{
  "version": 3,
  "sources": ["/cdn/shop/t/61/assets/custom.js?enable_js_minification=1"],
  "sourcesContent": ["/*\n* Pipeline Theme\n*\n* Use this file to add custom Javascript to Pipeline.  Keeping your custom\n* Javascript in this fill will make it easier to update Pipeline. In order\n* to use this file you will need to open layout/theme.liquid and uncomment\n* the custom.js script import line near the bottom of the file.\n*\n*/\n\n\n(function() {\n\n  // Below are example event listeners.  They listen for theme events that Pipeline\n  // fires in order to make it easier for you to add customizations.\n\n  // Keep your scripts inside this IIFE function call to avoid leaking your\n  // variables into the global scope.\n\n\n  document.addEventListener('theme:variant:change', function(event) {\n    // You might use something like this to write a pre-order feature or a\n    // custom swatch feature.\n    var variant = event.detail.variant;\n    var container = event.target;\n    if (variant) {\n      console.log('Container \u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014 \u2193');\n      console.log(container);\n      console.log('Variant \u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014 \u2193');\n      console.log(variant);\n      // ... update some element on the page\n    }\n  });\n\n  document.addEventListener('theme:cart:change', function(event) {\n    var cart = event.detail.cart;\n    if (cart) {\n      console.log('Cart \u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014 \u2193');\n      console.log(cart);\n      // ... update an app or a custom shipping caluclator\n    }\n  });\n  // Fired when page loads to update header values\n  document.addEventListener('theme:cart:init', (e) => {\n    console.log('theme:cart:init');\n    console.log(e);\n  });\n\n  // Debounced scroll listeners.  Up and down only fire on direction changes\n  // These events are useful for creating sticky elements and popups.\n  // document.addEventListener('theme:scroll', e => { console.log(e); });\n  // document.addEventListener('theme:scroll:up', e => { console.log(e); });\n  // document.addEventListener('theme:scroll:down', e => { console.log(e); });\n\n  // Debounced resize listener to bundle changes that trigger document reflow\n  document.addEventListener('theme:resize', e => { console.log(e); });\n\n  // Locks and unlocks page scroll for modals and drawers\n  // These are commented out because firing them will lock the page scroll\n  // the lock event must set `detail` to the modal or drawer body so the \n  // scroll locking code knows what element should maintain scoll. \n  // document.dispatchEvent(new CustomEvent('theme:scroll:lock', {bubbles: true, detail: scrollableInnerElement}));\n  // document.dispatchEvent(new CustomEvent('theme:scroll:unlock', {bubbles: true}));\n\n\n  // ^^ Keep your scripts inside this IIFE function call to avoid leaking your\n  // variables into the global scope.\n\n/**\n * Carousel Component\n * --------------------------------------------------------------------\n * @summary carousel, uses swiper, dots are optional, and arrows are optional\n *\n * See https://swiperjs.com/swiper-api#parameters for more carousel options\n *\n * @usage\n * \n *     {%- capture carousel_options -%}\n *       {\n *         \"slidesPerView\": \"auto\",\n *         \"loop\": false,\n *         ...\n *       }\n *     {%- endcapture -%}\n *      <s-carousel data-options='{{carousel_options}}' data-init=\"{{breakpoint}}\">\n *        <div id=\"{{custom_id}}\" class=\"swiper\" js-carousel>\n *          <div class=\"swiper-wrapper\">\n *            <div class=\"swiper-slide\" js-carousel-slide></div>\n *            ...\n *          </div>\n *          <div class=\"swiper-button-prev {{prev_button_class}}\"></div>\n *          <div class=\"swiper-button-next {{next_button_class}}\"></div>\n *          <div class=\"swiper-pagination {{pagination_class}}\"></div>\n *        </div>\n *      </s-carousel>\n *\n * The following parameters are attributes that the <s-carousel> element takes\n * @param data-options - object containing swiper options\n *                       ex.{\"slidesPerView\":\"auto\", \"loop\":false}\n *                       only needed if modifying or extending on default options\n *                       be careful with syntax here you have to use single quote on the outside,\n *                       and double quotes in the capture so that the JSON.parse() doesn't error.\n *                       DEFAULT OPTIONS:\n *                          loop: true,\n *                          slidesPerView: 'auto',\n *                          grabCursor: true,\n *                          centeredSlides: false,\n *                          on: {init: this._onReady},\n * \n * @param data-init - use to initialize or destroy carousel at certain widths.\n *                    pass in variable from theme.config.mediaQueries (/global/config.js)\n *                    \n *                    enquire match/unmatch is pretty specific, so follow the rules below:\n *                    if mobile = destroyed, higher width = initialized, use a max-width variable\n *                    if mobile = intialized, higher width = destroyed, use a min-width variable\n * \n *                    if breakpoint does not exist, feel free to add to config.js\n *\n * The following are selectors that the <s-carousel> searches for\n * [js-carousel] - required, this contains the slides and the arrows.\n * id - required, should be same element as [js-carousel]\n * .swiper - required class\n * .swiper-wrapper - required class\n * [js-carousel-slide] - required, each slide element needs this (differentiates from the arrows)\n * .swiper-slide - required class\n * .swiper-pagination - optional, custom {{pagination_class}} required if using pagination\n * .swiper-button-prev - optional, custom {{prev_button_class}} required if using navigation\n * .swiper-button-next - optional, custom {{next_button_class}} required if using navigation\n */\n\nclass Carousel extends HTMLElement {\n  constructor() {\n    super();\n\n    this.selectors = {\n      carousel: '[js-carousel]',\n      prevButton: '.carousel__button--prev',\n      nextButton: '.carousel__button--next'\n    }\n\n    this.options = {\n      loop: true,\n      slidesPerView: 'auto',\n      grabCursor: true,\n      centeredSlides: false,\n      navigation: false,\n      pagination: false,\n    }\n  }\n\n  connectedCallback() {\n    const extendedOptions = this.dataset.options ? JSON.parse(this.dataset.options) : {}\n    this.options = Object.assign(this.options, extendedOptions)\n    this._initCarousel();\n  }\n\n  // Initialize carousel\n  _initCarousel() {\n    let id = `#${this.querySelector(this.selectors.carousel).id}`;\n    if (typeof this.dataset.init !== 'undefined') {\n      //do nothing initially, init at larger points\n      enquire.register(this.dataset.init,{\n        match: function(){\n          this.carousel = new Swiper(id, this.options)\n          this._setupNavigationHandling();\n        }.bind(this),\n        unmatch: function(){\n          if (this.carousel.el.classList.contains('swiper-initialized')) {\n            this.carousel.destroy(true, true);\n          }\n        }.bind(this)\n      })\n    }else{\n      this.carousel = new Swiper(id, this.options);\n      this._setupNavigationHandling();\n    }\n  }\n\n  // Setup navigation button visibility handling\n  _setupNavigationHandling() {\n    if (!this.carousel) return;\n\n    const prevButton = this.querySelector(this.selectors.prevButton);\n    const nextButton = this.querySelector(this.selectors.nextButton);\n\n    if (!prevButton || !nextButton) return;\n\n    // Initial state\n    this._updateNavigationButtons();\n\n    // Listen for slide changes\n    this.carousel.on('slideChange', () => {\n      this._updateNavigationButtons();\n    });\n\n    // Listen for resize events to recalculate visibility\n    this.carousel.on('resize', () => {\n      this._updateNavigationButtons();\n    });\n  }\n\n  // Update navigation button visibility\n  _updateNavigationButtons() {\n    const prevButton = this.querySelector(this.selectors.prevButton);\n    const nextButton = this.querySelector(this.selectors.nextButton);\n\n    if (!prevButton || !nextButton) return;\n\n    // Check if first slide is visible\n    const isFirstSlideVisible = this.carousel.isBeginning;\n    \n    // Check if last slide is visible\n    const isLastSlideVisible = this.carousel.isEnd;\n\n    // Show/hide previous button based on first slide visibility\n    if (isFirstSlideVisible) {\n      prevButton.style.visibility = 'hidden';\n      prevButton.style.pointerEvents = 'none';\n    } else {\n      prevButton.style.visibility = 'visible'; \n      prevButton.style.pointerEvents = 'auto';\n    }\n\n    // Show/hide next button based on last slide visibility\n    if (isLastSlideVisible) {\n      nextButton.style.visibility = 'hidden';\n      nextButton.style.pointerEvents = 'none';\n    } else {\n      nextButton.style.visibility = 'visible';\n      nextButton.style.pointerEvents = 'auto';\n    }\n  }\n}\n\ncustomElements.define('s-carousel', Carousel);\n\n\n\nclass ProductUpsell extends HTMLElement{\n  constructor() {\n    super();\n\n    this._selectors = {\n      lineItem: '.upsell-item',\n      addToCart: '.product__submit__buttons button[data-add-to-cart]',\n      modal: '[upsell-modal]',\n      modalClose: '.modal__close',\n      continueButton: '.upsell-continue button',\n      drawer: 'nav#drawer-cart'\n    }\n\n    this.modal = document.querySelector(this._selectors.modal);\n    this.modalClose = this.modal.querySelector(this._selectors.modalClose);\n    this.lineItem = this.querySelector(this._selectors.lineItem);\n    this.addToCart = document.querySelector(this._selectors.addToCart);\n    this.continueButton = this.modal.querySelector(this._selectors.continueButton);\n    this.drawer = document.querySelector(this._selectors.drawer);\n\n    this.product = {\n      id: this.lineItem.dataset.id,\n      added: false\n    };\n\n    this._initListeners();\n  }\n\n  _addItemToCart = async (button, id, quantity = 1) => {\n    let formData = {\n      'items': [{\n       'id': id,\n       'quantity': quantity\n       }]\n     };\n  \n    const response = await fetch('/cart/add.js', {\n      method: 'POST',\n      headers: {\n        'Content-Type': 'application/json'\n      },\n      body: JSON.stringify(formData)\n    })\n    .then(response => {\n      return response.json();\n    })\n    .catch((error) => {\n      console.error('Error:', error);\n      return error;\n    });\n\n    if(response?.status){\n      console.log(\"Failed to add to cart\", response);\n    } else {\n      this.product.added = true;\n      button.style.display = \"none\";\n      \n      this.modal.classList.add(\"hidden\");\n      this._toggleDrawer();\n      this._checkModalStatus();\n      sessionStorage.setItem('upsellAdded', true);\n    }\n  }\n\n  _toggleDrawer = () => {\n    this.drawer.dispatchEvent(\n      new CustomEvent('theme:drawer:toggle', {\n        bubbles: false,\n      })\n    );\n  }\n\n  _checkModalStatus = () => {\n    if (this.product.added) {\n      this.addToCart.removeEventListener(\"click\", this._addToCartTrigger);\n    }\n  }\n\n  _addToCartTrigger = (e) => {\n    e.preventDefault();\n    if (!sessionStorage.getItem('upsellAdded')){\n      this.modal.classList.remove(\"hidden\");\n    }\n  }\n\n  _initListeners = () => {\n    this.addToCart.addEventListener(\"click\", this._addToCartTrigger);\n\n    this.lineItem.querySelector(\".upsell-item__atc button\").addEventListener(\"click\", (e) => {\n        this._addItemToCart(e.target, this.lineItem.dataset.id);\n    });\n\n    this.continueButton.addEventListener(\"click\", (e) => {\n      this.modal.classList.add(\"hidden\");\n    });\n\n    this.modalClose.addEventListener(\"click\", () => {\n      this.modal.classList.add(\"hidden\");\n      this._toggleDrawer();\n    });\n  }\n}\n\ncustomElements.define('product-upsell', ProductUpsell);\n\n\n})();\n\n\n"],
  "mappings": "CAWC,UAAW,CASV,SAAS,iBAAiB,uBAAwB,SAAS,MAAO,CAGhE,IAAI,QAAU,MAAM,OAAO,QACvB,UAAY,MAAM,OAClB,UACF,QAAQ,IAAI,mEAAsB,EAClC,QAAQ,IAAI,SAAS,EACrB,QAAQ,IAAI,6EAAsB,EAClC,QAAQ,IAAI,OAAO,EAGvB,CAAC,EAED,SAAS,iBAAiB,oBAAqB,SAAS,MAAO,CAC7D,IAAI,KAAO,MAAM,OAAO,KACpB,OACF,QAAQ,IAAI,sFAA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