{
  "version": 3,
  "sources": ["/cdn/shop/t/69/assets/variant-bundle-collection-search.js?cb=20260425b"],
  "sourcesContent": ["/**\n * variant-bundle-collection-search.js\n * Generated from Variant experiments on 2026-04-21\n * Do not hand-edit \u2014 regenerate from /tmp/gb_features_fresh.json via bundle script\n *\n * Contents:\n *   - EXP353F179F  \u2192  variant-exp-collection-tiles.js  (Collection/search pagination + category tiles)\n */\n\n\n/* === variant-exp-collection-tiles.js  (EXP353F179F) === */\n(function () {\n  'use strict';\n\n  try {\n    var productList = document.querySelector('.product-list');\n    if (!productList) return;\n\n    var pathname = window.location.pathname;\n    var handleMatch = pathname.match(/\\/collections\\/([^/?#]+)/);\n    // 2026-05-27 \u2014 also support /search pages (infinite scroll instead of pagination)\n    var isSearch = /^\\/search(\\/|$|\\?|#)/.test(pathname);\n    if (!handleMatch && !isSearch) return;\n    var collectionHandle = handleMatch ? handleMatch[1] : 'search';\n\n    var STOREFRONT_TOKEN = 'eb4616e9096382e0e9497a3a1acd148a';\n    var SHOP_DOMAIN = 'topnutritionandfitness.com';\n    var BATCH_SIZE = 10;\n\n    var existingProducts = productList.querySelectorAll('.product-item');\n    var loadedCount = existingProducts.length;\n\n    var totalProducts = loadedCount;\n    var totalCountEl = document.querySelector('.collection__products-count-total');\n    if (totalCountEl) {\n      var m = totalCountEl.textContent.match(/(\\d+)/);\n      if (m) totalProducts = parseInt(m[1], 10);\n    }\n\n    var isLoading = false;\n    var allLoaded = loadedCount >= totalProducts;\n    var endCursor = null;\n    var initialSkipDone = false;\n\n    var EXP_ID = 'EXP353F179F';\n    var VAR_ID = '1';\n\n    // Page-depth tracking: the original site shows ~48 products per page\n    var PRODUCTS_PER_PAGE = existingProducts.length || 48;\n    var maxPageReached = 1;\n\n    // Whether this collection has multiple pages (pagination exists)\n    var pagination = document.querySelector('.pagination');\n    var hasMultiplePages = !!pagination;\n\n    var container = productList.parentElement;\n\n    function trackEvent() { /* Variant analytics removed */ }\n\n    // Fire a collection-viewed event on every collection page for baseline metrics\n    trackEvent('collection-viewed', {\n      collection: collectionHandle,\n      products_on_page: loadedCount,\n      total_products: totalProducts,\n      has_pagination: hasMultiplePages\n    });\n\n    // --- Infinite scroll setup (only when collection has multiple pages) ---\n    var loadingIndicator, sentinel;\n\n    if (hasMultiplePages) {\n      // Track pagination clicks before hiding\n      var paginationLinks = pagination.querySelectorAll('a[data-page], .pagination__prev, .pagination__next');\n      paginationLinks.forEach(function (link) {\n        link.addEventListener('click', function (e) {\n          e.preventDefault();\n          var destinationUrl = this.href;\n          var targetPage = this.getAttribute('data-page') || '';\n          var clickType = 'page-number';\n          if (this.classList.contains('pagination__next')) clickType = 'next';\n          if (this.classList.contains('pagination__prev')) clickType = 'previous';\n\n          var safetyTimeout = setTimeout(function () {\n            window.location.href = destinationUrl;\n          }, 2000);\n\n          trackEvent('pagination-clicked', {\n            collection: collectionHandle,\n            page: targetPage,\n            click_type: clickType\n          });\n\n          clearTimeout(safetyTimeout);\n          window.location.href = destinationUrl;\n        });\n      });\n\n      // Hide the pagination and replace with infinite scroll\n      pagination.style.display = 'none';\n\n      loadingIndicator = document.createElement('div');\n      loadingIndicator.className = 'variant-infinite-scroll-loader';\n      loadingIndicator.innerHTML =\n        '<div class=\"variant-isl__spinner\"></div>' +\n        '<span class=\"variant-isl__text\">Loading more products...</span>';\n      loadingIndicator.style.display = 'none';\n\n      sentinel = document.createElement('div');\n      sentinel.className = 'variant-infinite-scroll-sentinel';\n      sentinel.style.height = '1px';\n      sentinel.style.width = '100%';\n\n      if (container) {\n        container.appendChild(loadingIndicator);\n        container.appendChild(sentinel);\n      }\n    }\n\n    // Collections to suggest when the user reaches the end (excluding the current one)\n    var suggestedCollections = [\n      { handle: 'instabadge-best-selling', title: 'Best Sellers' },\n      { handle: 'protein-snacks-1', title: 'Protein Snacks' },\n      { handle: 'protein-powder', title: 'Protein Powder' },\n      { handle: 'selling-out-soon', title: 'Low Stock' },\n      { handle: 'clearance', title: 'Clearance & Sales' },\n      { handle: 'seasonal-flavor', title: 'Seasonal/Limited' },\n      { handle: 'new-arrivals', title: 'New Arrivals' },\n      { handle: 'sales-stacks-1', title: 'Sales & Bundles' },\n      { handle: 'rare-find-brands-canada', title: 'Rare Finds' },\n      { handle: 'gain-muscle', title: 'Build Muscle' }\n    ].filter(function (c) { return c.handle !== collectionHandle; }).slice(0, 6);\n\n    var styleEl = document.createElement('style');\n    styleEl.textContent =\n      '.variant-infinite-scroll-loader {' +\n      '  display: flex; align-items: center; justify-content: center;' +\n      '  gap: 10px; padding: 24px 20px;' +\n      '  font-family: Barlow, sans-serif; font-size: 14px; font-weight: 500;' +\n      '  color: var(--text-color, #677279);' +\n      '}' +\n      '.variant-isl__spinner {' +\n      '  width: 24px; height: 24px;' +\n      '  border: 3px solid var(--border-color, #e1e3e4);' +\n      '  border-top-color: var(--heading-color, #006fdb);' +\n      '  border-radius: 50%;' +\n      '  animation: variant-isl-spin 0.7s linear infinite;' +\n      '}' +\n      '@keyframes variant-isl-spin { to { transform: rotate(360deg); } }' +\n\n      '.variant-is-product .product-item__primary-image {' +\n      '  transition: opacity 0.35s ease-in-out;' +\n      '}' +\n      '.variant-is-product:hover .product-item__primary-image {' +\n      '  opacity: 0;' +\n      '}' +\n      '.variant-is-product .product-item__secondary-image {' +\n      '  opacity: 0; transition: opacity 0.35s ease-in-out;' +\n      '  position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover;' +\n      '}' +\n      '.variant-is-product:hover .product-item__secondary-image {' +\n      '  opacity: 1;' +\n      '}' +\n\n      '.variant-end-section {' +\n      '  padding: 30px 20px 40px; text-align: center;' +\n      '  font-family: Barlow, sans-serif;' +\n      '}' +\n      '.variant-end-section__title {' +\n      '  font-size: 16px; font-weight: 600; color: var(--heading-color, #006fdb);' +\n      '  margin: 0 0 6px;' +\n      '}' +\n      '.variant-end-section__subtitle {' +\n      '  font-size: 13px; font-weight: 500; color: var(--text-color, #677279);' +\n      '  margin: 0 0 20px;' +\n      '}' +\n      '.variant-end-section__btt {' +\n      '  display: inline-flex; align-items: center; gap: 6px;' +\n      '  background: var(--primary-button-background, #fcdd00);' +\n      '  color: var(--primary-button-text-color, #1e2d7d);' +\n      '  border: none; border-radius: 2px; cursor: pointer;' +\n      '  font-family: Barlow, sans-serif; font-size: 14px; font-weight: 600;' +\n      '  padding: 10px 24px; text-transform: uppercase; letter-spacing: 0.5px;' +\n      '  transition: opacity 0.2s;' +\n      '}' +\n      '.variant-end-section__btt:hover { opacity: 0.85; }' +\n      '.variant-end-section__btt svg { width: 14px; height: 14px; }' +\n\n      '.variant-end-section__divider {' +\n      '  display: flex; align-items: center; gap: 12px;' +\n      '  margin: 24px 0 18px; color: var(--text-color, #677279);' +\n      '  font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px;' +\n      '}' +\n      '.variant-end-section__divider::before, .variant-end-section__divider::after {' +\n      '  content: \"\"; flex: 1; height: 1px; background: var(--border-color, #e1e3e4);' +\n      '}' +\n\n      '.variant-end-section__collections {' +\n      '  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;' +\n      '}' +\n      '.variant-end-section__coll-link {' +\n      '  display: inline-block; padding: 8px 16px;' +\n      '  background: var(--secondary-button-background, #005efc);' +\n      '  color: var(--secondary-button-text-color, #ffffff);' +\n      '  border-radius: 2px; font-size: 13px; font-weight: 600;' +\n      '  text-decoration: none; text-transform: uppercase; letter-spacing: 0.3px;' +\n      '  transition: opacity 0.2s;' +\n      '}' +\n      '.variant-end-section__coll-link:hover { opacity: 0.85; }';\n    document.head.appendChild(styleEl);\n\n    function updateShowingCount() {\n      var allItems = productList.querySelectorAll('.product-item');\n      var countEls = document.querySelectorAll(\n        '.collection__showing-count, .collection__products-count-showing'\n      );\n      countEls.forEach(function (el) {\n        el.textContent = 'Showing 1 - ' + allItems.length + ' of ' + totalProducts + ' products';\n      });\n    }\n\n    function buildQuery(first, after) {\n      var afterStr = after ? ', after: \"' + after + '\"' : '';\n      return '{ collectionByHandle(handle: \"' + collectionHandle + '\") {' +\n        ' products(first: ' + first + afterStr + ') {' +\n        '  pageInfo { hasNextPage endCursor }' +\n        '  edges { node {' +\n        '   id handle title vendor' +\n        '   availableForSale' +\n        '   totalInventory' +\n        '   variants(first: 1) { edges { node { id price { amount currencyCode } compareAtPrice { amount currencyCode } } } }' +\n        '   priceRange { minVariantPrice { amount currencyCode } maxVariantPrice { amount currencyCode } }' +\n        '   compareAtPriceRange { minVariantPrice { amount currencyCode } maxVariantPrice { amount currencyCode } }' +\n        '   images(first: 2) { edges { node { url altText width height } } }' +\n        '  } }' +\n        ' }' +\n        '} }';\n    }\n\n    function fetchProducts(first, after) {\n      // 2026-05-23: HTML page fetch (Storefront API token revoked). Same pagination + sort as server render.\n      // 2026-05-27: also supports /search pages.\n      // 2026-05-27b: also preserves query string on collection pages so filters (vendor, tag, sort) keep working.\n      var pageNum = after ? parseInt(after, 10) : 1;\n      var qs = new URLSearchParams(window.location.search);\n      qs.set('page', pageNum);\n      var base = isSearch ? '/search' : ('/collections/' + collectionHandle);\n      var fetchUrl = base + '?' + qs.toString();\n      return fetch(fetchUrl, { credentials: 'same-origin', headers: { 'Accept': 'text/html' } })\n        .then(function (res) { return res.ok ? res.text() : null; })\n        .then(function (html) {\n          if (!html) return null;\n          var parser = new DOMParser();\n          var doc = parser.parseFromString(html, 'text/html');\n          var cards = doc.querySelectorAll('.product-list .product-item, .product-list .product-item--vertical');\n          if (!cards || cards.length === 0) {\n            return { edges: [], pageInfo: { hasNextPage: false, endCursor: null } };\n          }\n          var edges = [];\n          for (var i = 0; i < cards.length; i++) {\n            edges.push({ node: { _rawHtml: cards[i].outerHTML } });\n          }\n          var nextLink = doc.querySelector('.pagination a[rel=\"next\"], .pagination__next, [aria-label*=\"Next\" i], a[href*=\"page=' + (pageNum + 1) + '\"]');\n          return {\n            edges: edges,\n            pageInfo: {\n              hasNextPage: !!nextLink,\n              endCursor: String(pageNum + 1)\n            }\n          };\n        })\n        .catch(function () { return null; });\n    }\n\n    function formatMoney(amount, currency) {\n      var num = parseFloat(amount);\n      var formatted = '$' + num.toFixed(2);\n      if (currency && currency !== 'CAD') {\n        formatted += ' ' + currency;\n      } else {\n        formatted += ' CAD';\n      }\n      return formatted;\n    }\n\n    function buildProductCard(product) {\n      var handle = product.handle;\n      var title = product.title;\n      var vendor = product.vendor;\n      var productUrl = '/products/' + handle;\n\n      var images = product.images.edges.map(function (e) { return e.node; });\n      var primaryImage = images[0] || null;\n      var secondaryImage = images[1] || null;\n\n      var firstVariant = product.variants.edges.length > 0 ? product.variants.edges[0].node : null;\n      var salePrice = product.priceRange.minVariantPrice;\n      var compareAtPrice = product.compareAtPriceRange && product.compareAtPriceRange.minVariantPrice;\n      var hasMultipleVariants = product.priceRange.minVariantPrice.amount !== product.priceRange.maxVariantPrice.amount;\n\n      var isOnSale = compareAtPrice && parseFloat(compareAtPrice.amount) > parseFloat(salePrice.amount);\n      var savings = isOnSale ? (parseFloat(compareAtPrice.amount) - parseFloat(salePrice.amount)).toFixed(2) : 0;\n\n      var inventory = product.totalInventory;\n      var inventoryClass = 'inventory--high';\n      var inventoryText = 'In stock' + (inventory > 0 ? ', ' + inventory + ' units' : '');\n      if (!product.availableForSale || inventory === 0) {\n        inventoryClass = 'inventory--zero';\n        inventoryText = 'Sold out';\n      } else if (inventory <= 10) {\n        inventoryClass = 'inventory--low';\n        inventoryText = 'Low stock, ' + inventory + ' units';\n      }\n\n      var labelHtml = '';\n      if (isOnSale) {\n        labelHtml = '<div class=\"product-item__label-list\">' +\n          '<span class=\"product-label product-label--on-sale active\">Save<span>$' + savings + '</span></span>' +\n          '</div>';\n      }\n\n      var hasSecondary = secondaryImage ? ' product-item__image-wrapper--with-secondary' : '';\n      var imgHtml = '';\n      if (primaryImage) {\n        var srcBase = primaryImage.url;\n        imgHtml += '<img class=\"product-item__primary-image\" alt=\"' + escapeAttr(title) + '\" loading=\"lazy\"' +\n          ' src=\"' + srcBase + '&width=500\"' +\n          ' srcset=\"' + srcBase + '&width=200 200w, ' + srcBase + '&width=300 300w, ' + srcBase + '&width=400 400w\"' +\n          ' sizes=\"(max-width: 699px) 100vw, 600px\"' +\n          ' width=\"' + (primaryImage.width || 500) + '\" height=\"' + (primaryImage.height || 500) + '\"' +\n          ' style=\"object-position: 50% 50%;\" />';\n      }\n      if (secondaryImage) {\n        var sec = secondaryImage.url;\n        imgHtml += '<img class=\"product-item__secondary-image\" alt=\"' + escapeAttr(title) + '\" loading=\"lazy\"' +\n          ' src=\"' + sec + '&width=500\"' +\n          ' srcset=\"' + sec + '&width=200 200w, ' + sec + '&width=300 300w, ' + sec + '&width=400 400w, ' + sec + '&width=600 600w\"' +\n          ' sizes=\"(max-width: 699px) 100vw, 600px\"' +\n          ' width=\"' + (secondaryImage.width || 500) + '\" height=\"' + (secondaryImage.height || 500) + '\"' +\n          ' style=\"object-position: 50% 50%;\" />';\n      }\n\n      var priceHtml = '';\n      var fromPrefix = hasMultipleVariants ? 'From ' : '';\n      if (isOnSale) {\n        priceHtml = '<div class=\"product-item__price-list price-list\">' +\n          '<span class=\"price price--highlight\"><span class=\"visually-hidden\">Sale price</span>' + fromPrefix + '<span class=\"money\">' + formatMoney(salePrice.amount, salePrice.currencyCode) + '</span></span> ' +\n          '<span class=\"price price--compare\"><span class=\"visually-hidden\">Regular price</span><span class=\"money\">' + formatMoney(compareAtPrice.amount, compareAtPrice.currencyCode) + '</span></span>' +\n          '</div>';\n      } else {\n        priceHtml = '<div class=\"product-item__price-list price-list\">' +\n          '<span class=\"price\"><span class=\"visually-hidden\">Sale price</span>' + fromPrefix + '<span class=\"money\">' + formatMoney(salePrice.amount, salePrice.currencyCode) + '</span></span>' +\n          '</div>';\n      }\n\n      var variantId = firstVariant ? firstVariant.id.replace('gid://shopify/ProductVariant/', '') : '';\n      var productId = product.id.replace('gid://shopify/Product/', '');\n\n      return '<div class=\"product-item product-item--vertical 1/3--tablet-and-up 1/4--desk variant-is-product\" data-product-id=\"' + productId + '\">' +\n          labelHtml +\n          '<a class=\"product-item__image-wrapper' + hasSecondary + '\" href=\"' + productUrl + '\">' +\n            '<div class=\"aspect-ratio aspect-ratio--short\" style=\"padding-bottom: 100%;\">' +\n              imgHtml +\n            '</div>' +\n          '</a>' +\n          '<div class=\"product-item__info\">' +\n            '<div class=\"product-item__info-inner\">' +\n              priceHtml +\n              '<a class=\"product-item__title text--strong link\" href=\"' + productUrl + '\">' + escapeHtml(title) + '</a>' +\n              '<a class=\"product-item__vendor link\" href=\"/collections/vendors?q=' + encodeURIComponent(vendor) + '\">' + escapeHtml(vendor) + '</a>' +\n              '<span class=\"product-item__inventory inventory ' + inventoryClass + '\">' + inventoryText + '</span>' +\n            '</div>' +\n            '<div class=\"product-item__action-list button-stack\">' +\n              '<a class=\"product-item__action-button button button--small button--primary\" href=\"' + productUrl + '\">Choose options</a>' +\n            '</div>' +\n          '</div>' +\n        '</div>';\n    }\n\n    function escapeHtml(str) {\n      var div = document.createElement('div');\n      div.appendChild(document.createTextNode(str));\n      return div.innerHTML;\n    }\n\n    function escapeAttr(str) {\n      return str.replace(/&/g, '&amp;').replace(/\"/g, '&quot;').replace(/'/g, '&#39;').replace(/</g, '&lt;').replace(/>/g, '&gt;');\n    }\n\n    function skipExistingProducts(callback) {\n      if (loadedCount === 0) {\n        initialSkipDone = true;\n        callback();\n        return;\n      }\n\n      var remaining = loadedCount;\n      var cursor = null;\n\n      function skipBatch() {\n        var batchSize = Math.min(remaining, 250);\n        fetchProducts(batchSize, cursor).then(function (data) {\n          if (!data) {\n            allLoaded = true;\n            return;\n          }\n          cursor = data.pageInfo.endCursor;\n          remaining -= data.edges.length;\n\n          if (!data.pageInfo.hasNextPage) {\n            allLoaded = true;\n            initialSkipDone = true;\n            endCursor = cursor;\n            callback();\n            return;\n          }\n\n          if (remaining <= 0) {\n            initialSkipDone = true;\n            endCursor = cursor;\n            callback();\n          } else {\n            skipBatch();\n          }\n        }).catch(function () {\n          allLoaded = true;\n        });\n      }\n\n      skipBatch();\n    }\n\n    function loadMoreProducts() {\n      if (isLoading || allLoaded) return;\n      isLoading = true;\n      loadingIndicator.style.display = 'flex';\n\n      fetchProducts(BATCH_SIZE, endCursor).then(function (data) {\n        if (!data || data.edges.length === 0) {\n          allLoaded = true;\n          showEndSection();\n          return;\n        }\n\n        endCursor = data.pageInfo.endCursor;\n\n        var fragment = document.createDocumentFragment();\n        var tempContainer = document.createElement('div');\n        var cardsHtml = '';\n\n        data.edges.forEach(function (edge) {\n          // 2026-05-23: prefer _rawHtml (HTML-fetch path) over buildProductCard (legacy GraphQL path)\n          cardsHtml += edge.node._rawHtml ? edge.node._rawHtml : buildProductCard(edge.node);\n          loadedCount++;\n        });\n\n        tempContainer.innerHTML = cardsHtml;\n        while (tempContainer.firstChild) {\n          fragment.appendChild(tempContainer.firstChild);\n        }\n        productList.appendChild(fragment);\n\n        updateShowingCount();\n\n        // Determine the equivalent page the user has now scrolled into\n        var equivalentPage = Math.ceil(loadedCount / PRODUCTS_PER_PAGE);\n        if (equivalentPage > maxPageReached) {\n          // Fire once per new equivalent page crossed\n          for (var p = maxPageReached + 1; p <= equivalentPage; p++) {\n            trackEvent('infinite-scroll-page-loaded', {\n              collection: collectionHandle,\n              page_number: p,\n              products_loaded: loadedCount,\n              products_per_page: PRODUCTS_PER_PAGE,\n              total_products: totalProducts\n            });\n          }\n          maxPageReached = equivalentPage;\n        }\n\n        if (!data.pageInfo.hasNextPage) {\n          allLoaded = true;\n          showEndSection();\n        }\n      }).catch(function () {\n        // Silently handle errors\n      }).finally(function () {\n        isLoading = false;\n        loadingIndicator.style.display = 'none';\n      });\n    }\n\n    function showEndSection() {\n      // Clean up infinite scroll elements if they exist\n      if (sentinel && sentinel.parentElement) {\n        sentinel.parentElement.removeChild(sentinel);\n      }\n      if (loadingIndicator) {\n        loadingIndicator.style.display = 'none';\n      }\n\n      // Build collection link pills\n      var collLinksHtml = '';\n      suggestedCollections.forEach(function (coll) {\n        collLinksHtml += '<a class=\"variant-end-section__coll-link\" href=\"/collections/' + coll.handle + '\">' +\n          escapeHtml(coll.title) + '</a>';\n      });\n\n      var endSection = document.createElement('div');\n      endSection.className = 'variant-end-section';\n      endSection.innerHTML =\n        '<p class=\"variant-end-section__title\">You\\'ve seen all the products!</p>' +\n        '<p class=\"variant-end-section__subtitle\">' + loadedCount + ' products in this collection</p>' +\n        '<button class=\"variant-end-section__btt\" type=\"button\">' +\n          '<svg viewBox=\"0 0 14 14\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">' +\n            '<path d=\"M7 12V2M7 2L2 7M7 2L12 7\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>' +\n          '</svg>' +\n          'Back to top' +\n        '</button>' +\n        '<div class=\"variant-end-section__divider\">Keep exploring</div>' +\n        '<div class=\"variant-end-section__collections\">' + collLinksHtml + '</div>';\n\n      if (container) container.appendChild(endSection);\n\n      trackEvent('collection-end-reached', {\n        collection: collectionHandle,\n        products_viewed: loadedCount,\n        max_page_reached: maxPageReached,\n        total_equivalent_pages: Math.ceil(totalProducts / PRODUCTS_PER_PAGE),\n        source: hasMultiplePages ? 'infinite_scroll' : 'single_page'\n      });\n\n      var bttBtn = endSection.querySelector('.variant-end-section__btt');\n      if (bttBtn) {\n        bttBtn.addEventListener('click', function () {\n          trackEvent('back-to-top-clicked', { collection: collectionHandle });\n          window.scrollTo({ top: 0, behavior: 'smooth' });\n        });\n      }\n\n      var collLinks = endSection.querySelectorAll('.variant-end-section__coll-link');\n      collLinks.forEach(function (link) {\n        link.addEventListener('click', function (e) {\n          e.preventDefault();\n          var destinationUrl = this.href;\n          var targetCollection = this.textContent.trim();\n\n          var safetyTimeout = setTimeout(function () {\n            window.location.href = destinationUrl;\n          }, 2000);\n\n          trackEvent('explore-collection-clicked', {\n            collection_from: collectionHandle,\n            collection_to: targetCollection\n          });\n\n          clearTimeout(safetyTimeout);\n          window.location.href = destinationUrl;\n        });\n      });\n    }\n\n    function startObserver() {\n      if ('IntersectionObserver' in window) {\n        var observer = new IntersectionObserver(\n          function (entries) {\n            entries.forEach(function (entry) {\n              if (entry.isIntersecting && !isLoading && !allLoaded && initialSkipDone) {\n                loadMoreProducts();\n              }\n            });\n          },\n          { root: null, rootMargin: '0px 0px 800px 0px', threshold: 0 }\n        );\n        observer.observe(sentinel);\n      } else {\n        window.addEventListener('scroll', function () {\n          if (isLoading || allLoaded || !initialSkipDone) return;\n          var rect = sentinel.getBoundingClientRect();\n          if (rect.top < window.innerHeight + 800) {\n            loadMoreProducts();\n          }\n        });\n      }\n    }\n\n    // Revenue attribution + button engagement tracking via event delegation\n    // Works on all collection pages regardless of size\n    productList.addEventListener('click', function (e) {\n      var actionBtn = e.target.closest('.product-item__action-button');\n      var link = actionBtn || e.target.closest('a[href*=\"/products/\"]');\n      if (!link) return;\n\n      var card = link.closest('.product-item');\n      if (!card) return;\n\n      var productId = card.getAttribute('data-product-id');\n      if (!productId) return;\n\n      var buttonText = (actionBtn ? actionBtn.textContent : '').trim().toLowerCase();\n      var isAddToCart = buttonText === 'add to cart' || (actionBtn && actionBtn.getAttribute('data-action') === 'add-to-cart');\n      var isChooseOptions = buttonText === 'choose options';\n      var isInfiniteScrollProduct = card.classList.contains('variant-is-product');\n\n      if (actionBtn && (isChooseOptions || isAddToCart)) {\n        var buttonType = isAddToCart ? 'add_to_cart' : 'choose_options';\n        trackEvent('product-action-button-clicked', {\n          collection: collectionHandle,\n          button_type: buttonType,\n          product_id: productId,\n          source: isInfiniteScrollProduct ? 'infinite_scroll' : 'original_page'\n        });\n      }\n\n      // \"Add to cart\" buttons submit a form and stay on the page\n      if (isAddToCart) return;\n\n      // \"Choose options\" \u2014 let the Quick Buy modal intercept (in variant-bundle-common.js EXPC513C797) handle it.\n      // Do NOT call preventDefault or force navigation here, otherwise we'd redirect to the PDP\n      // even when Quick Buy is supposed to open. Tracking already fired above.\n      if (isChooseOptions) return;\n\n      // For non-button product link clicks (image, title): fire attribution and redirect safely\n      e.preventDefault();\n      var destinationUrl = link.href;\n\n      var safetyTimeout = setTimeout(function () {\n        window.location.href = destinationUrl;\n      }, 2000);\n\n      try {\n        if (typeof Variant !== 'undefined' && Variant.publishCustomEvent) {\n          Variant.publishCustomEvent('product-clicked-attribution', {\n            experiment_id: EXP_ID,\n            variation_id: VAR_ID,\n            product_id: productId\n          });\n        }\n      } catch (err) {\n        // Safety timeout handles redirect\n      }\n\n      clearTimeout(safetyTimeout);\n      window.location.href = destinationUrl;\n    });\n\n    // --- Launch: infinite scroll for multi-page collections, end section for single-page ---\n    if (hasMultiplePages) {\n      skipExistingProducts(function () {\n        if (!allLoaded) {\n          startObserver();\n        } else {\n          showEndSection();\n        }\n      });\n    } else {\n      showEndSection();\n    }\n\n  } catch (e) {\n    // Fail silently\n  }\n})();"],
  "mappings": "CAWC,UAAY,CACX,aAEA,GAAI,CA2CF,IAAS,WAAT,UAAsB,CAAkC,EAyJ/C,mBAAT,UAA8B,CAC5B,IAAI,SAAW,YAAY,iBAAiB,eAAe,EACvD,SAAW,SAAS,iBACtB,iEACF,EACA,SAAS,QAAQ,SAAU,GAAI,CAC7B,GAAG,YAAc,eAAiB,SAAS,OAAS,OAAS,cAAgB,WAC/E,CAAC,CACH,EAES,WAAT,SAAoB,MAAO,MAAO,CAChC,IAAI,SAAW,MAAQ,aAAe,MAAQ,IAAM,GACpD,MAAO,iCAAmC,iBAAmB,wBACrC,MAAQ,SAAW,kgBAa7C,EAES,cAAT,SAAuB,MAAO,MAAO,CAInC,IAAI,QAAU,MAAQ,SAAS,MAAO,EAAE,EAAI,EACxC,GAAK,IAAI,gBAAgB,OAAO,SAAS,MAAM,EACnD,GAAG,IAAI,OAAQ,OAAO,EACtB,IAAI,KAAO,SAAW,UAAa,gBAAkB,iBACjD,SAAW,KAAO,IAAM,GAAG,SAAS,EACxC,OAAO,MAAM,SAAU,CAAE,YAAa,cAAe,QAAS,CAAE,OAAU,WAAY,CAAE,CAAC,EACtF,KAAK,SAAU,IAAK,CAAE,OAAO,IAAI,GAAK,IAAI,KAAK,EAAI,IAA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