@qratilabs/qrati-connect 2.24.3 → 2.25.0

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.
@@ -1,4 +1,4 @@
1
- import{D as t,E as e,T as i,_ as n,b as s,f as o,g as r,h as l,i as a,m as c,n as d,p as h,t as p,v as u,w as m,y as g}from"./DrrpB4Om.js";import{C as f,D as w,L as b,N as T,O as y,S as v,a as k,i as x,l as q,m as _,n as E,u as C,v as S}from"./CaX2xgrP.js";import{n as N,r as I,t as L}from"./dT6WSX65.js";import{t as M}from"./ChJXhA9c.js";import{t as A}from"./CATr-3VW.js";import{t as B}from"./C3dOFk9A.js";import{n as R}from"./CJXPO3HP.js";import{n as V}from"./BkIDQGIs.js";import{t as z}from"./Bki5T_lb.js";import{n as F,r as O,t as P}from"./EjMoIoSK.js";import{n as H}from"./CVRTTCyF.js";import{a as D,i as U,n as $,o as j,r as W,s as G,t as K}from"./CsfDBJh72.js";import{a as Q,n as Y,o as Z,r as J,t as X}from"./DZtaQWVG2.js";function tt(t,e){const[i,n]=t;if(i===e)return t;if(void 0!==n&&void 0!==e&&void 0!==i&&e===n&&Math.abs(e-i)<=20){const s=Math.min(i,e),o=Math.max(i,e);return s===i&&o===n?t:[s,o]}return[e,i]}function et(t,e,i){const[[n],r]=s(tt,[i]),a=function(t){const[e,i]=l(t);return t===e||t&&e&&t.length===e.length&&!t.some((t,i)=>t!==e[i])?e:(i(t),t)}(e),c=o(void 0);return{containerRef:u(e=>{c.current?.disconnect(),c.current=void 0;const i=()=>r(function(t,e){let i=t?.clientWidth;if(void 0!==i&&e&&e.length>0){const t=[...e.filter(t=>t>0)].sort((t,e)=>e-t);t.push(Math.floor(t[t.length-1]/2)),i=t.find((e,n)=>e<=i||n===t.length-1)}return i}(e,a));i(),e&&"undefined"!=typeof ResizeObserver&&(c.current=new ResizeObserver(i),c.current.observe(e)),"function"==typeof t?t(e):t&&(t.current=e)},[t,a]),containerWidth:n}}function it(t){return["react-photo-album",t].filter(Boolean).join("--")}function nt({width:t,height:e}){const i=t/e;return Number.isFinite(i)?i:1}var st=Object.freeze([1200,600,300,0]);function ot(t,e){return"function"==typeof t?t(e):t}function rt(t,e){return void 0!==e?ot(t,e):void 0}function lt(t,e,i,n=0){if(void 0===e)return;const s=rt(t,e);return Math.round(Math.max(void 0===s?function(t,e){const i=st.findIndex(t=>t<=e);return ot(t[Math.max(i,0)],e)}(i,e):s,n))}function at(t,{spacing:e,padding:i,componentsProps:n,render:s}){return{spacing:lt(e,t,[20,15,10,5]),padding:lt(i,t,[0,0,0,0]),componentsProps:ot(n,t)||{},render:ot(s,t)}}function ct(t,e=0){const i=10**e;return Math.round((t+Number.EPSILON)*i)/i}function dt(t,e,i,n,s,o,r){let l,a;const c=t=>{const e=o*(s-1)+2*r*s;return`calc((${t.match(/^\s*calc\((.*)\)\s*$/)?.[1]??t} - ${e}px) / ${ct((n-e)/i,5)})`},d=t.srcSet;return d&&d.length>0&&(l=d.concat(d.some(({width:e})=>e===t.width)?[]:[{src:t.src,width:t.width,height:t.height}]).sort((t,e)=>t.width-e.width).map(t=>`${t.src} ${t.width}w`).join(", ")),a=e?.size?(e.sizes||[]).map(({viewport:t,size:e})=>`${t} ${c(e)}`).concat(c(e.size)).join(", "):`${Math.ceil(i/n*100)}vw`,{srcSet:l,sizes:a}}var ht=a(function({as:t,render:e,context:i,classes:n=[],variables:s={},style:o,className:r,children:l,...a},c){const d=function(...t){return t.filter(Boolean).join(" ")}(...(Array.isArray(n)?n:[n]).filter(t=>"string"==typeof t).map(it),r),h={style:{...Object.fromEntries(Object.entries(s).map(([t,e])=>{return[(i=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),`--${it(i)}`),"number"==typeof e?ct(e,5):e];var i})),...o},className:d,children:l,...a};if(e){const t=e({ref:c,...h},i);if(t)return t}return p(t||"div",{ref:c,...h})}),pt=a(function({photo:t,index:e,width:i,height:n,onClick:s,render:{wrapper:o,link:r,button:l,image:a,extras:c}={},componentsProps:{link:d,button:h,wrapper:u,image:m}={}},g){const{href:f}=t,w={photo:t,index:e,width:ct(i,3),height:ct(n,3)};let b;return b=f?{...d,as:"a",render:r,classes:["photo","link"],href:f,onClick:s}:s?{...h,as:"button",type:"button",render:l,classes:["photo","button"],onClick:s}:{...u,render:o,classes:"photo"},p(ht,{ref:g,variables:{photoWidth:w.width,photoHeight:w.height},context:w,...b,children:[p(ht,{as:"img",classes:"image",render:a,context:w,...m}),c?.({},w)]})}),ut=a(function({layout:e,sizes:i,model:n,skeleton:s,onClick:o,render:{container:r,track:l,photo:a,...c}={},componentsProps:{container:d,track:h,link:u,button:m,wrapper:g,image:f}={}},w){const{spacing:b,padding:T,containerWidth:y,tracks:v,variables:k,horizontal:x}=n||{};return p(ht,{role:"group","aria-label":"Photo album",...d,variables:{spacing:b,padding:T,containerWidth:y,...k},classes:["",e],render:r,ref:w,children:[void 0!==b&&void 0!==T&&void 0!==y&&v?.map(({photos:e,variables:n},s)=>{const r=e.length,d=x?r:v.length;return t(ht,{...h,key:s,render:l,classes:"track",variables:{trackSize:r,...n}},e.map(t=>{const{photo:e,index:n,width:s}=t,{key:r,src:l,alt:h="",title:w,label:v}=e,k=o?t=>{o({event:t,photo:e,index:n})}:void 0;if(a){const e=a({onClick:k},t);if(e)return e}const x=t=>v?{"aria-label":v,...t}:t;return p(pt,{onClick:k,render:c,componentsProps:{image:{loading:"lazy",decoding:"async",src:l,alt:h,title:w,...dt(e,i,s,y,d,b,T),...ot(f,t)},link:x(ot(u,t)),button:x(ot(m,t)),wrapper:ot(g,t)},...t},r??n)}))}),void 0===y&&s]})});function mt(t,e,i,n){return(e-(t.length-1)*i-2*n*t.length)/t.reduce((t,e)=>t+nt(e),0)}function gt(t,e,i,n,s,o,r){const l=t.slice(e,i),a=mt(l,n,s,o);return a>0?(a-r)**2*l.length:void 0}var ft=a(function({photos:t,breakpoints:e,defaultContainerWidth:i,...n},s){const{containerRef:o,containerWidth:r}=et(s,e,i),{spacing:l,padding:a,targetRowHeight:c,minPhotos:d,maxPhotos:u,...m}=function(t,{photos:e,targetRowHeight:i,rowConstraints:n,...s}){const{spacing:o,padding:r,componentsProps:l,render:a}=at(t,s),{singleRowMaxHeight:c,minPhotos:d,maxPhotos:h}=rt(n,t)||{};if(void 0!==c&&void 0!==o&&void 0!==r){const t=Math.floor(e.reduce((t,{width:e,height:i})=>t+e/i*c+2*r,o*(e.length-1)));t>0&&(l.container={...l.container},l.container.style={maxWidth:t,...l.container.style})}return{...s,targetRowHeight:lt(i,t,[t=>t/5,t=>t/4,t=>t/3,t=>t/2]),render:a,spacing:o,padding:r,minPhotos:d,maxPhotos:h,componentsProps:l}}(r,{photos:t,...n});return p(ut,{layout:"rows",ref:o,model:h(()=>void 0!==r&&void 0!==l&&void 0!==a&&void 0!==c?function(t,e,i,n,s,o,r){const l=Math.min(function(t,e,i,n){return ct(e/i/Math.min(...t.map(t=>nt(t))))+(n||0)+2}(t,n,s,o),r||1/0),a=o||1,c=t.length,d=new Array(c+1).fill(1/0),h=new Array(c+1).fill(-1);d[0]=0;for(let m=1;m<=c;m+=1)for(let o=m-a;o>=Math.max(0,m-l);o-=1){if(d[o]===1/0)continue;const r=gt(t,o,m,n,e,i,s);if(void 0===r)break;const l=d[o]+r;(d[m]===1/0||d[m]>l&&(d[m]/l>1.005||-1!==h[m]&&h[m]<o))&&(d[m]=l,h[m]=o)}if(d[c]===1/0)return;const p=[];for(let m=c;0!==m;m=h[m])p.push(m);p.push(0),p.reverse();const u=[];for(let m=1;m<p.length;m+=1){const s=t.slice(p[m-1],p[m]).map((t,e)=>({photo:t,index:p[m-1]+e})),o=mt(s.map(({photo:t})=>t),n,e,i);u.push({photos:s.map(({photo:t,index:e})=>({photo:t,index:e,width:o*nt(t),height:o}))})}return{spacing:e,padding:i,containerWidth:n,tracks:u,horizontal:!0}}(t,l,a,r,c,d,u):void 0,[t,l,a,r,c,d,u]),...m})});function wt(t,e,i,n,s,o,r){const l=[],a=r.reduce((t,e)=>t+e,0);for(let c=0;c<t.length-1;c+=1){const d=e.slice(t[c],t[c+1]).map((e,i)=>({photo:e,index:t[c]+i})),h=r.reduce((t,e,i)=>t+(o[c]-o[i])*e,0),p=(s-(t.length-2)*i-2*(t.length-1)*n-h)*r[c]/a;l.push({photos:d.map(({photo:t,index:e})=>({photo:t,index:e,width:p,height:p/nt(t)})),variables:{adjustedGaps:h,columnRatio:r[c]}})}return{tracks:l,variables:{totalRatio:a}}}function bt(t,e,i,n,s,o){const r=[],l=[];if(t.length<=o){const s=t.length>0?t.reduce((t,e)=>t+nt(e),0)/t.length:1;for(let e=0;e<o;e+=1)r[e]=2*i,l[e]=e<t.length?nt(t[e]):s;return wt(Array.from({length:o+1},(e,i)=>Math.min(i,t.length)),t,e,i,n,r,l)}const a=(c=function(t,e,i,n,s){return o=>{const r=[],l=1.5*s;let a=n/nt(t[o])+2*i;for(let c=o+1;c<t.length+1&&(r.push([c,(s-a)**2]),!(a>l||c===t.length));c+=1)a+=n/nt(t[c])+e+2*i;return r}}(t,e,i,s,(t.reduce((t,e)=>t+s/nt(e),0)+e*(t.length-o)+2*i*t.length)/o),d=o,h=0,p=t.length,function(t,e,i){const n=[i];for(let s=i,o=e;o>0;o-=1)[s]=t.get(s)[o],n.push(s);return n.reverse()}(function(t,e,i,n){const s=/* @__PURE__ */new Map,o=/* @__PURE__ */new Set;o.add(i);for(let r=0;r<e;r+=1){const i=[...o.keys()];o.clear(),i.forEach(i=>{const l=r>0?s.get(i)[r][1]:0;t(i).forEach(([t,a])=>{let c=s.get(t);c||(c=[],s.set(t,c));const d=l+a,h=c[r+1];(!h||h[1]>d&&(h[1]/d>1.0001||i<h[0]))&&(c[r+1]=[i,d]),r<e-1&&t!==n&&o.add(t)})})}return s}(c,d,h,p),d,p));var c,d,h,p;for(let u=0;u<a.length-1;u+=1){const n=t.slice(a[u],a[u+1]);r[u]=e*(n.length-1)+2*i*n.length,l[u]=1/n.reduce((t,e)=>t+1/nt(e),0)}return wt(a,t,e,i,n,r,l)}function Tt(t,e,i,n,s){const{tracks:o,variables:r}=bt(t,e,i,n,(n-e*(s-1)-2*i*s)/s,s);return o.some(t=>t.photos.some(({width:t,height:e})=>t<=0||e<=0))?s>1?Tt(t,e,i,n,s-1):void 0:{tracks:o,spacing:e,padding:i,containerWidth:n,variables:{columns:s,...r}}}var yt=a(function({photos:t,breakpoints:e,defaultContainerWidth:i,...n},s){const{containerRef:o,containerWidth:r}=et(s,e,i),{spacing:l,padding:a,columns:c,...d}=function(t,{columns:e,...i}){return{...i,...at(t,i),columns:lt(e,t,[5,4,3,2],1)}}(r,{photos:t,...n});return p(ut,{layout:"columns",ref:o,model:h(()=>void 0!==r&&void 0!==l&&void 0!==a&&void 0!==c?Tt(t,l,a,r,c):void 0,[t,l,a,r,c]),...d})});function vt(t,e,i,n,s){const o=(n-e*(s-1)-2*i*s)/s;if(o<=0)return s>1?vt(t,e,i,n,s-1):void 0;const r=[];for(let a=0;a<s;a+=1)r[a]=0;const l=t.reduce((t,n,s)=>{const l=r.reduce((t,e,i)=>e<r[t]-1?i:t,0);return r[l]=r[l]+o/nt(n)+e+2*i,t[l].push({photo:n,index:s}),t},Array.from({length:s},()=>[]));return{spacing:e,padding:i,containerWidth:n,variables:{columns:s},tracks:l.map(t=>({photos:t.map(({photo:t,index:e})=>({photo:t,index:e,width:o,height:o/nt(t)}))}))}}var kt=a(function({photos:t,breakpoints:e,defaultContainerWidth:i,...n},s){const{containerRef:o,containerWidth:r}=et(s,e,i),{spacing:l,padding:a,columns:c,...d}=function(t,{columns:e,...i}){return{...i,...at(t,i),columns:lt(e,t,[5,4,3,2],1)}}(r,{photos:t,...n});return p(ut,{layout:"masonry",ref:o,model:h(()=>void 0!==r&&void 0!==l&&void 0!==a&&void 0!==c?vt(t,l,a,r,c):void 0,[t,l,a,r,c]),...d})}),xt='url("https://res.cloudinary.com/dectzk2b2/image/upload/v1736933014/black_rpie3v.png")',qt=class{constructor(t){this.backdropOn=!1,this.lightbox=t,this.backgroundElement=null,this.backgroundVideoElement=null,this.referenceVideoElement=null,this.options={toggleBackdropButtonOrder:7},t.on("init",()=>{this.initPswpEvents(t.pswp)})}getRootNode(){return this.lightbox?.pswp?.element?.getRootNode?.()||document}querySelector(t){return this.getRootNode().querySelector?.(t)||document.querySelector(t)}initPswpEvents(t){t.on("afterInit",()=>{setTimeout(()=>{this.backgroundElement.style.display="block",this.backgroundVideoElement.style.display="block"},[500])}),t.on("uiRegister",()=>{t.ui.registerElement({name:"toggle-backdrop-button",title:"Toggle blur backdrop",order:this.options.toggleBackdropButtonOrder,isButton:!0,html:'<svg aria-hidden="true" class="pswp__icn p-0.5" viewBox="0 0 24 24"><use class="pswp__icn-shadow" xlink:href="#pswp__icn-show-backdrop"/><use class="pswp__icn-shadow" xlink:href="#pswp__icn-hide-backdrop"/><path id="pswp__icn-show-backdrop" style="display:none" d="M3 14.5q-.2 0-.35-.15T2.5 14t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m0-4q-.2 0-.35-.15T2.5 10t.15-.35T3 9.5t.35.15t.15.35t-.15.35t-.35.15M6 19q-.425 0-.712-.288T5 18t.288-.712T6 17t.713.288T7 18t-.288.713T6 19m0-4q-.425 0-.712-.288T5 14t.288-.712T6 13t.713.288T7 14t-.288.713T6 15m0-4q-.425 0-.712-.288T5 10t.288-.712T6 9t.713.288T7 10t-.288.713T6 11m0-4q-.425 0-.712-.288T5 6t.288-.712T6 5t.713.288T7 6t-.288.713T6 7m4 8.5q-.625 0-1.062-.437T8.5 14t.438-1.062T10 12.5t1.063.438T11.5 14t-.437 1.063T10 15.5m0-4q-.625 0-1.062-.437T8.5 10t.438-1.062T10 8.5t1.063.438T11.5 10t-.437 1.063T10 11.5m0 7.5q-.425 0-.712-.288T9 18t.288-.712T10 17t.713.288T11 18t-.288.713T10 19m0-12q-.425 0-.712-.288T9 6t.288-.712T10 5t.713.288T11 6t-.288.713T10 7m0 14.5q-.2 0-.35-.15T9.5 21t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m0-18q-.2 0-.35-.15T9.5 3t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m4 12q-.625 0-1.062-.437T12.5 14t.438-1.062T14 12.5t1.063.438T15.5 14t-.437 1.063T14 15.5m0-4q-.625 0-1.062-.437T12.5 10t.438-1.062T14 8.5t1.063.438T15.5 10t-.437 1.063T14 11.5m0 7.5q-.425 0-.712-.288T13 18t.288-.712T14 17t.713.288T15 18t-.288.713T14 19m0-12q-.425 0-.712-.288T13 6t.288-.712T14 5t.713.288T15 6t-.288.713T14 7m0 14.5q-.2 0-.35-.15T13.5 21t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m0-18q-.2 0-.35-.15T13.5 3t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15M18 19q-.425 0-.712-.288T17 18t.288-.712T18 17t.713.288T19 18t-.288.713T18 19m0-4q-.425 0-.712-.288T17 14t.288-.712T18 13t.713.288T19 14t-.288.713T18 15m0-4q-.425 0-.712-.288T17 10t.288-.712T18 9t.713.288T19 10t-.288.713T18 11m0-4q-.425 0-.712-.288T17 6t.288-.712T18 5t.713.288T19 6t-.288.713T18 7m3 7.5q-.2 0-.35-.15T20.5 14t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m0-4q-.2 0-.35-.15T20.5 10t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15"/><path id="pswp__icn-hide-backdrop" d="m19.1 21.9l-17-17q-.275-.275-.275-.7t.275-.7t.7-.275t.7.275l17 17q.275.275.275.7t-.275.7t-.7.275t-.7-.275m-9.1-.4q-.2 0-.35-.15T9.5 21t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m4 0q-.2 0-.35-.15T13.5 21t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15M6 19q-.425 0-.712-.288T5 18t.288-.712T6 17t.713.288T7 18t-.288.713T6 19m4 0q-.425 0-.712-.288T9 18t.288-.712T10 17t.713.288T11 18t-.288.713T10 19m4 0q-.425 0-.712-.288T13 18t.288-.712T14 17t.713.288T15 18t-.288.713T14 19m-4-3.5q-.65 0-1.075-.425T8.5 14t.425-1.075T10 12.5t1.075.425T11.5 14t-.425 1.075T10 15.5M6 15q-.425 0-.712-.288T5 14t.288-.712T6 13t.713.288T7 14t-.288.713T6 15m11.8-.025l-.775-.775q-.1-.5.213-.85T18 13q.425 0 .713.288T19 14q0 .45-.35.763t-.85.212M3 14.5q-.2 0-.35-.15T2.5 14t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m18 0q-.2 0-.35-.15T20.5 14t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m-6.7-3.05L12.55 9.7q.125-.525.5-.862T14 8.5q.65 0 1.075.425T15.5 10q0 .575-.35.963t-.85.487M6 11q-.425 0-.712-.287T5 10t.288-.712T6 9t.713.288T7 10t-.288.713T6 11m12 0q-.425 0-.712-.288T17 10t.288-.712T18 9t.713.288T19 10t-.288.713T18 11m-15-.5q-.2 0-.35-.15T2.5 10t.15-.35T3 9.5t.35.15t.15.35t-.15.35t-.35.15m18 0q-.2 0-.35-.15T20.5 10t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15M14 7q-.425 0-.712-.288T13 6t.288-.712T14 5t.713.288T15 6t-.288.713T14 7m-4.175-.025l-.8-.8q-.075-.5.225-.837T10 5q.425 0 .712.287T11 6q0 .45-.337.75t-.838.225M18 7q-.425 0-.712-.288T17 6t.288-.712T18 5t.713.288T19 6t-.288.713T18 7m-8-3.5q-.2 0-.35-.15T9.5 3t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m4 0q-.2 0-.35-.15T13.5 3t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15" /></svg>',onClick:()=>{this.toggleBackdrop(t)}}),this.createBlurBackground(t)}),t.on("change",()=>{this.backdropOn&&this.updateBlurBackground(t)}),t.on("close",()=>{this.removeBlurBackground(),this.backdropOn=!1})}createBlurBackground(t){const e=t.element;if(!this.backgroundElement){const t=document.createElement("div");t.style.position="fixed",t.style.top=0,t.style.left=0,t.style.width="100vw",t.style.height="100vh",t.style.backgroundSize="cover",t.style.backgroundPosition="center",t.style.filter="blur(44px)",t.style.zIndex=-1,t.style.transition="background-image 0.5s ease, opacity 0.5s ease",t.style.display="none",t.style.backgroundImage=xt,e.append(t),this.backgroundElement=t}if(!this.backgroundVideoElement){const t=document.createElement("video");t.style.position="fixed",t.style.top=0,t.style.left=0,t.style.width="100vw",t.style.height="100vh",t.style.objectFit="cover",t.style.filter="blur(44px)",t.style.zIndex=-1,t.style.display="none",t.style.transition="opacity 0.5s ease",t.muted=!0,t.loop=!0,t.autoplay=!1,t.muted=!0,t.volume=0,e.append(t),this.backgroundVideoElement=t}}toggleBackdrop(t){this.backdropOn?(this.backgroundElement.style.backgroundImage=xt,this.backgroundVideoElement.style.opacity=0,this.backgroundVideoElement.pause(),this.backdropOn=!1):(this.updateBlurBackground(t),this.backdropOn=!0);const e=this.querySelector("#pswp__icn-hide-backdrop"),i=this.querySelector("#pswp__icn-show-backdrop");e&&(e.style.display=this.backdropOn?"none":"inline"),i&&(i.style.display=this.backdropOn?"inline":"none")}updateBlurBackground(t){const e=t.currSlide;if(e?.data)if("video"===e.data.type){const t=this.backgroundVideoElement,i=e.content.element;"video"===i?.tagName?.toLowerCase()&&(this.referenceVideoElement=i,this.registerVideoEvents(i,t)),t.style.opacity=0,setTimeout(()=>{t.src=e.data.src,t.load(),this.initBackgroundVideo(),t.style.opacity=1},500),this.backgroundElement&&(this.backgroundElement.style.opacity=0)}else{if(this.backgroundElement){const t=((t,e=32,i=32)=>{if(!t||t.length<6||"undefined"==typeof document)return null;try{const n=V(t,e,i),s=document.createElement("canvas");s.width=e,s.height=i;const o=s.getContext("2d");if(!o)return null;const r=o.createImageData(e,i);return r.data.set(n),o.putImageData(r,0,0),s.toDataURL()}catch(n){return console.warn("[PhotoSwipeBackdrop] Failed to decode blurhash:",n),null}})(e.data.blurhash)||e.data.thumbnailUrl||e.data.src;this.backgroundElement.style.backgroundImage=t?`url("${t}")`:xt,this.backgroundElement.style.backgroundColor="transparent",this.backgroundElement.style.opacity=1}this.backgroundVideoElement&&(this.backgroundVideoElement.style.opacity=0,this.backgroundVideoElement.src="")}}initBackgroundVideo(){this.referenceVideoElement&&(this.backgroundVideoElement.currentTime=this.referenceVideoElement.currentTime,this.referenceVideoElement.currentTime>0&&!this.referenceVideoElement.paused&&!this.referenceVideoElement.ended&&this.referenceVideoElement.readyState>2&&this.backgroundVideoElement.play())}removeBlurBackground(){this.backgroundElement&&(this.backgroundElement.remove(),this.backgroundVideoElement.remove(),this.backgroundElement=null,this.backgroundVideoElement=null)}registerVideoEvents(t,e){this.foregroundVideoElement=t,t.addEventListener("play",()=>{e.currentTime=t.currentTime,e.play()}),t.addEventListener("pause",()=>{e.pause()}),t.addEventListener("ended",()=>{e.pause(),e.currentTime=0})}},_t=class{constructor(t,e={}){this.lightbox=t,this.options={filmstripButtonOrder:e.filmstripButtonOrder||7,height:e.height||112,thumbnailHeight:e.thumbnailHeight||64,thumbnailWidth:e.thumbnailWidth||96,itemMargin:e.itemMargin??4,buffer:e.buffer??5,backgroundColor:e.backgroundColor||"rgba(0, 0, 0, 0.6)",activeBorderColor:e.activeBorderColor||"#ff4800",...e},this.itemWidth=this.options.thumbnailWidth+this.options.itemMargin,this.filmstripVisible=!0,this.filmstripContainer=null,this.filmstripContent=null,this.filmstripTrack=null,this.isAnimating=!1,this.thumbnailPool=/* @__PURE__ */new Map,this.contents=[],this.scrollTickPending=!1,this.scrollHandler=this.scrollHandler.bind(this),this.handleThumbnailClick=this.handleThumbnailClick.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),t.on("init",()=>{this.initPswpEvents(t.pswp)})}getRootNode(){return this.lightbox?.pswp?.element?.getRootNode?.()||document}getElementById(t){const e=this.getRootNode();return"function"==typeof e.getElementById?e.getElementById(t):e.querySelector?.(`#${t}`)||document.getElementById(t)}querySelector(t){return this.getRootNode().querySelector?.(t)||document.querySelector(t)}initPswpEvents(t){this.pswp=t,t.on("uiRegister",()=>{this.registerToggleButton(),this.registerFilmstripContainer()}),t.on("afterInit",()=>{this.filmstripContainer=this.getElementById("pswp-filmstrip-container"),this.filmstripContainer&&this.injectStyles()}),t.on("openingAnimationEnd",()=>{this.filmstripVisible&&!this.isAnimating&&requestAnimationFrame(()=>this.showFilmstrip())}),t.on("change",()=>{this.filmstripVisible&&this.filmstripContent&&this.updateActiveSlide(t.currSlide?.index??0)}),t.on("bindEvents",()=>{document.addEventListener("keydown",this.handleKeyDown)}),t.on("close",()=>{document.removeEventListener("keydown",this.handleKeyDown),this.cleanupFilmstrip()})}injectStyles(){const t="pswp-filmstrip-styles",e=this.getRootNode(),i=e.head??e;if(i.querySelector?.(`#${t}`))return;const n=document.createElement("style");n.id=t,n.textContent=`\n #pswp-filmstrip-container {\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n z-index: 1000;\n transform: translateY(100%);\n transition: transform 0.3s ease-in-out;\n pointer-events: none;\n }\n\n #pswp-filmstrip-container.pswp-filmstrip--visible {\n transform: translateY(0);\n pointer-events: auto;\n }\n\n .pswp-filmstrip {\n position: relative;\n height: ${this.options.height}px;\n background-color: ${this.options.backgroundColor};\n overflow-x: auto;\n overflow-y: hidden;\n scrollbar-width: none;\n -ms-overflow-style: none;\n scroll-behavior: auto;\n user-select: none;\n -webkit-user-select: none;\n padding: 8px 16px;\n box-sizing: border-box;\n }\n\n .pswp-filmstrip::-webkit-scrollbar {\n display: none;\n }\n\n .pswp-filmstrip__track {\n position: relative;\n height: 100%;\n min-width: 100%;\n }\n\n .pswp-filmstrip__item {\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n display: inline-flex;\n flex-shrink: 0;\n padding: 0;\n border: none;\n background: none;\n cursor: pointer;\n outline: none;\n border-radius: 4px;\n overflow: hidden;\n transition: transform 0.15s ease;\n }\n\n .pswp-filmstrip__item:hover {\n transform: translateY(-50%) scale(1.05);\n }\n\n .pswp-filmstrip__item:active {\n transform: translateY(-50%) scale(0.95);\n }\n\n .pswp-filmstrip__thumb {\n width: ${this.options.thumbnailWidth}px;\n height: ${this.options.thumbnailHeight}px;\n border-radius: 4px;\n overflow: hidden;\n position: relative;\n border: 2px solid transparent;\n transition: border-color 0.2s ease;\n background-color: #333;\n }\n\n .pswp-filmstrip__thumb--active {\n border-color: ${this.options.activeBorderColor};\n }\n\n .pswp-filmstrip__img {\n position: absolute;\n inset: 0;\n width: 100%;\n height: 100%;\n object-fit: cover;\n object-position: center;\n z-index: 2;\n opacity: 0;\n transform: scale(0.95);\n transition: opacity 0.3s ease, transform 0.3s ease;\n }\n\n .pswp-filmstrip__img--loaded {\n opacity: 1;\n transform: scale(1);\n }\n\n .pswp-filmstrip__overlay {\n position: absolute;\n inset: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 3;\n pointer-events: none;\n }\n\n .pswp-filmstrip__overlay-icon {\n width: 24px;\n height: 24px;\n opacity: 0.8;\n }\n\n .pswp-filmstrip__ad-label {\n position: absolute;\n top: 4px;\n left: 4px;\n font-size: 10px;\n color: white;\n background-color: rgba(0, 0, 0, 0.6);\n padding: 2px 6px;\n border-radius: 3px;\n z-index: 3;\n }\n\n @media (min-width: 1024px) {\n .pswp-filmstrip__thumb {\n width: 80px;\n height: 80px;\n }\n\n .pswp-filmstrip__overlay-icon {\n width: 28px;\n height: 28px;\n }\n }\n `,i.appendChild(n)}registerToggleButton(){this.pswp.ui.registerElement({name:"filmstrip-toggle-button",title:"Toggle filmstrip",order:this.options.filmstripButtonOrder,isButton:!0,html:this.getToggleButtonHtml(),onClick:()=>this.toggleFilmstrip()})}registerFilmstripContainer(){this.pswp.ui.registerElement({name:"filmstrip",isButton:!1,appendTo:"root",html:'<div id="pswp-filmstrip-container"></div>'})}getToggleButtonHtml(){return'\n <svg aria-hidden="true" class="pswp__icn" viewBox="0 0 24 24" width="24" height="24" id="pswp-filmstrip-icon-show">\n <path d="M4 20q-.825 0-1.412-.587T2 18V6q0-.825.588-1.412T4 4v2.85L1.35 4.2q-.3-.3-.3-.712t.3-.713t.713-.3t.712.3l18.4 18.4q.3.3.3.7t-.3.7t-.712.3t-.713-.3L17.15 20zm0-2h11.15l-10-10H4zM22 6v11q0 .5-.312.75T21 18t-.687-.262t-.313-.763V8h-8.325q-.4 0-.763-.15t-.637-.425L8.55 5.7q-.225-.25-.275-.525t.075-.55t.35-.45T9.275 4H20q.825 0 1.413.588T22 6" />\n <path d="m 5.100795,16.58464 q -0.165328,0 -0.282961,-0.116899 Q 4.700201,16.350842 4.7,16.186347 V 13.398294 Q 4.7,13.233997 4.817834,13.117098 4.935667,13.000199 5.100795,13 h 2.805561 q 0.165328,0 0.283161,0.117098 0.117834,0.117099 0.117633,0.281196 v 2.788053 q 0,0.164296 -0.117633,0.281394 -0.117633,0.117099 -0.283161,0.116899 z" style="stroke-width:0.199771" />\n <path d="m 10.572143,16.65489 q -0.165327,0 -0.282961,-0.116899 -0.117632,-0.116899 -0.117833,-0.281394 v -2.788053 q 0,-0.164297 0.117833,-0.281196 0.117834,-0.116899 0.282961,-0.117098 h 2.805562 q 0.165328,0 0.283161,0.117098 0.117834,0.117099 0.117633,0.281196 v 2.788053 q 0,0.164296 -0.117633,0.281394 -0.117633,0.117099 -0.283161,0.116899 z" style="stroke-width:0.199771" />\n <path d="m 16.049385,16.724729 q -0.165327,0 -0.282961,-0.116899 -0.117632,-0.116899 -0.117833,-0.281394 v -2.788053 q 0,-0.164297 0.117833,-0.281196 0.117834,-0.116899 0.282961,-0.117098 h 2.805561 q 0.165328,0 0.283161,0.117098 0.117834,0.117099 0.117634,0.281196 v 2.788053 q 0,0.164296 -0.117634,0.281394 -0.117633,0.117099 -0.283161,0.116899 z" style="stroke-width:0.199771" />\n </svg>\n <svg aria-hidden="true" class="pswp__icn" viewBox="0 0 24 24" width="24" height="24" id="pswp-filmstrip-icon-hide" style="display:none">\n <path d="M4 20q-.825 0-1.412-.587T2 18V6q0-.825.588-1.412T4 4h16q.825 0 1.413.588T22 6v12q0 .825-.587 1.413T20 20zm0-2h16V8H4z" />\n <path d="m 5.100795,16.58464 q -0.165328,0 -0.282961,-0.116899 Q 4.700201,16.350842 4.7,16.186347 V 13.398294 Q 4.7,13.233997 4.817834,13.117098 4.935667,13.000199 5.100795,13 h 2.805561 q 0.165328,0 0.283161,0.117098 0.117834,0.117099 0.117633,0.281196 v 2.788053 q 0,0.164296 -0.117633,0.281394 -0.117633,0.117099 -0.283161,0.116899 z" style="stroke-width:0.199771" />\n <path d="m 10.572144,16.65489 q -0.165329,0 -0.282961,-0.116899 -0.117633,-0.116899 -0.117834,-0.281394 v -2.788053 q 0,-0.164297 0.117834,-0.281196 0.117832,-0.116899 0.282961,-0.117098 h 2.805561 q 0.165328,0 0.283161,0.117098 0.117834,0.117099 0.117633,0.281196 v 2.788053 q 0,0.164296 -0.117633,0.281394 -0.117633,0.117099 -0.283161,0.116899 z" style="stroke-width:0.199771" />\n <path d="m 16.049385,16.724729 q -0.165328,0 -0.282961,-0.116899 -0.117633,-0.116899 -0.117834,-0.281394 v -2.788053 q 0,-0.164297 0.117834,-0.281196 0.117833,-0.116899 0.282961,-0.117098 h 2.805561 q 0.165328,0 0.283161,0.117098 0.117834,0.117099 0.117634,0.281196 v 2.788053 q 0,0.164296 -0.117634,0.281394 -0.117633,0.117099 -0.283161,0.116899 z" style="stroke-width:0.199771" />\n </svg>\n '}setCaptionOffset(t){const e=this.getElementById("pswp-caption-container");e&&(e.style.bottom=t?"7rem":"0")}showFilmstrip(){if(!this.filmstripContainer||!this.pswp)return;const t=this.getContentsFromPswp().filter(t=>t&&t.thumbnailUrl);if(0===t.length)return;this.isAnimating=!0,this.contents=t;const e=this.pswp.currSlide?.index??0;this.createFilmstripContent(t,e),this.filmstripContainer.classList.add("pswp-filmstrip--visible"),this.filmstripVisible=!0;const i=this.querySelector(".pswp");i&&i.classList.add("pswp-filmstrip-active"),this.setCaptionOffset(!0),this.updateToggleIcon(),setTimeout(()=>{this.isAnimating=!1},300)}hideFilmstrip(){if(!this.filmstripContainer)return;this.isAnimating=!0,this.filmstripContainer.classList.remove("pswp-filmstrip--visible"),this.filmstripVisible=!1;const t=this.querySelector(".pswp");t&&t.classList.remove("pswp-filmstrip-active"),this.setCaptionOffset(!1),this.updateToggleIcon(),setTimeout(()=>{this.filmstripContainer&&(this.filmstripContainer.innerHTML=""),this.filmstripContent=null,this.filmstripTrack=null,this.thumbnailPool.clear(),this.contents=[],this.isAnimating=!1},300)}toggleFilmstrip(){this.isAnimating||(this.filmstripVisible?this.hideFilmstrip():this.showFilmstrip())}updateToggleIcon(){const t=this.getElementById("pswp-filmstrip-icon-show"),e=this.getElementById("pswp-filmstrip-icon-hide");t&&(t.style.display=this.filmstripVisible?"none":"block"),e&&(e.style.display=this.filmstripVisible?"block":"none")}createFilmstripContent(t,e){if(!this.filmstripContainer)return;const i=document.createElement("div");i.className="pswp-filmstrip",i.id="pswp-filmstrip-content";const n=document.createElement("div");n.className="pswp-filmstrip__track",n.style.width=t.length*this.itemWidth+"px",i.appendChild(n),this.filmstripContainer.innerHTML="",this.filmstripContainer.appendChild(i),this.filmstripContent=i,this.filmstripTrack=n,i.addEventListener("scroll",this.scrollHandler,{passive:!0}),this.renderVisibleThumbnails(e,!0)}scrollHandler(){!this.scrollTickPending&&this.filmstripContent&&(this.scrollTickPending=!0,requestAnimationFrame(()=>{this.scrollTickPending=!1,this.filmstripContent&&this.renderVisibleThumbnails(this.pswp?.currSlide?.index??0,!1)}))}renderVisibleThumbnails(t,e){if(!this.filmstripContent||!this.filmstripTrack)return;const i=this.filmstripContent,n=this.filmstripTrack,s=this.contents,o=s.length;if(0===o)return;const r=i.clientWidth,l=i.scrollLeft,a=this.options.buffer;let c=Math.floor(l/this.itemWidth)-a,d=Math.ceil((l+r)/this.itemWidth)+a;c=Math.max(0,c),d=Math.min(o-1,d);for(const[h,p]of this.thumbnailPool)(h<c||h>d)&&(p.parentNode&&p.parentNode.removeChild(p),this.thumbnailPool.delete(h));for(let h=c;h<=d;h++){const e=s[h];if(!e||!e.thumbnailUrl)continue;let i=this.thumbnailPool.get(h);const o=h===t;i?this.updateThumbnailState(i,h,o):(i=this.createThumbnailButton(e,h,o),i.style.left=h*this.itemWidth+"px",n.appendChild(i),this.thumbnailPool.set(h,i))}e&&requestAnimationFrame(()=>this.scrollToThumbnail(t))}createThumbnailButton(t,e,i){const n=document.createElement("button");n.className="pswp-filmstrip__item",n.setAttribute("data-index",e),n.setAttribute("type","button"),n.setAttribute("aria-label",`Go to slide ${e+1}`);const s=document.createElement("div");s.className="pswp-filmstrip__thumb "+(e===i?"pswp-filmstrip__thumb--active":""),s.setAttribute("data-thumb-index",e);const o=document.createElement("img");if(o.className="pswp-filmstrip__img",o.alt=t.caption||`Slide ${e+1}`,o.loading="lazy",o.decoding="async",o.onload=()=>o.classList.add("pswp-filmstrip__img--loaded"),o.src=t.thumbnailUrl,s.appendChild(o),"VIDEO"===t.type){const t=document.createElement("div");t.className="pswp-filmstrip__overlay",t.innerHTML='\n <svg class="pswp-filmstrip__overlay-icon" viewBox="0 0 24 24" fill="white">\n <path 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"/>\n </svg>\n ',s.appendChild(t)}return n.appendChild(s),n.addEventListener("click",this.handleThumbnailClick),n}updateThumbnailState(t,e,i){const n=t.querySelector(".pswp-filmstrip__thumb");n&&(i?(n.classList.add("pswp-filmstrip__thumb--active"),t.setAttribute("aria-current","true")):(n.classList.remove("pswp-filmstrip__thumb--active"),t.removeAttribute("aria-current")))}handleThumbnailClick(t){const e=t.currentTarget,i=parseInt(e.getAttribute("data-index"),10);this.pswp&&!isNaN(i)&&this.pswp.goTo(i)}updateActiveSlide(t){if(this.filmstripContent){for(const[e,i]of this.thumbnailPool)this.updateThumbnailState(i,e,e===t);this.scrollToThumbnail(t)}}scrollToThumbnail(t){if(!this.filmstripContent)return;const e=this.contents;if(t<0||t>=e.length)return;const i=this.filmstripContent,n=i.clientWidth/2,s=t*this.itemWidth+this.itemWidth/2;i.scrollTo({left:s-n,behavior:"smooth"})}handleKeyDown(t){this.filmstripVisible&&this.pswp&&("f"!==t.key&&"F"!==t.key||this.toggleFilmstrip())}getContentsFromPswp(){if(!this.pswp)return[];const t=this.pswp.options?.dataSource;if(t?.gallery)return this.getContentsFromDOM(t.gallery);const e="function"==typeof this.pswp.getNumItems?this.pswp.getNumItems():0;if(!e)return[];const i=[];for(let n=0;n<e;n++){let t=null;this.pswp.slides?.[n]?.data?t=this.pswp.slides[n].data:"function"==typeof this.pswp.getItemData&&(t=this.pswp.getItemData(n)),i.push(t||{})}return i.map((t,e)=>this.normalizeItem(t,e))}getContentsFromDOM(t){if(!t)return[];const e=t.querySelectorAll("a[href]");return Array.from(e).map((t,e)=>{const i=t.dataset,n=i.pswpThumbnailUrl||i.pswpMsrc||"",s=(i.pswpType||"").toString().toUpperCase(),o=i.pswpCaption||t.getAttribute("title")||"";return{id:i.pswpId||`item-${e}`,type:s,thumbnailUrl:n||i.pswpSrc||t.getAttribute("href")||"",caption:o}})}normalizeItem(t,e){try{const i=t||{},n=i.data||i,s=(n.type||n.pswpType||i.type||"").toString().toUpperCase(),o=n.thumbnailUrl||n.thumbnail||n.msrc||n.src||"";return{id:n.id||n._id||i.id||i._id||`item-${e}`,type:s,thumbnailUrl:o,caption:n.caption||n.alt||n.title||""}}catch{return{id:`item-${e}`,type:"",thumbnailUrl:"",caption:""}}}cleanupFilmstrip(){const t=this.querySelector(".pswp");t&&t.classList.remove("pswp-filmstrip-active"),this.setCaptionOffset(!1),this.filmstripContent&&(this.filmstripContent.removeEventListener("scroll",this.scrollHandler),this.filmstripContent.innerHTML=""),this.filmstripContainer&&(this.filmstripContainer.innerHTML="",this.filmstripContainer.classList.remove("pswp-filmstrip--visible")),this.filmstripContent=null,this.filmstripTrack=null,this.thumbnailPool.clear(),this.contents=[],this.filmstripVisible=!0,this.isAnimating=!1}},Et=class{constructor(t){this.lightbox=t,this.fullscreen=!1,this.options={fullScreenButtonOrder:7},t.on("init",()=>{this.initPswpEvents(t.pswp)})}getRootNode(){return this.lightbox?.pswp?.element?.getRootNode?.()||document}querySelector(t){return this.getRootNode().querySelector?.(t)||document.querySelector(t)}syncFullscreenState(){const t=document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement;this.fullscreen=Boolean(t);const e=this.querySelector("#pswp__icn-exit-fullscreen"),i=this.querySelector("#pswp__icn-fullscreen");e&&(e.style.display=this.fullscreen?"inline":"none"),i&&(i.style.display=this.fullscreen?"none":"inline")}initPswpEvents(t){const e=()=>this.syncFullscreenState();t.events.add(document,"fullscreenchange",e),t.events.add(document,"webkitfullscreenchange",e),t.on("uiRegister",()=>{(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)&&t.ui.registerElement({name:"fullscreen-button",title:"Toggle fullscreen view",order:this.options.fullScreenButtonOrder,isButton:!0,html:'<svg aria-hidden="true" class="pswp__icn p-1" viewBox="0 0 24 24"><use class="pswp__icn-shadow" xlink:href="#pswp__icn-fullscreen"/><use class="pswp__icn-shadow" xlink:href="#pswp__icn-exit-fullscreen"/><path id="pswp__icn-fullscreen" d="M5 19h2q.425 0 .713.288T8 20t-.288.713T7 21H4q-.425 0-.712-.288T3 20v-3q0-.425.288-.712T4 16t.713.288T5 17zm14 0v-2q0-.425.288-.712T20 16t.713.288T21 17v3q0 .425-.288.713T20 21h-3q-.425 0-.712-.288T16 20t.288-.712T17 19zM5 5v2q0 .425-.288.713T4 8t-.712-.288T3 7V4q0-.425.288-.712T4 3h3q.425 0 .713.288T8 4t-.288.713T7 5zm14 0h-2q-.425 0-.712-.288T16 4t.288-.712T17 3h3q.425 0 .713.288T21 4v3q0 .425-.288.713T20 8t-.712-.288T19 7z"/><path id="pswp__icn-exit-fullscreen" style="display:none" d="M6 18H4q-.425 0-.712-.288T3 17t.288-.712T4 16h3q.425 0 .713.288T8 17v3q0 .425-.288.713T7 21t-.712-.288T6 20zm12 0v2q0 .425-.288.713T17 21t-.712-.288T16 20v-3q0-.425.288-.712T17 16h3q.425 0 .713.288T21 17t-.288.713T20 18zM6 6V4q0-.425.288-.712T7 3t.713.288T8 4v3q0 .425-.288.713T7 8H4q-.425 0-.712-.288T3 7t.288-.712T4 6zm12 0h2q.425 0 .713.288T21 7t-.288.713T20 8h-3q-.425 0-.712-.288T16 7V4q0-.425.288-.712T17 3t.713.288T18 4z"/></svg>',onClick:()=>{this.toggleFullscreen(t)}})})}toggleFullscreen(t){const e=t.element;this.fullscreen?(document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen(),t.options.showHideAnimationType="zoom",this.fullscreen=!1):(e.requestFullscreen?e.requestFullscreen():e.webkitRequestFullscreen?e.webkitRequestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.msRequestFullscreen&&e.msRequestFullscreen(),t.options.showHideAnimationType="fade",this.fullscreen=!0);const i=this.querySelector("#pswp__icn-exit-fullscreen"),n=this.querySelector("#pswp__icn-fullscreen");i&&(i.style.display=this.fullscreen?"inline":"none"),n&&(n.style.display=this.fullscreen?"none":"inline")}},Ct=class{constructor(t,e={}){this.lightbox=t,this.autoHideTimer=null,this.uiVisible=!0,this.options=Object.assign({defaultDelayMs:4e3,playPauseButtonOrder:9,progressBarPosition:"top",progressBarTransition:"ease",restartOnSlideChange:!0,autoHideProgressBar:!0},e),this.setSlideshowLength(Number(localStorage.getItem("pswp_delay"))||this.options.defaultDelayMs),this.slideshowIsRunning=!1,this.slideshowTimerID=null,this.wakeLockIsRunning=!1,this.wakeLockSentinel=null,this.lightbox.on("init",()=>{this.init(this.lightbox.pswp)})}getRootNode(){return this.lightbox?.pswp?.element?.getRootNode?.()||document}querySelector(t){return this.getRootNode().querySelector?.(t)||document.querySelector(t)}injectProgressBarStyles(){const t=this.getRootNode(),e=t===document?document.head:t;if(!e||e.querySelector("style[data-pswp-slideshow]"))return;const i=document.createElement("style");i.setAttribute("data-pswp-slideshow",""),i.textContent=`.pswp__progress-bar{position:fixed;${this.options.progressBarPosition}:0;width:0;height:0}.pswp__progress-bar.running{width:100%;height:2px;transition-property:width;background:#ff4800}`,e.appendChild(i)}init(t){t.on("uiRegister",()=>{this.injectProgressBarStyles(),t.ui.registerElement({name:"playpause-button",title:"Toggle slideshow (Space)\nChange delay with +/- while running",order:this.options.playPauseButtonOrder,isButton:!0,html:'<svg aria-hidden="true" class="pswp__icn" viewBox="0 0 24 24"><use class="pswp__icn-shadow" xlink:href="#pswp__icn-play"/><use class="pswp__icn-shadow" xlink:href="#pswp__icn-stop"/><path id="pswp__icn-play" 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"/><path id="pswp__icn-stop" style="display:none" d="M16 19q-.825 0-1.412-.587T14 17V7q0-.825.588-1.412T16 5t1.413.588T18 7v10q0 .825-.587 1.413T16 19m-8 0q-.825 0-1.412-.587T6 17V7q0-.825.588-1.412T8 5t1.413.588T10 7v10q0 .825-.587 1.413T8 19"/></svg>',onClick:()=>{this.setSlideshowState()}}),t.ui.registerElement({name:"playtime",appendTo:"wrapper",tagName:"div",className:"pswp__progress-bar"}),t.events.add(document,"keydown",t=>{switch(t.code){case"Space":this.setSlideshowState(),t.preventDefault();break;case"ArrowUp":case"NumpadAdd":case"Equal":this.changeSlideshowLength(1e3),t.preventDefault();break;case"ArrowDown":case"NumpadSubtract":case"Minus":this.changeSlideshowLength(-1e3),t.preventDefault()}})}),this.lightbox.on("change",()=>{this.slideshowIsRunning&&this.options.restartOnSlideChange&&this.goToNextSlideAfterTimeout()}),this.lightbox.on("close",()=>{this.slideshowIsRunning&&this.setSlideshowState()})}showUI(){this.lightbox&&this.lightbox.pswp&&this.lightbox.pswp.element&&this.lightbox.pswp.element.classList.add("pswp--ui-visible"),this.uiVisible=!0}stopAutoHideTimer(){this.autoHideTimer&&(clearTimeout(this.autoHideTimer),this.autoHideTimer=null)}hideUI(){this.lightbox&&this.lightbox.pswp&&this.lightbox.pswp.element&&this.lightbox.pswp.element.classList.remove("pswp--ui-visible"),this.uiVisible=!1}resetAutoHideTimer(){this.autoHideTimer&&clearTimeout(this.autoHideTimer),this.autoHideTimer=setTimeout(()=>{this.slideshowIsRunning&&this.hideUI(),this.autoHideTimer=null},[3e3])}setSlideshowState(){this.slideshowIsRunning=!this.slideshowIsRunning,this.slideshowIsRunning?(this.goToNextSlideAfterTimeout(),this.showUI(),this.resetAutoHideTimer(),document.addEventListener("touchstart",()=>{this.stopAutoHideTimer(),this.showUI()}),document.addEventListener("touchend",()=>{this.resetAutoHideTimer()}),document.addEventListener("mousemove",()=>{this.uiVisible||this.showUI(),this.resetAutoHideTimer()})):(this.showUI(),this.resetSlideshow(),this.stopAutoHideTimer());const t=this.querySelector("#pswp__icn-stop"),e=this.querySelector("#pswp__icn-play");t&&(t.style.display=this.slideshowIsRunning?"inline":"none"),e&&(e.style.display=this.slideshowIsRunning?"none":"inline");const i=this.querySelector(".pswp__progress-bar");i&&(i.style.opacity=this.options.autoHideProgressBar?null:1),this.toggleWakeLock()}setSlideshowLength(t){this.options.defaultDelayMs=Math.min(Math.max(t,1e3),2147483647),this.options.defaultDelayMs!=t&&localStorage.setItem("pswp_delay",this.options.defaultDelayMs)}changeSlideshowLength(t){if(!this.slideshowIsRunning)return;this.setSlideshowLength(this.options.defaultDelayMs+t),localStorage.setItem("pswp_delay",this.options.defaultDelayMs);const e=this.querySelector(".pswp__counter");e&&(e.innerHTML=this.options.defaultDelayMs/1e3+"s"),this.goToNextSlideAfterTimeout()}isVideoContent(t){return"video"===t?.data?.type}getSlideTimeout(){const t=this.lightbox.pswp.currSlide.content;if(this.isVideoContent(t)){const e=t.element;if(e.paused)return this.options.defaultDelayMs;const i=e.duration,n=e.currentTime;return isNaN(i)||isNaN(n)?this.options.defaultDelayMs:1e3*(i-n)}return this.options.defaultDelayMs}slideContentHasLoaded(){const t=this.lightbox.pswp.currSlide.content;if(this.isVideoContent(t)){const e=t.element;return e.ended||e.readyState===HTMLMediaElement.HAVE_ENOUGH_DATA&&[HTMLMediaElement.NETWORK_IDLE,HTMLMediaElement.NETWORK_LOADING].includes(e.networkState)}return!t.isLoading()}goToNextSlideAfterTimeout(){if(this.resetSlideshow(),this.slideContentHasLoaded()){const t=this.getSlideTimeout();this.slideshowTimerID=setTimeout(()=>{this.lightbox.pswp.next(),this.options.restartOnSlideChange||this.goToNextSlideAfterTimeout()},t),setTimeout(()=>{this.slideshowIsRunning&&this.toggleProgressBar(t)},100)}else this.slideshowTimerID=setTimeout(()=>{this.goToNextSlideAfterTimeout()},200)}getSlideTransition(){return this.isVideoContent(this.lightbox.pswp.currSlide.content)?"linear":this.options.progressBarTransition}toggleProgressBar(t){const e=this.querySelector(".pswp__progress-bar");e&&(t?(e.style.transitionTimingFunction=this.getSlideTransition(),e.style.transitionDuration=`${t}ms`,e.classList.add("running")):e.classList.remove("running"))}toggleWakeLock(){this.wakeLockIsRunning!=this.slideshowIsRunning&&("keepAwake"in screen?screen.keepAwake=this.slideshowIsRunning:"wakeLock"in navigator&&(this.wakeLockSentinel?this.wakeLockSentinel.release().then(()=>(this.wakeLockSentinel=null,!0)).catch(t=>console.error(t)):navigator.wakeLock.request("screen").then(t=>(this.wakeLockSentinel=t,this.wakeLockSentinel.addEventListener("release",()=>{this.wakeLockSentinel=null,this.wakeLockIsRunning=!1}),!0)).catch(t=>{})),this.wakeLockIsRunning=this.slideshowIsRunning)}resetSlideshow(){this.toggleProgressBar(),this.slideshowTimerID&&(clearTimeout(this.slideshowTimerID),this.slideshowTimerID=null)}},St={[String(q.NONE)]:function({className:t}){/* @__PURE__ */
1
+ import{D as t,E as e,T as i,_ as n,b as s,f as o,g as r,h as l,i as a,m as c,n as d,p as h,t as p,v as u,w as m,y as g}from"./DrrpB4Om.js";import{C as f,D as w,L as b,N as T,O as y,S as v,a as k,i as x,l as q,m as _,n as E,u as C,v as S}from"./CaX2xgrP.js";import{n as N,r as I,t as L}from"./dT6WSX65.js";import{t as M}from"./ChJXhA9c.js";import{t as A}from"./CATr-3VW.js";import{n as B}from"./CJXPO3HP.js";import{n as R}from"./BkIDQGIs.js";import{t as V}from"./Bki5T_lb.js";import{n as z,r as F,t as O}from"./EjMoIoSK.js";import{n as P}from"./CVRTTCyF.js";import{t as H}from"./C3dOFk9A.js";import{a as D,i as U,n as $,o as j,r as W,s as G,t as K}from"./CsfDBJh72.js";import{a as Q,n as Y,o as Z,r as J,t as X}from"./DZtaQWVG2.js";function tt(t,e){const[i,n]=t;if(i===e)return t;if(void 0!==n&&void 0!==e&&void 0!==i&&e===n&&Math.abs(e-i)<=20){const s=Math.min(i,e),o=Math.max(i,e);return s===i&&o===n?t:[s,o]}return[e,i]}function et(t,e,i){const[[n],r]=s(tt,[i]),a=function(t){const[e,i]=l(t);return t===e||t&&e&&t.length===e.length&&!t.some((t,i)=>t!==e[i])?e:(i(t),t)}(e),c=o(void 0);return{containerRef:u(e=>{c.current?.disconnect(),c.current=void 0;const i=()=>r(function(t,e){let i=t?.clientWidth;if(void 0!==i&&e&&e.length>0){const t=[...e.filter(t=>t>0)].sort((t,e)=>e-t);t.push(Math.floor(t[t.length-1]/2)),i=t.find((e,n)=>e<=i||n===t.length-1)}return i}(e,a));i(),e&&"undefined"!=typeof ResizeObserver&&(c.current=new ResizeObserver(i),c.current.observe(e)),"function"==typeof t?t(e):t&&(t.current=e)},[t,a]),containerWidth:n}}function it(t){return["react-photo-album",t].filter(Boolean).join("--")}function nt({width:t,height:e}){const i=t/e;return Number.isFinite(i)?i:1}var st=Object.freeze([1200,600,300,0]);function ot(t,e){return"function"==typeof t?t(e):t}function rt(t,e){return void 0!==e?ot(t,e):void 0}function lt(t,e,i,n=0){if(void 0===e)return;const s=rt(t,e);return Math.round(Math.max(void 0===s?function(t,e){const i=st.findIndex(t=>t<=e);return ot(t[Math.max(i,0)],e)}(i,e):s,n))}function at(t,{spacing:e,padding:i,componentsProps:n,render:s}){return{spacing:lt(e,t,[20,15,10,5]),padding:lt(i,t,[0,0,0,0]),componentsProps:ot(n,t)||{},render:ot(s,t)}}function ct(t,e=0){const i=10**e;return Math.round((t+Number.EPSILON)*i)/i}function dt(t,e,i,n,s,o,r){let l,a;const c=t=>{const e=o*(s-1)+2*r*s;return`calc((${t.match(/^\s*calc\((.*)\)\s*$/)?.[1]??t} - ${e}px) / ${ct((n-e)/i,5)})`},d=t.srcSet;return d&&d.length>0&&(l=d.concat(d.some(({width:e})=>e===t.width)?[]:[{src:t.src,width:t.width,height:t.height}]).sort((t,e)=>t.width-e.width).map(t=>`${t.src} ${t.width}w`).join(", ")),a=e?.size?(e.sizes||[]).map(({viewport:t,size:e})=>`${t} ${c(e)}`).concat(c(e.size)).join(", "):`${Math.ceil(i/n*100)}vw`,{srcSet:l,sizes:a}}var ht=a(function({as:t,render:e,context:i,classes:n=[],variables:s={},style:o,className:r,children:l,...a},c){const d=function(...t){return t.filter(Boolean).join(" ")}(...(Array.isArray(n)?n:[n]).filter(t=>"string"==typeof t).map(it),r),h={style:{...Object.fromEntries(Object.entries(s).map(([t,e])=>{return[(i=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),`--${it(i)}`),"number"==typeof e?ct(e,5):e];var i})),...o},className:d,children:l,...a};if(e){const t=e({ref:c,...h},i);if(t)return t}return p(t||"div",{ref:c,...h})}),pt=a(function({photo:t,index:e,width:i,height:n,onClick:s,render:{wrapper:o,link:r,button:l,image:a,extras:c}={},componentsProps:{link:d,button:h,wrapper:u,image:m}={}},g){const{href:f}=t,w={photo:t,index:e,width:ct(i,3),height:ct(n,3)};let b;return b=f?{...d,as:"a",render:r,classes:["photo","link"],href:f,onClick:s}:s?{...h,as:"button",type:"button",render:l,classes:["photo","button"],onClick:s}:{...u,render:o,classes:"photo"},p(ht,{ref:g,variables:{photoWidth:w.width,photoHeight:w.height},context:w,...b,children:[p(ht,{as:"img",classes:"image",render:a,context:w,...m}),c?.({},w)]})}),ut=a(function({layout:e,sizes:i,model:n,skeleton:s,onClick:o,render:{container:r,track:l,photo:a,...c}={},componentsProps:{container:d,track:h,link:u,button:m,wrapper:g,image:f}={}},w){const{spacing:b,padding:T,containerWidth:y,tracks:v,variables:k,horizontal:x}=n||{};return p(ht,{role:"group","aria-label":"Photo album",...d,variables:{spacing:b,padding:T,containerWidth:y,...k},classes:["",e],render:r,ref:w,children:[void 0!==b&&void 0!==T&&void 0!==y&&v?.map(({photos:e,variables:n},s)=>{const r=e.length,d=x?r:v.length;return t(ht,{...h,key:s,render:l,classes:"track",variables:{trackSize:r,...n}},e.map(t=>{const{photo:e,index:n,width:s}=t,{key:r,src:l,alt:h="",title:w,label:v}=e,k=o?t=>{o({event:t,photo:e,index:n})}:void 0;if(a){const e=a({onClick:k},t);if(e)return e}const x=t=>v?{"aria-label":v,...t}:t;return p(pt,{onClick:k,render:c,componentsProps:{image:{loading:"lazy",decoding:"async",src:l,alt:h,title:w,...dt(e,i,s,y,d,b,T),...ot(f,t)},link:x(ot(u,t)),button:x(ot(m,t)),wrapper:ot(g,t)},...t},r??n)}))}),void 0===y&&s]})});function mt(t,e,i,n){return(e-(t.length-1)*i-2*n*t.length)/t.reduce((t,e)=>t+nt(e),0)}function gt(t,e,i,n,s,o,r){const l=t.slice(e,i),a=mt(l,n,s,o);return a>0?(a-r)**2*l.length:void 0}var ft=a(function({photos:t,breakpoints:e,defaultContainerWidth:i,...n},s){const{containerRef:o,containerWidth:r}=et(s,e,i),{spacing:l,padding:a,targetRowHeight:c,minPhotos:d,maxPhotos:u,...m}=function(t,{photos:e,targetRowHeight:i,rowConstraints:n,...s}){const{spacing:o,padding:r,componentsProps:l,render:a}=at(t,s),{singleRowMaxHeight:c,minPhotos:d,maxPhotos:h}=rt(n,t)||{};if(void 0!==c&&void 0!==o&&void 0!==r){const t=Math.floor(e.reduce((t,{width:e,height:i})=>t+e/i*c+2*r,o*(e.length-1)));t>0&&(l.container={...l.container},l.container.style={maxWidth:t,...l.container.style})}return{...s,targetRowHeight:lt(i,t,[t=>t/5,t=>t/4,t=>t/3,t=>t/2]),render:a,spacing:o,padding:r,minPhotos:d,maxPhotos:h,componentsProps:l}}(r,{photos:t,...n});return p(ut,{layout:"rows",ref:o,model:h(()=>void 0!==r&&void 0!==l&&void 0!==a&&void 0!==c?function(t,e,i,n,s,o,r){const l=Math.min(function(t,e,i,n){return ct(e/i/Math.min(...t.map(t=>nt(t))))+(n||0)+2}(t,n,s,o),r||1/0),a=o||1,c=t.length,d=new Array(c+1).fill(1/0),h=new Array(c+1).fill(-1);d[0]=0;for(let m=1;m<=c;m+=1)for(let o=m-a;o>=Math.max(0,m-l);o-=1){if(d[o]===1/0)continue;const r=gt(t,o,m,n,e,i,s);if(void 0===r)break;const l=d[o]+r;(d[m]===1/0||d[m]>l&&(d[m]/l>1.005||-1!==h[m]&&h[m]<o))&&(d[m]=l,h[m]=o)}if(d[c]===1/0)return;const p=[];for(let m=c;0!==m;m=h[m])p.push(m);p.push(0),p.reverse();const u=[];for(let m=1;m<p.length;m+=1){const s=t.slice(p[m-1],p[m]).map((t,e)=>({photo:t,index:p[m-1]+e})),o=mt(s.map(({photo:t})=>t),n,e,i);u.push({photos:s.map(({photo:t,index:e})=>({photo:t,index:e,width:o*nt(t),height:o}))})}return{spacing:e,padding:i,containerWidth:n,tracks:u,horizontal:!0}}(t,l,a,r,c,d,u):void 0,[t,l,a,r,c,d,u]),...m})});function wt(t,e,i,n,s,o,r){const l=[],a=r.reduce((t,e)=>t+e,0);for(let c=0;c<t.length-1;c+=1){const d=e.slice(t[c],t[c+1]).map((e,i)=>({photo:e,index:t[c]+i})),h=r.reduce((t,e,i)=>t+(o[c]-o[i])*e,0),p=(s-(t.length-2)*i-2*(t.length-1)*n-h)*r[c]/a;l.push({photos:d.map(({photo:t,index:e})=>({photo:t,index:e,width:p,height:p/nt(t)})),variables:{adjustedGaps:h,columnRatio:r[c]}})}return{tracks:l,variables:{totalRatio:a}}}function bt(t,e,i,n,s,o){const r=[],l=[];if(t.length<=o){const s=t.length>0?t.reduce((t,e)=>t+nt(e),0)/t.length:1;for(let e=0;e<o;e+=1)r[e]=2*i,l[e]=e<t.length?nt(t[e]):s;return wt(Array.from({length:o+1},(e,i)=>Math.min(i,t.length)),t,e,i,n,r,l)}const a=(c=function(t,e,i,n,s){return o=>{const r=[],l=1.5*s;let a=n/nt(t[o])+2*i;for(let c=o+1;c<t.length+1&&(r.push([c,(s-a)**2]),!(a>l||c===t.length));c+=1)a+=n/nt(t[c])+e+2*i;return r}}(t,e,i,s,(t.reduce((t,e)=>t+s/nt(e),0)+e*(t.length-o)+2*i*t.length)/o),d=o,h=0,p=t.length,function(t,e,i){const n=[i];for(let s=i,o=e;o>0;o-=1)[s]=t.get(s)[o],n.push(s);return n.reverse()}(function(t,e,i,n){const s=/* @__PURE__ */new Map,o=/* @__PURE__ */new Set;o.add(i);for(let r=0;r<e;r+=1){const i=[...o.keys()];o.clear(),i.forEach(i=>{const l=r>0?s.get(i)[r][1]:0;t(i).forEach(([t,a])=>{let c=s.get(t);c||(c=[],s.set(t,c));const d=l+a,h=c[r+1];(!h||h[1]>d&&(h[1]/d>1.0001||i<h[0]))&&(c[r+1]=[i,d]),r<e-1&&t!==n&&o.add(t)})})}return s}(c,d,h,p),d,p));var c,d,h,p;for(let u=0;u<a.length-1;u+=1){const n=t.slice(a[u],a[u+1]);r[u]=e*(n.length-1)+2*i*n.length,l[u]=1/n.reduce((t,e)=>t+1/nt(e),0)}return wt(a,t,e,i,n,r,l)}function Tt(t,e,i,n,s){const{tracks:o,variables:r}=bt(t,e,i,n,(n-e*(s-1)-2*i*s)/s,s);return o.some(t=>t.photos.some(({width:t,height:e})=>t<=0||e<=0))?s>1?Tt(t,e,i,n,s-1):void 0:{tracks:o,spacing:e,padding:i,containerWidth:n,variables:{columns:s,...r}}}var yt=a(function({photos:t,breakpoints:e,defaultContainerWidth:i,...n},s){const{containerRef:o,containerWidth:r}=et(s,e,i),{spacing:l,padding:a,columns:c,...d}=function(t,{columns:e,...i}){return{...i,...at(t,i),columns:lt(e,t,[5,4,3,2],1)}}(r,{photos:t,...n});return p(ut,{layout:"columns",ref:o,model:h(()=>void 0!==r&&void 0!==l&&void 0!==a&&void 0!==c?Tt(t,l,a,r,c):void 0,[t,l,a,r,c]),...d})});function vt(t,e,i,n,s){const o=(n-e*(s-1)-2*i*s)/s;if(o<=0)return s>1?vt(t,e,i,n,s-1):void 0;const r=[];for(let a=0;a<s;a+=1)r[a]=0;const l=t.reduce((t,n,s)=>{const l=r.reduce((t,e,i)=>e<r[t]-1?i:t,0);return r[l]=r[l]+o/nt(n)+e+2*i,t[l].push({photo:n,index:s}),t},Array.from({length:s},()=>[]));return{spacing:e,padding:i,containerWidth:n,variables:{columns:s},tracks:l.map(t=>({photos:t.map(({photo:t,index:e})=>({photo:t,index:e,width:o,height:o/nt(t)}))}))}}var kt=a(function({photos:t,breakpoints:e,defaultContainerWidth:i,...n},s){const{containerRef:o,containerWidth:r}=et(s,e,i),{spacing:l,padding:a,columns:c,...d}=function(t,{columns:e,...i}){return{...i,...at(t,i),columns:lt(e,t,[5,4,3,2],1)}}(r,{photos:t,...n});return p(ut,{layout:"masonry",ref:o,model:h(()=>void 0!==r&&void 0!==l&&void 0!==a&&void 0!==c?vt(t,l,a,r,c):void 0,[t,l,a,r,c]),...d})}),xt='url("https://res.cloudinary.com/dectzk2b2/image/upload/v1736933014/black_rpie3v.png")',qt=class{constructor(t){this.backdropOn=!1,this.lightbox=t,this.backgroundElement=null,this.backgroundVideoElement=null,this.referenceVideoElement=null,this.options={toggleBackdropButtonOrder:7},t.on("init",()=>{this.initPswpEvents(t.pswp)})}getRootNode(){return this.lightbox?.pswp?.element?.getRootNode?.()||document}querySelector(t){return this.getRootNode().querySelector?.(t)||document.querySelector(t)}initPswpEvents(t){t.on("afterInit",()=>{setTimeout(()=>{this.backgroundElement.style.display="block",this.backgroundVideoElement.style.display="block"},[500])}),t.on("uiRegister",()=>{t.ui.registerElement({name:"toggle-backdrop-button",title:"Toggle blur backdrop",order:this.options.toggleBackdropButtonOrder,isButton:!0,html:'<svg aria-hidden="true" class="pswp__icn p-0.5" viewBox="0 0 24 24"><use class="pswp__icn-shadow" xlink:href="#pswp__icn-show-backdrop"/><use class="pswp__icn-shadow" xlink:href="#pswp__icn-hide-backdrop"/><path id="pswp__icn-show-backdrop" style="display:none" d="M3 14.5q-.2 0-.35-.15T2.5 14t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m0-4q-.2 0-.35-.15T2.5 10t.15-.35T3 9.5t.35.15t.15.35t-.15.35t-.35.15M6 19q-.425 0-.712-.288T5 18t.288-.712T6 17t.713.288T7 18t-.288.713T6 19m0-4q-.425 0-.712-.288T5 14t.288-.712T6 13t.713.288T7 14t-.288.713T6 15m0-4q-.425 0-.712-.288T5 10t.288-.712T6 9t.713.288T7 10t-.288.713T6 11m0-4q-.425 0-.712-.288T5 6t.288-.712T6 5t.713.288T7 6t-.288.713T6 7m4 8.5q-.625 0-1.062-.437T8.5 14t.438-1.062T10 12.5t1.063.438T11.5 14t-.437 1.063T10 15.5m0-4q-.625 0-1.062-.437T8.5 10t.438-1.062T10 8.5t1.063.438T11.5 10t-.437 1.063T10 11.5m0 7.5q-.425 0-.712-.288T9 18t.288-.712T10 17t.713.288T11 18t-.288.713T10 19m0-12q-.425 0-.712-.288T9 6t.288-.712T10 5t.713.288T11 6t-.288.713T10 7m0 14.5q-.2 0-.35-.15T9.5 21t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m0-18q-.2 0-.35-.15T9.5 3t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m4 12q-.625 0-1.062-.437T12.5 14t.438-1.062T14 12.5t1.063.438T15.5 14t-.437 1.063T14 15.5m0-4q-.625 0-1.062-.437T12.5 10t.438-1.062T14 8.5t1.063.438T15.5 10t-.437 1.063T14 11.5m0 7.5q-.425 0-.712-.288T13 18t.288-.712T14 17t.713.288T15 18t-.288.713T14 19m0-12q-.425 0-.712-.288T13 6t.288-.712T14 5t.713.288T15 6t-.288.713T14 7m0 14.5q-.2 0-.35-.15T13.5 21t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m0-18q-.2 0-.35-.15T13.5 3t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15M18 19q-.425 0-.712-.288T17 18t.288-.712T18 17t.713.288T19 18t-.288.713T18 19m0-4q-.425 0-.712-.288T17 14t.288-.712T18 13t.713.288T19 14t-.288.713T18 15m0-4q-.425 0-.712-.288T17 10t.288-.712T18 9t.713.288T19 10t-.288.713T18 11m0-4q-.425 0-.712-.288T17 6t.288-.712T18 5t.713.288T19 6t-.288.713T18 7m3 7.5q-.2 0-.35-.15T20.5 14t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m0-4q-.2 0-.35-.15T20.5 10t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15"/><path id="pswp__icn-hide-backdrop" d="m19.1 21.9l-17-17q-.275-.275-.275-.7t.275-.7t.7-.275t.7.275l17 17q.275.275.275.7t-.275.7t-.7.275t-.7-.275m-9.1-.4q-.2 0-.35-.15T9.5 21t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m4 0q-.2 0-.35-.15T13.5 21t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15M6 19q-.425 0-.712-.288T5 18t.288-.712T6 17t.713.288T7 18t-.288.713T6 19m4 0q-.425 0-.712-.288T9 18t.288-.712T10 17t.713.288T11 18t-.288.713T10 19m4 0q-.425 0-.712-.288T13 18t.288-.712T14 17t.713.288T15 18t-.288.713T14 19m-4-3.5q-.65 0-1.075-.425T8.5 14t.425-1.075T10 12.5t1.075.425T11.5 14t-.425 1.075T10 15.5M6 15q-.425 0-.712-.288T5 14t.288-.712T6 13t.713.288T7 14t-.288.713T6 15m11.8-.025l-.775-.775q-.1-.5.213-.85T18 13q.425 0 .713.288T19 14q0 .45-.35.763t-.85.212M3 14.5q-.2 0-.35-.15T2.5 14t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m18 0q-.2 0-.35-.15T20.5 14t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m-6.7-3.05L12.55 9.7q.125-.525.5-.862T14 8.5q.65 0 1.075.425T15.5 10q0 .575-.35.963t-.85.487M6 11q-.425 0-.712-.287T5 10t.288-.712T6 9t.713.288T7 10t-.288.713T6 11m12 0q-.425 0-.712-.288T17 10t.288-.712T18 9t.713.288T19 10t-.288.713T18 11m-15-.5q-.2 0-.35-.15T2.5 10t.15-.35T3 9.5t.35.15t.15.35t-.15.35t-.35.15m18 0q-.2 0-.35-.15T20.5 10t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15M14 7q-.425 0-.712-.288T13 6t.288-.712T14 5t.713.288T15 6t-.288.713T14 7m-4.175-.025l-.8-.8q-.075-.5.225-.837T10 5q.425 0 .712.287T11 6q0 .45-.337.75t-.838.225M18 7q-.425 0-.712-.288T17 6t.288-.712T18 5t.713.288T19 6t-.288.713T18 7m-8-3.5q-.2 0-.35-.15T9.5 3t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m4 0q-.2 0-.35-.15T13.5 3t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15" /></svg>',onClick:()=>{this.toggleBackdrop(t)}}),this.createBlurBackground(t)}),t.on("change",()=>{this.backdropOn&&this.updateBlurBackground(t)}),t.on("close",()=>{this.removeBlurBackground(),this.backdropOn=!1})}createBlurBackground(t){const e=t.element;if(!this.backgroundElement){const t=document.createElement("div");t.style.position="fixed",t.style.top=0,t.style.left=0,t.style.width="100vw",t.style.height="100vh",t.style.backgroundSize="cover",t.style.backgroundPosition="center",t.style.filter="blur(44px)",t.style.zIndex=-1,t.style.transition="background-image 0.5s ease, opacity 0.5s ease",t.style.display="none",t.style.backgroundImage=xt,e.append(t),this.backgroundElement=t}if(!this.backgroundVideoElement){const t=document.createElement("video");t.style.position="fixed",t.style.top=0,t.style.left=0,t.style.width="100vw",t.style.height="100vh",t.style.objectFit="cover",t.style.filter="blur(44px)",t.style.zIndex=-1,t.style.display="none",t.style.transition="opacity 0.5s ease",t.muted=!0,t.loop=!0,t.autoplay=!1,t.muted=!0,t.volume=0,e.append(t),this.backgroundVideoElement=t}}toggleBackdrop(t){this.backdropOn?(this.backgroundElement.style.backgroundImage=xt,this.backgroundVideoElement.style.opacity=0,this.backgroundVideoElement.pause(),this.backdropOn=!1):(this.updateBlurBackground(t),this.backdropOn=!0);const e=this.querySelector("#pswp__icn-hide-backdrop"),i=this.querySelector("#pswp__icn-show-backdrop");e&&(e.style.display=this.backdropOn?"none":"inline"),i&&(i.style.display=this.backdropOn?"inline":"none")}updateBlurBackground(t){const e=t.currSlide;if(e?.data)if("video"===e.data.type){const t=this.backgroundVideoElement,i=e.content.element;"video"===i?.tagName?.toLowerCase()&&(this.referenceVideoElement=i,this.registerVideoEvents(i,t)),t.style.opacity=0,setTimeout(()=>{t.src=e.data.src,t.load(),this.initBackgroundVideo(),t.style.opacity=1},500),this.backgroundElement&&(this.backgroundElement.style.opacity=0)}else{if(this.backgroundElement){const t=((t,e=32,i=32)=>{if(!t||t.length<6||"undefined"==typeof document)return null;try{const n=R(t,e,i),s=document.createElement("canvas");s.width=e,s.height=i;const o=s.getContext("2d");if(!o)return null;const r=o.createImageData(e,i);return r.data.set(n),o.putImageData(r,0,0),s.toDataURL()}catch(n){return console.warn("[PhotoSwipeBackdrop] Failed to decode blurhash:",n),null}})(e.data.blurhash)||e.data.thumbnailUrl||e.data.src;this.backgroundElement.style.backgroundImage=t?`url("${t}")`:xt,this.backgroundElement.style.backgroundColor="transparent",this.backgroundElement.style.opacity=1}this.backgroundVideoElement&&(this.backgroundVideoElement.style.opacity=0,this.backgroundVideoElement.src="")}}initBackgroundVideo(){this.referenceVideoElement&&(this.backgroundVideoElement.currentTime=this.referenceVideoElement.currentTime,this.referenceVideoElement.currentTime>0&&!this.referenceVideoElement.paused&&!this.referenceVideoElement.ended&&this.referenceVideoElement.readyState>2&&this.backgroundVideoElement.play())}removeBlurBackground(){this.backgroundElement&&(this.backgroundElement.remove(),this.backgroundVideoElement.remove(),this.backgroundElement=null,this.backgroundVideoElement=null)}registerVideoEvents(t,e){this.foregroundVideoElement=t,t.addEventListener("play",()=>{e.currentTime=t.currentTime,e.play()}),t.addEventListener("pause",()=>{e.pause()}),t.addEventListener("ended",()=>{e.pause(),e.currentTime=0})}},_t=class{constructor(t,e={}){this.lightbox=t,this.options={filmstripButtonOrder:e.filmstripButtonOrder||7,height:e.height||112,thumbnailHeight:e.thumbnailHeight||64,thumbnailWidth:e.thumbnailWidth||96,itemMargin:e.itemMargin??4,buffer:e.buffer??5,backgroundColor:e.backgroundColor||"rgba(0, 0, 0, 0.6)",activeBorderColor:e.activeBorderColor||"#ff4800",...e},this.itemWidth=this.options.thumbnailWidth+this.options.itemMargin,this.filmstripVisible=!0,this.filmstripContainer=null,this.filmstripContent=null,this.filmstripTrack=null,this.isAnimating=!1,this.thumbnailPool=/* @__PURE__ */new Map,this.contents=[],this.scrollTickPending=!1,this.scrollHandler=this.scrollHandler.bind(this),this.handleThumbnailClick=this.handleThumbnailClick.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),t.on("init",()=>{this.initPswpEvents(t.pswp)})}getRootNode(){return this.lightbox?.pswp?.element?.getRootNode?.()||document}getElementById(t){const e=this.getRootNode();return"function"==typeof e.getElementById?e.getElementById(t):e.querySelector?.(`#${t}`)||document.getElementById(t)}querySelector(t){return this.getRootNode().querySelector?.(t)||document.querySelector(t)}initPswpEvents(t){this.pswp=t,t.on("uiRegister",()=>{this.registerToggleButton(),this.registerFilmstripContainer()}),t.on("afterInit",()=>{this.filmstripContainer=this.getElementById("pswp-filmstrip-container"),this.filmstripContainer&&this.injectStyles()}),t.on("openingAnimationEnd",()=>{this.filmstripVisible&&!this.isAnimating&&requestAnimationFrame(()=>this.showFilmstrip())}),t.on("change",()=>{this.filmstripVisible&&this.filmstripContent&&this.updateActiveSlide(t.currSlide?.index??0)}),t.on("bindEvents",()=>{document.addEventListener("keydown",this.handleKeyDown)}),t.on("close",()=>{document.removeEventListener("keydown",this.handleKeyDown),this.cleanupFilmstrip()})}injectStyles(){const t="pswp-filmstrip-styles",e=this.getRootNode(),i=e.head??e;if(i.querySelector?.(`#${t}`))return;const n=document.createElement("style");n.id=t,n.textContent=`\n #pswp-filmstrip-container {\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n z-index: 1000;\n transform: translateY(100%);\n transition: transform 0.3s ease-in-out;\n pointer-events: none;\n }\n\n #pswp-filmstrip-container.pswp-filmstrip--visible {\n transform: translateY(0);\n pointer-events: auto;\n }\n\n .pswp-filmstrip {\n position: relative;\n height: ${this.options.height}px;\n background-color: ${this.options.backgroundColor};\n overflow-x: auto;\n overflow-y: hidden;\n scrollbar-width: none;\n -ms-overflow-style: none;\n scroll-behavior: auto;\n user-select: none;\n -webkit-user-select: none;\n padding: 8px 16px;\n box-sizing: border-box;\n }\n\n .pswp-filmstrip::-webkit-scrollbar {\n display: none;\n }\n\n .pswp-filmstrip__track {\n position: relative;\n height: 100%;\n min-width: 100%;\n }\n\n .pswp-filmstrip__item {\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n display: inline-flex;\n flex-shrink: 0;\n padding: 0;\n border: none;\n background: none;\n cursor: pointer;\n outline: none;\n border-radius: 4px;\n overflow: hidden;\n transition: transform 0.15s ease;\n }\n\n .pswp-filmstrip__item:hover {\n transform: translateY(-50%) scale(1.05);\n }\n\n .pswp-filmstrip__item:active {\n transform: translateY(-50%) scale(0.95);\n }\n\n .pswp-filmstrip__thumb {\n width: ${this.options.thumbnailWidth}px;\n height: ${this.options.thumbnailHeight}px;\n border-radius: 4px;\n overflow: hidden;\n position: relative;\n border: 2px solid transparent;\n transition: border-color 0.2s ease;\n background-color: #333;\n }\n\n .pswp-filmstrip__thumb--active {\n border-color: ${this.options.activeBorderColor};\n }\n\n .pswp-filmstrip__img {\n position: absolute;\n inset: 0;\n width: 100%;\n height: 100%;\n object-fit: cover;\n object-position: center;\n z-index: 2;\n opacity: 0;\n transform: scale(0.95);\n transition: opacity 0.3s ease, transform 0.3s ease;\n }\n\n .pswp-filmstrip__img--loaded {\n opacity: 1;\n transform: scale(1);\n }\n\n .pswp-filmstrip__overlay {\n position: absolute;\n inset: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 3;\n pointer-events: none;\n }\n\n .pswp-filmstrip__overlay-icon {\n width: 24px;\n height: 24px;\n opacity: 0.8;\n }\n\n .pswp-filmstrip__ad-label {\n position: absolute;\n top: 4px;\n left: 4px;\n font-size: 10px;\n color: white;\n background-color: rgba(0, 0, 0, 0.6);\n padding: 2px 6px;\n border-radius: 3px;\n z-index: 3;\n }\n\n @media (min-width: 1024px) {\n .pswp-filmstrip__thumb {\n width: 80px;\n height: 80px;\n }\n\n .pswp-filmstrip__overlay-icon {\n width: 28px;\n height: 28px;\n }\n }\n `,i.appendChild(n)}registerToggleButton(){this.pswp.ui.registerElement({name:"filmstrip-toggle-button",title:"Toggle filmstrip",order:this.options.filmstripButtonOrder,isButton:!0,html:this.getToggleButtonHtml(),onClick:()=>this.toggleFilmstrip()})}registerFilmstripContainer(){this.pswp.ui.registerElement({name:"filmstrip",isButton:!1,appendTo:"root",html:'<div id="pswp-filmstrip-container"></div>'})}getToggleButtonHtml(){return'\n <svg aria-hidden="true" class="pswp__icn" viewBox="0 0 24 24" width="24" height="24" id="pswp-filmstrip-icon-show">\n <path d="M4 20q-.825 0-1.412-.587T2 18V6q0-.825.588-1.412T4 4v2.85L1.35 4.2q-.3-.3-.3-.712t.3-.713t.713-.3t.712.3l18.4 18.4q.3.3.3.7t-.3.7t-.712.3t-.713-.3L17.15 20zm0-2h11.15l-10-10H4zM22 6v11q0 .5-.312.75T21 18t-.687-.262t-.313-.763V8h-8.325q-.4 0-.763-.15t-.637-.425L8.55 5.7q-.225-.25-.275-.525t.075-.55t.35-.45T9.275 4H20q.825 0 1.413.588T22 6" />\n <path d="m 5.100795,16.58464 q -0.165328,0 -0.282961,-0.116899 Q 4.700201,16.350842 4.7,16.186347 V 13.398294 Q 4.7,13.233997 4.817834,13.117098 4.935667,13.000199 5.100795,13 h 2.805561 q 0.165328,0 0.283161,0.117098 0.117834,0.117099 0.117633,0.281196 v 2.788053 q 0,0.164296 -0.117633,0.281394 -0.117633,0.117099 -0.283161,0.116899 z" style="stroke-width:0.199771" />\n <path d="m 10.572143,16.65489 q -0.165327,0 -0.282961,-0.116899 -0.117632,-0.116899 -0.117833,-0.281394 v -2.788053 q 0,-0.164297 0.117833,-0.281196 0.117834,-0.116899 0.282961,-0.117098 h 2.805562 q 0.165328,0 0.283161,0.117098 0.117834,0.117099 0.117633,0.281196 v 2.788053 q 0,0.164296 -0.117633,0.281394 -0.117633,0.117099 -0.283161,0.116899 z" style="stroke-width:0.199771" />\n <path d="m 16.049385,16.724729 q -0.165327,0 -0.282961,-0.116899 -0.117632,-0.116899 -0.117833,-0.281394 v -2.788053 q 0,-0.164297 0.117833,-0.281196 0.117834,-0.116899 0.282961,-0.117098 h 2.805561 q 0.165328,0 0.283161,0.117098 0.117834,0.117099 0.117634,0.281196 v 2.788053 q 0,0.164296 -0.117634,0.281394 -0.117633,0.117099 -0.283161,0.116899 z" style="stroke-width:0.199771" />\n </svg>\n <svg aria-hidden="true" class="pswp__icn" viewBox="0 0 24 24" width="24" height="24" id="pswp-filmstrip-icon-hide" style="display:none">\n <path d="M4 20q-.825 0-1.412-.587T2 18V6q0-.825.588-1.412T4 4h16q.825 0 1.413.588T22 6v12q0 .825-.587 1.413T20 20zm0-2h16V8H4z" />\n <path d="m 5.100795,16.58464 q -0.165328,0 -0.282961,-0.116899 Q 4.700201,16.350842 4.7,16.186347 V 13.398294 Q 4.7,13.233997 4.817834,13.117098 4.935667,13.000199 5.100795,13 h 2.805561 q 0.165328,0 0.283161,0.117098 0.117834,0.117099 0.117633,0.281196 v 2.788053 q 0,0.164296 -0.117633,0.281394 -0.117633,0.117099 -0.283161,0.116899 z" style="stroke-width:0.199771" />\n <path d="m 10.572144,16.65489 q -0.165329,0 -0.282961,-0.116899 -0.117633,-0.116899 -0.117834,-0.281394 v -2.788053 q 0,-0.164297 0.117834,-0.281196 0.117832,-0.116899 0.282961,-0.117098 h 2.805561 q 0.165328,0 0.283161,0.117098 0.117834,0.117099 0.117633,0.281196 v 2.788053 q 0,0.164296 -0.117633,0.281394 -0.117633,0.117099 -0.283161,0.116899 z" style="stroke-width:0.199771" />\n <path d="m 16.049385,16.724729 q -0.165328,0 -0.282961,-0.116899 -0.117633,-0.116899 -0.117834,-0.281394 v -2.788053 q 0,-0.164297 0.117834,-0.281196 0.117833,-0.116899 0.282961,-0.117098 h 2.805561 q 0.165328,0 0.283161,0.117098 0.117834,0.117099 0.117634,0.281196 v 2.788053 q 0,0.164296 -0.117634,0.281394 -0.117633,0.117099 -0.283161,0.116899 z" style="stroke-width:0.199771" />\n </svg>\n '}setCaptionOffset(t){const e=this.getElementById("pswp-caption-container");e&&(e.style.bottom=t?"7rem":"0")}showFilmstrip(){if(!this.filmstripContainer||!this.pswp)return;const t=this.getContentsFromPswp().filter(t=>t&&t.thumbnailUrl);if(0===t.length)return;this.isAnimating=!0,this.contents=t;const e=this.pswp.currSlide?.index??0;this.createFilmstripContent(t,e),this.filmstripContainer.classList.add("pswp-filmstrip--visible"),this.filmstripVisible=!0;const i=this.querySelector(".pswp");i&&i.classList.add("pswp-filmstrip-active"),this.setCaptionOffset(!0),this.updateToggleIcon(),setTimeout(()=>{this.isAnimating=!1},300)}hideFilmstrip(){if(!this.filmstripContainer)return;this.isAnimating=!0,this.filmstripContainer.classList.remove("pswp-filmstrip--visible"),this.filmstripVisible=!1;const t=this.querySelector(".pswp");t&&t.classList.remove("pswp-filmstrip-active"),this.setCaptionOffset(!1),this.updateToggleIcon(),setTimeout(()=>{this.filmstripContainer&&(this.filmstripContainer.innerHTML=""),this.filmstripContent=null,this.filmstripTrack=null,this.thumbnailPool.clear(),this.contents=[],this.isAnimating=!1},300)}toggleFilmstrip(){this.isAnimating||(this.filmstripVisible?this.hideFilmstrip():this.showFilmstrip())}updateToggleIcon(){const t=this.getElementById("pswp-filmstrip-icon-show"),e=this.getElementById("pswp-filmstrip-icon-hide");t&&(t.style.display=this.filmstripVisible?"none":"block"),e&&(e.style.display=this.filmstripVisible?"block":"none")}createFilmstripContent(t,e){if(!this.filmstripContainer)return;const i=document.createElement("div");i.className="pswp-filmstrip",i.id="pswp-filmstrip-content";const n=document.createElement("div");n.className="pswp-filmstrip__track",n.style.width=t.length*this.itemWidth+"px",i.appendChild(n),this.filmstripContainer.innerHTML="",this.filmstripContainer.appendChild(i),this.filmstripContent=i,this.filmstripTrack=n,i.addEventListener("scroll",this.scrollHandler,{passive:!0}),this.renderVisibleThumbnails(e,!0)}scrollHandler(){!this.scrollTickPending&&this.filmstripContent&&(this.scrollTickPending=!0,requestAnimationFrame(()=>{this.scrollTickPending=!1,this.filmstripContent&&this.renderVisibleThumbnails(this.pswp?.currSlide?.index??0,!1)}))}renderVisibleThumbnails(t,e){if(!this.filmstripContent||!this.filmstripTrack)return;const i=this.filmstripContent,n=this.filmstripTrack,s=this.contents,o=s.length;if(0===o)return;const r=i.clientWidth,l=i.scrollLeft,a=this.options.buffer;let c=Math.floor(l/this.itemWidth)-a,d=Math.ceil((l+r)/this.itemWidth)+a;c=Math.max(0,c),d=Math.min(o-1,d);for(const[h,p]of this.thumbnailPool)(h<c||h>d)&&(p.parentNode&&p.parentNode.removeChild(p),this.thumbnailPool.delete(h));for(let h=c;h<=d;h++){const e=s[h];if(!e||!e.thumbnailUrl)continue;let i=this.thumbnailPool.get(h);const o=h===t;i?this.updateThumbnailState(i,h,o):(i=this.createThumbnailButton(e,h,o),i.style.left=h*this.itemWidth+"px",n.appendChild(i),this.thumbnailPool.set(h,i))}e&&requestAnimationFrame(()=>this.scrollToThumbnail(t))}createThumbnailButton(t,e,i){const n=document.createElement("button");n.className="pswp-filmstrip__item",n.setAttribute("data-index",e),n.setAttribute("type","button"),n.setAttribute("aria-label",`Go to slide ${e+1}`);const s=document.createElement("div");s.className="pswp-filmstrip__thumb "+(e===i?"pswp-filmstrip__thumb--active":""),s.setAttribute("data-thumb-index",e);const o=document.createElement("img");if(o.className="pswp-filmstrip__img",o.alt=t.caption||`Slide ${e+1}`,o.loading="lazy",o.decoding="async",o.onload=()=>o.classList.add("pswp-filmstrip__img--loaded"),o.src=t.thumbnailUrl,s.appendChild(o),"VIDEO"===t.type){const t=document.createElement("div");t.className="pswp-filmstrip__overlay",t.innerHTML='\n <svg class="pswp-filmstrip__overlay-icon" viewBox="0 0 24 24" fill="white">\n <path 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"/>\n </svg>\n ',s.appendChild(t)}return n.appendChild(s),n.addEventListener("click",this.handleThumbnailClick),n}updateThumbnailState(t,e,i){const n=t.querySelector(".pswp-filmstrip__thumb");n&&(i?(n.classList.add("pswp-filmstrip__thumb--active"),t.setAttribute("aria-current","true")):(n.classList.remove("pswp-filmstrip__thumb--active"),t.removeAttribute("aria-current")))}handleThumbnailClick(t){const e=t.currentTarget,i=parseInt(e.getAttribute("data-index"),10);this.pswp&&!isNaN(i)&&this.pswp.goTo(i)}updateActiveSlide(t){if(this.filmstripContent){for(const[e,i]of this.thumbnailPool)this.updateThumbnailState(i,e,e===t);this.scrollToThumbnail(t)}}scrollToThumbnail(t){if(!this.filmstripContent)return;const e=this.contents;if(t<0||t>=e.length)return;const i=this.filmstripContent,n=i.clientWidth/2,s=t*this.itemWidth+this.itemWidth/2;i.scrollTo({left:s-n,behavior:"smooth"})}handleKeyDown(t){this.filmstripVisible&&this.pswp&&("f"!==t.key&&"F"!==t.key||this.toggleFilmstrip())}getContentsFromPswp(){if(!this.pswp)return[];const t=this.pswp.options?.dataSource;if(t?.gallery)return this.getContentsFromDOM(t.gallery);const e="function"==typeof this.pswp.getNumItems?this.pswp.getNumItems():0;if(!e)return[];const i=[];for(let n=0;n<e;n++){let t=null;this.pswp.slides?.[n]?.data?t=this.pswp.slides[n].data:"function"==typeof this.pswp.getItemData&&(t=this.pswp.getItemData(n)),i.push(t||{})}return i.map((t,e)=>this.normalizeItem(t,e))}getContentsFromDOM(t){if(!t)return[];const e=t.querySelectorAll("a[href]");return Array.from(e).map((t,e)=>{const i=t.dataset,n=i.pswpThumbnailUrl||i.pswpMsrc||"",s=(i.pswpType||"").toString().toUpperCase(),o=i.pswpCaption||t.getAttribute("title")||"";return{id:i.pswpId||`item-${e}`,type:s,thumbnailUrl:n||i.pswpSrc||t.getAttribute("href")||"",caption:o}})}normalizeItem(t,e){try{const i=t||{},n=i.data||i,s=(n.type||n.pswpType||i.type||"").toString().toUpperCase(),o=n.thumbnailUrl||n.thumbnail||n.msrc||n.src||"";return{id:n.id||n._id||i.id||i._id||`item-${e}`,type:s,thumbnailUrl:o,caption:n.caption||n.alt||n.title||""}}catch{return{id:`item-${e}`,type:"",thumbnailUrl:"",caption:""}}}cleanupFilmstrip(){const t=this.querySelector(".pswp");t&&t.classList.remove("pswp-filmstrip-active"),this.setCaptionOffset(!1),this.filmstripContent&&(this.filmstripContent.removeEventListener("scroll",this.scrollHandler),this.filmstripContent.innerHTML=""),this.filmstripContainer&&(this.filmstripContainer.innerHTML="",this.filmstripContainer.classList.remove("pswp-filmstrip--visible")),this.filmstripContent=null,this.filmstripTrack=null,this.thumbnailPool.clear(),this.contents=[],this.filmstripVisible=!0,this.isAnimating=!1}},Et=class{constructor(t){this.lightbox=t,this.fullscreen=!1,this.options={fullScreenButtonOrder:7},t.on("init",()=>{this.initPswpEvents(t.pswp)})}getRootNode(){return this.lightbox?.pswp?.element?.getRootNode?.()||document}querySelector(t){return this.getRootNode().querySelector?.(t)||document.querySelector(t)}syncFullscreenState(){const t=document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement;this.fullscreen=Boolean(t);const e=this.querySelector("#pswp__icn-exit-fullscreen"),i=this.querySelector("#pswp__icn-fullscreen");e&&(e.style.display=this.fullscreen?"inline":"none"),i&&(i.style.display=this.fullscreen?"none":"inline")}initPswpEvents(t){const e=()=>this.syncFullscreenState();t.events.add(document,"fullscreenchange",e),t.events.add(document,"webkitfullscreenchange",e),t.on("uiRegister",()=>{(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)&&t.ui.registerElement({name:"fullscreen-button",title:"Toggle fullscreen view",order:this.options.fullScreenButtonOrder,isButton:!0,html:'<svg aria-hidden="true" class="pswp__icn p-1" viewBox="0 0 24 24"><use class="pswp__icn-shadow" xlink:href="#pswp__icn-fullscreen"/><use class="pswp__icn-shadow" xlink:href="#pswp__icn-exit-fullscreen"/><path id="pswp__icn-fullscreen" d="M5 19h2q.425 0 .713.288T8 20t-.288.713T7 21H4q-.425 0-.712-.288T3 20v-3q0-.425.288-.712T4 16t.713.288T5 17zm14 0v-2q0-.425.288-.712T20 16t.713.288T21 17v3q0 .425-.288.713T20 21h-3q-.425 0-.712-.288T16 20t.288-.712T17 19zM5 5v2q0 .425-.288.713T4 8t-.712-.288T3 7V4q0-.425.288-.712T4 3h3q.425 0 .713.288T8 4t-.288.713T7 5zm14 0h-2q-.425 0-.712-.288T16 4t.288-.712T17 3h3q.425 0 .713.288T21 4v3q0 .425-.288.713T20 8t-.712-.288T19 7z"/><path id="pswp__icn-exit-fullscreen" style="display:none" d="M6 18H4q-.425 0-.712-.288T3 17t.288-.712T4 16h3q.425 0 .713.288T8 17v3q0 .425-.288.713T7 21t-.712-.288T6 20zm12 0v2q0 .425-.288.713T17 21t-.712-.288T16 20v-3q0-.425.288-.712T17 16h3q.425 0 .713.288T21 17t-.288.713T20 18zM6 6V4q0-.425.288-.712T7 3t.713.288T8 4v3q0 .425-.288.713T7 8H4q-.425 0-.712-.288T3 7t.288-.712T4 6zm12 0h2q.425 0 .713.288T21 7t-.288.713T20 8h-3q-.425 0-.712-.288T16 7V4q0-.425.288-.712T17 3t.713.288T18 4z"/></svg>',onClick:()=>{this.toggleFullscreen(t)}})})}toggleFullscreen(t){const e=t.element;this.fullscreen?(document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen(),t.options.showHideAnimationType="zoom",this.fullscreen=!1):(e.requestFullscreen?e.requestFullscreen():e.webkitRequestFullscreen?e.webkitRequestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.msRequestFullscreen&&e.msRequestFullscreen(),t.options.showHideAnimationType="fade",this.fullscreen=!0);const i=this.querySelector("#pswp__icn-exit-fullscreen"),n=this.querySelector("#pswp__icn-fullscreen");i&&(i.style.display=this.fullscreen?"inline":"none"),n&&(n.style.display=this.fullscreen?"none":"inline")}},Ct=class{constructor(t,e={}){this.lightbox=t,this.autoHideTimer=null,this.uiVisible=!0,this.options=Object.assign({defaultDelayMs:4e3,playPauseButtonOrder:9,progressBarPosition:"top",progressBarTransition:"ease",restartOnSlideChange:!0,autoHideProgressBar:!0},e),this.setSlideshowLength(Number(localStorage.getItem("pswp_delay"))||this.options.defaultDelayMs),this.slideshowIsRunning=!1,this.slideshowTimerID=null,this.wakeLockIsRunning=!1,this.wakeLockSentinel=null,this.lightbox.on("init",()=>{this.init(this.lightbox.pswp)})}getRootNode(){return this.lightbox?.pswp?.element?.getRootNode?.()||document}querySelector(t){return this.getRootNode().querySelector?.(t)||document.querySelector(t)}injectProgressBarStyles(){const t=this.getRootNode(),e=t===document?document.head:t;if(!e||e.querySelector("style[data-pswp-slideshow]"))return;const i=document.createElement("style");i.setAttribute("data-pswp-slideshow",""),i.textContent=`.pswp__progress-bar{position:fixed;${this.options.progressBarPosition}:0;width:0;height:0}.pswp__progress-bar.running{width:100%;height:2px;transition-property:width;background:#ff4800}`,e.appendChild(i)}init(t){t.on("uiRegister",()=>{this.injectProgressBarStyles(),t.ui.registerElement({name:"playpause-button",title:"Toggle slideshow (Space)\nChange delay with +/- while running",order:this.options.playPauseButtonOrder,isButton:!0,html:'<svg aria-hidden="true" class="pswp__icn" viewBox="0 0 24 24"><use class="pswp__icn-shadow" xlink:href="#pswp__icn-play"/><use class="pswp__icn-shadow" xlink:href="#pswp__icn-stop"/><path id="pswp__icn-play" 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"/><path id="pswp__icn-stop" style="display:none" d="M16 19q-.825 0-1.412-.587T14 17V7q0-.825.588-1.412T16 5t1.413.588T18 7v10q0 .825-.587 1.413T16 19m-8 0q-.825 0-1.412-.587T6 17V7q0-.825.588-1.412T8 5t1.413.588T10 7v10q0 .825-.587 1.413T8 19"/></svg>',onClick:()=>{this.setSlideshowState()}}),t.ui.registerElement({name:"playtime",appendTo:"wrapper",tagName:"div",className:"pswp__progress-bar"}),t.events.add(document,"keydown",t=>{switch(t.code){case"Space":this.setSlideshowState(),t.preventDefault();break;case"ArrowUp":case"NumpadAdd":case"Equal":this.changeSlideshowLength(1e3),t.preventDefault();break;case"ArrowDown":case"NumpadSubtract":case"Minus":this.changeSlideshowLength(-1e3),t.preventDefault()}})}),this.lightbox.on("change",()=>{this.slideshowIsRunning&&this.options.restartOnSlideChange&&this.goToNextSlideAfterTimeout()}),this.lightbox.on("close",()=>{this.slideshowIsRunning&&this.setSlideshowState()})}showUI(){this.lightbox&&this.lightbox.pswp&&this.lightbox.pswp.element&&this.lightbox.pswp.element.classList.add("pswp--ui-visible"),this.uiVisible=!0}stopAutoHideTimer(){this.autoHideTimer&&(clearTimeout(this.autoHideTimer),this.autoHideTimer=null)}hideUI(){this.lightbox&&this.lightbox.pswp&&this.lightbox.pswp.element&&this.lightbox.pswp.element.classList.remove("pswp--ui-visible"),this.uiVisible=!1}resetAutoHideTimer(){this.autoHideTimer&&clearTimeout(this.autoHideTimer),this.autoHideTimer=setTimeout(()=>{this.slideshowIsRunning&&this.hideUI(),this.autoHideTimer=null},[3e3])}setSlideshowState(){this.slideshowIsRunning=!this.slideshowIsRunning,this.slideshowIsRunning?(this.goToNextSlideAfterTimeout(),this.showUI(),this.resetAutoHideTimer(),document.addEventListener("touchstart",()=>{this.stopAutoHideTimer(),this.showUI()}),document.addEventListener("touchend",()=>{this.resetAutoHideTimer()}),document.addEventListener("mousemove",()=>{this.uiVisible||this.showUI(),this.resetAutoHideTimer()})):(this.showUI(),this.resetSlideshow(),this.stopAutoHideTimer());const t=this.querySelector("#pswp__icn-stop"),e=this.querySelector("#pswp__icn-play");t&&(t.style.display=this.slideshowIsRunning?"inline":"none"),e&&(e.style.display=this.slideshowIsRunning?"none":"inline");const i=this.querySelector(".pswp__progress-bar");i&&(i.style.opacity=this.options.autoHideProgressBar?null:1),this.toggleWakeLock()}setSlideshowLength(t){this.options.defaultDelayMs=Math.min(Math.max(t,1e3),2147483647),this.options.defaultDelayMs!=t&&localStorage.setItem("pswp_delay",this.options.defaultDelayMs)}changeSlideshowLength(t){if(!this.slideshowIsRunning)return;this.setSlideshowLength(this.options.defaultDelayMs+t),localStorage.setItem("pswp_delay",this.options.defaultDelayMs);const e=this.querySelector(".pswp__counter");e&&(e.innerHTML=this.options.defaultDelayMs/1e3+"s"),this.goToNextSlideAfterTimeout()}isVideoContent(t){return"video"===t?.data?.type}getSlideTimeout(){const t=this.lightbox.pswp.currSlide.content;if(this.isVideoContent(t)){const e=t.element;if(e.paused)return this.options.defaultDelayMs;const i=e.duration,n=e.currentTime;return isNaN(i)||isNaN(n)?this.options.defaultDelayMs:1e3*(i-n)}return this.options.defaultDelayMs}slideContentHasLoaded(){const t=this.lightbox.pswp.currSlide.content;if(this.isVideoContent(t)){const e=t.element;return e.ended||e.readyState===HTMLMediaElement.HAVE_ENOUGH_DATA&&[HTMLMediaElement.NETWORK_IDLE,HTMLMediaElement.NETWORK_LOADING].includes(e.networkState)}return!t.isLoading()}goToNextSlideAfterTimeout(){if(this.resetSlideshow(),this.slideContentHasLoaded()){const t=this.getSlideTimeout();this.slideshowTimerID=setTimeout(()=>{this.lightbox.pswp.next(),this.options.restartOnSlideChange||this.goToNextSlideAfterTimeout()},t),setTimeout(()=>{this.slideshowIsRunning&&this.toggleProgressBar(t)},100)}else this.slideshowTimerID=setTimeout(()=>{this.goToNextSlideAfterTimeout()},200)}getSlideTransition(){return this.isVideoContent(this.lightbox.pswp.currSlide.content)?"linear":this.options.progressBarTransition}toggleProgressBar(t){const e=this.querySelector(".pswp__progress-bar");e&&(t?(e.style.transitionTimingFunction=this.getSlideTransition(),e.style.transitionDuration=`${t}ms`,e.classList.add("running")):e.classList.remove("running"))}toggleWakeLock(){this.wakeLockIsRunning!=this.slideshowIsRunning&&("keepAwake"in screen?screen.keepAwake=this.slideshowIsRunning:"wakeLock"in navigator&&(this.wakeLockSentinel?this.wakeLockSentinel.release().then(()=>(this.wakeLockSentinel=null,!0)).catch(t=>console.error(t)):navigator.wakeLock.request("screen").then(t=>(this.wakeLockSentinel=t,this.wakeLockSentinel.addEventListener("release",()=>{this.wakeLockSentinel=null,this.wakeLockIsRunning=!1}),!0)).catch(t=>{})),this.wakeLockIsRunning=this.slideshowIsRunning)}resetSlideshow(){this.toggleProgressBar(),this.slideshowTimerID&&(clearTimeout(this.slideshowTimerID),this.slideshowTimerID=null)}},St={[String(q.NONE)]:function({className:t}){/* @__PURE__ */
2
2
  return p("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:t,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */p("path",{fill:"currentColor",d:"M5 21q-.825 0-1.412-.587T3 19V5q0-.825.588-1.412T5 3h14q.825 0 1.413.588T21 5v14q0 .825-.587 1.413T19 21zm0-2h14V5H5z"})})},[q.LINK]:function({className:t}){/* @__PURE__ */
3
3
  return p("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:t,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */p("path",{fill:"currentColor",d:"M7.95 21q-2.05 0-3.5-1.45T3 16.05q0-1 .375-1.9t1.075-1.6l2.625-2.625q.3-.3.713-.3t.712.3t.3.7t-.3.7l-2.65 2.65q-.425.425-.637.963T5 16.05q0 1.225.863 2.088T7.95 19q.575 0 1.125-.213t.975-.637l2.625-2.65q.3-.275.7-.275t.7.3t.3.7t-.3.7L11.45 19.55q-.7.7-1.6 1.075T7.95 21m1.25-6.2q-.3-.3-.3-.712t.3-.713L13.375 9.2q.3-.3.713-.3t.712.3t.3.713t-.3.712L10.625 14.8q-.3.3-.712.3t-.713-.3m6.3-.725q-.3-.3-.3-.7t.3-.7l2.65-2.625q.425-.425.625-.95t.2-1.1q0-1.25-.85-2.125T16.025 5q-.575 0-1.112.213t-.963.637L11.325 8.5q-.3.3-.7.3t-.7-.3t-.3-.712t.3-.713L12.55 4.45q.7-.7 1.6-1.075T16.05 3q2.05 0 3.488 1.45t1.437 3.525q0 .975-.363 1.875t-1.062 1.6l-2.625 2.625q-.3.3-.712.3t-.713-.3"})})},[q.EMAIL]:function({className:t}){/* @__PURE__ */
4
4
  return p("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:t,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */p("path",{fill:"currentColor",d:"M12 22q-2.075 0-3.9-.788t-3.175-2.137T2.788 15.9T2 12t.788-3.9t2.137-3.175T8.1 2.788T12 2t3.9.788t3.175 2.137T21.213 8.1T22 12v1.45q0 1.475-1.012 2.513T18.5 17q-.875 0-1.65-.375t-1.3-1.075q-.725.725-1.638 1.088T12 17q-2.075 0-3.537-1.463T7 12t1.463-3.537T12 7t3.538 1.463T17 12v1.45q0 .65.425 1.1T18.5 15t1.075-.45t.425-1.1V12q0-3.35-2.325-5.675T12 4T6.325 6.325T4 12t2.325 5.675T12 20h4q.425 0 .713.288T17 21t-.288.713T16 22zm2.125-7.875Q15 13.25 15 12t-.875-2.125T12 9t-2.125.875T9 12t.875 2.125T12 15t2.125-.875"})})},[q.PHONE]:function({className:t}){/* @__PURE__ */
@@ -16,20 +16,20 @@ return p("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",view
16
16
  /* @__PURE__ */p("stop",{offset:"93.482%","stop-color":"#ff5280"}),
17
17
  /* @__PURE__ */p("stop",{offset:"100%","stop-color":"#ff7061"})]})}),
18
18
  /* @__PURE__ */p("path",{fill:"url(#SVGhphmYc3G)",d:"M128 0C55.894 0 0 52.818 0 124.16c0 37.317 15.293 69.562 40.2 91.835c2.09 1.871 3.352 4.493 3.438 7.298l.697 22.77c.223 7.262 7.724 11.988 14.37 9.054L84.111 243.9a10.22 10.22 0 0 1 6.837-.501c11.675 3.21 24.1 4.92 37.052 4.92c72.106 0 128-52.818 128-124.16S200.106 0 128 0"}),
19
- /* @__PURE__ */p("path",{fill:"#fff",d:"m51.137 160.47l37.6-59.653c5.98-9.49 18.788-11.853 27.762-5.123l29.905 22.43a7.68 7.68 0 0 0 9.252-.027l40.388-30.652c5.39-4.091 12.428 2.36 8.82 8.085l-37.6 59.654c-5.981 9.489-18.79 11.852-27.763 5.122l-29.906-22.43a7.68 7.68 0 0 0-9.25.027l-40.39 30.652c-5.39 4.09-12.427-2.36-8.818-8.085"})]})}},Nt=({open:t,ad:e,onClose:i,captureAdClick:n})=>{const s=Boolean(e?.targetType&&e.targetType!==q.NONE),o=St[e?.targetType]??St[q.LINK],r=e?.imageUrl&&z(e.imageUrl,["http:","https:"])?e.imageUrl:void 0;/* @__PURE__ */
19
+ /* @__PURE__ */p("path",{fill:"#fff",d:"m51.137 160.47l37.6-59.653c5.98-9.49 18.788-11.853 27.762-5.123l29.905 22.43a7.68 7.68 0 0 0 9.252-.027l40.388-30.652c5.39-4.091 12.428 2.36 8.82 8.085l-37.6 59.654c-5.981 9.489-18.79 11.852-27.763 5.122l-29.906-22.43a7.68 7.68 0 0 0-9.25.027l-40.39 30.652c-5.39 4.09-12.427-2.36-8.818-8.085"})]})}},Nt=({open:t,ad:e,onClose:i,captureAdClick:n})=>{const s=Boolean(e?.targetType&&e.targetType!==q.NONE),o=St[e?.targetType]??St[q.LINK],r=e?.imageUrl&&V(e.imageUrl,["http:","https:"])?e.imageUrl:void 0;/* @__PURE__ */
20
20
  return p(X,{open:Boolean(t&&e),onOpenChange:t=>!t&&i?.(),children:/* @__PURE__ */p(Y,{className:"border-none p-0",children:[/* @__PURE__ */p(Q,{className:"sr-only",children:[/* @__PURE__ */p(Z,{children:e?.title}),/* @__PURE__ */p(J,{children:e?.description})]}),/* @__PURE__ */p("div",{className:"flex max-w-2xl flex-col overflow-hidden",children:[r&&/* @__PURE__ */p("img",{className:"h-auto w-full object-contain sm:max-h-96",src:r,alt:e?.title||"Advertisement"}),
21
- /* @__PURE__ */p("div",{className:"flex flex-col gap-2 p-3",children:[/* @__PURE__ */p(A,{variant:"h4",align:"center",lines:2,children:e?.title}),/* @__PURE__ */p(A,{variant:"body3",color:"secondary",align:"center",lines:4,children:e?.description})]}),s&&/* @__PURE__ */p(B,{fullWidth:!0,className:"rounded-none",onClick:()=>{n?.(e?._id,e?.targetType??q.LINK,e?.targetUrl),i?.()},icon:/* @__PURE__ */p(o,{className:"size-5"}),children:e?.targetText})]})]})})},It=({style:t,content:e,curateLink:i,onAdClick:n,hideControls:s})=>{const{captureAdImpression:o,captureAdEngagement:r,captureAdClick:l}=$(),a=Boolean(i&&n),c=e.ctaBg||"#ff4800",d=e.ctaForeground||"#FFFFFF",h=St[e?.targetType??q.LINK];/* @__PURE__ */
21
+ /* @__PURE__ */p("div",{className:"flex flex-col gap-2 p-3",children:[/* @__PURE__ */p(A,{variant:"h4",align:"center",lines:2,children:e?.title}),/* @__PURE__ */p(A,{variant:"body3",color:"secondary",align:"center",lines:4,children:e?.description})]}),s&&/* @__PURE__ */p(H,{fullWidth:!0,className:"rounded-none",onClick:()=>{n?.(e?._id,e?.targetType??q.LINK,e?.targetUrl),i?.()},icon:/* @__PURE__ */p(o,{className:"size-5"}),children:e?.targetText})]})]})})},It=({style:t,content:e,curateLink:i,onAdClick:n,hideControls:s})=>{const{captureAdImpression:o,captureAdEngagement:r,captureAdClick:l}=$(),a=Boolean(i&&n),c=e.ctaBg||"#ff4800",d=e.ctaForeground||"#FFFFFF",h=St[e?.targetType??q.LINK];/* @__PURE__ */
22
22
  return p("div",{style:t,className:"group relative mb-1 overflow-hidden rounded",children:[
23
- /* @__PURE__ */p(R,{className:"size-full",threshold:.8,triggerOnce:!0,onChange:t=>{t&&o(e._id)},onClick:()=>r(e._id),children:/* @__PURE__ */p(O,{url:e.src||e.imageUrl,thumbnailUrl:e.src||e.imageUrl,blurhash:e.blurhash,alt:e.caption,onClick:a?n:void 0,pswpData:{id:e._id,type:_.AD,hash:e._id,width:e.width,height:e.height,title:e.title,description:e.description,targetType:e.targetType,targetText:e.targetText,targetUrl:e.targetUrl,thumbnailUrl:e.imageUrl,blurhash:e.blurhash}})}),
23
+ /* @__PURE__ */p(B,{className:"size-full",threshold:.8,triggerOnce:!0,onChange:t=>{t&&o(e._id)},onClick:()=>r(e._id),children:/* @__PURE__ */p(F,{url:e.src||e.imageUrl,thumbnailUrl:e.src||e.imageUrl,blurhash:e.blurhash,alt:e.caption,onClick:a?n:void 0,pswpData:{id:e._id,type:_.AD,hash:e._id,width:e.width,height:e.height,title:e.title,description:e.description,targetType:e.targetType,targetText:e.targetText,targetUrl:e.targetUrl,thumbnailUrl:e.imageUrl,blurhash:e.blurhash}})}),
24
24
  /* @__PURE__ */p("span",{className:"bg-background/70 absolute top-1 right-1 rounded px-1 text-xs font-medium",children:"Ad"}),!s&&(e.title||e.targetType!==q.NONE)&&/* @__PURE__ */p("div",{className:"absolute bottom-0 flex w-full flex-col lg:opacity-0 lg:transition-opacity lg:group-hover:opacity-100",children:[e.title&&/* @__PURE__ */p("div",{className:"bg-background/60 px-3 py-1",children:/* @__PURE__ */p("h3",{className:"line-clamp-1 text-sm font-medium",children:e.title})}),e?.targetType!==q.NONE&&/* @__PURE__ */p("button",{className:"flex w-full items-center justify-center gap-1 rounded-none border-0 py-2 text-nowrap sm:gap-2",style:{backgroundColor:c,color:d},onClick:()=>{a?n?.():l(e._id,e.targetType,e.targetUrl)},children:[/* @__PURE__ */p("span",{style:{color:d},children:/* @__PURE__ */p(h,{})}),e?.targetText]})]})]})},Lt=({style:t,gamConfig:e,slotIndex:i,eventId:s,organizationId:r})=>{const l=o(null),a=o(null),{trackGamAnalytics:c}=$(),d=`gam-slot-${s??"ev"}-${i}`,h=Math.max(1,Math.round(t?.width||e.sizes[0]?.[0]||300)),u=Math.max(1,Math.round(t?.height||e.sizes[0]?.[1]||250)),m=o({w:h,h:u});return n(()=>{let t=!1,i=null,n=null,o=null,h=null;return(async()=>{await D(),!t&&l.current&&window.googletag.cmd.push(()=>{if(t)return;W(d);const{w:p,h:u}=m.current,g=[[p,u],...e.sizes],w=window.googletag.defineSlot(e.adUnitPath,g,d)?.addService(window.googletag.pubads());if(!w)return;a.current=w,n=window.googletag.pubads(),s?w.setConfig({targeting:{qrati_event:s,...e.categories.length>0?{qrati_category:e.categories}:{}}}):e.categories.length>0&&w.setConfig({targeting:{qrati_category:e.categories}}),o=t=>{t.slot===w&&c({eventId:s,organizationId:r,type:f.GAM_IMPRESSION,creativeId:String(t.creativeId??""),lineItemId:String(t.lineItemId??""),advertiserId:String(t.advertiserId??""),isEmpty:t.isEmpty??!1})},n.addEventListener("slotRenderEnded",o),h=t=>{t.slot===w&&c({eventId:s,organizationId:r,type:f.GAM_VIEWABLE})},n.addEventListener("impressionViewable",h);const b=l.current;b&&(i=K({container:b,onClick:()=>{c({eventId:s,organizationId:r,type:f.GAM_CLICK})}}),U(),window.googletag.display(d))})})(),()=>{t=!0,i?.(),n&&"function"==typeof n.removeEventListener&&(o&&n.removeEventListener("slotRenderEnded",o),h&&n.removeEventListener("impressionViewable",h));const e=a.current;a.current=null,e&&window.googletag?.cmd?.push(()=>{window.googletag.destroySlots([e])})}},[s,e.adUnitPath,e.categories,r,d]),/* @__PURE__ */p("div",{style:{width:h,height:u},className:"relative overflow-hidden rounded bg-neutral-100 dark:bg-neutral-800","data-gam-slot-index":i,children:/* @__PURE__ */p("div",{id:d,ref:l,style:{width:h,height:u},className:"gam-ad-slot"})})},Mt=(t,e)=>{if(!t||!e)return null;const i=e[t];if(!i)return null;try{const t=new Date(String(i)),e=/* @__PURE__ */new Date,n=t.getFullYear()===e.getFullYear(),s={weekday:"long",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0};return n||(s.year="numeric"),t.toLocaleString("en-US",s).replace(","," •")}catch{return null}},At=e(null),Bt=()=>{const t=g(At);if(!t)throw new Error("Popover components must be used within a Popover");return t},Rt=({children:t,className:e,open:i,onOpenChange:n})=>{const[s,a]=l(!1),c="boolean"==typeof i,d=c?i:s,h=r(),u=`popover-trigger-${h}`,m=`popover-content-${h}`,g=o(null);/* @__PURE__ */
25
25
  return p(At.Provider,{value:{isOpen:d,setIsOpen:t=>{c||a(t),n?.(t)},triggerId:u,contentId:m,triggerRef:g},children:/* @__PURE__ */p("div",{"data-slot":"popover",className:x("relative inline-block",e),children:t})})},Vt=({children:t,asChild:e,className:n,onClick:s,...o})=>{const{isOpen:r,setIsOpen:l,triggerId:a,contentId:c,triggerRef:d}=Bt();if(e){const e=Array.isArray(t)?t[0]:t;if(e&&e.type){const t=e.props?.className;return i(e,{ref:t=>{d.current=t},id:a,className:n?t?`${t} ${n}`:n:t,"aria-haspopup":"dialog","aria-expanded":r,"aria-controls":r?c:void 0,onClick:t=>{l(!r),e.props?.onClick?.(t)},"data-state":r?"open":"closed"})}}/* @__PURE__ */
26
- return p("button",{ref:d,id:a,type:"button","aria-haspopup":"dialog","aria-expanded":r,"aria-controls":r?c:void 0,"data-slot":"popover-trigger","data-state":r?"open":"closed",className:n,onClick:t=>{l(!r),s?.(t)},...o,children:t})},zt=({children:t,className:e,align:i="center",side:s="top",sideOffset:r=4,...a})=>{const{isOpen:h,setIsOpen:u,contentId:m,triggerRef:g}=Bt(),{organization:f,portalContainer:w}=E(),b=o(null),[T,y]=l(null);if(c(()=>{if(!h)return;const t=()=>{if(!g.current||!b.current)return;const t=g.current.getBoundingClientRect(),e=b.current.getBoundingClientRect();let n=t.left,o=t.bottom+r;"center"===i&&(n=t.left+t.width/2-e.width/2),"end"===i&&(n=t.right-e.width),"top"===s&&(o=t.top-e.height-r),"left"===s&&(n=t.left-e.width-r,o=t.top+t.height/2-e.height/2),"right"===s&&(n=t.right+r,o=t.top+t.height/2-e.height/2),"bottom"===s&&(o=t.bottom+r),y({top:o,left:n})},e=requestAnimationFrame(t);return window.addEventListener("resize",t),window.addEventListener("scroll",t,!0),()=>{cancelAnimationFrame(e),window.removeEventListener("resize",t),window.removeEventListener("scroll",t,!0)}},[i,h,s,r,g]),n(()=>{if(!h)return;const t=t=>{const e="function"==typeof t.composedPath?t.composedPath():[],i=t.target,n=b.current&&(b.current.contains(i)||e.includes(b.current)),s=g.current&&(g.current.contains(i)||e.includes(g.current));n||s||u(!1)},e=t=>{"Escape"===t.key&&(u(!1),g.current?.focus())},i=window.setTimeout(()=>{document.addEventListener("mousedown",t)},0);return document.addEventListener("keydown",e),()=>{window.clearTimeout(i),document.removeEventListener("mousedown",t),document.removeEventListener("keydown",e)}},[h,u,g]),!h)return null;const v=/* @__PURE__ */p("div",{ref:b,id:m,role:"dialog","aria-modal":"false","data-state":h?"open":"closed",className:x("bg-background text-foreground border-border shadow-outer rounded outline-none",e),style:{position:"fixed",top:T?.top??0,left:T?.left??0,zIndex:2010,...k(f)},...a,children:t});return"undefined"!=typeof document?d(v,w??document.body):v},Ft=({eventId:t,contentId:e,emojis:i=[],counts:s={},userReaction:r})=>{const{user:a,props:c,organization:d}=E(),h=c?.loginUrl,{handleReactionClick:u,isPending:m}=(()=>{const t=b(),{props:e,user:i}=E(),n=e?.organizationId,s=I({mutationFn:async({eventId:t,contentId:e,emoji:s})=>{await T.post(C.UPDATE_REACTION,{json:{eventId:t,contentId:e,reaction:s},headers:{"x-org-id":n,Authorization:`Bearer ${i?.token}`}})},onMutate:async({eventId:e,contentId:i,emoji:n})=>{const s=[y.CONTENTS_BY_EVENT(e)];await t.cancelQueries({queryKey:s});const o=t.getQueriesData({queryKey:s});return t.setQueriesData({queryKey:s},t=>((t,e,i)=>t?.pages&&Array.isArray(t.pages)?{...t,pages:t.pages.map(t=>t.data?{...t,data:t.data.map(t=>{if(t._id!==e)return t;const n={...t.reactionCounts??{}};return t.userReaction&&t.userReaction!==i&&(n[t.userReaction]=Math.max(0,(n[t.userReaction]??1)-1)),t.userReaction===i?(n[i]=Math.max(0,(n[i]??1)-1),{...t,reactionCounts:n,userReaction:void 0}):(n[i]=(n[i]??0)+1,{...t,reactionCounts:n,userReaction:i})})}:t)}:t)(t,i,n)),{previousData:o}},onError:(e,i,n)=>{n?.previousData?.forEach(([e,i])=>{t.setQueryData(e,i)}),H.error("Failed to add reaction"),console.error("Error handling reaction click:",e,i)}});return{handleReactionClick:async(t,e,n)=>{if(!t||!e||!n)return!1;if(!i)return H.error("Please login to react"),!1;try{return await s.mutateAsync({eventId:t,contentId:e,emoji:n}),!0}catch(o){return!1}},isPending:s.isPending}})(),[g,f]=l(!1),[v,k]=l(null),q=o(null),_=Object.values(s).reduce((t,e)=>t+e,0);return n(()=>()=>{q.current&&clearTimeout(q.current)},[]),/* @__PURE__ */p(Rt,{open:g,onOpenChange:f,children:[/* @__PURE__ */p(Vt,{asChild:!0,children:/* @__PURE__ */p("button",{type:"button",className:x("bg-background/50 flex items-center gap-1 rounded px-2 py-1 backdrop-blur-sm transition-transform duration-150 ease-out will-change-transform active:scale-95 sm:gap-2 sm:py-0",v&&"scale-[1.03] shadow-sm"),children:[(i||[]).slice().sort((t,e)=>(s[e]||0)-(s[t]||0)).slice(0,1).map(t=>/* @__PURE__ */p("span",{className:x("text-sm transition-transform duration-150 ease-out sm:text-lg",v===(r||t)&&"scale-125"),children:r||t},`${e}-${t}-1`)),_>0&&/* @__PURE__ */p("span",{className:"text-xs font-bold sm:text-sm",children:_||0})]})}),/* @__PURE__ */p(zt,{side:"top",align:"end",children:[a?null:/* @__PURE__ */p("div",d?.customAuth?{className:"p-2 font-semibold",children:["Please"," ",
26
+ return p("button",{ref:d,id:a,type:"button","aria-haspopup":"dialog","aria-expanded":r,"aria-controls":r?c:void 0,"data-slot":"popover-trigger","data-state":r?"open":"closed",className:n,onClick:t=>{l(!r),s?.(t)},...o,children:t})},zt=({children:t,className:e,align:i="center",side:s="top",sideOffset:r=4,...a})=>{const{isOpen:h,setIsOpen:u,contentId:m,triggerRef:g}=Bt(),{organization:f,portalContainer:w}=E(),b=o(null),[T,y]=l(null);if(c(()=>{if(!h)return;const t=()=>{if(!g.current||!b.current)return;const t=g.current.getBoundingClientRect(),e=b.current.getBoundingClientRect();let n=t.left,o=t.bottom+r;"center"===i&&(n=t.left+t.width/2-e.width/2),"end"===i&&(n=t.right-e.width),"top"===s&&(o=t.top-e.height-r),"left"===s&&(n=t.left-e.width-r,o=t.top+t.height/2-e.height/2),"right"===s&&(n=t.right+r,o=t.top+t.height/2-e.height/2),"bottom"===s&&(o=t.bottom+r),y({top:o,left:n})},e=requestAnimationFrame(t);return window.addEventListener("resize",t),window.addEventListener("scroll",t,!0),()=>{cancelAnimationFrame(e),window.removeEventListener("resize",t),window.removeEventListener("scroll",t,!0)}},[i,h,s,r,g]),n(()=>{if(!h)return;const t=t=>{const e="function"==typeof t.composedPath?t.composedPath():[],i=t.target,n=b.current&&(b.current.contains(i)||e.includes(b.current)),s=g.current&&(g.current.contains(i)||e.includes(g.current));n||s||u(!1)},e=t=>{"Escape"===t.key&&(u(!1),g.current?.focus())},i=window.setTimeout(()=>{document.addEventListener("mousedown",t)},0);return document.addEventListener("keydown",e),()=>{window.clearTimeout(i),document.removeEventListener("mousedown",t),document.removeEventListener("keydown",e)}},[h,u,g]),!h)return null;const v=/* @__PURE__ */p("div",{ref:b,id:m,role:"dialog","aria-modal":"false","data-state":h?"open":"closed",className:x("bg-background text-foreground border-border shadow-outer rounded outline-none",e),style:{position:"fixed",top:T?.top??0,left:T?.left??0,zIndex:2010,...k(f)},...a,children:t});return"undefined"!=typeof document?d(v,w??document.body):v},Ft=({eventId:t,contentId:e,emojis:i=[],counts:s={},userReaction:r})=>{const{user:a,props:c,organization:d}=E(),h=c?.loginUrl,{handleReactionClick:u,isPending:m}=(()=>{const t=b(),{props:e,user:i}=E(),n=e?.organizationId,s=I({mutationFn:async({eventId:t,contentId:e,emoji:s})=>{await T.post(C.UPDATE_REACTION,{json:{eventId:t,contentId:e,reaction:s},headers:{"x-org-id":n,Authorization:`Bearer ${i?.token}`}})},onMutate:async({eventId:e,contentId:i,emoji:n})=>{const s=[y.CONTENTS_BY_EVENT(e)];await t.cancelQueries({queryKey:s});const o=t.getQueriesData({queryKey:s});return t.setQueriesData({queryKey:s},t=>((t,e,i)=>t?.pages&&Array.isArray(t.pages)?{...t,pages:t.pages.map(t=>t.data?{...t,data:t.data.map(t=>{if(t._id!==e)return t;const n={...t.reactionCounts??{}};return t.userReaction&&t.userReaction!==i&&(n[t.userReaction]=Math.max(0,(n[t.userReaction]??1)-1)),t.userReaction===i?(n[i]=Math.max(0,(n[i]??1)-1),{...t,reactionCounts:n,userReaction:void 0}):(n[i]=(n[i]??0)+1,{...t,reactionCounts:n,userReaction:i})})}:t)}:t)(t,i,n)),{previousData:o}},onError:(e,i,n)=>{n?.previousData?.forEach(([e,i])=>{t.setQueryData(e,i)}),P.error("Failed to add reaction"),console.error("Error handling reaction click:",e,i)}});return{handleReactionClick:async(t,e,n)=>{if(!t||!e||!n)return!1;if(!i)return P.error("Please login to react"),!1;try{return await s.mutateAsync({eventId:t,contentId:e,emoji:n}),!0}catch(o){return!1}},isPending:s.isPending}})(),[g,f]=l(!1),[v,k]=l(null),q=o(null),_=Object.values(s).reduce((t,e)=>t+e,0);return n(()=>()=>{q.current&&clearTimeout(q.current)},[]),/* @__PURE__ */p(Rt,{open:g,onOpenChange:f,children:[/* @__PURE__ */p(Vt,{asChild:!0,children:/* @__PURE__ */p("button",{type:"button",className:x("bg-background/50 flex items-center gap-1 rounded px-2 py-1 backdrop-blur-sm transition-transform duration-150 ease-out will-change-transform active:scale-95 sm:gap-2 sm:py-0",v&&"scale-[1.03] shadow-sm"),children:[(i||[]).slice().sort((t,e)=>(s[e]||0)-(s[t]||0)).slice(0,1).map(t=>/* @__PURE__ */p("span",{className:x("text-sm transition-transform duration-150 ease-out sm:text-lg",v===(r||t)&&"scale-125"),children:r||t},`${e}-${t}-1`)),_>0&&/* @__PURE__ */p("span",{className:"text-xs font-bold sm:text-sm",children:_||0})]})}),/* @__PURE__ */p(zt,{side:"top",align:"end",children:[a?null:/* @__PURE__ */p("div",d?.customAuth?{className:"p-2 font-semibold",children:["Please"," ",
27
27
  /* @__PURE__ */p("a",{className:"text-info underline",href:h,children:"Login"})," ","to react"]}:{className:"p-2 font-semibold",children:["Please"," ",
28
28
  /* @__PURE__ */p(M,{className:"text-info underline",to:w.LOGIN,children:"Login"})," ","to react"]}),a&&/* @__PURE__ */p("div",{className:"flex gap-1 p-2",children:i.map(i=>{const n=r===i;/* @__PURE__ */
29
29
  return p("div",{className:"flex flex-col items-center",children:[/* @__PURE__ */p("span",{className:"text-xs font-medium",children:s[i]||0}),/* @__PURE__ */p("button",{type:"button",disabled:m,className:x("text-3xl transition-transform duration-150 ease-out disabled:opacity-50",n?"scale-125":"hover:scale-110",v===i&&"scale-125",m&&"cursor-not-allowed"),onClick:()=>(async i=>{!m&&u&&(k(i),f(!1),q.current&&clearTimeout(q.current),q.current=setTimeout(()=>k(null),180),u(t,e,i))})(i),children:i})]},`${e}-${i}-2`)})})]})]})},Ot=({event:t={},content:e,curateLink:i})=>t.engagementStyle===S.CONTEST?/* @__PURE__ */p("button",{className:"bg-background/75 flex items-center gap-1 rounded px-2 py-1",children:[/* @__PURE__ */p(G,{className:"size-4"}),/* @__PURE__ */p("span",{className:"text-xs font-semibold",children:parseFloat(String(e.score||0)).toFixed(1)})]}):t.engagementStyle===S.REACTION&&t.reactionEmojis?.length?/* @__PURE__ */p(Ft,{eventId:t?._id,contentId:e._id,emojis:t?.reactionEmojis,engagementStyle:t?.engagementStyle,counts:e.reactionCounts||{},userReaction:e.userReaction}):null,Pt=({content:t})=>/* @__PURE__ */p("div",{className:"w-full space-y-3 px-3 pb-3",children:[t?.caption&&/* @__PURE__ */p("span",{"data-tooltip-target":"tooltip-default",className:"hidden w-full text-xs drop-shadow-[0_1.2px_1.2px_rgba(0,0,0,0.8)] sm:block",children:/* @__PURE__ */p("div",{role:"note",title:t?.caption,className:"lg:text-md line-clamp-1 text-xs text-white lg:font-medium",children:t?.caption})}),/* @__PURE__ */p("div",{className:"flex items-center justify-between",children:/* @__PURE__ */p("span",{className:"lg:text-md line-clamp-1 text-sm font-medium text-white drop-shadow-[0_1.2px_1.2px_rgba(0,0,0,0.8)]",children:t?.user?.name})})]}),Ht=({event:t,content:e,style:i,timestampField:n,curateLink:s,onChangeFaceUrl:o,hideControls:r,showQuickSearch:l})=>{const a=`content-${e._id}`,c=h(()=>Mt(n,e),[n,e]),d=u(()=>{o?.(e?.url);const t=document.getElementById("media-gallery-container");t&&t.scrollIntoView({behavior:"smooth",block:"start"})},[o,e?.url]),g=h(()=>({id:e._id,type:_.IMAGE,hash:e._id,width:e.width,height:e.height,thumbnailUrl:e.thumbnailUrl,blurhash:e.blurhash,caption:e.caption}),[e._id,e.width,e.height,e.thumbnailUrl,e.blurhash,e.caption]);/* @__PURE__ */
30
- return p("div",{id:a,style:i,className:"group relative mb-1 overflow-hidden rounded [content-visibility:auto]",children:[/* @__PURE__ */p(O,{url:e.src,alt:e.caption,blurhash:e.blurhash,thumbnailUrl:e.thumbnailUrl,curateLink:s,pswpData:g}),!r&&/* @__PURE__ */p(m,{children:[c&&/* @__PURE__ */p("div",{className:"absolute top-2 left-2 max-w-[calc(100%-80px)] truncate rounded bg-black/50 px-2 py-0.5 text-xs text-white backdrop-blur-sm",children:c}),l&&(e.faces?.length??0)>0&&/* @__PURE__ */p("button",{className:"bg-primary absolute top-2 right-2 rounded-full p-1 text-gray-200 opacity-50 transition-all sm:p-1.5 sm:hover:scale-110 sm:hover:opacity-100",onClick:d,children:/* @__PURE__ */p(j,{className:"text-primary-foreground"})}),
30
+ return p("div",{id:a,style:i,className:"group relative mb-1 overflow-hidden rounded [content-visibility:auto]",children:[/* @__PURE__ */p(F,{url:e.src,alt:e.caption,blurhash:e.blurhash,thumbnailUrl:e.thumbnailUrl,curateLink:s,pswpData:g}),!r&&/* @__PURE__ */p(m,{children:[c&&/* @__PURE__ */p("div",{className:"absolute top-2 left-2 max-w-[calc(100%-80px)] truncate rounded bg-black/50 px-2 py-0.5 text-xs text-white backdrop-blur-sm",children:c}),l&&(e.faces?.length??0)>0&&/* @__PURE__ */p("button",{className:"bg-primary absolute top-2 right-2 rounded-full p-1 text-gray-200 opacity-50 transition-all sm:p-1.5 sm:hover:scale-110 sm:hover:opacity-100",onClick:d,children:/* @__PURE__ */p(j,{className:"text-primary-foreground"})}),
31
31
  /* @__PURE__ */p("div",{className:"",children:[/* @__PURE__ */p("div",{className:"absolute bottom-0 w-full rounded-b",children:/* @__PURE__ */p(Pt,{content:e})}),/* @__PURE__ */p("div",{className:"absolute right-2 bottom-2",children:/* @__PURE__ */p(Ot,{event:t,content:e,curateLink:s})})]})]})]})},Dt=({content:t,style:e,event:i,timestampField:n,curateLink:s,hideControls:o})=>{const r=h(()=>Mt(n,t),[n,t]);/* @__PURE__ */
32
- return p("div",{id:`content-${t._id}`,className:"group relative mb-1 overflow-hidden rounded [content-visibility:auto]",style:e,children:[/* @__PURE__ */p(O,{url:t.src??t.url,thumbnailUrl:t.thumbnailUrl,blurhash:t.blurhash,alt:t.caption,curateLink:s,pswpData:{id:t._id,type:_.VIDEO,hash:t._id,width:t.width,height:t.height,thumbnailUrl:t.thumbnailUrl,blurhash:t.blurhash,caption:t.caption}}),!o&&/* @__PURE__ */p("div",{className:"transition-opacity duration-500",children:[r&&/* @__PURE__ */p("div",{className:"absolute top-2 left-2 max-w-[calc(100%-80px)] truncate rounded bg-black/50 px-2 py-0.5 text-xs text-white backdrop-blur-sm",children:r}),
32
+ return p("div",{id:`content-${t._id}`,className:"group relative mb-1 overflow-hidden rounded [content-visibility:auto]",style:e,children:[/* @__PURE__ */p(F,{url:t.src??t.url,thumbnailUrl:t.thumbnailUrl,blurhash:t.blurhash,alt:t.caption,curateLink:s,pswpData:{id:t._id,type:_.VIDEO,hash:t._id,width:t.width,height:t.height,thumbnailUrl:t.thumbnailUrl,blurhash:t.blurhash,caption:t.caption}}),!o&&/* @__PURE__ */p("div",{className:"transition-opacity duration-500",children:[r&&/* @__PURE__ */p("div",{className:"absolute top-2 left-2 max-w-[calc(100%-80px)] truncate rounded bg-black/50 px-2 py-0.5 text-xs text-white backdrop-blur-sm",children:r}),
33
33
  /* @__PURE__ */p("div",{className:"absolute bottom-0 w-full rounded-b",children:/* @__PURE__ */p(Pt,{content:t})}),
34
- /* @__PURE__ */p("div",{className:"absolute right-2 bottom-2",children:/* @__PURE__ */p(Ot,{event:i,content:t,curateLink:s})})]})]})},Ut=({event:t,contents:e=[],gamConfig:i,singleColumnMode:s,kioskMode:r,timestampField:a,curateLink:c,onChangeFaceUrl:d,showQuickSearch:u})=>{const g=o(null),f=o(null),w=h(()=>`gallery-${t?._id??""}`,[t?._id]),{captureAdImpression:b,captureAdClick:T}=$(),{portalContainer:y,organization:k}=E(),q=k?._id,[C,S]=l(null);n(()=>{const t=f.current;if(!c&&t){const e=new F({gallery:t,children:"a",counter:!1,bgOpacity:1,wheelToZoom:!0,pinchToClose:!0,zoom:!1,pswpModule:P,appendToEl:y??document.body});g.current=e,new L(e),new _t(e),new qt(e),new N(e,b,T),new Et(e),new Ct(e),e.init()}return()=>{g.current?.destroy?.(),g.current=null}},[t?.galleryLayout,c,T,b,w,y]);const I=h(()=>{switch(t?.galleryLayout){case v.ROW:return ft;case v.COLUMN:return yt;case v.MASONRY:return kt;default:return ft}},[t?.galleryLayout]),M=h(()=>e.map(t=>{const e=t.type===_.IMAGE||t.type===_.VIDEO?t.url:t.type===_.GAM_AD?"":t.imageUrl;return{...t,src:e??"",width:t.dimension?.width||t.width||4,height:t.dimension?.height||t.height||3}}),[e]),A=h(()=>({container:({ref:t,className:e,children:i})=>/* @__PURE__ */p("div",{ref:t,className:e??"",children:i}),photo:(e,{photo:n,width:s,height:o,index:l})=>{const h=n;let m=null;switch(h.type){case _.IMAGE:m=Ht;break;case _.VIDEO:m=Dt;break;case _.AD:m=It;break;case _.GAM_AD:return i?/* @__PURE__ */p(Lt,{style:{width:s,height:o},gamConfig:i,slotIndex:h.slotIndex??l,eventId:t?._id,organizationId:q},`${h._id??l}-${l}`):null;default:m=null}return m?/* @__PURE__ */p(m,{style:{width:s,height:o},event:t,content:h,timestampField:a,onAdClick:c?()=>S(h):void 0,hideControls:r,curateLink:c?`${c}/${h._id}`:null,onChangeFaceUrl:d,showQuickSearch:u},`${h._id??l}-${l}`):null}}),[t,i,q,a,c,r,d,u]);/* @__PURE__ */
34
+ /* @__PURE__ */p("div",{className:"absolute right-2 bottom-2",children:/* @__PURE__ */p(Ot,{event:i,content:t,curateLink:s})})]})]})},Ut=({event:t,contents:e=[],gamConfig:i,singleColumnMode:s,kioskMode:r,timestampField:a,curateLink:c,onChangeFaceUrl:d,showQuickSearch:u})=>{const g=o(null),f=o(null),w=h(()=>`gallery-${t?._id??""}`,[t?._id]),{captureAdImpression:b,captureAdClick:T}=$(),{portalContainer:y,organization:k}=E(),q=k?._id,[C,S]=l(null);n(()=>{const t=f.current;if(!c&&t){const e=new z({gallery:t,children:"a",counter:!1,bgOpacity:1,wheelToZoom:!0,pinchToClose:!0,zoom:!1,pswpModule:O,appendToEl:y??document.body});g.current=e,new L(e),new _t(e),new qt(e),new N(e,b,T),new Et(e),new Ct(e),e.init()}return()=>{g.current?.destroy?.(),g.current=null}},[t?.galleryLayout,c,T,b,w,y]);const I=h(()=>{switch(t?.galleryLayout){case v.ROW:return ft;case v.COLUMN:return yt;case v.MASONRY:return kt;default:return ft}},[t?.galleryLayout]),M=h(()=>e.map(t=>{const e=t.type===_.IMAGE||t.type===_.VIDEO?t.url:t.type===_.GAM_AD?"":t.imageUrl;return{...t,src:e??"",width:t.dimension?.width||t.width||4,height:t.dimension?.height||t.height||3}}),[e]),A=h(()=>({container:({ref:t,className:e,children:i})=>/* @__PURE__ */p("div",{ref:t,className:e??"",children:i}),photo:(e,{photo:n,width:s,height:o,index:l})=>{const h=n;let m=null;switch(h.type){case _.IMAGE:m=Ht;break;case _.VIDEO:m=Dt;break;case _.AD:m=It;break;case _.GAM_AD:return i?/* @__PURE__ */p(Lt,{style:{width:s,height:o},gamConfig:i,slotIndex:h.slotIndex??l,eventId:t?._id,organizationId:q},`${h._id??l}-${l}`):null;default:m=null}return m?/* @__PURE__ */p(m,{style:{width:s,height:o},event:t,content:h,timestampField:a,onAdClick:c?()=>S(h):void 0,hideControls:r,curateLink:c?`${c}/${h._id}`:null,onChangeFaceUrl:d,showQuickSearch:u},`${h._id??l}-${l}`):null}}),[t,i,q,a,c,r,d,u]);/* @__PURE__ */
35
35
  return p(m,{children:[/* @__PURE__ */p("div",{id:w,ref:f,className:x(s?"w-full lg:w-1/3":"w-full"),children:/* @__PURE__ */p(I,{spacing:4,rowConstraints:t=>{const e={minPhotos:1,maxPhotos:4,singleRowMaxHeight:400};return s&&(e.minPhotos=1,e.maxPhotos=t<400?2:t<800?3:4),e},columns:t=>s?1:t<400?2:t<800?3:4,photos:M,render:A})}),/* @__PURE__ */p(Nt,{open:Boolean(C),ad:C,onClose:()=>S(null),captureAdClick:T})]})};export{Ut as default};
@@ -1,4 +1,4 @@
1
- import{d as e,s as r,t,v as o}from"./DrrpB4Om.js";import{D as l,n as s}from"./CaX2xgrP.js";import{l as i}from"./ChJXhA9c.js";import"./h4ZjZXfe2.js";var n=e(()=>import("./C9kBlCZx2.js")),a=e(()=>import("./CZbEGemi2.js")),c=e(()=>import("./D340VADc2.js")),d=e(()=>import("./CQBd8iaX2.js")),p=()=>/* @__PURE__ */t("div",{class:"flex h-full items-center justify-center",children:/* @__PURE__ */t("div",{class:"text-center",children:[
1
+ import{d as e,s as r,t,v as o}from"./DrrpB4Om.js";import{D as l,n as s}from"./CaX2xgrP.js";import{l as i}from"./ChJXhA9c.js";import"./h4ZjZXfe2.js";var n=e(()=>import("./C9kBlCZx2.js")),a=e(()=>import("./CZbEGemi2.js")),c=e(()=>import("./DWjheKBP2.js")),d=e(()=>import("./DRP9vxts2.js")),p=()=>/* @__PURE__ */t("div",{class:"flex h-full items-center justify-center",children:/* @__PURE__ */t("div",{class:"text-center",children:[
2
2
  /* @__PURE__ */t("svg",{xmlns:"http://www.w3.org/2000/svg",class:"text-muted-foreground mx-auto mb-3 size-10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5",children:[/* @__PURE__ */t("path",{d:"M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7z"}),/* @__PURE__ */t("circle",{cx:"12",cy:"9",r:"2.5"})]}),
3
3
  /* @__PURE__ */t("p",{class:"text-foreground",children:"No location data available."}),
4
4
  /* @__PURE__ */t("p",{class:"text-muted-foreground mt-1 text-xs",children:"Events need location data to appear on the map."})]})}),m=()=>/* @__PURE__ */t("div",{class:"flex h-full items-center justify-center",children:/* @__PURE__ */t("div",{class:"border-primary size-8 animate-spin rounded-full border-4 border-t-transparent"})}),g=({events:e,isLoading:g=!1})=>{const{organization:x}=s(),f=i(),h=x?.integrationSettings??{},u=h.mapProvider??"openstreetmap",v=o(e=>{f(l.GALLERY(e))},[f]);if("openstreetmap_free"===u)/* @__PURE__ */return t("div",{class:"relative mt-3 h-screen sm:mt-6",children:/* @__PURE__ */t(r,{fallback:/* @__PURE__ */t(m,{}),children:/* @__PURE__ */t(n,{onExplore:v,logoUrl:x?.logoUrl})})});const y=h.mapTilerApiKey??"",b=h.googleMapsApiKey??"",w=h.mapboxApiKey??"",j=e.filter(e=>"number"==typeof e.location?.x&&"number"==typeof e.location?.y);/* @__PURE__ */
@@ -0,0 +1,9 @@
1
+ import{t}from"./DrrpB4Om.js";import{D as a,n as s}from"./CaX2xgrP.js";import{i as r,n as e,u as o}from"./ChJXhA9c.js";import{t as i}from"./DF0LxcV7.js";import{t as n}from"./DGbyGc8b.js";import{t as l}from"./DCj_fMN5.js";import{t as m}from"./DnQ6XaLR.js";import{t as c}from"./DGGc10Cy.js";import{t as d}from"./CM46vluW.js";import{t as g}from"./C3dOFk9A.js";var p=()=>{const p=o(),{props:f}=s(),v=f?.organizationId,{loading:h,event:u}=d({eventSlug:p.eventSlug});if(h)/* @__PURE__ */return t("div",{children:[
2
+ /* @__PURE__ */t(n,{className:"mx-auto mt-4 h-8 w-64"}),
3
+ /* @__PURE__ */t(n,{className:"mx-auto mt-6 h-6 w-72"}),
4
+ /* @__PURE__ */t(n,{className:"mx-auto mt-6 h-8 w-72"}),
5
+ /* @__PURE__ */t("div",{className:"mt-8 grid grid-cols-1 gap-4 sm:grid-cols-3",children:Array.from({length:8}).map((a,s)=>/* @__PURE__ */t(n,{className:"h-72"},s))})]});const N=u?.organizationId?.toString?.()||u?.organizationId,j=v?.toString?.()||v;/* @__PURE__ */
6
+ return t("div",u&&N===j?{className:"bg-background relative min-h-screen",children:/* @__PURE__ */t(c,{locale:u?.language??"en",translations:u?.translations,children:[
7
+ /* @__PURE__ */t(m,{}),
8
+ /* @__PURE__ */t(r,{}),
9
+ /* @__PURE__ */t(l,{})]})}:{className:"flex w-full flex-col items-center gap-8",children:[/* @__PURE__ */t(i,{className:"mt-16",title:"Event not found",description:"Please check the provided link",iconSvg:/* @__PURE__ */t("svg",{xmlns:"http://www.w3.org/2000/svg",className:"size-full",viewBox:"0 0 997.86122 450.8081",role:"img"})}),/* @__PURE__ */t(e,{to:a.PUBLIC_EVENTS,state:{internalNavigation:!0},children:/* @__PURE__ */t(g,{children:"All events"})})]})};export{p as default};
@@ -0,0 +1,5 @@
1
+ import{t as r,w as t}from"./DrrpB4Om.js";import{D as e,n}from"./CaX2xgrP.js";import{l as a,t as i}from"./ChJXhA9c.js";import{t as s}from"./CATr-3VW.js";import{t as o}from"./D35mTuTT.js";var c=()=>{const{user:c,organization:l,signout:m}=n(),d=a(),h=l?.integrationSettings?.hideQratiBranding;/* @__PURE__ */
2
+ return r("div",{className:"pt-16 sm:pt-24",children:[l&&/* @__PURE__ */r("div",{className:"mx-auto py-2",children:l.customAuth?c&&/* @__PURE__ */r(s,{variant:"h6",align:"center",children:c.name}):/* @__PURE__ */r(t,{children:[!c&&/* @__PURE__ */r(s,{variant:"h6",align:"center",children:[
3
+ /* @__PURE__ */r(i,{className:"text-primary hover:underline",to:e.LOGIN,children:"Login"})," ","•"," ",
4
+ /* @__PURE__ */r(i,{className:"text-primary hover:underline",to:e.REGISTER,children:"Register"})]}),c&&/* @__PURE__ */r(s,{variant:"h6",align:"center",children:[c.name," •"," ",
5
+ /* @__PURE__ */r("button",{type:"button",className:"text-destructive cursor-pointer border-none bg-transparent p-0 hover:underline",onClick:async()=>{await m(),d(e.PUBLIC_EVENTS)},children:"Logout"})]})]})}),!h&&/* @__PURE__ */r(o,{})]})};export{c as t};