{
  "version": 3,
  "sources": ["/cdn/shop/t/117/assets/mast-product-mobile.js?mast_product_revision=20261102-5"],
  "sourcesContent": ["/* Progressive enhancement of Ella's existing Swiper and zoom dialog. */\n(() => {\n  'use strict';\n  const query = '(max-width: 749px), (min-width: 750px) and (max-width: 1024px) and (orientation: portrait) and (pointer: coarse)';\n  const init = (scope = document) => {\n    scope.querySelectorAll('.main-product-information[data-mast-product-mobile]').forEach((root) => {\n      if (root.mastMobileGallery) return;\n      const gallery = root.querySelector('media-gallery');\n      const component = gallery?.querySelector('swiper-component');\n      const slider = component?.querySelector('.swiper-main');\n      if (!slider) return;\n      const media = matchMedia(query);\n      const controller = new AbortController();\n      const { signal } = controller;\n      let frame = 0;\n      let entered = false;\n      let initialIndex = 0;\n      let chosenRoom = false;\n      let boundSwiper = null;\n      let lastMobileIndex = null;\n      const roomSlides = [];\n      const slides = Array.from(slider.querySelectorAll(':scope > .swiper-wrapper > .swiper-slide'));\n      const imageSizes = slides.flatMap((slide) => Array.from(slide.querySelectorAll('img'), (image) => ({\n        image, original: image.getAttribute('sizes')\n      })));\n      const syncImageSizes = (mobile) => {\n        imageSizes.forEach(({ image, original }) => {\n          const value = mobile ? '100vw' : original;\n          if (value === null) image.removeAttribute('sizes');\n          else if (image.getAttribute('sizes') !== value) image.setAttribute('sizes', value);\n        });\n      };\n      slides.forEach((slide, index) => {\n        const image = slide.querySelector('img');\n        // Reuse the supplier's room-image filename convention when an alt label is absent.\n        const imagePath = image ? new URL(image.currentSrc || image.src, location.href).pathname : '';\n        const room = image && (\n          /im eingerichteten raum|raumansicht|raumbild|room view/i.test(image.alt) ||\n          /_M_|IMC-Foto_[A-Z]-Speisen-Foto_|Tischgruppe/i.test(imagePath)\n        );\n        slide.toggleAttribute('data-mast-room', !!room);\n        if (room) roomSlides.push({ slide, index });\n      });\n      // Wide wallboards need the complete room view, not a portrait crop through the product.\n      const roomImage = roomSlides[0]?.slide.querySelector('img');\n      if (roomImage && /wandboard/i.test(roomImage.alt)) {\n        const ratio = Number(roomImage.getAttribute('width')) / Number(roomImage.getAttribute('height'));\n        if (Number.isFinite(ratio) && ratio > 0) {\n          root.setAttribute('data-mast-wide-room', '');\n          root.style.setProperty('--mast-room-ratio', String(ratio));\n        }\n      }\n      const updateHeader = () => {\n        frame = 0;\n        if (!root.isConnected) return;\n        const headerHeight = document.querySelector('#header-component')?.getBoundingClientRect().height || 76;\n        const bounds = slider.getBoundingClientRect();\n        const past = media.matches && bounds.height > 0 && bounds.bottom <= headerHeight;\n        const activeSlide = slides.find((slide) => slide.classList.contains('swiper-slide-active'));\n        const lightCanvas = media.matches && !past && !!activeSlide?.querySelector('.product-media__image') && !activeSlide.hasAttribute('data-mast-room');\n        document.body.toggleAttribute('data-mast-product-past-hero', past);\n        document.body.toggleAttribute('data-mast-product-light-canvas', lightCanvas);\n      };\n      const schedule = () => { if (!frame) frame = requestAnimationFrame(updateHeader); };\n      const update = () => {\n        const swiper = slider.swiper;\n        syncImageSizes(media.matches);\n        if (!media.matches) {\n          if (entered && swiper && !swiper.destroyed) {\n            swiper.slideToLoop?.(initialIndex, 0);\n            swiper.update();\n          }\n          entered = false;\n          document.body.removeAttribute('data-mast-product-past-hero');\n          document.body.removeAttribute('data-mast-product-light-canvas');\n          return;\n        }\n        if (!swiper || swiper.destroyed) return;\n        if (boundSwiper !== swiper) {\n          boundSwiper = swiper;\n          swiper.on('realIndexChange', () => {\n            if (media.matches && entered) {\n              lastMobileIndex = swiper.realIndex;\n              schedule();\n            }\n          });\n        }\n        swiper.update();\n        if (!entered) {\n          initialIndex = swiper.realIndex || 0;\n          entered = true;\n          // Keep an explicitly linked variant's media; do not rewrite product data/order.\n          if (!chosenRoom && !new URLSearchParams(location.search).has('variant') && roomSlides.length) {\n            const room = roomSlides[0];\n            const index = Number(room.slide.dataset.swiperSlideIndex ?? room.index);\n            swiper.slideToLoop(index, 0);\n            lastMobileIndex = index;\n            chosenRoom = true;\n          } else if (lastMobileIndex !== null) {\n            swiper.slideToLoop(lastMobileIndex, 0);\n          }\n        }\n        if (matchMedia('(prefers-reduced-motion: reduce)').matches) swiper.params.speed = 0;\n        schedule();\n      };\n      const observer = new MutationObserver(() => { if (slider.swiper && slider.swiper !== boundSwiper) update(); });\n      observer.observe(slider, { attributes: true, attributeFilter: ['class'] });\n      const sizeObserver = new ResizeObserver(schedule);\n      sizeObserver.observe(slider);\n      media.addEventListener('change', () => requestAnimationFrame(update), { signal });\n      addEventListener('pageshow', () => requestAnimationFrame(update), { signal });\n      addEventListener('resize', schedule, { signal, passive: true });\n      document.addEventListener('scroll', schedule, { signal, passive: true });\n      document.addEventListener('shopify:section:unload', (event) => {\n        if (!event.target.contains(root)) return;\n        controller.abort();\n        observer.disconnect();\n        sizeObserver.disconnect();\n        cancelAnimationFrame(frame);\n        document.body.removeAttribute('data-mast-product-past-hero');\n        document.body.removeAttribute('data-mast-product-light-canvas');\n      }, { signal });\n      root.mastMobileGallery = true;\n      root.dataset.mastProductRevision = '20261102-5';\n      customElements.whenDefined('swiper-component').then(() => {\n        if (!root.isConnected) return;\n        if (media.matches && !slider.swiper) component.initializeSwiper?.();\n        update();\n      });\n      updateHeader();\n    });\n  };\n  init();\n  document.addEventListener('shopify:section:load', (event) => init(event.target));\n  document.addEventListener('page:loaded', () => init());\n})();\n"],
  "mappings": "CACC,IAAM,CACL,aACA,MAAM,MAAQ,mHACR,KAAO,CAAC,MAAQ,WAAa,CACjC,MAAM,iBAAiB,qDAAqD,EAAE,QAAS,MAAS,CAC9F,GAAI,KAAK,kBAAmB,OAE5B,MAAM,UADU,KAAK,cAAc,eAAe,GACvB,cAAc,kBAAkB,EACrD,OAAS,WAAW,cAAc,cAAc,EACtD,GAAI,CAAC,OAAQ,OACb,MAAM,MAAQ,WAAW,KAAK,EACxB,WAAa,IAAI,gBACjB,CAAE,MAAO,EAAI,WACnB,IAAI,MAAQ,EACR,QAAU,GACV,aAAe,EACf,WAAa,GACb,YAAc,KACd,gBAAkB,KACtB,MAAM,WAAa,CAAC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