{ "version": 3, "sources": [ "../../../../../Foundation/JavascriptCommon/code/scripts/common/urlUtils.js", "../../../../Media/code/scripts/app/MediaGallery/mediaGallery.js", "ProductDetailsAndDimensions/productDetailsAndDimensions.js", "../../../../Order/code/scripts/app/ShoppingCartIcon/shoppingCartIcon.js", "../../../../../Foundation/JavascriptCommon/code/scripts/common/formUtils.js", "../../../../../Foundation/JavascriptCommon/code/scripts/common/alertMessage.js", "../../../../Order/code/scripts/app/ShoppingCartIcon/miniCart.js", "ProductDescriptionTabs/replacementParts.js", "../../../../../Foundation/JavascriptCommon/code/scripts/common/spinner.js", "../../../../../Foundation/JavascriptCommon/code/scripts/common/formatter.js", "ProductOptions/productOptions.js", "ProductOptions/main.js" ], "names": [], "mappings": "AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,AC1KA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACzOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,AC/GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,AC9GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACvGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACvGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,AC1FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,AC7CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,AC3BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACjgBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA", "file": "ProductOptions.js", "sourcesContent": [ "define('common/urlUtils',[\r\n],\r\n function () {\r\n\r\n // Takes the url and parses the query string parameters out of it.\r\n // Returns the parameters and their string values as object { paramName1: value1, paramName2: value2, ...},\r\n // or an empty object in case there are no parameters in url.\r\n function parseQueryParamsFromUrl(url) {\r\n url = url ? url : window.location.search; // default url parameter if not set\r\n // take just the query search part of url (lose the leading question mark)\r\n var query = decomposeUrl(url).search;\r\n if (query.indexOf(\"?\") >= 0) query = query.substring(query.indexOf(\"?\") + 1);\r\n var urlParams = {},\r\n match,\r\n search = /([^&=]+)=?([^&]*)/g,\r\n decode = function (s) { return decodeURI(decodeURIComponent(s)); };\r\n\r\n while (match = search.exec(query))\r\n urlParams[decode(match[1])] = decode(match[2]);\r\n\r\n return urlParams;\r\n }\r\n\r\n // Takes the url, decomposes it into three components: path, search, hash,\r\n // and returns those three components in an object.\r\n // When searching for hash string which is directly after path (without search parameters) we're ignoring '#/'.\r\n // That is not a hash, that is Angular routing and it's actually part of the path.\r\n function decomposeUrl(url) {\r\n var path = '';\r\n var search = '';\r\n var hash = '';\r\n if (url.indexOf('?') >= 0) {\r\n // there is search string already in the url\r\n path = url.substring(0, url.indexOf('?'));\r\n search = url.substring(url.indexOf('?'));\r\n if (search.indexOf('#') >= 0) {\r\n // there is also a hash string in the url\r\n hash = search.substring(search.indexOf('#'));\r\n search = search.substring(0, search.indexOf('#'));\r\n }\r\n } else if (url.indexOf('#') >= 0 && url.indexOf('#') != url.indexOf('#/')) {\r\n // no search string, but there is hash string\r\n path = url.substring(0, url.indexOf('#'));\r\n hash = url.substring(url.indexOf('#'));\r\n } else {\r\n // no search string, no hash string\r\n path = url ? url : '';\r\n }\r\n return {\r\n path: path, // path also includes the protocol and hostname (if they existed in the given url)\r\n search: search,\r\n hash: hash\r\n }\r\n }\r\n\r\n // Adds a new query string parameter into the given url.\r\n // Returns the newly constructed url.\r\n function putParamIntoUrl(paramName, paramValue, url) {\r\n // first we'll split the url into 3 components\r\n var urlComp = decomposeUrl(url);\r\n // add the new query string parameter into search string\r\n urlComp.search = (urlComp.search ? urlComp.search + '&' : '?') + paramName + '=' + encodeURIComponent(paramValue);\r\n // return the new url\r\n return urlComp.path + urlComp.search + urlComp.hash;\r\n }\r\n\r\n // Reads the specified query string parameter from a given url.\r\n // Returns the value of that parameter (a string value). \r\n function getParamFromUrl(paramName, url) {\r\n return parseQueryParamsFromUrl(url)[paramName];\r\n }\r\n\r\n // Modifies the given DOM element's href property, or the current page's URL (if\r\n // no domElement has been given) by adding new query string parameter with the\r\n // given value. \r\n function pushParamIntoLink(paramName, paramValue, domElement) {\r\n var url;\r\n if (domElement) url = $(domElement).attr('href'); // url from DOM element\r\n else url = window.location.href; // current page url\r\n\r\n var params = parseQueryParamsFromUrl(url);\r\n\r\n // making sure that we find the parameter no matter how it's written (case insensitive)\r\n for (var p in params) {\r\n if (p.toLowerCase() === paramName.toLowerCase()) {\r\n paramName = p;\r\n break;\r\n }\r\n }\r\n\r\n params[paramName] = paramValue; // update (or add) the parameter\r\n var newSearchString = $.param(params); // and construct a new search string.\r\n\r\n var urlComp = decomposeUrl(url);\r\n if (domElement) {\r\n // set new href property on DOM element\r\n var newHref = urlComp.path + (newSearchString ? ('?' + newSearchString) : '') + urlComp.hash;\r\n $(domElement).attr('href', newHref);\r\n } else {\r\n if (history && history.pushState) { // because some older browsers (IE 9 or older) don't support this\r\n // for other pages put new URL to browser's address bar using window.history\r\n history.replaceState(\r\n null,\r\n null,\r\n urlComp.path +\r\n (newSearchString ? ('?' + newSearchString) : '') +\r\n urlComp.hash\r\n );\r\n }\r\n }\r\n }\r\n\r\n // Reads the query string parameter from the domElement's href property, or from\r\n // the current page's URL (if no domElement has been given). Removes the parameter\r\n // from the URL and puts new URL into the domElement's href property, or into the\r\n // browser's address bar.\r\n // Returns the value of that parameter (a string value).\r\n function popParamFromLink(paramName, domElement) {\r\n var url;\r\n if (domElement) url = $(domElement).attr('href'); // url from DOM element\r\n else url = window.location.href; // current page url\r\n\r\n var params = parseQueryParamsFromUrl(url);\r\n var retVal;\r\n\r\n // making sure that we find the parameter no matter how it's written (case insensitive)\r\n for (var p in params) {\r\n if (p.toLowerCase() === paramName.toLowerCase()) {\r\n paramName = p;\r\n break;\r\n }\r\n }\r\n\r\n if (params[paramName]) {\r\n // the requested parameter exists in the url\r\n retVal = params[paramName]; // Its value will be returned from the function.\r\n delete params[paramName]; // Remove the parameter from the array,\r\n var newSearchString = $.param(params); // and construct a new search string.\r\n var urlComp = decomposeUrl(url);\r\n if (domElement) {\r\n // set new href property on DOM element\r\n var newHref = urlComp.path + (newSearchString ? ('?' + newSearchString) : '') + urlComp.hash;\r\n $(domElement).attr('href', newHref);\r\n } else {\r\n if (history && history.pushState) { // because some older browsers (IE 9 or older) don't support this\r\n // for other pages put new URL to browser's address bar using window.history\r\n history.replaceState(\r\n null,\r\n null,\r\n urlComp.path +\r\n (newSearchString ? ('?' + newSearchString) : '') +\r\n urlComp.hash\r\n );\r\n }\r\n }\r\n }\r\n return retVal;\r\n }\r\n\r\n\r\n return {\r\n parseQueryParamsFromUrl: parseQueryParamsFromUrl,\r\n decomposeUrl: decomposeUrl,\r\n putParamIntoUrl: putParamIntoUrl,\r\n getParamFromUrl: getParamFromUrl,\r\n pushParamIntoLink: pushParamIntoLink,\r\n popParamFromLink: popParamFromLink\r\n }\r\n });\r\n\n", "define('mediaGallery/mediaGallery',[\r\n],\r\n function () {\r\n\r\n const mediaGallerySelector = \".media-gallery\";\r\n const swiperSelector = \"div[id^='media_gallery_swiper_']\";\r\n const thumbsSelector = \"div[id^='media_gallery_thumbs_']\";\r\n\r\n // ZOOM & PINCH MEDIA GALLERY\r\n function initZoomAndPinch(slidesSelector) {\r\n slidesSelector = slidesSelector || '.media-gallery .main .swiper-slide';\r\n if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {\r\n setTimeout(function () {\r\n var divs = document.querySelectorAll(slidesSelector + ' .swiper-image-container img').forEach(function (el) {\r\n new PinchZoom(el, {\r\n tapZoomFactor: 3,\r\n minZoom: 1,\r\n maxZoom: 3\r\n });\r\n });\r\n }, 250);\r\n }\r\n else {\r\n // Thumbnail hovers\r\n $(\".thumb-slide\").off('click').on('click', function () {\r\n var parent = $(this).parent();\r\n var slideIndex = parent.children().index($(this)[0]);\r\n var swiperContainer = $(this).closest(mediaGallerySelector).find(swiperSelector);\r\n var swiper = swiperContainer[0].swiper;\r\n setTimeout(function () {\r\n swiper.slideTo(slideIndex);\r\n }, 250);\r\n });\r\n }\r\n }\r\n\r\n function monitorIframe() {\r\n // SET INTERVAL TO DETECT IFRAME CLICK\r\n var monitor = setInterval(function(){\r\n var elem = document.activeElement;\r\n if(elem && elem.tagName == 'IFRAME'){\r\n elem.blur();\r\n $('.media-gallery').addClass('video-playing');\r\n clearInterval(monitor);\r\n }\r\n }, 100);\r\n }\r\n\r\n (function loadDynamicIframe() {\r\n // ADD DEFAULT YOUTUBE IMAGE TO IFRAME\r\n $('.media-gallery .video-embed').each(function(){\r\n var y = $(this).attr('data-thumb');\r\n $(this).css('background-image','url('+ y + ')');\r\n });\r\n // REPLACE DEFAULT YOUTUBE IMAGE WITH YOUTUBE\r\n $('.media-gallery .video_wrapper .icon-play').on('click',function(){\r\n var b = $(this).next().attr('data-src');\r\n $(this).next().attr('src',b);\r\n $(this).remove();\r\n });\r\n $('.media-gallery .video_wrapper .play-icon').on('click', function () {\r\n var b = $(this).next().attr('data-src');\r\n $(this).next().attr('src', b);\r\n $(this).remove();\r\n });\r\n monitorIframe();\r\n }());\r\n\r\n function position(galleryNumber, slideId) {\r\n var swiperContainer = $(\"#media_gallery_swiper_\" + galleryNumber);\r\n if (swiperContainer.length) {\r\n var swiper = swiperContainer[0].swiper;\r\n if (swiper) {\r\n var slideIndex = $(swiperContainer).find(\".swiper-slide[data-slide-id=\" + slideId + \"]\").index(\".swiper-slide\");\r\n if (slideIndex >= 0) {\r\n swiper.slideTo(slideIndex, 0);\r\n displayCaptionForCurrentSlide(swiper);\r\n }\r\n }\r\n }\r\n }\r\n\r\n function displayVariantImages(galleryNumber, variantImageId, additionalVariantImages) {\r\n\r\n if (!window.mediaGalleryData || !window.mediaGalleryData.variantImages) return; // there's no mediaGalleryData to work with\r\n\r\n var swiperContainerSelector = \"#media_gallery_swiper_\" + galleryNumber;\r\n var variantImageSlideSelector = swiperContainerSelector + \" .swiper-slide[data-slide-type=VariantImage]\";\r\n\r\n var swiperContainer = $(swiperContainerSelector);\r\n if (!swiperContainer.length) return; // no swiper container - nothing to do\r\n var swiper = swiperContainer[0].swiper;\r\n if (!swiper) return; // no swiper initializaed - nothing to do\r\n\r\n var swiperChanged = false;\r\n // first, remove currently displayed variant images\r\n $(variantImageSlideSelector).each(function (index, slideElement) {\r\n var slideIndex = $(slideElement).index(\".swiper-slide\");\r\n swiper.removeSlide(slideIndex);\r\n swiper.thumbs.swiper.removeSlide(slideIndex);\r\n swiperChanged = true;\r\n });\r\n\r\n // then, add images given as parameters\r\n var imagesToAdd = variantImageId ? [variantImageId].concat(additionalVariantImages) : additionalVariantImages;\r\n if (imagesToAdd.length) {\r\n var slideCssClass = $(swiperContainer).data(\"slideCssClass\");\r\n var thumbnailSlideCssClass = $(swiperContainer).data(\"thumbnailSlideCssClass\");\r\n\r\n var slidesToAdd = [];\r\n var thumbnailsToAdd = [];\r\n imagesToAdd.forEach(function (imageId) {\r\n var variantImage = mediaGalleryData.variantImages[imageId];\r\n //checking if variant image exist (if image is unpublished it will be undefined and it will raise error in javascript)\r\n if (variantImage) {\r\n slidesToAdd.push(getSlideHtml(slideCssClass, imageId, variantImage.caption, variantImage.url, variantImage.alt));\r\n thumbnailsToAdd.push(getThumbnailSlideHtml(thumbnailSlideCssClass, variantImage.thumbnailUrl, variantImage.alt));\r\n }\r\n });\r\n\r\n swiper.prependSlide(slidesToAdd.reverse());\r\n swiper.thumbs.swiper.prependSlide(thumbnailsToAdd.reverse());\r\n\r\n swiperChanged = true;\r\n }\r\n\r\n if (swiperChanged) {\r\n swiper.slideTo(0, 0);\r\n // do the required initializations for newly added slides\r\n initZoomAndPinch(variantImageSlideSelector);\r\n $(variantImageSlideSelector).off('click').on('click', displayGalleryPopup);\r\n dispatchResizeEvent();\r\n displayCaptionForCurrentSlide(swiper);\r\n }\r\n }\r\n\r\n function getSlideHtml(cssClass, slideId, slideCaption, imageUrl, alt) {\r\n return '
';\r\n }\r\n\r\n function getThumbnailSlideHtml(cssClass, imageUrl, alt) {\r\n return ' ';\r\n }\r\n\r\n function displayCaptionForCurrentSlide(swiper) {\r\n var slide = swiper.slides[swiper.realIndex];\r\n\r\n // Taking the caption for variant images from the Javascript object, and for other images from their data-slide-caption attribute.\r\n // (This is because double quote characters are causing problems in variant image slide, which are generated dynamically in runtime.)\r\n var imageId = $(slide).data(\"slideId\");\r\n var variantImage = mediaGalleryData.variantImages ? mediaGalleryData.variantImages[imageId] : null;\r\n var captionHtmlEncoded = variantImage ? variantImage.caption : $(slide).data(\"slideCaption\");\r\n // caption string is HTML encoded (so it doesn't mess up Javascript object or data attribute), now we have to decode it back\r\n var textArea = document.createElement('textarea');\r\n textArea.innerHTML = captionHtmlEncoded;\r\n var caption = textArea.value;\r\n\r\n $(slide).closest(mediaGallerySelector).find(\".caption\").empty().html(caption);\r\n if($('.media-gallery').hasClass('video-playing')) {\r\n $('.media-gallery').removeClass('video-playing'); \r\n $('.media-gallery .video-embed').each(function(){\r\n var el_src = $(this).attr(\"src\");\r\n $(this).attr(\"src\",el_src);\r\n });\r\n monitorIframe(); \r\n }\r\n }\r\n\r\n function displayGalleryPopup(event) {\r\n if (!(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent))) {\r\n setTimeout(function () {\r\n $('.easyzoom').EasyZoomMagnifierReset();\r\n\r\n if (!$(\".modal-gallery\").hasClass(\"open-modal\")) {\r\n $('.modal-gallery').addClass('open-modal');\r\n }\r\n dispatchResizeEvent();\r\n }, 250);\r\n }\r\n }\r\n\r\n function closeGalleryPopup(event) {\r\n //e.preventDefault();\r\n var data = $(\".swiper-container.main\").data();\r\n\r\n $(\".swiper-lazy.swiper-lazy-loaded\").css(\"transform\", \"translate3d(0px, 0px, 0px) scale(1)\");\r\n $(\".swiper-zoom-container\").css(\"transform\", \"translate3d(0px, 0px, 0px)\");\r\n\r\n $('.modal-gallery').removeClass('open-modal');\r\n $('.easyzoom').EasyZoomMagnifier();\r\n\r\n dispatchResizeEvent();\r\n }\r\n\r\n function dispatchResizeEvent() {\r\n var event;\r\n if (typeof (Event) === 'function') {\r\n event = new Event('resize');\r\n } else {\r\n event = document.createEvent('Event');\r\n event.initEvent('resize', false, false);\r\n }\r\n\r\n window.dispatchEvent(event);\r\n }\r\n\r\n return {\r\n position: position,\r\n displayVariantImages: displayVariantImages,\r\n displayCaptionForCurrentSlide: displayCaptionForCurrentSlide,\r\n mediaGallerySelector: mediaGallerySelector,\r\n swiperSelector: swiperSelector,\r\n thumbsSelector: thumbsSelector,\r\n displayGalleryPopup: displayGalleryPopup,\r\n closeGalleryPopup: closeGalleryPopup,\r\n initZoomAndPinch: initZoomAndPinch\r\n };\r\n });\r\n\n", "define('productDetailsAndDimensions/productDetailsAndDimensions',[\r\n],\r\n function () {\r\n\r\n const componentSelector = \".product-details-and-dimensions\";\r\n const itersEcersSelector = \".rating-scale\";\r\n const componentTitleSelector = \"#details-and-dimensions\";\r\n const dimensionsWrapperSelector = \".dimensions-wrapper\";\r\n const dimensionsChangeList = [\r\n { selector: \".height\", wrapperSelector: \".height-wrapper\", data: \"height\" },\r\n { selector: \".depth\", wrapperSelector: \".depth-wrapper\", data: \"depth\" },\r\n { selector: \".width\", wrapperSelector: \".width-wrapper\", data: \"width\" },\r\n { selector: \".length\", wrapperSelector: \".length-wrapper\", data: \"length\" }\r\n ];\r\n const detailsChangeList = [\r\n { selector: \".details\", wrapperSelector: \".details-wrapper\", data: \"details\" }\r\n ];\r\n const ageRangeChangeList = [\r\n { selector: \".age-range\", wrapperSelector: \".age-range-wrapper\", data: \"ageRange\" }\r\n ];\r\n\r\n function displayVariantData(variantGuid) {\r\n var variant = productDetailsAndDimensions.variants[variantGuid];\r\n if (variant) {\r\n var componentElement = $(componentSelector);\r\n var displayed = {\r\n dimensions: false,\r\n details: false,\r\n image: false,\r\n itersEcers: false\r\n };\r\n // change text elements for dimensions\r\n dimensionsChangeList.forEach(function (change) {\r\n var value = variant[change.data];\r\n $(componentElement).find(change.selector).empty().html(value);\r\n if (value) {\r\n // this dimension has value - display its wrapper as well.\r\n $(componentElement).find(change.wrapperSelector).removeClass(\"d-none\");\r\n displayed.dimensions = true;\r\n } else {\r\n // this dimension doesn't have value - hide the wrapper.\r\n $(componentElement).find(change.wrapperSelector).addClass(\"d-none\");\r\n }\r\n });\r\n // If there's any dimension displayed - display the title as well. Otherwise hide it.\r\n if (displayed.dimensions) {\r\n $(componentElement).find(dimensionsWrapperSelector).removeClass(\"d-none\");\r\n } else {\r\n $(componentElement).find(dimensionsWrapperSelector).addClass(\"d-none\");\r\n }\r\n // change text for details\r\n detailsChangeList.forEach(function (change) {\r\n var value = variant[change.data];\r\n $(componentElement).find(change.selector).empty().html(value);\r\n if (value) {\r\n // has value - display the wrapper as well\r\n $(componentElement).find(change.wrapperSelector).removeClass(\"d-none\");\r\n displayed.details = true;\r\n } else {\r\n // doesn't have value - hide the wrapper\r\n $(componentElement).find(change.wrapperSelector).addClass(\"d-none\");\r\n }\r\n });\r\n // change text for age range\r\n ageRangeChangeList.forEach(function (change) {\r\n var value = variant[change.data];\r\n $(componentElement).find(change.selector).empty().html(value);\r\n if (value) {\r\n // has value - display the wrapper as well\r\n $(componentElement).find(change.wrapperSelector).removeClass(\"d-none\");\r\n displayed.details = true;\r\n } else {\r\n // doesn't have value - hide the wrapper\r\n $(componentElement).find(change.wrapperSelector).addClass(\"d-none\");\r\n }\r\n });\r\n // change image url\r\n if (variant.imageUrl) {\r\n var imageElement = $(componentElement).find(\".dimensions-image\");\r\n var currentImageUrl = $(imageElement).attr(\"src\");\r\n if (variant.imageUrl !== currentImageUrl) {\r\n $(imageElement)\r\n .addClass(\"opacity-05\")\r\n .attr(\"src\", variant.imageUrl)\r\n .attr(\"width\", variant.imageWidth)\r\n .attr(\"height\", variant.imageHeight)\r\n .one(\"load\", function () { $(this).removeClass(\"opacity-05\") });\r\n }\r\n $(componentElement).find(\".dimensions-image-wrapper\").removeClass(\"d-none\");\r\n displayed.image = true;\r\n } else {\r\n $(componentElement).find(\".dimensions-image-wrapper\").addClass(\"d-none\");\r\n }\r\n //do we have iters and ecers?\r\n if ($(componentElement).find(itersEcersSelector).length) {\r\n displayed.itersEcers = true;\r\n }\r\n // If there's something displayed - display the component title as well. Otherwise hide it.\r\n if (displayed.details || displayed.dimensions || displayed.image || displayed.itersEcers) {\r\n $(componentTitleSelector).removeClass(\"d-none\");\r\n } else {\r\n $(componentTitleSelector).addClass(\"d-none\");\r\n }\r\n }\r\n }\r\n\r\n return {\r\n displayVariantData: displayVariantData\r\n };\r\n });\r\n\n", "define('shoppingCartIcon/shoppingCartIcon',[\r\n],\r\n function () {\r\n\r\n const itemCountSelector = \".shopping-cart-icon .item-count\";\r\n\r\n function updateItemCount(count) {\r\n $(itemCountSelector).empty();\r\n if (count > 0) {\r\n $(itemCountSelector).text(count);\r\n }\r\n }\r\n\r\n return {\r\n updateItemCount: updateItemCount\r\n };\r\n });\r\n\n", "define('common/formUtils',[\r\n],\r\n function () {\r\n\r\n // Clears and deactivates all invalid feedback text on form fields\r\n function clearInvalidFeedback(formId) {\r\n if (!formId.startsWith(\"#\")) formId = \"#\" + formId;\r\n $(formId + \" .is-invalid\").removeClass(\"is-invalid\");\r\n $(formId + \" .invalid-feedback\").empty();\r\n }\r\n\r\n // Fills in and activates invalid feedback text on form fields\r\n function displayInvalidFeedback(invalidFields, formId) {\r\n if (!formId.startsWith(\"#\")) formId = \"#\" + formId;\r\n if (invalidFields) {\r\n invalidFields.forEach(function (fieldMessage) {\r\n var field = $(formId + \" [name='\" + fieldMessage.FieldName + \"']\");\r\n field.addClass(\"is-invalid\");\r\n field.siblings(\".invalid-feedback\").append(fieldMessage.MessageText);\r\n });\r\n }\r\n }\r\n\r\n // Collects the data from all form fields and returns them as object,\r\n // using \"name\" attribute values from form fields as object property names.\r\n function collectFormData(formId) {\r\n if (!formId.startsWith(\"#\")) formId = \"#\" + formId;\r\n // the serializeArray() jQuery method doesn't take the values from disabled fields, so first I'll\r\n // temporarily enable all disabled fields, and then disable them again\r\n var disabledFields = $(formId).find(\":input:disabled\").prop(\"disabled\", false);\r\n var serializedData = $(formId).serializeArray();\r\n disabledFields.prop(\"disabled\", true);\r\n var formData = {};\r\n serializedData.forEach(function (data) {\r\n formData[data.name] = data.value;\r\n });\r\n // serializeArray does not return anything for unchecked checkboxes, so we'll add them now with value false\r\n $(formId + \" input[type='checkbox']:not(:checked)\").each(function (index, element) {\r\n formData[element.name] = false;\r\n });\r\n // serializeArray returns \"on\" for checked checkboxes, so we'll set them to true now\r\n $(formId + \" input[type='checkbox']:checked\").each(function (index, element) {\r\n formData[element.name] = true;\r\n });\r\n return formData;\r\n }\r\n\r\n // Goes through all input elements on the form and fills them with data from the\r\n // given object, matching \"name\" attribute of the input element with object property name.\r\n function populateFormWithData(formId, data) {\r\n if (!formId.startsWith(\"#\")) formId = \"#\" + formId;\r\n $(formId + \" :input\").each(function (index, element) { \r\n if (element.type === \"radio\" ||\r\n element.type === \"checkbox\")\r\n {\r\n if (data[element.name] !== undefined)\r\n $(element).prop(\"checked\", $(element).val().toString() === data[element.name].toString());\r\n }\r\n else if (element.type === \"text\" ||\r\n element.type === \"email\" ||\r\n element.type === \"tel\" ||\r\n element.type === \"password\" ||\r\n element.type === \"textarea\" ||\r\n element.type === \"select-one\")\r\n {\r\n if (data[element.name] !== undefined)\r\n $(element).val(data[element.name]);\r\n else\r\n $(element).val(null);\r\n }\r\n });\r\n }\r\n\r\n function disableFields(formId) {\r\n if (!formId.startsWith(\"#\")) formId = \"#\" + formId;\r\n $(formId + \" :input\").prop(\"disabled\", true);\r\n }\r\n\r\n function enableFields(formId) {\r\n if (!formId.startsWith(\"#\")) formId = \"#\" + formId;\r\n $(formId + \" :input\").prop(\"disabled\", false);\r\n }\r\n\r\n function initializeFloatingLabels(formId) {\r\n if (!formId.startsWith(\"#\")) formId = \"#\" + formId;\r\n $(formId + \" .floating-label-container\").each(function (index, element) {\r\n var inputElement = $(element).find(\":input\")[0];\r\n if (inputElement.value) $(element).addClass(\"active\");\r\n else $(element).removeClass(\"active\");\r\n });\r\n }\r\n\r\n //adds the form token to the object for use with [ValidateAntiforgeryToken] attribute\r\n function useToken(data) { \r\n var token = $('input[name=\"__RequestVerificationToken\"]').val();\r\n data.__RequestVerificationToken = token;\r\n }\r\n\r\n return {\r\n clearInvalidFeedback: clearInvalidFeedback,\r\n displayInvalidFeedback: displayInvalidFeedback,\r\n collectFormData: collectFormData,\r\n populateFormWithData: populateFormWithData,\r\n disableFields: disableFields,\r\n enableFields: enableFields,\r\n initializeFloatingLabels: initializeFloatingLabels,\r\n useToken: useToken\r\n };\r\n });\r\n\n", "define('common/alertMessage',[\r\n],\r\n function () {\r\n\r\n const alertSelector = \"#alertMessage\";\r\n const allButtonsSelector = alertSelector + \" .modal-footer button\";\r\n const buttonSelector = {\r\n ok: allButtonsSelector + \".ok\",\r\n yes: allButtonsSelector + \".yes\",\r\n no: allButtonsSelector + \".no\"\r\n };\r\n\r\n function show(messageText, okCallback) {\r\n setIcon();\r\n setButtons(\"ok\", okCallback);\r\n displayAlert(messageText);\r\n }\r\n\r\n function info(messageText, okCallback) {\r\n setIcon(\"info\");\r\n setButtons(\"ok\", okCallback);\r\n displayAlert(messageText);\r\n }\r\n\r\n function warning(messageText, okCallback) {\r\n setIcon(\"warning\");\r\n setButtons(\"ok\", okCallback);\r\n displayAlert(messageText);\r\n }\r\n \r\n function error(messageText, okCallback, displayDefaultMessage) {\r\n setIcon(\"error\");\r\n setButtons(\"ok\", okCallback); \r\n if (typeof messageText === 'undefined' || messageText === null) messageText = \"\";\r\n if (typeof displayDefaultMessage === 'undefined') displayDefaultMessage = true;\r\n if (displayDefaultMessage || messageText === \"\") {\r\n messageText = CP.Messages[\"General/Default Error Message\"] + messageText;\r\n }\r\n displayAlert(messageText);\r\n }\r\n\r\n function yesNoQuestion(messageText, yesCallback, noCallback) {\r\n setIcon(\"question\");\r\n setButtons(\"yes-no\", yesCallback, noCallback);\r\n displayAlert(messageText);\r\n }\r\n\r\n function setIcon(iconName) {\r\n $(alertSelector + \" .icons\").addClass(\"d-none\");\r\n $(alertSelector + \" i\").addClass(\"d-none\");\r\n if (iconName) {\r\n $(alertSelector + \" .icons\").removeClass(\"d-none\");\r\n $(alertSelector + \" i.\" + iconName).removeClass(\"d-none\");\r\n }\r\n }\r\n\r\n function setButtons(buttons, callback1, callback2) {\r\n $(allButtonsSelector).addClass(\"d-none\");\r\n $(buttonSelector.ok).off(\"click\");\r\n $(buttonSelector.yes).off(\"click\");\r\n $(buttonSelector.no).off(\"click\");\r\n if (buttons === \"yes-no\") {\r\n $(buttonSelector.yes).removeClass(\"d-none\");\r\n $(buttonSelector.no).removeClass(\"d-none\");\r\n $(buttonSelector.yes).on(\"click\", function () { hideAndCallback(callback1); });\r\n $(buttonSelector.no).on(\"click\", function () { hideAndCallback(callback2); });\r\n }\r\n else {\r\n $(buttonSelector.ok).removeClass(\"d-none\");\r\n $(buttonSelector.ok).on(\"click\", function () { hideAndCallback(callback1); });\r\n }\r\n }\r\n\r\n var alertModal;\r\n\r\n function displayAlert(messageText) {\r\n $(alertSelector + \" .alert-text\").empty().html(messageText);\r\n if (!alertModal) {\r\n // initializing alertModal\r\n var alertElement = document.querySelector(alertSelector);\r\n if (alertElement) {\r\n alertModal = bootstrap.Modal.getOrCreateInstance(alertElement, { backdrop: \"static\", keyboard: false });\r\n if (!alertModal) console.log(\"Alert modal not initialized for \" + alertSelector);\r\n }\r\n else console.log(\"There's no alert modal with selector \" + alertSelector);\r\n }\r\n if (alertModal) alertModal.show();\r\n }\r\n\r\n function hideAndCallback(callback) {\r\n if (callback) $(alertSelector).one(\"hidden.bs.modal\", callback);\r\n if (alertModal) alertModal.hide();\r\n }\r\n\r\n return {\r\n show: show,\r\n info: info,\r\n warning: warning,\r\n error: error,\r\n yesNoQuestion: yesNoQuestion\r\n };\r\n });\r\n\n", "define('shoppingCartIcon/miniCart',[\r\n \"common/formUtils\",\r\n \"common/alertMessage\"\r\n],\r\nfunction (formUtils, alertMessage) {\r\n\r\n const miniCartSelector = \".mini-cart\";\r\n const cartIconSelector = \".shopping-cart-icon .the-icon\";\r\n var autoHideTimeout = 0;\r\n\r\n function init() {\r\n $(cartIconSelector).webuiPopover({\r\n trigger: \"click\",\r\n placement: \"bottom-left\",\r\n width: 400,\r\n type: \"html\",\r\n url: \".mini-cart\",\r\n animation: \"fade\",\r\n multi: true,\r\n arrow: false,\r\n closeable: true,\r\n onShow: populateMiniCart\r\n });\r\n }\r\n\r\n function flash() {\r\n // I've tried this by using some of the WebuiPopover methods (https://github.com/sandywalker/webui-popover),\r\n // but none of them worked for changing the options on the fly, so I'm accessing the popover options\r\n // directly from the data object on the cart icon element.\r\n var options = $(cartIconSelector).data(\"plugin_webuiPopover\").options;\r\n\r\n // setting the options for flashing the popover\r\n var pageTop = $(window).scrollTop();\r\n var cartIconPosition = $(cartIconSelector).offset().top + $(cartIconSelector)[0].offsetHeight;\r\n if (pageTop > cartIconPosition) {\r\n // cart icon is out of the view, offset the popover so it's visible\r\n options.offsetTop = pageTop - cartIconPosition;\r\n }\r\n autoHideTimeout = 3000; // auto hide the popup 3 seconds after its content has loaded\r\n\r\n // showing the popover\r\n $(cartIconSelector).webuiPopover(\"show\");\r\n\r\n // resetting the options back to default values\r\n options.offsetTop = 0;\r\n }\r\n\r\n function populateMiniCart() {\r\n spinner(\"show\");\r\n var postData = {};\r\n formUtils.useToken(postData);\r\n\r\n $.ajax({\r\n type: \"POST\",\r\n url: \"/customapi/Order/GetMiniCart\",\r\n dataType: \"json\",\r\n data: postData,\r\n success: function (data) {\r\n if (data.status === \"OK\") {\r\n $(miniCartSelector + \" .mini-cart-content\").empty().html(data.content);\r\n if (data.count > 0) {\r\n $(miniCartSelector + \" .mini-cart-button\").removeClass(\"d-none\");\r\n }\r\n if (autoHideTimeout > 0) {\r\n // hiding the minicart popup after a set timeout\r\n setTimeout(function () {\r\n $(cartIconSelector).webuiPopover(\"hide\");\r\n }, autoHideTimeout);\r\n autoHideTimeout = 0;\r\n }\r\n } else if (data.status === \"ERROR\") {\r\n alertMessage.error(data.message);\r\n }\r\n },\r\n error: function (jq, status, errorThrown) {\r\n alertMessage.error(status + \": \" + errorThrown);\r\n },\r\n complete: function () {\r\n spinner(\"hide\");\r\n }\r\n\r\n });\r\n\r\n }\r\n\r\n function spinner(what) {\r\n if (what === \"show\") {\r\n $(miniCartSelector + \" .mini-cart-content\").empty(); // remove previous content\r\n $(miniCartSelector + \" .mini-cart-button\").addClass(\"d-none\"); // hide button\r\n $(miniCartSelector + \" .spinner\").removeClass(\"d-none\"); // show spinner\r\n }\r\n else if (what === \"hide\") {\r\n $(miniCartSelector + \" .spinner\").addClass(\"d-none\");\r\n }\r\n\r\n }\r\n\r\n return {\r\n init: init,\r\n flash: flash\r\n };\r\n});\r\n\n", "define('productDescriptionTabs/replacementParts',[\r\n],\r\nfunction () {\r\n\r\n function init() {\r\n $(\".more-replacement-parts .link\").off(\"click\").on(\"click\", showMoreReplacementParts);\r\n if ($(\".replacement-parts .part-tile\").length > partsInitiallyDisplayedOnMobile) {\r\n $(window).off(\"resize.replacementParts\").on(\"resize.replacementParts\", adjustNumberofDisplayedParts);\r\n }\r\n showMoreLinkVisible = true;\r\n currentView = views.none;\r\n adjustNumberofDisplayedParts();\r\n }\r\n\r\n function showMoreReplacementParts(event) {\r\n $(\".replacement-parts .part-tile\").removeClass(\"d-none\");\r\n $(\".more-replacement-parts\").addClass(\"d-none\");\r\n showMoreLinkVisible = false;\r\n }\r\n\r\n var views = {\r\n desktop: 1,\r\n mobile: 2,\r\n none: 3\r\n };\r\n\r\n var partsInitiallyDisplayedOnMobile = 2;\r\n var partsInitiallyDisplayedOnDesktop = 3;\r\n var showMoreLinkVisible = true;\r\n\r\n var currentView = views.none;\r\n var mobileBreakpoint;\r\n\r\n function adjustNumberofDisplayedParts(event) {\r\n if (!showMoreLinkVisible) return;\r\n\r\n var width = $(window).width();\r\n if (!mobileBreakpoint) {\r\n mobileBreakpoint = $(\".dynamic-mobile-accordion\").data(\"mobileBreakpoint\");\r\n }\r\n\r\n if (width < mobileBreakpoint && currentView !== views.mobile) {\r\n // SWITCH TO MOBILE\r\n $(\".replacement-parts .part-tile.active\").addClass(\"d-none\");\r\n $(\".replacement-parts .part-tile.active:lt(\" + partsInitiallyDisplayedOnMobile + \")\").removeClass(\"d-none\");\r\n\r\n if ($(\".replacement-parts .part-tile.active\").length > partsInitiallyDisplayedOnMobile) {\r\n $(\".more-replacement-parts\").removeClass(\"d-none\");\r\n } else {\r\n $(\".more-replacement-parts\").addClass(\"d-none\");\r\n }\r\n\r\n currentView = views.mobile;\r\n } else if (width >= mobileBreakpoint && currentView !== views.desktop) {\r\n // SWITCH TO DESKTOP\r\n $(\".replacement-parts .part-tile.active\").addClass(\"d-none\");\r\n $(\".replacement-parts .part-tile.active:lt(\" + partsInitiallyDisplayedOnDesktop + \")\").removeClass(\"d-none\");\r\n\r\n if ($(\".replacement-parts .part-tile.active\").length > partsInitiallyDisplayedOnDesktop) {\r\n $(\".more-replacement-parts\").removeClass(\"d-none\");\r\n } else {\r\n $(\".more-replacement-parts\").addClass(\"d-none\");\r\n }\r\n\r\n currentView = views.desktop;\r\n }\r\n\r\n var activePartsCount = $(\".replacement-parts .part-tile.active\").length;\r\n if (activePartsCount > 0) {\r\n $(\".more-replacement-parts .count\").text(activePartsCount);\r\n $(\".replacement-parts\").removeClass(\"d-none\");\r\n }\r\n else {\r\n $(\".replacement-parts\").addClass(\"d-none\");\r\n }\r\n \r\n }\r\n\r\n function display(variantSku) {\r\n $(\".replacement-parts .part-tile[data-related-to-variant-sku!='']\").removeClass(\"active\");\r\n $(\".replacement-parts .part-tile[data-related-to-variant-sku='\" + variantSku + \"']\").addClass(\"active\");\r\n init();\r\n }\r\n\r\n return {\r\n display: display\r\n };\r\n \r\n});\r\n\n", "define('common/spinner',[\r\n],\r\n function () {\r\n\r\n var spinnerShownAt = {};\r\n\r\n function show(spinnerSelector) {\r\n $(spinnerSelector).removeClass(\"d-none\");\r\n var image = $(spinnerSelector).find(\"img\");\r\n if (image.length) {\r\n var alt = $(image).attr(\"alt\");\r\n if (!alt)\r\n $(image).attr(\"alt\", \"Spinner\");\r\n }\r\n // mark the time when this spinner was displayed\r\n spinnerShownAt[spinnerSelector] = Date.now();\r\n }\r\n\r\n function hide(spinnerSelector, callbackWhenHidden) {\r\n // This logic ensures that the spinner is displayed for at least 500ms.\r\n // Otherwise it just flickers and that doesn't look good for the user.\r\n var waitTime = 500 - (Date.now() - spinnerShownAt[spinnerSelector]);\r\n if (waitTime > 0) {\r\n setTimeout(function () {\r\n $(spinnerSelector).addClass(\"d-none\");\r\n if (callbackWhenHidden) callbackWhenHidden();\r\n }, waitTime);\r\n }\r\n else {\r\n $(spinnerSelector).addClass(\"d-none\");\r\n if (callbackWhenHidden) callbackWhenHidden();\r\n }\r\n }\r\n\r\n function getSpinnerHtml(spinnerId) {\r\n return '