{"version":3,"names":[],"mappings":"","sources":["app.js"],"sourcesContent":["(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c=\"function\"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error(\"Cannot find module '\"+i+\"'\");throw a.code=\"MODULE_NOT_FOUND\",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u=\"function\"==typeof require&&require,i=0;i 0) {\n\t\treturn \"Replenishment\";\n\t} else {\n\t\treturn \"Regular\";\n\t}\n}\n\nfunction getPageSubcategory() {\n\treturn window.pageContext.title || \"Content\";\n}\n\nfunction getLanguage() {\n\tif (window.User.locale.indexOf(\"en\") >= 0) {\n\t\treturn \"English\";\n\t} else if (window.User.locale.indexOf(\"cn\") >= 0) {\n\t\treturn \"Chinese\";\n\t} else if (window.User.locale.indexOf(\"es\") >= 0) {\n\t\treturn \"Spanish\";\n\t} else {\n\t\treturn window.User.locale;\n\t}\n}\n\n// page-specific: Cart, Checkout\nfunction getPageError() {\n\tvar $errorMsg = $(\".error-form\");\n\tif ($errorMsg.length === 0) {\n\t\treturn \"\";\n\t}\n\n\treturn $errorMsg.html().trim();\n}\n\nfunction getActiveSortingRule() {\n\tvar httpParams = util.getQueryStringParams(window.location.href);\n\tvar sortParam = httpParams[\"srule\"];\n\n\tif (!sortParam) {\n\t\treturn null;\n\t}\n\n\treturn sortParam.split(\"-\").map(function (w) {\n\t\treturn w[0].toUpperCase() + w.substr(1);\n\t}).join(\" \");\n}\n\nfunction pushToDataLayer(o) {\n\twindow.dataLayer = window.dataLayer || [];\n\t// window.dataLayer.push(util.filterObj(o));\n\twindow.dataLayer.push(o);\n\t//console.log(JSON.stringify(util.filterObj(o)));\n}\n\nfunction isScrolledIntoView(elem) {\n\tvar docViewTop = $(window).scrollTop();\n\tvar docViewBottom = docViewTop + $(window).height() - 150;\n\tvar elemTop = $(elem).offset().top;\n\treturn elemTop <= docViewBottom && elemTop >= docViewTop;\n}\n\nfunction getpage() {\n\tvar url = window.location.href;\n\tvar splittedurl = url.split(\"?\");\n\tvar page = splittedurl[0].split(\"/\");\n\treturn page[page.length - 1];\n}\n//page-specific: PLP\nfunction getRefinementsFromURL() {\n\tvar str = \"\";\n\tif (window.location.href.split(\"?\").length > 1) {\n\t\tvar urlparam;\n\t\tif (window.location.href.split(\"?\")[1].indexOf(\"&\") > -1) {\n\t\t\turlparam = window.location.href.split(\"?\")[1].split(\"&\");\n\t\t\tvar length = urlparam.length;\n\t\t\tvar prefnval, prefnkey, prefvval, prefvkey;\n\t\t\tfor (var i = 0; i < length; i++) {\n\t\t\t\tvar prefn = urlparam[i].indexOf(\"prefn\");\n\t\t\t\tif (prefn > -1) {\n\t\t\t\t\tprefnkey = urlparam[i].split(\"=\")[0];\n\t\t\t\t\tprefnval = urlparam[i].split(\"=\")[1];\n\t\t\t\t\tconsole.log(prefnkey);\n\t\t\t\t\tvar num = prefnkey.charAt(5);\n\t\t\t\t\tfor (var a = 0; a < length; a++) {\n\t\t\t\t\t\tvar prefv = urlparam[a].indexOf(\"prefv\");\n\t\t\t\t\t\tprefvkey = urlparam[a].split(\"=\")[0];\n\t\t\t\t\t\tif (prefvkey == \"prefv\" + num) {\n\t\t\t\t\t\t\tprefvval = urlparam[a].split(\"=\")[1];\n\t\t\t\t\t\t\tstr += \"[\" + prefnval + \":\" + prefvval + \"]\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn str;\n}\n\nfunction getProductType() {\n\treturn 'Product';\n}\n\nfunction trackConsultationEvent(data) {\n\tvar TOOL_TYPES = {\n\t\t\"skincareConsultation\": \"Skincare Consultation\"\n\t};\n\n\tpushToDataLayer({\n\t\t\"event\": \"consultation\" + data.element[0].toUpperCase() + data.element.substr(1),\n\t\t\"pageCategory\": \"Consultation Tool\",\n\t\t\"consultationToolType\": TOOL_TYPES[data.toolname] || data.toolname,\n\t\t\"consultationQuestion\": data.question,\n\t\t\"consultationResponse\": data.answers[0]\n\t});\n}\n\nfunction trackConsultationPageview(data) {\n\tpushToDataLayer({\n\t\t\"event\": \"consultationSteps\",\n\t\t\"pageCategory\": \"Consultation Tool\",\n\t\t\"consultationToolType\": data.toolname,\n\t\t\"consultationStep\": data.pagename\n\t});\n}\n\nfunction trackInternalPromotionEvent(data) {\n\n\tvar promotionURL = data.pageName;\n\n\tpushToDataLayer({\n\t\t\"event\": \"eePromoClick\",\n\t\t\"pageSubCategory\": data.pageSubCategory,\n\t\t\"pageCategory\": data.pageCategory,\n\t\t'promotions': [{\n\t\t\t\"position\": data.position,\n\t\t\t\"id\": data.id,\n\t\t\t\"creative\": data.creative,\n\t\t\t\"name\": data.name\n\t\t}]\n\t}), function () {\n\t\tsetTimeout(function () {\n\t\t\tif (promotionURL != undefined) {\n\t\t\t\tdocument.location = promotionURL;\n\t\t\t}\n\t\t}, 1000);\n\t}();\n}\n\nfunction trackInternalPromotionPageView(data) {\n\tpushToDataLayer({\n\t\t\"eeAction\": \"eePromoView\",\n\t\t\"event\": \"eePromoView\",\n\t\t\"pageSubCategory\": data.pageSubCategory,\n\t\t\"pageCategory\": data.pageCategory,\n\t\t'promotions': [{\n\t\t\t\"position\": data.position,\n\t\t\t\"id\": data.id,\n\t\t\t\"creative\": data.creative,\n\t\t\t\"name\": data.name\n\t\t}]\n\t});\n}\n\nfunction initializeGlobalEvents() {\n\tvar gtmNavData = \"\";\n\n\t$(document)\n\n\t// add to wishlist in pdp and quickview\n\t.on('click', \"#save-for-later\", function (e) {\n\t\tvar data = $(this).data(\"catid\");\n\t\tvar productCategory = data.length > 0 ? data[0] : '';\n\t\tvar productSubCategory = data.length > 1 ? data[1] : '';\n\t\tpushToDataLayer({\n\t\t\t\"event\": \"clickSaveForLater\",\n\t\t\t\"productCategory\": productCategory,\n\t\t\t\"productSubCategory\": productSubCategory,\n\t\t\t\"productName\": getProductName(),\n\t\t\t\"productId\": getProductID(),\n\t\t\t\"pageCategory\": getPageCategory(),\n\t\t\t\"productOutOfStock\": $(this).data(\"instock\"),\n\t\t\t\"productAutoReplen\": $(this).data(\"replenishable\"),\n\t\t\t\"productColor\": $(\".cpb-products-color_list .c-list-color-panel.is-current\").length > 0 ? $(\".cpb-products-color_list .c-list-color-panel.is-current\").data('description') : null,\n\t\t\t\"collectionName\": productCategory.toLowerCase().search('synactif') > -1 ? \"Synactif\" : null,\n\t\t\t\"productType\": \"Product\"\n\t\t});\n\t})\n\n\t// add to wishlist in cart\n\t.on('click', \".add-to-wishlist\", function (e) {\n\t\tvar index = $(this).parents(\".cpb-cart-bag_box\").index();\n\t\tpushToDataLayer({\n\t\t\t\"event\": \"clickSaveForLater\",\n\t\t\t\"productCategory\": basketConfirmation.productLineItems[index].category,\n\t\t\t\"productSubCategory\": basketConfirmation.productLineItems[index].subCategory,\n\t\t\t\"productName\": basketConfirmation.productLineItems[index].name,\n\t\t\t\"productId\": basketConfirmation.productLineItems[index].id,\n\t\t\t\"pageCategory\": getPageCategory(),\n\t\t\t\"productOutOfStock\": $(this).data(\"instock\"),\n\t\t\t\"productAutoReplen\": $(this).data(\"replenishable\"),\n\t\t\t\"productColor\": $(this).parents('.cpb-cart-bag_box').first().find(\".item-detail .color+dd\").length > 0 ? $(this).parents('.cpb-cart-bag_box').first().find(\".item-detail .color+dd\").text().trim() : null,\n\t\t\t\"collectionName\": basketConfirmation.productLineItems[index].category.toLowerCase().search('synactif') > -1 ? \"Synactif\" : null,\n\t\t\t\"productType\": \"Product\"\n\t\t});\n\t})\n\n\t// remove to wishlist PDP\n\t.on('click', \".remove-from-wishlist\", function (e) {\n\t\tvar data = $(this).data(\"catid\");\n\t\tvar productCategory = data.length > 0 ? data[0] : '';\n\t\tvar productSubCategory = data.length > 1 ? data[1] : '';\n\t\tpushToDataLayer({\n\t\t\t\"event\": \"removeFromWishlist\",\n\t\t\t\"productCategory\": productCategory,\n\t\t\t\"productSubCategory\": productSubCategory,\n\t\t\t\"productName\": getProductName(),\n\t\t\t\"productId\": getProductID(),\n\t\t\t\"pageCategory\": getPageCategory(),\n\t\t\t\"productOutOfStock\": $(this).data(\"instock\"),\n\t\t\t\"productAutoReplen\": $(this).data(\"replenishable\"),\n\t\t\t\"productColor\": $(\".cpb-products-color_list .c-list-color-panel.is-current\").length > 0 ? $(\".cpb-products-color_list .c-list-color-panel.is-current\").data('description') : null,\n\t\t\t\"collectionName\": productCategory.toLowerCase().search('synactif') > -1 ? \"Synactif\" : null,\n\t\t\t\"productType\": \"Product\"\n\t\t});\n\t})\n\n\t// remove to wishlist from my account\n\t.on('click', \".c-list-products-full-item .delete-item\", function (e) {\n\t\tvar $target = $(this).parents('.c-list-products-full-item-text').find('button[id^=\"delete-item\"]');\n\t\tvar data = $target.data(\"catid\");\n\t\tvar productCategory = data.length > 0 ? data[0] : '';\n\t\tvar productSubCategory = data.length > 1 ? data[1] : '';\n\t\tpushToDataLayer({\n\t\t\t\"event\": \"removeFromWishlist\",\n\t\t\t\"productCategory\": productCategory,\n\t\t\t\"productSubCategory\": productSubCategory,\n\t\t\t\"productName\": $target.data(\"productname\"),\n\t\t\t\"productId\": $target.data(\"productid\"),\n\t\t\t\"pageCategory\": getPageCategory(),\n\t\t\t\"productOutOfStock\": $target.data(\"instock\"),\n\t\t\t\"productAutoReplen\": $target.data(\"replenishable\"),\n\t\t\t\"productColor\": $(\".c-list-color .c-list-color-panel.is-current\").length > 0 ? $(\".c-list-color .c-list-color-panel.is-current\").data('description') : null,\n\t\t\t\"collectionName\": productCategory.toLowerCase().search('synactif') > -1 ? \"Synactif\" : null,\n\t\t\t\"productType\": \"Product\"\n\t\t});\n\t})\n\n\t// newsletter in navigation;\n\t.on(\"clicknewsletter\", function (e, data) {\n\t\tpushToDataLayer({\n\t\t\t\"event\": \"newsletterSubscription\",\n\t\t\t\"siteLocation\": data.siteloc\n\t\t});\n\t})\n\n\t// click ask question in pdp\n\t.on(\"click\", \".bv-ask-question\", function (e) {\n\t\tpushToDataLayer({\n\t\t\tpage: getpage(),\n\t\t\t\"event\": \"askQuestion\",\n\t\t\tproductCategory: getProductCategory(),\n\t\t\tpageSubCategory: \"Ask a Question\",\n\t\t\tproductName: getProductName(),\n\t\t\tpageCategory: \"Product Page\"\n\t\t});\n\t})\n\n\t// Scroll on reviews in pdp\n\t.scroll(function () {\n\t\tif ($(\".bv-section-summary\").length) {\n\t\t\tif (isScrolledIntoView(\".bv-section-summary\") && unbind < 1) {\n\t\t\t\tunbind = 1;\n\t\t\t\tpushToDataLayer({\n\t\t\t\t\tevent: \"productReviewsView\",\n\t\t\t\t\tpage: getpage(),\n\t\t\t\t\tpageCategory: \"Product Page\",\n\t\t\t\t\tproductColor: window.productCache.productColor,\n\t\t\t\t\tproductType: \"Product\",\n\t\t\t\t\tcollectionName: window.productCache.catid && window.productCache.catid.toLowerCase().search('synactif') > -1 ? \"Synactif\" : null\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\t// for recommendation in pdp and cart, Best Seller and Recently Viewed in Homepage\n\t\tif ($(\".pi .carousel-recommendations\").length > 0 || $(\".cross-sell .carousel-recommendations\").length > 0) {\n\t\t\tif (isScrolledIntoView(\".carousel-recommendations\") && unbindcarousel < 1) {\n\t\t\t\tunbindcarousel = 1;\n\t\t\t\tpushToDataLayer({\n\t\t\t\t\t\"currencyCode\": window.User.currencyCode,\n\t\t\t\t\t\"eeAction\": \"eeListView\",\n\t\t\t\t\t\"event\": \"eeListView\",\n\t\t\t\t\t\"pageCategory\": getPageCategory(),\n\t\t\t\t\t\"products\": window.forpageload.product });\n\t\t\t}\n\t\t}\n\t})\n\n\t// Click on Reviews in PDP\n\t.on(\"click\", \".bv-inline-histogram-ratings-star-container\", function () {\n\t\tpushToDataLayer({\n\t\t\tevent: \"productReviewsView\",\n\t\t\tpage: getpage(),\n\t\t\tpageCategory: \"Product Page\",\n\t\t\tproductColor: window.productCache.productColor,\n\t\t\tproductType: \"Product\",\n\t\t\tcollectionName: window.productCache.catid && window.productCache.catid.toLowerCase().search('synactif') > -1 ? \"Synactif\" : null\n\t\t});\n\t})\n\n\t// Check balance giftcard in gift card page\n\t.on('click', \"#CheckBalanceButton\", function () {\n\t\tif ($(\"#dwfrm_giftcert_balance_giftCertID\").val() != \"\" && $(\"#dwfrm_giftcert_balance_giftCertPIN\").val() != \"\") {\n\t\t\tpushToDataLayer({\n\t\t\t\t\"event\": \"checkBalance\",\n\t\t\t\t\"giftCardNumber\": $(\"#dwfrm_giftcert_balance_giftCertID\").val()\n\t\t\t\t//\t\t\t\t\t\"pageSubCategory\": \"Gift Card\",\n\t\t\t\t//\t\t\t\t\t\"pageCategory\": \"My Account\"\n\t\t\t});\n\t\t}\n\t})\n\n\t// Check balance giftcard in checkout modal\n\t.on('click', \"#check-giftcert-modal\", function (e) {\n\t\tif ($(\"#giftcardbalancemodal #dwfrm_billing_giftCertCode\").val() != \"\" && $(\"#giftcardbalancemodal #dwfrm_giftcert_balance_giftCertPIN\").val() != \"\") {\n\t\t\tpushToDataLayer({\n\t\t\t\t\"event\": \"checkBalance\",\n\t\t\t\t\"giftCardNumber\": $(\"#giftcardbalancemodal #dwfrm_billing_giftCertCode\").val()\n\t\t\t\t//\t\t\t\t\t\"pageSubCategory\": \"Payment\",\n\t\t\t\t//\t\t\t\t\t\"pageCategory\": \"Checkout\"\n\t\t\t});\n\t\t}\n\t})\n\n\t// Redeem gift card in checkout page\n\t.on('click', '.pt_checkout #add-giftcert', function () {\n\t\tif ($(\".gift-card-form #dwfrm_billing_giftCertCode\").val() != \"\" && $(\".gift-card-form #dwfrm_giftcert_balance_giftCertPIN\").val() != \"\") {\n\t\t\tpushToDataLayer({\n\t\t\t\t\"event\": \"redeemGiftCard\",\n\t\t\t\t\"giftCardNumber\": $(\".gift-card-form #dwfrm_billing_giftCertCode\").val()\n\t\t\t});\n\t\t}\n\t})\n\n\t// Redeem gift card in checkout modal\n\t.on('click', '#add-giftcert-modal', function () {\n\t\tif ($(\"#giftcardbalancemodal #dwfrm_billing_giftCertCode\").val() != \"\" && $(\"#giftcardbalancemodal #dwfrm_giftcert_balance_giftCertPIN\").val() != \"\") {\n\t\t\tpushToDataLayer({\n\t\t\t\t\"event\": \"redeemGiftCard\",\n\t\t\t\t\"giftCardNumber\": $(\"#giftcardbalancemodal #dwfrm_billing_giftCertCode\").val()\n\t\t\t});\n\t\t}\n\t})\n\n\t// add to cart from PDP\n\t.on('click', '#add-to-cart, .cpb-products-cart_fixed .cpb-products-cart_submit button', function (e) {\n\t\tif (getPageCategory() == \"Cart Page\") {\n\t\t\tif (sessionStorage.getItem(\"cartupdate\")) {\n\t\t\t\tsessionStorage.setItem(\"productUpdate\", \"1\");\n\t\t\t}\n\t\t} else {\n\t\t\twindow.productCache = window.productCache || {};\n\t\t\tpushToDataLayer({\n\t\t\t\t\"event\": \"addToCart\",\n\t\t\t\t//\"productOrderType\": getProductOrederType(),\n\t\t\t\t\"currencyCode\": window.Resources.CURRENCY,\n\t\t\t\t\"addToCartType\": $(this).parents('.quick-view').length ? \"Quick Shop\" : \"Product Page\",\n\t\t\t\t//\"pageCategory\": getPageCategory(),\n\t\t\t\t'products': [{\n\t\t\t\t\t\"name\": getProductName(),\n\t\t\t\t\t\"id\": getProductID(),\n\t\t\t\t\t\"price\": Number($(\"#add-to-cart\").data(\"price\")),\n\t\t\t\t\t\"brand\": getProductBrand(),\n\t\t\t\t\t\"category\": window.productCache.category,\n\t\t\t\t\t\"variant\": $(\".cpb-products-size_list input[type='radio']:checked+.label span\").text().trim(),\n\t\t\t\t\t\"quantity\": '1',\n\t\t\t\t\t\"productAutoReplen\": $(\"#add-to-cart\").data(\"replenishable\"),\n\t\t\t\t\t\"productColor\": $(\".cpb-products-color_list .c-list-color-panel.is-current\").data('description'),\n\t\t\t\t\t\"productOutOfStock\": $(\"#add-to-cart\").data(\"instock\"),\n\t\t\t\t\t\"collectionName\": window.productCache.catid && window.productCache.catid.toLowerCase().search('synactif') > -1 ? \"Synactif\" : null,\n\t\t\t\t\t\"productType\": \"Product\",\n\t\t\t\t\t\"productStarRating\": \"\",\n\t\t\t\t\t\"productVariantID\": $(\".cpb-products-size_list input[type='radio']:checked+.label span\").text().trim() != '' && $(\".cpb-products-color_list .c-list-color-panel.is-current\").data('description') != '' ? getProductID() : null,\n\t\t\t\t\t\"numberOfProductReview\": \"\"\n\t\t\t\t\t//\"subCategory\" : window.productCache.subcategory,\n\t\t\t\t\t//\"subSubCategory\" : window.productCache.subsubcategory,\n\t\t\t\t\t//\"productNumReviews\":\"\",\n\t\t\t\t}]\n\t\t\t});\n\t\t}\n\t})\n\n\t//Click at '+' on cart page\n\t.on('click', '.cpb-cart-bag_box .js-num-drop_up', function () {\n\t\tsessionStorage.setItem(\"productUpdate\", \"1\");\n\t\tvar index = $(this).parents(\".cpb-cart-bag_box\").index();\n\t\tvar product = basketConfirmation.productLineItems[index];\n\n\t\tpushToDataLayer({\n\t\t\t\"event\": \"addToCart\",\n\t\t\t\"addToCartType\": 'Cart Page',\n\t\t\t\"currencyCode\": basketConfirmation.currencyCode,\n\t\t\t'products': [{\n\t\t\t\t\"name\": product.name,\n\t\t\t\t\"id\": product.id,\n\t\t\t\t\"price\": product.price,\n\t\t\t\t\"brand\": product.brand,\n\t\t\t\t\"category\": product.category,\n\t\t\t\t\"variant\": product.size,\n\t\t\t\t\"quantity\": 1,\n\t\t\t\t\"productAutoReplen\": product.productAutoReplen,\n\t\t\t\t\"productColor\": product.color,\n\t\t\t\t\"productOutOfStock\": product.productOutOfStock,\n\t\t\t\t\"collectionName\": product.collectionName,\n\t\t\t\t\"productType\": product.productType,\n\t\t\t\t\"productStarRating\": product.productStarRating,\n\t\t\t\t\"productVariantID\": product.productVariantID,\n\t\t\t\t\"numberOfProductReview\": product.numberOfProductReview\n\t\t\t}]\n\t\t});\n\t})\n\n\t// click at '+' on minicart\n\t.on('click', '.cpb-products_list_box .js-num-drop_up', function () {\n\t\tsessionStorage.setItem(\"productUpdate\", \"1\");\n\t\tvar index = $(this).parents(\".cpb-products_list_box\").index();\n\t\tvar product = basketConfirmation.productLineItems[index];\n\n\t\tpushToDataLayer({\n\t\t\t\"event\": \"addToCart\",\n\t\t\t\"addToCartType\": 'Cart Page',\n\t\t\t\"currencyCode\": basketConfirmation.currencyCode,\n\t\t\t'products': [{\n\t\t\t\t\"name\": product.name,\n\t\t\t\t\"id\": product.id,\n\t\t\t\t\"price\": product.price,\n\t\t\t\t\"brand\": product.brand,\n\t\t\t\t\"category\": product.category,\n\t\t\t\t\"variant\": product.size,\n\t\t\t\t\"quantity\": 1,\n\t\t\t\t\"productAutoReplen\": product.productAutoReplen,\n\t\t\t\t\"productColor\": product.color,\n\t\t\t\t\"productOutOfStock\": product.productOutOfStock,\n\t\t\t\t\"collectionName\": product.collectionName,\n\t\t\t\t\"productType\": product.productType,\n\t\t\t\t\"productStarRating\": product.productStarRating,\n\t\t\t\t\"productVariantID\": product.productVariantID,\n\t\t\t\t\"numberOfProductReview\": product.numberOfProductReview\n\t\t\t}]\n\t\t});\n\t})\n\n\t//Click at '-' on cart page\n\t.on('click', '.cpb-cart-bag_box .js-num-drop_down', function () {\n\t\tsessionStorage.setItem(\"productUpdate\", \"1\");\n\t\tvar index = $(this).parents(\".cpb-cart-bag_box\").index();\n\t\tvar product = basketConfirmation.productLineItems[index];\n\t\tif (product.quantity > 1) {\n\t\t\tpushToDataLayer({\n\t\t\t\t\"event\": \"removeFromCart\",\n\t\t\t\t\"addToCartType\": 'Cart Page',\n\t\t\t\t\"currencyCode\": basketConfirmation.currencyCode,\n\t\t\t\t'products': [{\n\t\t\t\t\t\"name\": product.name,\n\t\t\t\t\t\"id\": product.id,\n\t\t\t\t\t\"price\": product.price,\n\t\t\t\t\t\"brand\": product.brand,\n\t\t\t\t\t\"category\": product.category,\n\t\t\t\t\t\"variant\": product.size,\n\t\t\t\t\t\"quantity\": 1,\n\t\t\t\t\t\"productAutoReplen\": product.productAutoReplen,\n\t\t\t\t\t\"productColor\": product.color,\n\t\t\t\t\t\"productOutOfStock\": product.productOutOfStock,\n\t\t\t\t\t\"collectionName\": product.collectionName,\n\t\t\t\t\t\"productType\": product.productType,\n\t\t\t\t\t\"productStarRating\": product.productStarRating,\n\t\t\t\t\t\"productVariantID\": product.productVariantID,\n\t\t\t\t\t\"numberOfProductReview\": product.numberOfProductReview\n\t\t\t\t}]\n\t\t\t});\n\t\t}\n\t})\n\n\t//Click at '-' on minicart\n\t.on('click', '.cpb-products_list_box .js-num-drop_down', function () {\n\t\tsessionStorage.setItem(\"productUpdate\", \"1\");\n\t\tvar index = $(this).parents(\".cpb-products_list_box\").index();\n\t\tvar product = basketConfirmation.productLineItems[index];\n\t\tif (product.quantity > 1) {\n\t\t\tpushToDataLayer({\n\t\t\t\t\"event\": \"removeFromCart\",\n\t\t\t\t\"addToCartType\": 'Cart Page',\n\t\t\t\t\"currencyCode\": basketConfirmation.currencyCode,\n\t\t\t\t'products': [{\n\t\t\t\t\t\"name\": product.name,\n\t\t\t\t\t\"id\": product.id,\n\t\t\t\t\t\"price\": product.price,\n\t\t\t\t\t\"brand\": product.brand,\n\t\t\t\t\t\"category\": product.category,\n\t\t\t\t\t\"variant\": product.size,\n\t\t\t\t\t\"quantity\": 1,\n\t\t\t\t\t\"productAutoReplen\": product.productAutoReplen,\n\t\t\t\t\t\"productColor\": product.color,\n\t\t\t\t\t\"productOutOfStock\": product.productOutOfStock,\n\t\t\t\t\t\"collectionName\": product.collectionName,\n\t\t\t\t\t\"productType\": product.productType,\n\t\t\t\t\t\"productStarRating\": product.productStarRating,\n\t\t\t\t\t\"productVariantID\": product.productVariantID,\n\t\t\t\t\t\"numberOfProductReview\": product.numberOfProductReview\n\t\t\t\t}]\n\t\t\t});\n\t\t}\n\t})\n\n\t//Click change quantity on cart page\n\t.on('click', '.cpb-cart-bag_box .cmd-num_list .js-num-drop_select a', function () {\n\t\tsessionStorage.setItem(\"productUpdate\", \"1\");\n\t\tvar index = $(this).parents(\".cpb-cart-bag_box\").index();\n\t\tvar product = basketConfirmation.productLineItems[index];\n\t\tif ($(this).text() != '') {\n\t\t\tpushToDataLayer({\n\t\t\t\t\"event\": Number($(this).text().trim()) - product.quantity > 0 ? \"addToCart\" : \"removeFromCart\",\n\t\t\t\t\"addToCartType\": 'Cart Page',\n\t\t\t\t\"currencyCode\": basketConfirmation.currencyCode,\n\t\t\t\t'products': [{\n\t\t\t\t\t\"name\": product.name,\n\t\t\t\t\t\"id\": product.id,\n\t\t\t\t\t\"price\": product.price,\n\t\t\t\t\t\"brand\": product.brand,\n\t\t\t\t\t\"category\": product.category,\n\t\t\t\t\t\"variant\": product.size,\n\t\t\t\t\t\"quantity\": Math.abs(Number($(this).text().trim()) - product.quantity),\n\t\t\t\t\t\"productAutoReplen\": product.productAutoReplen,\n\t\t\t\t\t\"productColor\": product.color,\n\t\t\t\t\t\"productOutOfStock\": product.productOutOfStock,\n\t\t\t\t\t\"collectionName\": product.collectionName,\n\t\t\t\t\t\"productType\": product.productType,\n\t\t\t\t\t\"productStarRating\": product.productStarRating,\n\t\t\t\t\t\"productVariantID\": product.productVariantID,\n\t\t\t\t\t\"numberOfProductReview\": product.numberOfProductReview\n\t\t\t\t}]\n\t\t\t});\n\t\t}\n\t})\n\n\t//Click change quantity on minicart\n\t.on('click', '.cpb-products_list_box .cmd-num_list .js-num-drop_select a', function () {\n\t\tsessionStorage.setItem(\"productUpdate\", \"1\");\n\t\tvar index = $(this).parents(\".cpb-products_list_box\").index();\n\t\tvar product = basketConfirmation.productLineItems[index];\n\t\tif ($(this).text() != '') {\n\t\t\tpushToDataLayer({\n\t\t\t\t\"event\": Number($(this).text().trim()) - product.quantity > 0 ? \"addToCart\" : \"removeFromCart\",\n\t\t\t\t\"addToCartType\": 'Cart Page',\n\t\t\t\t\"currencyCode\": basketConfirmation.currencyCode,\n\t\t\t\t'products': [{\n\t\t\t\t\t\"name\": product.name,\n\t\t\t\t\t\"id\": product.id,\n\t\t\t\t\t\"price\": product.price,\n\t\t\t\t\t\"brand\": product.brand,\n\t\t\t\t\t\"category\": product.category,\n\t\t\t\t\t\"variant\": product.size,\n\t\t\t\t\t\"quantity\": Math.abs(Number($(this).text().trim()) - product.quantity),\n\t\t\t\t\t\"productAutoReplen\": product.productAutoReplen,\n\t\t\t\t\t\"productColor\": product.color,\n\t\t\t\t\t\"productOutOfStock\": product.productOutOfStock,\n\t\t\t\t\t\"collectionName\": product.collectionName,\n\t\t\t\t\t\"productType\": product.productType,\n\t\t\t\t\t\"productStarRating\": product.productStarRating,\n\t\t\t\t\t\"productVariantID\": product.productVariantID,\n\t\t\t\t\t\"numberOfProductReview\": product.numberOfProductReview\n\t\t\t\t}]\n\t\t\t});\n\t\t}\n\t})\n\n\t// Submit ask a question\n\t.on('click', \".bv-submission-section button:contains('Post Question')\", function (e) {\n\t\tpushToDataLayer({\n\t\t\t//\"page\": getpage(),\n\t\t\t\"event\": \"submitQuestion\",\n\t\t\t//\"productCategory\": getProductCategory(),\n\t\t\t\"question\": $(\"#bv-textarea-field-questionsummary\").val(),\n\t\t\t//\"productName\": getProductName(),\n\t\t\t//\"pageSubCategory\": \"Ask a Question\",\n\t\t\t\"pageCategory\": getPageCategory()\n\t\t});\n\t})\n\n\t// remove from cart\n\t.on('click', \".cpb-cart-bag_box .item-remove\", function (e) {\n\t\tvar index = $(this).parents(\".cpb-cart-bag_box\").index();\n\t\tpushToDataLayer({\n\t\t\t\"event\": \"removeFromCart\",\n\t\t\t\"currencyCode\": window.Resources.CURRENCY,\n\t\t\t\"addToCartType\": getPageCategory(),\n\t\t\t//\"productOrderType\": ($(this).parents(\".cart-row\").find(\".replenishment .replenishmentDays\").length > 0) ? \"Replenishment\" : \"Regular\",\n\t\t\t//\"pageCategory\": getPageCategory(),\n\t\t\t'products': [{\n\t\t\t\t\"name\": basketConfirmation.productLineItems[index].name,\n\t\t\t\t\"id\": basketConfirmation.productLineItems[index].id,\n\t\t\t\t\"price\": basketConfirmation.productLineItems[index].price,\n\t\t\t\t\"brand\": getProductBrand(),\n\t\t\t\t\"category\": basketConfirmation.productLineItems[index].category,\n\t\t\t\t\"variant\": basketConfirmation.productLineItems[index].size,\n\t\t\t\t\"quantity\": basketConfirmation.productLineItems[index].quantity,\n\t\t\t\t\"productAutoReplen\": basketConfirmation.productLineItems[index].productAutoReplen,\n\t\t\t\t\"productColor\": basketConfirmation.productLineItems[index].productColor,\n\t\t\t\t\"productType\": basketConfirmation.productLineItems[index].productType,\n\t\t\t\t\"productOutOfStock\": basketConfirmation.productLineItems[index].productAutoReplen.productOutOfStock,\n\t\t\t\t\"collectionName\": basketConfirmation.productLineItems[index].category == \"Synactif\" ? \"Synactif\" : null,\n\t\t\t\t\"productStarRating\": \"\",\n\t\t\t\t\"productVariantID\": \"\",\n\t\t\t\t\"numberOfProductReview\": basketConfirmation.productLineItems[index].size != '' && basketConfirmation.productLineItems[index].productColor != '' ? basketConfirmation.productLineItems[index].id : null\n\t\t\t}]\n\t\t});\n\t})\n\t// click zoom in pdp\n\t.on('click', \".c-block-shopingmodal-main-image .c-modal-img\", function (e) {\n\t\tpushToDataLayer({\n\t\t\t\"event\": \"productInteraction\",\n\t\t\t\"interactionType\": \"Zoom\",\n\t\t\t\"productCategory\": getProductCategory(),\n\t\t\t\"productSubCategory\": getProductsubCategory(),\n\t\t\t\"productName\": getProductName(),\n\t\t\t\"productId\": getProductID(),\n\t\t\t\"pageCategory\": getPageCategory(),\n\t\t\t\"productOutOfStock\": window.productCache.productOutOfStock,\n\t\t\t\"productAutoReplen\": window.productCache.productautoreplenish,\n\t\t\t\"productColor\": window.productCache.productColor,\n\t\t\t\"collectionName\": window.productCache.catid && window.productCache.catid.toLowerCase().search('synactif') > -1 ? \"Synactif\" : null,\n\t\t\t\"productType\": window.productCache.master ? \"master\" : window.productCache.variant ? \"variant\" : window.productCache.bundle ? \"bundle\" : window.productCache.productSet ? \"productSet\" : \"product\"\n\t\t});\n\t})\n\n\t// click full ingredients in pdp\n\t.on('click', \".cpb-products-summary_contents .cpb-products_article a[data-tab-contents='content4'], .cpb-products-summary_tab_list li a[data-tab-target='content4']\", function (e) {\n\t\tpushToDataLayer({\n\t\t\t\"event\": \"productInteraction\",\n\t\t\t\"interactionType\": \"View Full Product Ingredients\",\n\t\t\t\"productCategory\": getProductCategory(),\n\t\t\t\"productSubCategory\": getProductsubCategory(),\n\t\t\t\"productName\": getProductName(),\n\t\t\t\"productId\": getProductID(),\n\t\t\t\"pageCategory\": getPageCategory(),\n\t\t\t\"productOutOfStock\": window.productCache.productOutOfStock,\n\t\t\t\"productAutoReplen\": window.productCache.productautoreplenish,\n\t\t\t\"productColor\": window.productCache.productColor,\n\t\t\t\"collectionName\": window.productCache.catid && window.productCache.catid.toLowerCase().search('synactif') > -1 ? \"Synactif\" : null,\n\t\t\t\"productType\": window.productCache.master ? \"master\" : window.productCache.variant ? \"variant\" : window.productCache.bundle ? \"bundle\" : window.productCache.productSet ? \"productSet\" : \"product\"\n\t\t});\n\t}).on(\"click\", \".cart-promo-approaching\", function () {\n\t\tpushToDataLayer({\n\t\t\t\"event\": \"eePromoClick\",\n\t\t\t\"pageSubCategory\": \"Internal marketing\",\n\t\t\t\"pageCategory\": \"Cart Page\",\n\t\t\t'promotions': [{\n\t\t\t\t\"position\": \"Cart\",\n\t\t\t\t\"id\": $(\".cart-promo-approaching\").data(\"promoid\"),\n\t\t\t\t\"creative\": \"Cart-Banner\",\n\t\t\t\t\"name\": $(\".cart-promo-approaching\").data(\"promoname\")\n\t\t\t}]\n\t\t});\n\t}).on(\"click\", \".input-code_box #add-coupon\", function () {\n\t\tlocalStorage.removeItem('couponvalidation');\n\t})\n\n\t// track share button on PDP\n\t.on(\"click\", \".item-link_sns_box .item-link_sns_list li a\", function () {\n\t\tpushToDataLayer({\n\t\t\t\"socialAction\": \"Share\",\n\t\t\t\"event\": \"socialShare\",\n\t\t\t\"siteLocation\": \"product page\",\n\t\t\t\"pageCategory\": getPageCategory(),\n\t\t\t\"socialNetwork\": $(this).data(\"share\")\n\t\t});\n\t})\n\n\t// Track Follow button on Footer\n\t.on(\"click\", \".cpb-footer-sns_box .cpb-footer-sns_list li a\", function () {\n\t\tpushToDataLayer({\n\t\t\t\"event\": \"socialClick\",\n\t\t\t\"socialNetwork\": $(this).find('svg').attr('aria-label').length > 0 ? $(this).find('svg').attr('aria-label').trim() : null,\n\t\t\t\"socialAction\": \"Follow\",\n\t\t\t\"siteLocation\": \"footer\",\n\t\t\t\"pageCategory\": getPageCategory()\n\t\t});\n\t})\n\n\t// Add to Cart in Save for later\n\t.on(\"click\", \".wishlist-item .add-to-cart\", function () {\n\t\tvar index = $(this).parents('form').index();\n\t\tpushToDataLayer({\n\t\t\t\"currencyCode\": window.Resources.CURRENCY,\n\t\t\t\"event\": \"addToCart\",\n\t\t\t//\"productOrderType\": getProductOrederType(),\n\t\t\t\"addToCartType\": getPageCategory(),\n\t\t\t\"pageSubCategory\": getProductsubCategory(),\n\t\t\t\"pageCategory\": getPageCategory(),\n\t\t\t'products': [{\n\t\t\t\t\"id\": wishlistItem.product[index].id,\n\t\t\t\t\"category\": wishlistItem.product[index].category,\n\t\t\t\t\"price\": wishlistItem.product[index].price,\n\t\t\t\t\"name\": wishlistItem.product[index].name,\n\t\t\t\t\"brand\": wishlistItem.product[index].brand,\n\t\t\t\t\"quantity\": wishlistItem.product[index].quantity,\n\t\t\t\t\"size\": wishlistItem.product[index].size,\n\t\t\t\t\"subCategory\": wishlistItem.product[index].subcategory,\n\t\t\t\t\"subSubCategory\": wishlistItem.product[index].subcategory,\n\t\t\t\t\"productAutoReplen\": wishlistItem.product[index].productAutoReplen,\n\t\t\t\t\"productOutOfStock\": wishlistItem.product[index].productOutOfStock,\n\t\t\t\t\"productColor\": wishlistItem.product[index].color,\n\t\t\t\t\"productType\": \"Product\",\n\t\t\t\t\"productNumReviews\": \"\",\n\t\t\t\t\"productStarRating\": \"\" }]\n\t\t});\n\t})\n\n\t// Add to all to Cart\n\t.on(\"click\", \".add-all-to-cart\", function () {\n\t\tpushToDataLayer({\n\t\t\t\"currencyCode\": window.Resources.CURRENCY,\n\t\t\t\"event\": \"addToCart\",\n\t\t\t//\"productOrderType\": getProductOrederType(),\n\t\t\t\"addToCartType\": getPageCategory(),\n\t\t\t\"pageSubCategory\": getProductsubCategory(),\n\t\t\t\"pageCategory\": getPageCategory(),\n\t\t\t'products': wishlistItem.product\n\t\t});\n\t})\n\n\t// click email hyper link in navigation\n\t.on('click', '#header .emailcsr-nav', function () {\n\t\tif (window.Resources.PAGE_CATEGORY == \"page-show\") {\n\t\t\tpushToDataLayer({\n\t\t\t\t\"event\": \"contactRequest\",\n\t\t\t\t\"contactType\": \"Email\",\n\t\t\t\t\"siteLocation\": \"Header\",\n\t\t\t\t//\t\t\t\t\t\"pageSubCategory\": couponsubcategory(),\n\t\t\t\t\"pageCategory\": getProductCategory()\n\t\t\t});\n\t\t} else {\n\t\t\tpushToDataLayer({\n\t\t\t\t\"event\": \"contactRequest\",\n\t\t\t\t\"contactType\": \"Email\",\n\t\t\t\t\"siteLocation\": \"Header\",\n\t\t\t\t\"pageSubCategory\": window.Resources.PAGE_CATEGORY == \"cart-show\" ? \"\" : couponsubcategory(),\n\t\t\t\t\"pageCategory\": getPageCategory()\n\t\t\t});\n\t\t}\n\t})\n\t// Click email link in the customer care\n\t//\t\t.on(\"click\",\".content-asset a:contains('customercare@cledepeaubeaute.com')\",function(){\n\t//\t\t\tpushToDataLayer({\n\t//\t\t\t\t\"event\": \"contactRequest\",\n\t//\t\t\t\t\"contactType\": \"Email\",\n\t//\t\t\t\t\"siteLocation\": window.Resources.PAGE_CATEGORY==\"cart-show\" ? \"Right Nav\":\"Body\",\n\t////\t\t\t\t\"pageSubCategory\": couponsubcategory(),\n\t//\t\t\t\t\"pageCategory\": window.Resources.PAGE_CATEGORY==\"cart-show\" ? getPageCategory(): getProductCategory()\n\t//\t\t\t});\n\t//\t\t})\n\n\t.on(\"gtmcontactus\", function () {\n\t\tpushToDataLayer({\n\t\t\t\"event\": \"contactRequest\",\n\t\t\t\"contactType\": \"Contact Customer Care Submission\",\n\t\t\t\"siteLocation\": \"Body\",\n\t\t\t\"pageCategory\": getPageCategory()\n\t\t});\n\t}).on(\"askanexpert\", function () {\n\t\tpushToDataLayer({\n\t\t\t\"event\": \"contactRequest\",\n\t\t\t\"contactType\": \"Ask An Expert Submission\",\n\t\t\t\"siteLocation\": \"Body\",\n\t\t\t\"pageSubCategory\": couponsubcategory(),\n\t\t\t\"pageCategory\": \"Ask An Expert\"\n\t\t});\n\t}).on(\"click\", \"#header .live-chat\", function () {\n\t\tpushToDataLayer({\n\t\t\t\"event\": \"contactRequest\",\n\t\t\t\"contactType\": \"Live Chat\",\n\t\t\t\"siteLocation\": \"Header\",\n\t\t\t\"pageSubCategory\": couponsubcategory(),\n\t\t\t\"pageCategory\": getPageCategory()\n\t\t});\n\t}).on(\"click\", \"#header .call-us\", function () {\n\t\tpushToDataLayer({\n\t\t\t\"event\": \"contactRequest\",\n\t\t\t\"contactType\": \"Call Us\",\n\t\t\t\"siteLocation\": \"Header\",\n\t\t\t\"pageSubCategory\": couponsubcategory(),\n\t\t\t\"pageCategory\": getPageCategory()\n\t\t});\n\t}).on(\"click\", \".LPMimage\", function () {\n\t\tvar id = $(this).attr(\"id\");\n\t\tvar chk = id.charAt(id.length - 1);\n\t\tif (chk == 1) {\n\t\t\tpushToDataLayer({\n\t\t\t\t\"event\": \"contactRequest\",\n\t\t\t\t\"contactType\": \"Live Chat\",\n\t\t\t\t\"siteLocation\": \"Pop-up\",\n\t\t\t\t\"pageSubCategory\": couponsubcategory(),\n\t\t\t\t\"pageCategory\": getPageCategory()\n\t\t\t});\n\t\t}\n\t}).on(\"click\", \".footer-container .products ul li:nth-child(4)\", function () {\n\t\tpushToDataLayer({\n\t\t\t\"event\": \"contactRequest\",\n\t\t\t\"contactType\": \"Phone\",\n\t\t\t\"siteLocation\": \"Footer\",\n\t\t\t\"pageSubCategory\": window.Resources.PAGE_CATEGORY == \"cart-show\" ? \"\" : couponsubcategory(),\n\t\t\t\"pageCategory\": getPageCategory()\n\t\t});\n\t})\n\n\t// click on recommendation\n\t.on(\"click\", \".recommendation-item\", function () {\n\t\tif (getPageCategory() == \"Product Page\") {\n\t\t\tsessionStorage.setItem('listType', \"Recommended Product List\");\n\t\t\tsessionStorage.setItem('listName', \"Product Page\");\n\t\t} else if (getPageCategory() == \"Home Page\") {\n\t\t\tsessionStorage.setItem('listType', \"Recently Viewed List\");\n\t\t\tsessionStorage.setItem('listName', \"Home Page\");\n\t\t}\n\t}).on(\"click\", \".gnav-item_btn\", function (e) {\n\t\tgtmNavData = $(this).text().trim();\n\t\tsessionStorage.setItem(\"navlink\", gtmNavData);\n\t\tsessionStorage.setItem(\"menuloc\", \"topmenu\");\n\t\tutil.setCookie('navdata', gtmNavData, .20);\n\t}).on(\"click\", \".cpb-gnav_container.is-cpb .cpb-gnav_list:first li a\", function (e) {\n\t\tgtmNavData = $(this).text().trim();\n\t\tsessionStorage.setItem(\"navlink\", gtmNavData);\n\t\tsessionStorage.setItem(\"menuloc\", \"topmenu\");\n\t\tutil.setCookie('navdata', gtmNavData, .20);\n\t}).on(\"click\", \".refinement-header\", function (e) {\n\t\tgtmNavData = $(this).text().trim();\n\t\tsessionStorage.setItem(\"navlink\", gtmNavData);\n\t\tsessionStorage.setItem(\"menuloc\", \"leftmenu\");\n\t}).on(\"click\", \".refinement-link\", function (e) {\n\t\tgtmNavData = $(this).text().trim();\n\t\tsessionStorage.setItem(\"navlink\", gtmNavData);\n\t\tsessionStorage.setItem(\"menuloc\", \"leftmenu\");\n\t}).on(\"click\", \".cmd-breadcrumb_container .cmd-breadcrumb_list li\", function (e) {\n\t\tgtmNavData = $(this).text().trim();\n\t\tsessionStorage.setItem(\"breadcrumbs\", gtmNavData);\n\t\tsessionStorage.setItem(\"menuloc\", \"leftmenu\");\n\t}).on(\"change\", \"#quantity\", function (e) {\n\t\tif (getPageCategory() == \"Cart Page\") {\n\t\t\tif ($(\".edit-modal\").length > 0) {\n\t\t\t\tsessionStorage.setItem(\"cartupdate\", \"1\");\n\t\t\t} else {\n\t\t\t\tsessionStorage.setItem(\"productUpdate\", \"1\");\n\t\t\t}\n\t\t}\n\t}).on(\"change\", \".quantity-select\", function (e) {\n\t\tif (window.Resources.PAGE_CATEGORY == \"wishlist-show\") {\n\t\t\tsessionStorage.setItem(\"productUpdate\", \"1\");\n\t\t}\n\t}).on(\"click\", \".account-left-nav li\", function (e) {\n\t\tgtmNavData = $(this).text().trim();\n\t\tsessionStorage.setItem(\"navlink\", gtmNavData);\n\t\tsessionStorage.setItem(\"menuloc\", \"leftmenu\");\n\t})\n\n\t// Remove uservalidation attribute for userlogin validation and product update\n\t.on('click', \".user-logout\", function (e) {\n\t\tlocalStorage.removeItem('uservalidation');\n\t\tsessionStorage.removeItem('productUpdate');\n\t}).on(\"click\", \"#pdp-swatches.c-block-shopingmodal-side-color a, .c-block-shopingmodal-side-colorSelect .c-select-list-item\", function () {\n\t\tif (getPageCategory() == \"Cart Page\") {\n\t\t\tsessionStorage.setItem(\"cartupdate\", \"1\");\n\t\t}\n\t}).on(\"click\", \".mfp-close\", function () {\n\t\tif (getPageCategory() == \"Cart Page\") {\n\t\t\tsessionStorage.setItem(\"cartupdate\", \"\");\n\t\t}\n\t}).on(\"click\", \"#save-for-later\", function () {\n\t\tif (getPageCategory() == \"Cart Page\") {\n\t\t\tsessionStorage.setItem(\"cartupdate\", \"\");\n\t\t}\n\t}).on(\"click\", \"#pdp-swatches .selectable\", function () {\n\t\tif (getPageCategory() == \"Cart Page\") {\n\t\t\tif (!$(this).hasClass(\"selected\")) {\n\t\t\t\tsessionStorage.setItem(\"cartupdate\", \"1\");\n\t\t\t}\n\t\t}\n\t}).on(\"click\", \".search-suggestion-wrapper .hit\", function () {\n\t\tgtmNavData = $(this).text().trim();\n\t\tsessionStorage.setItem(\"navlink\", gtmNavData.replace(/\\s\\s+/g, ' '));\n\t\tsessionStorage.setItem(\"menuloc\", \"site search pop-in\");\n\t}).on(\"click\", \".search-suggestion-wrapper .product-suggestion\", function () {\n\t\tgtmNavData = $(this).text().trim();\n\t\tvar rep = gtmNavData.replace(/\\n/g, \" \");\n\t\tsessionStorage.setItem(\"navlink\", rep.replace(/ +/g, \" \"));\n\t\tsessionStorage.setItem(\"menuloc\", \"site search pop-in\");\n\t})\n\n\t// PLP click in list\n\t.on(\"click\", \".c-product-cards-list .c-product-cards-list-item a.c-product-cards-photo-img\", function () {\n\t\tvar index = $(this).parents(\".c-product-cards-list-item\").index(\".c-product-cards-list-item\");\n\t\tvar url = $(this).attr('href');\n\t\tif (index >= 0) {\n\t\t\tif (productData.page >= 1) {\n\t\t\t\tpushToDataLayer({\n\t\t\t\t\t\"event\": \"eeListClick\",\n\t\t\t\t\t\"eeAction\": \"eeListClick\",\n\t\t\t\t\t\"pageCategory\": searchItems.search ? \"Site Search\" : \"Product List Page\",\n\t\t\t\t\t\"nextPage\": url ? url : null,\n\t\t\t\t\t'products': [$.extend({}, prodholder[index], {\n\t\t\t\t\t\t\"productBrand\": getProductBrandForPlp(),\n\t\t\t\t\t\t\"category\": function () {\n\t\t\t\t\t\t\tif (_typeof(prodholder[index]) !== 'object') {\n\t\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tvar productCategory = prodholder[index].category != null ? prodholder[index].category : '';\n\t\t\t\t\t\t\tvar productSubCategory = prodholder[index].subCategory != null ? prodholder[index].subCategory : '';\n\t\t\t\t\t\t\tvar productSubSubCategory = prodholder[index].subSubCategory != null ? prodholder[index].subSubCategory : '';\n\t\t\t\t\t\t\treturn productCategory + '/' + productSubCategory + '/' + productSubSubCategory;\n\t\t\t\t\t\t}(),\n\t\t\t\t\t\t\"collectionName\": function () {\n\t\t\t\t\t\t\tif (_typeof(prodholder[index]) !== 'object' || prodholder[index].catid == null) {\n\t\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn prodholder[index].catid && prodholder[index].catid.toLowerCase().search('synactif') > -1 ? \"Synactif\" : null;\n\t\t\t\t\t\t}()\n\t\t\t\t\t})]\n\t\t\t\t}), function () {\n\t\t\t\t\tsetTimeout(function () {\n\t\t\t\t\t\tif (url != undefined && url != null) {\n\t\t\t\t\t\t\tdocument.location = url;\n\t\t\t\t\t\t}\n\t\t\t\t\t}, 1000);\n\t\t\t\t}();\n\t\t\t\tsessionStorage.setItem('listType', prodholder[index].listType);\n\t\t\t\tsessionStorage.setItem('listName', prodholder[index].listName);\n\t\t\t} else {\n\t\t\t\tpushToDataLayer({\n\t\t\t\t\t\"event\": \"eeListClick\",\n\t\t\t\t\t\"eeAction\": \"eeListClick\",\n\t\t\t\t\t\"pageCategory\": searchItems.search ? \"Site Search\" : \"Product List Page\",\n\t\t\t\t\t\"nextPage\": url ? url : null,\n\t\t\t\t\t'products': [Object.assign({}, prodholder[0][index], {\n\t\t\t\t\t\t\"productBrand\": getProductBrandForPlp(),\n\t\t\t\t\t\t\"category\": function () {\n\t\t\t\t\t\t\tif (_typeof(prodholder[0][index]) !== 'object') {\n\t\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tvar productCategory = prodholder[0][index].category != null ? prodholder[0][index].category : '';\n\t\t\t\t\t\t\tvar productSubCategory = prodholder[0][index].subCategory != null ? prodholder[0][index].subCategory : '';\n\t\t\t\t\t\t\tvar productSubSubCategory = prodholder[0][index].subSubCategory != null ? prodholder[0][index].subSubCategory : '';\n\t\t\t\t\t\t\treturn productCategory + '/' + productSubCategory + '/' + productSubSubCategory;\n\t\t\t\t\t\t}(),\n\t\t\t\t\t\t\"collectionName\": function () {\n\t\t\t\t\t\t\tif (_typeof(prodholder[0][index]) !== 'object' || prodholder[0][index].catid == null) {\n\t\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn prodholder[0][index].catid && prodholder[0][index].catid.toLowerCase().search('synactif') > -1 ? \"Synactif\" : null;\n\t\t\t\t\t\t}()\n\t\t\t\t\t})]\n\t\t\t\t}), function () {\n\t\t\t\t\tsetTimeout(function () {\n\t\t\t\t\t\tif (url != undefined && url != null) {\n\t\t\t\t\t\t\tdocument.location = url;\n\t\t\t\t\t\t}\n\t\t\t\t\t}, 1000);\n\t\t\t\t}();\n\t\t\t\tsessionStorage.setItem('listType', prodholder[0][index].listType);\n\t\t\t\tsessionStorage.setItem('listName', prodholder[0][index].listName);\n\t\t\t}\n\t\t}\n\t})\n\n\t// PLP click in list\n\t.on(\"click\", \".c-product-cards-list .c-product-cards-list-item .c-product-cards-text a\", function () {\n\t\tvar index = $(this).parents(\".c-product-cards-list-item\").index(\".c-product-cards-list-item\");\n\t\tvar url = $(this).attr('href');\n\t\tif (index >= 0) {\n\t\t\tif (productData.page > 0) {\n\t\t\t\tpushToDataLayer({\n\t\t\t\t\t\"event\": \"eeListClick\",\n\t\t\t\t\t\"eeAction\": \"eeListClick\",\n\t\t\t\t\t\"pageCategory\": searchItems.search ? \"Site Search\" : \"Product List Page\",\n\t\t\t\t\t\"nextPage\": url ? url : null,\n\t\t\t\t\t'products': [Object.assign({}, prodholder[index], {\n\t\t\t\t\t\t\"productBrand\": getProductBrandForPlp(),\n\t\t\t\t\t\t\"category\": function () {\n\t\t\t\t\t\t\tif (_typeof(prodholder[index]) !== 'object') {\n\t\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tvar productCategory = prodholder[index].category != null ? prodholder[index].category : '';\n\t\t\t\t\t\t\tvar productSubCategory = prodholder[index].subCategory != null ? prodholder[index].subCategory : '';\n\t\t\t\t\t\t\tvar productSubSubCategory = prodholder[index].subSubCategory != null ? prodholder[index].subSubCategory : '';\n\t\t\t\t\t\t\treturn productCategory + '/' + productSubCategory + '/' + productSubSubCategory;\n\t\t\t\t\t\t}(),\n\t\t\t\t\t\t\"collectionName\": function () {\n\t\t\t\t\t\t\tif (_typeof(prodholder[index]) !== 'object' || prodholder[index].catid == null) {\n\t\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn prodholder[index].catid && prodholder[index].catid.toLowerCase().search('synactif') > -1 ? \"Synactif\" : null;\n\t\t\t\t\t\t}()\n\t\t\t\t\t})]\n\t\t\t\t}), function () {\n\t\t\t\t\tsetTimeout(function () {\n\t\t\t\t\t\tif (url != undefined && url != null) {\n\t\t\t\t\t\t\tdocument.location = url;\n\t\t\t\t\t\t}\n\t\t\t\t\t}, 1000);\n\t\t\t\t}();\n\t\t\t\tsessionStorage.setItem('listType', prodholder[index].listType);\n\t\t\t\tsessionStorage.setItem('listName', prodholder[index].listName);\n\t\t\t} else {\n\t\t\t\tpushToDataLayer({\n\t\t\t\t\t\"event\": \"eeListClick\",\n\t\t\t\t\t\"eeAction\": \"eeListClick\",\n\t\t\t\t\t\"pageCategory\": searchItems.search ? \"Site Search\" : \"Product List Page\",\n\t\t\t\t\t\"nextPage\": url ? url : null,\n\t\t\t\t\t'products': [Object.assign({}, prodholder[0][index], {\n\t\t\t\t\t\t\"productBrand\": getProductBrandForPlp(),\n\t\t\t\t\t\t\"category\": function () {\n\t\t\t\t\t\t\tif (_typeof(prodholder[0][index]) !== 'object') {\n\t\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tvar productCategory = prodholder[0][index].category != null ? prodholder[0][index].category : '';\n\t\t\t\t\t\t\tvar productSubCategory = prodholder[0][index].subCategory != null ? prodholder[0][index].subCategory : '';\n\t\t\t\t\t\t\tvar productSubSubCategory = prodholder[0][index].subSubCategory != null ? prodholder[0][index].subSubCategory : '';\n\t\t\t\t\t\t\treturn productCategory + '/' + productSubCategory + '/' + productSubSubCategory;\n\t\t\t\t\t\t}(),\n\t\t\t\t\t\t\"collectionName\": function () {\n\t\t\t\t\t\t\tif (_typeof(prodholder[0][index]) !== 'object' || prodholder[0][index].catid == null) {\n\t\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn prodholder[0][index].catid && prodholder[0][index].catid.toLowerCase().search('synactif') > -1 ? \"Synactif\" : null;\n\t\t\t\t\t\t}()\n\t\t\t\t\t})]\n\t\t\t\t}), function () {\n\t\t\t\t\tsetTimeout(function () {\n\t\t\t\t\t\tif (url != undefined && url != null) {\n\t\t\t\t\t\t\tdocument.location = url;\n\t\t\t\t\t\t}\n\t\t\t\t\t}, 1000);\n\t\t\t\t}();\n\t\t\t\tsessionStorage.setItem('listType', prodholder[0][index].listType);\n\t\t\t\tsessionStorage.setItem('listName', prodholder[0][index].listName);\n\t\t\t}\n\t\t}\n\t})\n\n\t// Recommendation, bestseller eelistclick in homepage,pdp,cart\n\t.on(\"click\", \".pi .carousel-recommendations .recommendation-item\", function (e) {\n\t\tvar index = $(this).index() - 3;\n\t\tif (_typeof(prodData.product[index]) != undefined && prodData.product[index] != null) {\n\t\t\tpushToDataLayer({\n\t\t\t\t\"event\": \"eeListClick\",\n\t\t\t\t\"pageSubCategory\": \"\",\n\t\t\t\t\"pageCategory\": getPageCategory(),\n\t\t\t\t\"filterChoice\": \"\",\n\t\t\t\t\"dropDown\": \"\",\n\t\t\t\t'products': [{\n\t\t\t\t\t\"listType\": prodData.product[index].listType,\n\t\t\t\t\t\"listName\": prodData.product[index].listName,\n\t\t\t\t\t\"position\": prodData.product[index].position,\n\t\t\t\t\t\"id\": prodData.product[index].id,\n\t\t\t\t\t\"category\": getProductCategory(),\n\t\t\t\t\t\"price\": prodData.product[index].price,\n\t\t\t\t\t\"name\": prodData.product[index].name,\n\t\t\t\t\t\"brand\": getProductBrand(),\n\t\t\t\t\t\"quantity\": prodData.product[index].quantity,\n\t\t\t\t\t\"size\": prodData.product[index].size,\n\t\t\t\t\t\"subCategory\": prodData.product[index].subCategory,\n\t\t\t\t\t\"subSubCategory\": prodData.product[index].subSubCategory,\n\t\t\t\t\t\"productAutoReplen\": prodData.product[index].productAutoReplen,\n\t\t\t\t\t\"productOutOfStock\": prodData.product[index].productOutOfStock,\n\t\t\t\t\t\"productColor\": prodData.product[index].productColor,\n\t\t\t\t\t\"productType\": prodData.product[index].productType,\n\t\t\t\t\t\"productNumReviews\": \"\",\n\t\t\t\t\t\"productStarRating\": \"\" }]\n\t\t\t});\n\t\t\tsessionStorage.setItem('listType', prodData.product[index].listType);\n\t\t\tsessionStorage.setItem('listName', prodData.product[index].listName);\n\t\t}\n\t})\n\n\t// Recently viewed eelistclick in homepage\n\t.on(\"click\", \".cross-sell .carousel-recommendations ul .recommendation-item\", function (e) {\n\t\tvar index = $(this).index() - 3;\n\t\tif (_typeof(prodData.product[index]) != undefined && prodData.product[index] != null) {\n\t\t\tpushToDataLayer({\n\t\t\t\t\"event\": \"eeListClick\",\n\t\t\t\t\"pageSubCategory\": \"\",\n\t\t\t\t\"pageCategory\": getPageCategory(),\n\t\t\t\t\"filterChoice\": \"\",\n\t\t\t\t\"dropDown\": \"\",\n\t\t\t\t'products': [{\n\t\t\t\t\t\"listType\": prodData.product[index].listType,\n\t\t\t\t\t\"listName\": prodData.product[index].listName,\n\t\t\t\t\t\"position\": prodData.product[index].position,\n\t\t\t\t\t\"id\": prodData.product[index].id,\n\t\t\t\t\t\"category\": getProductCategory(),\n\t\t\t\t\t\"price\": prodData.product[index].price,\n\t\t\t\t\t\"name\": prodData.product[index].name,\n\t\t\t\t\t\"brand\": getProductBrand(),\n\t\t\t\t\t\"quantity\": prodData.product[index].quantity,\n\t\t\t\t\t\"size\": prodData.product[index].size,\n\t\t\t\t\t\"subCategory\": prodData.product[index].subCategory,\n\t\t\t\t\t\"subSubCategory\": prodData.product[index].subSubCategory,\n\t\t\t\t\t\"productAutoReplen\": prodData.product[index].productAutoReplen,\n\t\t\t\t\t\"productOutOfStock\": prodData.product[index].productOutOfStock,\n\t\t\t\t\t\"productColor\": prodData.product[index].productColor,\n\t\t\t\t\t\"productType\": prodData.product[index].productType,\n\t\t\t\t\t\"productNumReviews\": \"\",\n\t\t\t\t\t\"productStarRating\": \"\" }]\n\t\t\t});\n\t\t\tsessionStorage.setItem('listType', prodData.product[index].listType);\n\t\t\tsessionStorage.setItem('listName', prodData.product[index].listName);\n\t\t}\n\t})\n\n\t// click on viewmore button\n\t.on(\"plpviewmore\", function (e) {\n\t\tif (getPageCategory() == \"Category Page\") {\n\t\t\tif (prodholder && _typeof(productData.product) != undefined) {\n\t\t\t\tif (productData.page > 1) {\n\t\t\t\t\tprodholder = prodholder.concat(productData.product);\n\t\t\t\t} else {\n\t\t\t\t\tprodholder = prodholder[0].concat(productData.product);\n\t\t\t\t}\n\n\t\t\t\tfor (var i = 0; i < prodholder.length; i++) {\n\t\t\t\t\tprodholder[i].position = i + 1;\n\t\t\t\t}\n\t\t\t\tfor (var a = 0; a < productData.product.length; a++) {\n\t\t\t\t\tvar diff = productData.product.length - a;\n\t\t\t\t\tproductData.product[a].position = prodholder.length - diff + 1;\n\t\t\t\t}\n\t\t\t\tpushDtLayer({\n\t\t\t\t\t\"event\": \"eeListView\",\n\t\t\t\t\t\"eeAction\": \"eeListView\",\n\t\t\t\t\t\"pageCategory\": searchItems.search ? \"Site Search\" : \"Product List Page\",\n\t\t\t\t\t\"dropDown\": \"\",\n\t\t\t\t\t\"filterChoice\": \"\",\n\t\t\t\t\t\"currencyCode\": window.User.currencyCode,\n\t\t\t\t\t\"products\": productData.product || new Array()\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}).on('click', '.c-block-shopingmodal-main-thumbnail .slick-slide', function () {\n\t\t$(document).trigger(\"clickproductthumbnail\");\n\t})\n\n\t// tracking change on image in\n\t.on(\"clickproductthumbnail\", function () {\n\t\tpushToDataLayer({\n\t\t\t\"event\": \"productInteraction\",\n\t\t\t\"interactionType\": \"Image Change\",\n\t\t\t\"productCategory\": window.productCache.catid,\n\t\t\t\"productSubCategory\": window.productCache.subcategory,\n\t\t\t\"productName\": getProductName(),\n\t\t\t\"productId\": getProductID(),\n\t\t\t\"pageCategory\": getPageCategory(),\n\t\t\t\"productOutOfStock\": window.productCache.productOutOfStock,\n\t\t\t\"productAutoReplen\": window.productCache.productautoreplenish,\n\t\t\t\"productColor\": window.productCache.productColor,\n\t\t\t\"collectionName\": window.productCache.catid && window.productCache.catid.toLowerCase().search('synactif') > -1 ? \"Synactif\" : null,\n\t\t\t\"productType\": window.productCache.master ? \"master\" : window.productCache.variant ? \"variant\" : window.productCache.bundle ? \"bundle\" : window.productCache.productSet ? \"productSet\" : \"product\"\n\t\t});\n\t})\n\t// click on next arrow recommendation carousel and best seller\n\t.on(\"click\", \".pi .carousel-recommendations .slick-next\", function (e) {\n\t\tif ((typeof prodData === \"undefined\" ? \"undefined\" : _typeof(prodData)) != undefined && prodData != null) {\n\t\t\tvar array = new Array();\n\t\t\tvar listholder = new Array();\n\t\t\tvar listchecker = false;\n\t\t\tvar listctr = 0;\n\t\t\t$(\".recommendation-item\").each(function (index) {\n\t\t\t\tif ($(\".recommendation-item\").filter(\".slick-active\").length == 3) {\n\t\t\t\t\tif (index > 2 && $(this).hasClass(\"slick-active\")) {\n\t\t\t\t\t\tarray.push(index - 3);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (index > 2 && ($(this).hasClass(\"slick-active\") || $(this).hasClass(\"slick-current\"))) {\n\t\t\t\t\t\tlistctr = 2;\n\t\t\t\t\t\tif (prodData.product.length > 3) {\n\t\t\t\t\t\t\tlistchecker = true;\n\t\t\t\t\t\t\tlistctr = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tarray.push(index - 3);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (listchecker && listctr < 2 && index > 2 && array.length <= 3) {\n\t\t\t\t\t\t\tif (array[array.length] != index - 3) {\n\t\t\t\t\t\t\t\tlistctr += 1;\n\t\t\t\t\t\t\t\tarray.push(index - 3);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tlistchecker = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t\tfor (var i = 0; i < prodData.product.length; i++) {\n\t\t\t\tfor (var a = 0; a < array.length; a++) {\n\t\t\t\t\tif (i == array[a]) {\n\t\t\t\t\t\tlistholder.push(prodData.product[i]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tpushToDataLayer({\n\t\t\t\t\"currencyCode\": window.User.currencyCode,\n\t\t\t\t\"eeAction\": \"eeListView\",\n\t\t\t\t\"event\": \"eeListView\",\n\t\t\t\t\"pageCategory\": getPageCategory(),\n\t\t\t\t\"products\": listholder });\n\t\t}\n\t})\n\n\t// click on next arrow recommendation carousel and best seller\n\t.on(\"click\", \".pi .carousel-recommendations .slick-prev\", function (e) {\n\n\t\tif ((typeof prodData === \"undefined\" ? \"undefined\" : _typeof(prodData)) != undefined && prodData != null) {\n\t\t\tvar array = new Array();\n\t\t\tvar listholder = new Array();\n\t\t\tvar listchecker = false;\n\t\t\tvar listctr = 0;\n\t\t\t$(\".recommendation-item\").each(function (index) {\n\t\t\t\tif ($(\".recommendation-item\").filter(\".slick-active\").length == 3) {\n\t\t\t\t\tif (index > 2 && $(this).hasClass(\"slick-active\")) {\n\t\t\t\t\t\tarray.push(index - 3);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (index > 2 && ($(this).hasClass(\"slick-active\") || $(this).hasClass(\"slick-current\"))) {\n\t\t\t\t\t\tlistctr = 2;\n\t\t\t\t\t\tif (prodData.product.length > 3) {\n\t\t\t\t\t\t\tlistchecker = true;\n\t\t\t\t\t\t\tlistctr = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tarray.push(index - 3);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (listchecker && listctr < 2 && index > 2 && array.length <= 3) {\n\t\t\t\t\t\t\tif (array[array.length] != index - 3) {\n\t\t\t\t\t\t\t\tlistctr += 1;\n\t\t\t\t\t\t\t\tarray.push(index - 3);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tlistchecker = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t\tfor (var i = 0; i < prodData.product.length; i++) {\n\t\t\t\tfor (var a = 0; a < array.length; a++) {\n\t\t\t\t\tif (i == array[a]) {\n\t\t\t\t\t\tlistholder.push(prodData.product[i]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tpushToDataLayer({\n\t\t\t\t\"currencyCode\": window.User.currencyCode,\n\t\t\t\t\"eeAction\": \"eeListView\",\n\t\t\t\t\"event\": \"eeListView\",\n\t\t\t\t\"pageCategory\": getPageCategory(),\n\t\t\t\t\"products\": listholder });\n\t\t}\n\t})\n\n\t// click on next arrow recently viewed\n\t.on(\"click\", \".cross-sell .carousel-recommendations .slick-next\", function (e) {\n\n\t\tif ((typeof prodData === \"undefined\" ? \"undefined\" : _typeof(prodData)) != undefined && prodData != null) {\n\t\t\tvar array = new Array();\n\t\t\tvar listholder = new Array();\n\t\t\t$(\".recommendation-item\").each(function (index) {\n\t\t\t\tif (index > 2 && $(this).hasClass(\"slick-active\")) {\n\t\t\t\t\tarray.push(index - 3);\n\t\t\t\t}\n\t\t\t});\n\t\t\tfor (var i = 0; i < prodData.product.length; i++) {\n\t\t\t\tfor (var a = 0; a < array.length; a++) {\n\t\t\t\t\tif (i == array[a]) {\n\t\t\t\t\t\tlistholder.push(prodData.product[i]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tpushToDataLayer({\n\t\t\t\t\"currencyCode\": window.User.currencyCode,\n\t\t\t\t\"eeAction\": \"eeListView\",\n\t\t\t\t\"event\": \"eeListView\",\n\t\t\t\t\"pageCategory\": getPageCategory(),\n\t\t\t\t\"products\": listholder });\n\t\t}\n\t})\n\n\t// click on next arrow recently viewed\n\t.on(\"click\", \".cross-sell .carousel-recommendations .slick-prev\", function (e) {\n\n\t\tif ((typeof prodData === \"undefined\" ? \"undefined\" : _typeof(prodData)) != undefined && prodData != null) {\n\t\t\tvar array = new Array();\n\t\t\tvar listholder = new Array();\n\t\t\t$(\".recommendation-item\").each(function (index) {\n\t\t\t\tif (index > 2 && $(this).hasClass(\"slick-active\")) {\n\t\t\t\t\tarray.push(index - 3);\n\t\t\t\t}\n\t\t\t});\n\t\t\tfor (var i = 0; i < prodData.product.length; i++) {\n\t\t\t\tfor (var a = 0; a < array.length; a++) {\n\t\t\t\t\tif (i == array[a]) {\n\t\t\t\t\t\tlistholder.push(prodData.product[i]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tpushToDataLayer({\n\t\t\t\t\"currencyCode\": window.User.currencyCode,\n\t\t\t\t\"eeAction\": \"eeListView\",\n\t\t\t\t\"event\": \"eeListView\",\n\t\t\t\t\"pageCategory\": getPageCategory(),\n\t\t\t\t\"products\": listholder });\n\t\t}\n\t})\n\n\t// pdp fire when variation was change\n\t.on(\"gtvariationchange\", function (e) {\n\t\tif (getPageCategory() == \"Product Page\") {\n\t\t\tpushToDataLayer({\n\t\t\t\t\"eeAction\": \"eeProductDetail\",\n\t\t\t\t\"event\": \"eeProductDetail\",\n\t\t\t\t\"pageCategory\": \"Product Page\",\n\t\t\t\t'products': [{\n\t\t\t\t\t\"listType\": sessionStorage.getItem('listType'),\n\t\t\t\t\t\"listName\": sessionStorage.getItem('listName'),\n\t\t\t\t\t\"id\": pdpdata.defalutvariant ? pdpdata.defalutvariant : pdpdata.ID,\n\t\t\t\t\t\"category\": pdpdata.category,\n\t\t\t\t\t\"price\": pdpdata.pricing.sale ? pdpdata.pricing.sale : pdpdata.pricing.minprice,\n\t\t\t\t\t\"name\": pdpdata.name,\n\t\t\t\t\t\"brand\": pdpdata.brand,\n\t\t\t\t\t\"quantity\": pdpdata.quantity,\n\t\t\t\t\t\"size\": pdpdata.size,\n\t\t\t\t\t\"subCategory\": pdpdata.subcategory,\n\t\t\t\t\t\"subSubCategory\": pdpdata.subsubcategory,\n\t\t\t\t\t\"productAutoReplen\": pdpdata.productautoreplenish,\n\t\t\t\t\t\"productOutOfStock\": pdpdata.productOutOfStock,\n\t\t\t\t\t\"productColor\": pdpdata.productColor,\n\t\t\t\t\t\"productType\": \"Product\",\n\t\t\t\t\t\"productNumReviews\": \"\",\n\t\t\t\t\t\"productStarRating\": \"\" }]\n\t\t\t});\n\t\t}\n\t})\n\n\t// quickview action\n\t.on('click', '.c-product-cards-quickshop-toggle', function () {\n\t\tvar index = $(this).parents(\".c-product-cards-list-item\").index(\".c-product-cards-list-item\");\n\t\tif (productData.product.length > 0 && prodholder[0].length > index) {\n\t\t\tpushToDataLayer({\n\t\t\t\t\"eeAction\": \"eeProductDetail\",\n\t\t\t\t\"event\": \"eeProductDetail\",\n\t\t\t\t\"pageCategory\": \"Category Page\",\n\t\t\t\t'products': [prodholder[0][index]]\n\t\t\t});\n\t\t}\n\t})\n\n\t// filter\n\t.on('click', '.c-block-products-search-panel--filter .c-select .c-select-list-item a', function () {\n\t\tpushToDataLayer({\n\t\t\t\"event\": \"dropDownChoice\",\n\t\t\t\"dropDownType\": \"Filter\",\n\t\t\t\"listType\": \"product category list\",\n\t\t\t\"listName\": $('.c-title-pageHeading-title').length > 0 ? $('.c-title-pageHeading-title').text().trim() : null,\n\t\t\t\"filterChoice\": $(this).length > 0 ? $(this).text().trim() : null\n\t\t});\n\t})\n\n\t// sort\n\t.on('click', '.c-block-products-search-panel--sort .c-select .c-select-list-item a', function () {\n\t\tpushToDataLayer({\n\t\t\t\"event\": \"dropDownChoice\",\n\t\t\t\"dropDownType\": \"Sort\",\n\t\t\t\"listType\": \"product category list\",\n\t\t\t\"listName\": $('.c-title-pageHeading-title').length > 0 ? $('.c-title-pageHeading-title').text().trim() : null,\n\t\t\t\"filterChoice\": $(this).length > 0 ? $(this).text().trim() : null\n\t\t});\n\t})\n\n\t// Transaction funnel steps - shipping to payment\n\t.on('click', 'button[name=\"dwfrm_singleshipping_shippingAddress_save\"]', function () {\n\t\tpushToDataLayer({\n\t\t\t\"event\": \"eeCheckoutOption\",\n\t\t\t\"checkoutStep\": \"1\",\n\t\t\t\"checkoutOption\": sessionStorage.getItem(\"productUpdate\") != \"\" ? sessionStorage.getItem(\"productUpdate\") : \"0\"\n\t\t});\n\t})\n\n\t// Transaction funnel step - payment to review\n\t.on('click', 'button[name=\"dwfrm_billing_save\"]', function () {\n\t\tpushToDataLayer({\n\t\t\t\"event\": \"eeCheckoutOption\",\n\t\t\t\"checkoutStep\": \"2\",\n\t\t\t\"checkoutOption\": basketConfirmation.defaultShipping\n\t\t});\n\t})\n\n\t// Transaction funnel step - review to confirmation\n\t.on('click', '.pt_checkout #summary-place-order', function () {\n\t\tpushToDataLayer({\n\t\t\t\"event\": \"eeCheckoutOption\",\n\t\t\t\"checkoutStep\": \"3\",\n\t\t\t\"checkoutOption\": basketConfirmation.paymentMethod\n\t\t});\n\n\t\tsessionStorage.setItem(\"productUpdate\", \"\");\n\t})\n\n\t// subscription on account registration page\n\t.on('click', '.pt_account #register-new-account', function () {\n\t\tif ($('input[name=\"dwfrm_profile_customer_addtoemaillist\"]').prop('checked')) {\n\t\t\t$(document).trigger(\"clicknewsletter\", { \"siteloc\": \"account registration page\" });\n\t\t\tsessionStorage.setItem(\"subscription\", true);\n\t\t} else {\n\t\t\tsessionStorage.setItem(\"subscription\", false);\n\t\t}\n\t})\n\n\t// subscription on profile page\n\t.on('click', '.pt_account #profile-save-changes', function () {\n\t\tif ($('input[name=\"dwfrm_profile_customer_addtoemaillist\"]').prop('checked') && sessionStorage.getItem(\"subscription\") == 'false') {\n\t\t\t$(document).trigger(\"clicknewsletter\", { \"siteloc\": \"profile page\" });\n\t\t\tsessionStorage.setItem(\"subscription\", true);\n\t\t}\n\t}).on('click', '.c-block-languagselection li a', function () {\n\t\tpushToDataLayer({\n\t\t\t\"event\": \"changeLanguage\",\n\t\t\t\"language\": $(this).length > 0 ? $(this).text().trim() : null\n\t\t});\n\t})\n\n\t// search button in header on all page\n\t.on('dataLayerPushWhenSearchButtonWasClicked', function () {\n\t\tpushToDataLayer({\n\t\t\tnavigationLocationClicked: \"site search pop-in\"\n\t\t});\n\t})\n\n\t// menu button in header on all page\n\t.on('click', '.header-menu_btn', function () {\n\t\tpushToDataLayer({\n\t\t\tnavigationLocationClicked: \"topmenu\"\n\t\t});\n\t})\n\n\t// global navigation link on Menu on all page\n\t.on('click', '.cpb-gnav-parents .cpb-gnav_list a, .cpb-gnav-parents .cpb-gnav-utility_list a', function (e) {\n\t\tpushToDataLayer({\n\t\t\tnavigationLinkNameClicked: $(this).text().trim(),\n\t\t\tnavigationLocationClicked: \"leftmenu\"\n\t\t});\n\t})\n\n\t// global navigation link on Menu children on all page\n\t.on('click', '.cpb-gnav-child .cpb-gnav_list a, .cpb-gnav-child .cpb-gnav-utility_list a', function (e) {\n\t\t// NOTE: can't use sessionStorage.getItem(\"navlink\");\n\t\t// because faster to be set \"navlink\" than to get \"navlink\".\n\t\tvar pageSubCategory = function () {\n\t\t\tvar currentTarget = $(e.currentTarget);\n\t\t\tif (currentTarget.length === 0) return null;\n\n\t\t\tvar parentElement = $(currentTarget[0]).closest('.cpb-gnav_contents_inner');\n\t\t\tif (parentElement.length === 0) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tvar elementWithSubCategory = parentElement[0].querySelector(\".cpb-gnav_ttl .cpb-gnav_back\");\n\t\t\treturn elementWithSubCategory.innerText.trim();\n\t\t}();\n\n\t\tpushToDataLayer({\n\t\t\tpageSubCategory: pageSubCategory,\n\t\t\tnavigationLinkNameClicked: $(this).text().trim(),\n\t\t\tnavigationLocationClicked: \"leftmenu\"\n\t\t});\n\t})\n\n\t// main visual card in top page\n\t.on('click', '.cmd-main-visual_container a.cmd-visual_card', function (e) {\n\t\tvar positionNum = $('.cmd-main-visual_container a.cmd-visual_card').index($(this)) + 1;\n\t\tpushToDataLayer({\n\t\t\tevent: \"eePromoClick\",\n\t\t\teeAction: \"eePromoClick\",\n\t\t\tpageCategory: getPageCategory(),\n\t\t\tnextPage: $(this).attr('href'),\n\t\t\t// TODO: confirming Jan,2023\n\t\t\tpromotions: [{\n\t\t\t\tid: \"\",\n\t\t\t\tname: \"\",\n\t\t\t\tcreative: \"\",\n\t\t\t\tposition: \"homepage_slot_\" + String(positionNum)\n\t\t\t}]\n\t\t});\n\t})\n\n\t// thumnails, prev and next button in pdp\n\t.on('click', '.cpb-products-photo .cpb-products-photo_cover-thumb .slick-slide, .cpb-products-photo .slick-prev, .cpb-products-photo .slick-next', function () {\n\t\tpushToDataLayer({\n\t\t\tevent: \"productInteraction\",\n\t\t\tinteractionType: \"Image Change\",\n\t\t\tproductCategory: getProductCategory(),\n\t\t\tproductSubCategory: getProductsubCategory(),\n\t\t\tproductName: window.productCache.name,\n\t\t\tproductId: window.productCache.ID,\n\t\t\tpageCategory: getPageCategory(),\n\t\t\tproductOutOfStock: window.productCache.productOutOfStock,\n\t\t\tproductAutoReplen: window.productCache.productautoreplenish,\n\t\t\tproductColor: $(\".cpb-products-color_list .c-list-color-panel.is-current\").data('description'),\n\t\t\tcollectionName: window.productCache.catid && window.productCache.catid.toLowerCase().search('synactif') > -1 ? \"Synactif\" : null,\n\t\t\tproductType: getProductType()\n\t\t});\n\t})\n\n\t// colors in pdp\n\t.on('click', '.cpb-products-variation a.swatchanchor', function () {\n\t\tvar childThatHasColorText = $(this).find('.c-list-color-panel');\n\t\tif (childThatHasColorText == null) return;\n\n\t\tpushToDataLayer({\n\t\t\tevent: \"productInteraction\",\n\t\t\tinteractionType: \"Select Color\",\n\t\t\tproductCategory: getProductCategory(),\n\t\t\tproductSubCategory: getProductsubCategory(),\n\t\t\tproductName: productCache.name,\n\t\t\tproductId: productCache.ID,\n\t\t\tpageCategory: getPageCategory(),\n\t\t\tproductOutOfStock: productCache.productOutOfStock,\n\t\t\tproductAutoReplen: productCache.productautoreplenish,\n\t\t\tproductColor: childThatHasColorText.attr('data-description'),\n\t\t\tcollectionName: window.productCache.catid && window.productCache.catid.toLowerCase().search('synactif') > -1 ? \"Synactif\" : null,\n\t\t\tproductType: getProductType()\n\t\t});\n\t});\n}\n\nmodule.exports = {\n\tinit: function init() {\n\t\tinitializeGlobalEvents();\n\t},\n\ttagmanager: {\n\t\tclick: function click(data) {\n\t\t\treturn trackConsultationEvent(data);\n\t\t},\n\n\t\tpageview: function pageview(data) {\n\t\t\treturn trackConsultationPageview(data);\n\t\t}\n\t},\n\tgtmInternalPromotion: {\n\t\tclick: function click(data) {\n\t\t\treturn trackInternalPromotionEvent(data);\n\t\t},\n\n\t\tpageview: function pageview(data) {\n\t\t\treturn trackInternalPromotionPageView(data);\n\t\t}\n\t}\n};\n\n},{\"./util\":68}],3:[function(require,module,exports){\n'use strict';\n\nvar analytics = require('./analytics'),\n countries = require('./countries'),\n dialog = require('./dialog'),\n quickview = require(\"./quickview\"),\n minicart = require('./minicart'),\n page = require('./page'),\n rating = require('./rating'),\n searchplaceholder = require('./searchplaceholder'),\n searchsuggest = require('./searchsuggest'),\n tooltip = require('./tooltip'),\n util = require('./util'),\n validator = require('./validator'),\n slick = require('./slick'),\n tls = require('./tls'),\n video = require(\"./video\"),\n headerMenu = require('./header-menu'),\n footerSelector = require('./footer-selector'),\n newsletter = require('./newsletter'),\n orderreplenishment = require('./order-replenishment'),\n inputEntry = require('./input-entry'),\n producttile = require('./product-tile'),\n design = require('./design'),\n newDesign = require('./new-design'),\n login = require('./login');\n\n//if jQuery has not been loaded, load from google cdn\nif (!window.jQuery) {\n var s = document.createElement('script');\n\n s.setAttribute('src', 'https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js');\n s.setAttribute('type', 'text/javascript');\n\n document.getElementsByTagName('head')[0].appendChild(s);\n}\n\nrequire('./jquery-ext')();\nrequire('./cookieprivacy')();\n//require('./captcha')();\n\nfunction initializeEvents() {\n var controlKeys = ['8', '13', '46', '45', '36', '35', '38', '37', '40', '39'];\n\n $('body').on('keydown', 'textarea[data-character-limit]', function (e) {\n var text = $.trim($(this).val()),\n charsLimit = $(this).data('character-limit'),\n charsUsed = text.length;\n\n if (charsUsed >= charsLimit && controlKeys.indexOf(e.which.toString()) < 0) {\n e.preventDefault();\n }\n }).on('change keyup mouseup', 'textarea[data-character-limit]', function () {\n var text = $(this).val(),\n charsLimit = $(this).data('character-limit'),\n charsUsed = text.length,\n charsRemain = charsLimit - charsUsed;\n\n if (charsRemain < 0) {\n $(this).val(text.slice(0, charsRemain));\n charsRemain = 0;\n }\n\n $(this).closest('.field-wrapper').find('.char-remain-count').html(charsRemain);\n });\n\n /**\r\n * initialize search suggestions, pending the value of the site preference(enhancedSearchSuggestions)\r\n * this will either init the legacy(false) or the beta versions(true) of the the search suggest feature.\r\n * */\n var $searchContainer = $('.utility-nav .header-search');\n\n searchsuggest.init($searchContainer, Resources.SIMPLE_SEARCH);\n\n // add show/hide navigation elements\n $('.secondary-navigation .toggle').click(function () {\n $(this).toggleClass('expanded').next('ul').toggle();\n });\n\n // add generic toggle functionality\n $('.toggle').next('.toggle-content').hide();\n $('.toggle').click(function () {\n $(this).toggleClass('expanded').next('.toggle-content').toggle();\n });\n\n // subscribe email box\n var $subscribeEmail = $('.subscribe-email');\n\n if ($subscribeEmail.length > 0) {\n $subscribeEmail.focus(function () {\n var val = $(this.val());\n\n if (val.length > 0 && val !== Resources.SUBSCRIBE_EMAIL_DEFAULT) {\n return; // do not animate when contains non-default value\n }\n\n $(this).animate({\n color: '#999999'\n }, 500, 'linear', function () {\n $(this).val('').css('color', '#333333');\n });\n }).blur(function () {\n var val = $.trim($(this.val()));\n\n if (val.length > 0) {\n return; // do not animate when contains value\n }\n\n $(this).val(Resources.SUBSCRIBE_EMAIL_DEFAULT).css('color', '#999999').animate({\n color: '#333333'\n }, 500, 'linear');\n });\n }\n\n if (SitePreferences.MOTIONPOINT_ENABLED) {\n\n $('#chooseLanguage').on('click', function (e) {\n e.preventDefault();\n\n var script = document.createElement('script');\n\n //MP.SrcUrl = unescape('mp_js_orgin_url'); - commented out per MotionPoint\n MP.UrlLang = 'mp_js_current_lang';\n MP.oSite = decodeURIComponent('mp_js_origin_baseUrl');\n MP.tSite = decodeURIComponent('mp_js_translated_baseUrl');\n\n MP.init();\n\n script.src = 'https://shiseidoamericas.mpeasylink.com/mpel/mpel_chooser.js';\n\n document.body.appendChild(script);\n\n return false;\n });\n }\n\n $('.privacy-policy').on('click', function (e) {\n e.preventDefault();\n\n dialog.open({\n url: $(e.target).attr('href'),\n options: {\n height: 600\n }\n });\n });\n\n if ($('.order-confirmation-details').length) {\n sessionStorage.removeItem('isGift');\n sessionStorage.removeItem('giftMessage');\n }\n\n var url = Urls.passwordReset;\n\n if ($('.reset-password-link').length) {\n if (location.protocol === 'https:') {\n url = Urls.securePasswordReset;\n }\n\n $('.reset-password-link').each(function () {\n $(this).find('a').attr('href', url);\n });\n }\n\n if ($('.user-recognized').length) {\n if (location.protocol === 'https:') {\n url = Urls.securePasswordReset;\n }\n\n $('.user-recognized').find('a').attr('href', url);\n }\n\n // checkout checkout minicart on right side event handling\n addSummaryScrollbar();\n //quick view\n producttile.initQuickViewButtons();\n producttile.initColorChange();\n}\n\n/**\r\n * @private\r\n * @function\r\n * @description Adds class ('js') to html for css targeting and loads js specific styles.\r\n */\nfunction initializeDom() {\n // add class to html for css targeting\n $('html').addClass('js');\n\n if (SitePreferences.LISTING_INFINITE_SCROLL) {\n $('html').addClass('infinite-scroll');\n }\n\n // load js specific styles\n util.limitCharacters();\n}\n\nfunction backToTopHandler() {\n $(document).on('scroll', function () {\n if ($(window).scrollTop() > 100) {\n $('.scroll-top-wrapper').addClass('show');\n } else {\n $('.scroll-top-wrapper').removeClass('show');\n }\n });\n\n $('.scroll-top-wrapper').on('click', scrollToTop);\n}\n\nfunction scrollToTop(e) {\n e.preventDefault();\n var verticalOffset = typeof verticalOffset != 'undefined' ? verticalOffset : 0;\n var element = $('body');\n var offset = element.offset();\n var offsetTop = offset.top;\n\n $('html, body').animate({\n scrollTop: offsetTop\n }, 500, 'linear');\n}\n\n// Minimize header and make it stick to the top\nfunction minimizedHeaderHandler() {\n checkScrolledDown();\n\n $(window).scroll(function () {\n checkScrolledDown();\n });\n}\n\nfunction checkScrolledDown() {\n\n var $stickyHeader = $('#minimized-header-container');\n var $headerScrollOffset = $('.header-banner').outerHeight();\n var $wrapper = $('#wrapper');\n\n if ($('body').hasClass('is-reveal-open')) {\n return false;\n }\n\n if ($(window).scrollTop() > $headerScrollOffset) {\n $stickyHeader.addClass('sticky-header');\n $wrapper.css('padding-top', $stickyHeader.outerHeight());\n } else {\n $stickyHeader.removeClass('sticky-header');\n $wrapper.css('padding-top', 0);\n }\n}\n\nfunction responsiveMegaMenu() {\n var $dropdowns = $('.level-1 li.has-sub-menu');\n\n $dropdowns.on('keydown', function (e) {\n var $this = $(this);\n\n if (e.keyCode === 13) {\n\n if (!$this.hasClass('hover')) {\n e.preventDefault();\n\n $dropdowns.removeClass('hover');\n $this.addClass('hover');\n }\n }\n\n if (e.keyCode === 32) {\n e.preventDefault();\n $dropdowns.removeClass('hover');\n }\n });\n\n $dropdowns.hover(function () {\n var $this = $(this);\n if ($this.prop('hoverTimeout')) {\n $this.prop('hoverTimeout', clearTimeout($this.prop('hoverTimeout')));\n }\n $this.prop('hoverIntent', setTimeout(function () {\n $this.addClass('hover');\n }, 200));\n }, function () {\n var $this = $(this);\n if ($this.prop('hoverIntent')) {\n $this.prop('hoverIntent', clearTimeout($this.prop('hoverIntent')));\n }\n $this.prop('hoverTimeout', setTimeout(function () {\n $this.removeClass('hover');\n }, 200));\n });\n\n if ('ontouchstart' in document.documentElement && window.innerWidth >= 640) {\n\n $dropdowns.each(function () {\n var $this = $(this);\n\n this.addEventListener('touchstart', function (e) {\n if (e.touches.length === 1) {\n e.stopPropagation();\n\n if (!$this.hasClass('hover')) {\n if (e.target === this || e.target.parentNode === this) {\n e.preventDefault();\n }\n\n $dropdowns.removeClass('hover');\n $this.addClass('hover');\n\n document.addEventListener('touchstart', function closeDropdown(e) {\n e.stopPropagation();\n\n $this.removeClass('hover');\n document.removeEventListener('touchstart', closeDropdown);\n });\n }\n }\n }, false);\n });\n }\n\n $('a.no-link, span.category-header').on('click', function (e) {\n if (window.innerWidth < 640) {\n $(this).next($('.menu-item-toggle')).trigger('click');\n } else {\n e.preventDefault();\n }\n });\n\n var ogMenuHeight = $('ul.level-1').height();\n // main menu toggle\n $('.menu-toggle').on('click', function () {\n $('#wrapper').toggleClass('menu-active');\n ogMenuHeight = $('ul.level-1').height();\n });\n\n $('.main-nav li .menu-item-toggle').on('click', function (e) {\n e.preventDefault();\n\n var $parentLi = $(e.target).closest('li');\n var menuHeight = $parentLi.find('.sub-level-wrapper').height();\n\n if (ogMenuHeight <= menuHeight) {\n $('ul.level-1').css('height', menuHeight);\n }\n\n $parentLi.siblings('li').removeClass('active').find('.menu-item-toggle');\n $parentLi.toggleClass('active');\n\n $(e.target).toggleClass('active');\n });\n\n $('.mobile-menu-back').on('click', function () {\n\n var $closestActiveMenu = $(this).closest('.active');\n var prevMenuHeight = $closestActiveMenu.parent().parent().height();\n\n $closestActiveMenu.removeClass('active');\n\n if (ogMenuHeight <= prevMenuHeight) {\n $('ul.level-1').css('height', prevMenuHeight);\n }\n });\n\n $('.user-account').on('click', function (e) {\n e.preventDefault();\n\n $(this).parent('.user-info').toggleClass('active');\n });\n}\n\nfunction searchMenuEvent() {\n // Search for mobile view\n $('.quick-access-menu [title=\"Search\"]').on('click', function (e) {\n e.preventDefault();\n\n $('.header-search').slideToggle(200);\n });\n\n // show the search button when the user switches to desktop view\n $(window).on(\"resize\", function (e) {\n if (window.innerWidth > 639) {\n $('.header-search').show();\n }\n });\n}\n\n//add class for scrollbar on miniline summary\nfunction addSummaryScrollbar() {\n var itemCount = $('.pt_checkout .checkout-mini-cart .accordion-content .mini-cart-product').length;\n\n if (itemCount > 4) {\n $('.checkout-mini-cart .accordion-content').addClass('scroll-items');\n }\n}\n\nfunction playVideoHandler() {\n var MAIN_VIDEO_SELECTOR = \".main-video\";\n var CAROUSEL_VIDEO_SELECTOR = \".modal-video\";\n $(document)\n // main video (inline)\n .on(\"click\", MAIN_VIDEO_SELECTOR, function () {\n var $this = $(this);\n\n var $inlineEle = $this.parent(\"div\"),\n videoId = $this.data(\"video-id\");\n\n video.playInline($inlineEle, videoId);\n })\n\n // carousel videos (launched in modal)\n .on(\"click\", CAROUSEL_VIDEO_SELECTOR, function () {\n var videoId = $(this).data(\"video-id\");\n\n video.playInModal(videoId);\n });\n}\n\nfunction resetFooterError() {\n $('.store-locator-form input[type=\"text\"]').val('');\n\n if ($('.store-locator-form .field-button-container div').hasClass('error')) {\n $('.store-locator-form .field-button-container div').removeClass('error');\n $('.store-locator-form .field-button-container .error-message').remove();\n }\n}\n\n/**\r\n * Dropdown event for quantity change\r\n * @returns\r\n */\nfunction dropDownEvents() {\n $(document).on('click', '.js-num-drop_up', function (e) {\n e.preventDefault();\n var $box = $(this).closest('.js-num-drop_container');\n var limit = $box.find('.js-num-drop_select').children().length;\n var currentNum = $box.find('.js-num-drop_cnt').html();\n\n if (currentNum < limit) {\n currentNum++;\n $box.find('.js-num-drop_cnt').html(currentNum);\n $box.find('.js-num-drop_select').children().find('a').removeClass('is-current');\n $box.find('.js-num-drop_select').children().eq(currentNum - 1).find('a').addClass('is-current');\n $box.find('.js-num-drop_input').val(currentNum);\n }\n\n if ($(this).parents('.cpb-products_list_box').length > 0) {\n $(this).trigger('dropUpMinicart');\n } else if ($(this).parents('.cpb-cart-bag_box').length > 0) {\n $(this).trigger('dropUpCart');\n } else if ($(this).parents('.cpb-products-conut').length > 0) {\n $(this).trigger('dropUpProduct');\n }\n });\n $(document).on('click', '.js-num-drop_down', function (e) {\n e.preventDefault();\n var $box = $(this).closest('.js-num-drop_container');\n var limit = $box.find('.js-num-drop_select').children().length;\n var currentNum = $box.find('.js-num-drop_cnt').html();\n\n if (currentNum > 1) {\n currentNum--;\n $box.find('.js-num-drop_cnt').html(currentNum);\n $box.find('.js-num-drop_select').children().find('a').removeClass('is-current');\n $box.find('.js-num-drop_select').children().eq(currentNum - 1).find('a').addClass('is-current');\n $box.find('.js-num-drop_input').val(currentNum);\n }\n\n if ($(this).parents('.cpb-products_list_box').length > 0) {\n $(this).trigger('dropDownMinicart');\n } else if ($(this).parents('.cpb-cart-bag_box').length > 0) {\n $(this).trigger('dropDownCart');\n } else if ($(this).parents('.cpb-products-conut').length > 0) {\n $(this).trigger('dropDownProduct');\n }\n });\n $(document).on('click', '.js-num-drop_select a', function (e) {\n e.preventDefault();\n var $box = $(this).closest('.js-num-drop_container');\n var num = $(this).html();\n $box.find('.js-num-drop_cnt').html(num);\n $box.find('.js-num-drop_select').children().find('a').removeClass('is-current');\n $box.find('.js-num-drop_select').children().eq(num - 1).find('a').addClass('is-current');\n $box.find('.js-num-drop_input').val(num);\n $box.find('.js-num-drop_select').removeClass('is-active');\n\n if ($(this).parents('.cpb-products_list_box').length > 0) {\n $(this).trigger('dropSelectMinicart');\n } else if ($(this).parents('.cpb-cart-bag_box').length > 0) {\n $(this).trigger('dropSelectCart');\n } else if ($(this).parents('.cpb-products-conut').length > 0) {\n $(this).trigger('dropSelectProduct');\n }\n });\n $(document).on('click', '.js-num-drop_drop', function (e) {\n e.preventDefault();\n var $box = $(this).closest('.js-num-drop_container');\n var eventName = '.event' + new Date().getTime();\n\n if ($box.find('.js-num-drop_select').hasClass('is-active')) {\n $box.find('.js-num-drop_select').removeClass('is-active');\n $(document).off(eventName);\n } else {\n var offset = $(this).offset();\n var posY = offset.top - $(window).scrollTop();\n var height = $(window).height();\n if (posY * 2 > height) {\n $box.find('.js-num-drop_select').addClass('is-up');\n } else {\n $box.find('.js-num-drop_select').removeClass('is-up');\n }\n\n $box.find('.js-num-drop_select').addClass('is-active');\n\n $(document).on('click' + eventName + ' touchend' + eventName, function (e) {\n if (!$.contains($box[0], e.target)) {\n $box.find('.js-num-drop_select').removeClass('is-active');\n $(document).off(eventName);\n }\n });\n }\n\n if ($(this).parents('.cpb-products_list_box').length > 0) {\n $(this).trigger('dropDropMinicart');\n } else if ($(this).parents('.cpb-cart-bag_box').length > 0) {\n $(this).trigger('dropDropCart');\n } else if ($(this).parents('.cpb-products-conut').length > 0) {\n $(this).trigger('dropDropProduct');\n }\n });\n}\n\nvar pages = {\n account: require('./pages/account'),\n cart: require('./pages/cart'),\n checkout: require('./pages/checkout'),\n compare: require('./pages/compare'),\n product: require('./pages/product'),\n registry: require('./pages/registry'),\n orderconfirmation: require('./pages/order-confirm'),\n search: require('./pages/search'),\n tutorial: require('./pages/tutorial'),\n storefront: require('./pages/storefront'),\n wishlist: require('./pages/wishlist'),\n storelocator: require('./pages/storelocator'),\n checkorder: require('./pages/checkorder'),\n content: require('./pages/content'),\n promotionlanding: require('./pages/promotionlanding')\n};\n\nvar app = {\n init: function init() {\n\n $(document).foundation();\n\n if (document.cookie.length === 0) {\n $('
').addClass('browser-compatibility-alert').append($('

').addClass('browser-error').html(Resources.COOKIES_DISABLED)).appendTo('#browser-check');\n }\n\n initializeDom();\n // init events for design\n design.init();\n initializeEvents();\n backToTopHandler();\n minimizedHeaderHandler();\n resetFooterError();\n responsiveMegaMenu();\n searchMenuEvent();\n\n // init specific global components\n analytics.init();\n countries.init();\n tooltip.init();\n minicart.init();\n validator.init();\n orderreplenishment.init();\n rating.init();\n slick.init();\n searchplaceholder.init();\n headerMenu.init();\n video.init();\n //checkoutLogin.init();\n footerSelector.countrySelector();\n newsletter.newsletterHeader();\n newsletter.isNewsletterEnabled();\n inputEntry.entry();\n playVideoHandler();\n login.init();\n quickview.init();\n dropDownEvents();\n\n // execute page specific initializations\n $.extend(page, window.pageContext);\n\n var ns = page.ns;\n\n if (ns && pages[ns] && pages[ns].init) {\n pages[ns].init();\n }\n\n // Check TLS status if indicated by site preference\n if (SitePreferences.CHECK_TLS === true) {\n tls.getUserAgent();\n }\n }\n};\n\n//general extension functions\n(function () {\n String.format = function () {\n var s = arguments[0];\n var i,\n len = arguments.length - 1;\n\n for (i = 0; i < len; i++) {\n var reg = new RegExp('\\\\{' + i + '\\\\}', 'gm');\n\n s = s.replace(reg, arguments[i + 1]);\n }\n\n return s;\n };\n})();\n\n// initialize app\n$(document).ready(function () {\n app.init();\n // fixed button cart\n $('.cpb-cart-checkout_fixed .cpb-cart_submit .button').on('click', function () {\n $('.cpb-cart-side_submit .button').trigger('click');\n });\n});\n\n// expose global app obj for 3rd party integrations\nwindow.app = {\n quickView: quickview,\n minicart: minicart,\n user: window.User,\n SCemailUrl: window.Urls.SCemailUrl,\n Product: {},\n tagmanager: analytics.tagmanager,\n gtmInternalPromotion: analytics.gtmInternalPromotion\n};\n\n// expose global saveURL to support legacy Composed integration\nwindow.saveURL = window.Urls.saveConsultationURL;\n// summary scroll bar global scope\nwindow.addSummaryScrollbar = addSummaryScrollbar;\nwindow.scrollToTop = scrollToTop;\n\n},{\"./analytics\":2,\"./cookieprivacy\":6,\"./countries\":7,\"./design\":8,\"./dialog\":9,\"./footer-selector\":10,\"./header-menu\":14,\"./input-entry\":15,\"./jquery-ext\":16,\"./login\":17,\"./minicart\":18,\"./new-design\":20,\"./newsletter\":21,\"./order-replenishment\":22,\"./page\":23,\"./pages/account\":24,\"./pages/cart\":25,\"./pages/checkorder\":26,\"./pages/checkout\":31,\"./pages/compare\":35,\"./pages/content\":36,\"./pages/order-confirm\":37,\"./pages/product\":42,\"./pages/promotionlanding\":47,\"./pages/registry\":48,\"./pages/search\":49,\"./pages/storefront\":50,\"./pages/storelocator\":51,\"./pages/tutorial\":52,\"./pages/wishlist\":53,\"./product-tile\":54,\"./quickview\":57,\"./rating\":58,\"./searchplaceholder\":60,\"./searchsuggest\":61,\"./slick\":62,\"./tls\":66,\"./tooltip\":67,\"./util\":68,\"./validator\":69,\"./video\":70}],4:[function(require,module,exports){\n'use strict';\n\nvar dialog = require('./dialog'),\n page = require('./page'),\n util = require('./util'),\n modal = require('./modal').global;\n\nvar selectedList = [];\nvar maxItems = 1;\nvar bliUUID = '';\n\n/**\r\n * @private\r\n * @function\r\n * description Gets a list of bonus products related to a promoted product\r\n */\nfunction getBonusProducts() {\n var bonusproducts = [];\n\n var i, len;\n for (i = 0, len = selectedList.length; i < len; i++) {\n var p = {\n pid: selectedList[i].pid,\n qty: selectedList[i].qty,\n options: {}\n };\n var a,\n alen,\n bp = selectedList[i];\n if (bp.options) {\n for (a = 0, alen = bp.options.length; a < alen; a++) {\n var opt = bp.options[a];\n p.options = { optionName: opt.name, optionValue: opt.value };\n }\n }\n bonusproducts.push({ product: p });\n }\n return { bonusproducts: bonusproducts };\n}\n\nvar selectedItemTemplate = function selectedItemTemplate(data) {\n var attributes = '';\n for (var attrID in data.attributes) {\n var attr = data.attributes[attrID];\n attributes += '

  • \\n';\n attributes += '' + attr.displayName + ': ';\n attributes += '' + attr.displayValue + '\\n';\n attributes += '
  • ';\n }\n attributes += '
  • \\n';\n attributes += 'Qty: ';\n attributes += '' + data.qty + '';\n return ['
  • ', '', '
    ' + data.name + '
    ', '
      ', attributes, '
        ', '
      • '].join('\\n');\n};\n\n// hide swatches that are not selected or not part of a Product Variation Group\nvar hideSwatches = function hideSwatches() {\n $('.bonus-product-item:not([data-producttype=\"master\"]) .swatches li').not('.selected').not('.variation-group-value').hide();\n // prevent unselecting the selected variant\n $('.bonus-product-item .swatches .selected').on('click', function () {\n return false;\n });\n};\n\n/**\r\n * @private\r\n * @function\r\n * @description Updates the summary page with the selected bonus product\r\n */\nfunction updateSummary() {\n var $bonusProductList = $('#bonus-product-list');\n if (!selectedList.length) {\n $bonusProductList.find('li.selected-bonus-item').remove();\n } else {\n var ulList = $bonusProductList.find('ul.selected-bonus-items').first();\n var i, len;\n for (i = 0, len = selectedList.length; i < len; i++) {\n var item = selectedList[i];\n var li = selectedItemTemplate(item);\n $(li).appendTo(ulList);\n }\n }\n\n // get remaining item count\n var remain = maxItems - selectedList.length;\n $bonusProductList.find('.bonus-items-available').text(remain);\n if (remain <= 0) {\n $bonusProductList.find('.select-bonus-item').attr('disabled', 'disabled');\n } else {\n $bonusProductList.find('.select-bonus-item').removeAttr('disabled');\n }\n}\n\nfunction initializeGrid() {\n var $bonusProduct = $('#bonus-product-dialog'),\n $bonusProductList = $('#bonus-product-list'),\n bliData = $bonusProductList.data('line-item-detail');\n maxItems = bliData.maxItems;\n bliUUID = bliData.uuid;\n\n if (bliData.itemCount >= maxItems) {\n $bonusProductList.find('.select-bonus-item').attr('disabled', 'disabled');\n }\n\n var cartItems = $bonusProductList.find('.selected-bonus-item');\n cartItems.each(function () {\n var ci = $(this);\n var product = {\n uuid: ci.data('uuid'),\n pid: ci.data('pid'),\n qty: ci.find('.item-qty').text(),\n name: ci.find('.item-name').html(),\n attributes: {}\n };\n var attributes = ci.find('ul.item-attributes li');\n attributes.each(function () {\n var li = $(this);\n product.attributes[li.data('attributeId')] = {\n displayName: li.children('.display-name').html(),\n displayValue: li.children('.display-value').html()\n };\n });\n selectedList.push(product);\n });\n\n $bonusProductList.on('click', '.bonus-product-item a[href].swatchanchor', function (e) {\n e.preventDefault();\n var url = this.href,\n $this = $(this);\n url = util.appendParamsToUrl(url, {\n 'source': 'bonus',\n 'format': 'ajax'\n });\n $.ajax({\n url: url,\n success: function success(response) {\n $this.closest('.bonus-product-item').empty().html(response);\n hideSwatches();\n }\n });\n }).on('change', '.input-text', function () {\n $bonusProductList.find('.select-bonus-item').removeAttr('disabled');\n $(this).closest('.bonus-product-form').find('.quantity-error').text('');\n }).on('click', '.select-bonus-item', function (e) {\n e.preventDefault();\n if (selectedList.length >= maxItems) {\n $bonusProductList.find('.select-bonus-item').attr('disabled', 'disabled');\n $bonusProductList.find('.bonus-items-available').text('0');\n return;\n }\n\n var form = $(this).closest('.bonus-product-form'),\n detail = $(this).closest('.product-detail'),\n uuid = form.find('input[name=\"productUUID\"]').val(),\n qtyVal = form.find('input[name=\"Quantity\"]').val(),\n qty = isNaN(qtyVal) ? 1 : +qtyVal;\n\n if (qty > maxItems) {\n $bonusProductList.find('.select-bonus-item').attr('disabled', 'disabled');\n form.find('.quantity-error').text(Resources.BONUS_PRODUCT_TOOMANY);\n return;\n }\n\n var product = {\n uuid: uuid,\n pid: form.find('input[name=\"pid\"]').val(),\n qty: qty,\n name: detail.find('.product-name').text(),\n attributes: detail.find('.product-variations').data('attributes'),\n options: []\n };\n\n var optionSelects = form.find('.product-option');\n\n optionSelects.each(function () {\n product.options.push({\n name: this.name,\n value: $(this).val(),\n display: $(this).children(':selected').first().html()\n });\n });\n selectedList.push(product);\n updateSummary();\n }).on('click', '.remove-link', function (e) {\n e.preventDefault();\n var container = $(this).closest('.selected-bonus-item');\n if (!container.data('uuid')) {\n return;\n }\n\n var uuid = container.data('uuid');\n var i,\n len = selectedList.length;\n for (i = 0; i < len; i++) {\n if (selectedList[i].uuid === uuid) {\n selectedList.splice(i, 1);\n break;\n }\n }\n updateSummary();\n }).on('click', '.add-to-cart-bonus', function (e) {\n e.preventDefault();\n var url = util.appendParamsToUrl(Urls.addBonusProduct, { bonusDiscountLineItemUUID: bliUUID });\n var bonusProducts = getBonusProducts();\n if (bonusProducts.bonusproducts[0].product.qty > maxItems) {\n bonusProducts.bonusproducts[0].product.qty = maxItems;\n }\n // make the server call\n $.ajax({\n type: 'POST',\n dataType: 'json',\n cache: false,\n contentType: 'application/json',\n url: url,\n data: JSON.stringify(bonusProducts)\n }).done(function () {\n // success\n page.refresh();\n }).fail(function (xhr, textStatus) {\n // failed\n if (textStatus === 'parsererror') {\n window.alert(Resources.BAD_RESPONSE);\n } else {\n window.alert(Resources.SERVER_CONNECTION_ERROR);\n }\n }).always(function () {\n $bonusProduct.dialog('close');\n });\n }).on('click', '#more-bonus-products', function (e) {\n e.preventDefault();\n var uuid = $('#bonus-product-list').data().lineItemDetail.uuid;\n\n //get the next page of choice of bonus products\n var lineItemDetail = JSON.parse($('#bonus-product-list').attr('data-line-item-detail'));\n lineItemDetail.pageStart = lineItemDetail.pageStart + lineItemDetail.pageSize;\n $('#bonus-product-list').attr('data-line-item-detail', JSON.stringify(lineItemDetail));\n\n var url = util.appendParamsToUrl(Urls.getBonusProducts, {\n bonusDiscountLineItemUUID: uuid,\n format: 'ajax',\n lazyLoad: 'true',\n pageStart: lineItemDetail.pageStart,\n pageSize: $('#bonus-product-list').data().lineItemDetail.pageSize,\n bonusProductsTotal: $('#bonus-product-list').data().lineItemDetail.bpTotal\n });\n\n $.ajax({\n type: 'GET',\n cache: false,\n contentType: 'application/json',\n url: url\n }).done(function (data) {\n //add the new page to DOM and remove 'More' link if it is the last page of results\n $('#more-bonus-products').before(data);\n if (lineItemDetail.pageStart + lineItemDetail.pageSize >= $('#bonus-product-list').data().lineItemDetail.bpTotal) {\n $('#more-bonus-products').remove();\n }\n }).fail(function (xhr, textStatus) {\n if (textStatus === 'parsererror') {\n window.alert(Resources.BAD_RESPONSE);\n } else {\n window.alert(Resources.SERVER_CONNECTION_ERROR);\n }\n });\n });\n}\n\nvar bonusProductsView = {\n /**\r\n * @function\r\n * @description Open the list of bonus products selection dialog\r\n */\n show: function show(url) {\n var $bonusProduct = $('#bonus-product-dialog');\n // create the dialog\n dialog.open({\n target: $bonusProduct,\n url: url,\n options: {\n width: 795,\n title: Resources.BONUS_PRODUCTS\n },\n callback: function callback() {\n initializeGrid();\n hideSwatches();\n }\n });\n },\n /**\r\n * @function\r\n * @description Open bonus product promo prompt dialog\r\n */\n loadBonusOption: function loadBonusOption() {\n var self = this,\n bonusDiscountContainer = document.querySelector('.bonus-discount-container');\n if (!bonusDiscountContainer) {\n return;\n }\n\n // get the html from minicart, then trash it\n var bonusDiscountContainerHtml = bonusDiscountContainer.outerHTML;\n bonusDiscountContainer.parentNode.removeChild(bonusDiscountContainer);\n\n dialog.open({\n html: bonusDiscountContainerHtml,\n options: {\n width: 'auto',\n title: Resources.BONUS_PRODUCT,\n dialogClass: 'bonus-eligibility-modal',\n buttons: [{\n text: Resources.SELECT_BONUS_PRODUCTS,\n click: function click() {\n var uuid = $('.bonus-product-promo').data('lineitemid'),\n url = util.appendParamsToUrl(Urls.showBonusProducts, {\n bonusDiscountLineItemUUID: uuid,\n source: 'bonus',\n format: 'ajax',\n lazyLoad: 'false',\n pageStart: 0,\n pageSize: 0,\n bonusProductsTotal: -1\n });\n $(this).dialog('close');\n //self.show(url);\n modal.addCustomClass('bonus-item-modal');\n modal.renderByUrl(url);\n }\n }, {\n text: Resources.NO_THANKS,\n click: function click() {\n $(this).dialog('close');\n }\n }]\n },\n callback: function callback() {\n // show hide promo details\n $('.show-promo-details').on('click', function () {\n $('.promo-details').toggleClass('visible');\n });\n }\n });\n },\n\n hasBonusOptions: function hasBonusOptions() {\n return $(\".bonus-discount-container\").length > 0;\n }\n};\n\nmodule.exports = bonusProductsView;\n\n},{\"./dialog\":9,\"./modal\":19,\"./page\":23,\"./util\":68}],5:[function(require,module,exports){\n'use strict';\n\nvar page = require('./page'),\n util = require('./util'),\n TPromise = require('promise');\n\nvar _currentCategory = '',\n MAX_ACTIVE = 6;\n\n/**\r\n * @private\r\n * @function\r\n * @description Verifies the number of elements in the compare container and updates it with sequential classes for ui targeting\r\n */\nfunction refreshContainer() {\n var $compareContainer = $('.compare-items');\n var $compareItems = $compareContainer.find('.compare-item');\n var numActive = $compareItems.filter('.active').length;\n\n if (numActive < 2) {\n $('#compare-items-button').attr('disabled', 'disabled');\n } else {\n $('#compare-items-button').removeAttr('disabled');\n }\n\n $compareContainer.toggle(numActive > 0);\n}\n/**\r\n * @private\r\n * @function\r\n * @description Adds an item to the compare container and refreshes it\r\n */\nfunction addToList(data) {\n // get the first compare-item not currently active\n var $item = $('.compare-items .compare-item').not('.active').first(),\n $productTile = $('#' + data.uuid);\n\n if ($item.length === 0) {\n if ($productTile.length > 0) {\n $productTile.find('.compare-check')[0].checked = false;\n }\n window.alert(Resources.COMPARE_ADD_FAIL);\n return;\n }\n\n // if already added somehow, return\n if ($('[data-uuid=\"' + data.uuid + '\"]').length > 0) {\n return;\n }\n // set as active item\n $item.addClass('active').attr('data-uuid', data.uuid).attr('data-itemid', data.itemid).data('uuid', data.uuid).data('itemid', data.itemid).append($(data.img).clone().addClass('compare-item-image'));\n}\n/**\r\n * @private\r\n * @function\r\n * description Removes an item from the compare container and refreshes it\r\n */\nfunction removeFromList($item) {\n if ($item.length === 0) {\n return;\n }\n // remove class, data and id from item\n $item.removeClass('active').removeAttr('data-uuid').removeAttr('data-itemid').data('uuid', '').data('itemid', '')\n // remove the image\n .find('.compare-item-image').remove();\n}\n\nfunction addProductAjax(args) {\n var promise = new TPromise(function (resolve, reject) {\n $.ajax({\n url: Urls.compareAdd,\n data: {\n pid: args.itemid,\n category: _currentCategory\n },\n dataType: 'json'\n }).done(function (response) {\n if (!response || !response.success) {\n reject(new Error(Resources.COMPARE_ADD_FAIL));\n } else {\n resolve(response);\n }\n }).fail(function (jqxhr, status, err) {\n reject(new Error(err));\n });\n });\n return promise;\n}\n\nfunction removeProductAjax(args) {\n var promise = new TPromise(function (resolve, reject) {\n $.ajax({\n url: Urls.compareRemove,\n data: {\n pid: args.itemid,\n category: _currentCategory\n },\n dataType: 'json'\n }).done(function (response) {\n if (!response || !response.success) {\n reject(new Error(Resources.COMPARE_REMOVE_FAIL));\n } else {\n resolve(response);\n }\n }).fail(function (jqxhr, status, err) {\n reject(new Error(err));\n });\n });\n return promise;\n}\n\nfunction shiftImages() {\n return new TPromise(function (resolve) {\n var $items = $('.compare-items .compare-item');\n $items.each(function (i, item) {\n var $item = $(item);\n // last item\n if (i === $items.length - 1) {\n return removeFromList($item);\n }\n var $next = $items.eq(i + 1);\n if ($next.hasClass('active')) {\n // remove its own image\n $next.find('.compare-item-image').detach().appendTo($item);\n $item.addClass('active').attr('data-uuid', $next.data('uuid')).attr('data-itemid', $next.data('itemid')).data('uuid', $next.data('uuid')).data('itemid', $next.data('itemid'));\n }\n });\n resolve();\n });\n}\n\n/**\r\n * @function\r\n * @description Adds product to the compare table\r\n */\nfunction addProduct(args) {\n var promise;\n var $items = $('.compare-items .compare-item');\n var $cb = $(args.cb);\n var numActive = $items.filter('.active').length;\n if (numActive === MAX_ACTIVE) {\n if (!window.confirm(Resources.COMPARE_CONFIRMATION)) {\n $cb[0].checked = false;\n return;\n }\n\n // remove product using id\n var $firstItem = $items.first();\n promise = removeItem($firstItem).then(function () {\n return shiftImages();\n });\n } else {\n promise = TPromise.resolve(0);\n }\n return promise.then(function () {\n return addProductAjax(args).then(function () {\n addToList(args);\n if ($cb && $cb.length > 0) {\n $cb[0].checked = true;\n }\n refreshContainer();\n });\n }).then(null, function () {\n if ($cb && $cb.length > 0) {\n $cb[0].checked = false;\n }\n });\n}\n\n/**\r\n * @function\r\n * @description Removes product from the compare table\r\n * @param {object} args - the arguments object should have the following properties: itemid, uuid and cb (checkbox)\r\n */\nfunction removeProduct(args) {\n var $cb = args.cb ? $(args.cb) : null;\n return removeProductAjax(args).then(function () {\n var $item = $('[data-uuid=\"' + args.uuid + '\"]');\n removeFromList($item);\n if ($cb && $cb.length > 0) {\n $cb[0].checked = false;\n }\n refreshContainer();\n }, function () {\n if ($cb && $cb.length > 0) {\n $cb[0].checked = true;\n }\n });\n}\n\nfunction removeItem($item) {\n var uuid = $item.data('uuid'),\n $productTile = $('#' + uuid);\n return removeProduct({\n itemid: $item.data('itemid'),\n uuid: uuid,\n cb: $productTile.length === 0 ? null : $productTile.find('.compare-check')\n });\n}\n\n/**\r\n * @private\r\n * @function\r\n * @description Initializes the DOM-Object of the compare container\r\n */\nfunction initializeDom() {\n var $compareContainer = $('.compare-items');\n _currentCategory = $compareContainer.data('category') || '';\n var $active = $compareContainer.find('.compare-item').filter('.active');\n $active.each(function () {\n var $productTile = $('#' + $(this).data('uuid'));\n if ($productTile.length === 0) {\n return;\n }\n $productTile.find('.compare-check')[0].checked = true;\n });\n // set container state\n refreshContainer();\n}\n\n/**\r\n * @private\r\n * @function\r\n * @description Initializes the events on the compare container\r\n */\nfunction initializeEvents() {\n // add event to buttons to remove products\n $('.compare-item').on('click', '.compare-item-remove', function () {\n removeItem($(this).closest('.compare-item'));\n });\n\n // Button to go to compare page\n $('#compare-items-button').on('click', function () {\n page.redirect(util.appendParamToURL(Urls.compareShow, 'category', _currentCategory));\n });\n\n // Button to clear all compared items\n // rely on refreshContainer to take care of hiding the container\n $('#clear-compared-items').on('click', function () {\n $('.compare-items .active').each(function () {\n removeItem($(this));\n });\n });\n}\n\nexports.init = function () {\n initializeDom();\n initializeEvents();\n};\n\nexports.addProduct = addProduct;\nexports.removeProduct = removeProduct;\n\n},{\"./page\":23,\"./util\":68,\"promise\":76}],6:[function(require,module,exports){\n'use strict';\n\nvar dialog = require('./dialog');\n\n/**\r\n * @function cookieprivacy Used to display/control the scrim containing the cookie privacy code\r\n **/\nmodule.exports = function () {\n /**\r\n * If we have not accepted cookies AND we're not on the Privacy Policy page, then show the notification\r\n * NOTE: You will probably want to adjust the Privacy Page test to match your site's specific privacy / cookie page\r\n */\n if (SitePreferences.COOKIE_HINT === true && document.cookie.indexOf('dw_cookies_accepted') < 0) {\n // check for privacy policy page\n if ($('.privacy-policy').length === 0) {\n dialog.open({\n url: Urls.cookieHint,\n options: {\n closeOnEscape: false,\n dialogClass: 'no-close',\n buttons: [{\n text: Resources.I_AGREE,\n click: function click() {\n $(this).dialog('close');\n enableCookies();\n }\n }]\n }\n });\n }\n } else {\n // Otherwise, we don't need to show the asset, just enable the cookies\n enableCookies();\n }\n\n function enableCookies() {\n if (document.cookie.indexOf('dw=1') < 0) {\n document.cookie = 'dw=1; path=/';\n }\n if (document.cookie.indexOf('dw_cookies_accepted') < 0) {\n document.cookie = 'dw_cookies_accepted=1; path=/';\n }\n }\n};\n\n},{\"./dialog\":9}],7:[function(require,module,exports){\n'use strict';\n\nexports.init = function init() {\n $('.country-selector .current-country').on('click', function () {\n $('.country-selector .selector').toggleClass('active');\n $(this).toggleClass('selector-active');\n });\n // set currency first before reload\n $('.country-selector .selector .locale').on('click', function (e) {\n e.preventDefault();\n var url = this.href;\n var currency = this.getAttribute('data-currency');\n $.ajax({\n dataType: 'json',\n url: Urls.setSessionCurrency,\n data: {\n format: 'ajax',\n currencyMnemonic: currency\n }\n }).done(function (response) {\n if (!response.success) {\n throw new Error('Unable to set currency');\n }\n window.location.href = url;\n });\n });\n};\n\n},{}],8:[function(require,module,exports){\n'use strict';\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nvar design = {\n init: function init() {\n //product search\n this.productSearchInit();\n\n //product list\n this.plpInit();\n\n //PDP\n this.pdpInit();\n\n //tmp_video\n this.tmpVideoInit();\n\n //tmp_recently\n this.tmpRecentlyInit();\n\n //tmp_image\n this.tmpImageInit();\n\n this.commonInit();\n },\n tmpImageInit: function tmpImageInit() {\n $(function () {\n $('.c-block-template_02-slider-main').slick({\n asNavFor: \".c-block-template_02-slider-thumbnail\",\n arrows: false,\n responsive: [{\n breakpoint: 991,\n settings: {\n arrows: false,\n dots: true\n }\n }, {\n breakpoint: 768,\n settings: {\n arrows: false,\n dots: false\n }\n }]\n });\n $('.c-block-template_02-slider-thumbnail').slick({\n asNavFor: \".c-block-template_02-slider-main\",\n slidesToShow: 4,\n slidesToScroll: 1,\n focusOnSelect: true\n });\n });\n },\n plpInit: function plpInit() {\n $(function () {\n $('.c-product-cards-color-more>a').off('click').on('click', function () {\n $(this).closest('.c-product-cards-color').addClass('is-active');\n $(this).closest('.c-product-cards-color').find('.c-list-color.is-hidden').removeClass('is-hidden');\n $(this).parent().addClass('is-hidden');\n matchHeightProducts();\n return false;\n });\n\n $('.c-list-color li > a').on('click mousehover', function () {\n if (window.innerWidth > 767) {\n var thumbIndex = $(this).closest('.c-product-cards-color-list').find('a').index(this);\n $(this).closest('.c-product-cards').find('.c-product-cards-photo-img > img').stop().hide();\n $(this).closest('.c-product-cards').find('.c-list-color-panel').removeClass('is-current');\n if ($(this).closest('.c-product-cards').find('.c-product-cards-photo-img > img').eq(thumbIndex).is(':hidden')) {\n $(this).closest('.c-product-cards').find('.c-product-cards-photo-img > img').eq(thumbIndex).fadeIn(\"slow\");\n $(this).children('.c-list-color-panel').addClass('is-current');\n }\n return false;\n }\n });\n\n // SP size When there is nothing to display on Filter \"Filter\" itself is not displayed.\n if (window.innerWidth < 991 && $('.c-block-products-search-panel--filter li').length == 0) {\n $('.c-block-products-search-tabs--filter').remove();\n $('.c-block-products-search-panel--filter').remove();\n }\n\n // $('.c-list-color li > a').hover(function(){\n // \tif(window.innerWidth>991) {\n // \t\t$(this).trigger('mousehover');\n // \t}\n // });\n });\n },\n selectGiftInit: function selectGiftInit() {\n $(function () {\n $('.c-block-shopingmodal .c-list-color a').on('colorSelect', function () {\n var element = $(this).closest('.c-list-color').find('a').index(this);\n $(this).closest('.c-block-shopingmodal').find('.c-block-shopingmodal-change-image').each(function () {\n $(this).children().stop().hide(), $(this).children().eq(element).fadeIn();\n });\n $(this).closest('.c-block-shopingmodal').find('.c-block-shopingmodal-side-colorSelect .c-select-list-item a').removeClass('is-selected');\n $(this).closest('.c-block-shopingmodal').find('.c-block-shopingmodal-side-colorSelect .c-select-list-item a').eq(element).addClass('is-selected');\n var text = $(this).closest('.c-block-shopingmodal').find('.c-select-list-item>a.is-selected .c-select-list-item-text').html();\n $(this).closest('.c-block-shopingmodal').find('.c-block-shopingmodal-side-colorSelect .c-select-current').html(text);\n $(this).closest(\".c-list-color\").find(\".c-list-color-panel\").removeClass(\"is-current\");\n $(this).children(\".c-list-color-panel\").addClass(\"is-current\");\n });\n\n $('.c-block-shopingmodal .c-list-color a').on('click', function () {\n if (767 < window.innerWidth) {\n var element = $(this).closest('.c-list-color').find('a').index(this);\n $('.c-block-shopingmodal .c-list-color a').eq(element).trigger('colorSelect');\n }\n });\n\n $('.c-block-shopingmodal-side-colorSelect .c-select-list-item a').on('click', function () {\n var element = $(this).closest('.c-select-list').find('a').index(this);\n $('.c-block-shopingmodal .c-list-color a').eq(element).trigger('colorSelect');\n return false;\n });\n });\n },\n selectQuantityInit: function selectQuantityInit() {\n $(function () {\n //countup\n $('.c-quantitySelection-btn-plus a').off('click').on('click', function () {\n var current = $(this).closest('.c-quantitySelection').find('.c-select-current');\n var currentNum = current.html();\n var limit = $(this).closest('.c-quantitySelection').find('.c-select-list-item').length;\n var index = $(this).closest('.c-quantitySelection').find('.c-select-list-item').index();\n currentNum++;\n var qtyReal = limit;\n if (currentNum <= limit) {\n current.html(currentNum);\n $(this).closest('.c-quantitySelection').find('.c-select-list-item').children('a').removeClass('is-selected');\n $(this).closest('.c-quantitySelection').find('.c-select-list-item').eq(currentNum - 1).children('a').addClass('is-selected');\n qtyReal = currentNum;\n }\n\n $(this).closest('.c-quantitySelection-btn-gather').prev().val(qtyReal);\n return false;\n });\n\n //countdown\n $('.c-quantitySelection-btn-minus a').off('click').on('click', function () {\n var current = $(this).closest('.c-quantitySelection').find('.c-select-current');\n var currentNum = current.html();\n var limit = $(this).closest('.c-quantitySelection').find('.c-select-list-item').length;\n var index = $(this).closest('.c-quantitySelection').find('.c-select-list-item').index();\n\n var qtyReal = 1;\n if (currentNum > 1) {\n currentNum--;\n current.html(currentNum);\n $(this).closest('.c-quantitySelection').find('.c-select-list-item').children('a').removeClass('is-selected');\n $(this).closest('.c-quantitySelection').find('.c-select-list-item').eq(currentNum - 1).children('a').addClass('is-selected');\n qtyReal = currentNum;\n } else if (currentNum == 0) {\n $(this).closest('.c-quantitySelection').find('.c-select-list-item').children('a').removeClass('is-selected');\n }\n\n $(this).closest('.c-quantitySelection-btn-gather').prev().val(qtyReal);\n return false;\n });\n\n // Change quantity on cart\n $('.c-list-products-full-item--cart .c-quantitySelection-btn-plus a').off('click').on('click', function () {\n var current = $(this).closest('.c-quantitySelection').find('.c-select-current');\n var currentNum = current.html();\n var limit = $(this).closest('.c-quantitySelection').find('.c-select-list-item').length;\n var index = $(this).closest('.c-quantitySelection').find('.c-select-list-item').index();\n currentNum++;\n var qtyReal = limit;\n if (currentNum <= limit) {\n current.html(currentNum);\n $(this).closest('.c-quantitySelection').find('.c-select-list-item').children('a').removeClass('is-selected');\n $(this).closest('.c-quantitySelection').find('.c-select-list-item').eq(currentNum - 1).children('a').addClass('is-selected');\n qtyReal = currentNum;\n }\n\n $(this).closest('.c-quantitySelection-btn-gather').prev().val(qtyReal);\n $(this).parents(\".c-quantitySelection\").find('input[type=\"hidden\"]').val(qtyReal);\n $('input[name$=_deleteGiftCertificate]').remove();\n $('input[name$=_deleteProduct]').remove();\n $(this).closest('form').submit();\n });\n\n $('.c-list-products-full-item--cart .c-quantitySelection-btn-minus a').off('click').on('click', function () {\n var current = $(this).closest('.c-quantitySelection').find('.c-select-current');\n var currentNum = current.html();\n var limit = $(this).closest('.c-quantitySelection').find('.c-select-list-item').length;\n var index = $(this).closest('.c-quantitySelection').find('.c-select-list-item').index();\n\n var qtyReal = 1;\n if (currentNum > 1) {\n currentNum--;\n current.html(currentNum);\n $(this).closest('.c-quantitySelection').find('.c-select-list-item').children('a').removeClass('is-selected');\n $(this).closest('.c-quantitySelection').find('.c-select-list-item').eq(currentNum - 1).children('a').addClass('is-selected');\n qtyReal = currentNum;\n } else if (currentNum == 0) {\n $(this).closest('.c-quantitySelection').find('.c-select-list-item').children('a').removeClass('is-selected');\n }\n\n $(this).closest('.c-quantitySelection-btn-gather').prev().val(qtyReal);\n $(this).parents(\".c-quantitySelection\").find('input[type=\"hidden\"]').val(qtyReal);\n $('input[name$=_deleteGiftCertificate]').remove();\n $('input[name$=_deleteProduct]').remove();\n $(this).closest('form').submit();\n });\n });\n },\n toggleSelectInit: function toggleSelectInit(eventContinue) {\n $(function () {\n // select open\n $('.c-dropdown-toggle').off('click').on('click', function () {\n if (!$(this).parents('.c-block-review').length) {\n if ($(this).parents('.c-dropdown').find('.c-select-list').is(':hidden')) {\n $('.c-select-list').hide();\n $(this).parents('.c-dropdown').find('.c-select-list').show();\n } else {\n $(this).parents('.c-dropdown').find('.c-select-list').hide();\n }\n return false;\n }\n });\n });\n\n $(function () {\n eventContinue = eventContinue || false;\n\n // select\n $('.c-select-toggle').off('click').on('click', function () {\n if ($(this).next('.c-select-list').is(':hidden') && !$(this).hasClass('is-noselect')) {\n $('.c-select-list').hide();\n $(this).next('.c-select-list').show();\n\n // Auto up down display\n var offset = $(this).offset();\n var posY = offset.top - $(window).scrollTop();\n var heightS = $(window).height();\n if (posY * 2 > heightS) {\n $(this).next('.c-select-list').addClass('up');\n } else {\n $(this).next('.c-select-list').removeClass('up');\n }\n } else {\n $(this).next('.c-select-list').hide();\n }\n });\n\n $('.c-select-list-item a').off('click').on('click', function (e) {\n e.preventDefault();\n var current = $(this).closest('.c-select').find('.c-select-current');\n var value = $(this).data('v') || $(this).find('span').data('num'); // form field and quantity selector \n var displayValue = $(this).children('.c-select-list-item-text').html();\n $(this).closest('.c-select-list').find('.c-select-list-item').children('a').removeClass('is-selected');\n $(this).addClass('is-selected');\n current.html(displayValue);\n $(this).closest('.c-select-list').hide();\n $(this).closest('.c-select').next().val(value);\n $(this).closest('.c-select').next().change();\n\n if ($(this).closest('.c-block-shopingmodal-side-colorSelect').length > 0 || $(this).closest('.c-block-shoppingDock').length > 0) {\n var index = $(this).closest('.c-select-list').find('a').index(this);\n if ($(this).closest('.c-block-shopingmodal-set-item').length > 0) {\n $(this).closest('.c-block-shopingmodal-set-item').find('.c-list-color a').eq(index).trigger('colorSelect');\n }\n\n if ($(this).closest('.product-variations').length > 0) {\n $(this).closest('.product-variations').find('.c-list-color a').eq(index).trigger('colorSelect');\n }\n\n if ($(this).closest('.c-block-shoppingDock').length > 0) {\n $('.product-variations').find('.c-list-color a').eq(index).trigger('colorSelect');\n }\n }\n return eventContinue;\n });\n\n $('.c-list-products-full-item--cart .c-select-list-item a').off('click').on('click', function (e) {\n e.preventDefault();\n var current = $(this).closest('.c-select').find('.c-select-current');\n var value = $(this).data('v') || $(this).find('span').data('num'); // form field and quantity selector \n var displayValue = $(this).children('.c-select-list-item-text').html();\n $(this).closest('.c-select-list').find('.c-select-list-item').children('a').removeClass('is-selected');\n $(this).addClass('is-selected');\n current.html(displayValue);\n $(this).closest('.c-select-list').hide();\n $(this).closest('.c-select').next().val(value);\n $(this).closest('.c-select').next().change();\n\n if ($(this).closest('.c-block-shopingmodal-side-colorSelect')) {\n var index = $(this).closest('.c-select-list').find('a').index(this);\n if ($(this).closest('.c-block-shopingmodal-set-item')) {\n $(this).closest('.c-block-shopingmodal-set-item').find('.c-list-color a').eq(index).trigger('colorSelect');\n }\n\n if ($(this).closest('.product-variations')) {\n $(this).closest('.product-variations').find('.c-list-color a').eq(index).trigger('colorSelect');\n }\n }\n var quantity = $(this).closest('.c-quantitySelection').find('.c-select-current').text();\n $(this).closest('.c-quantitySelection').find('input[type=\"hidden\"]').val(quantity);\n $('input[name$=_deleteGiftCertificate]').remove();\n $('input[name$=_deleteProduct]').remove();\n $(this).closest('form').submit();\n });\n\n $(document).on('touchstart click', function (e) {\n if (!$(e.target).closest('.c-select').length && !$(e.target).closest('.c-dropdown').length) {\n $('.c-select-list').hide();\n }\n });\n });\n },\n productSearchInit: function productSearchInit() {\n $(window).on('load resize', function () {\n if (window.innerWidth > 767) {\n setTimeout(function () {\n matchHeightProducts();\n }, 50);\n }\n });\n\n $(function () {\n $('.c-block-products-search-tabs .tab').off('click').on('click', function () {\n if (window.innerWidth < 991) {\n var num = $(this).closest('.c-block-products-search-tabs').find('.tab').index(this);\n if ($(this).closest('.c-block-products-search-tabs').next('.c-block-products-search-panels').find('.c-block-products-search-panel').eq(num).is(':hidden')) {\n $(this).closest('.c-block-products-search-tabs').next('.c-block-products-search-panels').find('.c-block-products-search-panel').removeClass('is-active');\n $('.c-block-products-search-tabs .tab').removeClass('is-active');\n $(this).closest('.c-block-products-search-tabs').next('.c-block-products-search-panels').find('.c-block-products-search-panel').eq(num).addClass('is-active');\n $(this).addClass('is-active');\n } else {\n $(this).closest('.c-block-products-search-tabs').next('.c-block-products-search-panels').find('.c-block-products-search-panel').eq(num).removeClass('is-active');\n $(this).removeClass('is-active');\n }\n return false;\n }\n });\n });\n },\n modalInit: function modalInit() {\n $.extend(true, $.magnificPopup.defaults, {\n tClose: Resources.POPUP_CLOSE,\n tLoading: Resources.POPUP_LOADING,\n gallery: {\n tPrev: Resources.POPUP_PREVIOUS,\n tNext: Resources.POPUP_NEXT,\n tCounter: Resources.POPUP_COUNTER\n },\n image: {\n tError: Resources.POPUP_ERROR\n }\n });\n\n $('.c-modal-img').magnificPopup({\n type: 'image',\n removalDelay: 500,\n fixedContentPos: true,\n callbacks: {\n open: function open() {\n $(\".mfp-container\").addClass(\"row\");\n $.magnificPopup.instance.close = function () {\n if (window.innerWidth < 992) {\n var scrollpos = $('body').attr('data-scroll');\n $('html,body').removeAttr('data-scroll').removeClass('is-noscroll').css({ 'top': 0 }).scrollTop(scrollpos);\n }\n $.magnificPopup.proto.close.call(this);\n };\n }\n }\n\n });\n\n $('.c-modal-video').each(function () {\n var link = $(this).attr('href');\n $(this).magnificPopup({\n type: 'iframe',\n removalDelay: 600,\n fixedContentPos: true,\n iframe: {\n patterns: {\n youtube: {\n src: link\n }\n }\n },\n callbacks: {\n open: function open() {\n $(\".mfp-container\").addClass(\"row\");\n $.magnificPopup.instance.close = function () {\n if (window.innerWidth < 992) {\n var scrollpos = $('body').attr('data-scroll');\n $('html,body').removeAttr('data-scroll').removeClass('is-noscroll').css({ 'top': 0 }).scrollTop(scrollpos);\n }\n $.magnificPopup.proto.close.call(this);\n };\n }\n }\n });\n });\n\n $('.c-modal-video-fullscreen').each(function () {\n var link = $(this).attr('href');\n $(this).magnificPopup({\n type: 'iframe',\n removalDelay: 600,\n fixedContentPos: true,\n iframe: {\n patterns: {\n youtube: {\n src: link\n }\n }\n },\n callbacks: {\n open: function open() {\n $(\".mfp-container\").addClass(\"row mfp-iframe-holder-fullscreen\");\n $.magnificPopup.instance.close = function () {\n if (window.innerWidth < 992) {\n var scrollpos = $('body').attr('data-scroll');\n $('html,body').removeAttr('data-scroll').removeClass('is-noscroll').css({ 'top': 0 }).scrollTop(scrollpos);\n }\n $.magnificPopup.proto.close.call(this);\n };\n }\n }\n });\n });\n\n $('.c-modal-inline').magnificPopup({\n type: 'inline',\n removalDelay: 500,\n preloader: false,\n fixedContentPos: true,\n callbacks: {\n open: function open() {\n $(\".mfp-container\").addClass(\"row\");\n $(\".mfp-content > div\").addClass(\"row\");\n $('.slick-slider').slick('setPosition');\n $('.c-slider-products-landscape').slick('setPosition');\n $('.c-slider-products-vertical').slick('setPosition');\n matchHeightProducts();\n if ($('.c-block-sampleselection-body').length) {\n $('.c-block-sampleselection-body').getNiceScroll().resize();\n }\n $.magnificPopup.instance.close = function () {\n if (window.innerWidth < 992) {\n var scrollpos = $('body').attr('data-scroll');\n $('html,body').removeAttr('data-scroll').removeClass('is-noscroll').css({ 'top': 0 }).scrollTop(scrollpos);\n }\n $.magnificPopup.proto.close.call(this);\n };\n }\n }\n });\n\n $('.c-modal-autoreplenishment').on(\"click\", function (e) {\n if ($.magnificPopup.instance.st !== undefined) {\n e.stopPropagation();\n $.magnificPopup.instance.st.callbacks = {\n afterClose: function afterClose() {\n if ($('#shopingmodal').length > 0) {\n e.stopPropagation();\n $.magnificPopup.open({\n items: {\n src: '#shopingmodal',\n type: 'inline',\n removalDelay: 500\n }\n });\n }\n }\n };\n }\n\n $.magnificPopup.open({\n items: {\n src: '#autoreplenishmentmodal',\n type: 'inline',\n removalDelay: 500\n }\n });\n });\n\n $(document).on(\"click\", '.c-block-share-toggle.c-modal', function (e) {\n if ($.magnificPopup.instance.st !== undefined) {\n e.stopPropagation();\n $.magnificPopup.instance.st.callbacks = {\n afterClose: function afterClose() {\n if ($('#shopingmodal').length > 0) {\n e.stopPropagation();\n $.magnificPopup.open({\n items: {\n src: '#shopingmodal',\n type: 'inline',\n removalDelay: 500\n }\n });\n }\n }\n };\n }\n\n $.magnificPopup.open({\n items: {\n src: '#sharemodal',\n type: 'inline',\n removalDelay: 500\n }\n });\n });\n\n $('.c-modal-inline--noclose').magnificPopup({\n type: 'inline',\n removalDelay: 500,\n preloader: false,\n fixedContentPos: true,\n showCloseBtn: false,\n closeOnBgClick: false,\n callbacks: {\n open: function open() {\n $(\".mfp-container\").addClass(\"row\");\n $(\".mfp-content > div\").addClass(\"row\");\n matchHeightProducts();\n $.magnificPopup.instance.close = function () {\n if (window.innerWidth < 992) {\n var scrollpos = $('body').attr('data-scroll');\n $('html,body').removeAttr('data-scroll').removeClass('is-noscroll').css({ 'top': 0 }).scrollTop(scrollpos);\n }\n $.magnificPopup.proto.close.call(this);\n };\n }\n }\n });\n\n $('.c-modal-finish').click(function (e) {\n $.magnificPopup.open({\n items: {\n src: $('#finishmodal')\n },\n type: 'inline',\n removalDelay: 500,\n preloader: false,\n fixedContentPos: true,\n showCloseBtn: false,\n closeOnBgClick: false,\n callbacks: {\n open: function open() {\n $(\".mfp-container\").addClass(\"row\");\n $(\".mfp-content > div\").addClass(\"row\");\n matchHeightProducts();\n $.magnificPopup.instance.close = function () {\n if (window.innerWidth < 992) {\n var scrollpos = $('body').attr('data-scroll');\n $('html,body').removeAttr('data-scroll').removeClass('is-noscroll').css({ 'top': 0 }).scrollTop(scrollpos);\n }\n $.magnificPopup.proto.close.call(this);\n };\n }\n }\n\n });\n return e.preventDefault();\n });\n\n $('.c-modal-gallery').magnificPopup({\n delegate: 'a',\n type: 'image',\n removalDelay: 500,\n fixedContentPos: true,\n gallery: {\n enabled: true\n },\n image: {\n titleSrc: function titleSrc(item) {\n return item.el.attr('title') || item.el.find('img').attr('alt');\n }\n },\n callbacks: {\n open: function open() {\n $(\".mfp-container\").addClass(\"row\");\n $.magnificPopup.instance.close = function () {\n if (window.innerWidth < 992) {\n var scrollpos = $('body').attr('data-scroll');\n $('html,body').removeAttr('data-scroll').removeClass('is-noscroll').css({ 'top': 0 }).scrollTop(scrollpos);\n }\n $.magnificPopup.proto.close.call(this);\n };\n }\n }\n });\n\n $('.c-modal-iframe').magnificPopup({\n type: 'iframe',\n removalDelay: 500,\n fixedContentPos: true,\n preloader: false\n });\n\n $('.c-modal-cart-alert').magnificPopup({\n type: 'inline',\n removalDelay: 500,\n fixedContentPos: true,\n preloader: false\n });\n\n $(document).off('click', '.c-modal').on('click', '.c-modal', function (e) {\n if (window.innerWidth < 992) {\n var scrollpos = $(window).scrollTop();\n $('body').attr('data-scroll', scrollpos);\n $('body').addClass('is-noscroll').css({ 'top': -scrollpos });\n }\n });\n $('.c-modal-close').off('click').on('click', function (e) {\n e.preventDefault();\n $.magnificPopup.instance.close = function () {\n if (window.innerWidth < 992) {\n var scrollpos = $('body').attr('data-scroll');\n $('html,body').removeAttr('data-scroll').removeClass('is-noscroll').css({ 'top': 0 }).scrollTop(scrollpos);\n }\n $.magnificPopup.proto.close.call(this);\n };\n var magnificPopup = $.magnificPopup.instance;\n magnificPopup.close();\n });\n $('.c-modal-cart-alert-close').off('click').on('click', function (e) {\n e.preventDefault();\n $.magnificPopup.instance.close = function () {\n if (window.innerWidth < 992) {\n var scrollpos = $('body').attr('data-scroll');\n $('html,body').removeAttr('data-scroll').removeClass('is-noscroll').css({ 'top': 0 }).scrollTop(scrollpos);\n }\n $.magnificPopup.proto.close.call(this);\n };\n });\n },\n footerInit: function footerInit() {\n $(function () {\n $('.ge-changeregion-toggle').off('click').on('click', function () {\n var scrollpos;\n if ($('.ge-changeregion').is(':hidden')) {\n var scroll_bar = window.innerWidth - $(window).width();\n if ($('.ge-navi-list').is(':visible') || window.innerWidth < 992) {\n var scrollpos = $('body').attr('data-scroll');\n $('body').attr('data-scroll', scrollpos);\n $('body').addClass('is-noscroll').css({ 'top': -scrollpos });\n } else {\n var scrollpos = $(window).scrollTop();\n $('body').attr('data-scroll', scrollpos);\n $('body').addClass('is-noscroll').css({ 'top': -scrollpos });\n }\n\n $('.ge-changeregion').fadeIn();\n $('.slick-slider').slick('setPosition');\n $('.ge-changeregion-close').css('padding-right', scroll_bar);\n if ($('.ge-changeregion-results-list').length) {\n $('.ge-changeregion').addClass('is-result');\n } else {\n $('.ge-changeregion').removeClass('is-result');\n }\n if (window.innerWidth < 992) {\n $('.ge-naviSpToggle').removeClass('is-active');\n $('.ge-header').removeClass('is-active');\n $('.ge-navi').fadeOut();\n }\n }\n return false;\n });\n $('.ge-changeregion-close a').off('click').on('click', function () {\n var scrollpos = $('body').attr('data-scroll');\n $('html,body').removeAttr('data-scroll').removeClass('is-noscroll').css({ 'top': 0 }).scrollTop(scrollpos);\n $('.ge-changeregion').fadeOut();\n $('.ge-changeregion').removeClass('is-result');\n return false;\n });\n });\n },\n headerInit: function headerInit() {\n $(function () {\n $('.js-navi-toggle a').off('click').on('click', function (e) {\n $('.ge-header').toggleClass('is-naviOpen');\n $(this).parent().toggleClass('is-active');\n $('.js-navi-list').slideToggle();\n return false;\n });\n\n //PC MEGA MENU item hover\n $('.ge-navi-list-first-text > a').hover(function () {\n if (window.innerWidth > 992) {\n $('.ge-navi-list-first-panel').not(this).stop().fadeOut();\n $('.ge-navi-list-first-text > a').not(this).removeClass('is-active');\n $(this).addClass('is-active');\n $(this).parent('.ge-navi-list-first-text ').next('.ge-navi-list-first-panel').stop().fadeIn();\n }\n });\n\n //TABLET, MOBILE Navi open\n $('.ge-naviSpToggle > a').off('click').on('click', function () {\n var scrollpos = 0;\n if ($('.ge-navi').is(':hidden')) {\n $('.ge-navi').fadeIn();\n $('.ge-header').addClass('is-active');\n if (window.innerWidth < 992 || $('body').hasClass('is-noscroll')) {\n var scrollpos = $(window).scrollTop();\n $('body').attr('data-scroll', scrollpos);\n $(this).parent().addClass('is-active');\n $('body').addClass('is-noscroll').css({ 'top': -scrollpos });\n }\n } else {\n $('.ge-navi').fadeOut();\n $('.ge-header').removeClass('is-active');\n if (window.innerWidth < 992) {\n var scrollpos = $('body').attr('data-scroll');\n $(this).parent().removeClass('is-active');\n $('html,body').removeAttr('data-scroll').removeClass('is-noscroll').css({ 'top': 0 }).scrollTop(scrollpos);\n }\n }\n return false;\n });\n\n $(document).on('click', function (e) {\n if (!$(e.target).closest('.ge-header').length) {\n $('.js-navi-toggle').removeClass('is-active');\n $('.ge-header').removeClass('is-naviOpen');\n $('.ge-navi-gather>li').removeClass('is-active');\n $('.ge-naviSpToggle').removeClass('is-active');\n if (window.innerWidth > 992) {\n $('.js-navi-list').slideUp();\n } else {\n $('.ge-navi').slideUp();\n }\n }\n });\n });\n\n this.dropdownToggleInit();\n\n $(function () {\n $('.ge-navi-list-dropdown-toggle,.ge-navi-list-dropdown-toggleText').off('click').on('click', function () {\n if (window.innerWidth < 992) {\n if ($(this).parent().next('.ge-navi-list-dropdown-panel').is(':hidden')) {\n $(this).parent().next('.ge-navi-list-dropdown-panel').slideDown();\n $(this).parent().addClass('is-active');\n } else {\n $(this).parent().next('.ge-navi-list-dropdown-panel').slideUp();\n $(this).parent().removeClass('is-active');\n }\n }\n });\n //TABLET, MOBILE Navi item open\n $('.ge-naviSp-dropdown-toggle').off('click').on('click', function () {\n if ($(this).next('.ge-naviSp-dropdown-panel').is(':hidden')) {\n $(this).next('.ge-naviSp-dropdown-panel').slideDown();\n $(this).parent().addClass('is-active');\n } else {\n $(this).next('.ge-naviSp-dropdown-panel').slideUp();\n $(this).parent().removeClass('is-active');\n }\n });\n\n //public header scroll\n geHeaderScroll();\n $(document).on('scroll', function () {\n geHeaderScroll();\n });\n function geHeaderScroll() {\n var scroll = $(window).scrollTop();\n if (scroll >= 1) {\n $('.ge-header').addClass('is-scroll');\n } else {\n if (!$('body').hasClass('is-noscroll')) {\n $('.ge-header').removeClass('is-scroll');\n }\n }\n }\n });\n },\n dropdownToggleInit: function dropdownToggleInit() {\n function headerNavScroll() {\n $('.ge-dropdown-cart-list').niceScroll({\n cursorcolor: \"#D7D7D7\",\n cursoropacitymin: 0.3,\n cursorwidth: 6,\n autohidemode: false\n });\n $(document).ready(function () {\n setTimeout(function () {\n if ($('.c-block-sampleselection-body').length) {\n $('.c-block-sampleselection-body').niceScroll(\"ul\", {\n cursorcolor: \"#D7D7D7\",\n cursoropacitymin: 0.3,\n cursorwidth: 6,\n autohidemode: false\n });\n }\n }, 50);\n });\n }\n headerNavScroll();\n $(window).on('resize', function () {\n headerNavScroll();\n });\n $(function () {\n $('.ge-dropdown:not(.ge-dropdown--cart) > a').off('click').on('click', function () {\n if (window.innerWidth > 767) {\n if ($(this).next('.ge-dropdown-box').is(':hidden')) {\n $('.ge-dropdown').removeClass('is-active');\n $('.ge-dropdown-box').fadeOut();\n $(this).next('.ge-dropdown-box').fadeIn();\n $(this).parent().addClass('is-active');\n if ($(this).closest('.ge-dropdown').find('.ge-dropdown-cart-list').length) {\n $('.ge-dropdown-cart-list').getNiceScroll().resize();\n }\n } else {\n $(this).next('.ge-dropdown-box').fadeOut(0);\n $(this).parent().removeClass('is-active');\n }\n return false;\n } else {\n if ($(this).parent()[0].id === 'mini-cart') {\n location.href = $(this).next('div').children('.ge-dropdown-cart-button').children('ul').children('li').children('a')[0].href;\n }\n }\n });\n var getDevice = function () {\n var ua = navigator.userAgent;\n if (ua.indexOf('iPhone') > 0 || ua.indexOf('iPod') > 0 || ua.indexOf('Android') > 0 && ua.indexOf('Mobile') > 0) {\n return 'sp';\n } else if (ua.indexOf('iPad') > 0 || ua.indexOf('Android') > 0) {\n return 'tab';\n } else {\n return 'other';\n }\n }();\n $('.ge-dropdown--cart').mouseenter(function () {\n if (window.innerWidth > 992 && getDevice == 'other') {\n if ($(this).find('.ge-dropdown-box').is(':hidden')) {\n $('.ge-dropdown').stop().removeClass('is-active');\n $('.ge-dropdown-box').stop().fadeOut();\n $(this).stop().addClass('is-active');\n $(this).find('.ge-dropdown-box').stop().fadeIn(0);\n $('.ge-dropdown-cart-list').niceScroll({\n cursorcolor: \"#D7D7D7\",\n cursoropacitymin: 0.3,\n cursorwidth: 6,\n autohidemode: false\n });\n $('.ge-dropdown-cart-list').getNiceScroll().resize();\n headerNavScroll();\n }\n }\n });\n $('.ge-dropdown--cart').mouseleave(function () {\n if (window.innerWidth > 992 && getDevice == 'other') {\n if (!$(this).find('.ge-dropdown-box').is(':hidden')) {\n $(this).find('.ge-dropdown-box').stop('true', 'true').fadeOut(0);\n $(this).stop().removeClass('is-active');\n headerNavScroll();\n }\n }\n });\n $(document).on('click', function (e) {\n if (!$(e.target).closest('.ge-dropdown').length && !$(e.target).closest('.ge-search').length && !$(e.target).hasClass('.c-modal') && !$(e.target).closest('.mfp-wrap').length) {\n if (window.innerWidth > 992) {\n var scrollpos = $('body').attr('data-scroll');\n $('html,body').removeAttr('data-scroll').removeClass('is-noscroll').css({ 'top': 0 }).scrollTop(scrollpos);\n }\n $('.ge-dropdown').removeClass('is-active');\n $('.ge-dropdown-box').fadeOut();\n }\n });\n });\n },\n searchInit: function searchInit() {\n $(function () {\n //search open\n $('.ge-search-toggle').off('click').on('click', function () {\n $(document).trigger('dataLayerPushWhenSearchButtonWasClicked');\n var scrollpos;\n if ($('.ge-search').is(':hidden')) {\n var scrollpos = $(window).scrollTop();\n var scroll_bar = window.innerWidth - $(window).width();\n $('body').attr('data-scroll', scrollpos);\n $('body').addClass('is-noscroll').css({ 'top': -scrollpos });\n $('.ge-search').fadeIn();\n $('.slick-slider').slick('setPosition');\n $('.ge-search-close').css('padding-right', scroll_bar);\n if ($('.ge-search-results-list').length) {\n $('.ge-search').addClass('is-result');\n } else {\n $('.ge-search').removeClass('is-result');\n }\n }\n return false;\n });\n\n //search close\n $('.ge-search-close a').off('click').on('click', function () {\n var scrollpos = $('body').attr('data-scroll');\n $('html,body').removeAttr('data-scroll').removeClass('is-noscroll').css({ 'top': 0 }).scrollTop(scrollpos);\n $('.ge-search').fadeOut();\n $('.ge-search').removeClass('is-result');\n return false;\n });\n\n //search reset\n $('.ge-search-input .c-input-btn-reset').off('click').on('click', function () {\n $(this).closest('.ge-search-input').find('.c-input-box').attr('value', '');\n $(this).closest('.ge-search-input').find('.c-input-btn-search').prop('disabled', true);\n $(this).fadeOut();\n $(this).closest('.ge-search-input').find('.c-input-btn-search').fadeIn();\n return false;\n });\n\n $(window).on('load', function () {\n $('.ge-search-input').each(function () {\n var value = $(this).find('.c-input-box').val();\n if (value == \"\" && value != value) {\n $(this).find('.c-input-btn-reset').fadeOut();\n $(this).find('.c-input-btn-search').fadeIn();\n }\n });\n });\n $('.ge-search-input .c-input-box').on('change keypress keyup', function () {\n $('.ge-search-input').each(function () {\n var value = $(this).find('.c-input-box').val();\n $(this).find('.c-input-btn-reset').fadeOut();\n $(this).find('.c-input-btn-search').fadeIn();\n });\n });\n //search disabled\n $('input[type=\"search\"]').on('change keypress keyup', function () {\n if ($(this).val() == \"\") {\n $(this).parent().find('.c-input-btn-search').prop('disabled', true);\n } else {\n $(this).parent().find('.c-input-btn-search').prop('disabled', false);\n }\n });\n matchHeightProducts();\n });\n },\n tmpRecentlyInit: function tmpRecentlyInit() {\n $(function () {\n $('.c-slider-recently').on('init', function () {\n $('.c-modal-inline').magnificPopup({\n type: 'inline',\n removalDelay: 500,\n preloader: false,\n fixedContentPos: true,\n callbacks: {\n open: function open() {\n $(\".mfp-container\").addClass(\"row\");\n $(\".mfp-content > div\").addClass(\"row\");\n $('.slick-slider').slick('setPosition');\n $('.c-slider-products-landscape').slick('setPosition');\n $('.c-slider-products-vertical').slick('setPosition');\n matchHeightProducts();\n $.magnificPopup.instance.close = function () {\n if (window.innerWidth < 992) {\n var scrollpos = $('body').attr('data-scroll');\n $('html,body').removeAttr('data-scroll').removeClass('is-noscroll').css({ 'top': 0 }).scrollTop(scrollpos);\n }\n $.magnificPopup.proto.close.call(this);\n };\n }\n }\n });\n });\n\n $('.c-slider-recently').slick({\n slidesToShow: 4,\n slidesToScroll: 4,\n dots: true,\n responsive: [{\n breakpoint: 991,\n settings: {\n slidesToShow: 3,\n slidesToScroll: 3,\n arrows: false,\n dots: true\n }\n }, {\n breakpoint: 768,\n settings: {\n slidesToShow: 1,\n slidesToScroll: 1,\n arrows: false,\n dots: true\n }\n }]\n });\n });\n },\n tmpVideoInit: function tmpVideoInit() {\n $(function () {\n $('.c-slider-videocarousel').on('init', function () {\n $('.c-modal-video-fullscreen').each(function () {\n var link = $(this).attr('href');\n $(this).magnificPopup({\n type: 'iframe',\n removalDelay: 600,\n fixedContentPos: true,\n iframe: {\n patterns: {\n youtube: {\n src: link\n }\n }\n },\n callbacks: {\n open: function open() {\n $(\".mfp-container\").addClass(\"row mfp-iframe-holder-fullscreen\");\n }\n }\n });\n });\n });\n $('.c-slider-videocarousel').slick({\n slidesToShow: 4,\n slidesToScroll: 4,\n dots: true,\n pauseOnHover: false,\n responsive: [{\n breakpoint: 991,\n settings: {\n slidesToShow: 3,\n slidesToScroll: 3,\n arrows: false,\n dots: true\n }\n }, {\n breakpoint: 768,\n settings: {\n slidesToShow: 1,\n slidesToScroll: 1,\n arrows: false,\n dots: true\n }\n }]\n });\n });\n },\n\n //WOW init\n wowInit: function wowInit() {\n $('template').each(function () {\n var $t = $(this),\n toId = $t.attr('data-forid'),\n inHtml = $t.html(),\n $box = $('#' + toId);\n\n if ($box.length) {\n $box.html(inHtml);\n }\n });\n\n $(function () {\n function wowstart() {\n if (window.innerWidth > 992) {\n new WOW().init();\n }\n }\n wowstart();\n var timer = false;\n var windowW = window.innerWidth;\n $(window).on('resize', function (e) {\n if (windowW != window.innerWidth) {\n if (timer !== false) {\n clearTimeout(timer);\n }\n timer = setTimeout(function () {\n wowstart();\n }, 200);\n windowW = window.innerWidth;\n }\n });\n });\n },\n\n commonInit: function commonInit() {\n //search\n this.searchInit();\n\n //header\n this.headerInit();\n\n //footer\n this.footerInit();\n\n //modal\n this.modalInit();\n\n //toggle select\n this.toggleSelectInit();\n\n //WOW init\n this.wowInit();\n\n if ($('.c-list-instagram01').length) {\n var accessToken = \"2680730803.d5ced9a.da86b2583a87427e8818b35ad0b3af39\";\n var count = 7; // 取得件数\n\n $.ajax({\n url: 'https://api.instagram.com/v1/users/self/media/recent/?access_token=' + accessToken + '&count=' + count,\n dataType: 'jsonp',\n success: function success(data) {\n var insert = \"\";\n for (var i = 0; i < data['data'].length; i++) {\n insert += \"
      • \";\n insert += '';\n insert += '';\n insert += '';\n\n insert += '
      • ';\n };\n $('.c-list-instagram01').append(insert);\n }\n });\n }\n if ($('.c-list-instagram02').length) {\n var accessToken = \"2680730803.d5ced9a.da86b2583a87427e8818b35ad0b3af39\";\n var count = 3; // 取得件数\n\n $.ajax({\n url: 'https://api.instagram.com/v1/users/self/media/recent/?access_token=' + accessToken + '&count=' + count,\n dataType: 'jsonp',\n success: function success(data) {\n var insert = \"\";\n for (var i = 0; i < data['data'].length; i++) {\n insert += \"
      • \";\n insert += '';\n insert += '';\n insert += '';\n\n insert += '
      • ';\n };\n $('.c-list-instagram02').append(insert);\n }\n });\n }\n\n $(function () {\n $('.c-underColumn-toggle >a ').off('click').on('click', function () {\n var main = $(this).closest('.c-underColumn').find('.c-underColumn-main'),\n side = $(this).closest('.c-underColumn').find('.c-underColumn-side');\n if (window.innerWidth < 767 || side.is(':hidden')) {\n main.hide();\n side.show();\n } else {\n main.show();\n side.hide();\n }\n return false;\n });\n });\n\n $(function () {\n //textarea count\n $(\".c-textarea\").keyup(function () {\n var txtcount = $(this).val().length,\n txtlimit = $(this).maxlength;\n $(this).closest('.c-textarea-box').find('.c-textarea-count .countnow').text(txtcount);\n if (txtcount == 0) {\n $(this).closest('.c-textarea-box').find('.c-textarea-count .countnow').text(\"0\");\n }\n if (txtcount >= txtlimit) {\n $(this).closest('.c-textarea-box').find('.c-textarea-count .countnow').text(txtlimit);\n }\n });\n\n $('.c-dlist-dropdown-link-toggle').off('click').on('click', function () {\n if ($(this).parent().next('dd').is(':hidden')) {\n $(this).parent().addClass('is-active');\n $(this).parent().next('dd').slideDown();\n } else {\n $(this).parent().removeClass('is-active');\n $(this).parent().next('dd').slideUp();\n }\n return false;\n });\n $('.c-dlist-dropdown > dt').off('click').on('click', function () {\n if ($(this).next('dd').is(':hidden')) {\n $(this).addClass('is-active');\n $(this).next('dd').slideDown();\n if ($(this).next('dd').find('.ge-dropdown-cart-list').length) {\n $('.ge-dropdown-cart-list').getNiceScroll().resize();\n $('.ge-dropdown-cart-list').niceScroll({\n cursorcolor: \"#D7D7D7\",\n cursoropacitymin: 0.3,\n cursorwidth: 6,\n autohidemode: false\n });\n }\n } else {\n $(this).removeClass('is-active');\n $(this).next('dd').slideUp();\n if ($(this).next('dd').find('.ge-dropdown-cart-list').length) {\n $('.ge-dropdown-cart-list').getNiceScroll().remove();\n }\n }\n return false;\n });\n });\n\n this.selectQuantityInit();\n\n // JavaScript Document\n var getDevice = function () {\n var ua = navigator.userAgent;\n if (ua.indexOf('iPhone') > 0 || ua.indexOf('iPod') > 0 || ua.indexOf('Android') > 0 && ua.indexOf('Mobile') > 0) {\n return 'sp';\n } else if (ua.indexOf('iPad') > 0 || ua.indexOf('Android') > 0) {\n return 'tab';\n } else {\n return 'other';\n }\n }();\n $(function () {\n $(document).on(\"click\", \"[href^='#']:not(.c-modal)\" + \"[href!='#']\", scroll_func);\n $(document).on(\"click\", \"#pageTop\", function () {\n scroll_func(\"top\");\n });\n\n $('form').submit(function () {\n loading_func('on');\n });\n });\n\n $(function () {\n $(\"[href^='#']:not(.c-modal)\" + \"[href!='#']\").off('click').on('click', function () {\n var headerH = $('.ge-header').height();\n var messageH = $('.ge-header-fixedMessage').height();\n var headerHight = headerH + messageH;\n var href = $(this).attr(\"href\");\n var target = $(href == \"#\" || href == \"\" ? 'html' : href);\n var position = target.offset().top - headerHight;\n $(\"html, body\").animate({ scrollTop: position }, 550, \"swing\");\n return false;\n });\n });\n\n /* ページTOPへスクロール */\n var scroll_func = function scroll_func(top) {\n if (top == \"top\") {\n $('html,body').scrollTop(800).stop().animate({ scrollTop: 0 }, 'slow', 'easeOutQuart');\n } else {\n $('html,body').animate({ scrollTop: $($(this).attr(\"href\")).offset().top }, 'slow', 'easeOutQuart');\n }\n return false;\n };\n /* /ページTOPへスクロール */\n\n var loading_func = function loading_func(mode) {\n if (mode == 'on') {\n $('.modLoading').remove();\n $('body').append('
        ');\n }\n if (mode == 'off') {\n $('.modLoading').fadeOut(function () {\n $(this).remove();\n });\n }\n };\n\n //modLoadingに対するBack Forward Cache 対策\n window.onpageshow = function (event) {\n if (event.persisted) {\n var elements = document.getElementsByClassName(\"modLoading\");\n var length = elements.length;\n if (length) {\n window.location.reload();\n }\n }\n };\n\n $(function () {\n $(window).on('load resize', function () {\n matchHeightAction();\n });\n });\n function matchHeightAction() {\n $('.js-height_01').matchHeight();\n $('.js-height_02').matchHeight();\n $('.js-height_03').matchHeight();\n $('.js-height_04').matchHeight();\n $('.js-height_05').matchHeight();\n $('.js-height_06').matchHeight();\n $('.js-height_07').matchHeight();\n $('.js-height_08').matchHeight();\n $('.js-height_09').matchHeight();\n $('.js-height_10').matchHeight();\n }\n\n $(function () {\n if ($('.js-top-carousel')[0]) {\n var isPC = function isPC() {\n return matchMediaPC.matches;\n };\n\n // sliderInit\n // YouTubeの埋め込み\n var onPlayerReady = function onPlayerReady(event) {\n event.target.mute();\n event.target.getPlaybackQuality('highres');\n sliderReady(event);\n };\n\n var onPlayerStateChange = function onPlayerStateChange(event) {\n if (event.data === YT.PlayerState.ENDED) {\n // $('.js-top-carousel').slick('slickNext');\n }\n };\n\n var onYouTubeIframeAPIReady = function onYouTubeIframeAPIReady() {\n $('.js-top-carousel').find('.c-topCarousel-item').each(function (index) {\n var $el = $(this).find('.c-topCarousel-iframe-wrap');\n if ($el[0]) {\n $('.js-top-carousel').removeClass('is-loading');\n $el.attr('id', 'c-topCarousel-movieid' + index);\n movieList.push({\n index: index,\n videoId: $el.attr('data-yt-id')\n });\n ytPlayers.push('');\n }\n });\n\n if (movieList.length) {\n for (var i = 0; i < movieList.length; i++) {\n var playerVars = {\n // 'autoplay': 1,\n 'controls': 0,\n // 'loop': 1,\n // 'playlist': movieList[i].videoId,\n 'disablekb': 1,\n 'rel': 0,\n 'playsinline': 1\n };\n\n isSingleAndMovie = $('.js-top-carousel').find('.c-topCarousel-item').length === 1;\n\n if (isSingleAndMovie) {\n playerVars.playlist = movieList[i].videoId;\n playerVars.loop = 1;\n }\n\n var ytPlayer = new YT.Player('c-topCarousel-movieid' + movieList[i].index, {\n width: 640,\n height: 480,\n videoId: movieList[i].videoId,\n playerVars: playerVars,\n events: {\n 'onReady': onPlayerReady,\n 'onStateChange': onPlayerStateChange\n }\n });\n ytPlayers[movieList[i].index] = ytPlayer;\n }\n } else {\n sliderReady();\n }\n };\n\n var sliderReady = function sliderReady(event) {\n if (event && $(event.target.getIframe()).attr('id') === 'c-topCarousel-movieid0') {\n if (isPC() && ytPlayers[0] && ytPlayers[0].playVideo) {\n ytPlayers[0].playVideo();\n\n setTimeout(function () {\n $('.js-top-carousel').removeClass('is-loading');\n $('.js-top-carousel').addClass('is-loaded');\n }, 100);\n }\n } else {\n setTimeout(function () {\n $('.js-top-carousel').removeClass('is-loading');\n\n setTimeout(function () {\n $('.js-top-carousel').addClass('is-loaded');\n }, 2500);\n }, 500);\n }\n slideStart(null, 0);\n };\n\n var getBgMovieSize = function getBgMovieSize() {\n var aspectW = 16;\n var aspectH = 9;\n var videoRatio = (aspectW / aspectH).toFixed(2);\n var minWidth = window.innerWidth ? window.innerWidth : $(window).width();\n var minHeight = $(window).height() + 100;\n var widthRatio = minWidth / aspectW;\n var heightRatio = minHeight / aspectH;\n var size = {};\n if (widthRatio > heightRatio) {\n size.width = minWidth;\n size.height = Math.ceil(minWidth / videoRatio);\n } else {\n size.height = minHeight;\n size.width = Math.ceil(minHeight * videoRatio);\n }\n return size;\n };\n\n var sliderInit = function sliderInit() {\n $('.js-top-carousel').on('init', function (event, slick) {\n if (!$(slick.$slides[0]).find('.type-video')[0]) {\n $('.js-top-carousel').removeClass('is-loading');\n }\n if ($(slick.$slides[0]).find('.type-video')[0]) {\n $(slick.$slides[0]).addClass('is-wait');\n }\n\n matchMediaPC.addListener(function (e) {\n if (e.matches) {\n var index = $('.js-top-carousel').find('.slick-active').attr('data-slick-index');\n if (ytPlayers[index] && ytPlayers[index].playVideo) {\n ytPlayers[index].playVideo();\n }\n } else {\n for (var i = 0; i < ytPlayers.length; i++) {\n if (ytPlayers[i].stopVideo) {\n ytPlayers[i].stopVideo();\n }\n }\n }\n });\n });\n\n $('.js-top-carousel').slick({\n fade: true,\n infinite: true,\n dots: true,\n arrows: false\n });\n\n $('.js-top-carousel').find('.slick-dots').find('button').append('');\n\n $('.js-top-carousel').on('beforeChange', function (event, slick, currentSlide, nextSlide) {});\n\n $('.js-top-carousel').on('afterChange', function (event, slick, currentSlide) {\n slideStart(slick, currentSlide);\n });\n };\n\n var slideStart = function slideStart(slick, currentSlide) {\n clearTimeout(nextTimer);\n clearInterval(seekbarTimer);\n clearTimeout(loadingTimer);\n\n for (var i = 0; i < ytPlayers.length; i++) {\n if (ytPlayers[i].stopVideo) {\n ytPlayers[i].stopVideo();\n }\n }\n\n var $currentSlide = $('.js-top-carousel').find('.slick-slide[data-slick-index=\"' + currentSlide + '\"]');\n\n // 動画コンテンツはすべてwait\n $('.js-top-carousel').find('.slick-slide').each(function () {\n if ($(this).find('.type-video')[0]) {\n if (isPC()) {\n $(this).addClass('is-wait');\n }\n }\n });\n\n // 動画が再生開始したらwait解除\n var loop = function loop() {\n if (ytPlayers[currentSlide] && ytPlayers[currentSlide].getPlayerState() === YT.PlayerState.PLAYING) {\n clearTimeout(loadingTimer);\n $currentSlide.removeClass('is-wait');\n }\n loadingTimer = setTimeout(loop, 50);\n };\n if (isPC()) {\n loop();\n } else {\n $currentSlide.removeClass('is-wait');\n }\n\n $('.js-top-carousel').find('.slick-dots').find('.bar').css('width', 0);\n\n if (ytPlayers[currentSlide] && isPC()) {\n ytPlayers[currentSlide].playVideo();\n }\n\n seekbarPlay($currentSlide, currentSlide);\n };\n\n var seekbarPlay = function seekbarPlay($currentSlide, currentSlide) {\n var cnt = 0;\n var step = 10;\n var subtract = 500;\n var $dotsBar = $('.js-top-carousel').find('.slick-dots').find('li').eq(currentSlide).find('.bar');\n\n seekbarTimer = setInterval(function () {\n var duration = carouselDuration;\n\n if (!$currentSlide.find('.type-video')[0] || !isPC()) {\n cnt += 10;\n } else {\n var movieDuration = ytPlayers[currentSlide].getDuration() * 1000 - subtract;\n duration = carouselDuration > movieDuration ? movieDuration : carouselDuration;\n cnt = ytPlayers[currentSlide].getCurrentTime() * 1000;\n }\n\n $dotsBar.css('width', cnt / duration * 100 + '%');\n\n if (duration > 0 && duration < cnt) {\n // 再生終了0.5秒前に次ぎスライドへ移動\n // 関連動画表示対処\n clearInterval(seekbarTimer);\n\n if (isSingleAndMovie) {\n slideStart(null, 0);\n } else {\n $('.js-top-carousel').slick('slickNext');\n }\n }\n }, 10);\n };\n\n var carouselDuration = 15000;\n var movieList = [];\n var ytPlayers = [];\n var nextTimer;\n var seekbarTimer;\n var loadingTimer;\n var isSingleAndMovie = false;\n window.ytPlayers = ytPlayers;\n\n var matchMediaPC = window.matchMedia('screen and (min-width: 1025px)');\n\n if (!isPC()) {\n $('.js-top-carousel').removeClass('is-loading');\n }\n\n var tag = document.createElement('script');\n tag.src = \"https://www.youtube.com/iframe_api\";\n var firstScriptTag = document.getElementsByTagName('script')[0];\n firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);\n\n window.onYouTubeIframeAPIReady = onYouTubeIframeAPIReady;\n\n $(function () {\n var movieSize = getBgMovieSize();\n $('.type-video').each(function () {\n $(this).css(movieSize);\n });\n $(window).on('resize', function (e) {\n var movieSize = getBgMovieSize();\n $('.type-video').each(function () {\n $(this).css(movieSize);\n });\n });\n\n sliderInit();\n });\n }\n\n /*\r\n if ($('.js-fullscreen')[0] && $('.js-top-carousel')[0]) {\r\n \tvar interval = 200;\r\n \tvar last_time = 0;\r\n \tvar mousewheelevent = 'onwheel' in document ? 'wheel' : 'onmousewheel' in document ? 'mousewheel' : 'DOMMouseScroll';\r\n \tvar isMoving = false;\r\n \t\t\t$('.js-fullscreen').on(mousewheelevent, function(e) {\r\n \t\tif (isMoving) {\r\n \t\t\treturn false;\r\n }\r\n \t\t\t\tif(window.innerWidth > 1024 && $('.ge-search').is(':hidden')) {\r\n \t\t\tvar now = new Date().getTime();\r\n \t\t\tif (now - last_time < interval) return;\r\n \t\t\t\t\tvar delta = e.originalEvent.deltaY ? -(e.originalEvent.deltaY) : e.originalEvent.wheelDelta ? e.originalEvent.wheelDelta : -(e.originalEvent.detail);\r\n \t\t\tvar scrollTop = $(window).scrollTop();\r\n \t\t\tvar mvHeight = $('.js-top-carousel').innerHeight();\r\n \t\t\tvar hHeight = $('#header').innerHeight();\r\n \t\t\tvar mHeight = 0;\r\n \t\t\tvar fixHeight = mvHeight - hHeight;\r\n \t\t\tif($('.ge-header-fixedMessage')[0]) {\r\n \t\t\t\tmHeight = $('.ge-header-fixedMessage').innerHeight();\r\n }\r\n \t\t\t\t\tfixHeight = fixHeight - mHeight;\r\n \t\t\t\t\tif (delta < 0){\r\n \t\t\t\tif (scrollTop + 10 < fixHeight) {\r\n \t\t\t\t\tisMoving = true;\r\n \t\t\t\t\tif (scrollTop >= 5) { \r\n \t\t\t\t\t\t$('html, body').stop().animate({scrollTop: fixHeight}, 1000, 'easeOutQuad', function() {\r\n \t\t\t\t\t\t\tisMoving = false;\r\n \t\t\t});\r\n \t\t} else { \r\n \t\t\t$('html, body').stop().animate({scrollTop: 5}, 450, 'easeOutQuad', function() {\r\n \t\t\t\thHeight = $('#header').innerHeight();\r\n \t\t\t\tfixHeight = mvHeight - hHeight - mHeight;\r\n \t\t\t\t$('html, body').stop().animate({scrollTop: fixHeight}, 1000, 'easeOutQuad', function() {\r\n \t\t\t\t\tisMoving = false;\r\n \t\t\t\t});\r\n \t\t\t});\r\n \t\t}\r\n \t\tlast_time = now;\r\n \t\treturn false;\r\n \t}\r\n } else {\r\n \tif (scrollTop <= fixHeight) {\r\n \t\tisMoving = true;\r\n \t\t$('html, body').stop().animate({scrollTop: 0}, 1000, 'easeOutQuad', function() {\r\n \t\t\tisMoving = false;\r\n \t\t});\r\n \t\tlast_time = now;\r\n \t\treturn false;\r\n \t}\r\n }\r\n }\r\n });\r\n }\r\n */\n });\n\n $(function () {\n $('.c-block-fullscreenModules--overlay .img source').each(function () {\n var srcset = $(this).attr('srcset');\n $(this).closest('.img').css('background-image', 'url(' + srcset + ')').addClass('isFinish');\n });\n\n if ($('.js-fullscreen')[0] && $('.c-block-fullscreenModules--overlay')[0] && $('.c-block-fullscreenModules--overlay-blanc-block')[0]) {\n var timer;\n var index = 0;\n var interval = 200;\n var last_time = 0;\n var mousewheelevent = 'onwheel' in document ? 'wheel' : 'onmousewheel' in document ? 'mousewheel' : 'DOMMouseScroll';\n var isMoving = false;\n\n $('.js-fullscreen').on(mousewheelevent, function (e) {\n if (isMoving) {\n return;\n }\n\n if (window.innerWidth > 992 && $('.ge-search').is(':hidden')) {\n var now = new Date().getTime();\n if (now - last_time > interval) {\n var delta = e.originalEvent.deltaY ? -e.originalEvent.deltaY : e.originalEvent.wheelDelta ? e.originalEvent.wheelDelta : -e.originalEvent.detail;\n var scrollTop = $(window).scrollTop();\n var wHeight = window.innerHeight;\n var vHeight = $('.c-block-fullscreenModules--overlay').innerHeight();\n var hHeight = $('#header').innerHeight();\n var vTop = $('.c-block-fullscreenModules--overlay').offset().top;\n var nTop = $('.c-block-fullscreenModules--overlay-blanc-block').next().offset().top;\n if ($('.ge-header-fixedMessage').length) {\n var mHeight = $('.ge-header-fixedMessage').innerHeight();\n var pos = nTop + hHeight + mHeight;\n } else {\n var pos = nTop + hHeight;\n }\n\n /*\r\n if (delta < 0){\r\n \tif(scrollTop < nTop ) {\r\n \t\tisMoving = true;\r\n \t\t$(\"html,body\").stop().animate({scrollTop:nTop + 5},1000,\"easeOutQuad\", function() {\r\n \t\t\tisMoving = false;\r\n \t\t});\r\n \t\treturn false;\r\n \t}\r\n } else {\r\n \tif(1 < scrollTop && scrollTop < pos ) {\r\n \t\tisMoving = true;\r\n \t\t$(\"html,body\").stop().animate({scrollTop:0},1000,\"easeOutQuad\", function() {\r\n \t\t\tisMoving = false;\r\n \t\t});\r\n \t\treturn false;\r\n \t}\r\n }\r\n */\n if (scrollTop > nTop) {\n $('.c-block-fullscreenModules--overlay').css({\n 'z-index': -2,\n 'opacity': 0,\n 'display': 'none'\n }).addClass('is-hidden');\n } else {\n $('.c-block-fullscreenModules--overlay').css({\n 'z-index': 0,\n 'opacity': 1,\n 'display': 'block'\n }).removeClass('is-hidden');\n }\n }\n last_time = now;\n }\n });\n\n $(window).on('load scroll resize', function (e) {\n if ($('.js-fullscreen').length) {\n if (window.innerWidth > 992) {\n var scrollTop = $(window).scrollTop();\n var wHeight = window.innerHeight;\n var vHeight = $('.c-block-fullscreenModules--overlay').innerHeight();\n var hHeight = $('#header').innerHeight();\n var vTop = $('.c-block-fullscreenModules--overlay').offset().top;\n var nTop = $('.c-block-fullscreenModules--overlay-blanc-block').next().offset().top;\n if ($('.ge-header-fixedMessage').length) {\n var mHeight = $('.ge-header-fixedMessage').innerHeight();\n var pos = nTop + hHeight + mHeight;\n } else {\n var pos = nTop + hHeight;\n }\n if (scrollTop > nTop) {\n $('.c-block-fullscreenModules--overlay').css({\n 'z-index': -2,\n 'opacity': 0,\n 'display': 'none'\n }).addClass('is-hidden');\n } else {\n $('.c-block-fullscreenModules--overlay').css({\n 'z-index': 0,\n 'opacity': 1,\n 'display': 'block'\n }).removeClass('is-hidden');\n }\n }\n }\n });\n }\n });\n\n $(function () {\n var targetList;\n\n function btnCheck() {\n list = $('.js-order-list .js-order-list-item').length, visiblelist = $('.js-order-list .js-order-list-item:visible').length;\n if (visiblelist >= list) {\n $('.js-order-btn').hide();\n }\n }\n $('.js-order-btn-more').off('click').on('click', function () {\n var i = 0,\n list = $('.js-order-list .js-order-list-item').length,\n visiblelist = $('.js-order-list .js-order-list-item:visible').length,\n btnT = $('.js-order-btn').offset().top,\n winT = $(window).scrollTop();\n console.log(winT);\n $('.js-order-list .js-order-list-item:hidden').eq(i).fadeIn();\n i++;\n btnCheck();\n $(\"html, body\").animate({ scrollTop: winT }, 0, \"swing\");\n return false;\n });\n\n $('.js-order-btn-all').off('click').on('click', function () {\n var i = 0,\n list = $('.js-order-list .js-order-list-item').length,\n visiblelist = $('.js-order-list .js-order-list-item:visible').length,\n btnT = $('.js-order-btn').offset().top,\n winT = $(window).scrollTop();\n $('.js-order-list .js-order-list-item:hidden').fadeIn();\n btnCheck();\n var listH = $('.js-order-list'),\n position = btnT + listH;\n if (window.innerWidth > 767) {\n $(\"html, body\").animate({ scrollTop: position }, 0, \"swing\");\n }\n $(\"html, body\").animate({ scrollTop: winT }, 0, \"swing\");\n return false;\n });\n });\n },\n pdpInit: function pdpInit() {\n\n $(function () {\n //AUTO-REPLENISHMENT\n $(\".js-autoreplenishment\").change(function () {\n if ($(this).is(':checked')) {\n $(this).closest('li').find(\".js-autoreplenishment-text\").fadeIn();\n } else {\n $(this).closest('li').find(\".js-autoreplenishment-text\").fadeOut();\n }\n });\n });\n\n $(function () {\n\n function videoControl(action, target) {\n if ($('.c-slider-rich-video').find('iframe').length) {\n var currentSlide = target.find(\".slick-current\");\n var iframe = $('iframe', currentSlide);\n var $playerWindow = iframe[0].contentWindow;\n $playerWindow.postMessage('{\"event\":\"command\",\"func\":\"' + action + '\",\"args\":\"\"}', '*');\n }\n }\n\n $('.c-slider-rich-video').on('afterChange', function (event, slick, currentSlide, nextSlide) {\n slick = $(slick.$slider);\n videoControl(\"playVideo\", slick);\n });\n\n $('.c-slider-rich-video').on('beforeChange', function (event, slick, currentSlide, nextSlide) {\n slick = $(slick.$slider);\n videoControl(\"stopVideo\", slick);\n });\n\n $('.c-slider-rich-video').each(function (i) {\n $(this).addClass('c-slider-rich-video' + i);\n $('.c-slider-rich-video' + i).on('init', function () {\n $(this).find('.c-modal-video').each(function () {\n var link = $(this).attr('href');\n console.log(link);\n $(this).find('.c-modal-video').magnificPopup({\n type: 'iframe',\n removalDelay: 600,\n fixedContentPos: true,\n iframe: {\n patterns: {\n youtube: {\n src: link\n }\n }\n },\n callbacks: {\n open: function open() {\n $(\".mfp-container\").addClass(\"row\");\n $.magnificPopup.instance.close = function () {\n if (window.innerWidth < 992) {\n var scrollpos = $('body').attr('data-scroll');\n $('html,body').removeAttr('data-scroll').removeClass('is-noscroll').css({ 'top': 0 }).scrollTop(scrollpos);\n }\n $.magnificPopup.proto.close.call(this);\n };\n }\n }\n });\n });\n });\n $('.c-slider-rich-video' + i).not('.slick-initialized').slick({\n centerMode: true,\n centerPadding: '17.5%',\n arrows: false,\n slidesToShow: 1,\n asNavFor: \".c-slider-rich-description\" + i,\n variableWidth: true,\n responsive: [{\n breakpoint: 992,\n settings: {\n centerPadding: '20%',\n variableWidth: false\n }\n }, {\n breakpoint: 767,\n settings: {\n centerPadding: '10%',\n variableWidth: false\n }\n }]\n });\n });\n $('.c-slider-rich-description').each(function (i) {\n $(this).addClass('c-slider-rich-description' + i);\n $('.c-slider-rich-description' + i).not('.slick-initialized').slick({\n asNavFor: \".c-slider-rich-video\" + i,\n touchMove: false\n });\n });\n });\n\n $(function () {\n if ($('.c-block-shoppingDock').length) {\n var shoppingDockHide = function shoppingDockHide() {\n $('.c-block-shoppingDock').hide();\n };\n\n var shoppingDockShow = function shoppingDockShow() {\n $('.c-block-shoppingDock').fadeIn();\n };\n\n shoppingDockHide();\n $(window).scroll(function () {\n var winT = $(window).scrollTop();\n var winH = $(window).height();\n var varH = $('.c-block-shoppingDock').innerHeight();\n var varTop = $('.c-block-shoppingDock').offset().top;\n var varPos = varH + varTop;\n var footT = $('#footer').offset().top;\n if (winT > 100) {\n shoppingDockShow();\n } else {\n shoppingDockHide();\n }\n if (varPos >= footT) {\n $('.c-block-shoppingDock').addClass('nofixed');\n } else {\n $('.c-block-shoppingDock').removeClass('nofixed');\n }\n });\n }\n });\n\n $(function () {\n function sliderMobile() {\n var width = window.innerWidth;\n if (width <= 767) {\n $('.c-slider-mobile').not('.slick-initialized').slick({\n arrows: false,\n dots: true\n });\n } else {\n $('.c-slider-mobile.slick-initialized').slick('unslick');\n }\n }\n sliderMobile();\n $(window).resize(function () {\n sliderMobile();\n });\n\n var timer;\n function sliderMobileArrow() {\n var width = window.innerWidth;\n if (width <= 767) {\n $('.c-block-richcontent01-content-list').not('.slick-initialized').slick({\n arrows: true\n });\n sliderArrowPositionSet();\n } else {\n $('.c-block-richcontent01-content-list.slick-initialized').slick('unslick');\n }\n }\n function sliderArrowPositionSet() {\n clearTimeout(timer);\n timer = setTimeout(function () {\n $('.c-block-richcontent01-content-list').each(function () {\n var $_t = $(this);\n var $photo = $_t.find('.slick-active').find('.c-block-richcontent01-content-list-item').find('.photo');\n var $arrow = $_t.find('.slick-arrow');\n if ($arrow[0] && $photo[0]) {\n var top = $photo.position().top;\n var height = $photo.height();\n var center = top + height / 2;\n $arrow.css({\n top: center\n });\n }\n });\n }, 100);\n }\n sliderMobileArrow();\n $(window).on('load', function () {\n if (window.innerWidth <= 767) {\n sliderArrowPositionSet();\n }\n });\n $(window).on('resize', function () {\n sliderMobileArrow();\n });\n });\n $(function () {\n $('.c-slider-fullscreenModulesImage').not('.slick-initialized').slick({\n asNavFor: \".c-slider-fullscreenModulesList\",\n arrows: false\n });\n $('.c-slider-fullscreenModulesList').not('.slick-initialized').slick({\n asNavFor: \".c-slider-fullscreenModulesImage\"\n });\n\n if ($(\".c-slider-products-vertical\").length > 0) {\n $('.c-slider-products-landscape').not('.slick-initialized').slick({\n asNavFor: \".c-slider-products-vertical\",\n arrows: false,\n responsive: [{\n breakpoint: 991,\n settings: {\n dots: true\n }\n }]\n });\n } else {\n $('.c-slider-products-landscape').not('.slick-initialized').slick();\n }\n });\n $(function () {\n $('.c-slider-products-vertical').on('init', function () {\n $('.c-modal-img').magnificPopup({\n type: 'image',\n removalDelay: 500,\n fixedContentPos: true,\n callbacks: {\n open: function open() {\n $(\".mfp-container\").addClass(\"row\");\n $.magnificPopup.instance.close = function () {\n if (window.innerWidth < 992) {\n var scrollpos = $('body').attr('data-scroll');\n $('html,body').removeAttr('data-scroll').removeClass('is-noscroll').css({ 'top': 0 }).scrollTop(scrollpos);\n }\n $.magnificPopup.proto.close.call(this);\n };\n }\n }\n\n });\n if ($(this).find('.c-block-shopingmodal-change-image').length < 5) {\n $(this).addClass('is-nobutton');\n }\n });\n if ($('.c-slider-products-vertical').hasClass('is-standard')) {\n var thumbnail = 3;\n } else {\n var thumbnail = 5;\n }\n $('.c-slider-products-vertical').not('.slick-initialized').slick({\n asNavFor: \".c-slider-products-landscape\",\n vertical: true,\n verticalSwiping: true,\n slidesToShow: thumbnail,\n focusOnSelect: true\n });\n $('.c-slider-products-landscape').on('afterChange', function (event, slick, currentSlide) {\n $('.c-slider-products-vertical').find('.slick-current').removeClass('slick-current');\n $('.c-slider-products-vertical').find('.slick-slide').eq(currentSlide).addClass('slick-current');\n });\n });\n\n $(function () {\n //SHARE\n $('.c-block-share-toggle').off('click').on('click', function () {\n if ($(this).closest('.c-block-share').find('.c-block-share-box').is(':hidden')) {\n $(this).closest('.c-block-share').find('.c-block-share-box').fadeIn().removeClass('mfp-hide');\n } else {\n $(this).closest('.c-block-share').find('.c-block-share-box').fadeOut(function () {\n $(this).addClass('mfp-hide');\n });\n }\n if (window.innerWidth >= 767) {\n return false;\n }\n });\n $('.c-block-share-close').off('click').on('click', function () {\n $(this).closest('.c-block-share').find('.c-block-share-box').fadeOut(function () {\n $(this).addClass('mfp-hide');\n });\n return false;\n });\n $(document).on('click touchstart', function (e) {\n if (!$(e.target).closest('.c-block-share-box').length) {\n if (window.innerWidth >= 767) {\n if ($('.c-block-share-box').is(':visible')) {\n $('.c-block-share-box').fadeOut(function () {\n $(this).addClass('mfp-hide');\n });\n }\n }\n }\n });\n //textarea count\n $(\".c-textarea\").keyup(function () {\n var txtcount = $(this).val().length,\n txtlimit = $(this).attr('maxlength'),\n txtDown = txtlimit - txtcount;\n $(this).closest('.c-textarea-box').find('.c-textarea-count:not(.js-countDown) .countnow').text(txtcount);\n $(this).closest('.c-textarea-box').find('.c-textarea-count.js-countDown .countlimit').text(txtDown);\n if (txtcount == 0) {\n $(this).closest('.c-textarea-box').find('.c-textarea-count .countnow').text(\"0\");\n }\n if (txtcount >= txtlimit) {\n $(this).closest('.c-textarea-box').find('.c-textarea-count .countnow').text(txtlimit);\n }\n });\n // Cut out character string of textarea when above limitting text is submited.\n $('button#sendBtn').on('mousedown', function () {\n var textareaElm = $(\".c-textarea\");\n if (textareaElm.length > 0 && textareaElm.val().length > textareaElm[0].dataset.characterLimit) {\n textareaElm.val(textareaElm.val().substr(0, textareaElm[0].dataset.characterLimit));\n }\n });\n\n //AUTO-REPLENISHMENT\n $(\".js-autoreplenishment\").change(function () {\n if ($(this).is(':checked')) {\n $(this).closest('li').find(\".js-autoreplenishment-text\").fadeIn();\n } else {\n $(this).closest('li').find(\".js-autoreplenishment-text\").fadeOut();\n }\n });\n });\n $(function () {\n $('.c-underColumn-toggle >a ').on('click', function () {\n var main = $(this).closest('.c-underColumn').find('.c-underColumn-main'),\n side = $(this).closest('.c-underColumn').find('.c-underColumn-side');\n if (window.innerWidth < 767 || side.is(':hidden')) {\n main.hide();\n side.show();\n } else {\n main.show();\n side.hide();\n }\n return false;\n });\n });\n $(function () {\n $('.c-dlist_01 dt').off('click').on('click', function () {\n if (window.innerWidth < 991) {\n if ($(this).next('dd').is(':hidden')) {\n $(this).addClass('is-active');\n $(this).next('dd').slideDown();\n } else {\n $(this).removeClass('is-active');\n $(this).next('dd').slideUp();\n }\n }\n return false;\n });\n $('.c-dlist-dropdown-link-toggle').on('click', function () {\n if ($(this).parent().next('dd').is(':hidden')) {\n $(this).parent().addClass('is-active');\n $(this).parent().next('dd').slideDown();\n } else {\n $(this).parent().removeClass('is-active');\n $(this).parent().next('dd').slideUp();\n }\n return false;\n });\n $('.c-dlist-dropdown > dt').on('click', function () {\n if ($(this).next('dd').is(':hidden')) {\n $(this).addClass('is-active');\n $(this).next('dd').slideDown();\n } else {\n $(this).removeClass('is-active');\n $(this).next('dd').slideUp();\n }\n return false;\n });\n });\n $(function () {\n if ($('.c-block-shoppingDock').length) {\n var shoppingDockHide = function shoppingDockHide() {\n $('.c-block-shoppingDock').hide();\n };\n\n var shoppingDockShow = function shoppingDockShow() {\n $('.c-block-shoppingDock').fadeIn();\n };\n\n shoppingDockHide();\n $(window).scroll(function () {\n var winT = $(window).scrollTop();\n var winH = $(window).height();\n var varH = $('.c-block-shoppingDock').innerHeight();\n var varTop = $('.c-block-shoppingDock').offset().top;\n var varPos = varH + varTop;\n var footT = $('#footer').offset().top;\n if (winT > 100) {\n shoppingDockShow();\n } else {\n shoppingDockHide();\n }\n if (varPos >= footT) {\n $('.c-block-shoppingDock').addClass('nofixed');\n } else {\n $('.c-block-shoppingDock').removeClass('nofixed');\n }\n });\n }\n });\n\n $(function () {\n if ($(\".c-block-lineBox\").length) {\n var t = function t() {\n $(\".c-block-lineBox-wrapper\").find(\".c-block-lineBox\").each(function (e) {\n var t = $(this).offset().top,\n i = ($(this).index(), $(this).children(\".c-block-lineBox-circle\").offset().top);\n o.push(t), n.push(i);\n }), $(\".c-block-lineBox-circleMove\").css(\"top\", n[0] + \"px\");\n };\n\n var e,\n o = [],\n n = [],\n s = $(window).scrollTop(),\n r = 0;\n\n t(), $(window).on(\"load resize\", function () {\n t();\n }), $(window).on(\"scroll\", function () {\n i();\n });\n var i = function i() {\n clearTimeout(e), e = setTimeout(function () {\n var e = $(window).scrollTop(),\n t = $(window).height(),\n i = ($(\"#header\").innerHeight(), []);\n $(\".c-block-lineBox\").each(function (e) {\n var t = $(this);\n i[e] = t.find(\".c-block-lineBox-circle\").offset().top;\n }), e < s ? i[r - 1] >= e && ($(\".c-block-lineBox-circleMove\").stop().css(\"top\", i[r - 1] + \"px\"), $(\".c-block-lineBox\").children(\".c-block-lineBox-circle\").removeClass(\"is-active is-first\"), $(\".c-block-lineBox\").eq(r - 1).children(\".c-block-lineBox-circle\").addClass(\"is-active\"), 0 != r && r--) : i[r + 1] < e + t - t / 5 && ($(\".c-block-lineBox-circleMove\").stop().css(\"top\", i[r + 1] + \"px\"), $(\".c-block-lineBox\").children(\".c-block-lineBox-circle\").removeClass(\"is-active is-first\"), $(\".c-block-lineBox\").eq(r + 1).children(\".c-block-lineBox-circle\").addClass(\"is-active\"), r++), s = e;\n }, 30);\n };\n }\n }), $(function () {\n $('.js-giftcardbalancemodal-send').on('click', function () {\n if ($('.c-block-giftcardbalance-block-send').length) {\n $('.c-block-giftcardbalance-block-send').hide();\n $('.c-block-giftcardbalance-block-receive').show();\n }\n return false;\n });\n });\n\n // JavaScript Document\n $(function () {\n $(document).on(\"click\", \"[href^='#']:not(.c-modal)\" + \"[href!='#']\", scroll_func);\n $(document).on(\"click\", \"#pageTop\", function () {\n scroll_func(\"top\");\n });\n\n $('form').submit(function () {\n loading_func('on');\n });\n });\n\n $(function () {\n $(\"[href^='#']:not(.c-modal)\" + \"[href!='#']\").on('click', function () {\n var headerH = $('.ge-header').height();\n var messageH = $('.ge-header-fixedMessage').height();\n var headerHight = headerH + messageH;\n var href = $(this).attr(\"href\");\n var target = $(href == \"#\" || href == \"\" ? 'html' : href);\n if (target[0]) {\n var position = target.offset().top - headerHight;\n $(\"html, body\").animate({ scrollTop: position }, 550, \"swing\");\n return false;\n }\n });\n });\n\n /* ページTOPへスクロール */\n var scroll_func = function scroll_func(top) {\n if (top == \"top\") {\n $('html,body').scrollTop(800).stop().animate({ scrollTop: 0 }, 'slow', 'easeOutQuart');\n } else {\n var $target = $($(this).attr(\"href\"));\n if ($target[0]) {\n $('html,body').animate({ scrollTop: $target.offset().top }, 'slow', 'easeOutQuart');\n }\n }\n return false;\n };\n /* /ページTOPへスクロール */\n\n var loading_func = function loading_func(mode) {\n if (mode == 'on') {\n $('.modLoading').remove();\n $('body').append('
        ');\n }\n if (mode == 'off') {\n $('.modLoading').fadeOut(function () {\n $(this).remove();\n });\n }\n };\n\n //modLoadingに対するBack Forward Cache 対策\n window.onpageshow = function (event) {\n if (event.persisted) {\n var elements = document.getElementsByClassName(\"modLoading\");\n var length = elements.length;\n if (length) {\n window.location.reload();\n }\n }\n };\n\n $(function () {\n function btnCheck() {\n list = $('.js-order-list .js-order-list-item').length, visiblelist = $('.js-order-list .js-order-list-item:visible').length;\n if (visiblelist >= list) {\n $('.js-order-btn').hide();\n }\n }\n $('.js-order-btn-more').on('click', function () {\n var i = 0,\n list = $('.js-order-list .js-order-list-item').length,\n visiblelist = $('.js-order-list .js-order-list-item:visible').length;\n $('.js-order-list .js-order-list-item:hidden').eq(i).fadeIn();\n i++;\n btnCheck();\n return false;\n });\n\n $('.js-order-btn-all').on('click', function () {\n var i = 0,\n list = $('.js-order-list .js-order-list-item').length,\n visiblelist = $('.js-order-list .js-order-list-item:visible').length;\n $('.js-order-list .js-order-list-item:hidden').fadeIn();\n btnCheck();\n return false;\n });\n });\n $(function () {\n if ($('#topics-video').length) {\n var resizeMovie = function resizeMovie() {\n var adjustWidth = $(window).width();\n var adjustHeight = $(window).height();\n if (adjustHeight > adjustWidth / movieRatio) {\n adjustWidth = adjustHeight * movieRatio;\n }\n $('#topics-video').css({ width: adjustWidth * 1.4, height: adjustWidth / movieRatio * 1.4 });\n // console.log(w, h, mw, mh);\n };\n\n var onPlayerReady = function onPlayerReady(event) {\n $('#topics-video').fadeIn(1000);\n player.setVolume(0);\n };\n\n var onPlayerStateChange = function onPlayerStateChange(event) {\n if (event.data == YT.PlayerState.ENDED) {\n player.playVideo();\n player.setVolume(0);\n }\n };\n\n $('body').append('