{
  "version": 3,
  "sources": ["/cdn/shop/t/26/assets/soulyshine-atc-processing-notice.js?ssatc=20260807-4"],
  "sourcesContent": ["(function () {\n  if (window.__soulyshineAtcProcessingNoticeInstalled) return;\n  window.__soulyshineAtcProcessingNoticeInstalled = true;\n\n  var buttonSelector = 'button[name=\"add\"], button.product-form__submit, [data-add-to-cart]';\n  var noticeId = 'SoulyshineAtcProcessingNotice';\n  var styleId = 'SoulyshineAtcProcessingNoticeStyles';\n  var slowTimer;\n\n  function installStyles() {\n    if (document.getElementById(styleId)) return;\n    var style = document.createElement('style');\n    style.id = styleId;\n    style.textContent = [\n      '.ss-atc-processing-notice{align-items:flex-start;background:#f2fbfb;border:1px solid #9bcaca;border-radius:8px;color:#173d3d;display:none;gap:10px;margin-top:10px;padding:12px 14px;text-align:left;width:100%;}',\n      '.ss-atc-processing-notice.is-visible{display:flex;}',\n      '.ss-atc-processing-notice__spinner{animation:ss-atc-processing-spin .8s linear infinite;border:2px solid rgba(23,61,61,.22);border-radius:50%;border-top-color:#1f7474;flex:0 0 18px;height:18px;margin-top:2px;width:18px;}',\n      '.ss-atc-processing-notice__copy{display:block;line-height:1.35;}',\n      '.ss-atc-processing-notice__title{display:block;font-size:14px;font-weight:700;}',\n      '.ss-atc-processing-notice__detail{display:block;font-size:12px;margin-top:2px;opacity:.82;}',\n      '@keyframes ss-atc-processing-spin{to{transform:rotate(360deg)}}',\n      '@media(max-width:749px){.ss-atc-processing-notice{padding:11px 12px}.ss-atc-processing-notice__title{font-size:13px}}',\n      '@media(prefers-reduced-motion:reduce){.ss-atc-processing-notice__spinner{animation-duration:1.8s}}'\n    ].join('');\n    document.head.appendChild(style);\n  }\n\n  function isAddToCartButton(button) {\n    if (!button || button.disabled || button.getAttribute('aria-disabled') === 'true') return false;\n    var text = (button.textContent || '').replace(/\\s+/g, ' ').trim();\n    var form = button.closest('form');\n    return /add to cart/i.test(text) || Boolean(form && /\\/cart\\/add/.test(form.getAttribute('action') || ''));\n  }\n\n  // The SDK is loaded globally; only a configured product should show this copy.\n  // Resolve the clicked button's product, never Customily on a different product.\n  function hasCustomilyForButton(button) {\n    if (!button || !button.isConnected) return false;\n    var form = button.form || button.closest('form');\n    var boundary = 'quick-add-modal, quick-add-drawer, [id^=\"MainProduct-\"], product-info, .main-product-section, .product';\n    var scope = (form && form.closest(boundary)) || button.closest(boundary) || form;\n    if (!scope) return false;\n\n    var fields = form ? form.querySelectorAll('input[name^=\"properties[_customily\"]') : [];\n    var hasCustomization = Array.prototype.some.call(fields, function (field) {\n      return Boolean((field.value || '').trim());\n    });\n    if (hasCustomization) return true;\n\n    var roots = scope.querySelectorAll('#cl_optionsapp, #customily-options, .customily-main-app, .customily-options-wrapper');\n    var hasOptions = Array.prototype.some.call(roots, function (root) {\n      return Boolean(root.querySelector('input:not([type=\"hidden\"]), select, textarea'));\n    });\n    if (hasOptions) return true;\n\n    return Boolean(scope.querySelector('.customily_gallery canvas, canvas#preview-canvas'));\n  }\n\n  function getNotice(button) {\n    var wrapper = button.parentElement || button.closest('form');\n    if (!wrapper) return null;\n    var notice = wrapper.querySelector('.ss-atc-processing-notice');\n    if (notice) return notice;\n\n    notice = document.createElement('div');\n    notice.id = noticeId + '-' + Math.random().toString(36).slice(2, 8);\n    notice.className = 'ss-atc-processing-notice';\n    notice.setAttribute('role', 'status');\n    notice.setAttribute('aria-live', 'polite');\n    notice.innerHTML = [\n      '<span class=\"ss-atc-processing-notice__spinner\" aria-hidden=\"true\"></span>',\n      '<span class=\"ss-atc-processing-notice__copy\">',\n      '<span class=\"ss-atc-processing-notice__title\">Please wait \u2014 we\\'re processing your personalization.</span>',\n      '<span class=\"ss-atc-processing-notice__detail\">Your cart will open when your design is ready.</span>',\n      '</span>'\n    ].join('');\n    button.insertAdjacentElement('afterend', notice);\n    return notice;\n  }\n\n  function isVisible(element) {\n    if (!element) return false;\n    var style = window.getComputedStyle(element);\n    return style.display !== 'none' && style.visibility !== 'hidden' && element.getClientRects().length > 0;\n  }\n\n  function hasVisibleValidationError(button) {\n    var scope = button.closest('product-info, .product__info-container, .main-product-section') || document;\n    var selectors = [\n      '[aria-invalid=\"true\"]',\n      '[role=\"alert\"]',\n      '.product-form__error-message:not([hidden])',\n      '.customily-error',\n      '.customily-required-error',\n      '.customily-required-label',\n      '.csh-error',\n      '.csh-error-message'\n    ].join(',');\n    return Array.prototype.some.call(scope.querySelectorAll(selectors), function (element) {\n      if (element.closest('.ss-atc-processing-notice')) return false;\n      return isVisible(element) && ((element.textContent || '').trim() || element.getAttribute('aria-invalid') === 'true');\n    });\n  }\n\n  function hideNotice(notice) {\n    if (!notice) return;\n    notice.classList.remove('is-visible');\n    notice.removeAttribute('data-processing');\n    window.clearTimeout(slowTimer);\n  }\n\n  function hideAllNotices() {\n    document.querySelectorAll('.ss-atc-processing-notice').forEach(hideNotice);\n  }\n\n  function showNotice(button) {\n    if (!hasCustomilyForButton(button)) return;\n    installStyles();\n    var notice = getNotice(button);\n    if (!notice) return;\n\n    notice.querySelector('.ss-atc-processing-notice__title').textContent = \"Please wait \u2014 we're processing your personalization.\";\n    notice.querySelector('.ss-atc-processing-notice__detail').textContent = \"Your cart will open when your design is ready.\";\n    notice.classList.add('is-visible');\n    notice.setAttribute('data-processing', 'true');\n    button.setAttribute('aria-describedby', notice.id);\n\n    [350, 900, 1600].forEach(function (delay) {\n      window.setTimeout(function () {\n        if (hasVisibleValidationError(button)) hideNotice(notice);\n      }, delay);\n    });\n\n    window.clearTimeout(slowTimer);\n    slowTimer = window.setTimeout(function () {\n      if (!notice.classList.contains('is-visible')) return;\n      notice.querySelector('.ss-atc-processing-notice__title').textContent = 'Still processing your personalization\u2026';\n      notice.querySelector('.ss-atc-processing-notice__detail').textContent = 'Please keep this page open. Your cart will load automatically.';\n    }, 30000);\n  }\n\n  document.addEventListener('click', function (event) {\n    var button = event.target.closest && event.target.closest(buttonSelector);\n    if (!isAddToCartButton(button) || !hasCustomilyForButton(button)) return;\n    window.setTimeout(function () { showNotice(button); }, 0);\n  }, true);\n\n  document.addEventListener('submit', function (event) {\n    var form = event.target;\n    if (!form || !/\\/cart\\/add/.test(form.getAttribute('action') || '')) return;\n    var button = form.querySelector(buttonSelector);\n    if (isAddToCartButton(button)) showNotice(button);\n  }, true);\n\n  window.addEventListener('pageshow', hideAllNotices);\n  document.addEventListener('cart:updated', hideAllNotices);\n  document.addEventListener('cart-notification:open', hideAllNotices);\n  document.addEventListener('soulyshine:drawer:ready', hideAllNotices);\n  document.addEventListener('soulyshine:drawer:error', hideAllNotices);\n})();\n"],
  "mappings": "CAAC,UAAY,CACX,GAAI,OAAO,yCAA0C,OACrD,OAAO,yCAA2C,GAElD,IAAI,eAAiB,sEACjB,SAAW,gCACX,QAAU,sCACV,UAEJ,SAAS,eAAgB,CACvB,GAAI,UAAS,eAAe,OAAO,EACnC,KAAI,MAAQ,SAAS,cAAc,OAAO,EAC1C,MAAM,GAAK,QACX,MAAM,YAAc,CAClB,oNACA,sDACA,+NACA,mEACA,kFACA,8FACA,kEACA,wHACA,oGACF,EAAE,KAAK,EAAE,EACT,SAAS,KAAK,YAAY,KAAK,EACjC,CAEA,SAAS,kBAAkB,OAAQ,CACjC,GAAI,CAAC,QAAU,OAAO,UAAY,OAAO,aAAa,eAAe,IAAM,OAAQ,MAAO,GAC1F,IAAI,MAAQ,OAAO,aAAe,IAAI,QAAQ,OAAQ,GAAG,EAAE,KAAK,EAC5D,KAAO,OAAO,QAAQ,MAAM,EAChC,MAAO,eAAe,KAAK,IAAI,GAAK,GAAQ,MAAQ,cAAc,KAAK,KAAK,aAAa,QAAQ,GAAK,EAAE,EAC1G,CAIA,SAAS,sBAAsB,OAAQ,CACrC,GAAI,CAAC,QAAU,CAAC,OAAO,YAAa,MAAO,GAC3C,IAAI,KAAO,OAAO,MAAQ,OAAO,QAAQ,MAAM,EAC3C,SAAW,yGACX,MAAS,MAAQ,KAAK,QAAQ,QAAQ,GAAM,OAAO,QAAQ,QAAQ,GAAK,KAC5E,GAAI,CAAC,MAAO,MAAO,G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