@qratilabs/qrati-connect 2.19.1 → 2.20.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.
- package/CHANGELOG.md +8 -0
- package/element/-uMLlqBc.js +2 -0
- package/element/ApyjFWKp.js +1 -0
- package/element/B4hg-Jzn.js +1 -0
- package/element/B8wY2BB-.js +3 -0
- package/element/BeYymwyj.js +4 -0
- package/element/CVV1-SpK.js +19 -0
- package/element/{DPCT8N8u.js → CjX00Gkn.js} +3 -3
- package/element/CoFGfneL.js +1 -0
- package/element/Cx7fRstJ.js +3 -0
- package/element/DKsx0Y8e.js +1 -0
- package/element/DRvEkh_Q.js +8 -0
- package/element/DagK3kTO.js +1 -0
- package/element/DjmdQPk0.js +4 -0
- package/element/cP0JEJfS.js +8 -0
- package/element/h5ayNw6S.js +46 -0
- package/element/web.es.js +426 -421
- package/package.json +1 -1
- package/react/{GqoKkUUo.js → BNa8-_2x.js} +1 -1
- package/react/{D25CQslU.js → BWhJS_45.js} +1 -1
- package/react/{3ELkYr5x.js → BWxkj9As.js} +1 -1
- package/react/{DSpGEHWU.js → B_KzP4r-.js} +1 -1
- package/react/{BUvxnH1l.js → BdOUN6H_.js} +1 -1
- package/react/{C8gjgLEP.js → BfQxUZ0J.js} +1 -1
- package/react/{e-di_fDQ.js → BgbYxvAG.js} +1 -1
- package/react/{CBlgNA7o.js → Bnv453PP.js} +1 -1
- package/react/{C5ddJD1C.js → C4byNc5q.js} +1 -1
- package/react/CS1Kg8-a.js +1 -0
- package/react/CWGMt62d.js +1 -0
- package/react/{QIpqvNGH.js → CnvASFmW.js} +1 -1
- package/react/Cqdhu1W9.js +1 -0
- package/react/{Dx3fTflu.js → CuZJVIKY.js} +1 -1
- package/react/{Bv-kIUzA.js → Cv1wuK5j.js} +1 -1
- package/react/{A5j-APoo.js → D16FFwT7.js} +1 -1
- package/react/{Denx3bSB.js → DDAabcWl.js} +1 -1
- package/react/DI13WO77.js +1 -0
- package/react/{DpdtQZDC.js → DM06aQTo.js} +1 -1
- package/react/DSiikjS9.js +1 -0
- package/react/{CC-KD1vv.js → DyMH2oz_.js} +1 -1
- package/react/K73cs4am.js +1 -0
- package/react/{Bec5xeLU.js → KsnrAVz9.js} +1 -1
- package/react/RkYXaQ5u.js +1 -0
- package/react/{Vri3EOjK.js → f9e52Yxy.js} +1 -1
- package/react/index.cjs +1 -1
- package/react/index.mjs +114 -109
- package/react/{_Zgp2alp.js → lh7wQOsu.js} +3 -3
- package/react/{BxRpgZYF.js → mnlJJuSr.js} +1 -1
- package/react/{-pPiIksh.js → smVbZ37h.js} +1 -1
- package/umd/web.umd.js +1 -1
- package/element/9hFRKQTz.js +0 -3
- package/element/BDfS178N.js +0 -3
- package/element/BPJdmb-n.js +0 -46
- package/element/BcbTpgCL.js +0 -4
- package/element/Bthg7jjx.js +0 -1
- package/element/CJHwaZlF.js +0 -4
- package/element/CRkKvdFk.js +0 -19
- package/element/D2Ekv0BO.js +0 -2
- package/element/DcYOBkni.js +0 -8
- package/element/rfpQMFBA.js +0 -8
- package/react/CcHquimJ.js +0 -1
- /package/element/{CMbOX_GS.js → BAMB7Uoo.js} +0 -0
- /package/element/{C6TX_i0I.js → BzIJspY1.js} +0 -0
- /package/element/{DgGPkDRT.js → CjmNvKgB.js} +0 -0
- /package/element/{BxbCvlCo.js → D1zX23l-.js} +0 -0
- /package/element/{CzSmu5XM.js → DUJAMyRv.js} +0 -0
- /package/element/{CIcND0Dg.js → PPVqva_9.js} +0 -0
- /package/element/{Cdux6g1i.js → tPk8Ov5I.js} +0 -0
- /package/react/{Cdux6g1i.js → BJ85RnFv.js} +0 -0
- /package/react/{BvVjd_UK.js → Bp3BRlhW.js} +0 -0
- /package/react/{BCc5Yj_f.js → BszowxAR.js} +0 -0
- /package/react/{BH8UJKb5.js → BtTYXVAR.js} +0 -0
- /package/react/{DJTeOMQR.js → BvT0jQ3V.js} +0 -0
- /package/react/{BAKN93OB.js → Byq3TC8k.js} +0 -0
- /package/react/{qy2OAEht.js → C5dmblnS.js} +0 -0
- /package/react/{fwmxAw7l.js → D2h6qyms.js} +0 -0
- /package/react/{DlCuoz_e.js → D7BzZEsL.js} +0 -0
- /package/react/{C8D6WaBQ.js → DSaIeQ30.js} +0 -0
- /package/react/{DiysJlOc.js → DYeIUbVU.js} +0 -0
- /package/react/{I7IwY3sd.js → Y-mDLYqW.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e}from"./Bto__AIV.js";import{At as t,Ct as r,Et as n,V as o,et as s,g as i,jt as l,p as a,r as c,wt as u,y as d}from"./
|
|
1
|
+
import{n as e}from"./Bto__AIV.js";import{At as t,Ct as r,Et as n,V as o,et as s,g as i,jt as l,p as a,r as c,wt as u,y as d}from"./DM06aQTo.js";import{t as p}from"./KsnrAVz9.js";import{a as m,i as f,n as g,o as y,r as h,t as b}from"./D16FFwT7.js";var v={top:60,bottom:60,left:276,right:60},x="#fb8500",w=new p,L=(e,t,r)=>{l(/* @__PURE__ */d(s,{client:w,children:/* @__PURE__ */d(c,{children:/* @__PURE__ */d(m,{event:e,onExplore:r})})}),t)},C=e=>{const t=document.createElement("div");t.style.cssText=`\n background:${h(e.color,"#fb8500")};color:#fff;border-radius:20px;padding:5px 10px;\n font-size:12px;font-weight:600;white-space:nowrap;cursor:pointer;\n box-shadow:0 2px 8px rgba(0,0,0,0.25);border:2px solid rgba(255,255,255,0.4);\n display:inline-flex;align-items:center;gap:6px;\n `;const r=document.createElement("span");r.textContent=e.folder.name;const n=document.createElement("span");return n.style.cssText="background:rgba(0,0,0,0.18);border-radius:10px;padding:1px 5px;font-size:10px;",n.textContent=String(e.eventCount),t.appendChild(r),t.appendChild(n),t},z=({apiKey:s,is3D:l,onExplore:c,logoUrl:p})=>{const m=r(null),h=r(null),w=r(null),z=r(l),E=r([]),k=r([]),_=r(null),j=r(!1),T=r(!1),F=r(null),[S,B]=n(l),Z=u(()=>(()=>{try{const e=sessionStorage.getItem(o);if(!e)return null;const t=JSON.parse(e);if(Array.isArray(t?.center)&&"number"==typeof t.zoom)return t}catch{}return null})(),[]),[D,A]=n(!1),[I,M]=n(!0),{folderTree:O,activeFolderId:U,activeFolder:P,visibleEvents:R,setActiveFolderId:W,isLoadingEvents:$}=y(),{organization:q}=a(),J=()=>{E.current.forEach(e=>e.remove()),E.current=[]},N=()=>{k.current.forEach(e=>e.remove()),k.current=[]},K=(e,t)=>{const r=t?"visible":"none";for(const n of["heatmap","event-clusters","cluster-count","unclustered-point"])e.getLayer(n)&&e.setLayoutProperty(n,"visibility",r)};return t(()=>{if(!m.current||h.current)return;let t,r=!1;return(async()=>{try{const n=(await import("./DSaIeQ30.js").then(t=>/* @__PURE__ */e(t.default,1))).default;if(r)return;if(!m.current)return;const i=Z?.center??[0,20],l=Z?.zoom??3,a=new n.Map({container:m.current,style:`https://api.maptiler.com/maps/streets-v2/style.json?key=${s}`,center:i,zoom:l,minZoom:0,pitch:0,bearing:0,renderWorldCopies:!1,projection:z.current?{type:"globe"}:{type:"mercator"},canvasContextAttributes:{antialias:!0}});h.current=a,w.current=n,a.on("load",()=>{if(r)return;const e=a.getStyle()?.layers??[];let t,o;for(const r of e){const e=r;"symbol"===e.type&&e.layout?.["text-field"]&&!t&&(t=r.id),"building"!==e["source-layer"]||o||(o=e.source)}o&&!a.getLayer("3d-buildings")&&a.addLayer({id:"3d-buildings",source:o,"source-layer":"building",filter:["has","render_height"],type:"fill-extrusion",minzoom:2,paint:{"fill-extrusion-color":["interpolate",["linear"],["get","render_height"],0,"lightgray",200,"royalblue",400,"lightblue"],"fill-extrusion-height":["interpolate",["linear"],["zoom"],14,0,15,["get","render_height"]],"fill-extrusion-base":["case",["has","render_min_height"],["get","render_min_height"],0],"fill-extrusion-opacity":.6}},t),a.addSource("all-events",{type:"geojson",data:{type:"FeatureCollection",features:[]},cluster:!0,clusterRadius:50,clusterMaxZoom:14}),a.addSource("heat-events",{type:"geojson",data:{type:"FeatureCollection",features:[]}}),a.addLayer({id:"heatmap",type:"heatmap",source:"heat-events",layout:{visibility:"none"},paint:{"heatmap-weight":["interpolate",["linear"],["get","views"],0,0,200,1],"heatmap-intensity":["interpolate",["linear"],["zoom"],0,1,9,3],"heatmap-color":["interpolate",["linear"],["heatmap-density"],0,"rgba(33,102,172,0)",.2,"rgb(103,169,207)",.4,"rgb(209,229,240)",.6,"rgb(253,219,199)",.8,"rgb(239,138,98)",1,"rgb(178,24,43)"],"heatmap-radius":["interpolate",["linear"],["zoom"],0,4,9,30],"heatmap-opacity":["interpolate",["linear"],["zoom"],6,.85,11,0]}}),a.addLayer({id:"event-clusters",type:"circle",source:"all-events",layout:{visibility:"none"},filter:["has","point_count"],paint:{"circle-color":["step",["get","point_count"],x,10,"#e63946",30,"#9b2226"],"circle-radius":["step",["get","point_count"],16,10,20,30,26],"circle-stroke-width":2,"circle-stroke-color":"#fff"}}),a.addLayer({id:"cluster-count",type:"symbol",source:"all-events",layout:{visibility:"none","text-field":"{point_count_abbreviated}","text-size":12},paint:{"text-color":"#fff"}}),a.addLayer({id:"unclustered-point",type:"circle",source:"all-events",layout:{visibility:"none"},filter:["!",["has","point_count"]],paint:{"circle-radius":7,"circle-color":x,"circle-stroke-color":"#fff","circle-stroke-width":2}}),a.on("click","event-clusters",e=>{const t=a.queryRenderedFeatures(e.point,{layers:["event-clusters"]});if(!t.length)return;const r=t[0].properties?.cluster_id,n=a.getSource("all-events");r&&n?.getClusterExpansionZoom&&n.getClusterExpansionZoom(r,(e,r)=>{e||"number"!=typeof r||a.easeTo({center:t[0].geometry.coordinates,zoom:r,duration:600})})}),a.on("click","unclustered-point",e=>{const t=e.features?.[0];if(!t)return;const r=t.geometry.coordinates.slice(0,2),o=t.properties??{},s={_id:o._id,slug:o.slug,name:o.name,views:o.views,location:{x:r[0],y:r[1],label:o.label},contents:o.thumbnailUrl?[{thumbnailUrl:o.thumbnailUrl}]:[]};F.current&&(F.current.remove(),F.current=null);const i=document.createElement("div");L(s,i,c);const l=new n.Popup({closeButton:!0,closeOnClick:!1,maxWidth:"none",offset:[0,-10]}).setLngLat(r).setDOMContent(i).addTo(a);F.current=l,l.on("close",()=>{F.current===l&&(F.current=null)})}),a.on("click",e=>{!a.queryRenderedFeatures(e.point,{layers:["event-clusters","unclustered-point"]}).length&&F.current&&(F.current.remove(),F.current=null)}),a.on("mouseenter","event-clusters",()=>{a.getCanvas().style.cursor="pointer"}),a.on("mouseleave","event-clusters",()=>{a.getCanvas().style.cursor=""}),a.on("mouseenter","unclustered-point",()=>{a.getCanvas().style.cursor="pointer"}),a.on("mouseleave","unclustered-point",()=>{a.getCanvas().style.cursor=""}),A(!0),M(!1)});const u=()=>{_.current&&clearTimeout(_.current),_.current=setTimeout(()=>{try{const e=a.getCenter();sessionStorage.setItem(o,JSON.stringify({center:[e.lng,e.lat],zoom:a.getZoom()}))}catch{}},250)};a.on("zoomend",u),a.on("moveend",u),t=()=>{J(),N(),_.current&&clearTimeout(_.current),a.off("zoomend",u),a.off("moveend",u),a.remove(),h.current=null,w.current=null}}finally{r||M(!1)}})(),()=>{r=!0,t?.()}},[s]),t(()=>{if(!D)return;const e=h.current,t=w.current;if(e&&t)if(J(),N(),null===U&&O.length>0){K(e,!1);const r=n=>{for(const o of n)if(o.centroid){const r=C(o);r.addEventListener("click",()=>W(o.folder._id));const n=new t.Marker({element:r,anchor:"center"}).setLngLat([o.centroid[0],o.centroid[1]]).addTo(e);E.current.push(n)}else o.children.length>0&&r(o.children)};r(O)}else if(0===O.length&&null===U){if(0===R.length)return;const r=R.map(e=>({type:"Feature",geometry:{type:"Point",coordinates:[e.location.x,e.location.y]},properties:{_id:e._id,slug:e.slug,name:e.name,views:e.views??0,label:e.location?.label??"",thumbnailUrl:e.contents?.[0]?.thumbnailUrl??""}})),n={type:"FeatureCollection",features:r};if(e.getSource("all-events")?.setData(n),e.getSource("heat-events")?.setData({...n,features:r.map(e=>({...e,properties:{views:e.properties.views}}))}),K(e,!0),!T.current&&(T.current=!0,!Z)){const r=new t.LngLatBounds;R.forEach(e=>r.extend([e.location.x,e.location.y])),r.isEmpty()||e.fitBounds(r,{padding:v,maxZoom:8,duration:800})}}else{if(0===R.length)return;K(e,!1);const r=P?.color||x,n=new t.LngLatBounds;R.forEach(o=>{const s=o.location.x,i=o.location.y;n.extend([s,i]);const l=((e,t)=>{const r=document.createElement("div");if(r.style.cssText=`\n width:36px;height:36px;cursor:pointer;\n background:${e};border-radius:50% 50% 50% 0;transform:rotate(-45deg);\n border:2px solid white;box-shadow:0 2px 8px rgba(0,0,0,0.3);\n display:flex;align-items:center;justify-content:center;overflow:hidden;\n `,t){const e=document.createElement("img");e.src=f(t)??"",e.style.cssText="width:24px;height:24px;border-radius:50%;object-fit:cover;transform:rotate(45deg);",r.appendChild(e)}return r})(r,p);l.addEventListener("click",()=>{F.current&&(F.current.remove(),F.current=null);const r=document.createElement("div");L(o,r,c);const n=new t.Popup({closeButton:!0,closeOnClick:!1,maxWidth:"none",offset:[0,-40]}).setLngLat([s,i]).setDOMContent(r).addTo(e);F.current=n,n.on("close",()=>{F.current===n&&(F.current=null)})});const a=new t.Marker({element:l}).setLngLat([s,i]).addTo(e);k.current.push(a)})}},[U,O,R,D,c,p,W,P,Z]),t(()=>{if(!D)return;const e=h.current;if(!e)return;if(!j.current&&Z)return void(j.current=!0);j.current=!0;const t={padding:v,duration:3e3,essential:!0};if(U){const r=g(O,U);if(!r?.folder.boundary?.length)return;const n=w.current;if(!n)return;const o=new n.LngLatBounds;for(const e of r.folder.boundary)o.extend([e.x,e.y]);o.isEmpty()||e.fitBounds(o,{...t,maxZoom:14})}else if(O.length>0){const r=w.current;if(!r)return;const n=new r.LngLatBounds,o=e=>{for(const t of e)t.centroid?n.extend([t.centroid[0],t.centroid[1]]):o(t.children)};o(O),n.isEmpty()||e.fitBounds(n,{...t,maxZoom:8})}},[U,O,D,Z]),t(()=>{h.current&&(z.current=S,h.current.setProjection(S?{type:"globe"}:{type:"mercator"}),h.current.easeTo({pitch:0,bearing:0,duration:600}))},[S]),/* @__PURE__ */d("div",{class:"relative h-screen w-full sm:h-[calc(100vh-4rem)]",style:i(q),children:[
|
|
2
2
|
/* @__PURE__ */d(b,{positionClass:"absolute top-3 left-16 z-[1000]",folderTree:O,activeFolderId:U,setActiveFolderId:W}),
|
|
3
3
|
/* @__PURE__ */d("button",{type:"button",onClick:()=>B(e=>!e),class:"bg-background hover:bg-foreground/10 absolute top-4 right-4 z-[1000] rounded-xl px-3 py-2 text-xs font-semibold shadow-lg backdrop-blur-sm",children:S?"2D":"3D"}),$&&/* @__PURE__ */d("div",{class:"absolute inset-0 z-10 flex items-center justify-center bg-white/60",children:/* @__PURE__ */d("div",{class:"border-primary size-10 animate-spin rounded-full border-4 border-t-transparent"})}),I&&/* @__PURE__ */d("div",{class:"absolute inset-0 z-20 flex items-center justify-center bg-white/85",children:/* @__PURE__ */d("div",{class:"flex flex-col items-center gap-3",children:[/* @__PURE__ */d("div",{class:"border-primary size-10 animate-spin rounded-full border-4 border-t-transparent"}),/* @__PURE__ */d("p",{class:"text-sm font-medium text-slate-700",children:"Loading map…"})]})}),
|
|
4
4
|
/* @__PURE__ */d("div",{ref:m,class:"size-full"})]})};export{z as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./
|
|
1
|
+
const e=require("./DI13WO77.js");var r=e.z(()=>Promise.resolve().then(()=>require("./CnvASFmW.js"))),t=e.z(()=>Promise.resolve().then(()=>require("./BgbYxvAG.js"))),o=e.z(()=>Promise.resolve().then(()=>require("./mnlJJuSr.js"))),l=e.z(()=>Promise.resolve().then(()=>require("./BfQxUZ0J.js"))),s=()=>e.u("div",{class:"flex h-full items-center justify-center",children:e.u("div",{class:"text-center",children:[e.u("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:[e.u("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"}),e.u("circle",{cx:"12",cy:"9",r:"2.5"})]}),e.u("p",{class:"text-foreground",children:"No location data available."}),e.u("p",{class:"text-muted-foreground mt-1 text-xs",children:"Events need location data to appear on the map."})]})}),i=()=>e.u("div",{class:"flex h-full items-center justify-center",children:e.u("div",{class:"border-primary size-8 animate-spin rounded-full border-4 border-t-transparent"})});exports.default=({events:n,isLoading:a=!1})=>{const{organization:u}=e.useSession(),c=e.useNavigate(),d=u?.integrationSettings??{},p=d.mapProvider??"openstreetmap",m=e.q(r=>{c(e.PAGE_ROUTES.GALLERY(r))},[c]);if("openstreetmap_free"===p)return e.u("div",{class:"relative mt-3 h-screen sm:mt-6",children:e.u(e.P,{fallback:e.u(i,{}),children:e.u(r,{onExplore:m,logoUrl:u?.logoUrl})})});const g=d.mapTilerApiKey??"",h=d.googleMapsApiKey??"",x=d.mapboxApiKey??"",v=n.filter(e=>"number"==typeof e.location?.x&&"number"==typeof e.location?.y);return e.u("div",{class:"relative mt-3 h-screen sm:mt-6",children:a?e.u(i,{}):"openstreetmap"===p&&!g||"google"===p&&!h||"mapbox"===p&&!x?e.u("div",{class:"flex h-full items-center justify-center",children:e.u("div",{class:"text-center",children:[e.u("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:[e.u("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"}),e.u("circle",{cx:"12",cy:"9",r:"2.5"})]}),e.u("p",{class:"text-foreground",children:"API key is required to display the map."}),e.u("p",{class:"text-muted-foreground mt-1 text-xs",children:"Provide a map API key in your organization settings."})]})}):0===v.length?e.u(s,{}):e.u(e.P,{fallback:e.u(i,{}),children:["openstreetmap"===p&&e.u(t,{is3D:!1,apiKey:g,onExplore:m,logoUrl:u?.logoUrl}),"mapbox"===p&&e.u(l,{onExplore:m,apiKey:x,is3D:!1,logoUrl:u?.logoUrl}),"google"===p&&e.u(o,{apiKey:h,onExplore:m,logoUrl:u?.logoUrl})]})})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
require("./CH5eh9L8.js");const t=require("./CcHquimJ.js"),e=require("./GqoKkUUo.js"),n=require("./Bv-kIUzA.js");let i=require("react"),s=require("react/jsx-runtime");function o(t){return["react-photo-album",t].filter(Boolean).join("--")}function r({width:t,height:e}){const n=t/e;return Number.isFinite(n)?n:1}var a=Object.freeze([1200,600,300,0]);function l(t,e){return"function"==typeof t?t(e):t}function c(t,e){return void 0!==e?l(t,e):void 0}function d(t,e,n,i=0){if(void 0===e)return;const s=c(t,e);return Math.round(Math.max(void 0===s?function(t,e){const n=a.findIndex(t=>t<=e);return l(t[Math.max(n,0)],e)}(n,e):s,i))}function u(t,{spacing:e,padding:n,componentsProps:i,render:s}){return{spacing:d(e,t,[20,15,10,5]),padding:d(n,t,[0,0,0,0]),componentsProps:l(i,t)||{},render:l(s,t)}}function p(t,e=0){const n=10**e;return Math.round((t+Number.EPSILON)*n)/n}function h(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) / ${p((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 m=(0,i.forwardRef)(function({as:t,render:e,context:n,classes:i=[],variables:r={},style:a,className:l,children:c,...d},u){const h=function(...t){return t.filter(Boolean).join(" ")}(...(Array.isArray(i)?i:[i]).filter(t=>"string"==typeof t).map(o),l),m={style:{...Object.fromEntries(Object.entries(r).map(([t,e])=>{return[(n=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),`--${o(n)}`),"number"==typeof e?p(e,5):e];var n})),...a},className:h,children:c,...d};if(e){const t=e({ref:u,...m},n);if(t)return t}return(0,s.jsx)(t||"div",{ref:u,...m})}),g=(0,i.forwardRef)(function({photo:t,index:e,width:n,height:i,onClick:o,render:{wrapper:r,link:a,button:l,image:c,extras:d}={},componentsProps:{link:u,button:h,wrapper:g,image:w}={}},f){const{href:T}=t,y={photo:t,index:e,width:p(n,3),height:p(i,3)};let v;return v=T?{...u,as:"a",render:a,classes:["photo","link"],href:T,onClick:o}:o?{...h,as:"button",type:"button",render:l,classes:["photo","button"],onClick:o}:{...g,render:r,classes:"photo"},(0,s.jsxs)(m,{ref:f,variables:{photoWidth:y.width,photoHeight:y.height},context:y,...v,children:[(0,s.jsx)(m,{as:"img",classes:"image",render:c,context:y,...w}),d?.({},y)]})}),w=(0,i.forwardRef)(function({layout:t,sizes:e,model:n,skeleton:o,onClick:r,render:{container:a,track:c,photo:d,...u}={},componentsProps:{container:p,track:w,link:f,button:T,wrapper:y,image:v}={}},b){const{spacing:_,padding:x,containerWidth:q,tracks:k,variables:E,horizontal:S}=n||{};return(0,s.jsxs)(m,{role:"group","aria-label":"Photo album",...p,variables:{spacing:_,padding:x,containerWidth:q,...E},classes:["",t],render:a,ref:b,children:[void 0!==_&&void 0!==x&&void 0!==q&&k?.map(({photos:t,variables:n},o)=>{const a=t.length,p=S?a:k.length;return(0,i.createElement)(m,{...w,key:o,render:c,classes:"track",variables:{trackSize:a,...n}},t.map(t=>{const{photo:n,index:i,width:o}=t,{key:a,src:c,alt:m="",title:w,label:b}=n,k=r?t=>{r({event:t,photo:n,index:i})}:void 0;if(d){const e=d({onClick:k},t);if(e)return e}const E=t=>b?{"aria-label":b,...t}:t;return(0,s.jsx)(g,{onClick:k,render:u,componentsProps:{image:{loading:"lazy",decoding:"async",src:c,alt:m,title:w,...h(n,e,o,q,p,_,x),...l(v,t)},link:E(l(f,t)),button:E(l(T,t)),wrapper:l(y,t)},...t},a??i)}))}),void 0===q&&o]})});function f(t,e,n,i){return(e-(t.length-1)*n-2*i*t.length)/t.reduce((t,e)=>t+r(e),0)}function T(t,e,n,i,s,o,r){const a=t.slice(e,n),l=f(a,i,s,o);return l>0?(l-r)**2*a.length:void 0}function y(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 v(t,e,n){const[[s],o]=(0,i.useReducer)(y,[n]),r=function(t){const[e,n]=(0,i.useState)(t);return t===e||t&&e&&t.length===e.length&&!t.some((t,n)=>t!==e[n])?e:(n(t),t)}(e),a=(0,i.useRef)(void 0);return{containerRef:(0,i.useCallback)(e=>{a.current?.disconnect(),a.current=void 0;const n=()=>o(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,r));n(),e&&"undefined"!=typeof ResizeObserver&&(a.current=new ResizeObserver(n),a.current.observe(e)),"function"==typeof t?t(e):t&&(t.current=e)},[t,r]),containerWidth:s}}var b=(0,i.forwardRef)(function({photos:t,breakpoints:e,defaultContainerWidth:n,...o},a){const{containerRef:l,containerWidth:h}=v(a,e,n),{spacing:m,padding:g,targetRowHeight:y,minPhotos:b,maxPhotos:_,...x}=function(t,{photos:e,targetRowHeight:n,rowConstraints:i,...s}){const{spacing:o,padding:r,componentsProps:a,render:l}=u(t,s),{singleRowMaxHeight:p,minPhotos:h,maxPhotos:m}=c(i,t)||{};if(void 0!==p&&void 0!==o&&void 0!==r){const t=Math.floor(e.reduce((t,{width:e,height:n})=>t+e/n*p+2*r,o*(e.length-1)));t>0&&(a.container={...a.container},a.container.style={maxWidth:t,...a.container.style})}return{...s,targetRowHeight:d(n,t,[t=>t/5,t=>t/4,t=>t/3,t=>t/2]),render:l,spacing:o,padding:r,minPhotos:h,maxPhotos:m,componentsProps:a}}(h,{photos:t,...o});return(0,s.jsx)(w,{layout:"rows",ref:l,model:(0,i.useMemo)(()=>void 0!==h&&void 0!==m&&void 0!==g&&void 0!==y?function(t,e,n,i,s,o,a){const l=Math.min(function(t,e,n,i){return p(e/n/Math.min(...t.map(t=>r(t))))+(i||0)+2}(t,i,s,o),a||1/0),c=o||1,d=t.length,u=new Array(d+1).fill(1/0),h=new Array(d+1).fill(-1);u[0]=0;for(let r=1;r<=d;r+=1)for(let o=r-c;o>=Math.max(0,r-l);o-=1){if(u[o]===1/0)continue;const a=T(t,o,r,i,e,n,s);if(void 0===a)break;const l=u[o]+a;(u[r]===1/0||u[r]>l&&(u[r]/l>1.005||-1!==h[r]&&h[r]<o))&&(u[r]=l,h[r]=o)}if(u[d]===1/0)return;const m=[];for(let r=d;0!==r;r=h[r])m.push(r);m.push(0),m.reverse();const g=[];for(let p=1;p<m.length;p+=1){const s=t.slice(m[p-1],m[p]).map((t,e)=>({photo:t,index:m[p-1]+e})),o=f(s.map(({photo:t})=>t),i,e,n);g.push({photos:s.map(({photo:t,index:e})=>({photo:t,index:e,width:o*r(t),height:o}))})}return{spacing:e,padding:n,containerWidth:i,tracks:g,horizontal:!0}}(t,m,g,h,y,b,_):void 0,[t,m,g,h,y,b,_]),...x})});function _(t,e,n,i,s,o,a){const l=[],c=a.reduce((t,e)=>t+e,0);for(let d=0;d<t.length-1;d+=1){const u=e.slice(t[d],t[d+1]).map((e,n)=>({photo:e,index:t[d]+n})),p=a.reduce((t,e,n)=>t+(o[d]-o[n])*e,0),h=(s-(t.length-2)*n-2*(t.length-1)*i-p)*a[d]/c;l.push({photos:u.map(({photo:t,index:e})=>({photo:t,index:e,width:h,height:h/r(t)})),variables:{adjustedGaps:p,columnRatio:a[d]}})}return{tracks:l,variables:{totalRatio:c}}}function x(t,e,n,i,s,o){const a=[],l=[];if(t.length<=o){const s=t.length>0?t.reduce((t,e)=>t+r(e),0)/t.length:1;for(let e=0;e<o;e+=1)a[e]=2*n,l[e]=e<t.length?r(t[e]):s;return _(Array.from({length:o+1},(e,n)=>Math.min(n,t.length)),t,e,n,i,a,l)}const c=(d=function(t,e,n,i,s){return o=>{const a=[],l=1.5*s;let c=i/r(t[o])+2*n;for(let d=o+1;d<t.length+1&&(a.push([d,(s-c)**2]),!(c>l||d===t.length));d+=1)c+=i/r(t[d])+e+2*n;return a}}(t,e,n,s,(t.reduce((t,e)=>t+s/r(e),0)+e*(t.length-o)+2*n*t.length)/o),u=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=new Map,o=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,u=c[r+1];(!u||u[1]>d&&(u[1]/d>1.0001||n<u[0]))&&(c[r+1]=[n,d]),r<e-1&&t!==i&&o.add(t)})})}return s}(d,u,p,h),u,h));var d,u,p,h;for(let m=0;m<c.length-1;m+=1){const i=t.slice(c[m],c[m+1]);a[m]=e*(i.length-1)+2*n*i.length,l[m]=1/i.reduce((t,e)=>t+1/r(e),0)}return _(c,t,e,n,i,a,l)}function q(t,e,n,i,s){const{tracks:o,variables:r}=x(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?q(t,e,n,i,s-1):void 0:{tracks:o,spacing:e,padding:n,containerWidth:i,variables:{columns:s,...r}}}var k=(0,i.forwardRef)(function({photos:t,breakpoints:e,defaultContainerWidth:n,...o},r){const{containerRef:a,containerWidth:l}=v(r,e,n),{spacing:c,padding:p,columns:h,...m}=function(t,{columns:e,...n}){return{...n,...u(t,n),columns:d(e,t,[5,4,3,2],1)}}(l,{photos:t,...o});return(0,s.jsx)(w,{layout:"columns",ref:a,model:(0,i.useMemo)(()=>void 0!==l&&void 0!==c&&void 0!==p&&void 0!==h?q(t,c,p,l,h):void 0,[t,c,p,l,h]),...m})});function E(t,e,n,i,s){const o=(i-e*(s-1)-2*n*s)/s;if(o<=0)return s>1?E(t,e,n,i,s-1):void 0;const a=[];for(let r=0;r<s;r+=1)a[r]=0;const l=t.reduce((t,i,s)=>{const l=a.reduce((t,e,n)=>e<a[t]-1?n:t,0);return a[l]=a[l]+o/r(i)+e+2*n,t[l].push({photo:i,index:s}),t},Array.from({length:s},()=>[]));return{spacing:e,padding:n,containerWidth:i,variables:{columns:s},tracks:l.map(t=>({photos:t.map(({photo:t,index:e})=>({photo:t,index:e,width:o,height:o/r(t)}))}))}}var S=(0,i.forwardRef)(function({photos:t,breakpoints:e,defaultContainerWidth:n,...o},r){const{containerRef:a,containerWidth:l}=v(r,e,n),{spacing:c,padding:p,columns:h,...m}=function(t,{columns:e,...n}){return{...n,...u(t,n),columns:d(e,t,[5,4,3,2],1)}}(l,{photos:t,...o});return(0,s.jsx)(w,{layout:"masonry",ref:a,model:(0,i.useMemo)(()=>void 0!==l&&void 0!==c&&void 0!==p&&void 0!==h?E(t,c,p,l,h):void 0,[t,c,p,l,h]),...m})});function I(t){return t?String(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"):""}var A=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">${I(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">${I(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">${I(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">${I(t.description)}</div>\n </div>\n `),e+="</div>",e}},C='url("https://res.cloudinary.com/dectzk2b2/image/upload/v1736933014/black_rpie3v.png")',N=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=C,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=C,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,i=32)=>{if(!t||t.length<6||"undefined"==typeof document)return null;try{const s=n.j(t,e,i),o=document.createElement("canvas");o.width=e,o.height=i;const r=o.getContext("2d");if(!r)return null;const a=r.createImageData(e,i);return a.data.set(s),r.putImageData(a,0,0),o.toDataURL()}catch(s){return console.warn("[PhotoSwipeBackdrop] Failed to decode blurhash:",s),null}})(e.data.blurhash)||e.data.thumbnailUrl||e.data.src;this.backgroundElement.style.backgroundImage=t?`url("${t}")`:C,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 L(t){return t?String(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"):""}var R={[t.AD_TARGET_TYPES.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>',[t.AD_TARGET_TYPES.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>',[t.AD_TARGET_TYPES.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>',[t.AD_TARGET_TYPES.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>',[t.AD_TARGET_TYPES.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>',[t.AD_TARGET_TYPES.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>'},M=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(e){const{id:n,type:i,caption:s,title:o,description:r,targetType:a,targetText:l,targetUrl:c}=e||{},d=Boolean(a)&&String(a)!==String(t.AD_TARGET_TYPES.NONE),u=d?a:t.AD_TARGET_TYPES.LINK;switch("ad"===i&&this.captureAdImpression&&this.captureAdImpression(n),i){case"image":case"video":return s?.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">${L(s)}</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">${L(o)}</h3>\n <h4 class=" pb-2 text-center text-sm sm:text-base">${L(r)}</h4>\n ${d?`<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="${L(n)}"\n data-target-type="${L(u)}"\n data-target-url="${L(c)}">\n ${R[u]}\n ${L(l)}\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="")}},P=({contents:e=[],selectedIndex:o,onClick:r})=>{const a=(0,i.useRef)(null);(0,i.useEffect)(()=>{a.current&&l(o)},[o,a.current]);const l=t=>{if(!a.current)return;const e=a.current,n=e.children;if(t<0||t>=n.length)return;const i=n[t],s=e.offsetWidth/2,o=i.offsetLeft+i.offsetWidth/2-s;e.scrollTo({left:o,behavior:"smooth"})};return(0,s.jsx)("div",{ref:a,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:e.map((e,i)=>(0,s.jsxs)("button",{className:"relative mx-0.5 inline-block lg:mx-1.5",onClick:()=>((t,e)=>{r(e)})(0,i),children:[(0,s.jsx)(n.LazyLoadImage,{wrapperClassName:t.cn("h-16 w-24 rounded-md lg:h-20 lg:w-20",i===o&&"border-2 border-[#ff4800]"),src:e.thumbnailUrl,placeholderSrc:e.blurImageUrl,alt:e.caption}),e.type===t.CONTENT_TYPES.VIDEO&&(0,s.jsx)("div",{className:"absolute top-0 left-0 flex size-full items-center justify-center opacity-75",children:(0,s.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"size-6 text-white lg:size-9",viewBox:"0 0 24 24",children:(0,s.jsx)("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"})})}),e.type===t.CONTENT_TYPES.AD&&(0,s.jsx)("div",{className:"absolute top-1 left-1 text-xs",children:"Ad"})]},`filmstrip-thumbnail-${i}`))})},B=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(e){const n=this.getElementById("filmstrip-container");if(!n)return;t.R((0,s.jsx)(P,{contents:e?.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:e.currSlide.index,onClick:t=>this.onThumbnailClcik(t)}),n);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 e=this.getElementById("filmstrip-container"),n=this.getElementById("pswp-caption-container");n&&(n.style.bottom="0"),e&&t.R(null,e)}},O=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"}},V=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)}},z={videoAttributes:{controls:"",playsinline:"",muted:"",preload:"auto"},autoplay:!0,preventDragOffset:40};function D(t){return t&&t.data&&"video"===t.data.type}var $=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(D(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=>{D(t.slide)&&!t.slide.isActive&&t.preventDefault()}),t.on("close",()=>{D(t.currSlide.content)&&this.pauseVideo(t.currSlide.content)})}onContentDestroy({content:t}){D(t)&&t._videoPosterImg&&(t._videoPosterImg.onload=t._videoPosterImg.onerror=null,t._videoPosterImg=null)}onContentResize(t){if(D(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!D(e)&&t}isContentZoomable(t,e){return!D(e)&&t}onContentActivate({content:t}){D(t)&&this.options.autoplay&&this.playVideo(t)}onContentDeactivate({content:t}){D(t)&&this.pauseVideo(t)}onContentAppend(t){D(t.content)&&(t.preventDefault(),t.content.isAttached=!0,t.content.appendImage())}onContentLoad(t){const e=t.content;if(D(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!!D(e)||t}},H=class{constructor(t,e={}){new $(t,{...z,...e})}},U=({open:n,ad:i,onClose:s,captureAdClick:o})=>{const r=Boolean(i?.targetType&&i.targetType!==t.AD_TARGET_TYPES.NONE);return t.u(e.Dialog,{open:Boolean(n&&i),onOpenChange:t=>!t&&s?.(),children:t.u(e.DialogContent,{className:"border-none p-0",children:[t.u(e.DialogHeader,{className:"hidden",children:[t.u(e.DialogTitle,{children:i?.title}),t.u(e.DialogDescription,{children:i?.description})]}),t.u("div",{className:"flex max-w-2xl flex-col overflow-hidden",children:[t.u("img",{className:"h-auto w-full object-contain sm:max-h-96",src:i?.imageUrl,alt:"Image not found"}),t.u("div",{className:"flex flex-col gap-2 p-3",children:[t.u(e.Typography,{variant:"h4",align:"center",lines:2,children:i?.title}),t.u(e.Typography,{variant:"body3",color:"secondary",align:"center",lines:4,children:i?.description})]}),r&&t.u(e.Button,{fullWidth:!0,className:"rounded-none",onClick:()=>{o?.(i?._id,i?.targetType??t.AD_TARGET_TYPES.LINK,i?.targetUrl),s?.()},iconName:t.AD_TARGET_TYPE_ICONS[i?.targetType]??t.AD_TARGET_TYPE_ICONS[t.AD_TARGET_TYPES.LINK],children:i?.targetText})]})]})})},G=({style:i,content:s,curateLink:o,onAdClick:r})=>{const{captureAdImpression:a,captureAdEngagement:l,captureAdClick:c}=e.useAnalytics(),d=Boolean(o&&r);return t.u("div",{style:i,className:"group relative mb-1 overflow-hidden rounded",children:[t.u(n.InView,{className:"size-full",threshold:.8,triggerOnce:!0,onChange:t=>{t&&a(s._id)},onClick:()=>l(s._id),children:t.u(e.PhotoswipeThumbnail,{url:s.src||s.imageUrl,thumbnailUrl:s.src||s.imageUrl,blurhash:s.blurhash,alt:s.caption,onClick:d?r:void 0,pswpData:{id:s._id,type:t.CONTENT_TYPES.AD,hash:s._id,width:s.width,height:s.height,title:s.title,description:s.description,targetType:s.targetType,targetText:s.targetText,targetUrl:s.targetUrl,thumbnailUrl:s.imageUrl,blurhash:s.blurhash}})}),t.u("div",{className:"transition-opacity duration-500 group-hover:opacity-100 sm:opacity-0",children:t.u("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:[t.u("div",{className:"py-2",children:t.u("h3",{className:"text-foreground line-clamp-2 px-2 text-sm font-medium sm:ml-3 sm:line-clamp-1 sm:p-0",children:s.title})}),s?.targetType!==t.AD_TARGET_TYPES.NONE&&t.u(e.Button,{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:()=>{d?r?.():c(s._id,s.targetType,s.targetUrl)},iconName:t.AD_TARGET_TYPE_ICONS[s?.targetType??t.AD_TARGET_TYPES.LINK],children:s?.targetText})]})})]})},j=({style:n,gamConfig:i,slotIndex:s,eventId:o,organizationId:r})=>{const a=t.A(null),l=t.A(null),{trackGamAnalytics:c}=e.useAnalytics(),d=`gam-slot-${o??"ev"}-${s}`,u=Math.max(1,Math.round(n?.width||i.sizes[0]?.[0]||300)),p=Math.max(1,Math.round(n?.height||i.sizes[0]?.[1]||250)),h=t.A({w:u,h:p});return t.y(()=>{let n=!1,s=null,u=null,p=null,m=null;return(async()=>{await e.loadGpt(),!n&&a.current&&window.googletag.cmd.push(()=>{if(n)return;e.destroyExistingSlot(d);const{w:g,h:w}=h.current,f=[[g,w],...i.sizes],T=window.googletag.defineSlot(i.adUnitPath,f,d)?.addService(window.googletag.pubads());if(!T)return;l.current=T,u=window.googletag.pubads(),o?T.setConfig({targeting:{qrati_event:o,...i.categories.length>0?{qrati_category:i.categories}:{}}}):i.categories.length>0&&T.setConfig({targeting:{qrati_category:i.categories}}),p=e=>{e.slot===T&&c({eventId:o,organizationId:r,type:t.GAM_ANALYTICS_TYPE.GAM_IMPRESSION,creativeId:String(e.creativeId??""),lineItemId:String(e.lineItemId??""),advertiserId:String(e.advertiserId??""),isEmpty:e.isEmpty??!1})},u.addEventListener("slotRenderEnded",p),m=e=>{e.slot===T&&c({eventId:o,organizationId:r,type:t.GAM_ANALYTICS_TYPE.GAM_VIEWABLE})},u.addEventListener("impressionViewable",m);const y=a.current;y&&(s=e.setupGamClickTracking({container:y,onClick:()=>{c({eventId:o,organizationId:r,type:t.GAM_ANALYTICS_TYPE.GAM_CLICK})}}),e.enableGptServices(),window.googletag.display(d))})})(),()=>{n=!0,s?.(),u&&"function"==typeof u.removeEventListener&&(p&&u.removeEventListener("slotRenderEnded",p),m&&u.removeEventListener("impressionViewable",m));const t=l.current;l.current=null,t&&window.googletag?.cmd?.push(()=>{window.googletag.destroySlots([t])})}},[o,i.adUnitPath,i.categories,r,d]),t.u("div",{style:{width:u,height:p},className:"relative overflow-hidden rounded bg-neutral-100 dark:bg-neutral-800","data-gam-slot-index":s,children:t.u("div",{id:d,ref:a,style:{width:u,height:p},className:"gam-ad-slot"})})},Y=t.X(null),F=()=>{const e=t.x(Y);if(!e)throw new Error("Popover components must be used within a Popover");return e},W=({children:e,className:n,open:i,onOpenChange:s})=>{const[o,r]=t.d(!1),a="boolean"==typeof i,l=a?i:o,c=t.g(),d=`popover-trigger-${c}`,u=`popover-content-${c}`,p=t.A(null);return t.u(Y.Provider,{value:{isOpen:l,setIsOpen:t=>{a||r(t),s?.(t)},triggerId:d,contentId:u,triggerRef:p},children:t.u("div",{"data-slot":"popover",className:t.cn("relative inline-block",n),children:e})})},K=({children:e,asChild:n,className:i,onClick:s,...o})=>{const{isOpen:r,setIsOpen:a,triggerId:l,contentId:c,triggerRef:d}=F();if(t.y(()=>{if(!n)return;const t=document.getElementById(l);return d.current=t,()=>{d.current===t&&(d.current=null)}},[n,l,d]),n){const n=Array.isArray(e)?e[0]:e;if(n&&n.type){const e=n.props?.className;return t.W(n,{id:l,className:i?e?`${e} ${i}`:i:e,"aria-haspopup":"dialog","aria-expanded":r,"aria-controls":r?c:void 0,onClick:t=>{a(!r),n.props?.onClick?.(t)},"data-state":r?"open":"closed"})}}return t.u("button",{ref:d,id:l,type:"button","aria-haspopup":"dialog","aria-expanded":r,"aria-controls":r?c:void 0,"data-slot":"popover-trigger","data-state":r?"open":"closed",className:i,onClick:t=>{a(!r),s?.(t)},...o,children:e})},Q=({children:e,className:n,align:i="center",side:s="top",sideOffset:o=4,...r})=>{const{isOpen:a,setIsOpen:l,contentId:c,triggerRef:d}=F(),{organization:u,portalContainer:p}=t.useSession(),h=t.A(null),[m,g]=t.d(null);if(t._(()=>{if(!a)return;const t=()=>{if(!d.current||!h.current)return;const t=d.current.getBoundingClientRect(),e=h.current.getBoundingClientRect();let n=t.left,r=t.bottom+o;"center"===i&&(n=t.left+t.width/2-e.width/2),"end"===i&&(n=t.right-e.width),"top"===s&&(r=t.top-e.height-o),"left"===s&&(n=t.left-e.width-o,r=t.top+t.height/2-e.height/2),"right"===s&&(n=t.right+o,r=t.top+t.height/2-e.height/2),"bottom"===s&&(r=t.bottom+o),g({top:r,left:n})},e=requestAnimationFrame(t);return window.addEventListener("resize",t),window.addEventListener("scroll",t,!0),()=>{cancelAnimationFrame(e),window.removeEventListener("resize",t),window.removeEventListener("scroll",t,!0)}},[i,a,s,o,d]),t.y(()=>{if(!a)return;const t=t=>{const e=t.target;h.current&&!h.current.contains(e)&&d.current&&!d.current.contains(e)&&l(!1)},e=t=>{"Escape"===t.key&&(l(!1),d.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)}},[a,l,d]),!a)return null;const w=t.u("div",{ref:h,id:c,role:"dialog","aria-modal":"false","data-state":a?"open":"closed",className:t.cn("bg-background text-foreground border-border shadow-outer rounded outline-none",n),style:{position:"fixed",top:m?.top??0,left:m?.left??0,zIndex:2010,...t.getStyleObject(u)},...r,children:e});return"undefined"!=typeof document?t.$(w,p??document.body):w},Z=({eventId:n,contentId:i,emojis:s=[],counts:o={},userReaction:r})=>{const{user:a,props:l,organization:c}=t.useSession(),d=l?.loginUrl,{handleReactionClick:u}=(()=>{const n=t.useQueryClient(),{props:i,user:s}=t.useSession(),o=i?.organizationId;return{handleReactionClick:async(i,r,a)=>{if(!i||!r||!a)return!1;if(!s)return e.y.error("Please login to react"),!1;const l=[t.QUERY_KEYS.CONTENTS_BY_EVENT(i)],c=n.getQueriesData({queryKey:l});n.setQueriesData({queryKey:l},t=>t?.pages&&Array.isArray(t.pages)?{...t,pages:t.pages.map(t=>t.data?{...t,data:t.data.map(t=>{if(t._id===r){const e={...t.reactionCounts};return t.userReaction&&t.userReaction!==a&&(e[t.userReaction]=Math.max(0,(e[t.userReaction]??1)-1)),t.userReaction===a?(e[a]=Math.max(0,(e[a]??1)-1),{...t,reactionCounts:e,userReaction:void 0}):(e[a]=(e[a]??0)+1,{...t,reactionCounts:e,userReaction:a})}return t})}:t)}:t);try{return await t.ky.post(t.API_ROUTES.UPDATE_REACTION,{json:{eventId:i,contentId:r,reaction:a},headers:{"x-org-id":o,Authorization:`Bearer ${s.token}`}}),!0}catch(d){return c.forEach(([t,e])=>{n.setQueryData(t,e)}),e.y.error("Failed to add reaction"),console.error("Error handling reaction click:",d),!1}}}})(),[p,h]=t.d(!1),[m,g]=t.d(!1),w=Object.values(o).reduce((t,e)=>t+e,0);return t.u(W,{open:p,onOpenChange:h,children:[t.u(K,{children:t.u("div",{className:t.cn("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",r&&"ring-primary ring-1"),children:[(s||[]).slice().sort((t,e)=>(o[e]||0)-(o[t]||0)).slice(0,1).map(e=>t.u("span",{className:"text-sm sm:text-lg",children:r||e},`${i}-${e}-1`)),w>0&&t.u("span",{className:"text-xs font-bold sm:text-sm",children:w||0})]})}),t.u(Q,{side:"top",align:"end",children:[a?null:c?.customAuth?t.u("div",{className:"p-2 font-semibold",children:["Please"," ",t.u("a",{className:"text-info underline",href:d,children:"Login"})," ","to react"]}):t.u("div",{className:"p-2 font-semibold",children:["Please"," ",t.u(t.Link,{className:"text-info underline",to:t.PAGE_ROUTES.LOGIN,children:"Login"})," ","to react"]}),a&&t.u("div",{className:"flex gap-1 p-2",children:s.map(e=>{const s=r===e;return t.u("div",{className:"flex flex-col items-center",children:[t.u("span",{className:"text-xs font-medium",children:o[e]||0}),t.u("button",{type:"button",disabled:m,className:t.cn("text-3xl transition-transform disabled:opacity-50",s?"scale-125":"hover:scale-110",m&&"cursor-not-allowed"),onClick:()=>(async t=>{!m&&u&&(g(!0),await u(n,i,t)&&h(!1),g(!1))})(e),children:e})]},`${i}-${e}-2`)})})]})]})},X=({event:n={},content:i,curateLink:s})=>n.engagementStyle===t.ENGAGEMENT_STYLES.CONTEST?t.u("button",{className:"bg-background/75 flex items-center gap-1 rounded px-2 py-1",children:[t.u(e.Iconify,{name:"material-symbols:star-half-rounded",className:"size-4"}),t.u("span",{className:"text-xs font-semibold",children:parseFloat(String(i.score||0)).toFixed(1)})]}):n.engagementStyle===t.ENGAGEMENT_STYLES.REACTION&&n.reactionEmojis?.length?t.u(Z,{eventId:n?._id,contentId:i._id,emojis:n?.reactionEmojis,engagementStyle:n?.engagementStyle,counts:i.reactionCounts||{},userReaction:i.userReaction}):null,J=({content:e})=>t.u("div",{className:"w-full space-y-3 px-3 pb-3",children:[e?.caption&&t.u("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:t.u("div",{role:"note",title:e?.caption,className:"lg:text-md line-clamp-1 text-xs text-white lg:font-medium",children:e?.caption})}),t.u("div",{className:"flex items-center justify-between",children:t.u("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:e?.user?.name})})]}),tt=({event:n,content:i,style:s,timestampField:o,curateLink:r,onChangeFaceUrl:a,hideControls:l})=>{const{organization:c}=t.useSession(),d=`content-${i._id}`,u=((t,e)=>{if(!t||!e)return null;const n=e?.[t];if(!n)return null;try{const t=new Date(String(n)),e=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}})(o,i);return t.u("div",{id:d,style:s,className:"group relative mb-1 overflow-hidden rounded",children:[t.u(e.PhotoswipeThumbnail,{url:i.src,alt:i.caption,blurhash:i.blurhash,thumbnailUrl:i.thumbnailUrl,curateLink:r,pswpData:{id:i._id,type:t.CONTENT_TYPES.IMAGE,hash:i._id,width:i.width,height:i.height,thumbnailUrl:i.thumbnailUrl,blurhash:i.blurhash,caption:i.caption,contentSummary:JSON.stringify(i.contentSummary)}}),!l&&t.u(t.S,{children:[u&&t.u("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:u}),c?.integrationSettings?.showQuickSearch&&(i.faces?.length??0)>0&&t.u("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:()=>{a?.(i?.url);const t=document.getElementById("media-gallery-container");t&&t.scrollIntoView({behavior:"smooth",block:"start"})},children:t.u(e.Iconify,{color:"a11y",name:"material-symbols:familiar-face-and-zone-outline-rounded"})}),t.u("div",{className:"",children:[t.u("div",{className:"absolute bottom-0 w-full rounded-b",children:t.u(J,{content:i})}),t.u("div",{className:"absolute right-2 bottom-2",children:t.u(X,{event:n,content:i,curateLink:r})})]})]})]})},et=({content:n,style:i,event:s,timestampField:o,curateLink:r,hideControls:a})=>{const l=((t,e)=>{if(!t||!e)return null;const n=e?.[t];if(!n)return null;try{const t=new Date(String(n)),e=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}})(o,n);return t.u("div",{id:`content-${n._id}`,className:"group relative mb-1 overflow-hidden rounded",style:i,children:[t.u(e.PhotoswipeThumbnail,{url:n.src??n.url,thumbnailUrl:n.thumbnailUrl,blurhash:n.blurhash,alt:n.caption,curateLink:r,pswpData:{id:n._id,type:t.CONTENT_TYPES.VIDEO,hash:n._id,width:n.width,height:n.height,thumbnailUrl:n.thumbnailUrl,blurhash:n.blurhash,caption:n.caption}}),!a&&t.u("div",{className:"transition-opacity duration-500",children:[l&&t.u("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:l}),t.u("div",{className:"absolute bottom-0 w-full rounded-b",children:t.u(J,{content:n})}),t.u("div",{className:"absolute right-2 bottom-2",children:t.u(X,{event:s,content:n,curateLink:r})})]})]})};exports.default=({event:n,contents:i=[],gamConfig:s,singleColumnMode:o,kioskMode:r,timestampField:a,curateLink:l,onChangeFaceUrl:c})=>{const d=t.A(null),u=t.A(null),p=t.T(()=>`gallery-${n?._id??""}`,[n]),{captureAdImpression:h,captureAdClick:m}=e.useAnalytics(),{organization:g,portalContainer:w}=t.useSession(),f=g?._id,[T,y]=t.d(null);t.y(()=>{const t=u.current;if(!l&&t){const n=new e.lightbox_default({gallery:t,children:"a",counter:!1,bgOpacity:1,wheelToZoom:!0,pinchToClose:!0,zoom:!1,pswpModule:e.loadPhotoSwipe,appendToEl:w??document.body});d.current=n,new H(n),new B(n),new N(n),new M(n,h,m),new O(n),new V(n),g?.integrationSettings?.showAIDescription&&new A(n,{width:"400px",height:"40%"}),n.init()}return()=>{d.current?.destroy?.(),d.current=null}},[n?.galleryLayout,l,m,h,p,g]);const v=t.T(()=>{switch(n?.galleryLayout){case t.GALLERY_LAYOUTS.ROW:return b;case t.GALLERY_LAYOUTS.COLUMN:return k;case t.GALLERY_LAYOUTS.MASONRY:return S;default:return b}},[o,n?.galleryLayout]);return t.u(t.S,{children:[t.u("div",{id:p,ref:u,className:t.cn(o?"w-full lg:w-1/3":"w-full"),children:t.u(v,{spacing:4,rowConstraints:t=>{const e={minPhotos:1,maxPhotos:4,singleRowMaxHeight:400};return o&&(e.minPhotos=1,e.maxPhotos=t<400?2:t<800?3:4),e},columns:t=>o?1:t<400?2:t<800?3:4,photos:i.map(e=>({src:e.type===t.CONTENT_TYPES.IMAGE||e.type===t.CONTENT_TYPES.VIDEO?e.url:e.type===t.CONTENT_TYPES.GAM_AD?"":e.imageUrl,width:e.dimension?.width,height:e.dimension?.height,...e})),render:{container:({ref:e,className:n,children:i})=>t.u("div",{ref:e,className:n??"",children:i}),photo:(e,{photo:i,width:o,height:d,index:u})=>{const p=i;let h=null;switch(p.type){case t.CONTENT_TYPES.IMAGE:h=tt;break;case t.CONTENT_TYPES.VIDEO:h=et;break;case t.CONTENT_TYPES.AD:h=G;break;case t.CONTENT_TYPES.GAM_AD:return s?t.u(j,{style:{width:o,height:d},gamConfig:s,slotIndex:p.slotIndex??u,eventId:n?._id,organizationId:f},`${p._id??u}-${u}`):null;default:h=null}return h&&t.u(h,{style:{width:o,height:d},event:n,content:p,timestampField:a,onAdClick:l?()=>y(p):void 0,hideControls:r,curateLink:l?`${l}/${p._id}`:null,onChangeFaceUrl:c},`${p._id??u}-${u}`)}}})}),t.u(U,{open:Boolean(T),ad:T,onClose:()=>y(null),captureAdClick:m})]})};
|
|
1
|
+
require("./CH5eh9L8.js");const t=require("./DI13WO77.js"),e=require("./BNa8-_2x.js"),n=require("./Cv1wuK5j.js");let i=require("react"),s=require("react/jsx-runtime");function o(t){return["react-photo-album",t].filter(Boolean).join("--")}function r({width:t,height:e}){const n=t/e;return Number.isFinite(n)?n:1}var a=Object.freeze([1200,600,300,0]);function l(t,e){return"function"==typeof t?t(e):t}function c(t,e){return void 0!==e?l(t,e):void 0}function d(t,e,n,i=0){if(void 0===e)return;const s=c(t,e);return Math.round(Math.max(void 0===s?function(t,e){const n=a.findIndex(t=>t<=e);return l(t[Math.max(n,0)],e)}(n,e):s,i))}function u(t,{spacing:e,padding:n,componentsProps:i,render:s}){return{spacing:d(e,t,[20,15,10,5]),padding:d(n,t,[0,0,0,0]),componentsProps:l(i,t)||{},render:l(s,t)}}function p(t,e=0){const n=10**e;return Math.round((t+Number.EPSILON)*n)/n}function h(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) / ${p((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 m=(0,i.forwardRef)(function({as:t,render:e,context:n,classes:i=[],variables:r={},style:a,className:l,children:c,...d},u){const h=function(...t){return t.filter(Boolean).join(" ")}(...(Array.isArray(i)?i:[i]).filter(t=>"string"==typeof t).map(o),l),m={style:{...Object.fromEntries(Object.entries(r).map(([t,e])=>{return[(n=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),`--${o(n)}`),"number"==typeof e?p(e,5):e];var n})),...a},className:h,children:c,...d};if(e){const t=e({ref:u,...m},n);if(t)return t}return(0,s.jsx)(t||"div",{ref:u,...m})}),g=(0,i.forwardRef)(function({photo:t,index:e,width:n,height:i,onClick:o,render:{wrapper:r,link:a,button:l,image:c,extras:d}={},componentsProps:{link:u,button:h,wrapper:g,image:w}={}},f){const{href:T}=t,y={photo:t,index:e,width:p(n,3),height:p(i,3)};let v;return v=T?{...u,as:"a",render:a,classes:["photo","link"],href:T,onClick:o}:o?{...h,as:"button",type:"button",render:l,classes:["photo","button"],onClick:o}:{...g,render:r,classes:"photo"},(0,s.jsxs)(m,{ref:f,variables:{photoWidth:y.width,photoHeight:y.height},context:y,...v,children:[(0,s.jsx)(m,{as:"img",classes:"image",render:c,context:y,...w}),d?.({},y)]})}),w=(0,i.forwardRef)(function({layout:t,sizes:e,model:n,skeleton:o,onClick:r,render:{container:a,track:c,photo:d,...u}={},componentsProps:{container:p,track:w,link:f,button:T,wrapper:y,image:v}={}},b){const{spacing:_,padding:x,containerWidth:q,tracks:k,variables:E,horizontal:S}=n||{};return(0,s.jsxs)(m,{role:"group","aria-label":"Photo album",...p,variables:{spacing:_,padding:x,containerWidth:q,...E},classes:["",t],render:a,ref:b,children:[void 0!==_&&void 0!==x&&void 0!==q&&k?.map(({photos:t,variables:n},o)=>{const a=t.length,p=S?a:k.length;return(0,i.createElement)(m,{...w,key:o,render:c,classes:"track",variables:{trackSize:a,...n}},t.map(t=>{const{photo:n,index:i,width:o}=t,{key:a,src:c,alt:m="",title:w,label:b}=n,k=r?t=>{r({event:t,photo:n,index:i})}:void 0;if(d){const e=d({onClick:k},t);if(e)return e}const E=t=>b?{"aria-label":b,...t}:t;return(0,s.jsx)(g,{onClick:k,render:u,componentsProps:{image:{loading:"lazy",decoding:"async",src:c,alt:m,title:w,...h(n,e,o,q,p,_,x),...l(v,t)},link:E(l(f,t)),button:E(l(T,t)),wrapper:l(y,t)},...t},a??i)}))}),void 0===q&&o]})});function f(t,e,n,i){return(e-(t.length-1)*n-2*i*t.length)/t.reduce((t,e)=>t+r(e),0)}function T(t,e,n,i,s,o,r){const a=t.slice(e,n),l=f(a,i,s,o);return l>0?(l-r)**2*a.length:void 0}function y(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 v(t,e,n){const[[s],o]=(0,i.useReducer)(y,[n]),r=function(t){const[e,n]=(0,i.useState)(t);return t===e||t&&e&&t.length===e.length&&!t.some((t,n)=>t!==e[n])?e:(n(t),t)}(e),a=(0,i.useRef)(void 0);return{containerRef:(0,i.useCallback)(e=>{a.current?.disconnect(),a.current=void 0;const n=()=>o(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,r));n(),e&&"undefined"!=typeof ResizeObserver&&(a.current=new ResizeObserver(n),a.current.observe(e)),"function"==typeof t?t(e):t&&(t.current=e)},[t,r]),containerWidth:s}}var b=(0,i.forwardRef)(function({photos:t,breakpoints:e,defaultContainerWidth:n,...o},a){const{containerRef:l,containerWidth:h}=v(a,e,n),{spacing:m,padding:g,targetRowHeight:y,minPhotos:b,maxPhotos:_,...x}=function(t,{photos:e,targetRowHeight:n,rowConstraints:i,...s}){const{spacing:o,padding:r,componentsProps:a,render:l}=u(t,s),{singleRowMaxHeight:p,minPhotos:h,maxPhotos:m}=c(i,t)||{};if(void 0!==p&&void 0!==o&&void 0!==r){const t=Math.floor(e.reduce((t,{width:e,height:n})=>t+e/n*p+2*r,o*(e.length-1)));t>0&&(a.container={...a.container},a.container.style={maxWidth:t,...a.container.style})}return{...s,targetRowHeight:d(n,t,[t=>t/5,t=>t/4,t=>t/3,t=>t/2]),render:l,spacing:o,padding:r,minPhotos:h,maxPhotos:m,componentsProps:a}}(h,{photos:t,...o});return(0,s.jsx)(w,{layout:"rows",ref:l,model:(0,i.useMemo)(()=>void 0!==h&&void 0!==m&&void 0!==g&&void 0!==y?function(t,e,n,i,s,o,a){const l=Math.min(function(t,e,n,i){return p(e/n/Math.min(...t.map(t=>r(t))))+(i||0)+2}(t,i,s,o),a||1/0),c=o||1,d=t.length,u=new Array(d+1).fill(1/0),h=new Array(d+1).fill(-1);u[0]=0;for(let r=1;r<=d;r+=1)for(let o=r-c;o>=Math.max(0,r-l);o-=1){if(u[o]===1/0)continue;const a=T(t,o,r,i,e,n,s);if(void 0===a)break;const l=u[o]+a;(u[r]===1/0||u[r]>l&&(u[r]/l>1.005||-1!==h[r]&&h[r]<o))&&(u[r]=l,h[r]=o)}if(u[d]===1/0)return;const m=[];for(let r=d;0!==r;r=h[r])m.push(r);m.push(0),m.reverse();const g=[];for(let p=1;p<m.length;p+=1){const s=t.slice(m[p-1],m[p]).map((t,e)=>({photo:t,index:m[p-1]+e})),o=f(s.map(({photo:t})=>t),i,e,n);g.push({photos:s.map(({photo:t,index:e})=>({photo:t,index:e,width:o*r(t),height:o}))})}return{spacing:e,padding:n,containerWidth:i,tracks:g,horizontal:!0}}(t,m,g,h,y,b,_):void 0,[t,m,g,h,y,b,_]),...x})});function _(t,e,n,i,s,o,a){const l=[],c=a.reduce((t,e)=>t+e,0);for(let d=0;d<t.length-1;d+=1){const u=e.slice(t[d],t[d+1]).map((e,n)=>({photo:e,index:t[d]+n})),p=a.reduce((t,e,n)=>t+(o[d]-o[n])*e,0),h=(s-(t.length-2)*n-2*(t.length-1)*i-p)*a[d]/c;l.push({photos:u.map(({photo:t,index:e})=>({photo:t,index:e,width:h,height:h/r(t)})),variables:{adjustedGaps:p,columnRatio:a[d]}})}return{tracks:l,variables:{totalRatio:c}}}function x(t,e,n,i,s,o){const a=[],l=[];if(t.length<=o){const s=t.length>0?t.reduce((t,e)=>t+r(e),0)/t.length:1;for(let e=0;e<o;e+=1)a[e]=2*n,l[e]=e<t.length?r(t[e]):s;return _(Array.from({length:o+1},(e,n)=>Math.min(n,t.length)),t,e,n,i,a,l)}const c=(d=function(t,e,n,i,s){return o=>{const a=[],l=1.5*s;let c=i/r(t[o])+2*n;for(let d=o+1;d<t.length+1&&(a.push([d,(s-c)**2]),!(c>l||d===t.length));d+=1)c+=i/r(t[d])+e+2*n;return a}}(t,e,n,s,(t.reduce((t,e)=>t+s/r(e),0)+e*(t.length-o)+2*n*t.length)/o),u=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=new Map,o=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,u=c[r+1];(!u||u[1]>d&&(u[1]/d>1.0001||n<u[0]))&&(c[r+1]=[n,d]),r<e-1&&t!==i&&o.add(t)})})}return s}(d,u,p,h),u,h));var d,u,p,h;for(let m=0;m<c.length-1;m+=1){const i=t.slice(c[m],c[m+1]);a[m]=e*(i.length-1)+2*n*i.length,l[m]=1/i.reduce((t,e)=>t+1/r(e),0)}return _(c,t,e,n,i,a,l)}function q(t,e,n,i,s){const{tracks:o,variables:r}=x(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?q(t,e,n,i,s-1):void 0:{tracks:o,spacing:e,padding:n,containerWidth:i,variables:{columns:s,...r}}}var k=(0,i.forwardRef)(function({photos:t,breakpoints:e,defaultContainerWidth:n,...o},r){const{containerRef:a,containerWidth:l}=v(r,e,n),{spacing:c,padding:p,columns:h,...m}=function(t,{columns:e,...n}){return{...n,...u(t,n),columns:d(e,t,[5,4,3,2],1)}}(l,{photos:t,...o});return(0,s.jsx)(w,{layout:"columns",ref:a,model:(0,i.useMemo)(()=>void 0!==l&&void 0!==c&&void 0!==p&&void 0!==h?q(t,c,p,l,h):void 0,[t,c,p,l,h]),...m})});function E(t,e,n,i,s){const o=(i-e*(s-1)-2*n*s)/s;if(o<=0)return s>1?E(t,e,n,i,s-1):void 0;const a=[];for(let r=0;r<s;r+=1)a[r]=0;const l=t.reduce((t,i,s)=>{const l=a.reduce((t,e,n)=>e<a[t]-1?n:t,0);return a[l]=a[l]+o/r(i)+e+2*n,t[l].push({photo:i,index:s}),t},Array.from({length:s},()=>[]));return{spacing:e,padding:n,containerWidth:i,variables:{columns:s},tracks:l.map(t=>({photos:t.map(({photo:t,index:e})=>({photo:t,index:e,width:o,height:o/r(t)}))}))}}var S=(0,i.forwardRef)(function({photos:t,breakpoints:e,defaultContainerWidth:n,...o},r){const{containerRef:a,containerWidth:l}=v(r,e,n),{spacing:c,padding:p,columns:h,...m}=function(t,{columns:e,...n}){return{...n,...u(t,n),columns:d(e,t,[5,4,3,2],1)}}(l,{photos:t,...o});return(0,s.jsx)(w,{layout:"masonry",ref:a,model:(0,i.useMemo)(()=>void 0!==l&&void 0!==c&&void 0!==p&&void 0!==h?E(t,c,p,l,h):void 0,[t,c,p,l,h]),...m})});function I(t){return t?String(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"):""}var A=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">${I(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">${I(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">${I(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">${I(t.description)}</div>\n </div>\n `),e+="</div>",e}},C='url("https://res.cloudinary.com/dectzk2b2/image/upload/v1736933014/black_rpie3v.png")',N=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=C,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=C,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,i=32)=>{if(!t||t.length<6||"undefined"==typeof document)return null;try{const s=n.j(t,e,i),o=document.createElement("canvas");o.width=e,o.height=i;const r=o.getContext("2d");if(!r)return null;const a=r.createImageData(e,i);return a.data.set(s),r.putImageData(a,0,0),o.toDataURL()}catch(s){return console.warn("[PhotoSwipeBackdrop] Failed to decode blurhash:",s),null}})(e.data.blurhash)||e.data.thumbnailUrl||e.data.src;this.backgroundElement.style.backgroundImage=t?`url("${t}")`:C,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 L(t){return t?String(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"):""}var R={[t.AD_TARGET_TYPES.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>',[t.AD_TARGET_TYPES.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>',[t.AD_TARGET_TYPES.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>',[t.AD_TARGET_TYPES.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>',[t.AD_TARGET_TYPES.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>',[t.AD_TARGET_TYPES.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>'},M=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(e){const{id:n,type:i,caption:s,title:o,description:r,targetType:a,targetText:l,targetUrl:c}=e||{},d=Boolean(a)&&String(a)!==String(t.AD_TARGET_TYPES.NONE),u=d?a:t.AD_TARGET_TYPES.LINK;switch("ad"===i&&this.captureAdImpression&&this.captureAdImpression(n),i){case"image":case"video":return s?.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">${L(s)}</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">${L(o)}</h3>\n <h4 class=" pb-2 text-center text-sm sm:text-base">${L(r)}</h4>\n ${d?`<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="${L(n)}"\n data-target-type="${L(u)}"\n data-target-url="${L(c)}">\n ${R[u]}\n ${L(l)}\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="")}},P=({contents:e=[],selectedIndex:o,onClick:r})=>{const a=(0,i.useRef)(null);(0,i.useEffect)(()=>{a.current&&l(o)},[o,a.current]);const l=t=>{if(!a.current)return;const e=a.current,n=e.children;if(t<0||t>=n.length)return;const i=n[t],s=e.offsetWidth/2,o=i.offsetLeft+i.offsetWidth/2-s;e.scrollTo({left:o,behavior:"smooth"})};return(0,s.jsx)("div",{ref:a,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:e.map((e,i)=>(0,s.jsxs)("button",{className:"relative mx-0.5 inline-block lg:mx-1.5",onClick:()=>((t,e)=>{r(e)})(0,i),children:[(0,s.jsx)(n.LazyLoadImage,{wrapperClassName:t.cn("h-16 w-24 rounded-md lg:h-20 lg:w-20",i===o&&"border-2 border-[#ff4800]"),src:e.thumbnailUrl,placeholderSrc:e.blurImageUrl,alt:e.caption}),e.type===t.CONTENT_TYPES.VIDEO&&(0,s.jsx)("div",{className:"absolute top-0 left-0 flex size-full items-center justify-center opacity-75",children:(0,s.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"size-6 text-white lg:size-9",viewBox:"0 0 24 24",children:(0,s.jsx)("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"})})}),e.type===t.CONTENT_TYPES.AD&&(0,s.jsx)("div",{className:"absolute top-1 left-1 text-xs",children:"Ad"})]},`filmstrip-thumbnail-${i}`))})},B=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(e){const n=this.getElementById("filmstrip-container");if(!n)return;t.R((0,s.jsx)(P,{contents:e?.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:e.currSlide.index,onClick:t=>this.onThumbnailClcik(t)}),n);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 e=this.getElementById("filmstrip-container"),n=this.getElementById("pswp-caption-container");n&&(n.style.bottom="0"),e&&t.R(null,e)}},O=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"}},V=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)}},z={videoAttributes:{controls:"",playsinline:"",muted:"",preload:"auto"},autoplay:!0,preventDragOffset:40};function D(t){return t&&t.data&&"video"===t.data.type}var $=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(D(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=>{D(t.slide)&&!t.slide.isActive&&t.preventDefault()}),t.on("close",()=>{D(t.currSlide.content)&&this.pauseVideo(t.currSlide.content)})}onContentDestroy({content:t}){D(t)&&t._videoPosterImg&&(t._videoPosterImg.onload=t._videoPosterImg.onerror=null,t._videoPosterImg=null)}onContentResize(t){if(D(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!D(e)&&t}isContentZoomable(t,e){return!D(e)&&t}onContentActivate({content:t}){D(t)&&this.options.autoplay&&this.playVideo(t)}onContentDeactivate({content:t}){D(t)&&this.pauseVideo(t)}onContentAppend(t){D(t.content)&&(t.preventDefault(),t.content.isAttached=!0,t.content.appendImage())}onContentLoad(t){const e=t.content;if(D(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!!D(e)||t}},H=class{constructor(t,e={}){new $(t,{...z,...e})}},U=({open:n,ad:i,onClose:s,captureAdClick:o})=>{const r=Boolean(i?.targetType&&i.targetType!==t.AD_TARGET_TYPES.NONE);return t.u(e.Dialog,{open:Boolean(n&&i),onOpenChange:t=>!t&&s?.(),children:t.u(e.DialogContent,{className:"border-none p-0",children:[t.u(e.DialogHeader,{className:"hidden",children:[t.u(e.DialogTitle,{children:i?.title}),t.u(e.DialogDescription,{children:i?.description})]}),t.u("div",{className:"flex max-w-2xl flex-col overflow-hidden",children:[t.u("img",{className:"h-auto w-full object-contain sm:max-h-96",src:i?.imageUrl,alt:"Image not found"}),t.u("div",{className:"flex flex-col gap-2 p-3",children:[t.u(e.Typography,{variant:"h4",align:"center",lines:2,children:i?.title}),t.u(e.Typography,{variant:"body3",color:"secondary",align:"center",lines:4,children:i?.description})]}),r&&t.u(e.Button,{fullWidth:!0,className:"rounded-none",onClick:()=>{o?.(i?._id,i?.targetType??t.AD_TARGET_TYPES.LINK,i?.targetUrl),s?.()},iconName:t.AD_TARGET_TYPE_ICONS[i?.targetType]??t.AD_TARGET_TYPE_ICONS[t.AD_TARGET_TYPES.LINK],children:i?.targetText})]})]})})},G=({style:i,content:s,curateLink:o,onAdClick:r})=>{const{captureAdImpression:a,captureAdEngagement:l,captureAdClick:c}=e.useAnalytics(),d=Boolean(o&&r);return t.u("div",{style:i,className:"group relative mb-1 overflow-hidden rounded",children:[t.u(n.InView,{className:"size-full",threshold:.8,triggerOnce:!0,onChange:t=>{t&&a(s._id)},onClick:()=>l(s._id),children:t.u(e.PhotoswipeThumbnail,{url:s.src||s.imageUrl,thumbnailUrl:s.src||s.imageUrl,blurhash:s.blurhash,alt:s.caption,onClick:d?r:void 0,pswpData:{id:s._id,type:t.CONTENT_TYPES.AD,hash:s._id,width:s.width,height:s.height,title:s.title,description:s.description,targetType:s.targetType,targetText:s.targetText,targetUrl:s.targetUrl,thumbnailUrl:s.imageUrl,blurhash:s.blurhash}})}),t.u("div",{className:"transition-opacity duration-500 group-hover:opacity-100 sm:opacity-0",children:t.u("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:[t.u("div",{className:"py-2",children:t.u("h3",{className:"text-foreground line-clamp-2 px-2 text-sm font-medium sm:ml-3 sm:line-clamp-1 sm:p-0",children:s.title})}),s?.targetType!==t.AD_TARGET_TYPES.NONE&&t.u(e.Button,{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:()=>{d?r?.():c(s._id,s.targetType,s.targetUrl)},iconName:t.AD_TARGET_TYPE_ICONS[s?.targetType??t.AD_TARGET_TYPES.LINK],children:s?.targetText})]})})]})},j=({style:n,gamConfig:i,slotIndex:s,eventId:o,organizationId:r})=>{const a=t.A(null),l=t.A(null),{trackGamAnalytics:c}=e.useAnalytics(),d=`gam-slot-${o??"ev"}-${s}`,u=Math.max(1,Math.round(n?.width||i.sizes[0]?.[0]||300)),p=Math.max(1,Math.round(n?.height||i.sizes[0]?.[1]||250)),h=t.A({w:u,h:p});return t.y(()=>{let n=!1,s=null,u=null,p=null,m=null;return(async()=>{await e.loadGpt(),!n&&a.current&&window.googletag.cmd.push(()=>{if(n)return;e.destroyExistingSlot(d);const{w:g,h:w}=h.current,f=[[g,w],...i.sizes],T=window.googletag.defineSlot(i.adUnitPath,f,d)?.addService(window.googletag.pubads());if(!T)return;l.current=T,u=window.googletag.pubads(),o?T.setConfig({targeting:{qrati_event:o,...i.categories.length>0?{qrati_category:i.categories}:{}}}):i.categories.length>0&&T.setConfig({targeting:{qrati_category:i.categories}}),p=e=>{e.slot===T&&c({eventId:o,organizationId:r,type:t.GAM_ANALYTICS_TYPE.GAM_IMPRESSION,creativeId:String(e.creativeId??""),lineItemId:String(e.lineItemId??""),advertiserId:String(e.advertiserId??""),isEmpty:e.isEmpty??!1})},u.addEventListener("slotRenderEnded",p),m=e=>{e.slot===T&&c({eventId:o,organizationId:r,type:t.GAM_ANALYTICS_TYPE.GAM_VIEWABLE})},u.addEventListener("impressionViewable",m);const y=a.current;y&&(s=e.setupGamClickTracking({container:y,onClick:()=>{c({eventId:o,organizationId:r,type:t.GAM_ANALYTICS_TYPE.GAM_CLICK})}}),e.enableGptServices(),window.googletag.display(d))})})(),()=>{n=!0,s?.(),u&&"function"==typeof u.removeEventListener&&(p&&u.removeEventListener("slotRenderEnded",p),m&&u.removeEventListener("impressionViewable",m));const t=l.current;l.current=null,t&&window.googletag?.cmd?.push(()=>{window.googletag.destroySlots([t])})}},[o,i.adUnitPath,i.categories,r,d]),t.u("div",{style:{width:u,height:p},className:"relative overflow-hidden rounded bg-neutral-100 dark:bg-neutral-800","data-gam-slot-index":s,children:t.u("div",{id:d,ref:a,style:{width:u,height:p},className:"gam-ad-slot"})})},Y=t.X(null),F=()=>{const e=t.x(Y);if(!e)throw new Error("Popover components must be used within a Popover");return e},W=({children:e,className:n,open:i,onOpenChange:s})=>{const[o,r]=t.d(!1),a="boolean"==typeof i,l=a?i:o,c=t.g(),d=`popover-trigger-${c}`,u=`popover-content-${c}`,p=t.A(null);return t.u(Y.Provider,{value:{isOpen:l,setIsOpen:t=>{a||r(t),s?.(t)},triggerId:d,contentId:u,triggerRef:p},children:t.u("div",{"data-slot":"popover",className:t.cn("relative inline-block",n),children:e})})},K=({children:e,asChild:n,className:i,onClick:s,...o})=>{const{isOpen:r,setIsOpen:a,triggerId:l,contentId:c,triggerRef:d}=F();if(t.y(()=>{if(!n)return;const t=document.getElementById(l);return d.current=t,()=>{d.current===t&&(d.current=null)}},[n,l,d]),n){const n=Array.isArray(e)?e[0]:e;if(n&&n.type){const e=n.props?.className;return t.W(n,{id:l,className:i?e?`${e} ${i}`:i:e,"aria-haspopup":"dialog","aria-expanded":r,"aria-controls":r?c:void 0,onClick:t=>{a(!r),n.props?.onClick?.(t)},"data-state":r?"open":"closed"})}}return t.u("button",{ref:d,id:l,type:"button","aria-haspopup":"dialog","aria-expanded":r,"aria-controls":r?c:void 0,"data-slot":"popover-trigger","data-state":r?"open":"closed",className:i,onClick:t=>{a(!r),s?.(t)},...o,children:e})},Q=({children:e,className:n,align:i="center",side:s="top",sideOffset:o=4,...r})=>{const{isOpen:a,setIsOpen:l,contentId:c,triggerRef:d}=F(),{organization:u,portalContainer:p}=t.useSession(),h=t.A(null),[m,g]=t.d(null);if(t._(()=>{if(!a)return;const t=()=>{if(!d.current||!h.current)return;const t=d.current.getBoundingClientRect(),e=h.current.getBoundingClientRect();let n=t.left,r=t.bottom+o;"center"===i&&(n=t.left+t.width/2-e.width/2),"end"===i&&(n=t.right-e.width),"top"===s&&(r=t.top-e.height-o),"left"===s&&(n=t.left-e.width-o,r=t.top+t.height/2-e.height/2),"right"===s&&(n=t.right+o,r=t.top+t.height/2-e.height/2),"bottom"===s&&(r=t.bottom+o),g({top:r,left:n})},e=requestAnimationFrame(t);return window.addEventListener("resize",t),window.addEventListener("scroll",t,!0),()=>{cancelAnimationFrame(e),window.removeEventListener("resize",t),window.removeEventListener("scroll",t,!0)}},[i,a,s,o,d]),t.y(()=>{if(!a)return;const t=t=>{const e=t.target;h.current&&!h.current.contains(e)&&d.current&&!d.current.contains(e)&&l(!1)},e=t=>{"Escape"===t.key&&(l(!1),d.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)}},[a,l,d]),!a)return null;const w=t.u("div",{ref:h,id:c,role:"dialog","aria-modal":"false","data-state":a?"open":"closed",className:t.cn("bg-background text-foreground border-border shadow-outer rounded outline-none",n),style:{position:"fixed",top:m?.top??0,left:m?.left??0,zIndex:2010,...t.getStyleObject(u)},...r,children:e});return"undefined"!=typeof document?t.$(w,p??document.body):w},Z=({eventId:n,contentId:i,emojis:s=[],counts:o={},userReaction:r})=>{const{user:a,props:l,organization:c}=t.useSession(),d=l?.loginUrl,{handleReactionClick:u}=(()=>{const n=t.useQueryClient(),{props:i,user:s}=t.useSession(),o=i?.organizationId;return{handleReactionClick:async(i,r,a)=>{if(!i||!r||!a)return!1;if(!s)return e.y.error("Please login to react"),!1;const l=[t.QUERY_KEYS.CONTENTS_BY_EVENT(i)],c=n.getQueriesData({queryKey:l});n.setQueriesData({queryKey:l},t=>t?.pages&&Array.isArray(t.pages)?{...t,pages:t.pages.map(t=>t.data?{...t,data:t.data.map(t=>{if(t._id===r){const e={...t.reactionCounts};return t.userReaction&&t.userReaction!==a&&(e[t.userReaction]=Math.max(0,(e[t.userReaction]??1)-1)),t.userReaction===a?(e[a]=Math.max(0,(e[a]??1)-1),{...t,reactionCounts:e,userReaction:void 0}):(e[a]=(e[a]??0)+1,{...t,reactionCounts:e,userReaction:a})}return t})}:t)}:t);try{return await t.ky.post(t.API_ROUTES.UPDATE_REACTION,{json:{eventId:i,contentId:r,reaction:a},headers:{"x-org-id":o,Authorization:`Bearer ${s.token}`}}),!0}catch(d){return c.forEach(([t,e])=>{n.setQueryData(t,e)}),e.y.error("Failed to add reaction"),console.error("Error handling reaction click:",d),!1}}}})(),[p,h]=t.d(!1),[m,g]=t.d(!1),w=Object.values(o).reduce((t,e)=>t+e,0);return t.u(W,{open:p,onOpenChange:h,children:[t.u(K,{children:t.u("div",{className:t.cn("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",r&&"ring-primary ring-1"),children:[(s||[]).slice().sort((t,e)=>(o[e]||0)-(o[t]||0)).slice(0,1).map(e=>t.u("span",{className:"text-sm sm:text-lg",children:r||e},`${i}-${e}-1`)),w>0&&t.u("span",{className:"text-xs font-bold sm:text-sm",children:w||0})]})}),t.u(Q,{side:"top",align:"end",children:[a?null:c?.customAuth?t.u("div",{className:"p-2 font-semibold",children:["Please"," ",t.u("a",{className:"text-info underline",href:d,children:"Login"})," ","to react"]}):t.u("div",{className:"p-2 font-semibold",children:["Please"," ",t.u(t.Link,{className:"text-info underline",to:t.PAGE_ROUTES.LOGIN,children:"Login"})," ","to react"]}),a&&t.u("div",{className:"flex gap-1 p-2",children:s.map(e=>{const s=r===e;return t.u("div",{className:"flex flex-col items-center",children:[t.u("span",{className:"text-xs font-medium",children:o[e]||0}),t.u("button",{type:"button",disabled:m,className:t.cn("text-3xl transition-transform disabled:opacity-50",s?"scale-125":"hover:scale-110",m&&"cursor-not-allowed"),onClick:()=>(async t=>{!m&&u&&(g(!0),await u(n,i,t)&&h(!1),g(!1))})(e),children:e})]},`${i}-${e}-2`)})})]})]})},X=({event:n={},content:i,curateLink:s})=>n.engagementStyle===t.ENGAGEMENT_STYLES.CONTEST?t.u("button",{className:"bg-background/75 flex items-center gap-1 rounded px-2 py-1",children:[t.u(e.Iconify,{name:"material-symbols:star-half-rounded",className:"size-4"}),t.u("span",{className:"text-xs font-semibold",children:parseFloat(String(i.score||0)).toFixed(1)})]}):n.engagementStyle===t.ENGAGEMENT_STYLES.REACTION&&n.reactionEmojis?.length?t.u(Z,{eventId:n?._id,contentId:i._id,emojis:n?.reactionEmojis,engagementStyle:n?.engagementStyle,counts:i.reactionCounts||{},userReaction:i.userReaction}):null,J=({content:e})=>t.u("div",{className:"w-full space-y-3 px-3 pb-3",children:[e?.caption&&t.u("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:t.u("div",{role:"note",title:e?.caption,className:"lg:text-md line-clamp-1 text-xs text-white lg:font-medium",children:e?.caption})}),t.u("div",{className:"flex items-center justify-between",children:t.u("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:e?.user?.name})})]}),tt=({event:n,content:i,style:s,timestampField:o,curateLink:r,onChangeFaceUrl:a,hideControls:l})=>{const{organization:c}=t.useSession(),d=`content-${i._id}`,u=((t,e)=>{if(!t||!e)return null;const n=e?.[t];if(!n)return null;try{const t=new Date(String(n)),e=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}})(o,i);return t.u("div",{id:d,style:s,className:"group relative mb-1 overflow-hidden rounded",children:[t.u(e.PhotoswipeThumbnail,{url:i.src,alt:i.caption,blurhash:i.blurhash,thumbnailUrl:i.thumbnailUrl,curateLink:r,pswpData:{id:i._id,type:t.CONTENT_TYPES.IMAGE,hash:i._id,width:i.width,height:i.height,thumbnailUrl:i.thumbnailUrl,blurhash:i.blurhash,caption:i.caption,contentSummary:JSON.stringify(i.contentSummary)}}),!l&&t.u(t.S,{children:[u&&t.u("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:u}),c?.integrationSettings?.showQuickSearch&&(i.faces?.length??0)>0&&t.u("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:()=>{a?.(i?.url);const t=document.getElementById("media-gallery-container");t&&t.scrollIntoView({behavior:"smooth",block:"start"})},children:t.u(e.Iconify,{color:"a11y",name:"material-symbols:familiar-face-and-zone-outline-rounded"})}),t.u("div",{className:"",children:[t.u("div",{className:"absolute bottom-0 w-full rounded-b",children:t.u(J,{content:i})}),t.u("div",{className:"absolute right-2 bottom-2",children:t.u(X,{event:n,content:i,curateLink:r})})]})]})]})},et=({content:n,style:i,event:s,timestampField:o,curateLink:r,hideControls:a})=>{const l=((t,e)=>{if(!t||!e)return null;const n=e?.[t];if(!n)return null;try{const t=new Date(String(n)),e=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}})(o,n);return t.u("div",{id:`content-${n._id}`,className:"group relative mb-1 overflow-hidden rounded",style:i,children:[t.u(e.PhotoswipeThumbnail,{url:n.src??n.url,thumbnailUrl:n.thumbnailUrl,blurhash:n.blurhash,alt:n.caption,curateLink:r,pswpData:{id:n._id,type:t.CONTENT_TYPES.VIDEO,hash:n._id,width:n.width,height:n.height,thumbnailUrl:n.thumbnailUrl,blurhash:n.blurhash,caption:n.caption}}),!a&&t.u("div",{className:"transition-opacity duration-500",children:[l&&t.u("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:l}),t.u("div",{className:"absolute bottom-0 w-full rounded-b",children:t.u(J,{content:n})}),t.u("div",{className:"absolute right-2 bottom-2",children:t.u(X,{event:s,content:n,curateLink:r})})]})]})};exports.default=({event:n,contents:i=[],gamConfig:s,singleColumnMode:o,kioskMode:r,timestampField:a,curateLink:l,onChangeFaceUrl:c})=>{const d=t.A(null),u=t.A(null),p=t.T(()=>`gallery-${n?._id??""}`,[n]),{captureAdImpression:h,captureAdClick:m}=e.useAnalytics(),{organization:g,portalContainer:w}=t.useSession(),f=g?._id,[T,y]=t.d(null);t.y(()=>{const t=u.current;if(!l&&t){const n=new e.lightbox_default({gallery:t,children:"a",counter:!1,bgOpacity:1,wheelToZoom:!0,pinchToClose:!0,zoom:!1,pswpModule:e.loadPhotoSwipe,appendToEl:w??document.body});d.current=n,new H(n),new B(n),new N(n),new M(n,h,m),new O(n),new V(n),g?.integrationSettings?.showAIDescription&&new A(n,{width:"400px",height:"40%"}),n.init()}return()=>{d.current?.destroy?.(),d.current=null}},[n?.galleryLayout,l,m,h,p,g]);const v=t.T(()=>{switch(n?.galleryLayout){case t.GALLERY_LAYOUTS.ROW:return b;case t.GALLERY_LAYOUTS.COLUMN:return k;case t.GALLERY_LAYOUTS.MASONRY:return S;default:return b}},[o,n?.galleryLayout]);return t.u(t.S,{children:[t.u("div",{id:p,ref:u,className:t.cn(o?"w-full lg:w-1/3":"w-full"),children:t.u(v,{spacing:4,rowConstraints:t=>{const e={minPhotos:1,maxPhotos:4,singleRowMaxHeight:400};return o&&(e.minPhotos=1,e.maxPhotos=t<400?2:t<800?3:4),e},columns:t=>o?1:t<400?2:t<800?3:4,photos:i.map(e=>({src:e.type===t.CONTENT_TYPES.IMAGE||e.type===t.CONTENT_TYPES.VIDEO?e.url:e.type===t.CONTENT_TYPES.GAM_AD?"":e.imageUrl,width:e.dimension?.width,height:e.dimension?.height,...e})),render:{container:({ref:e,className:n,children:i})=>t.u("div",{ref:e,className:n??"",children:i}),photo:(e,{photo:i,width:o,height:d,index:u})=>{const p=i;let h=null;switch(p.type){case t.CONTENT_TYPES.IMAGE:h=tt;break;case t.CONTENT_TYPES.VIDEO:h=et;break;case t.CONTENT_TYPES.AD:h=G;break;case t.CONTENT_TYPES.GAM_AD:return s?t.u(j,{style:{width:o,height:d},gamConfig:s,slotIndex:p.slotIndex??u,eventId:n?._id,organizationId:f},`${p._id??u}-${u}`):null;default:h=null}return h&&t.u(h,{style:{width:o,height:d},event:n,content:p,timestampField:a,onAdClick:l?()=>y(p):void 0,hideControls:r,curateLink:l?`${l}/${p._id}`:null,onChangeFaceUrl:c},`${p._id??u}-${u}`)}}})}),t.u(U,{open:Boolean(T),ad:T,onClose:()=>y(null),captureAdClick:m})]})};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{n as e}from"./Bto__AIV.js";import{At as r,Ct as t,Et as n,V as o,et as a,g as i,jt as s,p as c,r as l,wt as d,y as u}from"./
|
|
1
|
+
import{n as e}from"./Bto__AIV.js";import{At as r,Ct as t,Et as n,V as o,et as a,g as i,jt as s,p as c,r as l,wt as d,y as u}from"./DM06aQTo.js";import{t as p}from"./KsnrAVz9.js";import{a as m,i as f,n as g,o as h,r as y,t as x}from"./D16FFwT7.js";var b=[[90,-180],[-90,180]],v=[20,0],L="#fb8500",w={topLeft:[276,60],bottomRight:[60,60]},z=new p,T=e=>e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""),B=({onExplore:p,logoUrl:B})=>{const j=t(null),k=t(null),C=t(null),O=t(null),S=t(null),Z=t(null),E=t(null),I=t(!1),R=t(!1),A=d(()=>(()=>{try{const e=sessionStorage.getItem(o);if(!e)return null;const r=JSON.parse(e);if("number"==typeof r?.center?.lat&&"number"==typeof r?.center?.lng&&"number"==typeof r?.zoom)return r}catch{}return null})(),[]),[F,$]=n(!0),[V,G]=n(!1),{folderTree:N,activeFolderId:q,activeFolder:J,visibleEvents:M,setActiveFolderId:P,isLoadingEvents:W}=h(),{organization:H}=c();return r(()=>{if(!j.current||k.current)return;let r,t=!1;return(async()=>{try{const n=await import("./Byq3TC8k.js").then(r=>/* @__PURE__ */e(r.default,1));if(t)return;if("undefined"!=typeof window&&(window.L=n),await Promise.all([import("./DYeIUbVU.js").then(r=>/* @__PURE__ */e(r.default,1)),import("./BJ85RnFv.js")]),t)return;const a=window.L??n;if(!j.current)return;const i=n.map(j.current,{center:A?.center?[A.center.lat??v[0],A.center.lng??v[1]]:v,zoom:A?.zoom??3,minZoom:3,zoomControl:!0,worldCopyJump:!1,maxBounds:n.latLngBounds(b),maxBoundsViscosity:1});n.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:"© OpenStreetMap contributors",maxZoom:19,noWrap:!0}).addTo(i);const s=n.layerGroup().addTo(i),c="function"==typeof a.heatLayer?a.heatLayer([],{radius:30,blur:30,maxZoom:10,minOpacity:.35}):null;c?.addTo(i);const l="function"==typeof a.markerClusterGroup?a.markerClusterGroup({chunkedLoading:!0,showCoverageOnHover:!1,spiderfyOnMaxZoom:!0,zoomToBoundsOnClick:!0,maxClusterRadius:48}):n.layerGroup();l.addTo(i);const d=()=>{E.current&&clearTimeout(E.current),E.current=setTimeout(()=>{try{sessionStorage.setItem(o,JSON.stringify({center:i.getCenter(),zoom:i.getZoom()}))}catch{}},250)};let u;i.on("zoomend",d),i.on("moveend",d),k.current=i,C.current=a,O.current=s,Z.current=c,S.current=l,"undefined"!=typeof ResizeObserver&&j.current&&(u=new ResizeObserver(()=>i.invalidateSize(!1)),u.observe(j.current)),requestAnimationFrame(()=>i.invalidateSize(!1)),G(!0),$(!1),r=()=>{u?.disconnect(),E.current&&clearTimeout(E.current),i.off("zoomend",d),i.off("moveend",d),i.remove(),C.current=null,k.current=null,O.current=null,Z.current=null,S.current=null}}finally{t||$(!1)}})(),()=>{t=!0,r?.()}},[A]),r(()=>{if(!V)return;const e=C.current;if(!e)return;const r=k.current;if(O.current?.clearLayers(),S.current?.clearLayers(),null===q&&N.length>0){r&&Z.current&&(Z.current.setLatLngs?.([]),r.hasLayer(Z.current)&&r.removeLayer(Z.current));const t=r=>{for(const n of r)if(n.centroid){const[r,t]=n.centroid,o=e.divIcon({className:"",html:`<div style="transform:translate(-50%,-50%);background:${y(n.color,L)};color:#fff;border-radius:20px;padding:5px 10px;font-size:12px;font-weight:600;white-space:nowrap;box-shadow:0 2px 8px rgba(0,0,0,0.25);border:2px solid rgba(255,255,255,0.4);cursor:pointer;display:inline-flex;align-items:center;gap:6px;"><span>${T(n.folder.name)}</span><span style="background:rgba(0,0,0,0.18);border-radius:10px;padding:1px 5px;font-size:10px;">${n.eventCount}</span></div>`,iconSize:[0,0],iconAnchor:[0,0]});e.marker([t,r],{icon:o}).on("click",()=>P(n.folder._id)).addTo(O.current)}else n.children.length>0&&t(n.children)};t(N)}else{if(0===M.length)return;const t=0===N.length&&null===q,n=y(J?.color,L);if(r&&Z.current&&(t&&!r.hasLayer(Z.current)?Z.current.addTo(r):t||(Z.current.setLatLngs?.([]),r.hasLayer(Z.current)&&r.removeLayer(Z.current))),M.forEach(r=>{const t=r.location.x,o=r.location.y,i=e.divIcon({className:"qrati-leaflet-marker-wrapper",html:`<div style="width:36px;height:36px;cursor:pointer;background:${n};border-radius:50% 50% 50% 0;transform:rotate(-45deg);border:2px solid white;box-shadow:0 2px 8px rgba(0,0,0,0.3);display:flex;align-items:center;justify-content:center;overflow:hidden;">${f(B)?`<img src="${f(B)}" style="width:24px;height:24px;border-radius:50%;object-fit:cover;transform:rotate(45deg);" />`:""}</div>`,iconSize:[36,36],iconAnchor:[18,36],popupAnchor:[0,-36]}),c=e.marker([o,t],{icon:i}),d=document.createElement("div");d.style.width="fit-content",((e,r,t)=>{s(/* @__PURE__ */u(a,{client:z,children:/* @__PURE__ */u(l,{children:/* @__PURE__ */u(m,{event:e,onExplore:t})})}),r)})(r,d,p),c.bindPopup(d,{closeButton:!0,maxWidth:256}),S.current?.addLayer(c)}),t&&Z.current){const e=M.reduce((e,r)=>Math.max(e,r.views??0),1),r=M.map(e=>[e.location.y,e.location.x,e.views??1]);Z.current.setOptions?.({radius:30,blur:30,maxZoom:10,minOpacity:.35,max:e}),Z.current.setLatLngs?.(r)}if(t&&!R.current&&r&&(R.current=!0,!A)){const t=e.latLngBounds([]);M.forEach(e=>t.extend([e.location.y,e.location.x])),t.isValid()&&r.fitBounds(t,{paddingTopLeft:w.topLeft,paddingBottomRight:w.bottomRight,maxZoom:8})}}},[q,N,M,V,p,B,P,J,A]),r(()=>{if(!V)return;const e=k.current,r=C.current;if(!e||!r)return;if(!I.current&&A)return void(I.current=!0);I.current=!0;const t={paddingTopLeft:w.topLeft,paddingBottomRight:w.bottomRight,duration:3,easeLinearity:1};if(q){const n=g(N,q);if(!n?.folder.boundary?.length)return;const o=r.latLngBounds([]);for(const e of n.folder.boundary)o.extend([e.y,e.x]);o.isValid()&&e.flyToBounds(o,{...t,maxZoom:14})}else{const n=r.latLngBounds([]),o=e=>{for(const r of e)r.centroid?n.extend([r.centroid[1],r.centroid[0]]):o(r.children)};o(N),n.isValid()&&e.flyToBounds(n,{...t,maxZoom:8})}},[q,N,V,A]),/* @__PURE__ */u("div",{class:"relative h-screen w-full sm:h-[calc(100vh-4rem)]",style:i(H),children:[
|
|
2
2
|
/* @__PURE__ */u(x,{positionClass:"absolute top-3 left-16 z-[1000]",folderTree:N,activeFolderId:q,setActiveFolderId:P}),W&&/* @__PURE__ */u("div",{class:"absolute inset-0 z-10 flex items-center justify-center bg-white/60",children:/* @__PURE__ */u("div",{class:"border-primary size-10 animate-spin rounded-full border-4 border-t-transparent"})}),F&&/* @__PURE__ */u("div",{class:"absolute inset-0 z-20 flex items-center justify-center bg-white/85",children:/* @__PURE__ */u("div",{class:"flex flex-col items-center gap-3",children:[/* @__PURE__ */u("div",{class:"border-primary size-10 animate-spin rounded-full border-4 border-t-transparent"}),/* @__PURE__ */u("p",{class:"text-sm font-medium text-slate-700",children:"Loading map…"})]})}),
|
|
3
3
|
/* @__PURE__ */u("div",{ref:j,class:"h-full w-full rounded-xl border border-slate-200"})]})};export{B as default};
|