@qratilabs/qrati-connect 2.14.0 → 2.16.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.
Files changed (53) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/element/{CWJf7mNz.js → BI8RhPVM.js} +1 -1
  3. package/element/BhtZwJ7r.js +19 -0
  4. package/element/{CMtkKIjI.js → BvDw8z0o.js} +1 -1
  5. package/element/{Bez3GA8y.js → CEsBzi55.js} +1 -1
  6. package/element/CwqB3rqe.js +3 -0
  7. package/element/{CNGkJRCP.js → Cy3iV9XH.js} +1 -1
  8. package/element/{FXirOp_Y.js → D0tOl2TC.js} +1 -1
  9. package/element/{BHwNoqYe.js → DAitYRY4.js} +1 -1
  10. package/element/{BQBx6JI7.js → Dlyq91q9.js} +1 -1
  11. package/element/{Bu-H5iRE.js → DuIwDwan.js} +1 -1
  12. package/element/{19c52mJB.js → MZuQhFbV.js} +1 -1
  13. package/element/{BU70X6zI.js → VGPc4EeK.js} +1 -1
  14. package/element/{t1REK11Z.js → jL1IhEDX.js} +3 -3
  15. package/element/web.es.js +5 -5
  16. package/package.json +1 -1
  17. package/react/{DCz37sa7.js → B8OuOa1d.js} +1 -1
  18. package/react/{CDiSbuj_.js → BG6d9dt3.js} +1 -1
  19. package/react/BiTDkR5y.js +1 -0
  20. package/react/{CHSr2RxR.js → BkeCKRKb.js} +1 -1
  21. package/react/{BMzYiAN3.js → BlGHB1od.js} +1 -1
  22. package/react/BltPktiy.js +19 -0
  23. package/react/{DvzgEfqA.js → C77XJYNh.js} +1 -1
  24. package/react/{DqVfSNOG.js → CPM5coLp.js} +1 -1
  25. package/react/CSHWW4FM.js +1 -0
  26. package/react/CY68wh8z.js +1 -0
  27. package/react/{BJvO-E_0.js → CYntO9YI.js} +1 -1
  28. package/react/{TRIgeGAL.js → CZ9RIEEO.js} +1 -1
  29. package/react/{B100IxcO.js → D1CJDHfi.js} +1 -1
  30. package/react/{B1c5Cjsd.js → D9p5klRz.js} +1 -1
  31. package/react/DCS0HdZa.js +3 -0
  32. package/react/{CX_Vz15p.js → DF_cfEUO.js} +1 -1
  33. package/react/DQVgvgo2.js +6 -0
  34. package/react/{D_KoEU5i.js → DVJkpJ9-.js} +1 -1
  35. package/react/{BlSQ-ODL.js → DXEzKDRE.js} +1 -1
  36. package/react/{DQWXCdfm.js → DZhlx4rT.js} +1 -1
  37. package/react/{DPezSfU3.js → D_47D6ly.js} +1 -1
  38. package/react/{eCa9bk8E.js → O7eIZSmq.js} +1 -1
  39. package/react/{BmbdEikc.js → P53QlFG0.js} +1 -1
  40. package/react/index.cjs +1 -1
  41. package/react/index.mjs +5 -5
  42. package/react/{EJU6024p.js → k7mNnMH1.js} +1 -1
  43. package/react/{CojsvC2N.js → vcPA0j_c.js} +3 -3
  44. package/react/{CB5M-zWX.js → yWdl62rI.js} +1 -1
  45. package/umd/web.umd.js +1 -1
  46. package/element/BRTFWO2n.js +0 -3
  47. package/element/CERLiedB.js +0 -17
  48. package/react/BsUU5VBO.js +0 -6
  49. package/react/Bxxb7z6d.js +0 -1
  50. package/react/JLXrD6OW.js +0 -1
  51. package/react/eEYDnGow.js +0 -1
  52. package/react/yLRfWDiY.js +0 -3
  53. package/react/zqIYi_Na.js +0 -17
package/CHANGELOG.md CHANGED
@@ -1,3 +1,29 @@
1
+ # [2.15.0](https://github.com/qrati-labs/qrati-connect-ts/compare/v2.14.0...v2.15.0) (2026-05-07)
2
+
3
+
4
+ ### Features
5
+
6
+ * add PhotoSwipeFilmstrip plugin and integrate with MediaGallery ([3f5cbd3](https://github.com/qrati-labs/qrati-connect-ts/commit/3f5cbd3cc67789135cce0d1e860fe4ce009761ee))
7
+ * enhance PhotoSwipe and Ad components with blurhash support and improved dialog handling ([12c07eb](https://github.com/qrati-labs/qrati-connect-ts/commit/12c07ebf4ed0aefd26b1be38e7bbd9d83b5057e3))
8
+ * replace React with Preact for filmstrip rendering in PhotoSwipe ([6bcafb1](https://github.com/qrati-labs/qrati-connect-ts/commit/6bcafb1b2cf0f7575e8f6e44753a3e357cbe8fbf))
9
+
10
+ # [2.14.0](https://github.com/qrati-labs/qrati-connect-ts/compare/v2.13.0...v2.14.0) (2026-05-07)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * reorder CSS imports for proper style application in Shadow DOM ([9eb29ae](https://github.com/qrati-labs/qrati-connect-ts/commit/9eb29aebff37e9427ddfcbccf6dcd30a00aff44f))
16
+
17
+
18
+ ### Features
19
+
20
+ * enhance GAM ad components with new targeting options and refresh capabilities ([7c671bf](https://github.com/qrati-labs/qrati-connect-ts/commit/7c671bfeaeb4300eaf5a92b76059fd22d0ebf58e))
21
+ * enhance GAM ad slot handling with dynamic size allocation and improved tracking ([dcee7f1](https://github.com/qrati-labs/qrati-connect-ts/commit/dcee7f17757f72d3b038896b8c8ce62534aee4fa))
22
+ * implement GAM click tracking and enhance ad components with error handling ([fa6fe3b](https://github.com/qrati-labs/qrati-connect-ts/commit/fa6fe3bf92e845209f4a71993e9390b5fa339333))
23
+ * integrate GAM ads with new banner and sidebar components, and update content embedding logic ([b9c9f96](https://github.com/qrati-labs/qrati-connect-ts/commit/b9c9f962e28f9d2db74e90090f372c124ab0bded))
24
+ * integrate Google Ad Manager support with GAM ad components and analytics tracking ([fdcd11d](https://github.com/qrati-labs/qrati-connect-ts/commit/fdcd11d2962ba627ae19400b0417c1c318cd25d2))
25
+ * refactor GamBannerAd and GamSidebarAd components for improved ad rendering and fixed positioning ([5979b08](https://github.com/qrati-labs/qrati-connect-ts/commit/5979b0840c61f323dc6b7ef053516f4ad56d9c3f))
26
+
1
27
  # [2.13.0](https://github.com/qrati-labs/qrati-connect-ts/compare/v2.12.0...v2.13.0) (2026-04-24)
2
28
 
3
29
 
@@ -1,4 +1,4 @@
1
- import{A as e,u as t,v as r,w as o}from"./19c52mJB.js";import{D as s,n as l}from"./t1REK11Z.js";var i=e(()=>import("./Bez3GA8y.js")),n=e(()=>import("./FXirOp_Y.js")),a=e(()=>import("./CMtkKIjI.js")),c=e(()=>import("./BU70X6zI.js")),d=({events:e,isLoading:d=!1})=>{const{organization:p}=l(),m=t(),g=p?.integrationSettings??{},x=g.mapProvider??"openstreetmap",u=g.mapTilerApiKey??"",f=g.googleMapsApiKey??"",h=g.mapboxApiKey??"",v=e.filter(e=>"number"==typeof e.location?.x&&"number"==typeof e.location?.y),y="openstreetmap"===x&&!u||"google"===x&&!f||"mapbox"===x&&!h,w=e=>{m(s.GALLERY(e))};/* @__PURE__ */
1
+ import{A as e,u as t,v as r,w as o}from"./MZuQhFbV.js";import{D as s,n as l}from"./jL1IhEDX.js";var i=e(()=>import("./CEsBzi55.js")),n=e(()=>import("./D0tOl2TC.js")),a=e(()=>import("./BvDw8z0o.js")),c=e(()=>import("./VGPc4EeK.js")),d=({events:e,isLoading:d=!1})=>{const{organization:p}=l(),m=t(),g=p?.integrationSettings??{},x=g.mapProvider??"openstreetmap",u=g.mapTilerApiKey??"",f=g.googleMapsApiKey??"",h=g.mapboxApiKey??"",v=e.filter(e=>"number"==typeof e.location?.x&&"number"==typeof e.location?.y),y="openstreetmap"===x&&!u||"google"===x&&!f||"mapbox"===x&&!h,w=e=>{m(s.GALLERY(e))};/* @__PURE__ */
2
2
  return r("div",{class:"w relative mt-3 h-screen sm:mt-6",children:d?/* @__PURE__ */r("div",{class:"flex h-full items-center justify-center",children:/* @__PURE__ */r("div",{class:"border-primary bt-transparent size-8 animate-spin rounded-full"})}):y?/* @__PURE__ */r("div",{class:"flex h-full items-center justify-center",children:/* @__PURE__ */r("div",{class:"text-center",children:[
3
3
  /* @__PURE__ */r("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__ */r("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__ */r("circle",{cx:"12",cy:"9",r:"2.5"})]}),
4
4
  /* @__PURE__ */r("p",{class:"text-foreground",children:"API key is required to display the map."}),
@@ -0,0 +1,19 @@
1
+ import{F as t,G as e,H as n,I as i,K as s,L as o,M as r,N as a,P as l,R as c,U as d,W as p,f as h,j as u,n as m,p as g,v as w,x as f,y,z as v}from"./MZuQhFbV.js";import{D as b,L as T,N as x,O as _,T as q,c as k,l as S,m as I,n as E,s as C,w as L,y as N}from"./jL1IhEDX.js";import{a as A,d as M,f as B,g as z,h as V,i as R,l as O,m as P,n as $,o as D,p as H,r as F,s as U,t as j,u as W,v as G,y as K}from"./CwqB3rqe.js";import{n as Y,r as Q,t as Z}from"./DuIwDwan.js";function J(t){return["react-photo-album",t].filter(Boolean).join("--")}function X({width:t,height:e}){const n=t/e;return Number.isFinite(n)?n:1}var tt=Object.freeze([1200,600,300,0]);function et(t,e){return"function"==typeof t?t(e):t}function nt(t,e){return void 0!==e?et(t,e):void 0}function it(t,e,n,i=0){if(void 0===e)return;const s=nt(t,e);return Math.round(Math.max(void 0===s?function(t,e){const n=tt.findIndex(t=>t<=e);return et(t[Math.max(n,0)],e)}(n,e):s,i))}function st(t,{spacing:e,padding:n,componentsProps:i,render:s}){return{spacing:it(e,t,[20,15,10,5]),padding:it(n,t,[0,0,0,0]),componentsProps:et(i,t)||{},render:et(s,t)}}function ot(t,e=0){const n=10**e;return Math.round((t+Number.EPSILON)*n)/n}function rt(t,e,n,i,s,o,r){let a,l;const c=t=>{const e=o*(s-1)+2*r*s;return`calc((${t.match(/^\s*calc\((.*)\)\s*$/)?.[1]??t} - ${e}px) / ${ot((i-e)/n,5)})`},d=t.srcSet;return d&&d.length>0&&(a=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(", ")),l=e?.size?(e.sizes||[]).map(({viewport:t,size:e})=>`${t} ${c(e)}`).concat(c(e.size)).join(", "):`${Math.ceil(n/i*100)}vw`,{srcSet:a,sizes:l}}var at=f(function({as:t,render:e,context:n,classes:i=[],variables:s={},style:o,className:r,children:a,...l},c){const d=function(...t){return t.filter(Boolean).join(" ")}(...(Array.isArray(i)?i:[i]).filter(t=>"string"==typeof t).map(J),r),p={style:{...Object.fromEntries(Object.entries(s).map(([t,e])=>{return[(n=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),`--${J(n)}`),"number"==typeof e?ot(e,5):e];var n})),...o},className:d,children:a,...l};if(e){const t=e({ref:c,...p},n);if(t)return t}return w(t||"div",{ref:c,...p})}),lt=f(function({photo:t,index:e,width:n,height:i,onClick:s,render:{wrapper:o,link:r,button:a,image:l,extras:c}={},componentsProps:{link:d,button:p,wrapper:h,image:u}={}},m){const{href:g}=t,f={photo:t,index:e,width:ot(n,3),height:ot(i,3)};let y;return y=g?{...d,as:"a",render:r,classes:["photo","link"],href:g,onClick:s}:s?{...p,as:"button",type:"button",render:a,classes:["photo","button"],onClick:s}:{...h,render:o,classes:"photo"},w(at,{ref:m,variables:{photoWidth:f.width,photoHeight:f.height},context:f,...y,children:[w(at,{as:"img",classes:"image",render:l,context:f,...u}),c?.({},f)]})}),ct=f(function({layout:t,sizes:e,model:n,skeleton:i,onClick:o,render:{container:r,track:a,photo:l,...c}={},componentsProps:{container:d,track:p,link:h,button:u,wrapper:m,image:g}={}},f){const{spacing:y,padding:v,containerWidth:b,tracks:T,variables:x,horizontal:_}=n||{};return w(at,{role:"group","aria-label":"Photo album",...d,variables:{spacing:y,padding:v,containerWidth:b,...x},classes:["",t],render:r,ref:f,children:[void 0!==y&&void 0!==v&&void 0!==b&&T?.map(({photos:t,variables:n},i)=>{const r=t.length,d=_?r:T.length;return s(at,{...p,key:i,render:a,classes:"track",variables:{trackSize:r,...n}},t.map(t=>{const{photo:n,index:i,width:s}=t,{key:r,src:a,alt:p="",title:f,label:T}=n,x=o?t=>{o({event:t,photo:n,index:i})}:void 0;if(l){const e=l({onClick:x},t);if(e)return e}const _=t=>T?{"aria-label":T,...t}:t;return w(lt,{onClick:x,render:c,componentsProps:{image:{loading:"lazy",decoding:"async",src:a,alt:p,title:f,...rt(n,e,s,b,d,y,v),...et(g,t)},link:_(et(h,t)),button:_(et(u,t)),wrapper:et(m,t)},...t},r??i)}))}),void 0===b&&i]})});function dt(t,e,n,i){return(e-(t.length-1)*n-2*i*t.length)/t.reduce((t,e)=>t+X(e),0)}function pt(t,e,n,i,s,o,r){const a=t.slice(e,n),l=dt(a,i,s,o);return l>0?(l-r)**2*a.length:void 0}function ht(t,e){const[n,i]=t;if(n===e)return t;if(void 0!==i&&void 0!==e&&void 0!==n&&e===i&&Math.abs(e-n)<=20){const s=Math.min(n,e),o=Math.max(n,e);return s===n&&o===i?t:[s,o]}return[e,n]}function ut(t,e,n){const[[s],r]=i(ht,[n]),a=function(t){const[e,n]=l(t);return t===e||t&&e&&t.length===e.length&&!t.some((t,n)=>t!==e[n])?e:(n(t),t)}(e),c=u(void 0);return{containerRef:o(e=>{c.current?.disconnect(),c.current=void 0;const n=()=>r(function(t,e){let n=t?.clientWidth;if(void 0!==n&&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)),n=t.find((e,i)=>e<=n||i===t.length-1)}return n}(e,a));n(),e&&"undefined"!=typeof ResizeObserver&&(c.current=new ResizeObserver(n),c.current.observe(e)),"function"==typeof t?t(e):t&&(t.current=e)},[t,a]),containerWidth:s}}var mt=f(function({photos:t,breakpoints:e,defaultContainerWidth:n,...i},s){const{containerRef:o,containerWidth:a}=ut(s,e,n),{spacing:l,padding:c,targetRowHeight:d,minPhotos:p,maxPhotos:h,...u}=function(t,{photos:e,targetRowHeight:n,rowConstraints:i,...s}){const{spacing:o,padding:r,componentsProps:a,render:l}=st(t,s),{singleRowMaxHeight:c,minPhotos:d,maxPhotos:p}=nt(i,t)||{};if(void 0!==c&&void 0!==o&&void 0!==r){const t=Math.floor(e.reduce((t,{width:e,height:n})=>t+e/n*c+2*r,o*(e.length-1)));t>0&&(a.container={...a.container},a.container.style={maxWidth:t,...a.container.style})}return{...s,targetRowHeight:it(n,t,[t=>t/5,t=>t/4,t=>t/3,t=>t/2]),render:l,spacing:o,padding:r,minPhotos:d,maxPhotos:p,componentsProps:a}}(a,{photos:t,...i});return w(ct,{layout:"rows",ref:o,model:r(()=>void 0!==a&&void 0!==l&&void 0!==c&&void 0!==d?function(t,e,n,i,s,o,r){const a=Math.min(function(t,e,n,i){return ot(e/n/Math.min(...t.map(t=>X(t))))+(i||0)+2}(t,i,s,o),r||1/0),l=o||1,c=t.length,d=new Array(c+1).fill(1/0),p=new Array(c+1).fill(-1);d[0]=0;for(let m=1;m<=c;m+=1)for(let o=m-l;o>=Math.max(0,m-a);o-=1){if(d[o]===1/0)continue;const r=pt(t,o,m,i,e,n,s);if(void 0===r)break;const a=d[o]+r;(d[m]===1/0||d[m]>a&&(d[m]/a>1.005||-1!==p[m]&&p[m]<o))&&(d[m]=a,p[m]=o)}if(d[c]===1/0)return;const h=[];for(let m=c;0!==m;m=p[m])h.push(m);h.push(0),h.reverse();const u=[];for(let m=1;m<h.length;m+=1){const s=t.slice(h[m-1],h[m]).map((t,e)=>({photo:t,index:h[m-1]+e})),o=dt(s.map(({photo:t})=>t),i,e,n);u.push({photos:s.map(({photo:t,index:e})=>({photo:t,index:e,width:o*X(t),height:o}))})}return{spacing:e,padding:n,containerWidth:i,tracks:u,horizontal:!0}}(t,l,c,a,d,p,h):void 0,[t,l,c,a,d,p,h]),...u})});function gt(t,e,n,i,s,o,r){const a=[],l=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,n)=>({photo:e,index:t[c]+n})),p=r.reduce((t,e,n)=>t+(o[c]-o[n])*e,0),h=(s-(t.length-2)*n-2*(t.length-1)*i-p)*r[c]/l;a.push({photos:d.map(({photo:t,index:e})=>({photo:t,index:e,width:h,height:h/X(t)})),variables:{adjustedGaps:p,columnRatio:r[c]}})}return{tracks:a,variables:{totalRatio:l}}}function wt(t,e,n,i,s,o){const r=[],a=[];if(t.length<=o){const s=t.length>0?t.reduce((t,e)=>t+X(e),0)/t.length:1;for(let e=0;e<o;e+=1)r[e]=2*n,a[e]=e<t.length?X(t[e]):s;return gt(Array.from({length:o+1},(e,n)=>Math.min(n,t.length)),t,e,n,i,r,a)}const l=(c=function(t,e,n,i,s){return o=>{const r=[],a=1.5*s;let l=i/X(t[o])+2*n;for(let c=o+1;c<t.length+1&&(r.push([c,(s-l)**2]),!(l>a||c===t.length));c+=1)l+=i/X(t[c])+e+2*n;return r}}(t,e,n,s,(t.reduce((t,e)=>t+s/X(e),0)+e*(t.length-o)+2*n*t.length)/o),d=o,p=0,h=t.length,function(t,e,n){const i=[n];for(let s=n,o=e;o>0;o-=1)[s]=t.get(s)[o],i.push(s);return i.reverse()}(function(t,e,n,i){const s=/* @__PURE__ */new Map,o=/* @__PURE__ */new Set;o.add(n);for(let r=0;r<e;r+=1){const n=[...o.keys()];o.clear(),n.forEach(n=>{const a=r>0?s.get(n)[r][1]:0;t(n).forEach(([t,l])=>{let c=s.get(t);c||(c=[],s.set(t,c));const d=a+l,p=c[r+1];(!p||p[1]>d&&(p[1]/d>1.0001||n<p[0]))&&(c[r+1]=[n,d]),r<e-1&&t!==i&&o.add(t)})})}return s}(c,d,p,h),d,h));var c,d,p,h;for(let u=0;u<l.length-1;u+=1){const i=t.slice(l[u],l[u+1]);r[u]=e*(i.length-1)+2*n*i.length,a[u]=1/i.reduce((t,e)=>t+1/X(e),0)}return gt(l,t,e,n,i,r,a)}function ft(t,e,n,i,s){const{tracks:o,variables:r}=wt(t,e,n,i,(i-e*(s-1)-2*n*s)/s,s);return o.some(t=>t.photos.some(({width:t,height:e})=>t<=0||e<=0))?s>1?ft(t,e,n,i,s-1):void 0:{tracks:o,spacing:e,padding:n,containerWidth:i,variables:{columns:s,...r}}}var yt=f(function({photos:t,breakpoints:e,defaultContainerWidth:n,...i},s){const{containerRef:o,containerWidth:a}=ut(s,e,n),{spacing:l,padding:c,columns:d,...p}=function(t,{columns:e,...n}){return{...n,...st(t,n),columns:it(e,t,[5,4,3,2],1)}}(a,{photos:t,...i});return w(ct,{layout:"columns",ref:o,model:r(()=>void 0!==a&&void 0!==l&&void 0!==c&&void 0!==d?ft(t,l,c,a,d):void 0,[t,l,c,a,d]),...p})});function vt(t,e,n,i,s){const o=(i-e*(s-1)-2*n*s)/s;if(o<=0)return s>1?vt(t,e,n,i,s-1):void 0;const r=[];for(let l=0;l<s;l+=1)r[l]=0;const a=t.reduce((t,i,s)=>{const a=r.reduce((t,e,n)=>e<r[t]-1?n:t,0);return r[a]=r[a]+o/X(i)+e+2*n,t[a].push({photo:i,index:s}),t},Array.from({length:s},()=>[]));return{spacing:e,padding:n,containerWidth:i,variables:{columns:s},tracks:a.map(t=>({photos:t.map(({photo:t,index:e})=>({photo:t,index:e,width:o,height:o/X(t)}))}))}}var bt=f(function({photos:t,breakpoints:e,defaultContainerWidth:n,...i},s){const{containerRef:o,containerWidth:a}=ut(s,e,n),{spacing:l,padding:c,columns:d,...p}=function(t,{columns:e,...n}){return{...n,...st(t,n),columns:it(e,t,[5,4,3,2],1)}}(a,{photos:t,...i});return w(ct,{layout:"masonry",ref:o,model:r(()=>void 0!==a&&void 0!==l&&void 0!==c&&void 0!==d?vt(t,l,c,a,d):void 0,[t,l,c,a,d]),...p})});function Tt(t){return t?String(t).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;"):""}var xt=class{constructor(t,e={}){this.lightbox=t,this.aiSummaryVisible=!1,this.currentSummary=null,this.options={aiSummaryButtonOrder:7,width:"400px",height:"300px",transition:"0.3s ease",...e},document.head.insertAdjacentHTML("beforeend",`<style>\n .pswp__ai-summary-panel {\n background: rgba(30, 30, 30, 0.9);\n color: white;\n position: absolute;\n overflow-y: auto;\n z-index: 1;\n transition: transform ${this.options.transition};\n box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);\n padding: 20px;\n }\n\n /* Desktop styles */\n @media (min-width: 768px) {\n .pswp__ai-summary-panel {\n top: 0;\n right: 0;\n height: 100%;\n width: ${this.options.width};\n transform: translateX(100%);\n }\n\n .pswp__ai-summary-panel.visible {\n transform: translateX(0);\n }\n\n .pswp__container.shifted-for-ai-summary {\n transform: translateX(-${this.options.width});\n transition: transform ${this.options.transition};\n }\n }\n\n /* Mobile styles */\n @media (max-width: 767px) {\n .pswp__ai-summary-panel {\n bottom: 0;\n left: 0;\n width: 100%;\n height: ${this.options.height};\n transform: translateY(100%);\n }\n\n .pswp__ai-summary-panel.visible {\n transform: translateY(0);\n }\n\n .pswp__container.shifted-for-ai-summary {\n transform: translateY(-${this.options.height});\n transition: transform ${this.options.transition};\n }\n }\n\n .pswp__ai-summary-close {\n position: absolute;\n top: 10px;\n right: 10px;\n width: 32px;\n height: 32px;\n opacity: 0.6;\n cursor: pointer;\n z-index: 2;\n background: rgba(0, 0, 0, 0.3);\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: opacity 0.3s;\n }\n\n .pswp__ai-summary-close:hover {\n opacity: 1;\n }\n\n .pswp__ai-summary-close:before,\n .pswp__ai-summary-close:after {\n position: absolute;\n content: '';\n width: 16px;\n height: 2px;\n background-color: white;\n }\n\n .pswp__ai-summary-close:before {\n transform: rotate(45deg);\n }\n\n .pswp__ai-summary-close:after {\n transform: rotate(-45deg);\n }\n\n .pswp__ai-summary-content {\n margin-top: 20px;\n }\n\n .pswp__ai-summary-title {\n margin-bottom: 16px;\n font-size: 18px;\n font-weight: bold;\n padding-right: 30px; /* Add space for the close button */\n }\n\n .pswp__ai-summary-section {\n margin-bottom: 16px;\n }\n\n .pswp__ai-summary-section-title {\n font-weight: bold;\n margin-bottom: 8px;\n }\n\n .pswp__ai-summary-label {\n display: inline-flex;\n align-items: center;\n background: rgba(255, 255, 255, 0.1);\n border-radius: 12px;\n padding: 4px 12px;\n margin-right: 8px;\n margin-bottom: 8px;\n font-size: 14px;\n }\n\n .pswp__ai-summary-description {\n font-size: 14px;\n line-height: 1.5;\n }\n\n .pswp__ai-summary-empty {\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100%;\n color: rgba(255, 255, 255, 0.6);\n font-style: italic;\n }\n\n .pswp__ai-summary-bing-search {\n width: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n gap: 8px;\n z-index: 2;\n }\n\n .pswp__ai-summary-bing-button {\n height: 32px;\n background: rgba(255, 255, 255, 0.2);\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n transition: background-color 0.3s;\n }\n\n .pswp__ai-summary-bing-button:hover {\n background: rgba(255, 255, 255, 0.4);\n }\n\n .pswp__ai-summary-bing-icon {\n width: 20px;\n height: 20px;\n }\n\n .pswp__ai-summary-disclaimer {\n font-size: 12px;\n color: rgba(255, 255, 255, 0.7);\n text-align: center;\n margin-top: 32px;\n padding: 0 10px;\n line-height: 1.4;\n font-style: italic;\n }\n </style>`),t.on("init",()=>{this.initPswpEvents(t.pswp)})}initPswpEvents(t){t.on("uiRegister",()=>{t.ui.registerElement({name:"ai-summary-toggle-button",title:"Toggle AI summary view",order:this.options.aiSummaryButtonOrder,isButton:!0,html:'<svg aria-hidden="true" class="pswp__icn" viewBox="0 0 24 24">\n <use class="pswp__icn-shadow" xlink:href="#pswp__icn-ai-summary"/>\n <path d="M12 17q.425 0 .713-.288T13 16v-4q0-.425-.288-.712T12 11t-.712.288T11 12v4q0 .425.288.713T12 17m0-8q.425 0 .713-.288T13 8t-.288-.712T12 7t-.712.288T11 8t.288.713T12 9m0 13q-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 12t-.788 3.9t-2.137 3.175t-3.175 2.138T12 22m0-2q3.35 0 5.675-2.325T20 12t-2.325-5.675T12 4T6.325 6.325T4 12t2.325 5.675T12 20m0-8"/>\n </svg>',onClick:()=>{this.toggleAISummary(t)}}),t.ui.registerElement({name:"ai-summary-panel",isButton:!1,appendTo:"root",html:'<div class="pswp__ai-summary-panel"><div class="pswp__ai-summary-close"></div></div>'})}),t.on("change",()=>{this.aiSummaryVisible&&this.updateAISummary(t)}),t.on("close",()=>{this.hideAISummary(t)}),t.on("firstUpdate",()=>{const e=t.element.querySelector(".pswp__ai-summary-close");e&&e.addEventListener("click",()=>{this.hideAISummary(t)})})}toggleAISummary(t){this.aiSummaryVisible?this.hideAISummary(t):this.showAISummary(t)}showAISummary(t){const e=t.container,n=t.element.querySelector(".pswp__ai-summary-panel");n&&(this.aiSummaryVisible=!0,n.classList.add("visible"),e.classList.add("shifted-for-ai-summary"),this.updateAISummary(t))}hideAISummary(t){const e=t.container,n=t.element.querySelector(".pswp__ai-summary-panel");n&&(this.aiSummaryVisible=!1,n.classList.remove("visible"),e.classList.remove("shifted-for-ai-summary"))}updateAISummary(t){if(!t.currSlide)return;const e=t.element.querySelector(".pswp__ai-summary-panel");if(!e)return;const n=t.currSlide.data,i=n.src||n.url||"";let s=null;try{n.contentSummary&&(s=JSON.parse(n.contentSummary),this.currentSummary=s)}catch(r){console.error("Error parsing AI summary data:",r)}const o=i?`<a class="pswp__ai-summary-bing-search" href="https://www.bing.com/images/search?view=detailv2&iss=SBI&form=SBIIRP&sbisrc=UrlPaste&q=imgurl:${encodeURIComponent(i)}&idpbck=1&selectedindex=0&id=${encodeURIComponent(i)}&mediaurl=${encodeURIComponent(i)}" target="_blank" rel="noopener noreferrer" class="pswp__ai-summary-bing-button">\n <svg xmlns="http://www.w3.org/2000/svg" style="height:24px;width:24px" width="256" height="388" viewBox="0 0 256 388"><defs><radialGradient id="logosBing0" cx="93.717%" cy="77.818%" r="143.121%" fx="93.717%" fy="77.818%" gradientTransform="scale(-1 -.71954)rotate(49.091 2.036 -2.204)"><stop offset="0%" stop-color="#00cacc"/><stop offset="100%" stop-color="#048fce"/></radialGradient><radialGradient id="logosBing1" cx="13.893%" cy="71.448%" r="150.086%" fx="13.893%" fy="71.448%" gradientTransform="matrix(.55155 -.39387 .23634 .91917 -.107 .112)"><stop offset="0%" stop-color="#00bbec"/><stop offset="100%" stop-color="#2756a9"/></radialGradient><linearGradient id="logosBing2" x1="50%" x2="50%" y1="0%" y2="100%"><stop offset="0%" stop-color="#00bbec"/><stop offset="100%" stop-color="#2756a9"/></linearGradient></defs><path fill="url(#logosBing0)" d="M129.424 122.047c-7.133.829-12.573 6.622-13.079 13.928c-.218 3.147-.15 3.36 6.986 21.722c16.233 41.774 20.166 51.828 20.827 53.243c1.603 3.427 3.856 6.65 6.672 9.544c2.16 2.22 3.585 3.414 5.994 5.024c4.236 2.829 6.337 3.61 22.818 8.49c16.053 4.754 24.824 7.913 32.381 11.664c9.791 4.86 16.623 10.387 20.944 16.946c3.1 4.706 5.846 13.145 7.04 21.64c.468 3.321.47 10.661.006 13.663c-1.008 6.516-3.021 11.976-6.101 16.545c-1.638 2.43-1.068 2.023 1.313-.939c6.74-8.379 13.605-22.7 17.108-35.687c4.24-15.718 4.817-32.596 1.66-48.57c-6.147-31.108-25.786-57.955-53.444-73.06c-1.738-.95-8.357-4.42-17.331-9.085a1633 1633 0 0 1-4.127-2.154c-.907-.477-2.764-1.447-4.126-2.154c-1.362-.708-5.282-2.75-8.711-4.539l-8.528-4.446a6021 6021 0 0 1-8.344-4.357c-8.893-4.655-12.657-6.537-13.73-6.863c-1.125-.343-3.984-.782-4.701-.723c-.152.012-.838.088-1.527.168"/><path fill="url(#logosBing1)" d="M148.81 277.994c-.493.292-1.184.714-1.537.938c-.354.225-1.137.712-1.743 1.083a8315 8315 0 0 0-13.204 8.137a2848 2848 0 0 0-8.07 4.997a388 388 0 0 1-3.576 2.198c-.454.271-2.393 1.465-4.31 2.654a2652 2652 0 0 1-7.427 4.586a3958 3958 0 0 0-8.62 5.316a3011 3011 0 0 1-7.518 4.637c-1.564.959-3.008 1.885-3.21 2.058c-.3.257-14.205 8.87-21.182 13.121c-5.3 3.228-11.43 5.387-17.705 6.235c-2.921.395-8.45.396-11.363.003c-7.9-1.067-15.176-4.013-21.409-8.666c-2.444-1.826-7.047-6.425-8.806-8.8c-4.147-5.598-6.829-11.602-8.218-18.396c-.32-1.564-.622-2.884-.672-2.935c-.13-.13.105 2.231.528 5.319c.44 3.211 1.377 7.856 2.387 11.829c7.814 30.743 30.05 55.749 60.15 67.646c8.668 3.424 17.415 5.582 26.932 6.64c3.576.4 13.699.56 17.43.276c17.117-1.296 32.02-6.334 47.308-15.996c1.362-.86 3.92-2.474 5.685-3.585a877 877 0 0 0 4.952-3.14c.958-.615 2.114-1.341 2.567-1.614a91 91 0 0 0 2.018-1.268c.656-.424 3.461-2.2 6.235-3.944l11.092-7.006l3.809-2.406l.137-.086l.42-.265l.199-.126l2.804-1.771l9.69-6.121c12.348-7.759 16.03-10.483 21.766-16.102c2.392-2.342 5.997-6.34 6.176-6.848c.037-.104.678-1.092 1.424-2.197c3.036-4.492 5.06-9.995 6.064-16.484c.465-3.002.462-10.342-.005-13.663c-.903-6.42-2.955-13.702-5.167-18.339c-3.627-7.603-11.353-14.512-22.453-20.076c-3.065-1.537-6.23-2.943-6.583-2.924c-.168.009-10.497 6.322-22.954 14.03c-12.457 7.71-23.268 14.4-24.025 14.87s-2.056 1.263-2.888 1.764z"/><path fill="url(#logosBing2)" d="m.053 241.013l.054 53.689l.695 3.118c2.172 9.747 5.937 16.775 12.482 23.302c3.078 3.07 5.432 4.922 8.768 6.896c7.06 4.177 14.657 6.238 22.978 6.235c8.716-.005 16.256-2.179 24.025-6.928c1.311-.801 6.449-3.964 11.416-7.029l9.032-5.572v-127.4l-.002-58.273c-.002-37.177-.07-59.256-.188-60.988c-.74-10.885-5.293-20.892-12.948-28.461c-2.349-2.323-4.356-3.875-10.336-7.99a25160 25160 0 0 1-12.104-8.336L28.617 5.835C22.838 1.85 22.386 1.574 20.639.949C18.367.136 15.959-.163 13.67.084C6.998.804 1.657 5.622.269 12.171C.053 13.191.013 26.751.01 100.35l-.003 86.975H0z"/></svg>\n <span>Search on Bing</span>\n </a>\n <div class="pswp__ai-summary-disclaimer">\n These are AI generated summaries based on the content. Please verify the information before using it.\n </div>`:"";if(s){e.innerHTML=`<div class="pswp__ai-summary-close"></div>${this.renderAISummary(s)}${o}`;const n=e.querySelector(".pswp__ai-summary-close");n&&n.addEventListener("click",()=>{this.hideAISummary(t)})}else{e.innerHTML=`<div class="pswp__ai-summary-close"></div><div class="pswp__ai-summary-empty">No AI summary available for this content</div>${o}`;const n=e.querySelector(".pswp__ai-summary-close");n&&n.addEventListener("click",()=>{this.hideAISummary(t)})}}renderAISummary(t){let e='<div class="pswp__ai-summary-content">';return t.subject&&(e+=`<div class="pswp__ai-summary-title">${Tt(t.subject)}</div>`),t.labels&&Object.entries(t.labels).filter(([t,e])=>Array.isArray(e)&&e.length>0).forEach(([t,n])=>{e+=`\n <div class="pswp__ai-summary-section">\n <div class="pswp__ai-summary-section-title">${Tt(t.replace("_"," ").replace(/\b\w/g,t=>t.toUpperCase()))}</div>\n <div class="pswp__ai-summary-labels space-y-2">\n ${n.map(t=>`<span class="pswp__ai-summary-label">${Tt(t)}</span>`).join("")}\n </div>\n </div>\n `}),t.description&&(e+=`\n <div class="pswp__ai-summary-section">\n <div class="pswp__ai-summary-description">${Tt(t.description)}</div>\n </div>\n `),e+="</div>",e}},_t='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)})}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=_t,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=_t,this.backgroundVideoElement.style.opacity=0,this.backgroundVideoElement.pause(),this.backdropOn=!1):(this.updateBlurBackground(t),this.backdropOn=!0),document.querySelector("#pswp__icn-hide-backdrop").style.display=this.backdropOn?"none":"inline",document.querySelector("#pswp__icn-show-backdrop").style.display=this.backdropOn?"inline":"none"}updateBlurBackground(t){const e=t.currSlide;if(e?.data)if("video"===e.data.type){const t=this.backgroundVideoElement,n=e.content.element;"video"===n?.tagName?.toLowerCase()&&(this.referenceVideoElement=n,this.registerVideoEvents(n,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,n=32)=>{if(!t||t.length<6||"undefined"==typeof document)return null;try{const i=Y(t,e,n),s=document.createElement("canvas");s.width=e,s.height=n;const o=s.getContext("2d");if(!o)return null;const r=o.createImageData(e,n);return r.data.set(i),o.putImageData(r,0,0),s.toDataURL()}catch(i){return console.warn("[PhotoSwipeBackdrop] Failed to decode blurhash:",i),null}})(e.data.blurhash)||e.data.thumbnailUrl||e.data.src;this.backgroundElement.style.backgroundImage=t?`url("${t}")`:_t,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})}};function kt(t){return t?String(t).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;"):""}var St={[C.LINK]:'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24"><path fill="currentColor" d="M5 21q-.825 0-1.412-.587T3 19V5q0-.825.588-1.412T5 3h6q.425 0 .713.288T12 4t-.288.713T11 5H5v14h14v-6q0-.425.288-.712T20 12t.713.288T21 13v6q0 .825-.587 1.413T19 21zM19 6.4L10.4 15q-.275.275-.7.275T9 15t-.275-.7t.275-.7L17.6 5H15q-.425 0-.712-.288T14 4t.288-.712T15 3h5q.425 0 .713.288T21 4v5q0 .425-.288.713T20 10t-.712-.288T19 9z"/></svg>',[C.EMAIL]:'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24"><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 22zm0-7q1.25 0 2.125-.875T15 12t-.875-2.125T12 9t-2.125.875T9 12t.875 2.125T12 15"/></svg>',[C.PHONE]:'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24"><path fill="currentColor" d="M19.95 21q-3.125 0-6.175-1.362t-5.55-3.863t-3.862-5.55T3 4.05q0-.45.3-.75t.75-.3H8.1q.35 0 .625.238t.325.562l.65 3.5q.05.4-.025.675T9.4 8.45L6.975 10.9q.5.925 1.187 1.787t1.513 1.663q.775.775 1.625 1.438T13.1 17l2.35-2.35q.225-.225.588-.337t.712-.063l3.45.7q.35.1.575.363T21 15.9v4.05q0 .45-.3.75t-.75.3M6.025 9l1.65-1.65L7.25 5H5.025q.125 1.025.35 2.025T6.025 9m8.95 8.95q.975.425 1.988.675T19 18.95v-2.2l-2.35-.475zm0 0"/></svg>',[C.SMS]:'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24"><path fill="currentColor" d="m6 18l-2.3 2.3q-.475.475-1.088.213T2 19.575V4q0-.825.588-1.412T4 2h16q.825 0 1.413.588T22 4v12q0 .825-.587 1.413T20 18zm-.85-2H20V4H4v13.125zM4 16V4zm4-5q.425 0 .713-.288T9 10t-.288-.712T8 9t-.712.288T7 10t.288.713T8 11m4 0q.425 0 .713-.288T13 10t-.288-.712T12 9t-.712.288T11 10t.288.713T12 11m4 0q.425 0 .713-.288T17 10t-.288-.712T16 9t-.712.288T15 10t.288.713T16 11"/></svg>',[C.WHATSAPP]:'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 256 258"><defs><linearGradient id="logosWhatsappIcon0" x1="50%" x2="50%" y1="100%" y2="0%"><stop offset="0%" stop-color="#1faf38"/><stop offset="100%" stop-color="#60d669"/></linearGradient><linearGradient id="logosWhatsappIcon1" x1="50%" x2="50%" y1="100%" y2="0%"><stop offset="0%" stop-color="#f9f9f9"/><stop offset="100%" stop-color="#fff"/></linearGradient></defs><path fill="url(#logosWhatsappIcon0)" d="M5.463 127.456c-.006 21.677 5.658 42.843 16.428 61.499L4.433 252.697l65.232-17.104a123 123 0 0 0 58.8 14.97h.054c67.815 0 123.018-55.183 123.047-123.01c.013-32.867-12.775-63.773-36.009-87.025c-23.23-23.25-54.125-36.061-87.043-36.076c-67.823 0-123.022 55.18-123.05 123.004"/><path fill="url(#logosWhatsappIcon1)" d="M1.07 127.416c-.007 22.457 5.86 44.38 17.014 63.704L0 257.147l67.571-17.717c18.618 10.151 39.58 15.503 60.91 15.511h.055c70.248 0 127.434-57.168 127.464-127.423c.012-34.048-13.236-66.065-37.3-90.15C194.633 13.286 162.633.014 128.536 0C58.276 0 1.099 57.16 1.071 127.416m40.24 60.376l-2.523-4.005c-10.606-16.864-16.204-36.352-16.196-56.363C22.614 69.029 70.138 21.52 128.576 21.52c28.3.012 54.896 11.044 74.9 31.06c20.003 20.018 31.01 46.628 31.003 74.93c-.026 58.395-47.551 105.91-105.943 105.91h-.042c-19.013-.01-37.66-5.116-53.922-14.765l-3.87-2.295l-40.098 10.513z"/><path fill="#fff" d="M96.678 74.148c-2.386-5.303-4.897-5.41-7.166-5.503c-1.858-.08-3.982-.074-6.104-.074c-2.124 0-5.575.799-8.492 3.984c-2.92 3.188-11.148 10.892-11.148 26.561s11.413 30.813 13.004 32.94c1.593 2.123 22.033 35.307 54.405 48.073c26.904 10.609 32.379 8.499 38.218 7.967c5.84-.53 18.844-7.702 21.497-15.139c2.655-7.436 2.655-13.81 1.859-15.142c-.796-1.327-2.92-2.124-6.105-3.716s-18.844-9.298-21.763-10.361c-2.92-1.062-5.043-1.592-7.167 1.597c-2.124 3.184-8.223 10.356-10.082 12.48c-1.857 2.129-3.716 2.394-6.9.801c-3.187-1.598-13.444-4.957-25.613-15.806c-9.468-8.442-15.86-18.867-17.718-22.056c-1.858-3.184-.199-4.91 1.398-6.497c1.431-1.427 3.186-3.719 4.78-5.578c1.588-1.86 2.118-3.187 3.18-5.311c1.063-2.126.531-3.986-.264-5.579c-.798-1.593-6.987-17.343-9.819-23.64"/></svg>',[C.MESSENGER]:'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 256 256"><defs><radialGradient id="logosMessenger0" cx="19.247%" cy="99.465%" r="108.96%" fx="19.247%" fy="99.465%"><stop offset="0%" stop-color="#09f"/><stop offset="60.975%" stop-color="#a033ff"/><stop offset="93.482%" stop-color="#ff5280"/><stop offset="100%" stop-color="#ff7061"/></radialGradient></defs><path fill="url(#logosMessenger0)" 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"/><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"/></svg>'},It=class{constructor(t,e,n){this.lightbox=t,this.captureAdImpression=e,this.captureAdClick=n,this.captionOn=!0,this.options={captionButtonOrder:8},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){t.on("uiRegister",()=>{t.ui.registerElement({name:"caption-toggle-button",title:"Toggle caption view",order:this.options.captionButtonOrder,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-caption"/><use class="pswp__icn-shadow" xlink:href="#pswp__icn-hide-caption"/><path id="pswp__icn-show-caption" d="M5 20q-.825 0-1.412-.587T3 18V6q0-.825.588-1.412T5 4h14q.825 0 1.413.588T21 6v12q0 .825-.587 1.413T19 20zm0-2h14V6H5zm2-3h3q.425 0 .713-.288T11 14v-.5q0-.225-.15-.375t-.375-.15h-.45q-.225 0-.375.15t-.15.375h-2v-3h2q0 .225.15.375t.375.15h.45q.225 0 .375-.15T11 10.5V10q0-.425-.288-.712T10 9H7q-.425 0-.712.288T6 10v4q0 .425.288.713T7 15m10-6h-3q-.425 0-.712.288T13 10v4q0 .425.288.713T14 15h3q.425 0 .713-.288T18 14v-.5q0-.225-.15-.375t-.375-.15h-.45q-.225 0-.375.15t-.15.375h-2v-3h2q0 .225.15.375t.375.15h.45q.225 0 .375-.15T18 10.5V10q0-.425-.288-.712T17 9M5 18V6z"/><path id="pswp__icn-hide-caption" style="display:none" d="m9.025 9l1.5 1.5H7.5v3h2q0-.225.15-.375t.375-.15h.45q.225 0 .375.15t.15.375v.5q0 .425-.288.713T10 15H7q-.425 0-.712-.288T6 14v-4q0-.425.288-.712T7 9zM21 6v10q0 .5-.325.763t-.7.262t-.675-.262T19 16V6H8.975q-.5 0-.75-.312T7.975 5t.25-.687t.75-.313H19q.825 0 1.413.588T21 6m-3 8q0 .225-.088.438t-.262.337L16.375 13.5h.125q0-.225.15-.375t.375-.15h.45q.225 0 .375.15t.15.375zm-1-5q.425 0 .713.288T18 10v.5q0 .225-.15.375t-.375.15h-.45q-.225 0-.375-.15t-.15-.375h-2v1.125l-1.5-1.5V10q0-.425.288-.712T14 9zM5 20q-.825 0-1.412-.587T3 18V6q0-.625.338-1.112t.862-.713L6.025 6H5v12h10.175L1.375 4.225q-.3-.3-.3-.712t.3-.713t.713-.3t.712.3l18.375 18.375q.3.3.3.713t-.3.712t-.712.3t-.713-.3L17.175 20z"/></svg>',onClick:()=>{this.toggleCaption(t)}}),t.ui.registerElement({name:"custom-caption",isButton:!1,appendTo:"root",html:'<div id="pswp-caption-container" class=" absolute bottom-0 w-full"></div>'})}),t.on("change",()=>{this.captionOn&&this.updateCaption(t)}),t.on("close",()=>{this.clearCaption()})}toggleCaption(t){this.captionOn?this.clearCaption():this.updateCaption(t),this.captionOn=!this.captionOn;const e=this.querySelector("#pswp__icn-show-caption"),n=this.querySelector("#pswp__icn-hide-caption");e&&(e.style.display=this.captionOn?"inline":"none"),n&&(n.style.display=this.captionOn?"none":"inline")}createCaptionHTML(t){const{id:e,type:n,caption:i,title:s,description:o,targetType:r,targetText:a,targetUrl:l}=t||{},c=Boolean(r)&&String(r)!==String(C.NONE),d=c?r:C.LINK;switch("ad"===n&&this.captureAdImpression&&this.captureAdImpression(e),n){case"image":case"video":return i?.length>0?`\n <div class=" w-full bg-black bg-opacity-50 p-4 text-gray-300">\n <h3 class=" text-center sm:text-lg">${kt(i)}</h3>\n </div>\n `:"";case"ad":return`\n <div class=" w-full bg-black/85 p-4 text-white">\n <div class=" mx-auto w-full max-w-2xl space-y-2 text-center">\n <h3 class=" text-center sm:text-lg">${kt(s)}</h3>\n <h4 class=" pb-2 text-center text-sm sm:text-base">${kt(o)}</h4>\n ${c?`<button\n class=" flex w-full items-center justify-center gap-3 rounded-md bg-white py-1 text-lg text-black caption-action-button"\n data-id="${kt(e)}"\n data-target-type="${kt(d)}"\n data-target-url="${kt(l)}">\n ${St[d]}\n ${kt(a)}\n </button>`:""}\n </div>\n </div>\n `;default:return""}}updateCaption(t){try{const e=this.getElementById("pswp-caption-container");if(!e)return;const n=t.currSlide?.data;e.innerHTML=this.createCaptionHTML(n);const i=e.querySelector(".caption-action-button");i&&i.addEventListener("click",t=>{const e=t.currentTarget.dataset.id,n=t.currentTarget.dataset.targetType,i=t.currentTarget.dataset.targetUrl;this.captureAdClick&&e&&this.captureAdClick(e,n,i)})}catch(e){console.error("Error rendering caption:",e)}}clearCaption(){const t=this.getElementById("pswp-caption-container");t&&(t.innerHTML="")}},Et=({contents:t=[],selectedIndex:e,onClick:n})=>{const i=u(null);v(()=>{i.current&&s(e)},[e,i.current]);const s=t=>{if(!i.current)return;const e=i.current,n=e.children;if(t<0||t>=n.length)return;const s=n[t],o=e.offsetWidth/2,r=s.offsetLeft+s.offsetWidth/2-o;e.scrollTo({left:r,behavior:"smooth"})};/* @__PURE__ */
2
+ return w("div",{ref:i,className:"scrollbar-hide flex h-28 w-auto items-center justify-center overflow-x-auto bg-black/50",style:{scrollBehavior:"smooth",userSelect:"none",whiteSpace:"nowrap"},children:t.map((t,i)=>/* @__PURE__ */w("button",{className:"relative mx-0.5 inline-block lg:mx-1.5",onClick:()=>((t,e)=>{n(e)})(0,i),children:[
3
+ /* @__PURE__ */w(Z,{wrapperClassName:h("h-16 w-24 rounded-md lg:h-20 lg:w-20",i===e&&"border-2 border-[#ff4800]"),src:t.thumbnailUrl,placeholderSrc:t.blurImageUrl,alt:t.caption}),t.type===I.VIDEO&&/* @__PURE__ */w("div",{className:"absolute top-0 left-0 flex size-full items-center justify-center opacity-75",children:/* @__PURE__ */w("svg",{xmlns:"http://www.w3.org/2000/svg",className:"size-6 text-white lg:size-9",viewBox:"0 0 24 24",children:/* @__PURE__ */w("path",{fill:"currentColor",d:"M8 17.175V6.825q0-.425.3-.713t.7-.287q.125 0 .263.037t.262.113l8.15 5.175q.225.15.338.375t.112.475t-.112.475t-.338.375l-8.15 5.175q-.125.075-.262.113T9 18.175q-.4 0-.7-.288t-.3-.712"})})}),t.type===I.AD&&/* @__PURE__ */w("div",{className:"absolute top-1 left-1 text-xs",children:"Ad"})]},`filmstrip-thumbnail-${i}`))})},Ct=class{constructor(t){this.lightbox=t,this.filmstripVisible=!0,this.options={filmstripButtonOrder:7},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){t.on("uiRegister",()=>{t.ui.registerElement({name:"filmstrip-toggle-button",title:"Toggle filmstrip view",order:this.options.filmstripButtonOrder,isButton:!0,html:'<svg aria-hidden="true" class="pswp__icn p-0.5" viewBox="0 0 24 24" id="pswp__icn-show-filmstrip"><use class="pswp__icn-shadow" xlink:href="#pswp__icn-show-filmstrip"/>\n <path\n 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\n 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"\n\n style="stroke-width:0.199771" />\n <path\n\n 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"\n\n style="stroke-width:0.199771" />\n <path\n\n 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"\n\n style="stroke-width:0.199771" />\n </svg>\n <svg aria-hidden="true" class="pswp__icn p-0.5" viewBox="0 0 24 24" id="pswp__icn-hide-filmstrip" style="display:none"><use class="pswp__icn-shadow" xlink:href="#pswp__icn-hide-filmstrip"/>\n <path\n 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 />\n <path\n\n 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"\n\n style="stroke-width:0.199771" />\n <path\n\n 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"\n\n style="stroke-width:0.199771" />\n <path\n\n 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"\n\n style="stroke-width:0.199771" />\n </svg>\n\n ',onClick:()=>{this.toggleFilmstrip()}}),t.ui.registerElement({name:"filmstrip",isButton:!1,appendTo:"root",html:'\n <div id="filmstrip-container" class="w-full absolute bottom-0">\n </div>\n '})}),t.on("change",()=>{this.filmstripVisible&&this.updateFilmstrip(t)}),t.on("close",()=>{this.cleanupFilmstrip()})}onThumbnailClcik(t){this.lightbox.pswp.goTo(t)}updateFilmstrip(t){const e=this.getElementById("filmstrip-container");if(!e)return;n(/* @__PURE__ */w(Et,{contents:t?.options?.dataSource?.items?.map(t=>({id:t.getAttribute("data-pswp-id"),type:t.getAttribute("data-pswp-type"),thumbnailUrl:t.getAttribute("data-pswp-thumbnail-url"),blurImageUrl:t.getAttribute("data-pswp-blur-image-url")||t.getAttribute("data-pswp-blurhash")})),selectedIndex:t.currSlide.index,onClick:t=>this.onThumbnailClcik(t)}),e);const i=this.getElementById("pswp-caption-container");i&&"7rem"!==i.style.bottom&&(i.style.bottom="7rem")}toggleFilmstrip(){this.filmstripVisible?this.cleanupFilmstrip():this.updateFilmstrip(this.lightbox.pswp),this.filmstripVisible=!this.filmstripVisible;const t=this.querySelector("#pswp__icn-show-filmstrip"),e=this.querySelector("#pswp__icn-hide-filmstrip");t&&(t.style.display=this.filmstripVisible?"inline":"none"),e&&(e.style.display=this.filmstripVisible?"none":"inline")}cleanupFilmstrip(){const t=this.getElementById("filmstrip-container"),e=this.getElementById("pswp-caption-container");e&&(e.style.bottom="0"),t&&n(null,t)}},Lt=class{constructor(t){this.lightbox=t,this.fullscreen=!1,this.options={fullScreenButtonOrder:7},t.on("init",()=>{this.initPswpEvents(t.pswp)})}initPswpEvents(t){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),document.querySelector("#pswp__icn-exit-fullscreen").style.display=this.fullscreen?"inline":"none",document.querySelector("#pswp__icn-fullscreen").style.display=this.fullscreen?"none":"inline"}},Nt=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),document.head.insertAdjacentHTML("beforeend",`<style>.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}</style>`),this.slideshowIsRunning=!1,this.slideshowTimerID=null,this.wakeLockIsRunning=!1,this.wakeLockSentinel=null,this.lightbox.on("init",()=>{this.init(this.lightbox.pswp)})}init(t){t.on("uiRegister",()=>{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()),document.querySelector("#pswp__icn-stop").style.display=this.slideshowIsRunning?"inline":"none",document.querySelector("#pswp__icn-play").style.display=this.slideshowIsRunning?"none":"inline",document.querySelector(".pswp__progress-bar").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=document.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 n=e.duration,i=e.currentTime;return isNaN(n)||isNaN(i)?this.options.defaultDelayMs:1e3*(n-i)}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=document.querySelector(".pswp__progress-bar");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)}},At={videoAttributes:{controls:"",playsinline:"",muted:"",preload:"auto"},autoplay:!0,preventDragOffset:40};function Mt(t){return t&&t.data&&"video"===t.data.type}var Bt=class{constructor(t,e){this.options=e,this.initLightboxEvents(t),t.on("init",()=>{this.initPswpEvents(t.pswp)})}initLightboxEvents(t){t.on("contentLoad",this.onContentLoad.bind(this)),t.on("contentDestroy",this.onContentDestroy.bind(this)),t.on("contentActivate",this.onContentActivate.bind(this)),t.on("contentDeactivate",this.onContentDeactivate.bind(this)),t.on("contentAppend",this.onContentAppend.bind(this)),t.on("contentResize",this.onContentResize.bind(this)),t.addFilter("isKeepingPlaceholder",this.isKeepingPlaceholder.bind(this)),t.addFilter("isContentZoomable",this.isContentZoomable.bind(this)),t.addFilter("useContentPlaceholder",this.useContentPlaceholder.bind(this)),t.addFilter("domItemData",(t,e,n)=>("video"===t.type&&n&&(n.dataset.pswpVideoSources?t.videoSources=JSON.parse(n.dataset.pswpVideoSources):n.dataset.pswpVideoSrc?t.videoSrc=n.dataset.pswpVideoSrc:t.videoSrc=n.href),t))}initPswpEvents(t){t.on("pointerDown",e=>{const n=t.currSlide;if(Mt(n)&&this.options.preventDragOffset){const i=e.originalEvent;if("pointerdown"===i.type){const s=Math.ceil(n.height*n.currZoomLevel)+n.bounds.center.y,o=i.pageY-t.offset.y;o>s-this.options.preventDragOffset&&o<s&&e.preventDefault()}}}),t.on("appendHeavy",t=>{Mt(t.slide)&&!t.slide.isActive&&t.preventDefault()}),t.on("close",()=>{Mt(t.currSlide.content)&&this.pauseVideo(t.currSlide.content)})}onContentDestroy({content:t}){Mt(t)&&t._videoPosterImg&&(t._videoPosterImg.onload=t._videoPosterImg.onerror=null,t._videoPosterImg=null)}onContentResize(t){if(Mt(t.content)){t.preventDefault();const e=t.width,n=t.height,i=t.content;if(i.element&&(i.element.style.width=`${e}px`,i.element.style.height=`${n}px`),i.slide&&i.slide.placeholder){const t=i.slide.placeholder.element.style;t.transform="none",t.width=`${e}px`,t.height=`${n}px`}}}isKeepingPlaceholder(t,e){return!Mt(e)&&t}isContentZoomable(t,e){return!Mt(e)&&t}onContentActivate({content:t}){Mt(t)&&this.options.autoplay&&this.playVideo(t)}onContentDeactivate({content:t}){Mt(t)&&this.pauseVideo(t)}onContentAppend(t){Mt(t.content)&&(t.preventDefault(),t.content.isAttached=!0,t.content.appendImage())}onContentLoad(t){const e=t.content;if(Mt(t.content)&&(t.preventDefault(),!e.element)){if(e.state="loading",e.type="video",e.element=document.createElement("video"),this.options.videoAttributes)for(let t in this.options.videoAttributes)e.element.setAttribute(t,this.options.videoAttributes[t]||"");e.element.setAttribute("poster",e.data.msrc),this.preloadVideoPoster(e,e.data.msrc),e.element.style.position="relative",e.element.style.left=0,e.element.style.top=0,e.data.videoSources?e.data.videoSources.forEach(t=>{let n=document.createElement("source");n.src=t.src,n.type=t.type,e.element.appendChild(n)}):e.data.videoSrc&&(e.element.src=e.data.videoSrc)}}preloadVideoPoster(t,e){!t._videoPosterImg&&e&&(t._videoPosterImg=new Image,t._videoPosterImg.src=e,t._videoPosterImg.complete?t.onLoaded():t._videoPosterImg.onload=t._videoPosterImg.onerror=()=>{t.onLoaded()})}playVideo(t){t.element&&t.element.play()}pauseVideo(t){t.element&&t.element.pause()}useContentPlaceholder(t,e){return!!Mt(e)||t}},zt=class{constructor(t,e={}){new Bt(t,{...At,...e})}},Vt=({open:t,ad:e,onClose:n,captureAdClick:i})=>{const s=Boolean(e?.targetType&&e.targetType!==C.NONE);/* @__PURE__ */
4
+ return w(A,{open:Boolean(t&&e),onOpenChange:t=>!t&&n?.(),children:/* @__PURE__ */w(D,{className:"border-none p-0",children:[/* @__PURE__ */w(O,{className:"hidden",children:[/* @__PURE__ */w(W,{children:e?.title}),/* @__PURE__ */w(U,{children:e?.description})]}),/* @__PURE__ */w("div",{className:"flex max-w-2xl flex-col overflow-hidden",children:[
5
+ /* @__PURE__ */w("img",{className:"h-auto w-full object-contain sm:max-h-96",src:e?.imageUrl,alt:"Image not found"}),
6
+ /* @__PURE__ */w("div",{className:"flex flex-col gap-2 p-3",children:[/* @__PURE__ */w(z,{variant:"h4",align:"center",lines:2,children:e?.title}),/* @__PURE__ */w(z,{variant:"body3",color:"secondary",align:"center",lines:4,children:e?.description})]}),s&&/* @__PURE__ */w(G,{fullWidth:!0,className:"rounded-none",onClick:()=>{i?.(e?._id,e?.targetType??C.LINK,e?.targetUrl),n?.()},iconName:k[e?.targetType]??k[C.LINK],children:e?.targetText})]})]})})},Rt=({style:t,content:e,curateLink:n,onAdClick:i})=>{const{captureAdImpression:s,captureAdEngagement:o,captureAdClick:r}=B(),a=Boolean(n&&i);/* @__PURE__ */
7
+ return w("div",{style:t,className:"group relative mb-1 overflow-hidden rounded",children:[/* @__PURE__ */w(Q,{className:"size-full",threshold:.8,triggerOnce:!0,onChange:t=>{t&&s(e._id)},onClick:()=>o(e._id),children:/* @__PURE__ */w(F,{url:e.src||e.imageUrl,thumbnailUrl:e.src||e.imageUrl,blurhash:e.blurhash,alt:e.caption,onClick:a?i:void 0,pswpData:{id:e._id,type:I.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}})}),/* @__PURE__ */w("div",{className:"transition-opacity duration-500 group-hover:opacity-100 sm:opacity-0",children:/* @__PURE__ */w("div",{className:"text-foreground bg-background bg-opacity-75 absolute bottom-0 w-full flex-col items-center justify-between sm:flex sm:flex-row",children:[/* @__PURE__ */w("div",{className:"py-2",children:/* @__PURE__ */w("h3",{className:"text-foreground line-clamp-2 px-2 text-sm font-medium sm:ml-3 sm:line-clamp-1 sm:p-0",children:e.title})}),e?.targetType!==C.NONE&&/* @__PURE__ */w(G,{immutable:!0,className:"w-full rounded-t-none py-1 text-nowrap sm:w-auto sm:rounded-t-none sm:rounded-bl-none sm:py-2",onClick:()=>{a?i?.():r(e._id,e.targetType,e.targetUrl)},iconName:k[e?.targetType??C.LINK],children:e?.targetText})]})})]})},Ot=({style:t,gamConfig:e,slotIndex:n,eventId:i,organizationId:s})=>{const o=u(null),r=u(null),{trackGamAnalytics:a}=B(),l=`gam-slot-${i??"ev"}-${n}`,c=Math.max(1,Math.round(t?.width||e.sizes[0]?.[0]||300)),d=Math.max(1,Math.round(t?.height||e.sizes[0]?.[1]||250));return v(()=>{let t=!1,n=null,p=null,h=null,u=null;return(async()=>{await V(),!t&&o.current&&window.googletag.cmd.push(()=>{if(t)return;H(l);const m=[[c,d],...e.sizes],g=window.googletag.defineSlot(e.adUnitPath,m,l)?.addService(window.googletag.pubads());if(!g)return;r.current=g,p=window.googletag.pubads(),i?g.setConfig({targeting:{qrati_event:i,...e.categories.length>0?{qrati_category:e.categories}:{}}}):e.categories.length>0&&g.setConfig({targeting:{qrati_category:e.categories}}),h=t=>{t.slot===g&&a({eventId:i,organizationId:s,type:q.GAM_IMPRESSION,creativeId:String(t.creativeId??""),lineItemId:String(t.lineItemId??""),advertiserId:String(t.advertiserId??""),isEmpty:t.isEmpty??!1})},p.addEventListener("slotRenderEnded",h),u=t=>{t.slot===g&&a({eventId:i,organizationId:s,type:q.GAM_VIEWABLE})},p.addEventListener("impressionViewable",u);const w=o.current;w&&(n=M({container:w,onClick:()=>{a({eventId:i,organizationId:s,type:q.GAM_CLICK})}}),P(),window.googletag.display(l))})})(),()=>{t=!0,n?.(),p&&"function"==typeof p.removeEventListener&&(h&&p.removeEventListener("slotRenderEnded",h),u&&p.removeEventListener("impressionViewable",u));const e=r.current;r.current=null,e&&window.googletag?.cmd?.push(()=>{window.googletag.destroySlots([e])})}},[d,c,i,e.adUnitPath,e.categories,s,l]),/* @__PURE__ */w("div",{style:{width:c,height:d},className:"relative overflow-hidden rounded bg-neutral-100 dark:bg-neutral-800","data-gam-slot-index":n,children:/* @__PURE__ */w("div",{id:l,ref:o,style:{width:c,height:d},className:"gam-ad-slot"})})},Pt=e(null),$t=()=>{const t=c(Pt);if(!t)throw new Error("Popover components must be used within a Popover");return t},Dt=({children:e,className:n,open:i,onOpenChange:s})=>{const[o,r]=l(!1),a="boolean"==typeof i,c=a?i:o,d=t(),p=`popover-trigger-${d}`,m=`popover-content-${d}`,g=u(null);/* @__PURE__ */
8
+ return w(Pt.Provider,{value:{isOpen:c,setIsOpen:t=>{a||r(t),s?.(t)},triggerId:p,contentId:m,triggerRef:g},children:/* @__PURE__ */w("div",{"data-slot":"popover",className:h("relative inline-block",n),children:e})})},Ht=({children:t,asChild:e,className:n,onClick:i,...s})=>{const{isOpen:o,setIsOpen:r,triggerId:a,contentId:l,triggerRef:c}=$t();if(v(()=>{if(!e)return;const t=document.getElementById(a);return c.current=t,()=>{c.current===t&&(c.current=null)}},[e,a,c]),e){const e=Array.isArray(t)?t[0]:t;if(e&&e.type){const t=e.props?.className;return p(e,{id:a,className:n?t?`${t} ${n}`:n:t,"aria-haspopup":"dialog","aria-expanded":o,"aria-controls":o?l:void 0,onClick:t=>{r(!o),e.props?.onClick?.(t)},"data-state":o?"open":"closed"})}}/* @__PURE__ */
9
+ return w("button",{ref:c,id:a,type:"button","aria-haspopup":"dialog","aria-expanded":o,"aria-controls":o?l:void 0,"data-slot":"popover-trigger","data-state":o?"open":"closed",className:n,onClick:t=>{r(!o),i?.(t)},...s,children:t})},Ft=({children:t,className:e,align:n="center",side:i="top",sideOffset:s=4,...o})=>{const{isOpen:r,setIsOpen:c,contentId:d,triggerRef:p}=$t(),{organization:m,portalContainer:f}=E(),b=u(null),[T,x]=l(null);if(a(()=>{if(!r)return;const t=()=>{if(!p.current||!b.current)return;const t=p.current.getBoundingClientRect(),e=b.current.getBoundingClientRect();let o=t.left,r=t.bottom+s;"center"===n&&(o=t.left+t.width/2-e.width/2),"end"===n&&(o=t.right-e.width),"top"===i&&(r=t.top-e.height-s),"left"===i&&(o=t.left-e.width-s,r=t.top+t.height/2-e.height/2),"right"===i&&(o=t.right+s,r=t.top+t.height/2-e.height/2),"bottom"===i&&(r=t.bottom+s),x({top:r,left:o})},e=requestAnimationFrame(t);return window.addEventListener("resize",t),window.addEventListener("scroll",t,!0),()=>{cancelAnimationFrame(e),window.removeEventListener("resize",t),window.removeEventListener("scroll",t,!0)}},[n,r,i,s,p]),v(()=>{if(!r)return;const t=t=>{const e=t.target;b.current&&!b.current.contains(e)&&p.current&&!p.current.contains(e)&&c(!1)},e=t=>{"Escape"===t.key&&(c(!1),p.current?.focus())},n=window.setTimeout(()=>{document.addEventListener("mousedown",t)},0);return document.addEventListener("keydown",e),()=>{window.clearTimeout(n),document.removeEventListener("mousedown",t),document.removeEventListener("keydown",e)}},[r,c,p]),!r)return null;const _=/* @__PURE__ */w("div",{ref:b,id:d,role:"dialog","aria-modal":"false","data-state":r?"open":"closed",className:h("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,...g(m)},...o,children:t});return"undefined"!=typeof document?y(_,f??document.body):_},Ut=({eventId:t,contentId:e,emojis:n=[],counts:i={},userReaction:s})=>{const{user:o,props:r,organization:a}=E(),c=r?.loginUrl,{handleReactionClick:d}=(()=>{const t=T(),{props:e,user:n}=E(),i=e?.organizationId;return{handleReactionClick:async(e,s,o)=>{if(!e||!s||!o)return!1;if(!n)return R.error("Please login to react"),!1;const r=[_.CONTENTS_BY_EVENT(e)],a=t.getQueriesData({queryKey:r});t.setQueriesData({queryKey:r},t=>t?.pages&&Array.isArray(t.pages)?{...t,pages:t.pages.map(t=>t.data?{...t,data:t.data.map(t=>{if(t._id===s){const e={...t.reactionCounts};return t.userReaction&&t.userReaction!==o&&(e[t.userReaction]=Math.max(0,(e[t.userReaction]??1)-1)),t.userReaction===o?(e[o]=Math.max(0,(e[o]??1)-1),{...t,reactionCounts:e,userReaction:void 0}):(e[o]=(e[o]??0)+1,{...t,reactionCounts:e,userReaction:o})}return t})}:t)}:t);try{return await x.post(S.UPDATE_REACTION,{json:{eventId:e,contentId:s,reaction:o},headers:{"x-org-id":i,Authorization:`Bearer ${n.token}`}}),!0}catch(l){return a.forEach(([e,n])=>{t.setQueryData(e,n)}),R.error("Failed to add reaction"),console.error("Error handling reaction click:",l),!1}}}})(),[p,u]=l(!1),[g,f]=l(!1),y=Object.values(i).reduce((t,e)=>t+e,0);/* @__PURE__ */
10
+ return w(Dt,{open:p,onOpenChange:u,children:[/* @__PURE__ */w(Ht,{children:/* @__PURE__ */w("div",{className:h("bg-background/50 flex items-center gap-1 rounded px-2 py-1 backdrop-blur-sm transition-transform active:scale-90 sm:gap-2 sm:py-0",s&&"ring-primary ring-1"),children:[(n||[]).slice().sort((t,e)=>(i[e]||0)-(i[t]||0)).slice(0,1).map(t=>/* @__PURE__ */w("span",{className:"text-sm sm:text-lg",children:s||t},`${e}-${t}-1`)),y>0&&/* @__PURE__ */w("span",{className:"text-xs font-bold sm:text-sm",children:y||0})]})}),/* @__PURE__ */w(Ft,{side:"top",align:"end",children:[o?null:/* @__PURE__ */w("div",a?.customAuth?{className:"p-2 font-semibold",children:["Please"," ",
11
+ /* @__PURE__ */w("a",{className:"text-info underline",href:c,children:"Login"})," ","to react"]}:{className:"p-2 font-semibold",children:["Please"," ",
12
+ /* @__PURE__ */w(m,{className:"text-info underline",to:b.LOGIN,children:"Login"})," ","to react"]}),o&&/* @__PURE__ */w("div",{className:"flex gap-1 p-2",children:n.map(n=>{const o=s===n;/* @__PURE__ */
13
+ return w("div",{className:"flex flex-col items-center",children:[/* @__PURE__ */w("span",{className:"text-xs font-medium",children:i[n]||0}),/* @__PURE__ */w("button",{type:"button",disabled:g,className:h("text-3xl transition-transform disabled:opacity-50",o?"scale-125":"hover:scale-110",g&&"cursor-not-allowed"),onClick:()=>(async n=>{!g&&d&&(f(!0),await d(t,e,n)&&u(!1),f(!1))})(n),children:n})]},`${e}-${n}-2`)})})]})]})},jt=({event:t={},content:e,curateLink:n})=>t.engagementStyle===N.CONTEST?/* @__PURE__ */w("button",{className:"bg-background/75 flex items-center gap-1 rounded px-2 py-1",children:[/* @__PURE__ */w(K,{name:"material-symbols:star-half-rounded",className:"size-4"}),/* @__PURE__ */w("span",{className:"text-xs font-semibold",children:parseFloat(String(e.score||0)).toFixed(1)})]}):t.engagementStyle===N.REACTION&&t.reactionEmojis?.length?/* @__PURE__ */w(Ut,{eventId:t?._id,contentId:e._id,emojis:t?.reactionEmojis,engagementStyle:t?.engagementStyle,counts:e.reactionCounts||{},userReaction:e.userReaction}):null,Wt=({content:t})=>/* @__PURE__ */w("div",{className:"w-full space-y-3 px-3 pb-3",children:[t?.caption&&/* @__PURE__ */w("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__ */w("div",{role:"note",title:t?.caption,className:"lg:text-md line-clamp-1 text-xs text-white lg:font-medium",children:t?.caption})}),/* @__PURE__ */w("div",{className:"flex items-center justify-between",children:/* @__PURE__ */w("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})})]}),Gt=({event:t,content:e,style:n,timestampField:i,curateLink:s,onChangeFaceUrl:o,hideControls:r})=>{const{organization:a}=E(),l=`content-${e._id}`,c=((t,e)=>{if(!t||!e)return null;const n=e?.[t];if(!n)return null;try{const t=new Date(String(n)),e=/* @__PURE__ */new Date,i=t.getFullYear()===e.getFullYear(),s={weekday:"long",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0};return i||(s.year="numeric"),t.toLocaleString("en-US",s).replace(","," •")}catch{return null}})(i,e);/* @__PURE__ */
14
+ return w("div",{id:l,style:n,className:"group relative mb-1 overflow-hidden rounded",children:[/* @__PURE__ */w(F,{url:e.src,alt:e.caption,blurhash:e.blurhash,thumbnailUrl:e.thumbnailUrl,curateLink:s,pswpData:{id:e._id,type:I.IMAGE,hash:e._id,width:e.width,height:e.height,thumbnailUrl:e.thumbnailUrl,blurhash:e.blurhash,caption:e.caption,contentSummary:JSON.stringify(e.contentSummary)}}),!r&&/* @__PURE__ */w(d,{children:[c&&/* @__PURE__ */w("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}),a?.integrationSettings?.showQuickSearch&&(e.faces?.length??0)>0&&/* @__PURE__ */w("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:()=>{o?.(e?.url);const t=document.getElementById("media-gallery-container");t&&t.scrollIntoView({behavior:"smooth",block:"start"})},children:/* @__PURE__ */w(K,{color:"a11y",name:"material-symbols:familiar-face-and-zone-outline-rounded"})}),
15
+ /* @__PURE__ */w("div",{className:"",children:[/* @__PURE__ */w("div",{className:"absolute bottom-0 w-full rounded-b",children:/* @__PURE__ */w(Wt,{content:e})}),/* @__PURE__ */w("div",{className:"absolute right-2 bottom-2",children:/* @__PURE__ */w(jt,{event:t,content:e,curateLink:s})})]})]})]})},Kt=({content:t,style:e,event:n,timestampField:i,curateLink:s,hideControls:o})=>{const r=((t,e)=>{if(!t||!e)return null;const n=e?.[t];if(!n)return null;try{const t=new Date(String(n)),e=/* @__PURE__ */new Date,i=t.getFullYear()===e.getFullYear(),s={weekday:"long",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0};return i||(s.year="numeric"),t.toLocaleString("en-US",s).replace(","," •")}catch{return null}})(i,t);/* @__PURE__ */
16
+ return w("div",{id:`content-${t._id}`,className:"group relative mb-1 overflow-hidden rounded",style:e,children:[/* @__PURE__ */w(F,{url:t.src??t.url,thumbnailUrl:t.thumbnailUrl,blurhash:t.blurhash,alt:t.caption,curateLink:s,pswpData:{id:t._id,type:I.VIDEO,hash:t._id,width:t.width,height:t.height,thumbnailUrl:t.thumbnailUrl,blurhash:t.blurhash,caption:t.caption}}),!o&&/* @__PURE__ */w("div",{className:"transition-opacity duration-500",children:[r&&/* @__PURE__ */w("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}),
17
+ /* @__PURE__ */w("div",{className:"absolute bottom-0 w-full rounded-b",children:/* @__PURE__ */w(Wt,{content:t})}),
18
+ /* @__PURE__ */w("div",{className:"absolute right-2 bottom-2",children:/* @__PURE__ */w(jt,{event:n,content:t,curateLink:s})})]})]})},Yt=({event:t,contents:e=[],gamConfig:n,singleColumnMode:i,kioskMode:s,timestampField:o,curateLink:a,onChangeFaceUrl:c})=>{const p=u(null),m=u(null),g=r(()=>`gallery-${t?._id??""}`,[t]),{captureAdImpression:f,captureAdClick:y}=B(),{organization:b,portalContainer:T}=E(),x=b?._id,[_,q]=l(null);v(()=>{const t=m.current;if(!a&&t){const e=new $({gallery:t,children:"a",counter:!1,bgOpacity:1,wheelToZoom:!0,pinchToClose:!0,zoom:!1,pswpModule:j,appendToEl:T??document.body});p.current=e,new zt(e),new Ct(e),new qt(e),new It(e,f,y),new Lt(e),new Nt(e),b?.integrationSettings?.showAIDescription&&new xt(e,{width:"400px",height:"40%"}),e.init()}return()=>{p.current?.destroy?.(),p.current=null}},[t?.galleryLayout,a,y,f,g,b]);const k=r(()=>{switch(t?.galleryLayout){case L.ROW:return mt;case L.COLUMN:return yt;case L.MASONRY:return bt;default:return mt}},[i,t?.galleryLayout]);/* @__PURE__ */
19
+ return w(d,{children:[/* @__PURE__ */w("div",{id:g,ref:m,className:h(i?"w-full lg:w-1/3":"w-full"),children:/* @__PURE__ */w(k,{spacing:4,rowConstraints:t=>{const e={minPhotos:1,maxPhotos:4,singleRowMaxHeight:400};return i&&(e.minPhotos=1,e.maxPhotos=t<400?2:t<800?3:4),e},columns:t=>i?1:t<400?2:t<800?3:4,photos:e.map(t=>({src:t.type===I.IMAGE||t.type===I.VIDEO?t.url:t.type===I.GAM_AD?"":t.imageUrl,width:t.dimension?.width,height:t.dimension?.height,...t})),render:{container:({ref:t,className:e,children:n})=>/* @__PURE__ */w("div",{ref:t,className:e??"",children:n}),photo:(e,{photo:i,width:r,height:l,index:d})=>{const p=i;let h=null;switch(p.type){case I.IMAGE:h=Gt;break;case I.VIDEO:h=Kt;break;case I.AD:h=Rt;break;case I.GAM_AD:return n?/* @__PURE__ */w(Ot,{style:{width:r,height:l},gamConfig:n,slotIndex:p.slotIndex??d,eventId:t?._id,organizationId:x},`${p._id??d}-${d}`):null;default:h=null}return h&&/* @__PURE__ */w(h,{style:{width:r,height:l},event:t,content:p,timestampField:o,onAdClick:a?()=>q(p):void 0,hideControls:s,curateLink:a?`${a}/${p._id}`:null,onChangeFaceUrl:c},`${p._id??d}-${d}`)}}})}),/* @__PURE__ */w(Vt,{open:Boolean(_),ad:_,onClose:()=>q(null),captureAdClick:y})]})};export{Yt as default};
@@ -1 +1 @@
1
- import{H as e,j as n,r as t,v as r,z as o}from"./19c52mJB.js";import{t as a}from"./CNGkJRCP.js";var i=(n,o,i)=>{e(/* @__PURE__ */r(t,{children:/* @__PURE__ */r(a,{event:n,onExplore:i})}),o)},s=({events:e,apiKey:t,onExplore:a,logoUrl:s})=>{const l=n(null),c=n(null);return o(()=>{if(l.current&&!c.current)return(async()=>{const{setOptions:n,importLibrary:r}=await import("./CjmNvKgB.js");n({key:t,v:"weekly"}),await Promise.all([r("maps"),r("marker")]);const o=window.google.maps;if(!l.current)return;const d=new o.Map(l.current,{mapId:"DEMO_MAP_ID",renderingType:"VECTOR",mapTypeId:"roadmap",center:{lat:20,lng:0},zoom:2,mapTypeControl:!1,streetViewControl:!1});o.event.addListenerOnce(d,"idle",()=>{d.getRenderingType?.()!==o.RenderingType?.VECTOR&&console.warn("Google Maps fell back to raster rendering; globe view is unavailable in raster mode.")}),c.current=d;const p=e.filter(e=>"number"==typeof e.location?.x&&"number"==typeof e.location?.y);if(0===p.length)return;const m=new o.LatLngBounds,u=new o.InfoWindow({maxWidth:200});for(const e of p){const n=e.location.x,t={lat:e.location.y,lng:n};m.extend(t);const r=document.createElement("div");if(r.style.cssText="\n width: 36px; height: 36px; cursor: pointer;\n background: var(--primary, #ff4800);\n border-radius: 50% 50% 50% 0;\n transform: rotate(-45deg);\n border: 2px solid white;\n box-shadow: 0 2px 8px rgba(0,0,0,0.3);\n display: flex; align-items: center; justify-content: center; overflow: hidden;\n ",s){const e=document.createElement("img");e.src=s,e.style.cssText="width: 24px; height: 24px; border-radius: 50%; object-fit: cover; transform: rotate(45deg);",r.appendChild(e)}const l=new o.marker.AdvancedMarkerElement({map:d,position:t,content:r,gmpClickable:!0});l.addListener("click",()=>{const n=document.createElement("div");i(e,n,a),u.close(),u.setContent(n),u.open(d,l)})}d.fitBounds(m)})(),()=>{c.current=null}},[t]),/* @__PURE__ */r("div",{ref:l,class:"size-full"})};export{s as default};
1
+ import{H as e,j as n,r as t,v as r,z as o}from"./MZuQhFbV.js";import{t as a}from"./Cy3iV9XH.js";var i=(n,o,i)=>{e(/* @__PURE__ */r(t,{children:/* @__PURE__ */r(a,{event:n,onExplore:i})}),o)},s=({events:e,apiKey:t,onExplore:a,logoUrl:s})=>{const l=n(null),c=n(null);return o(()=>{if(l.current&&!c.current)return(async()=>{const{setOptions:n,importLibrary:r}=await import("./CjmNvKgB.js");n({key:t,v:"weekly"}),await Promise.all([r("maps"),r("marker")]);const o=window.google.maps;if(!l.current)return;const d=new o.Map(l.current,{mapId:"DEMO_MAP_ID",renderingType:"VECTOR",mapTypeId:"roadmap",center:{lat:20,lng:0},zoom:2,mapTypeControl:!1,streetViewControl:!1});o.event.addListenerOnce(d,"idle",()=>{d.getRenderingType?.()!==o.RenderingType?.VECTOR&&console.warn("Google Maps fell back to raster rendering; globe view is unavailable in raster mode.")}),c.current=d;const p=e.filter(e=>"number"==typeof e.location?.x&&"number"==typeof e.location?.y);if(0===p.length)return;const m=new o.LatLngBounds,u=new o.InfoWindow({maxWidth:200});for(const e of p){const n=e.location.x,t={lat:e.location.y,lng:n};m.extend(t);const r=document.createElement("div");if(r.style.cssText="\n width: 36px; height: 36px; cursor: pointer;\n background: var(--primary, #ff4800);\n border-radius: 50% 50% 50% 0;\n transform: rotate(-45deg);\n border: 2px solid white;\n box-shadow: 0 2px 8px rgba(0,0,0,0.3);\n display: flex; align-items: center; justify-content: center; overflow: hidden;\n ",s){const e=document.createElement("img");e.src=s,e.style.cssText="width: 24px; height: 24px; border-radius: 50%; object-fit: cover; transform: rotate(45deg);",r.appendChild(e)}const l=new o.marker.AdvancedMarkerElement({map:d,position:t,content:r,gmpClickable:!0});l.addListener("click",()=>{const n=document.createElement("div");i(e,n,a),u.close(),u.setContent(n),u.open(d,l)})}d.fitBounds(m)})(),()=>{c.current=null}},[t]),/* @__PURE__ */r("div",{ref:l,class:"size-full"})};export{s as default};
@@ -1,3 +1,3 @@
1
- import{a as e}from"./CsohJ1Yu.js";import{H as t,M as r,P as n,j as o,r as l,v as i,z as s}from"./19c52mJB.js";import{E as c,I as a}from"./t1REK11Z.js";import{n as u}from"./BQBx6JI7.js";import{t as d}from"./CNGkJRCP.js";import{t as f}from"./BHwNoqYe.js";var m=[[90,-180],[-90,180]],p=[0,0],y=new u,h=e=>e||"#fb8500",g=({folderId:u,onExplore:g,logoUrl:x})=>{const b=o(null),v=o(null),w=o(null),L=o(null),z=o(null),B=o(null),j=o(null),k=o(!1),O=o(u??null),T=o(null),C=o(!1),S=o(()=>{}),I=o(!1),F=r(()=>(()=>{try{const e=sessionStorage.getItem(c);if(!e)return null;const t=JSON.parse(e);if("number"==typeof t?.center?.lat&&"number"==typeof t?.center?.lng&&"number"==typeof t?.zoom)return t}catch{}return null})(),[]),[Z,E]=n(!0),[N,$]=n(!1),{isFolderViewEnabled:A,activeFolderId:M,visibleEvents:R,visibleFolders:V,folderFeatureCollection:q,breadcrumb:J,isBusy:G,setActiveFolderId:H,goBack:P,activeFolder:W,folderBounds:_}=f({folderId:u});O.current=M,T.current=W,C.current=A,S.current=H;const U=()=>{const e=v.current,t=w.current;if(!e||!N||!t)return;const r=M??null,n=F?.folderId??null;if(!I.current&&F&&r===n)return void(I.current=!0);let o=null;if(_){const[e,r,n,l]=_;o=t.latLngBounds([[r,e],[l,n]])}o||(o=((e,t)=>{const r=e.latLngBounds([]);for(const n of t)"number"==typeof n.location?.x&&"number"==typeof n.location?.y&&r.extend([n.location.y,n.location.x]);return r.isValid()?r:null})(t,R)),o&&(k.current=!0,e.fitBounds(o,{paddingTopLeft:[12,88],paddingBottomRight:[12,24],maxZoom:14}),I.current=!0)};return s(()=>{if(!b.current||v.current)return;let t;return(async()=>{try{const r=await import("./CiA4qgsY.js").then(t=>/* @__PURE__ */e(t.default,1));"undefined"!=typeof window&&(window.L=r),await Promise.all([import("./OQ2IC54N.js").then(t=>/* @__PURE__ */e(t.default,1)),import("./BJ85RnFv.js")]);const n=window.L??r,o=r.latLngBounds(m);if(!b.current)return;const l=r.map(b.current,{center:F?.center?[F.center.lat??p[0],F.center.lng??p[1]]:p,zoom:F?.zoom??3,minZoom:3,zoomControl:!0,worldCopyJump:!1,maxBounds:o,maxBoundsViscosity:1});r.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:"&copy; OpenStreetMap contributors",maxZoom:19,noWrap:!0}).addTo(l);const i="function"==typeof n.markerClusterGroup?n.markerClusterGroup({chunkedLoading:!0,showCoverageOnHover:!1,spiderfyOnMaxZoom:!0,maxClusterRadius:48,zoomToBoundsOnClick:!1}):r.layerGroup(),s=e=>{const t=e?.layer;t&&(C.current?t.spiderfy?.():t.zoomToBounds?.())},a="function"==typeof n.heatLayer?n.heatLayer([],{radius:30,blur:30,maxZoom:10,minOpacity:.35}):null;a?.addTo(l),i.addTo(l);const u=()=>{j.current&&clearTimeout(j.current),j.current=setTimeout(()=>{try{sessionStorage.setItem(c,JSON.stringify({center:l.getCenter(),zoom:l.getZoom(),folderId:O.current}))}catch{}},250)},d=()=>{if(k.current)return void(k.current=!1);if(!C.current)return;const e=T.current;if(!e?._id)return;const t=((e,t)=>{if(!t?.length)return null;const r=e.latLngBounds([]);for(const n of t)"number"==typeof n?.x&&"number"==typeof n?.y&&r.extend([n.y,n.x]);return r.isValid()?r:null})(n,e.boundary);if(!t)return;const r=l.getBoundsZoom(t,!1);l.getZoom()>=r-1||S.current(e.parentFolderId??null)};l.on("zoomend",u),l.on("moveend",u),l.on("zoomend",d),i.on?.("clusterclick",s),v.current=l,w.current=n,z.current=i,B.current=a;const f=()=>{l.invalidateSize(!1)};let y;"undefined"!=typeof ResizeObserver&&b.current&&(y=new ResizeObserver(f),y.observe(b.current)),requestAnimationFrame(f),$(!0),E(!1),t=()=>{y?.disconnect(),j.current&&(clearTimeout(j.current),j.current=null),l.off("zoomend",u),l.off("moveend",u),l.off("zoomend",d),i.off?.("clusterclick",s),l.remove(),w.current=null,v.current=null,L.current=null,z.current=null,B.current=null}}finally{E(!1)}})(),()=>{t?.()}},[F]),s(()=>{I.current=!1},[M]),s(()=>{if(!v.current||!N)return;const e=v.current,r=w.current;if(!r)return;B.current&&(A?(B.current.setLatLngs?.([]),e.hasLayer(B.current)&&e.removeLayer(B.current)):e.hasLayer(B.current)||B.current.addTo(e)),L.current&&(e.removeLayer(L.current),L.current=null),z.current?.clearLayers?.(),q.features.length>0&&(L.current=r.geoJSON(q,{style:e=>{const t=h(e?.properties?.color);return{color:t,weight:2,opacity:1,fillColor:t,fillOpacity:.22}},onEachFeature:(t,r)=>{const n=t.properties??{},o=String(n.name??"Folder"),l=h(n.color);r.bindTooltip(`<div style="font-size:12px;font-weight:700;color:${l};white-space:nowrap;">${o}</div>`,{permanent:!0,direction:"center",className:"qrati-folder-label",opacity:1}),r.on("click",()=>{const t=n.folderId;t&&("function"==typeof r.getBounds&&(k.current=!0,e.fitBounds(r.getBounds(),{paddingTopLeft:[12,88],paddingBottomRight:[12,24],maxZoom:14})),H(String(t)))}),r.on("mouseover",()=>{r.setStyle({fillOpacity:.4,weight:3}),e.getContainer().style.cursor="pointer"}),r.on("mouseout",()=>{r.setStyle({fillOpacity:.28,weight:2}),e.getContainer().style.cursor=""})},pointToLayer:(t,n)=>{const o=t.properties??{},l=String(o.name??"Folder"),i=h(o.color);return r.circleMarker(n,{color:i,weight:2,fillColor:i,fillOpacity:.22,radius:10}).bindTooltip(`<div style="font-size:12px;font-weight:700;color:${i};white-space:nowrap;">${l}</div>`,{permanent:!0,direction:"top",offset:[0,-8],className:"qrati-folder-label",opacity:1}).on("click",()=>{const t=o.folderId;t&&(k.current=!0,e.setView(n,Math.max(e.getZoom(),10),{animate:!0}),H(String(t)))})}}).addTo(e));const n=R.filter(e=>"number"==typeof e.location?.x&&"number"==typeof e.location?.y);if(n.length>0){if(n.map(e=>{const n=e.location.x,o=e.location.y,s=r.divIcon({className:"qrati-leaflet-marker-wrapper",html:`\n <div style="\n width: 36px;\n height: 36px;\n cursor: pointer;\n background: var(--primary, #ff4800);\n border-radius: 50% 50% 50% 0;\n transform: rotate(-45deg);\n border: 2px solid white;\n box-shadow: 0 2px 8px rgba(0,0,0,0.3);\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n ">${x?`<img src="${x}" style="width: 24px; height: 24px; border-radius: 50%; object-fit: cover; transform: rotate(45deg);" />`:""}</div>\n `,iconSize:[36,36],iconAnchor:[18,36],popupAnchor:[0,-36]}),c=r.marker([o,n],{icon:s}),u=document.createElement("div");return u.style.width="fit-content",((e,r,n)=>{t(/* @__PURE__ */i(a,{client:y,children:/* @__PURE__ */i(l,{children:/* @__PURE__ */i(d,{event:e,onExplore:n})})}),r)})(e,u,g),c.bindPopup(u,{closeButton:!0,maxWidth:256}),c}).forEach(e=>z.current?.addLayer?.(e)),B.current&&!A){const e=[];n.forEach(t=>{const r=t.location.x,n=t.location.y,o="number"==typeof t.views&&t.views>0?t.views:1;e.push([n,r,o])});const t=n.reduce((e,t)=>{const r="number"==typeof t.views&&t.views>0?t.views:1;return r>e?r:e},1);B.current.setOptions?.({radius:30,blur:30,maxZoom:10,minOpacity:.35,max:t}),B.current.setLatLngs?.(e)}}else B.current?.setLatLngs?.([]);U()},[M,q,R,N,H,g,x,A]),s(()=>{U()},[M,_,N,R]),/* @__PURE__ */i("div",{class:"relative h-screen w-full sm:h-[calc(100vh-4rem)]",children:[
1
+ import{a as e}from"./CsohJ1Yu.js";import{H as t,M as r,P as n,j as o,r as l,v as i,z as s}from"./MZuQhFbV.js";import{E as c,I as a}from"./jL1IhEDX.js";import{n as u}from"./Dlyq91q9.js";import{t as d}from"./Cy3iV9XH.js";import{t as f}from"./DAitYRY4.js";var m=[[90,-180],[-90,180]],p=[0,0],y=new u,h=e=>e||"#fb8500",g=({folderId:u,onExplore:g,logoUrl:x})=>{const b=o(null),v=o(null),w=o(null),L=o(null),z=o(null),B=o(null),j=o(null),k=o(!1),O=o(u??null),T=o(null),C=o(!1),S=o(()=>{}),I=o(!1),F=r(()=>(()=>{try{const e=sessionStorage.getItem(c);if(!e)return null;const t=JSON.parse(e);if("number"==typeof t?.center?.lat&&"number"==typeof t?.center?.lng&&"number"==typeof t?.zoom)return t}catch{}return null})(),[]),[Z,E]=n(!0),[N,$]=n(!1),{isFolderViewEnabled:A,activeFolderId:M,visibleEvents:R,visibleFolders:V,folderFeatureCollection:q,breadcrumb:J,isBusy:G,setActiveFolderId:H,goBack:P,activeFolder:W,folderBounds:_}=f({folderId:u});O.current=M,T.current=W,C.current=A,S.current=H;const U=()=>{const e=v.current,t=w.current;if(!e||!N||!t)return;const r=M??null,n=F?.folderId??null;if(!I.current&&F&&r===n)return void(I.current=!0);let o=null;if(_){const[e,r,n,l]=_;o=t.latLngBounds([[r,e],[l,n]])}o||(o=((e,t)=>{const r=e.latLngBounds([]);for(const n of t)"number"==typeof n.location?.x&&"number"==typeof n.location?.y&&r.extend([n.location.y,n.location.x]);return r.isValid()?r:null})(t,R)),o&&(k.current=!0,e.fitBounds(o,{paddingTopLeft:[12,88],paddingBottomRight:[12,24],maxZoom:14}),I.current=!0)};return s(()=>{if(!b.current||v.current)return;let t;return(async()=>{try{const r=await import("./CiA4qgsY.js").then(t=>/* @__PURE__ */e(t.default,1));"undefined"!=typeof window&&(window.L=r),await Promise.all([import("./OQ2IC54N.js").then(t=>/* @__PURE__ */e(t.default,1)),import("./BJ85RnFv.js")]);const n=window.L??r,o=r.latLngBounds(m);if(!b.current)return;const l=r.map(b.current,{center:F?.center?[F.center.lat??p[0],F.center.lng??p[1]]:p,zoom:F?.zoom??3,minZoom:3,zoomControl:!0,worldCopyJump:!1,maxBounds:o,maxBoundsViscosity:1});r.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:"&copy; OpenStreetMap contributors",maxZoom:19,noWrap:!0}).addTo(l);const i="function"==typeof n.markerClusterGroup?n.markerClusterGroup({chunkedLoading:!0,showCoverageOnHover:!1,spiderfyOnMaxZoom:!0,maxClusterRadius:48,zoomToBoundsOnClick:!1}):r.layerGroup(),s=e=>{const t=e?.layer;t&&(C.current?t.spiderfy?.():t.zoomToBounds?.())},a="function"==typeof n.heatLayer?n.heatLayer([],{radius:30,blur:30,maxZoom:10,minOpacity:.35}):null;a?.addTo(l),i.addTo(l);const u=()=>{j.current&&clearTimeout(j.current),j.current=setTimeout(()=>{try{sessionStorage.setItem(c,JSON.stringify({center:l.getCenter(),zoom:l.getZoom(),folderId:O.current}))}catch{}},250)},d=()=>{if(k.current)return void(k.current=!1);if(!C.current)return;const e=T.current;if(!e?._id)return;const t=((e,t)=>{if(!t?.length)return null;const r=e.latLngBounds([]);for(const n of t)"number"==typeof n?.x&&"number"==typeof n?.y&&r.extend([n.y,n.x]);return r.isValid()?r:null})(n,e.boundary);if(!t)return;const r=l.getBoundsZoom(t,!1);l.getZoom()>=r-1||S.current(e.parentFolderId??null)};l.on("zoomend",u),l.on("moveend",u),l.on("zoomend",d),i.on?.("clusterclick",s),v.current=l,w.current=n,z.current=i,B.current=a;const f=()=>{l.invalidateSize(!1)};let y;"undefined"!=typeof ResizeObserver&&b.current&&(y=new ResizeObserver(f),y.observe(b.current)),requestAnimationFrame(f),$(!0),E(!1),t=()=>{y?.disconnect(),j.current&&(clearTimeout(j.current),j.current=null),l.off("zoomend",u),l.off("moveend",u),l.off("zoomend",d),i.off?.("clusterclick",s),l.remove(),w.current=null,v.current=null,L.current=null,z.current=null,B.current=null}}finally{E(!1)}})(),()=>{t?.()}},[F]),s(()=>{I.current=!1},[M]),s(()=>{if(!v.current||!N)return;const e=v.current,r=w.current;if(!r)return;B.current&&(A?(B.current.setLatLngs?.([]),e.hasLayer(B.current)&&e.removeLayer(B.current)):e.hasLayer(B.current)||B.current.addTo(e)),L.current&&(e.removeLayer(L.current),L.current=null),z.current?.clearLayers?.(),q.features.length>0&&(L.current=r.geoJSON(q,{style:e=>{const t=h(e?.properties?.color);return{color:t,weight:2,opacity:1,fillColor:t,fillOpacity:.22}},onEachFeature:(t,r)=>{const n=t.properties??{},o=String(n.name??"Folder"),l=h(n.color);r.bindTooltip(`<div style="font-size:12px;font-weight:700;color:${l};white-space:nowrap;">${o}</div>`,{permanent:!0,direction:"center",className:"qrati-folder-label",opacity:1}),r.on("click",()=>{const t=n.folderId;t&&("function"==typeof r.getBounds&&(k.current=!0,e.fitBounds(r.getBounds(),{paddingTopLeft:[12,88],paddingBottomRight:[12,24],maxZoom:14})),H(String(t)))}),r.on("mouseover",()=>{r.setStyle({fillOpacity:.4,weight:3}),e.getContainer().style.cursor="pointer"}),r.on("mouseout",()=>{r.setStyle({fillOpacity:.28,weight:2}),e.getContainer().style.cursor=""})},pointToLayer:(t,n)=>{const o=t.properties??{},l=String(o.name??"Folder"),i=h(o.color);return r.circleMarker(n,{color:i,weight:2,fillColor:i,fillOpacity:.22,radius:10}).bindTooltip(`<div style="font-size:12px;font-weight:700;color:${i};white-space:nowrap;">${l}</div>`,{permanent:!0,direction:"top",offset:[0,-8],className:"qrati-folder-label",opacity:1}).on("click",()=>{const t=o.folderId;t&&(k.current=!0,e.setView(n,Math.max(e.getZoom(),10),{animate:!0}),H(String(t)))})}}).addTo(e));const n=R.filter(e=>"number"==typeof e.location?.x&&"number"==typeof e.location?.y);if(n.length>0){if(n.map(e=>{const n=e.location.x,o=e.location.y,s=r.divIcon({className:"qrati-leaflet-marker-wrapper",html:`\n <div style="\n width: 36px;\n height: 36px;\n cursor: pointer;\n background: var(--primary, #ff4800);\n border-radius: 50% 50% 50% 0;\n transform: rotate(-45deg);\n border: 2px solid white;\n box-shadow: 0 2px 8px rgba(0,0,0,0.3);\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n ">${x?`<img src="${x}" style="width: 24px; height: 24px; border-radius: 50%; object-fit: cover; transform: rotate(45deg);" />`:""}</div>\n `,iconSize:[36,36],iconAnchor:[18,36],popupAnchor:[0,-36]}),c=r.marker([o,n],{icon:s}),u=document.createElement("div");return u.style.width="fit-content",((e,r,n)=>{t(/* @__PURE__ */i(a,{client:y,children:/* @__PURE__ */i(l,{children:/* @__PURE__ */i(d,{event:e,onExplore:n})})}),r)})(e,u,g),c.bindPopup(u,{closeButton:!0,maxWidth:256}),c}).forEach(e=>z.current?.addLayer?.(e)),B.current&&!A){const e=[];n.forEach(t=>{const r=t.location.x,n=t.location.y,o="number"==typeof t.views&&t.views>0?t.views:1;e.push([n,r,o])});const t=n.reduce((e,t)=>{const r="number"==typeof t.views&&t.views>0?t.views:1;return r>e?r:e},1);B.current.setOptions?.({radius:30,blur:30,maxZoom:10,minOpacity:.35,max:t}),B.current.setLatLngs?.(e)}}else B.current?.setLatLngs?.([]);U()},[M,q,R,N,H,g,x,A]),s(()=>{U()},[M,_,N,R]),/* @__PURE__ */i("div",{class:"relative h-screen w-full sm:h-[calc(100vh-4rem)]",children:[
2
2
  /* @__PURE__ */i("div",{class:"absolute top-4 left-4 z-200 flex w-[min(96%,420px)] flex-col gap-2 rounded-xl border border-slate-200 bg-white/95 p-3 shadow-lg backdrop-blur-sm",children:[/* @__PURE__ */i("div",{class:"flex items-center justify-between gap-3",children:[/* @__PURE__ */i("div",{children:[/* @__PURE__ */i("div",{class:"text-sm font-semibold text-slate-900",children:W?.name??"Home"}),/* @__PURE__ */i("div",{class:"text-xs text-slate-600",children:["Tap a folder region to drill into its contents. ",V?.length??0," folder",1===V?.length?"":"s",", ",R.length," event",1===R.length?"":"s"," total"]})]}),M&&/* @__PURE__ */i("button",{type:"button",onClick:P,class:"rounded bg-slate-100 px-3 py-1 text-xs font-semibold text-slate-700 hover:bg-slate-200",children:"Back"})]}),J.length>0&&/* @__PURE__ */i("div",{class:"flex flex-wrap gap-1 text-xs text-slate-500",children:[/* @__PURE__ */i("span",{children:"All folders"}),J.map(e=>/* @__PURE__ */i("span",{class:"inline-flex items-center gap-1",children:[/* @__PURE__ */i("span",{class:"text-slate-300",children:"/"}),/* @__PURE__ */i("span",{children:e.name})]},e._id))]})]}),G&&/* @__PURE__ */i("div",{class:"absolute inset-0 z-10 flex items-center justify-center bg-white/70",children:/* @__PURE__ */i("div",{class:"border-primary flex h-12 w-12 animate-spin items-center justify-center rounded-full border-4 border-t-transparent"})}),Z&&/* @__PURE__ */i("div",{class:"absolute inset-0 z-20 flex items-center justify-center bg-white/85",children:/* @__PURE__ */i("div",{class:"flex flex-col items-center gap-3",children:[/* @__PURE__ */i("div",{class:"border-primary size-10 animate-spin rounded-full border-4 border-t-transparent"}),/* @__PURE__ */i("p",{class:"text-sm font-medium text-slate-700",children:"Loading map…"})]})}),
3
3
  /* @__PURE__ */i("div",{ref:b,class:"h-full w-full rounded-xl border border-slate-200"})]})};export{g as default};
@@ -0,0 +1,3 @@
1
+ import{D as t,G as e,K as i,N as s,O as n,P as o,R as r,U as a,W as l,f as h,j as c,m as d,n as p,p as u,v as m,x as f,z as g}from"./MZuQhFbV.js";import{N as v,l as y,m as w,n as _,o as x,r as b,s as S}from"./jL1IhEDX.js";import{t as P}from"./DuIwDwan.js";var I=Object.freeze({left:0,top:0,width:16,height:16}),C=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),L=Object.freeze({...I,...C}),T=Object.freeze({...L,body:"",hidden:!1});function z(t,e){const i=function(t,e){const i={};!t.hFlip!=!e.hFlip&&(i.hFlip=!0),!t.vFlip!=!e.vFlip&&(i.vFlip=!0);const s=((t.rotate||0)+(e.rotate||0))%4;return s&&(i.rotate=s),i}(t,e);for(const s in T)s in C?s in t&&!(s in i)&&(i[s]=C[s]):s in e?i[s]=e[s]:s in t&&(i[s]=t[s]);return i}function A(t,e,i){const s=t.icons,n=t.aliases||Object.create(null);let o={};function r(t){o=z(s[t]||n[t],o)}return r(e),i.forEach(r),z(t,o)}function E(t,e){const i=[];if("object"!=typeof t||"object"!=typeof t.icons)return i;t.not_found instanceof Array&&t.not_found.forEach(t=>{e(t,null),i.push(t)});const s=function(t){const e=t.icons,i=t.aliases||Object.create(null),s=Object.create(null);return Object.keys(e).concat(Object.keys(i)).forEach(function t(n){if(e[n])return s[n]=[];if(!(n in s)){s[n]=null;const e=i[n]&&i[n].parent,o=e&&t(e);o&&(s[n]=[e].concat(o))}return s[n]}),s}(t);for(const n in s){const o=s[n];o&&(e(n,A(t,n,o)),i.push(n))}return i}var O={provider:"",aliases:{},not_found:{},...I};function k(t,e){for(const i in e)if(i in t&&typeof t[i]!=typeof e[i])return!1;return!0}function Z(t){if("object"!=typeof t||null===t)return null;const e=t;if("string"!=typeof e.prefix||!t.icons||"object"!=typeof t.icons)return null;if(!k(t,O))return null;const i=e.icons;for(const n in i){const t=i[n];if(!n||"string"!=typeof t.body||!k(t,T))return null}const s=e.aliases||Object.create(null);for(const n in s){const t=s[n],e=t.parent;if(!n||"string"!=typeof e||!i[e]&&!s[e]||!k(t,T))return null}return e}var D=Object.create(null);function F(t,e){const i=D[t]||(D[t]=Object.create(null));return i[e]||(i[e]=function(t,e){return{provider:t,prefix:e,icons:Object.create(null),missing:/* @__PURE__ */new Set}}(t,e))}function M(t,e){return Z(e)?E(e,(e,i)=>{i?t.icons[e]=i:t.missing.add(e)}):[]}var N=/^[a-z0-9]+(-[a-z0-9]+)*$/,B=(t,e,i,s="")=>{const n=t.split(":");if("@"===t.slice(0,1)){if(n.length<2||n.length>3)return null;s=n.shift().slice(1)}if(n.length>3||!n.length)return null;if(n.length>1){const t=n.pop(),i=n.pop(),o={provider:n.length>0?n[0]:s,prefix:i,name:t};return e&&!R(o)?null:o}const o=n[0],r=o.split("-");if(r.length>1){const t={provider:s,prefix:r.shift(),name:r.join("-")};return e&&!R(t)?null:t}if(i&&""===s){const t={provider:s,prefix:"",name:o};return e&&!R(t,i)?null:t}return null},R=(t,e)=>!!t&&!(!(e&&""===t.prefix||t.prefix)||!t.name),j=!1;function H(t){return"boolean"==typeof t&&(j=t),j}function W(t){const e="string"==typeof t?B(t,!0,j):t;if(e){const t=F(e.provider,e.prefix),i=e.name;return t.icons[i]||(t.missing.has(i)?null:void 0)}}var $=Object.freeze({width:null,height:null}),V=Object.freeze({...$,...C}),q=/(-?[0-9.]*[0-9]+[0-9.]*)/g,U=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function G(t,e,i){if(1===e)return t;if(i=i||100,"number"==typeof t)return Math.ceil(t*e*i)/i;if("string"!=typeof t)return t;const s=t.split(q);if(null===s||!s.length)return t;const n=[];let o=s.shift(),r=U.test(o);for(;;){if(r){const t=parseFloat(o);isNaN(t)?n.push(o):n.push(Math.ceil(t*e*i)/i)}else n.push(o);if(o=s.shift(),void 0===o)return n.join("");r=!r}}var K=/\sid="(\S+)"/g,X="IconifyId"+Date.now().toString(16)+(16777216*Math.random()|0).toString(16),Y=0;function Q(t,e=X){const i=[];let s;for(;s=K.exec(t);)i.push(s[1]);if(!i.length)return t;const n="suffix"+(16777216*Math.random()|Date.now()).toString(16);return i.forEach(i=>{const s="function"==typeof e?e(i):e+(Y++).toString(),o=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");t=t.replace(new RegExp('([#;"])('+o+')([")]|\\.[a-z])',"g"),"$1"+s+n+"$3")}),t=t.replace(new RegExp(n,"g"),"")}var J=Object.create(null);function tt(t){return J[t]||J[""]}function et(t){let e;if("string"==typeof t.resources)e=[t.resources];else if(e=t.resources,!(e instanceof Array&&e.length))return null;return{resources:e,path:t.path||"/",maxURL:t.maxURL||500,rotate:t.rotate||750,timeout:t.timeout||5e3,random:!0===t.random,index:t.index||0,dataAfterTimeout:!1!==t.dataAfterTimeout}}for(var it=Object.create(null),st=["https://api.simplesvg.com","https://api.unisvg.com"],nt=[];st.length>0;)1===st.length||Math.random()>.5?nt.push(st.shift()):nt.push(st.pop());function ot(t,e){const i=et(e);return null!==i&&(it[t]=i,!0)}function rt(t){return it[t]}it[""]=et({resources:["https://api.iconify.design"].concat(nt)});var at=(()=>{let t;try{if(t=fetch,"function"==typeof t)return t}catch(e){}})(),lt={prepare:(t,e,i)=>{const s=[],n=function(t,e){const i=rt(t);if(!i)return 0;let s;if(i.maxURL){let t=0;i.resources.forEach(e=>{t=Math.max(t,e.length)});const n=e+".json?icons=";s=i.maxURL-t-i.path.length-n.length}else s=0;return s}(t,e),o="icons";let r={type:o,provider:t,prefix:e,icons:[]},a=0;return i.forEach((i,l)=>{a+=i.length+1,a>=n&&l>0&&(s.push(r),r={type:o,provider:t,prefix:e,icons:[]},a=i.length),r.icons.push(i)}),s.push(r),s},send:(t,e,i)=>{if(!at)return void i("abort",424);let s=function(t){if("string"==typeof t){const e=rt(t);if(e)return e.path}return"/"}(e.provider);switch(e.type){case"icons":{const t=e.prefix,i=e.icons.join(",");s+=t+".json?"+new URLSearchParams({icons:i}).toString();break}case"custom":{const t=e.uri;s+="/"===t.slice(0,1)?t.slice(1):t;break}default:return void i("abort",400)}let n=503;at(t+s).then(t=>{const e=t.status;if(200===e)return n=501,t.json();setTimeout(()=>{i(function(t){return 404===t}(e)?"abort":"next",e)})}).then(t=>{"object"==typeof t&&null!==t?setTimeout(()=>{i("success",t)}):setTimeout(()=>{404===t?i("abort",t):i("next",n)})}).catch(()=>{i("next",n)})}};function ht(t,e){t.forEach(t=>{const i=t.loaderCallbacks;i&&(t.loaderCallbacks=i.filter(t=>t.id!==e))})}var ct=0,dt={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function pt(t){const e={...dt,...t};let i=[];function s(){i=i.filter(t=>"pending"===t().status)}return{query:function(t,n,o){const r=function(t,e,i,s){const n=t.resources.length,o=t.random?Math.floor(Math.random()*n):t.index;let r;if(t.random){let e=t.resources.slice(0);for(r=[];e.length>1;){const t=Math.floor(Math.random()*e.length);r.push(e[t]),e=e.slice(0,t).concat(e.slice(t+1))}r=r.concat(e)}else r=t.resources.slice(o).concat(t.resources.slice(0,o));const a=Date.now();let l,h="pending",c=0,d=null,p=[],u=[];function m(){d&&(clearTimeout(d),d=null)}function f(){"pending"===h&&(h="aborted"),m(),p.forEach(t=>{"pending"===t.status&&(t.status="aborted")}),p=[]}function g(t,e){e&&(u=[]),"function"==typeof t&&u.push(t)}function v(){h="failed",u.forEach(t=>{t(void 0,l)})}function y(){p.forEach(t=>{"pending"===t.status&&(t.status="aborted")}),p=[]}return"function"==typeof s&&u.push(s),setTimeout(function s(){if("pending"!==h)return;m();const n=r.shift();if(void 0===n)return p.length?void(d=setTimeout(()=>{m(),"pending"===h&&(y(),v())},t.timeout)):void v();const o={status:"pending",resource:n,callback:(e,i)=>{!function(e,i,n){const o="success"!==i;switch(p=p.filter(t=>t!==e),h){case"pending":break;case"failed":if(o||!t.dataAfterTimeout)return;break;default:return}if("abort"===i)return l=n,void v();if(o)return l=n,void(p.length||(r.length?s():v()));if(m(),y(),!t.random){const i=t.resources.indexOf(e.resource);-1!==i&&i!==t.index&&(t.index=i)}h="completed",u.forEach(t=>{t(n)})}(o,e,i)}};p.push(o),c++,d=setTimeout(s,t.rotate),i(n,e,o.callback)}),function(){return{startTime:a,payload:e,status:h,queriesSent:c,queriesPending:p.length,subscribe:g,abort:f}}}(e,t,n,(t,e)=>{s(),o&&o(t,e)});return i.push(r),r},find:function(t){return i.find(e=>t(e))||null},setIndex:t=>{e.index=t},getIndex:()=>e.index,cleanup:s}}function ut(){}var mt=Object.create(null);function ft(){}function gt(t,e,i){function s(){const i=t.pendingIcons;e.forEach(e=>{i&&i.delete(e),t.icons[e]||t.missing.add(e)})}if(i&&"object"==typeof i)try{if(!M(t,i).length)return void s()}catch(n){console.error(n)}s(),function(t){t.iconsLoaderFlag||(t.iconsLoaderFlag=!0,setTimeout(()=>{t.iconsLoaderFlag=!1,function(t){t.pendingCallbacksFlag||(t.pendingCallbacksFlag=!0,setTimeout(()=>{t.pendingCallbacksFlag=!1;const e=t.loaderCallbacks?t.loaderCallbacks.slice(0):[];if(!e.length)return;let i=!1;const s=t.provider,n=t.prefix;e.forEach(e=>{const o=e.icons,r=o.pending.length;o.pending=o.pending.filter(e=>{if(e.prefix!==n)return!0;const r=e.name;if(t.icons[r])o.loaded.push({provider:s,prefix:n,name:r});else{if(!t.missing.has(r))return i=!0,!0;o.missing.push({provider:s,prefix:n,name:r})}return!1}),o.pending.length!==r&&(i||ht([t],e.id),e.callback(o.loaded.slice(0),o.missing.slice(0),o.pending.slice(0),e.abort))})}))}(t)}))}(t)}function vt(t,e){t instanceof Promise?t.then(t=>{e(t)}).catch(()=>{e(null)}):e(t)}function yt(t,e){t.iconsToLoad?t.iconsToLoad=t.iconsToLoad.concat(e).sort():t.iconsToLoad=e,t.iconsQueueFlag||(t.iconsQueueFlag=!0,setTimeout(()=>{t.iconsQueueFlag=!1;const{provider:e,prefix:i}=t,s=t.iconsToLoad;if(delete t.iconsToLoad,!s||!s.length)return;const n=t.loadIcon;if(t.loadIcons&&(s.length>1||!n))return void vt(t.loadIcons(s,i,e),e=>{gt(t,s,e)});if(n)return void s.forEach(s=>{vt(n(s,i,e),e=>{gt(t,[s],e?{prefix:i,icons:{[s]:e}}:null)})});const{valid:o,invalid:r}=function(t){const e=[],i=[];return t.forEach(t=>{(t.match(N)?e:i).push(t)}),{valid:e,invalid:i}}(s);if(r.length&&gt(t,r,null),!o.length)return;const a=i.match(N)?tt(e):null;a?a.prepare(e,i,o).forEach(i=>{!function(t,e,i){let s,n;if("string"==typeof t){const e=tt(t);if(!e)return i(void 0,424),ut;n=e.send;const o=function(t){if(!mt[t]){const e=rt(t);if(!e)return;mt[t]={config:e,redundancy:pt(e)}}return mt[t]}(t);o&&(s=o.redundancy)}else{const e=et(t);if(e){s=pt(e);const i=tt(t.resources?t.resources[0]:"");i&&(n=i.send)}}s&&n?s.query(e,n,i)().abort:i(void 0,424)}(e,i,e=>{gt(t,i.icons,e)})}):gt(t,o,null)}))}var wt,_t=(t,e)=>{const i=function(t){const e={loaded:[],missing:[],pending:[]},i=Object.create(null);t.sort((t,e)=>t.provider!==e.provider?t.provider.localeCompare(e.provider):t.prefix!==e.prefix?t.prefix.localeCompare(e.prefix):t.name.localeCompare(e.name));let s={provider:"",prefix:"",name:""};return t.forEach(t=>{if(s.name===t.name&&s.prefix===t.prefix&&s.provider===t.provider)return;s=t;const n=t.provider,o=t.prefix,r=t.name,a=i[n]||(i[n]=Object.create(null)),l=a[o]||(a[o]=F(n,o));let h;h=r in l.icons?e.loaded:""===o||l.missing.has(r)?e.missing:e.pending;const c={provider:n,prefix:o,name:r};h.push(c)}),e}(function(t,e=!0,i=!1){const s=[];return t.forEach(t=>{const n="string"==typeof t?B(t,e,i):t;n&&s.push(n)}),s}(t,!0,H()));if(!i.pending.length){let t=!0;return e&&setTimeout(()=>{t&&e(i.loaded,i.missing,i.pending,ft)}),()=>{t=!1}}const s=Object.create(null),n=[];let o,r;return i.pending.forEach(t=>{const{provider:e,prefix:i}=t;if(i===r&&e===o)return;o=e,r=i,n.push(F(e,i));const a=s[e]||(s[e]=Object.create(null));a[i]||(a[i]=[])}),i.pending.forEach(t=>{const{provider:e,prefix:i,name:n}=t,o=F(e,i),r=o.pendingIcons||(o.pendingIcons=/* @__PURE__ */new Set);r.has(n)||(r.add(n),s[e][i].push(n))}),n.forEach(t=>{const e=s[t.provider][t.prefix];e.length&&yt(t,e)}),e?function(t,e,i){const s=ct++,n=ht.bind(null,i,s);if(!e.pending.length)return n;const o={id:s,icons:e,callback:t,abort:n};return i.forEach(t=>{(t.loaderCallbacks||(t.loaderCallbacks=[])).push(o)}),n}(e,i,n):ft},xt=/[\s,]+/;function bt(t,e){e.split(xt).forEach(e=>{switch(e.trim()){case"horizontal":t.hFlip=!0;break;case"vertical":t.vFlip=!0}})}function St(t,e=0){const i=t.replace(/^-?[0-9.]*/,"");function s(t){for(;t<0;)t+=4;return t%4}if(""===i){const e=parseInt(t);return isNaN(e)?0:s(e)}if(i!==t){let e=0;switch(i){case"%":e=25;break;case"deg":e=90}if(e){let n=parseFloat(t.slice(0,t.length-i.length));return isNaN(n)?0:(n/=e,n%1==0?s(n):0)}}return e}function Pt(t){return void 0===wt&&function(){try{wt=window.trustedTypes.createPolicy("iconify",{createHTML:t=>t})}catch(t){wt=null}}(),wt?wt.createHTML(t):t}var It={...V,inline:!1},Ct={xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},Lt={display:"inline-block"},Tt={backgroundColor:"currentColor"},zt={backgroundColor:"transparent"},At={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},Et={WebkitMask:Tt,mask:Tt,background:zt};for(const Ri in Et){const t=Et[Ri];for(const e in At)t[Ri+e]=At[e]}var Ot={...It,inline:!0};function kt(t){return t+(t.match(/^[-0-9.]+$/)?"px":"")}var Zt;if(H(!0),Zt=lt,J[""]=Zt,"undefined"!=typeof document&&"undefined"!=typeof window){const t=window;if(void 0!==t.IconifyPreload){const e=t.IconifyPreload,i="Invalid IconifyPreload syntax.";"object"==typeof e&&null!==e&&(e instanceof Array?e:[e]).forEach(t=>{try{("object"!=typeof t||null===t||t instanceof Array||"object"!=typeof t.icons||"string"!=typeof t.prefix||!function(t,e){if("object"!=typeof t)return!1;if("string"!=typeof e&&(e=t.provider||""),j&&!e&&!t.prefix){let e=!1;return Z(t)&&(t.prefix="",E(t,(t,s)=>{(function(t,e){const s=B(t,!0,j);if(!s)return!1;const n=F(s.provider,s.prefix);return e?function(t,e,s){try{if("string"==typeof s.body)return t.icons[e]={...s},!0}catch(i){}return!1}(n,s.name,e):(n.missing.add(s.name),!0)})(t,s)&&(e=!0)})),e}const s=t.prefix;return!!R({prefix:s,name:"a"})&&!!M(F(e,s),t)}(t))&&console.error(i)}catch(e){console.error(i)}})}if(void 0!==t.IconifyProviders){const e=t.IconifyProviders;if("object"==typeof e&&null!==e)for(let t in e){const i="IconifyProviders["+t+"] is invalid.";try{const s=e[t];if("object"!=typeof s||!s||void 0===s.resources)continue;ot(t,s)||console.error(i)}catch(Bi){console.error(i)}}}}function Dt(t){const[e,s]=o(!!t.ssr),[n,r]=o({}),[a,l]=o(function(e){if(e){const e=t.icon;if("object"==typeof e)return{name:"",data:e};const i=W(e);if(i)return{name:e,data:i}}return{name:""}}(!!t.ssr));function h(){const t=n.callback;t&&(t(),r({}))}function c(t){if(JSON.stringify(a)!==JSON.stringify(t))return h(),l(t),!0}function d(){var e;const i=t.icon;if("object"==typeof i)return void c({name:"",data:i});const s=W(i);c({name:i,data:s})&&(void 0===s?r({callback:_t([i],d)}):s&&(null===(e=t.onLoad)||void 0===e||e.call(t,i)))}g(()=>(s(!0),h),[]),g(()=>{e&&d()},[t.icon,e]);const{name:p,data:u}=a;return u?((t,e,s)=>{const n=e.inline?Ot:It,o=function(t,e){const i={...t};for(const s in e){const t=e[s],n=typeof t;s in $?(null===t||t&&("string"===n||"number"===n))&&(i[s]=t):n===typeof i[s]&&(i[s]="rotate"===s?t%4:t)}return i}(n,e),r=e.mode||"svg",a={},l=e.style||{},h={..."svg"===r?Ct:{}};if(s){const t=B(s,!1,!0);if(t){const e=["iconify"];for(const i of["provider","prefix"])t[i]&&e.push("iconify--"+t[i]);h.className=e.join(" ")}}for(let i in e){const t=e[i];if(void 0!==t)switch(i){case"icon":case"style":case"children":case"onLoad":case"mode":case"ssr":case"fallback":break;case"_ref":h.ref=t;break;case"className":h[i]=(h[i]?h[i]+" ":"")+t;break;case"inline":case"hFlip":case"vFlip":o[i]=!0===t||"true"===t||1===t;break;case"flip":"string"==typeof t&&bt(o,t);break;case"color":a.color=t;break;case"rotate":"string"==typeof t?o[i]=St(t):"number"==typeof t&&(o[i]=t);break;case"ariaHidden":case"aria-hidden":!0!==t&&"true"!==t&&delete h["aria-hidden"];break;default:void 0===n[i]&&(h[i]=t)}}const c=function(t,e){const i={...L,...t},s={...V,...e},n={left:i.left,top:i.top,width:i.width,height:i.height};let o=i.body;[i,s].forEach(t=>{const e=[],i=t.hFlip,s=t.vFlip;let r,a=t.rotate;switch(i?s?a+=2:(e.push("translate("+(n.width+n.left).toString()+" "+(0-n.top).toString()+")"),e.push("scale(-1 1)"),n.top=n.left=0):s&&(e.push("translate("+(0-n.left).toString()+" "+(n.height+n.top).toString()+")"),e.push("scale(1 -1)"),n.top=n.left=0),a<0&&(a-=4*Math.floor(a/4)),a%=4,a){case 1:r=n.height/2+n.top,e.unshift("rotate(90 "+r.toString()+" "+r.toString()+")");break;case 2:e.unshift("rotate(180 "+(n.width/2+n.left).toString()+" "+(n.height/2+n.top).toString()+")");break;case 3:r=n.width/2+n.left,e.unshift("rotate(-90 "+r.toString()+" "+r.toString()+")")}a%2==1&&(n.left!==n.top&&(r=n.left,n.left=n.top,n.top=r),n.width!==n.height&&(r=n.width,n.width=n.height,n.height=r)),e.length&&(o=function(t,e){const i=function(t,e="defs"){let i="";const s=t.indexOf("<"+e);for(;s>=0;){const n=t.indexOf(">",s),o=t.indexOf("</"+e);if(-1===n||-1===o)break;const r=t.indexOf(">",o);if(-1===r)break;i+=t.slice(n+1,o).trim(),t=t.slice(0,s).trim()+t.slice(r+1)}return{defs:i,content:t}}(t);return s=i.defs,n=e+i.content+"</g>",s?"<defs>"+s+"</defs>"+n:n;var s,n}(o,'<g transform="'+e.join(" ")+'">'))});const r=s.width,a=s.height,l=n.width,h=n.height;let c,d;null===r?(d=null===a?"1em":"auto"===a?h:a,c=G(d,l/h)):(c="auto"===r?l:r,d=null===a?G(c,h/l):"auto"===a?h:a);const p={},u=(t,e)=>{(t=>"unset"===t||"undefined"===t||"none"===t)(e)||(p[t]=e.toString())};u("width",c),u("height",d);const m=[n.left,n.top,l,h];return p.viewBox=m.join(" "),{attributes:p,viewBox:m,body:o}}(t,o),d=c.attributes;if(o.inline&&(a.verticalAlign="-0.125em"),"svg"===r){h.style={...a,...l},Object.assign(h,d);let t=0,s=e.id;return"string"==typeof s&&(s=s.replace(/-/g,"_")),h.dangerouslySetInnerHTML={__html:Pt(Q(c.body,s?()=>s+"ID"+t++:"iconifyReact"))},i("svg",h)}const{body:p,width:u,height:m}=t,f="mask"===r||"bg"!==r&&-1!==p.indexOf("currentColor"),g=function(t,e){let i=-1===t.indexOf("xlink:")?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const s in e)i+=" "+s+'="'+e[s]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+i+">"+t+"</svg>"}(p,{...d,width:u+"",height:m+""});var v;return h.style={...a,"--svg":(v=g,'url("'+function(t){return"data:image/svg+xml,"+function(t){return t.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}(t)}(v)+'")'),width:kt(d.width),height:kt(d.height),...Lt,...f?Tt:zt,...l},i("span",h)})({...L,...u},t,p):t.children?t.children:t.fallback?t.fallback:i("span",{})}var Ft=f((t,e)=>Dt({...t,_ref:e})),Mt=(f((t,e)=>Dt({inline:!0,...t,_ref:e})),t=>"boolean"==typeof t?`${t}`:0===t?"0":t),Nt=d,Bt=(t,e)=>i=>{var s;if(null==(null==e?void 0:e.variants))return Nt(t,null==i?void 0:i.class,null==i?void 0:i.className);const{variants:n,defaultVariants:o}=e,r=Object.keys(n).map(t=>{const e=null==i?void 0:i[t],s=null==o?void 0:o[t];if(null===e)return null;const r=Mt(e)||Mt(s);return n[t][r]}),a=i&&Object.entries(i).reduce((t,e)=>{let[i,s]=e;return void 0===s||(t[i]=s),t},{});return Nt(t,r,null==e||null===(s=e.compoundVariants)||void 0===s?void 0:s.reduce((t,e)=>{let{class:i,className:s,...n}=e;return Object.entries(n).every(t=>{let[e,i]=t;return Array.isArray(i)?i.includes({...o,...a}[e]):{...o,...a}[e]===i})?[...t,i,s]:t},[]),null==i?void 0:i.class,null==i?void 0:i.className)},Rt=Bt("",{variants:{variant:{default:"border-none",outline:"rounded",solid:"bg-background"},size:{sm:"size-4",md:"size-5",lg:"size-6",xl:"size-7","2xl":"size-8","3xl":"size-9"},color:{foreground:"text-foreground",primary:"text-primary",secondary:"text-muted-foreground",info:"text-info",warning:"text-warning",success:"text-success",error:"text-destructive",a11y:"text-primary-foreground",inherit:""}},compoundVariants:[{variant:"outline",color:"primary",class:"border-primary"},{variant:"outline",color:"secondary",class:"border-border"},{variant:"outline",color:"info",class:"border-info"},{variant:"outline",color:"warning",class:"border-warning"},{variant:"outline",color:"success",class:"border-success"},{variant:"outline",color:"error",class:"border-destructive"},{variant:"solid",color:"primary",class:"bg-background text-foreground"},{variant:"solid",color:"secondary",class:"bg-background text-muted-foreground"},{variant:"solid",color:"info",class:"bg-info text-foreground text-text-primary-dark"},{variant:"solid",color:"warning",class:"bg-warning text-foreground text-text-primary-dark"},{variant:"solid",color:"success",class:"bg-success text-foreground text-text-primary-dark"},{variant:"solid",color:"error",class:"bg-destructive text-foreground text-text-primary-dark"}],defaultVariants:{variant:"default",size:"md",color:"foreground"}}),jt=({className:t,color:e="foreground",size:i="md",variant:s="default",name:n="line-md:iconify1",...o})=>/* @__PURE__ */m(Ft,{icon:n,className:h(Rt({color:e,size:i,variant:s,className:t})),...o});function Ht({children:t,asChild:e=!1,...i}){if(e){const e=Array.isArray(t)?t[0]:t;if(e&&e.type)return l(e,{...i,...e.props})}/* @__PURE__ */
2
+ return m("button",{...i,children:t})}var Wt=Bt("shadow-outer inline-flex size-fit cursor-pointer items-center justify-center rounded font-medium transition-all duration-200 active:scale-95 disabled:pointer-events-none disabled:opacity-50",{variants:{size:{sm:"gap-1 p-2 text-sm",md:"gap-2 px-4 py-2 text-sm sm:text-base",lg:"gap-2 px-4 py-3 text-lg",icon:"h-9 w-9 p-0"},color:{foreground:"bg-background text-foreground hover:bg-muted active:bg-muted/80",primary:"bg-primary text-primary-foreground hover:bg-primary/90 active:bg-primary/80",info:"bg-info hover:bg-info/90 active:bg-info/80 text-white",warning:"bg-warning hover:bg-warning/90 active:bg-warning/80 text-white",success:"bg-success hover:bg-success/90 active:bg-success/80 text-white",error:"bg-destructive hover:bg-destructive/90 active:bg-destructive/80 text-white"},variant:{default:"",outlined:"bg-transparent hover:bg-current/10 active:bg-current/15",ghost:"border-transparent bg-transparent shadow-none hover:bg-current/10 active:bg-current/15"}},compoundVariants:[{variant:"default",color:"primary",class:"border-primary border"},{variant:"default",color:"info",class:"border-info border"},{variant:"default",color:"warning",class:"border-warning border"},{variant:"default",color:"success",class:"border-success border"},{variant:"default",color:"error",class:"border-destructive border"},{variant:"outlined",color:"foreground",class:"text-foreground border-muted-foreground hover:bg-foreground/10 border bg-transparent"},{variant:"outlined",color:"primary",class:"border-primary text-primary hover:bg-primary/10 border bg-transparent"},{variant:"outlined",color:"info",class:"border-info text-info hover:bg-info/10 border bg-transparent"},{variant:"outlined",color:"warning",class:"border-warning text-warning hover:bg-warning/10 border bg-transparent"},{variant:"outlined",color:"success",class:"border-success text-success hover:bg-success/10 border bg-transparent"},{variant:"outlined",color:"error",class:"border-destructive text-destructive hover:bg-destructive/10 border bg-transparent"},{variant:"ghost",color:"primary",class:"text-primary hover:bg-primary/10"},{variant:"ghost",color:"info",class:"text-info hover:bg-info/10"},{variant:"ghost",color:"warning",class:"text-warning hover:bg-warning/10"},{variant:"ghost",color:"success",class:"text-success hover:bg-success/10"},{variant:"ghost",color:"error",class:"text-destructive hover:bg-destructive/10"}],defaultVariants:{variant:"default",size:"md",color:"primary"}}),$t=({className:t,type:e="button",disabled:i,loading:s,fullWidth:n,color:o,size:r,variant:a,icon:l,iconName:c,iconSvg:d,asChild:p=!1,immutable:u,elementRef:f,children:g,...v})=>{const y=p?Ht:"button",w=p?{asChild:!0}:{},_=d||l||(c?/* @__PURE__ */m(jt,{name:c,className:"text-primary-foreground"}):null);/* @__PURE__ */
3
+ return m(y,{ref:f,type:e,disabled:i||s,className:h(Wt({color:o,size:r,variant:a}),t,n&&"w-full"),...w,...v,children:[/* @__PURE__ */m("div",{className:h(s?"collapse":"visible flex items-center gap-3"),children:[_&&!s&&_,g]}),s&&/* @__PURE__ */m("span",{className:"icon-[eos-icons--three-dots-loading] absolute size-6"})]})},Vt={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",p:"p",blockquote:"blockquote",body1:"p",body2:"p",body3:"p",caption:"span",overline:"span",lead:"p"},qt=Bt("antialiased",{variants:{variant:{h1:"scroll-m-20 text-4xl font-bold tracking-tight lg:text-5xl",h2:"scroll-m-20 text-3xl font-bold tracking-tight lg:text-4xl",h3:"scroll-m-20 text-2xl font-semibold tracking-tight",h4:"scroll-m-20 text-xl font-semibold",h5:"scroll-m-20 text-lg font-semibold",h6:"scroll-m-20 text-base font-semibold",body1:"text-base leading-relaxed font-medium",body2:"text-sm leading-relaxed",body3:"text-sm leading-relaxed sm:text-base",p:"text-base leading-7",lead:"text-muted-foreground text-xl leading-relaxed",blockquote:"border-primary/30 text-muted-foreground border-l-4 pl-4 text-base italic",caption:"text-muted-foreground text-xs",overline:"text-muted-foreground text-xs font-medium tracking-widest uppercase"},color:{foreground:"text-foreground",muted:"text-muted-foreground",primary:"text-primary",info:"text-info",warning:"text-warning",success:"text-success",error:"text-destructive",inherit:"text-inherit",secondary:"text-muted-foreground",white:"text-white",black:"text-black",a11y:"text-primary-foreground",light:"text-text-primary-light"},align:{left:"text-left",right:"text-right",center:"text-center",justify:"text-justify"},weight:{normal:"font-normal",medium:"font-medium",semibold:"font-semibold",bold:"font-bold"}},defaultVariants:{variant:"body1",color:"foreground",align:"left"}}),Ut=({variant:t="body1",color:e,align:i,weight:s,transform:n,lines:o,shadow:r,noWrap:a,className:l,immutable:c,...d})=>/* @__PURE__ */m(Vt[t],{className:h(qt({variant:t,color:e,align:i,weight:s}),n,o&&o>0?`line-clamp-${o}`:void 0,r&&"drop-shadow-[0_1px_2px_rgba(0,0,0,0.5)]",a&&"truncate",l),...d,children:d.children}),Gt=null,Kt=!1,Xt=()=>Gt||(Gt=new Promise(t=>{if("undefined"==typeof window)return void t();if(window.googletag=window.googletag||{cmd:[]},document.querySelector('script[src*="gpt.js"]'))return void t();const e=document.createElement("script");e.src="https://securepubads.g.doubleclick.net/tag/js/gpt.js",e.async=!0,e.crossOrigin="anonymous",e.onload=()=>t(),e.onerror=()=>t(),document.head.appendChild(e)})),Yt=()=>{Kt||(Kt=!0,window.googletag.enableServices())},Qt=t=>{try{const e=(window.googletag.pubads().getSlots?.()??[]).find(e=>e.getSlotElementId?.()===t);e&&window.googletag.destroySlots([e])}catch{}},Jt=async()=>{const t=await b();return"string"==typeof t?t:t?.fingerprint},te=()=>{const t=c(null),{props:e,sessionId:i,user:s}=_(),n=e?.organizationId,o=c(null),r=c(null),a=async(e,i)=>{if(e&&i&&(t.current||(t.current=await Jt()),t.current))try{await v.post(y.UPDATE_AD_ANALYTICS,{json:{adId:e,type:i,browserFingerprint:t.current},headers:{"x-org-id":n}})}catch(Bi){console.error(Bi)}},l=async t=>{if(i)try{await v.post(y.UPDATE_SESSION,{headers:{"x-org-id":n},json:{sessionId:i,pageViews:t}})}catch(Bi){console.error(Bi)}};return{incrementEventView:async e=>{if(e&&(t.current||(t.current=await Jt()),t.current))try{await v.post(y.INCREMENT_EVENT_VIEW,{json:{eventSlug:e,browserFingerprint:t.current},headers:{"x-org-id":n,Authorization:s?`Bearer ${s.token}`:void 0}})}catch(Bi){console.error(Bi)}},captureAdImpression:async t=>a(t,x.AD_IMPRESSION),captureAdEngagement:async t=>a(t,x.AD_ENGAGEMENT),captureAdClick:(t,e,i)=>{if(a(t,x.AD_CLICK),i)switch(e){case S.LINK:window.open(String(i),"_blank");break;case S.EMAIL:window.location.href=`mailto:${String(i)}`;break;case S.PHONE:window.location.href=`tel:${String(i)}`;break;case S.SMS:window.location.href=`sms:${String(i)}`;break;case S.WHATSAPP:window.location.href=`https://wa.me/${String(i)}`;break;case S.MESSENGER:window.location.href=`https://m.me/${String(i)}`;break;default:window.open(String(i),"_blank")}},trackPageView:t=>{o.current&&r.current&&l([{page:o.current,entryTime:r.current,exitTime:Date.now()}]),o.current=t??null,r.current=Date.now()},exportPageViewsData:l,trackGamAnalytics:async({eventId:e,organizationId:i,type:s,creativeId:o,lineItemId:r,advertiserId:a,isEmpty:l})=>{if(!e||!s)return;if(t.current||(t.current=await Jt()),!t.current)return;const h=i||n;if(h)try{await v.post(y.UPDATE_GAM_ANALYTICS,{json:{eventId:e,organizationId:h,type:s,browserFingerprint:t.current,...o?{creativeId:o}:{},...r?{lineItemId:r}:{},...a?{advertiserId:a}:{},...void 0!==l?{isEmpty:l}:{}},headers:{"x-org-id":h}})}catch(Bi){console.error(Bi)}}}},ee=({container:t,onClick:e})=>{let i=!1,s=!1,n=0,o=null;const r=()=>{i=!0,n=Date.now()},a=()=>{i=!1},l=()=>{null!==o&&(window.clearTimeout(o),o=null)},h=()=>{o=window.setTimeout(()=>{const o=document.activeElement,r=o instanceof HTMLIFrameElement&&t.contains(o),a=Date.now()-n<=1500;!s&&(r||i&&a)&&(s=!0,e())},0)};return t.addEventListener("pointerenter",r),t.addEventListener("pointerleave",a),window.addEventListener("blur",h),window.addEventListener("focus",l),()=>{t.removeEventListener("pointerenter",r),t.removeEventListener("pointerleave",a),window.removeEventListener("blur",h),window.removeEventListener("focus",l),null!==o&&window.clearTimeout(o)}},ie=e(null),se=({open:t,onOpenChange:e,children:i})=>{const[s,n]=o(!!t);return g(()=>{"boolean"==typeof t&&n(t)},[t]),/* @__PURE__ */m(ie.Provider,{value:{open:s,setOpen:t=>{n(t),e?.(t)}},children:i})},ne=({children:t})=>/* @__PURE__ */m(a,{children:t}),oe=({className:t,...e})=>/* @__PURE__ */m("div",{"data-state":r(ie)?.open?"open":"closed",className:h("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-2001 bg-black/15 backdrop-blur-md",t),...e}),re=({className:t,children:e,...i})=>{const{organization:s}=_(),n=r(ie);return g(()=>{if(!n?.open)return;const t=t=>{"Escape"===t.key&&n.setOpen(!1)};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[n?.open]),n?.open?/* @__PURE__ */m(ne,{children:[/* @__PURE__ */m(oe,{onClick:()=>n.setOpen(!1)}),/* @__PURE__ */m("div",{role:"dialog","aria-modal":"true","data-state":n?.open?"open":"closed",className:h("border-border bg-background shadow-outer data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0 data-[state=open]:zoom-in-95 data-[state=closed]:zoom-out-95 max-sm:data-[state=open]:slide-in-from-bottom max-sm:data-[state=closed]:slide-out-to-bottom fixed top-[50%] left-[50%] z-2002 h-fit w-auto max-w-5xl translate-x-[-50%] translate-y-[-50%] overflow-hidden rounded-t border duration-300 max-sm:top-auto max-sm:bottom-0 max-sm:left-0 max-sm:w-full max-sm:translate-x-0 max-sm:translate-y-0 max-sm:border-x-0 max-sm:border-b-0 sm:rounded",t),style:u(s),...i,children:e})]}):null},ae=({className:t,...e})=>/* @__PURE__ */m("div",{className:h("flex flex-col space-y-1 p-3 text-center sm:text-left",t),...e}),le=({className:t,...e})=>/* @__PURE__ */m("div",{className:h("p- flex justify-end space-x-3",t),...e}),he=({className:t,...e})=>/* @__PURE__ */m("h2",{className:h("text-center text-lg font-semibold",t),...e}),ce=({className:t,...e})=>/* @__PURE__ */m("p",{className:h("text-muted-foreground text-center text-sm",t),...e}),de=t=>"number"==typeof t&&!isNaN(t),pe=t=>"string"==typeof t,ue=t=>"function"==typeof t;function me({enter:e,exit:i,appendPosition:n=!1,collapse:o=!0,collapseDuration:r=300}){return function({children:a,position:l,preventExitTransition:h,done:d,nodeRef:p,isIn:u,playToast:m}){let f=n?`${e}--${l}`:e,v=n?`${i}--${l}`:i,y=c(0);return s(()=>{let t=p.current,e=f.split(" "),i=s=>{s.target===p.current&&(m(),t.removeEventListener("animationend",i),t.removeEventListener("animationcancel",i),0===y.current&&"animationcancel"!==s.type&&t.classList.remove(...e))};t.classList.add(...e),t.addEventListener("animationend",i),t.addEventListener("animationcancel",i)},[]),g(()=>{let t=p.current,e=()=>{t.removeEventListener("animationend",e),o?function(t,e,i=300){let{scrollHeight:s,style:n}=t;requestAnimationFrame(()=>{n.minHeight="initial",n.height=s+"px",n.transition=`all ${i}ms`,requestAnimationFrame(()=>{n.height="0",n.padding="0",n.margin="0",setTimeout(e,i)})})}(t,d,r):d()};u||(h?e():(y.current=1,t.className+=` ${v}`,t.addEventListener("animationend",e)))},[u]),t.createElement(t.Fragment,null,a)}}var fe=1,ge=()=>""+fe++,ve=/* @__PURE__ */new Map,ye=[],we=/* @__PURE__ */new Set,_e=()=>ve.size>0;function xe(t,e){ve.forEach(i=>{(null==e||null==e||!e.containerId||(null==e?void 0:e.containerId)===i.id)&&i.toggle(t,null==e?void 0:e.id)})}function be(t){return t&&(pe(t.toastId)||de(t.toastId))?t.toastId:ge()}function Se(t,e){return function(t,e){(t=>n(t)||pe(t)||ue(t)||de(t))(t)&&(_e()||ye.push({content:t,options:e}),ve.forEach(i=>{i.buildToast(t,e)}))}(t,e),e.toastId}function Pe(t,e){return{...e,type:e&&e.type||t,toastId:be(e)}}function Ie(t){return(e,i)=>Se(e,Pe(t,i))}function Ce(t,e){return Se(t,Pe("default",e))}Ce.loading=(t,e)=>Se(t,Pe("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...e})),Ce.promise=function(t,{pending:e,error:i,success:s},n){let o;e&&(o=pe(e)?Ce.loading(e,n):Ce.loading(e.render,{...n,...e}));let r={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},a=(t,e,i)=>{if(null==e)return void Ce.dismiss(o);let s={type:t,...r,...n,data:i},a=pe(e)?{render:e}:e;return o?Ce.update(o,{...s,...a}):Ce(a.render,{...s,...a}),i},l=ue(t)?t():t;return l.then(t=>a("success",s,t)).catch(t=>a("error",i,t)),l},Ce.success=Ie("success"),Ce.info=Ie("info"),Ce.error=Ie("error"),Ce.warning=Ie("warning"),Ce.warn=Ce.warning,Ce.dark=(t,e)=>Se(t,Pe("default",{theme:"dark",...e})),Ce.dismiss=function(t){!function(t){if(_e()){if(null==t||(t=>pe(t)||de(t))(t))ve.forEach(e=>{e.removeToast(t)});else if(t&&("containerId"in t||"id"in t)){let e=ve.get(t.containerId);e?e.removeToast(t.id):ve.forEach(e=>{e.removeToast(t.id)})}}else ye=ye.filter(e=>null!=t&&e.options.toastId!==t)}(t)},Ce.clearWaitingQueue=(t={})=>{ve.forEach(e=>{e.props.limit&&(!t.containerId||e.id===t.containerId)&&e.clearQueue()})},Ce.isActive=function(t,e){var i;if(e)return!(null==(i=ve.get(e))||!i.isToastActive(t));let s=!1;return ve.forEach(e=>{e.isToastActive(t)&&(s=!0)}),s},Ce.update=(t,e={})=>{let i=((t,{containerId:e})=>{var i;return null==(i=ve.get(e||1))?void 0:i.toasts.get(t)})(t,e);if(i){let{props:s,content:n}=i,o={delay:100,...s,...e,toastId:e.toastId||t,updateId:ge()};o.toastId!==t&&(o.staleId=t);let r=o.render||n;delete o.render,Se(r,o)}},Ce.done=t=>{Ce.update(t,{progress:1})},Ce.onChange=function(t){return we.add(t),()=>{we.delete(t)}},Ce.play=t=>xe(!0,t),Ce.pause=t=>xe(!1,t);var Le=(t,e=!1)=>({enter:`Toastify--animate Toastify__${t}-enter`,exit:`Toastify--animate Toastify__${t}-exit`,appendPosition:e}),Te=(me(Le("bounce",!0)),me(Le("slide",!0)),me(Le("zoom")),me(Le("flip")),({url:t,alt:e="",thumbnailUrl:i,blurhash:s,pswpData:n={},curateLink:o,onClick:r})=>{const l=/* @__PURE__ */m(a,{children:[/* @__PURE__ */m(P,{threshold:.1,src:i||t,blurhash:s,alt:e}),n.type===w.VIDEO&&/* @__PURE__ */m("div",{className:"absolute inset-0 top-0 left-0 flex items-center justify-center opacity-75",children:/* @__PURE__ */m("svg",{xmlns:"http://www.w3.org/2000/svg",className:"w-16 text-white lg:w-24",viewBox:"0 0 24 24",children:/* @__PURE__ */m("path",{fill:"currentColor",d:"M8 17.175V6.825q0-.425.3-.713t.7-.287q.125 0 .263.037t.262.113l8.15 5.175q.225.15.338.375t.112.475t-.112.475t-.338.375l-8.15 5.175q-.125.075-.262.113T9 18.175q-.4 0-.7-.288t-.3-.712"})})})]});return r?/* @__PURE__ */m("button",{className:"h-full w-full",onClick:r,children:l}):o?/* @__PURE__ */m(p,{to:o,className:"h-full w-full",children:l}):/* @__PURE__ */m("a",{href:t,className:"pswp-item block h-full w-full",...Object.keys(n).reduce((t,e)=>{const i=n[e];return null==i||""===i||(t[`data-pswp-${s=e,s.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}`]=i),t;var s},{}),...i?{"data-pswp-thumbnail-url":i}:{},...s?{"data-pswp-blurhash":s}:{},target:"_blank",rel:"noreferrer",children:l})});function ze(t,e,i){const s=document.createElement(e);return t&&(s.className=t),i&&i.appendChild(s),s}function Ae(t,e){return t.x=e.x,t.y=e.y,void 0!==e.id&&(t.id=e.id),t}function Ee(t){t.x=Math.round(t.x),t.y=Math.round(t.y)}function Oe(t,e){const i=Math.abs(t.x-e.x),s=Math.abs(t.y-e.y);return Math.sqrt(i*i+s*s)}function ke(t,e){return t.x===e.x&&t.y===e.y}function Ze(t,e,i){return Math.min(Math.max(t,e),i)}function De(t,e,i){let s=`translate3d(${t}px,${e||0}px,0)`;return void 0!==i&&(s+=` scale3d(${i},${i},1)`),s}function Fe(t,e,i,s){t.style.transform=De(e,i,s)}function Me(t,e,i,s){t.style.transition=e?`${e} ${i}ms ${s||"cubic-bezier(.4,0,.22,1)"}`:"none"}function Ne(t,e,i){t.style.width="number"==typeof e?`${e}px`:e,t.style.height="number"==typeof i?`${i}px`:i}var Be="loading",Re="loaded",je="error";function He(t){return"button"in t&&1===t.button||t.ctrlKey||t.metaKey||t.altKey||t.shiftKey}function We(t,e,i=document){let s=[];if(t instanceof Element)s=[t];else if(t instanceof NodeList||Array.isArray(t))s=Array.from(t);else{const n="string"==typeof t?t:e;n&&(s=Array.from(i.querySelectorAll(n)))}return s}function $e(){return!(!navigator.vendor||!navigator.vendor.match(/apple/i))}var Ve=class{constructor(t,e){if(this.element=ze("pswp__img pswp__img--placeholder",t?"img":"div",e),t){const e=this.element;e.decoding="async",e.alt="",e.src=t,e.setAttribute("role","presentation")}this.element.setAttribute("aria-hidden","true")}setDisplayedSize(t,e){this.element&&("IMG"===this.element.tagName?(Ne(this.element,250,"auto"),this.element.style.transformOrigin="0 0",this.element.style.transform=De(0,0,t/250)):Ne(this.element,t,e))}destroy(){this.element?.parentNode&&this.element.remove(),this.element=null}},qe=class{constructor(t,e,i){this.instance=e,this.data=t,this.index=i,this.element=void 0,this.placeholder=void 0,this.slide=void 0,this.displayedImageWidth=0,this.displayedImageHeight=0,this.width=Number(this.data.w)||Number(this.data.width)||0,this.height=Number(this.data.h)||Number(this.data.height)||0,this.isAttached=!1,this.hasSlide=!1,this.isDecoding=!1,this.state="idle",this.data.type?this.type=this.data.type:this.data.src?this.type="image":this.type="html",this.hash=this.data.hash,this.instance.dispatch("contentInit",{content:this})}removePlaceholder(){this.placeholder&&!this.keepPlaceholder()&&setTimeout(()=>{this.placeholder&&(this.placeholder.destroy(),this.placeholder=void 0)},1e3)}load(t,e){if(this.slide&&this.usePlaceholder())if(this.placeholder){const t=this.placeholder.element;t&&!t.parentElement&&this.slide.container.prepend(t)}else{const t=this.instance.applyFilters("placeholderSrc",!(!this.data.msrc||!this.slide.isFirstSlide)&&this.data.msrc,this);this.placeholder=new Ve(t,this.slide.container)}this.element&&!e||this.instance.dispatch("contentLoad",{content:this,isLazy:t}).defaultPrevented||(this.isImageContent()?(this.element=ze("pswp__img","img"),this.displayedImageWidth&&this.loadImage(t)):(this.element=ze("pswp__content","div"),this.element.innerHTML=this.data.html||""),e&&this.slide&&this.slide.updateContentSize(!0))}loadImage(t){if(!this.isImageContent()||!this.element||this.instance.dispatch("contentLoadImage",{content:this,isLazy:t}).defaultPrevented)return;const e=this.element;this.updateSrcsetSizes(),this.data.srcset&&(e.srcset=this.data.srcset),e.src=this.data.src??"",e.alt=this.data.alt??"",this.state=Be,e.complete?this.onLoaded():(e.onload=()=>{this.onLoaded()},e.onerror=()=>{this.onError()})}setSlide(t){this.slide=t,this.hasSlide=!0,this.instance=t.pswp}onLoaded(){this.state=Re,this.slide&&this.element&&(this.instance.dispatch("loadComplete",{slide:this.slide,content:this}),this.slide.isActive&&this.slide.heavyAppended&&!this.element.parentNode&&(this.append(),this.slide.updateContentSize(!0)),this.state!==Re&&this.state!==je||this.removePlaceholder())}onError(){this.state=je,this.slide&&(this.displayError(),this.instance.dispatch("loadComplete",{slide:this.slide,isError:!0,content:this}),this.instance.dispatch("loadError",{slide:this.slide,content:this}))}isLoading(){return this.instance.applyFilters("isContentLoading",this.state===Be,this)}isError(){return this.state===je}isImageContent(){return"image"===this.type||"ad"===this.type}setDisplayedSize(t,e){if(this.element&&(this.placeholder&&this.placeholder.setDisplayedSize(t,e),!this.instance.dispatch("contentResize",{content:this,width:t,height:e}).defaultPrevented&&(Ne(this.element,t,e),this.isImageContent()&&!this.isError()))){const i=!this.displayedImageWidth&&t;this.displayedImageWidth=t,this.displayedImageHeight=e,i?this.loadImage(!1):this.updateSrcsetSizes(),this.slide&&this.instance.dispatch("imageSizeChange",{slide:this.slide,width:t,height:e,content:this})}}isZoomable(){return this.instance.applyFilters("isContentZoomable",this.isImageContent()&&this.state!==je,this)}updateSrcsetSizes(){if(!this.isImageContent()||!this.element||!this.data.srcset)return;const t=this.element,e=this.instance.applyFilters("srcsetSizesWidth",this.displayedImageWidth,this);(!t.dataset.largestUsedSize||e>parseInt(t.dataset.largestUsedSize,10))&&(t.sizes=`${e}px`,t.dataset.largestUsedSize=String(e))}usePlaceholder(){return this.instance.applyFilters("useContentPlaceholder",this.isImageContent(),this)}lazyLoad(){this.instance.dispatch("contentLazyLoad",{content:this}).defaultPrevented||this.load(!0)}keepPlaceholder(){return this.instance.applyFilters("isKeepingPlaceholder",this.isLoading(),this)}destroy(){this.hasSlide=!1,this.slide=void 0,this.instance.dispatch("contentDestroy",{content:this}).defaultPrevented||(this.remove(),this.placeholder&&(this.placeholder.destroy(),this.placeholder=void 0),this.isImageContent()&&this.element&&(this.element.onload=null,this.element.onerror=null,this.element=void 0))}displayError(){if(this.slide){let t=ze("pswp__error-msg","div");t.innerText=this.instance.options?.errorMsg??"",t=this.instance.applyFilters("contentErrorElement",t,this),this.element=ze("pswp__content pswp__error-msg-container","div"),this.element.appendChild(t),this.slide.container.innerText="",this.slide.container.appendChild(this.element),this.slide.updateContentSize(!0),this.removePlaceholder()}}append(){if(this.isAttached||!this.element)return;if(this.isAttached=!0,this.state===je)return void this.displayError();if(this.instance.dispatch("contentAppend",{content:this}).defaultPrevented)return;const t="decode"in this.element;this.isImageContent()?t&&this.slide&&(!this.slide.isActive||$e())?(this.isDecoding=!0,this.element.decode().catch(()=>{}).finally(()=>{this.isDecoding=!1,this.appendImage()})):this.appendImage():this.slide&&!this.element.parentNode&&this.slide.container.appendChild(this.element)}activate(){!this.instance.dispatch("contentActivate",{content:this}).defaultPrevented&&this.slide&&(this.isImageContent()&&this.isDecoding&&!$e()?this.appendImage():this.isError()&&this.load(!1,!0),this.slide.holderElement&&this.slide.holderElement.setAttribute("aria-hidden","false"))}deactivate(){this.instance.dispatch("contentDeactivate",{content:this}),this.slide&&this.slide.holderElement&&this.slide.holderElement.setAttribute("aria-hidden","true")}remove(){this.isAttached=!1,this.instance.dispatch("contentRemove",{content:this}).defaultPrevented||(this.element&&this.element.parentNode&&this.element.remove(),this.placeholder&&this.placeholder.element&&this.placeholder.element.remove())}appendImage(){this.isAttached&&(this.instance.dispatch("contentAppendImage",{content:this}).defaultPrevented||(this.slide&&this.element&&!this.element.parentNode&&this.slide.container.appendChild(this.element),this.state!==Re&&this.state!==je||this.removePlaceholder()))}};function Ue(t,e){if(t.getViewportSizeFn){const i=t.getViewportSizeFn(t,e);if(i)return i}return{x:document.documentElement.clientWidth,y:window.innerHeight}}function Ge(t,e,i,s,n){let o=0;if(e.paddingFn)o=e.paddingFn(i,s,n)[t];else if(e.padding)o=e.padding[t];else{const i=`padding${t[0].toUpperCase()}${t.slice(1)}`;e[i]&&(o=e[i])}return Number(o)||0}function Ke(t,e,i,s){return{x:e.x-Ge("left",t,e,i,s)-Ge("right",t,e,i,s),y:e.y-Ge("top",t,e,i,s)-Ge("bottom",t,e,i,s)}}var Xe=class{constructor(t,e,i,s){this.pswp=s,this.options=t,this.itemData=e,this.index=i,this.panAreaSize=null,this.elementSize=null,this.fit=1,this.fill=1,this.vFill=1,this.initial=1,this.secondary=1,this.max=1,this.min=1}update(t,e,i){const s={x:t,y:e};this.elementSize=s,this.panAreaSize=i;const n=i.x/s.x,o=i.y/s.y;this.fit=Math.min(1,n<o?n:o),this.fill=Math.min(1,n>o?n:o),this.vFill=Math.min(1,o),this.initial=this._getInitial(),this.secondary=this._getSecondary(),this.max=Math.max(this.initial,this.secondary,this._getMax()),this.min=Math.min(this.fit,this.initial,this.secondary),this.pswp&&this.pswp.dispatch("zoomLevelsUpdate",{zoomLevels:this,slideData:this.itemData})}_parseZoomLevelOption(t){const e=`${t}ZoomLevel`,i=this.options[e];if(i)return"function"==typeof i?i(this):"fill"===i?this.fill:"fit"===i?this.fit:Number(i)}_getSecondary(){let t=this._parseZoomLevelOption("secondary");return t||(t=Math.min(1,3*this.fit),this.elementSize&&t*this.elementSize.x>4e3&&(t=4e3/this.elementSize.x),t)}_getInitial(){return this._parseZoomLevelOption("initial")||this.fit}_getMax(){return this._parseZoomLevelOption("max")||Math.max(1,4*this.fit)}};function Ye(t,e,i){const s=e.createContentFromData(t,i);let n;const{options:o}=e;if(o){let r;n=new Xe(o,t,-1),r=e.pswp?e.pswp.viewportSize:Ue(o,e);const a=Ke(o,r,t,i);n.update(s.width,s.height,a)}return s.lazyLoad(),n&&s.setDisplayedSize(Math.ceil(s.width*n.initial),Math.ceil(s.height*n.initial)),s}function Qe(t,e){const i=e.getItemData(t);if(!e.dispatch("lazyLoadSlide",{index:t,itemData:i}).defaultPrevented)return Ye(i,e,t)}var Je=class{constructor(t){this.pswp=t,this.limit=Math.max(t.options.preload[0]+t.options.preload[1]+1,5),this._cachedItems=[]}updateLazy(t){const{pswp:e}=this;if(e.dispatch("lazyLoad").defaultPrevented)return;const{preload:i}=e.options,s=void 0===t||t>=0;let n;for(n=0;n<=i[1];n++)this.loadSlideByIndex(e.currIndex+(s?n:-n));for(n=1;n<=i[0];n++)this.loadSlideByIndex(e.currIndex+(s?-n:n))}loadSlideByIndex(t){const e=this.pswp.getLoopedIndex(t);let i=this.getContentByIndex(e);i||(i=Qe(e,this.pswp),i&&this.addToCache(i))}getContentBySlide(t){let e=this.getContentByIndex(t.index);return e||(e=this.pswp.createContentFromData(t.data,t.index),this.addToCache(e)),e.setSlide(t),e}addToCache(t){if(this.removeByIndex(t.index),this._cachedItems.push(t),this._cachedItems.length>this.limit){const t=this._cachedItems.findIndex(t=>!t.isAttached&&!t.hasSlide);-1!==t&&this._cachedItems.splice(t,1)[0].destroy()}}removeByIndex(t){const e=this._cachedItems.findIndex(e=>e.index===t);-1!==e&&this._cachedItems.splice(e,1)}getContentByIndex(t){return this._cachedItems.find(e=>e.index===t)}destroy(){this._cachedItems.forEach(t=>t.destroy()),this._cachedItems=[]}},ti=class{constructor(t,e){this.type=t,this.defaultPrevented=!1,e&&Object.assign(this,e)}preventDefault(){this.defaultPrevented=!0}},ei=class{constructor(){this._listeners={},this._filters={},this.pswp=void 0,this.options=void 0}addFilter(t,e,i=100){this._filters[t]||(this._filters[t]=[]),this._filters[t]?.push({fn:e,priority:i}),this._filters[t]?.sort((t,e)=>t.priority-e.priority),this.pswp?.addFilter(t,e,i)}removeFilter(t,e){this._filters[t]&&(this._filters[t]=this._filters[t].filter(t=>t.fn!==e)),this.pswp&&this.pswp.removeFilter(t,e)}applyFilters(t,...e){return this._filters[t]?.forEach(t=>{e[0]=t.fn.apply(this,e)}),e[0]}on(t,e){this._listeners[t]||(this._listeners[t]=[]),this._listeners[t]?.push(e),this.pswp?.on(t,e)}off(t,e){this._listeners[t]&&(this._listeners[t]=this._listeners[t].filter(t=>e!==t)),this.pswp?.off(t,e)}dispatch(t,e){if(this.pswp)return this.pswp.dispatch(t,e);const i=new ti(t,e);return this._listeners[t]?.forEach(t=>{t.call(this,i)}),i}},ii=class extends ei{getNumItems(){let t=0;const e=this.options?.dataSource;e&&"length"in e?t=e.length:e&&"gallery"in e&&(e.items||(e.items=this._getGalleryDOMElements(e.gallery)),e.items&&(t=e.items.length));const i=this.dispatch("numItems",{dataSource:e,numItems:t});return this.applyFilters("numItems",i.numItems,e)}createContentFromData(t,e){return new qe(t,this,e)}getItemData(t){const e=this.options?.dataSource;let i={};Array.isArray(e)?i=e[t]:e&&"gallery"in e&&(e.items||(e.items=this._getGalleryDOMElements(e.gallery)),i=e.items[t]);let s=i;s instanceof Element&&(s=this._domElementToItemData(s));const n=this.dispatch("itemData",{itemData:s||{},index:t});return this.applyFilters("itemData",n.itemData,t)}_getGalleryDOMElements(t){return this.options?.children||this.options?.childSelector?We(this.options.children,this.options.childSelector,t)||[]:[t]}_toLowerCaseFirstLetter(t){return t?t.charAt(0).toLowerCase()+t.slice(1):t}_domElementToItemData(t){const e={element:t},i="A"===t.tagName?t:t.querySelector("a");if(i){e.src=i.dataset.pswpSrc||i.href,i.dataset.pswpSrcset&&(e.srcset=i.dataset.pswpSrcset),e.width=i.dataset.pswpWidth?parseInt(i.dataset.pswpWidth,10):0,e.height=i.dataset.pswpHeight?parseInt(i.dataset.pswpHeight,10):0,i.dataset.pswpType&&(e.type=i.dataset.pswpType.toLowerCase());const s=t.querySelector("img");s&&(e.msrc=s.currentSrc||s.src,e.alt=s.getAttribute("alt")??""),(i.dataset.pswpCropped||i.dataset.cropped)&&(e.thumbCropped=!0);const n=["element","src","srcset","width","height","type","msrc","alt","thumbCropped"];Object.keys(i.dataset).filter(t=>t.startsWith("pswp")&&!n.includes(this._toLowerCaseFirstLetter(t.slice(4)))).forEach(t=>{e[this._toLowerCaseFirstLetter(t.slice(4))]=i.dataset[t]})}return this.applyFilters("domItemData",e,t,i)}lazyLoadData(t,e){return Ye(t,this,e)}},si=class extends ii{constructor(t){super(),this.options=t||{},this._uid=0,this.shouldOpen=!1,this._preloadedContent=void 0,this.onThumbnailsClick=this.onThumbnailsClick.bind(this)}init(){We(this.options.gallery,this.options.gallerySelector).forEach(t=>{t.addEventListener("click",this.onThumbnailsClick,!1)})}onThumbnailsClick(t){if(He(t)||window.pswp)return;let e={x:t.clientX,y:t.clientY};e.x||e.y||(e=null);let i=this.getClickedIndex(t);i=this.applyFilters("clickedIndex",i,t,this);const s={gallery:t.currentTarget};i>=0&&(t.preventDefault(),this.loadAndOpen(i,s,e))}getClickedIndex(t){if(this.options.getClickedIndexFn)return this.options.getClickedIndexFn.call(this,t);const e=t.target,i=We(this.options.children,this.options.childSelector,t.currentTarget).findIndex(t=>t===e||t.contains(e));return-1!==i?i:this.options.children||this.options.childSelector?-1:0}loadAndOpen(t,e,i){if(window.pswp||!this.options)return!1;if(!e&&this.options.gallery&&this.options.children){const t=We(this.options.gallery);t[0]&&(e={gallery:t[0]})}return this.options.index=t,this.options.initialPointerPos=i,this.shouldOpen=!0,this.preload(t,e),!0}preload(t,e){const{options:i}=this;e&&(i.dataSource=e);const s=[],n=typeof i.pswpModule;if("function"==typeof(o=i.pswpModule)&&o.prototype&&o.prototype.goTo)s.push(Promise.resolve(i.pswpModule));else{if("string"===n)throw new Error("pswpModule as string is no longer supported");if("function"!==n)throw new Error("pswpModule is not valid");s.push(i.pswpModule())}var o;"function"==typeof i.openPromise&&s.push(i.openPromise()),!1!==i.preloadFirstSlide&&t>=0&&(this._preloadedContent=Qe(t,this));const r=++this._uid;Promise.all(s).then(t=>{if(this.shouldOpen){const e=t[0];this._openPhotoswipe(e,r)}})}_openPhotoswipe(t,e){if(e!==this._uid&&this.shouldOpen)return;if(this.shouldOpen=!1,window.pswp)return;const i="object"==typeof t?new t.default(this.options):new t(this.options);this.pswp=i,window.pswp=i,Object.keys(this._listeners).forEach(t=>{this._listeners[t]?.forEach(e=>{i.on(t,e)})}),Object.keys(this._filters).forEach(t=>{this._filters[t]?.forEach(e=>{i.addFilter(t,e.fn,e.priority)})}),this._preloadedContent&&(i.contentLoader.addToCache(this._preloadedContent),this._preloadedContent=void 0),i.on("destroy",()=>{this.pswp=void 0,delete window.pswp}),i.init()}destroy(){this.pswp?.destroy(),this.shouldOpen=!1,this._listeners={},We(this.options.gallery,this.options.gallerySelector).forEach(t=>{t.removeEventListener("click",this.onThumbnailsClick,!1)})}},ni=class{constructor(t){this.gestures=t,this.pswp=t.pswp,this.startPan={x:0,y:0}}start(){this.pswp.currSlide&&Ae(this.startPan,this.pswp.currSlide.pan),this.pswp.animations.stopAll()}change(){const{p1:t,prevP1:e,dragAxis:i}=this.gestures,{currSlide:s}=this.pswp;if("y"===i&&this.pswp.options.closeOnVerticalDrag&&s&&s.currZoomLevel<=s.zoomLevels.fit&&!this.gestures.isMultitouch){const i=s.pan.y+(t.y-e.y);if(!this.pswp.dispatch("verticalDrag",{panY:i}).defaultPrevented){this._setPanWithFriction("y",i,.6);const t=1-Math.abs(this._getVerticalDragRatio(s.pan.y));this.pswp.applyBgOpacity(t),s.applyCurrentZoomPan()}}else this._panOrMoveMainScroll("x")||(this._panOrMoveMainScroll("y"),s&&(Ee(s.pan),s.applyCurrentZoomPan()))}end(){const{velocity:t}=this.gestures,{mainScroll:e,currSlide:i}=this.pswp;let s=0;if(this.pswp.animations.stopAll(),e.isShifted()){const i=(e.x-e.getCurrSlideX())/this.pswp.viewportSize.x;t.x<-.5&&i<0||t.x<.1&&i<-.5?(s=1,t.x=Math.min(t.x,0)):(t.x>.5&&i>0||t.x>-.1&&i>.5)&&(s=-1,t.x=Math.max(t.x,0)),e.moveIndexBy(s,!0,t.x,!0)}i&&i.currZoomLevel>i.zoomLevels.max||this.gestures.isMultitouch?this.gestures.zoomLevels.correctZoomPan(!0):(this._finishPanGestureForAxis("x"),this._finishPanGestureForAxis("y"))}_finishPanGestureForAxis(t){const{velocity:e}=this.gestures,{currSlide:i}=this.pswp;if(!i)return;const{pan:s,bounds:n}=i,o=s[t],r=this.pswp.bgOpacity<1&&"y"===t,a=o+e[t]*.995/(1-.995);if(r){const t=this._getVerticalDragRatio(o),e=this._getVerticalDragRatio(a);if(t<0&&e<-.4||t>0&&e>.4)return void this.pswp.close()}const l=n.correctPan(t,a);if(o===l)return;const h=l===a?1:.82,c=this.pswp.bgOpacity,d=l-o;this.pswp.animations.startSpring({name:`panGesture${t}`,isPan:!0,start:o,end:l,velocity:e[t],dampingRatio:h,onUpdate:e=>{if(r&&this.pswp.bgOpacity<1){const t=1-(l-e)/d;this.pswp.applyBgOpacity(Ze(c+(1-c)*t,0,1))}s[t]=Math.floor(e),i.applyCurrentZoomPan()}})}_panOrMoveMainScroll(t){const{p1:e,dragAxis:i,prevP1:s,isMultitouch:n}=this.gestures,{currSlide:o,mainScroll:r}=this.pswp,a=e[t]-s[t],l=r.x+a;if(!a||!o)return!1;if("x"===t&&!o.isPannable()&&!n)return r.moveTo(l,!0),!0;const{bounds:h}=o,c=o.pan[t]+a;if(this.pswp.options.allowPanToNext&&"x"===i&&"x"===t&&!n){const e=r.getCurrSlideX(),i=r.x-e,s=a>0,n=!s;if(c>h.min[t]&&s){if(h.min[t]<=this.startPan[t])return r.moveTo(l,!0),!0;this._setPanWithFriction(t,c)}else if(c<h.max[t]&&n){if(this.startPan[t]<=h.max[t])return r.moveTo(l,!0),!0;this._setPanWithFriction(t,c)}else if(0!==i){if(i>0)return r.moveTo(Math.max(l,e),!0),!0;if(i<0)return r.moveTo(Math.min(l,e),!0),!0}else this._setPanWithFriction(t,c)}else"y"===t&&(r.isShifted()||h.min.y===h.max.y)||this._setPanWithFriction(t,c);return!1}_getVerticalDragRatio(t){return(t-(this.pswp.currSlide?.bounds.center.y??0))/(this.pswp.viewportSize.y/3)}_setPanWithFriction(t,e,i){const{currSlide:s}=this.pswp;if(!s)return;const{pan:n,bounds:o}=s;if(o.correctPan(t,e)!==e||i){const s=Math.round(e-n[t]);n[t]+=s*(i||.35)}else n[t]=e}};function oi(t){return!!t.target.closest(".pswp__container")}var ri=class{constructor(t){this.gestures=t}click(t,e){const i=e.target.classList,s=i.contains("pswp__img"),n=i.contains("pswp__item")||i.contains("pswp__zoom-wrap");s?this._doClickOrTapAction("imageClick",t,e):n&&this._doClickOrTapAction("bgClick",t,e)}tap(t,e){oi(e)&&this._doClickOrTapAction("tap",t,e)}doubleTap(t,e){oi(e)&&this._doClickOrTapAction("doubleTap",t,e)}_doClickOrTapAction(t,e,i){const{pswp:s}=this.gestures,{currSlide:n}=s,o=`${t}Action`,r=s.options[o];if(!s.dispatch(o,{point:e,originalEvent:i}).defaultPrevented)if("function"!=typeof r)switch(r){case"close":case"next":s[r]();break;case"zoom":n?.toggleZoom(e);break;case"zoom-or-close":n?.isZoomable()&&n.zoomLevels.secondary!==n.zoomLevels.initial?n.toggleZoom(e):s.options.clickToCloseNonZoomable&&s.close();break;case"toggle-controls":this.gestures.pswp.element?.classList.toggle("pswp--ui-visible")}else r.call(s,e,i)}};function ai(t,e,i){return t.x=(e.x+i.x)/2,t.y=(e.y+i.y)/2,t}var li=class{constructor(t){this.gestures=t,this._startPan={x:0,y:0},this._startZoomPoint={x:0,y:0},this._zoomPoint={x:0,y:0},this._wasOverFitZoomLevel=!1,this._startZoomLevel=1}start(){const{currSlide:t}=this.gestures.pswp;t&&(this._startZoomLevel=t.currZoomLevel,Ae(this._startPan,t.pan)),this.gestures.pswp.animations.stopAllPan(),this._wasOverFitZoomLevel=!1}change(){const{p1:t,startP1:e,p2:i,startP2:s,pswp:n}=this.gestures,{currSlide:o}=n;if(!o)return;const r=o.zoomLevels.min,a=o.zoomLevels.max;if(!o.isZoomable()||n.mainScroll.isShifted())return;ai(this._startZoomPoint,e,s),ai(this._zoomPoint,t,i);let l=1/Oe(e,s)*Oe(t,i)*this._startZoomLevel;if(l>o.zoomLevels.initial+o.zoomLevels.initial/15&&(this._wasOverFitZoomLevel=!0),l<r)if(n.options.pinchToClose&&!this._wasOverFitZoomLevel&&this._startZoomLevel<=o.zoomLevels.initial){const t=1-(r-l)/(r/1.2);n.dispatch("pinchClose",{bgOpacity:t}).defaultPrevented||n.applyBgOpacity(t)}else l=r-.15*(r-l);else l>a&&(l=a+.05*(l-a));o.pan.x=this._calculatePanForZoomLevel("x",l),o.pan.y=this._calculatePanForZoomLevel("y",l),o.setZoomLevel(l),o.applyCurrentZoomPan()}end(){const{pswp:t}=this.gestures,{currSlide:e}=t;(!e||e.currZoomLevel<e.zoomLevels.initial)&&!this._wasOverFitZoomLevel&&t.options.pinchToClose?t.close():this.correctZoomPan()}_calculatePanForZoomLevel(t,e){const i=e/this._startZoomLevel;return this._zoomPoint[t]-(this._startZoomPoint[t]-this._startPan[t])*i}correctZoomPan(t){const{pswp:e}=this.gestures,{currSlide:i}=e;if(!i?.isZoomable())return;0===this._zoomPoint.x&&(t=!0);const s=i.currZoomLevel;let n,o=!0;s<i.zoomLevels.initial?n=i.zoomLevels.initial:s>i.zoomLevels.max?n=i.zoomLevels.max:(o=!1,n=s);const r=e.bgOpacity,a=e.bgOpacity<1,l=Ae({x:0,y:0},i.pan);let h=Ae({x:0,y:0},l);t&&(this._zoomPoint.x=0,this._zoomPoint.y=0,this._startZoomPoint.x=0,this._startZoomPoint.y=0,this._startZoomLevel=s,Ae(this._startPan,l)),o&&(h={x:this._calculatePanForZoomLevel("x",n),y:this._calculatePanForZoomLevel("y",n)}),i.setZoomLevel(n),h={x:i.bounds.correctPan("x",h.x),y:i.bounds.correctPan("y",h.y)},i.setZoomLevel(s);const c=!ke(h,l);if(!c&&!o&&!a)return i._setResolution(n),void i.applyCurrentZoomPan();e.animations.stopAllPan(),e.animations.startSpring({isPan:!0,start:0,end:1e3,velocity:0,dampingRatio:1,naturalFrequency:40,onUpdate:t=>{if(t/=1e3,c||o){if(c&&(i.pan.x=l.x+(h.x-l.x)*t,i.pan.y=l.y+(h.y-l.y)*t),o){const e=s+(n-s)*t;i.setZoomLevel(e)}i.applyCurrentZoomPan()}a&&e.bgOpacity<1&&e.applyBgOpacity(Ze(r+(1-r)*t,0,1))},onComplete:()=>{i._setResolution(n),i.applyCurrentZoomPan()}})}},hi=class{constructor(t){this.pswp=t,this.dragAxis=null,this.p1={x:0,y:0},this.p2={x:0,y:0},this.prevP1={x:0,y:0},this.prevP2={x:0,y:0},this.startP1={x:0,y:0},this.startP2={x:0,y:0},this.velocity={x:0,y:0},this._lastStartP1={x:0,y:0},this._intervalP1={x:0,y:0},this._numActivePoints=0,this._ongoingPointers=[],this._touchEventEnabled="ontouchstart"in window,this._pointerEventEnabled=!!window.PointerEvent,this.supportsTouch=this._touchEventEnabled||this._pointerEventEnabled&&navigator.maxTouchPoints>1,this._numActivePoints=0,this._intervalTime=0,this._velocityCalculated=!1,this.isMultitouch=!1,this.isDragging=!1,this.isZooming=!1,this.raf=null,this._tapTimer=null,this.supportsTouch||(t.options.allowPanToNext=!1),this.drag=new ni(this),this.zoomLevels=new li(this),this.tapHandler=new ri(this),t.on("bindEvents",()=>{t.events.add(t.scrollWrap,"click",this._onClick.bind(this)),this._pointerEventEnabled?this._bindEvents("pointer","down","up","cancel"):this._touchEventEnabled?(this._bindEvents("touch","start","end","cancel"),t.scrollWrap&&(t.scrollWrap.ontouchmove=()=>{},t.scrollWrap.ontouchend=()=>{})):this._bindEvents("mouse","down","up")})}_bindEvents(t,e,i,s){const{pswp:n}=this,{events:o}=n,r=s?t+s:"";o.add(n.scrollWrap,t+e,this.onPointerDown.bind(this)),o.add(window,`${t}move`,this.onPointerMove.bind(this)),o.add(window,t+i,this.onPointerUp.bind(this)),r&&o.add(n.scrollWrap,r,this.onPointerUp.bind(this))}onPointerDown(t){const e="mousedown"===t.type||"mouse"===t.pointerType;if(e&&t.button>0)return;const{pswp:i}=this;i.opener.isOpen?i.dispatch("pointerDown",{originalEvent:t}).defaultPrevented||(e&&(i.mouseDetected(),this._preventPointerEventBehaviour(t,"down")),i.animations.stopAll(),this._updatePoints(t,"down"),1===this._numActivePoints&&(this.dragAxis=null,Ae(this.startP1,this.p1)),this._numActivePoints>1?(this._clearTapTimer(),this.isMultitouch=!0):this.isMultitouch=!1):t.preventDefault()}onPointerMove(t){this._preventPointerEventBehaviour(t,"move"),this._numActivePoints&&(this._updatePoints(t,"move"),this.pswp.dispatch("pointerMove",{originalEvent:t}).defaultPrevented||(1!==this._numActivePoints||this.isDragging?this._numActivePoints>1&&!this.isZooming&&(this._finishDrag(),this.isZooming=!0,this._updateStartPoints(),this.zoomLevels.start(),this._rafStopLoop(),this._rafRenderLoop()):(this.dragAxis||this._calculateDragDirection(),this.dragAxis&&!this.isDragging&&(this.isZooming&&(this.isZooming=!1,this.zoomLevels.end()),this.isDragging=!0,this._clearTapTimer(),this._updateStartPoints(),this._intervalTime=Date.now(),this._velocityCalculated=!1,Ae(this._intervalP1,this.p1),this.velocity.x=0,this.velocity.y=0,this.drag.start(),this._rafStopLoop(),this._rafRenderLoop()))))}_finishDrag(){this.isDragging&&(this.isDragging=!1,this._velocityCalculated||this._updateVelocity(!0),this.drag.end(),this.dragAxis=null)}onPointerUp(t){this._numActivePoints&&(this._updatePoints(t,"up"),this.pswp.dispatch("pointerUp",{originalEvent:t}).defaultPrevented||(0===this._numActivePoints&&(this._rafStopLoop(),this.isDragging?this._finishDrag():this.isZooming||this.isMultitouch||this._finishTap(t)),this._numActivePoints<2&&this.isZooming&&(this.isZooming=!1,this.zoomLevels.end(),1===this._numActivePoints&&(this.dragAxis=null,this._updateStartPoints()))))}_rafRenderLoop(){(this.isDragging||this.isZooming)&&(this._updateVelocity(),this.isDragging?ke(this.p1,this.prevP1)||this.drag.change():ke(this.p1,this.prevP1)&&ke(this.p2,this.prevP2)||this.zoomLevels.change(),this._updatePrevPoints(),this.raf=requestAnimationFrame(this._rafRenderLoop.bind(this)))}_updateVelocity(t){const e=Date.now(),i=e-this._intervalTime;i<50&&!t||(this.velocity.x=this._getVelocity("x",i),this.velocity.y=this._getVelocity("y",i),this._intervalTime=e,Ae(this._intervalP1,this.p1),this._velocityCalculated=!0)}_finishTap(t){const{mainScroll:e}=this.pswp;if(e.isShifted())return void e.moveIndexBy(0,!0);if(t.type.indexOf("cancel")>0)return;if("mouseup"===t.type||"mouse"===t.pointerType)return void this.tapHandler.click(this.startP1,t);const i=this.pswp.options.doubleTapAction?300:0;this._tapTimer?(this._clearTapTimer(),Oe(this._lastStartP1,this.startP1)<25&&this.tapHandler.doubleTap(this.startP1,t)):(Ae(this._lastStartP1,this.startP1),this._tapTimer=setTimeout(()=>{this.tapHandler.tap(this.startP1,t),this._clearTapTimer()},i))}_clearTapTimer(){this._tapTimer&&(clearTimeout(this._tapTimer),this._tapTimer=null)}_getVelocity(t,e){const i=this.p1[t]-this._intervalP1[t];return Math.abs(i)>1&&e>5?i/e:0}_rafStopLoop(){this.raf&&(cancelAnimationFrame(this.raf),this.raf=null)}_preventPointerEventBehaviour(t,e){this.pswp.applyFilters("preventPointerEvent",!0,t,e)&&t.preventDefault()}_updatePoints(t,e){if(this._pointerEventEnabled){const i=t,s=this._ongoingPointers.findIndex(t=>t.id===i.pointerId);"up"===e&&s>-1?this._ongoingPointers.splice(s,1):"down"===e&&-1===s?this._ongoingPointers.push(this._convertEventPosToPoint(i,{x:0,y:0})):s>-1&&this._convertEventPosToPoint(i,this._ongoingPointers[s]),this._numActivePoints=this._ongoingPointers.length,this._numActivePoints>0&&Ae(this.p1,this._ongoingPointers[0]),this._numActivePoints>1&&Ae(this.p2,this._ongoingPointers[1])}else{const i=t;this._numActivePoints=0,i.type.indexOf("touch")>-1?i.touches&&i.touches.length>0&&(this._convertEventPosToPoint(i.touches[0],this.p1),this._numActivePoints++,i.touches.length>1&&(this._convertEventPosToPoint(i.touches[1],this.p2),this._numActivePoints++)):(this._convertEventPosToPoint(t,this.p1),"up"===e?this._numActivePoints=0:this._numActivePoints++)}}_updatePrevPoints(){Ae(this.prevP1,this.p1),Ae(this.prevP2,this.p2)}_updateStartPoints(){Ae(this.startP1,this.p1),Ae(this.startP2,this.p2),this._updatePrevPoints()}_calculateDragDirection(){if(this.pswp.mainScroll.isShifted())this.dragAxis="x";else{const t=Math.abs(this.p1.x-this.startP1.x)-Math.abs(this.p1.y-this.startP1.y);if(0!==t){const e=t>0?"x":"y";Math.abs(this.p1[e]-this.startP1[e])>=10&&(this.dragAxis=e)}}}_convertEventPosToPoint(t,e){return e.x=t.pageX-this.pswp.offset.x,e.y=t.pageY-this.pswp.offset.y,"pointerId"in t?e.id=t.pointerId:void 0!==t.identifier&&(e.id=t.identifier),e}_onClick(t){this.pswp.mainScroll.isShifted()&&(t.preventDefault(),t.stopPropagation())}},ci=class{constructor(t){this.slide=t,this.currZoomLevel=1,this.center={x:0,y:0},this.max={x:0,y:0},this.min={x:0,y:0}}update(t){this.currZoomLevel=t,this.slide.width?(this._updateAxis("x"),this._updateAxis("y"),this.slide.pswp.dispatch("calcBounds",{slide:this.slide})):this.reset()}_updateAxis(t){const{pswp:e}=this.slide,i=this.slide["x"===t?"width":"height"]*this.currZoomLevel,s=Ge("x"===t?"left":"top",e.options,e.viewportSize,this.slide.data,this.slide.index),n=this.slide.panAreaSize[t];this.center[t]=Math.round((n-i)/2)+s,this.max[t]=i>n?Math.round(n-i)+s:this.center[t],this.min[t]=i>n?s:this.center[t]}reset(){this.center.x=0,this.center.y=0,this.max.x=0,this.max.y=0,this.min.x=0,this.min.y=0}correctPan(t,e){return Ze(e,this.max[t],this.min[t])}},di=class{constructor(t,e,i){this.data=t,this.index=e,this.pswp=i,this.isActive=e===i.currIndex,this.currentResolution=0,this.panAreaSize={x:0,y:0},this.pan={x:0,y:0},this.isFirstSlide=this.isActive&&!i.opener.isOpen,this.zoomLevels=new Xe(i.options,t,e,i),this.pswp.dispatch("gettingData",{slide:this,data:this.data,index:e}),this.content=this.pswp.contentLoader.getContentBySlide(this),this.container=ze("pswp__zoom-wrap","div"),this.holderElement=null,this.currZoomLevel=1,this.width=this.content.width,this.height=this.content.height,this.heavyAppended=!1,this.bounds=new ci(this),this.prevDisplayedWidth=-1,this.prevDisplayedHeight=-1,this.pswp.dispatch("slideInit",{slide:this})}setIsActive(t){t&&!this.isActive?this.activate():!t&&this.isActive&&this.deactivate()}append(t){this.holderElement=t,this.container.style.transformOrigin="0 0",this.data&&(this.calculateSize(),this.load(),this.updateContentSize(),this.appendHeavy(),this.holderElement.appendChild(this.container),this.zoomAndPanToInitial(),this.pswp.dispatch("firstZoomPan",{slide:this}),this.applyCurrentZoomPan(),this.pswp.dispatch("afterSetContent",{slide:this}),this.isActive&&this.activate())}load(){this.content.load(!1),this.pswp.dispatch("slideLoad",{slide:this})}appendHeavy(){const{pswp:t}=this;!this.heavyAppended&&t.opener.isOpen&&!t.mainScroll.isShifted()&&(this.isActive,1)&&(this.pswp.dispatch("appendHeavy",{slide:this}).defaultPrevented||(this.heavyAppended=!0,this.content.append(),this.pswp.dispatch("appendHeavyContent",{slide:this})))}activate(){this.isActive=!0,this.appendHeavy(),this.content.activate(),this.pswp.dispatch("slideActivate",{slide:this})}deactivate(){this.isActive=!1,this.content.deactivate(),this.currZoomLevel!==this.zoomLevels.initial&&this.calculateSize(),this.currentResolution=0,this.zoomAndPanToInitial(),this.applyCurrentZoomPan(),this.updateContentSize(),this.pswp.dispatch("slideDeactivate",{slide:this})}destroy(){this.content.hasSlide=!1,this.content.remove(),this.container.remove(),this.pswp.dispatch("slideDestroy",{slide:this})}resize(){this.currZoomLevel!==this.zoomLevels.initial&&this.isActive?(this.calculateSize(),this.bounds.update(this.currZoomLevel),this.panTo(this.pan.x,this.pan.y)):(this.calculateSize(),this.currentResolution=0,this.zoomAndPanToInitial(),this.applyCurrentZoomPan(),this.updateContentSize())}updateContentSize(t){const e=this.currentResolution||this.zoomLevels.initial;if(!e)return;const i=Math.round(this.width*e)||this.pswp.viewportSize.x,s=Math.round(this.height*e)||this.pswp.viewportSize.y;(this.sizeChanged(i,s)||t)&&this.content.setDisplayedSize(i,s)}sizeChanged(t,e){return(t!==this.prevDisplayedWidth||e!==this.prevDisplayedHeight)&&(this.prevDisplayedWidth=t,this.prevDisplayedHeight=e,!0)}getPlaceholderElement(){return this.content.placeholder?.element}zoomTo(t,e,i,s){const{pswp:n}=this;if(!this.isZoomable()||n.mainScroll.isShifted())return;n.dispatch("beforeZoomTo",{destZoomLevel:t,centerPoint:e,transitionDuration:i}),n.animations.stopAllPan();const o=this.currZoomLevel;s||(t=Ze(t,this.zoomLevels.min,this.zoomLevels.max)),this.setZoomLevel(t),this.pan.x=this.calculateZoomToPanOffset("x",e,o),this.pan.y=this.calculateZoomToPanOffset("y",e,o),Ee(this.pan);const r=()=>{this._setResolution(t),this.applyCurrentZoomPan()};i?n.animations.startTransition({isPan:!0,name:"zoomTo",target:this.container,transform:this.getCurrentTransform(),onComplete:r,duration:i,easing:n.options.easing}):r()}toggleZoom(t){this.zoomTo(this.currZoomLevel===this.zoomLevels.initial?this.zoomLevels.secondary:this.zoomLevels.initial,t,this.pswp.options.zoomAnimationDuration)}setZoomLevel(t){this.currZoomLevel=t,this.bounds.update(this.currZoomLevel)}calculateZoomToPanOffset(t,e,i){if(this.bounds.max[t]-this.bounds.min[t]===0)return this.bounds.center[t];e||(e=this.pswp.getViewportCenterPoint()),i||(i=this.zoomLevels.initial);const s=this.currZoomLevel/i;return this.bounds.correctPan(t,(this.pan[t]-e[t])*s+e[t])}panTo(t,e){this.pan.x=this.bounds.correctPan("x",t),this.pan.y=this.bounds.correctPan("y",e),this.applyCurrentZoomPan()}isPannable(){return Boolean(this.width)&&this.currZoomLevel>this.zoomLevels.fit}isZoomable(){return Boolean(this.width)&&this.content.isZoomable()}applyCurrentZoomPan(){this._applyZoomTransform(this.pan.x,this.pan.y,this.currZoomLevel),this===this.pswp.currSlide&&this.pswp.dispatch("zoomPanUpdate",{slide:this})}zoomAndPanToInitial(){this.currZoomLevel=this.zoomLevels.initial,this.bounds.update(this.currZoomLevel),Ae(this.pan,this.bounds.center),this.pswp.dispatch("initialZoomPan",{slide:this})}_applyZoomTransform(t,e,i){i/=this.currentResolution||this.zoomLevels.initial,Fe(this.container,t,e,i)}calculateSize(){const{pswp:t}=this;Ae(this.panAreaSize,Ke(t.options,t.viewportSize,this.data,this.index)),this.zoomLevels.update(this.width,this.height,this.panAreaSize),t.dispatch("calcSlideSize",{slide:this})}getCurrentTransform(){const t=this.currZoomLevel/(this.currentResolution||this.zoomLevels.initial);return De(this.pan.x,this.pan.y,t)}_setResolution(t){t!==this.currentResolution&&(this.currentResolution=t,this.updateContentSize(),this.pswp.dispatch("resolutionChanged"))}};function pi(t,e,i){t.classList.add("pswp__button--arrow"),t.setAttribute("aria-controls","pswp__items"),e.on("change",()=>{e.options.loop||(t.disabled=i?!(e.currIndex<e.getNumItems()-1):!(e.currIndex>0))})}var ui={name:"arrowPrev",className:"pswp__button--arrow--prev",title:"Previous",order:10,isButton:!0,appendTo:"wrapper",html:{isCustomSVG:!0,size:60,inner:'<path d="M29 43l-3 3-16-16 16-16 3 3-13 13 13 13z" id="pswp__icn-arrow"/>',outlineID:"pswp__icn-arrow"},onClick:"prev",onInit:pi},mi={name:"arrowNext",className:"pswp__button--arrow--next",title:"Next",order:11,isButton:!0,appendTo:"wrapper",html:{isCustomSVG:!0,size:60,inner:'<use xlink:href="#pswp__icn-arrow"/>',outlineID:"pswp__icn-arrow"},onClick:"next",onInit:(t,e)=>{pi(t,e,!0)}},fi={name:"close",title:"Close",order:20,isButton:!0,html:{isCustomSVG:!0,inner:'<path d="M24 10l-2-2-6 6-6-6-2 2 6 6-6 6 2 2 6-6 6 6 2-2-6-6z" id="pswp__icn-close"/>',outlineID:"pswp__icn-close"},onClick:"close"},gi={name:"zoom",title:"Zoom",order:10,isButton:!0,html:{isCustomSVG:!0,inner:'<path d="M17.426 19.926a6 6 0 1 1 1.5-1.5L23 22.5 21.5 24l-4.074-4.074z" id="pswp__icn-zoom"/><path fill="currentColor" class="pswp__zoom-icn-bar-h" d="M11 16v-2h6v2z"/><path fill="currentColor" class="pswp__zoom-icn-bar-v" d="M13 12h2v6h-2z"/>',outlineID:"pswp__icn-zoom"},onClick:"toggleZoom"},vi={name:"counter",order:5,onInit:(t,e)=>{e.on("change",()=>{t.innerText=e.currIndex+1+e.options.indexIndicatorSep+e.getNumItems()})}},yi={name:"preloader",appendTo:"bar",order:7,html:{isCustomSVG:!0,inner:'<path fill-rule="evenodd" clip-rule="evenodd" d="M21.2 16a5.2 5.2 0 1 1-5.2-5.2V8a8 8 0 1 0 8 8h-2.8Z" id="pswp__icn-loading"/>',outlineID:"pswp__icn-loading"},onInit:(t,e)=>{let i,s=null;const n=e=>{var s;i!==e&&(i=e,s=e,t.classList.toggle("pswp__preloader--active",s))},o=()=>{if(!e.currSlide?.content.isLoading())return n(!1),void(s&&(clearTimeout(s),s=null));s||(s=setTimeout(()=>{n(Boolean(e.currSlide?.content.isLoading())),s=null},e.options.preloaderDelay))};e.on("change",o),e.on("loadComplete",t=>{e.currSlide===t.slide&&o()}),e.ui&&(e.ui.updatePreloaderVisibility=o)}},wi=class{constructor(t,e){const i=e.name||e.className;let s=e.html;if(!1===t.options[i])return;"string"==typeof t.options[`${i}SVG`]&&(s=t.options[`${i}SVG`]),t.dispatch("uiElementCreate",{data:e});let n="";e.isButton?(n+="pswp__button ",n+=e.className||`pswp__button--${e.name}`):n+=e.className||`pswp__${e.name}`;let o=e.isButton?e.tagName||"button":e.tagName||"div";o=o.toLowerCase();const r=ze(n,o);if(e.isButton){"button"===o&&(r.type="button");let{title:s}=e;const{ariaLabel:n}=e;"string"==typeof t.options[`${i}Title`]&&(s=t.options[`${i}Title`]),s&&(r.title=s);const a=n||s;a&&r.setAttribute("aria-label",a)}r.innerHTML=function(t){if("string"==typeof t)return t;if(!t||!t.isCustomSVG)return"";const e=t;let i='<svg aria-hidden="true" class="pswp__icn" viewBox="0 0 %d %d" width="%d" height="%d">';return i=i.split("%d").join(e.size||32),e.outlineID&&(i+=`<use class="pswp__icn-shadow" xlink:href="#${e.outlineID}"/>`),i+=e.inner,i+="</svg>",i}(s),e.onInit&&e.onInit(r,t),e.onClick&&(r.onclick=i=>{"string"==typeof e.onClick?t[e.onClick]():"function"==typeof e.onClick&&e.onClick(i,r,t)});const a=e.appendTo||"bar";let l=t.element;"bar"===a?(t.topBar||(t.topBar=ze("pswp__top-bar pswp__hide-on-close","div",t.scrollWrap)),l=t.topBar):(r.classList.add("pswp__hide-on-close"),"wrapper"===a&&(l=t.scrollWrap)),l?.appendChild(t.applyFilters("uiElement",r,e))}};function _i(t,e){t.classList.toggle("pswp--zoomed-in",e)}var xi=class{constructor(t){this.pswp=t,this.isRegistered=!1,this.uiElementsData=[],this.items=[],this.updatePreloaderVisibility=()=>{},this._lastUpdatedZoomLevel=void 0}init(){const{pswp:t}=this;this.isRegistered=!1,this.uiElementsData=[fi,ui,mi,gi,yi,vi],t.dispatch("uiRegister"),this.uiElementsData.sort((t,e)=>(t.order||0)-(e.order||0)),this.items=[],this.isRegistered=!0,this.uiElementsData.forEach(t=>{this.registerElement(t)}),t.on("change",()=>{t.element?.classList.toggle("pswp--one-slide",1===t.getNumItems())}),t.on("zoomPanUpdate",()=>this._onZoomPanUpdate())}registerElement(t){this.isRegistered?this.items.push(new wi(this.pswp,t)):this.uiElementsData.push(t)}_onZoomPanUpdate(){const{template:t,currSlide:e,options:i}=this.pswp;if(this.pswp.opener.isClosing||!t||!e)return;let{currZoomLevel:s}=e;if(this.pswp.opener.isOpen||(s=e.zoomLevels.initial),s===this._lastUpdatedZoomLevel)return;this._lastUpdatedZoomLevel=s;const n=e.zoomLevels.initial-e.zoomLevels.secondary;if(Math.abs(n)<.01||!e.isZoomable())return _i(t,!1),void t.classList.remove("pswp--zoom-allowed");t.classList.add("pswp--zoom-allowed"),_i(t,(s===e.zoomLevels.initial?e.zoomLevels.secondary:e.zoomLevels.initial)<=s),"zoom"!==i.imageClickAction&&"zoom-or-close"!==i.imageClickAction||t.classList.add("pswp--click-to-zoom")}},bi="cubic-bezier(.4,0,.22,1)",Si=class{constructor(t){this.props=t;const{target:e,onComplete:i,transform:s,onFinish:n=()=>{},duration:o=333,easing:r=bi}=t;this.onFinish=n;const a=s?"transform":"opacity",l=t[a]??"";this._target=e,this._onComplete=i,this._finished=!1,this._onTransitionEnd=this._onTransitionEnd.bind(this),this._helperTimeout=setTimeout(()=>{Me(e,a,o,r),this._helperTimeout=setTimeout(()=>{e.addEventListener("transitionend",this._onTransitionEnd,!1),e.addEventListener("transitioncancel",this._onTransitionEnd,!1),this._helperTimeout=setTimeout(()=>{this._finalizeAnimation()},o+500),e.style[a]=l},30)},0)}_onTransitionEnd(t){t.target===this._target&&this._finalizeAnimation()}_finalizeAnimation(){this._finished||(this._finished=!0,this.onFinish(),this._onComplete&&this._onComplete())}destroy(){this._helperTimeout&&(clearTimeout(this._helperTimeout),this._helperTimeout=null),Me(this._target),this._target.removeEventListener("transitionend",this._onTransitionEnd,!1),this._target.removeEventListener("transitioncancel",this._onTransitionEnd,!1),this._finished||this._finalizeAnimation()}},Pi=class{constructor(t,e,i){this.velocity=1e3*t,this._dampingRatio=e||.75,this._naturalFrequency=i||12,this._dampedFrequency=this._naturalFrequency,this._dampingRatio<1&&(this._dampedFrequency*=Math.sqrt(1-this._dampingRatio*this._dampingRatio))}easeFrame(t,e){let i,s=0;e/=1e3;const n=Math.E**(-this._dampingRatio*this._naturalFrequency*e);if(1===this._dampingRatio)i=this.velocity+this._naturalFrequency*t,s=(t+i*e)*n,this.velocity=s*-this._naturalFrequency+i*n;else if(this._dampingRatio<1){i=1/this._dampedFrequency*(this._dampingRatio*this._naturalFrequency*t+this.velocity);const o=Math.cos(this._dampedFrequency*e),r=Math.sin(this._dampedFrequency*e);s=n*(t*o+i*r),this.velocity=s*-this._naturalFrequency*this._dampingRatio+n*(-this._dampedFrequency*t*r+this._dampedFrequency*i*o)}return s}},Ii=class{constructor(t){this.props=t,this._raf=0;const{start:e,end:i,velocity:s,onUpdate:n,onComplete:o,onFinish:r=()=>{},dampingRatio:a,naturalFrequency:l}=t;this.onFinish=r;const h=new Pi(s,a,l);let c=Date.now(),d=e-i;const p=()=>{this._raf&&(d=h.easeFrame(d,Date.now()-c),Math.abs(d)<1&&Math.abs(h.velocity)<50?(n(i),o&&o(),this.onFinish()):(c=Date.now(),n(d+i),this._raf=requestAnimationFrame(p)))};this._raf=requestAnimationFrame(p)}destroy(){this._raf>=0&&cancelAnimationFrame(this._raf),this._raf=0}},Ci=class{constructor(){this.activeAnimations=[]}startSpring(t){this._start(t,!0)}startTransition(t){this._start(t)}_start(t,e){const i=e?new Ii(t):new Si(t);return this.activeAnimations.push(i),i.onFinish=()=>this.stop(i),i}stop(t){t.destroy();const e=this.activeAnimations.indexOf(t);e>-1&&this.activeAnimations.splice(e,1)}stopAll(){this.activeAnimations.forEach(t=>{t.destroy()}),this.activeAnimations=[]}stopAllPan(){this.activeAnimations=this.activeAnimations.filter(t=>!t.props.isPan||(t.destroy(),!1))}stopMainScroll(){this.activeAnimations=this.activeAnimations.filter(t=>!t.props.isMainScroll||(t.destroy(),!1))}isPanRunning(){return this.activeAnimations.some(t=>t.props.isPan)}},Li=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:()=>{Li=!0}}))}catch(Bi){}var Ti=class{constructor(){this._pool=[]}add(t,e,i,s){this._toggleListener(t,e,i,s)}remove(t,e,i,s){this._toggleListener(t,e,i,s,!0)}removeAll(){this._pool.forEach(t=>{this._toggleListener(t.target,t.type,t.listener,t.passive,!0,!0)}),this._pool=[]}_toggleListener(t,e,i,s,n,o){if(!t)return;const r=n?"removeEventListener":"addEventListener";e.split(" ").forEach(e=>{if(e){o||(n?this._pool=this._pool.filter(s=>s.type!==e||s.listener!==i||s.target!==t):this._pool.push({target:t,type:e,listener:i,passive:s}));const a=!!Li&&{passive:s||!1};t[r](e,i,a)}})}},zi={Escape:27,z:90,ArrowLeft:37,ArrowUp:38,ArrowRight:39,ArrowDown:40,Tab:9},Ai=(t,e)=>e?t:zi[t],Ei=class{constructor(t){this.pswp=t,this._wasFocused=!1,t.on("bindEvents",()=>{t.options.trapFocus&&(t.options.initialPointerPos||this._focusRoot(),t.events.add(document,"focusin",this._onFocusIn.bind(this))),t.events.add(document,"keydown",this._onKeyDown.bind(this))});const e=document.activeElement;t.on("destroy",()=>{t.options.returnFocus&&e&&this._wasFocused&&e.focus()})}_focusRoot(){!this._wasFocused&&this.pswp.element&&(this.pswp.element.focus(),this._wasFocused=!0)}_onKeyDown(t){const{pswp:e}=this;if(e.dispatch("keydown",{originalEvent:t}).defaultPrevented)return;if(He(t))return;let i,s,n=!1;const o="key"in t;switch(o?t.key:t.keyCode){case Ai("Escape",o):e.options.escKey&&(i="close");break;case Ai("z",o):i="toggleZoom";break;case Ai("ArrowLeft",o):s="x";break;case Ai("ArrowUp",o):s="y";break;case Ai("ArrowRight",o):s="x",n=!0;break;case Ai("ArrowDown",o):n=!0,s="y";break;case Ai("Tab",o):this._focusRoot()}if(s){t.preventDefault();const{currSlide:o}=e;e.options.arrowKeys&&"x"===s&&e.getNumItems()>1?i=n?"next":"prev":o&&o.currZoomLevel>o.zoomLevels.fit&&(o.pan[s]+=n?-80:80,o.panTo(o.pan.x,o.pan.y))}i&&(t.preventDefault(),e[i]())}_onFocusIn(t){const{template:e}=this.pswp;e&&document!==t.target&&e!==t.target&&!e.contains(t.target)&&e.focus()}},Oi=class{constructor(t){this.pswp=t,this.x=0,this.slideWidth=0,this._currPositionIndex=0,this._prevPositionIndex=0,this._containerShiftIndex=-1,this.itemHolders=[]}resize(t){const{pswp:e}=this,i=Math.round(e.viewportSize.x+e.viewportSize.x*e.options.spacing),s=i!==this.slideWidth;s&&(this.slideWidth=i,this.moveTo(this.getCurrSlideX())),this.itemHolders.forEach((e,i)=>{s&&Fe(e.el,(i+this._containerShiftIndex)*this.slideWidth),t&&e.slide&&e.slide.resize()})}resetPosition(){this._currPositionIndex=0,this._prevPositionIndex=0,this.slideWidth=0,this._containerShiftIndex=-1}appendHolders(){this.itemHolders=[];for(let t=0;t<3;t++){const e=ze("pswp__item","div",this.pswp.container);e.setAttribute("role","group"),e.setAttribute("aria-roledescription","slide"),e.setAttribute("aria-hidden","true"),e.style.display=1===t?"block":"none",this.itemHolders.push({el:e})}}canBeSwiped(){return this.pswp.getNumItems()>1}moveIndexBy(t,e,i){const{pswp:s}=this;let n=s.potentialIndex+t;const o=s.getNumItems();if(s.canLoop()){n=s.getLoopedIndex(n);const e=(t+o)%o;t=e<=o/2?e:e-o}else n<0?n=0:n>=o&&(n=o-1),t=n-s.potentialIndex;s.potentialIndex=n,this._currPositionIndex-=t,s.animations.stopMainScroll();const r=this.getCurrSlideX();if(e){s.animations.startSpring({isMainScroll:!0,start:this.x,end:r,velocity:i||0,naturalFrequency:30,dampingRatio:1,onUpdate:t=>{this.moveTo(t)},onComplete:()=>{this.updateCurrItem(),s.appendHeavy()}});let t=s.potentialIndex-s.currIndex;if(s.canLoop()){const e=(t+o)%o;t=e<=o/2?e:e-o}Math.abs(t)>1&&this.updateCurrItem()}else this.moveTo(r),this.updateCurrItem();return Boolean(t)}getCurrSlideX(){return this.slideWidth*this._currPositionIndex}isShifted(){return this.x!==this.getCurrSlideX()}updateCurrItem(){const{pswp:t}=this,e=this._prevPositionIndex-this._currPositionIndex;if(!e)return;this._prevPositionIndex=this._currPositionIndex,t.currIndex=t.potentialIndex;let i,s=Math.abs(e);s>=3&&(this._containerShiftIndex+=e+(e>0?-3:3),s=3,this.itemHolders.forEach(t=>{t.slide?.destroy(),t.slide=void 0}));for(let n=0;n<s;n++)e>0?(i=this.itemHolders.shift(),i&&(this.itemHolders[2]=i,this._containerShiftIndex++,Fe(i.el,(this._containerShiftIndex+2)*this.slideWidth),t.setContent(i,t.currIndex-s+n+2))):(i=this.itemHolders.pop(),i&&(this.itemHolders.unshift(i),this._containerShiftIndex--,Fe(i.el,this._containerShiftIndex*this.slideWidth),t.setContent(i,t.currIndex+s-n-2)));Math.abs(this._containerShiftIndex)>50&&!this.isShifted()&&(this.resetPosition(),this.resize()),t.animations.stopAllPan(),this.itemHolders.forEach((t,e)=>{t.slide&&t.slide.setIsActive(1===e)}),t.currSlide=this.itemHolders[1]?.slide,t.contentLoader.updateLazy(e),t.currSlide&&t.currSlide.applyCurrentZoomPan(),t.dispatch("change")}moveTo(t,e){if(!this.pswp.canLoop()&&e){let e=(this.slideWidth*this._currPositionIndex-t)/this.slideWidth;e+=this.pswp.currIndex;const i=Math.round(t-this.x);(e<0&&i>0||e>=this.pswp.getNumItems()-1&&i<0)&&(t=this.x+.35*i)}this.x=t,this.pswp.container&&Fe(this.pswp.container,t),this.pswp.dispatch("moveMainScroll",{x:t,dragging:e??!1})}},ki=.003,Zi=class{constructor(t){this.pswp=t,this.isClosed=!0,this.isOpen=!1,this.isClosing=!1,this.isOpening=!1,this._duration=void 0,this._useAnimation=!1,this._croppedZoom=!1,this._animateRootOpacity=!1,this._animateBgOpacity=!1,this._placeholder=void 0,this._opacityElement=void 0,this._cropContainer1=void 0,this._cropContainer2=void 0,this._thumbBounds=void 0,this._prepareOpen=this._prepareOpen.bind(this),t.on("firstZoomPan",this._prepareOpen)}open(){this._prepareOpen(),this._start()}close(){if(this.isClosed||this.isClosing||this.isOpening)return;const t=this.pswp.currSlide;this.isOpen=!1,this.isOpening=!1,this.isClosing=!0,this._duration=this.pswp.options.hideAnimationDuration,t&&t.currZoomLevel*t.width>=this.pswp.options.maxWidthToAnimate&&(this._duration=0),this._applyStartProps(),setTimeout(()=>{this._start()},this._croppedZoom?30:0)}_prepareOpen(){if(this.pswp.off("firstZoomPan",this._prepareOpen),!this.isOpening){const t=this.pswp.currSlide;this.isOpening=!0,this.isClosing=!1,this._duration=this.pswp.options.showAnimationDuration,t&&t.zoomLevels.initial*t.width>=this.pswp.options.maxWidthToAnimate&&(this._duration=0),this._applyStartProps()}}_applyStartProps(){const{pswp:t}=this,e=this.pswp.currSlide,{options:i}=t;if("fade"===i.showHideAnimationType?(i.showHideOpacity=!0,this._thumbBounds=void 0):"none"===i.showHideAnimationType?(i.showHideOpacity=!1,this._duration=0,this._thumbBounds=void 0):this.isOpening&&t._initialThumbBounds?this._thumbBounds=t._initialThumbBounds:this._thumbBounds=this.pswp.getThumbBounds(),this._placeholder=e?.getPlaceholderElement(),t.animations.stopAll(),this._useAnimation=Boolean(this._duration&&this._duration>50),this._animateZoom=Boolean(this._thumbBounds)&&e?.content.usePlaceholder()&&(!this.isClosing||!t.mainScroll.isShifted()),this._animateZoom?this._animateRootOpacity=i.showHideOpacity??!1:(this._animateRootOpacity=!0,this.isOpening&&e&&(e.zoomAndPanToInitial(),e.applyCurrentZoomPan())),this._animateBgOpacity=!this._animateRootOpacity&&this.pswp.options.bgOpacity>ki,this._opacityElement=this._animateRootOpacity?t.element:t.bg,!this._useAnimation)return this._duration=0,this._animateZoom=!1,this._animateBgOpacity=!1,this._animateRootOpacity=!0,void(this.isOpening&&(t.element&&(t.element.style.opacity=String(ki)),t.applyBgOpacity(1)));this._animateZoom&&this._thumbBounds&&this._thumbBounds.innerRect?(this._croppedZoom=!0,this._cropContainer1=this.pswp.container,this._cropContainer2=this.pswp.currSlide?.holderElement,t.container&&(t.container.style.overflow="hidden",t.container.style.width=`${t.viewportSize.x}px`)):this._croppedZoom=!1,this.isOpening?(this._animateRootOpacity?(t.element&&(t.element.style.opacity=String(ki)),t.applyBgOpacity(1)):(this._animateBgOpacity&&t.bg&&(t.bg.style.opacity=String(ki)),t.element&&(t.element.style.opacity="1")),this._animateZoom&&(this._setClosedStateZoomPan(),this._placeholder&&(this._placeholder.style.willChange="transform",this._placeholder.style.opacity=String(ki)))):this.isClosing&&(t.mainScroll.itemHolders[0]&&(t.mainScroll.itemHolders[0].el.style.display="none"),t.mainScroll.itemHolders[2]&&(t.mainScroll.itemHolders[2].el.style.display="none"),this._croppedZoom&&0!==t.mainScroll.x&&(t.mainScroll.resetPosition(),t.mainScroll.resize()))}_start(){this.isOpening&&this._useAnimation&&this._placeholder&&"IMG"===this._placeholder.tagName?new Promise(t=>{let e=!1,i=!0;var s;(s=this._placeholder,"decode"in s?s.decode().catch(()=>{}):s.complete?Promise.resolve(s):new Promise((t,e)=>{s.onload=()=>t(s),s.onerror=e})).finally(()=>{e=!0,i||t(!0)}),setTimeout(()=>{i=!1,e&&t(!0)},50),setTimeout(t,250)}).finally(()=>this._initiate()):this._initiate()}_initiate(){this.pswp.element?.style.setProperty("--pswp-transition-duration",`${this._duration}ms`),this.pswp.dispatch(this.isOpening?"openingAnimationStart":"closingAnimationStart"),this.pswp.dispatch("initialZoom"+(this.isOpening?"In":"Out")),this.pswp.element?.classList.toggle("pswp--ui-visible",this.isOpening),this.isOpening?(this._placeholder&&(this._placeholder.style.opacity="1"),this._animateToOpenState()):this.isClosing&&this._animateToClosedState(),this._useAnimation||this._onAnimationComplete()}_onAnimationComplete(){const{pswp:t}=this;this.isOpen=this.isOpening,this.isClosed=this.isClosing,this.isOpening=!1,this.isClosing=!1,t.dispatch(this.isOpen?"openingAnimationEnd":"closingAnimationEnd"),t.dispatch("initialZoom"+(this.isOpen?"InEnd":"OutEnd")),this.isClosed?t.destroy():this.isOpen&&(this._animateZoom&&t.container&&(t.container.style.overflow="visible",t.container.style.width="100%"),t.currSlide?.applyCurrentZoomPan())}_animateToOpenState(){const{pswp:t}=this;this._animateZoom&&(this._croppedZoom&&this._cropContainer1&&this._cropContainer2&&(this._animateTo(this._cropContainer1,"transform","translate3d(0,0,0)"),this._animateTo(this._cropContainer2,"transform","none")),t.currSlide&&(t.currSlide.zoomAndPanToInitial(),this._animateTo(t.currSlide.container,"transform",t.currSlide.getCurrentTransform()))),this._animateBgOpacity&&t.bg&&this._animateTo(t.bg,"opacity",String(t.options.bgOpacity)),this._animateRootOpacity&&t.element&&this._animateTo(t.element,"opacity","1")}_animateToClosedState(){const{pswp:t}=this;this._animateZoom&&this._setClosedStateZoomPan(!0),this._animateBgOpacity&&t.bgOpacity>.01&&t.bg&&this._animateTo(t.bg,"opacity","0"),this._animateRootOpacity&&t.element&&this._animateTo(t.element,"opacity","0")}_setClosedStateZoomPan(t){if(!this._thumbBounds)return;const{pswp:e}=this,{innerRect:i}=this._thumbBounds,{currSlide:s,viewportSize:n}=e;if(this._croppedZoom&&i&&this._cropContainer1&&this._cropContainer2){const e=-n.x+(this._thumbBounds.x-i.x)+i.w,s=-n.y+(this._thumbBounds.y-i.y)+i.h,o=n.x-i.w,r=n.y-i.h;t?(this._animateTo(this._cropContainer1,"transform",De(e,s)),this._animateTo(this._cropContainer2,"transform",De(o,r))):(Fe(this._cropContainer1,e,s),Fe(this._cropContainer2,o,r))}s&&(Ae(s.pan,i||this._thumbBounds),s.currZoomLevel=this._thumbBounds.w/s.width,t?this._animateTo(s.container,"transform",s.getCurrentTransform()):s.applyCurrentZoomPan())}_animateTo(t,e,i){if(!this._duration)return void(t.style[e]=i);const{animations:s}=this.pswp,n={duration:this._duration,easing:this.pswp.options.easing,onComplete:()=>{s.activeAnimations.length||this._onAnimationComplete()},target:t};n[e]=i,s.startTransition(n)}},Di=class{constructor(t){this.pswp=t,t.events.add(t.element,"wheel",this._onWheel.bind(this))}_onWheel(t){t.preventDefault();const{currSlide:e}=this.pswp;let{deltaX:i,deltaY:s}=t;if(e&&!this.pswp.dispatch("wheel",{originalEvent:t}).defaultPrevented)if(t.ctrlKey||this.pswp.options.wheelToZoom){if(e.isZoomable()){let i=-s;1===t.deltaMode?i*=.05:i*=t.deltaMode?1:.002,i=2**i;const n=e.currZoomLevel*i;e.zoomTo(n,{x:t.clientX,y:t.clientY})}}else e.isPannable()&&(1===t.deltaMode&&(i*=18,s*=18),e.panTo(e.pan.x-i,e.pan.y-s))}},Fi={allowPanToNext:!0,spacing:.1,loop:!0,pinchToClose:!0,closeOnVerticalDrag:!0,hideAnimationDuration:333,showAnimationDuration:333,zoomAnimationDuration:333,escKey:!0,arrowKeys:!0,trapFocus:!0,returnFocus:!0,maxWidthToAnimate:4e3,clickToCloseNonZoomable:!0,imageClickAction:"zoom-or-close",bgClickAction:"close",tapAction:"toggle-controls",doubleTapAction:"zoom",indexIndicatorSep:" / ",preloaderDelay:2e3,bgOpacity:.8,index:0,errorMsg:"The image cannot be loaded",preload:[1,2],easing:"cubic-bezier(.4,0,.22,1)"},Mi=class extends ii{constructor(t){super(),this.options=this._prepareOptions(t||{}),this.offset={x:0,y:0},this._prevViewportSize={x:0,y:0},this.viewportSize={x:0,y:0},this.bgOpacity=1,this.currIndex=0,this.potentialIndex=0,this.isOpen=!1,this.isDestroying=!1,this.hasMouse=!1,this._initialItemData={},this._initialThumbBounds=void 0,this.topBar=void 0,this.element=void 0,this.template=void 0,this.container=void 0,this.scrollWrap=void 0,this.currSlide=void 0,this.events=new Ti,this.animations=new Ci,this.mainScroll=new Oi(this),this.gestures=new hi(this),this.opener=new Zi(this),this.keyboard=new Ei(this),this.contentLoader=new Je(this)}init(){if(this.isOpen||this.isDestroying)return!1;this.isOpen=!0,this.dispatch("init"),this.dispatch("beforeOpen"),this._createMainStructure();let t="pswp--open";return this.gestures.supportsTouch&&(t+=" pswp--touch"),this.options.mainClass&&(t+=` ${this.options.mainClass}`),this.element&&(this.element.className+=` ${t}`),this.currIndex=this.options.index||0,this.potentialIndex=this.currIndex,this.dispatch("firstUpdate"),this.scrollWheel=new Di(this),(Number.isNaN(this.currIndex)||this.currIndex<0||this.currIndex>=this.getNumItems())&&(this.currIndex=0),this.gestures.supportsTouch||this.mouseDetected(),this.updateSize(),this.offset.y=window.pageYOffset,this._initialItemData=this.getItemData(this.currIndex),this.dispatch("gettingData",{index:this.currIndex,data:this._initialItemData,slide:void 0}),this._initialThumbBounds=this.getThumbBounds(),this.dispatch("initialLayout"),this.on("openingAnimationEnd",()=>{const{itemHolders:t}=this.mainScroll;t[0]&&(t[0].el.style.display="block",this.setContent(t[0],this.currIndex-1)),t[2]&&(t[2].el.style.display="block",this.setContent(t[2],this.currIndex+1)),this.appendHeavy(),this.contentLoader.updateLazy(),this.events.add(window,"resize",this._handlePageResize.bind(this)),this.events.add(window,"scroll",this._updatePageScrollOffset.bind(this)),this.dispatch("bindEvents")}),this.mainScroll.itemHolders[1]&&this.setContent(this.mainScroll.itemHolders[1],this.currIndex),this.dispatch("change"),this.opener.open(),this.dispatch("afterInit"),!0}getLoopedIndex(t){const e=this.getNumItems();return this.options.loop&&(t>e-1&&(t-=e),t<0&&(t+=e)),Ze(t,0,e-1)}appendHeavy(){this.mainScroll.itemHolders.forEach(t=>{t.slide?.appendHeavy()})}goTo(t){this.mainScroll.moveIndexBy(this.getLoopedIndex(t)-this.potentialIndex,!0)}next(){this.goTo(this.potentialIndex+1)}prev(){this.goTo(this.potentialIndex-1)}zoomTo(...t){this.currSlide?.zoomTo(...t)}toggleZoom(){this.currSlide?.toggleZoom()}close(){this.opener.isOpen&&!this.isDestroying&&(this.isDestroying=!0,this.dispatch("close"),this.events.removeAll(),this.opener.close())}destroy(){if(!this.isDestroying)return this.options.showHideAnimationType="none",void this.close();this.dispatch("destroy"),this._listeners={},this.scrollWrap&&(this.scrollWrap.ontouchmove=null,this.scrollWrap.ontouchend=null),this.element?.remove(),this.mainScroll.itemHolders.forEach(t=>{t.slide?.destroy()}),this.contentLoader.destroy(),this.events.removeAll()}refreshSlideContent(t){this.contentLoader.removeByIndex(t),this.mainScroll.itemHolders.forEach((e,i)=>{let s=(this.currSlide?.index??0)-1+i;this.canLoop()&&(s=this.getLoopedIndex(s)),s===t&&(this.setContent(e,t,!0),1===i&&(this.currSlide=e.slide,e.slide?.setIsActive(!0)))}),this.dispatch("change")}setContent(t,e,i){if(this.canLoop()&&(e=this.getLoopedIndex(e)),t.slide){if(t.slide.index===e&&!i)return;t.slide.destroy(),t.slide=void 0}!this.canLoop()&&(e<0||e>=this.getNumItems())||(t.slide=new di(this.getItemData(e),e,this),e===this.currIndex&&(this.currSlide=t.slide),t.slide.append(t.el))}getViewportCenterPoint(){return{x:this.viewportSize.x/2,y:this.viewportSize.y/2}}updateSize(t){if(this.isDestroying)return;const e=Ue(this.options,this);!t&&ke(e,this._prevViewportSize)||(Ae(this._prevViewportSize,e),this.dispatch("beforeResize"),Ae(this.viewportSize,this._prevViewportSize),this._updatePageScrollOffset(),this.dispatch("viewportSize"),this.mainScroll.resize(this.opener.isOpen),!this.hasMouse&&window.matchMedia("(any-hover: hover)").matches&&this.mouseDetected(),this.dispatch("resize"))}applyBgOpacity(t){this.bgOpacity=Math.max(t,0),this.bg&&(this.bg.style.opacity=String(this.bgOpacity*this.options.bgOpacity))}mouseDetected(){this.hasMouse||(this.hasMouse=!0,this.element?.classList.add("pswp--has_mouse"))}_handlePageResize(){this.updateSize(),/iPhone|iPad|iPod/i.test(window.navigator.userAgent)&&setTimeout(()=>{this.updateSize()},500)}_updatePageScrollOffset(){this.setScrollOffset(0,window.pageYOffset)}setScrollOffset(t,e){this.offset.x=t,this.offset.y=e,this.dispatch("updateScrollOffset")}_createMainStructure(){this.element=ze("pswp","div"),this.element.setAttribute("tabindex","-1"),this.element.setAttribute("role","dialog"),this.template=this.element,this.bg=ze("pswp__bg","div",this.element),this.scrollWrap=ze("pswp__scroll-wrap","section",this.element),this.container=ze("pswp__container","div",this.scrollWrap),this.scrollWrap.setAttribute("aria-roledescription","carousel"),this.container.setAttribute("aria-live","off"),this.container.setAttribute("id","pswp__items"),this.mainScroll.appendHolders(),this.ui=new xi(this),this.ui.init(),(this.options.appendToEl||document.body).appendChild(this.element)}getThumbBounds(){return function(t,e,i){const s=i.dispatch("thumbBounds",{index:t,itemData:e,instance:i});if(s.thumbBounds)return s.thumbBounds;const{element:n}=e;let o,r;if(n&&!1!==i.options.thumbSelector){const t=i.options.thumbSelector||"img";r=n.matches(t)?n:n.querySelector(t)}return r=i.applyFilters("thumbEl",r,e,t),r&&(o=e.thumbCropped?function(t,e,i){const s=t.getBoundingClientRect(),n=s.width/e,o=s.height/i,r=n>o?n:o,a=(s.width-e*r)/2,l=(s.height-i*r)/2,h={x:s.left+a,y:s.top+l,w:e*r};return h.innerRect={w:s.width,h:s.height,x:a,y:l},h}(r,e.width||e.w||0,e.height||e.h||0):function(t){const e=t.getBoundingClientRect();return{x:e.left,y:e.top,w:e.width}}(r)),i.applyFilters("thumbBounds",o,e,t)}(this.currIndex,this.currSlide?this.currSlide.data:this._initialItemData,this)}canLoop(){return this.options.loop&&this.getNumItems()>2}_prepareOptions(t){return window.matchMedia("(prefers-reduced-motion), (update: slow)").matches&&(t.showHideAnimationType="none",t.zoomAnimationDuration=0),{...Fi,...t}}},Ni=()=>Promise.resolve(Mi);export{qt as _,se as a,Bt as b,le as c,ee as d,te as f,Ut as g,Xt as h,Ce as i,ae as l,Yt as m,si as n,re as o,Qt as p,Te as r,ce as s,Ni as t,he as u,$t as v,jt as y};