{
  "version": 3,
  "sources": ["/cdn/shop/t/42/assets/sk-chapters.js?sk=1794478091281"],
  "sourcesContent": ["/* SK, Phase 3 (pre-publish, 12 Nov 2026), owner 10:57 (The House, as Chanel's Gabrielle Chanel page): the chapters of\n   sections/sk-chapters.liquid, one at a time. The arrows (and the arrow keys inside the band, and a swipe across the\n   picture on phones and tablets) show the previous or next chapter. The others stay out of reach of the keyboard and\n   screen readers. In the theme editor, choosing a chapter shows it. Nothing here adds to the cart, sends or saves\n   anything.\n   Kit 65 (owner 12:11: \"like Chanel, more dynamic\"; \"when we get to chapter 6 there shouldn't be an arrow to the right,\n   only left, and vice versa\"): the chapters no longer loop: the first chapter has no left arrow, the last no right\n   arrow (the keys and swipes stop there too). Changing chapter: the chapter that leaves fades; the new picture opens\n   from the side it comes from while it settles from a 1.6 zoom (as Chanel's), then its number and title slide in, then\n   its words rise (assets/sk-chapters.css; none for visitors who ask for less motion).\n   Kit 66 (owner 12:44): the closing line shows above the count on the last chapter (\"is-last\"). */\n(function () {\n  'use strict';\n  if (!window.customElements || window.customElements.get('sk-chapters')) return;\n\n  window.customElements.define(\n    'sk-chapters',\n    class extends HTMLElement {\n      connectedCallback() {\n        if (this.ready) return;\n        this.slides = Array.prototype.slice.call(this.querySelectorAll('.sk-ch__slide'));\n        if (this.slides.length < 2) return;\n        this.ready = true;\n        var self = this;\n        this.index = 0;\n        for (var i = 0; i < this.slides.length; i++) {\n          if (this.slides[i].classList.contains('is-active')) {\n            this.index = i;\n            break;\n          }\n        }\n        this.current = this.querySelector('[data-sk-ch-current]');\n        this.prev = this.querySelector('.sk-ch__arrow--prev');\n        this.next = this.querySelector('.sk-ch__arrow--next');\n        this.addEventListener('click', function (event) {\n          var arrow = event.target.closest('[data-sk-ch-step]');\n          if (!arrow || !self.contains(arrow)) return;\n          self.go(self.index + parseInt(arrow.getAttribute('data-sk-ch-step'), 10));\n        });\n        this.addEventListener('keydown', function (event) {\n          if (event.key !== 'ArrowLeft' && event.key !== 'ArrowRight') return;\n          if (event.target.closest('input, textarea, select')) return;\n          var step = event.key === 'ArrowRight' ? 1 : -1;\n          if (self.isRtl()) step = -step;\n          event.preventDefault();\n          self.go(self.index + step);\n        });\n        // a swipe across the picture (phones and tablets)\n        var startX = null;\n        var startY = null;\n        this.addEventListener(\n          'touchstart',\n          function (event) {\n            if (!event.target.closest('.sk-ch__media')) return;\n            startX = event.touches[0].clientX;\n            startY = event.touches[0].clientY;\n          },\n          { passive: true }\n        );\n        this.addEventListener(\n          'touchend',\n          function (event) {\n            if (startX === null) return;\n            var dx = event.changedTouches[0].clientX - startX;\n            var dy = event.changedTouches[0].clientY - startY;\n            startX = null;\n            if (Math.abs(dx) > 50 && Math.abs(dx) > Math.abs(dy) * 1.5) {\n              self.go(self.index + ((dx < 0) !== self.isRtl() ? 1 : -1));\n            }\n          },\n          { passive: true }\n        );\n        // the theme editor: a chosen chapter shows\n        this.onSelect = function (event) {\n          var slide = event.target && event.target.closest ? event.target.closest('.sk-ch__slide') : null;\n          if (!slide || !self.contains(slide)) return;\n          var n = self.slides.indexOf(slide);\n          if (n >= 0) self.show(n, true);\n        };\n        document.addEventListener('shopify:block:select', this.onSelect);\n        this.show(this.index, true);\n      }\n      disconnectedCallback() {\n        if (this.onSelect) document.removeEventListener('shopify:block:select', this.onSelect);\n        if (this.enterTimer) clearTimeout(this.enterTimer);\n        if (this.leaveTimer) clearTimeout(this.leaveTimer);\n      }\n      isRtl() {\n        return window.getComputedStyle(this).direction === 'rtl';\n      }\n      // no loop: before the first and after the last chapter, nothing\n      go(n) {\n        if (n < 0 || n >= this.slides.length || n === this.index) return;\n        this.show(n, false);\n      }\n      show(n, quiet) {\n        var self = this;\n        var old = this.index;\n        var leaving = !quiet && old !== n ? this.slides[old] : null;\n        for (var i = 0; i < this.slides.length; i++) {\n          var slide = this.slides[i];\n          var on = i === n;\n          slide.classList.toggle('is-active', on);\n          slide.classList.remove('is-entering', 'is-leaving');\n          if (on) {\n            slide.removeAttribute('aria-hidden');\n            slide.removeAttribute('inert');\n          } else {\n            slide.setAttribute('aria-hidden', 'true');\n            slide.setAttribute('inert', '');\n          }\n        }\n        var active = this.slides[n];\n        if (!quiet) {\n          // the side the new chapter comes from: the right going forward (the left on right-to-left pages)\n          this.setAttribute('data-sk-ch-from', (n > old) !== this.isRtl() ? 'right' : 'left');\n          // restart the entrance (assets/sk-chapters.css), then let it go\n          void active.offsetWidth;\n          active.classList.add('is-entering');\n          if (leaving) leaving.classList.add('is-leaving');\n          if (this.enterTimer) clearTimeout(this.enterTimer);\n          if (this.leaveTimer) clearTimeout(this.leaveTimer);\n          this.enterTimer = setTimeout(function () {\n            active.classList.remove('is-entering');\n          }, 1700);\n          this.leaveTimer = setTimeout(function () {\n            if (leaving) leaving.classList.remove('is-leaving');\n          }, 450);\n        }\n        this.index = n;\n        if (this.current) this.current.textContent = String(n + 1);\n        // kit 66: the closing line shows on the last chapter (assets/sk-chapters.css)\n        this.classList.toggle('is-last', n === this.slides.length - 1);\n        // the arrows: none before the first chapter, none after the last; a hidden arrow hands its focus to the other\n        var atStart = n === 0;\n        var atEnd = n === this.slides.length - 1;\n        var focused = document.activeElement;\n        if (this.prev) this.prev.hidden = atStart;\n        if (this.next) this.next.hidden = atEnd;\n        if (focused === this.prev && atStart && this.next) this.next.focus();\n        if (focused === this.next && atEnd && this.prev) this.prev.focus();\n        // the neighbours' pictures load now, so the next one is ready when asked for\n        [n - 1, n + 1].forEach(function (k) {\n          var s = self.slides[k];\n          var img = s && s.querySelector('img[loading=\"lazy\"]');\n          if (img) img.setAttribute('loading', 'eager');\n        });\n      }\n    }\n  );\n})();\n"],
  "mappings": "CAWC,UAAY,CACX,aACI,CAAC,OAAO,gBAAkB,OAAO,eAAe,IAAI,aAAa,GAErE,OAAO,eAAe,OACpB,cACA,cAAc,WAAY,CACxB,mBAAoB,CAClB,GAAI,MAAK,QACT,KAAK,OAAS,MAAM,UAAU,MAAM,KAAK,KAAK,iBAAiB,eAAe,CAAC,EAC3E,OAAK,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