{
  "version": 3,
  "sources": ["/cdn/shop/t/8/assets/recently-viewed-product.js?view=ajax_recently_viewed"],
  "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\njQuery.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\nShopify.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 shownSection = 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 (wrapperP) {\n        if (productHandleQueue.length && shown < config.howManyToShow) {\n            var url = window.routes.root + '/products/' + productHandleQueue[shown] + '?view=ajax_recently_viewed';\n\n            jQuery.ajax({\n                type: 'get',\n                url: url,\n                cache: false,\n                success: function (product) {\n                    wrapperP.append(product);\n                    shown++;\n                    moveAlong(wrapperP);\n                },\n                error: function () {\n                    cookie.remove(productHandleQueue[shown]);\n                    shown++;\n                    moveAlong(wrapperP);\n                }\n            });\n        } else {\n            finalize();\n        }\n    };\n\n    var doAlong = function (wrapperS) {\n        const recentlyViewed = wrapperS.parents('.halo-recently-viewed-block');\n\n        if (productHandleQueue.length && shownSection < config.howManyToShow) {\n            var url = window.routes.root + '/products/' + productHandleQueue[shownSection] + '?view=ajax_section_recently_viewed';\n\n            jQuery.ajax({\n                type: 'get',\n                url: url,\n                cache: false,\n                success: function (product) {\n                    wrapperS.append(product);\n                    if (shownSection == 0) {\n                        const productLoading = wrapperS.find('.product-item--loadingNoInfo').parents('.product');\n                        productLoading.remove();\n                    }\n                    shownSection++;\n                    doAlong(wrapperS);\n                },\n                error: function () {\n                    console.log($.parseJSON(xhr.responseText).description);\n                }\n            });\n        } else {\n            if (productHandleQueue.length == 0) {\n                recentlyViewed.hide();\n                return;\n            }\n\n            if (config.layout == 'slider') {\n                var productGrid = wrapperS,\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    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                    const wrapperP = wrapper;\n                    moveAlong(wrapperP);\n                } else {\n                    const wrapperS = wrapper;\n                    doAlong(wrapperS);\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": "AAUA,OAAO,OAAS,SAAU,EAAG,EAAG,EAAG,CAAE,GAAI,OAAO,EAAK,IAAa,CAAE,EAAI,GAAK,CAAC,EAAO,IAAM,OAAQ,EAAI,GAAI,EAAE,QAAU,IAAK,IAAI,EAAI,GAAI,GAAI,EAAE,UAAY,OAAO,EAAE,SAAW,UAAY,EAAE,QAAQ,aAAc,CAAE,IAAI,EAAO,OAAO,EAAE,SAAW,UAAY,EAAI,IAAI,KAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAK,EAAE,QAAU,GAAK,GAAK,GAA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