@qratilabs/qrati-connect 2.23.6 → 2.23.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{umd/Dgs_iVn3.js → element/BYEF5Khs.js} +1 -1
- package/element/{R0dHh5Az2.js → BYoa-kpQ2.js} +1 -1
- package/{umd/_bFyk49H2.js → element/BfkCwRAR2.js} +1 -1
- package/element/{CGc52QIP2.js → BpVacqmD2.js} +1 -1
- package/{umd/B78xAjNG2.js → element/C030L_Hu2.js} +1 -1
- package/element/{DNAwNX6_.js → CSO2IaJ1.js} +1 -1
- package/element/{CebL6kYV2.js → D4apO9G62.js} +1 -1
- package/element/{C3HKK1w_2.js → DB1jhaAe2.js} +1 -1
- package/element/{7GXdePWm2.js → DQ6V4QOv2.js} +1 -1
- package/{umd/BNEa3Uj4.js → element/Do2aldFH.js} +1 -1
- package/element/{d_bA36WR2.js → Drl8BMLL2.js} +1 -1
- package/{umd/D5YBxlTz2.js → element/WxZlurdK2.js} +5 -5
- package/element/{D5MjLaap2.js → lrjV8c1G2.js} +1 -1
- package/element/ls36Q8v0.js +9 -0
- package/{umd/Bm_xW_Mp2.js → element/qNDy94Dr2.js} +1 -1
- package/element/web.es.js +4 -4
- package/package.json +1 -1
- package/{element/Dgs_iVn3.js → umd/BYEF5Khs.js} +1 -1
- package/umd/{R0dHh5Az2.js → BYoa-kpQ2.js} +1 -1
- package/{element/_bFyk49H2.js → umd/BfkCwRAR2.js} +1 -1
- package/umd/{CGc52QIP2.js → BpVacqmD2.js} +1 -1
- package/{element/B78xAjNG2.js → umd/C030L_Hu2.js} +1 -1
- package/umd/{DNAwNX6_.js → CSO2IaJ1.js} +1 -1
- package/umd/{CebL6kYV2.js → D4apO9G62.js} +1 -1
- package/umd/{C3HKK1w_2.js → DB1jhaAe2.js} +1 -1
- package/umd/{7GXdePWm2.js → DQ6V4QOv2.js} +1 -1
- package/{element/BNEa3Uj4.js → umd/Do2aldFH.js} +1 -1
- package/umd/{d_bA36WR2.js → Drl8BMLL2.js} +1 -1
- package/{element/D5YBxlTz2.js → umd/WxZlurdK2.js} +5 -5
- package/umd/{D5MjLaap2.js → lrjV8c1G2.js} +1 -1
- package/umd/ls36Q8v0.js +9 -0
- package/{element/Bm_xW_Mp2.js → umd/qNDy94Dr2.js} +1 -1
- package/umd/web.es.js +4 -4
- package/element/C9ak4yUT.js +0 -8
- package/umd/C9ak4yUT.js +0 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as t,t as i,w as e}from"./C3uDEVBt.js";import{m as s}from"./BItJQVdK.js";import{t as n}from"./b6CwQBFC.js";import{t as o}from"./DNAwNX6_.js";import{t as a}from"./Bki5T_lb.js";var r=({url:r,alt:h="",thumbnailUrl:l,blurhash:p,pswpData:d={},curateLink:c,onClick:m})=>{const u=t(()=>(t=>Object.keys(t).reduce((i,e)=>{const s=t[e];return null==s||""===s||(i[`data-pswp-${n=e,n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}`]=s),i;var n},{}))(d),[d]),_=/* @__PURE__ */i(e,{children:[/* @__PURE__ */i(o,{threshold:.1,src:l||r,blurhash:p,alt:h}),d.type===s.VIDEO&&/* @__PURE__ */i("div",{className:"absolute inset-0 top-0 left-0 flex items-center justify-center opacity-75",children:/* @__PURE__ */i("svg",{xmlns:"http://www.w3.org/2000/svg",className:"w-16 text-white lg:w-24",viewBox:"0 0 24 24",children:/* @__PURE__ */i("path",{fill:"currentColor",d:"M8 17.175V6.825q0-.425.3-.713t.7-.287q.125 0 .263.037t.262.113l8.15 5.175q.225.15.338.375t.112.475t-.112.475t-.338.375l-8.15 5.175q-.125.075-.262.113T9 18.175q-.4 0-.7-.288t-.3-.712"})})})]});if(m)/* @__PURE__ */return i("button",{className:"h-full w-full",onClick:m,children:_});if(c)/* @__PURE__ */return i(n,{to:c,className:"h-full w-full",children:_});const g=r&&a(r,["http:","https:"])?r:void 0;return g?/* @__PURE__ */i("a",{href:g,className:"pswp-item block h-full w-full",...u,...l?{"data-pswp-thumbnail-url":l}:{},...p?{"data-pswp-blurhash":p}:{},target:"_blank",rel:"noreferrer",children:_}):/* @__PURE__ */i("span",{className:"pswp-item block h-full w-full",...u,...l?{"data-pswp-thumbnail-url":l}:{},...p?{"data-pswp-blurhash":p}:{},children:_})};function h(t,i,e){const s=document.createElement(i);return t&&(s.className=t),e&&e.appendChild(s),s}function l(t,i){return t.x=i.x,t.y=i.y,void 0!==i.id&&(t.id=i.id),t}function p(t){t.x=Math.round(t.x),t.y=Math.round(t.y)}function d(t,i){const e=Math.abs(t.x-i.x),s=Math.abs(t.y-i.y);return Math.sqrt(e*e+s*s)}function c(t,i){return t.x===i.x&&t.y===i.y}function m(t,i,e){return Math.min(Math.max(t,i),e)}function u(t,i,e){let s=`translate3d(${t}px,${i||0}px,0)`;return void 0!==e&&(s+=` scale3d(${e},${e},1)`),s}function _(t,i,e,s){t.style.transform=u(i,e,s)}function g(t,i,e,s){t.style.transition=i?`${i} ${e}ms ${s||"cubic-bezier(.4,0,.22,1)"}`:"none"}function v(t,i,e){t.style.width="number"==typeof i?`${i}px`:i,t.style.height="number"==typeof e?`${e}px`:e}var y="loading",w="loaded",f="error";function x(t){return"button"in t&&1===t.button||t.ctrlKey||t.metaKey||t.altKey||t.shiftKey}function P(t,i,e=document){let s=[];if(t instanceof Element)s=[t];else if(t instanceof NodeList||Array.isArray(t))s=Array.from(t);else{const n="string"==typeof t?t:i;n&&(s=Array.from(e.querySelectorAll(n)))}return s}function S(){return!(!navigator.vendor||!navigator.vendor.match(/apple/i))}var b=class{constructor(t,i){if(this.element=h("pswp__img pswp__img--placeholder",t?"img":"div",i),t){const i=this.element;i.decoding="async",i.alt="",i.src=t,i.setAttribute("role","presentation")}this.element.setAttribute("aria-hidden","true")}setDisplayedSize(t,i){this.element&&("IMG"===this.element.tagName?(v(this.element,250,"auto"),this.element.style.transformOrigin="0 0",this.element.style.transform=u(0,0,t/250)):v(this.element,t,i))}destroy(){this.element?.parentNode&&this.element.remove(),this.element=null}},C=class{constructor(t,i,e){this.instance=i,this.data=t,this.index=e,this.element=void 0,this.placeholder=void 0,this.slide=void 0,this.displayedImageWidth=0,this.displayedImageHeight=0,this.width=Number(this.data.w)||Number(this.data.width)||0,this.height=Number(this.data.h)||Number(this.data.height)||0,this.isAttached=!1,this.hasSlide=!1,this.isDecoding=!1,this.state="idle",this.data.type?this.type=this.data.type:this.data.src?this.type="image":this.type="html",this.hash=this.data.hash,this.instance.dispatch("contentInit",{content:this})}removePlaceholder(){this.placeholder&&!this.keepPlaceholder()&&setTimeout(()=>{this.placeholder&&(this.placeholder.destroy(),this.placeholder=void 0)},1e3)}load(t,i){if(this.slide&&this.usePlaceholder())if(this.placeholder){const t=this.placeholder.element;t&&!t.parentElement&&this.slide.container.prepend(t)}else{const t=this.instance.applyFilters("placeholderSrc",!(!this.data.msrc||!this.slide.isFirstSlide)&&this.data.msrc,this);this.placeholder=new b(t,this.slide.container)}this.element&&!i||this.instance.dispatch("contentLoad",{content:this,isLazy:t}).defaultPrevented||(this.isImageContent()?(this.element=h("pswp__img","img"),this.displayedImageWidth&&this.loadImage(t)):(this.element=h("pswp__content","div"),this.element.innerHTML=this.data.html||""),i&&this.slide&&this.slide.updateContentSize(!0))}loadImage(t){if(!this.isImageContent()||!this.element||this.instance.dispatch("contentLoadImage",{content:this,isLazy:t}).defaultPrevented)return;const i=this.element;this.updateSrcsetSizes(),this.data.srcset&&(i.srcset=this.data.srcset),i.src=this.data.src??"",i.alt=this.data.alt??"",this.state=y,i.complete?this.onLoaded():(i.onload=()=>{this.onLoaded()},i.onerror=()=>{this.onError()})}setSlide(t){this.slide=t,this.hasSlide=!0,this.instance=t.pswp}onLoaded(){this.state=w,this.slide&&this.element&&(this.instance.dispatch("loadComplete",{slide:this.slide,content:this}),this.slide.isActive&&this.slide.heavyAppended&&!this.element.parentNode&&(this.append(),this.slide.updateContentSize(!0)),this.state!==w&&this.state!==f||this.removePlaceholder())}onError(){this.state=f,this.slide&&(this.displayError(),this.instance.dispatch("loadComplete",{slide:this.slide,isError:!0,content:this}),this.instance.dispatch("loadError",{slide:this.slide,content:this}))}isLoading(){return this.instance.applyFilters("isContentLoading",this.state===y,this)}isError(){return this.state===f}isImageContent(){return"image"===this.type||"ad"===this.type}setDisplayedSize(t,i){if(this.element&&(this.placeholder&&this.placeholder.setDisplayedSize(t,i),!this.instance.dispatch("contentResize",{content:this,width:t,height:i}).defaultPrevented&&(v(this.element,t,i),this.isImageContent()&&!this.isError()))){const e=!this.displayedImageWidth&&t;this.displayedImageWidth=t,this.displayedImageHeight=i,e?this.loadImage(!1):this.updateSrcsetSizes(),this.slide&&this.instance.dispatch("imageSizeChange",{slide:this.slide,width:t,height:i,content:this})}}isZoomable(){return this.instance.applyFilters("isContentZoomable",this.isImageContent()&&this.state!==f,this)}updateSrcsetSizes(){if(!this.isImageContent()||!this.element||!this.data.srcset)return;const t=this.element,i=this.instance.applyFilters("srcsetSizesWidth",this.displayedImageWidth,this);(!t.dataset.largestUsedSize||i>parseInt(t.dataset.largestUsedSize,10))&&(t.sizes=`${i}px`,t.dataset.largestUsedSize=String(i))}usePlaceholder(){return this.instance.applyFilters("useContentPlaceholder",this.isImageContent(),this)}lazyLoad(){this.instance.dispatch("contentLazyLoad",{content:this}).defaultPrevented||this.load(!0)}keepPlaceholder(){return this.instance.applyFilters("isKeepingPlaceholder",this.isLoading(),this)}destroy(){this.hasSlide=!1,this.slide=void 0,this.instance.dispatch("contentDestroy",{content:this}).defaultPrevented||(this.remove(),this.placeholder&&(this.placeholder.destroy(),this.placeholder=void 0),this.isImageContent()&&this.element&&(this.element.onload=null,this.element.onerror=null,this.element=void 0))}displayError(){if(this.slide){let t=h("pswp__error-msg","div");t.innerText=this.instance.options?.errorMsg??"",t=this.instance.applyFilters("contentErrorElement",t,this),this.element=h("pswp__content pswp__error-msg-container","div"),this.element.appendChild(t),this.slide.container.innerText="",this.slide.container.appendChild(this.element),this.slide.updateContentSize(!0),this.removePlaceholder()}}append(){if(this.isAttached||!this.element)return;if(this.isAttached=!0,this.state===f)return void this.displayError();if(this.instance.dispatch("contentAppend",{content:this}).defaultPrevented)return;const t="decode"in this.element;this.isImageContent()?t&&this.slide&&(!this.slide.isActive||S())?(this.isDecoding=!0,this.element.decode().catch(()=>{}).finally(()=>{this.isDecoding=!1,this.appendImage()})):this.appendImage():this.slide&&!this.element.parentNode&&this.slide.container.appendChild(this.element)}activate(){!this.instance.dispatch("contentActivate",{content:this}).defaultPrevented&&this.slide&&(this.isImageContent()&&this.isDecoding&&!S()?this.appendImage():this.isError()&&this.load(!1,!0),this.slide.holderElement&&this.slide.holderElement.setAttribute("aria-hidden","false"))}deactivate(){this.instance.dispatch("contentDeactivate",{content:this}),this.slide&&this.slide.holderElement&&this.slide.holderElement.setAttribute("aria-hidden","true")}remove(){this.isAttached=!1,this.instance.dispatch("contentRemove",{content:this}).defaultPrevented||(this.element&&this.element.parentNode&&this.element.remove(),this.placeholder&&this.placeholder.element&&this.placeholder.element.remove())}appendImage(){this.isAttached&&(this.instance.dispatch("contentAppendImage",{content:this}).defaultPrevented||(this.slide&&this.element&&!this.element.parentNode&&this.slide.container.appendChild(this.element),this.state!==w&&this.state!==f||this.removePlaceholder()))}};function L(t,i){if(t.getViewportSizeFn){const e=t.getViewportSizeFn(t,i);if(e)return e}return{x:document.documentElement.clientWidth,y:window.innerHeight}}function z(t,i,e,s,n){let o=0;if(i.paddingFn)o=i.paddingFn(e,s,n)[t];else if(i.padding)o=i.padding[t];else{const e=`padding${t[0].toUpperCase()}${t.slice(1)}`;i[e]&&(o=i[e])}return Number(o)||0}function I(t,i,e,s){return{x:i.x-z("left",t,i,e,s)-z("right",t,i,e,s),y:i.y-z("top",t,i,e,s)-z("bottom",t,i,e,s)}}var A=class{constructor(t,i,e,s){this.pswp=s,this.options=t,this.itemData=i,this.index=e,this.panAreaSize=null,this.elementSize=null,this.fit=1,this.fill=1,this.vFill=1,this.initial=1,this.secondary=1,this.max=1,this.min=1}update(t,i,e){const s={x:t,y:i};this.elementSize=s,this.panAreaSize=e;const n=e.x/s.x,o=e.y/s.y;this.fit=Math.min(1,n<o?n:o),this.fill=Math.min(1,n>o?n:o),this.vFill=Math.min(1,o),this.initial=this._getInitial(),this.secondary=this._getSecondary(),this.max=Math.max(this.initial,this.secondary,this._getMax()),this.min=Math.min(this.fit,this.initial,this.secondary),this.pswp&&this.pswp.dispatch("zoomLevelsUpdate",{zoomLevels:this,slideData:this.itemData})}_parseZoomLevelOption(t){const i=`${t}ZoomLevel`,e=this.options[i];if(e)return"function"==typeof e?e(this):"fill"===e?this.fill:"fit"===e?this.fit:Number(e)}_getSecondary(){let t=this._parseZoomLevelOption("secondary");return t||(t=Math.min(1,3*this.fit),this.elementSize&&t*this.elementSize.x>4e3&&(t=4e3/this.elementSize.x),t)}_getInitial(){return this._parseZoomLevelOption("initial")||this.fit}_getMax(){return this._parseZoomLevelOption("max")||Math.max(1,4*this.fit)}};function T(t,i,e){const s=i.createContentFromData(t,e);let n;const{options:o}=i;if(o){let a;n=new A(o,t,-1),a=i.pswp?i.pswp.viewportSize:L(o,i);const r=I(o,a,t,e);n.update(s.width,s.height,r)}return s.lazyLoad(),n&&s.setDisplayedSize(Math.ceil(s.width*n.initial),Math.ceil(s.height*n.initial)),s}function Z(t,i){const e=i.getItemData(t);if(!i.dispatch("lazyLoadSlide",{index:t,itemData:e}).defaultPrevented)return T(e,i,t)}var O=class{constructor(t){this.pswp=t,this.limit=Math.max(t.options.preload[0]+t.options.preload[1]+1,5),this._cachedItems=[]}updateLazy(t){const{pswp:i}=this;if(i.dispatch("lazyLoad").defaultPrevented)return;const{preload:e}=i.options,s=void 0===t||t>=0;let n;for(n=0;n<=e[1];n++)this.loadSlideByIndex(i.currIndex+(s?n:-n));for(n=1;n<=e[0];n++)this.loadSlideByIndex(i.currIndex+(s?-n:n))}loadSlideByIndex(t){const i=this.pswp.getLoopedIndex(t);let e=this.getContentByIndex(i);e||(e=Z(i,this.pswp),e&&this.addToCache(e))}getContentBySlide(t){let i=this.getContentByIndex(t.index);return i||(i=this.pswp.createContentFromData(t.data,t.index),this.addToCache(i)),i.setSlide(t),i}addToCache(t){if(this.removeByIndex(t.index),this._cachedItems.push(t),this._cachedItems.length>this.limit){const t=this._cachedItems.findIndex(t=>!t.isAttached&&!t.hasSlide);-1!==t&&this._cachedItems.splice(t,1)[0].destroy()}}removeByIndex(t){const i=this._cachedItems.findIndex(i=>i.index===t);-1!==i&&this._cachedItems.splice(i,1)}getContentByIndex(t){return this._cachedItems.find(i=>i.index===t)}destroy(){this._cachedItems.forEach(t=>t.destroy()),this._cachedItems=[]}},E=class{constructor(t,i){this.type=t,this.defaultPrevented=!1,i&&Object.assign(this,i)}preventDefault(){this.defaultPrevented=!0}},D=class{constructor(){this._listeners={},this._filters={},this.pswp=void 0,this.options=void 0}addFilter(t,i,e=100){this._filters[t]||(this._filters[t]=[]),this._filters[t]?.push({fn:i,priority:e}),this._filters[t]?.sort((t,i)=>t.priority-i.priority),this.pswp?.addFilter(t,i,e)}removeFilter(t,i){this._filters[t]&&(this._filters[t]=this._filters[t].filter(t=>t.fn!==i)),this.pswp&&this.pswp.removeFilter(t,i)}applyFilters(t,...i){return this._filters[t]?.forEach(t=>{i[0]=t.fn.apply(this,i)}),i[0]}on(t,i){this._listeners[t]||(this._listeners[t]=[]),this._listeners[t]?.push(i),this.pswp?.on(t,i)}off(t,i){this._listeners[t]&&(this._listeners[t]=this._listeners[t].filter(t=>i!==t)),this.pswp?.off(t,i)}dispatch(t,i){if(this.pswp)return this.pswp.dispatch(t,i);const e=new E(t,i);return this._listeners[t]?.forEach(t=>{t.call(this,e)}),e}},M=class extends D{getNumItems(){let t=0;const i=this.options?.dataSource;i&&"length"in i?t=i.length:i&&"gallery"in i&&(i.items||(i.items=this._getGalleryDOMElements(i.gallery)),i.items&&(t=i.items.length));const e=this.dispatch("numItems",{dataSource:i,numItems:t});return this.applyFilters("numItems",e.numItems,i)}createContentFromData(t,i){return new C(t,this,i)}getItemData(t){const i=this.options?.dataSource;let e={};Array.isArray(i)?e=i[t]:i&&"gallery"in i&&(i.items||(i.items=this._getGalleryDOMElements(i.gallery)),e=i.items[t]);let s=e;s instanceof Element&&(s=this._domElementToItemData(s));const n=this.dispatch("itemData",{itemData:s||{},index:t});return this.applyFilters("itemData",n.itemData,t)}_getGalleryDOMElements(t){return this.options?.children||this.options?.childSelector?P(this.options.children,this.options.childSelector,t)||[]:[t]}_toLowerCaseFirstLetter(t){return t?t.charAt(0).toLowerCase()+t.slice(1):t}_domElementToItemData(t){const i={element:t},e="A"===t.tagName?t:t.querySelector("a");if(e){i.src=e.dataset.pswpSrc||e.href,e.dataset.pswpSrcset&&(i.srcset=e.dataset.pswpSrcset),i.width=e.dataset.pswpWidth?parseInt(e.dataset.pswpWidth,10):0,i.height=e.dataset.pswpHeight?parseInt(e.dataset.pswpHeight,10):0,e.dataset.pswpType&&(i.type=e.dataset.pswpType.toLowerCase());const s=t.querySelector("img");s&&(i.msrc=s.currentSrc||s.src,i.alt=s.getAttribute("alt")??""),(e.dataset.pswpCropped||e.dataset.cropped)&&(i.thumbCropped=!0);const n=["element","src","srcset","width","height","type","msrc","alt","thumbCropped"];Object.keys(e.dataset).filter(t=>t.startsWith("pswp")&&!n.includes(this._toLowerCaseFirstLetter(t.slice(4)))).forEach(t=>{i[this._toLowerCaseFirstLetter(t.slice(4))]=e.dataset[t]})}return this.applyFilters("domItemData",i,t,e)}lazyLoadData(t,i){return T(t,this,i)}},F=class extends M{constructor(t){super(),this.options=t||{},this._uid=0,this.shouldOpen=!1,this._preloadedContent=void 0,this.onThumbnailsClick=this.onThumbnailsClick.bind(this)}init(){P(this.options.gallery,this.options.gallerySelector).forEach(t=>{t.addEventListener("click",this.onThumbnailsClick,!1)})}onThumbnailsClick(t){if(x(t)||window.pswp)return;let i={x:t.clientX,y:t.clientY};i.x||i.y||(i=null);let e=this.getClickedIndex(t);e=this.applyFilters("clickedIndex",e,t,this);const s={gallery:t.currentTarget};e>=0&&(t.preventDefault(),this.loadAndOpen(e,s,i))}getClickedIndex(t){if(this.options.getClickedIndexFn)return this.options.getClickedIndexFn.call(this,t);const i=t.target,e=P(this.options.children,this.options.childSelector,t.currentTarget).findIndex(t=>t===i||t.contains(i));return-1!==e?e:this.options.children||this.options.childSelector?-1:0}loadAndOpen(t,i,e){if(window.pswp||!this.options)return!1;if(!i&&this.options.gallery&&this.options.children){const t=P(this.options.gallery);t[0]&&(i={gallery:t[0]})}return this.options.index=t,this.options.initialPointerPos=e,this.shouldOpen=!0,this.preload(t,i),!0}preload(t,i){const{options:e}=this;i&&(e.dataSource=i);const s=[],n=typeof e.pswpModule;if("function"==typeof(o=e.pswpModule)&&o.prototype&&o.prototype.goTo)s.push(Promise.resolve(e.pswpModule));else{if("string"===n)throw new Error("pswpModule as string is no longer supported");if("function"!==n)throw new Error("pswpModule is not valid");s.push(e.pswpModule())}var o;"function"==typeof e.openPromise&&s.push(e.openPromise()),!1!==e.preloadFirstSlide&&t>=0&&(this._preloadedContent=Z(t,this));const a=++this._uid;Promise.all(s).then(t=>{if(this.shouldOpen){const i=t[0];this._openPhotoswipe(i,a)}})}_openPhotoswipe(t,i){if(i!==this._uid&&this.shouldOpen)return;if(this.shouldOpen=!1,window.pswp)return;const e="object"==typeof t?new t.default(this.options):new t(this.options);this.pswp=e,window.pswp=e,Object.keys(this._listeners).forEach(t=>{this._listeners[t]?.forEach(i=>{e.on(t,i)})}),Object.keys(this._filters).forEach(t=>{this._filters[t]?.forEach(i=>{e.addFilter(t,i.fn,i.priority)})}),this._preloadedContent&&(e.contentLoader.addToCache(this._preloadedContent),this._preloadedContent=void 0),e.on("destroy",()=>{this.pswp=void 0,delete window.pswp}),e.init()}destroy(){this.pswp?.destroy(),this.shouldOpen=!1,this._listeners={},P(this.options.gallery,this.options.gallerySelector).forEach(t=>{t.removeEventListener("click",this.onThumbnailsClick,!1)})}},B=class{constructor(t){this.gestures=t,this.pswp=t.pswp,this.startPan={x:0,y:0}}start(){this.pswp.currSlide&&l(this.startPan,this.pswp.currSlide.pan),this.pswp.animations.stopAll()}change(){const{p1:t,prevP1:i,dragAxis:e}=this.gestures,{currSlide:s}=this.pswp;if("y"===e&&this.pswp.options.closeOnVerticalDrag&&s&&s.currZoomLevel<=s.zoomLevels.fit&&!this.gestures.isMultitouch){const e=s.pan.y+(t.y-i.y);if(!this.pswp.dispatch("verticalDrag",{panY:e}).defaultPrevented){this._setPanWithFriction("y",e,.6);const t=1-Math.abs(this._getVerticalDragRatio(s.pan.y));this.pswp.applyBgOpacity(t),s.applyCurrentZoomPan()}}else this._panOrMoveMainScroll("x")||(this._panOrMoveMainScroll("y"),s&&(p(s.pan),s.applyCurrentZoomPan()))}end(){const{velocity:t}=this.gestures,{mainScroll:i,currSlide:e}=this.pswp;let s=0;if(this.pswp.animations.stopAll(),i.isShifted()){const e=(i.x-i.getCurrSlideX())/this.pswp.viewportSize.x;t.x<-.5&&e<0||t.x<.1&&e<-.5?(s=1,t.x=Math.min(t.x,0)):(t.x>.5&&e>0||t.x>-.1&&e>.5)&&(s=-1,t.x=Math.max(t.x,0)),i.moveIndexBy(s,!0,t.x,!0)}e&&e.currZoomLevel>e.zoomLevels.max||this.gestures.isMultitouch?this.gestures.zoomLevels.correctZoomPan(!0):(this._finishPanGestureForAxis("x"),this._finishPanGestureForAxis("y"))}_finishPanGestureForAxis(t){const{velocity:i}=this.gestures,{currSlide:e}=this.pswp;if(!e)return;const{pan:s,bounds:n}=e,o=s[t],a=this.pswp.bgOpacity<1&&"y"===t,r=o+i[t]*.995/(1-.995);if(a){const t=this._getVerticalDragRatio(o),i=this._getVerticalDragRatio(r);if(t<0&&i<-.4||t>0&&i>.4)return void this.pswp.close()}const h=n.correctPan(t,r);if(o===h)return;const l=h===r?1:.82,p=this.pswp.bgOpacity,d=h-o;this.pswp.animations.startSpring({name:`panGesture${t}`,isPan:!0,start:o,end:h,velocity:i[t],dampingRatio:l,onUpdate:i=>{if(a&&this.pswp.bgOpacity<1){const t=1-(h-i)/d;this.pswp.applyBgOpacity(m(p+(1-p)*t,0,1))}s[t]=Math.floor(i),e.applyCurrentZoomPan()}})}_panOrMoveMainScroll(t){const{p1:i,dragAxis:e,prevP1:s,isMultitouch:n}=this.gestures,{currSlide:o,mainScroll:a}=this.pswp,r=i[t]-s[t],h=a.x+r;if(!r||!o)return!1;if("x"===t&&!o.isPannable()&&!n)return a.moveTo(h,!0),!0;const{bounds:l}=o,p=o.pan[t]+r;if(this.pswp.options.allowPanToNext&&"x"===e&&"x"===t&&!n){const i=a.getCurrSlideX(),e=a.x-i,s=r>0,n=!s;if(p>l.min[t]&&s){if(l.min[t]<=this.startPan[t])return a.moveTo(h,!0),!0;this._setPanWithFriction(t,p)}else if(p<l.max[t]&&n){if(this.startPan[t]<=l.max[t])return a.moveTo(h,!0),!0;this._setPanWithFriction(t,p)}else if(0!==e){if(e>0)return a.moveTo(Math.max(h,i),!0),!0;if(e<0)return a.moveTo(Math.min(h,i),!0),!0}else this._setPanWithFriction(t,p)}else"y"===t&&(a.isShifted()||l.min.y===l.max.y)||this._setPanWithFriction(t,p);return!1}_getVerticalDragRatio(t){return(t-(this.pswp.currSlide?.bounds.center.y??0))/(this.pswp.viewportSize.y/3)}_setPanWithFriction(t,i,e){const{currSlide:s}=this.pswp;if(!s)return;const{pan:n,bounds:o}=s;if(o.correctPan(t,i)!==i||e){const s=Math.round(i-n[t]);n[t]+=s*(e||.35)}else n[t]=i}};function k(t){return!!t.target.closest(".pswp__container")}var R=class{constructor(t){this.gestures=t}click(t,i){const e=i.target.classList,s=e.contains("pswp__img"),n=e.contains("pswp__item")||e.contains("pswp__zoom-wrap");s?this._doClickOrTapAction("imageClick",t,i):n&&this._doClickOrTapAction("bgClick",t,i)}tap(t,i){k(i)&&this._doClickOrTapAction("tap",t,i)}doubleTap(t,i){k(i)&&this._doClickOrTapAction("doubleTap",t,i)}_doClickOrTapAction(t,i,e){const{pswp:s}=this.gestures,{currSlide:n}=s,o=`${t}Action`,a=s.options[o];if(!s.dispatch(o,{point:i,originalEvent:e}).defaultPrevented)if("function"!=typeof a)switch(a){case"close":case"next":s[a]();break;case"zoom":n?.toggleZoom(i);break;case"zoom-or-close":n?.isZoomable()&&n.zoomLevels.secondary!==n.zoomLevels.initial?n.toggleZoom(i):s.options.clickToCloseNonZoomable&&s.close();break;case"toggle-controls":this.gestures.pswp.element?.classList.toggle("pswp--ui-visible")}else a.call(s,i,e)}};function H(t,i,e){return t.x=(i.x+e.x)/2,t.y=(i.y+e.y)/2,t}var N=class{constructor(t){this.gestures=t,this._startPan={x:0,y:0},this._startZoomPoint={x:0,y:0},this._zoomPoint={x:0,y:0},this._wasOverFitZoomLevel=!1,this._startZoomLevel=1}start(){const{currSlide:t}=this.gestures.pswp;t&&(this._startZoomLevel=t.currZoomLevel,l(this._startPan,t.pan)),this.gestures.pswp.animations.stopAllPan(),this._wasOverFitZoomLevel=!1}change(){const{p1:t,startP1:i,p2:e,startP2:s,pswp:n}=this.gestures,{currSlide:o}=n;if(!o)return;const a=o.zoomLevels.min,r=o.zoomLevels.max;if(!o.isZoomable()||n.mainScroll.isShifted())return;H(this._startZoomPoint,i,s),H(this._zoomPoint,t,e);let h=1/d(i,s)*d(t,e)*this._startZoomLevel;if(h>o.zoomLevels.initial+o.zoomLevels.initial/15&&(this._wasOverFitZoomLevel=!0),h<a)if(n.options.pinchToClose&&!this._wasOverFitZoomLevel&&this._startZoomLevel<=o.zoomLevels.initial){const t=1-(a-h)/(a/1.2);n.dispatch("pinchClose",{bgOpacity:t}).defaultPrevented||n.applyBgOpacity(t)}else h=a-.15*(a-h);else h>r&&(h=r+.05*(h-r));o.pan.x=this._calculatePanForZoomLevel("x",h),o.pan.y=this._calculatePanForZoomLevel("y",h),o.setZoomLevel(h),o.applyCurrentZoomPan()}end(){const{pswp:t}=this.gestures,{currSlide:i}=t;(!i||i.currZoomLevel<i.zoomLevels.initial)&&!this._wasOverFitZoomLevel&&t.options.pinchToClose?t.close():this.correctZoomPan()}_calculatePanForZoomLevel(t,i){const e=i/this._startZoomLevel;return this._zoomPoint[t]-(this._startZoomPoint[t]-this._startPan[t])*e}correctZoomPan(t){const{pswp:i}=this.gestures,{currSlide:e}=i;if(!e?.isZoomable())return;0===this._zoomPoint.x&&(t=!0);const s=e.currZoomLevel;let n,o=!0;s<e.zoomLevels.initial?n=e.zoomLevels.initial:s>e.zoomLevels.max?n=e.zoomLevels.max:(o=!1,n=s);const a=i.bgOpacity,r=i.bgOpacity<1,h=l({x:0,y:0},e.pan);let p=l({x:0,y:0},h);t&&(this._zoomPoint.x=0,this._zoomPoint.y=0,this._startZoomPoint.x=0,this._startZoomPoint.y=0,this._startZoomLevel=s,l(this._startPan,h)),o&&(p={x:this._calculatePanForZoomLevel("x",n),y:this._calculatePanForZoomLevel("y",n)}),e.setZoomLevel(n),p={x:e.bounds.correctPan("x",p.x),y:e.bounds.correctPan("y",p.y)},e.setZoomLevel(s);const d=!c(p,h);if(!d&&!o&&!r)return e._setResolution(n),void e.applyCurrentZoomPan();i.animations.stopAllPan(),i.animations.startSpring({isPan:!0,start:0,end:1e3,velocity:0,dampingRatio:1,naturalFrequency:40,onUpdate:t=>{if(t/=1e3,d||o){if(d&&(e.pan.x=h.x+(p.x-h.x)*t,e.pan.y=h.y+(p.y-h.y)*t),o){const i=s+(n-s)*t;e.setZoomLevel(i)}e.applyCurrentZoomPan()}r&&i.bgOpacity<1&&i.applyBgOpacity(m(a+(1-a)*t,0,1))},onComplete:()=>{e._setResolution(n),e.applyCurrentZoomPan()}})}},W=class{constructor(t){this.pswp=t,this.dragAxis=null,this.p1={x:0,y:0},this.p2={x:0,y:0},this.prevP1={x:0,y:0},this.prevP2={x:0,y:0},this.startP1={x:0,y:0},this.startP2={x:0,y:0},this.velocity={x:0,y:0},this._lastStartP1={x:0,y:0},this._intervalP1={x:0,y:0},this._numActivePoints=0,this._ongoingPointers=[],this._touchEventEnabled="ontouchstart"in window,this._pointerEventEnabled=!!window.PointerEvent,this.supportsTouch=this._touchEventEnabled||this._pointerEventEnabled&&navigator.maxTouchPoints>1,this._numActivePoints=0,this._intervalTime=0,this._velocityCalculated=!1,this.isMultitouch=!1,this.isDragging=!1,this.isZooming=!1,this.raf=null,this._tapTimer=null,this.supportsTouch||(t.options.allowPanToNext=!1),this.drag=new B(this),this.zoomLevels=new N(this),this.tapHandler=new R(this),t.on("bindEvents",()=>{t.events.add(t.scrollWrap,"click",this._onClick.bind(this)),this._pointerEventEnabled?this._bindEvents("pointer","down","up","cancel"):this._touchEventEnabled?(this._bindEvents("touch","start","end","cancel"),t.scrollWrap&&(t.scrollWrap.ontouchmove=()=>{},t.scrollWrap.ontouchend=()=>{})):this._bindEvents("mouse","down","up")})}_bindEvents(t,i,e,s){const{pswp:n}=this,{events:o}=n,a=s?t+s:"";o.add(n.scrollWrap,t+i,this.onPointerDown.bind(this)),o.add(window,`${t}move`,this.onPointerMove.bind(this)),o.add(window,t+e,this.onPointerUp.bind(this)),a&&o.add(n.scrollWrap,a,this.onPointerUp.bind(this))}onPointerDown(t){const i="mousedown"===t.type||"mouse"===t.pointerType;if(i&&t.button>0)return;const{pswp:e}=this;e.opener.isOpen?e.dispatch("pointerDown",{originalEvent:t}).defaultPrevented||(i&&(e.mouseDetected(),this._preventPointerEventBehaviour(t,"down")),e.animations.stopAll(),this._updatePoints(t,"down"),1===this._numActivePoints&&(this.dragAxis=null,l(this.startP1,this.p1)),this._numActivePoints>1?(this._clearTapTimer(),this.isMultitouch=!0):this.isMultitouch=!1):t.preventDefault()}onPointerMove(t){this._preventPointerEventBehaviour(t,"move"),this._numActivePoints&&(this._updatePoints(t,"move"),this.pswp.dispatch("pointerMove",{originalEvent:t}).defaultPrevented||(1!==this._numActivePoints||this.isDragging?this._numActivePoints>1&&!this.isZooming&&(this._finishDrag(),this.isZooming=!0,this._updateStartPoints(),this.zoomLevels.start(),this._rafStopLoop(),this._rafRenderLoop()):(this.dragAxis||this._calculateDragDirection(),this.dragAxis&&!this.isDragging&&(this.isZooming&&(this.isZooming=!1,this.zoomLevels.end()),this.isDragging=!0,this._clearTapTimer(),this._updateStartPoints(),this._intervalTime=Date.now(),this._velocityCalculated=!1,l(this._intervalP1,this.p1),this.velocity.x=0,this.velocity.y=0,this.drag.start(),this._rafStopLoop(),this._rafRenderLoop()))))}_finishDrag(){this.isDragging&&(this.isDragging=!1,this._velocityCalculated||this._updateVelocity(!0),this.drag.end(),this.dragAxis=null)}onPointerUp(t){this._numActivePoints&&(this._updatePoints(t,"up"),this.pswp.dispatch("pointerUp",{originalEvent:t}).defaultPrevented||(0===this._numActivePoints&&(this._rafStopLoop(),this.isDragging?this._finishDrag():this.isZooming||this.isMultitouch||this._finishTap(t)),this._numActivePoints<2&&this.isZooming&&(this.isZooming=!1,this.zoomLevels.end(),1===this._numActivePoints&&(this.dragAxis=null,this._updateStartPoints()))))}_rafRenderLoop(){(this.isDragging||this.isZooming)&&(this._updateVelocity(),this.isDragging?c(this.p1,this.prevP1)||this.drag.change():c(this.p1,this.prevP1)&&c(this.p2,this.prevP2)||this.zoomLevels.change(),this._updatePrevPoints(),this.raf=requestAnimationFrame(this._rafRenderLoop.bind(this)))}_updateVelocity(t){const i=Date.now(),e=i-this._intervalTime;e<50&&!t||(this.velocity.x=this._getVelocity("x",e),this.velocity.y=this._getVelocity("y",e),this._intervalTime=i,l(this._intervalP1,this.p1),this._velocityCalculated=!0)}_finishTap(t){const{mainScroll:i}=this.pswp;if(i.isShifted())return void i.moveIndexBy(0,!0);if(t.type.indexOf("cancel")>0)return;if("mouseup"===t.type||"mouse"===t.pointerType)return void this.tapHandler.click(this.startP1,t);const e=this.pswp.options.doubleTapAction?300:0;this._tapTimer?(this._clearTapTimer(),d(this._lastStartP1,this.startP1)<25&&this.tapHandler.doubleTap(this.startP1,t)):(l(this._lastStartP1,this.startP1),this._tapTimer=setTimeout(()=>{this.tapHandler.tap(this.startP1,t),this._clearTapTimer()},e))}_clearTapTimer(){this._tapTimer&&(clearTimeout(this._tapTimer),this._tapTimer=null)}_getVelocity(t,i){const e=this.p1[t]-this._intervalP1[t];return Math.abs(e)>1&&i>5?e/i:0}_rafStopLoop(){this.raf&&(cancelAnimationFrame(this.raf),this.raf=null)}_preventPointerEventBehaviour(t,i){this.pswp.applyFilters("preventPointerEvent",!0,t,i)&&t.preventDefault()}_updatePoints(t,i){if(this._pointerEventEnabled){const e=t,s=this._ongoingPointers.findIndex(t=>t.id===e.pointerId);"up"===i&&s>-1?this._ongoingPointers.splice(s,1):"down"===i&&-1===s?this._ongoingPointers.push(this._convertEventPosToPoint(e,{x:0,y:0})):s>-1&&this._convertEventPosToPoint(e,this._ongoingPointers[s]),this._numActivePoints=this._ongoingPointers.length,this._numActivePoints>0&&l(this.p1,this._ongoingPointers[0]),this._numActivePoints>1&&l(this.p2,this._ongoingPointers[1])}else{const e=t;this._numActivePoints=0,e.type.indexOf("touch")>-1?e.touches&&e.touches.length>0&&(this._convertEventPosToPoint(e.touches[0],this.p1),this._numActivePoints++,e.touches.length>1&&(this._convertEventPosToPoint(e.touches[1],this.p2),this._numActivePoints++)):(this._convertEventPosToPoint(t,this.p1),"up"===i?this._numActivePoints=0:this._numActivePoints++)}}_updatePrevPoints(){l(this.prevP1,this.p1),l(this.prevP2,this.p2)}_updateStartPoints(){l(this.startP1,this.p1),l(this.startP2,this.p2),this._updatePrevPoints()}_calculateDragDirection(){if(this.pswp.mainScroll.isShifted())this.dragAxis="x";else{const t=Math.abs(this.p1.x-this.startP1.x)-Math.abs(this.p1.y-this.startP1.y);if(0!==t){const i=t>0?"x":"y";Math.abs(this.p1[i]-this.startP1[i])>=10&&(this.dragAxis=i)}}}_convertEventPosToPoint(t,i){return i.x=t.pageX-this.pswp.offset.x,i.y=t.pageY-this.pswp.offset.y,"pointerId"in t?i.id=t.pointerId:void 0!==t.identifier&&(i.id=t.identifier),i}_onClick(t){this.pswp.mainScroll.isShifted()&&(t.preventDefault(),t.stopPropagation())}},V=class{constructor(t){this.slide=t,this.currZoomLevel=1,this.center={x:0,y:0},this.max={x:0,y:0},this.min={x:0,y:0}}update(t){this.currZoomLevel=t,this.slide.width?(this._updateAxis("x"),this._updateAxis("y"),this.slide.pswp.dispatch("calcBounds",{slide:this.slide})):this.reset()}_updateAxis(t){const{pswp:i}=this.slide,e=this.slide["x"===t?"width":"height"]*this.currZoomLevel,s=z("x"===t?"left":"top",i.options,i.viewportSize,this.slide.data,this.slide.index),n=this.slide.panAreaSize[t];this.center[t]=Math.round((n-e)/2)+s,this.max[t]=e>n?Math.round(n-e)+s:this.center[t],this.min[t]=e>n?s:this.center[t]}reset(){this.center.x=0,this.center.y=0,this.max.x=0,this.max.y=0,this.min.x=0,this.min.y=0}correctPan(t,i){return m(i,this.max[t],this.min[t])}},q=class{constructor(t,i,e){this.data=t,this.index=i,this.pswp=e,this.isActive=i===e.currIndex,this.currentResolution=0,this.panAreaSize={x:0,y:0},this.pan={x:0,y:0},this.isFirstSlide=this.isActive&&!e.opener.isOpen,this.zoomLevels=new A(e.options,t,i,e),this.pswp.dispatch("gettingData",{slide:this,data:this.data,index:i}),this.content=this.pswp.contentLoader.getContentBySlide(this),this.container=h("pswp__zoom-wrap","div"),this.holderElement=null,this.currZoomLevel=1,this.width=this.content.width,this.height=this.content.height,this.heavyAppended=!1,this.bounds=new V(this),this.prevDisplayedWidth=-1,this.prevDisplayedHeight=-1,this.pswp.dispatch("slideInit",{slide:this})}setIsActive(t){t&&!this.isActive?this.activate():!t&&this.isActive&&this.deactivate()}append(t){this.holderElement=t,this.container.style.transformOrigin="0 0",this.data&&(this.calculateSize(),this.load(),this.updateContentSize(),this.appendHeavy(),this.holderElement.appendChild(this.container),this.zoomAndPanToInitial(),this.pswp.dispatch("firstZoomPan",{slide:this}),this.applyCurrentZoomPan(),this.pswp.dispatch("afterSetContent",{slide:this}),this.isActive&&this.activate())}load(){this.content.load(!1),this.pswp.dispatch("slideLoad",{slide:this})}appendHeavy(){const{pswp:t}=this;!this.heavyAppended&&t.opener.isOpen&&!t.mainScroll.isShifted()&&(this.isActive,1)&&(this.pswp.dispatch("appendHeavy",{slide:this}).defaultPrevented||(this.heavyAppended=!0,this.content.append(),this.pswp.dispatch("appendHeavyContent",{slide:this})))}activate(){this.isActive=!0,this.appendHeavy(),this.content.activate(),this.pswp.dispatch("slideActivate",{slide:this})}deactivate(){this.isActive=!1,this.content.deactivate(),this.currZoomLevel!==this.zoomLevels.initial&&this.calculateSize(),this.currentResolution=0,this.zoomAndPanToInitial(),this.applyCurrentZoomPan(),this.updateContentSize(),this.pswp.dispatch("slideDeactivate",{slide:this})}destroy(){this.content.hasSlide=!1,this.content.remove(),this.container.remove(),this.pswp.dispatch("slideDestroy",{slide:this})}resize(){this.currZoomLevel!==this.zoomLevels.initial&&this.isActive?(this.calculateSize(),this.bounds.update(this.currZoomLevel),this.panTo(this.pan.x,this.pan.y)):(this.calculateSize(),this.currentResolution=0,this.zoomAndPanToInitial(),this.applyCurrentZoomPan(),this.updateContentSize())}updateContentSize(t){const i=this.currentResolution||this.zoomLevels.initial;if(!i)return;const e=Math.round(this.width*i)||this.pswp.viewportSize.x,s=Math.round(this.height*i)||this.pswp.viewportSize.y;(this.sizeChanged(e,s)||t)&&this.content.setDisplayedSize(e,s)}sizeChanged(t,i){return(t!==this.prevDisplayedWidth||i!==this.prevDisplayedHeight)&&(this.prevDisplayedWidth=t,this.prevDisplayedHeight=i,!0)}getPlaceholderElement(){return this.content.placeholder?.element}zoomTo(t,i,e,s){const{pswp:n}=this;if(!this.isZoomable()||n.mainScroll.isShifted())return;n.dispatch("beforeZoomTo",{destZoomLevel:t,centerPoint:i,transitionDuration:e}),n.animations.stopAllPan();const o=this.currZoomLevel;s||(t=m(t,this.zoomLevels.min,this.zoomLevels.max)),this.setZoomLevel(t),this.pan.x=this.calculateZoomToPanOffset("x",i,o),this.pan.y=this.calculateZoomToPanOffset("y",i,o),p(this.pan);const a=()=>{this._setResolution(t),this.applyCurrentZoomPan()};e?n.animations.startTransition({isPan:!0,name:"zoomTo",target:this.container,transform:this.getCurrentTransform(),onComplete:a,duration:e,easing:n.options.easing}):a()}toggleZoom(t){this.zoomTo(this.currZoomLevel===this.zoomLevels.initial?this.zoomLevels.secondary:this.zoomLevels.initial,t,this.pswp.options.zoomAnimationDuration)}setZoomLevel(t){this.currZoomLevel=t,this.bounds.update(this.currZoomLevel)}calculateZoomToPanOffset(t,i,e){if(this.bounds.max[t]-this.bounds.min[t]===0)return this.bounds.center[t];i||(i=this.pswp.getViewportCenterPoint()),e||(e=this.zoomLevels.initial);const s=this.currZoomLevel/e;return this.bounds.correctPan(t,(this.pan[t]-i[t])*s+i[t])}panTo(t,i){this.pan.x=this.bounds.correctPan("x",t),this.pan.y=this.bounds.correctPan("y",i),this.applyCurrentZoomPan()}isPannable(){return Boolean(this.width)&&this.currZoomLevel>this.zoomLevels.fit}isZoomable(){return Boolean(this.width)&&this.content.isZoomable()}applyCurrentZoomPan(){this._applyZoomTransform(this.pan.x,this.pan.y,this.currZoomLevel),this===this.pswp.currSlide&&this.pswp.dispatch("zoomPanUpdate",{slide:this})}zoomAndPanToInitial(){this.currZoomLevel=this.zoomLevels.initial,this.bounds.update(this.currZoomLevel),l(this.pan,this.bounds.center),this.pswp.dispatch("initialZoomPan",{slide:this})}_applyZoomTransform(t,i,e){e/=this.currentResolution||this.zoomLevels.initial,_(this.container,t,i,e)}calculateSize(){const{pswp:t}=this;l(this.panAreaSize,I(t.options,t.viewportSize,this.data,this.index)),this.zoomLevels.update(this.width,this.height,this.panAreaSize),t.dispatch("calcSlideSize",{slide:this})}getCurrentTransform(){const t=this.currZoomLevel/(this.currentResolution||this.zoomLevels.initial);return u(this.pan.x,this.pan.y,t)}_setResolution(t){t!==this.currentResolution&&(this.currentResolution=t,this.updateContentSize(),this.pswp.dispatch("resolutionChanged"))}};function $(t,i,e){t.classList.add("pswp__button--arrow"),t.setAttribute("aria-controls","pswp__items"),i.on("change",()=>{i.options.loop||(t.disabled=e?!(i.currIndex<i.getNumItems()-1):!(i.currIndex>0))})}var U={name:"arrowPrev",className:"pswp__button--arrow--prev",title:"Previous",order:10,isButton:!0,appendTo:"wrapper",html:{isCustomSVG:!0,size:60,inner:'<path d="M29 43l-3 3-16-16 16-16 3 3-13 13 13 13z" id="pswp__icn-arrow"/>',outlineID:"pswp__icn-arrow"},onClick:"prev",onInit:$},G={name:"arrowNext",className:"pswp__button--arrow--next",title:"Next",order:11,isButton:!0,appendTo:"wrapper",html:{isCustomSVG:!0,size:60,inner:'<use xlink:href="#pswp__icn-arrow"/>',outlineID:"pswp__icn-arrow"},onClick:"next",onInit:(t,i)=>{$(t,i,!0)}},j={name:"close",title:"Close",order:20,isButton:!0,html:{isCustomSVG:!0,inner:'<path d="M24 10l-2-2-6 6-6-6-2 2 6 6-6 6 2 2 6-6 6 6 2-2-6-6z" id="pswp__icn-close"/>',outlineID:"pswp__icn-close"},onClick:"close"},K={name:"zoom",title:"Zoom",order:10,isButton:!0,html:{isCustomSVG:!0,inner:'<path d="M17.426 19.926a6 6 0 1 1 1.5-1.5L23 22.5 21.5 24l-4.074-4.074z" id="pswp__icn-zoom"/><path fill="currentColor" class="pswp__zoom-icn-bar-h" d="M11 16v-2h6v2z"/><path fill="currentColor" class="pswp__zoom-icn-bar-v" d="M13 12h2v6h-2z"/>',outlineID:"pswp__icn-zoom"},onClick:"toggleZoom"},X={name:"counter",order:5,onInit:(t,i)=>{i.on("change",()=>{t.innerText=i.currIndex+1+i.options.indexIndicatorSep+i.getNumItems()})}},Y={name:"preloader",appendTo:"bar",order:7,html:{isCustomSVG:!0,inner:'<path fill-rule="evenodd" clip-rule="evenodd" d="M21.2 16a5.2 5.2 0 1 1-5.2-5.2V8a8 8 0 1 0 8 8h-2.8Z" id="pswp__icn-loading"/>',outlineID:"pswp__icn-loading"},onInit:(t,i)=>{let e,s=null;const n=i=>{var s;e!==i&&(e=i,s=i,t.classList.toggle("pswp__preloader--active",s))},o=()=>{if(!i.currSlide?.content.isLoading())return n(!1),void(s&&(clearTimeout(s),s=null));s||(s=setTimeout(()=>{n(Boolean(i.currSlide?.content.isLoading())),s=null},i.options.preloaderDelay))};i.on("change",o),i.on("loadComplete",t=>{i.currSlide===t.slide&&o()}),i.ui&&(i.ui.updatePreloaderVisibility=o)}},J=class{constructor(t,i){const e=i.name||i.className;let s=i.html;if(!1===t.options[e])return;"string"==typeof t.options[`${e}SVG`]&&(s=t.options[`${e}SVG`]),t.dispatch("uiElementCreate",{data:i});let n="";i.isButton?(n+="pswp__button ",n+=i.className||`pswp__button--${i.name}`):n+=i.className||`pswp__${i.name}`;let o=i.isButton?i.tagName||"button":i.tagName||"div";o=o.toLowerCase();const a=h(n,o);if(i.isButton){"button"===o&&(a.type="button");let{title:s}=i;const{ariaLabel:n}=i;"string"==typeof t.options[`${e}Title`]&&(s=t.options[`${e}Title`]),s&&(a.title=s);const r=n||s;r&&a.setAttribute("aria-label",r)}a.innerHTML=function(t){if("string"==typeof t)return t;if(!t||!t.isCustomSVG)return"";const i=t;let e='<svg aria-hidden="true" class="pswp__icn" viewBox="0 0 %d %d" width="%d" height="%d">';return e=e.split("%d").join(i.size||32),i.outlineID&&(e+=`<use class="pswp__icn-shadow" xlink:href="#${i.outlineID}"/>`),e+=i.inner,e+="</svg>",e}(s),i.onInit&&i.onInit(a,t),i.onClick&&(a.onclick=e=>{"string"==typeof i.onClick?t[i.onClick]():"function"==typeof i.onClick&&i.onClick(e,a,t)});const r=i.appendTo||"bar";let l=t.element;"bar"===r?(t.topBar||(t.topBar=h("pswp__top-bar pswp__hide-on-close","div",t.scrollWrap)),l=t.topBar):(a.classList.add("pswp__hide-on-close"),"wrapper"===r&&(l=t.scrollWrap)),l?.appendChild(t.applyFilters("uiElement",a,i))}};function Q(t,i){t.classList.toggle("pswp--zoomed-in",i)}var tt=class{constructor(t){this.pswp=t,this.isRegistered=!1,this.uiElementsData=[],this.items=[],this.updatePreloaderVisibility=()=>{},this._lastUpdatedZoomLevel=void 0}init(){const{pswp:t}=this;this.isRegistered=!1,this.uiElementsData=[j,U,G,K,Y,X],t.dispatch("uiRegister"),this.uiElementsData.sort((t,i)=>(t.order||0)-(i.order||0)),this.items=[],this.isRegistered=!0,this.uiElementsData.forEach(t=>{this.registerElement(t)}),t.on("change",()=>{t.element?.classList.toggle("pswp--one-slide",1===t.getNumItems())}),t.on("zoomPanUpdate",()=>this._onZoomPanUpdate())}registerElement(t){this.isRegistered?this.items.push(new J(this.pswp,t)):this.uiElementsData.push(t)}_onZoomPanUpdate(){const{template:t,currSlide:i,options:e}=this.pswp;if(this.pswp.opener.isClosing||!t||!i)return;let{currZoomLevel:s}=i;if(this.pswp.opener.isOpen||(s=i.zoomLevels.initial),s===this._lastUpdatedZoomLevel)return;this._lastUpdatedZoomLevel=s;const n=i.zoomLevels.initial-i.zoomLevels.secondary;if(Math.abs(n)<.01||!i.isZoomable())return Q(t,!1),void t.classList.remove("pswp--zoom-allowed");t.classList.add("pswp--zoom-allowed"),Q(t,(s===i.zoomLevels.initial?i.zoomLevels.secondary:i.zoomLevels.initial)<=s),"zoom"!==e.imageClickAction&&"zoom-or-close"!==e.imageClickAction||t.classList.add("pswp--click-to-zoom")}},it="cubic-bezier(.4,0,.22,1)",et=class{constructor(t){this.props=t;const{target:i,onComplete:e,transform:s,onFinish:n=()=>{},duration:o=333,easing:a=it}=t;this.onFinish=n;const r=s?"transform":"opacity",h=t[r]??"";this._target=i,this._onComplete=e,this._finished=!1,this._onTransitionEnd=this._onTransitionEnd.bind(this),this._helperTimeout=setTimeout(()=>{g(i,r,o,a),this._helperTimeout=setTimeout(()=>{i.addEventListener("transitionend",this._onTransitionEnd,!1),i.addEventListener("transitioncancel",this._onTransitionEnd,!1),this._helperTimeout=setTimeout(()=>{this._finalizeAnimation()},o+500),i.style[r]=h},30)},0)}_onTransitionEnd(t){t.target===this._target&&this._finalizeAnimation()}_finalizeAnimation(){this._finished||(this._finished=!0,this.onFinish(),this._onComplete&&this._onComplete())}destroy(){this._helperTimeout&&(clearTimeout(this._helperTimeout),this._helperTimeout=null),g(this._target),this._target.removeEventListener("transitionend",this._onTransitionEnd,!1),this._target.removeEventListener("transitioncancel",this._onTransitionEnd,!1),this._finished||this._finalizeAnimation()}},st=class{constructor(t,i,e){this.velocity=1e3*t,this._dampingRatio=i||.75,this._naturalFrequency=e||12,this._dampedFrequency=this._naturalFrequency,this._dampingRatio<1&&(this._dampedFrequency*=Math.sqrt(1-this._dampingRatio*this._dampingRatio))}easeFrame(t,i){let e,s=0;i/=1e3;const n=Math.E**(-this._dampingRatio*this._naturalFrequency*i);if(1===this._dampingRatio)e=this.velocity+this._naturalFrequency*t,s=(t+e*i)*n,this.velocity=s*-this._naturalFrequency+e*n;else if(this._dampingRatio<1){e=1/this._dampedFrequency*(this._dampingRatio*this._naturalFrequency*t+this.velocity);const o=Math.cos(this._dampedFrequency*i),a=Math.sin(this._dampedFrequency*i);s=n*(t*o+e*a),this.velocity=s*-this._naturalFrequency*this._dampingRatio+n*(-this._dampedFrequency*t*a+this._dampedFrequency*e*o)}return s}},nt=class{constructor(t){this.props=t,this._raf=0;const{start:i,end:e,velocity:s,onUpdate:n,onComplete:o,onFinish:a=()=>{},dampingRatio:r,naturalFrequency:h}=t;this.onFinish=a;const l=new st(s,r,h);let p=Date.now(),d=i-e;const c=()=>{this._raf&&(d=l.easeFrame(d,Date.now()-p),Math.abs(d)<1&&Math.abs(l.velocity)<50?(n(e),o&&o(),this.onFinish()):(p=Date.now(),n(d+e),this._raf=requestAnimationFrame(c)))};this._raf=requestAnimationFrame(c)}destroy(){this._raf>=0&&cancelAnimationFrame(this._raf),this._raf=0}},ot=class{constructor(){this.activeAnimations=[]}startSpring(t){this._start(t,!0)}startTransition(t){this._start(t)}_start(t,i){const e=i?new nt(t):new et(t);return this.activeAnimations.push(e),e.onFinish=()=>this.stop(e),e}stop(t){t.destroy();const i=this.activeAnimations.indexOf(t);i>-1&&this.activeAnimations.splice(i,1)}stopAll(){this.activeAnimations.forEach(t=>{t.destroy()}),this.activeAnimations=[]}stopAllPan(){this.activeAnimations=this.activeAnimations.filter(t=>!t.props.isPan||(t.destroy(),!1))}stopMainScroll(){this.activeAnimations=this.activeAnimations.filter(t=>!t.props.isMainScroll||(t.destroy(),!1))}isPanRunning(){return this.activeAnimations.some(t=>t.props.isPan)}},at=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:()=>{at=!0}}))}catch(yt){}var rt=class{constructor(){this._pool=[]}add(t,i,e,s){this._toggleListener(t,i,e,s)}remove(t,i,e,s){this._toggleListener(t,i,e,s,!0)}removeAll(){this._pool.forEach(t=>{this._toggleListener(t.target,t.type,t.listener,t.passive,!0,!0)}),this._pool=[]}_toggleListener(t,i,e,s,n,o){if(!t)return;const a=n?"removeEventListener":"addEventListener";i.split(" ").forEach(i=>{if(i){o||(n?this._pool=this._pool.filter(s=>s.type!==i||s.listener!==e||s.target!==t):this._pool.push({target:t,type:i,listener:e,passive:s}));const r=!!at&&{passive:s||!1};t[a](i,e,r)}})}},ht={Escape:27,z:90,ArrowLeft:37,ArrowUp:38,ArrowRight:39,ArrowDown:40,Tab:9},lt=(t,i)=>i?t:ht[t],pt=class{constructor(t){this.pswp=t,this._wasFocused=!1,t.on("bindEvents",()=>{t.options.trapFocus&&(t.options.initialPointerPos||this._focusRoot(),t.events.add(document,"focusin",this._onFocusIn.bind(this))),t.events.add(document,"keydown",this._onKeyDown.bind(this))});const i=document.activeElement;t.on("destroy",()=>{t.options.returnFocus&&i&&this._wasFocused&&i.focus()})}_focusRoot(){!this._wasFocused&&this.pswp.element&&(this.pswp.element.focus(),this._wasFocused=!0)}_onKeyDown(t){const{pswp:i}=this;if(i.dispatch("keydown",{originalEvent:t}).defaultPrevented)return;if(x(t))return;let e,s,n=!1;const o="key"in t;switch(o?t.key:t.keyCode){case lt("Escape",o):i.options.escKey&&(e="close");break;case lt("z",o):e="toggleZoom";break;case lt("ArrowLeft",o):s="x";break;case lt("ArrowUp",o):s="y";break;case lt("ArrowRight",o):s="x",n=!0;break;case lt("ArrowDown",o):n=!0,s="y";break;case lt("Tab",o):this._focusRoot()}if(s){t.preventDefault();const{currSlide:o}=i;i.options.arrowKeys&&"x"===s&&i.getNumItems()>1?e=n?"next":"prev":o&&o.currZoomLevel>o.zoomLevels.fit&&(o.pan[s]+=n?-80:80,o.panTo(o.pan.x,o.pan.y))}e&&(t.preventDefault(),i[e]())}_onFocusIn(t){const{template:i}=this.pswp;i&&document!==t.target&&i!==t.target&&!i.contains(t.target)&&i.focus()}},dt=class{constructor(t){this.pswp=t,this.x=0,this.slideWidth=0,this._currPositionIndex=0,this._prevPositionIndex=0,this._containerShiftIndex=-1,this.itemHolders=[]}resize(t){const{pswp:i}=this,e=Math.round(i.viewportSize.x+i.viewportSize.x*i.options.spacing),s=e!==this.slideWidth;s&&(this.slideWidth=e,this.moveTo(this.getCurrSlideX())),this.itemHolders.forEach((i,e)=>{s&&_(i.el,(e+this._containerShiftIndex)*this.slideWidth),t&&i.slide&&i.slide.resize()})}resetPosition(){this._currPositionIndex=0,this._prevPositionIndex=0,this.slideWidth=0,this._containerShiftIndex=-1}appendHolders(){this.itemHolders=[];for(let t=0;t<3;t++){const i=h("pswp__item","div",this.pswp.container);i.setAttribute("role","group"),i.setAttribute("aria-roledescription","slide"),i.setAttribute("aria-hidden","true"),i.style.display=1===t?"block":"none",this.itemHolders.push({el:i})}}canBeSwiped(){return this.pswp.getNumItems()>1}moveIndexBy(t,i,e){const{pswp:s}=this;let n=s.potentialIndex+t;const o=s.getNumItems();if(s.canLoop()){n=s.getLoopedIndex(n);const i=(t+o)%o;t=i<=o/2?i:i-o}else n<0?n=0:n>=o&&(n=o-1),t=n-s.potentialIndex;s.potentialIndex=n,this._currPositionIndex-=t,s.animations.stopMainScroll();const a=this.getCurrSlideX();if(i){s.animations.startSpring({isMainScroll:!0,start:this.x,end:a,velocity:e||0,naturalFrequency:30,dampingRatio:1,onUpdate:t=>{this.moveTo(t)},onComplete:()=>{this.updateCurrItem(),s.appendHeavy()}});let t=s.potentialIndex-s.currIndex;if(s.canLoop()){const i=(t+o)%o;t=i<=o/2?i:i-o}Math.abs(t)>1&&this.updateCurrItem()}else this.moveTo(a),this.updateCurrItem();return Boolean(t)}getCurrSlideX(){return this.slideWidth*this._currPositionIndex}isShifted(){return this.x!==this.getCurrSlideX()}updateCurrItem(){const{pswp:t}=this,i=this._prevPositionIndex-this._currPositionIndex;if(!i)return;this._prevPositionIndex=this._currPositionIndex,t.currIndex=t.potentialIndex;let e,s=Math.abs(i);s>=3&&(this._containerShiftIndex+=i+(i>0?-3:3),s=3,this.itemHolders.forEach(t=>{t.slide?.destroy(),t.slide=void 0}));for(let n=0;n<s;n++)i>0?(e=this.itemHolders.shift(),e&&(this.itemHolders[2]=e,this._containerShiftIndex++,_(e.el,(this._containerShiftIndex+2)*this.slideWidth),t.setContent(e,t.currIndex-s+n+2))):(e=this.itemHolders.pop(),e&&(this.itemHolders.unshift(e),this._containerShiftIndex--,_(e.el,this._containerShiftIndex*this.slideWidth),t.setContent(e,t.currIndex+s-n-2)));Math.abs(this._containerShiftIndex)>50&&!this.isShifted()&&(this.resetPosition(),this.resize()),t.animations.stopAllPan(),this.itemHolders.forEach((t,i)=>{t.slide&&t.slide.setIsActive(1===i)}),t.currSlide=this.itemHolders[1]?.slide,t.contentLoader.updateLazy(i),t.currSlide&&t.currSlide.applyCurrentZoomPan(),t.dispatch("change")}moveTo(t,i){if(!this.pswp.canLoop()&&i){let i=(this.slideWidth*this._currPositionIndex-t)/this.slideWidth;i+=this.pswp.currIndex;const e=Math.round(t-this.x);(i<0&&e>0||i>=this.pswp.getNumItems()-1&&e<0)&&(t=this.x+.35*e)}this.x=t,this.pswp.container&&_(this.pswp.container,t),this.pswp.dispatch("moveMainScroll",{x:t,dragging:i??!1})}},ct=.003,mt=class{constructor(t){this.pswp=t,this.isClosed=!0,this.isOpen=!1,this.isClosing=!1,this.isOpening=!1,this._duration=void 0,this._useAnimation=!1,this._croppedZoom=!1,this._animateRootOpacity=!1,this._animateBgOpacity=!1,this._placeholder=void 0,this._opacityElement=void 0,this._cropContainer1=void 0,this._cropContainer2=void 0,this._thumbBounds=void 0,this._prepareOpen=this._prepareOpen.bind(this),t.on("firstZoomPan",this._prepareOpen)}open(){this._prepareOpen(),this._start()}close(){if(this.isClosed||this.isClosing||this.isOpening)return;const t=this.pswp.currSlide;this.isOpen=!1,this.isOpening=!1,this.isClosing=!0,this._duration=this.pswp.options.hideAnimationDuration,t&&t.currZoomLevel*t.width>=this.pswp.options.maxWidthToAnimate&&(this._duration=0),this._applyStartProps(),setTimeout(()=>{this._start()},this._croppedZoom?30:0)}_prepareOpen(){if(this.pswp.off("firstZoomPan",this._prepareOpen),!this.isOpening){const t=this.pswp.currSlide;this.isOpening=!0,this.isClosing=!1,this._duration=this.pswp.options.showAnimationDuration,t&&t.zoomLevels.initial*t.width>=this.pswp.options.maxWidthToAnimate&&(this._duration=0),this._applyStartProps()}}_applyStartProps(){const{pswp:t}=this,i=this.pswp.currSlide,{options:e}=t;if("fade"===e.showHideAnimationType?(e.showHideOpacity=!0,this._thumbBounds=void 0):"none"===e.showHideAnimationType?(e.showHideOpacity=!1,this._duration=0,this._thumbBounds=void 0):this.isOpening&&t._initialThumbBounds?this._thumbBounds=t._initialThumbBounds:this._thumbBounds=this.pswp.getThumbBounds(),this._placeholder=i?.getPlaceholderElement(),t.animations.stopAll(),this._useAnimation=Boolean(this._duration&&this._duration>50),this._animateZoom=Boolean(this._thumbBounds)&&i?.content.usePlaceholder()&&(!this.isClosing||!t.mainScroll.isShifted()),this._animateZoom?this._animateRootOpacity=e.showHideOpacity??!1:(this._animateRootOpacity=!0,this.isOpening&&i&&(i.zoomAndPanToInitial(),i.applyCurrentZoomPan())),this._animateBgOpacity=!this._animateRootOpacity&&this.pswp.options.bgOpacity>ct,this._opacityElement=this._animateRootOpacity?t.element:t.bg,!this._useAnimation)return this._duration=0,this._animateZoom=!1,this._animateBgOpacity=!1,this._animateRootOpacity=!0,void(this.isOpening&&(t.element&&(t.element.style.opacity=String(ct)),t.applyBgOpacity(1)));this._animateZoom&&this._thumbBounds&&this._thumbBounds.innerRect?(this._croppedZoom=!0,this._cropContainer1=this.pswp.container,this._cropContainer2=this.pswp.currSlide?.holderElement,t.container&&(t.container.style.overflow="hidden",t.container.style.width=`${t.viewportSize.x}px`)):this._croppedZoom=!1,this.isOpening?(this._animateRootOpacity?(t.element&&(t.element.style.opacity=String(ct)),t.applyBgOpacity(1)):(this._animateBgOpacity&&t.bg&&(t.bg.style.opacity=String(ct)),t.element&&(t.element.style.opacity="1")),this._animateZoom&&(this._setClosedStateZoomPan(),this._placeholder&&(this._placeholder.style.willChange="transform",this._placeholder.style.opacity=String(ct)))):this.isClosing&&(t.mainScroll.itemHolders[0]&&(t.mainScroll.itemHolders[0].el.style.display="none"),t.mainScroll.itemHolders[2]&&(t.mainScroll.itemHolders[2].el.style.display="none"),this._croppedZoom&&0!==t.mainScroll.x&&(t.mainScroll.resetPosition(),t.mainScroll.resize()))}_start(){this.isOpening&&this._useAnimation&&this._placeholder&&"IMG"===this._placeholder.tagName?new Promise(t=>{let i=!1,e=!0;var s;(s=this._placeholder,"decode"in s?s.decode().catch(()=>{}):s.complete?Promise.resolve(s):new Promise((t,i)=>{s.onload=()=>t(s),s.onerror=i})).finally(()=>{i=!0,e||t(!0)}),setTimeout(()=>{e=!1,i&&t(!0)},50),setTimeout(t,250)}).finally(()=>this._initiate()):this._initiate()}_initiate(){this.pswp.element?.style.setProperty("--pswp-transition-duration",`${this._duration}ms`),this.pswp.dispatch(this.isOpening?"openingAnimationStart":"closingAnimationStart"),this.pswp.dispatch("initialZoom"+(this.isOpening?"In":"Out")),this.pswp.element?.classList.toggle("pswp--ui-visible",this.isOpening),this.isOpening?(this._placeholder&&(this._placeholder.style.opacity="1"),this._animateToOpenState()):this.isClosing&&this._animateToClosedState(),this._useAnimation||this._onAnimationComplete()}_onAnimationComplete(){const{pswp:t}=this;this.isOpen=this.isOpening,this.isClosed=this.isClosing,this.isOpening=!1,this.isClosing=!1,t.dispatch(this.isOpen?"openingAnimationEnd":"closingAnimationEnd"),t.dispatch("initialZoom"+(this.isOpen?"InEnd":"OutEnd")),this.isClosed?t.destroy():this.isOpen&&(this._animateZoom&&t.container&&(t.container.style.overflow="visible",t.container.style.width="100%"),t.currSlide?.applyCurrentZoomPan())}_animateToOpenState(){const{pswp:t}=this;this._animateZoom&&(this._croppedZoom&&this._cropContainer1&&this._cropContainer2&&(this._animateTo(this._cropContainer1,"transform","translate3d(0,0,0)"),this._animateTo(this._cropContainer2,"transform","none")),t.currSlide&&(t.currSlide.zoomAndPanToInitial(),this._animateTo(t.currSlide.container,"transform",t.currSlide.getCurrentTransform()))),this._animateBgOpacity&&t.bg&&this._animateTo(t.bg,"opacity",String(t.options.bgOpacity)),this._animateRootOpacity&&t.element&&this._animateTo(t.element,"opacity","1")}_animateToClosedState(){const{pswp:t}=this;this._animateZoom&&this._setClosedStateZoomPan(!0),this._animateBgOpacity&&t.bgOpacity>.01&&t.bg&&this._animateTo(t.bg,"opacity","0"),this._animateRootOpacity&&t.element&&this._animateTo(t.element,"opacity","0")}_setClosedStateZoomPan(t){if(!this._thumbBounds)return;const{pswp:i}=this,{innerRect:e}=this._thumbBounds,{currSlide:s,viewportSize:n}=i;if(this._croppedZoom&&e&&this._cropContainer1&&this._cropContainer2){const i=-n.x+(this._thumbBounds.x-e.x)+e.w,s=-n.y+(this._thumbBounds.y-e.y)+e.h,o=n.x-e.w,a=n.y-e.h;t?(this._animateTo(this._cropContainer1,"transform",u(i,s)),this._animateTo(this._cropContainer2,"transform",u(o,a))):(_(this._cropContainer1,i,s),_(this._cropContainer2,o,a))}s&&(l(s.pan,e||this._thumbBounds),s.currZoomLevel=this._thumbBounds.w/s.width,t?this._animateTo(s.container,"transform",s.getCurrentTransform()):s.applyCurrentZoomPan())}_animateTo(t,i,e){if(!this._duration)return void(t.style[i]=e);const{animations:s}=this.pswp,n={duration:this._duration,easing:this.pswp.options.easing,onComplete:()=>{s.activeAnimations.length||this._onAnimationComplete()},target:t};n[i]=e,s.startTransition(n)}},ut=class{constructor(t){this.pswp=t,t.events.add(t.element,"wheel",this._onWheel.bind(this))}_onWheel(t){t.preventDefault();const{currSlide:i}=this.pswp;let{deltaX:e,deltaY:s}=t;if(i&&!this.pswp.dispatch("wheel",{originalEvent:t}).defaultPrevented)if(t.ctrlKey||this.pswp.options.wheelToZoom){if(i.isZoomable()){let e=-s;1===t.deltaMode?e*=.05:e*=t.deltaMode?1:.002,e=2**e;const n=i.currZoomLevel*e;i.zoomTo(n,{x:t.clientX,y:t.clientY})}}else i.isPannable()&&(1===t.deltaMode&&(e*=18,s*=18),i.panTo(i.pan.x-e,i.pan.y-s))}},_t={allowPanToNext:!0,spacing:.1,loop:!0,pinchToClose:!0,closeOnVerticalDrag:!0,hideAnimationDuration:333,showAnimationDuration:333,zoomAnimationDuration:333,escKey:!0,arrowKeys:!0,trapFocus:!0,returnFocus:!0,maxWidthToAnimate:4e3,clickToCloseNonZoomable:!0,imageClickAction:"zoom-or-close",bgClickAction:"close",tapAction:"toggle-controls",doubleTapAction:"zoom",indexIndicatorSep:" / ",preloaderDelay:2e3,bgOpacity:.8,index:0,errorMsg:"The image cannot be loaded",preload:[1,2],easing:"cubic-bezier(.4,0,.22,1)"},gt=class extends M{constructor(t){super(),this.options=this._prepareOptions(t||{}),this.offset={x:0,y:0},this._prevViewportSize={x:0,y:0},this.viewportSize={x:0,y:0},this.bgOpacity=1,this.currIndex=0,this.potentialIndex=0,this.isOpen=!1,this.isDestroying=!1,this.hasMouse=!1,this._initialItemData={},this._initialThumbBounds=void 0,this.topBar=void 0,this.element=void 0,this.template=void 0,this.container=void 0,this.scrollWrap=void 0,this.currSlide=void 0,this.events=new rt,this.animations=new ot,this.mainScroll=new dt(this),this.gestures=new W(this),this.opener=new mt(this),this.keyboard=new pt(this),this.contentLoader=new O(this)}init(){if(this.isOpen||this.isDestroying)return!1;this.isOpen=!0,this.dispatch("init"),this.dispatch("beforeOpen"),this._createMainStructure();let t="pswp--open";return this.gestures.supportsTouch&&(t+=" pswp--touch"),this.options.mainClass&&(t+=` ${this.options.mainClass}`),this.element&&(this.element.className+=` ${t}`),this.currIndex=this.options.index||0,this.potentialIndex=this.currIndex,this.dispatch("firstUpdate"),this.scrollWheel=new ut(this),(Number.isNaN(this.currIndex)||this.currIndex<0||this.currIndex>=this.getNumItems())&&(this.currIndex=0),this.gestures.supportsTouch||this.mouseDetected(),this.updateSize(),this.offset.y=window.pageYOffset,this._initialItemData=this.getItemData(this.currIndex),this.dispatch("gettingData",{index:this.currIndex,data:this._initialItemData,slide:void 0}),this._initialThumbBounds=this.getThumbBounds(),this.dispatch("initialLayout"),this.on("openingAnimationEnd",()=>{const{itemHolders:t}=this.mainScroll;t[0]&&(t[0].el.style.display="block",this.setContent(t[0],this.currIndex-1)),t[2]&&(t[2].el.style.display="block",this.setContent(t[2],this.currIndex+1)),this.appendHeavy(),this.contentLoader.updateLazy(),this.events.add(window,"resize",this._handlePageResize.bind(this)),this.events.add(window,"scroll",this._updatePageScrollOffset.bind(this)),this.dispatch("bindEvents")}),this.mainScroll.itemHolders[1]&&this.setContent(this.mainScroll.itemHolders[1],this.currIndex),this.dispatch("change"),this.opener.open(),this.dispatch("afterInit"),!0}getLoopedIndex(t){const i=this.getNumItems();return this.options.loop&&(t>i-1&&(t-=i),t<0&&(t+=i)),m(t,0,i-1)}appendHeavy(){this.mainScroll.itemHolders.forEach(t=>{t.slide?.appendHeavy()})}goTo(t){this.mainScroll.moveIndexBy(this.getLoopedIndex(t)-this.potentialIndex,!0)}next(){this.goTo(this.potentialIndex+1)}prev(){this.goTo(this.potentialIndex-1)}zoomTo(...t){this.currSlide?.zoomTo(...t)}toggleZoom(){this.currSlide?.toggleZoom()}close(){this.opener.isOpen&&!this.isDestroying&&(this.isDestroying=!0,this.dispatch("close"),this.events.removeAll(),this.opener.close())}destroy(){if(!this.isDestroying)return this.options.showHideAnimationType="none",void this.close();this.dispatch("destroy"),this._listeners={},this.scrollWrap&&(this.scrollWrap.ontouchmove=null,this.scrollWrap.ontouchend=null),this.element?.remove(),this.mainScroll.itemHolders.forEach(t=>{t.slide?.destroy()}),this.contentLoader.destroy(),this.events.removeAll()}refreshSlideContent(t){this.contentLoader.removeByIndex(t),this.mainScroll.itemHolders.forEach((i,e)=>{let s=(this.currSlide?.index??0)-1+e;this.canLoop()&&(s=this.getLoopedIndex(s)),s===t&&(this.setContent(i,t,!0),1===e&&(this.currSlide=i.slide,i.slide?.setIsActive(!0)))}),this.dispatch("change")}setContent(t,i,e){if(this.canLoop()&&(i=this.getLoopedIndex(i)),t.slide){if(t.slide.index===i&&!e)return;t.slide.destroy(),t.slide=void 0}!this.canLoop()&&(i<0||i>=this.getNumItems())||(t.slide=new q(this.getItemData(i),i,this),i===this.currIndex&&(this.currSlide=t.slide),t.slide.append(t.el))}getViewportCenterPoint(){return{x:this.viewportSize.x/2,y:this.viewportSize.y/2}}updateSize(t){if(this.isDestroying)return;const i=L(this.options,this);!t&&c(i,this._prevViewportSize)||(l(this._prevViewportSize,i),this.dispatch("beforeResize"),l(this.viewportSize,this._prevViewportSize),this._updatePageScrollOffset(),this.dispatch("viewportSize"),this.mainScroll.resize(this.opener.isOpen),!this.hasMouse&&window.matchMedia("(any-hover: hover)").matches&&this.mouseDetected(),this.dispatch("resize"))}applyBgOpacity(t){this.bgOpacity=Math.max(t,0),this.bg&&(this.bg.style.opacity=String(this.bgOpacity*this.options.bgOpacity))}mouseDetected(){this.hasMouse||(this.hasMouse=!0,this.element?.classList.add("pswp--has_mouse"))}_handlePageResize(){this.updateSize(),/iPhone|iPad|iPod/i.test(window.navigator.userAgent)&&setTimeout(()=>{this.updateSize()},500)}_updatePageScrollOffset(){this.setScrollOffset(0,window.pageYOffset)}setScrollOffset(t,i){this.offset.x=t,this.offset.y=i,this.dispatch("updateScrollOffset")}_createMainStructure(){this.element=h("pswp","div"),this.element.setAttribute("tabindex","-1"),this.element.setAttribute("role","dialog"),this.template=this.element,this.bg=h("pswp__bg","div",this.element),this.scrollWrap=h("pswp__scroll-wrap","section",this.element),this.container=h("pswp__container","div",this.scrollWrap),this.scrollWrap.setAttribute("aria-roledescription","carousel"),this.container.setAttribute("aria-live","off"),this.container.setAttribute("id","pswp__items"),this.mainScroll.appendHolders(),this.ui=new tt(this),this.ui.init(),(this.options.appendToEl||document.body).appendChild(this.element)}getThumbBounds(){return function(t,i,e){const s=e.dispatch("thumbBounds",{index:t,itemData:i,instance:e});if(s.thumbBounds)return s.thumbBounds;const{element:n}=i;let o,a;if(n&&!1!==e.options.thumbSelector){const t=e.options.thumbSelector||"img";a=n.matches(t)?n:n.querySelector(t)}return a=e.applyFilters("thumbEl",a,i,t),a&&(o=i.thumbCropped?function(t,i,e){const s=t.getBoundingClientRect(),n=s.width/i,o=s.height/e,a=n>o?n:o,r=(s.width-i*a)/2,h=(s.height-e*a)/2,l={x:s.left+r,y:s.top+h,w:i*a};return l.innerRect={w:s.width,h:s.height,x:r,y:h},l}(a,i.width||i.w||0,i.height||i.h||0):function(t){const i=t.getBoundingClientRect();return{x:i.left,y:i.top,w:i.width}}(a)),e.applyFilters("thumbBounds",o,i,t)}(this.currIndex,this.currSlide?this.currSlide.data:this._initialItemData,this)}canLoop(){return this.options.loop&&this.getNumItems()>2}_prepareOptions(t){return window.matchMedia("(prefers-reduced-motion), (update: slow)").matches&&(t.showHideAnimationType="none",t.zoomAnimationDuration=0),{..._t,...t}}},vt=()=>Promise.resolve(gt);export{F as n,r,vt as t};
|
|
1
|
+
import{p as t,t as i,w as e}from"./C3uDEVBt.js";import{m as s}from"./BItJQVdK.js";import{t as n}from"./b6CwQBFC.js";import{t as o}from"./CSO2IaJ1.js";import{t as a}from"./Bki5T_lb.js";var r=({url:r,alt:h="",thumbnailUrl:l,blurhash:p,pswpData:d={},curateLink:c,onClick:m})=>{const u=t(()=>(t=>Object.keys(t).reduce((i,e)=>{const s=t[e];return null==s||""===s||(i[`data-pswp-${n=e,n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}`]=s),i;var n},{}))(d),[d]),_=/* @__PURE__ */i(e,{children:[/* @__PURE__ */i(o,{threshold:.1,src:l||r,blurhash:p,alt:h}),d.type===s.VIDEO&&/* @__PURE__ */i("div",{className:"absolute inset-0 top-0 left-0 flex items-center justify-center opacity-75",children:/* @__PURE__ */i("svg",{xmlns:"http://www.w3.org/2000/svg",className:"w-16 text-white lg:w-24",viewBox:"0 0 24 24",children:/* @__PURE__ */i("path",{fill:"currentColor",d:"M8 17.175V6.825q0-.425.3-.713t.7-.287q.125 0 .263.037t.262.113l8.15 5.175q.225.15.338.375t.112.475t-.112.475t-.338.375l-8.15 5.175q-.125.075-.262.113T9 18.175q-.4 0-.7-.288t-.3-.712"})})})]});if(m)/* @__PURE__ */return i("button",{className:"h-full w-full",onClick:m,children:_});if(c)/* @__PURE__ */return i(n,{to:c,className:"h-full w-full",children:_});const g=r&&a(r,["http:","https:"])?r:void 0;return g?/* @__PURE__ */i("a",{href:g,className:"pswp-item block h-full w-full",...u,...l?{"data-pswp-thumbnail-url":l}:{},...p?{"data-pswp-blurhash":p}:{},target:"_blank",rel:"noreferrer",children:_}):/* @__PURE__ */i("span",{className:"pswp-item block h-full w-full",...u,...l?{"data-pswp-thumbnail-url":l}:{},...p?{"data-pswp-blurhash":p}:{},children:_})};function h(t,i,e){const s=document.createElement(i);return t&&(s.className=t),e&&e.appendChild(s),s}function l(t,i){return t.x=i.x,t.y=i.y,void 0!==i.id&&(t.id=i.id),t}function p(t){t.x=Math.round(t.x),t.y=Math.round(t.y)}function d(t,i){const e=Math.abs(t.x-i.x),s=Math.abs(t.y-i.y);return Math.sqrt(e*e+s*s)}function c(t,i){return t.x===i.x&&t.y===i.y}function m(t,i,e){return Math.min(Math.max(t,i),e)}function u(t,i,e){let s=`translate3d(${t}px,${i||0}px,0)`;return void 0!==e&&(s+=` scale3d(${e},${e},1)`),s}function _(t,i,e,s){t.style.transform=u(i,e,s)}function g(t,i,e,s){t.style.transition=i?`${i} ${e}ms ${s||"cubic-bezier(.4,0,.22,1)"}`:"none"}function v(t,i,e){t.style.width="number"==typeof i?`${i}px`:i,t.style.height="number"==typeof e?`${e}px`:e}var y="loading",w="loaded",f="error";function x(t){return"button"in t&&1===t.button||t.ctrlKey||t.metaKey||t.altKey||t.shiftKey}function P(t,i,e=document){let s=[];if(t instanceof Element)s=[t];else if(t instanceof NodeList||Array.isArray(t))s=Array.from(t);else{const n="string"==typeof t?t:i;n&&(s=Array.from(e.querySelectorAll(n)))}return s}function S(){return!(!navigator.vendor||!navigator.vendor.match(/apple/i))}var b=class{constructor(t,i){if(this.element=h("pswp__img pswp__img--placeholder",t?"img":"div",i),t){const i=this.element;i.decoding="async",i.alt="",i.src=t,i.setAttribute("role","presentation")}this.element.setAttribute("aria-hidden","true")}setDisplayedSize(t,i){this.element&&("IMG"===this.element.tagName?(v(this.element,250,"auto"),this.element.style.transformOrigin="0 0",this.element.style.transform=u(0,0,t/250)):v(this.element,t,i))}destroy(){this.element?.parentNode&&this.element.remove(),this.element=null}},C=class{constructor(t,i,e){this.instance=i,this.data=t,this.index=e,this.element=void 0,this.placeholder=void 0,this.slide=void 0,this.displayedImageWidth=0,this.displayedImageHeight=0,this.width=Number(this.data.w)||Number(this.data.width)||0,this.height=Number(this.data.h)||Number(this.data.height)||0,this.isAttached=!1,this.hasSlide=!1,this.isDecoding=!1,this.state="idle",this.data.type?this.type=this.data.type:this.data.src?this.type="image":this.type="html",this.hash=this.data.hash,this.instance.dispatch("contentInit",{content:this})}removePlaceholder(){this.placeholder&&!this.keepPlaceholder()&&setTimeout(()=>{this.placeholder&&(this.placeholder.destroy(),this.placeholder=void 0)},1e3)}load(t,i){if(this.slide&&this.usePlaceholder())if(this.placeholder){const t=this.placeholder.element;t&&!t.parentElement&&this.slide.container.prepend(t)}else{const t=this.instance.applyFilters("placeholderSrc",!(!this.data.msrc||!this.slide.isFirstSlide)&&this.data.msrc,this);this.placeholder=new b(t,this.slide.container)}this.element&&!i||this.instance.dispatch("contentLoad",{content:this,isLazy:t}).defaultPrevented||(this.isImageContent()?(this.element=h("pswp__img","img"),this.displayedImageWidth&&this.loadImage(t)):(this.element=h("pswp__content","div"),this.element.innerHTML=this.data.html||""),i&&this.slide&&this.slide.updateContentSize(!0))}loadImage(t){if(!this.isImageContent()||!this.element||this.instance.dispatch("contentLoadImage",{content:this,isLazy:t}).defaultPrevented)return;const i=this.element;this.updateSrcsetSizes(),this.data.srcset&&(i.srcset=this.data.srcset),i.src=this.data.src??"",i.alt=this.data.alt??"",this.state=y,i.complete?this.onLoaded():(i.onload=()=>{this.onLoaded()},i.onerror=()=>{this.onError()})}setSlide(t){this.slide=t,this.hasSlide=!0,this.instance=t.pswp}onLoaded(){this.state=w,this.slide&&this.element&&(this.instance.dispatch("loadComplete",{slide:this.slide,content:this}),this.slide.isActive&&this.slide.heavyAppended&&!this.element.parentNode&&(this.append(),this.slide.updateContentSize(!0)),this.state!==w&&this.state!==f||this.removePlaceholder())}onError(){this.state=f,this.slide&&(this.displayError(),this.instance.dispatch("loadComplete",{slide:this.slide,isError:!0,content:this}),this.instance.dispatch("loadError",{slide:this.slide,content:this}))}isLoading(){return this.instance.applyFilters("isContentLoading",this.state===y,this)}isError(){return this.state===f}isImageContent(){return"image"===this.type||"ad"===this.type}setDisplayedSize(t,i){if(this.element&&(this.placeholder&&this.placeholder.setDisplayedSize(t,i),!this.instance.dispatch("contentResize",{content:this,width:t,height:i}).defaultPrevented&&(v(this.element,t,i),this.isImageContent()&&!this.isError()))){const e=!this.displayedImageWidth&&t;this.displayedImageWidth=t,this.displayedImageHeight=i,e?this.loadImage(!1):this.updateSrcsetSizes(),this.slide&&this.instance.dispatch("imageSizeChange",{slide:this.slide,width:t,height:i,content:this})}}isZoomable(){return this.instance.applyFilters("isContentZoomable",this.isImageContent()&&this.state!==f,this)}updateSrcsetSizes(){if(!this.isImageContent()||!this.element||!this.data.srcset)return;const t=this.element,i=this.instance.applyFilters("srcsetSizesWidth",this.displayedImageWidth,this);(!t.dataset.largestUsedSize||i>parseInt(t.dataset.largestUsedSize,10))&&(t.sizes=`${i}px`,t.dataset.largestUsedSize=String(i))}usePlaceholder(){return this.instance.applyFilters("useContentPlaceholder",this.isImageContent(),this)}lazyLoad(){this.instance.dispatch("contentLazyLoad",{content:this}).defaultPrevented||this.load(!0)}keepPlaceholder(){return this.instance.applyFilters("isKeepingPlaceholder",this.isLoading(),this)}destroy(){this.hasSlide=!1,this.slide=void 0,this.instance.dispatch("contentDestroy",{content:this}).defaultPrevented||(this.remove(),this.placeholder&&(this.placeholder.destroy(),this.placeholder=void 0),this.isImageContent()&&this.element&&(this.element.onload=null,this.element.onerror=null,this.element=void 0))}displayError(){if(this.slide){let t=h("pswp__error-msg","div");t.innerText=this.instance.options?.errorMsg??"",t=this.instance.applyFilters("contentErrorElement",t,this),this.element=h("pswp__content pswp__error-msg-container","div"),this.element.appendChild(t),this.slide.container.innerText="",this.slide.container.appendChild(this.element),this.slide.updateContentSize(!0),this.removePlaceholder()}}append(){if(this.isAttached||!this.element)return;if(this.isAttached=!0,this.state===f)return void this.displayError();if(this.instance.dispatch("contentAppend",{content:this}).defaultPrevented)return;const t="decode"in this.element;this.isImageContent()?t&&this.slide&&(!this.slide.isActive||S())?(this.isDecoding=!0,this.element.decode().catch(()=>{}).finally(()=>{this.isDecoding=!1,this.appendImage()})):this.appendImage():this.slide&&!this.element.parentNode&&this.slide.container.appendChild(this.element)}activate(){!this.instance.dispatch("contentActivate",{content:this}).defaultPrevented&&this.slide&&(this.isImageContent()&&this.isDecoding&&!S()?this.appendImage():this.isError()&&this.load(!1,!0),this.slide.holderElement&&this.slide.holderElement.setAttribute("aria-hidden","false"))}deactivate(){this.instance.dispatch("contentDeactivate",{content:this}),this.slide&&this.slide.holderElement&&this.slide.holderElement.setAttribute("aria-hidden","true")}remove(){this.isAttached=!1,this.instance.dispatch("contentRemove",{content:this}).defaultPrevented||(this.element&&this.element.parentNode&&this.element.remove(),this.placeholder&&this.placeholder.element&&this.placeholder.element.remove())}appendImage(){this.isAttached&&(this.instance.dispatch("contentAppendImage",{content:this}).defaultPrevented||(this.slide&&this.element&&!this.element.parentNode&&this.slide.container.appendChild(this.element),this.state!==w&&this.state!==f||this.removePlaceholder()))}};function L(t,i){if(t.getViewportSizeFn){const e=t.getViewportSizeFn(t,i);if(e)return e}return{x:document.documentElement.clientWidth,y:window.innerHeight}}function z(t,i,e,s,n){let o=0;if(i.paddingFn)o=i.paddingFn(e,s,n)[t];else if(i.padding)o=i.padding[t];else{const e=`padding${t[0].toUpperCase()}${t.slice(1)}`;i[e]&&(o=i[e])}return Number(o)||0}function I(t,i,e,s){return{x:i.x-z("left",t,i,e,s)-z("right",t,i,e,s),y:i.y-z("top",t,i,e,s)-z("bottom",t,i,e,s)}}var A=class{constructor(t,i,e,s){this.pswp=s,this.options=t,this.itemData=i,this.index=e,this.panAreaSize=null,this.elementSize=null,this.fit=1,this.fill=1,this.vFill=1,this.initial=1,this.secondary=1,this.max=1,this.min=1}update(t,i,e){const s={x:t,y:i};this.elementSize=s,this.panAreaSize=e;const n=e.x/s.x,o=e.y/s.y;this.fit=Math.min(1,n<o?n:o),this.fill=Math.min(1,n>o?n:o),this.vFill=Math.min(1,o),this.initial=this._getInitial(),this.secondary=this._getSecondary(),this.max=Math.max(this.initial,this.secondary,this._getMax()),this.min=Math.min(this.fit,this.initial,this.secondary),this.pswp&&this.pswp.dispatch("zoomLevelsUpdate",{zoomLevels:this,slideData:this.itemData})}_parseZoomLevelOption(t){const i=`${t}ZoomLevel`,e=this.options[i];if(e)return"function"==typeof e?e(this):"fill"===e?this.fill:"fit"===e?this.fit:Number(e)}_getSecondary(){let t=this._parseZoomLevelOption("secondary");return t||(t=Math.min(1,3*this.fit),this.elementSize&&t*this.elementSize.x>4e3&&(t=4e3/this.elementSize.x),t)}_getInitial(){return this._parseZoomLevelOption("initial")||this.fit}_getMax(){return this._parseZoomLevelOption("max")||Math.max(1,4*this.fit)}};function T(t,i,e){const s=i.createContentFromData(t,e);let n;const{options:o}=i;if(o){let a;n=new A(o,t,-1),a=i.pswp?i.pswp.viewportSize:L(o,i);const r=I(o,a,t,e);n.update(s.width,s.height,r)}return s.lazyLoad(),n&&s.setDisplayedSize(Math.ceil(s.width*n.initial),Math.ceil(s.height*n.initial)),s}function Z(t,i){const e=i.getItemData(t);if(!i.dispatch("lazyLoadSlide",{index:t,itemData:e}).defaultPrevented)return T(e,i,t)}var O=class{constructor(t){this.pswp=t,this.limit=Math.max(t.options.preload[0]+t.options.preload[1]+1,5),this._cachedItems=[]}updateLazy(t){const{pswp:i}=this;if(i.dispatch("lazyLoad").defaultPrevented)return;const{preload:e}=i.options,s=void 0===t||t>=0;let n;for(n=0;n<=e[1];n++)this.loadSlideByIndex(i.currIndex+(s?n:-n));for(n=1;n<=e[0];n++)this.loadSlideByIndex(i.currIndex+(s?-n:n))}loadSlideByIndex(t){const i=this.pswp.getLoopedIndex(t);let e=this.getContentByIndex(i);e||(e=Z(i,this.pswp),e&&this.addToCache(e))}getContentBySlide(t){let i=this.getContentByIndex(t.index);return i||(i=this.pswp.createContentFromData(t.data,t.index),this.addToCache(i)),i.setSlide(t),i}addToCache(t){if(this.removeByIndex(t.index),this._cachedItems.push(t),this._cachedItems.length>this.limit){const t=this._cachedItems.findIndex(t=>!t.isAttached&&!t.hasSlide);-1!==t&&this._cachedItems.splice(t,1)[0].destroy()}}removeByIndex(t){const i=this._cachedItems.findIndex(i=>i.index===t);-1!==i&&this._cachedItems.splice(i,1)}getContentByIndex(t){return this._cachedItems.find(i=>i.index===t)}destroy(){this._cachedItems.forEach(t=>t.destroy()),this._cachedItems=[]}},E=class{constructor(t,i){this.type=t,this.defaultPrevented=!1,i&&Object.assign(this,i)}preventDefault(){this.defaultPrevented=!0}},D=class{constructor(){this._listeners={},this._filters={},this.pswp=void 0,this.options=void 0}addFilter(t,i,e=100){this._filters[t]||(this._filters[t]=[]),this._filters[t]?.push({fn:i,priority:e}),this._filters[t]?.sort((t,i)=>t.priority-i.priority),this.pswp?.addFilter(t,i,e)}removeFilter(t,i){this._filters[t]&&(this._filters[t]=this._filters[t].filter(t=>t.fn!==i)),this.pswp&&this.pswp.removeFilter(t,i)}applyFilters(t,...i){return this._filters[t]?.forEach(t=>{i[0]=t.fn.apply(this,i)}),i[0]}on(t,i){this._listeners[t]||(this._listeners[t]=[]),this._listeners[t]?.push(i),this.pswp?.on(t,i)}off(t,i){this._listeners[t]&&(this._listeners[t]=this._listeners[t].filter(t=>i!==t)),this.pswp?.off(t,i)}dispatch(t,i){if(this.pswp)return this.pswp.dispatch(t,i);const e=new E(t,i);return this._listeners[t]?.forEach(t=>{t.call(this,e)}),e}},M=class extends D{getNumItems(){let t=0;const i=this.options?.dataSource;i&&"length"in i?t=i.length:i&&"gallery"in i&&(i.items||(i.items=this._getGalleryDOMElements(i.gallery)),i.items&&(t=i.items.length));const e=this.dispatch("numItems",{dataSource:i,numItems:t});return this.applyFilters("numItems",e.numItems,i)}createContentFromData(t,i){return new C(t,this,i)}getItemData(t){const i=this.options?.dataSource;let e={};Array.isArray(i)?e=i[t]:i&&"gallery"in i&&(i.items||(i.items=this._getGalleryDOMElements(i.gallery)),e=i.items[t]);let s=e;s instanceof Element&&(s=this._domElementToItemData(s));const n=this.dispatch("itemData",{itemData:s||{},index:t});return this.applyFilters("itemData",n.itemData,t)}_getGalleryDOMElements(t){return this.options?.children||this.options?.childSelector?P(this.options.children,this.options.childSelector,t)||[]:[t]}_toLowerCaseFirstLetter(t){return t?t.charAt(0).toLowerCase()+t.slice(1):t}_domElementToItemData(t){const i={element:t},e="A"===t.tagName?t:t.querySelector("a");if(e){i.src=e.dataset.pswpSrc||e.href,e.dataset.pswpSrcset&&(i.srcset=e.dataset.pswpSrcset),i.width=e.dataset.pswpWidth?parseInt(e.dataset.pswpWidth,10):0,i.height=e.dataset.pswpHeight?parseInt(e.dataset.pswpHeight,10):0,e.dataset.pswpType&&(i.type=e.dataset.pswpType.toLowerCase());const s=t.querySelector("img");s&&(i.msrc=s.currentSrc||s.src,i.alt=s.getAttribute("alt")??""),(e.dataset.pswpCropped||e.dataset.cropped)&&(i.thumbCropped=!0);const n=["element","src","srcset","width","height","type","msrc","alt","thumbCropped"];Object.keys(e.dataset).filter(t=>t.startsWith("pswp")&&!n.includes(this._toLowerCaseFirstLetter(t.slice(4)))).forEach(t=>{i[this._toLowerCaseFirstLetter(t.slice(4))]=e.dataset[t]})}return this.applyFilters("domItemData",i,t,e)}lazyLoadData(t,i){return T(t,this,i)}},F=class extends M{constructor(t){super(),this.options=t||{},this._uid=0,this.shouldOpen=!1,this._preloadedContent=void 0,this.onThumbnailsClick=this.onThumbnailsClick.bind(this)}init(){P(this.options.gallery,this.options.gallerySelector).forEach(t=>{t.addEventListener("click",this.onThumbnailsClick,!1)})}onThumbnailsClick(t){if(x(t)||window.pswp)return;let i={x:t.clientX,y:t.clientY};i.x||i.y||(i=null);let e=this.getClickedIndex(t);e=this.applyFilters("clickedIndex",e,t,this);const s={gallery:t.currentTarget};e>=0&&(t.preventDefault(),this.loadAndOpen(e,s,i))}getClickedIndex(t){if(this.options.getClickedIndexFn)return this.options.getClickedIndexFn.call(this,t);const i=t.target,e=P(this.options.children,this.options.childSelector,t.currentTarget).findIndex(t=>t===i||t.contains(i));return-1!==e?e:this.options.children||this.options.childSelector?-1:0}loadAndOpen(t,i,e){if(window.pswp||!this.options)return!1;if(!i&&this.options.gallery&&this.options.children){const t=P(this.options.gallery);t[0]&&(i={gallery:t[0]})}return this.options.index=t,this.options.initialPointerPos=e,this.shouldOpen=!0,this.preload(t,i),!0}preload(t,i){const{options:e}=this;i&&(e.dataSource=i);const s=[],n=typeof e.pswpModule;if("function"==typeof(o=e.pswpModule)&&o.prototype&&o.prototype.goTo)s.push(Promise.resolve(e.pswpModule));else{if("string"===n)throw new Error("pswpModule as string is no longer supported");if("function"!==n)throw new Error("pswpModule is not valid");s.push(e.pswpModule())}var o;"function"==typeof e.openPromise&&s.push(e.openPromise()),!1!==e.preloadFirstSlide&&t>=0&&(this._preloadedContent=Z(t,this));const a=++this._uid;Promise.all(s).then(t=>{if(this.shouldOpen){const i=t[0];this._openPhotoswipe(i,a)}})}_openPhotoswipe(t,i){if(i!==this._uid&&this.shouldOpen)return;if(this.shouldOpen=!1,window.pswp)return;const e="object"==typeof t?new t.default(this.options):new t(this.options);this.pswp=e,window.pswp=e,Object.keys(this._listeners).forEach(t=>{this._listeners[t]?.forEach(i=>{e.on(t,i)})}),Object.keys(this._filters).forEach(t=>{this._filters[t]?.forEach(i=>{e.addFilter(t,i.fn,i.priority)})}),this._preloadedContent&&(e.contentLoader.addToCache(this._preloadedContent),this._preloadedContent=void 0),e.on("destroy",()=>{this.pswp=void 0,delete window.pswp}),e.init()}destroy(){this.pswp?.destroy(),this.shouldOpen=!1,this._listeners={},P(this.options.gallery,this.options.gallerySelector).forEach(t=>{t.removeEventListener("click",this.onThumbnailsClick,!1)})}},B=class{constructor(t){this.gestures=t,this.pswp=t.pswp,this.startPan={x:0,y:0}}start(){this.pswp.currSlide&&l(this.startPan,this.pswp.currSlide.pan),this.pswp.animations.stopAll()}change(){const{p1:t,prevP1:i,dragAxis:e}=this.gestures,{currSlide:s}=this.pswp;if("y"===e&&this.pswp.options.closeOnVerticalDrag&&s&&s.currZoomLevel<=s.zoomLevels.fit&&!this.gestures.isMultitouch){const e=s.pan.y+(t.y-i.y);if(!this.pswp.dispatch("verticalDrag",{panY:e}).defaultPrevented){this._setPanWithFriction("y",e,.6);const t=1-Math.abs(this._getVerticalDragRatio(s.pan.y));this.pswp.applyBgOpacity(t),s.applyCurrentZoomPan()}}else this._panOrMoveMainScroll("x")||(this._panOrMoveMainScroll("y"),s&&(p(s.pan),s.applyCurrentZoomPan()))}end(){const{velocity:t}=this.gestures,{mainScroll:i,currSlide:e}=this.pswp;let s=0;if(this.pswp.animations.stopAll(),i.isShifted()){const e=(i.x-i.getCurrSlideX())/this.pswp.viewportSize.x;t.x<-.5&&e<0||t.x<.1&&e<-.5?(s=1,t.x=Math.min(t.x,0)):(t.x>.5&&e>0||t.x>-.1&&e>.5)&&(s=-1,t.x=Math.max(t.x,0)),i.moveIndexBy(s,!0,t.x,!0)}e&&e.currZoomLevel>e.zoomLevels.max||this.gestures.isMultitouch?this.gestures.zoomLevels.correctZoomPan(!0):(this._finishPanGestureForAxis("x"),this._finishPanGestureForAxis("y"))}_finishPanGestureForAxis(t){const{velocity:i}=this.gestures,{currSlide:e}=this.pswp;if(!e)return;const{pan:s,bounds:n}=e,o=s[t],a=this.pswp.bgOpacity<1&&"y"===t,r=o+i[t]*.995/(1-.995);if(a){const t=this._getVerticalDragRatio(o),i=this._getVerticalDragRatio(r);if(t<0&&i<-.4||t>0&&i>.4)return void this.pswp.close()}const h=n.correctPan(t,r);if(o===h)return;const l=h===r?1:.82,p=this.pswp.bgOpacity,d=h-o;this.pswp.animations.startSpring({name:`panGesture${t}`,isPan:!0,start:o,end:h,velocity:i[t],dampingRatio:l,onUpdate:i=>{if(a&&this.pswp.bgOpacity<1){const t=1-(h-i)/d;this.pswp.applyBgOpacity(m(p+(1-p)*t,0,1))}s[t]=Math.floor(i),e.applyCurrentZoomPan()}})}_panOrMoveMainScroll(t){const{p1:i,dragAxis:e,prevP1:s,isMultitouch:n}=this.gestures,{currSlide:o,mainScroll:a}=this.pswp,r=i[t]-s[t],h=a.x+r;if(!r||!o)return!1;if("x"===t&&!o.isPannable()&&!n)return a.moveTo(h,!0),!0;const{bounds:l}=o,p=o.pan[t]+r;if(this.pswp.options.allowPanToNext&&"x"===e&&"x"===t&&!n){const i=a.getCurrSlideX(),e=a.x-i,s=r>0,n=!s;if(p>l.min[t]&&s){if(l.min[t]<=this.startPan[t])return a.moveTo(h,!0),!0;this._setPanWithFriction(t,p)}else if(p<l.max[t]&&n){if(this.startPan[t]<=l.max[t])return a.moveTo(h,!0),!0;this._setPanWithFriction(t,p)}else if(0!==e){if(e>0)return a.moveTo(Math.max(h,i),!0),!0;if(e<0)return a.moveTo(Math.min(h,i),!0),!0}else this._setPanWithFriction(t,p)}else"y"===t&&(a.isShifted()||l.min.y===l.max.y)||this._setPanWithFriction(t,p);return!1}_getVerticalDragRatio(t){return(t-(this.pswp.currSlide?.bounds.center.y??0))/(this.pswp.viewportSize.y/3)}_setPanWithFriction(t,i,e){const{currSlide:s}=this.pswp;if(!s)return;const{pan:n,bounds:o}=s;if(o.correctPan(t,i)!==i||e){const s=Math.round(i-n[t]);n[t]+=s*(e||.35)}else n[t]=i}};function k(t){return!!t.target.closest(".pswp__container")}var R=class{constructor(t){this.gestures=t}click(t,i){const e=i.target.classList,s=e.contains("pswp__img"),n=e.contains("pswp__item")||e.contains("pswp__zoom-wrap");s?this._doClickOrTapAction("imageClick",t,i):n&&this._doClickOrTapAction("bgClick",t,i)}tap(t,i){k(i)&&this._doClickOrTapAction("tap",t,i)}doubleTap(t,i){k(i)&&this._doClickOrTapAction("doubleTap",t,i)}_doClickOrTapAction(t,i,e){const{pswp:s}=this.gestures,{currSlide:n}=s,o=`${t}Action`,a=s.options[o];if(!s.dispatch(o,{point:i,originalEvent:e}).defaultPrevented)if("function"!=typeof a)switch(a){case"close":case"next":s[a]();break;case"zoom":n?.toggleZoom(i);break;case"zoom-or-close":n?.isZoomable()&&n.zoomLevels.secondary!==n.zoomLevels.initial?n.toggleZoom(i):s.options.clickToCloseNonZoomable&&s.close();break;case"toggle-controls":this.gestures.pswp.element?.classList.toggle("pswp--ui-visible")}else a.call(s,i,e)}};function H(t,i,e){return t.x=(i.x+e.x)/2,t.y=(i.y+e.y)/2,t}var N=class{constructor(t){this.gestures=t,this._startPan={x:0,y:0},this._startZoomPoint={x:0,y:0},this._zoomPoint={x:0,y:0},this._wasOverFitZoomLevel=!1,this._startZoomLevel=1}start(){const{currSlide:t}=this.gestures.pswp;t&&(this._startZoomLevel=t.currZoomLevel,l(this._startPan,t.pan)),this.gestures.pswp.animations.stopAllPan(),this._wasOverFitZoomLevel=!1}change(){const{p1:t,startP1:i,p2:e,startP2:s,pswp:n}=this.gestures,{currSlide:o}=n;if(!o)return;const a=o.zoomLevels.min,r=o.zoomLevels.max;if(!o.isZoomable()||n.mainScroll.isShifted())return;H(this._startZoomPoint,i,s),H(this._zoomPoint,t,e);let h=1/d(i,s)*d(t,e)*this._startZoomLevel;if(h>o.zoomLevels.initial+o.zoomLevels.initial/15&&(this._wasOverFitZoomLevel=!0),h<a)if(n.options.pinchToClose&&!this._wasOverFitZoomLevel&&this._startZoomLevel<=o.zoomLevels.initial){const t=1-(a-h)/(a/1.2);n.dispatch("pinchClose",{bgOpacity:t}).defaultPrevented||n.applyBgOpacity(t)}else h=a-.15*(a-h);else h>r&&(h=r+.05*(h-r));o.pan.x=this._calculatePanForZoomLevel("x",h),o.pan.y=this._calculatePanForZoomLevel("y",h),o.setZoomLevel(h),o.applyCurrentZoomPan()}end(){const{pswp:t}=this.gestures,{currSlide:i}=t;(!i||i.currZoomLevel<i.zoomLevels.initial)&&!this._wasOverFitZoomLevel&&t.options.pinchToClose?t.close():this.correctZoomPan()}_calculatePanForZoomLevel(t,i){const e=i/this._startZoomLevel;return this._zoomPoint[t]-(this._startZoomPoint[t]-this._startPan[t])*e}correctZoomPan(t){const{pswp:i}=this.gestures,{currSlide:e}=i;if(!e?.isZoomable())return;0===this._zoomPoint.x&&(t=!0);const s=e.currZoomLevel;let n,o=!0;s<e.zoomLevels.initial?n=e.zoomLevels.initial:s>e.zoomLevels.max?n=e.zoomLevels.max:(o=!1,n=s);const a=i.bgOpacity,r=i.bgOpacity<1,h=l({x:0,y:0},e.pan);let p=l({x:0,y:0},h);t&&(this._zoomPoint.x=0,this._zoomPoint.y=0,this._startZoomPoint.x=0,this._startZoomPoint.y=0,this._startZoomLevel=s,l(this._startPan,h)),o&&(p={x:this._calculatePanForZoomLevel("x",n),y:this._calculatePanForZoomLevel("y",n)}),e.setZoomLevel(n),p={x:e.bounds.correctPan("x",p.x),y:e.bounds.correctPan("y",p.y)},e.setZoomLevel(s);const d=!c(p,h);if(!d&&!o&&!r)return e._setResolution(n),void e.applyCurrentZoomPan();i.animations.stopAllPan(),i.animations.startSpring({isPan:!0,start:0,end:1e3,velocity:0,dampingRatio:1,naturalFrequency:40,onUpdate:t=>{if(t/=1e3,d||o){if(d&&(e.pan.x=h.x+(p.x-h.x)*t,e.pan.y=h.y+(p.y-h.y)*t),o){const i=s+(n-s)*t;e.setZoomLevel(i)}e.applyCurrentZoomPan()}r&&i.bgOpacity<1&&i.applyBgOpacity(m(a+(1-a)*t,0,1))},onComplete:()=>{e._setResolution(n),e.applyCurrentZoomPan()}})}},W=class{constructor(t){this.pswp=t,this.dragAxis=null,this.p1={x:0,y:0},this.p2={x:0,y:0},this.prevP1={x:0,y:0},this.prevP2={x:0,y:0},this.startP1={x:0,y:0},this.startP2={x:0,y:0},this.velocity={x:0,y:0},this._lastStartP1={x:0,y:0},this._intervalP1={x:0,y:0},this._numActivePoints=0,this._ongoingPointers=[],this._touchEventEnabled="ontouchstart"in window,this._pointerEventEnabled=!!window.PointerEvent,this.supportsTouch=this._touchEventEnabled||this._pointerEventEnabled&&navigator.maxTouchPoints>1,this._numActivePoints=0,this._intervalTime=0,this._velocityCalculated=!1,this.isMultitouch=!1,this.isDragging=!1,this.isZooming=!1,this.raf=null,this._tapTimer=null,this.supportsTouch||(t.options.allowPanToNext=!1),this.drag=new B(this),this.zoomLevels=new N(this),this.tapHandler=new R(this),t.on("bindEvents",()=>{t.events.add(t.scrollWrap,"click",this._onClick.bind(this)),this._pointerEventEnabled?this._bindEvents("pointer","down","up","cancel"):this._touchEventEnabled?(this._bindEvents("touch","start","end","cancel"),t.scrollWrap&&(t.scrollWrap.ontouchmove=()=>{},t.scrollWrap.ontouchend=()=>{})):this._bindEvents("mouse","down","up")})}_bindEvents(t,i,e,s){const{pswp:n}=this,{events:o}=n,a=s?t+s:"";o.add(n.scrollWrap,t+i,this.onPointerDown.bind(this)),o.add(window,`${t}move`,this.onPointerMove.bind(this)),o.add(window,t+e,this.onPointerUp.bind(this)),a&&o.add(n.scrollWrap,a,this.onPointerUp.bind(this))}onPointerDown(t){const i="mousedown"===t.type||"mouse"===t.pointerType;if(i&&t.button>0)return;const{pswp:e}=this;e.opener.isOpen?e.dispatch("pointerDown",{originalEvent:t}).defaultPrevented||(i&&(e.mouseDetected(),this._preventPointerEventBehaviour(t,"down")),e.animations.stopAll(),this._updatePoints(t,"down"),1===this._numActivePoints&&(this.dragAxis=null,l(this.startP1,this.p1)),this._numActivePoints>1?(this._clearTapTimer(),this.isMultitouch=!0):this.isMultitouch=!1):t.preventDefault()}onPointerMove(t){this._preventPointerEventBehaviour(t,"move"),this._numActivePoints&&(this._updatePoints(t,"move"),this.pswp.dispatch("pointerMove",{originalEvent:t}).defaultPrevented||(1!==this._numActivePoints||this.isDragging?this._numActivePoints>1&&!this.isZooming&&(this._finishDrag(),this.isZooming=!0,this._updateStartPoints(),this.zoomLevels.start(),this._rafStopLoop(),this._rafRenderLoop()):(this.dragAxis||this._calculateDragDirection(),this.dragAxis&&!this.isDragging&&(this.isZooming&&(this.isZooming=!1,this.zoomLevels.end()),this.isDragging=!0,this._clearTapTimer(),this._updateStartPoints(),this._intervalTime=Date.now(),this._velocityCalculated=!1,l(this._intervalP1,this.p1),this.velocity.x=0,this.velocity.y=0,this.drag.start(),this._rafStopLoop(),this._rafRenderLoop()))))}_finishDrag(){this.isDragging&&(this.isDragging=!1,this._velocityCalculated||this._updateVelocity(!0),this.drag.end(),this.dragAxis=null)}onPointerUp(t){this._numActivePoints&&(this._updatePoints(t,"up"),this.pswp.dispatch("pointerUp",{originalEvent:t}).defaultPrevented||(0===this._numActivePoints&&(this._rafStopLoop(),this.isDragging?this._finishDrag():this.isZooming||this.isMultitouch||this._finishTap(t)),this._numActivePoints<2&&this.isZooming&&(this.isZooming=!1,this.zoomLevels.end(),1===this._numActivePoints&&(this.dragAxis=null,this._updateStartPoints()))))}_rafRenderLoop(){(this.isDragging||this.isZooming)&&(this._updateVelocity(),this.isDragging?c(this.p1,this.prevP1)||this.drag.change():c(this.p1,this.prevP1)&&c(this.p2,this.prevP2)||this.zoomLevels.change(),this._updatePrevPoints(),this.raf=requestAnimationFrame(this._rafRenderLoop.bind(this)))}_updateVelocity(t){const i=Date.now(),e=i-this._intervalTime;e<50&&!t||(this.velocity.x=this._getVelocity("x",e),this.velocity.y=this._getVelocity("y",e),this._intervalTime=i,l(this._intervalP1,this.p1),this._velocityCalculated=!0)}_finishTap(t){const{mainScroll:i}=this.pswp;if(i.isShifted())return void i.moveIndexBy(0,!0);if(t.type.indexOf("cancel")>0)return;if("mouseup"===t.type||"mouse"===t.pointerType)return void this.tapHandler.click(this.startP1,t);const e=this.pswp.options.doubleTapAction?300:0;this._tapTimer?(this._clearTapTimer(),d(this._lastStartP1,this.startP1)<25&&this.tapHandler.doubleTap(this.startP1,t)):(l(this._lastStartP1,this.startP1),this._tapTimer=setTimeout(()=>{this.tapHandler.tap(this.startP1,t),this._clearTapTimer()},e))}_clearTapTimer(){this._tapTimer&&(clearTimeout(this._tapTimer),this._tapTimer=null)}_getVelocity(t,i){const e=this.p1[t]-this._intervalP1[t];return Math.abs(e)>1&&i>5?e/i:0}_rafStopLoop(){this.raf&&(cancelAnimationFrame(this.raf),this.raf=null)}_preventPointerEventBehaviour(t,i){this.pswp.applyFilters("preventPointerEvent",!0,t,i)&&t.preventDefault()}_updatePoints(t,i){if(this._pointerEventEnabled){const e=t,s=this._ongoingPointers.findIndex(t=>t.id===e.pointerId);"up"===i&&s>-1?this._ongoingPointers.splice(s,1):"down"===i&&-1===s?this._ongoingPointers.push(this._convertEventPosToPoint(e,{x:0,y:0})):s>-1&&this._convertEventPosToPoint(e,this._ongoingPointers[s]),this._numActivePoints=this._ongoingPointers.length,this._numActivePoints>0&&l(this.p1,this._ongoingPointers[0]),this._numActivePoints>1&&l(this.p2,this._ongoingPointers[1])}else{const e=t;this._numActivePoints=0,e.type.indexOf("touch")>-1?e.touches&&e.touches.length>0&&(this._convertEventPosToPoint(e.touches[0],this.p1),this._numActivePoints++,e.touches.length>1&&(this._convertEventPosToPoint(e.touches[1],this.p2),this._numActivePoints++)):(this._convertEventPosToPoint(t,this.p1),"up"===i?this._numActivePoints=0:this._numActivePoints++)}}_updatePrevPoints(){l(this.prevP1,this.p1),l(this.prevP2,this.p2)}_updateStartPoints(){l(this.startP1,this.p1),l(this.startP2,this.p2),this._updatePrevPoints()}_calculateDragDirection(){if(this.pswp.mainScroll.isShifted())this.dragAxis="x";else{const t=Math.abs(this.p1.x-this.startP1.x)-Math.abs(this.p1.y-this.startP1.y);if(0!==t){const i=t>0?"x":"y";Math.abs(this.p1[i]-this.startP1[i])>=10&&(this.dragAxis=i)}}}_convertEventPosToPoint(t,i){return i.x=t.pageX-this.pswp.offset.x,i.y=t.pageY-this.pswp.offset.y,"pointerId"in t?i.id=t.pointerId:void 0!==t.identifier&&(i.id=t.identifier),i}_onClick(t){this.pswp.mainScroll.isShifted()&&(t.preventDefault(),t.stopPropagation())}},V=class{constructor(t){this.slide=t,this.currZoomLevel=1,this.center={x:0,y:0},this.max={x:0,y:0},this.min={x:0,y:0}}update(t){this.currZoomLevel=t,this.slide.width?(this._updateAxis("x"),this._updateAxis("y"),this.slide.pswp.dispatch("calcBounds",{slide:this.slide})):this.reset()}_updateAxis(t){const{pswp:i}=this.slide,e=this.slide["x"===t?"width":"height"]*this.currZoomLevel,s=z("x"===t?"left":"top",i.options,i.viewportSize,this.slide.data,this.slide.index),n=this.slide.panAreaSize[t];this.center[t]=Math.round((n-e)/2)+s,this.max[t]=e>n?Math.round(n-e)+s:this.center[t],this.min[t]=e>n?s:this.center[t]}reset(){this.center.x=0,this.center.y=0,this.max.x=0,this.max.y=0,this.min.x=0,this.min.y=0}correctPan(t,i){return m(i,this.max[t],this.min[t])}},q=class{constructor(t,i,e){this.data=t,this.index=i,this.pswp=e,this.isActive=i===e.currIndex,this.currentResolution=0,this.panAreaSize={x:0,y:0},this.pan={x:0,y:0},this.isFirstSlide=this.isActive&&!e.opener.isOpen,this.zoomLevels=new A(e.options,t,i,e),this.pswp.dispatch("gettingData",{slide:this,data:this.data,index:i}),this.content=this.pswp.contentLoader.getContentBySlide(this),this.container=h("pswp__zoom-wrap","div"),this.holderElement=null,this.currZoomLevel=1,this.width=this.content.width,this.height=this.content.height,this.heavyAppended=!1,this.bounds=new V(this),this.prevDisplayedWidth=-1,this.prevDisplayedHeight=-1,this.pswp.dispatch("slideInit",{slide:this})}setIsActive(t){t&&!this.isActive?this.activate():!t&&this.isActive&&this.deactivate()}append(t){this.holderElement=t,this.container.style.transformOrigin="0 0",this.data&&(this.calculateSize(),this.load(),this.updateContentSize(),this.appendHeavy(),this.holderElement.appendChild(this.container),this.zoomAndPanToInitial(),this.pswp.dispatch("firstZoomPan",{slide:this}),this.applyCurrentZoomPan(),this.pswp.dispatch("afterSetContent",{slide:this}),this.isActive&&this.activate())}load(){this.content.load(!1),this.pswp.dispatch("slideLoad",{slide:this})}appendHeavy(){const{pswp:t}=this;!this.heavyAppended&&t.opener.isOpen&&!t.mainScroll.isShifted()&&(this.isActive,1)&&(this.pswp.dispatch("appendHeavy",{slide:this}).defaultPrevented||(this.heavyAppended=!0,this.content.append(),this.pswp.dispatch("appendHeavyContent",{slide:this})))}activate(){this.isActive=!0,this.appendHeavy(),this.content.activate(),this.pswp.dispatch("slideActivate",{slide:this})}deactivate(){this.isActive=!1,this.content.deactivate(),this.currZoomLevel!==this.zoomLevels.initial&&this.calculateSize(),this.currentResolution=0,this.zoomAndPanToInitial(),this.applyCurrentZoomPan(),this.updateContentSize(),this.pswp.dispatch("slideDeactivate",{slide:this})}destroy(){this.content.hasSlide=!1,this.content.remove(),this.container.remove(),this.pswp.dispatch("slideDestroy",{slide:this})}resize(){this.currZoomLevel!==this.zoomLevels.initial&&this.isActive?(this.calculateSize(),this.bounds.update(this.currZoomLevel),this.panTo(this.pan.x,this.pan.y)):(this.calculateSize(),this.currentResolution=0,this.zoomAndPanToInitial(),this.applyCurrentZoomPan(),this.updateContentSize())}updateContentSize(t){const i=this.currentResolution||this.zoomLevels.initial;if(!i)return;const e=Math.round(this.width*i)||this.pswp.viewportSize.x,s=Math.round(this.height*i)||this.pswp.viewportSize.y;(this.sizeChanged(e,s)||t)&&this.content.setDisplayedSize(e,s)}sizeChanged(t,i){return(t!==this.prevDisplayedWidth||i!==this.prevDisplayedHeight)&&(this.prevDisplayedWidth=t,this.prevDisplayedHeight=i,!0)}getPlaceholderElement(){return this.content.placeholder?.element}zoomTo(t,i,e,s){const{pswp:n}=this;if(!this.isZoomable()||n.mainScroll.isShifted())return;n.dispatch("beforeZoomTo",{destZoomLevel:t,centerPoint:i,transitionDuration:e}),n.animations.stopAllPan();const o=this.currZoomLevel;s||(t=m(t,this.zoomLevels.min,this.zoomLevels.max)),this.setZoomLevel(t),this.pan.x=this.calculateZoomToPanOffset("x",i,o),this.pan.y=this.calculateZoomToPanOffset("y",i,o),p(this.pan);const a=()=>{this._setResolution(t),this.applyCurrentZoomPan()};e?n.animations.startTransition({isPan:!0,name:"zoomTo",target:this.container,transform:this.getCurrentTransform(),onComplete:a,duration:e,easing:n.options.easing}):a()}toggleZoom(t){this.zoomTo(this.currZoomLevel===this.zoomLevels.initial?this.zoomLevels.secondary:this.zoomLevels.initial,t,this.pswp.options.zoomAnimationDuration)}setZoomLevel(t){this.currZoomLevel=t,this.bounds.update(this.currZoomLevel)}calculateZoomToPanOffset(t,i,e){if(this.bounds.max[t]-this.bounds.min[t]===0)return this.bounds.center[t];i||(i=this.pswp.getViewportCenterPoint()),e||(e=this.zoomLevels.initial);const s=this.currZoomLevel/e;return this.bounds.correctPan(t,(this.pan[t]-i[t])*s+i[t])}panTo(t,i){this.pan.x=this.bounds.correctPan("x",t),this.pan.y=this.bounds.correctPan("y",i),this.applyCurrentZoomPan()}isPannable(){return Boolean(this.width)&&this.currZoomLevel>this.zoomLevels.fit}isZoomable(){return Boolean(this.width)&&this.content.isZoomable()}applyCurrentZoomPan(){this._applyZoomTransform(this.pan.x,this.pan.y,this.currZoomLevel),this===this.pswp.currSlide&&this.pswp.dispatch("zoomPanUpdate",{slide:this})}zoomAndPanToInitial(){this.currZoomLevel=this.zoomLevels.initial,this.bounds.update(this.currZoomLevel),l(this.pan,this.bounds.center),this.pswp.dispatch("initialZoomPan",{slide:this})}_applyZoomTransform(t,i,e){e/=this.currentResolution||this.zoomLevels.initial,_(this.container,t,i,e)}calculateSize(){const{pswp:t}=this;l(this.panAreaSize,I(t.options,t.viewportSize,this.data,this.index)),this.zoomLevels.update(this.width,this.height,this.panAreaSize),t.dispatch("calcSlideSize",{slide:this})}getCurrentTransform(){const t=this.currZoomLevel/(this.currentResolution||this.zoomLevels.initial);return u(this.pan.x,this.pan.y,t)}_setResolution(t){t!==this.currentResolution&&(this.currentResolution=t,this.updateContentSize(),this.pswp.dispatch("resolutionChanged"))}};function $(t,i,e){t.classList.add("pswp__button--arrow"),t.setAttribute("aria-controls","pswp__items"),i.on("change",()=>{i.options.loop||(t.disabled=e?!(i.currIndex<i.getNumItems()-1):!(i.currIndex>0))})}var U={name:"arrowPrev",className:"pswp__button--arrow--prev",title:"Previous",order:10,isButton:!0,appendTo:"wrapper",html:{isCustomSVG:!0,size:60,inner:'<path d="M29 43l-3 3-16-16 16-16 3 3-13 13 13 13z" id="pswp__icn-arrow"/>',outlineID:"pswp__icn-arrow"},onClick:"prev",onInit:$},G={name:"arrowNext",className:"pswp__button--arrow--next",title:"Next",order:11,isButton:!0,appendTo:"wrapper",html:{isCustomSVG:!0,size:60,inner:'<use xlink:href="#pswp__icn-arrow"/>',outlineID:"pswp__icn-arrow"},onClick:"next",onInit:(t,i)=>{$(t,i,!0)}},j={name:"close",title:"Close",order:20,isButton:!0,html:{isCustomSVG:!0,inner:'<path d="M24 10l-2-2-6 6-6-6-2 2 6 6-6 6 2 2 6-6 6 6 2-2-6-6z" id="pswp__icn-close"/>',outlineID:"pswp__icn-close"},onClick:"close"},K={name:"zoom",title:"Zoom",order:10,isButton:!0,html:{isCustomSVG:!0,inner:'<path d="M17.426 19.926a6 6 0 1 1 1.5-1.5L23 22.5 21.5 24l-4.074-4.074z" id="pswp__icn-zoom"/><path fill="currentColor" class="pswp__zoom-icn-bar-h" d="M11 16v-2h6v2z"/><path fill="currentColor" class="pswp__zoom-icn-bar-v" d="M13 12h2v6h-2z"/>',outlineID:"pswp__icn-zoom"},onClick:"toggleZoom"},X={name:"counter",order:5,onInit:(t,i)=>{i.on("change",()=>{t.innerText=i.currIndex+1+i.options.indexIndicatorSep+i.getNumItems()})}},Y={name:"preloader",appendTo:"bar",order:7,html:{isCustomSVG:!0,inner:'<path fill-rule="evenodd" clip-rule="evenodd" d="M21.2 16a5.2 5.2 0 1 1-5.2-5.2V8a8 8 0 1 0 8 8h-2.8Z" id="pswp__icn-loading"/>',outlineID:"pswp__icn-loading"},onInit:(t,i)=>{let e,s=null;const n=i=>{var s;e!==i&&(e=i,s=i,t.classList.toggle("pswp__preloader--active",s))},o=()=>{if(!i.currSlide?.content.isLoading())return n(!1),void(s&&(clearTimeout(s),s=null));s||(s=setTimeout(()=>{n(Boolean(i.currSlide?.content.isLoading())),s=null},i.options.preloaderDelay))};i.on("change",o),i.on("loadComplete",t=>{i.currSlide===t.slide&&o()}),i.ui&&(i.ui.updatePreloaderVisibility=o)}},J=class{constructor(t,i){const e=i.name||i.className;let s=i.html;if(!1===t.options[e])return;"string"==typeof t.options[`${e}SVG`]&&(s=t.options[`${e}SVG`]),t.dispatch("uiElementCreate",{data:i});let n="";i.isButton?(n+="pswp__button ",n+=i.className||`pswp__button--${i.name}`):n+=i.className||`pswp__${i.name}`;let o=i.isButton?i.tagName||"button":i.tagName||"div";o=o.toLowerCase();const a=h(n,o);if(i.isButton){"button"===o&&(a.type="button");let{title:s}=i;const{ariaLabel:n}=i;"string"==typeof t.options[`${e}Title`]&&(s=t.options[`${e}Title`]),s&&(a.title=s);const r=n||s;r&&a.setAttribute("aria-label",r)}a.innerHTML=function(t){if("string"==typeof t)return t;if(!t||!t.isCustomSVG)return"";const i=t;let e='<svg aria-hidden="true" class="pswp__icn" viewBox="0 0 %d %d" width="%d" height="%d">';return e=e.split("%d").join(i.size||32),i.outlineID&&(e+=`<use class="pswp__icn-shadow" xlink:href="#${i.outlineID}"/>`),e+=i.inner,e+="</svg>",e}(s),i.onInit&&i.onInit(a,t),i.onClick&&(a.onclick=e=>{"string"==typeof i.onClick?t[i.onClick]():"function"==typeof i.onClick&&i.onClick(e,a,t)});const r=i.appendTo||"bar";let l=t.element;"bar"===r?(t.topBar||(t.topBar=h("pswp__top-bar pswp__hide-on-close","div",t.scrollWrap)),l=t.topBar):(a.classList.add("pswp__hide-on-close"),"wrapper"===r&&(l=t.scrollWrap)),l?.appendChild(t.applyFilters("uiElement",a,i))}};function Q(t,i){t.classList.toggle("pswp--zoomed-in",i)}var tt=class{constructor(t){this.pswp=t,this.isRegistered=!1,this.uiElementsData=[],this.items=[],this.updatePreloaderVisibility=()=>{},this._lastUpdatedZoomLevel=void 0}init(){const{pswp:t}=this;this.isRegistered=!1,this.uiElementsData=[j,U,G,K,Y,X],t.dispatch("uiRegister"),this.uiElementsData.sort((t,i)=>(t.order||0)-(i.order||0)),this.items=[],this.isRegistered=!0,this.uiElementsData.forEach(t=>{this.registerElement(t)}),t.on("change",()=>{t.element?.classList.toggle("pswp--one-slide",1===t.getNumItems())}),t.on("zoomPanUpdate",()=>this._onZoomPanUpdate())}registerElement(t){this.isRegistered?this.items.push(new J(this.pswp,t)):this.uiElementsData.push(t)}_onZoomPanUpdate(){const{template:t,currSlide:i,options:e}=this.pswp;if(this.pswp.opener.isClosing||!t||!i)return;let{currZoomLevel:s}=i;if(this.pswp.opener.isOpen||(s=i.zoomLevels.initial),s===this._lastUpdatedZoomLevel)return;this._lastUpdatedZoomLevel=s;const n=i.zoomLevels.initial-i.zoomLevels.secondary;if(Math.abs(n)<.01||!i.isZoomable())return Q(t,!1),void t.classList.remove("pswp--zoom-allowed");t.classList.add("pswp--zoom-allowed"),Q(t,(s===i.zoomLevels.initial?i.zoomLevels.secondary:i.zoomLevels.initial)<=s),"zoom"!==e.imageClickAction&&"zoom-or-close"!==e.imageClickAction||t.classList.add("pswp--click-to-zoom")}},it="cubic-bezier(.4,0,.22,1)",et=class{constructor(t){this.props=t;const{target:i,onComplete:e,transform:s,onFinish:n=()=>{},duration:o=333,easing:a=it}=t;this.onFinish=n;const r=s?"transform":"opacity",h=t[r]??"";this._target=i,this._onComplete=e,this._finished=!1,this._onTransitionEnd=this._onTransitionEnd.bind(this),this._helperTimeout=setTimeout(()=>{g(i,r,o,a),this._helperTimeout=setTimeout(()=>{i.addEventListener("transitionend",this._onTransitionEnd,!1),i.addEventListener("transitioncancel",this._onTransitionEnd,!1),this._helperTimeout=setTimeout(()=>{this._finalizeAnimation()},o+500),i.style[r]=h},30)},0)}_onTransitionEnd(t){t.target===this._target&&this._finalizeAnimation()}_finalizeAnimation(){this._finished||(this._finished=!0,this.onFinish(),this._onComplete&&this._onComplete())}destroy(){this._helperTimeout&&(clearTimeout(this._helperTimeout),this._helperTimeout=null),g(this._target),this._target.removeEventListener("transitionend",this._onTransitionEnd,!1),this._target.removeEventListener("transitioncancel",this._onTransitionEnd,!1),this._finished||this._finalizeAnimation()}},st=class{constructor(t,i,e){this.velocity=1e3*t,this._dampingRatio=i||.75,this._naturalFrequency=e||12,this._dampedFrequency=this._naturalFrequency,this._dampingRatio<1&&(this._dampedFrequency*=Math.sqrt(1-this._dampingRatio*this._dampingRatio))}easeFrame(t,i){let e,s=0;i/=1e3;const n=Math.E**(-this._dampingRatio*this._naturalFrequency*i);if(1===this._dampingRatio)e=this.velocity+this._naturalFrequency*t,s=(t+e*i)*n,this.velocity=s*-this._naturalFrequency+e*n;else if(this._dampingRatio<1){e=1/this._dampedFrequency*(this._dampingRatio*this._naturalFrequency*t+this.velocity);const o=Math.cos(this._dampedFrequency*i),a=Math.sin(this._dampedFrequency*i);s=n*(t*o+e*a),this.velocity=s*-this._naturalFrequency*this._dampingRatio+n*(-this._dampedFrequency*t*a+this._dampedFrequency*e*o)}return s}},nt=class{constructor(t){this.props=t,this._raf=0;const{start:i,end:e,velocity:s,onUpdate:n,onComplete:o,onFinish:a=()=>{},dampingRatio:r,naturalFrequency:h}=t;this.onFinish=a;const l=new st(s,r,h);let p=Date.now(),d=i-e;const c=()=>{this._raf&&(d=l.easeFrame(d,Date.now()-p),Math.abs(d)<1&&Math.abs(l.velocity)<50?(n(e),o&&o(),this.onFinish()):(p=Date.now(),n(d+e),this._raf=requestAnimationFrame(c)))};this._raf=requestAnimationFrame(c)}destroy(){this._raf>=0&&cancelAnimationFrame(this._raf),this._raf=0}},ot=class{constructor(){this.activeAnimations=[]}startSpring(t){this._start(t,!0)}startTransition(t){this._start(t)}_start(t,i){const e=i?new nt(t):new et(t);return this.activeAnimations.push(e),e.onFinish=()=>this.stop(e),e}stop(t){t.destroy();const i=this.activeAnimations.indexOf(t);i>-1&&this.activeAnimations.splice(i,1)}stopAll(){this.activeAnimations.forEach(t=>{t.destroy()}),this.activeAnimations=[]}stopAllPan(){this.activeAnimations=this.activeAnimations.filter(t=>!t.props.isPan||(t.destroy(),!1))}stopMainScroll(){this.activeAnimations=this.activeAnimations.filter(t=>!t.props.isMainScroll||(t.destroy(),!1))}isPanRunning(){return this.activeAnimations.some(t=>t.props.isPan)}},at=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:()=>{at=!0}}))}catch(yt){}var rt=class{constructor(){this._pool=[]}add(t,i,e,s){this._toggleListener(t,i,e,s)}remove(t,i,e,s){this._toggleListener(t,i,e,s,!0)}removeAll(){this._pool.forEach(t=>{this._toggleListener(t.target,t.type,t.listener,t.passive,!0,!0)}),this._pool=[]}_toggleListener(t,i,e,s,n,o){if(!t)return;const a=n?"removeEventListener":"addEventListener";i.split(" ").forEach(i=>{if(i){o||(n?this._pool=this._pool.filter(s=>s.type!==i||s.listener!==e||s.target!==t):this._pool.push({target:t,type:i,listener:e,passive:s}));const r=!!at&&{passive:s||!1};t[a](i,e,r)}})}},ht={Escape:27,z:90,ArrowLeft:37,ArrowUp:38,ArrowRight:39,ArrowDown:40,Tab:9},lt=(t,i)=>i?t:ht[t],pt=class{constructor(t){this.pswp=t,this._wasFocused=!1,t.on("bindEvents",()=>{t.options.trapFocus&&(t.options.initialPointerPos||this._focusRoot(),t.events.add(document,"focusin",this._onFocusIn.bind(this))),t.events.add(document,"keydown",this._onKeyDown.bind(this))});const i=document.activeElement;t.on("destroy",()=>{t.options.returnFocus&&i&&this._wasFocused&&i.focus()})}_focusRoot(){!this._wasFocused&&this.pswp.element&&(this.pswp.element.focus(),this._wasFocused=!0)}_onKeyDown(t){const{pswp:i}=this;if(i.dispatch("keydown",{originalEvent:t}).defaultPrevented)return;if(x(t))return;let e,s,n=!1;const o="key"in t;switch(o?t.key:t.keyCode){case lt("Escape",o):i.options.escKey&&(e="close");break;case lt("z",o):e="toggleZoom";break;case lt("ArrowLeft",o):s="x";break;case lt("ArrowUp",o):s="y";break;case lt("ArrowRight",o):s="x",n=!0;break;case lt("ArrowDown",o):n=!0,s="y";break;case lt("Tab",o):this._focusRoot()}if(s){t.preventDefault();const{currSlide:o}=i;i.options.arrowKeys&&"x"===s&&i.getNumItems()>1?e=n?"next":"prev":o&&o.currZoomLevel>o.zoomLevels.fit&&(o.pan[s]+=n?-80:80,o.panTo(o.pan.x,o.pan.y))}e&&(t.preventDefault(),i[e]())}_onFocusIn(t){const{template:i}=this.pswp;i&&document!==t.target&&i!==t.target&&!i.contains(t.target)&&i.focus()}},dt=class{constructor(t){this.pswp=t,this.x=0,this.slideWidth=0,this._currPositionIndex=0,this._prevPositionIndex=0,this._containerShiftIndex=-1,this.itemHolders=[]}resize(t){const{pswp:i}=this,e=Math.round(i.viewportSize.x+i.viewportSize.x*i.options.spacing),s=e!==this.slideWidth;s&&(this.slideWidth=e,this.moveTo(this.getCurrSlideX())),this.itemHolders.forEach((i,e)=>{s&&_(i.el,(e+this._containerShiftIndex)*this.slideWidth),t&&i.slide&&i.slide.resize()})}resetPosition(){this._currPositionIndex=0,this._prevPositionIndex=0,this.slideWidth=0,this._containerShiftIndex=-1}appendHolders(){this.itemHolders=[];for(let t=0;t<3;t++){const i=h("pswp__item","div",this.pswp.container);i.setAttribute("role","group"),i.setAttribute("aria-roledescription","slide"),i.setAttribute("aria-hidden","true"),i.style.display=1===t?"block":"none",this.itemHolders.push({el:i})}}canBeSwiped(){return this.pswp.getNumItems()>1}moveIndexBy(t,i,e){const{pswp:s}=this;let n=s.potentialIndex+t;const o=s.getNumItems();if(s.canLoop()){n=s.getLoopedIndex(n);const i=(t+o)%o;t=i<=o/2?i:i-o}else n<0?n=0:n>=o&&(n=o-1),t=n-s.potentialIndex;s.potentialIndex=n,this._currPositionIndex-=t,s.animations.stopMainScroll();const a=this.getCurrSlideX();if(i){s.animations.startSpring({isMainScroll:!0,start:this.x,end:a,velocity:e||0,naturalFrequency:30,dampingRatio:1,onUpdate:t=>{this.moveTo(t)},onComplete:()=>{this.updateCurrItem(),s.appendHeavy()}});let t=s.potentialIndex-s.currIndex;if(s.canLoop()){const i=(t+o)%o;t=i<=o/2?i:i-o}Math.abs(t)>1&&this.updateCurrItem()}else this.moveTo(a),this.updateCurrItem();return Boolean(t)}getCurrSlideX(){return this.slideWidth*this._currPositionIndex}isShifted(){return this.x!==this.getCurrSlideX()}updateCurrItem(){const{pswp:t}=this,i=this._prevPositionIndex-this._currPositionIndex;if(!i)return;this._prevPositionIndex=this._currPositionIndex,t.currIndex=t.potentialIndex;let e,s=Math.abs(i);s>=3&&(this._containerShiftIndex+=i+(i>0?-3:3),s=3,this.itemHolders.forEach(t=>{t.slide?.destroy(),t.slide=void 0}));for(let n=0;n<s;n++)i>0?(e=this.itemHolders.shift(),e&&(this.itemHolders[2]=e,this._containerShiftIndex++,_(e.el,(this._containerShiftIndex+2)*this.slideWidth),t.setContent(e,t.currIndex-s+n+2))):(e=this.itemHolders.pop(),e&&(this.itemHolders.unshift(e),this._containerShiftIndex--,_(e.el,this._containerShiftIndex*this.slideWidth),t.setContent(e,t.currIndex+s-n-2)));Math.abs(this._containerShiftIndex)>50&&!this.isShifted()&&(this.resetPosition(),this.resize()),t.animations.stopAllPan(),this.itemHolders.forEach((t,i)=>{t.slide&&t.slide.setIsActive(1===i)}),t.currSlide=this.itemHolders[1]?.slide,t.contentLoader.updateLazy(i),t.currSlide&&t.currSlide.applyCurrentZoomPan(),t.dispatch("change")}moveTo(t,i){if(!this.pswp.canLoop()&&i){let i=(this.slideWidth*this._currPositionIndex-t)/this.slideWidth;i+=this.pswp.currIndex;const e=Math.round(t-this.x);(i<0&&e>0||i>=this.pswp.getNumItems()-1&&e<0)&&(t=this.x+.35*e)}this.x=t,this.pswp.container&&_(this.pswp.container,t),this.pswp.dispatch("moveMainScroll",{x:t,dragging:i??!1})}},ct=.003,mt=class{constructor(t){this.pswp=t,this.isClosed=!0,this.isOpen=!1,this.isClosing=!1,this.isOpening=!1,this._duration=void 0,this._useAnimation=!1,this._croppedZoom=!1,this._animateRootOpacity=!1,this._animateBgOpacity=!1,this._placeholder=void 0,this._opacityElement=void 0,this._cropContainer1=void 0,this._cropContainer2=void 0,this._thumbBounds=void 0,this._prepareOpen=this._prepareOpen.bind(this),t.on("firstZoomPan",this._prepareOpen)}open(){this._prepareOpen(),this._start()}close(){if(this.isClosed||this.isClosing||this.isOpening)return;const t=this.pswp.currSlide;this.isOpen=!1,this.isOpening=!1,this.isClosing=!0,this._duration=this.pswp.options.hideAnimationDuration,t&&t.currZoomLevel*t.width>=this.pswp.options.maxWidthToAnimate&&(this._duration=0),this._applyStartProps(),setTimeout(()=>{this._start()},this._croppedZoom?30:0)}_prepareOpen(){if(this.pswp.off("firstZoomPan",this._prepareOpen),!this.isOpening){const t=this.pswp.currSlide;this.isOpening=!0,this.isClosing=!1,this._duration=this.pswp.options.showAnimationDuration,t&&t.zoomLevels.initial*t.width>=this.pswp.options.maxWidthToAnimate&&(this._duration=0),this._applyStartProps()}}_applyStartProps(){const{pswp:t}=this,i=this.pswp.currSlide,{options:e}=t;if("fade"===e.showHideAnimationType?(e.showHideOpacity=!0,this._thumbBounds=void 0):"none"===e.showHideAnimationType?(e.showHideOpacity=!1,this._duration=0,this._thumbBounds=void 0):this.isOpening&&t._initialThumbBounds?this._thumbBounds=t._initialThumbBounds:this._thumbBounds=this.pswp.getThumbBounds(),this._placeholder=i?.getPlaceholderElement(),t.animations.stopAll(),this._useAnimation=Boolean(this._duration&&this._duration>50),this._animateZoom=Boolean(this._thumbBounds)&&i?.content.usePlaceholder()&&(!this.isClosing||!t.mainScroll.isShifted()),this._animateZoom?this._animateRootOpacity=e.showHideOpacity??!1:(this._animateRootOpacity=!0,this.isOpening&&i&&(i.zoomAndPanToInitial(),i.applyCurrentZoomPan())),this._animateBgOpacity=!this._animateRootOpacity&&this.pswp.options.bgOpacity>ct,this._opacityElement=this._animateRootOpacity?t.element:t.bg,!this._useAnimation)return this._duration=0,this._animateZoom=!1,this._animateBgOpacity=!1,this._animateRootOpacity=!0,void(this.isOpening&&(t.element&&(t.element.style.opacity=String(ct)),t.applyBgOpacity(1)));this._animateZoom&&this._thumbBounds&&this._thumbBounds.innerRect?(this._croppedZoom=!0,this._cropContainer1=this.pswp.container,this._cropContainer2=this.pswp.currSlide?.holderElement,t.container&&(t.container.style.overflow="hidden",t.container.style.width=`${t.viewportSize.x}px`)):this._croppedZoom=!1,this.isOpening?(this._animateRootOpacity?(t.element&&(t.element.style.opacity=String(ct)),t.applyBgOpacity(1)):(this._animateBgOpacity&&t.bg&&(t.bg.style.opacity=String(ct)),t.element&&(t.element.style.opacity="1")),this._animateZoom&&(this._setClosedStateZoomPan(),this._placeholder&&(this._placeholder.style.willChange="transform",this._placeholder.style.opacity=String(ct)))):this.isClosing&&(t.mainScroll.itemHolders[0]&&(t.mainScroll.itemHolders[0].el.style.display="none"),t.mainScroll.itemHolders[2]&&(t.mainScroll.itemHolders[2].el.style.display="none"),this._croppedZoom&&0!==t.mainScroll.x&&(t.mainScroll.resetPosition(),t.mainScroll.resize()))}_start(){this.isOpening&&this._useAnimation&&this._placeholder&&"IMG"===this._placeholder.tagName?new Promise(t=>{let i=!1,e=!0;var s;(s=this._placeholder,"decode"in s?s.decode().catch(()=>{}):s.complete?Promise.resolve(s):new Promise((t,i)=>{s.onload=()=>t(s),s.onerror=i})).finally(()=>{i=!0,e||t(!0)}),setTimeout(()=>{e=!1,i&&t(!0)},50),setTimeout(t,250)}).finally(()=>this._initiate()):this._initiate()}_initiate(){this.pswp.element?.style.setProperty("--pswp-transition-duration",`${this._duration}ms`),this.pswp.dispatch(this.isOpening?"openingAnimationStart":"closingAnimationStart"),this.pswp.dispatch("initialZoom"+(this.isOpening?"In":"Out")),this.pswp.element?.classList.toggle("pswp--ui-visible",this.isOpening),this.isOpening?(this._placeholder&&(this._placeholder.style.opacity="1"),this._animateToOpenState()):this.isClosing&&this._animateToClosedState(),this._useAnimation||this._onAnimationComplete()}_onAnimationComplete(){const{pswp:t}=this;this.isOpen=this.isOpening,this.isClosed=this.isClosing,this.isOpening=!1,this.isClosing=!1,t.dispatch(this.isOpen?"openingAnimationEnd":"closingAnimationEnd"),t.dispatch("initialZoom"+(this.isOpen?"InEnd":"OutEnd")),this.isClosed?t.destroy():this.isOpen&&(this._animateZoom&&t.container&&(t.container.style.overflow="visible",t.container.style.width="100%"),t.currSlide?.applyCurrentZoomPan())}_animateToOpenState(){const{pswp:t}=this;this._animateZoom&&(this._croppedZoom&&this._cropContainer1&&this._cropContainer2&&(this._animateTo(this._cropContainer1,"transform","translate3d(0,0,0)"),this._animateTo(this._cropContainer2,"transform","none")),t.currSlide&&(t.currSlide.zoomAndPanToInitial(),this._animateTo(t.currSlide.container,"transform",t.currSlide.getCurrentTransform()))),this._animateBgOpacity&&t.bg&&this._animateTo(t.bg,"opacity",String(t.options.bgOpacity)),this._animateRootOpacity&&t.element&&this._animateTo(t.element,"opacity","1")}_animateToClosedState(){const{pswp:t}=this;this._animateZoom&&this._setClosedStateZoomPan(!0),this._animateBgOpacity&&t.bgOpacity>.01&&t.bg&&this._animateTo(t.bg,"opacity","0"),this._animateRootOpacity&&t.element&&this._animateTo(t.element,"opacity","0")}_setClosedStateZoomPan(t){if(!this._thumbBounds)return;const{pswp:i}=this,{innerRect:e}=this._thumbBounds,{currSlide:s,viewportSize:n}=i;if(this._croppedZoom&&e&&this._cropContainer1&&this._cropContainer2){const i=-n.x+(this._thumbBounds.x-e.x)+e.w,s=-n.y+(this._thumbBounds.y-e.y)+e.h,o=n.x-e.w,a=n.y-e.h;t?(this._animateTo(this._cropContainer1,"transform",u(i,s)),this._animateTo(this._cropContainer2,"transform",u(o,a))):(_(this._cropContainer1,i,s),_(this._cropContainer2,o,a))}s&&(l(s.pan,e||this._thumbBounds),s.currZoomLevel=this._thumbBounds.w/s.width,t?this._animateTo(s.container,"transform",s.getCurrentTransform()):s.applyCurrentZoomPan())}_animateTo(t,i,e){if(!this._duration)return void(t.style[i]=e);const{animations:s}=this.pswp,n={duration:this._duration,easing:this.pswp.options.easing,onComplete:()=>{s.activeAnimations.length||this._onAnimationComplete()},target:t};n[i]=e,s.startTransition(n)}},ut=class{constructor(t){this.pswp=t,t.events.add(t.element,"wheel",this._onWheel.bind(this))}_onWheel(t){t.preventDefault();const{currSlide:i}=this.pswp;let{deltaX:e,deltaY:s}=t;if(i&&!this.pswp.dispatch("wheel",{originalEvent:t}).defaultPrevented)if(t.ctrlKey||this.pswp.options.wheelToZoom){if(i.isZoomable()){let e=-s;1===t.deltaMode?e*=.05:e*=t.deltaMode?1:.002,e=2**e;const n=i.currZoomLevel*e;i.zoomTo(n,{x:t.clientX,y:t.clientY})}}else i.isPannable()&&(1===t.deltaMode&&(e*=18,s*=18),i.panTo(i.pan.x-e,i.pan.y-s))}},_t={allowPanToNext:!0,spacing:.1,loop:!0,pinchToClose:!0,closeOnVerticalDrag:!0,hideAnimationDuration:333,showAnimationDuration:333,zoomAnimationDuration:333,escKey:!0,arrowKeys:!0,trapFocus:!0,returnFocus:!0,maxWidthToAnimate:4e3,clickToCloseNonZoomable:!0,imageClickAction:"zoom-or-close",bgClickAction:"close",tapAction:"toggle-controls",doubleTapAction:"zoom",indexIndicatorSep:" / ",preloaderDelay:2e3,bgOpacity:.8,index:0,errorMsg:"The image cannot be loaded",preload:[1,2],easing:"cubic-bezier(.4,0,.22,1)"},gt=class extends M{constructor(t){super(),this.options=this._prepareOptions(t||{}),this.offset={x:0,y:0},this._prevViewportSize={x:0,y:0},this.viewportSize={x:0,y:0},this.bgOpacity=1,this.currIndex=0,this.potentialIndex=0,this.isOpen=!1,this.isDestroying=!1,this.hasMouse=!1,this._initialItemData={},this._initialThumbBounds=void 0,this.topBar=void 0,this.element=void 0,this.template=void 0,this.container=void 0,this.scrollWrap=void 0,this.currSlide=void 0,this.events=new rt,this.animations=new ot,this.mainScroll=new dt(this),this.gestures=new W(this),this.opener=new mt(this),this.keyboard=new pt(this),this.contentLoader=new O(this)}init(){if(this.isOpen||this.isDestroying)return!1;this.isOpen=!0,this.dispatch("init"),this.dispatch("beforeOpen"),this._createMainStructure();let t="pswp--open";return this.gestures.supportsTouch&&(t+=" pswp--touch"),this.options.mainClass&&(t+=` ${this.options.mainClass}`),this.element&&(this.element.className+=` ${t}`),this.currIndex=this.options.index||0,this.potentialIndex=this.currIndex,this.dispatch("firstUpdate"),this.scrollWheel=new ut(this),(Number.isNaN(this.currIndex)||this.currIndex<0||this.currIndex>=this.getNumItems())&&(this.currIndex=0),this.gestures.supportsTouch||this.mouseDetected(),this.updateSize(),this.offset.y=window.pageYOffset,this._initialItemData=this.getItemData(this.currIndex),this.dispatch("gettingData",{index:this.currIndex,data:this._initialItemData,slide:void 0}),this._initialThumbBounds=this.getThumbBounds(),this.dispatch("initialLayout"),this.on("openingAnimationEnd",()=>{const{itemHolders:t}=this.mainScroll;t[0]&&(t[0].el.style.display="block",this.setContent(t[0],this.currIndex-1)),t[2]&&(t[2].el.style.display="block",this.setContent(t[2],this.currIndex+1)),this.appendHeavy(),this.contentLoader.updateLazy(),this.events.add(window,"resize",this._handlePageResize.bind(this)),this.events.add(window,"scroll",this._updatePageScrollOffset.bind(this)),this.dispatch("bindEvents")}),this.mainScroll.itemHolders[1]&&this.setContent(this.mainScroll.itemHolders[1],this.currIndex),this.dispatch("change"),this.opener.open(),this.dispatch("afterInit"),!0}getLoopedIndex(t){const i=this.getNumItems();return this.options.loop&&(t>i-1&&(t-=i),t<0&&(t+=i)),m(t,0,i-1)}appendHeavy(){this.mainScroll.itemHolders.forEach(t=>{t.slide?.appendHeavy()})}goTo(t){this.mainScroll.moveIndexBy(this.getLoopedIndex(t)-this.potentialIndex,!0)}next(){this.goTo(this.potentialIndex+1)}prev(){this.goTo(this.potentialIndex-1)}zoomTo(...t){this.currSlide?.zoomTo(...t)}toggleZoom(){this.currSlide?.toggleZoom()}close(){this.opener.isOpen&&!this.isDestroying&&(this.isDestroying=!0,this.dispatch("close"),this.events.removeAll(),this.opener.close())}destroy(){if(!this.isDestroying)return this.options.showHideAnimationType="none",void this.close();this.dispatch("destroy"),this._listeners={},this.scrollWrap&&(this.scrollWrap.ontouchmove=null,this.scrollWrap.ontouchend=null),this.element?.remove(),this.mainScroll.itemHolders.forEach(t=>{t.slide?.destroy()}),this.contentLoader.destroy(),this.events.removeAll()}refreshSlideContent(t){this.contentLoader.removeByIndex(t),this.mainScroll.itemHolders.forEach((i,e)=>{let s=(this.currSlide?.index??0)-1+e;this.canLoop()&&(s=this.getLoopedIndex(s)),s===t&&(this.setContent(i,t,!0),1===e&&(this.currSlide=i.slide,i.slide?.setIsActive(!0)))}),this.dispatch("change")}setContent(t,i,e){if(this.canLoop()&&(i=this.getLoopedIndex(i)),t.slide){if(t.slide.index===i&&!e)return;t.slide.destroy(),t.slide=void 0}!this.canLoop()&&(i<0||i>=this.getNumItems())||(t.slide=new q(this.getItemData(i),i,this),i===this.currIndex&&(this.currSlide=t.slide),t.slide.append(t.el))}getViewportCenterPoint(){return{x:this.viewportSize.x/2,y:this.viewportSize.y/2}}updateSize(t){if(this.isDestroying)return;const i=L(this.options,this);!t&&c(i,this._prevViewportSize)||(l(this._prevViewportSize,i),this.dispatch("beforeResize"),l(this.viewportSize,this._prevViewportSize),this._updatePageScrollOffset(),this.dispatch("viewportSize"),this.mainScroll.resize(this.opener.isOpen),!this.hasMouse&&window.matchMedia("(any-hover: hover)").matches&&this.mouseDetected(),this.dispatch("resize"))}applyBgOpacity(t){this.bgOpacity=Math.max(t,0),this.bg&&(this.bg.style.opacity=String(this.bgOpacity*this.options.bgOpacity))}mouseDetected(){this.hasMouse||(this.hasMouse=!0,this.element?.classList.add("pswp--has_mouse"))}_handlePageResize(){this.updateSize(),/iPhone|iPad|iPod/i.test(window.navigator.userAgent)&&setTimeout(()=>{this.updateSize()},500)}_updatePageScrollOffset(){this.setScrollOffset(0,window.pageYOffset)}setScrollOffset(t,i){this.offset.x=t,this.offset.y=i,this.dispatch("updateScrollOffset")}_createMainStructure(){this.element=h("pswp","div"),this.element.setAttribute("tabindex","-1"),this.element.setAttribute("role","dialog"),this.template=this.element,this.bg=h("pswp__bg","div",this.element),this.scrollWrap=h("pswp__scroll-wrap","section",this.element),this.container=h("pswp__container","div",this.scrollWrap),this.scrollWrap.setAttribute("aria-roledescription","carousel"),this.container.setAttribute("aria-live","off"),this.container.setAttribute("id","pswp__items"),this.mainScroll.appendHolders(),this.ui=new tt(this),this.ui.init(),(this.options.appendToEl||document.body).appendChild(this.element)}getThumbBounds(){return function(t,i,e){const s=e.dispatch("thumbBounds",{index:t,itemData:i,instance:e});if(s.thumbBounds)return s.thumbBounds;const{element:n}=i;let o,a;if(n&&!1!==e.options.thumbSelector){const t=e.options.thumbSelector||"img";a=n.matches(t)?n:n.querySelector(t)}return a=e.applyFilters("thumbEl",a,i,t),a&&(o=i.thumbCropped?function(t,i,e){const s=t.getBoundingClientRect(),n=s.width/i,o=s.height/e,a=n>o?n:o,r=(s.width-i*a)/2,h=(s.height-e*a)/2,l={x:s.left+r,y:s.top+h,w:i*a};return l.innerRect={w:s.width,h:s.height,x:r,y:h},l}(a,i.width||i.w||0,i.height||i.h||0):function(t){const i=t.getBoundingClientRect();return{x:i.left,y:i.top,w:i.width}}(a)),e.applyFilters("thumbBounds",o,i,t)}(this.currIndex,this.currSlide?this.currSlide.data:this._initialItemData,this)}canLoop(){return this.options.loop&&this.getNumItems()>2}_prepareOptions(t){return window.matchMedia("(prefers-reduced-motion), (update: slow)").matches&&(t.showHideAnimationType="none",t.zoomAnimationDuration=0),{..._t,...t}}},vt=()=>Promise.resolve(gt);export{F as n,r,vt as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as e,h as t,p as l,t as n,v as r,w as a}from"./C3uDEVBt.js";import{N as o,P as s,i,n as d,u as c}from"./BItJQVdK.js";import{t as u}from"./
|
|
1
|
+
import{b as e,h as t,p as l,t as n,v as r,w as a}from"./C3uDEVBt.js";import{N as o,P as s,i,n as d,u as c}from"./BItJQVdK.js";import{t as u}from"./CSO2IaJ1.js";var h=(e,t)=>e.filter(e=>(e.parentFolderId??null)===t).map(t=>{return{folder:t,children:h(e,t._id),eventCount:t.boundary?.length??0,centroid:(l=t.boundary,l?.length?[l.reduce((e,t)=>e+t.x,0)/l.length,l.reduce((e,t)=>e+t.y,0)/l.length]:null),color:t.color||"#fb8500"};var l}).filter(e=>e.eventCount>0||e.children.length>0),p=e=>e.filter(e=>"number"==typeof e.location?.x&&"number"==typeof e.location?.y),m=()=>{const{folders:n,organization:a}=d(),[i,u]=t(null),m=Boolean(a?.integrationSettings?.enableFolderView),f=l(()=>m?h(n??[],null):[],[n,m]),g=s({queryKey:["map-all-events",a?._id],queryFn:async()=>p((await o.get(c.PUBLIC_EVENTS,{headers:{"x-org-id":a?._id??""},searchParams:{includeAllFolders:!0,limit:500,sort:"-views",contentLimit:3,projection:"connect"}}).json()).data??[]),enabled:Boolean(a?._id)&&!m,staleTime:3e5,gcTime:6e5,retry:!1}),b=s({queryKey:["map-folder-events",a?._id,i],queryFn:async()=>p((await o.get(c.PUBLIC_EVENTS,{headers:{"x-org-id":a?._id??""},searchParams:{folderId:i,limit:500,sort:"-views",contentLimit:3,projection:"connect"}}).json()).data??[]),enabled:Boolean(a?._id)&&m&&Boolean(i),staleTime:3e5,gcTime:6e5,retry:!1}),v=l(()=>(n??[]).find(e=>e._id===i)??null,[n,i]);e(()=>{m||u(null)},[m]);const x=r(e=>{u(e)},[]);return{folderTree:f,activeFolderId:i,activeFolder:v,visibleEvents:m?b.data??[]:g.data??[],setActiveFolderId:x,isLoadingEvents:m?Boolean(i)&&(b.isLoading||b.isFetching):g.isLoading||g.isFetching}},f=()=>/* @__PURE__ */n("svg",{className:"size-5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:/* @__PURE__ */n("path",{d:"m15 18-6-6 6-6"})}),g=()=>/* @__PURE__ */n("svg",{className:"size-5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:/* @__PURE__ */n("path",{d:"m9 18 6-6-6-6"})});function b({items:l,autoplayInterval:r=3e3,showControls:o=!1,className:s}){const[d,c]=t(0);return e(()=>{if(l.length<=1)return;const e=setInterval(()=>c(e=>(e+1)%l.length),r);return()=>clearInterval(e)},[l.length,r]),0===l.length?null:/* @__PURE__ */n("div",{className:i("relative size-full overflow-hidden",s),children:[l.map((e,t)=>/* @__PURE__ */n("div",{className:i("absolute inset-0 transition-opacity duration-500",t===d?"opacity-100":"opacity-0"),children:e},t)),l.length>1&&/* @__PURE__ */n("div",{className:"absolute bottom-2 left-1/2 z-10 flex -translate-x-1/2 gap-1",children:l.map((e,t)=>/* @__PURE__ */n("button",{onClick:()=>c(t),className:i("h-1.5 rounded-full transition-all",t===d?"w-4 bg-white":"w-1.5 bg-white/50 hover:bg-white/75"),"aria-label":`Go to slide ${t+1}`},t))}),o&&l.length>1&&/* @__PURE__ */n(a,{children:[/* @__PURE__ */n("button",{onClick:()=>c(e=>0===e?l.length-1:e-1),className:"absolute top-1/2 left-2 z-10 flex size-8 -translate-y-1/2 items-center justify-center rounded-full bg-black/40 text-white hover:bg-black/60","aria-label":"Previous",children:/* @__PURE__ */n(f,{})}),/* @__PURE__ */n("button",{onClick:()=>c(e=>(e+1)%l.length),className:"absolute top-1/2 right-2 z-10 flex size-8 -translate-y-1/2 items-center justify-center rounded-full bg-black/40 text-white hover:bg-black/60","aria-label":"Next",children:/* @__PURE__ */n(g,{})})]})]})}var v=({event:e,onExplore:t})=>{const l=(e.contents||[]).map(t=>/* @__PURE__ */n(u,{alt:e.name,src:t.thumbnailUrl||t.url,containerClassName:"size-full",imgClassName:"rounded"},t._id)),r=e?.status?.toUpperCase();/* @__PURE__ */
|
|
2
2
|
return n("div",{className:"w-40 rounded pt-2 pl-1",children:[
|
|
3
3
|
/* @__PURE__ */n("div",{className:"relative h-32 w-full overflow-hidden rounded",children:[/* @__PURE__ */n(b,{items:l,autoplayInterval:3e3}),"OPEN"===r&&/* @__PURE__ */n("span",{className:"absolute top-2 left-2 inline-flex items-center gap-1 rounded-full bg-green-500 px-2 py-0.5 text-[10px] font-medium text-white",children:[/* @__PURE__ */n("span",{className:"size-1.5 animate-pulse rounded-full bg-white"}),"Open"]})]}),
|
|
4
4
|
/* @__PURE__ */n("div",{className:"line-clamp-2 pt-2 pb-0.5 text-sm font-medium text-black",children:e.name}),
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{C as t,b as e,f as r,h as n,p as s,t as o}from"./C3uDEVBt.js";import{I as i,a,n as c,w as l}from"./BItJQVdK.js";import{t as u}from"./Be1e_ATJ.js";import{a as h,i as d,n as p,o as f,r as m,t as g}from"./R0dHh5Az2.js";var{getOwnPropertyNames:y,getOwnPropertySymbols:b}=Object,{hasOwnProperty:w}=Object.prototype;function x(t,e){return function(r,n,s){return t(r,n,s)&&e(r,n,s)}}function k(t){return function(e,r,n){if(!e||!r||"object"!=typeof e||"object"!=typeof r)return t(e,r,n);const{cache:s}=n,o=s.get(e),i=s.get(r);if(o&&i)return o===r&&i===e;s.set(e,r),s.set(r,e);const a=t(e,r,n);return s.delete(e),s.delete(r),a}}function E(t){return y(t).concat(b(t))}var v=Object.hasOwn||((t,e)=>w.call(t,e));function M(t,e){return t===e||!t&&!e&&t!=t&&e!=e}var{getOwnPropertyDescriptor:A,keys:C}=Object;function _(t,e){return t.byteLength===e.byteLength&&F(new Uint8Array(t),new Uint8Array(e))}function L(t,e,r){let n=t.length;if(e.length!==n)return!1;for(;n-- >0;)if(!r.equals(t[n],e[n],n,n,t,e,r))return!1;return!0}function j(t,e){return t.byteLength===e.byteLength&&F(new Uint8Array(t.buffer,t.byteOffset,t.byteLength),new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}function I(t,e){return M(t.getTime(),e.getTime())}function O(t,e){return t.name===e.name&&t.message===e.message&&t.cause===e.cause&&t.stack===e.stack}function q(t,e){return t===e}function T(t,e,r){const n=t.size;if(n!==e.size)return!1;if(!n)return!0;const s=new Array(n),o=t.entries();let i,a,c=0;for(;(i=o.next())&&!i.done;){const n=e.entries();let o=!1,l=0;for(;(a=n.next())&&!a.done;){if(s[l]){l++;continue}const n=i.value,u=a.value;if(r.equals(n[0],u[0],c,l,t,e,r)&&r.equals(n[1],u[1],n[0],u[0],t,e,r)){o=s[l]=!0;break}l++}if(!o)return!1;c++}return!0}var P=M;function S(t,e,r){const n=C(t);let s=n.length;if(C(e).length!==s)return!1;for(;s-- >0;)if(!D(t,e,r,n[s]))return!1;return!0}function z(t,e,r){const n=E(t);let s,o,i,a=n.length;if(E(e).length!==a)return!1;for(;a-- >0;){if(s=n[a],!D(t,e,r,s))return!1;if(o=A(t,s),i=A(e,s),(o||i)&&(!o||!i||o.configurable!==i.configurable||o.enumerable!==i.enumerable||o.writable!==i.writable))return!1}return!0}function U(t,e){return M(t.valueOf(),e.valueOf())}function Z(t,e){return t.source===e.source&&t.flags===e.flags}function N(t,e,r){const n=t.size;if(n!==e.size)return!1;if(!n)return!0;const s=new Array(n),o=t.values();let i,a;for(;(i=o.next())&&!i.done;){const n=e.values();let o=!1,c=0;for(;(a=n.next())&&!a.done;){if(!s[c]&&r.equals(i.value,a.value,i.value,a.value,t,e,r)){o=s[c]=!0;break}c++}if(!o)return!1}return!0}function F(t,e){let r=t.byteLength;if(e.byteLength!==r||t.byteOffset!==e.byteOffset)return!1;for(;r-- >0;)if(t[r]!==e[r])return!1;return!0}function B(t,e){return t.hostname===e.hostname&&t.pathname===e.pathname&&t.protocol===e.protocol&&t.port===e.port&&t.hash===e.hash&&t.username===e.username&&t.password===e.password}function D(t,e,r,n){return!("_owner"!==n&&"__o"!==n&&"__v"!==n||!t.$$typeof&&!e.$$typeof)||v(e,n)&&r.equals(t[n],e[n],n,n,t,e,r)}var $={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},R=Object.prototype.toString;var G=V();function V(t={}){const{circular:e=!1,createInternalComparator:r,createState:n,strict:s=!1}=t,o=function({areArrayBuffersEqual:t,areArraysEqual:e,areDataViewsEqual:r,areDatesEqual:n,areErrorsEqual:s,areFunctionsEqual:o,areMapsEqual:i,areNumbersEqual:a,areObjectsEqual:c,arePrimitiveWrappersEqual:l,areRegExpsEqual:u,areSetsEqual:h,areTypedArraysEqual:d,areUrlsEqual:p,unknownTagComparators:f}){return function(m,g,y){if(m===g)return!0;if(null==m||null==g)return!1;const b=typeof m;if(b!==typeof g)return!1;if("object"!==b)return"number"===b?a(m,g,y):"function"===b&&o(m,g,y);const w=m.constructor;if(w!==g.constructor)return!1;if(w===Object)return c(m,g,y);if(Array.isArray(m))return e(m,g,y);if(w===Date)return n(m,g,y);if(w===RegExp)return u(m,g,y);if(w===Map)return i(m,g,y);if(w===Set)return h(m,g,y);const x=R.call(m);if("[object Date]"===x)return n(m,g,y);if("[object RegExp]"===x)return u(m,g,y);if("[object Map]"===x)return i(m,g,y);if("[object Set]"===x)return h(m,g,y);if("[object Object]"===x)return"function"!=typeof m.then&&"function"!=typeof g.then&&c(m,g,y);if("[object URL]"===x)return p(m,g,y);if("[object Error]"===x)return s(m,g,y);if("[object Arguments]"===x)return c(m,g,y);if($[x])return d(m,g,y);if("[object ArrayBuffer]"===x)return t(m,g,y);if("[object DataView]"===x)return r(m,g,y);if("[object Boolean]"===x||"[object Number]"===x||"[object String]"===x)return l(m,g,y);if(f){let t=f[x];if(!t){const e=null!=(k=m)?k[Symbol.toStringTag]:void 0;e&&(t=f[e])}if(t)return t(m,g,y)}var k;return!1}}(function({circular:t,createCustomConfig:e,strict:r}){let n={areArrayBuffersEqual:_,areArraysEqual:r?z:L,areDataViewsEqual:j,areDatesEqual:I,areErrorsEqual:O,areFunctionsEqual:q,areMapsEqual:r?x(T,z):T,areNumbersEqual:P,areObjectsEqual:r?z:S,arePrimitiveWrappersEqual:U,areRegExpsEqual:Z,areSetsEqual:r?x(N,z):N,areTypedArraysEqual:r?x(F,z):F,areUrlsEqual:B,unknownTagComparators:void 0};if(e&&(n=Object.assign({},n,e(n))),t){const t=k(n.areArraysEqual),e=k(n.areMapsEqual),r=k(n.areObjectsEqual),s=k(n.areSetsEqual);n=Object.assign({},n,{areArraysEqual:t,areMapsEqual:e,areObjectsEqual:r,areSetsEqual:s})}return n}(t));return function({circular:t,comparator:e,createState:r,equals:n,strict:s}){if(r)return function(o,i){const{cache:a=(t?/* @__PURE__ */new WeakMap:void 0),meta:c}=r();return e(o,i,{cache:a,equals:n,meta:c,strict:s})};if(t)return function(t,r){return e(t,r,{cache:/* @__PURE__ */new WeakMap,equals:n,meta:void 0,strict:s})};const o={cache:void 0,equals:n,meta:void 0,strict:s};return function(t,r){return e(t,r,o)}}({circular:e,comparator:o,createState:n,equals:r?r(o):(i=o,function(t,e,r,n,s,o,a){return i(t,e,a)}),strict:s});var i}V({strict:!0}),V({circular:!0}),V({circular:!0,strict:!0}),V({createInternalComparator:()=>M}),V({strict:!0,createInternalComparator:()=>M}),V({circular:!0,createInternalComparator:()=>M}),V({circular:!0,createInternalComparator:()=>M,strict:!0});var K=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],W=new Uint32Array(96),X=class t{static from(e){if(!e||void 0===e.byteLength||e.buffer)throw new Error("Data must be an instance of ArrayBuffer or SharedArrayBuffer.");const[r,n]=new Uint8Array(e,0,2);if(219!==r)throw new Error("Data does not appear to be in a KDBush format.");const s=n>>4;if(1!==s)throw new Error(`Got v${s} data when expected v1.`);const o=K[15&n];if(!o)throw new Error("Unrecognized array type.");const[i]=new Uint16Array(e,2,1),[a]=new Uint32Array(e,4,1);return new t(a,i,o,void 0,e)}constructor(t,e=64,r=Float64Array,n=ArrayBuffer,s){if(isNaN(t)||t<0)throw new Error(`Unexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+e,2),65535),this.ArrayType=r,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;const o=K.indexOf(this.ArrayType),i=2*t*this.ArrayType.BYTES_PER_ELEMENT,a=t*this.IndexArrayType.BYTES_PER_ELEMENT,c=(8-a%8)%8;if(o<0)throw new Error(`Unexpected typed array class: ${r}.`);if(s)this.data=s,this.ids=new this.IndexArrayType(s,8,t),this.coords=new r(s,8+a+c,2*t),this._pos=2*t,this._finished=!0;else{const s=this.data=new n(8+i+a+c);this.ids=new this.IndexArrayType(s,8,t),this.coords=new r(s,8+a+c,2*t),this._pos=0,this._finished=!1,new Uint8Array(s,0,2).set([219,16+o]),new Uint16Array(s,2,1)[0]=e,new Uint32Array(s,4,1)[0]=t}}add(t,e){const r=this._pos>>1;return this.ids[r]=r,this.coords[this._pos++]=t,this.coords[this._pos++]=e,r}finish(){const t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return J(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,e,r,n){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:s,coords:o,nodeSize:i}=this;W[0]=0,W[1]=s.length-1,W[2]=0;let a=3;const c=[];for(;a>0;){const l=W[--a],u=W[--a],h=W[--a];if(u-h<=i){for(let i=h;i<=u;i++){const a=o[2*i],l=o[2*i+1];a>=t&&a<=r&&l>=e&&l<=n&&c.push(s[i])}continue}const d=h+u>>1,p=o[2*d],f=o[2*d+1];p>=t&&p<=r&&f>=e&&f<=n&&c.push(s[d]),(0===l?t<=p:e<=f)&&(W[a++]=h,W[a++]=d-1,W[a++]=1-l),(0===l?r>=p:n>=f)&&(W[a++]=d+1,W[a++]=u,W[a++]=1-l)}return c}within(t,e,r){const n=[];return this.withinInto(t,e,r,n),n}withinInto(t,e,r,n){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:s,coords:o,nodeSize:i}=this;W[0]=0,W[1]=s.length-1,W[2]=0;let a=3,c=0;const l=r*r;for(;a>0;){const u=W[--a],h=W[--a],d=W[--a];if(h-d<=i){for(let r=d;r<=h;r++)tt(o[2*r],o[2*r+1],t,e)<=l&&(n[c++]=s[r]);continue}const p=d+h>>1,f=o[2*p],m=o[2*p+1];tt(f,m,t,e)<=l&&(n[c++]=s[p]),(0===u?t-r<=f:e-r<=m)&&(W[a++]=d,W[a++]=p-1,W[a++]=1-u),(0===u?t+r>=f:e+r>=m)&&(W[a++]=p+1,W[a++]=h,W[a++]=1-u)}return c}};function J(t,e,r,n,s,o){if(s-n<=r)return;const i=n+s>>1;Y(t,e,i,n,s,o),J(t,e,r,n,i-1,1-o),J(t,e,r,i+1,s,1-o)}function Y(t,e,r,n,s,o){for(;s>n;){if(s-n>600){const i=s-n+1,a=r-n+1,c=Math.log(i),l=.5*Math.exp(2*c/3),u=.5*Math.sqrt(c*l*(i-l)/i)*(a-i/2<0?-1:1);Y(t,e,r,Math.max(n,Math.floor(r-a*l/i+u)),Math.min(s,Math.floor(r+(i-a)*l/i+u)),o)}const i=e[2*r+o];let a=n,c=s;for(H(t,e,n,r),e[2*s+o]>i&&H(t,e,n,s);a<c;){for(H(t,e,a,c),a++,c--;e[2*a+o]<i;)a++;for(;e[2*c+o]>i;)c--}e[2*n+o]===i?H(t,e,n,c):(c++,H(t,e,c,s)),c<=r&&(n=c+1),r<=c&&(s=c-1)}}function H(t,e,r,n){Q(t,r,n),Q(e,2*r,2*n),Q(e,2*r+1,2*n+1)}function Q(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function tt(t,e,r,n){const s=t-r,o=e-n;return s*s+o*o}var et,rt={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:t=>t},nt=Math.fround||(et=new Float32Array(1),t=>(et[0]=+t,et[0])),st=class{constructor(t){this.options=Object.assign(Object.create(rt),t),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(t){const{log:e,minZoom:r,maxZoom:n}=this.options;e&&console.time("total time");const s=`prepare ${t.length} points`;e&&console.time(s),this.points=t;const o=[];for(let a=0;a<t.length;a++){const e=t[a];if(!e.geometry)continue;const[r,n]=e.geometry.coordinates,s=nt(at(r)),i=nt(ct(n));o.push(s,i,1/0,a,-1,1),this.options.reduce&&o.push(0)}let i=this.trees[n+1]=this._createTree(o);e&&console.timeEnd(s);for(let a=n;a>=r;a--){const t=+Date.now();i=this.trees[a]=this._createTree(this._cluster(i,a)),e&&console.log("z%d: %d clusters in %dms",a,i.numItems,+Date.now()-t)}return e&&console.timeEnd("total time"),this}getClusters(t,e){let r=((t[0]+180)%360+360)%360-180;const n=Math.max(-90,Math.min(90,t[1]));let s=180===t[2]?180:((t[2]+180)%360+360)%360-180;const o=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)r=-180,s=180;else if(r>s){const t=this.getClusters([r,n,180,o],e),i=this.getClusters([-180,n,s,o],e);return t.concat(i)}const i=this.trees[this._limitZoom(e)],a=i.range(at(r),ct(o),at(s),ct(n)),c=i.data,l=[];for(const u of a){const t=this.stride*u;l.push(c[t+5]>1?ot(c,t,this.clusterProps):this.points[c[t+3]])}return l}getChildren(t){const e=this._getOriginId(t),r=this._getOriginZoom(t),n="No cluster with the specified id.",s=this.trees[r];if(!s)throw new Error(n);const o=s.data;if(e*this.stride>=o.length)throw new Error(n);const i=this.options.radius/(this.options.extent*Math.pow(2,r-1)),a=o[e*this.stride],c=o[e*this.stride+1],l=s.within(a,c,i),u=[];for(const h of l){const e=h*this.stride;o[e+4]===t&&u.push(o[e+5]>1?ot(o,e,this.clusterProps):this.points[o[e+3]])}if(0===u.length)throw new Error(n);return u}getLeaves(t,e,r){e=e||10,r=r||0;const n=[];return this._appendLeaves(n,t,e,r,0),n}getTile(t,e,r){const n=this.trees[this._limitZoom(t)],s=Math.pow(2,t),{extent:o,radius:i}=this.options,a=i/o,c=(r-a)/s,l=(r+1+a)/s,u={features:[]};return this._addTileFeatures(n.range((e-a)/s,c,(e+1+a)/s,l),n.data,e,r,s,u),0===e&&this._addTileFeatures(n.range(1-a/s,c,1,l),n.data,s,r,s,u),e===s-1&&this._addTileFeatures(n.range(0,c,a/s,l),n.data,-1,r,s,u),u.features.length?u:null}getClusterExpansionZoom(t){let e=this._getOriginZoom(t)-1;for(;e<=this.options.maxZoom;){const r=this.getChildren(t);if(e++,1!==r.length)break;t=r[0].properties.cluster_id}return e}_appendLeaves(t,e,r,n,s){const o=this.getChildren(e);for(const i of o){const e=i.properties;if(e&&e.cluster?s+e.point_count<=n?s+=e.point_count:s=this._appendLeaves(t,e.cluster_id,r,n,s):s<n?s++:t.push(i),t.length===r)break}return s}_createTree(t){const e=new X(t.length/this.stride|0,this.options.nodeSize,Float32Array);for(let r=0;r<t.length;r+=this.stride)e.add(t[r],t[r+1]);return e.finish(),e.data=t,e}_addTileFeatures(t,e,r,n,s,o){for(const i of t){const t=i*this.stride,a=e[t+5]>1;let c,l,u;if(a)c=it(e,t,this.clusterProps),l=e[t],u=e[t+1];else{const r=this.points[e[t+3]];c=r.properties;const[n,s]=r.geometry.coordinates;l=at(n),u=ct(s)}const h={type:1,geometry:[[Math.round(this.options.extent*(l*s-r)),Math.round(this.options.extent*(u*s-n))]],tags:c};let d;d=a||this.options.generateId?e[t+3]:this.points[e[t+3]].id,void 0!==d&&(h.id=d),o.features.push(h)}}_limitZoom(t){return Math.max(this.options.minZoom,Math.min(Math.floor(+t),this.options.maxZoom+1))}_cluster(t,e){const{radius:r,extent:n,reduce:s,minPoints:o}=this.options,i=r/(n*Math.pow(2,e)),a=t.data,c=[],l=this.stride;for(let u=0;u<a.length;u+=l){if(a[u+2]<=e)continue;a[u+2]=e;const r=a[u],n=a[u+1],h=t.within(a[u],a[u+1],i),d=a[u+5];let p=d;for(const t of h){const r=t*l;a[r+2]>e&&(p+=a[r+5])}if(p>d&&p>=o){let t,o=r*d,i=n*d,f=-1;const m=(u/l<<5)+(e+1)+this.points.length;for(const r of h){const n=r*l;if(a[n+2]<=e)continue;a[n+2]=e;const c=a[n+5];o+=a[n]*c,i+=a[n+1]*c,a[n+4]=m,s&&(t||(t=this._map(a,u,!0),f=this.clusterProps.length,this.clusterProps.push(t)),s(t,this._map(a,n)))}a[u+4]=m,c.push(o/p,i/p,1/0,m,-1,p),s&&c.push(f)}else{for(let t=0;t<l;t++)c.push(a[u+t]);if(p>1)for(const t of h){const r=t*l;if(!(a[r+2]<=e)){a[r+2]=e;for(let t=0;t<l;t++)c.push(a[r+t])}}}}return c}_getOriginId(t){return t-this.points.length>>5}_getOriginZoom(t){return(t-this.points.length)%32}_map(t,e,r){if(t[e+5]>1){const n=this.clusterProps[t[e+6]];return r?Object.assign({},n):n}const n=this.points[t[e+3]].properties,s=this.options.map(n);return r&&s===n?Object.assign({},s):s}};function ot(t,e,r){return{type:"Feature",id:t[e+3],properties:it(t,e,r),geometry:{type:"Point",coordinates:[(n=t[e],360*(n-.5)),lt(t[e+1])]}};var n}function it(t,e,r){const n=t[e+5],s=n>=1e4?`${Math.round(n/1e3)}k`:n>=1e3?Math.round(n/100)/10+"k":n,o=t[e+6],i=-1===o?{}:Object.assign({},r[o]);return Object.assign(i,{cluster:!0,cluster_id:t[e+3],point_count:n,point_count_abbreviated:s})}function at(t){return t/360+.5}function ct(t){const e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function lt(t){const e=(180-360*t)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}var ut=class{static isAdvancedMarkerAvailable(t){return google.maps.marker&&!0===t.getMapCapabilities().isAdvancedMarkersAvailable}static isAdvancedMarker(t){return google.maps.marker&&t instanceof google.maps.marker.AdvancedMarkerElement}static setMap(t,e){this.isAdvancedMarker(t)?t.map=e:t.setMap(e)}static getPosition(t){if(this.isAdvancedMarker(t)){if(t.position){if(t.position instanceof google.maps.LatLng)return t.position;if(Number.isFinite(t.position.lat)&&Number.isFinite(t.position.lng))return new google.maps.LatLng(t.position.lat,t.position.lng)}return new google.maps.LatLng(null)}return t.getPosition()}static getVisible(t){return!!this.isAdvancedMarker(t)||t.getVisible()}},ht=class{constructor({markers:t,position:e}){this.markers=[],t&&(this.markers=t),e&&(e instanceof google.maps.LatLng?this._position=e:this._position=new google.maps.LatLng(e))}get bounds(){if(0===this.markers.length&&!this._position)return;const t=new google.maps.LatLngBounds(this._position,this._position);for(const e of this.markers)t.extend(ut.getPosition(e));return t}get position(){return this._position||this.bounds.getCenter()}get count(){return this.markers.filter(t=>ut.getVisible(t)).length}push(t){this.markers.push(t)}delete(){this.marker&&(ut.setMap(this.marker,null),this.marker=void 0),this.markers.length=0}};function dt(t,e="assertion failed"){if(null==t)throw Error(e)}var pt,ft=class{constructor({maxZoom:t=16}){this.maxZoom=t}noop({markers:t}){return mt(t)}},mt=t=>t.map(t=>new ht({position:ut.getPosition(t),markers:[t]})),gt=class extends ft{constructor(t){var{maxZoom:e,radius:r=60}=t,n=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(t);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(t,n[s])&&(r[n[s]]=t[n[s]])}return r}(t,["maxZoom","radius"]);super({maxZoom:e}),this.markers=[],this.clusters=[],this.state={zoom:-1},this.superCluster=new st(Object.assign({maxZoom:this.maxZoom,radius:r},n))}calculate(t){let e=!1,r=t.map.getZoom();dt(r),r=Math.round(r);const n={zoom:r};if(!G(t.markers,this.markers)){e=!0,this.markers=[...t.markers];const r=this.markers.map(t=>{const e=ut.getPosition(t);return{type:"Feature",geometry:{type:"Point",coordinates:[e.lng(),e.lat()]},properties:{marker:t}}});this.superCluster.load(r)}return e||(this.state.zoom<=this.maxZoom||n.zoom<=this.maxZoom)&&(e=!G(this.state,n)),this.state=n,0===t.markers.length?(this.clusters=[],{clusters:this.clusters,changed:e}):(e&&(this.clusters=this.cluster(t)),{clusters:this.clusters,changed:e})}cluster({map:t}){const e=t.getZoom();return dt(e),this.superCluster.getClusters([-180,-90,180,90],Math.round(e)).map(t=>this.transformCluster(t))}transformCluster({geometry:{coordinates:[t,e]},properties:r}){if(r.cluster)return new ht({markers:this.superCluster.getLeaves(r.cluster_id,1/0).map(t=>t.properties.marker),position:{lat:e,lng:t}});const n=r.marker;return new ht({markers:[n],position:ut.getPosition(n)})}},yt=class{constructor(t,e){this.markers={sum:t.length};const r=e.map(t=>t.count),n=r.reduce((t,e)=>t+e,0);this.clusters={count:e.length,markers:{mean:n/e.length,sum:n,min:Math.min(...r),max:Math.max(...r)}}}},bt=class{render({count:t,position:e},r,n){const s=`<svg fill="${t>Math.max(10,r.clusters.markers.mean)?"#ff0000":"#0000ff"}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 240" width="50" height="50">\n<circle cx="120" cy="120" opacity=".6" r="70" />\n<circle cx="120" cy="120" opacity=".3" r="90" />\n<circle cx="120" cy="120" opacity=".2" r="110" />\n<text x="50%" y="50%" style="fill:#fff" text-anchor="middle" font-size="50" dominant-baseline="middle" font-family="roboto,arial,sans-serif">${t}</text>\n</svg>`,o=`Cluster of ${t} markers`,i=Number(google.maps.Marker.MAX_ZINDEX)+t;if(ut.isAdvancedMarkerAvailable(n)){const t=(new DOMParser).parseFromString(s,"image/svg+xml").documentElement;t.setAttribute("transform","translate(0 25)");const r={map:n,position:e,zIndex:i,title:o,content:t};return new google.maps.marker.AdvancedMarkerElement(r)}const a={position:e,zIndex:i,title:o,icon:{url:`data:image/svg+xml;base64,${btoa(s)}`,anchor:new google.maps.Point(25,25)}};return new google.maps.Marker(a)}},wt=class t{constructor(){!function(t,e){for(let r in e.prototype)t.prototype[r]=e.prototype[r]}(t,google.maps.OverlayView)}};!function(t){t.CLUSTERING_BEGIN="clusteringbegin",t.CLUSTERING_END="clusteringend",t.CLUSTER_CLICK="click",t.GMP_CLICK="gmp-click"}(pt||(pt={}));var xt=(t,e,r)=>{e.bounds&&r.fitBounds(e.bounds)},kt=class extends wt{constructor({map:t,markers:e=[],algorithmOptions:r={},algorithm:n=new gt(r),renderer:s=new bt,onClusterClick:o=xt}){super(),this.map=null,this.idleListener=null,this.markers=[...e],this.clusters=[],this.algorithm=n,this.renderer=s,this.onClusterClick=o,t&&this.setMap(t)}addMarker(t,e){this.markers.includes(t)||(this.markers.push(t),e||this.render())}addMarkers(t,e){t.forEach(t=>{this.addMarker(t,!0)}),e||this.render()}removeMarker(t,e){const r=this.markers.indexOf(t);return-1!==r&&(ut.setMap(t,null),this.markers.splice(r,1),e||this.render(),!0)}removeMarkers(t,e){let r=!1;return t.forEach(t=>{r=this.removeMarker(t,!0)||r}),r&&!e&&this.render(),r}clearMarkers(t){this.markers.length=0,t||this.render()}render(){const t=this.getMap();if(t instanceof google.maps.Map&&t.getProjection()){google.maps.event.trigger(this,pt.CLUSTERING_BEGIN,this);const{clusters:e,changed:r}=this.algorithm.calculate({markers:this.markers,map:t,mapCanvasProjection:this.getProjection()});if(r||null==r){const t=/* @__PURE__ */new Set;for(const n of e)1==n.markers.length&&t.add(n.markers[0]);const r=[];for(const e of this.clusters)null!=e.marker&&(1==e.markers.length?t.has(e.marker)||ut.setMap(e.marker,null):r.push(e.marker));this.clusters=e,this.renderClusters(),requestAnimationFrame(()=>r.forEach(t=>ut.setMap(t,null)))}google.maps.event.trigger(this,pt.CLUSTERING_END,this)}}onAdd(){const t=this.getMap();dt(t),this.idleListener=t.addListener("idle",this.render.bind(this)),this.render()}onRemove(){this.idleListener&&google.maps.event.removeListener(this.idleListener),this.reset()}reset(){this.markers.forEach(t=>ut.setMap(t,null)),this.clusters.forEach(t=>t.delete()),this.clusters=[]}renderClusters(){const t=new yt(this.markers,this.clusters),e=this.getMap();this.clusters.forEach(r=>{if(1===r.markers.length)r.marker=r.markers[0];else if(r.marker=this.renderer.render(r,t,e),r.markers.forEach(t=>ut.setMap(t,null)),this.onClusterClick){const t=ut.isAdvancedMarker(r.marker)?pt.GMP_CLICK:pt.CLUSTER_CLICK;r.marker.addListener(t,t=>{google.maps.event.trigger(this,pt.CLUSTER_CLICK,r),this.onClusterClick(t,r,e)})}ut.setMap(r.marker,e)})}},Et={top:60,bottom:60,left:276,right:60},vt="#fb8500",Mt=new u,At=(e,r,n)=>{t(/* @__PURE__ */o(i,{client:Mt,children:/* @__PURE__ */o(h,{event:e,onExplore:n})}),r)},Ct=t=>{const e=document.createElement("div");e.style.cssText=`\n background:${m(t.color,"#fb8500")};color:#fff;border-radius:20px;padding:5px 10px;\n font-size:12px;font-weight:600;white-space:nowrap;cursor:pointer;\n box-shadow:0 2px 8px rgba(0,0,0,0.25);border:2px solid rgba(255,255,255,0.4);\n display:inline-flex;align-items:center;gap:6px;\n `;const r=document.createElement("span");r.textContent=t.folder.name;const n=document.createElement("span");return n.style.cssText="background:rgba(0,0,0,0.18);border-radius:10px;padding:1px 5px;font-size:10px;",n.textContent=String(t.eventCount),e.appendChild(r),e.appendChild(n),e},_t=(t,e)=>{const r=document.createElement("div");if(r.style.cssText=`\n width:36px;height:36px;cursor:pointer;\n background:${t};border-radius:50% 50% 50% 0;transform:rotate(-45deg);\n border:2px solid white;box-shadow:0 2px 8px rgba(0,0,0,0.3);\n display:flex;align-items:center;justify-content:center;overflow:hidden;\n `,e){const t=document.createElement("img");t.src=d(e)??"",t.style.cssText="width:24px;height:24px;border-radius:50%;object-fit:cover;transform:rotate(45deg);",r.appendChild(t)}return r},Lt=({apiKey:t,onExplore:i,logoUrl:u})=>{const h=r(null),d=r(null),m=r(null),y=r(null),b=r([]),w=r([]),x=r(null),k=r(null),E=r(!1),v=r(!1),M=s(()=>(()=>{try{const t=sessionStorage.getItem(l);if(!t)return null;const e=JSON.parse(t);if(Array.isArray(e?.center)&&"number"==typeof e.zoom)return e}catch{}return null})(),[]),[A,C]=n(!1),[_,L]=n(!0),{folderTree:j,activeFolderId:I,activeFolder:O,visibleEvents:q,setActiveFolderId:T,isLoadingEvents:P}=f(),{organization:S}=c(),z=()=>{b.current.forEach(t=>{t.map=null}),b.current=[]},U=()=>{x.current&&(x.current.clearMarkers(),x.current=null),w.current.forEach(t=>{t.map=null}),w.current=[]};return e(()=>{if(!h.current||d.current)return;let e=!1;return(async()=>{try{const{setOptions:r,importLibrary:n}=await import("./BsT0vqml.js");if(e)return;if(r({key:t,v:"weekly"}),await Promise.all([n("maps"),n("marker"),n("visualization")]),e||!h.current)return;const s=window.google.maps;m.current=s;const o=M?.center?{lng:M.center[0],lat:M.center[1]}:{lat:20,lng:0},i=M?.zoom??3,a=new s.Map(h.current,{mapId:"DEMO_MAP_ID",renderingType:"VECTOR",mapTypeId:"roadmap",center:o,zoom:i,mapTypeControl:!1,streetViewControl:!1});d.current=a,y.current=new s.InfoWindow({maxWidth:280}),k.current=new s.visualization.HeatmapLayer({data:[],map:null,radius:30,opacity:.8});const c=()=>{try{const t=a.getCenter();if(!t)return;sessionStorage.setItem(l,JSON.stringify({center:[t.lng(),t.lat()],zoom:a.getZoom()}))}catch{}};a.addListener("idle",c),L(!1),C(!0)}finally{e||L(!1)}})(),()=>{e=!0,z(),U(),k.current&&(k.current.setMap(null),k.current=null),y.current?.close(),d.current=null,m.current=null}},[t]),e(()=>{if(!A)return;const t=d.current,e=m.current;if(t&&e)if(z(),U(),y.current?.close(),null===I&&j.length>0){k.current?.setMap(null);const r=n=>{for(const s of n)if(s.centroid){const r=Ct(s),n=new e.marker.AdvancedMarkerElement({map:t,position:{lng:s.centroid[0],lat:s.centroid[1]},content:r,gmpClickable:!0});n.addListener("click",()=>T(s.folder._id)),b.current.push(n)}else s.children.length>0&&r(s.children)};r(j)}else{const r=0===j.length&&null===I;if(0===q.length)return;if(r){const r=[],n=q.map(n=>{const s=n.location.y,o=n.location.x;r.push({location:new e.LatLng(s,o),weight:(n.views||0)+1});const a=_t(vt,u),c=new e.marker.AdvancedMarkerElement({map:t,position:{lat:s,lng:o},content:a,gmpClickable:!0});return c.addListener("click",()=>{const e=document.createElement("div");At(n,e,i),y.current.close(),y.current.setContent(e),y.current.open({anchor:c,map:t})}),c});if(w.current=n,x.current=new kt({markers:n,map:t,renderer:{render:({count:t,position:r})=>{const n=document.createElement("div"),s=t<10?28:t<30?34:40;return n.style.cssText=`\n width:${s}px;height:${s}px;border-radius:50%;cursor:pointer;\n background:${vt};color:#fff;\n display:flex;align-items:center;justify-content:center;\n font-size:13px;font-weight:700;\n box-shadow:0 2px 8px rgba(0,0,0,0.3);\n border:2px solid rgba(255,255,255,0.6);\n `,n.textContent=String(t),new e.marker.AdvancedMarkerElement({position:r,content:n,gmpClickable:!0,zIndex:Number(e.Marker?.MAX_ZINDEX??0)+t})}}}),k.current&&(k.current.setData(r),k.current.setMap(t)),!v.current&&(v.current=!0,!M)){const r=new e.LatLngBounds;q.forEach(t=>r.extend({lat:t.location.y,lng:t.location.x})),r.isEmpty()||t.fitBounds(r,Et)}}else{k.current?.setMap(null);const r=O?.color||vt,n=new e.LatLngBounds;q.forEach(s=>{const o=s.location.y,a=s.location.x;n.extend({lat:o,lng:a});const c=_t(r,u),l=new e.marker.AdvancedMarkerElement({map:t,position:{lat:o,lng:a},content:c,gmpClickable:!0});l.addListener("click",()=>{const e=document.createElement("div");At(s,e,i),y.current.close(),y.current.setContent(e),y.current.open({anchor:l,map:t})}),w.current.push(l)})}}},[I,j,q,A,i,u,T,O,M]),e(()=>{if(!A)return;const t=d.current,e=m.current;if(t&&e)if(E.current||!M){if(E.current=!0,I){const r=p(j,I);if(!r?.folder.boundary?.length)return;const n=new e.LatLngBounds;for(const t of r.folder.boundary)n.extend({lat:t.y,lng:t.x});n.isEmpty()||t.fitBounds(n,{...Et,maxZoom:14})}else if(j.length>0){const r=new e.LatLngBounds,n=t=>{for(const e of t)e.centroid?r.extend({lng:e.centroid[0],lat:e.centroid[1]}):n(e.children)};n(j),r.isEmpty()||t.fitBounds(r,{...Et,maxZoom:8})}}else E.current=!0},[I,j,A,M]),/* @__PURE__ */o("div",{class:"relative h-screen w-full sm:h-[calc(100vh-4rem)]",style:a(S),children:[
|
|
1
|
+
import{C as t,b as e,f as r,h as n,p as s,t as o}from"./C3uDEVBt.js";import{I as i,a,n as c,w as l}from"./BItJQVdK.js";import{t as u}from"./Be1e_ATJ.js";import{a as h,i as d,n as p,o as f,r as m,t as g}from"./BYoa-kpQ2.js";var{getOwnPropertyNames:y,getOwnPropertySymbols:b}=Object,{hasOwnProperty:w}=Object.prototype;function x(t,e){return function(r,n,s){return t(r,n,s)&&e(r,n,s)}}function k(t){return function(e,r,n){if(!e||!r||"object"!=typeof e||"object"!=typeof r)return t(e,r,n);const{cache:s}=n,o=s.get(e),i=s.get(r);if(o&&i)return o===r&&i===e;s.set(e,r),s.set(r,e);const a=t(e,r,n);return s.delete(e),s.delete(r),a}}function E(t){return y(t).concat(b(t))}var v=Object.hasOwn||((t,e)=>w.call(t,e));function M(t,e){return t===e||!t&&!e&&t!=t&&e!=e}var{getOwnPropertyDescriptor:A,keys:C}=Object;function _(t,e){return t.byteLength===e.byteLength&&F(new Uint8Array(t),new Uint8Array(e))}function L(t,e,r){let n=t.length;if(e.length!==n)return!1;for(;n-- >0;)if(!r.equals(t[n],e[n],n,n,t,e,r))return!1;return!0}function j(t,e){return t.byteLength===e.byteLength&&F(new Uint8Array(t.buffer,t.byteOffset,t.byteLength),new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}function I(t,e){return M(t.getTime(),e.getTime())}function O(t,e){return t.name===e.name&&t.message===e.message&&t.cause===e.cause&&t.stack===e.stack}function q(t,e){return t===e}function T(t,e,r){const n=t.size;if(n!==e.size)return!1;if(!n)return!0;const s=new Array(n),o=t.entries();let i,a,c=0;for(;(i=o.next())&&!i.done;){const n=e.entries();let o=!1,l=0;for(;(a=n.next())&&!a.done;){if(s[l]){l++;continue}const n=i.value,u=a.value;if(r.equals(n[0],u[0],c,l,t,e,r)&&r.equals(n[1],u[1],n[0],u[0],t,e,r)){o=s[l]=!0;break}l++}if(!o)return!1;c++}return!0}var P=M;function S(t,e,r){const n=C(t);let s=n.length;if(C(e).length!==s)return!1;for(;s-- >0;)if(!D(t,e,r,n[s]))return!1;return!0}function z(t,e,r){const n=E(t);let s,o,i,a=n.length;if(E(e).length!==a)return!1;for(;a-- >0;){if(s=n[a],!D(t,e,r,s))return!1;if(o=A(t,s),i=A(e,s),(o||i)&&(!o||!i||o.configurable!==i.configurable||o.enumerable!==i.enumerable||o.writable!==i.writable))return!1}return!0}function U(t,e){return M(t.valueOf(),e.valueOf())}function Z(t,e){return t.source===e.source&&t.flags===e.flags}function N(t,e,r){const n=t.size;if(n!==e.size)return!1;if(!n)return!0;const s=new Array(n),o=t.values();let i,a;for(;(i=o.next())&&!i.done;){const n=e.values();let o=!1,c=0;for(;(a=n.next())&&!a.done;){if(!s[c]&&r.equals(i.value,a.value,i.value,a.value,t,e,r)){o=s[c]=!0;break}c++}if(!o)return!1}return!0}function F(t,e){let r=t.byteLength;if(e.byteLength!==r||t.byteOffset!==e.byteOffset)return!1;for(;r-- >0;)if(t[r]!==e[r])return!1;return!0}function B(t,e){return t.hostname===e.hostname&&t.pathname===e.pathname&&t.protocol===e.protocol&&t.port===e.port&&t.hash===e.hash&&t.username===e.username&&t.password===e.password}function D(t,e,r,n){return!("_owner"!==n&&"__o"!==n&&"__v"!==n||!t.$$typeof&&!e.$$typeof)||v(e,n)&&r.equals(t[n],e[n],n,n,t,e,r)}var $={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},R=Object.prototype.toString;var G=V();function V(t={}){const{circular:e=!1,createInternalComparator:r,createState:n,strict:s=!1}=t,o=function({areArrayBuffersEqual:t,areArraysEqual:e,areDataViewsEqual:r,areDatesEqual:n,areErrorsEqual:s,areFunctionsEqual:o,areMapsEqual:i,areNumbersEqual:a,areObjectsEqual:c,arePrimitiveWrappersEqual:l,areRegExpsEqual:u,areSetsEqual:h,areTypedArraysEqual:d,areUrlsEqual:p,unknownTagComparators:f}){return function(m,g,y){if(m===g)return!0;if(null==m||null==g)return!1;const b=typeof m;if(b!==typeof g)return!1;if("object"!==b)return"number"===b?a(m,g,y):"function"===b&&o(m,g,y);const w=m.constructor;if(w!==g.constructor)return!1;if(w===Object)return c(m,g,y);if(Array.isArray(m))return e(m,g,y);if(w===Date)return n(m,g,y);if(w===RegExp)return u(m,g,y);if(w===Map)return i(m,g,y);if(w===Set)return h(m,g,y);const x=R.call(m);if("[object Date]"===x)return n(m,g,y);if("[object RegExp]"===x)return u(m,g,y);if("[object Map]"===x)return i(m,g,y);if("[object Set]"===x)return h(m,g,y);if("[object Object]"===x)return"function"!=typeof m.then&&"function"!=typeof g.then&&c(m,g,y);if("[object URL]"===x)return p(m,g,y);if("[object Error]"===x)return s(m,g,y);if("[object Arguments]"===x)return c(m,g,y);if($[x])return d(m,g,y);if("[object ArrayBuffer]"===x)return t(m,g,y);if("[object DataView]"===x)return r(m,g,y);if("[object Boolean]"===x||"[object Number]"===x||"[object String]"===x)return l(m,g,y);if(f){let t=f[x];if(!t){const e=null!=(k=m)?k[Symbol.toStringTag]:void 0;e&&(t=f[e])}if(t)return t(m,g,y)}var k;return!1}}(function({circular:t,createCustomConfig:e,strict:r}){let n={areArrayBuffersEqual:_,areArraysEqual:r?z:L,areDataViewsEqual:j,areDatesEqual:I,areErrorsEqual:O,areFunctionsEqual:q,areMapsEqual:r?x(T,z):T,areNumbersEqual:P,areObjectsEqual:r?z:S,arePrimitiveWrappersEqual:U,areRegExpsEqual:Z,areSetsEqual:r?x(N,z):N,areTypedArraysEqual:r?x(F,z):F,areUrlsEqual:B,unknownTagComparators:void 0};if(e&&(n=Object.assign({},n,e(n))),t){const t=k(n.areArraysEqual),e=k(n.areMapsEqual),r=k(n.areObjectsEqual),s=k(n.areSetsEqual);n=Object.assign({},n,{areArraysEqual:t,areMapsEqual:e,areObjectsEqual:r,areSetsEqual:s})}return n}(t));return function({circular:t,comparator:e,createState:r,equals:n,strict:s}){if(r)return function(o,i){const{cache:a=(t?/* @__PURE__ */new WeakMap:void 0),meta:c}=r();return e(o,i,{cache:a,equals:n,meta:c,strict:s})};if(t)return function(t,r){return e(t,r,{cache:/* @__PURE__ */new WeakMap,equals:n,meta:void 0,strict:s})};const o={cache:void 0,equals:n,meta:void 0,strict:s};return function(t,r){return e(t,r,o)}}({circular:e,comparator:o,createState:n,equals:r?r(o):(i=o,function(t,e,r,n,s,o,a){return i(t,e,a)}),strict:s});var i}V({strict:!0}),V({circular:!0}),V({circular:!0,strict:!0}),V({createInternalComparator:()=>M}),V({strict:!0,createInternalComparator:()=>M}),V({circular:!0,createInternalComparator:()=>M}),V({circular:!0,createInternalComparator:()=>M,strict:!0});var K=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],W=new Uint32Array(96),X=class t{static from(e){if(!e||void 0===e.byteLength||e.buffer)throw new Error("Data must be an instance of ArrayBuffer or SharedArrayBuffer.");const[r,n]=new Uint8Array(e,0,2);if(219!==r)throw new Error("Data does not appear to be in a KDBush format.");const s=n>>4;if(1!==s)throw new Error(`Got v${s} data when expected v1.`);const o=K[15&n];if(!o)throw new Error("Unrecognized array type.");const[i]=new Uint16Array(e,2,1),[a]=new Uint32Array(e,4,1);return new t(a,i,o,void 0,e)}constructor(t,e=64,r=Float64Array,n=ArrayBuffer,s){if(isNaN(t)||t<0)throw new Error(`Unexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+e,2),65535),this.ArrayType=r,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;const o=K.indexOf(this.ArrayType),i=2*t*this.ArrayType.BYTES_PER_ELEMENT,a=t*this.IndexArrayType.BYTES_PER_ELEMENT,c=(8-a%8)%8;if(o<0)throw new Error(`Unexpected typed array class: ${r}.`);if(s)this.data=s,this.ids=new this.IndexArrayType(s,8,t),this.coords=new r(s,8+a+c,2*t),this._pos=2*t,this._finished=!0;else{const s=this.data=new n(8+i+a+c);this.ids=new this.IndexArrayType(s,8,t),this.coords=new r(s,8+a+c,2*t),this._pos=0,this._finished=!1,new Uint8Array(s,0,2).set([219,16+o]),new Uint16Array(s,2,1)[0]=e,new Uint32Array(s,4,1)[0]=t}}add(t,e){const r=this._pos>>1;return this.ids[r]=r,this.coords[this._pos++]=t,this.coords[this._pos++]=e,r}finish(){const t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return J(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,e,r,n){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:s,coords:o,nodeSize:i}=this;W[0]=0,W[1]=s.length-1,W[2]=0;let a=3;const c=[];for(;a>0;){const l=W[--a],u=W[--a],h=W[--a];if(u-h<=i){for(let i=h;i<=u;i++){const a=o[2*i],l=o[2*i+1];a>=t&&a<=r&&l>=e&&l<=n&&c.push(s[i])}continue}const d=h+u>>1,p=o[2*d],f=o[2*d+1];p>=t&&p<=r&&f>=e&&f<=n&&c.push(s[d]),(0===l?t<=p:e<=f)&&(W[a++]=h,W[a++]=d-1,W[a++]=1-l),(0===l?r>=p:n>=f)&&(W[a++]=d+1,W[a++]=u,W[a++]=1-l)}return c}within(t,e,r){const n=[];return this.withinInto(t,e,r,n),n}withinInto(t,e,r,n){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:s,coords:o,nodeSize:i}=this;W[0]=0,W[1]=s.length-1,W[2]=0;let a=3,c=0;const l=r*r;for(;a>0;){const u=W[--a],h=W[--a],d=W[--a];if(h-d<=i){for(let r=d;r<=h;r++)tt(o[2*r],o[2*r+1],t,e)<=l&&(n[c++]=s[r]);continue}const p=d+h>>1,f=o[2*p],m=o[2*p+1];tt(f,m,t,e)<=l&&(n[c++]=s[p]),(0===u?t-r<=f:e-r<=m)&&(W[a++]=d,W[a++]=p-1,W[a++]=1-u),(0===u?t+r>=f:e+r>=m)&&(W[a++]=p+1,W[a++]=h,W[a++]=1-u)}return c}};function J(t,e,r,n,s,o){if(s-n<=r)return;const i=n+s>>1;Y(t,e,i,n,s,o),J(t,e,r,n,i-1,1-o),J(t,e,r,i+1,s,1-o)}function Y(t,e,r,n,s,o){for(;s>n;){if(s-n>600){const i=s-n+1,a=r-n+1,c=Math.log(i),l=.5*Math.exp(2*c/3),u=.5*Math.sqrt(c*l*(i-l)/i)*(a-i/2<0?-1:1);Y(t,e,r,Math.max(n,Math.floor(r-a*l/i+u)),Math.min(s,Math.floor(r+(i-a)*l/i+u)),o)}const i=e[2*r+o];let a=n,c=s;for(H(t,e,n,r),e[2*s+o]>i&&H(t,e,n,s);a<c;){for(H(t,e,a,c),a++,c--;e[2*a+o]<i;)a++;for(;e[2*c+o]>i;)c--}e[2*n+o]===i?H(t,e,n,c):(c++,H(t,e,c,s)),c<=r&&(n=c+1),r<=c&&(s=c-1)}}function H(t,e,r,n){Q(t,r,n),Q(e,2*r,2*n),Q(e,2*r+1,2*n+1)}function Q(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function tt(t,e,r,n){const s=t-r,o=e-n;return s*s+o*o}var et,rt={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:t=>t},nt=Math.fround||(et=new Float32Array(1),t=>(et[0]=+t,et[0])),st=class{constructor(t){this.options=Object.assign(Object.create(rt),t),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(t){const{log:e,minZoom:r,maxZoom:n}=this.options;e&&console.time("total time");const s=`prepare ${t.length} points`;e&&console.time(s),this.points=t;const o=[];for(let a=0;a<t.length;a++){const e=t[a];if(!e.geometry)continue;const[r,n]=e.geometry.coordinates,s=nt(at(r)),i=nt(ct(n));o.push(s,i,1/0,a,-1,1),this.options.reduce&&o.push(0)}let i=this.trees[n+1]=this._createTree(o);e&&console.timeEnd(s);for(let a=n;a>=r;a--){const t=+Date.now();i=this.trees[a]=this._createTree(this._cluster(i,a)),e&&console.log("z%d: %d clusters in %dms",a,i.numItems,+Date.now()-t)}return e&&console.timeEnd("total time"),this}getClusters(t,e){let r=((t[0]+180)%360+360)%360-180;const n=Math.max(-90,Math.min(90,t[1]));let s=180===t[2]?180:((t[2]+180)%360+360)%360-180;const o=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)r=-180,s=180;else if(r>s){const t=this.getClusters([r,n,180,o],e),i=this.getClusters([-180,n,s,o],e);return t.concat(i)}const i=this.trees[this._limitZoom(e)],a=i.range(at(r),ct(o),at(s),ct(n)),c=i.data,l=[];for(const u of a){const t=this.stride*u;l.push(c[t+5]>1?ot(c,t,this.clusterProps):this.points[c[t+3]])}return l}getChildren(t){const e=this._getOriginId(t),r=this._getOriginZoom(t),n="No cluster with the specified id.",s=this.trees[r];if(!s)throw new Error(n);const o=s.data;if(e*this.stride>=o.length)throw new Error(n);const i=this.options.radius/(this.options.extent*Math.pow(2,r-1)),a=o[e*this.stride],c=o[e*this.stride+1],l=s.within(a,c,i),u=[];for(const h of l){const e=h*this.stride;o[e+4]===t&&u.push(o[e+5]>1?ot(o,e,this.clusterProps):this.points[o[e+3]])}if(0===u.length)throw new Error(n);return u}getLeaves(t,e,r){e=e||10,r=r||0;const n=[];return this._appendLeaves(n,t,e,r,0),n}getTile(t,e,r){const n=this.trees[this._limitZoom(t)],s=Math.pow(2,t),{extent:o,radius:i}=this.options,a=i/o,c=(r-a)/s,l=(r+1+a)/s,u={features:[]};return this._addTileFeatures(n.range((e-a)/s,c,(e+1+a)/s,l),n.data,e,r,s,u),0===e&&this._addTileFeatures(n.range(1-a/s,c,1,l),n.data,s,r,s,u),e===s-1&&this._addTileFeatures(n.range(0,c,a/s,l),n.data,-1,r,s,u),u.features.length?u:null}getClusterExpansionZoom(t){let e=this._getOriginZoom(t)-1;for(;e<=this.options.maxZoom;){const r=this.getChildren(t);if(e++,1!==r.length)break;t=r[0].properties.cluster_id}return e}_appendLeaves(t,e,r,n,s){const o=this.getChildren(e);for(const i of o){const e=i.properties;if(e&&e.cluster?s+e.point_count<=n?s+=e.point_count:s=this._appendLeaves(t,e.cluster_id,r,n,s):s<n?s++:t.push(i),t.length===r)break}return s}_createTree(t){const e=new X(t.length/this.stride|0,this.options.nodeSize,Float32Array);for(let r=0;r<t.length;r+=this.stride)e.add(t[r],t[r+1]);return e.finish(),e.data=t,e}_addTileFeatures(t,e,r,n,s,o){for(const i of t){const t=i*this.stride,a=e[t+5]>1;let c,l,u;if(a)c=it(e,t,this.clusterProps),l=e[t],u=e[t+1];else{const r=this.points[e[t+3]];c=r.properties;const[n,s]=r.geometry.coordinates;l=at(n),u=ct(s)}const h={type:1,geometry:[[Math.round(this.options.extent*(l*s-r)),Math.round(this.options.extent*(u*s-n))]],tags:c};let d;d=a||this.options.generateId?e[t+3]:this.points[e[t+3]].id,void 0!==d&&(h.id=d),o.features.push(h)}}_limitZoom(t){return Math.max(this.options.minZoom,Math.min(Math.floor(+t),this.options.maxZoom+1))}_cluster(t,e){const{radius:r,extent:n,reduce:s,minPoints:o}=this.options,i=r/(n*Math.pow(2,e)),a=t.data,c=[],l=this.stride;for(let u=0;u<a.length;u+=l){if(a[u+2]<=e)continue;a[u+2]=e;const r=a[u],n=a[u+1],h=t.within(a[u],a[u+1],i),d=a[u+5];let p=d;for(const t of h){const r=t*l;a[r+2]>e&&(p+=a[r+5])}if(p>d&&p>=o){let t,o=r*d,i=n*d,f=-1;const m=(u/l<<5)+(e+1)+this.points.length;for(const r of h){const n=r*l;if(a[n+2]<=e)continue;a[n+2]=e;const c=a[n+5];o+=a[n]*c,i+=a[n+1]*c,a[n+4]=m,s&&(t||(t=this._map(a,u,!0),f=this.clusterProps.length,this.clusterProps.push(t)),s(t,this._map(a,n)))}a[u+4]=m,c.push(o/p,i/p,1/0,m,-1,p),s&&c.push(f)}else{for(let t=0;t<l;t++)c.push(a[u+t]);if(p>1)for(const t of h){const r=t*l;if(!(a[r+2]<=e)){a[r+2]=e;for(let t=0;t<l;t++)c.push(a[r+t])}}}}return c}_getOriginId(t){return t-this.points.length>>5}_getOriginZoom(t){return(t-this.points.length)%32}_map(t,e,r){if(t[e+5]>1){const n=this.clusterProps[t[e+6]];return r?Object.assign({},n):n}const n=this.points[t[e+3]].properties,s=this.options.map(n);return r&&s===n?Object.assign({},s):s}};function ot(t,e,r){return{type:"Feature",id:t[e+3],properties:it(t,e,r),geometry:{type:"Point",coordinates:[(n=t[e],360*(n-.5)),lt(t[e+1])]}};var n}function it(t,e,r){const n=t[e+5],s=n>=1e4?`${Math.round(n/1e3)}k`:n>=1e3?Math.round(n/100)/10+"k":n,o=t[e+6],i=-1===o?{}:Object.assign({},r[o]);return Object.assign(i,{cluster:!0,cluster_id:t[e+3],point_count:n,point_count_abbreviated:s})}function at(t){return t/360+.5}function ct(t){const e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function lt(t){const e=(180-360*t)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}var ut=class{static isAdvancedMarkerAvailable(t){return google.maps.marker&&!0===t.getMapCapabilities().isAdvancedMarkersAvailable}static isAdvancedMarker(t){return google.maps.marker&&t instanceof google.maps.marker.AdvancedMarkerElement}static setMap(t,e){this.isAdvancedMarker(t)?t.map=e:t.setMap(e)}static getPosition(t){if(this.isAdvancedMarker(t)){if(t.position){if(t.position instanceof google.maps.LatLng)return t.position;if(Number.isFinite(t.position.lat)&&Number.isFinite(t.position.lng))return new google.maps.LatLng(t.position.lat,t.position.lng)}return new google.maps.LatLng(null)}return t.getPosition()}static getVisible(t){return!!this.isAdvancedMarker(t)||t.getVisible()}},ht=class{constructor({markers:t,position:e}){this.markers=[],t&&(this.markers=t),e&&(e instanceof google.maps.LatLng?this._position=e:this._position=new google.maps.LatLng(e))}get bounds(){if(0===this.markers.length&&!this._position)return;const t=new google.maps.LatLngBounds(this._position,this._position);for(const e of this.markers)t.extend(ut.getPosition(e));return t}get position(){return this._position||this.bounds.getCenter()}get count(){return this.markers.filter(t=>ut.getVisible(t)).length}push(t){this.markers.push(t)}delete(){this.marker&&(ut.setMap(this.marker,null),this.marker=void 0),this.markers.length=0}};function dt(t,e="assertion failed"){if(null==t)throw Error(e)}var pt,ft=class{constructor({maxZoom:t=16}){this.maxZoom=t}noop({markers:t}){return mt(t)}},mt=t=>t.map(t=>new ht({position:ut.getPosition(t),markers:[t]})),gt=class extends ft{constructor(t){var{maxZoom:e,radius:r=60}=t,n=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(t);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(t,n[s])&&(r[n[s]]=t[n[s]])}return r}(t,["maxZoom","radius"]);super({maxZoom:e}),this.markers=[],this.clusters=[],this.state={zoom:-1},this.superCluster=new st(Object.assign({maxZoom:this.maxZoom,radius:r},n))}calculate(t){let e=!1,r=t.map.getZoom();dt(r),r=Math.round(r);const n={zoom:r};if(!G(t.markers,this.markers)){e=!0,this.markers=[...t.markers];const r=this.markers.map(t=>{const e=ut.getPosition(t);return{type:"Feature",geometry:{type:"Point",coordinates:[e.lng(),e.lat()]},properties:{marker:t}}});this.superCluster.load(r)}return e||(this.state.zoom<=this.maxZoom||n.zoom<=this.maxZoom)&&(e=!G(this.state,n)),this.state=n,0===t.markers.length?(this.clusters=[],{clusters:this.clusters,changed:e}):(e&&(this.clusters=this.cluster(t)),{clusters:this.clusters,changed:e})}cluster({map:t}){const e=t.getZoom();return dt(e),this.superCluster.getClusters([-180,-90,180,90],Math.round(e)).map(t=>this.transformCluster(t))}transformCluster({geometry:{coordinates:[t,e]},properties:r}){if(r.cluster)return new ht({markers:this.superCluster.getLeaves(r.cluster_id,1/0).map(t=>t.properties.marker),position:{lat:e,lng:t}});const n=r.marker;return new ht({markers:[n],position:ut.getPosition(n)})}},yt=class{constructor(t,e){this.markers={sum:t.length};const r=e.map(t=>t.count),n=r.reduce((t,e)=>t+e,0);this.clusters={count:e.length,markers:{mean:n/e.length,sum:n,min:Math.min(...r),max:Math.max(...r)}}}},bt=class{render({count:t,position:e},r,n){const s=`<svg fill="${t>Math.max(10,r.clusters.markers.mean)?"#ff0000":"#0000ff"}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 240" width="50" height="50">\n<circle cx="120" cy="120" opacity=".6" r="70" />\n<circle cx="120" cy="120" opacity=".3" r="90" />\n<circle cx="120" cy="120" opacity=".2" r="110" />\n<text x="50%" y="50%" style="fill:#fff" text-anchor="middle" font-size="50" dominant-baseline="middle" font-family="roboto,arial,sans-serif">${t}</text>\n</svg>`,o=`Cluster of ${t} markers`,i=Number(google.maps.Marker.MAX_ZINDEX)+t;if(ut.isAdvancedMarkerAvailable(n)){const t=(new DOMParser).parseFromString(s,"image/svg+xml").documentElement;t.setAttribute("transform","translate(0 25)");const r={map:n,position:e,zIndex:i,title:o,content:t};return new google.maps.marker.AdvancedMarkerElement(r)}const a={position:e,zIndex:i,title:o,icon:{url:`data:image/svg+xml;base64,${btoa(s)}`,anchor:new google.maps.Point(25,25)}};return new google.maps.Marker(a)}},wt=class t{constructor(){!function(t,e){for(let r in e.prototype)t.prototype[r]=e.prototype[r]}(t,google.maps.OverlayView)}};!function(t){t.CLUSTERING_BEGIN="clusteringbegin",t.CLUSTERING_END="clusteringend",t.CLUSTER_CLICK="click",t.GMP_CLICK="gmp-click"}(pt||(pt={}));var xt=(t,e,r)=>{e.bounds&&r.fitBounds(e.bounds)},kt=class extends wt{constructor({map:t,markers:e=[],algorithmOptions:r={},algorithm:n=new gt(r),renderer:s=new bt,onClusterClick:o=xt}){super(),this.map=null,this.idleListener=null,this.markers=[...e],this.clusters=[],this.algorithm=n,this.renderer=s,this.onClusterClick=o,t&&this.setMap(t)}addMarker(t,e){this.markers.includes(t)||(this.markers.push(t),e||this.render())}addMarkers(t,e){t.forEach(t=>{this.addMarker(t,!0)}),e||this.render()}removeMarker(t,e){const r=this.markers.indexOf(t);return-1!==r&&(ut.setMap(t,null),this.markers.splice(r,1),e||this.render(),!0)}removeMarkers(t,e){let r=!1;return t.forEach(t=>{r=this.removeMarker(t,!0)||r}),r&&!e&&this.render(),r}clearMarkers(t){this.markers.length=0,t||this.render()}render(){const t=this.getMap();if(t instanceof google.maps.Map&&t.getProjection()){google.maps.event.trigger(this,pt.CLUSTERING_BEGIN,this);const{clusters:e,changed:r}=this.algorithm.calculate({markers:this.markers,map:t,mapCanvasProjection:this.getProjection()});if(r||null==r){const t=/* @__PURE__ */new Set;for(const n of e)1==n.markers.length&&t.add(n.markers[0]);const r=[];for(const e of this.clusters)null!=e.marker&&(1==e.markers.length?t.has(e.marker)||ut.setMap(e.marker,null):r.push(e.marker));this.clusters=e,this.renderClusters(),requestAnimationFrame(()=>r.forEach(t=>ut.setMap(t,null)))}google.maps.event.trigger(this,pt.CLUSTERING_END,this)}}onAdd(){const t=this.getMap();dt(t),this.idleListener=t.addListener("idle",this.render.bind(this)),this.render()}onRemove(){this.idleListener&&google.maps.event.removeListener(this.idleListener),this.reset()}reset(){this.markers.forEach(t=>ut.setMap(t,null)),this.clusters.forEach(t=>t.delete()),this.clusters=[]}renderClusters(){const t=new yt(this.markers,this.clusters),e=this.getMap();this.clusters.forEach(r=>{if(1===r.markers.length)r.marker=r.markers[0];else if(r.marker=this.renderer.render(r,t,e),r.markers.forEach(t=>ut.setMap(t,null)),this.onClusterClick){const t=ut.isAdvancedMarker(r.marker)?pt.GMP_CLICK:pt.CLUSTER_CLICK;r.marker.addListener(t,t=>{google.maps.event.trigger(this,pt.CLUSTER_CLICK,r),this.onClusterClick(t,r,e)})}ut.setMap(r.marker,e)})}},Et={top:60,bottom:60,left:276,right:60},vt="#fb8500",Mt=new u,At=(e,r,n)=>{t(/* @__PURE__ */o(i,{client:Mt,children:/* @__PURE__ */o(h,{event:e,onExplore:n})}),r)},Ct=t=>{const e=document.createElement("div");e.style.cssText=`\n background:${m(t.color,"#fb8500")};color:#fff;border-radius:20px;padding:5px 10px;\n font-size:12px;font-weight:600;white-space:nowrap;cursor:pointer;\n box-shadow:0 2px 8px rgba(0,0,0,0.25);border:2px solid rgba(255,255,255,0.4);\n display:inline-flex;align-items:center;gap:6px;\n `;const r=document.createElement("span");r.textContent=t.folder.name;const n=document.createElement("span");return n.style.cssText="background:rgba(0,0,0,0.18);border-radius:10px;padding:1px 5px;font-size:10px;",n.textContent=String(t.eventCount),e.appendChild(r),e.appendChild(n),e},_t=(t,e)=>{const r=document.createElement("div");if(r.style.cssText=`\n width:36px;height:36px;cursor:pointer;\n background:${t};border-radius:50% 50% 50% 0;transform:rotate(-45deg);\n border:2px solid white;box-shadow:0 2px 8px rgba(0,0,0,0.3);\n display:flex;align-items:center;justify-content:center;overflow:hidden;\n `,e){const t=document.createElement("img");t.src=d(e)??"",t.style.cssText="width:24px;height:24px;border-radius:50%;object-fit:cover;transform:rotate(45deg);",r.appendChild(t)}return r},Lt=({apiKey:t,onExplore:i,logoUrl:u})=>{const h=r(null),d=r(null),m=r(null),y=r(null),b=r([]),w=r([]),x=r(null),k=r(null),E=r(!1),v=r(!1),M=s(()=>(()=>{try{const t=sessionStorage.getItem(l);if(!t)return null;const e=JSON.parse(t);if(Array.isArray(e?.center)&&"number"==typeof e.zoom)return e}catch{}return null})(),[]),[A,C]=n(!1),[_,L]=n(!0),{folderTree:j,activeFolderId:I,activeFolder:O,visibleEvents:q,setActiveFolderId:T,isLoadingEvents:P}=f(),{organization:S}=c(),z=()=>{b.current.forEach(t=>{t.map=null}),b.current=[]},U=()=>{x.current&&(x.current.clearMarkers(),x.current=null),w.current.forEach(t=>{t.map=null}),w.current=[]};return e(()=>{if(!h.current||d.current)return;let e=!1;return(async()=>{try{const{setOptions:r,importLibrary:n}=await import("./BsT0vqml.js");if(e)return;if(r({key:t,v:"weekly"}),await Promise.all([n("maps"),n("marker"),n("visualization")]),e||!h.current)return;const s=window.google.maps;m.current=s;const o=M?.center?{lng:M.center[0],lat:M.center[1]}:{lat:20,lng:0},i=M?.zoom??3,a=new s.Map(h.current,{mapId:"DEMO_MAP_ID",renderingType:"VECTOR",mapTypeId:"roadmap",center:o,zoom:i,mapTypeControl:!1,streetViewControl:!1});d.current=a,y.current=new s.InfoWindow({maxWidth:280}),k.current=new s.visualization.HeatmapLayer({data:[],map:null,radius:30,opacity:.8});const c=()=>{try{const t=a.getCenter();if(!t)return;sessionStorage.setItem(l,JSON.stringify({center:[t.lng(),t.lat()],zoom:a.getZoom()}))}catch{}};a.addListener("idle",c),L(!1),C(!0)}finally{e||L(!1)}})(),()=>{e=!0,z(),U(),k.current&&(k.current.setMap(null),k.current=null),y.current?.close(),d.current=null,m.current=null}},[t]),e(()=>{if(!A)return;const t=d.current,e=m.current;if(t&&e)if(z(),U(),y.current?.close(),null===I&&j.length>0){k.current?.setMap(null);const r=n=>{for(const s of n)if(s.centroid){const r=Ct(s),n=new e.marker.AdvancedMarkerElement({map:t,position:{lng:s.centroid[0],lat:s.centroid[1]},content:r,gmpClickable:!0});n.addListener("click",()=>T(s.folder._id)),b.current.push(n)}else s.children.length>0&&r(s.children)};r(j)}else{const r=0===j.length&&null===I;if(0===q.length)return;if(r){const r=[],n=q.map(n=>{const s=n.location.y,o=n.location.x;r.push({location:new e.LatLng(s,o),weight:(n.views||0)+1});const a=_t(vt,u),c=new e.marker.AdvancedMarkerElement({map:t,position:{lat:s,lng:o},content:a,gmpClickable:!0});return c.addListener("click",()=>{const e=document.createElement("div");At(n,e,i),y.current.close(),y.current.setContent(e),y.current.open({anchor:c,map:t})}),c});if(w.current=n,x.current=new kt({markers:n,map:t,renderer:{render:({count:t,position:r})=>{const n=document.createElement("div"),s=t<10?28:t<30?34:40;return n.style.cssText=`\n width:${s}px;height:${s}px;border-radius:50%;cursor:pointer;\n background:${vt};color:#fff;\n display:flex;align-items:center;justify-content:center;\n font-size:13px;font-weight:700;\n box-shadow:0 2px 8px rgba(0,0,0,0.3);\n border:2px solid rgba(255,255,255,0.6);\n `,n.textContent=String(t),new e.marker.AdvancedMarkerElement({position:r,content:n,gmpClickable:!0,zIndex:Number(e.Marker?.MAX_ZINDEX??0)+t})}}}),k.current&&(k.current.setData(r),k.current.setMap(t)),!v.current&&(v.current=!0,!M)){const r=new e.LatLngBounds;q.forEach(t=>r.extend({lat:t.location.y,lng:t.location.x})),r.isEmpty()||t.fitBounds(r,Et)}}else{k.current?.setMap(null);const r=O?.color||vt,n=new e.LatLngBounds;q.forEach(s=>{const o=s.location.y,a=s.location.x;n.extend({lat:o,lng:a});const c=_t(r,u),l=new e.marker.AdvancedMarkerElement({map:t,position:{lat:o,lng:a},content:c,gmpClickable:!0});l.addListener("click",()=>{const e=document.createElement("div");At(s,e,i),y.current.close(),y.current.setContent(e),y.current.open({anchor:l,map:t})}),w.current.push(l)})}}},[I,j,q,A,i,u,T,O,M]),e(()=>{if(!A)return;const t=d.current,e=m.current;if(t&&e)if(E.current||!M){if(E.current=!0,I){const r=p(j,I);if(!r?.folder.boundary?.length)return;const n=new e.LatLngBounds;for(const t of r.folder.boundary)n.extend({lat:t.y,lng:t.x});n.isEmpty()||t.fitBounds(n,{...Et,maxZoom:14})}else if(j.length>0){const r=new e.LatLngBounds,n=t=>{for(const e of t)e.centroid?r.extend({lng:e.centroid[0],lat:e.centroid[1]}):n(e.children)};n(j),r.isEmpty()||t.fitBounds(r,{...Et,maxZoom:8})}}else E.current=!0},[I,j,A,M]),/* @__PURE__ */o("div",{class:"relative h-screen w-full sm:h-[calc(100vh-4rem)]",style:a(S),children:[
|
|
2
2
|
/* @__PURE__ */o(g,{positionClass:"absolute top-3 left-16 z-[1000]",folderTree:j,activeFolderId:I,setActiveFolderId:T}),P&&/* @__PURE__ */o("div",{class:"absolute inset-0 z-10 flex items-center justify-center bg-white/60",children:/* @__PURE__ */o("div",{class:"border-primary size-10 animate-spin rounded-full border-4 border-t-transparent"})}),_&&/* @__PURE__ */o("div",{class:"absolute inset-0 z-20 flex items-center justify-center bg-white/85",children:/* @__PURE__ */o("div",{class:"flex flex-col items-center gap-3",children:[/* @__PURE__ */o("div",{class:"border-primary size-10 animate-spin rounded-full border-4 border-t-transparent"}),/* @__PURE__ */o("p",{class:"text-sm font-medium text-slate-700",children:"Loading map…"})]})}),
|
|
3
3
|
/* @__PURE__ */o("div",{ref:h,class:"size-full"})]})};export{Lt as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as e,f as t,h as a,p as n,t as r,w as o}from"./C3uDEVBt.js";import{L as s,N as i,O as l,i as c,n as d,p as m,u}from"./BItJQVdK.js";import{n as p,r as h,t as g}from"./C8_zGNAf.js";import{n as f,r as v,t as x}from"./CnoPTYOO.js";import{c as N,l as w}from"./b6CwQBFC.js";import{t as y}from"./ekog7y-V.js";import{t as b}from"./Cb1JRT_1.js";import{t as T}from"./CCLXmMXp.js";import{t as D}from"./D9NypPiv.js";import{n as P,r as C,t as j}from"./
|
|
1
|
+
import{b as e,f as t,h as a,p as n,t as r,w as o}from"./C3uDEVBt.js";import{L as s,N as i,O as l,i as c,n as d,p as m,u}from"./BItJQVdK.js";import{n as p,r as h,t as g}from"./C8_zGNAf.js";import{n as f,r as v,t as x}from"./CnoPTYOO.js";import{c as N,l as w}from"./b6CwQBFC.js";import{t as y}from"./ekog7y-V.js";import{t as b}from"./Cb1JRT_1.js";import{t as T}from"./CCLXmMXp.js";import{t as D}from"./D9NypPiv.js";import{n as P,r as C,t as j}from"./BYEF5Khs.js";import{t as I}from"./BglDIiFp.js";import{n as E,o as S,r as z,t as A}from"./BQuhYd4G2.js";import{t as U}from"./DNG5BSHx2.js";import{a as q,i as O,n as _,r as k,t as M}from"./BdOzsWR32.js";var L=({content:e,onDeleted:t,onClose:a})=>{const n=function(){const e=s(),{user:t,props:a}=d(),n=a?.organizationId,r=t?.token;return v({mutationKey:["delete-upload",r??null],mutationFn:async({contentId:e})=>{const t=await i.post(u.DELETE_CONTENT,{json:{contentId:e},headers:{"x-org-id":n,...r?{Authorization:`Bearer ${r}`}:{}}}).json();if(t?.error)throw new Error(t.error);return{contentId:e}},onMutate:async({contentId:t})=>{await e.cancelQueries({queryKey:[l.USER_UPLOADS],exact:!1});const a=e.getQueriesData({queryKey:[l.USER_UPLOADS],exact:!1});return e.setQueriesData({queryKey:[l.USER_UPLOADS],exact:!1},e=>e?.pages?{...e,pages:e.pages.map(e=>({...e,data:e.data.filter(e=>e._id!==t),meta:{...e.meta,totalCount:Math.max(0,(e.meta.totalCount??0)-1)}}))}:e),{previousData:a}},onError:(t,a,n)=>{n?.previousData?.forEach(([t,a])=>{e.setQueryData(t,a)})}})}(),o=e?.rateCount??0,c=o<=0,m=c?null:`This photo has ${o} rating${o>1?"s":""}. Photos with at least 1 rating cannot be deleted.`;/* @__PURE__ */
|
|
2
2
|
return r(k,{open:Boolean(e),onOpenChange:e=>{e||a()},title:"Delete content?",description:m??"Are you sure you want to delete this content? This operation is permanent and cannot be undone.",cancelText:"Cancel",confirmText:c?"Delete":"Got it",confirmColor:c?"error":"primary",onCancel:a,onConfirm:c?()=>{if(!e||!c)return;const a=e.eventId,r=e._id;t(),n.mutate({contentId:r,eventId:a})}:a})};function $({className:e}){/* @__PURE__ */
|
|
3
3
|
return r("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */r("path",{fill:"currentColor",d:"M7 21q-.825 0-1.412-.587T5 19V6q-.425 0-.712-.288T4 5t.288-.712T5 4h4q0-.425.288-.712T10 3h4q.425 0 .713.288T15 4h4q.425 0 .713.288T20 5t-.288.713T19 6v13q0 .825-.587 1.413T17 21zM17 6H7v13h10zm-7 11q.425 0 .713-.288T11 16V9q0-.425-.288-.712T10 8t-.712.288T9 9v7q0 .425.288.713T10 17m4 0q.425 0 .713-.288T15 16V9q0-.425-.288-.712T14 8t-.712.288T13 9v7q0 .425.288.713T14 17M7 6v13z"})})}var R={[m.APPROVED]:{color:"text-success",bgColor:"bg-success/20",icon:/* @__PURE__ */r(M,{className:"size-full"}),title:"Approved",description:"Your upload has been approved and is now visible to everyone viewing this event."},[m.IN_REVIEW]:{color:"text-warning",bgColor:"bg-warning/20",icon:/* @__PURE__ */r(O,{className:"size-full"}),title:"In Review",description:"Your upload is currently being reviewed. It will be visible once approved by the event admin."},[m.REJECTED]:{color:"text-destructive",bgColor:"bg-destructive/20",icon:/* @__PURE__ */r(U,{className:"size-full"}),title:"Rejected",description:"Your upload was not approved as it may not meet the content guidelines. Please upload appropriate content."}},F=e=>{const t=new Date(e).getTime();if(Number.isNaN(t))return"";const a=Math.max(0,Math.floor((Date.now()-t)/1e3)),n=[[60,"second"],[60,"minute"],[24,"hour"],[30,"day"],[12,"month"],[Number.POSITIVE_INFINITY,"year"]];let r=a,o="second";for(const[s,i]of n){if(r<s){o=i;break}r=Math.floor(r/s),o=i}return"second"===o&&r<30?"just now":`${r} ${o}${1===r?"":"s"} ago`},V=({content:e,onDelete:t,onStatusClick:a})=>{const n=e.status,o=R[n];/* @__PURE__ */
|
|
4
4
|
return r("div",{className:"group relative size-full overflow-hidden sm:rounded",children:/* @__PURE__ */r("div",{className:"relative size-full",children:[
|