{
  "version": 3,
  "sources": ["/cdn/shop/t/46/assets/matchy-a11y.js?matchy_v=20260530a"],
  "sourcesContent": ["(() => {\n  const favoriteSelectors = [\n    '.kl-hub-favorites-icon-widget',\n    '.kl-hub-favorites-icon-widget button',\n    '.kl-hub-favorites-icon-widget [role=\"button\"]',\n    '.klaviyo-favorites-plp-slot button',\n    '.klaviyo-wishlist-slot button'\n  ];\n  const favoriteSelector = favoriteSelectors.join(',');\n\n  const titleSelectors = [\n    '[data-product-title]',\n    '.card__heading a',\n    '.card__heading',\n    '.full-unstyled-link',\n    '.matchy-best-sellers__title a',\n    '.matchy-best-sellers__title',\n    '.product__title h1',\n    'h1',\n    'h2',\n    'h3'\n  ];\n\n  const cleanText = (value) => (value || '').replace(/\\s+/g, ' ').trim();\n\n  const getVisibleButtonText = (button) => cleanText(button.textContent);\n\n  const getElementText = (element) => {\n    if (!element) return '';\n\n    const dataTitle = cleanText(element.getAttribute('data-product-title'));\n    if (dataTitle) return dataTitle;\n\n    const labelledBy = element.getAttribute('aria-labelledby');\n    if (labelledBy) {\n      const label = cleanText(\n        labelledBy\n          .split(/\\s+/)\n          .map((id) => document.getElementById(id)?.textContent)\n          .filter(Boolean)\n          .join(' ')\n      );\n      if (label) return label;\n    }\n\n    const ariaLabel = cleanText(element.getAttribute('aria-label'));\n    if (ariaLabel && ariaLabel !== 'button') return ariaLabel;\n\n    return cleanText(element.textContent);\n  };\n\n  const getProductTitle = (button) => {\n    const context = button.closest(\n      'product-info, .product, .product-card-wrapper, .card-wrapper, .grid__item, article, li, .matchy-best-sellers__card'\n    ) || document;\n\n    for (const selector of titleSelectors) {\n      const titleElement = context.querySelector(selector);\n      const title = getElementText(titleElement);\n      if (title && title.length > 1 && title !== 'Favorites') return title;\n    }\n\n    return '';\n  };\n\n  const isFavoriteActive = (button) => {\n    const pressed = button.getAttribute('aria-pressed');\n    if (pressed === 'true') return true;\n    if (pressed === 'false') return false;\n\n    return [\n      'is-active',\n      'active',\n      'selected',\n      'favorited',\n      'kl-hub-favorites-icon-widget--active'\n    ].some((className) => button.classList.contains(className));\n  };\n\n  const getFavoriteLabel = (button) => {\n    const title = getProductTitle(button);\n    const active = isFavoriteActive(button);\n    const visibleText = getVisibleButtonText(button);\n\n    if (visibleText && visibleText !== 'button') {\n      return title ? `${visibleText}: ${title}` : visibleText;\n    }\n\n    const action = active ? 'Remove' : 'Add';\n    const suffix = active ? 'from favourites' : 'to favourites';\n\n    return title ? `${action} ${title} ${suffix}` : `${action} ${suffix}`;\n  };\n\n  const labelFavoriteButton = (button) => {\n    if (!button || !(button instanceof Element)) return;\n\n    const label = getFavoriteLabel(button);\n    button.setAttribute('aria-label', label);\n    button.setAttribute('title', label);\n\n    if (button.tagName === 'BUTTON' && !button.hasAttribute('type')) {\n      button.setAttribute('type', 'button');\n    }\n  };\n\n  const labelThirdPartyImages = () => {\n    document.querySelectorAll('img.zip-logo:not([alt])').forEach((image) => {\n      image.setAttribute('alt', 'Zip payment logo');\n    });\n  };\n\n  const syncFavoriteButtons = () => {\n    document.querySelectorAll(favoriteSelector).forEach(labelFavoriteButton);\n    labelThirdPartyImages();\n  };\n\n  let syncQueued = false;\n  const queueSync = () => {\n    if (syncQueued) return;\n\n    syncQueued = true;\n    window.requestAnimationFrame(() => {\n      syncQueued = false;\n      syncFavoriteButtons();\n    });\n  };\n\n  const nodeNeedsAccessibilitySync = (node) => {\n    if (!(node instanceof Element)) return false;\n    return (\n      node.matches(favoriteSelector) ||\n      node.matches('img.zip-logo:not([alt])') ||\n      Boolean(node.querySelector(favoriteSelector)) ||\n      Boolean(node.querySelector('img.zip-logo:not([alt])'))\n    );\n  };\n\n  const observeFavoriteButtons = () => {\n    if (!document.body || !('MutationObserver' in window)) return;\n\n    const observer = new MutationObserver((mutations) => {\n      const shouldSync = mutations.some((mutation) => {\n        if (mutation.type === 'attributes') {\n          return nodeNeedsAccessibilitySync(mutation.target);\n        }\n\n        return Array.from(mutation.addedNodes).some(nodeNeedsAccessibilitySync);\n      });\n\n      if (shouldSync) queueSync();\n    });\n\n    observer.observe(document.body, {\n      childList: true,\n      subtree: true,\n      attributes: true,\n      attributeFilter: ['aria-pressed', 'class']\n    });\n  };\n\n  if (document.readyState === 'loading') {\n    document.addEventListener('DOMContentLoaded', () => {\n      syncFavoriteButtons();\n      observeFavoriteButtons();\n    });\n  } else {\n    syncFavoriteButtons();\n    observeFavoriteButtons();\n  }\n\n  document.addEventListener('shopify:section:load', queueSync);\n  window.addEventListener('load', queueSync);\n})();\n"],
  "mappings": "CAAC,IAAM,CAQL,MAAM,iBAPoB,CACxB,gCACA,uCACA,gDACA,qCACA,+BACF,EAC2C,KAAK,GAAG,EAE7C,eAAiB,CACrB,uBACA,mBACA,iBACA,sBACA,gCACA,8BACA,qBACA,KACA,KACA,IACF,EAEM,UAAa,QAAW,OAAS,IAAI,QAAQ,OAAQ,GAAG,EAAE,KAAK,EAE/D,qBAAwB,QAAW,UAAU,OAAO,WAAW,EAE/D,eAAkB,SAAY,CAClC,GAAI,CAAC,QAAS,MAAO,GAErB,MAAM,UAAY,UAAU,QAAQ,aAAa,oBAAoB,CAAC,EACtE,GAAI,UAAW,OAAO,UAEtB,MAAM,WAAa,QAAQ,aAAa,iBAAiB,EACzD,GAAI,WAAY,CACd,MAAM,MAAQ,UACZ,WACG,MAAM,KAAK,EACX,IAAK,IAAO,SAAS,eAAe,EAAE,GAAG,WAAW,EACpD,OAAO,OAAO,EACd,KAAK,GAAG,CACb,EACA,GAAI,MAAO,OAAO,KACpB,CAEA,MAAM,UAAY,UAAU,QAAQ,aAAa,YAAY,CAAC,EAC9D,OAAI,WAAa,YAAc,SAAiB,UAEzC,UAAU,QAAQ,WAAW,CACtC,EAEM,gBAAmB,QAAW,CAClC,MAAM,QAAU,OAAO,QACrB,oHACF,GAAK,SAEL,UAAW,YAAY,eAAgB,CACrC,MAAM,aAAe,QAAQ,cAAc,QAAQ,EAC7C,MAAQ,eAAe,YAAY,EACzC,GAAI,OAAS,MAAM,OAAS,GAAK,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