/******/ (() => { // webpackBootstrap /******/ var __webpack_modules__ = ({ /***/ "./sources/javascript/helpers/InteractiveIcon.js": /*!*******************************************************!*\ !*** ./sources/javascript/helpers/InteractiveIcon.js ***! \*******************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); class InteractiveIcon extends HTMLElement { constructor() { super(); this._openModal = this._openModal.bind(this); this.link = document.createElement('a'); this.link.classList.add('content-icons__icon'); this.modal = null; let href = this.getAttribute('href'); if (href !== null) this.link.href = href; this.action = this.getAttribute('data-action'); if (this.action === 'modal') { this.modalContent = this.innerHTML; this.innerHTML = ''; this.genID = Math.random().toString(16).slice(2); this.link.id = this.genID; this.link.addEventListener('click', this._openModal); this.link.setAttribute('aria-haspopup', 'dialog'); this.modal = document.createElement('nt-modal'); let data_content = document.createElement('div'); data_content.classList.add('publication-lightbox__content'); data_content.innerHTML = this.modalContent; this.modal.container.append(data_content); this.modal.labeledBy = this.genID; this.modal.style.display = 'none'; } if (this.action === 'link') this.link.target = '_blank'; let title = this.getAttribute('data-title'); let icon = this.getAttribute('data-icon'); if (icon !== null && icon !== '0') { let iconEl = document.createElement('img'); iconEl.src = icon; this.link.append(iconEl); } else if (icon === null) { let icon = ` `; this.link.innerHTML += icon; } let titleEl = document.createElement('span'); titleEl.innerText = title; this.link.append(titleEl); this.append(this.link); if (this.modal !== null) document.body.append(this.modal); } _openModal(event) { event.preventDefault(); this.modal.openModal(); } } let initElement = () => { customElements.define('interactive-icon', InteractiveIcon); }; /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ 'init': initElement }); /***/ }), /***/ "./sources/javascript/helpers/ModalElement.js": /*!****************************************************!*\ !*** ./sources/javascript/helpers/ModalElement.js ***! \****************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ ModalElement: () => (/* binding */ ModalElement), /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); class ModalElement extends HTMLElement { constructor() { super(); this.isOpen = false; this.container = document.createElement('div'); this.labeledBy = null; this.styles = document.createElement('style'); this.styles.textContent = `.loader { width: 75px; height: 75px; position: relative; } .loader__error { //position: absolute; //left: 50%; //top: 50%; //transform: translate(-50%, -50%); font-size: 18px; color: #ffffff; } .loader-error { //position: absolute; display: inline-block; text-align: center; font-size: 18px; line-height: 22px; color: #cc2931; border: 1px solid #cc2931; padding: 20px; background-color: #f2bfc2; font-weight: 600; //left: 50%; //top: 50%; //transform: translate(-50%, -50%); z-index: 50000; } .loader-success { //position: absolute; display: inline-block; text-align: center; font-size: 18px; line-height: 22px; color: #228B22; border: 1px solid #228B22; padding: 20px; background-color: #c2f0c2; font-weight: 600; //left: 50%; // top: 50%; //transform: translate(-50%, -50%); z-index: 50000; } .double-bounce1, .double-bounce2 { width: 100%; height: 100%; border-radius: 50%; background-color: #333; opacity: 0.6; position: absolute; top: 0; left: 0; animation: sk-bounce 2s infinite ease-in-out; } .double-bounce2 { animation-delay: -1s; } @keyframes sk-bounce { 0%, 100% { transform: scale(0); -webkit-transform: scale(0); } 50% { transform: scale(1); -webkit-transform: scale(1); } } @media screen and (max-width: 1366px) { .loader { height: 60px; width: 60px; } } @media screen and (max-width: 800px) { .loader { height: 40px; width: 40px; } } .publication-lightbox { height: 100vh; width: 100vw; position: fixed; top: 0; left: 0; background-color: rgba(0, 0, 0, 0.9); z-index: 100; display: flex; justify-content: center; align-items: center; } .publication-lightbox__loading { display: flex; justify-content: center; align-items: center; padding: 20px; width: 100%; } .publication-lightbox__close-button { position: absolute; cursor: pointer; top: 0; right: 0; font-size: 40px; color: #ffffff; background-color: transparent; border: none; padding: 30px; z-index: 500; } .publication-lightbox__close-button .first-line { width: 50px; height: 5px; background-color: #ffffff; display: block; margin: 8px auto; transform: translateY(7px) rotate(45deg); } .publication-lightbox__close-button .second-line { width: 50px; height: 5px; background-color: #ffffff; display: block; margin: 8px auto; transform: translateY(-6px) rotate(-45deg); } .publication-lightbox__container { width: 50%; height: auto; display: flex; background: var(--footer-background); padding: 30px; max-height: 80vh; overflow-y: auto; box-sizing: border-box; } .publication-lightbox__image-box { min-width: 250px; height: auto; margin-right: 45px; } .publication-lightbox__image { width: 250px; height: auto; max-height: 500px; display: block; } .publication-lightbox__content { display: block; flex-direction: column; } .publication-lightbox__title { color: var(--default-font-color); font-size: 1.2em; line-height: 1.4em; font-weight: 600; } .publication-lightbox__price { color: var(--default-font-color); font-size: 1.1em; line-height: 1.4em; } .publication-lightbox__about { color: var(--default-font-color); font-size: 1em; line-height: 1.5em; margin: 30px 0; } .publication-lightbox__about p { margin: 0; } .publication-lightbox__description { color: var(--default-font-color); font-size: 1em; line-height: 1.5em; } .publication-lightbox__icons { display: flex; margin-top: 30px; } .publication-lightbox__shop { margin-right: 30px; } .publication-lightbox.publication-lightbox--friends-of-museum .publication-lightbox__container { display: flex; flex-direction: column; } .publication-lightbox.publication-lightbox--friends-of-museum .publication-lightbox__image-box { width: 50%; position: relative; } .publication-lightbox.publication-lightbox--friends-of-museum .publication-lightbox__image { width: 100%; } .publication-lightbox.publication-lightbox--friends-of-museum .publication-lightbox__title { width: calc(100% - 50px); margin-top: 20px; } .publication-lightbox.publication-lightbox--friends-of-museum .publication-lightbox__description { width: calc(100% - 50px); margin-top: 20px; overflow: auto !important; max-height: 170px; scrollbar-color: #00b3f0 #1d1d1d; scrollbar-width: thin; } .publication-lightbox.publication-lightbox--friends-of-museum .publication-lightbox__description::-webkit-scrollbar-track { -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3); background-color: #1d1d1d; } .publication-lightbox.publication-lightbox--friends-of-museum .publication-lightbox__description::-webkit-scrollbar { width: 6px; background-color: #1d1d1d; } .publication-lightbox.publication-lightbox--friends-of-museum .publication-lightbox__description::-webkit-scrollbar-thumb { background-color: #00b3f0; } .publication-lightbox.publication-lightbox--friends-of-museum .publication-lightbox__content { position: absolute; top: 50%; left: calc(100% - 30px); width: calc(100% - 50px); margin-top: 20px; } @media screen and (max-width: 1440px) { .publication-lightbox__container { width: 60%; } } @media screen and (max-width: 1050px) { .publication-lightbox__container { width: 75%; } } @media screen and (max-width: 800px) { .publication-lightbox { height: 100vh; overflow: scroll; } .publication-lightbox__container { position: absolute; width: 100%; padding: 60px 60px; } } @media screen and (max-width: 700px) { .publication-lightbox:not(.publication-lightbox--friends-of-museum) .publication-lightbox__container { flex-direction: column; align-items: center; } .publication-lightbox:not(.publication-lightbox--friends-of-museum) .publication-lightbox__image-box { margin-right: 0; margin-bottom: 30px; display: flex; justify-content: center; } } @media screen and (max-width: 767px) { .publication-lightbox.publication-lightbox--friends-of-museum { width: 100%; margin-right: 0; } .publication-lightbox.publication-lightbox--friends-of-museum .publication-lightbox__image-box { width: 100%; margin-right: 0; } .publication-lightbox.publication-lightbox--friends-of-museum .publication-lightbox__image { width: 200px; margin: 0 auto; } .publication-lightbox.publication-lightbox--friends-of-museum .publication-lightbox__title { width: 100%; } .publication-lightbox.publication-lightbox--friends-of-museum .publication-lightbox__description { width: 100%; } .publication-lightbox.publication-lightbox--friends-of-museum .publication-lightbox__content { position: relative; left: initial; top: initial; margin: 30px auto; display: block; text-align: center; } .publication-lightbox.publication-lightbox--friends-of-museum .publication-lightbox__content .publication-lightbox__image { width: auto; margin: 0 auto; } } @media screen and (max-width: 500px) { .publication-lightbox.publication-lightbox--friends-of-museum .publication-lightbox__container { padding: 30px 30px; } .publication-lightbox.publication-lightbox--friends-of-museum .publication-lightbox__image { width: auto; max-width: 100%; } .publication-lightbox.publication-lightbox--friends-of-museum .publication-lightbox__content .publication-lightbox__image { width: 100%; } }`; } connectedCallback() { let overlay = document.createElement('div'); overlay.classList.add('publication-lightbox'); this._closeClick = this._closeClick.bind(this); this._keyboard = this._keyboard.bind(this); this._overlayClick = this._overlayClick.bind(this); let closeButton = document.createElement('button'); closeButton.classList.add('publication-lightbox__close-button'); closeButton.setAttribute('aria-label', 'Zamknij modal'); closeButton.innerHTML = '
'; this.container.classList.add('publication-lightbox__container'); this.container.setAttribute('role', 'dialog'); this.container.setAttribute('aria-modal', true); this.container.setAttribute('aria-labelledby', this.labeledBy); overlay.append(closeButton); overlay.append(this.container); this.append(overlay); window.addEventListener('keyup', this._keyboard); overlay.addEventListener('click', this._overlayClick); closeButton.addEventListener('click', this._closeClick); } _closeClick(event) { event.preventDefault(); this._closeModal(); } _keyboard(event) { if (this.isOpen) { if (event.keyCode === 27) { this._closeModal(); } } } _overlayClick(event) { if (this.isOpen) { if (event.target.classList.contains('publication-lightbox')) { this._closeModal(); } } } _closeModal() { this.style.display = 'none'; document.body.style.overflow = 'auto'; } openModal() { document.body.style.overflow = 'hidden'; // document.body.append(this); this.style.display = 'block'; this.isOpen = true; } } let initElement = () => { customElements.define('nt-modal', ModalElement); }; /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ 'init': initElement }); /***/ }), /***/ "./sources/javascript/helpers/Prayer.js": /*!**********************************************!*\ !*** ./sources/javascript/helpers/Prayer.js ***! \**********************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); class Prayer extends HTMLElement { static get observedAttributes() { return ['data-author', 'data-date']; } constructor() { super(); let content = this.innerHTML; this.innerHTML = ''; this.classList.add('prayers-list__item'); this.prayerContent = document.createElement('div'); this.prayerContent.classList.add('prayers-list__item-content'); let author = document.createElement('div'); author.classList.add('prayers-list__item-author'); this.prayerAuthor = document.createElement('div'); this.prayerAuthor.classList.add('person'); this.prayerDate = document.createElement('div'); this.prayerDate.classList.add('date'); author.append(this.prayerAuthor); author.append(this.prayerDate); this.append(this.prayerContent); this.append(author); if (this.getAttribute('data-author') !== null) { this.prayerAuthor.innerText = this.getAttribute('data-author'); } if (this.getAttribute('data-date') !== null) { this.prayerDate.innerText = this.getAttribute('data-date'); } if (content !== '') { this.prayerContent.innerHTML = content; } } attributeChangedCallback(name, oldValue, newValue) { if (this.querySelector('.prayers-list__item-content') === null) { let content = this.innerHTML; this.innerHTML = ''; this.prayerContent = document.createElement('div'); this.prayerContent.classList.add('prayers-list__item-content'); let author = document.createElement('div'); author.classList.add('prayers-list__item-author'); this.prayerAuthor = document.createElement('div'); this.prayerAuthor.classList.add('person'); this.prayerDate = document.createElement('div'); this.prayerDate.classList.add('date'); author.append(this.prayerAuthor); author.append(this.prayerDate); this.append(this.prayerContent); this.append(author); if (content !== '') { this.prayerContent.innerHTML = content; } } if (this.getAttribute('data-author') !== null) { this.prayerAuthor.innerText = this.getAttribute('data-author'); } if (this.getAttribute('data-date') !== null) { this.prayerDate.innerText = this.getAttribute('data-date'); } } } let initElement = () => { customElements.define('netivo-prayer', Prayer); }; /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ 'init': initElement }); /***/ }), /***/ "./sources/javascript/helpers/PublicationLightbox.js": /*!***********************************************************!*\ !*** ./sources/javascript/helpers/PublicationLightbox.js ***! \***********************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _ModalElement__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ModalElement */ "./sources/javascript/helpers/ModalElement.js"); class PublicationLightbox extends _ModalElement__WEBPACK_IMPORTED_MODULE_0__.ModalElement { constructor() { super(); } connectedCallback() { super.connectedCallback(); this.loaderContainer = document.createElement('div'); this.loaderContainer.classList.add('publication-lightbox__loading'); this.loaderContainer.setAttribute('aria-label', 'Ładowanie informacji'); let loader = document.createElement('div'); loader.classList.add('loader'); let bounce1 = document.createElement('div'); let bounce2 = document.createElement('div'); bounce1.classList.add('double-bounce1'); bounce2.classList.add('double-bounce2'); loader.append(bounce1); loader.append(bounce2); this.loaderContainer.append(loader); this.container.append(this.loaderContainer); } showError(message) { let error_message = document.createElement('div'); error_message.classList.add('loader__error'); error_message.innerText = message; this.loaderContainer.innerHTML = ''; this.loaderContainer.append(error_message); } showPublication(data) { let image_cont = document.createElement('div'); image_cont.classList.add('publication-lightbox__image-box'); if (data.hasOwnProperty('_embedded')) { let image = document.createElement('img'); image.classList.add('publication-lightbox__image'); image.src = data['_embedded']['wp:featuredmedia'][0]['source_url']; image.setAttribute('alt', data['_embedded']['wp:featuredmedia'][0]['alt_text']); image_cont.append(image); } let data_content = document.createElement('div'); data_content.classList.add('publication-lightbox__content'); let title = document.createElement('div'); title.classList.add('publication-lightbox__title'); title.id = 'modal-id'; title.innerHTML = data.title.rendered; let price = document.createElement('div'); price.classList.add('publication-lightbox__price'); price.innerHTML = data.meta._price !== '' ? data.meta._price + 'PLN' : ''; let about = document.createElement('div'); about.classList.add('publication-lightbox__about'); if (data.meta.hasOwnProperty('_author') && data.meta._author !== '') { let author = document.createElement('p'); author.classList.add('author'); author.innerHTML = 'Autor: ' + data.meta._author; about.append(author); } if (data.meta.hasOwnProperty('_language') && data.meta._language !== '') { let language = document.createElement('p'); language.classList.add('language'); language.innerHTML = 'Jęzuk: ' + data.meta._language; about.append(language); } if (data.meta.hasOwnProperty('_pages') && data.meta._pages !== '') { let pages = document.createElement('p'); pages.classList.add('pages'); pages.innerHTML = 'Liczba stron: ' + data.meta._pages; about.append(pages); } if (data.meta.hasOwnProperty('_time') && data.meta._time !== '') { let time = document.createElement('p'); time.classList.add('time'); time.innerHTML = 'Długość: ' + data.meta._time; about.append(time); } if (data.meta.hasOwnProperty('_isbn') && data.meta._isbn !== '') { let isbn = document.createElement('p'); isbn.classList.add('isbn'); isbn.innerHTML = 'ISBN: ' + data.meta._isbn; about.append(isbn); } let description = document.createElement('div'); description.classList.add('publication-lightbox__description'); description.innerHTML = data.content.rendered; let icons = document.createElement('div'); icons.classList.add('publication-lightbox__icons'); if (data.meta.hasOwnProperty('_free') && data.meta._free !== '') { let pdf = document.createElement('a'); pdf.classList.add('publication-lightbox__pdf'); pdf.setAttribute('href', data.meta._free); pdf.setAttribute('aria-label', 'Pobierz PDF'); pdf.setAttribute('role', 'button'); let ico = document.createElement('img'); ico.classList.add('publication-lightbox__icon'); ico.src = '/wp-content/themes/stutthof/dist/images/pdf-icon.png'; ico.setAttribute('role', 'none'); pdf.append(ico); icons.append(pdf); } if (data.meta.hasOwnProperty('_price') && data.meta._price !== '') { let shop = document.createElement('a'); shop.classList.add('publication-lightbox__pdf'); shop.setAttribute('href', '/ksiegarnia'); shop.setAttribute('aria-label', 'Przejdź do księgarni'); shop.setAttribute('role', 'button'); let ico_s = document.createElement('img'); ico_s.classList.add('publication-lightbox__icon'); ico_s.src = '/wp-content/themes/stutthof/dist/images/book-icon.png'; ico_s.setAttribute('role', 'none'); shop.append(ico_s); icons.append(shop); } data_content.append(title); data_content.append(price); data_content.append(about); data_content.append(description); data_content.append(icons); this.container.append(image_cont); this.container.append(data_content); this.loaderContainer.remove(); } openModal() { super.openModal(); } } let initElement = () => { customElements.define('publication-lightbox', PublicationLightbox); }; /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ 'init': initElement }); /***/ }), /***/ "./sources/javascript/helpers/TimelineLesson.js": /*!******************************************************!*\ !*** ./sources/javascript/helpers/TimelineLesson.js ***! \******************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); class TimelineLesson extends HTMLElement { constructor() { super(); this._openModal = this._openModal.bind(this); let modalContent = this.querySelector('[data-element="modal-content"]'); if (modalContent !== null) { this.modalContent = modalContent.innerHTML; modalContent.remove(); } this.video = this.getAttribute('data-video'); this.genID = Math.random().toString(16).slice(2); this.modal = document.createElement('nt-modal'); let data_content = document.createElement('div'); data_content.classList.add('publication-lightbox__content'); data_content.innerHTML = this.modalContent; if (this.video !== null && this.video !== '') { let width = window.innerWidth / 2 - 60; console.log(window.innerWidth, width); if (window.innerWidth < 800) { width = window.innerWidth - 120; } else if (window.innerWidth < 1050) { width = window.innerWidth * 0.75 - 60; } else if (window.innerWidth < 1440) { width = window.innerWidth * 0.6 - 60; } console.log(width); let height = width / 16 * 9; let iframe = document.createElement('iframe'); iframe.src = 'https://www.youtube.com/embed/' + this.video; iframe.width = width + 'px'; iframe.height = height + 'px'; iframe.frameBorder = '0'; iframe.setAttribute('allowfullscreen', ''); data_content.append(iframe); } this.modal.container.append(data_content); this.modal.style.display = 'none'; this.modal.labeledBy = this.genID; this.id = this.genID; this.setAttribute('aria-haspopup', 'dialog'); document.body.append(this.modal); this.addEventListener('click', this._openModal); } _openModal(event) { event.preventDefault(); this.modal.openModal(); } } let initElement = () => { customElements.define('timeline-lesson', TimelineLesson); }; /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ 'init': initElement }); /***/ }), /***/ "./sources/javascript/publicationDetails.js": /*!**************************************************!*\ !*** ./sources/javascript/publicationDetails.js ***! \**************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); class publicationDetails { constructor(selector) { this.selector = selector; this.publicationID = this.selector.getAttribute('data-id'); this._showDetails = this._showDetails.bind(this); this.modal = this._openModal(); this.modal.style.display = 'none'; document.body.append(this.modal); if (this.publicationID !== '' && this.publicationID !== null) { this.selector.addEventListener('click', this._showDetails); } } _showDetails(event) { event.preventDefault(); this.modal.openModal(); this._getPublicationData().then(data => { this.modal.showPublication(data); }).catch(error => { this.modal.showError(error); }); } _openModal() { let modal = document.createElement('publication-lightbox'); return modal; } _getPublicationData() { let url = '/wp-json/wp/v2/publication/' + this.publicationID + '?_embed'; return fetch(url, { method: 'GET', cache: 'no-cache', credentials: "same-origin", redirect: "follow", headers: { 'Content-Type': 'application/json' } }).then(response => { if (!response.ok) { return response.json().then(function (response) { throw Error(response.code); }); } else { return response.json(); } }); } } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (publicationDetails); /***/ }), /***/ "./sources/javascript/quantityInput.js": /*!*********************************************!*\ !*** ./sources/javascript/quantityInput.js ***! \*********************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var js_cookie__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! js-cookie */ "./node_modules/js-cookie/dist/js.cookie.mjs"); class quantityInput { constructor(selector) { this.selector = selector; this.id = this.selector.getAttribute('data-id'); this.decrease = this.decrease.bind(this); this.increase = this.increase.bind(this); this.changeInput = this.changeInput.bind(this); this.decreaseElement = this.selector.querySelector('[data-element="decrease"]'); this.increaseElement = this.selector.querySelector('[data-element="increase"]'); this.countElement = this.selector.querySelector('[data-element="count"]'); this.decreaseElement.addEventListener('click', this.decrease); this.increaseElement.addEventListener('click', this.increase); this.countElement.addEventListener('change', this.changeInput); } decrease(event) { event.preventDefault(); let value = this.countElement.value; value--; if (value < 0) value = 0; this.countElement.value = value; this.countElement.dispatchEvent(new Event('change')); } increase(event) { event.preventDefault(); let value = this.countElement.value; value++; this.countElement.value = value; this.countElement.dispatchEvent(new Event('change')); } changeInput(event) { this.cart = js_cookie__WEBPACK_IMPORTED_MODULE_0__["default"].get('nt_cart'); let cart = {}; if (typeof this.cart !== 'undefined') { cart = JSON.parse(this.cart); } if (parseInt(event.target.value) === 0 && cart.hasOwnProperty(this.id)) { delete cart[this.id]; } else { cart[this.id] = event.target.value; } this.cart = JSON.stringify(cart); console.log(this.cart); js_cookie__WEBPACK_IMPORTED_MODULE_0__["default"].set('nt_cart', this.cart, { SameSite: 'lax' }); } } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (quantityInput); /***/ }), /***/ "./sources/javascript/timeline.js": /*!****************************************!*\ !*** ./sources/javascript/timeline.js ***! \****************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); class Timeline { constructor(selector) { this.selector = selector; this.items = this.selector.querySelectorAll('[data-timeline-item]'); this._showContent = this._showContent.bind(this); this.sides = this.selector.getAttribute('data-sides'); let width = this.selector.offsetWidth; if (this.sides) { this.items.forEach(item => { let content = item.querySelector('[data-timeline-content]'); content.style.width = width / 2 - 140 + 'px'; }); } else { this.items.forEach(item => { let content = item.querySelector('[data-timeline-content]'); console.log(width, content); content.style.width = width - 240 + 'px'; let opener = item.querySelector('[data-opener]'); opener.addEventListener('click', this._showContent); }); } } _showContent(event) { event.preventDefault(); this.items.forEach(item => { let content = item.querySelector('[data-timeline-content]'); let opener = item.querySelector('[data-opener]'); let dots = item.querySelector('[data-dots]'); content.style.display = 'none'; dots.style.display = 'none'; opener.classList.remove('active'); }); let current = event.target.closest('[data-timeline-item]'); let c_content = current.querySelector('[data-timeline-content]'); let c_opener = current.querySelector('[data-opener]'); let c_dots = current.querySelector('[data-dots]'); c_content.style.display = 'block'; c_opener.classList.add('active'); c_dots.style.display = 'flex'; } } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Timeline); /***/ }), /***/ "./sources/javascript/wai.js": /*!***********************************!*\ !*** ./sources/javascript/wai.js ***! \***********************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var js_cookie__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! js-cookie */ "./node_modules/js-cookie/dist/js.cookie.mjs"); class Wai { constructor(element) { this.element = element; let font = document.body.style.getPropertyValue('--default-font-size'); if (font === '') { font = js_cookie__WEBPACK_IMPORTED_MODULE_0__["default"].get('nt_font_size'); } if (typeof font === 'undefined') font = '16px'; this.fontSize = parseInt(font); this.contrast = null; this.defaultFont = parseInt(getComputedStyle(document.documentElement).getPropertyValue('--default-font-size')); this.fontIncrease = this.element.querySelector('[data-element="font-increase"]'); this.fontDefault = this.element.querySelector('[data-element="font-default"]'); this.fontDescrease = this.element.querySelector('[data-element="font-decrease"]'); this.contrastDefault = this.element.querySelector('[data-element="contrast-default"]'); this.contrastHigh = this.element.querySelector('[data-element="contrast-high"]'); this.contrastNegative = this.element.querySelector('[data-element="contrast-negative"]'); this.setDefaultFont = this.setDefaultFont.bind(this); this.decreaseFont = this.decreaseFont.bind(this); this.increaseFont = this.increaseFont.bind(this); this.setDefaultContrast = this.setDefaultContrast.bind(this); this.setHighContrast = this.setHighContrast.bind(this); this.setNegativeContrast = this.setNegativeContrast.bind(this); this.fontDefault.addEventListener('click', this.setDefaultFont); this.fontIncrease.addEventListener('click', this.increaseFont); this.fontDescrease.addEventListener('click', this.decreaseFont); this.contrastDefault.addEventListener('click', this.setDefaultContrast); this.contrastHigh.addEventListener('click', this.setHighContrast); this.contrastNegative.addEventListener('click', this.setNegativeContrast); } setDefaultFont(event) { event.preventDefault(); document.body.style.removeProperty('--default-font-size'); js_cookie__WEBPACK_IMPORTED_MODULE_0__["default"].remove('nt_font_size', { path: '/' }); this.fontSize = null; } increaseFont(event) { event.preventDefault(); if (this.fontSize == null) this.fontSize = this.defaultFont; if (this.fontSize < 22) { this.fontSize++; document.body.style.setProperty('--default-font-size', this.fontSize + 'px'); js_cookie__WEBPACK_IMPORTED_MODULE_0__["default"].set('nt_font_size', this.fontSize + 'px', { SameSite: 'lax' }); } } decreaseFont(event) { event.preventDefault(); if (this.fontSize == null) this.fontSize = this.defaultFont; if (this.fontSize > 12) { this.fontSize--; document.body.style.setProperty('--default-font-size', this.fontSize + 'px'); js_cookie__WEBPACK_IMPORTED_MODULE_0__["default"].set('nt_font_size', this.fontSize + 'px', { SameSite: 'lax' }); } } setDefaultContrast(event) { event.preventDefault(); js_cookie__WEBPACK_IMPORTED_MODULE_0__["default"].remove('nt_contrast'); document.body.style.removeProperty('--main-background'); document.body.style.removeProperty('--footer-background'); document.body.style.removeProperty('--default-font-color'); document.body.style.removeProperty('--header-text-color'); document.body.style.removeProperty('--footer-text-color'); //@todo remove body props this.contrast = null; } setHighContrast(event) { event.preventDefault(); if (this.contrast !== 'high') { this.contrast = 'high'; //@todo set body props js_cookie__WEBPACK_IMPORTED_MODULE_0__["default"].set('nt_contrast', 'high', { SameSite: 'lax' }); } } setNegativeContrast(event) { event.preventDefault(); if (this.contrast !== 'negative') { this.contrast = 'negative'; document.body.style.setProperty('--main-background', '#000000'); document.body.style.setProperty('--footer-background', '#000000'); document.body.style.setProperty('--default-font-color', '#ffff00'); document.body.style.setProperty('--header-text-color', '#ffff00'); document.body.style.setProperty('--footer-text-color', '#ffff00'); document.body.style.setProperty('--hyperlink-hover-color', '#ffff00'); //@todo set body props js_cookie__WEBPACK_IMPORTED_MODULE_0__["default"].set('nt_contrast', 'negative', { SameSite: 'lax' }); } } } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Wai); /***/ }), /***/ "./node_modules/@netivo/base-scripts/index.js": /*!****************************************************!*\ !*** ./node_modules/@netivo/base-scripts/index.js ***! \****************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ Form: () => (/* reexport safe */ _javascript_form__WEBPACK_IMPORTED_MODULE_1__["default"]), /* harmony export */ extend: () => (/* reexport safe */ _javascript_extend__WEBPACK_IMPORTED_MODULE_2__["default"]), /* harmony export */ initMap: () => (/* reexport safe */ _javascript_map__WEBPACK_IMPORTED_MODULE_0__["default"]) /* harmony export */ }); /* harmony import */ var _javascript_map__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./javascript/map */ "./node_modules/@netivo/base-scripts/javascript/map.js"); /* harmony import */ var _javascript_form__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./javascript/form */ "./node_modules/@netivo/base-scripts/javascript/form.js"); /* harmony import */ var _javascript_extend__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./javascript/extend */ "./node_modules/@netivo/base-scripts/javascript/extend.js"); /***/ }), /***/ "./node_modules/@netivo/base-scripts/javascript/extend.js": /*!****************************************************************!*\ !*** ./node_modules/@netivo/base-scripts/javascript/extend.js ***! \****************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); const extend = function () { let extended = {}; let deep = false; let i = 0; let length = arguments.length; if ( Object.prototype.toString.call( arguments[0] ) === '[object Boolean]' ) { deep = arguments[0]; i++; } let merge = function (obj) { for ( let prop in obj ) { if ( Object.prototype.hasOwnProperty.call( obj, prop ) ) { if ( deep && Object.prototype.toString.call(obj[prop]) === '[object Object]' ) { extended[prop] = extend( true, extended[prop], obj[prop] ); } else { extended[prop] = obj[prop]; } } } }; for ( ; i < length; i++ ) { let obj = arguments[i]; merge(obj); } return extended; }; /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (extend); /***/ }), /***/ "./node_modules/@netivo/base-scripts/javascript/form.js": /*!**************************************************************!*\ !*** ./node_modules/@netivo/base-scripts/javascript/form.js ***! \**************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _extend__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./extend */ "./node_modules/@netivo/base-scripts/javascript/extend.js"); let defaultOptions = { handler: null, action: '', data: form => { return new Promise((resolve, reject) => { resolve({}); }); }, beforeSubmit: form => { return true; }, success: (form, response) => {}, error: (form, error) => {} } class Form { constructor(selector, options) { this.options = (0,_extend__WEBPACK_IMPORTED_MODULE_0__["default"])(defaultOptions, options); this.selector = selector; this._submitForm = this._submitForm.bind(this); this.selector.addEventListener('submit', this._submitForm); } _submitForm(event){ if(typeof event !== 'undefined') event.preventDefault(); let cont = this.options.beforeSubmit(this.selector); if(cont) { this.options.data(this.selector).then(data => { this._sendForm(this.options.action, data) .then(response => { this.options.success(this.selector, response); }) .catch(error => { this.options.error(this.selector, error); }) }).catch(error => { this.options.error(this.selector, error); }); } } _sendForm(url, data) { let formBody = Object.keys(data).map(key => { if (typeof data[key] === "object" && !Array.isArray(data[key]) && data[key] !== null) { return Object.keys(data[key]).map(k => { return key + '[' + k + ']=' + data[key][k]; }).join('&'); } return key + '=' + data[key] }).join('&'); return fetch(url, { method: 'POST', cache: 'no-cache', credentials: "same-origin", redirect: "follow", headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, body: formBody }).then(response => { if (!response.ok) { return response.json().then(function(response) { throw Error(response.message); }) } else { return response.json(); } }); } } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Form); /***/ }), /***/ "./node_modules/@netivo/base-scripts/javascript/map.js": /*!*************************************************************!*\ !*** ./node_modules/@netivo/base-scripts/javascript/map.js ***! \*************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); const initMap = function() { const preparePoints = (mapElement) => { let lat = ('lat' in mapElement.dataset) ? mapElement.dataset.lat.split(';') : null; let lng = ('lng' in mapElement.dataset) ? mapElement.dataset.lng.split(';') : null; if(lat.length === lng.length){ let zoom = (isNaN(parseInt(mapElement.dataset.zoom))) ? 14 : parseInt(mapElement.dataset.zoom); let title = ('title' in mapElement.dataset) ? mapElement.dataset.title.split(';') : null; let content = ('content' in mapElement.dataset) ? mapElement.dataset.content.split(';') : null; let markerIcon = ('marker' in mapElement.dataset) ? mapElement.dataset.marker.split(';') : null; let data = { zoom: zoom, points: [] }; lat.forEach((p1, i) => { let tmp = { lat: parseFloat(p1), lng: parseFloat(lng[i]) }; if(title !== null) { if (i in title) { tmp.title = title[i]; } } if(content !== null) { if (i in content) { tmp.content = content[i]; } } if(markerIcon !== null) { if (i in markerIcon) { tmp.marker = markerIcon[i]; } else tmp.marker = markerIcon[0]; } data.points.push(tmp); }); return data; } return null; } const getMapCenter = (points) =>{ let center = { lat: 0, lng: 0 }; points.forEach(point => { center.lat += point.lat; center.lng += point.lng; }); center.lat = center.lat/points.length; center.lng = center.lng/points.length; return center; } let maps = document.querySelectorAll('.js-map'); if(maps.length > 0){ maps.forEach(mapElement => { let mapPoints = preparePoints(mapElement); if(mapPoints !== null){ let mapOptions = { center: getMapCenter(mapPoints.points), zoom: mapPoints.zoom, scrollwheel: false, scaleControl: false, disableDefaultUI: false, } let map = new google.maps.Map(mapElement, mapOptions); mapPoints.points.forEach(point => { let markerOptions = { position: {lat: point.lat, lng: point.lng}, map: map }; if('marker' in point){ markerOptions.icon = point.marker; } if('title' in point){ markerOptions.title = point.title; } let marker = new google.maps.Marker(markerOptions); if('content' in point){ let infoWindow = new google.maps.InfoWindow({ content: point.content }); marker.addListener('click', () => { infoWindow.open(map, marker); }); } }); } else { console.log('Niezgodna ilość punktów do naniesienia na mapę.'); mapElement.innerHTML = "

Przepraszamy, nie możemy wyświetlić mapy

"; } }); } }; /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (initMap); /***/ }), /***/ "./node_modules/@splidejs/splide/dist/js/splide.esm.js": /*!*************************************************************!*\ !*** ./node_modules/@splidejs/splide/dist/js/splide.esm.js ***! \*************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CLASSES: () => (/* binding */ CLASSES), /* harmony export */ CLASS_ACTIVE: () => (/* binding */ CLASS_ACTIVE), /* harmony export */ CLASS_ARROW: () => (/* binding */ CLASS_ARROW), /* harmony export */ CLASS_ARROWS: () => (/* binding */ CLASS_ARROWS), /* harmony export */ CLASS_ARROW_NEXT: () => (/* binding */ CLASS_ARROW_NEXT), /* harmony export */ CLASS_ARROW_PREV: () => (/* binding */ CLASS_ARROW_PREV), /* harmony export */ CLASS_CLONE: () => (/* binding */ CLASS_CLONE), /* harmony export */ CLASS_CONTAINER: () => (/* binding */ CLASS_CONTAINER), /* harmony export */ CLASS_FOCUS_IN: () => (/* binding */ CLASS_FOCUS_IN), /* harmony export */ CLASS_INITIALIZED: () => (/* binding */ CLASS_INITIALIZED), /* harmony export */ CLASS_LIST: () => (/* binding */ CLASS_LIST), /* harmony export */ CLASS_LOADING: () => (/* binding */ CLASS_LOADING), /* harmony export */ CLASS_NEXT: () => (/* binding */ CLASS_NEXT), /* harmony export */ CLASS_OVERFLOW: () => (/* binding */ CLASS_OVERFLOW), /* harmony export */ CLASS_PAGINATION: () => (/* binding */ CLASS_PAGINATION), /* harmony export */ CLASS_PAGINATION_PAGE: () => (/* binding */ CLASS_PAGINATION_PAGE), /* harmony export */ CLASS_PREV: () => (/* binding */ CLASS_PREV), /* harmony export */ CLASS_PROGRESS: () => (/* binding */ CLASS_PROGRESS), /* harmony export */ CLASS_PROGRESS_BAR: () => (/* binding */ CLASS_PROGRESS_BAR), /* harmony export */ CLASS_ROOT: () => (/* binding */ CLASS_ROOT), /* harmony export */ CLASS_SLIDE: () => (/* binding */ CLASS_SLIDE), /* harmony export */ CLASS_SPINNER: () => (/* binding */ CLASS_SPINNER), /* harmony export */ CLASS_SR: () => (/* binding */ CLASS_SR), /* harmony export */ CLASS_TOGGLE: () => (/* binding */ CLASS_TOGGLE), /* harmony export */ CLASS_TOGGLE_PAUSE: () => (/* binding */ CLASS_TOGGLE_PAUSE), /* harmony export */ CLASS_TOGGLE_PLAY: () => (/* binding */ CLASS_TOGGLE_PLAY), /* harmony export */ CLASS_TRACK: () => (/* binding */ CLASS_TRACK), /* harmony export */ CLASS_VISIBLE: () => (/* binding */ CLASS_VISIBLE), /* harmony export */ DEFAULTS: () => (/* binding */ DEFAULTS), /* harmony export */ EVENT_ACTIVE: () => (/* binding */ EVENT_ACTIVE), /* harmony export */ EVENT_ARROWS_MOUNTED: () => (/* binding */ EVENT_ARROWS_MOUNTED), /* harmony export */ EVENT_ARROWS_UPDATED: () => (/* binding */ EVENT_ARROWS_UPDATED), /* harmony export */ EVENT_AUTOPLAY_PAUSE: () => (/* binding */ EVENT_AUTOPLAY_PAUSE), /* harmony export */ EVENT_AUTOPLAY_PLAY: () => (/* binding */ EVENT_AUTOPLAY_PLAY), /* harmony export */ EVENT_AUTOPLAY_PLAYING: () => (/* binding */ EVENT_AUTOPLAY_PLAYING), /* harmony export */ EVENT_CLICK: () => (/* binding */ EVENT_CLICK), /* harmony export */ EVENT_DESTROY: () => (/* binding */ EVENT_DESTROY), /* harmony export */ EVENT_DRAG: () => (/* binding */ EVENT_DRAG), /* harmony export */ EVENT_DRAGGED: () => (/* binding */ EVENT_DRAGGED), /* harmony export */ EVENT_DRAGGING: () => (/* binding */ EVENT_DRAGGING), /* harmony export */ EVENT_END_INDEX_CHANGED: () => (/* binding */ EVENT_END_INDEX_CHANGED), /* harmony export */ EVENT_HIDDEN: () => (/* binding */ EVENT_HIDDEN), /* harmony export */ EVENT_INACTIVE: () => (/* binding */ EVENT_INACTIVE), /* harmony export */ EVENT_LAZYLOAD_LOADED: () => (/* binding */ EVENT_LAZYLOAD_LOADED), /* harmony export */ EVENT_MOUNTED: () => (/* binding */ EVENT_MOUNTED), /* harmony export */ EVENT_MOVE: () => (/* binding */ EVENT_MOVE), /* harmony export */ EVENT_MOVED: () => (/* binding */ EVENT_MOVED), /* harmony export */ EVENT_NAVIGATION_MOUNTED: () => (/* binding */ EVENT_NAVIGATION_MOUNTED), /* harmony export */ EVENT_OVERFLOW: () => (/* binding */ EVENT_OVERFLOW), /* harmony export */ EVENT_PAGINATION_MOUNTED: () => (/* binding */ EVENT_PAGINATION_MOUNTED), /* harmony export */ EVENT_PAGINATION_UPDATED: () => (/* binding */ EVENT_PAGINATION_UPDATED), /* harmony export */ EVENT_READY: () => (/* binding */ EVENT_READY), /* harmony export */ EVENT_REFRESH: () => (/* binding */ EVENT_REFRESH), /* harmony export */ EVENT_RESIZE: () => (/* binding */ EVENT_RESIZE), /* harmony export */ EVENT_RESIZED: () => (/* binding */ EVENT_RESIZED), /* harmony export */ EVENT_SCROLL: () => (/* binding */ EVENT_SCROLL), /* harmony export */ EVENT_SCROLLED: () => (/* binding */ EVENT_SCROLLED), /* harmony export */ EVENT_SHIFTED: () => (/* binding */ EVENT_SHIFTED), /* harmony export */ EVENT_SLIDE_KEYDOWN: () => (/* binding */ EVENT_SLIDE_KEYDOWN), /* harmony export */ EVENT_UPDATED: () => (/* binding */ EVENT_UPDATED), /* harmony export */ EVENT_VISIBLE: () => (/* binding */ EVENT_VISIBLE), /* harmony export */ EventBinder: () => (/* binding */ EventBinder), /* harmony export */ EventInterface: () => (/* binding */ EventInterface), /* harmony export */ FADE: () => (/* binding */ FADE), /* harmony export */ LOOP: () => (/* binding */ LOOP), /* harmony export */ LTR: () => (/* binding */ LTR), /* harmony export */ RTL: () => (/* binding */ RTL), /* harmony export */ RequestInterval: () => (/* binding */ RequestInterval), /* harmony export */ SLIDE: () => (/* binding */ SLIDE), /* harmony export */ STATUS_CLASSES: () => (/* binding */ STATUS_CLASSES), /* harmony export */ Splide: () => (/* binding */ Splide), /* harmony export */ SplideRenderer: () => (/* binding */ SplideRenderer), /* harmony export */ State: () => (/* binding */ State), /* harmony export */ TTB: () => (/* binding */ TTB), /* harmony export */ Throttle: () => (/* binding */ Throttle), /* harmony export */ "default": () => (/* binding */ Splide) /* harmony export */ }); function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } /*! * Splide.js * Version : 4.1.4 * License : MIT * Copyright: 2022 Naotoshi Fujita */ var MEDIA_PREFERS_REDUCED_MOTION = "(prefers-reduced-motion: reduce)"; var CREATED = 1; var MOUNTED = 2; var IDLE = 3; var MOVING = 4; var SCROLLING = 5; var DRAGGING = 6; var DESTROYED = 7; var STATES = { CREATED: CREATED, MOUNTED: MOUNTED, IDLE: IDLE, MOVING: MOVING, SCROLLING: SCROLLING, DRAGGING: DRAGGING, DESTROYED: DESTROYED }; function empty(array) { array.length = 0; } function slice(arrayLike, start, end) { return Array.prototype.slice.call(arrayLike, start, end); } function apply(func) { return func.bind.apply(func, [null].concat(slice(arguments, 1))); } var nextTick = setTimeout; var noop = function noop() {}; function raf(func) { return requestAnimationFrame(func); } function typeOf(type, subject) { return typeof subject === type; } function isObject(subject) { return !isNull(subject) && typeOf("object", subject); } var isArray = Array.isArray; var isFunction = apply(typeOf, "function"); var isString = apply(typeOf, "string"); var isUndefined = apply(typeOf, "undefined"); function isNull(subject) { return subject === null; } function isHTMLElement(subject) { try { return subject instanceof (subject.ownerDocument.defaultView || window).HTMLElement; } catch (e) { return false; } } function toArray(value) { return isArray(value) ? value : [value]; } function forEach(values, iteratee) { toArray(values).forEach(iteratee); } function includes(array, value) { return array.indexOf(value) > -1; } function push(array, items) { array.push.apply(array, toArray(items)); return array; } function toggleClass(elm, classes, add) { if (elm) { forEach(classes, function (name) { if (name) { elm.classList[add ? "add" : "remove"](name); } }); } } function addClass(elm, classes) { toggleClass(elm, isString(classes) ? classes.split(" ") : classes, true); } function append(parent, children) { forEach(children, parent.appendChild.bind(parent)); } function before(nodes, ref) { forEach(nodes, function (node) { var parent = (ref || node).parentNode; if (parent) { parent.insertBefore(node, ref); } }); } function matches(elm, selector) { return isHTMLElement(elm) && (elm["msMatchesSelector"] || elm.matches).call(elm, selector); } function children(parent, selector) { var children2 = parent ? slice(parent.children) : []; return selector ? children2.filter(function (child) { return matches(child, selector); }) : children2; } function child(parent, selector) { return selector ? children(parent, selector)[0] : parent.firstElementChild; } var ownKeys = Object.keys; function forOwn(object, iteratee, right) { if (object) { (right ? ownKeys(object).reverse() : ownKeys(object)).forEach(function (key) { key !== "__proto__" && iteratee(object[key], key); }); } return object; } function assign(object) { slice(arguments, 1).forEach(function (source) { forOwn(source, function (value, key) { object[key] = source[key]; }); }); return object; } function merge(object) { slice(arguments, 1).forEach(function (source) { forOwn(source, function (value, key) { if (isArray(value)) { object[key] = value.slice(); } else if (isObject(value)) { object[key] = merge({}, isObject(object[key]) ? object[key] : {}, value); } else { object[key] = value; } }); }); return object; } function omit(object, keys) { forEach(keys || ownKeys(object), function (key) { delete object[key]; }); } function removeAttribute(elms, attrs) { forEach(elms, function (elm) { forEach(attrs, function (attr) { elm && elm.removeAttribute(attr); }); }); } function setAttribute(elms, attrs, value) { if (isObject(attrs)) { forOwn(attrs, function (value2, name) { setAttribute(elms, name, value2); }); } else { forEach(elms, function (elm) { isNull(value) || value === "" ? removeAttribute(elm, attrs) : elm.setAttribute(attrs, String(value)); }); } } function create(tag, attrs, parent) { var elm = document.createElement(tag); if (attrs) { isString(attrs) ? addClass(elm, attrs) : setAttribute(elm, attrs); } parent && append(parent, elm); return elm; } function style(elm, prop, value) { if (isUndefined(value)) { return getComputedStyle(elm)[prop]; } if (!isNull(value)) { elm.style[prop] = "" + value; } } function display(elm, display2) { style(elm, "display", display2); } function focus(elm) { elm["setActive"] && elm["setActive"]() || elm.focus({ preventScroll: true }); } function getAttribute(elm, attr) { return elm.getAttribute(attr); } function hasClass(elm, className) { return elm && elm.classList.contains(className); } function rect(target) { return target.getBoundingClientRect(); } function remove(nodes) { forEach(nodes, function (node) { if (node && node.parentNode) { node.parentNode.removeChild(node); } }); } function parseHtml(html) { return child(new DOMParser().parseFromString(html, "text/html").body); } function prevent(e, stopPropagation) { e.preventDefault(); if (stopPropagation) { e.stopPropagation(); e.stopImmediatePropagation(); } } function query(parent, selector) { return parent && parent.querySelector(selector); } function queryAll(parent, selector) { return selector ? slice(parent.querySelectorAll(selector)) : []; } function removeClass(elm, classes) { toggleClass(elm, classes, false); } function timeOf(e) { return e.timeStamp; } function unit(value) { return isString(value) ? value : value ? value + "px" : ""; } var PROJECT_CODE = "splide"; var DATA_ATTRIBUTE = "data-" + PROJECT_CODE; function assert(condition, message) { if (!condition) { throw new Error("[" + PROJECT_CODE + "] " + (message || "")); } } var min = Math.min, max = Math.max, floor = Math.floor, ceil = Math.ceil, abs = Math.abs; function approximatelyEqual(x, y, epsilon) { return abs(x - y) < epsilon; } function between(number, x, y, exclusive) { var minimum = min(x, y); var maximum = max(x, y); return exclusive ? minimum < number && number < maximum : minimum <= number && number <= maximum; } function clamp(number, x, y) { var minimum = min(x, y); var maximum = max(x, y); return min(max(minimum, number), maximum); } function sign(x) { return +(x > 0) - +(x < 0); } function camelToKebab(string) { return string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(); } function format(string, replacements) { forEach(replacements, function (replacement) { string = string.replace("%s", "" + replacement); }); return string; } function pad(number) { return number < 10 ? "0" + number : "" + number; } var ids = {}; function uniqueId(prefix) { return "" + prefix + pad(ids[prefix] = (ids[prefix] || 0) + 1); } function EventBinder() { var listeners = []; function bind(targets, events, callback, options) { forEachEvent(targets, events, function (target, event, namespace) { var isEventTarget = ("addEventListener" in target); var remover = isEventTarget ? target.removeEventListener.bind(target, event, callback, options) : target["removeListener"].bind(target, callback); isEventTarget ? target.addEventListener(event, callback, options) : target["addListener"](callback); listeners.push([target, event, namespace, callback, remover]); }); } function unbind(targets, events, callback) { forEachEvent(targets, events, function (target, event, namespace) { listeners = listeners.filter(function (listener) { if (listener[0] === target && listener[1] === event && listener[2] === namespace && (!callback || listener[3] === callback)) { listener[4](); return false; } return true; }); }); } function dispatch(target, type, detail) { var e; var bubbles = true; if (typeof CustomEvent === "function") { e = new CustomEvent(type, { bubbles: bubbles, detail: detail }); } else { e = document.createEvent("CustomEvent"); e.initCustomEvent(type, bubbles, false, detail); } target.dispatchEvent(e); return e; } function forEachEvent(targets, events, iteratee) { forEach(targets, function (target) { target && forEach(events, function (events2) { events2.split(" ").forEach(function (eventNS) { var fragment = eventNS.split("."); iteratee(target, fragment[0], fragment[1]); }); }); }); } function destroy() { listeners.forEach(function (data) { data[4](); }); empty(listeners); } return { bind: bind, unbind: unbind, dispatch: dispatch, destroy: destroy }; } var EVENT_MOUNTED = "mounted"; var EVENT_READY = "ready"; var EVENT_MOVE = "move"; var EVENT_MOVED = "moved"; var EVENT_CLICK = "click"; var EVENT_ACTIVE = "active"; var EVENT_INACTIVE = "inactive"; var EVENT_VISIBLE = "visible"; var EVENT_HIDDEN = "hidden"; var EVENT_REFRESH = "refresh"; var EVENT_UPDATED = "updated"; var EVENT_RESIZE = "resize"; var EVENT_RESIZED = "resized"; var EVENT_DRAG = "drag"; var EVENT_DRAGGING = "dragging"; var EVENT_DRAGGED = "dragged"; var EVENT_SCROLL = "scroll"; var EVENT_SCROLLED = "scrolled"; var EVENT_OVERFLOW = "overflow"; var EVENT_DESTROY = "destroy"; var EVENT_ARROWS_MOUNTED = "arrows:mounted"; var EVENT_ARROWS_UPDATED = "arrows:updated"; var EVENT_PAGINATION_MOUNTED = "pagination:mounted"; var EVENT_PAGINATION_UPDATED = "pagination:updated"; var EVENT_NAVIGATION_MOUNTED = "navigation:mounted"; var EVENT_AUTOPLAY_PLAY = "autoplay:play"; var EVENT_AUTOPLAY_PLAYING = "autoplay:playing"; var EVENT_AUTOPLAY_PAUSE = "autoplay:pause"; var EVENT_LAZYLOAD_LOADED = "lazyload:loaded"; var EVENT_SLIDE_KEYDOWN = "sk"; var EVENT_SHIFTED = "sh"; var EVENT_END_INDEX_CHANGED = "ei"; function EventInterface(Splide2) { var bus = Splide2 ? Splide2.event.bus : document.createDocumentFragment(); var binder = EventBinder(); function on(events, callback) { binder.bind(bus, toArray(events).join(" "), function (e) { callback.apply(callback, isArray(e.detail) ? e.detail : []); }); } function emit(event) { binder.dispatch(bus, event, slice(arguments, 1)); } if (Splide2) { Splide2.event.on(EVENT_DESTROY, binder.destroy); } return assign(binder, { bus: bus, on: on, off: apply(binder.unbind, bus), emit: emit }); } function RequestInterval(interval, onInterval, onUpdate, limit) { var now = Date.now; var startTime; var rate = 0; var id; var paused = true; var count = 0; function update() { if (!paused) { rate = interval ? min((now() - startTime) / interval, 1) : 1; onUpdate && onUpdate(rate); if (rate >= 1) { onInterval(); startTime = now(); if (limit && ++count >= limit) { return pause(); } } id = raf(update); } } function start(resume) { resume || cancel(); startTime = now() - (resume ? rate * interval : 0); paused = false; id = raf(update); } function pause() { paused = true; } function rewind() { startTime = now(); rate = 0; if (onUpdate) { onUpdate(rate); } } function cancel() { id && cancelAnimationFrame(id); rate = 0; id = 0; paused = true; } function set(time) { interval = time; } function isPaused() { return paused; } return { start: start, rewind: rewind, pause: pause, cancel: cancel, set: set, isPaused: isPaused }; } function State(initialState) { var state = initialState; function set(value) { state = value; } function is(states) { return includes(toArray(states), state); } return { set: set, is: is }; } function Throttle(func, duration) { var interval = RequestInterval(duration || 0, func, null, 1); return function () { interval.isPaused() && interval.start(); }; } function Media(Splide2, Components2, options) { var state = Splide2.state; var breakpoints = options.breakpoints || {}; var reducedMotion = options.reducedMotion || {}; var binder = EventBinder(); var queries = []; function setup() { var isMin = options.mediaQuery === "min"; ownKeys(breakpoints).sort(function (n, m) { return isMin ? +n - +m : +m - +n; }).forEach(function (key) { register(breakpoints[key], "(" + (isMin ? "min" : "max") + "-width:" + key + "px)"); }); register(reducedMotion, MEDIA_PREFERS_REDUCED_MOTION); update(); } function destroy(completely) { if (completely) { binder.destroy(); } } function register(options2, query) { var queryList = matchMedia(query); binder.bind(queryList, "change", update); queries.push([options2, queryList]); } function update() { var destroyed = state.is(DESTROYED); var direction = options.direction; var merged = queries.reduce(function (merged2, entry) { return merge(merged2, entry[1].matches ? entry[0] : {}); }, {}); omit(options); set(merged); if (options.destroy) { Splide2.destroy(options.destroy === "completely"); } else if (destroyed) { destroy(true); Splide2.mount(); } else { direction !== options.direction && Splide2.refresh(); } } function reduce(enable) { if (matchMedia(MEDIA_PREFERS_REDUCED_MOTION).matches) { enable ? merge(options, reducedMotion) : omit(options, ownKeys(reducedMotion)); } } function set(opts, base, notify) { merge(options, opts); base && merge(Object.getPrototypeOf(options), opts); if (notify || !state.is(CREATED)) { Splide2.emit(EVENT_UPDATED, options); } } return { setup: setup, destroy: destroy, reduce: reduce, set: set }; } var ARROW = "Arrow"; var ARROW_LEFT = ARROW + "Left"; var ARROW_RIGHT = ARROW + "Right"; var ARROW_UP = ARROW + "Up"; var ARROW_DOWN = ARROW + "Down"; var LTR = "ltr"; var RTL = "rtl"; var TTB = "ttb"; var ORIENTATION_MAP = { width: ["height"], left: ["top", "right"], right: ["bottom", "left"], x: ["y"], X: ["Y"], Y: ["X"], ArrowLeft: [ARROW_UP, ARROW_RIGHT], ArrowRight: [ARROW_DOWN, ARROW_LEFT] }; function Direction(Splide2, Components2, options) { function resolve(prop, axisOnly, direction) { direction = direction || options.direction; var index = direction === RTL && !axisOnly ? 1 : direction === TTB ? 0 : -1; return ORIENTATION_MAP[prop] && ORIENTATION_MAP[prop][index] || prop.replace(/width|left|right/i, function (match, offset) { var replacement = ORIENTATION_MAP[match.toLowerCase()][index] || match; return offset > 0 ? replacement.charAt(0).toUpperCase() + replacement.slice(1) : replacement; }); } function orient(value) { return value * (options.direction === RTL ? 1 : -1); } return { resolve: resolve, orient: orient }; } var ROLE = "role"; var TAB_INDEX = "tabindex"; var DISABLED = "disabled"; var ARIA_PREFIX = "aria-"; var ARIA_CONTROLS = ARIA_PREFIX + "controls"; var ARIA_CURRENT = ARIA_PREFIX + "current"; var ARIA_SELECTED = ARIA_PREFIX + "selected"; var ARIA_LABEL = ARIA_PREFIX + "label"; var ARIA_LABELLEDBY = ARIA_PREFIX + "labelledby"; var ARIA_HIDDEN = ARIA_PREFIX + "hidden"; var ARIA_ORIENTATION = ARIA_PREFIX + "orientation"; var ARIA_ROLEDESCRIPTION = ARIA_PREFIX + "roledescription"; var ARIA_LIVE = ARIA_PREFIX + "live"; var ARIA_BUSY = ARIA_PREFIX + "busy"; var ARIA_ATOMIC = ARIA_PREFIX + "atomic"; var ALL_ATTRIBUTES = [ROLE, TAB_INDEX, DISABLED, ARIA_CONTROLS, ARIA_CURRENT, ARIA_LABEL, ARIA_LABELLEDBY, ARIA_HIDDEN, ARIA_ORIENTATION, ARIA_ROLEDESCRIPTION]; var CLASS_PREFIX = PROJECT_CODE + "__"; var STATUS_CLASS_PREFIX = "is-"; var CLASS_ROOT = PROJECT_CODE; var CLASS_TRACK = CLASS_PREFIX + "track"; var CLASS_LIST = CLASS_PREFIX + "list"; var CLASS_SLIDE = CLASS_PREFIX + "slide"; var CLASS_CLONE = CLASS_SLIDE + "--clone"; var CLASS_CONTAINER = CLASS_SLIDE + "__container"; var CLASS_ARROWS = CLASS_PREFIX + "arrows"; var CLASS_ARROW = CLASS_PREFIX + "arrow"; var CLASS_ARROW_PREV = CLASS_ARROW + "--prev"; var CLASS_ARROW_NEXT = CLASS_ARROW + "--next"; var CLASS_PAGINATION = CLASS_PREFIX + "pagination"; var CLASS_PAGINATION_PAGE = CLASS_PAGINATION + "__page"; var CLASS_PROGRESS = CLASS_PREFIX + "progress"; var CLASS_PROGRESS_BAR = CLASS_PROGRESS + "__bar"; var CLASS_TOGGLE = CLASS_PREFIX + "toggle"; var CLASS_TOGGLE_PLAY = CLASS_TOGGLE + "__play"; var CLASS_TOGGLE_PAUSE = CLASS_TOGGLE + "__pause"; var CLASS_SPINNER = CLASS_PREFIX + "spinner"; var CLASS_SR = CLASS_PREFIX + "sr"; var CLASS_INITIALIZED = STATUS_CLASS_PREFIX + "initialized"; var CLASS_ACTIVE = STATUS_CLASS_PREFIX + "active"; var CLASS_PREV = STATUS_CLASS_PREFIX + "prev"; var CLASS_NEXT = STATUS_CLASS_PREFIX + "next"; var CLASS_VISIBLE = STATUS_CLASS_PREFIX + "visible"; var CLASS_LOADING = STATUS_CLASS_PREFIX + "loading"; var CLASS_FOCUS_IN = STATUS_CLASS_PREFIX + "focus-in"; var CLASS_OVERFLOW = STATUS_CLASS_PREFIX + "overflow"; var STATUS_CLASSES = [CLASS_ACTIVE, CLASS_VISIBLE, CLASS_PREV, CLASS_NEXT, CLASS_LOADING, CLASS_FOCUS_IN, CLASS_OVERFLOW]; var CLASSES = { slide: CLASS_SLIDE, clone: CLASS_CLONE, arrows: CLASS_ARROWS, arrow: CLASS_ARROW, prev: CLASS_ARROW_PREV, next: CLASS_ARROW_NEXT, pagination: CLASS_PAGINATION, page: CLASS_PAGINATION_PAGE, spinner: CLASS_SPINNER }; function closest(from, selector) { if (isFunction(from.closest)) { return from.closest(selector); } var elm = from; while (elm && elm.nodeType === 1) { if (matches(elm, selector)) { break; } elm = elm.parentElement; } return elm; } var FRICTION = 5; var LOG_INTERVAL = 200; var POINTER_DOWN_EVENTS = "touchstart mousedown"; var POINTER_MOVE_EVENTS = "touchmove mousemove"; var POINTER_UP_EVENTS = "touchend touchcancel mouseup click"; function Elements(Splide2, Components2, options) { var _EventInterface = EventInterface(Splide2), on = _EventInterface.on, bind = _EventInterface.bind; var root = Splide2.root; var i18n = options.i18n; var elements = {}; var slides = []; var rootClasses = []; var trackClasses = []; var track; var list; var isUsingKey; function setup() { collect(); init(); update(); } function mount() { on(EVENT_REFRESH, destroy); on(EVENT_REFRESH, setup); on(EVENT_UPDATED, update); bind(document, POINTER_DOWN_EVENTS + " keydown", function (e) { isUsingKey = e.type === "keydown"; }, { capture: true }); bind(root, "focusin", function () { toggleClass(root, CLASS_FOCUS_IN, !!isUsingKey); }); } function destroy(completely) { var attrs = ALL_ATTRIBUTES.concat("style"); empty(slides); removeClass(root, rootClasses); removeClass(track, trackClasses); removeAttribute([track, list], attrs); removeAttribute(root, completely ? attrs : ["style", ARIA_ROLEDESCRIPTION]); } function update() { removeClass(root, rootClasses); removeClass(track, trackClasses); rootClasses = getClasses(CLASS_ROOT); trackClasses = getClasses(CLASS_TRACK); addClass(root, rootClasses); addClass(track, trackClasses); setAttribute(root, ARIA_LABEL, options.label); setAttribute(root, ARIA_LABELLEDBY, options.labelledby); } function collect() { track = find("." + CLASS_TRACK); list = child(track, "." + CLASS_LIST); assert(track && list, "A track/list element is missing."); push(slides, children(list, "." + CLASS_SLIDE + ":not(." + CLASS_CLONE + ")")); forOwn({ arrows: CLASS_ARROWS, pagination: CLASS_PAGINATION, prev: CLASS_ARROW_PREV, next: CLASS_ARROW_NEXT, bar: CLASS_PROGRESS_BAR, toggle: CLASS_TOGGLE }, function (className, key) { elements[key] = find("." + className); }); assign(elements, { root: root, track: track, list: list, slides: slides }); } function init() { var id = root.id || uniqueId(PROJECT_CODE); var role = options.role; root.id = id; track.id = track.id || id + "-track"; list.id = list.id || id + "-list"; if (!getAttribute(root, ROLE) && root.tagName !== "SECTION" && role) { setAttribute(root, ROLE, role); } setAttribute(root, ARIA_ROLEDESCRIPTION, i18n.carousel); setAttribute(list, ROLE, "presentation"); } function find(selector) { var elm = query(root, selector); return elm && closest(elm, "." + CLASS_ROOT) === root ? elm : void 0; } function getClasses(base) { return [base + "--" + options.type, base + "--" + options.direction, options.drag && base + "--draggable", options.isNavigation && base + "--nav", base === CLASS_ROOT && CLASS_ACTIVE]; } return assign(elements, { setup: setup, mount: mount, destroy: destroy }); } var SLIDE = "slide"; var LOOP = "loop"; var FADE = "fade"; function Slide$1(Splide2, index, slideIndex, slide) { var event = EventInterface(Splide2); var on = event.on, emit = event.emit, bind = event.bind; var Components = Splide2.Components, root = Splide2.root, options = Splide2.options; var isNavigation = options.isNavigation, updateOnMove = options.updateOnMove, i18n = options.i18n, pagination = options.pagination, slideFocus = options.slideFocus; var resolve = Components.Direction.resolve; var styles = getAttribute(slide, "style"); var label = getAttribute(slide, ARIA_LABEL); var isClone = slideIndex > -1; var container = child(slide, "." + CLASS_CONTAINER); var destroyed; function mount() { if (!isClone) { slide.id = root.id + "-slide" + pad(index + 1); setAttribute(slide, ROLE, pagination ? "tabpanel" : "group"); setAttribute(slide, ARIA_ROLEDESCRIPTION, i18n.slide); setAttribute(slide, ARIA_LABEL, label || format(i18n.slideLabel, [index + 1, Splide2.length])); } listen(); } function listen() { bind(slide, "click", apply(emit, EVENT_CLICK, self)); bind(slide, "keydown", apply(emit, EVENT_SLIDE_KEYDOWN, self)); on([EVENT_MOVED, EVENT_SHIFTED, EVENT_SCROLLED], update); on(EVENT_NAVIGATION_MOUNTED, initNavigation); if (updateOnMove) { on(EVENT_MOVE, onMove); } } function destroy() { destroyed = true; event.destroy(); removeClass(slide, STATUS_CLASSES); removeAttribute(slide, ALL_ATTRIBUTES); setAttribute(slide, "style", styles); setAttribute(slide, ARIA_LABEL, label || ""); } function initNavigation() { var controls = Splide2.splides.map(function (target) { var Slide2 = target.splide.Components.Slides.getAt(index); return Slide2 ? Slide2.slide.id : ""; }).join(" "); setAttribute(slide, ARIA_LABEL, format(i18n.slideX, (isClone ? slideIndex : index) + 1)); setAttribute(slide, ARIA_CONTROLS, controls); setAttribute(slide, ROLE, slideFocus ? "button" : ""); slideFocus && removeAttribute(slide, ARIA_ROLEDESCRIPTION); } function onMove() { if (!destroyed) { update(); } } function update() { if (!destroyed) { var curr = Splide2.index; updateActivity(); updateVisibility(); toggleClass(slide, CLASS_PREV, index === curr - 1); toggleClass(slide, CLASS_NEXT, index === curr + 1); } } function updateActivity() { var active = isActive(); if (active !== hasClass(slide, CLASS_ACTIVE)) { toggleClass(slide, CLASS_ACTIVE, active); setAttribute(slide, ARIA_CURRENT, isNavigation && active || ""); emit(active ? EVENT_ACTIVE : EVENT_INACTIVE, self); } } function updateVisibility() { var visible = isVisible(); var hidden = !visible && (!isActive() || isClone); if (!Splide2.state.is([MOVING, SCROLLING])) { setAttribute(slide, ARIA_HIDDEN, hidden || ""); } setAttribute(queryAll(slide, options.focusableNodes || ""), TAB_INDEX, hidden ? -1 : ""); if (slideFocus) { setAttribute(slide, TAB_INDEX, hidden ? -1 : 0); } if (visible !== hasClass(slide, CLASS_VISIBLE)) { toggleClass(slide, CLASS_VISIBLE, visible); emit(visible ? EVENT_VISIBLE : EVENT_HIDDEN, self); } if (!visible && document.activeElement === slide) { var Slide2 = Components.Slides.getAt(Splide2.index); Slide2 && focus(Slide2.slide); } } function style$1(prop, value, useContainer) { style(useContainer && container || slide, prop, value); } function isActive() { var curr = Splide2.index; return curr === index || options.cloneStatus && curr === slideIndex; } function isVisible() { if (Splide2.is(FADE)) { return isActive(); } var trackRect = rect(Components.Elements.track); var slideRect = rect(slide); var left = resolve("left", true); var right = resolve("right", true); return floor(trackRect[left]) <= ceil(slideRect[left]) && floor(slideRect[right]) <= ceil(trackRect[right]); } function isWithin(from, distance) { var diff = abs(from - index); if (!isClone && (options.rewind || Splide2.is(LOOP))) { diff = min(diff, Splide2.length - diff); } return diff <= distance; } var self = { index: index, slideIndex: slideIndex, slide: slide, container: container, isClone: isClone, mount: mount, destroy: destroy, update: update, style: style$1, isWithin: isWithin }; return self; } function Slides(Splide2, Components2, options) { var _EventInterface2 = EventInterface(Splide2), on = _EventInterface2.on, emit = _EventInterface2.emit, bind = _EventInterface2.bind; var _Components2$Elements = Components2.Elements, slides = _Components2$Elements.slides, list = _Components2$Elements.list; var Slides2 = []; function mount() { init(); on(EVENT_REFRESH, destroy); on(EVENT_REFRESH, init); } function init() { slides.forEach(function (slide, index) { register(slide, index, -1); }); } function destroy() { forEach$1(function (Slide2) { Slide2.destroy(); }); empty(Slides2); } function update() { forEach$1(function (Slide2) { Slide2.update(); }); } function register(slide, index, slideIndex) { var object = Slide$1(Splide2, index, slideIndex, slide); object.mount(); Slides2.push(object); Slides2.sort(function (Slide1, Slide2) { return Slide1.index - Slide2.index; }); } function get(excludeClones) { return excludeClones ? filter(function (Slide2) { return !Slide2.isClone; }) : Slides2; } function getIn(page) { var Controller = Components2.Controller; var index = Controller.toIndex(page); var max = Controller.hasFocus() ? 1 : options.perPage; return filter(function (Slide2) { return between(Slide2.index, index, index + max - 1); }); } function getAt(index) { return filter(index)[0]; } function add(items, index) { forEach(items, function (slide) { if (isString(slide)) { slide = parseHtml(slide); } if (isHTMLElement(slide)) { var ref = slides[index]; ref ? before(slide, ref) : append(list, slide); addClass(slide, options.classes.slide); observeImages(slide, apply(emit, EVENT_RESIZE)); } }); emit(EVENT_REFRESH); } function remove$1(matcher) { remove(filter(matcher).map(function (Slide2) { return Slide2.slide; })); emit(EVENT_REFRESH); } function forEach$1(iteratee, excludeClones) { get(excludeClones).forEach(iteratee); } function filter(matcher) { return Slides2.filter(isFunction(matcher) ? matcher : function (Slide2) { return isString(matcher) ? matches(Slide2.slide, matcher) : includes(toArray(matcher), Slide2.index); }); } function style(prop, value, useContainer) { forEach$1(function (Slide2) { Slide2.style(prop, value, useContainer); }); } function observeImages(elm, callback) { var images = queryAll(elm, "img"); var length = images.length; if (length) { images.forEach(function (img) { bind(img, "load error", function () { if (! --length) { callback(); } }); }); } else { callback(); } } function getLength(excludeClones) { return excludeClones ? slides.length : Slides2.length; } function isEnough() { return Slides2.length > options.perPage; } return { mount: mount, destroy: destroy, update: update, register: register, get: get, getIn: getIn, getAt: getAt, add: add, remove: remove$1, forEach: forEach$1, filter: filter, style: style, getLength: getLength, isEnough: isEnough }; } function Layout(Splide2, Components2, options) { var _EventInterface3 = EventInterface(Splide2), on = _EventInterface3.on, bind = _EventInterface3.bind, emit = _EventInterface3.emit; var Slides = Components2.Slides; var resolve = Components2.Direction.resolve; var _Components2$Elements2 = Components2.Elements, root = _Components2$Elements2.root, track = _Components2$Elements2.track, list = _Components2$Elements2.list; var getAt = Slides.getAt, styleSlides = Slides.style; var vertical; var rootRect; var overflow; function mount() { init(); bind(window, "resize load", Throttle(apply(emit, EVENT_RESIZE))); on([EVENT_UPDATED, EVENT_REFRESH], init); on(EVENT_RESIZE, resize); } function init() { vertical = options.direction === TTB; style(root, "maxWidth", unit(options.width)); style(track, resolve("paddingLeft"), cssPadding(false)); style(track, resolve("paddingRight"), cssPadding(true)); resize(true); } function resize(force) { var newRect = rect(root); if (force || rootRect.width !== newRect.width || rootRect.height !== newRect.height) { style(track, "height", cssTrackHeight()); styleSlides(resolve("marginRight"), unit(options.gap)); styleSlides("width", cssSlideWidth()); styleSlides("height", cssSlideHeight(), true); rootRect = newRect; emit(EVENT_RESIZED); if (overflow !== (overflow = isOverflow())) { toggleClass(root, CLASS_OVERFLOW, overflow); emit(EVENT_OVERFLOW, overflow); } } } function cssPadding(right) { var padding = options.padding; var prop = resolve(right ? "right" : "left"); return padding && unit(padding[prop] || (isObject(padding) ? 0 : padding)) || "0px"; } function cssTrackHeight() { var height = ""; if (vertical) { height = cssHeight(); assert(height, "height or heightRatio is missing."); height = "calc(" + height + " - " + cssPadding(false) + " - " + cssPadding(true) + ")"; } return height; } function cssHeight() { return unit(options.height || rect(list).width * options.heightRatio); } function cssSlideWidth() { return options.autoWidth ? null : unit(options.fixedWidth) || (vertical ? "" : cssSlideSize()); } function cssSlideHeight() { return unit(options.fixedHeight) || (vertical ? options.autoHeight ? null : cssSlideSize() : cssHeight()); } function cssSlideSize() { var gap = unit(options.gap); return "calc((100%" + (gap && " + " + gap) + ")/" + (options.perPage || 1) + (gap && " - " + gap) + ")"; } function listSize() { return rect(list)[resolve("width")]; } function slideSize(index, withoutGap) { var Slide = getAt(index || 0); return Slide ? rect(Slide.slide)[resolve("width")] + (withoutGap ? 0 : getGap()) : 0; } function totalSize(index, withoutGap) { var Slide = getAt(index); if (Slide) { var right = rect(Slide.slide)[resolve("right")]; var left = rect(list)[resolve("left")]; return abs(right - left) + (withoutGap ? 0 : getGap()); } return 0; } function sliderSize(withoutGap) { return totalSize(Splide2.length - 1) - totalSize(0) + slideSize(0, withoutGap); } function getGap() { var Slide = getAt(0); return Slide && parseFloat(style(Slide.slide, resolve("marginRight"))) || 0; } function getPadding(right) { return parseFloat(style(track, resolve("padding" + (right ? "Right" : "Left")))) || 0; } function isOverflow() { return Splide2.is(FADE) || sliderSize(true) > listSize(); } return { mount: mount, resize: resize, listSize: listSize, slideSize: slideSize, sliderSize: sliderSize, totalSize: totalSize, getPadding: getPadding, isOverflow: isOverflow }; } var MULTIPLIER = 2; function Clones(Splide2, Components2, options) { var event = EventInterface(Splide2); var on = event.on; var Elements = Components2.Elements, Slides = Components2.Slides; var resolve = Components2.Direction.resolve; var clones = []; var cloneCount; function mount() { on(EVENT_REFRESH, remount); on([EVENT_UPDATED, EVENT_RESIZE], observe); if (cloneCount = computeCloneCount()) { generate(cloneCount); Components2.Layout.resize(true); } } function remount() { destroy(); mount(); } function destroy() { remove(clones); empty(clones); event.destroy(); } function observe() { var count = computeCloneCount(); if (cloneCount !== count) { if (cloneCount < count || !count) { event.emit(EVENT_REFRESH); } } } function generate(count) { var slides = Slides.get().slice(); var length = slides.length; if (length) { while (slides.length < count) { push(slides, slides); } push(slides.slice(-count), slides.slice(0, count)).forEach(function (Slide, index) { var isHead = index < count; var clone = cloneDeep(Slide.slide, index); isHead ? before(clone, slides[0].slide) : append(Elements.list, clone); push(clones, clone); Slides.register(clone, index - count + (isHead ? 0 : length), Slide.index); }); } } function cloneDeep(elm, index) { var clone = elm.cloneNode(true); addClass(clone, options.classes.clone); clone.id = Splide2.root.id + "-clone" + pad(index + 1); return clone; } function computeCloneCount() { var clones2 = options.clones; if (!Splide2.is(LOOP)) { clones2 = 0; } else if (isUndefined(clones2)) { var fixedSize = options[resolve("fixedWidth")] && Components2.Layout.slideSize(0); var fixedCount = fixedSize && ceil(rect(Elements.track)[resolve("width")] / fixedSize); clones2 = fixedCount || options[resolve("autoWidth")] && Splide2.length || options.perPage * MULTIPLIER; } return clones2; } return { mount: mount, destroy: destroy }; } function Move(Splide2, Components2, options) { var _EventInterface4 = EventInterface(Splide2), on = _EventInterface4.on, emit = _EventInterface4.emit; var set = Splide2.state.set; var _Components2$Layout = Components2.Layout, slideSize = _Components2$Layout.slideSize, getPadding = _Components2$Layout.getPadding, totalSize = _Components2$Layout.totalSize, listSize = _Components2$Layout.listSize, sliderSize = _Components2$Layout.sliderSize; var _Components2$Directio = Components2.Direction, resolve = _Components2$Directio.resolve, orient = _Components2$Directio.orient; var _Components2$Elements3 = Components2.Elements, list = _Components2$Elements3.list, track = _Components2$Elements3.track; var Transition; function mount() { Transition = Components2.Transition; on([EVENT_MOUNTED, EVENT_RESIZED, EVENT_UPDATED, EVENT_REFRESH], reposition); } function reposition() { if (!Components2.Controller.isBusy()) { Components2.Scroll.cancel(); jump(Splide2.index); Components2.Slides.update(); } } function move(dest, index, prev, callback) { if (dest !== index && canShift(dest > prev)) { cancel(); translate(shift(getPosition(), dest > prev), true); } set(MOVING); emit(EVENT_MOVE, index, prev, dest); Transition.start(index, function () { set(IDLE); emit(EVENT_MOVED, index, prev, dest); callback && callback(); }); } function jump(index) { translate(toPosition(index, true)); } function translate(position, preventLoop) { if (!Splide2.is(FADE)) { var destination = preventLoop ? position : loop(position); style(list, "transform", "translate" + resolve("X") + "(" + destination + "px)"); position !== destination && emit(EVENT_SHIFTED); } } function loop(position) { if (Splide2.is(LOOP)) { var index = toIndex(position); var exceededMax = index > Components2.Controller.getEnd(); var exceededMin = index < 0; if (exceededMin || exceededMax) { position = shift(position, exceededMax); } } return position; } function shift(position, backwards) { var excess = position - getLimit(backwards); var size = sliderSize(); position -= orient(size * (ceil(abs(excess) / size) || 1)) * (backwards ? 1 : -1); return position; } function cancel() { translate(getPosition(), true); Transition.cancel(); } function toIndex(position) { var Slides = Components2.Slides.get(); var index = 0; var minDistance = Infinity; for (var i = 0; i < Slides.length; i++) { var slideIndex = Slides[i].index; var distance = abs(toPosition(slideIndex, true) - position); if (distance <= minDistance) { minDistance = distance; index = slideIndex; } else { break; } } return index; } function toPosition(index, trimming) { var position = orient(totalSize(index - 1) - offset(index)); return trimming ? trim(position) : position; } function getPosition() { var left = resolve("left"); return rect(list)[left] - rect(track)[left] + orient(getPadding(false)); } function trim(position) { if (options.trimSpace && Splide2.is(SLIDE)) { position = clamp(position, 0, orient(sliderSize(true) - listSize())); } return position; } function offset(index) { var focus = options.focus; return focus === "center" ? (listSize() - slideSize(index, true)) / 2 : +focus * slideSize(index) || 0; } function getLimit(max) { return toPosition(max ? Components2.Controller.getEnd() : 0, !!options.trimSpace); } function canShift(backwards) { var shifted = orient(shift(getPosition(), backwards)); return backwards ? shifted >= 0 : shifted <= list[resolve("scrollWidth")] - rect(track)[resolve("width")]; } function exceededLimit(max, position) { position = isUndefined(position) ? getPosition() : position; var exceededMin = max !== true && orient(position) < orient(getLimit(false)); var exceededMax = max !== false && orient(position) > orient(getLimit(true)); return exceededMin || exceededMax; } return { mount: mount, move: move, jump: jump, translate: translate, shift: shift, cancel: cancel, toIndex: toIndex, toPosition: toPosition, getPosition: getPosition, getLimit: getLimit, exceededLimit: exceededLimit, reposition: reposition }; } function Controller(Splide2, Components2, options) { var _EventInterface5 = EventInterface(Splide2), on = _EventInterface5.on, emit = _EventInterface5.emit; var Move = Components2.Move; var getPosition = Move.getPosition, getLimit = Move.getLimit, toPosition = Move.toPosition; var _Components2$Slides = Components2.Slides, isEnough = _Components2$Slides.isEnough, getLength = _Components2$Slides.getLength; var omitEnd = options.omitEnd; var isLoop = Splide2.is(LOOP); var isSlide = Splide2.is(SLIDE); var getNext = apply(getAdjacent, false); var getPrev = apply(getAdjacent, true); var currIndex = options.start || 0; var endIndex; var prevIndex = currIndex; var slideCount; var perMove; var perPage; function mount() { init(); on([EVENT_UPDATED, EVENT_REFRESH, EVENT_END_INDEX_CHANGED], init); on(EVENT_RESIZED, onResized); } function init() { slideCount = getLength(true); perMove = options.perMove; perPage = options.perPage; endIndex = getEnd(); var index = clamp(currIndex, 0, omitEnd ? endIndex : slideCount - 1); if (index !== currIndex) { currIndex = index; Move.reposition(); } } function onResized() { if (endIndex !== getEnd()) { emit(EVENT_END_INDEX_CHANGED); } } function go(control, allowSameIndex, callback) { if (!isBusy()) { var dest = parse(control); var index = loop(dest); if (index > -1 && (allowSameIndex || index !== currIndex)) { setIndex(index); Move.move(dest, index, prevIndex, callback); } } } function scroll(destination, duration, snap, callback) { Components2.Scroll.scroll(destination, duration, snap, function () { var index = loop(Move.toIndex(getPosition())); setIndex(omitEnd ? min(index, endIndex) : index); callback && callback(); }); } function parse(control) { var index = currIndex; if (isString(control)) { var _ref = control.match(/([+\-<>])(\d+)?/) || [], indicator = _ref[1], number = _ref[2]; if (indicator === "+" || indicator === "-") { index = computeDestIndex(currIndex + +("" + indicator + (+number || 1)), currIndex); } else if (indicator === ">") { index = number ? toIndex(+number) : getNext(true); } else if (indicator === "<") { index = getPrev(true); } } else { index = isLoop ? control : clamp(control, 0, endIndex); } return index; } function getAdjacent(prev, destination) { var number = perMove || (hasFocus() ? 1 : perPage); var dest = computeDestIndex(currIndex + number * (prev ? -1 : 1), currIndex, !(perMove || hasFocus())); if (dest === -1 && isSlide) { if (!approximatelyEqual(getPosition(), getLimit(!prev), 1)) { return prev ? 0 : endIndex; } } return destination ? dest : loop(dest); } function computeDestIndex(dest, from, snapPage) { if (isEnough() || hasFocus()) { var index = computeMovableDestIndex(dest); if (index !== dest) { from = dest; dest = index; snapPage = false; } if (dest < 0 || dest > endIndex) { if (!perMove && (between(0, dest, from, true) || between(endIndex, from, dest, true))) { dest = toIndex(toPage(dest)); } else { if (isLoop) { dest = snapPage ? dest < 0 ? -(slideCount % perPage || perPage) : slideCount : dest; } else if (options.rewind) { dest = dest < 0 ? endIndex : 0; } else { dest = -1; } } } else { if (snapPage && dest !== from) { dest = toIndex(toPage(from) + (dest < from ? -1 : 1)); } } } else { dest = -1; } return dest; } function computeMovableDestIndex(dest) { if (isSlide && options.trimSpace === "move" && dest !== currIndex) { var position = getPosition(); while (position === toPosition(dest, true) && between(dest, 0, Splide2.length - 1, !options.rewind)) { dest < currIndex ? --dest : ++dest; } } return dest; } function loop(index) { return isLoop ? (index + slideCount) % slideCount || 0 : index; } function getEnd() { var end = slideCount - (hasFocus() || isLoop && perMove ? 1 : perPage); while (omitEnd && end-- > 0) { if (toPosition(slideCount - 1, true) !== toPosition(end, true)) { end++; break; } } return clamp(end, 0, slideCount - 1); } function toIndex(page) { return clamp(hasFocus() ? page : perPage * page, 0, endIndex); } function toPage(index) { return hasFocus() ? min(index, endIndex) : floor((index >= endIndex ? slideCount - 1 : index) / perPage); } function toDest(destination) { var closest = Move.toIndex(destination); return isSlide ? clamp(closest, 0, endIndex) : closest; } function setIndex(index) { if (index !== currIndex) { prevIndex = currIndex; currIndex = index; } } function getIndex(prev) { return prev ? prevIndex : currIndex; } function hasFocus() { return !isUndefined(options.focus) || options.isNavigation; } function isBusy() { return Splide2.state.is([MOVING, SCROLLING]) && !!options.waitForTransition; } return { mount: mount, go: go, scroll: scroll, getNext: getNext, getPrev: getPrev, getAdjacent: getAdjacent, getEnd: getEnd, setIndex: setIndex, getIndex: getIndex, toIndex: toIndex, toPage: toPage, toDest: toDest, hasFocus: hasFocus, isBusy: isBusy }; } var XML_NAME_SPACE = "http://www.w3.org/2000/svg"; var PATH = "m15.5 0.932-4.3 4.38 14.5 14.6-14.5 14.5 4.3 4.4 14.6-14.6 4.4-4.3-4.4-4.4-14.6-14.6z"; var SIZE = 40; function Arrows(Splide2, Components2, options) { var event = EventInterface(Splide2); var on = event.on, bind = event.bind, emit = event.emit; var classes = options.classes, i18n = options.i18n; var Elements = Components2.Elements, Controller = Components2.Controller; var placeholder = Elements.arrows, track = Elements.track; var wrapper = placeholder; var prev = Elements.prev; var next = Elements.next; var created; var wrapperClasses; var arrows = {}; function mount() { init(); on(EVENT_UPDATED, remount); } function remount() { destroy(); mount(); } function init() { var enabled = options.arrows; if (enabled && !(prev && next)) { createArrows(); } if (prev && next) { assign(arrows, { prev: prev, next: next }); display(wrapper, enabled ? "" : "none"); addClass(wrapper, wrapperClasses = CLASS_ARROWS + "--" + options.direction); if (enabled) { listen(); update(); setAttribute([prev, next], ARIA_CONTROLS, track.id); emit(EVENT_ARROWS_MOUNTED, prev, next); } } } function destroy() { event.destroy(); removeClass(wrapper, wrapperClasses); if (created) { remove(placeholder ? [prev, next] : wrapper); prev = next = null; } else { removeAttribute([prev, next], ALL_ATTRIBUTES); } } function listen() { on([EVENT_MOUNTED, EVENT_MOVED, EVENT_REFRESH, EVENT_SCROLLED, EVENT_END_INDEX_CHANGED], update); bind(next, "click", apply(go, ">")); bind(prev, "click", apply(go, "<")); } function go(control) { Controller.go(control, true); } function createArrows() { wrapper = placeholder || create("div", classes.arrows); prev = createArrow(true); next = createArrow(false); created = true; append(wrapper, [prev, next]); !placeholder && before(wrapper, track); } function createArrow(prev2) { var arrow = ""; }; _proto3.html = function html() { var _this$config = this.config, rootClass = _this$config.rootClass, listTag = _this$config.listTag, arrows = _this$config.arrows, beforeTrack = _this$config.beforeTrack, afterTrack = _this$config.afterTrack, slider = _this$config.slider, beforeSlider = _this$config.beforeSlider, afterSlider = _this$config.afterSlider; var html = ""; html += "
"; html += ""; if (slider) { html += beforeSlider || ""; html += "
"; } html += beforeTrack || ""; if (arrows) { html += this.renderArrows(); } html += "
"; html += "<" + listTag + " class=\"splide__list\">"; html += this.renderSlides(); html += ""; html += "
"; html += afterTrack || ""; if (slider) { html += "
"; html += afterSlider || ""; } html += "
"; return html; }; return SplideRenderer; }(); /***/ }), /***/ "./node_modules/glightbox/src/js/core/drag.js": /*!****************************************************!*\ !*** ./node_modules/glightbox/src/js/core/drag.js ***! \****************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ DragSlides) /* harmony export */ }); /* harmony import */ var _utils_helpers_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/helpers.js */ "./node_modules/glightbox/src/js/utils/helpers.js"); /** * DragSlides * Allow imaes to be dragged for prev and next * in desktops * * @param { object } config */ class DragSlides { constructor(config = {}) { let { dragEl, toleranceX = 40, toleranceY = 65, slide = null, instance = null } = config; this.el = dragEl; this.active = false; this.dragging = false; this.currentX = null; this.currentY = null; this.initialX = null; this.initialY = null; this.xOffset = 0; this.yOffset = 0; this.direction = null; this.lastDirection = null; this.toleranceX = toleranceX; this.toleranceY = toleranceY; this.toleranceReached = false; this.dragContainer = this.el; this.slide = slide; this.instance = instance; this.el.addEventListener('mousedown', (e) => this.dragStart(e), false); this.el.addEventListener('mouseup', (e) => this.dragEnd(e), false); this.el.addEventListener('mousemove', (e) => this.drag(e), false); } dragStart(e) { if (this.slide.classList.contains('zoomed')) { this.active = false; return; } if (e.type === 'touchstart') { this.initialX = e.touches[0].clientX - this.xOffset; this.initialY = e.touches[0].clientY - this.yOffset; } else { this.initialX = e.clientX - this.xOffset; this.initialY = e.clientY - this.yOffset; } let clicked = e.target.nodeName.toLowerCase(); let exludeClicks = ['input', 'select', 'textarea', 'button', 'a']; if ( e.target.classList.contains('nodrag') || (0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_0__.closest)(e.target, '.nodrag') || exludeClicks.indexOf(clicked) !== -1 ) { this.active = false; return; } e.preventDefault(); if (e.target === this.el || (clicked !== 'img' && (0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_0__.closest)(e.target, '.gslide-inline'))) { this.active = true; this.el.classList.add('dragging'); this.dragContainer = (0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_0__.closest)(e.target, '.ginner-container'); } } dragEnd(e) { e && e.preventDefault(); this.initialX = 0; this.initialY = 0; this.currentX = null; this.currentY = null; this.initialX = null; this.initialY = null; this.xOffset = 0; this.yOffset = 0; this.active = false; if (this.doSlideChange) { this.instance.preventOutsideClick = true; this.doSlideChange == 'right' && this.instance.prevSlide(); this.doSlideChange == 'left' && this.instance.nextSlide(); } if (this.doSlideClose) { this.instance.close(); } if (!this.toleranceReached) { this.setTranslate(this.dragContainer, 0, 0, true); } setTimeout(() => { this.instance.preventOutsideClick = false; this.toleranceReached = false; this.lastDirection = null; this.dragging = false; this.el.isDragging = false; this.el.classList.remove('dragging'); this.slide.classList.remove('dragging-nav'); this.dragContainer.style.transform = ''; this.dragContainer.style.transition = ''; }, 100); } drag(e) { if (this.active) { e.preventDefault(); this.slide.classList.add('dragging-nav'); if (e.type === 'touchmove') { this.currentX = e.touches[0].clientX - this.initialX; this.currentY = e.touches[0].clientY - this.initialY; } else { this.currentX = e.clientX - this.initialX; this.currentY = e.clientY - this.initialY; } this.xOffset = this.currentX; this.yOffset = this.currentY; this.el.isDragging = true; this.dragging = true; this.doSlideChange = false; this.doSlideClose = false; let currentXInt = Math.abs(this.currentX); let currentYInt = Math.abs(this.currentY); // Horizontal drag if ( currentXInt > 0 && currentXInt >= Math.abs(this.currentY) && (!this.lastDirection || this.lastDirection == 'x') ) { this.yOffset = 0; this.lastDirection = 'x'; this.setTranslate(this.dragContainer, this.currentX, 0); let doChange = this.shouldChange(); if (!this.instance.settings.dragAutoSnap && doChange) { this.doSlideChange = doChange; } if (this.instance.settings.dragAutoSnap && doChange) { this.instance.preventOutsideClick = true; this.toleranceReached = true; this.active = false; this.instance.preventOutsideClick = true; this.dragEnd(null); doChange == 'right' && this.instance.prevSlide(); doChange == 'left' && this.instance.nextSlide(); return; } } // Vertical drag if ( this.toleranceY > 0 && currentYInt > 0 && currentYInt >= currentXInt && (!this.lastDirection || this.lastDirection == 'y') ) { this.xOffset = 0; this.lastDirection = 'y'; this.setTranslate(this.dragContainer, 0, this.currentY); let doClose = this.shouldClose(); if (!this.instance.settings.dragAutoSnap && doClose) { this.doSlideClose = true; } if (this.instance.settings.dragAutoSnap && doClose) { this.instance.close(); } return; } } } shouldChange() { let doChange = false; let currentXInt = Math.abs(this.currentX); if (currentXInt >= this.toleranceX) { let dragDir = this.currentX > 0 ? 'right' : 'left'; if ( (dragDir == 'left' && this.slide !== this.slide.parentNode.lastChild) || (dragDir == 'right' && this.slide !== this.slide.parentNode.firstChild) ) { doChange = dragDir; } } return doChange; } shouldClose() { let doClose = false; let currentYInt = Math.abs(this.currentY); if (currentYInt >= this.toleranceY) { doClose = true; } return doClose; } setTranslate(node, xPos, yPos, animated = false) { if (animated) { node.style.transition = 'all .2s ease'; } else { node.style.transition = ''; } node.style.transform = `translate3d(${xPos}px, ${yPos}px, 0)`; } } /***/ }), /***/ "./node_modules/glightbox/src/js/core/keyboard-navigation.js": /*!*******************************************************************!*\ !*** ./node_modules/glightbox/src/js/core/keyboard-navigation.js ***! \*******************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ keyboardNavigation) /* harmony export */ }); /* harmony import */ var _utils_helpers_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/helpers.js */ "./node_modules/glightbox/src/js/utils/helpers.js"); /** * Keyboard Navigation * Allow navigation using the keyboard * * @param {object} instance */ function getNextFocusElement(current = -1) { const btns = document.querySelectorAll('.gbtn[data-taborder]:not(.disabled)'); if (!btns.length) { return false; } if (btns.length == 1) { return btns[0]; } if (typeof current == 'string') { current = parseInt(current); } const orders = []; (0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_0__.each)(btns, (btn) => { orders.push(btn.getAttribute('data-taborder')); }); const highestOrder = Math.max.apply(Math, orders.map((order) => parseInt(order))); let newIndex = current < 0 ? 1 : current + 1; if (newIndex > highestOrder) { newIndex = '1'; } const nextOrders = orders.filter((el) => el >= parseInt(newIndex)); const nextFocus = nextOrders.sort()[0]; return document.querySelector(`.gbtn[data-taborder="${nextFocus}"]`); } function keyboardNavigation(instance) { if (instance.events.hasOwnProperty('keyboard')) { return false; } instance.events['keyboard'] = (0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_0__.addEvent)('keydown', { onElement: window, withCallback: (event, target) => { event = event || window.event; const key = event.keyCode; if (key == 9) { //prettier-ignore const focusedButton = document.querySelector('.gbtn.focused'); if (!focusedButton) { const activeElement = document.activeElement && document.activeElement.nodeName ? document.activeElement.nodeName.toLocaleLowerCase() : false; if (activeElement == 'input' || activeElement == 'textarea' || activeElement == 'button') { return; } } event.preventDefault(); const btns = document.querySelectorAll('.gbtn[data-taborder]'); if (!btns || btns.length <= 0) { return; } if (!focusedButton) { const first = getNextFocusElement(); if (first) { first.focus(); (0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_0__.addClass)(first, 'focused'); } return; } let currentFocusOrder = focusedButton.getAttribute('data-taborder'); let nextFocus = getNextFocusElement(currentFocusOrder); (0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_0__.removeClass)(focusedButton, 'focused'); if (nextFocus) { nextFocus.focus(); (0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_0__.addClass)(nextFocus, 'focused'); } } if (key == 39) { instance.nextSlide(); } if (key == 37) { instance.prevSlide(); } if (key == 27) { instance.close(); } } }); } /***/ }), /***/ "./node_modules/glightbox/src/js/core/slide-parser.js": /*!************************************************************!*\ !*** ./node_modules/glightbox/src/js/core/slide-parser.js ***! \************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ SlideConfigParser) /* harmony export */ }); /* harmony import */ var _utils_helpers_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/helpers.js */ "./node_modules/glightbox/src/js/utils/helpers.js"); class SlideConfigParser { constructor(slideParamas = {}) { this.defaults = { href: '', sizes: '', srcset: '', title: '', type: '', videoProvider: '', description: '', alt: '', descPosition: 'bottom', effect: '', width: '', height: '', content: false, zoomable: true, draggable: true }; if ((0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_0__.isObject)(slideParamas)) { this.defaults = (0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_0__.extend)(this.defaults, slideParamas); } } /** * Get source type * gte the source type of a url * * @param {string} url */ sourceType(url) { let origin = url; url = url.toLowerCase(); if (url.match(/\.(jpeg|jpg|jpe|gif|png|apn|webp|avif|svg)/) !== null) { return 'image'; } if (url.match(/(youtube\.com|youtube-nocookie\.com)\/watch\?v=([a-zA-Z0-9\-_]+)/) || url.match(/youtu\.be\/([a-zA-Z0-9\-_]+)/) || url.match(/(youtube\.com|youtube-nocookie\.com)\/embed\/([a-zA-Z0-9\-_]+)/)) { return 'video'; } if (url.match(/vimeo\.com\/([0-9]*)/)) { return 'video'; } if (url.match(/\.(mp4|ogg|webm|mov)/) !== null) { return 'video'; } if (url.match(/\.(mp3|wav|wma|aac|ogg)/) !== null) { return 'audio'; } // Check if inline content if (url.indexOf('#') > -1) { let hash = origin.split('#').pop(); if (hash.trim() !== '') { return 'inline'; } } // Ajax if (url.indexOf('goajax=true') > -1) { return 'ajax'; } return 'external'; } parseConfig(element, settings) { let data = (0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_0__.extend)({ descPosition: settings.descPosition }, this.defaults); if ((0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_0__.isObject)(element) && !(0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_0__.isNode)(element)) { if (!(0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_0__.has)(element, 'type')) { if ((0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_0__.has)(element, 'content') && element.content) { element.type = 'inline'; } else if ((0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_0__.has)(element, 'href')) { element.type = this.sourceType(element.href); } } let objectData = (0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_0__.extend)(data, element); this.setSize(objectData, settings); return objectData; } let url = ''; let config = element.getAttribute('data-glightbox'); let nodeType = element.nodeName.toLowerCase(); if (nodeType === 'a') { url = element.href; } if (nodeType === 'img') { url = element.src; //alt attribute propagation data.alt = element.alt; } if (nodeType === 'area') { url = element.href; //alt attribute propagation data.alt = element.alt; data.title = element.title; } data.href = url; (0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_0__.each)(data, (val, key) => { if ((0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_0__.has)(settings, key) && key !== 'width') { data[key] = settings[key]; } const nodeData = element.dataset[key]; if (!(0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_0__.isNil)(nodeData)) { data[key] = this.sanitizeValue(nodeData); } }); if (data.content) { data.type = 'inline'; } if (!data.type && url) { data.type = this.sourceType(url); } if (!(0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_0__.isNil)(config)) { let cleanKeys = []; (0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_0__.each)(data, (v, k) => { cleanKeys.push(';\\s?' + k); }); cleanKeys = cleanKeys.join('\\s?:|'); if (config.trim() !== '') { (0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_0__.each)(data, (val, key) => { const str = config; const match = 's?' + key + 's?:s?(.*?)(' + cleanKeys + 's?:|$)'; const regex = new RegExp(match); const matches = str.match(regex); if (matches && matches.length && matches[1]) { const value = matches[1].trim().replace(/;\s*$/, ''); data[key] = this.sanitizeValue(value); } }); } } else { if (!data.title && nodeType == 'a') { let title = element.title; if (!(0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_0__.isNil)(title) && title !== '') { data.title = title; } } if (!data.title && nodeType == 'img') { let alt = element.alt; if (!(0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_0__.isNil)(alt) && alt !== '') { data.title = alt; } } } // Try to get the description from a referenced element if (data.description && data.description.substring(0, 1) === '.') { let description; try { description = document.querySelector(data.description).innerHTML; } catch (error) { if (!(error instanceof DOMException)) { throw error; } } if (description) { data.description = description; } } // Try to get the description from a .glightbox-desc element if (!data.description) { let nodeDesc = element.querySelector('.glightbox-desc'); if (nodeDesc) { data.description = nodeDesc.innerHTML; } } this.setSize(data, settings, element); this.slideConfig = data; return data; } /** * Set slide data size * set the correct size dependin * on the slide type * * @param { object } data * @param { object } settings * @return { object } */ setSize(data, settings, element = null) { const defaultWith = data.type == 'video' ? this.checkSize(settings.videosWidth) : this.checkSize(settings.width); const defaultHeight = this.checkSize(settings.height); data.width = (0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_0__.has)(data, 'width') && data.width !== '' ? this.checkSize(data.width) : defaultWith; data.height = (0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_0__.has)(data, 'height') && data.height !== '' ? this.checkSize(data.height) : defaultHeight; if (element && data.type == 'image') { data._hasCustomWidth = element.dataset.width ? true : false; data._hasCustomHeight = element.dataset.height ? true : false; } return data; } /** * [checkSize size * check if the passed size has a correct unit * * @param {string} size * @return {string} */ checkSize(size) { return (0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_0__.isNumber)(size) ? `${size}px` : size; } /** * Sanitize data attributes value * * @param string val * @return mixed */ sanitizeValue(val) { if (val !== 'true' && val !== 'false') { return val; } return val === 'true'; } } /***/ }), /***/ "./node_modules/glightbox/src/js/core/slide.js": /*!*****************************************************!*\ !*** ./node_modules/glightbox/src/js/core/slide.js ***! \*****************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ Slide) /* harmony export */ }); /* harmony import */ var _zoom_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./zoom.js */ "./node_modules/glightbox/src/js/core/zoom.js"); /* harmony import */ var _drag_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./drag.js */ "./node_modules/glightbox/src/js/core/drag.js"); /* harmony import */ var _slides_image_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../slides/image.js */ "./node_modules/glightbox/src/js/slides/image.js"); /* harmony import */ var _slides_video_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../slides/video.js */ "./node_modules/glightbox/src/js/slides/video.js"); /* harmony import */ var _slides_inline_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../slides/inline.js */ "./node_modules/glightbox/src/js/slides/inline.js"); /* harmony import */ var _slides_iframe_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../slides/iframe.js */ "./node_modules/glightbox/src/js/slides/iframe.js"); /* harmony import */ var _slide_parser_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./slide-parser.js */ "./node_modules/glightbox/src/js/core/slide-parser.js"); /* harmony import */ var _utils_helpers_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../utils/helpers.js */ "./node_modules/glightbox/src/js/utils/helpers.js"); /** * Slide * class to hablde slide creation * and config parser */ class Slide { constructor(el, instance, index) { this.element = el; this.instance = instance; this.index = index; } /** * Set slide content * * @param {node} slide * @param {object} data * @param {function} callback */ setContent(slide = null, callback = false) { if ((0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_7__.hasClass)(slide, 'loaded')) { return false; } const settings = this.instance.settings; const slideConfig = this.slideConfig; const isMobileDevice = (0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_7__.isMobile)(); if ((0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_7__.isFunction)(settings.beforeSlideLoad)) { settings.beforeSlideLoad({ index: this.index, slide: slide, player: false }); } let type = slideConfig.type; let position = slideConfig.descPosition; let slideMedia = slide.querySelector('.gslide-media'); let slideTitle = slide.querySelector('.gslide-title'); let slideText = slide.querySelector('.gslide-desc'); let slideDesc = slide.querySelector('.gdesc-inner'); let finalCallback = callback; // used for image accessiblity let titleID = 'gSlideTitle_' + this.index; let textID = 'gSlideDesc_' + this.index; if ((0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_7__.isFunction)(settings.afterSlideLoad)) { finalCallback = () => { if ((0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_7__.isFunction)(callback)) { callback(); } settings.afterSlideLoad({ index: this.index, slide: slide, player: this.instance.getSlidePlayerInstance(this.index) }); }; } if (slideConfig.title == '' && slideConfig.description == '') { if (slideDesc) { slideDesc.parentNode.parentNode.removeChild(slideDesc.parentNode); } } else { if (slideTitle && slideConfig.title !== '') { slideTitle.id = titleID; slideTitle.innerHTML = slideConfig.title; } else { slideTitle.parentNode.removeChild(slideTitle); } if (slideText && slideConfig.description !== '') { slideText.id = textID; if (isMobileDevice && settings.moreLength > 0) { slideConfig.smallDescription = this.slideShortDesc(slideConfig.description, settings.moreLength, settings.moreText); slideText.innerHTML = slideConfig.smallDescription; this.descriptionEvents(slideText, slideConfig); } else { slideText.innerHTML = slideConfig.description; } } else { slideText.parentNode.removeChild(slideText); } (0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_7__.addClass)(slideMedia.parentNode, `desc-${position}`); (0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_7__.addClass)(slideDesc.parentNode, `description-${position}`); } (0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_7__.addClass)(slideMedia, `gslide-${type}`); (0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_7__.addClass)(slide, 'loaded'); if (type === 'video') { _slides_video_js__WEBPACK_IMPORTED_MODULE_3__["default"].apply(this.instance, [slide, slideConfig, this.index, finalCallback]); return; } if (type === 'external') { _slides_iframe_js__WEBPACK_IMPORTED_MODULE_5__["default"].apply(this, [slide, slideConfig, this.index, finalCallback]); return; } if (type === 'inline') { _slides_inline_js__WEBPACK_IMPORTED_MODULE_4__["default"].apply(this.instance, [slide, slideConfig, this.index, finalCallback]); if (slideConfig.draggable) { new _drag_js__WEBPACK_IMPORTED_MODULE_1__["default"]({ dragEl: slide.querySelector('.gslide-inline'), toleranceX: settings.dragToleranceX, toleranceY: settings.dragToleranceY, slide: slide, instance: this.instance }); } return; } if (type === 'image') { (0,_slides_image_js__WEBPACK_IMPORTED_MODULE_2__["default"])(slide, slideConfig, this.index, () => { const img = slide.querySelector('img'); if (slideConfig.draggable) { new _drag_js__WEBPACK_IMPORTED_MODULE_1__["default"]({ dragEl: img, toleranceX: settings.dragToleranceX, toleranceY: settings.dragToleranceY, slide: slide, instance: this.instance }); } if (slideConfig.zoomable && img.naturalWidth > img.offsetWidth) { (0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_7__.addClass)(img, 'zoomable'); new _zoom_js__WEBPACK_IMPORTED_MODULE_0__["default"](img, slide, () => { this.instance.resize(); }); } if ((0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_7__.isFunction)(finalCallback)) { finalCallback(); } }); return; } if ((0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_7__.isFunction)(finalCallback)) { finalCallback(); } } slideShortDesc(string, n = 50, wordBoundary = false) { let div = document.createElement('div'); div.innerHTML = string; let cleanedString = div.innerText; let useWordBoundary = wordBoundary; string = cleanedString.trim(); if (string.length <= n) { return string; } let subString = string.substr(0, n - 1); if (!useWordBoundary) { return subString; } div = null; return subString + '... ' + wordBoundary + ''; } descriptionEvents(desc, data) { let moreLink = desc.querySelector('.desc-more'); if (!moreLink) { return false; } (0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_7__.addEvent)('click', { onElement: moreLink, withCallback: (event, target) => { event.preventDefault(); const body = document.body; let desc = (0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_7__.closest)(target, '.gslide-desc'); if (!desc) { return false; } desc.innerHTML = data.description; (0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_7__.addClass)(body, 'gdesc-open'); let shortEvent = (0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_7__.addEvent)('click', { onElement: [body, (0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_7__.closest)(desc, '.gslide-description')], withCallback: (event, target) => { if (event.target.nodeName.toLowerCase() !== 'a') { (0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_7__.removeClass)(body, 'gdesc-open'); (0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_7__.addClass)(body, 'gdesc-closed'); desc.innerHTML = data.smallDescription; this.descriptionEvents(desc, data); setTimeout(() => { (0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_7__.removeClass)(body, 'gdesc-closed'); }, 400); shortEvent.destroy(); } } }); } }); } /** * Create Slide Node * * @return { node } */ create() { return (0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_7__.createHTML)(this.instance.settings.slideHTML); } /** * Get slide config * returns each individual slide config * it uses SlideConfigParser * each slide can overwrite a global setting * read more in the SlideConfigParser class * * @return { object } */ getConfig() { if (!(0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_7__.isNode)(this.element) && !this.element.hasOwnProperty('draggable')) { this.element.draggable = this.instance.settings.draggable; } const parser = new _slide_parser_js__WEBPACK_IMPORTED_MODULE_6__["default"](this.instance.settings.slideExtraAttributes); this.slideConfig = parser.parseConfig(this.element, this.instance.settings); return this.slideConfig; } } /***/ }), /***/ "./node_modules/glightbox/src/js/core/touch-events.js": /*!************************************************************!*\ !*** ./node_modules/glightbox/src/js/core/touch-events.js ***! \************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ TouchEvents) /* harmony export */ }); function getLen(v) { return Math.sqrt(v.x * v.x + v.y * v.y); } function dot(v1, v2) { return v1.x * v2.x + v1.y * v2.y; } function getAngle(v1, v2) { var mr = getLen(v1) * getLen(v2); if (mr === 0) { return 0; } var r = dot(v1, v2) / mr; if (r > 1) { r = 1; } return Math.acos(r); } function cross(v1, v2) { return v1.x * v2.y - v2.x * v1.y; } function getRotateAngle(v1, v2) { var angle = getAngle(v1, v2); if (cross(v1, v2) > 0) { angle *= -1; } return (angle * 180) / Math.PI; } class EventsHandlerAdmin { constructor(el) { this.handlers = []; this.el = el; } add(handler) { this.handlers.push(handler); } del(handler) { if (!handler) { this.handlers = []; } for (var i = this.handlers.length; i >= 0; i--) { if (this.handlers[i] === handler) { this.handlers.splice(i, 1); } } } dispatch() { for (var i = 0, len = this.handlers.length; i < len; i++) { var handler = this.handlers[i]; if (typeof handler === 'function') { handler.apply(this.el, arguments); } } } } function wrapFunc(el, handler) { var EventshandlerAdmin = new EventsHandlerAdmin(el); EventshandlerAdmin.add(handler); return EventshandlerAdmin; } // Modified version of AlloyFinger class TouchEvents { constructor(el, option) { this.element = typeof el == 'string' ? document.querySelector(el) : el; this.start = this.start.bind(this); this.move = this.move.bind(this); this.end = this.end.bind(this); this.cancel = this.cancel.bind(this); this.element.addEventListener('touchstart', this.start, false); this.element.addEventListener('touchmove', this.move, false); this.element.addEventListener('touchend', this.end, false); this.element.addEventListener('touchcancel', this.cancel, false); this.preV = { x: null, y: null }; this.pinchStartLen = null; this.zoom = 1; this.isDoubleTap = false; var noop = function () {}; this.rotate = wrapFunc(this.element, option.rotate || noop); this.touchStart = wrapFunc(this.element, option.touchStart || noop); this.multipointStart = wrapFunc(this.element, option.multipointStart || noop); this.multipointEnd = wrapFunc(this.element, option.multipointEnd || noop); this.pinch = wrapFunc(this.element, option.pinch || noop); this.swipe = wrapFunc(this.element, option.swipe || noop); this.tap = wrapFunc(this.element, option.tap || noop); this.doubleTap = wrapFunc(this.element, option.doubleTap || noop); this.longTap = wrapFunc(this.element, option.longTap || noop); this.singleTap = wrapFunc(this.element, option.singleTap || noop); this.pressMove = wrapFunc(this.element, option.pressMove || noop); this.twoFingerPressMove = wrapFunc(this.element, option.twoFingerPressMove || noop); this.touchMove = wrapFunc(this.element, option.touchMove || noop); this.touchEnd = wrapFunc(this.element, option.touchEnd || noop); this.touchCancel = wrapFunc(this.element, option.touchCancel || noop); this.translateContainer = this.element; this._cancelAllHandler = this.cancelAll.bind(this); window.addEventListener('scroll', this._cancelAllHandler); this.delta = null; this.last = null; this.now = null; this.tapTimeout = null; this.singleTapTimeout = null; this.longTapTimeout = null; this.swipeTimeout = null; this.x1 = this.x2 = this.y1 = this.y2 = null; this.preTapPosition = { x: null, y: null }; } start(evt) { if (!evt.touches) { return; } // Fix Media Buttons Not responding on Android #233 const ignoreDragFor = ['a', 'button', 'input']; if (evt.target && evt.target.nodeName && ignoreDragFor.indexOf(evt.target.nodeName.toLowerCase()) >= 0) { console.log('ignore drag for this touched element', evt.target.nodeName.toLowerCase()); return; } this.now = Date.now(); this.x1 = evt.touches[0].pageX; this.y1 = evt.touches[0].pageY; this.delta = this.now - (this.last || this.now); this.touchStart.dispatch(evt, this.element); if (this.preTapPosition.x !== null) { this.isDoubleTap = this.delta > 0 && this.delta <= 250 && Math.abs(this.preTapPosition.x - this.x1) < 30 && Math.abs(this.preTapPosition.y - this.y1) < 30; if (this.isDoubleTap) { clearTimeout(this.singleTapTimeout); } } this.preTapPosition.x = this.x1; this.preTapPosition.y = this.y1; this.last = this.now; var preV = this.preV, len = evt.touches.length; if (len > 1) { this._cancelLongTap(); this._cancelSingleTap(); var v = { x: evt.touches[1].pageX - this.x1, y: evt.touches[1].pageY - this.y1 }; preV.x = v.x; preV.y = v.y; this.pinchStartLen = getLen(preV); this.multipointStart.dispatch(evt, this.element); } this._preventTap = false; this.longTapTimeout = setTimeout( function () { this.longTap.dispatch(evt, this.element); this._preventTap = true; }.bind(this), 750 ); } move(evt) { if (!evt.touches) { return; } var preV = this.preV, len = evt.touches.length, currentX = evt.touches[0].pageX, currentY = evt.touches[0].pageY; this.isDoubleTap = false; if (len > 1) { var sCurrentX = evt.touches[1].pageX, sCurrentY = evt.touches[1].pageY; var v = { x: evt.touches[1].pageX - currentX, y: evt.touches[1].pageY - currentY }; if (preV.x !== null) { if (this.pinchStartLen > 0) { evt.zoom = getLen(v) / this.pinchStartLen; this.pinch.dispatch(evt, this.element); } evt.angle = getRotateAngle(v, preV); this.rotate.dispatch(evt, this.element); } preV.x = v.x; preV.y = v.y; if (this.x2 !== null && this.sx2 !== null) { evt.deltaX = (currentX - this.x2 + sCurrentX - this.sx2) / 2; evt.deltaY = (currentY - this.y2 + sCurrentY - this.sy2) / 2; } else { evt.deltaX = 0; evt.deltaY = 0; } this.twoFingerPressMove.dispatch(evt, this.element); this.sx2 = sCurrentX; this.sy2 = sCurrentY; } else { if (this.x2 !== null) { evt.deltaX = currentX - this.x2; evt.deltaY = currentY - this.y2; var movedX = Math.abs(this.x1 - this.x2), movedY = Math.abs(this.y1 - this.y2); if (movedX > 10 || movedY > 10) { this._preventTap = true; } } else { evt.deltaX = 0; evt.deltaY = 0; } this.pressMove.dispatch(evt, this.element); } this.touchMove.dispatch(evt, this.element); this._cancelLongTap(); this.x2 = currentX; this.y2 = currentY; if (len > 1) { evt.preventDefault(); } } end(evt) { if (!evt.changedTouches) { return; } this._cancelLongTap(); var self = this; if (evt.touches.length < 2) { this.multipointEnd.dispatch(evt, this.element); this.sx2 = this.sy2 = null; } //swipe if ((this.x2 && Math.abs(this.x1 - this.x2) > 30) || (this.y2 && Math.abs(this.y1 - this.y2) > 30)) { evt.direction = this._swipeDirection(this.x1, this.x2, this.y1, this.y2); this.swipeTimeout = setTimeout(function () { self.swipe.dispatch(evt, self.element); }, 0); } else { this.tapTimeout = setTimeout(function () { if (!self._preventTap) { self.tap.dispatch(evt, self.element); } // trigger double tap immediately if (self.isDoubleTap) { self.doubleTap.dispatch(evt, self.element); self.isDoubleTap = false; } }, 0); if (!self.isDoubleTap) { self.singleTapTimeout = setTimeout(function () { self.singleTap.dispatch(evt, self.element); }, 250); } } this.touchEnd.dispatch(evt, this.element); this.preV.x = 0; this.preV.y = 0; this.zoom = 1; this.pinchStartLen = null; this.x1 = this.x2 = this.y1 = this.y2 = null; } cancelAll() { this._preventTap = true; clearTimeout(this.singleTapTimeout); clearTimeout(this.tapTimeout); clearTimeout(this.longTapTimeout); clearTimeout(this.swipeTimeout); } cancel(evt) { this.cancelAll(); this.touchCancel.dispatch(evt, this.element); } _cancelLongTap() { clearTimeout(this.longTapTimeout); } _cancelSingleTap() { clearTimeout(this.singleTapTimeout); } _swipeDirection(x1, x2, y1, y2) { return Math.abs(x1 - x2) >= Math.abs(y1 - y2) ? (x1 - x2 > 0 ? 'Left' : 'Right') : y1 - y2 > 0 ? 'Up' : 'Down'; } on(evt, handler) { if (this[evt]) { this[evt].add(handler); } } off(evt, handler) { if (this[evt]) { this[evt].del(handler); } } destroy() { if (this.singleTapTimeout) { clearTimeout(this.singleTapTimeout); } if (this.tapTimeout) { clearTimeout(this.tapTimeout); } if (this.longTapTimeout) { clearTimeout(this.longTapTimeout); } if (this.swipeTimeout) { clearTimeout(this.swipeTimeout); } this.element.removeEventListener('touchstart', this.start); this.element.removeEventListener('touchmove', this.move); this.element.removeEventListener('touchend', this.end); this.element.removeEventListener('touchcancel', this.cancel); this.rotate.del(); this.touchStart.del(); this.multipointStart.del(); this.multipointEnd.del(); this.pinch.del(); this.swipe.del(); this.tap.del(); this.doubleTap.del(); this.longTap.del(); this.singleTap.del(); this.pressMove.del(); this.twoFingerPressMove.del(); this.touchMove.del(); this.touchEnd.del(); this.touchCancel.del(); this.preV = this.pinchStartLen = this.zoom = this.isDoubleTap = this.delta = this.last = this.now = this.tapTimeout = this.singleTapTimeout = this.longTapTimeout = this.swipeTimeout = this.x1 = this.x2 = this.y1 = this.y2 = this.preTapPosition = this.rotate = this.touchStart = this.multipointStart = this.multipointEnd = this.pinch = this.swipe = this.tap = this.doubleTap = this.longTap = this.singleTap = this.pressMove = this.touchMove = this.touchEnd = this.touchCancel = this.twoFingerPressMove = null; window.removeEventListener('scroll', this._cancelAllHandler); return null; } } /***/ }), /***/ "./node_modules/glightbox/src/js/core/touch-navigation.js": /*!****************************************************************!*\ !*** ./node_modules/glightbox/src/js/core/touch-navigation.js ***! \****************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ touchNavigation) /* harmony export */ }); /* harmony import */ var _touch_events_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./touch-events.js */ "./node_modules/glightbox/src/js/core/touch-events.js"); /* harmony import */ var _utils_helpers_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/helpers.js */ "./node_modules/glightbox/src/js/utils/helpers.js"); /** * Touch Navigation * Allow navigation using touch events * * @param {object} instance */ function resetSlideMove(slide) { const transitionEnd = (0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_1__.whichTransitionEvent)(); const windowWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth; let media = (0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_1__.hasClass)(slide, 'gslide-media') ? slide : slide.querySelector('.gslide-media'); let container = (0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_1__.closest)(media, '.ginner-container'); let desc = slide.querySelector('.gslide-description'); if (windowWidth > 769) { media = container; } (0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_1__.addClass)(media, 'greset'); (0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_1__.cssTransform)(media, 'translate3d(0, 0, 0)'); (0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_1__.addEvent)(transitionEnd, { onElement: media, once: true, withCallback: (event, target) => { (0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_1__.removeClass)(media, 'greset'); } }); media.style.opacity = ''; if (desc) { desc.style.opacity = ''; } } function touchNavigation(instance) { if (instance.events.hasOwnProperty('touch')) { return false; } let winSize = (0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_1__.windowSize)(); let winWidth = winSize.width; let winHeight = winSize.height; let process = false; let currentSlide = null; let media = null; let mediaImage = null; let doingMove = false; let initScale = 1; let maxScale = 4.5; let currentScale = 1; let doingZoom = false; let imageZoomed = false; let zoomedPosX = null; let zoomedPosY = null; let lastZoomedPosX = null; let lastZoomedPosY = null; let hDistance; let vDistance; let hDistancePercent = 0; let vDistancePercent = 0; let vSwipe = false; let hSwipe = false; let startCoords = {}; let endCoords = {}; let xDown = 0; let yDown = 0; let isInlined; const sliderWrapper = document.getElementById('glightbox-slider'); const overlay = document.querySelector('.goverlay'); const touchInstance = new _touch_events_js__WEBPACK_IMPORTED_MODULE_0__["default"](sliderWrapper, { touchStart: (e) => { process = true; // TODO: More tests for inline content slides if ((0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_1__.hasClass)(e.targetTouches[0].target, 'ginner-container') || (0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_1__.closest)(e.targetTouches[0].target, '.gslide-desc') || e.targetTouches[0].target.nodeName.toLowerCase() == 'a') { process = false; } if ((0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_1__.closest)(e.targetTouches[0].target, '.gslide-inline') && !(0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_1__.hasClass)(e.targetTouches[0].target.parentNode, 'gslide-inline')) { process = false; } if (process) { endCoords = e.targetTouches[0]; startCoords.pageX = e.targetTouches[0].pageX; startCoords.pageY = e.targetTouches[0].pageY; xDown = e.targetTouches[0].clientX; yDown = e.targetTouches[0].clientY; currentSlide = instance.activeSlide; media = currentSlide.querySelector('.gslide-media'); isInlined = currentSlide.querySelector('.gslide-inline'); mediaImage = null; if ((0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_1__.hasClass)(media, 'gslide-image')) { mediaImage = media.querySelector('img'); } const windowWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth; if (windowWidth > 769) { media = currentSlide.querySelector('.ginner-container'); } (0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_1__.removeClass)(overlay, 'greset'); if (e.pageX > 20 && e.pageX < window.innerWidth - 20) { return; } e.preventDefault(); } }, touchMove: (e) => { if (!process) { return; } endCoords = e.targetTouches[0]; if (doingZoom || imageZoomed) { return; } if (isInlined && isInlined.offsetHeight > winHeight) { // Allow scroll without moving the slide const moved = startCoords.pageX - endCoords.pageX; if (Math.abs(moved) <= 13) { return false; } } doingMove = true; let xUp = e.targetTouches[0].clientX; let yUp = e.targetTouches[0].clientY; let xDiff = xDown - xUp; let yDiff = yDown - yUp; if (Math.abs(xDiff) > Math.abs(yDiff)) { vSwipe = false; hSwipe = true; } else { hSwipe = false; vSwipe = true; } hDistance = endCoords.pageX - startCoords.pageX; hDistancePercent = (hDistance * 100) / winWidth; vDistance = endCoords.pageY - startCoords.pageY; vDistancePercent = (vDistance * 100) / winHeight; let opacity; if (vSwipe && mediaImage) { opacity = 1 - Math.abs(vDistance) / winHeight; overlay.style.opacity = opacity; if (instance.settings.touchFollowAxis) { hDistancePercent = 0; } } if (hSwipe) { opacity = 1 - Math.abs(hDistance) / winWidth; media.style.opacity = opacity; if (instance.settings.touchFollowAxis) { vDistancePercent = 0; } } if (!mediaImage) { return (0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_1__.cssTransform)(media, `translate3d(${hDistancePercent}%, 0, 0)`); } (0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_1__.cssTransform)(media, `translate3d(${hDistancePercent}%, ${vDistancePercent}%, 0)`); }, touchEnd: () => { if (!process) { return; } doingMove = false; if (imageZoomed || doingZoom) { lastZoomedPosX = zoomedPosX; lastZoomedPosY = zoomedPosY; return; } const v = Math.abs(parseInt(vDistancePercent)); const h = Math.abs(parseInt(hDistancePercent)); if (v > 29 && mediaImage) { instance.close(); return; } if (v < 29 && h < 25) { (0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_1__.addClass)(overlay, 'greset'); overlay.style.opacity = 1; return resetSlideMove(media); } }, multipointEnd: () => { setTimeout(() => { doingZoom = false; }, 50); }, multipointStart: () => { doingZoom = true; initScale = currentScale ? currentScale : 1; }, pinch: (evt) => { if (!mediaImage || doingMove) { return false; } doingZoom = true; mediaImage.scaleX = mediaImage.scaleY = initScale * evt.zoom; let scale = initScale * evt.zoom; imageZoomed = true; if (scale <= 1) { imageZoomed = false; scale = 1; lastZoomedPosY = null; lastZoomedPosX = null; zoomedPosX = null; zoomedPosY = null; mediaImage.setAttribute('style', ''); return; } if (scale > maxScale) { // max scale zoom scale = maxScale; } mediaImage.style.transform = `scale3d(${scale}, ${scale}, 1)`; currentScale = scale; }, pressMove: (e) => { if (imageZoomed && !doingZoom) { var mhDistance = endCoords.pageX - startCoords.pageX; var mvDistance = endCoords.pageY - startCoords.pageY; if (lastZoomedPosX) { mhDistance = mhDistance + lastZoomedPosX; } if (lastZoomedPosY) { mvDistance = mvDistance + lastZoomedPosY; } zoomedPosX = mhDistance; zoomedPosY = mvDistance; let style = `translate3d(${mhDistance}px, ${mvDistance}px, 0)`; if (currentScale) { style += ` scale3d(${currentScale}, ${currentScale}, 1)`; } (0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_1__.cssTransform)(mediaImage, style); } }, swipe: (evt) => { if (imageZoomed) { return; } if (doingZoom) { doingZoom = false; return; } if (evt.direction == 'Left') { if (instance.index == instance.elements.length - 1) { return resetSlideMove(media); } instance.nextSlide(); } if (evt.direction == 'Right') { if (instance.index == 0) { return resetSlideMove(media); } instance.prevSlide(); } } }); instance.events['touch'] = touchInstance; } /***/ }), /***/ "./node_modules/glightbox/src/js/core/zoom.js": /*!****************************************************!*\ !*** ./node_modules/glightbox/src/js/core/zoom.js ***! \****************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ ZoomImages) /* harmony export */ }); /** * ZoomImages * Allow imaes to zoom and drag * for desktops * * @param {node} img node * @param {node} slide container * @param {function} function to trigger on close */ class ZoomImages { constructor(el, slide, onclose = null) { this.img = el; this.slide = slide; this.onclose = onclose; if (this.img.setZoomEvents) { return false; } this.active = false; this.zoomedIn = false; this.dragging = false; this.currentX = null; this.currentY = null; this.initialX = null; this.initialY = null; this.xOffset = 0; this.yOffset = 0; this.img.addEventListener('mousedown', (e) => this.dragStart(e), false); this.img.addEventListener('mouseup', (e) => this.dragEnd(e), false); this.img.addEventListener('mousemove', (e) => this.drag(e), false); this.img.addEventListener( 'click', (e) => { if (this.slide.classList.contains('dragging-nav')) { this.zoomOut(); return false; } if (!this.zoomedIn) { return this.zoomIn(); } if (this.zoomedIn && !this.dragging) { this.zoomOut(); } }, false ); this.img.setZoomEvents = true; } zoomIn() { let winWidth = this.widowWidth(); if (this.zoomedIn || winWidth <= 768) { return; } const img = this.img; img.setAttribute('data-style', img.getAttribute('style')); img.style.maxWidth = img.naturalWidth + 'px'; img.style.maxHeight = img.naturalHeight + 'px'; if (img.naturalWidth > winWidth) { let centerX = winWidth / 2 - img.naturalWidth / 2; this.setTranslate(this.img.parentNode, centerX, 0); } this.slide.classList.add('zoomed'); this.zoomedIn = true; } zoomOut() { this.img.parentNode.setAttribute('style', ''); this.img.setAttribute('style', this.img.getAttribute('data-style')); this.slide.classList.remove('zoomed'); this.zoomedIn = false; this.currentX = null; this.currentY = null; this.initialX = null; this.initialY = null; this.xOffset = 0; this.yOffset = 0; if (this.onclose && typeof this.onclose == 'function') { this.onclose(); } } dragStart(e) { e.preventDefault(); if (!this.zoomedIn) { this.active = false; return; } if (e.type === 'touchstart') { this.initialX = e.touches[0].clientX - this.xOffset; this.initialY = e.touches[0].clientY - this.yOffset; } else { this.initialX = e.clientX - this.xOffset; this.initialY = e.clientY - this.yOffset; } if (e.target === this.img) { this.active = true; this.img.classList.add('dragging'); } } dragEnd(e) { e.preventDefault(); this.initialX = this.currentX; this.initialY = this.currentY; this.active = false; setTimeout(() => { this.dragging = false; this.img.isDragging = false; this.img.classList.remove('dragging'); }, 100); } drag(e) { if (this.active) { e.preventDefault(); if (e.type === 'touchmove') { this.currentX = e.touches[0].clientX - this.initialX; this.currentY = e.touches[0].clientY - this.initialY; } else { this.currentX = e.clientX - this.initialX; this.currentY = e.clientY - this.initialY; } this.xOffset = this.currentX; this.yOffset = this.currentY; this.img.isDragging = true; this.dragging = true; this.setTranslate(this.img, this.currentX, this.currentY); } } onMove(e) { if (!this.zoomedIn) { return; } let xOffset = e.clientX - this.img.naturalWidth / 2; let yOffset = e.clientY - this.img.naturalHeight / 2; this.setTranslate(this.img, xOffset, yOffset); } setTranslate(node, xPos, yPos) { node.style.transform = 'translate3d(' + xPos + 'px, ' + yPos + 'px, 0)'; } widowWidth() { return window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth; } } /***/ }), /***/ "./node_modules/glightbox/src/js/glightbox.js": /*!****************************************************!*\ !*** ./node_modules/glightbox/src/js/glightbox.js ***! \****************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* export default binding */ __WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _core_keyboard_navigation_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./core/keyboard-navigation.js */ "./node_modules/glightbox/src/js/core/keyboard-navigation.js"); /* harmony import */ var _core_touch_navigation_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./core/touch-navigation.js */ "./node_modules/glightbox/src/js/core/touch-navigation.js"); /* harmony import */ var _core_slide_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./core/slide.js */ "./node_modules/glightbox/src/js/core/slide.js"); /* harmony import */ var _utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils/helpers.js */ "./node_modules/glightbox/src/js/utils/helpers.js"); /** * GLightbox * Awesome pure javascript lightbox * made by https://www.biati.digital * Github: https://github.com/biati-digital/glightbox */ const version = '3.2.0'; const isMobile = _utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.isMobile(); const isTouch = _utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.isTouch(); const html = document.getElementsByTagName('html')[0]; const defaults = { selector: '.glightbox', elements: null, skin: 'clean', theme: 'clean', closeButton: true, startAt: null, autoplayVideos: true, autofocusVideos: true, descPosition: 'bottom', width: '900px', height: '506px', videosWidth: '960px', beforeSlideChange: null, afterSlideChange: null, beforeSlideLoad: null, afterSlideLoad: null, slideInserted: null, slideRemoved: null, slideExtraAttributes: null, onOpen: null, onClose: null, loop: false, zoomable: true, draggable: true, dragAutoSnap: false, dragToleranceX: 40, dragToleranceY: 65, preload: true, oneSlidePerOpen: false, touchNavigation: true, touchFollowAxis: true, keyboardNavigation: true, closeOnOutsideClick: true, plugins: false, plyr: { css: 'https://cdn.plyr.io/3.6.12/plyr.css', js: 'https://cdn.plyr.io/3.6.12/plyr.js', config: { ratio: '16:9', // or '4:3' fullscreen: { enabled: true, iosNative: true }, youtube: { noCookie: true, rel: 0, showinfo: 0, iv_load_policy: 3 // eslint-disable-line camelcase }, vimeo: { byline: false, portrait: false, title: false, transparent: false } } }, openEffect: 'zoom', // fade, zoom, none closeEffect: 'zoom', // fade, zoom, none slideEffect: 'slide', // fade, slide, zoom, none moreText: 'See more', moreLength: 60, cssEfects: { fade: { in: 'fadeIn', out: 'fadeOut' }, zoom: { in: 'zoomIn', out: 'zoomOut' }, slide: { in: 'slideInRight', out: 'slideOutLeft' }, slideBack: { in: 'slideInLeft', out: 'slideOutRight' }, none: { in: 'none', out: 'none' } }, svg: { close: '', next: ' ', prev: '' } }; // You can pass your own slide structure // just make sure that add the same classes so they are populated // title class = gslide-title // desc class = gslide-desc // prev arrow class = gnext // next arrow id = gprev // close id = gclose defaults.slideHTML = `

`; defaults.lightboxHTML = ``; /** * GLightbox Class * Class and public methods */ class GlightboxInit { constructor(options = {}) { this.customOptions = options; this.settings = _utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.extend(defaults, options); this.effectsClasses = this.getAnimationClasses(); this.videoPlayers = {}; this.apiEvents = []; this.fullElementsList = false; } init() { const selector = this.getSelector(); if (selector) { this.baseEvents = _utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.addEvent('click', { onElement: selector, withCallback: (e, target) => { e.preventDefault(); this.open(target); } }); } this.elements = this.getElements(); } open(element = null, startAt = null) { if (this.elements.length === 0) { return false; } this.activeSlide = null; this.prevActiveSlideIndex = null; this.prevActiveSlide = null; let index = _utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.isNumber(startAt) ? startAt : this.settings.startAt; if (_utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.isNode(element)) { const gallery = element.getAttribute('data-gallery'); if (gallery) { this.fullElementsList = this.elements; this.elements = this.getGalleryElements(this.elements, gallery); } if (_utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.isNil(index)) { // get the index of the element index = this.getElementIndex(element); if (index < 0) { index = 0; } } } if (!_utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.isNumber(index)) { index = 0; } this.build(); _utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.animateElement(this.overlay, this.settings.openEffect === 'none' ? 'none' : this.settings.cssEfects.fade.in); const body = document.body; const scrollBar = window.innerWidth - document.documentElement.clientWidth; if (scrollBar > 0) { var styleSheet = document.createElement('style'); styleSheet.type = 'text/css'; styleSheet.className = 'gcss-styles'; styleSheet.innerText = `.gscrollbar-fixer {margin-right: ${scrollBar}px}`; document.head.appendChild(styleSheet); _utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.addClass(body, 'gscrollbar-fixer'); } _utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.addClass(body, 'glightbox-open'); _utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.addClass(html, 'glightbox-open'); if (isMobile) { _utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.addClass(document.body, 'glightbox-mobile'); this.settings.slideEffect = 'slide'; } this.showSlide(index, true); if (this.elements.length === 1) { _utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.addClass(this.prevButton, 'glightbox-button-hidden'); _utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.addClass(this.nextButton, 'glightbox-button-hidden'); } else { _utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.removeClass(this.prevButton, 'glightbox-button-hidden'); _utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.removeClass(this.nextButton, 'glightbox-button-hidden'); } this.lightboxOpen = true; this.trigger('open'); // settings.onOpen is deprecated and will be removed in a future update if (_utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.isFunction(this.settings.onOpen)) { this.settings.onOpen(); } if (isTouch && this.settings.touchNavigation) { (0,_core_touch_navigation_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this); } if (this.settings.keyboardNavigation) { (0,_core_keyboard_navigation_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this); } } /** * Open at specific index * @param {int} index */ openAt(index = 0) { this.open(null, index); } /** * Set Slide */ showSlide(index = 0, first = false) { _utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.show(this.loader); this.index = parseInt(index); let current = this.slidesContainer.querySelector('.current'); if (current) { _utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.removeClass(current, 'current'); } // hide prev slide this.slideAnimateOut(); let slideNode = this.slidesContainer.querySelectorAll('.gslide')[index]; // Check if slide's content is alreay loaded if (_utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.hasClass(slideNode, 'loaded')) { this.slideAnimateIn(slideNode, first); _utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.hide(this.loader); } else { // If not loaded add the slide content _utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.show(this.loader); const slide = this.elements[index]; const slideData = { index: this.index, slide: slideNode, //this will be removed in the future slideNode: slideNode, slideConfig: slide.slideConfig, slideIndex: this.index, trigger: slide.node, player: null }; this.trigger('slide_before_load', slideData); slide.instance.setContent(slideNode, () => { _utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.hide(this.loader); this.resize(); this.slideAnimateIn(slideNode, first); this.trigger('slide_after_load', slideData); }); } this.slideDescription = slideNode.querySelector('.gslide-description'); this.slideDescriptionContained = this.slideDescription && _utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.hasClass(this.slideDescription.parentNode, 'gslide-media'); // Preload subsequent slides if (this.settings.preload) { this.preloadSlide(index + 1); this.preloadSlide(index - 1); } // Handle navigation arrows this.updateNavigationClasses(); this.activeSlide = slideNode; } /** * Preload slides * @param {Int} index slide index * @return {null} */ preloadSlide(index) { // Verify slide index, it can not be lower than 0 // and it can not be greater than the total elements if (index < 0 || index > this.elements.length - 1) { return false; } if (_utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.isNil(this.elements[index])) { return false; } let slideNode = this.slidesContainer.querySelectorAll('.gslide')[index]; if (_utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.hasClass(slideNode, 'loaded')) { return false; } const slide = this.elements[index]; const type = slide.type; const slideData = { index: index, slide: slideNode, //this will be removed in the future slideNode: slideNode, slideConfig: slide.slideConfig, slideIndex: index, trigger: slide.node, player: null }; this.trigger('slide_before_load', slideData); if (type === 'video' || type === 'external') { setTimeout(() => { slide.instance.setContent(slideNode, () => { this.trigger('slide_after_load', slideData); }); }, 200); } else { slide.instance.setContent(slideNode, () => { this.trigger('slide_after_load', slideData); }); } } /** * Load previous slide * calls goToslide */ prevSlide() { this.goToSlide(this.index - 1); } /** * Load next slide * calls goToslide */ nextSlide() { this.goToSlide(this.index + 1); } /** * Go to sldei * calls set slide * @param {Int} - index */ goToSlide(index = false) { this.prevActiveSlide = this.activeSlide; this.prevActiveSlideIndex = this.index; if (!this.loop() && (index < 0 || index > this.elements.length - 1)) { return false; } if (index < 0) { index = this.elements.length - 1; } else if (index >= this.elements.length) { index = 0; } this.showSlide(index); } /** * Insert slide * * @param { object } data * @param { numeric } position */ insertSlide(config = {}, index = -1) { // Append at the end if (index < 0) { index = this.elements.length; } const slide = new _core_slide_js__WEBPACK_IMPORTED_MODULE_2__["default"](config, this, index); const data = slide.getConfig(); const slideInfo = _utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.extend({}, data); const newSlide = slide.create(); const totalSlides = this.elements.length - 1; slideInfo.index = index; slideInfo.node = false; slideInfo.instance = slide; slideInfo.slideConfig = data; this.elements.splice(index, 0, slideInfo); let addedSlideNode = null; let addedSlidePlayer = null; if (this.slidesContainer) { // Append at the end if (index > totalSlides) { this.slidesContainer.appendChild(newSlide); } else { // A current slide must exist in the position specified // we need tp get that slide and insder the new slide before let existingSlide = this.slidesContainer.querySelectorAll('.gslide')[index]; this.slidesContainer.insertBefore(newSlide, existingSlide); } if ((this.settings.preload && this.index == 0 && index == 0) || this.index - 1 == index || this.index + 1 == index) { this.preloadSlide(index); } if (this.index === 0 && index === 0) { this.index = 1; } this.updateNavigationClasses(); addedSlideNode = this.slidesContainer.querySelectorAll('.gslide')[index]; addedSlidePlayer = this.getSlidePlayerInstance(index); slideInfo.slideNode = addedSlideNode; } this.trigger('slide_inserted', { index: index, slide: addedSlideNode, slideNode: addedSlideNode, slideConfig: data, slideIndex: index, trigger: null, player: addedSlidePlayer }); // Deprecated and will be removed in a future update if (_utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.isFunction(this.settings.slideInserted)) { this.settings.slideInserted({ index: index, slide: addedSlideNode, player: addedSlidePlayer }); } } /** * Remove slide * * @param { numeric } position */ removeSlide(index = -1) { if (index < 0 || index > this.elements.length - 1) { return false; } const slide = this.slidesContainer && this.slidesContainer.querySelectorAll('.gslide')[index]; if (slide) { if (this.getActiveSlideIndex() == index) { if (index == this.elements.length - 1) { this.prevSlide(); } else { this.nextSlide(); } } slide.parentNode.removeChild(slide); } this.elements.splice(index, 1); this.trigger('slide_removed', index); // Deprecated and will be removed in a future update if (_utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.isFunction(this.settings.slideRemoved)) { this.settings.slideRemoved(index); } } /** * Slide In * @return {null} */ slideAnimateIn(slide, first) { let slideMedia = slide.querySelector('.gslide-media'); let slideDesc = slide.querySelector('.gslide-description'); let prevData = { index: this.prevActiveSlideIndex, slide: this.prevActiveSlide, //this will be removed in the future slideNode: this.prevActiveSlide, slideIndex: this.prevActiveSlide, slideConfig: _utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.isNil(this.prevActiveSlideIndex) ? null : this.elements[this.prevActiveSlideIndex].slideConfig, trigger: _utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.isNil(this.prevActiveSlideIndex) ? null : this.elements[this.prevActiveSlideIndex].node, player: this.getSlidePlayerInstance(this.prevActiveSlideIndex) }; let nextData = { index: this.index, slide: this.activeSlide, //this will be removed in the future slideNode: this.activeSlide, slideConfig: this.elements[this.index].slideConfig, slideIndex: this.index, trigger: this.elements[this.index].node, player: this.getSlidePlayerInstance(this.index) }; if (slideMedia.offsetWidth > 0 && slideDesc) { _utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.hide(slideDesc); slideDesc.style.display = ''; } _utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.removeClass(slide, this.effectsClasses); if (first) { _utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.animateElement(slide, this.settings.cssEfects[this.settings.openEffect].in, () => { if (this.settings.autoplayVideos) { this.slidePlayerPlay(slide); } this.trigger('slide_changed', { prev: prevData, current: nextData }); // settings.afterSlideChange is deprecated and will be removed in a future update if (_utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.isFunction(this.settings.afterSlideChange)) { this.settings.afterSlideChange.apply(this, [prevData, nextData]); } }); } else { let effectName = this.settings.slideEffect; let animIn = effectName !== 'none' ? this.settings.cssEfects[effectName].in : effectName; if (this.prevActiveSlideIndex > this.index) { if (this.settings.slideEffect == 'slide') { animIn = this.settings.cssEfects.slideBack.in; } } _utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.animateElement(slide, animIn, () => { if (this.settings.autoplayVideos) { this.slidePlayerPlay(slide); } this.trigger('slide_changed', { prev: prevData, current: nextData }); // settings.afterSlideChange is deprecated and will be removed in a future update if (_utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.isFunction(this.settings.afterSlideChange)) { this.settings.afterSlideChange.apply(this, [prevData, nextData]); } }); } setTimeout(() => { this.resize(slide); }, 100); _utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.addClass(slide, 'current'); } /** * Slide out */ slideAnimateOut() { if (!this.prevActiveSlide) { return false; } let prevSlide = this.prevActiveSlide; _utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.removeClass(prevSlide, this.effectsClasses); _utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.addClass(prevSlide, 'prev'); let animation = this.settings.slideEffect; let animOut = animation !== 'none' ? this.settings.cssEfects[animation].out : animation; this.slidePlayerPause(prevSlide); this.trigger('slide_before_change', { prev: { index: this.prevActiveSlideIndex, //this will be removed in the future slide: this.prevActiveSlide, //this will be removed in the future slideNode: this.prevActiveSlide, slideIndex: this.prevActiveSlideIndex, slideConfig: _utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.isNil(this.prevActiveSlideIndex) ? null : this.elements[this.prevActiveSlideIndex].slideConfig, trigger: _utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.isNil(this.prevActiveSlideIndex) ? null : this.elements[this.prevActiveSlideIndex].node, player: this.getSlidePlayerInstance(this.prevActiveSlideIndex) }, current: { index: this.index, //this will be removed in the future slide: this.activeSlide, //this will be removed in the future slideNode: this.activeSlide, slideIndex: this.index, slideConfig: this.elements[this.index].slideConfig, trigger: this.elements[this.index].node, player: this.getSlidePlayerInstance(this.index) } }); // settings.beforeSlideChange is deprecated and will be removed in a future update if (_utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.isFunction(this.settings.beforeSlideChange)) { this.settings.beforeSlideChange.apply(this, [ { index: this.prevActiveSlideIndex, slide: this.prevActiveSlide, player: this.getSlidePlayerInstance(this.prevActiveSlideIndex) }, { index: this.index, slide: this.activeSlide, player: this.getSlidePlayerInstance(this.index) } ]); } if (this.prevActiveSlideIndex > this.index && this.settings.slideEffect == 'slide') { // going back animOut = this.settings.cssEfects.slideBack.out; } _utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.animateElement(prevSlide, animOut, () => { let container = prevSlide.querySelector('.ginner-container'); let media = prevSlide.querySelector('.gslide-media'); let desc = prevSlide.querySelector('.gslide-description'); container.style.transform = ''; media.style.transform = ''; _utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.removeClass(media, 'greset'); media.style.opacity = ''; if (desc) { desc.style.opacity = ''; } _utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.removeClass(prevSlide, 'prev'); }); } /** * Get all defined players */ getAllPlayers() { return this.videoPlayers; } /** * Get player at index * * @param index * @return bool|object */ getSlidePlayerInstance(index) { const id = 'gvideo' + index; const videoPlayers = this.getAllPlayers(); if (_utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.has(videoPlayers, id) && videoPlayers[id]) { return videoPlayers[id]; } return false; } /** * Stop video at specified * node or index * * @param slide node or index * @return void */ stopSlideVideo(slide) { if (_utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.isNode(slide)) { let node = slide.querySelector('.gvideo-wrapper'); if (node) { slide = node.getAttribute('data-index'); } } console.log('stopSlideVideo is deprecated, use slidePlayerPause'); const player = this.getSlidePlayerInstance(slide); if (player && player.playing) { player.pause(); } } /** * Stop player at specified index * * @param slide node or index * @return void */ slidePlayerPause(slide) { if (_utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.isNode(slide)) { let node = slide.querySelector('.gvideo-wrapper'); if (node) { slide = node.getAttribute('data-index'); } } const player = this.getSlidePlayerInstance(slide); if (player && player.playing) { player.pause(); } } /** * Play video at specified * node or index * * @param slide node or index * @return void */ playSlideVideo(slide) { if (_utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.isNode(slide)) { let node = slide.querySelector('.gvideo-wrapper'); if (node) { slide = node.getAttribute('data-index'); } } console.log('playSlideVideo is deprecated, use slidePlayerPlay'); const player = this.getSlidePlayerInstance(slide); if (player && !player.playing) { player.play(); } } /** * Play media player at specified * node or index * * @param slide node or index * @return void */ slidePlayerPlay(slide) { // Do not autoplay on mobile // plyr does not handle well the errors // and the player becomes unplayable if (isMobile && !this.settings.plyr.config?.muted) { return; } if (_utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.isNode(slide)) { let node = slide.querySelector('.gvideo-wrapper'); if (node) { slide = node.getAttribute('data-index'); } } const player = this.getSlidePlayerInstance(slide); if (player && !player.playing) { player.play(); if (this.settings.autofocusVideos) { player.elements.container.focus(); } } } /** * Set the entire elements * in the gallery, it replaces all * the existing elements * with the specified list * * @param {array} elements */ setElements(elements) { this.settings.elements = false; const newElements = []; if (elements && elements.length) { _utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.each(elements, (el, i) => { const slide = new _core_slide_js__WEBPACK_IMPORTED_MODULE_2__["default"](el, this, i); const data = slide.getConfig(); const slideInfo = _utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.extend({}, data); slideInfo.slideConfig = data; slideInfo.instance = slide; slideInfo.index = i; newElements.push(slideInfo); }); } this.elements = newElements; if (this.lightboxOpen) { this.slidesContainer.innerHTML = ''; if (this.elements.length) { _utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.each(this.elements, () => { let slide = _utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.createHTML(this.settings.slideHTML); this.slidesContainer.appendChild(slide); }); this.showSlide(0, true); } } } /** * Return the index * of the specified node, * this node is for example an image, link, etc. * that when clicked it opens the lightbox * its position in the elements array can change * when using insertSlide or removeSlide so we * need to find it in the elements list * * @param {node} node * @return bool|int */ getElementIndex(node) { let index = false; _utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.each(this.elements, (el, i) => { if (_utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.has(el, 'node') && el.node == node) { index = i; return true; // exit loop } }); return index; } /** * Get elements * returns an array containing all * the elements that must be displayed in the * lightbox * * @return { array } */ getElements() { let list = []; this.elements = this.elements ? this.elements : []; if (!_utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.isNil(this.settings.elements) && _utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.isArray(this.settings.elements) && this.settings.elements.length) { _utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.each(this.settings.elements, (el, i) => { const slide = new _core_slide_js__WEBPACK_IMPORTED_MODULE_2__["default"](el, this, i); const elData = slide.getConfig(); const slideInfo = _utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.extend({}, elData); slideInfo.node = false; slideInfo.index = i; slideInfo.instance = slide; slideInfo.slideConfig = elData; list.push(slideInfo); }); } let nodes = false; let selector = this.getSelector(); if (selector) { nodes = document.querySelectorAll(this.getSelector()); } if (!nodes) { return list; } _utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.each(nodes, (el, i) => { const slide = new _core_slide_js__WEBPACK_IMPORTED_MODULE_2__["default"](el, this, i); const elData = slide.getConfig(); const slideInfo = _utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.extend({}, elData); slideInfo.node = el; slideInfo.index = i; slideInfo.instance = slide; slideInfo.slideConfig = elData; slideInfo.gallery = el.getAttribute('data-gallery'); list.push(slideInfo); }); return list; } /** * Return only the elements * from a specific gallery * * @return array */ getGalleryElements(list, gallery) { return list.filter((el) => { return el.gallery == gallery; }); } /** * Get selector */ getSelector() { if (this.settings.elements) { return false; } if (this.settings.selector && this.settings.selector.substring(0, 5) == 'data-') { return `*[${this.settings.selector}]`; } return this.settings.selector; } /** * Get the active slide */ getActiveSlide() { return this.slidesContainer.querySelectorAll('.gslide')[this.index]; } /** * Get the active index */ getActiveSlideIndex() { return this.index; } /** * Get the defined * effects as string */ getAnimationClasses() { let effects = []; for (let key in this.settings.cssEfects) { if (this.settings.cssEfects.hasOwnProperty(key)) { let effect = this.settings.cssEfects[key]; effects.push(`g${effect.in}`); effects.push(`g${effect.out}`); } } return effects.join(' '); } /** * Build the structure * @return {null} */ build() { if (this.built) { return false; } // TODO: :scope is not supported on IE or first Edge. so we'll // update this when IE support is removed to use newer code //const children = document.body.querySelectorAll(':scope > *'); const children = document.body.childNodes; const bodyChildElms = []; _utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.each(children, (el) => { if (el.parentNode == document.body && el.nodeName.charAt(0) !== '#' && el.hasAttribute && !el.hasAttribute('aria-hidden')) { bodyChildElms.push(el); el.setAttribute('aria-hidden', 'true'); } }); const nextSVG = _utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.has(this.settings.svg, 'next') ? this.settings.svg.next : ''; const prevSVG = _utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.has(this.settings.svg, 'prev') ? this.settings.svg.prev : ''; const closeSVG = _utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.has(this.settings.svg, 'close') ? this.settings.svg.close : ''; let lightboxHTML = this.settings.lightboxHTML; lightboxHTML = lightboxHTML.replace(/{nextSVG}/g, nextSVG); lightboxHTML = lightboxHTML.replace(/{prevSVG}/g, prevSVG); lightboxHTML = lightboxHTML.replace(/{closeSVG}/g, closeSVG); lightboxHTML = _utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.createHTML(lightboxHTML); document.body.appendChild(lightboxHTML); const modal = document.getElementById('glightbox-body'); this.modal = modal; let closeButton = modal.querySelector('.gclose'); this.prevButton = modal.querySelector('.gprev'); this.nextButton = modal.querySelector('.gnext'); this.overlay = modal.querySelector('.goverlay'); this.loader = modal.querySelector('.gloader'); this.slidesContainer = document.getElementById('glightbox-slider'); this.bodyHiddenChildElms = bodyChildElms; this.events = {}; _utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.addClass(this.modal, 'glightbox-' + this.settings.skin); if (this.settings.closeButton && closeButton) { this.events['close'] = _utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.addEvent('click', { onElement: closeButton, withCallback: (e, target) => { e.preventDefault(); this.close(); } }); } if (closeButton && !this.settings.closeButton) { closeButton.parentNode.removeChild(closeButton); } if (this.nextButton) { this.events['next'] = _utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.addEvent('click', { onElement: this.nextButton, withCallback: (e, target) => { e.preventDefault(); this.nextSlide(); } }); } if (this.prevButton) { this.events['prev'] = _utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.addEvent('click', { onElement: this.prevButton, withCallback: (e, target) => { e.preventDefault(); this.prevSlide(); } }); } if (this.settings.closeOnOutsideClick) { this.events['outClose'] = _utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.addEvent('click', { onElement: modal, withCallback: (e, target) => { if (!this.preventOutsideClick && !_utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.hasClass(document.body, 'glightbox-mobile') && !_utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.closest(e.target, '.ginner-container')) { if (!_utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.closest(e.target, '.gbtn') && !_utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.hasClass(e.target, 'gnext') && !_utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.hasClass(e.target, 'gprev')) { this.close(); } } } }); } _utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.each(this.elements, (slide, i) => { this.slidesContainer.appendChild(slide.instance.create()); slide.slideNode = this.slidesContainer.querySelectorAll('.gslide')[i]; }); if (isTouch) { _utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.addClass(document.body, 'glightbox-touch'); } this.events['resize'] = _utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.addEvent('resize', { onElement: window, withCallback: () => { this.resize(); } }); this.built = true; } /** * Handle resize * Create only to handle * when the height of the screen * is lower than the slide content * this helps to resize videos vertically * and images with description */ resize(slide = null) { slide = !slide ? this.activeSlide : slide; if (!slide || _utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.hasClass(slide, 'zoomed')) { return; } const winSize = _utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.windowSize(); const video = slide.querySelector('.gvideo-wrapper'); const image = slide.querySelector('.gslide-image'); const description = this.slideDescription; let winWidth = winSize.width; let winHeight = winSize.height; if (winWidth <= 768) { _utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.addClass(document.body, 'glightbox-mobile'); } else { _utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.removeClass(document.body, 'glightbox-mobile'); } if (!video && !image) { return; } let descriptionResize = false; if (description && (_utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.hasClass(description, 'description-bottom') || _utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.hasClass(description, 'description-top')) && !_utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.hasClass(description, 'gabsolute')) { descriptionResize = true; } if (image) { if (winWidth <= 768) { let imgNode = image.querySelector('img'); //imgNode.setAttribute('style', ''); } else if (descriptionResize) { let descHeight = description.offsetHeight; let imgNode = image.querySelector('img'); imgNode.setAttribute('style', `max-height: calc(100vh - ${descHeight}px)`); description.setAttribute('style', `max-width: ${imgNode.offsetWidth}px;`); } } if (video) { let ratio = _utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.has(this.settings.plyr.config, 'ratio') ? this.settings.plyr.config.ratio : ''; if (!ratio) { // If no ratio passed, calculate it using the video width and height // generated by Plyr const containerWidth = video.clientWidth; const containerHeight = video.clientHeight; const divisor = containerWidth / containerHeight; ratio = `${containerWidth / divisor}:${containerHeight / divisor}`; } let videoRatio = ratio.split(':'); let videoWidth = this.settings.videosWidth; let maxWidth = this.settings.videosWidth; if (_utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.isNumber(videoWidth) || videoWidth.indexOf('px') !== -1) { maxWidth = parseInt(videoWidth); } else { // If video size is vw, vh or % convert it to pixels, // fallback to the current video size if (videoWidth.indexOf('vw') !== -1) { maxWidth = (winWidth * parseInt(videoWidth)) / 100; } else if (videoWidth.indexOf('vh') !== -1) { maxWidth = (winHeight * parseInt(videoWidth)) / 100; } else if (videoWidth.indexOf('%') !== -1) { maxWidth = (winWidth * parseInt(videoWidth)) / 100; } else { maxWidth = parseInt(video.clientWidth); } } let maxHeight = maxWidth / (parseInt(videoRatio[0]) / parseInt(videoRatio[1])); maxHeight = Math.floor(maxHeight); if (descriptionResize) { winHeight = winHeight - description.offsetHeight; } if (maxWidth > winWidth || maxHeight > winHeight || (winHeight < maxHeight && winWidth > maxWidth)) { let vwidth = video.offsetWidth; let vheight = video.offsetHeight; let ratio = winHeight / vheight; let vsize = { width: vwidth * ratio, height: vheight * ratio }; video.parentNode.setAttribute('style', `max-width: ${vsize.width}px`); if (descriptionResize) { description.setAttribute('style', `max-width: ${vsize.width}px;`); } } else { video.parentNode.style.maxWidth = `${videoWidth}`; if (descriptionResize) { description.setAttribute('style', `max-width: ${videoWidth};`); } } } } /** * Reload Lightbox * reload and apply events to nodes */ reload() { this.init(); } /** * Update navigation classes on slide change */ updateNavigationClasses() { const loop = this.loop(); // Handle navigation arrows _utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.removeClass(this.nextButton, 'disabled'); _utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.removeClass(this.prevButton, 'disabled'); if (this.index == 0 && this.elements.length - 1 == 0) { _utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.addClass(this.prevButton, 'disabled'); _utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.addClass(this.nextButton, 'disabled'); } else if (this.index === 0 && !loop) { _utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.addClass(this.prevButton, 'disabled'); } else if (this.index === this.elements.length - 1 && !loop) { _utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.addClass(this.nextButton, 'disabled'); } } /** * Handle loop config */ loop() { let loop = _utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.has(this.settings, 'loopAtEnd') ? this.settings.loopAtEnd : null; loop = _utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.has(this.settings, 'loop') ? this.settings.loop : loop; return loop; } /** * Close Lightbox * closes the lightbox and removes the slides * and some classes */ close() { if (!this.lightboxOpen) { if (this.events) { for (let key in this.events) { if (this.events.hasOwnProperty(key)) { this.events[key].destroy(); } } this.events = null; } return false; } if (this.closing) { return false; } this.closing = true; this.slidePlayerPause(this.activeSlide); if (this.fullElementsList) { this.elements = this.fullElementsList; } if (this.bodyHiddenChildElms.length) { _utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.each(this.bodyHiddenChildElms, (el) => { el.removeAttribute('aria-hidden'); }); } _utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.addClass(this.modal, 'glightbox-closing'); _utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.animateElement(this.overlay, this.settings.openEffect == 'none' ? 'none' : this.settings.cssEfects.fade.out); _utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.animateElement(this.activeSlide, this.settings.cssEfects[this.settings.closeEffect].out, () => { this.activeSlide = null; this.prevActiveSlideIndex = null; this.prevActiveSlide = null; this.built = false; if (this.events) { for (let key in this.events) { if (this.events.hasOwnProperty(key)) { this.events[key].destroy(); } } this.events = null; } const body = document.body; _utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.removeClass(html, 'glightbox-open'); _utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.removeClass(body, 'glightbox-open touching gdesc-open glightbox-touch glightbox-mobile gscrollbar-fixer'); this.modal.parentNode.removeChild(this.modal); this.trigger('close'); // settings.onClose is deprecated and will be removed in a future update if (_utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.isFunction(this.settings.onClose)) { this.settings.onClose(); } const styles = document.querySelector('.gcss-styles'); if (styles) { styles.parentNode.removeChild(styles); } this.lightboxOpen = false; this.closing = null; }); } /** * Destroy lightbox * and all events */ destroy() { this.close(); this.clearAllEvents(); if (this.baseEvents) { this.baseEvents.destroy(); } } /** * Set event */ on(evt, callback, once = false) { if (!evt || !_utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.isFunction(callback)) { throw new TypeError('Event name and callback must be defined'); } this.apiEvents.push({ evt, once, callback }); } /** * Set event */ once(evt, callback) { this.on(evt, callback, true); } /** * Triggers an specific event * with data * * @param string eventName */ trigger(eventName, data = null) { const onceTriggered = []; _utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.each(this.apiEvents, (event, i) => { const { evt, once, callback } = event; if (evt == eventName) { callback(data); if (once) { onceTriggered.push(i); } } }); if (onceTriggered.length) { _utils_helpers_js__WEBPACK_IMPORTED_MODULE_3__.each(onceTriggered, (i) => this.apiEvents.splice(i, 1)); } } /** * Removes all events * set using the API */ clearAllEvents() { this.apiEvents.splice(0, this.apiEvents.length); } /** * Get Version */ version() { return version; } } /* harmony default export */ function __WEBPACK_DEFAULT_EXPORT__(options = {}) { const instance = new GlightboxInit(options); instance.init(); return instance; } /***/ }), /***/ "./node_modules/glightbox/src/js/slides/iframe.js": /*!********************************************************!*\ !*** ./node_modules/glightbox/src/js/slides/iframe.js ***! \********************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ slideIframe) /* harmony export */ }); /* harmony import */ var _utils_helpers_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/helpers.js */ "./node_modules/glightbox/src/js/utils/helpers.js"); /** * Set slide iframe content * * @param {node} slide * @param {object} data * @param {int} index * @param {function} callback */ function slideIframe(slide, data, index, callback) { const slideMedia = slide.querySelector('.gslide-media'); const iframe = (0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_0__.createIframe)({ url: data.href, callback: callback }); slideMedia.parentNode.style.maxWidth = data.width; slideMedia.parentNode.style.height = data.height; slideMedia.appendChild(iframe); return; } /***/ }), /***/ "./node_modules/glightbox/src/js/slides/image.js": /*!*******************************************************!*\ !*** ./node_modules/glightbox/src/js/slides/image.js ***! \*******************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ slideImage) /* harmony export */ }); /* harmony import */ var _utils_helpers_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/helpers.js */ "./node_modules/glightbox/src/js/utils/helpers.js"); /** * Set slide inline content * we'll extend this to make http * requests using the fetch api * but for now we keep it simple * * @param {node} slide * @param {object} data * @param {int} index * @param {function} callback */ function slideImage(slide, data, index, callback) { const slideMedia = slide.querySelector('.gslide-media'); let img = new Image(); let titleID = 'gSlideTitle_' + index; let textID = 'gSlideDesc_' + index; // prettier-ignore img.addEventListener('load', () => { if ((0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_0__.isFunction)(callback)) { callback(); } }, false); img.src = data.href; if (data.sizes != '' && data.srcset != '') { img.sizes = data.sizes; img.srcset = data.srcset; } img.alt = ''; // https://davidwalsh.name/accessibility-tip-empty-alt-attributes if (!(0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_0__.isNil)(data.alt) && data.alt !== '') { img.alt = data.alt; } if (data.title !== '') { img.setAttribute('aria-labelledby', titleID); } if (data.description !== '') { // https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-describedby_attribute#Example_2_A_Close_Button img.setAttribute('aria-describedby', textID); } if (data.hasOwnProperty('_hasCustomWidth') && data._hasCustomWidth) { img.style.width = data.width; } if (data.hasOwnProperty('_hasCustomHeight') && data._hasCustomHeight) { img.style.height = data.height; } slideMedia.insertBefore(img, slideMedia.firstChild); return; } /***/ }), /***/ "./node_modules/glightbox/src/js/slides/inline.js": /*!********************************************************!*\ !*** ./node_modules/glightbox/src/js/slides/inline.js ***! \********************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ slideInline) /* harmony export */ }); /* harmony import */ var _utils_helpers_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/helpers.js */ "./node_modules/glightbox/src/js/utils/helpers.js"); /** * Set slide inline content * we'll extend this to make http * requests using the fetch api * but for now we keep it simple * * @param {node} slide * @param {object} data * @param {int} index * @param {function} callback */ function slideInline(slide, data, index, callback) { const slideMedia = slide.querySelector('.gslide-media'); const hash = (0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_0__.has)(data, 'href') && data.href ? data.href.split('#').pop().trim() : false; const content = (0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_0__.has)(data, 'content') && data.content ? data.content : false; let innerContent; if (content) { if ((0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_0__.isString)(content)) { innerContent = (0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_0__.createHTML)(`
${content}
`); } if ((0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_0__.isNode)(content)) { if (content.style.display == 'none') { content.style.display = 'block'; } const container = document.createElement('div'); container.className = 'ginlined-content'; container.appendChild(content); innerContent = container; } } if (hash) { let div = document.getElementById(hash); if (!div) { return false; } const cloned = div.cloneNode(true); cloned.style.height = data.height; cloned.style.maxWidth = data.width; (0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_0__.addClass)(cloned, 'ginlined-content'); innerContent = cloned; } if (!innerContent) { console.error('Unable to append inline slide content', data); return false; } slideMedia.style.height = data.height; slideMedia.style.width = data.width; slideMedia.appendChild(innerContent); this.events['inlineclose' + hash] = (0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_0__.addEvent)('click', { onElement: slideMedia.querySelectorAll('.gtrigger-close'), withCallback: (e) => { e.preventDefault(); this.close(); } }); if ((0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_0__.isFunction)(callback)) { callback(); } return; } /***/ }), /***/ "./node_modules/glightbox/src/js/slides/video.js": /*!*******************************************************!*\ !*** ./node_modules/glightbox/src/js/slides/video.js ***! \*******************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ slideVideo) /* harmony export */ }); /* harmony import */ var _utils_helpers_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/helpers.js */ "./node_modules/glightbox/src/js/utils/helpers.js"); /** * Set slide video * * @param {node} slide * @param {object} data * @param {int} index * @param {function} callback */ function slideVideo(slide, data, index, callback) { const slideContainer = slide.querySelector('.ginner-container'); const videoID = 'gvideo' + index; const slideMedia = slide.querySelector('.gslide-media'); const videoPlayers = this.getAllPlayers(); (0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_0__.addClass)(slideContainer, 'gvideo-container'); slideMedia.insertBefore((0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_0__.createHTML)('
'), slideMedia.firstChild); const videoWrapper = slide.querySelector('.gvideo-wrapper'); (0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_0__.injectAssets)(this.settings.plyr.css, 'Plyr'); let url = data.href; let provider = data?.videoProvider; let customPlaceholder = false; slideMedia.style.maxWidth = data.width; (0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_0__.injectAssets)(this.settings.plyr.js, 'Plyr', () => { // Set vimeo videos if (!provider && url.match(/vimeo\.com\/([0-9]*)/)) { provider = 'vimeo'; } // Set youtube videos if ( !provider && (url.match(/(youtube\.com|youtube-nocookie\.com)\/watch\?v=([a-zA-Z0-9\-_]+)/) || url.match(/youtu\.be\/([a-zA-Z0-9\-_]+)/) || url.match(/(youtube\.com|youtube-nocookie\.com)\/embed\/([a-zA-Z0-9\-_]+)/)) ) { provider = 'youtube'; } // Set local videos // if no provider, default to local if (provider === 'local' || !provider) { provider = 'local'; let html = ''; customPlaceholder = (0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_0__.createHTML)(html); } // prettier-ignore const placeholder = customPlaceholder ? customPlaceholder : (0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_0__.createHTML)(`
`); (0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_0__.addClass)(videoWrapper, `${provider}-video gvideo`); videoWrapper.appendChild(placeholder); videoWrapper.setAttribute('data-id', videoID); videoWrapper.setAttribute('data-index', index); const playerConfig = (0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_0__.has)(this.settings.plyr, 'config') ? this.settings.plyr.config : {}; const player = new Plyr('#' + videoID, playerConfig); player.on('ready', (event) => { videoPlayers[videoID] = event.detail.plyr; if ((0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_0__.isFunction)(callback)) { callback(); } }); (0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_0__.waitUntil)( () => { return slide.querySelector('iframe') && slide.querySelector('iframe').dataset.ready == 'true'; }, () => { this.resize(slide); } ); player.on('enterfullscreen', handleMediaFullScreen); player.on('exitfullscreen', handleMediaFullScreen); }); } /** * Handle fullscreen * * @param {object} event */ function handleMediaFullScreen(event) { const media = (0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_0__.closest)(event.target, '.gslide-media'); if (event.type === 'enterfullscreen') { (0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_0__.addClass)(media, 'fullscreen'); } if (event.type === 'exitfullscreen') { (0,_utils_helpers_js__WEBPACK_IMPORTED_MODULE_0__.removeClass)(media, 'fullscreen'); } } /***/ }), /***/ "./node_modules/glightbox/src/js/utils/helpers.js": /*!********************************************************!*\ !*** ./node_modules/glightbox/src/js/utils/helpers.js ***! \********************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ addClass: () => (/* binding */ addClass), /* harmony export */ addEvent: () => (/* binding */ addEvent), /* harmony export */ animateElement: () => (/* binding */ animateElement), /* harmony export */ closest: () => (/* binding */ closest), /* harmony export */ createHTML: () => (/* binding */ createHTML), /* harmony export */ createIframe: () => (/* binding */ createIframe), /* harmony export */ cssTransform: () => (/* binding */ cssTransform), /* harmony export */ each: () => (/* binding */ each), /* harmony export */ extend: () => (/* binding */ extend), /* harmony export */ getNodeEvents: () => (/* binding */ getNodeEvents), /* harmony export */ has: () => (/* binding */ has), /* harmony export */ hasClass: () => (/* binding */ hasClass), /* harmony export */ hide: () => (/* binding */ hide), /* harmony export */ injectAssets: () => (/* binding */ injectAssets), /* harmony export */ isArray: () => (/* binding */ isArray), /* harmony export */ isArrayLike: () => (/* binding */ isArrayLike), /* harmony export */ isFunction: () => (/* binding */ isFunction), /* harmony export */ isMobile: () => (/* binding */ isMobile), /* harmony export */ isNil: () => (/* binding */ isNil), /* harmony export */ isNode: () => (/* binding */ isNode), /* harmony export */ isNumber: () => (/* binding */ isNumber), /* harmony export */ isObject: () => (/* binding */ isObject), /* harmony export */ isString: () => (/* binding */ isString), /* harmony export */ isTouch: () => (/* binding */ isTouch), /* harmony export */ removeClass: () => (/* binding */ removeClass), /* harmony export */ show: () => (/* binding */ show), /* harmony export */ size: () => (/* binding */ size), /* harmony export */ waitUntil: () => (/* binding */ waitUntil), /* harmony export */ whichAnimationEvent: () => (/* binding */ whichAnimationEvent), /* harmony export */ whichTransitionEvent: () => (/* binding */ whichTransitionEvent), /* harmony export */ windowSize: () => (/* binding */ windowSize) /* harmony export */ }); const uid = Date.now(); /** * Merge two or more objects */ function extend() { let extended = {}; let deep = true; let i = 0; let length = arguments.length; if (Object.prototype.toString.call(arguments[0]) === '[object Boolean]') { deep = arguments[0]; i++; } let merge = (obj) => { for (let prop in obj) { if (Object.prototype.hasOwnProperty.call(obj, prop)) { if (deep && Object.prototype.toString.call(obj[prop]) === '[object Object]') { extended[prop] = extend(true, extended[prop], obj[prop]); } else { extended[prop] = obj[prop]; } } } }; for (; i < length; i++) { let obj = arguments[i]; merge(obj); } return extended; } /** * Each * * @param {mixed} node list, array, object * @param {function} callback */ function each(collection, callback) { if (isNode(collection) || collection === window || collection === document) { collection = [collection]; } if (!isArrayLike(collection) && !isObject(collection)) { collection = [collection]; } if (size(collection) == 0) { return; } if (isArrayLike(collection) && !isObject(collection)) { let l = collection.length, i = 0; for (; i < l; i++) { if (callback.call(collection[i], collection[i], i, collection) === false) { break; } } } else if (isObject(collection)) { for (let key in collection) { if (has(collection, key)) { if (callback.call(collection[key], collection[key], key, collection) === false) { break; } } } } } /** * Get nde events * return node events and optionally * check if the node has already a specific event * to avoid duplicated callbacks * * @param {node} node * @param {string} name event name * @param {object} fn callback * @returns {object} */ function getNodeEvents(node, name = null, fn = null) { const cache = (node[uid] = node[uid] || []); const data = { all: cache, evt: null, found: null }; if (name && fn && size(cache) > 0) { each(cache, (cl, i) => { if (cl.eventName == name && cl.fn.toString() == fn.toString()) { data.found = true; data.evt = i; return false; } }); } return data; } /** * Add Event * Add an event listener * * @param {string} eventName * @param {object} detials */ function addEvent(eventName, { onElement, withCallback, avoidDuplicate = true, once = false, useCapture = false } = {}, thisArg) { let element = onElement || []; if (isString(element)) { element = document.querySelectorAll(element); } function handler(event) { if (isFunction(withCallback)) { withCallback.call(thisArg, event, this); } if (once) { handler.destroy(); } } handler.destroy = function () { each(element, (el) => { const events = getNodeEvents(el, eventName, handler); if (events.found) { events.all.splice(events.evt, 1); } if (el.removeEventListener) { el.removeEventListener(eventName, handler, useCapture); } }); }; each(element, (el) => { const events = getNodeEvents(el, eventName, handler); if ((el.addEventListener && avoidDuplicate && !events.found) || !avoidDuplicate) { el.addEventListener(eventName, handler, useCapture); events.all.push({ eventName: eventName, fn: handler }); } }); return handler; } /** * Add element class * * @param {node} element * @param {string} class name */ function addClass(node, name) { each(name.split(' '), (cl) => node.classList.add(cl)); } /** * Remove element class * * @param {node} element * @param {string} class name */ function removeClass(node, name) { each(name.split(' '), (cl) => node.classList.remove(cl)); } /** * Has class * * @param {node} element * @param {string} class name */ function hasClass(node, name) { return node.classList.contains(name); } /** * Get the closestElement * * @param {node} element * @param {string} class name */ function closest(elem, selector) { while (elem !== document.body) { elem = elem.parentElement; if (!elem) { return false; } const matches = typeof elem.matches == 'function' ? elem.matches(selector) : elem.msMatchesSelector(selector); if (matches) { return elem; } } } /** * CSS Animations * * @param {node} element * @param {string} animation name * @param {function} callback */ function animateElement(element, animation = '', callback = false) { if (!element || animation === '') { return false; } if (animation === 'none') { if (isFunction(callback)) { callback(); } return false; } const animationEnd = whichAnimationEvent(); const animationNames = animation.split(' '); each(animationNames, (name) => { addClass(element, 'g' + name); }); addEvent(animationEnd, { onElement: element, avoidDuplicate: false, once: true, withCallback: (event, target) => { each(animationNames, (name) => { removeClass(target, 'g' + name); }); if (isFunction(callback)) { callback(); } } }); } function cssTransform(node, translate = '') { if (translate === '') { node.style.webkitTransform = ''; node.style.MozTransform = ''; node.style.msTransform = ''; node.style.OTransform = ''; node.style.transform = ''; return false; } node.style.webkitTransform = translate; node.style.MozTransform = translate; node.style.msTransform = translate; node.style.OTransform = translate; node.style.transform = translate; } /** * Show element * * @param {node} element */ function show(element) { element.style.display = 'block'; } /** * Hide element */ function hide(element) { element.style.display = 'none'; } /** * Create a document fragment * * @param {string} html code */ function createHTML(htmlStr) { let frag = document.createDocumentFragment(), temp = document.createElement('div'); temp.innerHTML = htmlStr; while (temp.firstChild) { frag.appendChild(temp.firstChild); } return frag; } /** * Return screen size * return the current screen dimensions * * @returns {object} */ function windowSize() { return { width: window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth, height: window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight }; } /** * Determine animation events */ function whichAnimationEvent() { let t, el = document.createElement('fakeelement'); let animations = { animation: 'animationend', OAnimation: 'oAnimationEnd', MozAnimation: 'animationend', WebkitAnimation: 'webkitAnimationEnd' }; for (t in animations) { if (el.style[t] !== undefined) { return animations[t]; } } } /** * Determine transition events */ function whichTransitionEvent() { let t, el = document.createElement('fakeelement'); const transitions = { transition: 'transitionend', OTransition: 'oTransitionEnd', MozTransition: 'transitionend', WebkitTransition: 'webkitTransitionEnd' }; for (t in transitions) { if (el.style[t] !== undefined) { return transitions[t]; } } } /** * Create an iframe element * * @param {string} url * @param {numeric} width * @param {numeric} height * @param {function} callback */ function createIframe(config) { let { url, allow, callback, appendTo } = config; let iframe = document.createElement('iframe'); iframe.className = 'vimeo-video gvideo'; iframe.src = url; iframe.style.width = '100%'; iframe.style.height = '100%'; if (allow) { iframe.setAttribute('allow', allow); } iframe.onload = function () { iframe.onload = null; addClass(iframe, 'node-ready'); if (isFunction(callback)) { callback(); } }; if (appendTo) { appendTo.appendChild(iframe); } return iframe; } /** * Wait until * wait until all the validations * are passed * * @param {function} check * @param {function} onComplete * @param {numeric} delay * @param {numeric} timeout */ function waitUntil(check, onComplete, delay, timeout) { if (check()) { onComplete(); return; } if (!delay) { delay = 100; } let timeoutPointer; let intervalPointer = setInterval(() => { if (!check()) { return; } clearInterval(intervalPointer); if (timeoutPointer) { clearTimeout(timeoutPointer); } onComplete(); }, delay); if (timeout) { timeoutPointer = setTimeout(() => { clearInterval(intervalPointer); }, timeout); } } /** * Inject videos api * used for video player * * @param {string} url * @param {function} callback */ function injectAssets(url, waitFor, callback) { if (isNil(url)) { console.error('Inject assets error'); return; } if (isFunction(waitFor)) { callback = waitFor; waitFor = false; } if (isString(waitFor) && waitFor in window) { if (isFunction(callback)) { callback(); } return; } let found; if (url.indexOf('.css') !== -1) { found = document.querySelectorAll('link[href="' + url + '"]'); if (found && found.length > 0) { if (isFunction(callback)) { callback(); } return; } const head = document.getElementsByTagName('head')[0]; const headStyles = head.querySelectorAll('link[rel="stylesheet"]'); const link = document.createElement('link'); link.rel = 'stylesheet'; link.type = 'text/css'; link.href = url; link.media = 'all'; if (headStyles) { head.insertBefore(link, headStyles[0]); } else { head.appendChild(link); } if (isFunction(callback)) { callback(); } return; } found = document.querySelectorAll('script[src="' + url + '"]'); if (found && found.length > 0) { if (isFunction(callback)) { if (isString(waitFor)) { waitUntil( () => { return typeof window[waitFor] !== 'undefined'; }, () => { callback(); } ); return false; } callback(); } return; } let script = document.createElement('script'); script.type = 'text/javascript'; script.src = url; script.onload = () => { if (isFunction(callback)) { if (isString(waitFor)) { waitUntil( () => { return typeof window[waitFor] !== 'undefined'; }, () => { callback(); } ); return false; } callback(); } }; document.body.appendChild(script); } function isMobile() { return 'navigator' in window && window.navigator.userAgent.match(/(iPad)|(iPhone)|(iPod)|(Android)|(PlayBook)|(BB10)|(BlackBerry)|(Opera Mini)|(IEMobile)|(webOS)|(MeeGo)/i); } function isTouch() { return isMobile() !== null || document.createTouch !== undefined || 'ontouchstart' in window || 'onmsgesturechange' in window || navigator.msMaxTouchPoints; } function isFunction(f) { return typeof f === 'function'; } function isString(s) { return typeof s === 'string'; } function isNode(el) { return !!(el && el.nodeType && el.nodeType == 1); } function isArray(ar) { return Array.isArray(ar); } function isArrayLike(ar) { return ar && ar.length && isFinite(ar.length); } function isObject(o) { let type = typeof o; return type === 'object' && o != null && !isFunction(o) && !isArray(o); } function isNil(o) { return o == null; } function has(obj, key) { return obj !== null && hasOwnProperty.call(obj, key); } function size(o) { if (isObject(o)) { if (o.keys) { return o.keys().length; } let l = 0; for (let k in o) { if (has(o, k)) { l++; } } return l; } else { return o.length; } } function isNumber(n) { return !isNaN(parseFloat(n)) && isFinite(n); } /***/ }), /***/ "./node_modules/image-map-resizer/js/imageMapResizer.min.js": /*!******************************************************************!*\ !*** ./node_modules/image-map-resizer/js/imageMapResizer.min.js ***! \******************************************************************/ /***/ ((module, exports) => { var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! Image Map Resizer (imageMapResizer.min.js ) - v1.0.10 - 2019-04-10 * Desc: Resize HTML imageMap to scaled image. * Copyright: (c) 2019 David J. Bradshaw - dave@bradshaw.net * License: MIT */ !function(){"use strict";function r(){function e(){var r={width:u.width/u.naturalWidth,height:u.height/u.naturalHeight},a={width:parseInt(window.getComputedStyle(u,null).getPropertyValue("padding-left"),10),height:parseInt(window.getComputedStyle(u,null).getPropertyValue("padding-top"),10)};i.forEach(function(e,t){var n=0;o[t].coords=e.split(",").map(function(e){var t=1==(n=1-n)?"width":"height";return a[t]+Math.floor(Number(e)*r[t])}).join(",")})}function t(e){return e.coords.replace(/ *, */g,",").replace(/ +/g,",")}function n(){clearTimeout(d),d=setTimeout(e,250)}function r(e){return document.querySelector('img[usemap="'+e+'"]')}var a=this,o=null,i=null,u=null,d=null;"function"!=typeof a._resize?(o=a.getElementsByTagName("area"),i=Array.prototype.map.call(o,t),u=r("#"+a.name)||r(a.name),a._resize=e,u.addEventListener("load",e,!1),window.addEventListener("focus",e,!1),window.addEventListener("resize",n,!1),window.addEventListener("readystatechange",e,!1),document.addEventListener("fullscreenchange",e,!1),u.width===u.naturalWidth&&u.height===u.naturalHeight||e()):a._resize()}function e(){function t(e){e&&(!function(e){if(!e.tagName)throw new TypeError("Object is not a valid DOM element");if("MAP"!==e.tagName.toUpperCase())throw new TypeError("Expected tag, found <"+e.tagName+">.")}(e),r.call(e),n.push(e))}var n;return function(e){switch(n=[],typeof e){case"undefined":case"string":Array.prototype.forEach.call(document.querySelectorAll(e||"map"),t);break;case"object":t(e);break;default:throw new TypeError("Unexpected data type ("+typeof e+").")}return n}} true?!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (e), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)):0,"jQuery"in window&&(window.jQuery.fn.imageMapResize=function(){return this.filter("map").each(r).end()})}(); /***/ }), /***/ "./node_modules/js-cookie/dist/js.cookie.mjs": /*!***************************************************!*\ !*** ./node_modules/js-cookie/dist/js.cookie.mjs ***! \***************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ api) /* harmony export */ }); /*! js-cookie v3.0.5 | MIT */ /* eslint-disable no-var */ function assign (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { target[key] = source[key]; } } return target } /* eslint-enable no-var */ /* eslint-disable no-var */ var defaultConverter = { read: function (value) { if (value[0] === '"') { value = value.slice(1, -1); } return value.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent) }, write: function (value) { return encodeURIComponent(value).replace( /%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g, decodeURIComponent ) } }; /* eslint-enable no-var */ /* eslint-disable no-var */ function init (converter, defaultAttributes) { function set (name, value, attributes) { if (typeof document === 'undefined') { return } attributes = assign({}, defaultAttributes, attributes); if (typeof attributes.expires === 'number') { attributes.expires = new Date(Date.now() + attributes.expires * 864e5); } if (attributes.expires) { attributes.expires = attributes.expires.toUTCString(); } name = encodeURIComponent(name) .replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent) .replace(/[()]/g, escape); var stringifiedAttributes = ''; for (var attributeName in attributes) { if (!attributes[attributeName]) { continue } stringifiedAttributes += '; ' + attributeName; if (attributes[attributeName] === true) { continue } // Considers RFC 6265 section 5.2: // ... // 3. If the remaining unparsed-attributes contains a %x3B (";") // character: // Consume the characters of the unparsed-attributes up to, // not including, the first %x3B (";") character. // ... stringifiedAttributes += '=' + attributes[attributeName].split(';')[0]; } return (document.cookie = name + '=' + converter.write(value, name) + stringifiedAttributes) } function get (name) { if (typeof document === 'undefined' || (arguments.length && !name)) { return } // To prevent the for loop in the first place assign an empty array // in case there are no cookies at all. var cookies = document.cookie ? document.cookie.split('; ') : []; var jar = {}; for (var i = 0; i < cookies.length; i++) { var parts = cookies[i].split('='); var value = parts.slice(1).join('='); try { var found = decodeURIComponent(parts[0]); jar[found] = converter.read(value, found); if (name === found) { break } } catch (e) {} } return name ? jar[name] : jar } return Object.create( { set, get, remove: function (name, attributes) { set( name, '', assign({}, attributes, { expires: -1 }) ); }, withAttributes: function (attributes) { return init(this.converter, assign({}, this.attributes, attributes)) }, withConverter: function (converter) { return init(assign({}, this.converter, converter), this.attributes) } }, { attributes: { value: Object.freeze(defaultAttributes) }, converter: { value: Object.freeze(converter) } } ) } var api = init(defaultConverter, { path: '/' }); /* eslint-enable no-var */ /***/ }) /******/ }); /************************************************************************/ /******/ // The module cache /******/ var __webpack_module_cache__ = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ // Check if module is in cache /******/ var cachedModule = __webpack_module_cache__[moduleId]; /******/ if (cachedModule !== undefined) { /******/ return cachedModule.exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { /******/ // no module.id needed /******/ // no module.loaded needed /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /************************************************************************/ /******/ /* webpack/runtime/compat get default export */ /******/ (() => { /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = (module) => { /******/ var getter = module && module.__esModule ? /******/ () => (module['default']) : /******/ () => (module); /******/ __webpack_require__.d(getter, { a: getter }); /******/ return getter; /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/define property getters */ /******/ (() => { /******/ // define getter functions for harmony exports /******/ __webpack_require__.d = (exports, definition) => { /******/ for(var key in definition) { /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); /******/ } /******/ } /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ (() => { /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) /******/ })(); /******/ /******/ /* webpack/runtime/make namespace object */ /******/ (() => { /******/ // define __esModule on exports /******/ __webpack_require__.r = (exports) => { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ })(); /******/ /************************************************************************/ var __webpack_exports__ = {}; // This entry need to be wrapped in an IIFE because it need to be in strict mode. (() => { "use strict"; /*!*********************************************!*\ !*** ./sources/javascript/entries/index.js ***! \*********************************************/ __webpack_require__.r(__webpack_exports__); /* harmony import */ var _wai__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../wai */ "./sources/javascript/wai.js"); /* harmony import */ var _helpers_ModalElement__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../helpers/ModalElement */ "./sources/javascript/helpers/ModalElement.js"); /* harmony import */ var _helpers_PublicationLightbox__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../helpers/PublicationLightbox */ "./sources/javascript/helpers/PublicationLightbox.js"); /* harmony import */ var _helpers_Prayer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../helpers/Prayer */ "./sources/javascript/helpers/Prayer.js"); /* harmony import */ var _helpers_InteractiveIcon__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../helpers/InteractiveIcon */ "./sources/javascript/helpers/InteractiveIcon.js"); /* harmony import */ var _helpers_TimelineLesson__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../helpers/TimelineLesson */ "./sources/javascript/helpers/TimelineLesson.js"); /* harmony import */ var _publicationDetails__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../publicationDetails */ "./sources/javascript/publicationDetails.js"); /* harmony import */ var _timeline__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../timeline */ "./sources/javascript/timeline.js"); /* harmony import */ var _netivo_base_scripts__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @netivo/base-scripts */ "./node_modules/@netivo/base-scripts/index.js"); /* harmony import */ var _quantityInput__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../quantityInput */ "./sources/javascript/quantityInput.js"); /* harmony import */ var _splidejs_splide__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @splidejs/splide */ "./node_modules/@splidejs/splide/dist/js/splide.esm.js"); /* harmony import */ var image_map_resizer__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! image-map-resizer */ "./node_modules/image-map-resizer/js/imageMapResizer.min.js"); /* harmony import */ var image_map_resizer__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(image_map_resizer__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var glightbox_src_js_glightbox__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! glightbox/src/js/glightbox */ "./node_modules/glightbox/src/js/glightbox.js"); _helpers_ModalElement__WEBPACK_IMPORTED_MODULE_1__["default"].init(); _helpers_PublicationLightbox__WEBPACK_IMPORTED_MODULE_2__["default"].init(); _helpers_Prayer__WEBPACK_IMPORTED_MODULE_3__["default"].init(); _helpers_InteractiveIcon__WEBPACK_IMPORTED_MODULE_4__["default"].init(); _helpers_TimelineLesson__WEBPACK_IMPORTED_MODULE_5__["default"].init(); window.initMap = _netivo_base_scripts__WEBPACK_IMPORTED_MODULE_8__.initMap; let hamburger = document.querySelector('.js-hamburger'); let menu = document.querySelector('#mobile-menu'); let mask = document.querySelector('#mask'); const toggleMenu = e => { e.preventDefault(); hamburger.classList.toggle('active'); menu.classList.toggle('toggled'); mask.classList.toggle('toggled'); if (menu.classList.contains('toggled')) { document.body.style.overflow = 'hidden'; document.querySelector('html').style.overflow = 'hidden'; menu.focus(); menu.setAttribute('aria-hidden', false); } else { document.body.style.overflow = 'auto'; document.querySelector('html').style.overflow = 'auto'; menu.setAttribute('aria-hidden', true); } }; hamburger.addEventListener('click', toggleMenu); mask.addEventListener('click', toggleMenu); let waiContainer = document.querySelector('.js-wai'); if (waiContainer !== null) { new _wai__WEBPACK_IMPORTED_MODULE_0__["default"](waiContainer); } let publicationLink = document.querySelectorAll('.js-publication'); if (publicationLink.length > 0) { publicationLink.forEach(element => { new _publicationDetails__WEBPACK_IMPORTED_MODULE_6__["default"](element); }); } let timeline = document.querySelector('.js-timeline'); if (timeline !== null) { new _timeline__WEBPACK_IMPORTED_MODULE_7__["default"](timeline); } let quantityInputs = document.querySelectorAll('.js-quantity-input'); if (quantityInputs.length > 0) { quantityInputs.forEach(qi => { new _quantityInput__WEBPACK_IMPORTED_MODULE_9__["default"](qi); }); } let gallery = document.querySelectorAll('.js-gallery'); if (gallery.length > 0) { gallery.forEach(gal => { let main = new _splidejs_splide__WEBPACK_IMPORTED_MODULE_10__["default"](gal.querySelector('[data-element="main-gallery"]'), { type: 'fade', pagination: false, arrows: false, autoHeight: true, fixedHeight: 500, cover: false }); let thumbnails = new _splidejs_splide__WEBPACK_IMPORTED_MODULE_10__["default"](gal.querySelector('[data-element="thumbnails"]'), { rewind: true, fixedWidth: 100, fixedHeight: 100, isNavigation: true, gap: 10, focus: 'center', pagination: false, cover: true, dragMinThreshold: { mouse: 4, touch: 10 }, breakpoints: { 640: { fixedWidth: 80, fixedHeight: 80 } } }); main.sync(thumbnails); main.mount(); thumbnails.mount(); }); } let prayerForm = document.querySelector('.js-prayer-form'); if (prayerForm !== null) { let recaptcha_key = prayerForm.getAttribute('data-recaptcha'); new _netivo_base_scripts__WEBPACK_IMPORTED_MODULE_8__.Form(prayerForm, { action: '/wp-admin/admin-ajax.php', data: el => { return new Promise((resolve, reject) => { let data = { action: 'nt_send_form_prayer', first_name: '', prayer: '' }; let form_first_name = el.querySelector('[name="first_name"]'), form_prayer = el.querySelector('[name="prayer"]'); if (form_first_name !== null) data.first_name = form_first_name.value; if (form_prayer !== null) data.prayer = form_prayer.value; // grecaptcha.ready(function() { // grecaptcha.execute(recaptcha_key, {action: 'application'}).then(function (token) { // data.recaptcha = token; // resolve(data); // }); // }); resolve(data); }); }, success: (el, response) => { let form_body = prayerForm.querySelector('[data-element="body"]'), form_message = prayerForm.querySelector('[data-element="message"]'), form_button = prayerForm.querySelector('[data-element="button"]'); form_message.innerText = response.message; form_body.style.display = 'none'; form_button.style.display = 'none'; form_message.style.display = 'block'; form_message.classList.add('success'); let prayer = document.createElement('div', { is: 'netivo-prayer' }); prayer.innerHTML = response.prayer.content; prayer.setAttribute('data-author', response.prayer.author); prayer.setAttribute('data-date', response.prayer.date); let list = document.querySelector('.js-prayers-list'); list.prepend(prayer); if (window.gtag !== undefined) { window.gtag('event', 'application'); } }, error: (el, response) => { let form_body = prayerForm.querySelector('[data-element="body"]'), form_message = prayerForm.querySelector('[data-element="message"]'), form_button = prayerForm.querySelector('[data-element="button"]'); form_message.innerText = response.message; form_body.style.display = 'none'; form_button.style.display = 'none'; form_message.style.display = 'block'; form_message.classList.add('error'); } }); } let prisonerForm = document.querySelector('.js-prisoner-form'); if (prisonerForm !== null) { new _netivo_base_scripts__WEBPACK_IMPORTED_MODULE_8__.Form(prisonerForm, { action: '/wp-admin/admin-ajax.php', beforeSubmit: el => { let loader = el.querySelector('[data-element="loader"]'); loader.style.display = 'block'; let results = document.querySelector('.js-prisoner-results'); results.innerHTML = ''; return true; }, data: el => { return new Promise((resolve, reject) => { let data = { nazwisko: '', imie: '', nr_obozowy: '', data_ur: '', miejsce_ur: '', miejsce_zam: '', zawod: '', action: 'nt_former_prisoners' }; let form_nazwisko = el.querySelector('[name="nazwisko"]'), form_imie = el.querySelector('[name="imie"]'), form_nr_obozowy = el.querySelector('[name="nr_obozowy"]'), form_data_ur = el.querySelector('[name="data_ur"]'), form_miejsce_ur = el.querySelector('[name="miejsce_ur"]'), form_miejsce_zam = el.querySelector('[name="miejsce_zam"]'), form_zawod = el.querySelector('[name="zawod"]'); if (form_nazwisko !== null) data.nazwisko = form_nazwisko.value; if (form_imie !== null) data.imie = form_imie.value; if (form_nr_obozowy !== null) data.nr_obozowy = form_nr_obozowy.value; if (form_data_ur !== null) data.data_ur = form_data_ur.value; if (form_miejsce_ur !== null) data.miejsce_ur = form_miejsce_ur.value; if (form_miejsce_zam !== null) data.miejsce_zam = form_miejsce_zam.value; if (form_zawod !== null) data.zawod = form_zawod.value; // grecaptcha.ready(function() { // grecaptcha.execute(recaptcha_key, {action: 'application'}).then(function (token) { // data.recaptcha = token; // resolve(data); // }); // }); resolve(data); }); }, success: (el, response) => { if (response.length > 0) { let results = document.querySelector('.js-prisoner-results'); results.innerHTML = ''; let title = document.createElement('h4'); title.classList.add('title'); title.classList.add('title--small'); title.classList.add('title--no-border'); title.innerText = 'Lista wyników'; let info = document.createElement('p'); info.innerText = 'Znaleziono ' + response.length + ' więźniów'; results.append(title); results.append(info); response.forEach(prisoner => { let prisEl = document.createElement('blockquote'); prisEl.classList.add('db-result'); if (prisoner.hasOwnProperty('nazwisko')) prisEl.innerHTML += '

Nazwisko: ' + prisoner.nazwisko + '

'; if (prisoner.hasOwnProperty('nazwisko_ss')) prisEl.innerHTML += '

Nazwisko: ' + prisoner.nazwisko_ss + '

'; if (prisoner.hasOwnProperty('imie')) prisEl.innerHTML += '

Imię: ' + prisoner.imie + '

'; if (prisoner.hasOwnProperty('nr')) prisEl.innerHTML += '

Nr obozowy: ' + prisoner.nr + '

'; if (prisoner.hasOwnProperty('data_urodzenia')) prisEl.innerHTML += '

Data urodzenia: ' + prisoner.data_urodzenia + '

'; if (prisoner.hasOwnProperty('data_zgonu')) prisEl.innerHTML += '

Data zgonu: ' + prisoner.data_zgonu + '

'; if (prisoner.hasOwnProperty('miejsce_urodzenia')) prisEl.innerHTML += '

Miejsce urodzenia: ' + prisoner.miejsce_urodzenia + '

'; if (prisoner.hasOwnProperty('miejsce_zamieszkania')) prisEl.innerHTML += '

Miejsce zamieszkania: ' + prisoner.miejsce_zamieszkania + '

'; if (prisoner.hasOwnProperty('narodowosc')) prisEl.innerHTML += '

Narodowość: ' + prisoner.narodowosc + '

'; if (prisoner.hasOwnProperty('zawod')) prisEl.innerHTML += '

Zawód: ' + prisoner.zawod + '

'; if (prisoner.hasOwnProperty('sygnatura')) prisEl.innerHTML += '

Sygnatura akt archiwalnych: ' + prisoner.sygnatura + '

'; if (prisoner.hasOwnProperty('sygnatura2')) prisEl.innerHTML += '

Sygnatura: ' + prisoner.sygnatura2 + '

'; if (prisoner.hasOwnProperty('plec')) prisEl.innerHTML += '

Płeć: ' + prisoner.plec + '

'; if (prisoner.hasOwnProperty('uwagi')) prisEl.innerHTML += '

Uwagi: ' + prisoner.uwagi + '

'; if (prisoner.hasOwnProperty('dbname')) prisEl.innerHTML += '

Źródło: ' + prisoner.dbname + '

'; results.append(prisEl); }); results.style.display = 'block'; } let loader = el.querySelector('[data-element="loader"]'); loader.style.display = 'none'; }, error: (el, response) => { let loader = el.querySelector('[data-element="loader"]'); loader.style.display = 'none'; let results = document.querySelector('.js-prisoner-results'); results.innerHTML = ''; let title = document.createElement('h4'); title.classList.add('title'); title.classList.add('title--small'); title.classList.add('title--no-border'); title.classList.add('title--error'); title.innerText = response.message; console.log(response); results.append(title); } }); } let iconForm = document.querySelector('.js-iconographic-collections'); if (iconForm !== null) { new _netivo_base_scripts__WEBPACK_IMPORTED_MODULE_8__.Form(iconForm, { action: '/wp-admin/admin-ajax.php', beforeSubmit: el => { let loader = el.querySelector('[data-element="loader"]'); loader.style.display = 'block'; let results = document.querySelector('.js-icons-results'); results.innerHTML = ''; return true; }, data: el => { return new Promise((resolve, reject) => { let data = { hg: '', hp: '', opis: '', autor: '', sygnatura: '', action: 'nt_iconographic_collections' }; let form_hg = el.querySelector('[name="haslo_glowne"]'), form_hp = el.querySelector('[name="haslo_podrzedne"]'), form_opis = el.querySelector('[name="opis"]'), form_autor = el.querySelector('[name="autor"]'), form_sygnatura = el.querySelector('[name="sygnatura"]'); if (form_hg !== null) data.hg = form_hg.value; if (form_hp !== null) data.hp = form_hp.value; if (form_opis !== null) data.opis = form_opis.value; if (form_autor !== null) data.autor = form_autor.value; if (form_sygnatura !== null) data.sygnatura = form_sygnatura.value; // grecaptcha.ready(function() { // grecaptcha.execute(recaptcha_key, {action: 'application'}).then(function (token) { // data.recaptcha = token; // resolve(data); // }); // }); resolve(data); }); }, success: (el, response) => { if (response.length > 0) { let results = document.querySelector('.js-icons-results'); results.innerHTML = ''; let title = document.createElement('h4'); title.classList.add('title'); title.classList.add('title--small'); title.classList.add('title--no-border'); title.innerText = 'Lista wyników'; let info = document.createElement('p'); info.innerText = 'Znaleziono ' + response.length + ' pozycji'; results.append(title); results.append(info); response.forEach(icon => { let iconEl = document.createElement('blockquote'); iconEl.classList.add('db-result'); if (icon.hasOwnProperty('sygnatura')) iconEl.innerHTML += '

Sygnatura: ' + icon.sygnatura + '

'; if (icon.hasOwnProperty('hg')) iconEl.innerHTML += '

Hasło głowne: ' + icon.hg + '

'; if (icon.hasOwnProperty('hp')) iconEl.innerHTML += '

Hasło podrzędne: ' + icon.hp + '

'; if (icon.hasOwnProperty('opis')) iconEl.innerHTML += '

Opis: ' + icon.opis + '

'; if (icon.hasOwnProperty('autor')) iconEl.innerHTML += '

Autor: ' + icon.autor + '

'; if (icon.hasOwnProperty('sygnatura')) iconEl.innerHTML += '

Sygnatura: ' + icon.sygnatura + '

'; results.append(iconEl); }); results.style.display = 'block'; } let loader = el.querySelector('[data-element="loader"]'); loader.style.display = 'none'; }, error: (el, response) => { let loader = el.querySelector('[data-element="loader"]'); loader.style.display = 'none'; let results = document.querySelector('.js-icons-results'); results.innerHTML = ''; let title = document.createElement('h4'); title.classList.add('title'); title.classList.add('title--small'); title.classList.add('title--no-border'); title.classList.add('title--error'); title.innerText = response.message; console.log(response); results.append(title); } }); } let classesForm = document.querySelector('.js-lesson-form'); if (classesForm !== null) { new _netivo_base_scripts__WEBPACK_IMPORTED_MODULE_8__.Form(classesForm, { action: '/wp-admin/admin-ajax.php', beforeSubmit: el => { let loader = el.querySelector('[data-element="loader"]'); loader.querySelector('.loader').style.display = 'block'; let error = loader.querySelector('.loader-error'); if (error !== null) error.remove(); loader.style.display = 'flex'; return true; }, data: el => { return new Promise((resolve, reject) => { let data = { educators: '', classesDate: '', classesTime: '', peopleAmount: '', topic: '', email: '', about: '', action: 'nt_classes' }; let form_educators = el.querySelector('[name="educators"]:checked'), form_classes_date = el.querySelector('[name="classes_date"]'), form_classes_time = el.querySelector('[name="classes_time"]'), form_people_amount = el.querySelector('[name="people_amount"]'), form_topic = el.querySelector('[name="topic"]'), form_email = el.querySelector('[name="email"]'), form_about = el.querySelector('[name="about"]'); if (form_educators !== null) data.educators = form_educators.value; if (form_classes_date !== null) data.classesDate = form_classes_date.value; if (form_classes_time !== null) data.classesTime = form_classes_time.value; if (form_people_amount !== null) data.peopleAmount = form_people_amount.value; if (form_topic !== null) data.topic = form_topic.value; if (form_email !== null) data.email = form_email.value; if (form_about !== null) data.about = form_about.value; // grecaptcha.ready(function() { // grecaptcha.execute(recaptcha_key, {action: 'application'}).then(function (token) { // data.recaptcha = token; // resolve(data); // }); // }); resolve(data); }); }, success: (el, response) => { let loader = el.querySelector('[data-element="loader"]'); loader.querySelector('.loader').remove(); loader.innerHTML = '
Udało się pomyślnie wysłać formularz.
'; }, error: (el, response) => { let loader = el.querySelector('[data-element="loader"]'); loader.querySelector('.loader').style.display = 'none'; loader.innerHTML += '
' + response.error + '
'; window.setTimeout(() => { loader.style.display = 'none'; }, 3000); } }); } let orderForm = document.querySelector('.js-order-form'); if (orderForm !== null) { new _netivo_base_scripts__WEBPACK_IMPORTED_MODULE_8__.Form(orderForm, { action: '/wp-admin/admin-ajax.php', beforeSubmit: el => { let loader = el.querySelector('[data-element="loader"]'); loader.querySelector('.loader').style.display = 'block'; let error = loader.querySelector('.loader-error'); if (error !== null) error.remove(); loader.style.display = 'flex'; return true; }, data: el => { return new Promise((resolve, reject) => { let data = { cart: '', companyName: '', name: '', surname: '', adress: '', adressContinued: '', city: '', zipCode: '', country: '', phone: '', nip: '', email: '', additionalInformation: '', action: 'nt_order' }; let cart = []; let cartEl = el.querySelectorAll('.js-quantity-input'); cartEl.forEach(e => { let cnt = e.querySelector('[data-element="count"]'); if (cnt.value > 0) { cart.push(e.getAttribute('data-id') + ':' + cnt.value); } }); data.cart = cart.join(','); let form_companyName = el.querySelector('[name="company_name"]'), form_name = el.querySelector('[name="name"]'), form_surname = el.querySelector('[name="surname"]'), form_adress = el.querySelector('[name="adress"]'), form_adressContinued = el.querySelector('[name="adress_continued"]'), form_city = el.querySelector('[name="city"]'), form_zipCode = el.querySelector('[name="zip_code"]'), form_country = el.querySelector('[name="country"]'), form_phone = el.querySelector('[name="phone"]'), form_nip = el.querySelector('[name="nip"]'), form_email = el.querySelector('[name="email"]'), form_additionalInformation = el.querySelector('[name="additional_information"]'); if (form_companyName !== null) data.companyName = form_companyName.value; if (form_name !== null) data.name = form_name.value; if (form_surname !== null) data.surname = form_surname.value; if (form_adress !== null) data.adress = form_adress.value; if (form_adressContinued !== null) data.adressContinued = form_adressContinued.value; if (form_city !== null) data.city = form_city.value; if (form_zipCode !== null) data.zipCode = form_zipCode.value; if (form_country !== null) data.country = form_country.value; if (form_phone !== null) data.phone = form_phone.value; if (form_nip !== null) data.nip = form_nip.value; if (form_email !== null) data.email = form_email.value; if (form_additionalInformation !== null) data.additionalInformation = form_additionalInformation.value; // grecaptcha.ready(function() { // grecaptcha.execute(recaptcha_key, {action: 'application'}).then(function (token) { // data.recaptcha = token; // resolve(data); // }); // }); resolve(data); }); }, success: (el, response) => { let loader = el.querySelector('[data-element="loader"]'); loader.querySelector('.loader').remove(); loader.innerHTML = '
Udało się pomyślnie wysłać formularz.
'; }, error: (el, response) => { let loader = el.querySelector('[data-element="loader"]'); loader.querySelector('.loader').style.display = 'none'; loader.innerHTML += '
' + response.error + '
'; window.setTimeout(() => { loader.style.display = 'none'; }, 3000); } }); } let lessonForm = document.querySelector('.js-contact-form'); if (lessonForm !== null) { new _netivo_base_scripts__WEBPACK_IMPORTED_MODULE_8__.Form(lessonForm, { action: '/wp-admin/admin-ajax.php', beforeSubmit: el => { let loader = el.querySelector('[data-element="loader"]'); loader.querySelector('.loader').style.display = 'block'; let error = loader.querySelector('.loader-error'); if (error !== null) error.remove(); loader.style.display = 'flex'; return true; }, data: el => { return new Promise((resolve, reject) => { let data = { firstName: '', lastName: '', schoolName: '', email: '', message: '', lesson: '', action: 'nt_lesson_contact' }; let form_first_name = el.querySelector('[name="first_name"]'), form_last_name = el.querySelector('[name="last_name"]'), form_school_name = el.querySelector('[name="school_name"]'), form_email = el.querySelector('[name="email"]'), form_lesson = el.querySelector('[name="lesson"]'), form_message = el.querySelector('[name="message"]'); if (form_first_name !== null) data.firstName = form_first_name.value; if (form_last_name !== null) data.lastName = form_last_name.value; if (form_school_name !== null) data.schoolName = form_school_name.value; if (form_email !== null) data.email = form_email.value; if (form_message !== null) data.message = form_message.value; if (form_lesson !== null) data.lesson = form_lesson.value; // grecaptcha.ready(function() { // grecaptcha.execute(recaptcha_key, {action: 'application'}).then(function (token) { // data.recaptcha = token; // resolve(data); // }); // }); resolve(data); }); }, success: (el, response) => { let loader = el.querySelector('[data-element="loader"]'); loader.querySelector('.loader').remove(); loader.innerHTML = '
Udało się pomyślnie wysłać formularz.
'; }, error: (el, response) => { let loader = el.querySelector('[data-element="loader"]'); loader.querySelector('.loader').style.display = 'none'; loader.innerHTML += '
' + response.message + '
'; window.setTimeout(() => { loader.style.display = 'none'; }, 3000); } }); } let imageMaps = document.querySelector('[data-element="image-map"]'); if (imageMaps !== null) { image_map_resizer__WEBPACK_IMPORTED_MODULE_11___default()(imageMaps); } new glightbox_src_js_glightbox__WEBPACK_IMPORTED_MODULE_12__["default"](); })(); /******/ })() ; //# sourceMappingURL=stutthof.js.map