{
  "version": 3,
  "sources": ["/cdn/shop/t/2/assets/pod-pdp.js?cp=20260717a"],
  "sourcesContent": ["/* pod-pdp.js \u2014 shared PDP behaviour for every POD product.\n   Pills, step-number strip, ETA on the loader, ATC gate message, size rename.\n   Every DOM write is GUARDED (write only on change): these run inside MutationObservers,\n   and an unguarded write re-triggers the observer forever and freezes the tab. */\n(function(){\n// NOTE: this file must NEVER assign CUSTOM_PRINTS_CONFIG \u2014 the per-product template owns it.\n// (A stale copy captured here once overwrote every product's config, because defer runs last.)\n\n(function(){\n  function init(){\n    var list = document.querySelector('.product__media-list');\n    if(!list) return;\n    var pills = document.getElementById('cp-pills');\n    if(!pills){\n      pills = document.createElement('div');\n      pills.id = 'cp-pills';\n      pills.setAttribute('role','tablist');\n      pills.setAttribute('aria-label','Product images');\n    }\n    var slides = [].slice.call(list.querySelectorAll('.product__media-item'));\n    if(!slides.length) return;\n\n    // Move the pill row directly under the gallery.\n    var gallery = document.querySelector('media-gallery') || list.closest('.product__media-wrapper');\n    if (gallery && gallery.parentElement) gallery.parentElement.insertBefore(pills, gallery.nextSibling);\n\n    pills.innerHTML = '';\n    slides.forEach(function(s, i){\n      var b = document.createElement('button');\n      b.type = 'button';\n      b.setAttribute('aria-label', 'Image ' + (i+1));\n      b.setAttribute('aria-current', i === 0 ? 'true' : 'false');\n      b.addEventListener('click', function(){\n        list.scrollTo({ left: s.offsetLeft - list.offsetLeft, behavior: 'smooth' });\n      });\n      pills.appendChild(b);\n    });\n\n    var buttons = [].slice.call(pills.children);\n    var ticking = false;\n    function sync(){\n      ticking = false;\n      var idx = Math.round(list.scrollLeft / list.clientWidth);\n      if (idx < 0) idx = 0;\n      if (idx > buttons.length - 1) idx = buttons.length - 1;\n      buttons.forEach(function(b, i){\n        var next = i === idx ? 'true' : 'false';\n        if (b.getAttribute('aria-current') !== next) b.setAttribute('aria-current', next);  // guarded write\n      });\n    }\n    list.addEventListener('scroll', function(){ if(!ticking){ ticking = true; requestAnimationFrame(sync); } }, {passive:true});\n    sync();\n  }\n  if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', init);\n  else init();\n})();\n\n(function(){\n  // Drop the \"1 \u00B7 \" / \"2 \u00B7 \" step numbers \u2014 there is really only one step, and the numbering\n  // implies more work than the flow actually asks for. The strings are hardcoded in the shared\n  // widget JS, so rewrite them here (template-scoped) instead of editing the shared asset.\n  // Timer, not a MutationObserver: the callback writes text, which would re-trigger an observer\n  // watching the same subtree.\n  function strip(){\n    var step = document.querySelector('#custom-prints-widget .cp-step');\n    if (step) {\n      var a = step.textContent.replace(/^\\s*1\\s*\u00B7\\s*/, '');\n      if (step.textContent !== a) step.textContent = a;           // guarded\n    }\n    document.querySelectorAll('#custom-prints-widget button').forEach(function(btn){\n      var b2 = btn.textContent.replace(/^\\s*2\\s*\u00B7\\s*/, '');\n      if (btn.textContent !== b2) btn.textContent = b2;           // guarded\n    });\n  }\n  function renameXS(){\n    document.querySelectorAll('#cpv-root .cpv-card').forEach(function(card){\n      var size = card.querySelector('.cpv-size');\n      var name = card.querySelector('.cpv-name');\n      if (!size || !name) return;\n      if (!/10\\s*[x\u00D7]\\s*10/.test(size.textContent)) return;\n      if (name.textContent !== 'Canvas Print Small') name.textContent = 'Canvas Print Small';  // guarded\n    });\n  }\n  function run(){ strip(); renameXS(); }\n  run();\n  var host = document.getElementById('custom-prints-widget');\n  if (host && 'MutationObserver' in window) {\n    new MutationObserver(run).observe(host, {childList:true, subtree:true, characterData:true});\n  }\n  var cpv = document.getElementById('cpv-root');\n  if (cpv && 'MutationObserver' in window) {\n    new MutationObserver(renameXS).observe(cpv, {childList:true, subtree:true});\n  }\n  setInterval(run, 1000);   // slow backstop only\n})();\n\n(function(){\n  // Insert the gate message once, directly after the ATC so the CSS sibling rule can react.\n  function place(){\n    var atc = document.querySelector('.product-form__submit, button[name=\"add\"]');\n    if (!atc || document.getElementById('cp-atc-msg')) return;\n    var p = document.createElement('p');\n    p.id = 'cp-atc-msg';\n    p.textContent = 'Please add your photos first';\n    atc.insertAdjacentElement('afterend', p);\n  }\n  if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', place);\n  else place();\n  setTimeout(place, 800);   // the widget re-renders the buy area; make sure we land after it\n})();\n\n(function(){\n  // 'Generations take 1\\u20133 minutes' under the generate button (quality:auto runs ~60\\u201395s/option).\n  function eta(){\n    // anchor to the progress meta so it only shows WHILE generating\n    var meta = document.querySelector('#custom-prints-widget .cp-progress-meta');\n    var existing = document.getElementById('cp-eta');\n    if (!meta) { if (existing) existing.remove(); return; }\n    if (existing && existing.previousElementSibling === meta) return;\n    if (existing) existing.remove();\n    var p = document.createElement('p');\n    p.id = 'cp-eta';\n    p.textContent = 'Takes about 1 minute';\n    meta.insertAdjacentElement('afterend', p);\n  }\n  eta();\n  var host = document.getElementById('custom-prints-widget');\n  if (host && 'MutationObserver' in window) new MutationObserver(eta).observe(host, {childList:true, subtree:true});\n})();\n})();"],
  "mappings": "CAIC,UAAU,EAIV,UAAU,CACT,SAAS,MAAM,CACb,IAAI,KAAO,SAAS,cAAc,sBAAsB,EACxD,GAAG,CAAC,KAAM,OACV,IAAI,MAAQ,SAAS,eAAe,UAAU,EAC1C,QACF,MAAQ,SAAS,cAAc,KAAK,EACpC,MAAM,GAAK,WACX,MAAM,aAAa,OAAO,SAAS,EACnC,MAAM,aAAa,aAAa,gBAAgB,GAElD,IAAI,OAAS,CAAC,EAAE,MAAM,KAAK,KAAK,iBAAiB,sBAAsB,CAAC,EACxE,GAAG,CAAC,OAAO,OAAQ,OAGnB,IAAI,QAAU,SAAS,cAAc,eAAe,GAAK,KAAK,QAAQ,yBAAyB,EAC3F,SAAW,QAAQ,eAAe,QAAQ,cAAc,aAAa,MAAO,QAAQ,WAAW,EAEnG,MAAM,UAAY,GAClB,OAAO,QAAQ,SAAS,EAAG,EAAE,CAC3B,IAAI,EAAI,SAAS,cAAc,QAAQ,EACvC,EAAE,KAAO,SACT,EAAE,aAAa,aAAc,UAAY,EAAE,EAAE,EAC7C,EAAE,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