{
  "version": 3,
  "sources": ["/cdn/shop/t/163/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(function () {\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).ready(function () {\n    console.log('\u2705 jQuery ready \u2014 targeting iPad only');\n\n    const screenWidth = $(window).width();\n    if (screenWidth >= 768 && screenWidth <= 991) {\n      console.log('\uD83D\uDCF1 iPad detected \u2014 checking for filter drawer');\n\n      let attempts = 0;\n      const maxAttempts = 50; // try for ~5 seconds\n\n      const interval = setInterval(function () {\n        const $closeBtn = $('.collection__filters__outer .drawer__close');\n\n        if ($closeBtn.length > 0) {\n          console.log('\u2705 Close button found \u2014 clicking to hide drawer');\n          $closeBtn.trigger('click');\n          clearInterval(interval);\n        } else {\n          console.log('\u23F3 Waiting for close button...');\n        }\n\n        attempts++;\n        if (attempts >= maxAttempts) {\n          clearInterval(interval);\n          console.warn('\u274C Close button not found after waiting.');\n        }\n      }, 100); // check every 100ms\n    } else {\n      console.log('\uD83D\uDED1 Not an iPad \u2014 script skipped.');\n    }\n  });\n\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      if (container.querySelectorAll('.sticky-options [data-option-value]').length > 0) {\n        container.querySelectorAll('.sticky-options [data-option-value]').forEach((i, index) => {\n          i.textContent = variant.options[index];\n        });\n      }\n      if (document.querySelector('#sticky-add-to-cart .image img') && variant.featured_image.src) {\n        document.querySelector('#sticky-add-to-cart .image img').src = variant.featured_image.src;\n      }\n\n      if (variant.compare_at_price > variant.price && variant.compare_at_price && variant.price) {\n        let discountPercentage = ((variant.compare_at_price - variant.price) / variant.compare_at_price) * 100;\n        container.querySelectorAll('.discount-save').forEach((i) => {\n          const discountText = `Save ${Math.round(discountPercentage)}%`;\n          i.textContent = discountText;\n        });\n\n        container.querySelectorAll('.compare-price-money').forEach((i) => {\n          const currencySymbolContainer = i.closest('.currency-symbol');\n          if (currencySymbolContainer) {\n            currencySymbolContainer.classList.remove('tw-hidden');\n          }\n          i.textContent = variant.compare_at_price / 100;\n        });\n      } else if (container.querySelectorAll('.currency-symbol').length > 0) {\n        container.querySelectorAll('.currency-symbol').forEach((i) => {\n          i.classList.add('tw-hidden');\n        });\n      }\n\n      var titleee = 'p';\n      var titlecontains = variant.title;\n      console.log(titlecontains);\n      if (titlecontains != 'Default Title') {\n        $('.product__media').css('opacity', '0');\n        //  $( \".product__media\" ).hide();\n        $('.product__media').each(function () {\n          console.log('ttt' + titlecontains);\n          if ($(this).attr('aria-label').indexOf(titlecontains) != -1) {\n            $(this).css('opacity', '1');\n            //   $(this).show();\n            // break;\n            //     return false;\n          }\n        });\n\n        let isfirstthumb = true;\n        document.querySelectorAll('.media__thumb').forEach(function (thumb) {\n          const alt = thumb.getAttribute('data-alt') || '';\n          const shouldShow = alt.indexOf(titlecontains) !== -1;\n          const isHidden = thumb.style.display === 'none';\n\n          if (shouldShow) {\n            if (isHidden) {\n              thumb.style.display = '';\n            }\n            if (isfirstthumb) {\n              thumb.classList.add('active');\n              isfirstthumb = false;\n            } else {\n              thumb.classList.remove('active');\n            }\n          } else if (!isHidden) {\n            thumb.style.display = 'none';\n            thumb.classList.remove('active');\n          } else {\n            thumb.classList.remove('active');\n          }\n        });\n\n        // Hide all Flickity dots\n        $('.flickity-page-dots .dot').hide();\n\n        // Show dots matching the visible slides\n        $('.product__media').each(function (index) {\n          if ($(this).attr('aria-label').indexOf(titlecontains) !== -1) {\n            $('.flickity-page-dots .dot').eq(index).show();\n          }\n        });\n\n        $(window).trigger('resize');\n        $('.media__thumb__wrapper').resize();\n        // $( '.product__slides' ).flickity('resize')\n\n        $('.product__slides').resize();\n        //  $('.product__slides').refresh();\n      }\n    }\n  });\n\n  document.addEventListener('theme:cart:change', function (event) {\n    var cart = event.detail.cart;\n    if (cart) {\n      if (document.querySelector('.cart-item-count')) {\n        if (cart.item_count > 0) {\n          document.querySelector('.cart-item-count').style.display = 'block';\n        } else {\n          document.querySelector('.cart-item-count').style.display = 'none';\n        }\n      }\n      // console.log('Cart \u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014 \u2193');\n      // console.log(cart);\n\n      // console.log('Cart \u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014 iii');\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) => {\n  //   console.log(e);\n  // });\n  // document.addEventListener('theme:scroll:up', (e) => {\n  //   console.log(e);\n  // });\n  // document.addEventListener('theme:scroll:down', (e) => {\n  //   console.log(e);\n  // });\n\n  // // Debounced resize listener to bundle changes that trigger document reflow\n  // document.addEventListener('theme:resize', (e) => {\n  //   console.log(e);\n  // });\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  // ^^ Keep your scripts inside this IIFE function call to avoid leaking your\n  // variables into the global scope.\n\n  document.addEventListener('DOMContentLoaded', function () {\n    // Select all media__thumb elements\n    const thumbs = document.querySelectorAll('.media__thumb');\n\n    // Flag to track if the first match is found\n    let isActiveAdded = false;\n\n    // Check for the first element with display: inline-block on load\n    thumbs.forEach((thumb) => {\n      if (!isActiveAdded) {\n        const thumbStyle = window.getComputedStyle(thumb);\n        if (thumbStyle.display === 'inline-block') {\n          thumb.classList.add('active');\n          isActiveAdded = true; // Stop further checks after the first match\n        }\n      }\n    });\n\n    // Add click event listener to each media__thumb\n    thumbs.forEach((thumb) => {\n      thumb.addEventListener('click', function () {\n        // Remove active class from all\n        thumbs.forEach((el) => {\n          el.classList.remove('active');\n        });\n\n        // Add active class to the clicked element\n        thumb.classList.add('active');\n      });\n    });\n\n    // Loox is injected after first paint. Products without reviews reserve the\n    // same initial space, then release it after the app has had time to load.\n    const noReviewProduct = document.querySelector('.product-section--no-loox-reviews');\n    if (noReviewProduct) {\n      const reservationDelay = Math.max(0, 7000 - performance.now());\n      window.setTimeout(() => {\n        noReviewProduct.querySelectorAll('loox-snippets-widget').forEach((widget) => {\n          widget.classList.add('loox-reservation-released');\n        });\n      }, reservationDelay);\n    }\n  });\n\n  // var $carousel = $('.features').themeVendor.Flickity();\n  // const instance = this;\n  //    let flickityOptions = {\n  //      autoPlay: false,\n  //      prevNextButtons: false,\n  //      contain: true,\n  //      pageDots: false,\n  //      adaptiveHeight: true,\n  //      accessibility: true,\n  //      wrapAround: true,\n  //      fade: true,\n  //      on: {\n  //        ready: function () {\n  //          instance.sliderThumbs();\n  //        },\n  //      },\n  //    };\n\n  //    this.flkty = new FlickityFade('.features', flickityOptions);\n  //    this.flkty.resize();\n\n\n\n\n})();\n\n\n\n\n\n\n\n\n\n\n\n"],
  "mappings": "CAUC,UAAY,CAQX,EAAE,QAAQ,EAAE,MAAM,UAAY,CAC5B,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