{
  "version": 3,
  "sources": ["/cdn/shop/t/205/assets/fe-mobile-sticky-atc.js?cb=1791422706772"],
  "sourcesContent": ["/* F&E: Add to Cart behavior on product pages.\n *\n * All screen sizes:\n * - The button reads \"Add to Cart\" even before a size is picked.\n * - Pressing it with no size still adds nothing: the size-required guard\n *   in product-block-variant-selector.js scrolls to the sizes and shows\n *   \"Please select a size\". That guard stays the single safeguard.\n * - If the shopper pressed Add to Cart and was prompted for a size,\n *   their next size tap completes the add. A size tapped on its own\n *   only selects; pressing Add to Cart then adds it as usual.\n *\n * Phones only:\n * - A sticky Add to Cart button is pinned to the bottom of the screen\n *   whenever the page's own Add to Cart button is off screen. It hides\n *   once the real button scrolls into view and returns if the shopper\n *   scrolls past it. It only ever clicks the page's real button.\n *\n * Loaded from snippets/product-block-buy-buttons.liquid. Safe to remove:\n * delete that one script line and this file.\n */\n(() => {\n  if (window.__feStickyAtcInit) {\n    return\n  }\n  window.__feStickyAtcInit = true;\n\n  if (window.Shopify && window.Shopify.designMode) {\n    return\n  }\n\n  const MOBILE_MQ = \"(max-width: 719.9px)\";\n  const VARIANT_CHANGED_EVENT = \"product:variant:changed\";\n  const PENDING_ATTR = \"data-fe-size-pending\";\n  const ON_CLASS = \"fe-sticky-atc-on\";\n  const HEADER_OFFSET = 70;\n  const INTENT_TTL_MS = 120000;\n\n  const mq = window.matchMedia(MOBILE_MQ);\n  const html = document.documentElement;\n  const container = document.querySelector(\"main-product-default\");\n  if (!container) {\n    return\n  }\n\n  const realButton = () => container.querySelector(\"[js-add-to-cart-button]\");\n  if (!realButton()) {\n    return\n  }\n\n  const isPending = () => html.hasAttribute(PENDING_ATTR);\n\n  // --- Styles -------------------------------------------------------------\n  const style = document.createElement(\"style\");\n  style.textContent = `\n    #fe-sticky-atc { display: none; }\n    @media ${MOBILE_MQ} {\n      #fe-sticky-atc {\n        display: block;\n        position: fixed;\n        left: 0;\n        right: 0;\n        bottom: 0;\n        z-index: 10;\n        padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));\n        background: #fff;\n        border-top: 1px solid #afb6c0;\n        box-shadow: 0 -6px 16px rgba(0, 0, 0, 0.08);\n        transform: translateY(110%);\n        visibility: hidden;\n        transition: transform 0.25s ease, visibility 0s linear 0.25s;\n      }\n      html.${ON_CLASS} #fe-sticky-atc {\n        transform: none;\n        visibility: visible;\n        transition: transform 0.25s ease;\n      }\n      .fe-sticky-atc__btn {\n        width: 100%;\n        min-height: 56px;\n        margin: 0;\n        padding: 6px 12px;\n        border: 0;\n        display: flex;\n        flex-direction: column;\n        align-items: center;\n        justify-content: center;\n        gap: 1px;\n        cursor: pointer;\n        -webkit-appearance: none;\n        appearance: none;\n      }\n      .fe-sticky-atc__btn[disabled] {\n        background: rgba(21, 42, 71, 0.1) !important;\n        color: #152a47 !important;\n        cursor: default;\n      }\n      .fe-sticky-atc__size {\n        font-size: 13px;\n        line-height: 16px;\n      }\n      .fe-sticky-atc__size:empty { display: none; }\n      html.fe-sticky-atc-ready body { padding-bottom: 96px; }\n      html.${ON_CLASS} #gorgias-chat-container iframe,\n      html.${ON_CLASS} iframe[class*=\"gorgias-chat\"] {\n        bottom: calc(96px + env(safe-area-inset-bottom, 0px)) !important;\n      }\n    }\n  `;\n  document.head.appendChild(style);\n\n  // --- Sticky bar (shown on phones only, via the media query above) -------\n  const bar = document.createElement(\"div\");\n  bar.id = \"fe-sticky-atc\";\n\n  const stickyButton = document.createElement(\"button\");\n  stickyButton.type = \"button\";\n  stickyButton.className = \"fe-sticky-atc__btn\";\n\n  const labelEl = document.createElement(\"span\");\n  labelEl.className = \"fe-sticky-atc__label\";\n\n  const sizeEl = document.createElement(\"span\");\n  sizeEl.className = \"fe-sticky-atc__size\";\n\n  stickyButton.appendChild(labelEl);\n  stickyButton.appendChild(sizeEl);\n  bar.appendChild(stickyButton);\n  document.body.appendChild(bar);\n  html.classList.add(\"fe-sticky-atc-ready\");\n\n  let stylesCopied = false;\n\n  // Match the theme's own button look (copied once, from an enabled button)\n  function copyStyles(real) {\n    if (stylesCopied || real.disabled) {\n      return\n    }\n    const cs = window.getComputedStyle(real);\n    if (!cs.fontFamily) {\n      return\n    }\n    stickyButton.style.fontFamily = cs.fontFamily;\n    stickyButton.style.fontSize = cs.fontSize;\n    stickyButton.style.fontWeight = cs.fontWeight;\n    stickyButton.style.lineHeight = \"22px\";\n    stickyButton.style.letterSpacing = cs.letterSpacing;\n    stickyButton.style.textTransform = cs.textTransform;\n    stickyButton.style.borderRadius = cs.borderRadius;\n    stickyButton.style.color = cs.color;\n    stickyButton.style.backgroundColor = cs.backgroundColor;\n    stickyButton.style.backgroundImage = cs.backgroundImage;\n    sizeEl.style.fontFamily = window.getComputedStyle(document.body).fontFamily;\n    stylesCopied = true;\n  }\n\n  // Keep \"Add to Cart\" on the button while no size is picked (all screens)\n  function restoreLabels() {\n    if (!isPending()) {\n      return\n    }\n    container\n      .querySelectorAll(\"[js-add-to-cart-button] [data-fe-original]\")\n      .forEach((el) => {\n        const original = el.getAttribute(\"data-fe-original\");\n        if (original !== null && el.textContent !== original) {\n          el.textContent = original;\n        }\n      });\n  }\n\n  function selectedSizeText() {\n    if (isPending()) {\n      return \"\"\n    }\n    const selector = container.querySelector(\"product-block-variant-selector\");\n    if (!selector) {\n      return \"\"\n    }\n    const input = selector.querySelector('input[type=\"radio\"][js-variant-input]:checked');\n    if (!input || !input.parentElement) {\n      return \"\"\n    }\n    const chip = input.parentElement.querySelector(\"[js-chip]\");\n    const value = chip ? (chip.getAttribute(\"aria-label\") || \"\").trim() : \"\";\n    if (!value) {\n      return \"\"\n    }\n    const group = input.closest(\"[js-variant-group-container]\");\n    const name = group\n      ? (group.querySelector(\".label-text\")?.textContent || \"\").replace(\":\", \"\").trim()\n      : \"\";\n    return name ? `${name} ${value}` : value;\n  }\n\n  function sync() {\n    restoreLabels();\n\n    const real = realButton();\n    if (!real || !mq.matches) {\n      html.classList.remove(ON_CLASS);\n      return\n    }\n\n    copyStyles(real);\n\n    const source = real.querySelector(\".label-default\") || real;\n    const text = (source.textContent || \"\").trim();\n    if (labelEl.textContent !== text) {\n      labelEl.textContent = text;\n    }\n\n    const sizeText = selectedSizeText();\n    if (sizeEl.textContent !== sizeText) {\n      sizeEl.textContent = sizeText;\n    }\n\n    stickyButton.disabled = real.disabled;\n\n    const rect = real.getBoundingClientRect();\n    const show =\n      rect.width > 0 &&\n      (rect.top >= window.innerHeight - 20 || rect.bottom <= HEADER_OFFSET);\n    html.classList.toggle(ON_CLASS, show);\n  }\n\n  // Run on the next frame, with a timer as backup\n  let queued = false;\n  function schedule() {\n    if (queued) {\n      return\n    }\n    queued = true;\n    const run = () => {\n      if (!queued) {\n        return\n      }\n      queued = false;\n      sync();\n    };\n    window.requestAnimationFrame(run);\n    window.setTimeout(run, 150);\n  }\n\n  function scheduleSoon() {\n    schedule();\n    window.setTimeout(schedule, 400);\n  }\n\n  window.addEventListener(\"scroll\", schedule, { passive: true });\n  window.addEventListener(\"resize\", schedule);\n  // The size-required guard re-applies its label on pageshow; undo it at once\n  window.addEventListener(\"pageshow\", () => {\n    restoreLabels();\n    window.setTimeout(schedule, 0);\n  });\n  if (mq.addEventListener) {\n    mq.addEventListener(\"change\", schedule);\n  }\n  document.addEventListener(\"change\", scheduleSoon, true);\n  document.addEventListener(VARIANT_CHANGED_EVENT, scheduleSoon, true);\n\n  // The theme repaints the buy buttons on variant change; keep in step\n  new MutationObserver(schedule).observe(container, {\n    subtree: true,\n    childList: true,\n    characterData: true,\n    attributes: true,\n    attributeFilter: [\"disabled\"],\n  });\n  new MutationObserver(schedule).observe(html, {\n    attributes: true,\n    attributeFilter: [PENDING_ATTR],\n  });\n\n  // --- Sticky tap: always goes through the page's real button -------------\n  stickyButton.addEventListener(\"click\", () => {\n    const real = realButton();\n    if (real && !real.disabled) {\n      real.click();\n    }\n  });\n\n  // --- Size tap completes an add the shopper already asked for ------------\n  let intentUntil = 0;\n\n  // Runs before the size-required guard (window is first in capture order)\n  window.addEventListener(\n    \"submit\",\n    (event) => {\n      if (!isPending()) {\n        return\n      }\n      const form = event.target;\n      if (\n        form &&\n        form.matches &&\n        form.matches(\"[data-product-form]\") &&\n        container.contains(form)\n      ) {\n        intentUntil = Date.now() + INTENT_TTL_MS;\n      }\n    },\n    true,\n  );\n\n  function waitForVariantChange() {\n    return new Promise((resolve) => {\n      let done = false;\n      const finish = () => {\n        if (!done) {\n          done = true;\n          resolve();\n        }\n      };\n      document.addEventListener(VARIANT_CHANGED_EVENT, finish, {\n        once: true,\n        capture: true,\n      });\n      window.setTimeout(finish, 700);\n    });\n  }\n\n  // Only add once the form really holds the size the shopper tapped\n  function addWhenFormMatches(variantId, attempt) {\n    const hidden = container.querySelector(\n      '[data-product-form] input[type=\"hidden\"][name=\"id\"]',\n    );\n    const checked = container.querySelector(\n      'product-block-variant-selector input[type=\"radio\"][js-variant-input]:checked',\n    );\n    const real = realButton();\n\n    if (\n      hidden &&\n      hidden.value === variantId &&\n      checked &&\n      checked.value === variantId &&\n      !isPending()\n    ) {\n      if (real && !real.disabled) {\n        real.click();\n      }\n      return\n    }\n\n    if (attempt < 40) {\n      window.setTimeout(() => addWhenFormMatches(variantId, attempt + 1), 100);\n    }\n  }\n\n  document.addEventListener(\n    \"change\",\n    (event) => {\n      if (!intentUntil) {\n        return\n      }\n      const input = event.target;\n      if (\n        !input ||\n        !input.matches ||\n        !input.matches('input[type=\"radio\"][js-variant-input]') ||\n        !container.contains(input)\n      ) {\n        return\n      }\n\n      const fresh = Date.now() < intentUntil;\n      intentUntil = 0;\n      if (!fresh) {\n        return\n      }\n\n      const variantId = input.value;\n      waitForVariantChange().then(() => {\n        window.setTimeout(() => addWhenFormMatches(variantId, 0), 100);\n      });\n    },\n    true,\n  );\n\n  window.setTimeout(schedule, 300);\n  sync();\n})();\n"],
  "mappings": "CAoBC,IAAM,CAML,GALI,OAAO,oBAGX,OAAO,kBAAoB,GAEvB,OAAO,SAAW,OAAO,QAAQ,YACnC,OAGF,MAAM,UAAY,uBACZ,sBAAwB,0BACxB,aA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