{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./codebase/orange/cartridges/app_storefront_core/cartridge/client/default/js/components/organism-swiper-apple.js"],"names":[],"mappings":";QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;;;;AClFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA,wDAAwD,OAAO;AAC/D,OAAO;AACP;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA,wDAAwD,OAAO;AAC/D,OAAO;AACP;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT,OAAO;;AAEP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA,KAAK;;AAEL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA,wDAAwD,OAAO;AAC/D,OAAO;AACP;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT,OAAO;AACP;;AAEA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA","file":"default\\js\\components\\organism-swiper-apple.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./codebase/orange/cartridges/app_storefront_core/cartridge/client/default/js/components/organism-swiper-apple.js\");\n","/* global Swiper */\r\nconst sectionSwiperLeftOffsets = document.querySelectorAll('.swiper-module--full-width');\r\nconst sectionSwiperCenter = document.querySelectorAll('.swiper-module--center');\r\nconst sectionSwiperCards = document.querySelectorAll('.swiper-module--cards');\r\nconst sectionSwiperTV = document.querySelectorAll('.swiper-module--tv');\r\nconst mediaPrefersReducedMotion = window.matchMedia('(prefers-reduced-motion: reduce)');\r\nconst swiperAnimationsDisabled = settings => (settings.speed = 0);\r\nconst isMobile = window.matchMedia('(any-pointer:coarse)');\r\n\r\n// util to retrieve data-breakpoint from HTML\r\nfunction stringToJSON(str) {\r\n try {\r\n return JSON.parse(str);\r\n } catch (error) {\r\n console.error('Error in swiper data-breakpoint: ', str, '\\n', error);\r\n return false;\r\n }\r\n}\r\n\r\n// util to slideTo\r\nfunction slideTo(swiper, timeSwiperTransitionClicked) {\r\n swiper.slideTo(swiper.clickedIndex, timeSwiperTransitionClicked);\r\n}\r\n\r\n// util to show/hide three dots\r\nfunction showScrollDots(swiper, section, paginationSettings) {\r\n const leftDots = section.querySelector('.swiper-left-dots');\r\n const rightDots = section.querySelector('.swiper-right-dots');\r\n if (leftDots) {\r\n if (paginationSettings.totalPagination < paginationSettings.swiperPaginationMaxBullet) {\r\n leftDots.classList.add('disabled');\r\n rightDots.classList.add('disabled');\r\n } else {\r\n if (swiper.realIndex > paginationSettings.swiperPaginationMaxBulletStep) {\r\n leftDots.classList.remove('disabled');\r\n } else {\r\n leftDots.classList.add('disabled');\r\n }\r\n\r\n if (swiper.realIndex < paginationSettings.totalPagination - paginationSettings.swiperPaginationMaxBulletStep) {\r\n rightDots.classList.remove('disabled');\r\n } else {\r\n rightDots.classList.add('disabled');\r\n }\r\n }\r\n }\r\n}\r\n\r\n// util to limit width of Paginations\r\nfunction slideChangeObservePagination(swiper, section, paginationSettings, motion) {\r\n showScrollDots(swiper, section, paginationSettings);\r\n if (\r\n paginationSettings.totalPagination &&\r\n paginationSettings.totalPagination >= paginationSettings.swiperPaginationMaxBullet\r\n ) {\r\n jQuery(swiper.pagination.el).animate(\r\n {\r\n scrollLeft:\r\n (swiper.realIndex - paginationSettings.swiperPaginationMaxBulletStep) *\r\n paginationSettings._swiperPaginationBulletSizeComputed,\r\n },\r\n !motion || motion.matches ? 0 : 200,\r\n );\r\n }\r\n}\r\n\r\n// util to set intial slide on selectable-cards reading input:checked\r\nfunction configuratorInitialSlide(section) {\r\n const inputs = section.querySelectorAll('.selectable input[type=\"radio\"]');\r\n if (inputs) {\r\n inputs.forEach((input, index, arr) => {\r\n if (input.checked) {\r\n section.setAttribute('data-initial-slide', index);\r\n arr.length = index + 1;\r\n }\r\n });\r\n }\r\n}\r\n\r\n// swiper with offset: recalculate offsets\r\nfunction createOffsets() {\r\n for (const sectionWithLeftOffset of sectionSwiperLeftOffsets) {\r\n const container = sectionWithLeftOffset.querySelector('.swiper-module .container-fluid');\r\n\r\n const wrapperComputedStyle = window.getComputedStyle(container, null);\r\n const containerWidth = (container.clientWidth -=\r\n parseFloat(wrapperComputedStyle.paddingLeft) + parseFloat(wrapperComputedStyle.paddingRight));\r\n\r\n const offset = (window.innerWidth - containerWidth) / 2;\r\n sectionWithLeftOffset.style.setProperty('--swiper-offset', offset + 'px');\r\n }\r\n}\r\n// end swiper with offset: recalculate offsets\r\n\r\n// util to set custom pagination on those swiper that required\r\nfunction renderBulletPagination(index, className) {\r\n return '';\r\n}\r\n\r\n// START swiper with offset\r\nif (sectionSwiperLeftOffsets.length) {\r\n createOffsets();\r\n\r\n // swiper with offset: loop over all swiper instances\r\n for (const section of sectionSwiperLeftOffsets) {\r\n const swiper = section.querySelector('.swiper');\r\n const dataBreakpoint = section.getAttribute('data-breakpoint');\r\n const swiperBreakpoint = stringToJSON(dataBreakpoint);\r\n const noSpaceBetween = section.classList.contains('swiper-module--no-space-between');\r\n const invisibleLooped = section.classList.contains('swiper-module--full-width--invisible-looped');\r\n\r\n configuratorInitialSlide(section);\r\n const dataInitialSlide = section.getAttribute('data-initial-slide');\r\n\r\n const styles = getComputedStyle(section);\r\n const swiperPaginationMaxBullet = Number(styles.getPropertyValue('--swiper-pagination-max-bullet'));\r\n const swiperPaginationMaxBulletStep = Math.floor(swiperPaginationMaxBullet / 2);\r\n const _swiperPaginationBulletSizeComputed = Number(\r\n styles.getPropertyValue('--_swiper-pagination-bullet-size-computed'),\r\n );\r\n\r\n const paginationSettings = {\r\n swiperPaginationMaxBullet,\r\n swiperPaginationMaxBulletStep,\r\n _swiperPaginationBulletSizeComputed,\r\n totalPagination: undefined,\r\n };\r\n\r\n let swiperSettings = {\r\n slidesPerView: 'auto',\r\n breakpoints: swiperBreakpoint ? swiperBreakpoint : null,\r\n spaceBetween: noSpaceBetween ? 0 : 16,\r\n loop: invisibleLooped,\r\n initialSlide: dataInitialSlide ? Number(dataInitialSlide) : 0,\r\n navigation: {\r\n prevEl: section.querySelector('.swiper-control-left'),\r\n nextEl: section.querySelector('.swiper-control-right'),\r\n },\r\n pagination: {\r\n el:\r\n section.querySelector('.swiper-pagination .swiper-pagination-container') ||\r\n section.querySelector('.swiper-pagination'),\r\n clickable: true,\r\n type: 'bullets',\r\n renderBullet: function (index, className) {\r\n paginationSettings.totalPagination = index;\r\n return renderBulletPagination(index, className);\r\n },\r\n },\r\n a11y: {\r\n prevSlideMessage: 'Ir a diapositiva anterior',\r\n nextSlideMessage: 'Ir a diapositiva siguiente',\r\n paginationBulletMessage: 'Ir a la dispositiva {{index}}',\r\n },\r\n on: {\r\n resize: function () {\r\n createOffsets();\r\n },\r\n transitionStart: function () {\r\n slideChangeObservePagination(this, section, paginationSettings, mediaPrefersReducedMotion);\r\n },\r\n afterInit: function () {\r\n showScrollDots(this, section, paginationSettings);\r\n },\r\n },\r\n };\r\n\r\n if (section.closest('.modal--drawer--tariff-comparator-V02')) {\r\n swiperSettings = {\r\n ...swiperSettings,\r\n on: {\r\n resize: null,\r\n },\r\n };\r\n }\r\n\r\n if (section.classList.contains('swiper-module--slide-to-clicked-slide')) {\r\n const timeSwiperTransitionClicked = !mediaPrefersReducedMotion || mediaPrefersReducedMotion.matches ? 0 : 300;\r\n swiperSettings = {\r\n ...swiperSettings,\r\n on: {\r\n ...swiperSettings.on,\r\n click: function () {\r\n slideTo(this, timeSwiperTransitionClicked);\r\n },\r\n },\r\n };\r\n }\r\n\r\n if (section.classList.contains('swiper-module--mousewheel') && !isMobile.matches) {\r\n swiperSettings = {\r\n ...swiperSettings,\r\n mousewheel: {\r\n eventsTarget: 'container',\r\n },\r\n };\r\n }\r\n\r\n if (section.classList.contains('swiper-module--contain-inputs')) {\r\n swiperSettings.a11y = {\r\n ...swiperSettings.a11y,\r\n slideRole: null,\r\n slideLabelMessage: null,\r\n };\r\n }\r\n\r\n if (!mediaPrefersReducedMotion || mediaPrefersReducedMotion.matches) swiperAnimationsDisabled(swiperSettings);\r\n\r\n const swiperInstance = new Swiper(swiper, swiperSettings);\r\n\r\n if (section.classList.contains('swiper-module--navigation-pulse')) {\r\n swiperInstance.once('slideChange', function () {\r\n section.classList.remove('swiper-module--navigation-pulse');\r\n });\r\n }\r\n }\r\n // end swiper with offset: loop over all swiper instances\r\n}\r\n// END swiper with offset\r\n/////////////////////////\r\n\r\n// START swiper center\r\nif (sectionSwiperCenter.length) {\r\n // START swiper center: loop over all swiper instances\r\n sectionSwiperCenter.forEach(section => {\r\n const swiper = section.querySelector('.swiper');\r\n const dataBreakpoint = section.getAttribute('data-breakpoint');\r\n const swiperBreakpoint = stringToJSON(dataBreakpoint);\r\n const noSpaceBetween = section.classList.contains('swiper-module--no-space-between');\r\n const looped = section.classList.contains('swiper-module--center--looped');\r\n\r\n configuratorInitialSlide(section);\r\n const dataInitialSlide = section.getAttribute('data-initial-slide');\r\n\r\n const styles = getComputedStyle(section);\r\n const swiperPaginationMaxBullet = Number(styles.getPropertyValue('--swiper-pagination-max-bullet'));\r\n const swiperPaginationMaxBulletStep = Math.floor(swiperPaginationMaxBullet / 2);\r\n const _swiperPaginationBulletSizeComputed = Number(\r\n styles.getPropertyValue('--_swiper-pagination-bullet-size-computed'),\r\n );\r\n\r\n const paginationSettings = {\r\n swiperPaginationMaxBullet,\r\n swiperPaginationMaxBulletStep,\r\n _swiperPaginationBulletSizeComputed,\r\n totalPagination: undefined,\r\n };\r\n\r\n let swiperSettings = {\r\n slidesPerView: 'auto',\r\n breakpoints: swiperBreakpoint ? swiperBreakpoint : null,\r\n spaceBetween: noSpaceBetween ? 0 : 16,\r\n loop: looped,\r\n initialSlide: dataInitialSlide ? Number(dataInitialSlide) : 0,\r\n navigation: {\r\n prevEl: section.querySelector('.swiper-control-left'),\r\n nextEl: section.querySelector('.swiper-control-right'),\r\n },\r\n pagination: {\r\n el:\r\n section.querySelector('.swiper-pagination .swiper-pagination-container') ||\r\n section.querySelector('.swiper-pagination'),\r\n clickable: true,\r\n type: 'bullets',\r\n renderBullet: function (index, className) {\r\n paginationSettings.totalPagination = index;\r\n return renderBulletPagination(index, className);\r\n },\r\n },\r\n a11y: {\r\n prevSlideMessage: 'Ir a diapositiva anterior',\r\n nextSlideMessage: 'Ir a diapositiva siguiente',\r\n paginationBulletMessage: 'Ir a la dispositiva {{index}}',\r\n },\r\n on: {\r\n transitionStart: function () {\r\n slideChangeObservePagination(this, section, paginationSettings, mediaPrefersReducedMotion);\r\n },\r\n afterInit: function () {\r\n showScrollDots(this, section, paginationSettings);\r\n },\r\n },\r\n };\r\n\r\n if (section.classList.contains('swiper-module--center--progress-bullets')) {\r\n swiperSettings = {\r\n ...swiperSettings,\r\n autoplay: {\r\n delay: 6000,\r\n disableOnInteraction: true,\r\n },\r\n pagination: {\r\n el: section.querySelector('.swiper-pagination'),\r\n clickable: true,\r\n type: 'bullets',\r\n bulletElement: 'div',\r\n },\r\n loop: true,\r\n watchSlidesProgress: true,\r\n slidesPerView: 1,\r\n on: {\r\n resize: null,\r\n slideChange: null,\r\n },\r\n };\r\n }\r\n if (section.classList.contains('swiper-module--center--active-middle')) {\r\n const swiperCount = swiper.querySelectorAll('.swiper-slide').length;\r\n swiperSettings = {\r\n ...swiperSettings,\r\n initialSlide: Math.floor((swiperCount - 1) / 2),\r\n centeredSlides: true,\r\n centeredSlidesBounds: true, //required: centeredSlides:true, and incompatible with: loop and pagination\r\n };\r\n }\r\n\r\n if (section.classList.contains('swiper-module--mousewheel') && !isMobile.matches) {\r\n swiperSettings = {\r\n ...swiperSettings,\r\n mousewheel: {\r\n eventsTarget: 'container',\r\n },\r\n };\r\n }\r\n\r\n if (section.classList.contains('swiper-module--slide-to-clicked-slide')) {\r\n const timeSwiperTransitionClicked = !mediaPrefersReducedMotion || mediaPrefersReducedMotion.matches ? 0 : 300;\r\n swiperSettings = {\r\n ...swiperSettings,\r\n on: {\r\n ...swiperSettings.on,\r\n click: function () {\r\n slideTo(this, timeSwiperTransitionClicked);\r\n },\r\n },\r\n };\r\n }\r\n\r\n if (section.classList.contains('swiper-module--one-slide-perview')) {\r\n document.querySelectorAll('.swiper-module--one-slide-perview .card-tariff-new__dropdown-input').forEach(function (e) {\r\n e.addEventListener('click', function () {\r\n e.closest('.swiper-module--one-slide-perview').querySelectorAll('.card-tariff-new__dropdown-input').forEach(function (f) {\r\n if (e.checked === true) {\r\n f.checked = true;\r\n }\r\n else {\r\n f.checked = false;\r\n }\r\n });\r\n });\r\n })\r\n\r\n swiperSettings = {\r\n ...swiperSettings,\r\n\r\n allowTouchMove: false,\r\n pagination: false,\r\n navigation: {\r\n prevEl: section.querySelector('.swiper-control-left'),\r\n nextEl: section.querySelector('.swiper-control-right'),\r\n },\r\n loop: false,\r\n watchSlidesProgress: true,\r\n slidesPerView: 1,\r\n speed: 0,\r\n on: {\r\n resize: null,\r\n slideChange: null,\r\n },\r\n };\r\n\r\n const animatePrice = '';\r\n\r\n // Se aƱade una funcion onclick para animar el precio\r\n swiperSettings.navigation.prevEl.onclick = animatePrice;\r\n swiperSettings.navigation.nextEl.onclick = animatePrice;\r\n }\r\n\r\n if (section.classList.contains('swiper-module--contain-inputs')) {\r\n swiperSettings.a11y = {\r\n ...swiperSettings.a11y,\r\n slideRole: null,\r\n slideLabelMessage: null,\r\n };\r\n }\r\n\r\n if (!mediaPrefersReducedMotion || mediaPrefersReducedMotion.matches) swiperAnimationsDisabled(swiperSettings);\r\n\r\n const swiperInstance = new Swiper(swiper, swiperSettings);\r\n\r\n if (section.classList.contains('swiper-module--navigation-pulse')) {\r\n swiperInstance.once('slideChange', function () {\r\n section.classList.remove('swiper-module--navigation-pulse');\r\n });\r\n }\r\n });\r\n}\r\n\r\n// START swiper cards\r\nif (sectionSwiperCards.length) {\r\n sectionSwiperCards.forEach(section => {\r\n const sectionSwiperCard = section.querySelector('.swiper-gallery-txt');\r\n const sectionGalleryThumbs = section.querySelector('.swiper-gallery-thumbs');\r\n\r\n const imgs = sectionSwiperCard.querySelectorAll('.swiper-slide .gallery-txt-img');\r\n\r\n let slide;\r\n const fragment = document.createDocumentFragment();\r\n imgs.forEach(img => {\r\n slide = document.createElement('div');\r\n slide.classList.add('swiper-slide');\r\n slide.appendChild(img); //without img.cloneNode()\r\n fragment.appendChild(slide);\r\n });\r\n\r\n const thumbWrapper = sectionGalleryThumbs.querySelector('.swiper-wrapper');\r\n thumbWrapper.appendChild(fragment);\r\n\r\n if (sectionSwiperCard.querySelectorAll('.swiper-slide').length == 1) {\r\n if (section.querySelector('.swiper-pagination')) {\r\n section.querySelector('.swiper-pagination').classList.add('d-none');\r\n }\r\n return;\r\n }\r\n\r\n const styles = getComputedStyle(section);\r\n const swiperPaginationMaxBullet = Number(styles.getPropertyValue('--swiper-pagination-max-bullet'));\r\n const swiperPaginationMaxBulletStep = Math.floor(swiperPaginationMaxBullet / 2);\r\n const _swiperPaginationBulletSizeComputed = Number(\r\n styles.getPropertyValue('--_swiper-pagination-bullet-size-computed'),\r\n );\r\n\r\n const paginationSettings = {\r\n swiperPaginationMaxBullet,\r\n swiperPaginationMaxBulletStep,\r\n _swiperPaginationBulletSizeComputed,\r\n totalPagination: undefined,\r\n };\r\n\r\n let swiperSettings = {\r\n resizeObserver: false,\r\n spaceBetween: 32,\r\n slidesPerView: 1,\r\n allowTouchMove: false,\r\n effect: 'fade',\r\n fadeEffect: {\r\n crossFade: true,\r\n },\r\n };\r\n\r\n let swiperThumbSettings = {\r\n resizeObserver: false,\r\n effect: 'cards',\r\n grabCursor: true,\r\n cardsEffect: {\r\n perSlideOffset: 6,\r\n perSlideRotate: 4,\r\n rotate: true,\r\n slideShadow: true,\r\n },\r\n navigation: {\r\n prevEl: section.querySelector('.swiper-control-left'),\r\n nextEl: section.querySelector('.swiper-control-right'),\r\n },\r\n pagination: {\r\n el:\r\n section.querySelector('.swiper-pagination .swiper-pagination-container') ||\r\n section.querySelector('.swiper-pagination'),\r\n clickable: true,\r\n type: 'bullets',\r\n renderBullet: function (index, className) {\r\n paginationSettings.totalPagination = index;\r\n return renderBulletPagination(index, className);\r\n },\r\n },\r\n a11y: {\r\n prevSlideMessage: 'Ir a diapositiva anterior',\r\n nextSlideMessage: 'Ir a diapositiva siguiente',\r\n paginationBulletMessage: 'Ir a la dispositiva {{index}}',\r\n },\r\n on: {\r\n transitionStart: function () {\r\n slideChangeObservePagination(this, section, paginationSettings, mediaPrefersReducedMotion);\r\n },\r\n afterInit: function () {\r\n showScrollDots(this, section, paginationSettings);\r\n },\r\n },\r\n };\r\n\r\n const swiperThumbsInstance = new Swiper(sectionGalleryThumbs, swiperThumbSettings);\r\n const swiperInstance = new Swiper(sectionSwiperCard, swiperSettings);\r\n\r\n swiperThumbsInstance.controller.control = swiperInstance;\r\n swiperInstance.controller.control = swiperThumbsInstance;\r\n });\r\n}\r\n// END swiper cards\r\n\r\n// START swiper TV\r\nif (sectionSwiperTV.length) {\r\n sectionSwiperTV.forEach(section => {\r\n const swiperTV = section.querySelector('.swiper-TV');\r\n const swiperTxt = section.querySelector('.swiper-TV-thumb');\r\n\r\n if (swiperTV.querySelectorAll('.swiper-slide').length == 1) {\r\n return;\r\n }\r\n\r\n // Esta media debe ser acorde con el sistema de columnas\r\n const mqLarge = window.matchMedia('(min-width: 992px)');\r\n\r\n let swiperTxtSettings = {\r\n direction: window.innerWidth >= 992 ? 'vertical' : 'horizontal',\r\n spaceBetween: 8,\r\n slidesPerView: 'auto',\r\n slideToClickedSlide: true,\r\n centeredSlides: true,\r\n a11y: {\r\n slideRole: 'button',\r\n slideLabelMessage: null\r\n },\r\n };\r\n\r\n let swiperTVsettings = {\r\n slidesPerView: 1,\r\n allowTouchMove: false,\r\n a11y: {\r\n paginationBulletMessage: null,\r\n },\r\n };\r\n\r\n const swiperTxtInstance = new Swiper(swiperTxt, swiperTxtSettings);\r\n const swiperTvInstance = new Swiper(swiperTV, swiperTVsettings);\r\n\r\n swiperTvInstance.controller.control = swiperTxtInstance;\r\n swiperTxtInstance.controller.control = swiperTvInstance;\r\n\r\n mqLarge.addEventListener('change', event => {\r\n if (event.matches) {\r\n swiperTxtInstance.changeDirection('vertical', true);\r\n swiperTvInstance.update();\r\n } else {\r\n swiperTxtInstance.changeDirection('horizontal', true);\r\n swiperTvInstance.update();\r\n }\r\n });\r\n });\r\n}\r\n// END swiper TV\r\n"],"sourceRoot":""}