bs5-lightbox
Advanced tools
Comparing version 1.5.1 to 1.6.0
@@ -14,23 +14,9 @@ "use strict"; | ||
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } | ||
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } | ||
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } | ||
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } | ||
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } | ||
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
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); return Constructor; } | ||
var bootstrap = { | ||
/** | ||
* Lightbox for Bootstrap 5 | ||
* | ||
* @file Creates a modal with a lightbox carousel. | ||
* @module bs5-lightbox | ||
*/ | ||
const bootstrap = { | ||
Modal: _modal.default, | ||
@@ -40,10 +26,4 @@ Carousel: _carousel.default | ||
var Lightbox = /*#__PURE__*/function () { | ||
function Lightbox(el) { | ||
var _this = this; | ||
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
_classCallCheck(this, Lightbox); | ||
class Lightbox { | ||
constructor(el, options = {}) { | ||
this.hash = this.randomHash(); | ||
@@ -56,9 +36,5 @@ this.settings = Object.assign(Object.assign(Object.assign({}, bootstrap.Modal.Default), bootstrap.Carousel.Default), { | ||
this.modalOptions = function () { | ||
return _this.setOptionsFromSettings(bootstrap.Modal.Default); | ||
}(); | ||
this.modalOptions = (() => this.setOptionsFromSettings(bootstrap.Modal.Default))(); | ||
this.carouselOptions = function () { | ||
return _this.setOptionsFromSettings(bootstrap.Carousel.Default); | ||
}(); | ||
this.carouselOptions = (() => this.setOptionsFromSettings(bootstrap.Carousel.Default))(); | ||
@@ -83,155 +59,122 @@ console.log(); | ||
_createClass(Lightbox, [{ | ||
key: "show", | ||
value: function show() { | ||
document.body.appendChild(this.modalElement); | ||
this.modal.show(); | ||
} | ||
}, { | ||
key: "hide", | ||
value: function hide() { | ||
this.modal.hide(); | ||
} | ||
}, { | ||
key: "setOptionsFromSettings", | ||
value: function setOptionsFromSettings(obj) { | ||
var _this2 = this; | ||
show() { | ||
document.body.appendChild(this.modalElement); | ||
this.modal.show(); | ||
} | ||
return Object.keys(obj).reduce(function (p, c) { | ||
return Object.assign(p, _defineProperty({}, c, _this2.settings[c])); | ||
}, {}); | ||
} | ||
}, { | ||
key: "getSrc", | ||
value: function getSrc(el) { | ||
return el.dataset.src || el.dataset.remote || el.href || 'http://via.placeholder.com/1600x900'; | ||
} | ||
}, { | ||
key: "getGalleryItems", | ||
value: function getGalleryItems() { | ||
var _this3 = this; | ||
hide() { | ||
this.modal.hide(); | ||
} | ||
var galleryTarget; | ||
setOptionsFromSettings(obj) { | ||
return Object.keys(obj).reduce((p, c) => Object.assign(p, { | ||
[c]: this.settings[c] | ||
}), {}); | ||
} | ||
if (this.settings.gallery) { | ||
if (Array.isArray(this.settings.gallery)) { | ||
return this.settings.gallery; | ||
} | ||
getSrc(el) { | ||
return el.dataset.src || el.dataset.remote || el.href || 'http://via.placeholder.com/1600x900'; | ||
} | ||
galleryTarget = this.settings.gallery; | ||
} else if (this.el.dataset.gallery) { | ||
galleryTarget = this.el.dataset.gallery; | ||
getGalleryItems() { | ||
let galleryTarget; | ||
if (this.settings.gallery) { | ||
if (Array.isArray(this.settings.gallery)) { | ||
return this.settings.gallery; | ||
} | ||
var gallery = galleryTarget ? _toConsumableArray(new Set(Array.from(document.querySelectorAll("[data-gallery=\"".concat(galleryTarget, "\"]")), function (v) { | ||
return "".concat(v.dataset.type ? 'embed' : '').concat(_this3.getSrc(v)); | ||
}))) : [this.src]; | ||
return gallery; | ||
galleryTarget = this.settings.gallery; | ||
} else if (this.el.dataset.gallery) { | ||
galleryTarget = this.el.dataset.gallery; | ||
} | ||
}, { | ||
key: "getYoutubeId", | ||
value: function getYoutubeId(src) { | ||
if (!src) return false; | ||
var matches = src.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/); | ||
return matches && matches[2].length === 11 ? matches[2] : false; | ||
} | ||
}, { | ||
key: "getInstagramEmbed", | ||
value: function getInstagramEmbed(src) { | ||
if (/instagram/.test(src)) { | ||
src += /\/embed$/.test(src) ? '' : '/embed'; | ||
return "<div class=\"ratio ratio-16x9\" style=\"max-height: 100%;\"><iframe src=\"".concat(src, "\" class=\"start-50 translate-middle-x\" style=\"max-width: 500px\" frameborder=\"0\" scrolling=\"no\" allowtransparency=\"true\"></iframe></div>"); | ||
} | ||
} | ||
}, { | ||
key: "isEmbed", | ||
value: function isEmbed(src) { | ||
var regex = new RegExp(Lightbox.allowedEmbedTypes.join('|')); | ||
var isEmbed = regex.test(src); | ||
var isImg = /\.(png|jpe?g|gif|svg|webp)/.test(src); | ||
return isEmbed || !isImg; | ||
} | ||
}, { | ||
key: "createCarousel", | ||
value: function createCarousel() { | ||
var _this4 = this; | ||
var template = document.createElement('template'); | ||
var slidesHtml = this.sources.map(function (src, i) { | ||
src = src.replace(/\/$/, ''); | ||
var onload = ''; | ||
onload += /\.png/.test(src) ? "this.add.previousSibling.remove()" : ''; | ||
var inner = "<div class=\"ratio ratio-16x9\"><img src=\"".concat(src, "\" class=\"d-block w-100 h-100 img-fluid\" style=\"z-index: 1; object-fit: contain;\" onload=\"").concat(onload, "\" /></div>"); | ||
var attributes = ''; | ||
const gallery = galleryTarget ? [...new Set(Array.from(document.querySelectorAll("[data-gallery=\"".concat(galleryTarget, "\"]")), v => "".concat(v.dataset.type ? 'embed' : '').concat(this.getSrc(v))))] : [this.src]; | ||
return gallery; | ||
} | ||
var instagramEmbed = _this4.getInstagramEmbed(src); | ||
getYoutubeId(src) { | ||
if (!src) return false; | ||
let matches = src.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/); | ||
return matches && matches[2].length === 11 ? matches[2] : false; | ||
} | ||
var youtubeId = _this4.getYoutubeId(src); | ||
getInstagramEmbed(src) { | ||
if (/instagram/.test(src)) { | ||
src += /\/embed$/.test(src) ? '' : '/embed'; | ||
return "<div class=\"ratio ratio-16x9\" style=\"max-height: 100%;\"><iframe src=\"".concat(src, "\" class=\"start-50 translate-middle-x\" style=\"max-width: 500px\" frameborder=\"0\" scrolling=\"no\" allowtransparency=\"true\"></iframe></div>"); | ||
} | ||
} | ||
if (_this4.isEmbed(src)) { | ||
if (/^embed/.test(src)) src = src.substring(5); | ||
isEmbed(src) { | ||
const regex = new RegExp(Lightbox.allowedEmbedTypes.join('|')); | ||
const isEmbed = regex.test(src); | ||
const isImg = /\.(png|jpe?g|gif|svg|webp)/.test(src); | ||
return isEmbed || !isImg; | ||
} | ||
if (youtubeId) { | ||
src = "https://www.youtube.com/embed/".concat(youtubeId); | ||
attributes = 'title="YouTube video player" frameborder="0" allow="accelerometer autoplay clipboard-write encrypted-media gyroscope picture-in-picture"'; | ||
} | ||
createCarousel() { | ||
const template = document.createElement('template'); | ||
const slidesHtml = this.sources.map((src, i) => { | ||
src = src.replace(/\/$/, ''); | ||
let onload = ''; | ||
onload += /\.png/.test(src) ? "this.add.previousSibling.remove()" : ''; | ||
let inner = "<div class=\"ratio ratio-16x9\"><img src=\"".concat(src, "\" class=\"d-block w-100 h-100 img-fluid\" style=\"z-index: 1; object-fit: contain;\" onload=\"").concat(onload, "\" /></div>"); | ||
let attributes = ''; | ||
const instagramEmbed = this.getInstagramEmbed(src); | ||
const youtubeId = this.getYoutubeId(src); | ||
inner = instagramEmbed || "<div class=\"ratio ratio-16x9\"><iframe src=\"".concat(src, "\" ").concat(attributes, " allowfullscreen></iframe></div>"); | ||
if (this.isEmbed(src)) { | ||
if (/^embed/.test(src)) src = src.substring(5); | ||
if (youtubeId) { | ||
src = "https://www.youtube.com/embed/".concat(youtubeId); | ||
attributes = 'title="YouTube video player" frameborder="0" allow="accelerometer autoplay clipboard-write encrypted-media gyroscope picture-in-picture"'; | ||
} | ||
var spinner = "<div class=\"position-absolute top-50 start-50 translate-middle text-white\"><div class=\"spinner-border\" style=\"width: 3rem height: 3rem\" role=\"status\"></div></div>"; | ||
return "<div class=\"carousel-item ".concat(!i ? 'active' : '', "\" style=\"min-height: 100px\">").concat(spinner).concat(inner, "</div>"); | ||
}).join(''); | ||
var controlsHtml = this.sources.length < 2 ? '' : "\n\t\t\t<button class=\"carousel-control carousel-control-prev h-75 m-auto\" type=\"button\" data-bs-target=\"#lightboxCarousel-".concat(this.hash, "\" data-bs-slide=\"prev\">\n\t\t\t\t<span class=\"carousel-control-prev-icon\" aria-hidden=\"true\"></span>\n\t\t\t\t<span class=\"visually-hidden\">Previous</span>\n\t\t\t</button>\n\t\t\t<button class=\"carousel-control carousel-control-next h-75 m-auto\" type=\"button\" data-bs-target=\"#lightboxCarousel-").concat(this.hash, "\" data-bs-slide=\"next\">\n\t\t\t\t<span class=\"carousel-control-next-icon\" aria-hidden=\"true\"></span>\n\t\t\t\t<span class=\"visually-hidden\">Next</span>\n\t\t\t</button>"); | ||
var html = "\n\t\t\t<div id=\"lightboxCarousel-".concat(this.hash, "\" class=\"lightbox-carousel carousel\" data-bs-ride=\"carousel\">\n\t\t\t\t<div class=\"carousel-inner\">\n\t\t\t\t\t").concat(slidesHtml, "\n\t\t\t\t</div>\n\t\t\t\t").concat(controlsHtml, "\n\t\t\t</div>"); | ||
template.innerHTML = html.trim(); | ||
this.carouselElement = template.content.firstChild; | ||
this.carousel = new bootstrap.Carousel(this.carouselElement, this.carouselOptions); | ||
this.carousel.to(this.sources.includes(this.src) ? this.sources.indexOf(this.src) : 0); // this.carouselElement.querySelector('[data-bs-slide="prev"]').addEventListener('click', this.carousel.prev) | ||
inner = instagramEmbed || "<div class=\"ratio ratio-16x9\"><iframe src=\"".concat(src, "\" ").concat(attributes, " allowfullscreen></iframe></div>"); | ||
} | ||
return this.carousel; | ||
} | ||
}, { | ||
key: "createModal", | ||
value: function createModal() { | ||
var _this5 = this; | ||
const spinner = "<div class=\"position-absolute top-50 start-50 translate-middle text-white\"><div class=\"spinner-border\" style=\"width: 3rem height: 3rem\" role=\"status\"></div></div>"; | ||
return "<div class=\"carousel-item ".concat(!i ? 'active' : '', "\" style=\"min-height: 100px\">").concat(spinner).concat(inner, "</div>"); | ||
}).join(''); | ||
const controlsHtml = this.sources.length < 2 ? '' : "\n\t\t\t<button class=\"carousel-control carousel-control-prev h-75 m-auto\" type=\"button\" data-bs-target=\"#lightboxCarousel-".concat(this.hash, "\" data-bs-slide=\"prev\">\n\t\t\t\t<span class=\"carousel-control-prev-icon\" aria-hidden=\"true\"></span>\n\t\t\t\t<span class=\"visually-hidden\">Previous</span>\n\t\t\t</button>\n\t\t\t<button class=\"carousel-control carousel-control-next h-75 m-auto\" type=\"button\" data-bs-target=\"#lightboxCarousel-").concat(this.hash, "\" data-bs-slide=\"next\">\n\t\t\t\t<span class=\"carousel-control-next-icon\" aria-hidden=\"true\"></span>\n\t\t\t\t<span class=\"visually-hidden\">Next</span>\n\t\t\t</button>"); | ||
const html = "\n\t\t\t<div id=\"lightboxCarousel-".concat(this.hash, "\" class=\"lightbox-carousel carousel\" data-bs-ride=\"carousel\">\n\t\t\t\t<div class=\"carousel-inner\">\n\t\t\t\t\t").concat(slidesHtml, "\n\t\t\t\t</div>\n\t\t\t\t").concat(controlsHtml, "\n\t\t\t</div>"); | ||
template.innerHTML = html.trim(); | ||
this.carouselElement = template.content.firstChild; | ||
this.carousel = new bootstrap.Carousel(this.carouselElement, this.carouselOptions); | ||
this.carousel.to(this.sources.includes(this.src) ? this.sources.indexOf(this.src) : 0); // this.carouselElement.querySelector('[data-bs-slide="prev"]').addEventListener('click', this.carousel.prev) | ||
var template = document.createElement('template'); | ||
var btnInner = '<svg xmlns="http://www.w3.org/2000/svg" style="position: relative; top: -5px;" viewBox="0 0 16 16" fill="#fff"><path d="M.293.293a1 1 0 011.414 0L8 6.586 14.293.293a1 1 0 111.414 1.414L9.414 8l6.293 6.293a1 1 0 01-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 01-1.414-1.414L6.586 8 .293 1.707a1 1 0 010-1.414z"/></svg>)'; | ||
var html = "\n\t\t\t<div class=\"modal lightbox fade\" id=\"lightboxModal-".concat(this.hash, "\" tabindex=\"-1\" aria-hidden=\"true\">\n\t\t\t\t<div class=\"modal-dialog modal-dialog-centered modal-xl\">\n\t\t\t\t\t<div class=\"modal-content border-0\" style=\"background: black\">\n\t\t\t\t\t\t<div class=\"modal-body p-0\">\n\t\t\t\t\t\t\t<button type=\"button\" class=\"btn-close position-absolute top-0 end-0 p-3\" data-bs-dismiss=\"modal\" aria-label=\"Close\" style=\"z-index: 2; background: none;\">").concat(btnInner, "</button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>"); | ||
template.innerHTML = html.trim(); | ||
this.modalElement = template.content.firstChild; | ||
this.modalElement.querySelector('.modal-body').appendChild(this.carouselElement); | ||
this.modalElement.addEventListener('hidden.bs.modal', function (e) { | ||
return _this5.modalElement.remove(); | ||
}); | ||
this.modal = new bootstrap.Modal(this.modalElement, this.modalOptions); | ||
return this.modal; | ||
} | ||
}, { | ||
key: "randomHash", | ||
value: function randomHash() { | ||
var length = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 8; | ||
return Array.from({ | ||
length: length | ||
}, function () { | ||
return Math.floor(Math.random() * 36).toString(36); | ||
}).join(''); | ||
} | ||
}]); | ||
return this.carousel; | ||
} | ||
return Lightbox; | ||
}(); | ||
createModal() { | ||
const template = document.createElement('template'); | ||
const btnInner = '<svg xmlns="http://www.w3.org/2000/svg" style="position: relative; top: -5px;" viewBox="0 0 16 16" fill="#fff"><path d="M.293.293a1 1 0 011.414 0L8 6.586 14.293.293a1 1 0 111.414 1.414L9.414 8l6.293 6.293a1 1 0 01-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 01-1.414-1.414L6.586 8 .293 1.707a1 1 0 010-1.414z"/></svg>)'; | ||
const html = "\n\t\t\t<div class=\"modal lightbox fade\" id=\"lightboxModal-".concat(this.hash, "\" tabindex=\"-1\" aria-hidden=\"true\">\n\t\t\t\t<div class=\"modal-dialog modal-dialog-centered modal-xl\">\n\t\t\t\t\t<div class=\"modal-content border-0\" style=\"background: black\">\n\t\t\t\t\t\t<div class=\"modal-body p-0\">\n\t\t\t\t\t\t\t<button type=\"button\" class=\"btn-close position-absolute top-0 end-0 p-3\" data-bs-dismiss=\"modal\" aria-label=\"Close\" style=\"z-index: 2; background: none;\">").concat(btnInner, "</button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>"); | ||
template.innerHTML = html.trim(); | ||
this.modalElement = template.content.firstChild; | ||
this.modalElement.querySelector('.modal-body').appendChild(this.carouselElement); | ||
this.modalElement.addEventListener('hidden.bs.modal', e => this.modalElement.remove()); | ||
this.modal = new bootstrap.Modal(this.modalElement, this.modalOptions); | ||
return this.modal; | ||
} | ||
randomHash(length = 8) { | ||
return Array.from({ | ||
length | ||
}, () => Math.floor(Math.random() * 36).toString(36)).join(''); | ||
} | ||
} | ||
Lightbox.allowedEmbedTypes = ['embed', 'youtube', 'vimeo', 'instagram', 'url']; | ||
Lightbox.allowedMediaTypes = [].concat(_toConsumableArray(Lightbox.allowedEmbedTypes), ['image']); | ||
Lightbox.allowedMediaTypes = [...Lightbox.allowedEmbedTypes, 'image']; | ||
Lightbox.defaultSelector = '[data-toggle="lightbox"]'; | ||
document.querySelectorAll(Lightbox.defaultSelector).forEach(function (el) { | ||
return el.addEventListener('click', function (e) { | ||
e.preventDefault(); | ||
var lightbox = new Lightbox(el); | ||
lightbox.show(); | ||
}); | ||
}); | ||
document.querySelectorAll(Lightbox.defaultSelector).forEach(el => el.addEventListener('click', e => { | ||
e.preventDefault(); | ||
const lightbox = new Lightbox(el); | ||
lightbox.show(); | ||
})); | ||
var _default = Lightbox; | ||
exports.default = _default; |
@@ -1,1 +0,1 @@ | ||
!function(){"use strict";const t="transitionend",e=e=>{e.dispatchEvent(new Event(t))},i=t=>!(!t||"object"!=typeof t)&&(void 0!==t.jquery&&(t=t[0]),void 0!==t.nodeType),s=t=>i(t)?t.jquery?t[0]:t:"string"==typeof t&&t.length>0?document.querySelector(t):null,n=(t,e,s)=>{Object.keys(s).forEach((n=>{const o=s[n],r=e[n],a=r&&i(r)?"element":null==(l=r)?`${l}`:{}.toString.call(l).match(/\s([a-z]+)/i)[1].toLowerCase();var l;if(!new RegExp(o).test(a))throw new TypeError(`${t.toUpperCase()}: Option "${n}" provided type "${a}" but expected type "${o}".`)}))},o=t=>!(!i(t)||0===t.getClientRects().length)&&"visible"===getComputedStyle(t).getPropertyValue("visibility"),r=t=>{t.offsetHeight},a=()=>"rtl"===document.documentElement.dir,l=t=>{"function"==typeof t&&t()},c=(i,s,n=!0)=>{if(!n)return void l(i);const o=(t=>{if(!t)return 0;let{transitionDuration:e,transitionDelay:i}=window.getComputedStyle(t);const s=Number.parseFloat(e),n=Number.parseFloat(i);return s||n?(e=e.split(",")[0],i=i.split(",")[0],1e3*(Number.parseFloat(e)+Number.parseFloat(i))):0})(s)+5;let r=!1;const a=({target:e})=>{e===s&&(r=!0,s.removeEventListener(t,a),l(i))};s.addEventListener(t,a),setTimeout((()=>{r||e(s)}),o)},d=/[^.]*(?=\..*)\.|.*/,h=/\..*/,u=/::\d+$/,m={};let g=1;const _={mouseenter:"mouseover",mouseleave:"mouseout"},f=/^(mouseenter|mouseleave)/i,p=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function b(t,e){return e&&`${e}::${g++}`||t.uidEvent||g++}function v(t){const e=b(t);return t.uidEvent=e,m[e]=m[e]||{},m[e]}function y(t,e,i=null){const s=Object.keys(t);for(let n=0,o=s.length;n<o;n++){const o=t[s[n]];if(o.originalHandler===e&&o.delegationSelector===i)return o}return null}function E(t,e,i){const s="string"==typeof e,n=s?i:e;let o=k(t);return p.has(o)||(o=t),[s,n,o]}function w(t,e,i,s,n){if("string"!=typeof e||!t)return;if(i||(i=s,s=null),f.test(e)){const t=t=>function(e){if(!e.relatedTarget||e.relatedTarget!==e.delegateTarget&&!e.delegateTarget.contains(e.relatedTarget))return t.call(this,e)};s?s=t(s):i=t(i)}const[o,r,a]=E(e,i,s),l=v(t),c=l[a]||(l[a]={}),h=y(c,r,o?i:null);if(h)return void(h.oneOff=h.oneOff&&n);const u=b(r,e.replace(d,"")),m=o?function(t,e,i){return function s(n){const o=t.querySelectorAll(e);for(let{target:r}=n;r&&r!==this;r=r.parentNode)for(let a=o.length;a--;)if(o[a]===r)return n.delegateTarget=r,s.oneOff&&T.off(t,n.type,e,i),i.apply(r,[n]);return null}}(t,i,s):function(t,e){return function i(s){return s.delegateTarget=t,i.oneOff&&T.off(t,s.type,e),e.apply(t,[s])}}(t,i);m.delegationSelector=o?i:null,m.originalHandler=r,m.oneOff=n,m.uidEvent=u,c[u]=m,t.addEventListener(a,m,o)}function A(t,e,i,s,n){const o=y(e[i],s,n);o&&(t.removeEventListener(i,o,Boolean(n)),delete e[i][o.uidEvent])}function k(t){return t=t.replace(h,""),_[t]||t}const T={on(t,e,i,s){w(t,e,i,s,!1)},one(t,e,i,s){w(t,e,i,s,!0)},off(t,e,i,s){if("string"!=typeof e||!t)return;const[n,o,r]=E(e,i,s),a=r!==e,l=v(t),c=e.startsWith(".");if(void 0!==o){if(!l||!l[r])return;return void A(t,l,r,o,n?i:null)}c&&Object.keys(l).forEach((i=>{!function(t,e,i,s){const n=e[i]||{};Object.keys(n).forEach((o=>{if(o.includes(s)){const s=n[o];A(t,e,i,s.originalHandler,s.delegationSelector)}}))}(t,l,i,e.slice(1))}));const d=l[r]||{};Object.keys(d).forEach((i=>{const s=i.replace(u,"");if(!a||e.includes(s)){const e=d[i];A(t,l,r,e.originalHandler,e.delegationSelector)}}))},trigger(t,e,i){if("string"!=typeof e||!t)return null;const s=(()=>{const{jQuery:t}=window;return t&&!document.body.hasAttribute("data-bs-no-jquery")?t:null})(),n=k(e),o=e!==n,r=p.has(n);let a,l=!0,c=!0,d=!1,h=null;return o&&s&&(a=s.Event(e,i),s(t).trigger(a),l=!a.isPropagationStopped(),c=!a.isImmediatePropagationStopped(),d=a.isDefaultPrevented()),r?(h=document.createEvent("HTMLEvents"),h.initEvent(n,l,!0)):h=new CustomEvent(e,{bubbles:l,cancelable:!0}),void 0!==i&&Object.keys(i).forEach((t=>{Object.defineProperty(h,t,{get:()=>i[t]})})),d&&h.preventDefault(),c&&t.dispatchEvent(h),h.defaultPrevented&&void 0!==a&&a.preventDefault(),h}};var O=T;function x(t){return"true"===t||"false"!==t&&(t===Number(t).toString()?Number(t):""===t||"null"===t?null:t)}function S(t){return t.replace(/[A-Z]/g,(t=>`-${t.toLowerCase()}`))}var D={setDataAttribute(t,e,i){t.setAttribute(`data-bs-${S(e)}`,i)},removeDataAttribute(t,e){t.removeAttribute(`data-bs-${S(e)}`)},getDataAttributes(t){if(!t)return{};const e={};return Object.keys(t.dataset).filter((t=>t.startsWith("bs"))).forEach((i=>{let s=i.replace(/^bs/,"");s=s.charAt(0).toLowerCase()+s.slice(1,s.length),e[s]=x(t.dataset[i])})),e},getDataAttribute:(t,e)=>x(t.getAttribute(`data-bs-${S(e)}`)),offset(t){const e=t.getBoundingClientRect();return{top:e.top+window.pageYOffset,left:e.left+window.pageXOffset}},position:t=>({top:t.offsetTop,left:t.offsetLeft})},C={find:(t,e=document.documentElement)=>[].concat(...Element.prototype.querySelectorAll.call(e,t)),findOne:(t,e=document.documentElement)=>Element.prototype.querySelector.call(e,t),children:(t,e)=>[].concat(...t.children).filter((t=>t.matches(e))),parents(t,e){const i=[];let s=t.parentNode;for(;s&&s.nodeType===Node.ELEMENT_NODE&&3!==s.nodeType;)s.matches(e)&&i.push(s),s=s.parentNode;return i},prev(t,e){let i=t.previousElementSibling;for(;i;){if(i.matches(e))return[i];i=i.previousElementSibling}return[]},next(t,e){let i=t.nextElementSibling;for(;i;){if(i.matches(e))return[i];i=i.nextElementSibling}return[]},focusableChildren(t){const e=["a","button","input","textarea","select","details","[tabindex]",'[contenteditable="true"]'].map((t=>`${t}:not([tabindex^="-"])`)).join(", ");return this.find(e,t).filter((t=>!(t=>!t||t.nodeType!==Node.ELEMENT_NODE||!!t.classList.contains("disabled")||(void 0!==t.disabled?t.disabled:t.hasAttribute("disabled")&&"false"!==t.getAttribute("disabled")))(t)&&o(t)))}};const L=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",j=".sticky-top";const I=new Map;var N={set(t,e,i){I.has(t)||I.set(t,new Map);const s=I.get(t);s.has(e)||0===s.size?s.set(e,i):console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(s.keys())[0]}.`)},get:(t,e)=>I.has(t)&&I.get(t).get(e)||null,remove(t,e){if(!I.has(t))return;const i=I.get(t);i.delete(e),0===i.size&&I.delete(t)}},$=class{constructor(t){(t=s(t))&&(this._element=t,N.set(this._element,this.constructor.DATA_KEY,this))}dispose(){N.remove(this._element,this.constructor.DATA_KEY),O.off(this._element,this.constructor.EVENT_KEY),Object.getOwnPropertyNames(this).forEach((t=>{this[t]=null}))}_queueCallback(t,e,i=!0){c(t,e,i)}static getInstance(t){return N.get(s(t),this.DATA_KEY)}static getOrCreateInstance(t,e={}){return this.getInstance(t)||new this(t,"object"==typeof e?e:null)}static get VERSION(){return"5.1.1"}static get NAME(){throw new Error('You have to implement the static method "NAME", for each component!')}static get DATA_KEY(){return`bs.${this.NAME}`}static get EVENT_KEY(){return`.${this.DATA_KEY}`}};const M={className:"modal-backdrop",isVisible:!0,isAnimated:!1,rootElement:"body",clickCallback:null},B={className:"string",isVisible:"boolean",isAnimated:"boolean",rootElement:"(element|string)",clickCallback:"(function|null)"},P="backdrop",q="show",R=`mousedown.bs.${P}`;const Y={trapElement:null,autofocus:!0},X={trapElement:"element",autofocus:"boolean"},z=".bs.focustrap",H=`focusin${z}`,W=`keydown.tab${z}`,F="backward";const K="modal",V="Escape",Q={backdrop:!0,keyboard:!0,focus:!0},G={backdrop:"(boolean|string)",keyboard:"boolean",focus:"boolean"},U="resize.bs.modal",Z="click.dismiss.bs.modal",J="keydown.dismiss.bs.modal",tt="mousedown.dismiss.bs.modal",et="modal-open",it="show",st="modal-static";class nt extends ${constructor(t,e){super(t),this._config=this._getConfig(e),this._dialog=C.findOne(".modal-dialog",this._element),this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._isShown=!1,this._ignoreBackdropClick=!1,this._isTransitioning=!1,this._scrollBar=new class{constructor(){this._element=document.body}getWidth(){const t=document.documentElement.clientWidth;return Math.abs(window.innerWidth-t)}hide(){const t=this.getWidth();this._disableOverFlow(),this._setElementAttributes(this._element,"paddingRight",(e=>e+t)),this._setElementAttributes(L,"paddingRight",(e=>e+t)),this._setElementAttributes(j,"marginRight",(e=>e-t))}_disableOverFlow(){this._saveInitialAttribute(this._element,"overflow"),this._element.style.overflow="hidden"}_setElementAttributes(t,e,i){const s=this.getWidth();this._applyManipulationCallback(t,(t=>{if(t!==this._element&&window.innerWidth>t.clientWidth+s)return;this._saveInitialAttribute(t,e);const n=window.getComputedStyle(t)[e];t.style[e]=`${i(Number.parseFloat(n))}px`}))}reset(){this._resetElementAttributes(this._element,"overflow"),this._resetElementAttributes(this._element,"paddingRight"),this._resetElementAttributes(L,"paddingRight"),this._resetElementAttributes(j,"marginRight")}_saveInitialAttribute(t,e){const i=t.style[e];i&&D.setDataAttribute(t,e,i)}_resetElementAttributes(t,e){this._applyManipulationCallback(t,(t=>{const i=D.getDataAttribute(t,e);void 0===i?t.style.removeProperty(e):(D.removeDataAttribute(t,e),t.style[e]=i)}))}_applyManipulationCallback(t,e){i(t)?e(t):C.find(t,this._element).forEach(e)}isOverflowing(){return this.getWidth()>0}}}static get Default(){return Q}static get NAME(){return K}toggle(t){return this._isShown?this.hide():this.show(t)}show(t){this._isShown||this._isTransitioning||O.trigger(this._element,"show.bs.modal",{relatedTarget:t}).defaultPrevented||(this._isShown=!0,this._isAnimated()&&(this._isTransitioning=!0),this._scrollBar.hide(),document.body.classList.add(et),this._adjustDialog(),this._setEscapeEvent(),this._setResizeEvent(),O.on(this._dialog,tt,(()=>{O.one(this._element,"mouseup.dismiss.bs.modal",(t=>{t.target===this._element&&(this._ignoreBackdropClick=!0)}))})),this._showBackdrop((()=>this._showElement(t))))}hide(){if(!this._isShown||this._isTransitioning)return;if(O.trigger(this._element,"hide.bs.modal").defaultPrevented)return;this._isShown=!1;const t=this._isAnimated();t&&(this._isTransitioning=!0),this._setEscapeEvent(),this._setResizeEvent(),this._focustrap.deactivate(),this._element.classList.remove(it),O.off(this._element,Z),O.off(this._dialog,tt),this._queueCallback((()=>this._hideModal()),this._element,t)}dispose(){[window,this._dialog].forEach((t=>O.off(t,".bs.modal"))),this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}handleUpdate(){this._adjustDialog()}_initializeBackDrop(){return new class{constructor(t){this._config=this._getConfig(t),this._isAppended=!1,this._element=null}show(t){this._config.isVisible?(this._append(),this._config.isAnimated&&r(this._getElement()),this._getElement().classList.add(q),this._emulateAnimation((()=>{l(t)}))):l(t)}hide(t){this._config.isVisible?(this._getElement().classList.remove(q),this._emulateAnimation((()=>{this.dispose(),l(t)}))):l(t)}_getElement(){if(!this._element){const t=document.createElement("div");t.className=this._config.className,this._config.isAnimated&&t.classList.add("fade"),this._element=t}return this._element}_getConfig(t){return(t={...M,..."object"==typeof t?t:{}}).rootElement=s(t.rootElement),n(P,t,B),t}_append(){this._isAppended||(this._config.rootElement.append(this._getElement()),O.on(this._getElement(),R,(()=>{l(this._config.clickCallback)})),this._isAppended=!0)}dispose(){this._isAppended&&(O.off(this._element,R),this._element.remove(),this._isAppended=!1)}_emulateAnimation(t){c(t,this._getElement(),this._config.isAnimated)}}({isVisible:Boolean(this._config.backdrop),isAnimated:this._isAnimated()})}_initializeFocusTrap(){return new class{constructor(t){this._config=this._getConfig(t),this._isActive=!1,this._lastTabNavDirection=null}activate(){const{trapElement:t,autofocus:e}=this._config;this._isActive||(e&&t.focus(),O.off(document,z),O.on(document,H,(t=>this._handleFocusin(t))),O.on(document,W,(t=>this._handleKeydown(t))),this._isActive=!0)}deactivate(){this._isActive&&(this._isActive=!1,O.off(document,z))}_handleFocusin(t){const{target:e}=t,{trapElement:i}=this._config;if(e===document||e===i||i.contains(e))return;const s=C.focusableChildren(i);0===s.length?i.focus():this._lastTabNavDirection===F?s[s.length-1].focus():s[0].focus()}_handleKeydown(t){"Tab"===t.key&&(this._lastTabNavDirection=t.shiftKey?F:"forward")}_getConfig(t){return t={...Y,..."object"==typeof t?t:{}},n("focustrap",t,X),t}}({trapElement:this._element})}_getConfig(t){return t=Object.assign(Object.assign(Object.assign({},Q),D.getDataAttributes(this._element)),"object"==typeof t?t:{}),n(K,t,G),t}_showElement(t){const e=this._isAnimated(),i=C.findOne(".modal-body",this._dialog);this._element.parentNode&&this._element.parentNode.nodeType===Node.ELEMENT_NODE||document.body.append(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.scrollTop=0,i&&(i.scrollTop=0),e&&r(this._element),this._element.classList.add(it),this._queueCallback((()=>{this._config.focus&&this._focustrap.activate(),this._isTransitioning=!1,O.trigger(this._element,"shown.bs.modal",{relatedTarget:t})}),this._dialog,e)}_setEscapeEvent(){this._isShown?O.on(this._element,J,(t=>{this._config.keyboard&&t.key===V?(t.preventDefault(),this.hide()):this._config.keyboard||t.key!==V||this._triggerBackdropTransition()})):O.off(this._element,J)}_setResizeEvent(){this._isShown?O.on(window,U,(()=>this._adjustDialog())):O.off(window,U)}_hideModal(){this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,this._backdrop.hide((()=>{document.body.classList.remove(et),this._resetAdjustments(),this._scrollBar.reset(),O.trigger(this._element,"hidden.bs.modal")}))}_showBackdrop(t){O.on(this._element,Z,(t=>{this._ignoreBackdropClick?this._ignoreBackdropClick=!1:t.target===t.currentTarget&&(!0===this._config.backdrop?this.hide():"static"===this._config.backdrop&&this._triggerBackdropTransition())})),this._backdrop.show(t)}_isAnimated(){return this._element.classList.contains("fade")}_triggerBackdropTransition(){if(O.trigger(this._element,"hidePrevented.bs.modal").defaultPrevented)return;const{classList:t,scrollHeight:e,style:i}=this._element,s=e>document.documentElement.clientHeight;!s&&"hidden"===i.overflowY||t.contains(st)||(s||(i.overflowY="hidden"),t.add(st),this._queueCallback((()=>{t.remove(st),s||this._queueCallback((()=>{i.overflowY=""}),this._dialog)}),this._dialog),this._element.focus())}_adjustDialog(){const t=this._element.scrollHeight>document.documentElement.clientHeight,e=this._scrollBar.getWidth(),i=e>0;(!i&&t&&!a()||i&&!t&&a())&&(this._element.style.paddingLeft=`${e}px`),(i&&!t&&!a()||!i&&t&&a())&&(this._element.style.paddingRight=`${e}px`)}_resetAdjustments(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}static jQueryInterface(t,e){return this.each((function(){const i=nt.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===i[t])throw new TypeError(`No method named "${t}"`);i[t](e)}}))}}var ot=nt;const rt="carousel",at={interval:5e3,keyboard:!0,slide:!1,pause:"hover",wrap:!0,touch:!0},lt={interval:"(number|boolean)",keyboard:"boolean",slide:"(boolean|string)",pause:"(string|boolean)",wrap:"boolean",touch:"boolean"},ct="next",dt="prev",ht="left",ut="right",mt={ArrowLeft:ut,ArrowRight:ht},gt="slid.bs.carousel",_t="active",ft=".active.carousel-item";class pt extends ${constructor(t,e){super(t),this._items=null,this._interval=null,this._activeElement=null,this._isPaused=!1,this._isSliding=!1,this.touchTimeout=null,this.touchStartX=0,this.touchDeltaX=0,this._config=this._getConfig(e),this._indicatorsElement=C.findOne(".carousel-indicators",this._element),this._touchSupported="ontouchstart"in document.documentElement||navigator.maxTouchPoints>0,this._pointerEvent=Boolean(window.PointerEvent),this._addEventListeners()}static get Default(){return at}static get NAME(){return rt}next(){this._slide(ct)}nextWhenVisible(){!document.hidden&&o(this._element)&&this.next()}prev(){this._slide(dt)}pause(t){t||(this._isPaused=!0),C.findOne(".carousel-item-next, .carousel-item-prev",this._element)&&(e(this._element),this.cycle(!0)),clearInterval(this._interval),this._interval=null}cycle(t){t||(this._isPaused=!1),this._interval&&(clearInterval(this._interval),this._interval=null),this._config&&this._config.interval&&!this._isPaused&&(this._updateInterval(),this._interval=setInterval((document.visibilityState?this.nextWhenVisible:this.next).bind(this),this._config.interval))}to(t){this._activeElement=C.findOne(ft,this._element);const e=this._getItemIndex(this._activeElement);if(t>this._items.length-1||t<0)return;if(this._isSliding)return void O.one(this._element,gt,(()=>this.to(t)));if(e===t)return this.pause(),void this.cycle();const i=t>e?ct:dt;this._slide(i,this._items[t])}_getConfig(t){return t=Object.assign(Object.assign(Object.assign({},at),D.getDataAttributes(this._element)),"object"==typeof t?t:{}),n(rt,t,lt),t}_handleSwipe(){const t=Math.abs(this.touchDeltaX);if(t<=40)return;const e=t/this.touchDeltaX;this.touchDeltaX=0,e&&this._slide(e>0?ut:ht)}_addEventListeners(){this._config.keyboard&&O.on(this._element,"keydown.bs.carousel",(t=>this._keydown(t))),"hover"===this._config.pause&&(O.on(this._element,"mouseenter.bs.carousel",(t=>this.pause(t))),O.on(this._element,"mouseleave.bs.carousel",(t=>this.cycle(t)))),this._config.touch&&this._touchSupported&&this._addTouchEventListeners()}dispose(){Data.remove(this._element,this.constructor.DATA_KEY),O.off(this._element,this.constructor.EVENT_KEY),Object.getOwnPropertyNames(this).forEach((t=>{this[t]=null}))}_addTouchEventListeners(){const t=t=>this._pointerEvent&&("pen"===t.pointerType||"touch"===t.pointerType),e=e=>{t(e)?this.touchStartX=e.clientX:this._pointerEvent||(this.touchStartX=e.touches[0].clientX)},i=t=>{this.touchDeltaX=t.touches&&t.touches.length>1?0:t.touches[0].clientX-this.touchStartX},s=e=>{t(e)&&(this.touchDeltaX=e.clientX-this.touchStartX),this._handleSwipe(),"hover"===this._config.pause&&(this.pause(),this.touchTimeout&&clearTimeout(this.touchTimeout),this.touchTimeout=setTimeout((t=>this.cycle(t)),500+this._config.interval))};C.find(".carousel-item img",this._element).forEach((t=>{O.on(t,"dragstart.bs.carousel",(t=>t.preventDefault()))})),this._pointerEvent?(O.on(this._element,"pointerdown.bs.carousel",(t=>e(t))),O.on(this._element,"pointerup.bs.carousel",(t=>s(t))),this._element.classList.add("pointer-event")):(O.on(this._element,"touchstart.bs.carousel",(t=>e(t))),O.on(this._element,"touchmove.bs.carousel",(t=>i(t))),O.on(this._element,"touchend.bs.carousel",(t=>s(t))))}_keydown(t){if(/input|textarea/i.test(t.target.tagName))return;const e=mt[t.key];e&&(t.preventDefault(),this._slide(e))}_getItemIndex(t){return this._items=t&&t.parentNode?C.find(".carousel-item",t.parentNode):[],this._items.indexOf(t)}_getItemByOrder(t,e){const i=t===ct;return((t,e,i,s)=>{let n=t.indexOf(e);if(-1===n)return t[!i&&s?t.length-1:0];const o=t.length;return n+=i?1:-1,s&&(n=(n+o)%o),t[Math.max(0,Math.min(n,o-1))]})(this._items,e,i,this._config.wrap)}_triggerSlideEvent(t,e){const i=this._getItemIndex(t),s=this._getItemIndex(C.findOne(ft,this._element));return O.trigger(this._element,"slide.bs.carousel",{relatedTarget:t,direction:e,from:s,to:i})}_setActiveIndicatorElement(t){if(this._indicatorsElement){const e=C.findOne(".active",this._indicatorsElement);e.classList.remove(_t),e.removeAttribute("aria-current");const i=C.find("[data-bs-target]",this._indicatorsElement);for(let e=0;e<i.length;e++)if(Number.parseInt(i[e].getAttribute("data-bs-slide-to"),10)===this._getItemIndex(t)){i[e].classList.add(_t),i[e].setAttribute("aria-current","true");break}}}_updateInterval(){const t=this._activeElement||C.findOne(ft,this._element);if(!t)return;const e=Number.parseInt(t.getAttribute("data-bs-interval"),10);e?(this._config.defaultInterval=this._config.defaultInterval||this._config.interval,this._config.interval=e):this._config.interval=this._config.defaultInterval||this._config.interval}_slide(t,e){const i=this._directionToOrder(t),s=C.findOne(ft,this._element),n=this._getItemIndex(s),o=e||this._getItemByOrder(i,s),a=this._getItemIndex(o),l=Boolean(this._interval),c=i===ct,d=c?"carousel-item-start":"carousel-item-end",h=c?"carousel-item-next":"carousel-item-prev",u=this._orderToDirection(i);if(o&&o.classList.contains(_t))return void(this._isSliding=!1);if(this._isSliding)return;if(this._triggerSlideEvent(o,u).defaultPrevented)return;if(!s||!o)return;this._isSliding=!0,l&&this.pause(),this._setActiveIndicatorElement(o),this._activeElement=o;const m=()=>{O.trigger(this._element,gt,{relatedTarget:o,direction:u,from:n,to:a})};if(this._element.classList.contains("slide")){o.classList.add(h),r(o),s.classList.add(d),o.classList.add(d);const t=()=>{o.classList.remove(d,h),o.classList.add(_t),s.classList.remove(_t,h,d),this._isSliding=!1,setTimeout(m,0)};this._queueCallback(t,s,!0)}else s.classList.remove(_t),o.classList.add(_t),this._isSliding=!1,m();l&&this.cycle()}_directionToOrder(t){return[ut,ht].includes(t)?a()?t===ht?dt:ct:t===ht?ct:dt:t}_orderToDirection(t){return[ct,dt].includes(t)?a()?t===dt?ht:ut:t===dt?ut:ht:t}static carouselInterface(t,e){const i=pt.getOrCreateInstance(t,e);let{_config:s}=i;"object"==typeof e&&(s=Object.assign(Object.assign({},s),e));const n="string"==typeof e?e:s.slide;if("number"==typeof e)i.to(e);else if("string"==typeof n){if(void 0===i[n])throw new TypeError(`No method named "${n}"`);i[n]()}else s.interval&&s.ride&&(i.pause(),i.cycle())}static jQueryInterface(t){return this.each((function(){pt.carouselInterface(this,t)}))}static dataApiClickHandler(t){let e=(t=>{const e=(t=>{let e=t.getAttribute("data-bs-target");if(!e||"#"===e){let i=t.getAttribute("href");if(!i||!i.includes("#")&&!i.startsWith("."))return null;i.includes("#")&&!i.startsWith("#")&&(i=`#${i.split("#")[1]}`),e=i&&"#"!==i?i.trim():null}return e})(this);return e?document.querySelector(e):null})();if(!e||!e.classList.contains("carousel"))return;const i=Object.assign(Object.assign({},D.getDataAttributes(e)),D.getDataAttributes(this));console.log(i);const s=this.getAttribute("data-bs-slide-to");s&&(i.interval=!1),pt.carouselInterface(e,i),s&&pt.getInstance(e).to(s),t.preventDefault()}}const bt={Modal:ot,Carousel:pt};class vt{constructor(t,e={}){this.hash=this.randomHash(),this.settings=Object.assign(Object.assign(Object.assign({},bt.Modal.Default),bt.Carousel.Default),{interval:!1,target:'[data-toggle="lightbox"]',gallery:""}),this.modalOptions=(()=>this.setOptionsFromSettings(bt.Modal.Default))(),this.carouselOptions=(()=>this.setOptionsFromSettings(bt.Carousel.Default))(),console.log(),"string"==typeof t&&(this.settings.target=t,t=document.querySelector(this.settings.target),e=void 0!==arguments[1]?arguments[1]:{}),this.settings=Object.assign(Object.assign({},this.settings),e),this.el=t,this.type=t.dataset.type||"image",this.src=this.getSrc(t),this.src="image"!==this.type?"embed"+this.src:this.src,this.sources=this.getGalleryItems(),this.createCarousel(),this.createModal()}show(){document.body.appendChild(this.modalElement),this.modal.show()}hide(){this.modal.hide()}setOptionsFromSettings(t){return Object.keys(t).reduce(((t,e)=>Object.assign(t,{[e]:this.settings[e]})),{})}getSrc(t){return t.dataset.src||t.dataset.remote||t.href||"http://via.placeholder.com/1600x900"}getGalleryItems(){let t;if(this.settings.gallery){if(Array.isArray(this.settings.gallery))return this.settings.gallery;t=this.settings.gallery}else this.el.dataset.gallery&&(t=this.el.dataset.gallery);return t?[...new Set(Array.from(document.querySelectorAll(`[data-gallery="${t}"]`),(t=>`${t.dataset.type?"embed":""}${this.getSrc(t)}`)))]:[this.src]}getYoutubeId(t){if(!t)return!1;let e=t.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/);return!(!e||11!==e[2].length)&&e[2]}getInstagramEmbed(t){if(/instagram/.test(t))return`<div class="ratio ratio-16x9" style="max-height: 100%;"><iframe src="${t+=/\/embed$/.test(t)?"":"/embed"}" class="start-50 translate-middle-x" style="max-width: 500px" frameborder="0" scrolling="no" allowtransparency="true"></iframe></div>`}isEmbed(t){const e=new RegExp(vt.allowedEmbedTypes.join("|")).test(t),i=/\.(png|jpe?g|gif|svg|webp)/.test(t);return e||!i}createCarousel(){const t=document.createElement("template"),e=this.sources.map(((t,e)=>{t=t.replace(/\/$/,"");let i="";i+=/\.png/.test(t)?"this.add.previousSibling.remove()":"";let s=`<div class="ratio ratio-16x9"><img src="${t}" class="d-block w-100 h-100 img-fluid" style="z-index: 1; object-fit: contain;" onload="${i}" /></div>`,n="";const o=this.getInstagramEmbed(t),r=this.getYoutubeId(t);return this.isEmbed(t)&&(/^embed/.test(t)&&(t=t.substring(5)),r&&(t=`https://www.youtube.com/embed/${r}`,n='title="YouTube video player" frameborder="0" allow="accelerometer autoplay clipboard-write encrypted-media gyroscope picture-in-picture"'),s=o||`<div class="ratio ratio-16x9"><iframe src="${t}" ${n} allowfullscreen></iframe></div>`),`<div class="carousel-item ${e?"":"active"}" style="min-height: 100px"><div class="position-absolute top-50 start-50 translate-middle text-white"><div class="spinner-border" style="width: 3rem height: 3rem" role="status"></div></div>${s}</div>`})).join(""),i=this.sources.length<2?"":`\n\t\t\t<button class="carousel-control carousel-control-prev h-75 m-auto" type="button" data-bs-target="#lightboxCarousel-${this.hash}" data-bs-slide="prev">\n\t\t\t\t<span class="carousel-control-prev-icon" aria-hidden="true"></span>\n\t\t\t\t<span class="visually-hidden">Previous</span>\n\t\t\t</button>\n\t\t\t<button class="carousel-control carousel-control-next h-75 m-auto" type="button" data-bs-target="#lightboxCarousel-${this.hash}" data-bs-slide="next">\n\t\t\t\t<span class="carousel-control-next-icon" aria-hidden="true"></span>\n\t\t\t\t<span class="visually-hidden">Next</span>\n\t\t\t</button>`,s=`\n\t\t\t<div id="lightboxCarousel-${this.hash}" class="lightbox-carousel carousel" data-bs-ride="carousel">\n\t\t\t\t<div class="carousel-inner">\n\t\t\t\t\t${e}\n\t\t\t\t</div>\n\t\t\t\t${i}\n\t\t\t</div>`;return t.innerHTML=s.trim(),this.carouselElement=t.content.firstChild,this.carousel=new bt.Carousel(this.carouselElement,this.carouselOptions),this.carousel.to(this.sources.includes(this.src)?this.sources.indexOf(this.src):0),this.carousel}createModal(){const t=document.createElement("template"),e=`\n\t\t\t<div class="modal lightbox fade" id="lightboxModal-${this.hash}" tabindex="-1" aria-hidden="true">\n\t\t\t\t<div class="modal-dialog modal-dialog-centered modal-xl">\n\t\t\t\t\t<div class="modal-content border-0" style="background: black">\n\t\t\t\t\t\t<div class="modal-body p-0">\n\t\t\t\t\t\t\t<button type="button" class="btn-close position-absolute top-0 end-0 p-3" data-bs-dismiss="modal" aria-label="Close" style="z-index: 2; background: none;"><svg xmlns="http://www.w3.org/2000/svg" style="position: relative; top: -5px;" viewBox="0 0 16 16" fill="#fff"><path d="M.293.293a1 1 0 011.414 0L8 6.586 14.293.293a1 1 0 111.414 1.414L9.414 8l6.293 6.293a1 1 0 01-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 01-1.414-1.414L6.586 8 .293 1.707a1 1 0 010-1.414z"/></svg>)</button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>`;return t.innerHTML=e.trim(),this.modalElement=t.content.firstChild,this.modalElement.querySelector(".modal-body").appendChild(this.carouselElement),this.modalElement.addEventListener("hidden.bs.modal",(t=>this.modalElement.remove())),this.modal=new bt.Modal(this.modalElement,this.modalOptions),this.modal}randomHash(t=8){return Array.from({length:t},(()=>Math.floor(36*Math.random()).toString(36))).join("")}}vt.allowedEmbedTypes=["embed","youtube","vimeo","instagram","url"],vt.allowedMediaTypes=[...vt.allowedEmbedTypes,"image"],vt.defaultSelector='[data-toggle="lightbox"]',document.querySelectorAll(vt.defaultSelector).forEach((t=>t.addEventListener("click",(e=>{e.preventDefault(),new vt(t).show()}))));var yt=vt;window.bootstrap&&(window.bootstrap.Lightbox=yt)}(); | ||
!function(){"use strict";var t,e={728:function(t,e,i){i.r(e);var s=i(360),n=i(127),o=i(591),r=i(802),a=i(642);const l="carousel",c={interval:5e3,keyboard:!0,slide:!1,pause:"hover",wrap:!0,touch:!0},d={interval:"(number|boolean)",keyboard:"boolean",slide:"(boolean|string)",pause:"(string|boolean)",wrap:"boolean",touch:"boolean"},h="next",u="prev",m="left",g="right",f={ArrowLeft:g,ArrowRight:m},p="slid.bs.carousel",_="active",b=".active.carousel-item";class v extends a.Z{constructor(t,e){super(t),this._items=null,this._interval=null,this._activeElement=null,this._isPaused=!1,this._isSliding=!1,this.touchTimeout=null,this.touchStartX=0,this.touchDeltaX=0,this._config=this._getConfig(e),this._indicatorsElement=r.Z.findOne(".carousel-indicators",this._element),this._touchSupported="ontouchstart"in document.documentElement||navigator.maxTouchPoints>0,this._pointerEvent=Boolean(window.PointerEvent),this._addEventListeners()}static get Default(){return c}static get NAME(){return l}next(){this._slide(h)}nextWhenVisible(){!document.hidden&&(0,s.pn)(this._element)&&this.next()}prev(){this._slide(u)}pause(t){t||(this._isPaused=!0),r.Z.findOne(".carousel-item-next, .carousel-item-prev",this._element)&&((0,s.S3)(this._element),this.cycle(!0)),clearInterval(this._interval),this._interval=null}cycle(t){t||(this._isPaused=!1),this._interval&&(clearInterval(this._interval),this._interval=null),this._config&&this._config.interval&&!this._isPaused&&(this._updateInterval(),this._interval=setInterval((document.visibilityState?this.nextWhenVisible:this.next).bind(this),this._config.interval))}to(t){this._activeElement=r.Z.findOne(b,this._element);const e=this._getItemIndex(this._activeElement);if(t>this._items.length-1||t<0)return;if(this._isSliding)return void n.Z.one(this._element,p,(()=>this.to(t)));if(e===t)return this.pause(),void this.cycle();const i=t>e?h:u;this._slide(i,this._items[t])}_getConfig(t){return t=Object.assign(Object.assign(Object.assign({},c),o.Z.getDataAttributes(this._element)),"object"==typeof t?t:{}),(0,s.zE)(l,t,d),t}_handleSwipe(){const t=Math.abs(this.touchDeltaX);if(t<=40)return;const e=t/this.touchDeltaX;this.touchDeltaX=0,e&&this._slide(e>0?g:m)}_addEventListeners(){this._config.keyboard&&n.Z.on(this._element,"keydown.bs.carousel",(t=>this._keydown(t))),"hover"===this._config.pause&&(n.Z.on(this._element,"mouseenter.bs.carousel",(t=>this.pause(t))),n.Z.on(this._element,"mouseleave.bs.carousel",(t=>this.cycle(t)))),this._config.touch&&this._touchSupported&&this._addTouchEventListeners()}dispose(){Data.remove(this._element,this.constructor.DATA_KEY),n.Z.off(this._element,this.constructor.EVENT_KEY),Object.getOwnPropertyNames(this).forEach((t=>{this[t]=null}))}_addTouchEventListeners(){const t=t=>this._pointerEvent&&("pen"===t.pointerType||"touch"===t.pointerType),e=e=>{t(e)?this.touchStartX=e.clientX:this._pointerEvent||(this.touchStartX=e.touches[0].clientX)},i=t=>{this.touchDeltaX=t.touches&&t.touches.length>1?0:t.touches[0].clientX-this.touchStartX},s=e=>{t(e)&&(this.touchDeltaX=e.clientX-this.touchStartX),this._handleSwipe(),"hover"===this._config.pause&&(this.pause(),this.touchTimeout&&clearTimeout(this.touchTimeout),this.touchTimeout=setTimeout((t=>this.cycle(t)),500+this._config.interval))};r.Z.find(".carousel-item img",this._element).forEach((t=>{n.Z.on(t,"dragstart.bs.carousel",(t=>t.preventDefault()))})),this._pointerEvent?(n.Z.on(this._element,"pointerdown.bs.carousel",(t=>e(t))),n.Z.on(this._element,"pointerup.bs.carousel",(t=>s(t))),this._element.classList.add("pointer-event")):(n.Z.on(this._element,"touchstart.bs.carousel",(t=>e(t))),n.Z.on(this._element,"touchmove.bs.carousel",(t=>i(t))),n.Z.on(this._element,"touchend.bs.carousel",(t=>s(t))))}_keydown(t){if(/input|textarea/i.test(t.target.tagName))return;const e=f[t.key];e&&(t.preventDefault(),this._slide(e))}_getItemIndex(t){return this._items=t&&t.parentNode?r.Z.find(".carousel-item",t.parentNode):[],this._items.indexOf(t)}_getItemByOrder(t,e){const i=t===h;return(0,s.Fj)(this._items,e,i,this._config.wrap)}_triggerSlideEvent(t,e){const i=this._getItemIndex(t),s=this._getItemIndex(r.Z.findOne(b,this._element));return n.Z.trigger(this._element,"slide.bs.carousel",{relatedTarget:t,direction:e,from:s,to:i})}_setActiveIndicatorElement(t){if(this._indicatorsElement){const e=r.Z.findOne(".active",this._indicatorsElement);e.classList.remove(_),e.removeAttribute("aria-current");const i=r.Z.find("[data-bs-target]",this._indicatorsElement);for(let e=0;e<i.length;e++)if(Number.parseInt(i[e].getAttribute("data-bs-slide-to"),10)===this._getItemIndex(t)){i[e].classList.add(_),i[e].setAttribute("aria-current","true");break}}}_updateInterval(){const t=this._activeElement||r.Z.findOne(b,this._element);if(!t)return;const e=Number.parseInt(t.getAttribute("data-bs-interval"),10);e?(this._config.defaultInterval=this._config.defaultInterval||this._config.interval,this._config.interval=e):this._config.interval=this._config.defaultInterval||this._config.interval}_slide(t,e){const i=this._directionToOrder(t),o=r.Z.findOne(b,this._element),a=this._getItemIndex(o),l=e||this._getItemByOrder(i,o),c=this._getItemIndex(l),d=Boolean(this._interval),u=i===h,m=u?"carousel-item-start":"carousel-item-end",g=u?"carousel-item-next":"carousel-item-prev",f=this._orderToDirection(i);if(l&&l.classList.contains(_))return void(this._isSliding=!1);if(this._isSliding)return;if(this._triggerSlideEvent(l,f).defaultPrevented)return;if(!o||!l)return;this._isSliding=!0,d&&this.pause(),this._setActiveIndicatorElement(l),this._activeElement=l;const v=()=>{n.Z.trigger(this._element,p,{relatedTarget:l,direction:f,from:a,to:c})};if(this._element.classList.contains("slide")){l.classList.add(g),(0,s.nq)(l),o.classList.add(m),l.classList.add(m);const t=()=>{l.classList.remove(m,g),l.classList.add(_),o.classList.remove(_,g,m),this._isSliding=!1,setTimeout(v,0)};this._queueCallback(t,o,!0)}else o.classList.remove(_),l.classList.add(_),this._isSliding=!1,v();d&&this.cycle()}_directionToOrder(t){return[g,m].includes(t)?(0,s.dZ)()?t===m?u:h:t===m?h:u:t}_orderToDirection(t){return[h,u].includes(t)?(0,s.dZ)()?t===u?m:g:t===u?g:m:t}static carouselInterface(t,e){const i=v.getOrCreateInstance(t,e);let{_config:s}=i;"object"==typeof e&&(s=Object.assign(Object.assign({},s),e));const n="string"==typeof e?e:s.slide;if("number"==typeof e)i.to(e);else if("string"==typeof n){if(void 0===i[n])throw new TypeError(`No method named "${n}"`);i[n]()}else s.interval&&s.ride&&(i.pause(),i.cycle())}static jQueryInterface(t){return this.each((function(){v.carouselInterface(this,t)}))}static dataApiClickHandler(t){let e=(0,s.dG)(this);if(!e||!e.classList.contains("carousel"))return;const i=Object.assign(Object.assign({},o.Z.getDataAttributes(e)),o.Z.getDataAttributes(this));console.log(i);const n=this.getAttribute("data-bs-slide-to");n&&(i.interval=!1),v.carouselInterface(e,i),n&&v.getInstance(e).to(n),t.preventDefault()}}e.default=v},112:function(t,e,i){i.r(e),i.d(e,{default:function(){return L}});var s=i(360),n=i(127),o=i(591),r=i(802);const a=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",l=".sticky-top";var c=i(642);const d={className:"modal-backdrop",isVisible:!0,isAnimated:!1,rootElement:"body",clickCallback:null},h={className:"string",isVisible:"boolean",isAnimated:"boolean",rootElement:"(element|string)",clickCallback:"(function|null)"},u="backdrop",m="show",g=`mousedown.bs.${u}`;const f={trapElement:null,autofocus:!0},p={trapElement:"element",autofocus:"boolean"},_=".bs.focustrap",b=`focusin${_}`,v=`keydown.tab${_}`,y="backward";const E="modal",w="Escape",A={backdrop:!0,keyboard:!0,focus:!0},k={backdrop:"(boolean|string)",keyboard:"boolean",focus:"boolean"},O="resize.bs.modal",T="click.dismiss.bs.modal",x="keydown.dismiss.bs.modal",Z="mousedown.dismiss.bs.modal",S="modal-open",j="show",D="modal-static";class C extends c.Z{constructor(t,e){super(t),this._config=this._getConfig(e),this._dialog=r.Z.findOne(".modal-dialog",this._element),this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._isShown=!1,this._ignoreBackdropClick=!1,this._isTransitioning=!1,this._scrollBar=new class{constructor(){this._element=document.body}getWidth(){const t=document.documentElement.clientWidth;return Math.abs(window.innerWidth-t)}hide(){const t=this.getWidth();this._disableOverFlow(),this._setElementAttributes(this._element,"paddingRight",(e=>e+t)),this._setElementAttributes(a,"paddingRight",(e=>e+t)),this._setElementAttributes(l,"marginRight",(e=>e-t))}_disableOverFlow(){this._saveInitialAttribute(this._element,"overflow"),this._element.style.overflow="hidden"}_setElementAttributes(t,e,i){const s=this.getWidth();this._applyManipulationCallback(t,(t=>{if(t!==this._element&&window.innerWidth>t.clientWidth+s)return;this._saveInitialAttribute(t,e);const n=window.getComputedStyle(t)[e];t.style[e]=`${i(Number.parseFloat(n))}px`}))}reset(){this._resetElementAttributes(this._element,"overflow"),this._resetElementAttributes(this._element,"paddingRight"),this._resetElementAttributes(a,"paddingRight"),this._resetElementAttributes(l,"marginRight")}_saveInitialAttribute(t,e){const i=t.style[e];i&&o.Z.setDataAttribute(t,e,i)}_resetElementAttributes(t,e){this._applyManipulationCallback(t,(t=>{const i=o.Z.getDataAttribute(t,e);void 0===i?t.style.removeProperty(e):(o.Z.removeDataAttribute(t,e),t.style[e]=i)}))}_applyManipulationCallback(t,e){(0,s.kK)(t)?e(t):r.Z.find(t,this._element).forEach(e)}isOverflowing(){return this.getWidth()>0}}}static get Default(){return A}static get NAME(){return E}toggle(t){return this._isShown?this.hide():this.show(t)}show(t){this._isShown||this._isTransitioning||n.Z.trigger(this._element,"show.bs.modal",{relatedTarget:t}).defaultPrevented||(this._isShown=!0,this._isAnimated()&&(this._isTransitioning=!0),this._scrollBar.hide(),document.body.classList.add(S),this._adjustDialog(),this._setEscapeEvent(),this._setResizeEvent(),n.Z.on(this._dialog,Z,(()=>{n.Z.one(this._element,"mouseup.dismiss.bs.modal",(t=>{t.target===this._element&&(this._ignoreBackdropClick=!0)}))})),this._showBackdrop((()=>this._showElement(t))))}hide(){if(!this._isShown||this._isTransitioning)return;if(n.Z.trigger(this._element,"hide.bs.modal").defaultPrevented)return;this._isShown=!1;const t=this._isAnimated();t&&(this._isTransitioning=!0),this._setEscapeEvent(),this._setResizeEvent(),this._focustrap.deactivate(),this._element.classList.remove(j),n.Z.off(this._element,T),n.Z.off(this._dialog,Z),this._queueCallback((()=>this._hideModal()),this._element,t)}dispose(){[window,this._dialog].forEach((t=>n.Z.off(t,".bs.modal"))),this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}handleUpdate(){this._adjustDialog()}_initializeBackDrop(){return new class{constructor(t){this._config=this._getConfig(t),this._isAppended=!1,this._element=null}show(t){this._config.isVisible?(this._append(),this._config.isAnimated&&(0,s.nq)(this._getElement()),this._getElement().classList.add(m),this._emulateAnimation((()=>{(0,s.ht)(t)}))):(0,s.ht)(t)}hide(t){this._config.isVisible?(this._getElement().classList.remove(m),this._emulateAnimation((()=>{this.dispose(),(0,s.ht)(t)}))):(0,s.ht)(t)}_getElement(){if(!this._element){const t=document.createElement("div");t.className=this._config.className,this._config.isAnimated&&t.classList.add("fade"),this._element=t}return this._element}_getConfig(t){return(t={...d,..."object"==typeof t?t:{}}).rootElement=(0,s.sb)(t.rootElement),(0,s.zE)(u,t,h),t}_append(){this._isAppended||(this._config.rootElement.append(this._getElement()),n.Z.on(this._getElement(),g,(()=>{(0,s.ht)(this._config.clickCallback)})),this._isAppended=!0)}dispose(){this._isAppended&&(n.Z.off(this._element,g),this._element.remove(),this._isAppended=!1)}_emulateAnimation(t){(0,s.e0)(t,this._getElement(),this._config.isAnimated)}}({isVisible:Boolean(this._config.backdrop),isAnimated:this._isAnimated()})}_initializeFocusTrap(){return new class{constructor(t){this._config=this._getConfig(t),this._isActive=!1,this._lastTabNavDirection=null}activate(){const{trapElement:t,autofocus:e}=this._config;this._isActive||(e&&t.focus(),n.Z.off(document,_),n.Z.on(document,b,(t=>this._handleFocusin(t))),n.Z.on(document,v,(t=>this._handleKeydown(t))),this._isActive=!0)}deactivate(){this._isActive&&(this._isActive=!1,n.Z.off(document,_))}_handleFocusin(t){const{target:e}=t,{trapElement:i}=this._config;if(e===document||e===i||i.contains(e))return;const s=r.Z.focusableChildren(i);0===s.length?i.focus():this._lastTabNavDirection===y?s[s.length-1].focus():s[0].focus()}_handleKeydown(t){"Tab"===t.key&&(this._lastTabNavDirection=t.shiftKey?y:"forward")}_getConfig(t){return t={...f,..."object"==typeof t?t:{}},(0,s.zE)("focustrap",t,p),t}}({trapElement:this._element})}_getConfig(t){return t=Object.assign(Object.assign(Object.assign({},A),o.Z.getDataAttributes(this._element)),"object"==typeof t?t:{}),(0,s.zE)(E,t,k),t}_showElement(t){const e=this._isAnimated(),i=r.Z.findOne(".modal-body",this._dialog);this._element.parentNode&&this._element.parentNode.nodeType===Node.ELEMENT_NODE||document.body.append(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.scrollTop=0,i&&(i.scrollTop=0),e&&(0,s.nq)(this._element),this._element.classList.add(j),this._queueCallback((()=>{this._config.focus&&this._focustrap.activate(),this._isTransitioning=!1,n.Z.trigger(this._element,"shown.bs.modal",{relatedTarget:t})}),this._dialog,e)}_setEscapeEvent(){this._isShown?n.Z.on(this._element,x,(t=>{this._config.keyboard&&t.key===w?(t.preventDefault(),this.hide()):this._config.keyboard||t.key!==w||this._triggerBackdropTransition()})):n.Z.off(this._element,x)}_setResizeEvent(){this._isShown?n.Z.on(window,O,(()=>this._adjustDialog())):n.Z.off(window,O)}_hideModal(){this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,this._backdrop.hide((()=>{document.body.classList.remove(S),this._resetAdjustments(),this._scrollBar.reset(),n.Z.trigger(this._element,"hidden.bs.modal")}))}_showBackdrop(t){n.Z.on(this._element,T,(t=>{this._ignoreBackdropClick?this._ignoreBackdropClick=!1:t.target===t.currentTarget&&(!0===this._config.backdrop?this.hide():"static"===this._config.backdrop&&this._triggerBackdropTransition())})),this._backdrop.show(t)}_isAnimated(){return this._element.classList.contains("fade")}_triggerBackdropTransition(){if(n.Z.trigger(this._element,"hidePrevented.bs.modal").defaultPrevented)return;const{classList:t,scrollHeight:e,style:i}=this._element,s=e>document.documentElement.clientHeight;!s&&"hidden"===i.overflowY||t.contains(D)||(s||(i.overflowY="hidden"),t.add(D),this._queueCallback((()=>{t.remove(D),s||this._queueCallback((()=>{i.overflowY=""}),this._dialog)}),this._dialog),this._element.focus())}_adjustDialog(){const t=this._element.scrollHeight>document.documentElement.clientHeight,e=this._scrollBar.getWidth(),i=e>0;(!i&&t&&!(0,s.dZ)()||i&&!t&&(0,s.dZ)())&&(this._element.style.paddingLeft=`${e}px`),(i&&!t&&!(0,s.dZ)()||!i&&t&&(0,s.dZ)())&&(this._element.style.paddingRight=`${e}px`)}_resetAdjustments(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}static jQueryInterface(t,e){return this.each((function(){const i=C.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===i[t])throw new TypeError(`No method named "${t}"`);i[t](e)}}))}}var L=C},338:function(t,e,i){e.Z=void 0;var s=o(i(112)),n=o(i(728));function o(t){return t&&t.__esModule?t:{default:t}}const r={Modal:s.default,Carousel:n.default};class a{constructor(t,e={}){this.hash=this.randomHash(),this.settings=Object.assign(Object.assign(Object.assign({},r.Modal.Default),r.Carousel.Default),{interval:!1,target:'[data-toggle="lightbox"]',gallery:""}),this.modalOptions=(()=>this.setOptionsFromSettings(r.Modal.Default))(),this.carouselOptions=(()=>this.setOptionsFromSettings(r.Carousel.Default))(),console.log(),"string"==typeof t&&(this.settings.target=t,t=document.querySelector(this.settings.target),e=void 0!==arguments[1]?arguments[1]:{}),this.settings=Object.assign(Object.assign({},this.settings),e),this.el=t,this.type=t.dataset.type||"image",this.src=this.getSrc(t),this.src="image"!==this.type?"embed"+this.src:this.src,this.sources=this.getGalleryItems(),this.createCarousel(),this.createModal()}show(){document.body.appendChild(this.modalElement),this.modal.show()}hide(){this.modal.hide()}setOptionsFromSettings(t){return Object.keys(t).reduce(((t,e)=>Object.assign(t,{[e]:this.settings[e]})),{})}getSrc(t){return t.dataset.src||t.dataset.remote||t.href||"http://via.placeholder.com/1600x900"}getGalleryItems(){let t;if(this.settings.gallery){if(Array.isArray(this.settings.gallery))return this.settings.gallery;t=this.settings.gallery}else this.el.dataset.gallery&&(t=this.el.dataset.gallery);return t?[...new Set(Array.from(document.querySelectorAll('[data-gallery="'.concat(t,'"]')),(t=>"".concat(t.dataset.type?"embed":"").concat(this.getSrc(t)))))]:[this.src]}getYoutubeId(t){if(!t)return!1;let e=t.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/);return!(!e||11!==e[2].length)&&e[2]}getInstagramEmbed(t){if(/instagram/.test(t))return t+=/\/embed$/.test(t)?"":"/embed",'<div class="ratio ratio-16x9" style="max-height: 100%;"><iframe src="'.concat(t,'" class="start-50 translate-middle-x" style="max-width: 500px" frameborder="0" scrolling="no" allowtransparency="true"></iframe></div>')}isEmbed(t){const e=new RegExp(a.allowedEmbedTypes.join("|")).test(t),i=/\.(png|jpe?g|gif|svg|webp)/.test(t);return e||!i}createCarousel(){const t=document.createElement("template"),e=this.sources.map(((t,e)=>{t=t.replace(/\/$/,"");let i="";i+=/\.png/.test(t)?"this.add.previousSibling.remove()":"";let s='<div class="ratio ratio-16x9"><img src="'.concat(t,'" class="d-block w-100 h-100 img-fluid" style="z-index: 1; object-fit: contain;" onload="').concat(i,'" /></div>'),n="";const o=this.getInstagramEmbed(t),r=this.getYoutubeId(t);return this.isEmbed(t)&&(/^embed/.test(t)&&(t=t.substring(5)),r&&(t="https://www.youtube.com/embed/".concat(r),n='title="YouTube video player" frameborder="0" allow="accelerometer autoplay clipboard-write encrypted-media gyroscope picture-in-picture"'),s=o||'<div class="ratio ratio-16x9"><iframe src="'.concat(t,'" ').concat(n," allowfullscreen></iframe></div>")),'<div class="carousel-item '.concat(e?"":"active",'" style="min-height: 100px">').concat('<div class="position-absolute top-50 start-50 translate-middle text-white"><div class="spinner-border" style="width: 3rem height: 3rem" role="status"></div></div>').concat(s,"</div>")})).join(""),i=this.sources.length<2?"":'\n\t\t\t<button class="carousel-control carousel-control-prev h-75 m-auto" type="button" data-bs-target="#lightboxCarousel-'.concat(this.hash,'" data-bs-slide="prev">\n\t\t\t\t<span class="carousel-control-prev-icon" aria-hidden="true"></span>\n\t\t\t\t<span class="visually-hidden">Previous</span>\n\t\t\t</button>\n\t\t\t<button class="carousel-control carousel-control-next h-75 m-auto" type="button" data-bs-target="#lightboxCarousel-').concat(this.hash,'" data-bs-slide="next">\n\t\t\t\t<span class="carousel-control-next-icon" aria-hidden="true"></span>\n\t\t\t\t<span class="visually-hidden">Next</span>\n\t\t\t</button>'),s='\n\t\t\t<div id="lightboxCarousel-'.concat(this.hash,'" class="lightbox-carousel carousel" data-bs-ride="carousel">\n\t\t\t\t<div class="carousel-inner">\n\t\t\t\t\t').concat(e,"\n\t\t\t\t</div>\n\t\t\t\t").concat(i,"\n\t\t\t</div>");return t.innerHTML=s.trim(),this.carouselElement=t.content.firstChild,this.carousel=new r.Carousel(this.carouselElement,this.carouselOptions),this.carousel.to(this.sources.includes(this.src)?this.sources.indexOf(this.src):0),this.carousel}createModal(){const t=document.createElement("template"),e='\n\t\t\t<div class="modal lightbox fade" id="lightboxModal-'.concat(this.hash,'" tabindex="-1" aria-hidden="true">\n\t\t\t\t<div class="modal-dialog modal-dialog-centered modal-xl">\n\t\t\t\t\t<div class="modal-content border-0" style="background: black">\n\t\t\t\t\t\t<div class="modal-body p-0">\n\t\t\t\t\t\t\t<button type="button" class="btn-close position-absolute top-0 end-0 p-3" data-bs-dismiss="modal" aria-label="Close" style="z-index: 2; background: none;">').concat('<svg xmlns="http://www.w3.org/2000/svg" style="position: relative; top: -5px;" viewBox="0 0 16 16" fill="#fff"><path d="M.293.293a1 1 0 011.414 0L8 6.586 14.293.293a1 1 0 111.414 1.414L9.414 8l6.293 6.293a1 1 0 01-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 01-1.414-1.414L6.586 8 .293 1.707a1 1 0 010-1.414z"/></svg>)',"</button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>");return t.innerHTML=e.trim(),this.modalElement=t.content.firstChild,this.modalElement.querySelector(".modal-body").appendChild(this.carouselElement),this.modalElement.addEventListener("hidden.bs.modal",(t=>this.modalElement.remove())),this.modal=new r.Modal(this.modalElement,this.modalOptions),this.modal}randomHash(t=8){return Array.from({length:t},(()=>Math.floor(36*Math.random()).toString(36))).join("")}}a.allowedEmbedTypes=["embed","youtube","vimeo","instagram","url"],a.allowedMediaTypes=[...a.allowedEmbedTypes,"image"],a.defaultSelector='[data-toggle="lightbox"]',document.querySelectorAll(a.defaultSelector).forEach((t=>t.addEventListener("click",(e=>{e.preventDefault(),new a(t).show()}))));var l=a;e.Z=l},642:function(t,e,i){i.d(e,{Z:function(){return a}});const s=new Map;var n={set(t,e,i){s.has(t)||s.set(t,new Map);const n=s.get(t);n.has(e)||0===n.size?n.set(e,i):console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(n.keys())[0]}.`)},get:(t,e)=>s.has(t)&&s.get(t).get(e)||null,remove(t,e){if(!s.has(t))return;const i=s.get(t);i.delete(e),0===i.size&&s.delete(t)}},o=i(360),r=i(127),a=class{constructor(t){(t=(0,o.sb)(t))&&(this._element=t,n.set(this._element,this.constructor.DATA_KEY,this))}dispose(){n.remove(this._element,this.constructor.DATA_KEY),r.Z.off(this._element,this.constructor.EVENT_KEY),Object.getOwnPropertyNames(this).forEach((t=>{this[t]=null}))}_queueCallback(t,e,i=!0){(0,o.e0)(t,e,i)}static getInstance(t){return n.get((0,o.sb)(t),this.DATA_KEY)}static getOrCreateInstance(t,e={}){return this.getInstance(t)||new this(t,"object"==typeof e?e:null)}static get VERSION(){return"5.1.1"}static get NAME(){throw new Error('You have to implement the static method "NAME", for each component!')}static get DATA_KEY(){return`bs.${this.NAME}`}static get EVENT_KEY(){return`.${this.DATA_KEY}`}}},127:function(t,e,i){var s=i(360);const n=/[^.]*(?=\..*)\.|.*/,o=/\..*/,r=/::\d+$/,a={};let l=1;const c={mouseenter:"mouseover",mouseleave:"mouseout"},d=/^(mouseenter|mouseleave)/i,h=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function u(t,e){return e&&`${e}::${l++}`||t.uidEvent||l++}function m(t){const e=u(t);return t.uidEvent=e,a[e]=a[e]||{},a[e]}function g(t,e,i=null){const s=Object.keys(t);for(let n=0,o=s.length;n<o;n++){const o=t[s[n]];if(o.originalHandler===e&&o.delegationSelector===i)return o}return null}function f(t,e,i){const s="string"==typeof e,n=s?i:e;let o=b(t);return h.has(o)||(o=t),[s,n,o]}function p(t,e,i,s,o){if("string"!=typeof e||!t)return;if(i||(i=s,s=null),d.test(e)){const t=t=>function(e){if(!e.relatedTarget||e.relatedTarget!==e.delegateTarget&&!e.delegateTarget.contains(e.relatedTarget))return t.call(this,e)};s?s=t(s):i=t(i)}const[r,a,l]=f(e,i,s),c=m(t),h=c[l]||(c[l]={}),p=g(h,a,r?i:null);if(p)return void(p.oneOff=p.oneOff&&o);const _=u(a,e.replace(n,"")),b=r?function(t,e,i){return function s(n){const o=t.querySelectorAll(e);for(let{target:r}=n;r&&r!==this;r=r.parentNode)for(let a=o.length;a--;)if(o[a]===r)return n.delegateTarget=r,s.oneOff&&v.off(t,n.type,e,i),i.apply(r,[n]);return null}}(t,i,s):function(t,e){return function i(s){return s.delegateTarget=t,i.oneOff&&v.off(t,s.type,e),e.apply(t,[s])}}(t,i);b.delegationSelector=r?i:null,b.originalHandler=a,b.oneOff=o,b.uidEvent=_,h[_]=b,t.addEventListener(l,b,r)}function _(t,e,i,s,n){const o=g(e[i],s,n);o&&(t.removeEventListener(i,o,Boolean(n)),delete e[i][o.uidEvent])}function b(t){return t=t.replace(o,""),c[t]||t}const v={on(t,e,i,s){p(t,e,i,s,!1)},one(t,e,i,s){p(t,e,i,s,!0)},off(t,e,i,s){if("string"!=typeof e||!t)return;const[n,o,a]=f(e,i,s),l=a!==e,c=m(t),d=e.startsWith(".");if(void 0!==o){if(!c||!c[a])return;return void _(t,c,a,o,n?i:null)}d&&Object.keys(c).forEach((i=>{!function(t,e,i,s){const n=e[i]||{};Object.keys(n).forEach((o=>{if(o.includes(s)){const s=n[o];_(t,e,i,s.originalHandler,s.delegationSelector)}}))}(t,c,i,e.slice(1))}));const h=c[a]||{};Object.keys(h).forEach((i=>{const s=i.replace(r,"");if(!l||e.includes(s)){const e=h[i];_(t,c,a,e.originalHandler,e.delegationSelector)}}))},trigger(t,e,i){if("string"!=typeof e||!t)return null;const n=(0,s.KF)(),o=b(e),r=e!==o,a=h.has(o);let l,c=!0,d=!0,u=!1,m=null;return r&&n&&(l=n.Event(e,i),n(t).trigger(l),c=!l.isPropagationStopped(),d=!l.isImmediatePropagationStopped(),u=l.isDefaultPrevented()),a?(m=document.createEvent("HTMLEvents"),m.initEvent(o,c,!0)):m=new CustomEvent(e,{bubbles:c,cancelable:!0}),void 0!==i&&Object.keys(i).forEach((t=>{Object.defineProperty(m,t,{get:()=>i[t]})})),u&&m.preventDefault(),d&&t.dispatchEvent(m),m.defaultPrevented&&void 0!==l&&l.preventDefault(),m}};e.Z=v},591:function(t,e){function i(t){return"true"===t||"false"!==t&&(t===Number(t).toString()?Number(t):""===t||"null"===t?null:t)}function s(t){return t.replace(/[A-Z]/g,(t=>`-${t.toLowerCase()}`))}const n={setDataAttribute(t,e,i){t.setAttribute(`data-bs-${s(e)}`,i)},removeDataAttribute(t,e){t.removeAttribute(`data-bs-${s(e)}`)},getDataAttributes(t){if(!t)return{};const e={};return Object.keys(t.dataset).filter((t=>t.startsWith("bs"))).forEach((s=>{let n=s.replace(/^bs/,"");n=n.charAt(0).toLowerCase()+n.slice(1,n.length),e[n]=i(t.dataset[s])})),e},getDataAttribute:(t,e)=>i(t.getAttribute(`data-bs-${s(e)}`)),offset(t){const e=t.getBoundingClientRect();return{top:e.top+window.pageYOffset,left:e.left+window.pageXOffset}},position:t=>({top:t.offsetTop,left:t.offsetLeft})};e.Z=n},802:function(t,e,i){var s=i(360);const n={find:(t,e=document.documentElement)=>[].concat(...Element.prototype.querySelectorAll.call(e,t)),findOne:(t,e=document.documentElement)=>Element.prototype.querySelector.call(e,t),children:(t,e)=>[].concat(...t.children).filter((t=>t.matches(e))),parents(t,e){const i=[];let s=t.parentNode;for(;s&&s.nodeType===Node.ELEMENT_NODE&&3!==s.nodeType;)s.matches(e)&&i.push(s),s=s.parentNode;return i},prev(t,e){let i=t.previousElementSibling;for(;i;){if(i.matches(e))return[i];i=i.previousElementSibling}return[]},next(t,e){let i=t.nextElementSibling;for(;i;){if(i.matches(e))return[i];i=i.nextElementSibling}return[]},focusableChildren(t){const e=["a","button","input","textarea","select","details","[tabindex]",'[contenteditable="true"]'].map((t=>`${t}:not([tabindex^="-"])`)).join(", ");return this.find(e,t).filter((t=>!(0,s.pK)(t)&&(0,s.pn)(t)))}};e.Z=n},360:function(t,e,i){i.d(e,{sb:function(){return a},dG:function(){return n},S3:function(){return o},kK:function(){return r},zE:function(){return l},pn:function(){return c},pK:function(){return d},Fj:function(){return p},nq:function(){return h},KF:function(){return u},dZ:function(){return m},ht:function(){return g},e0:function(){return f}});const s="transitionend",n=t=>{const e=(t=>{let e=t.getAttribute("data-bs-target");if(!e||"#"===e){let i=t.getAttribute("href");if(!i||!i.includes("#")&&!i.startsWith("."))return null;i.includes("#")&&!i.startsWith("#")&&(i=`#${i.split("#")[1]}`),e=i&&"#"!==i?i.trim():null}return e})(t);return e?document.querySelector(e):null},o=t=>{t.dispatchEvent(new Event(s))},r=t=>!(!t||"object"!=typeof t)&&(void 0!==t.jquery&&(t=t[0]),void 0!==t.nodeType),a=t=>r(t)?t.jquery?t[0]:t:"string"==typeof t&&t.length>0?document.querySelector(t):null,l=(t,e,i)=>{Object.keys(i).forEach((s=>{const n=i[s],o=e[s],a=o&&r(o)?"element":null==(l=o)?`${l}`:{}.toString.call(l).match(/\s([a-z]+)/i)[1].toLowerCase();var l;if(!new RegExp(n).test(a))throw new TypeError(`${t.toUpperCase()}: Option "${s}" provided type "${a}" but expected type "${n}".`)}))},c=t=>!(!r(t)||0===t.getClientRects().length)&&"visible"===getComputedStyle(t).getPropertyValue("visibility"),d=t=>!t||t.nodeType!==Node.ELEMENT_NODE||!!t.classList.contains("disabled")||(void 0!==t.disabled?t.disabled:t.hasAttribute("disabled")&&"false"!==t.getAttribute("disabled")),h=t=>{t.offsetHeight},u=()=>{const{jQuery:t}=window;return t&&!document.body.hasAttribute("data-bs-no-jquery")?t:null},m=()=>"rtl"===document.documentElement.dir,g=t=>{"function"==typeof t&&t()},f=(t,e,i=!0)=>{if(!i)return void g(t);const n=(t=>{if(!t)return 0;let{transitionDuration:e,transitionDelay:i}=window.getComputedStyle(t);const s=Number.parseFloat(e),n=Number.parseFloat(i);return s||n?(e=e.split(",")[0],i=i.split(",")[0],1e3*(Number.parseFloat(e)+Number.parseFloat(i))):0})(e)+5;let r=!1;const a=({target:i})=>{i===e&&(r=!0,e.removeEventListener(s,a),g(t))};e.addEventListener(s,a),setTimeout((()=>{r||o(e)}),n)},p=(t,e,i,s)=>{let n=t.indexOf(e);if(-1===n)return t[!i&&s?t.length-1:0];const o=t.length;return n+=i?1:-1,s&&(n=(n+o)%o),t[Math.max(0,Math.min(n,o-1))]}}},i={};function s(t){var n=i[t];if(void 0!==n)return n.exports;var o=i[t]={exports:{}};return e[t](o,o.exports,s),o.exports}s.d=function(t,e){for(var i in e)s.o(e,i)&&!s.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},s.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},s.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},t=s(338),window.bootstrap&&(window.bootstrap.Lightbox=t.Z)}(); |
@@ -1,1 +0,1 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _modal=_interopRequireDefault(require("./bootstrap/modal")),_carousel=_interopRequireDefault(require("./bootstrap/carousel"));function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}function _toConsumableArray(t){return _arrayWithoutHoles(t)||_iterableToArray(t)||_unsupportedIterableToArray(t)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(t,e){if(t){if("string"==typeof t)return _arrayLikeToArray(t,e);var a=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(a="Object"===a&&t.constructor?t.constructor.name:a)||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?_arrayLikeToArray(t,e):void 0}}function _iterableToArray(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function _arrayWithoutHoles(t){if(Array.isArray(t))return _arrayLikeToArray(t)}function _arrayLikeToArray(t,e){(null==e||e>t.length)&&(e=t.length);for(var a=0,r=new Array(e);a<e;a++)r[a]=t[a];return r}function _defineProperty(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,e){for(var a=0;a<e.length;a++){var r=e[a];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function _createClass(t,e,a){return e&&_defineProperties(t.prototype,e),a&&_defineProperties(t,a),t}var bootstrap={Modal:_modal.default,Carousel:_carousel.default},Lightbox=function(){function r(t){var e=this,a=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};_classCallCheck(this,r),this.hash=this.randomHash(),this.settings=Object.assign(Object.assign(Object.assign({},bootstrap.Modal.Default),bootstrap.Carousel.Default),{interval:!1,target:'[data-toggle="lightbox"]',gallery:""}),this.modalOptions=e.setOptionsFromSettings(bootstrap.Modal.Default),this.carouselOptions=e.setOptionsFromSettings(bootstrap.Carousel.Default),console.log(),"string"==typeof t&&(this.settings.target=t,t=document.querySelector(this.settings.target),a=void 0!==arguments[1]?arguments[1]:{}),this.settings=Object.assign(Object.assign({},this.settings),a),this.el=t,this.type=t.dataset.type||"image",this.src=this.getSrc(t),this.src="image"!==this.type?"embed"+this.src:this.src,this.sources=this.getGalleryItems(),this.createCarousel(),this.createModal()}return _createClass(r,[{key:"show",value:function(){document.body.appendChild(this.modalElement),this.modal.show()}},{key:"hide",value:function(){this.modal.hide()}},{key:"setOptionsFromSettings",value:function(t){var a=this;return Object.keys(t).reduce(function(t,e){return Object.assign(t,_defineProperty({},e,a.settings[e]))},{})}},{key:"getSrc",value:function(t){return t.dataset.src||t.dataset.remote||t.href||"http://via.placeholder.com/1600x900"}},{key:"getGalleryItems",value:function(){var t,e=this;if(this.settings.gallery){if(Array.isArray(this.settings.gallery))return this.settings.gallery;t=this.settings.gallery}else this.el.dataset.gallery&&(t=this.el.dataset.gallery);return t?_toConsumableArray(new Set(Array.from(document.querySelectorAll('[data-gallery="'.concat(t,'"]')),function(t){return"".concat(t.dataset.type?"embed":"").concat(e.getSrc(t))}))):[this.src]}},{key:"getYoutubeId",value:function(t){if(!t)return!1;t=t.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/);return!(!t||11!==t[2].length)&&t[2]}},{key:"getInstagramEmbed",value:function(t){if(/instagram/.test(t))return t+=/\/embed$/.test(t)?"":"/embed",'<div class="ratio ratio-16x9" style="max-height: 100%;"><iframe src="'.concat(t,'" class="start-50 translate-middle-x" style="max-width: 500px" frameborder="0" scrolling="no" allowtransparency="true"></iframe></div>')}},{key:"isEmbed",value:function(t){var e=new RegExp(r.allowedEmbedTypes.join("|")).test(t),t=/\.(png|jpe?g|gif|svg|webp)/.test(t);return e||!t}},{key:"createCarousel",value:function(){var n=this,t=document.createElement("template"),e=this.sources.map(function(t,e){t=t.replace(/\/$/,"");var a="";a+=/\.png/.test(t)?"this.add.previousSibling.remove()":"";var r='<div class="ratio ratio-16x9"><img src="'.concat(t,'" class="d-block w-100 h-100 img-fluid" style="z-index: 1; object-fit: contain;" onload="').concat(a,'" /></div>'),o="",s=n.getInstagramEmbed(t),a=n.getYoutubeId(t);n.isEmbed(t)&&(/^embed/.test(t)&&(t=t.substring(5)),a&&(t="https://www.youtube.com/embed/".concat(a),o='title="YouTube video player" frameborder="0" allow="accelerometer autoplay clipboard-write encrypted-media gyroscope picture-in-picture"'),r=s||'<div class="ratio ratio-16x9"><iframe src="'.concat(t,'" ').concat(o," allowfullscreen></iframe></div>"));return'<div class="carousel-item '.concat(e?"":"active",'" style="min-height: 100px">').concat('<div class="position-absolute top-50 start-50 translate-middle text-white"><div class="spinner-border" style="width: 3rem height: 3rem" role="status"></div></div>').concat(r,"</div>")}).join(""),a=this.sources.length<2?"":'\n\t\t\t<button class="carousel-control carousel-control-prev h-75 m-auto" type="button" data-bs-target="#lightboxCarousel-'.concat(this.hash,'" data-bs-slide="prev">\n\t\t\t\t<span class="carousel-control-prev-icon" aria-hidden="true"></span>\n\t\t\t\t<span class="visually-hidden">Previous</span>\n\t\t\t</button>\n\t\t\t<button class="carousel-control carousel-control-next h-75 m-auto" type="button" data-bs-target="#lightboxCarousel-').concat(this.hash,'" data-bs-slide="next">\n\t\t\t\t<span class="carousel-control-next-icon" aria-hidden="true"></span>\n\t\t\t\t<span class="visually-hidden">Next</span>\n\t\t\t</button>'),a='\n\t\t\t<div id="lightboxCarousel-'.concat(this.hash,'" class="lightbox-carousel carousel" data-bs-ride="carousel">\n\t\t\t\t<div class="carousel-inner">\n\t\t\t\t\t').concat(e,"\n\t\t\t\t</div>\n\t\t\t\t").concat(a,"\n\t\t\t</div>");return t.innerHTML=a.trim(),this.carouselElement=t.content.firstChild,this.carousel=new bootstrap.Carousel(this.carouselElement,this.carouselOptions),this.carousel.to(this.sources.includes(this.src)?this.sources.indexOf(this.src):0),this.carousel}},{key:"createModal",value:function(){var e=this,t=document.createElement("template"),a='\n\t\t\t<div class="modal lightbox fade" id="lightboxModal-'.concat(this.hash,'" tabindex="-1" aria-hidden="true">\n\t\t\t\t<div class="modal-dialog modal-dialog-centered modal-xl">\n\t\t\t\t\t<div class="modal-content border-0" style="background: black">\n\t\t\t\t\t\t<div class="modal-body p-0">\n\t\t\t\t\t\t\t<button type="button" class="btn-close position-absolute top-0 end-0 p-3" data-bs-dismiss="modal" aria-label="Close" style="z-index: 2; background: none;">').concat('<svg xmlns="http://www.w3.org/2000/svg" style="position: relative; top: -5px;" viewBox="0 0 16 16" fill="#fff"><path d="M.293.293a1 1 0 011.414 0L8 6.586 14.293.293a1 1 0 111.414 1.414L9.414 8l6.293 6.293a1 1 0 01-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 01-1.414-1.414L6.586 8 .293 1.707a1 1 0 010-1.414z"/></svg>)',"</button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>");return t.innerHTML=a.trim(),this.modalElement=t.content.firstChild,this.modalElement.querySelector(".modal-body").appendChild(this.carouselElement),this.modalElement.addEventListener("hidden.bs.modal",function(t){return e.modalElement.remove()}),this.modal=new bootstrap.Modal(this.modalElement,this.modalOptions),this.modal}},{key:"randomHash",value:function(){return Array.from({length:0<arguments.length&&void 0!==arguments[0]?arguments[0]:8},function(){return Math.floor(36*Math.random()).toString(36)}).join("")}}]),r}();Lightbox.allowedEmbedTypes=["embed","youtube","vimeo","instagram","url"],Lightbox.allowedMediaTypes=[].concat(_toConsumableArray(Lightbox.allowedEmbedTypes),["image"]),Lightbox.defaultSelector='[data-toggle="lightbox"]',document.querySelectorAll(Lightbox.defaultSelector).forEach(function(e){return e.addEventListener("click",function(t){t.preventDefault(),new Lightbox(e).show()})});var _default=Lightbox;exports.default=_default; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _modal=_interopRequireDefault(require("./bootstrap/modal")),_carousel=_interopRequireDefault(require("./bootstrap/carousel"));function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}const bootstrap={Modal:_modal.default,Carousel:_carousel.default};class Lightbox{constructor(t,e={}){this.hash=this.randomHash(),this.settings=Object.assign(Object.assign(Object.assign({},bootstrap.Modal.Default),bootstrap.Carousel.Default),{interval:!1,target:'[data-toggle="lightbox"]',gallery:""}),this.modalOptions=this.setOptionsFromSettings(bootstrap.Modal.Default),this.carouselOptions=this.setOptionsFromSettings(bootstrap.Carousel.Default),console.log(),"string"==typeof t&&(this.settings.target=t,t=document.querySelector(this.settings.target),e=void 0!==arguments[1]?arguments[1]:{}),this.settings=Object.assign(Object.assign({},this.settings),e),this.el=t,this.type=t.dataset.type||"image",this.src=this.getSrc(t),this.src="image"!==this.type?"embed"+this.src:this.src,this.sources=this.getGalleryItems(),this.createCarousel(),this.createModal()}show(){document.body.appendChild(this.modalElement),this.modal.show()}hide(){this.modal.hide()}setOptionsFromSettings(t){return Object.keys(t).reduce((t,e)=>Object.assign(t,{[e]:this.settings[e]}),{})}getSrc(t){return t.dataset.src||t.dataset.remote||t.href||"http://via.placeholder.com/1600x900"}getGalleryItems(){let t;if(this.settings.gallery){if(Array.isArray(this.settings.gallery))return this.settings.gallery;t=this.settings.gallery}else this.el.dataset.gallery&&(t=this.el.dataset.gallery);return t?[...new Set(Array.from(document.querySelectorAll('[data-gallery="'.concat(t,'"]')),t=>"".concat(t.dataset.type?"embed":"").concat(this.getSrc(t))))]:[this.src]}getYoutubeId(t){if(!t)return!1;t=t.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/);return!(!t||11!==t[2].length)&&t[2]}getInstagramEmbed(t){if(/instagram/.test(t))return t+=/\/embed$/.test(t)?"":"/embed",'<div class="ratio ratio-16x9" style="max-height: 100%;"><iframe src="'.concat(t,'" class="start-50 translate-middle-x" style="max-width: 500px" frameborder="0" scrolling="no" allowtransparency="true"></iframe></div>')}isEmbed(t){const e=new RegExp(Lightbox.allowedEmbedTypes.join("|"));var s=e.test(t),t=/\.(png|jpe?g|gif|svg|webp)/.test(t);return s||!t}createCarousel(){const t=document.createElement("template");var e=this.sources.map((t,e)=>{t=t.replace(/\/$/,"");var s="";s+=/\.png/.test(t)?"this.add.previousSibling.remove()":"";let a='<div class="ratio ratio-16x9"><img src="'.concat(t,'" class="d-block w-100 h-100 img-fluid" style="z-index: 1; object-fit: contain;" onload="').concat(s,'" /></div>'),o="";var i=this.getInstagramEmbed(t),s=this.getYoutubeId(t);this.isEmbed(t)&&(/^embed/.test(t)&&(t=t.substring(5)),s&&(t="https://www.youtube.com/embed/".concat(s),o='title="YouTube video player" frameborder="0" allow="accelerometer autoplay clipboard-write encrypted-media gyroscope picture-in-picture"'),a=i||'<div class="ratio ratio-16x9"><iframe src="'.concat(t,'" ').concat(o," allowfullscreen></iframe></div>"));return'<div class="carousel-item '.concat(e?"":"active",'" style="min-height: 100px">').concat('<div class="position-absolute top-50 start-50 translate-middle text-white"><div class="spinner-border" style="width: 3rem height: 3rem" role="status"></div></div>').concat(a,"</div>")}).join(""),s=this.sources.length<2?"":'\n\t\t\t<button class="carousel-control carousel-control-prev h-75 m-auto" type="button" data-bs-target="#lightboxCarousel-'.concat(this.hash,'" data-bs-slide="prev">\n\t\t\t\t<span class="carousel-control-prev-icon" aria-hidden="true"></span>\n\t\t\t\t<span class="visually-hidden">Previous</span>\n\t\t\t</button>\n\t\t\t<button class="carousel-control carousel-control-next h-75 m-auto" type="button" data-bs-target="#lightboxCarousel-').concat(this.hash,'" data-bs-slide="next">\n\t\t\t\t<span class="carousel-control-next-icon" aria-hidden="true"></span>\n\t\t\t\t<span class="visually-hidden">Next</span>\n\t\t\t</button>');const a='\n\t\t\t<div id="lightboxCarousel-'.concat(this.hash,'" class="lightbox-carousel carousel" data-bs-ride="carousel">\n\t\t\t\t<div class="carousel-inner">\n\t\t\t\t\t').concat(e,"\n\t\t\t\t</div>\n\t\t\t\t").concat(s,"\n\t\t\t</div>");return t.innerHTML=a.trim(),this.carouselElement=t.content.firstChild,this.carousel=new bootstrap.Carousel(this.carouselElement,this.carouselOptions),this.carousel.to(this.sources.includes(this.src)?this.sources.indexOf(this.src):0),this.carousel}createModal(){const t=document.createElement("template");const e='\n\t\t\t<div class="modal lightbox fade" id="lightboxModal-'.concat(this.hash,'" tabindex="-1" aria-hidden="true">\n\t\t\t\t<div class="modal-dialog modal-dialog-centered modal-xl">\n\t\t\t\t\t<div class="modal-content border-0" style="background: black">\n\t\t\t\t\t\t<div class="modal-body p-0">\n\t\t\t\t\t\t\t<button type="button" class="btn-close position-absolute top-0 end-0 p-3" data-bs-dismiss="modal" aria-label="Close" style="z-index: 2; background: none;">').concat('<svg xmlns="http://www.w3.org/2000/svg" style="position: relative; top: -5px;" viewBox="0 0 16 16" fill="#fff"><path d="M.293.293a1 1 0 011.414 0L8 6.586 14.293.293a1 1 0 111.414 1.414L9.414 8l6.293 6.293a1 1 0 01-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 01-1.414-1.414L6.586 8 .293 1.707a1 1 0 010-1.414z"/></svg>)',"</button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>");return t.innerHTML=e.trim(),this.modalElement=t.content.firstChild,this.modalElement.querySelector(".modal-body").appendChild(this.carouselElement),this.modalElement.addEventListener("hidden.bs.modal",t=>this.modalElement.remove()),this.modal=new bootstrap.Modal(this.modalElement,this.modalOptions),this.modal}randomHash(t=8){return Array.from({length:t},()=>Math.floor(36*Math.random()).toString(36)).join("")}}Lightbox.allowedEmbedTypes=["embed","youtube","vimeo","instagram","url"],Lightbox.allowedMediaTypes=[...Lightbox.allowedEmbedTypes,"image"],Lightbox.defaultSelector='[data-toggle="lightbox"]',document.querySelectorAll(Lightbox.defaultSelector).forEach(s=>s.addEventListener("click",t=>{t.preventDefault();const e=new Lightbox(s);e.show()}));var _default=Lightbox;exports.default=_default; |
{ | ||
"name": "bs5-lightbox", | ||
"version": "1.5.1", | ||
"version": "1.6.0", | ||
"author": { | ||
@@ -21,4 +21,13 @@ "name": "Travis Aaron Wagner", | ||
"license": "MIT", | ||
"main": "dist/index.esm", | ||
"types": "dist/index.esm.d.ts", | ||
"main": "./dist/index", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/trvswgnr/bs5-lightbox.git" | ||
}, | ||
"dependencies": { | ||
"@babel/preset-typescript": "^7.15.0" | ||
}, | ||
"peerDependencies": { | ||
"bootstrap": "^5.1.1" | ||
}, | ||
"scripts": { | ||
@@ -36,3 +45,2 @@ "bundle": "webpack --mode=production", | ||
"lint:fix": "eslint src --fix --ext .js,.ts", | ||
"publish": "npm publish", | ||
"serve": "browser-sync start --server --files \"dist/*.css, dist/*.js, **/*.html, !node_modules/**/*.html\" --open false", | ||
@@ -43,13 +51,5 @@ "watch:ts": "npm run-s build; onchange \"src/*.ts\" -- run-s build -s", | ||
}, | ||
"browserslist": [ | ||
">= 0.5%", | ||
"last 2 major versions", | ||
"not dead", | ||
"Chrome >= 60", | ||
"Firefox >= 60", | ||
"Firefox ESR", | ||
"iOS >= 12", | ||
"Safari >= 12", | ||
"not Explorer <= 11" | ||
], | ||
"bundleDependencies": false, | ||
"deprecated": false, | ||
"funding": "https://github.com/sponsors/trvswgnr", | ||
"devDependencies": { | ||
@@ -91,11 +91,13 @@ "@atao60/fse-cli": "^0.1.7", | ||
}, | ||
"files": [ | ||
"dist/**/*" | ||
], | ||
"peerDependencies": { | ||
"bootstrap": "^5.1.1" | ||
}, | ||
"bundleDependencies": false, | ||
"deprecated": false, | ||
"funding": "https://github.com/sponsors/trvswgnr" | ||
"browserslist": [ | ||
">= 0.5%", | ||
"last 2 major versions", | ||
"not dead", | ||
"Chrome >= 60", | ||
"Firefox >= 60", | ||
"Firefox ESR", | ||
"iOS >= 12", | ||
"Safari >= 12", | ||
"not Explorer <= 11" | ||
] | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
128969
24
2213
0
2
+ Added@ampproject/remapping@2.3.0(transitive)
+ Added@babel/code-frame@7.26.2(transitive)
+ Added@babel/compat-data@7.26.2(transitive)
+ Added@babel/core@7.26.0(transitive)
+ Added@babel/generator@7.26.2(transitive)
+ Added@babel/helper-annotate-as-pure@7.25.9(transitive)
+ Added@babel/helper-compilation-targets@7.25.9(transitive)
+ Added@babel/helper-create-class-features-plugin@7.25.9(transitive)
+ Added@babel/helper-member-expression-to-functions@7.25.9(transitive)
+ Added@babel/helper-module-imports@7.25.9(transitive)
+ Added@babel/helper-module-transforms@7.26.0(transitive)
+ Added@babel/helper-optimise-call-expression@7.25.9(transitive)
+ Added@babel/helper-plugin-utils@7.25.9(transitive)
+ Added@babel/helper-replace-supers@7.25.9(transitive)
+ Added@babel/helper-simple-access@7.25.9(transitive)
+ Added@babel/helper-skip-transparent-expression-wrappers@7.25.9(transitive)
+ Added@babel/helper-string-parser@7.25.9(transitive)
+ Added@babel/helper-validator-identifier@7.25.9(transitive)
+ Added@babel/helper-validator-option@7.25.9(transitive)
+ Added@babel/helpers@7.26.0(transitive)
+ Added@babel/parser@7.26.2(transitive)
+ Added@babel/plugin-syntax-jsx@7.25.9(transitive)
+ Added@babel/plugin-syntax-typescript@7.25.9(transitive)
+ Added@babel/plugin-transform-modules-commonjs@7.25.9(transitive)
+ Added@babel/plugin-transform-typescript@7.25.9(transitive)
+ Added@babel/preset-typescript@7.26.0(transitive)
+ Added@babel/template@7.25.9(transitive)
+ Added@babel/traverse@7.25.9(transitive)
+ Added@babel/types@7.26.0(transitive)
+ Added@jridgewell/gen-mapping@0.3.5(transitive)
+ Added@jridgewell/resolve-uri@3.1.2(transitive)
+ Added@jridgewell/set-array@1.2.1(transitive)
+ Added@jridgewell/sourcemap-codec@1.5.0(transitive)
+ Added@jridgewell/trace-mapping@0.3.25(transitive)
+ Addedbrowserslist@4.24.2(transitive)
+ Addedcaniuse-lite@1.0.30001683(transitive)
+ Addedconvert-source-map@2.0.0(transitive)
+ Addeddebug@4.3.7(transitive)
+ Addedelectron-to-chromium@1.5.64(transitive)
+ Addedescalade@3.2.0(transitive)
+ Addedgensync@1.0.0-beta.2(transitive)
+ Addedglobals@11.12.0(transitive)
+ Addedjs-tokens@4.0.0(transitive)
+ Addedjsesc@3.0.2(transitive)
+ Addedjson5@2.2.3(transitive)
+ Addedlru-cache@5.1.1(transitive)
+ Addedms@2.1.3(transitive)
+ Addednode-releases@2.0.18(transitive)
+ Addedpicocolors@1.1.1(transitive)
+ Addedsemver@6.3.1(transitive)
+ Addedupdate-browserslist-db@1.1.1(transitive)
+ Addedyallist@3.1.1(transitive)