{
  "version": 3,
  "sources": ["/cdn/shop/t/6/assets/recently-viewed-product.js"],
  "sourcesContent": ["/**\n * Cookie plugin\n *\n * Copyright (c) 2006 Klaus Hartl (stilbuero.de)\n * Dual licensed under the MIT and GPL licenses:\n * http://www.opensource.org/licenses/mit-license.php\n * http://www.gnu.org/licenses/gpl.html\n *\n */\n\n jQuery.cookie=function(b,j,m){if(typeof j!=\"undefined\"){m=m||{};if(j===null){j=\"\";m.expires=-1}var e=\"\";if(m.expires&&(typeof m.expires==\"number\"||m.expires.toUTCString)){var f;if(typeof m.expires==\"number\"){f=new Date();f.setTime(f.getTime()+(m.expires*24*60*60*1000))}else{f=m.expires}e=\"; expires=\"+f.toUTCString()}var l=m.path?\"; path=\"+(m.path):\"\";var g=m.domain?\"; domain=\"+(m.domain):\"\";var a=m.secure?\"; secure\":\"\";document.cookie=[b,\"=\",encodeURIComponent(j),e,l,g,a].join(\"\")}else{var d=null;if(document.cookie&&document.cookie!=\"\"){var k=document.cookie.split(\";\");for(var h=0;h<k.length;h++){var c=jQuery.trim(k[h]);if(c.substring(0,b.length+1)==(b+\"=\")){d=decodeURIComponent(c.substring(b.length+1));break}}}return d}};\n\n /**\n  * Module to show Recently Viewed Products\n  *\n  * Copyright (c) 2014 Caroline Schnapp (11heavens.com)\n  * Dual licensed under the MIT and GPL licenses:\n  * http://www.opensource.org/licenses/mit-license.php\n  * http://www.gnu.org/licenses/gpl.html\n  *\n  */\n \n Shopify.Products = (function() {\n     var config = {\n         howManyToShow: 3,\n         howManyToStoreInMemory: 10,\n         wrapperId: 'recently-viewed-products',\n         templateId: 'recently-viewed-product-template',\n         layout: 'slider',\n         swipe: true,\n         media: 'adapt',\n         onComplete: null\n     };\n     var productHandleQueue = [];\n     var wrapper = null;\n     var template = null;\n     var shown = 0;\n     var cookie = {\n         configuration: {\n             expires: 90,\n             path: '/',\n             domain: window.location.hostname\n         },\n         name: 'shopify_recently_viewed',\n         write: function(recentlyViewed) {\n             jQuery.cookie(this.name, recentlyViewed.join(' '), this.configuration);\n         },\n         read: function() {\n             var recentlyViewed = [];\n             var cookieValue = jQuery.cookie(this.name);\n             if (cookieValue !== null) {\n                 recentlyViewed = cookieValue.split(' ');\n             }\n             return recentlyViewed;\n         },\n         destroy: function() {\n             jQuery.cookie(this.name, null, this.configuration);\n         },\n         remove: function(productHandle) {\n             var recentlyViewed = this.read();\n             var position = jQuery.inArray(productHandle, recentlyViewed);\n             if (position !== -1) {\n                 recentlyViewed.splice(position, 1);\n                 this.write(recentlyViewed);\n             }\n         }\n     };\n \n     var finalize = function() {\n         var items = wrapper.find('.item')\n         if (items.length <= 2) $('#recently-viewed-products-list').addClass('center');\n \n         $('#recently-viewed-products-list-2').addClass('recently-viewed-loaded');\n         \n         wrapper.show();\n         // If we have a callback.\n         if (config.onComplete) {\n             try {\n                 config.onComplete();\n             } catch (error) {}\n         }\n     };\n \n     var moveAlong = function() {\n         if (productHandleQueue.length && shown < config.howManyToShow) {\n             var url = window.routes.root + '/products/' + productHandleQueue[0] + '?view=ajax_recently_viewed';\n \n             jQuery.ajax({\n                 type: 'get',\n                 url: url,\n                 cache: false,\n                 success: function(product) {\n                     wrapper.append(product);\n                     productHandleQueue.shift();\n                     shown++;\n                     moveAlong();\n                 },\n                 error: function() {\n                     cookie.remove(productHandleQueue[0]);\n                     productHandleQueue.shift();\n                     moveAlong();\n                 }\n             });\n         } else {\n             finalize();\n         }\n     };\n \n     var doAlong = function() {\n         if (productHandleQueue.length) {\n             var url = window.routes.root + '/collections/all';\n                 \n             const trips = productHandleQueue.join(encodeURIComponent(','));\n             $.ajax({\n                 type: 'get',\n                 url: url,\n                 cache: false,\n                 data: {\n                     view: 'ajax_recently_viewed',\n                     constraint: `limit=${productHandleQueue.length}+layout=${config.layout}+imageRatio=${config.media}+swipe=${config.swipe}+sectionId=recently-viewed+list_handle=` + trips\n                 },\n                 beforeSend: function () {},\n                 success: function (data) {\n                     const recentlyViewedRow = $('.halo-recently-viewed-block .recentlyViewed-row');\n                     recentlyViewedRow.empty();\n                     wrapper.append(data);\n                 },  \n                 error: function (xhr, text) {\n                     alert($.parseJSON(xhr.responseText).description);\n                 },\n                 complete: function () {\n                     if(config.layout == 'slider'){\n                         var wrapper = $('.halo-recently-viewed-block'),\n                             productGrid = wrapper.find('.products-carousel'),\n                             itemToShow = productGrid.data('item-to-show'),\n                             itemDots = productGrid.data('item-dots'),\n                             itemDotsMb = productGrid.data('item-dots-mb'),\n                             itemArrows = productGrid.data('item-arrows'),\n                             itemArrowsMb = productGrid.data('item-arrows-mb');\n \n                         if(productGrid.length > 0) {\n                             if(productGrid.not('.slick-initialized')) {\n                                 productGrid.slick({\n                                     mobileFirst: true,\n                                     adaptiveHeight: true,\n                                     vertical: false,\n                                     infinite: true,\n                                     slidesToShow: 1,\n                                     slidesToScroll: 1,\n                                     arrows: itemArrowsMb,\n                                     dots: itemDotsMb,\n                                     nextArrow: window.arrows.icon_next,\n                                     prevArrow: window.arrows.icon_prev,\n                                     rtl: window.rtl_slick,\n                                     responsive: \n                                     [\n                                         {\n                                             breakpoint: 1599,\n                                             settings: {\n                                                 arrows: itemArrows,\n                                                 dots: itemDots,\n                                                 get slidesToShow() {\n                                                     if(itemToShow !== undefined && itemToShow !== null && itemToShow !== ''){\n                                                         return this.slidesToShow = itemToShow;\n                                                     } else {\n                                                         return this.slidesToShow = 1;\n                                                     }\n                                                 },\n                                                 get slidesToScroll() {\n                                                     if(itemToShow !== undefined && itemToShow !== null && itemToShow !== ''){\n                                                         return this.slidesToScroll = itemToShow;\n                                                     } else {\n                                                         return this.slidesToScroll = 1;\n                                                     }\n                                                 }\n                                             }\n                                         },\n                                         {\n                                             breakpoint: 1024,\n                                             settings: {\n                                                 arrows: itemArrows,\n                                                 dots: itemDots,\n                                                 get slidesToShow() {\n                                                     if(itemToShow !== undefined && itemToShow !== null && itemToShow !== ''){\n                                                         if(itemToShow == 5){\n                                                             return this.slidesToShow = itemToShow - 1;\n                                                         } else {\n                                                             return this.slidesToShow = itemToShow;\n                                                         }\n                                                     } else {\n                                                         return this.slidesToShow = 1;\n                                                     }\n                                                 },\n                                                 get slidesToScroll() {\n                                                     if(itemToShow !== undefined && itemToShow !== null && itemToShow !== ''){\n                                                         if(itemToShow == 5){\n                                                             return this.slidesToScroll = itemToShow - 1;\n                                                         } else {\n                                                             return this.slidesToScroll = itemToShow;\n                                                         }\n                                                     } else {\n                                                         return this.slidesToScroll = 1;\n                                                     }\n                                                 }\n                                             }\n                                         },\n                                         {\n                                             breakpoint: 991,\n                                             settings: {\n                                                 arrows: itemArrowsMb,\n                                                 dots: itemDotsMb,\n                                                 slidesToShow: 4,\n                                                 slidesToScroll: 4\n                                             }\n                                         },\n                                         {\n                                             breakpoint: 767,\n                                             settings: {\n                                                 arrows: itemArrowsMb,\n                                                 dots: itemDotsMb,\n                                                 slidesToShow: 3,\n                                                 slidesToScroll: 3\n                                             }\n                                         },\n                                         {\n                                             breakpoint: 320,\n                                             settings: {\n                                                 arrows: itemArrowsMb,\n                                                 dots: itemDotsMb,\n                                                 slidesToShow: 2,\n                                                 slidesToScroll: 2\n                                             }\n                                         }\n                                     ]\n                                 });\n                             }\n                         }\n                     }\n                 }\n             });\n         }\n     };\n \n     return {\n         resizeImage: function(src, size) {\n             if (size == null) {\n                 return src;\n             }\n \n             if (size == 'master') {\n                 return src.replace(/http(s)?:/, \"\");\n             }\n \n             var match = src.match(/\\.(jpg|jpeg|gif|png|bmp|bitmap|tiff|tif)(\\?v=\\d+)?/i);\n \n             if (match != null) {\n                 var prefix = src.split(match[0]);\n                 var suffix = match[0];\n \n                 return (prefix[0] + \"_\" + size + suffix).replace(/http(s)?:/, \"\")\n             } else {\n                 return null;\n             }\n         },\n \n         showRecentlyViewed: function(params) {\n             var params = params || {};\n \n             // Update defaults.\n             jQuery.extend(config, params);\n \n             // Read cookie.\n             productHandleQueue = cookie.read();\n \n             // Template and element where to insert.\n             template = config.templateId;\n             wrapper = jQuery('#' + config.wrapperId);\n \n             // How many products to show.\n             config.howManyToShow = Math.min(productHandleQueue.length, config.howManyToShow);\n \n             // If we have any to show.\n             if (config.howManyToShow && wrapper.length) {\n                 // Getting each product with an Ajax call and rendering it on the page.\n                 if (template == 'recently-viewed-product-popup'){\n                     moveAlong();\n                 } else {\n                     doAlong();\n                 }\n             }\n         },\n \n         getConfig: function() {\n             return config;\n         },\n \n         clearList: function() {\n             cookie.destroy();\n         },\n \n         recordRecentlyViewed: function(params) {\n             var params = params || {};\n \n             // Update defaults.\n             jQuery.extend(config, params);\n \n             // Read cookie.\n             var recentlyViewed = cookie.read();\n \n             // If we are on a product page.\n             if (window.location.pathname.indexOf('/products/') !== -1) {\n                 // What is the product handle on this page.\n                 var splitted = window.location.pathname.match(/\\/products\\/([a-z0-9\\-]+)/);\n                 if (splitted == null) {\n                     var productHandle = decodeURIComponent(window.location.pathname.split('/products/')[1]);\n                 } else {\n                   var productHandle = window.location.pathname.match(/\\/products\\/([a-z0-9\\-]+)/)[1];\n                 }\n                 // In what position is that product in memory.\n                 var position = jQuery.inArray(productHandle, recentlyViewed);\n                 // If not in memory.\n                 if (position === -1) {\n                     // Add product at the start of the list.\n                     recentlyViewed.unshift(productHandle);\n                     // Only keep what we need.\n                     recentlyViewed = recentlyViewed.splice(0, config.howManyToStoreInMemory);\n                 } else {\n                     // Remove the product and place it at start of list.\n                     recentlyViewed.splice(position, 1);\n                     recentlyViewed.unshift(productHandle);\n                 }\n \n                 // Update cookie.\n                 cookie.write(recentlyViewed);\n             }\n         }\n     };\n })();"],
  "mappings": "AAUC,OAAO,OAAO,SAAS,EAAE,EAAE,EAAE,CAAC,GAAG,OAAO,EAAG,IAAY,CAAC,EAAE,GAAG,CAAC,EAAK,IAAI,OAAM,EAAE,GAAG,EAAE,QAAQ,IAAG,IAAI,EAAE,GAAG,GAAG,EAAE,UAAU,OAAO,EAAE,SAAS,UAAU,EAAE,QAAQ,aAAa,CAAC,IAAI,EAAK,OAAO,EAAE,SAAS,UAAU,EAAE,IAAI,KAAO,EAAE,QAAQ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