@qratilabs/qrati-connect 2.23.6 → 2.23.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/{umd/Dgs_iVn3.js → element/BYEF5Khs.js} +1 -1
  2. package/element/{R0dHh5Az2.js → BYoa-kpQ2.js} +1 -1
  3. package/{umd/_bFyk49H2.js → element/BfkCwRAR2.js} +1 -1
  4. package/element/{CGc52QIP2.js → BpVacqmD2.js} +1 -1
  5. package/{umd/B78xAjNG2.js → element/C030L_Hu2.js} +1 -1
  6. package/element/{DNAwNX6_.js → CSO2IaJ1.js} +1 -1
  7. package/element/{CebL6kYV2.js → D4apO9G62.js} +1 -1
  8. package/element/{C3HKK1w_2.js → DB1jhaAe2.js} +1 -1
  9. package/element/{7GXdePWm2.js → DQ6V4QOv2.js} +1 -1
  10. package/{umd/BNEa3Uj4.js → element/Do2aldFH.js} +1 -1
  11. package/element/{d_bA36WR2.js → Drl8BMLL2.js} +1 -1
  12. package/{umd/D5YBxlTz2.js → element/WxZlurdK2.js} +5 -5
  13. package/element/{D5MjLaap2.js → lrjV8c1G2.js} +1 -1
  14. package/element/ls36Q8v0.js +9 -0
  15. package/{umd/Bm_xW_Mp2.js → element/qNDy94Dr2.js} +1 -1
  16. package/element/web.es.js +4 -4
  17. package/package.json +1 -1
  18. package/{element/Dgs_iVn3.js → umd/BYEF5Khs.js} +1 -1
  19. package/umd/{R0dHh5Az2.js → BYoa-kpQ2.js} +1 -1
  20. package/{element/_bFyk49H2.js → umd/BfkCwRAR2.js} +1 -1
  21. package/umd/{CGc52QIP2.js → BpVacqmD2.js} +1 -1
  22. package/{element/B78xAjNG2.js → umd/C030L_Hu2.js} +1 -1
  23. package/umd/{DNAwNX6_.js → CSO2IaJ1.js} +1 -1
  24. package/umd/{CebL6kYV2.js → D4apO9G62.js} +1 -1
  25. package/umd/{C3HKK1w_2.js → DB1jhaAe2.js} +1 -1
  26. package/umd/{7GXdePWm2.js → DQ6V4QOv2.js} +1 -1
  27. package/{element/BNEa3Uj4.js → umd/Do2aldFH.js} +1 -1
  28. package/umd/{d_bA36WR2.js → Drl8BMLL2.js} +1 -1
  29. package/{element/D5YBxlTz2.js → umd/WxZlurdK2.js} +5 -5
  30. package/umd/{D5MjLaap2.js → lrjV8c1G2.js} +1 -1
  31. package/umd/ls36Q8v0.js +9 -0
  32. package/{element/Bm_xW_Mp2.js → umd/qNDy94Dr2.js} +1 -1
  33. package/umd/web.es.js +4 -4
  34. package/element/C9ak4yUT.js +0 -8
  35. package/umd/C9ak4yUT.js +0 -8
@@ -1,4 +1,4 @@
1
- import{b as e,d as t,f as n,h as r,p as a,s as i,t as s,v as o,w as l}from"./C3uDEVBt.js";import{C as c,D as d,L as u,M as m,N as g,O as h,P as p,S as f,_ as v,b as w,d as T,f as y,g as N,h as q,i as x,j as b,m as E,n as C,p as S,u as I,v as L,x as z,y as k}from"./BItJQVdK.js";import{n as A,r as M,t as _}from"./C8_zGNAf.js";import{t as P,u as R}from"./b6CwQBFC.js";import{t as V}from"./ekog7y-V.js";import{n as O,t as j}from"./Cb1JRT_1.js";import{a as F,c as B,i as H,l as U,n as G,o as $,r as D,s as W,t as Q,u as K}from"./D0VKfxwE.js";import{t as Z}from"./CCLXmMXp.js";import{r as Y}from"./DvTRhlvs.js";import{n as J,t as X}from"./D9NypPiv.js";import{t as ee}from"./DIYUC8M3.js";import{t as te}from"./qWp4ucdT.js";import{t as ne}from"./B14kCOq8.js";import{a as re,i as ae,n as ie,o as se,r as oe,s as le,t as ce}from"./CiiNqDJq.js";import{n as de,r as ue,t as me}from"./gjXXuILV2.js";import{n as ge,t as he}from"./DXx41__x2.js";function pe({className:e}){/* @__PURE__ */
1
+ import{b as e,d as t,f as n,h as r,p as a,s as i,t as s,v as o,w as l}from"./C3uDEVBt.js";import{C as c,D as d,L as u,M as m,N as g,O as h,P as p,S as f,_ as v,b as w,d as T,f as y,g as N,h as q,i as x,j as b,m as E,n as C,p as S,u as I,v as L,x as z,y as k}from"./BItJQVdK.js";import{n as M,r as A,t as _}from"./C8_zGNAf.js";import{t as P,u as R}from"./b6CwQBFC.js";import{t as V}from"./ekog7y-V.js";import{n as O,t as j}from"./Cb1JRT_1.js";import{a as F,c as B,i as H,l as U,n as G,o as $,r as D,s as W,t as Q,u as K}from"./D0VKfxwE.js";import{t as Z}from"./CCLXmMXp.js";import{r as Y}from"./DvTRhlvs.js";import{n as J,t as X}from"./D9NypPiv.js";import{t as ee}from"./DIYUC8M3.js";import{t as te}from"./qWp4ucdT.js";import{t as ne}from"./B14kCOq8.js";import{a as re,i as ae,n as ie,o as se,r as oe,s as le,t as ce}from"./CiiNqDJq.js";import{n as de,r as ue,t as me}from"./gjXXuILV2.js";import{n as ge,t as he}from"./DXx41__x2.js";function pe({className:e}){/* @__PURE__ */
2
2
  return s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */s("path",{fill:"currentColor",d:"M5 21q-.825 0-1.412-.587T3 19V5q0-.825.588-1.412T5 3h14q.825 0 1.413.588T21 5v14q0 .825-.587 1.413T19 21zm0-2h14V5H5zm0 0V5zm2-2h10q.3 0 .45-.275t-.05-.525l-2.75-3.675q-.15-.2-.4-.2t-.4.2L11.25 16L9.4 13.525q-.15-.2-.4-.2t-.4.2l-2 2.675q-.2.25-.05.525T7 17"})})}function fe({className:e}){/* @__PURE__ */
3
3
  return s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */s("path",{fill:"currentColor",d:"M15.188 14.688Q16.5 13.375 16.5 11.5t-1.312-3.187T12 7T8.813 8.313T7.5 11.5t1.313 3.188T12 16t3.188-1.312m-5.1-1.276Q9.3 12.625 9.3 11.5t.788-1.912T12 8.8t1.913.788t.787 1.912t-.787 1.913T12 14.2t-1.912-.787m-4.2 3.787q-2.763-1.8-4.363-4.75q-.125-.225-.187-.462t-.063-.488t.063-.488t.187-.462q1.6-2.95 4.363-4.75T12 4t6.113 1.8t4.362 4.75q.125.225.188.463t.062.487t-.062.488t-.188.462q-1.6 2.95-4.362 4.75T12 19t-6.113-1.8m11.3-1.687Q19.55 14.025 20.8 11.5q-1.25-2.525-3.613-4.012T12 6T6.813 7.488T3.2 11.5q1.25 2.525 3.613 4.013T12 17t5.188-1.487"})})}var ve=({description:t,maxLines:a=2,className:i})=>{const[o,l]=r(!1),[c,d]=r(!1),u=n(null),m=n(null);return e(()=>{l(!1)},[t]),e(()=>{if(!u.current||!t)return void d(!1);const e=u.current,n=()=>{const t=window.getComputedStyle(e),r=Math.max(0,Math.floor(e.getBoundingClientRect().width));if(!r)return void(m.current=window.requestAnimationFrame(n));const i=t.lineHeight,s=parseFloat(t.fontSize)||16;let o=1.2*s;i&&"normal"!==i&&(o=i.endsWith("px")?parseFloat(i):parseFloat(i)*s);const l=document.createElement("div");l.style.position="absolute",l.style.visibility="hidden",l.style.pointerEvents="none",l.style.whiteSpace="normal",l.style.width=`${r}px`,l.style.boxSizing=t.boxSizing,l.style.padding=t.padding,l.style.margin=t.margin,l.style.fontSize=t.fontSize,l.style.fontFamily=t.fontFamily,l.style.fontWeight=t.fontWeight,l.style.lineHeight=t.lineHeight,l.style.letterSpacing=t.letterSpacing,l.style.wordBreak="break-word",l.innerText=e.innerText||"",document.body.appendChild(l);const c=l.scrollHeight;document.body.removeChild(l),d(c>o*a+1)},r=()=>{null!==m.current&&window.cancelAnimationFrame(m.current),m.current=window.requestAnimationFrame(n)};let i;r(),window.addEventListener("resize",r);try{i=new MutationObserver(r),i.observe(e,{characterData:!0,childList:!0,subtree:!0})}catch{}return()=>{window.removeEventListener("resize",r),null!==m.current&&window.cancelAnimationFrame(m.current),i?.disconnect()}},[t,a]),t?/* @__PURE__ */s("div",{className:x("relative w-full",i),children:[/* @__PURE__ */s("p",{ref:u,className:x(O({variant:"body2",color:"muted",align:"center"}),"w-full",o?void 0:`line-clamp-${a}`),children:[t,c&&o&&/* @__PURE__ */s("button",{type:"button",onClick:()=>l(!1),className:"text-primary ml-2 text-sm font-medium hover:underline cursor-pointer",children:"see less"})]}),c&&!o&&/* @__PURE__ */s("span",{className:"bg-background absolute right-0 bottom-0 inline-flex items-center pl-2",children:[/* @__PURE__ */s("span",{className:"text-muted-foreground",children:"..."}),/* @__PURE__ */s("button",{type:"button",onClick:()=>l(!0),className:"text-primary ml-1 text-sm font-medium hover:underline cursor-pointer",children:"see more"})]})]}):null},we=()=>{const{t:e}=Y(),{eventSlug:t}=R(),{event:n}=te({eventSlug:t}),{props:r,organization:a}=C(),{curateLabel:i,leaderboardLabel:o}=r??{},{eventViews:l,contentCount:c,curationCount:u}=(({event:e})=>{const{props:t,organization:n}=C(),r=t?.organizationId,{isLoading:a,data:i}=p({queryKey:["event-stats",r??"",e?._id??""],queryFn:async()=>{try{return(await g.get(I.GET_EVENT_STATISTICS,{searchParams:{eventSlug:e?.slug},headers:{"x-org-id":r}}).json()).data}catch(t){throw new Error(t instanceof Error?t.message:String(t)||"Failed to fetch event stats")}},enabled:!!e&&Boolean(n?.integrationSettings?.showEventStats)});return{isLoading:a,eventViews:"number"==typeof i?.eventViews?i.eventViews:i?.eventViews?.views??0,contentCount:i?.contentCount||0,curationCount:i?.curationCount||0}})({event:n});/* @__PURE__ */
4
4
  return s("div",{className:"w-full space-y-3",children:[
@@ -16,11 +16,11 @@ return s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",view
16
16
  return s(D,{children:[/* @__PURE__ */s($,{children:/* @__PURE__ */s(o?Se:Ce,{className:"size-6"})}),/* @__PURE__ */s(H,{align:"end",side:"bottom",className:"w-44",children:Object.values(f).map(r=>/* @__PURE__ */s(F,{onClick:()=>(async r=>{l(!0);try{const a=new FormData;a.append("eventId",e?._id??""),a.append("galleryLayout",r),await g.post(I.UPDATE_EVENT_LAYOUT,{body:a,headers:{"x-org-id":i,Authorization:n?`Bearer ${n.token}`:void 0}}),t.invalidateQueries({queryKey:[`event-data-${i??""}-${e?.slug??""}`]})}catch(a){console.error(a)}l(!1)})(r),isChecked:e?.galleryLayout===r,title:ge(r)},r))})]})},Le=({event:e,onAutoscrollClick:t})=>{const{t:n}=Y(),{isSuper:r,isOwner:i,isAdmin:o,isModerator:l}=U(),{inReviewCount:c}=(e=>{const t=u(),{props:n}=C(),r=n?.organizationId,{role:a,isSuper:i}=U(),{isLoading:s,data:o,isError:l,error:c}=p({queryKey:Te(r,e?.slug),queryFn:async()=>{try{const t=await g.get(I.GET_CONTENTS_COUNT,{searchParams:{eventSlug:e?.slug,filter:`status:${S.IN_REVIEW}`},headers:{"x-org-id":r}}).json();if(t.error)throw new Error(t.error);return t.data}catch(t){throw new Error(t instanceof Error?t.message:String(t)||"Failed to fetch in review count")}},staleTime:0,enabled:Boolean(a)||Boolean(i)});return{loading:s,inReviewCount:o,error:l?c:null,increment:()=>{t.setQueryData(Te(r,e?.slug),e=>(e??0)+1)},decrement:()=>{t.setQueryData(Te(r,e?.slug),e=>Math.max(0,(e??0)-1))}}})(e),d=r||i||o||l,m=r||i||o,h=a(()=>{const t=[];return m&&t.push({title:n("event.shot_inspector","Shot Inspector"),icon:ye,href:z.EVENT_SHOT_INSPECTOR(e?.slug??"")}),e?.visibility===w.PRIVATE&&d&&t.push({title:n("event.access_requests","Access Requests"),icon:Ee,href:z.EVENT_ACCESS_REQUESTS(e?.slug??"")}),e?.engagementStyle===L.CONTEST&&m&&t.push({title:n("event.curation_details","Curation Details"),icon:be,href:z.EVENT_CURATION_DETAILS(e?.slug??"")}),m&&t.push({title:n("event.edit_event","Edit Event"),icon:W,href:z.EVENT_SETTINGS_BASIC_DETAILS(e?.slug??"")}),t},[e,m,d]);/* @__PURE__ */
17
17
  return s("div",{className:"text-muted-foreground sm:text-foreground flex flex-row items-center justify-end gap-6 pr-1 sm:justify-between sm:pr-4",children:["undefined"!=typeof document&&document?.fullscreenEnabled&&t&&/* @__PURE__ */s(B,{content:n("event.kiosk_mode","Kiosk Mode"),children:/* @__PURE__ */s("button",{onClick:t,className:"hidden sm:block",children:/* @__PURE__ */s(qe,{className:"size-6"})})}),"undefined"!=typeof document&&document?.fullscreenEnabled&&m&&/* @__PURE__ */s(Ie,{event:e}),d&&/* @__PURE__ */s(B,{content:n("event.review_contents","Review Contents"),children:/* @__PURE__ */s("a",{target:"_blank",rel:"noreferrer",href:z.EVENT_REVIEW_CONTENTS(e?.slug??""),className:"relative",children:[/* @__PURE__ */s(Ne,{className:"size-6"}),Number(c)>0&&/* @__PURE__ */s("div",{className:"bg-primary text-primary-foreground absolute -top-2 -right-2 rounded-lg px-1 py-0 text-xs",children:c})]})}),h.length>0&&/* @__PURE__ */s(D,{children:[/* @__PURE__ */s($,{children:/* @__PURE__ */s(xe,{className:"size-6"})}),/* @__PURE__ */s(H,{align:"end",side:"bottom",className:"w-48",children:h.map(e=>/* @__PURE__ */s(F,{href:e.href,icon:/* @__PURE__ */s(e.icon,{className:"text-primary"}),title:e.title,suffix:e?.chip?/* @__PURE__ */s("span",{className:"bg-primary text-primary-foreground rounded-full px-1.5 py-0.5 text-[0.5rem] font-medium sm:text-xs",children:e.chip}):void 0,isBeta:"BETA"===e?.chip},e.href??e.title))})]})]})};function ze({className:e}){/* @__PURE__ */
18
18
  return s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */s("path",{fill:"currentColor",d:"M4 18q-.425 0-.712-.288T3 17t.288-.712T4 16h16q.425 0 .713.288T21 17t-.288.713T20 18zm0-5q-.425 0-.712-.288T3 12t.288-.712T4 11h16q.425 0 .713.288T21 12t-.288.713T20 13zm0-5q-.425 0-.712-.288T3 7t.288-.712T4 6h16q.425 0 .713.288T21 7t-.288.713T20 8z"})})}var ke=({engagementStyle:e,sort:t=N,order:n=v,onSortChange:r,onSortOrderChange:i})=>{const{t:o}=Y(),l=a(()=>{const t=Object.keys(y).map(e=>({text:o(`content.sortby_${y[e].label.toLowerCase()}`,y[e].label),value:e,activeClassName:"bg-primary text-primary-foreground"}));return e===L.CONTEST?t:t.filter(e=>e.value!==T.POPULAR)},[e,o]);/* @__PURE__ */
19
- return s("div",{className:"relative flex w-auto items-center gap-2",children:[/* @__PURE__ */s("button",{type:"button",className:"bg-background rounded p-1",onClick:i,children:/* @__PURE__ */s("svg",{xmlns:"http://www.w3.org/2000/svg",className:x("text-foreground w-7 -scale-x-100 transition-transform",n===b.ASC&&"-scale-y-100"),viewBox:"0 0 24 24",children:/* @__PURE__ */s("path",{fill:"currentColor",d:"M4 18q-.425 0-.712-.288T3 17t.288-.712T4 16h4q.425 0 .713.288T9 17t-.288.713T8 18zm0-5q-.425 0-.712-.288T3 12t.288-.712T4 11h10q.425 0 .713.288T15 12t-.288.713T14 13zm0-5q-.425 0-.712-.288T3 7t.288-.712T4 6h16q.425 0 .713.288T21 7t-.288.713T20 8z"})})}),/* @__PURE__ */s(K,{className:"flex-1 lg:flex-none",selected:t,buttons:l,onChange:e=>r&&r(e)})]})},Ae=["jpg","jpeg","png","webp","heic","tiff","bmp"],Me=({value:t,onChange:i})=>{const[o,l]=r(!1),c=n(null),d=a(()=>t?URL.createObjectURL(t):null,[t]);return e(()=>()=>{d&&URL.revokeObjectURL(d)},[d]),e(()=>{!t&&c.current&&(c.current.value="")},[t]),/* @__PURE__ */s("div",{className:"flex items-center gap-3",children:[!t&&/* @__PURE__ */s("div",{className:"flex items-center gap-4",children:/* @__PURE__ */s("button",{type:"button",onClick:()=>c.current?.click(),className:"border-border flex items-center gap-2 rounded border px-3 py-2.5 "+(o?"bg-opacity-75 cursor-not-allowed":"hover:cursor-pointer"),children:/* @__PURE__ */s(o?J:se,{})})}),t&&d&&/* @__PURE__ */s("img",{src:d,alt:"Facial Search",className:"size-10 rounded object-cover"}),
20
- /* @__PURE__ */s("input",{ref:c,type:"file",accept:"image/*",className:"hidden",onChange:e=>{const t=e.target?.files?.[0]??null;if(!t)return;const n=(t.name.split(".").pop()||"").toLowerCase();if(!Ae.includes(n))return i(null);(async e=>{if(!e)return;l(!0);let t=e;try{e.size/1024/1024>1&&(t=await de(e,{maxSizeMB:1,maxWidthOrHeight:1600,useWebWorker:!0,preserveExif:!1,maxIteration:3}))}catch(n){console.error(n)}l(!1),i(t)})(t)}})]})},_e={[q.GRID]:{icon:/* @__PURE__ */s(Ce,{className:"size-full text-inherit"})},[q.SINGLE]:{icon:/* @__PURE__ */s(ze,{className:"size-full text-inherit"})}},Pe=Object.keys(_e).map(e=>({icon:_e[e].icon,value:e})),Re=({engagementStyle:t,disabled:a,mode:i,onModeChange:l,sort:c,onSortChange:d,sortOrder:u,onSortOrderChange:m,handleChange:g,face:h,onFaceImageChange:p})=>{const{t:f}=Y(),{organization:v}=C(),[w,T]=r(""),[y,N]=r(null),q=n(null),x=o(()=>{q.current&&(URL.revokeObjectURL(q.current),q.current=null)},[]),b=o(e=>{if(N(e),x(),e){const t=URL.createObjectURL(e);q.current=t,p?.(t)}else p?.(void 0)},[p,x]),E=o(e=>{T(e.target.value)},[]),S=o(e=>{const t=e.key;"Enter"===t?g&&g(w.length>0?w:""):"Escape"===t&&(T(""),g&&g(""))},[w,g]),I=o(()=>{T(""),g&&g("")},[g]),L=o(()=>{g&&g(w)},[w,g]);return e(()=>{h||N(null)},[h]),e(()=>()=>{x()},[x]),/* @__PURE__ */s("div",{className:"mb-3 grid grid-cols-3 md:space-y-0 md:space-x-4",children:[
19
+ return s("div",{className:"relative flex w-auto items-center gap-2",children:[/* @__PURE__ */s("button",{type:"button",className:"bg-background rounded p-1",onClick:i,children:/* @__PURE__ */s("svg",{xmlns:"http://www.w3.org/2000/svg",className:x("text-foreground w-7 -scale-x-100 transition-transform",n===b.ASC&&"-scale-y-100"),viewBox:"0 0 24 24",children:/* @__PURE__ */s("path",{fill:"currentColor",d:"M4 18q-.425 0-.712-.288T3 17t.288-.712T4 16h4q.425 0 .713.288T9 17t-.288.713T8 18zm0-5q-.425 0-.712-.288T3 12t.288-.712T4 11h10q.425 0 .713.288T15 12t-.288.713T14 13zm0-5q-.425 0-.712-.288T3 7t.288-.712T4 6h16q.425 0 .713.288T21 7t-.288.713T20 8z"})})}),/* @__PURE__ */s(K,{className:"flex-1 lg:flex-none",selected:t,buttons:l,onChange:e=>r&&r(e)})]})},Me=["jpg","jpeg","png","webp","heic","tiff","bmp"],Ae=({value:t,onChange:i})=>{const[o,l]=r(!1),c=n(null),d=a(()=>t?URL.createObjectURL(t):null,[t]);return e(()=>()=>{d&&URL.revokeObjectURL(d)},[d]),e(()=>{!t&&c.current&&(c.current.value="")},[t]),/* @__PURE__ */s("div",{className:"flex items-center gap-3",children:[!t&&/* @__PURE__ */s("div",{className:"flex items-center gap-4",children:/* @__PURE__ */s("button",{type:"button",onClick:()=>c.current?.click(),className:"border-border flex items-center gap-2 rounded border px-3 py-2.5 "+(o?"bg-opacity-75 cursor-not-allowed":"hover:cursor-pointer"),children:/* @__PURE__ */s(o?J:se,{})})}),t&&d&&/* @__PURE__ */s("img",{src:d,alt:"Facial Search",className:"size-10 rounded object-cover"}),
20
+ /* @__PURE__ */s("input",{ref:c,type:"file",accept:"image/*",className:"hidden",onChange:e=>{const t=e.target?.files?.[0]??null;if(!t)return;const n=(t.name.split(".").pop()||"").toLowerCase();if(!Me.includes(n))return i(null);(async e=>{if(!e)return;l(!0);let t=e;try{e.size/1024/1024>1&&(t=await de(e,{maxSizeMB:1,maxWidthOrHeight:1600,useWebWorker:!0,preserveExif:!1,maxIteration:3}))}catch(n){console.error(n)}l(!1),i(t)})(t)}})]})},_e={[q.GRID]:{icon:/* @__PURE__ */s(Ce,{className:"size-full text-inherit"})},[q.SINGLE]:{icon:/* @__PURE__ */s(ze,{className:"size-full text-inherit"})}},Pe=Object.keys(_e).map(e=>({icon:_e[e].icon,value:e})),Re=({engagementStyle:t,disabled:a,mode:i,onModeChange:l,sort:c,onSortChange:d,sortOrder:u,onSortOrderChange:m,handleChange:g,face:h,onFaceImageChange:p})=>{const{t:f}=Y(),{organization:v}=C(),[w,T]=r(""),[y,N]=r(null),q=n(null),x=o(()=>{q.current&&(URL.revokeObjectURL(q.current),q.current=null)},[]),b=o(e=>{if(N(e),x(),e){const t=URL.createObjectURL(e);q.current=t,p?.(t)}else p?.(void 0)},[p,x]),E=o(e=>{T(e.target.value)},[]),S=o(e=>{const t=e.key;"Enter"===t?g&&g(w.length>0?w:""):"Escape"===t&&(T(""),g&&g(""))},[w,g]),I=o(()=>{T(""),g&&g("")},[g]),L=o(()=>{g&&g(w)},[w,g]);return e(()=>{h||N(null)},[h]),e(()=>()=>{x()},[x]),/* @__PURE__ */s("div",{className:"mb-3 grid grid-cols-3 md:space-y-0 md:space-x-4",children:[
21
21
  /* @__PURE__ */s("div",{className:"col-span-3 flex items-center gap-4 md:col-span-1",children:[v?.integrationSettings?.showGridViewToggle&&/* @__PURE__ */s(K,{buttons:Pe,selected:i,onChange:l}),v?.integrationSettings?.showKeywordSearch&&/* @__PURE__ */s("div",{className:"flex-auto",children:/* @__PURE__ */s("div",{className:"relative min-w-32 sm:min-w-48",children:[
22
22
  /* @__PURE__ */s(he,{placeholder:f("content.search_placeholder","Search using text"),value:w,className:"py-2",onChange:E,onKeyUp:S}),w?.length>0&&/* @__PURE__ */s("button",{className:"absolute inset-y-0 right-10 flex items-center",onClick:I,children:/* @__PURE__ */s(ee,{className:"text-foreground w-5"})}),
23
- /* @__PURE__ */s("button",{className:"absolute inset-y-0 right-3 flex items-center",onClick:L,children:/* @__PURE__ */s(G,{className:"text-foreground w-5"})})]})}),v?.integrationSettings?.showFacialSearch&&/* @__PURE__ */s(Me,{value:y,onChange:b})]}),
23
+ /* @__PURE__ */s("button",{className:"absolute inset-y-0 right-3 flex items-center",onClick:L,children:/* @__PURE__ */s(G,{className:"text-foreground w-5"})})]})}),v?.integrationSettings?.showFacialSearch&&/* @__PURE__ */s(Ae,{value:y,onChange:b})]}),
24
24
  /* @__PURE__ */s("div",{className:"col-span-3 md:col-span-1"}),
25
25
  /* @__PURE__ */s("div",{className:"col-span-3 mt-3 md:col-span-1 md:mt-0 lg:justify-self-end",children:/* @__PURE__ */s(ke,{engagementStyle:t,sort:c,order:u,onSortChange:d,onSortOrderChange:m})})]})},Ve=()=>/* @__PURE__ */s("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-full",width:"800",height:"469.317",viewBox:"0 0 800 469.317",role:"img","aria-hidden":"true",children:/* @__PURE__ */s("g",{transform:"translate(-443.142 -257.876)",children:[
26
26
  /* @__PURE__ */s("path",{d:"M898.247,664.1H371.155a30.276,30.276,0,0,1-30.241-30.241V352.525a30.276,30.276,0,0,1,30.241-30.241H898.247a30.276,30.276,0,0,1,30.241,30.241V633.862A30.276,30.276,0,0,1,898.247,664.1Z",transform:"translate(308.867 25.517)",fill:"#fff"}),
@@ -29,7 +29,7 @@ return s("div",{className:"relative flex w-auto items-center gap-2",children:[/*
29
29
  /* @__PURE__ */s("path",{d:"M775.247,705.1H248.155a30.276,30.276,0,0,1-30.241-30.241V393.525a30.276,30.276,0,0,1,30.241-30.241H775.247a30.276,30.276,0,0,1,30.241,30.242V674.862A30.275,30.275,0,0,1,775.247,705.1Z",transform:"translate(319.149 22.09)",fill:"#fff"}),
30
30
  /* @__PURE__ */s("path",{d:"M638.653,701.841H298.272c-.426,0-.852-.009-1.272-.033l160.985-90.663c3.065-1.762,9.943-2.382,15.361-1.385a13.912,13.912,0,0,1,4.26,1.385l108.041,60.842,5.176,2.911Z",transform:"translate(312.538 1.526)",fill:"#e6e6e6"}),
31
31
  /* @__PURE__ */s("path",{d:"M760.145,704.279h-294.4l57.049-26.943L526.9,675.4l74.341-35.111c4.874-2.3,16.6-2.445,22.328-.434q.577.206,1.071.434Z",transform:"translate(298.432 -0.912)",fill:"#e6e6e6"}),
32
- /* @__PURE__ */s("path",{d:"M248.322,365.284a28.441,28.441,0,0,0-28.409,28.409V675.03a28.441,28.441,0,0,0,28.409,28.409H775.415a28.441,28.441,0,0,0,28.409-28.409V393.693a28.441,28.441,0,0,0-28.409-28.409Z",transform:"translate(319.149 22.09)",fill:"none",stroke:"#d6d6e3",strokeWidth:"1.833"})]})}),Oe=({position:t,gamConfig:r,eventId:a,organizationId:i})=>{const{trackGamAnalytics:o}=ie(),l=n(null),d=`gam-${t}-banner-${a??"ev"}`,u=r.placementCategories?.[t];return e(()=>{let e=!1,t=null,n=null,s=null,m=null,g=null,h=null;const p=u?[u]:[],f=document.createElement("div");f.id=d,document.body.appendChild(f);const v=()=>{const e=l.current;if(!e)return;const t=e.getBoundingClientRect(),n=t.width>0&&t.height>0;f.style.display=n?"block":"none",n&&(f.style.position="fixed",f.style.top=`${t.top}px`,f.style.left=`${t.left}px`,f.style.width="728px",f.style.height="90px",f.style.zIndex="20")};return v(),window.addEventListener("scroll",v,{passive:!0}),window.addEventListener("resize",v),(async()=>{await re(),e||window.googletag.cmd.push(()=>{if(e)return;oe(d);const l=window.googletag.defineSlot(r.adUnitPath,[[728,90]],d)?.addService(window.googletag.pubads());l&&(t=l,m=window.googletag.pubads(),a?l.setConfig({targeting:{qrati_event:a,...p.length>0?{qrati_category:p}:{}}}):p.length>0&&l.setConfig({targeting:{qrati_category:p}}),g=e=>{e.slot===l&&o({eventId:a,organizationId:i,type:c.GAM_IMPRESSION,creativeId:String(e.creativeId??""),lineItemId:String(e.lineItemId??""),advertiserId:String(e.advertiserId??""),isEmpty:e.isEmpty??!1})},m.addEventListener("slotRenderEnded",g),h=e=>{e.slot===l&&o({eventId:a,organizationId:i,type:c.GAM_VIEWABLE})},m.addEventListener("impressionViewable",h),s=ce({container:f,onClick:()=>{o({eventId:a,organizationId:i,type:c.GAM_CLICK})}}),ae(),window.googletag.display(d),n=window.setTimeout(()=>{e||(v(),l.getResponseInformation?.()||window.googletag.pubads().refresh([l]))},1500))})})(),()=>{e=!0,window.removeEventListener("scroll",v),window.removeEventListener("resize",v),null!==n&&window.clearTimeout(n),s?.(),m&&"function"==typeof m.removeEventListener&&(g&&m.removeEventListener("slotRenderEnded",g),h&&m.removeEventListener("impressionViewable",h));const r=t;t=null,r&&window.googletag?.cmd?.push(()=>{window.googletag.destroySlots([r])}),f.parentNode&&f.parentNode.removeChild(f)}},[a,r.adUnitPath,i,u,t,d]),/* @__PURE__ */s("div",{className:"flex w-full items-center justify-center overflow-x-auto py-2",children:/* @__PURE__ */s("div",{ref:l,style:{width:728,height:90,minWidth:728}})})},je=({gamConfig:t,eventId:r,organizationId:a})=>{const{trackGamAnalytics:i}=ie(),o=n(null),l=`gam-right-${r??"ev"}`,d=t.placementCategories?.right??t.placementCategories?.sidebar;return e(()=>{let e=!1,n=null,s=null,u=null,m=null,g=null,h=null;const p=d?[d]:[],f=document.createElement("div");f.id=l,document.body.appendChild(f);const v=()=>{const e=o.current;if(!e)return;const t=e.getBoundingClientRect(),n=e.parentElement?.getBoundingClientRect(),r=t.width>0&&t.height>0;if(f.style.display=r?"block":"none",!r)return;const a=t.top<=0&&n?Math.min(0,n.bottom-600):t.top;f.style.position="fixed",f.style.top=`${a}px`,f.style.left=`${t.left}px`,f.style.width="160px",f.style.height="600px",f.style.zIndex="20"};return v(),window.addEventListener("scroll",v,{passive:!0}),window.addEventListener("resize",v),(async()=>{await re(),e||window.googletag.cmd.push(()=>{if(e)return;oe(l);const o=window.googletag.defineSlot(t.adUnitPath,[[160,600]],l)?.addService(window.googletag.pubads());o&&(n=o,m=window.googletag.pubads(),r?o.setConfig({targeting:{qrati_event:r,...p.length>0?{qrati_category:p}:{}}}):p.length>0&&o.setConfig({targeting:{qrati_category:p}}),g=e=>{e.slot===o&&i({eventId:r,organizationId:a,type:c.GAM_IMPRESSION,creativeId:String(e.creativeId??""),lineItemId:String(e.lineItemId??""),advertiserId:String(e.advertiserId??""),isEmpty:e.isEmpty??!1})},m.addEventListener("slotRenderEnded",g),h=e=>{e.slot===o&&i({eventId:r,organizationId:a,type:c.GAM_VIEWABLE})},m.addEventListener("impressionViewable",h),u=ce({container:f,onClick:()=>{i({eventId:r,organizationId:a,type:c.GAM_CLICK})}}),ae(),window.googletag.display(l),s=window.setTimeout(()=>{e||(v(),o.getResponseInformation?.()||window.googletag.pubads().refresh([o]))},1500))})})(),()=>{e=!0,window.removeEventListener("scroll",v),window.removeEventListener("resize",v),null!==s&&window.clearTimeout(s),u?.(),m&&"function"==typeof m.removeEventListener&&(g&&m.removeEventListener("slotRenderEnded",g),h&&m.removeEventListener("impressionViewable",h));const t=n;n=null,t&&window.googletag?.cmd?.push(()=>{window.googletag.destroySlots([t])}),f.parentNode&&f.parentNode.removeChild(f)}},[r,t.adUnitPath,a,d,l]),/* @__PURE__ */s("div",{ref:o,style:{width:160,height:600},className:"hidden shrink-0 self-start lg:block"})},Fe=t(()=>import("./7GXdePWm2.js")),Be=()=>{const t=R().eventSlug,{loadingUser:o,organization:c}=C(),p=u(),[f,w]=r(""),[b,S]=r(void 0),[z,P]=r(N),[O,F]=r(v),[B,H]=r("undefined"!=typeof window&&window.innerWidth<768?q.SINGLE:q.GRID),U=n(null),{event:G,ads:$,gamConfig:D}=te({eventSlug:t}),{loading:W,isError:K,error:Y,refetch:J,contentsWithAds:ne,hasNextPage:re,fetchNextPage:ae,isFetchingNextPage:se}=(({event:e,ads:t=[],gamConfig:n,sort:r=N,order:i=v,keywords:s,face:o,limit:l=20})=>{const{props:c,loadingUser:d,user:u}=C(),p=c?.organizationId,{isLoading:f,isError:w,error:T,data:q,hasNextPage:x,fetchNextPage:b,isFetchingNextPage:S,refetch:L}=M({queryKey:[h.CONTENTS_BY_EVENT(e?._id??""),p??"",r,i,s,o,String(l)],queryFn:async({pageParam:t=1})=>{try{return await g.get(I.GET_CONTENTS,{searchParams:{eventId:e?._id,page:t,keywords:s,faceImageUrl:o,sort:`${m[i].sortOrder}${y[r].sortField}`,limit:l},headers:{"x-org-id":p,...u?{Authorization:`Bearer ${u.token}`}:{}}}).json()}catch(T){throw new Error(T instanceof Error?T.message:String(T)||"Failed to fetch contents")}},enabled:!d&&!!e,staleTime:6e4,gcTime:3e5,initialPageParam:1,getPreviousPageParam:e=>A(e),getNextPageParam:_}),z=a(()=>q?.pages?.flatMap(e=>e?.data??[])??[],[q]);return{contents:z,contentsWithAds:a(()=>"gam"===e?.adMode?n?.inGalleryEnabled?((e=[],t,n)=>{if(!n||n<=0)return e;const[r,a]=t.sizes[0]??[300,250];let i=0;const s=[];for(let o=0;o<e.length;o++)s.push(e[o]),n>0&&(o+1)%n===0&&(s.push({_id:`gam-ad-slot-${i}`,type:E.GAM_AD,slotIndex:i,width:r,height:a}),i++);return s})(z,n,e?.adPosition??5):z:((e=[],t=[],n)=>{if(!n||n<=0)return e;let r=0;const a=[];for(let i=0;i<(e?.length||0);i++)a.push(e[i]),t.length>0&&n>0&&(i+1)%n===0&&(a.push({...t[r],type:E.AD,adType:t[r].type}),r=(r+1)%t.length);return a})(z,t,e?.adPosition),[t,z,e?.adMode,e?.adPosition,n]),loading:f,isError:w,error:T,refetch:L,hasNextPage:x,fetchNextPage:b,isFetchingNextPage:S}})({event:G,ads:$,gamConfig:D,sort:z,order:O,keywords:f,face:b}),{incrementEventView:oe}=ie(),{start:le,initializing:ce,running:de}=(({ref:t,onBottomReached:a,hasNextPage:i,fetchNextPage:s,isFetchingNextPage:o})=>{const l=n(1),c=n(null),d=n(null),u=n(null),m=n(null),g=n(!1),h=n(),p=n(),[f,v]=r(!1),[w,T]=r(!1),y=()=>{null!==u.current&&u.current.release().then(()=>{u.current=null}).catch(()=>{u.current=null}),m.current&&(document.removeEventListener("visibilitychange",m.current),m.current=null),v(!1),T(!1),t.current&&(t.current.scrollTop=0),c.current&&(window.cancelAnimationFrame(c.current),c.current=null),d.current&&(window.clearTimeout(d.current),d.current=null),g.current&&(h.current&&document.removeEventListener("keydown",h.current),p.current&&document.removeEventListener("fullscreenchange",p.current),g.current=!1)},N=n(e=>{"+"===e.key&&(l.current=Math.min(l.current+1,10)),"-"===e.key&&(l.current=Math.max(l.current-1,1))});N.current=e=>{"+"===e.key&&(l.current=Math.min(l.current+1,10)),"-"===e.key&&(l.current=Math.max(l.current-1,1))};const q=n(()=>{document.fullscreenElement||y()});q.current=()=>{document.fullscreenElement||y()};const x=()=>{t.current&&(t.current.scrollTop+=l.current,i&&!o&&s&&t.current.scrollTop+t.current.clientHeight>=.5*t.current.scrollHeight&&s(),t.current.scrollTop+t.current.clientHeight>=t.current.scrollHeight?(v(!1),c.current&&(window.cancelAnimationFrame(c.current),c.current=null),d.current=window.setTimeout(()=>{T(!0),a?.(),d.current=window.setTimeout(()=>{t.current&&(t.current.scrollTop=0),T(!1),v(!0)},1e3)},1e3)):c.current=window.requestAnimationFrame(x))};return e(()=>(f&&(d.current&&window.clearTimeout(d.current),d.current=window.setTimeout(()=>{c.current=window.requestAnimationFrame(x)},300)),()=>{c.current&&window.cancelAnimationFrame(c.current)}),[f,i,o,s,a]),e(()=>()=>{y()},[]),{start:()=>{if(t?.current?.requestFullscreen)t.current.requestFullscreen();else{const e=t.current;e?.webkitRequestFullscreen?e.webkitRequestFullscreen():e?.mozRequestFullScreen?e.mozRequestFullScreen():e?.msRequestFullscreen&&e.msRequestFullscreen()}(async()=>{try{if("wakeLock"in navigator){u.current=await navigator.wakeLock.request("screen");const e=async()=>{null!==u.current&&"visible"===document.visibilityState&&(u.current=await navigator.wakeLock.request("screen"))};m.current=e,document.addEventListener("visibilitychange",e)}}catch(e){}})(),v(!0),g.current||(h.current=e=>N.current(e),p.current=()=>q.current(),document.addEventListener("keydown",h.current),document.addEventListener("fullscreenchange",p.current),g.current=!0)},initializing:w,running:f}})({ref:U,hasNextPage:re,fetchNextPage:ae,isFetchingNextPage:se,onBottomReached:()=>G?._id&&p.refetchQueries({queryKey:[h.CONTENTS_BY_EVENT(G._id)]})});e(()=>{G?.slug&&oe(G.slug)},[G?.slug,oe]);const ue=a(()=>B===q.SINGLE,[B]),ge=a(()=>/* @__PURE__ */s(Le,{event:G,onAutoscrollClick:le}),[G,le]),he=n(null),pe=n(null);e(()=>(he.current&&he.current.disconnect(),he.current=new IntersectionObserver(e=>{e[0].isIntersecting&&re&&!se&&!W&&ae()},{rootMargin:"200px"}),pe.current&&he.current.observe(pe.current),()=>{he.current&&(he.current.disconnect(),he.current=null)}),[re,se,W,ae]);const fe=D?.bannerPositions??[],ve=c?._id,Te=D&&fe.includes("right"),ye=Boolean(c?.integrationSettings?.showQuickSearch);/* @__PURE__ */
32
+ /* @__PURE__ */s("path",{d:"M248.322,365.284a28.441,28.441,0,0,0-28.409,28.409V675.03a28.441,28.441,0,0,0,28.409,28.409H775.415a28.441,28.441,0,0,0,28.409-28.409V393.693a28.441,28.441,0,0,0-28.409-28.409Z",transform:"translate(319.149 22.09)",fill:"none",stroke:"#d6d6e3",strokeWidth:"1.833"})]})}),Oe=({position:t,gamConfig:r,eventId:a,organizationId:i})=>{const{trackGamAnalytics:o}=ie(),l=n(null),d=`gam-${t}-banner-${a??"ev"}`,u=r.placementCategories?.[t];return e(()=>{let e=!1,t=null,n=null,s=null,m=null,g=null,h=null;const p=u?[u]:[],f=document.createElement("div");f.id=d,document.body.appendChild(f);const v=()=>{const e=l.current;if(!e)return;const t=e.getBoundingClientRect(),n=t.width>0&&t.height>0;f.style.display=n?"block":"none",n&&(f.style.position="fixed",f.style.top=`${t.top}px`,f.style.left=`${t.left}px`,f.style.width="728px",f.style.height="90px",f.style.zIndex="20")};return v(),window.addEventListener("scroll",v,{passive:!0}),window.addEventListener("resize",v),(async()=>{await re(),e||window.googletag.cmd.push(()=>{if(e)return;oe(d);const l=window.googletag.defineSlot(r.adUnitPath,[[728,90]],d)?.addService(window.googletag.pubads());l&&(t=l,m=window.googletag.pubads(),a?l.setConfig({targeting:{qrati_event:a,...p.length>0?{qrati_category:p}:{}}}):p.length>0&&l.setConfig({targeting:{qrati_category:p}}),g=e=>{e.slot===l&&o({eventId:a,organizationId:i,type:c.GAM_IMPRESSION,creativeId:String(e.creativeId??""),lineItemId:String(e.lineItemId??""),advertiserId:String(e.advertiserId??""),isEmpty:e.isEmpty??!1})},m.addEventListener("slotRenderEnded",g),h=e=>{e.slot===l&&o({eventId:a,organizationId:i,type:c.GAM_VIEWABLE})},m.addEventListener("impressionViewable",h),s=ce({container:f,onClick:()=>{o({eventId:a,organizationId:i,type:c.GAM_CLICK})}}),ae(),window.googletag.display(d),n=window.setTimeout(()=>{e||(v(),l.getResponseInformation?.()||window.googletag.pubads().refresh([l]))},1500))})})(),()=>{e=!0,window.removeEventListener("scroll",v),window.removeEventListener("resize",v),null!==n&&window.clearTimeout(n),s?.(),m&&"function"==typeof m.removeEventListener&&(g&&m.removeEventListener("slotRenderEnded",g),h&&m.removeEventListener("impressionViewable",h));const r=t;t=null,r&&window.googletag?.cmd?.push(()=>{window.googletag.destroySlots([r])}),f.parentNode&&f.parentNode.removeChild(f)}},[a,r.adUnitPath,i,u,t,d]),/* @__PURE__ */s("div",{className:"flex w-full items-center justify-center overflow-x-auto py-2",children:/* @__PURE__ */s("div",{ref:l,style:{width:728,height:90,minWidth:728}})})},je=({gamConfig:t,eventId:r,organizationId:a})=>{const{trackGamAnalytics:i}=ie(),o=n(null),l=`gam-right-${r??"ev"}`,d=t.placementCategories?.right??t.placementCategories?.sidebar;return e(()=>{let e=!1,n=null,s=null,u=null,m=null,g=null,h=null;const p=d?[d]:[],f=document.createElement("div");f.id=l,document.body.appendChild(f);const v=()=>{const e=o.current;if(!e)return;const t=e.getBoundingClientRect(),n=e.parentElement?.getBoundingClientRect(),r=t.width>0&&t.height>0;if(f.style.display=r?"block":"none",!r)return;const a=t.top<=0&&n?Math.min(0,n.bottom-600):t.top;f.style.position="fixed",f.style.top=`${a}px`,f.style.left=`${t.left}px`,f.style.width="160px",f.style.height="600px",f.style.zIndex="20"};return v(),window.addEventListener("scroll",v,{passive:!0}),window.addEventListener("resize",v),(async()=>{await re(),e||window.googletag.cmd.push(()=>{if(e)return;oe(l);const o=window.googletag.defineSlot(t.adUnitPath,[[160,600]],l)?.addService(window.googletag.pubads());o&&(n=o,m=window.googletag.pubads(),r?o.setConfig({targeting:{qrati_event:r,...p.length>0?{qrati_category:p}:{}}}):p.length>0&&o.setConfig({targeting:{qrati_category:p}}),g=e=>{e.slot===o&&i({eventId:r,organizationId:a,type:c.GAM_IMPRESSION,creativeId:String(e.creativeId??""),lineItemId:String(e.lineItemId??""),advertiserId:String(e.advertiserId??""),isEmpty:e.isEmpty??!1})},m.addEventListener("slotRenderEnded",g),h=e=>{e.slot===o&&i({eventId:r,organizationId:a,type:c.GAM_VIEWABLE})},m.addEventListener("impressionViewable",h),u=ce({container:f,onClick:()=>{i({eventId:r,organizationId:a,type:c.GAM_CLICK})}}),ae(),window.googletag.display(l),s=window.setTimeout(()=>{e||(v(),o.getResponseInformation?.()||window.googletag.pubads().refresh([o]))},1500))})})(),()=>{e=!0,window.removeEventListener("scroll",v),window.removeEventListener("resize",v),null!==s&&window.clearTimeout(s),u?.(),m&&"function"==typeof m.removeEventListener&&(g&&m.removeEventListener("slotRenderEnded",g),h&&m.removeEventListener("impressionViewable",h));const t=n;n=null,t&&window.googletag?.cmd?.push(()=>{window.googletag.destroySlots([t])}),f.parentNode&&f.parentNode.removeChild(f)}},[r,t.adUnitPath,a,d,l]),/* @__PURE__ */s("div",{ref:o,style:{width:160,height:600},className:"hidden shrink-0 self-start lg:block"})},Fe=t(()=>import("./DQ6V4QOv2.js")),Be=()=>{const t=R().eventSlug,{loadingUser:o,organization:c}=C(),p=u(),[f,w]=r(""),[b,S]=r(void 0),[z,P]=r(N),[O,F]=r(v),[B,H]=r("undefined"!=typeof window&&window.innerWidth<768?q.SINGLE:q.GRID),U=n(null),{event:G,ads:$,gamConfig:D}=te({eventSlug:t}),{loading:W,isError:K,error:Y,refetch:J,contentsWithAds:ne,hasNextPage:re,fetchNextPage:ae,isFetchingNextPage:se}=(({event:e,ads:t=[],gamConfig:n,sort:r=N,order:i=v,keywords:s,face:o,limit:l=20})=>{const{props:c,loadingUser:d,user:u}=C(),p=c?.organizationId,{isLoading:f,isError:w,error:T,data:q,hasNextPage:x,fetchNextPage:b,isFetchingNextPage:S,refetch:L}=A({queryKey:[h.CONTENTS_BY_EVENT(e?._id??""),p??"",r,i,s,o,String(l)],queryFn:async({pageParam:t=1})=>{try{return await g.get(I.GET_CONTENTS,{searchParams:{eventId:e?._id,page:t,keywords:s,faceImageUrl:o,sort:`${m[i].sortOrder}${y[r].sortField}`,limit:l},headers:{"x-org-id":p,...u?{Authorization:`Bearer ${u.token}`}:{}}}).json()}catch(T){throw new Error(T instanceof Error?T.message:String(T)||"Failed to fetch contents")}},enabled:!d&&!!e,staleTime:6e4,gcTime:3e5,initialPageParam:1,getPreviousPageParam:e=>M(e),getNextPageParam:_}),z=a(()=>q?.pages?.flatMap(e=>e?.data??[])??[],[q]);return{contents:z,contentsWithAds:a(()=>"gam"===e?.adMode?n?.inGalleryEnabled?((e=[],t,n)=>{if(!n||n<=0)return e;const[r,a]=t.sizes[0]??[300,250];let i=0;const s=[];for(let o=0;o<e.length;o++)s.push(e[o]),n>0&&(o+1)%n===0&&(s.push({_id:`gam-ad-slot-${i}`,type:E.GAM_AD,slotIndex:i,width:r,height:a}),i++);return s})(z,n,e?.adPosition??5):z:((e=[],t=[],n)=>{if(!n||n<=0)return e;let r=0;const a=[];for(let i=0;i<(e?.length||0);i++)a.push(e[i]),t.length>0&&n>0&&(i+1)%n===0&&(a.push({...t[r],type:E.AD,adType:t[r].type}),r=(r+1)%t.length);return a})(z,t,e?.adPosition),[t,z,e?.adMode,e?.adPosition,n]),loading:f,isError:w,error:T,refetch:L,hasNextPage:x,fetchNextPage:b,isFetchingNextPage:S}})({event:G,ads:$,gamConfig:D,sort:z,order:O,keywords:f,face:b}),{incrementEventView:oe}=ie(),{start:le,initializing:ce,running:de}=(({ref:t,onBottomReached:a,hasNextPage:i,fetchNextPage:s,isFetchingNextPage:o})=>{const[l,c]=r(!1),[d,u]=r(!1),m=n(1),g=n(null),h=n(null),p=n(null),f=n(0),v=n(!1),w=n(null),T=n(null),y=n(!1),N=n(),q=n(),x=n(i),b=n(o),E=n(s),C=n(a);x.current=i,b.current=o,E.current=s,C.current=a,e(()=>{o||(v.current=!1)},[o]);const S=()=>{null!==g.current&&(window.cancelAnimationFrame(g.current),g.current=null)},I=e=>{const n=t.current;if(!n)return;null===p.current&&(p.current=e);const r=Math.min((e-p.current)/1e3,.05);p.current=e,f.current+=60*m.current*r;const a=Math.floor(f.current);a>0&&(n.scrollTop+=a,f.current-=a),x.current&&!b.current&&!v.current&&"function"==typeof E.current&&n.scrollTop+n.clientHeight>=.5*n.scrollHeight&&(v.current=!0,E.current()),Math.ceil(n.scrollTop)+n.clientHeight>=n.scrollHeight?(S(),h.current=window.setTimeout(()=>{u(!0),C.current?.(),v.current=!1,h.current=window.setTimeout(()=>{t.current&&(t.current.scrollTop=0),u(!1),f.current=0,p.current=null,g.current=window.requestAnimationFrame(I)},1e3)},1e3)):g.current=window.requestAnimationFrame(I)},L=()=>{S(),h.current&&(window.clearTimeout(h.current),h.current=null),null!==w.current&&w.current.release().catch(()=>{}).finally(()=>{w.current=null}),T.current&&(document.removeEventListener("visibilitychange",T.current),T.current=null),y.current&&(N.current&&document.removeEventListener("keydown",N.current),q.current&&document.removeEventListener("fullscreenchange",q.current),y.current=!1),c(!1),u(!1),t.current&&(t.current.scrollTop=0)},z=n(e=>{"+"===e.key&&(m.current=Math.min(m.current+1,10)),"-"===e.key&&(m.current=Math.max(m.current-1,1))}),k=n(()=>{document.fullscreenElement||L()});return k.current=()=>{document.fullscreenElement||L()},e(()=>()=>{L()},[]),{start:()=>{if(t?.current?.requestFullscreen)t.current.requestFullscreen();else{const e=t.current;e?.webkitRequestFullscreen?e.webkitRequestFullscreen():e?.mozRequestFullScreen?e.mozRequestFullScreen():e?.msRequestFullscreen&&e.msRequestFullscreen()}(async()=>{try{if(!("wakeLock"in navigator))return;const e=navigator;w.current=await e.wakeLock.request("screen");const t=async()=>{"visible"===document.visibilityState&&(w.current=await e.wakeLock.request("screen"))};T.current=t,document.addEventListener("visibilitychange",t)}catch(e){}})(),y.current||(N.current=e=>z.current(e),q.current=()=>k.current(),document.addEventListener("keydown",N.current),document.addEventListener("fullscreenchange",q.current),y.current=!0),f.current=0,p.current=null,v.current=!1,c(!0),S(),h.current=window.setTimeout(()=>{g.current=window.requestAnimationFrame(I)},300)},initializing:d,running:l}})({ref:U,hasNextPage:re,fetchNextPage:ae,isFetchingNextPage:se,onBottomReached:()=>G?._id&&p.refetchQueries({queryKey:[h.CONTENTS_BY_EVENT(G._id)]})});e(()=>{G?.slug&&oe(G.slug)},[G?.slug,oe]);const ue=a(()=>B===q.SINGLE,[B]),ge=a(()=>/* @__PURE__ */s(Le,{event:G,onAutoscrollClick:le}),[G,le]),he=n(null),pe=n(null);e(()=>(he.current&&he.current.disconnect(),he.current=new IntersectionObserver(e=>{e[0].isIntersecting&&re&&!se&&!W&&ae()},{rootMargin:"200px"}),pe.current&&he.current.observe(pe.current),()=>{he.current&&(he.current.disconnect(),he.current=null)}),[re,se,W,ae]);const fe=D?.bannerPositions??[],ve=c?._id,Te=D&&fe.includes("right"),ye=Boolean(c?.integrationSettings?.showQuickSearch);/* @__PURE__ */
33
33
  return s("div",{className:"bg-background mx-auto min-h-[80vh]",children:[
34
34
  /* @__PURE__ */s("div",{className:"flex flex-row justify-end gap-4 pt-2",children:ge}),
35
35
  /* @__PURE__ */s("div",{className:"pb-3",children:/* @__PURE__ */s(we,{})}),D&&fe.includes("top")&&/* @__PURE__ */s(Oe,{position:"top",gamConfig:D,eventId:G?._id,organizationId:ve}),
@@ -1,4 +1,4 @@
1
- import{d as e,s as r,t,v as o}from"./C3uDEVBt.js";import{D as l,n as s}from"./BItJQVdK.js";import{l as i}from"./b6CwQBFC.js";var n=e(()=>import("./Bm_xW_Mp2.js")),a=e(()=>import("./B78xAjNG2.js")),c=e(()=>import("./_bFyk49H2.js")),d=e(()=>import("./CebL6kYV2.js")),p=()=>/* @__PURE__ */t("div",{class:"flex h-full items-center justify-center",children:/* @__PURE__ */t("div",{class:"text-center",children:[
1
+ import{d as e,s as r,t,v as o}from"./C3uDEVBt.js";import{D as l,n as s}from"./BItJQVdK.js";import{l as i}from"./b6CwQBFC.js";var n=e(()=>import("./qNDy94Dr2.js")),a=e(()=>import("./C030L_Hu2.js")),c=e(()=>import("./BfkCwRAR2.js")),d=e(()=>import("./D4apO9G62.js")),p=()=>/* @__PURE__ */t("div",{class:"flex h-full items-center justify-center",children:/* @__PURE__ */t("div",{class:"text-center",children:[
2
2
  /* @__PURE__ */t("svg",{xmlns:"http://www.w3.org/2000/svg",class:"text-muted-foreground mx-auto mb-3 size-10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5",children:[/* @__PURE__ */t("path",{d:"M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7z"}),/* @__PURE__ */t("circle",{cx:"12",cy:"9",r:"2.5"})]}),
3
3
  /* @__PURE__ */t("p",{class:"text-foreground",children:"No location data available."}),
4
4
  /* @__PURE__ */t("p",{class:"text-muted-foreground mt-1 text-xs",children:"Events need location data to appear on the map."})]})}),m=()=>/* @__PURE__ */t("div",{class:"flex h-full items-center justify-center",children:/* @__PURE__ */t("div",{class:"border-primary size-8 animate-spin rounded-full border-4 border-t-transparent"})}),g=({events:e,isLoading:g=!1})=>{const{organization:x}=s(),f=i(),h=x?.integrationSettings??{},u=h.mapProvider??"openstreetmap",v=o(e=>{f(l.GALLERY(e))},[f]);if("openstreetmap_free"===u)/* @__PURE__ */return t("div",{class:"relative mt-3 h-screen sm:mt-6",children:/* @__PURE__ */t(r,{fallback:/* @__PURE__ */t(m,{}),children:/* @__PURE__ */t(n,{onExplore:v,logoUrl:x?.logoUrl})})});const y=h.mapTilerApiKey??"",b=h.googleMapsApiKey??"",w=h.mapboxApiKey??"",j=e.filter(e=>"number"==typeof e.location?.x&&"number"==typeof e.location?.y);/* @__PURE__ */
@@ -0,0 +1,9 @@
1
+ import{t as e,w as t}from"./C3uDEVBt.js";import{D as n,n as a}from"./BItJQVdK.js";import{c as r,l as i,t as s}from"./b6CwQBFC.js";import{t as o}from"./ekog7y-V.js";import{t as l}from"./Cb1JRT_1.js";import{n as c}from"./DvTRhlvs.js";import{t as m}from"./D9NypPiv.js";import{t as d}from"./_ty2jtjs.js";function h({className:t}){/* @__PURE__ */
2
+ return e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:t,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */e("path",{fill:"currentColor",d:"M5 21q-.825 0-1.412-.587T3 19v-3q0-.425.288-.712T4 15t.713.288T5 16v3h14V5H5v3q0 .425-.288.713T4 9t-.712-.288T3 8V5q0-.825.588-1.412T5 3h14q.825 0 1.413.588T21 5v14q0 .825-.587 1.413T19 21zm6.65-8H4q-.425 0-.712-.288T3 12t.288-.712T4 11h7.65L9.8 9.15q-.3-.3-.288-.7t.288-.7q.3-.3.713-.312t.712.287L14.8 11.3q.15.15.213.325t.062.375t-.062.375t-.213.325l-3.575 3.575q-.3.3-.712.288T9.8 16.25q-.275-.3-.288-.7t.288-.7z"})})}var u=()=>{const{t:t}=c(),d=r(),u=i(),{initializing:p,organization:g,loadingUser:v,user:f,signout:N}=a();/* @__PURE__ */
3
+ return e("div",p||v?{className:"my-2 flex justify-end",children:/* @__PURE__ */e(o,{className:"h-9 w-64"})}:{className:"mx-auto mb-4",children:[!f&&/* @__PURE__ */e("div",{className:"flex justify-end gap-4",children:/* @__PURE__ */e(s,{to:`${n.LOGIN}?ref=${encodeURIComponent(d.pathname)}`,children:/* @__PURE__ */e(m,{children:t("button.login","Login")})})}),f&&/* @__PURE__ */e("div",{className:"mt-2 flex items-center justify-end gap-4",children:[/* @__PURE__ */e(l,{variant:"h5",children:f.name}),!g?.customAuth&&/* @__PURE__ */e("button",{onClick:async()=>{await N(),u(n.PUBLIC_EVENTS)},children:/* @__PURE__ */e(h,{className:"text-destructive"})})]})]})},p=()=>{const{user:r,organization:o,signout:c}=a(),m=i(),h=o?.integrationSettings?.hideQratiBranding;/* @__PURE__ */
4
+ return e("div",{className:"pt-16 sm:pt-24",children:[o&&/* @__PURE__ */e("div",{className:"mx-auto py-2",children:o.customAuth?r&&/* @__PURE__ */e(l,{variant:"h6",align:"center",children:[r.name,"•"," ",
5
+ /* @__PURE__ */e(s,{className:"hover:underline",to:n.MY_UPLOADS,children:"My Uploads"})]}):/* @__PURE__ */e(t,{children:[!r&&/* @__PURE__ */e(l,{variant:"h6",align:"center",children:[
6
+ /* @__PURE__ */e(s,{className:"text-primary hover:underline",to:n.LOGIN,children:"Login"})," ","•"," ",
7
+ /* @__PURE__ */e(s,{className:"text-primary hover:underline",to:n.REGISTER,children:"Register"})]}),r&&/* @__PURE__ */e(l,{variant:"h6",align:"center",children:[r.name," •"," ",
8
+ /* @__PURE__ */e(s,{className:"hover:underline",to:n.MY_UPLOADS,children:"My Uploads"})," ","•"," ",
9
+ /* @__PURE__ */e("button",{type:"button",className:"text-destructive cursor-pointer border-none bg-transparent p-0 hover:underline",onClick:async()=>{await c(),m(n.PUBLIC_EVENTS)},children:"Logout"})]})]})}),!h&&/* @__PURE__ */e(d,{})]})};export{u as n,p as t};
@@ -1,3 +1,3 @@
1
- import{n as e}from"./Cko4QHwX.js";import{C as t,b as o,f as l,h as r,p as a,t as n}from"./C3uDEVBt.js";import{I as i,a as f,n as c,w as p}from"./BItJQVdK.js";import{t as s}from"./Be1e_ATJ.js";import{a as d,i as u,n as m,o as g,r as b,t as h}from"./R0dHh5Az2.js";import{t as x}from"./CfMNBPpx2.js";var k=[[90,-180],[-90,180]],v=[20,0],y="#fb8500",w={topLeft:[276,60],bottomRight:[60,60]},z=new s,A=e=>e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"),E=({onExplore:s,logoUrl:E})=>{const L=l(null),R=l(null),C=l(null),T=l(null),M=l(null),O=l(null),I=l(null),W=l(!1),S=l(!1),Z=a(()=>(()=>{try{const e=sessionStorage.getItem(p);if(!e)return null;const t=JSON.parse(e);if("number"==typeof t?.center?.lat&&"number"==typeof t?.center?.lng&&"number"==typeof t?.zoom)return t}catch{}return null})(),[]),[j,q]=r(!0),[D,B]=r(!1),{folderTree:H,activeFolderId:N,activeFolder:P,visibleEvents:U,setActiveFolderId:F,isLoadingEvents:Y}=g(),{organization:J}=c();return o(()=>{if(!L.current||R.current)return;x("leaflet",'.leaflet-pane,.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-tile-container,.leaflet-pane>svg,.leaflet-pane>canvas,.leaflet-zoom-box,.leaflet-image-layer,.leaflet-layer{position:absolute;top:0;left:0}.leaflet-container{overflow:hidden}.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow{-webkit-user-select:none;user-select:none;-webkit-user-drag:none}.leaflet-tile::selection{background:0 0}.leaflet-safari .leaflet-tile{image-rendering:-webkit-optimize-contrast}.leaflet-safari .leaflet-tile-container{-webkit-transform-origin:0 0;width:1600px;height:1600px}.leaflet-marker-icon,.leaflet-marker-shadow{display:block}.leaflet-container .leaflet-overlay-pane svg{max-width:none!important;max-height:none!important}.leaflet-container .leaflet-marker-pane img,.leaflet-container .leaflet-shadow-pane img,.leaflet-container .leaflet-tile-pane img,.leaflet-container img.leaflet-image-layer,.leaflet-container .leaflet-tile{width:auto;padding:0;max-width:none!important;max-height:none!important}.leaflet-container img.leaflet-tile{mix-blend-mode:plus-lighter}.leaflet-container.leaflet-touch-zoom{-ms-touch-action:pan-x pan-y;touch-action:pan-x pan-y}.leaflet-container.leaflet-touch-drag{-ms-touch-action:pinch-zoom;touch-action:none;touch-action:pinch-zoom}.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom{-ms-touch-action:none;touch-action:none}.leaflet-container{-webkit-tap-highlight-color:transparent}.leaflet-container a{-webkit-tap-highlight-color:#33b5e566}.leaflet-tile{filter:inherit;visibility:hidden}.leaflet-tile-loaded{visibility:inherit}.leaflet-zoom-box{box-sizing:border-box;z-index:800;width:0;height:0}.leaflet-overlay-pane svg{-moz-user-select:none}.leaflet-pane{z-index:400}.leaflet-tile-pane{z-index:200}.leaflet-overlay-pane{z-index:400}.leaflet-shadow-pane{z-index:500}.leaflet-marker-pane{z-index:600}.leaflet-tooltip-pane{z-index:650}.leaflet-popup-pane{z-index:700}.leaflet-map-pane canvas{z-index:100}.leaflet-map-pane svg{z-index:200}.leaflet-vml-shape{width:1px;height:1px}.lvml{behavior:url(#default#VML);display:inline-block;position:absolute}.leaflet-control{z-index:800;pointer-events:visiblePainted;pointer-events:auto;position:relative}.leaflet-top,.leaflet-bottom{z-index:1000;pointer-events:none;position:absolute}.leaflet-top{top:0}.leaflet-right{right:0}.leaflet-bottom{bottom:0}.leaflet-left{left:0}.leaflet-control{float:left;clear:both}.leaflet-right .leaflet-control{float:right}.leaflet-top .leaflet-control{margin-top:10px}.leaflet-bottom .leaflet-control{margin-bottom:10px}.leaflet-left .leaflet-control{margin-left:10px}.leaflet-right .leaflet-control{margin-right:10px}.leaflet-fade-anim .leaflet-popup{opacity:0;transition:opacity .2s linear}.leaflet-fade-anim .leaflet-map-pane .leaflet-popup{opacity:1}.leaflet-zoom-animated{transform-origin:0 0}svg.leaflet-zoom-animated{will-change:transform}.leaflet-zoom-anim .leaflet-zoom-animated{-webkit-transition:-webkit-transform .25s cubic-bezier(0,0,.25,1);-moz-transition:-moz-transform .25s cubic-bezier(0,0,.25,1);transition:transform .25s cubic-bezier(0,0,.25,1)}.leaflet-zoom-anim .leaflet-tile,.leaflet-pan-anim .leaflet-tile{transition:none}.leaflet-zoom-anim .leaflet-zoom-hide{visibility:hidden}.leaflet-interactive{cursor:pointer}.leaflet-grab{cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.leaflet-crosshair,.leaflet-crosshair .leaflet-interactive{cursor:crosshair}.leaflet-popup-pane,.leaflet-control{cursor:auto}.leaflet-dragging .leaflet-grab,.leaflet-dragging .leaflet-grab .leaflet-interactive,.leaflet-dragging .leaflet-marker-draggable{cursor:move;cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-image-layer,.leaflet-pane>svg path,.leaflet-tile-container{pointer-events:none}.leaflet-marker-icon.leaflet-interactive,.leaflet-image-layer.leaflet-interactive,.leaflet-pane>svg path.leaflet-interactive,svg.leaflet-image-layer.leaflet-interactive path{pointer-events:visiblePainted;pointer-events:auto}.leaflet-container{outline-offset:1px;background:#ddd}.leaflet-container a{color:#0078a8}.leaflet-zoom-box{background:#ffffff80;border:2px dotted #38f}.leaflet-container{font-family:Helvetica Neue,Arial,Helvetica,sans-serif;font-size:.75rem;line-height:1.5}.leaflet-bar{border-radius:4px;box-shadow:0 1px 5px #000000a6}.leaflet-bar a{text-align:center;color:#000;background-color:#fff;border-bottom:1px solid #ccc;width:26px;height:26px;line-height:26px;text-decoration:none;display:block}.leaflet-bar a,.leaflet-control-layers-toggle{background-position:50%;background-repeat:no-repeat;display:block}.leaflet-bar a:hover,.leaflet-bar a:focus{background-color:#f4f4f4}.leaflet-bar a:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.leaflet-bar a:last-child{border-bottom:none;border-bottom-right-radius:4px;border-bottom-left-radius:4px}.leaflet-bar a.leaflet-disabled{cursor:default;color:#bbb;background-color:#f4f4f4}.leaflet-touch .leaflet-bar a{width:30px;height:30px;line-height:30px}.leaflet-touch .leaflet-bar a:first-child{border-top-left-radius:2px;border-top-right-radius:2px}.leaflet-touch .leaflet-bar a:last-child{border-bottom-right-radius:2px;border-bottom-left-radius:2px}.leaflet-control-zoom-in,.leaflet-control-zoom-out{text-indent:1px;font:700 18px Lucida Console,Monaco,monospace}.leaflet-touch .leaflet-control-zoom-in,.leaflet-touch .leaflet-control-zoom-out{font-size:22px}.leaflet-control-layers{background:#fff;border-radius:5px;box-shadow:0 1px 5px #0006}.leaflet-control-layers-toggle{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAQAAAADQ4RFAAACf0lEQVR4AY1UM3gkARTePdvdoTxXKc+qTl3aU5U6b2Kbkz3Gtq3Zw6ziLGNPzrYx7946Tr6/ee/XeCQ4D3ykPtL5tHno4n0d/h3+xfuWHGLX81cn7r0iTNzjr7LrlxCqPtkbTQEHeqOrTy4Yyt3VCi/IOB0v7rVC7q45Q3Gr5K6jt+3Gl5nCoDD4MtO+j96Wu8atmhGqcNGHObuf8OM/x3AMx38+4Z2sPqzCxRFK2aF2e5Jol56XTLyggAMTL56XOMoS1W4pOyjUcGGQdZxU6qRh7B9Zp+PfpOFlqt0zyDZckPi1ttmIp03jX8gyJ8a/PG2yutpS/Vol7peZIbZcKBAEEheEIAgFbDkz5H6Zrkm2hVWGiXKiF4Ycw0RWKdtC16Q7qe3X4iOMxruonzegJzWaXFrU9utOSsLUmrc0YjeWYjCW4PDMADElpJSSQ0vQvA1Tm6/JlKnqFs1EGyZiFCqnRZTEJJJiKRYzVYzJck2Rm6P4iH+cmSY0YzimYa8l0EtTODFWhcMIMVqdsI2uiTvKmTisIDHJ3od5GILVhBCarCfVRmo4uTjkhrhzkiBV7SsaqS+TzrzM1qpGGUFt28pIySQHR6h7F6KSwGWm97ay+Z+ZqMcEjEWebE7wxCSQwpkhJqoZA5ivCdZDjJepuJ9IQjGGUmuXJdBFUygxVqVsxFsLMbDe8ZbDYVCGKxs+W080max1hFCarCfV+C1KATwcnvE9gRRuMP2prdbWGowm1KB1y+zwMMENkM755cJ2yPDtqhTI6ED1M/82yIDtC/4j4BijjeObflpO9I9MwXTCsSX8jWAFeHr05WoLTJ5G8IQVS/7vwR6ohirYM7f6HzYpogfS3R2OAAAAAElFTkSuQmCC);width:36px;height:36px}.leaflet-retina .leaflet-control-layers-toggle{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAQAAABvcdNgAAAEsklEQVR4AWL4TydIhpZK1kpWOlg0w3ZXP6D2soBtG42jeI6ZmQTHzAxiTbSJsYLjO9HhP+WOmcuhciVnmHVQcJnp7DFvScowZorad/+V/fVzMdMT2g9Cv9guXGv/7pYOrXh2U+RRR3dSd9JRx6bIFc/ekqHI29JC6pJ5ZEh1yWkhkbcFeSjxgx3L2m1cb1C7bceyxA+CNjT/Ifff+/kDk2u/w/33/IeCMOSaWZ4glosqT3DNnNZQ7Cs58/3Ce5HL78iZH/vKVIaYlqzfdLu8Vi7dnvUbEza5Idt36tquZFldl6N5Z/POLof0XLK61mZCmJSWjVF9tEjUluu74IUXvgttuVIHE7YxSkaYhJZam7yiM9Pv82JYfl9nptxZaxMJE4YSPty+vF0+Y2up9d3wwijfjZbabqm/3bZ9ecKHsiGmRflnn1MW4pjHf9oLufyn2z3y1D6n8g8TZhxyzipLNPnAUpsOiuWimg52psrTZYnOWYNDTMuWBWa0tJb4rgq1UvmutpaYEbZlwU3CLJm/ayYjHW5/h7xWLn9Hh1vepDkyf7dE7MtT5LR4e7yYpHrkhOUpEfssBLq2pPhAqoSWKUkk7EDqkmK6RrCEzqDjhNDWNE+XSMvkJRDWlZTmCW0l0PHQGRZY5t1L83kT0Y3l2SItk5JAWHl2dCOBm+fPu3fo5/3v61RMCO9Jx2EEYYhb0rmNQMX/vm7gqOEJLcXTGw3CAuRNeyaPWwjR8PRqKQ1PDA/dpv+on9Shox52WFnx0KY8onHayrJzm87i5h9xGw/tfkev0jGsQizqezUKjk12hBMKJ4kbCqGPVNXudyyrShovGw5CgxsRICxF6aRmSjlBnHRzg7Gx8fKqEubI2rahQYdR1YgDIRQO7JvQyD52hoIQx0mxa0ODtW2Iozn1le2iIRdzwWewedyZzewidueOGqlsn1MvcnQpuVwLGG3/IR1hIKxCjelIDZ8ldqWz25jWAsnldEnK0Zxro19TGVb2ffIZEsIO89EIEDvKMPrzmBOQcKQ+rroye6NgRRxqR4U8EAkz0CL6uSGOm6KQCdWjvjRiSP1BPalCRS5iQYiEIvxuBMJEWgzSoHADcVMuN7IuqqTeyUPq22qFimFtxDyBBJEwNyt6TM88blFHao/6tWWhuuOM4SAK4EI4QmFHA+SEyWlp4EQoJ13cYGzMu7yszEIBOm2rVmHUNqwAIQabISNMRstmdhNWcFLsSm+0tjJH1MdRxO5Nx0WDMhCtgD6OKgZeljJqJKc9po8juskR9XN0Y1lZ3mWjLR9JCO1jRDMd0fpYC2VnvjBSEFg7wBENc0R9HFlb0xvF1+TBEpF68d+DHR6IOWVv2BECtxo46hOFUBd/APU57WIoEwJhIi2CdpyZX0m93BZicktMj1AS9dClteUFAUNUIEygRZCtik5zSxI9MubTBH1GOiHsiLJ3OCoSZkILa9PxiN0EbvhsAo8tdAf9Seepd36lGWHmtNANTv5Jd0z4QYyeo/UEJqxKRpg5LZx6btLPsOaEmdMyxYdlc8LMaJnikDlhclqmPiQnTEpLUIZEwkRagjYkEibQErwhkTAKCLQEbUgkzJQWc/0PstHHcfEdQ+UAAAAASUVORK5CYII=);background-size:26px 26px}.leaflet-touch .leaflet-control-layers-toggle{width:44px;height:44px}.leaflet-control-layers .leaflet-control-layers-list,.leaflet-control-layers-expanded .leaflet-control-layers-toggle{display:none}.leaflet-control-layers-expanded .leaflet-control-layers-list{display:block;position:relative}.leaflet-control-layers-expanded{color:#333;background:#fff;padding:6px 10px 6px 6px}.leaflet-control-layers-scrollbar{padding-right:5px;overflow:hidden scroll}.leaflet-control-layers-selector{margin-top:2px;position:relative;top:1px}.leaflet-control-layers label{font-size:1.08333em;display:block}.leaflet-control-layers-separator{border-top:1px solid #ddd;height:0;margin:5px -10px 5px -6px}.leaflet-default-icon-path{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAFgUlEQVR4Aa1XA5BjWRTN2oW17d3YaZtr2962HUzbDNpjszW24mRt28p47v7zq/bXZtrp/lWnXr337j3nPCe85NcypgSFdugCpW5YoDAMRaIMqRi6aKq5E3YqDQO3qAwjVWrD8Ncq/RBpykd8oZUb/kaJutow8r1aP9II0WmLKLIsJyv1w/kqw9Ch2MYdB++12Onxee/QMwvf4/Dk/Lfp/i4nxTXtOoQ4pW5Aj7wpici1A9erdAN2OH64x8OSP9j3Ft3b7aWkTg/Fm91siTra0f9on5sQr9INejH6CUUUpavjFNq1B+Oadhxmnfa8RfEmN8VNAsQhPqF55xHkMzz3jSmChWU6f7/XZKNH+9+hBLOHYozuKQPxyMPUKkrX/K0uWnfFaJGS1QPRtZsOPtr3NsW0uyh6NNCOkU3Yz+bXbT3I8G3xE5EXLXtCXbbqwCO9zPQYPRTZ5vIDXD7U+w7rFDEoUUf7ibHIR4y6bLVPXrz8JVZEql13trxwue/uDivd3fkWRbS6/IA2bID4uk0UpF1N8qLlbBlXs4Ee7HLTfV1j54APvODnSfOWBqtKVvjgLKzF5YdEk5ewRkGlK0i33Eofffc7HT56jD7/6U+qH3Cx7SBLNntH5YIPvODnyfIXZYRVDPqgHtLs5ABHD3YzLuespb7t79FY34DjMwrVrcTuwlT55YMPvOBnRrJ4VXTdNnYug5ucHLBjEpt30701A3Ts+HEa73u6dT3FNWwflY86eMHPk+Yu+i6pzUpRrW7SNDg5JHR4KapmM5Wv2E8Tfcb1HoqqHMHU+uWDD7zg54mz5/2BSnizi9T1Dg4QQXLToGNCkb6tb1NU+QAlGr1++eADrzhn/u8Q2YZhQVlZ5+CAOtqfbhmaUCS1ezNFVm2imDbPmPng5wmz+gwh+oHDce0eUtQ6OGDIyR0uUhUsoO3vfDmmgOezH0mZN59x7MBi++WDL1g/eEiU3avlidO671bkLfwbw5XV2P8Pzo0ydy4t2/0eu33xYSOMOD8hTf4CrBtGMSoXfPLchX+J0ruSePw3LZeK0juPJbYzrhkH0io7B3k164hiGvawhOKMLkrQLyVpZg8rHFW7E2uHOL888IBPlNZ1FPzstSJM694fWr6RwpvcJK60+0HCILTBzZLFNdtAzJaohze60T8qBzyh5ZuOg5e7uwQppofEmf2++DYvmySqGBuKaicF1blQjhuHdvCIMvp8whTTfZzI7RldpwtSzL+F1+wkdZ2TBOW2gIF88PBTzD/gpeREAMEbxnJcaJHNHrpzji0gQCS6hdkEeYt9DF/2qPcEC8RM28Hwmr3sdNyht00byAut2k3gufWNtgtOEOFGUwcXWNDbdNbpgBGxEvKkOQsxivJx33iow0Vw5S6SVTrpVq11ysA2Rp7gTfPfktc6zhtXBBC+adRLshf6sG2RfHPZ5EAc4sVZ83yCN00Fk/4kggu40ZTvIEm5g24qtU4KjBrx/BTTH8ifVASAG7gKrnWxJDcU7x8X6Ecczhm3o6YicvsLXWfh3Ch1W0k8x0nXF+0fFxgt4phz8QvypiwCCFKMqXCnqXExjq10beH+UUA7+nG6mdG/Pu0f3LgFcGrl2s0kNNjpmoJ9o4B29CMO8dMT4Q5ox8uitF6fqsrJOr8qnwNbRzv6hSnG5wP+64C7h9lp30hKNtKdWjtdkbuPA19nJ7Tz3zR/ibgARbhb4AlhavcBebmTHcFl2fvYEnW0ox9xMxKBS8btJ+KiEbq9zA4RthQXDhPa0T9TEe69gWupwc6uBUphquXgf+/FrIjweHQS4/pduMe5ERUMHUd9xv8ZR98CxkS4F2n3EUrUZ10EYNw7BWm9x1GiPssi3GgiGRDKWRYZfXlON+dfNbM+GgIwYdwAAAAASUVORK5CYII=)}.leaflet-container .leaflet-control-attribution{background:#fffc;margin:0}.leaflet-control-attribution,.leaflet-control-scale-line{color:#333;padding:0 5px;line-height:1.4}.leaflet-control-attribution a{text-decoration:none}.leaflet-control-attribution a:hover,.leaflet-control-attribution a:focus{text-decoration:underline}.leaflet-attribution-flag{width:1em;height:.6669em;vertical-align:baseline!important;display:inline!important}.leaflet-left .leaflet-control-scale{margin-left:5px}.leaflet-bottom .leaflet-control-scale{margin-bottom:5px}.leaflet-control-scale-line{white-space:nowrap;box-sizing:border-box;text-shadow:1px 1px #fff;background:#fffc;border:2px solid #777;border-top:none;padding:2px 5px 1px;line-height:1.1}.leaflet-control-scale-line:not(:first-child){border-top:2px solid #777;border-bottom:none;margin-top:-2px}.leaflet-control-scale-line:not(:first-child):not(:last-child){border-bottom:2px solid #777}.leaflet-touch .leaflet-control-attribution,.leaflet-touch .leaflet-control-layers,.leaflet-touch .leaflet-bar{box-shadow:none}.leaflet-touch .leaflet-control-layers,.leaflet-touch .leaflet-bar{background-clip:padding-box;border:2px solid #0003}.leaflet-popup{text-align:center;margin-bottom:20px;position:absolute}.leaflet-popup-content-wrapper{text-align:left;border-radius:12px;padding:1px}.leaflet-popup-content{min-height:1px;margin:13px 24px 13px 20px;font-size:1.08333em;line-height:1.3}.leaflet-popup-content p{margin:1.3em 0}.leaflet-popup-tip-container{pointer-events:none;width:40px;height:20px;margin-top:-1px;margin-left:-20px;position:absolute;left:50%;overflow:hidden}.leaflet-popup-tip{pointer-events:auto;width:17px;height:17px;margin:-10px auto 0;padding:1px;transform:rotate(45deg)}.leaflet-popup-content-wrapper,.leaflet-popup-tip{color:#333;background:#fff;box-shadow:0 3px 14px #0006}.leaflet-container a.leaflet-popup-close-button{text-align:center;color:#757575;background:0 0;border:none;width:24px;height:24px;font:16px/24px Tahoma,Verdana,sans-serif;text-decoration:none;position:absolute;top:0;right:0}.leaflet-container a.leaflet-popup-close-button:hover,.leaflet-container a.leaflet-popup-close-button:focus{color:#585858}.leaflet-popup-scrolled{overflow:auto}.leaflet-oldie .leaflet-popup-content-wrapper{-ms-zoom:1}.leaflet-oldie .leaflet-popup-tip{-ms-filter:"progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";width:24px;filter:progid:DXImageTransform.Microsoft.Matrix(M11=.707107, M12=.707107, M21=-.707107, M22=.707107);margin:0 auto}.leaflet-oldie .leaflet-control-zoom,.leaflet-oldie .leaflet-control-layers,.leaflet-oldie .leaflet-popup-content-wrapper,.leaflet-oldie .leaflet-popup-tip{border:1px solid #999}.leaflet-div-icon{background:#fff;border:1px solid #666}.leaflet-tooltip{color:#222;white-space:nowrap;-webkit-user-select:none;user-select:none;pointer-events:none;background-color:#fff;border:1px solid #fff;border-radius:3px;padding:6px;position:absolute;box-shadow:0 1px 3px #0006}.leaflet-tooltip.leaflet-interactive{cursor:pointer;pointer-events:auto}.leaflet-tooltip-top:before,.leaflet-tooltip-bottom:before,.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{pointer-events:none;content:"";background:0 0;border:6px solid #0000;position:absolute}.leaflet-tooltip-bottom{margin-top:6px}.leaflet-tooltip-top{margin-top:-6px}.leaflet-tooltip-bottom:before,.leaflet-tooltip-top:before{margin-left:-6px;left:50%}.leaflet-tooltip-top:before{border-top-color:#fff;margin-bottom:-12px;bottom:0}.leaflet-tooltip-bottom:before{border-bottom-color:#fff;margin-top:-12px;margin-left:-6px;top:0}.leaflet-tooltip-left{margin-left:-6px}.leaflet-tooltip-right{margin-left:6px}.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{margin-top:-6px;top:50%}.leaflet-tooltip-left:before{border-left-color:#fff;margin-right:-12px;right:0}.leaflet-tooltip-right:before{border-right-color:#fff;margin-left:-12px;left:0}@media print{.leaflet-control{-webkit-print-color-adjust:exact;print-color-adjust:exact}}'),x("marker-cluster",".leaflet-cluster-anim .leaflet-marker-icon,.leaflet-cluster-anim .leaflet-marker-shadow{transition:transform .3s ease-out,opacity .3s ease-in}.leaflet-cluster-spider-leg{transition:stroke-dashoffset .3s ease-out,stroke-opacity .3s ease-in}.marker-cluster-small{background-color:#b5e28c99}.marker-cluster-small div{background-color:#6ecc3999}.marker-cluster-medium{background-color:#f1d35799}.marker-cluster-medium div{background-color:#f0c20c99}.marker-cluster-large{background-color:#fd9c7399}.marker-cluster-large div{background-color:#f1801799}.leaflet-oldie .marker-cluster-small{background-color:#b5e28c}.leaflet-oldie .marker-cluster-small div{background-color:#6ecc39}.leaflet-oldie .marker-cluster-medium{background-color:#f1d357}.leaflet-oldie .marker-cluster-medium div{background-color:#f0c20c}.leaflet-oldie .marker-cluster-large{background-color:#fd9c73}.leaflet-oldie .marker-cluster-large div{background-color:#f18017}.marker-cluster{background-clip:padding-box;border-radius:20px}.marker-cluster div{text-align:center;border-radius:15px;width:30px;height:30px;margin-top:5px;margin-left:5px}.marker-cluster span{line-height:30px}");let t,o=!1;return(async()=>{try{const l=await import("./BCTYvPrD.js").then(t=>/* @__PURE__ */e(t.default,1));if(o)return;if("undefined"!=typeof window&&(window.L=l),await Promise.all([import("./CgUphJWo.js").then(t=>/* @__PURE__ */e(t.default,1)),import("./rtH8O6Hc.js")]),o)return;const r=window.L??l;if(!L.current)return;const a=l.map(L.current,{center:Z?.center?[Z.center.lat??v[0],Z.center.lng??v[1]]:v,zoom:Z?.zoom??3,minZoom:3,zoomControl:!0,worldCopyJump:!1,maxBounds:l.latLngBounds(k),maxBoundsViscosity:1});l.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:"&copy; OpenStreetMap contributors",maxZoom:19,noWrap:!0}).addTo(a);const n=l.layerGroup().addTo(a),i="function"==typeof r.heatLayer?r.heatLayer([],{radius:30,blur:30,maxZoom:10,minOpacity:.35}):null;i?.addTo(a);const f="function"==typeof r.markerClusterGroup?r.markerClusterGroup({chunkedLoading:!0,showCoverageOnHover:!1,spiderfyOnMaxZoom:!0,zoomToBoundsOnClick:!0,maxClusterRadius:48}):l.layerGroup();f.addTo(a);const c=()=>{I.current&&clearTimeout(I.current),I.current=setTimeout(()=>{try{sessionStorage.setItem(p,JSON.stringify({center:a.getCenter(),zoom:a.getZoom()}))}catch{}},250)};let s;a.on("zoomend",c),a.on("moveend",c),R.current=a,C.current=r,T.current=n,O.current=i,M.current=f,"undefined"!=typeof ResizeObserver&&L.current&&(s=new ResizeObserver(()=>a.invalidateSize(!1)),s.observe(L.current)),requestAnimationFrame(()=>a.invalidateSize(!1)),B(!0),q(!1),t=()=>{s?.disconnect(),I.current&&clearTimeout(I.current),a.off("zoomend",c),a.off("moveend",c),a.remove(),C.current=null,R.current=null,T.current=null,O.current=null,M.current=null}}finally{o||q(!1)}})(),()=>{o=!0,t?.()}},[Z]),o(()=>{if(!D)return;const e=C.current;if(!e)return;const o=R.current;if(T.current?.clearLayers(),M.current?.clearLayers(),null===N&&H.length>0){o&&O.current&&(O.current.setLatLngs?.([]),o.hasLayer(O.current)&&o.removeLayer(O.current));const t=o=>{for(const l of o)if(l.centroid){const[t,o]=l.centroid,r=e.divIcon({className:"",html:`<div style="transform:translate(-50%,-50%);background:${b(l.color,y)};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>${A(l.folder.name)}</span><span style="background:rgba(0,0,0,0.18);border-radius:10px;padding:1px 5px;font-size:10px;">${l.eventCount}</span></div>`,iconSize:[0,0],iconAnchor:[0,0]});e.marker([o,t],{icon:r}).on("click",()=>F(l.folder._id)).addTo(T.current)}else l.children.length>0&&t(l.children)};t(H)}else{if(0===U.length)return;const l=0===H.length&&null===N,r=b(P?.color,y);if(o&&O.current&&(l&&!o.hasLayer(O.current)?O.current.addTo(o):l||(O.current.setLatLngs?.([]),o.hasLayer(O.current)&&o.removeLayer(O.current))),U.forEach(o=>{const l=o.location.x,a=o.location.y,f=e.divIcon({className:"qrati-leaflet-marker-wrapper",html:`<div style="width:36px;height:36px;cursor:pointer;background:${r};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;">${u(E)?`<img src="${u(E)}" 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([a,l],{icon:f}),p=document.createElement("div");p.style.width="fit-content",((e,o,l)=>{t(/* @__PURE__ */n(i,{client:z,children:/* @__PURE__ */n(d,{event:e,onExplore:l})}),o)})(o,p,s),c.bindPopup(p,{closeButton:!0,maxWidth:256}),M.current?.addLayer(c)}),l&&O.current){const e=U.reduce((e,t)=>Math.max(e,t.views??0),1),t=U.map(e=>[e.location.y,e.location.x,e.views??1]);O.current.setOptions?.({radius:30,blur:30,maxZoom:10,minOpacity:.35,max:e}),O.current.setLatLngs?.(t)}if(l&&!S.current&&o&&(S.current=!0,!Z)){const t=e.latLngBounds([]);U.forEach(e=>t.extend([e.location.y,e.location.x])),t.isValid()&&o.fitBounds(t,{paddingTopLeft:w.topLeft,paddingBottomRight:w.bottomRight,maxZoom:8})}}},[N,H,U,D,s,E,F,P,Z]),o(()=>{if(!D)return;const e=R.current,t=C.current;if(!e||!t)return;if(!W.current&&Z)return void(W.current=!0);W.current=!0;const o={paddingTopLeft:w.topLeft,paddingBottomRight:w.bottomRight,duration:3,easeLinearity:1};if(N){const l=m(H,N);if(!l?.folder.boundary?.length)return;const r=t.latLngBounds([]);for(const e of l.folder.boundary)r.extend([e.y,e.x]);r.isValid()&&e.flyToBounds(r,{...o,maxZoom:14})}else{const l=t.latLngBounds([]),r=e=>{for(const t of e)t.centroid?l.extend([t.centroid[1],t.centroid[0]]):r(t.children)};r(H),l.isValid()&&e.flyToBounds(l,{...o,maxZoom:8})}},[N,H,D,Z]),/* @__PURE__ */n("div",{class:"relative h-screen w-full sm:h-[calc(100vh-4rem)]",style:f(J),children:[
1
+ import{n as e}from"./Cko4QHwX.js";import{C as t,b as o,f as l,h as r,p as a,t as n}from"./C3uDEVBt.js";import{I as i,a as f,n as c,w as p}from"./BItJQVdK.js";import{t as s}from"./Be1e_ATJ.js";import{a as d,i as u,n as m,o as g,r as b,t as h}from"./BYoa-kpQ2.js";import{t as x}from"./CfMNBPpx2.js";var k=[[90,-180],[-90,180]],v=[20,0],y="#fb8500",w={topLeft:[276,60],bottomRight:[60,60]},z=new s,A=e=>e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"),E=({onExplore:s,logoUrl:E})=>{const L=l(null),R=l(null),C=l(null),T=l(null),M=l(null),O=l(null),I=l(null),W=l(!1),S=l(!1),Z=a(()=>(()=>{try{const e=sessionStorage.getItem(p);if(!e)return null;const t=JSON.parse(e);if("number"==typeof t?.center?.lat&&"number"==typeof t?.center?.lng&&"number"==typeof t?.zoom)return t}catch{}return null})(),[]),[j,q]=r(!0),[D,B]=r(!1),{folderTree:H,activeFolderId:N,activeFolder:P,visibleEvents:U,setActiveFolderId:F,isLoadingEvents:Y}=g(),{organization:J}=c();return o(()=>{if(!L.current||R.current)return;x("leaflet",'.leaflet-pane,.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-tile-container,.leaflet-pane>svg,.leaflet-pane>canvas,.leaflet-zoom-box,.leaflet-image-layer,.leaflet-layer{position:absolute;top:0;left:0}.leaflet-container{overflow:hidden}.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow{-webkit-user-select:none;user-select:none;-webkit-user-drag:none}.leaflet-tile::selection{background:0 0}.leaflet-safari .leaflet-tile{image-rendering:-webkit-optimize-contrast}.leaflet-safari .leaflet-tile-container{-webkit-transform-origin:0 0;width:1600px;height:1600px}.leaflet-marker-icon,.leaflet-marker-shadow{display:block}.leaflet-container .leaflet-overlay-pane svg{max-width:none!important;max-height:none!important}.leaflet-container .leaflet-marker-pane img,.leaflet-container .leaflet-shadow-pane img,.leaflet-container .leaflet-tile-pane img,.leaflet-container img.leaflet-image-layer,.leaflet-container .leaflet-tile{width:auto;padding:0;max-width:none!important;max-height:none!important}.leaflet-container img.leaflet-tile{mix-blend-mode:plus-lighter}.leaflet-container.leaflet-touch-zoom{-ms-touch-action:pan-x pan-y;touch-action:pan-x pan-y}.leaflet-container.leaflet-touch-drag{-ms-touch-action:pinch-zoom;touch-action:none;touch-action:pinch-zoom}.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom{-ms-touch-action:none;touch-action:none}.leaflet-container{-webkit-tap-highlight-color:transparent}.leaflet-container a{-webkit-tap-highlight-color:#33b5e566}.leaflet-tile{filter:inherit;visibility:hidden}.leaflet-tile-loaded{visibility:inherit}.leaflet-zoom-box{box-sizing:border-box;z-index:800;width:0;height:0}.leaflet-overlay-pane svg{-moz-user-select:none}.leaflet-pane{z-index:400}.leaflet-tile-pane{z-index:200}.leaflet-overlay-pane{z-index:400}.leaflet-shadow-pane{z-index:500}.leaflet-marker-pane{z-index:600}.leaflet-tooltip-pane{z-index:650}.leaflet-popup-pane{z-index:700}.leaflet-map-pane canvas{z-index:100}.leaflet-map-pane svg{z-index:200}.leaflet-vml-shape{width:1px;height:1px}.lvml{behavior:url(#default#VML);display:inline-block;position:absolute}.leaflet-control{z-index:800;pointer-events:visiblePainted;pointer-events:auto;position:relative}.leaflet-top,.leaflet-bottom{z-index:1000;pointer-events:none;position:absolute}.leaflet-top{top:0}.leaflet-right{right:0}.leaflet-bottom{bottom:0}.leaflet-left{left:0}.leaflet-control{float:left;clear:both}.leaflet-right .leaflet-control{float:right}.leaflet-top .leaflet-control{margin-top:10px}.leaflet-bottom .leaflet-control{margin-bottom:10px}.leaflet-left .leaflet-control{margin-left:10px}.leaflet-right .leaflet-control{margin-right:10px}.leaflet-fade-anim .leaflet-popup{opacity:0;transition:opacity .2s linear}.leaflet-fade-anim .leaflet-map-pane .leaflet-popup{opacity:1}.leaflet-zoom-animated{transform-origin:0 0}svg.leaflet-zoom-animated{will-change:transform}.leaflet-zoom-anim .leaflet-zoom-animated{-webkit-transition:-webkit-transform .25s cubic-bezier(0,0,.25,1);-moz-transition:-moz-transform .25s cubic-bezier(0,0,.25,1);transition:transform .25s cubic-bezier(0,0,.25,1)}.leaflet-zoom-anim .leaflet-tile,.leaflet-pan-anim .leaflet-tile{transition:none}.leaflet-zoom-anim .leaflet-zoom-hide{visibility:hidden}.leaflet-interactive{cursor:pointer}.leaflet-grab{cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.leaflet-crosshair,.leaflet-crosshair .leaflet-interactive{cursor:crosshair}.leaflet-popup-pane,.leaflet-control{cursor:auto}.leaflet-dragging .leaflet-grab,.leaflet-dragging .leaflet-grab .leaflet-interactive,.leaflet-dragging .leaflet-marker-draggable{cursor:move;cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-image-layer,.leaflet-pane>svg path,.leaflet-tile-container{pointer-events:none}.leaflet-marker-icon.leaflet-interactive,.leaflet-image-layer.leaflet-interactive,.leaflet-pane>svg path.leaflet-interactive,svg.leaflet-image-layer.leaflet-interactive path{pointer-events:visiblePainted;pointer-events:auto}.leaflet-container{outline-offset:1px;background:#ddd}.leaflet-container a{color:#0078a8}.leaflet-zoom-box{background:#ffffff80;border:2px dotted #38f}.leaflet-container{font-family:Helvetica Neue,Arial,Helvetica,sans-serif;font-size:.75rem;line-height:1.5}.leaflet-bar{border-radius:4px;box-shadow:0 1px 5px #000000a6}.leaflet-bar a{text-align:center;color:#000;background-color:#fff;border-bottom:1px solid #ccc;width:26px;height:26px;line-height:26px;text-decoration:none;display:block}.leaflet-bar a,.leaflet-control-layers-toggle{background-position:50%;background-repeat:no-repeat;display:block}.leaflet-bar a:hover,.leaflet-bar a:focus{background-color:#f4f4f4}.leaflet-bar a:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.leaflet-bar a:last-child{border-bottom:none;border-bottom-right-radius:4px;border-bottom-left-radius:4px}.leaflet-bar a.leaflet-disabled{cursor:default;color:#bbb;background-color:#f4f4f4}.leaflet-touch .leaflet-bar a{width:30px;height:30px;line-height:30px}.leaflet-touch .leaflet-bar a:first-child{border-top-left-radius:2px;border-top-right-radius:2px}.leaflet-touch .leaflet-bar a:last-child{border-bottom-right-radius:2px;border-bottom-left-radius:2px}.leaflet-control-zoom-in,.leaflet-control-zoom-out{text-indent:1px;font:700 18px Lucida Console,Monaco,monospace}.leaflet-touch .leaflet-control-zoom-in,.leaflet-touch .leaflet-control-zoom-out{font-size:22px}.leaflet-control-layers{background:#fff;border-radius:5px;box-shadow:0 1px 5px #0006}.leaflet-control-layers-toggle{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAQAAAADQ4RFAAACf0lEQVR4AY1UM3gkARTePdvdoTxXKc+qTl3aU5U6b2Kbkz3Gtq3Zw6ziLGNPzrYx7946Tr6/ee/XeCQ4D3ykPtL5tHno4n0d/h3+xfuWHGLX81cn7r0iTNzjr7LrlxCqPtkbTQEHeqOrTy4Yyt3VCi/IOB0v7rVC7q45Q3Gr5K6jt+3Gl5nCoDD4MtO+j96Wu8atmhGqcNGHObuf8OM/x3AMx38+4Z2sPqzCxRFK2aF2e5Jol56XTLyggAMTL56XOMoS1W4pOyjUcGGQdZxU6qRh7B9Zp+PfpOFlqt0zyDZckPi1ttmIp03jX8gyJ8a/PG2yutpS/Vol7peZIbZcKBAEEheEIAgFbDkz5H6Zrkm2hVWGiXKiF4Ycw0RWKdtC16Q7qe3X4iOMxruonzegJzWaXFrU9utOSsLUmrc0YjeWYjCW4PDMADElpJSSQ0vQvA1Tm6/JlKnqFs1EGyZiFCqnRZTEJJJiKRYzVYzJck2Rm6P4iH+cmSY0YzimYa8l0EtTODFWhcMIMVqdsI2uiTvKmTisIDHJ3od5GILVhBCarCfVRmo4uTjkhrhzkiBV7SsaqS+TzrzM1qpGGUFt28pIySQHR6h7F6KSwGWm97ay+Z+ZqMcEjEWebE7wxCSQwpkhJqoZA5ivCdZDjJepuJ9IQjGGUmuXJdBFUygxVqVsxFsLMbDe8ZbDYVCGKxs+W080max1hFCarCfV+C1KATwcnvE9gRRuMP2prdbWGowm1KB1y+zwMMENkM755cJ2yPDtqhTI6ED1M/82yIDtC/4j4BijjeObflpO9I9MwXTCsSX8jWAFeHr05WoLTJ5G8IQVS/7vwR6ohirYM7f6HzYpogfS3R2OAAAAAElFTkSuQmCC);width:36px;height:36px}.leaflet-retina .leaflet-control-layers-toggle{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAQAAABvcdNgAAAEsklEQVR4AWL4TydIhpZK1kpWOlg0w3ZXP6D2soBtG42jeI6ZmQTHzAxiTbSJsYLjO9HhP+WOmcuhciVnmHVQcJnp7DFvScowZorad/+V/fVzMdMT2g9Cv9guXGv/7pYOrXh2U+RRR3dSd9JRx6bIFc/ekqHI29JC6pJ5ZEh1yWkhkbcFeSjxgx3L2m1cb1C7bceyxA+CNjT/Ifff+/kDk2u/w/33/IeCMOSaWZ4glosqT3DNnNZQ7Cs58/3Ce5HL78iZH/vKVIaYlqzfdLu8Vi7dnvUbEza5Idt36tquZFldl6N5Z/POLof0XLK61mZCmJSWjVF9tEjUluu74IUXvgttuVIHE7YxSkaYhJZam7yiM9Pv82JYfl9nptxZaxMJE4YSPty+vF0+Y2up9d3wwijfjZbabqm/3bZ9ecKHsiGmRflnn1MW4pjHf9oLufyn2z3y1D6n8g8TZhxyzipLNPnAUpsOiuWimg52psrTZYnOWYNDTMuWBWa0tJb4rgq1UvmutpaYEbZlwU3CLJm/ayYjHW5/h7xWLn9Hh1vepDkyf7dE7MtT5LR4e7yYpHrkhOUpEfssBLq2pPhAqoSWKUkk7EDqkmK6RrCEzqDjhNDWNE+XSMvkJRDWlZTmCW0l0PHQGRZY5t1L83kT0Y3l2SItk5JAWHl2dCOBm+fPu3fo5/3v61RMCO9Jx2EEYYhb0rmNQMX/vm7gqOEJLcXTGw3CAuRNeyaPWwjR8PRqKQ1PDA/dpv+on9Shox52WFnx0KY8onHayrJzm87i5h9xGw/tfkev0jGsQizqezUKjk12hBMKJ4kbCqGPVNXudyyrShovGw5CgxsRICxF6aRmSjlBnHRzg7Gx8fKqEubI2rahQYdR1YgDIRQO7JvQyD52hoIQx0mxa0ODtW2Iozn1le2iIRdzwWewedyZzewidueOGqlsn1MvcnQpuVwLGG3/IR1hIKxCjelIDZ8ldqWz25jWAsnldEnK0Zxro19TGVb2ffIZEsIO89EIEDvKMPrzmBOQcKQ+rroye6NgRRxqR4U8EAkz0CL6uSGOm6KQCdWjvjRiSP1BPalCRS5iQYiEIvxuBMJEWgzSoHADcVMuN7IuqqTeyUPq22qFimFtxDyBBJEwNyt6TM88blFHao/6tWWhuuOM4SAK4EI4QmFHA+SEyWlp4EQoJ13cYGzMu7yszEIBOm2rVmHUNqwAIQabISNMRstmdhNWcFLsSm+0tjJH1MdRxO5Nx0WDMhCtgD6OKgZeljJqJKc9po8juskR9XN0Y1lZ3mWjLR9JCO1jRDMd0fpYC2VnvjBSEFg7wBENc0R9HFlb0xvF1+TBEpF68d+DHR6IOWVv2BECtxo46hOFUBd/APU57WIoEwJhIi2CdpyZX0m93BZicktMj1AS9dClteUFAUNUIEygRZCtik5zSxI9MubTBH1GOiHsiLJ3OCoSZkILa9PxiN0EbvhsAo8tdAf9Seepd36lGWHmtNANTv5Jd0z4QYyeo/UEJqxKRpg5LZx6btLPsOaEmdMyxYdlc8LMaJnikDlhclqmPiQnTEpLUIZEwkRagjYkEibQErwhkTAKCLQEbUgkzJQWc/0PstHHcfEdQ+UAAAAASUVORK5CYII=);background-size:26px 26px}.leaflet-touch .leaflet-control-layers-toggle{width:44px;height:44px}.leaflet-control-layers .leaflet-control-layers-list,.leaflet-control-layers-expanded .leaflet-control-layers-toggle{display:none}.leaflet-control-layers-expanded .leaflet-control-layers-list{display:block;position:relative}.leaflet-control-layers-expanded{color:#333;background:#fff;padding:6px 10px 6px 6px}.leaflet-control-layers-scrollbar{padding-right:5px;overflow:hidden scroll}.leaflet-control-layers-selector{margin-top:2px;position:relative;top:1px}.leaflet-control-layers label{font-size:1.08333em;display:block}.leaflet-control-layers-separator{border-top:1px solid #ddd;height:0;margin:5px -10px 5px -6px}.leaflet-default-icon-path{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAFgUlEQVR4Aa1XA5BjWRTN2oW17d3YaZtr2962HUzbDNpjszW24mRt28p47v7zq/bXZtrp/lWnXr337j3nPCe85NcypgSFdugCpW5YoDAMRaIMqRi6aKq5E3YqDQO3qAwjVWrD8Ncq/RBpykd8oZUb/kaJutow8r1aP9II0WmLKLIsJyv1w/kqw9Ch2MYdB++12Onxee/QMwvf4/Dk/Lfp/i4nxTXtOoQ4pW5Aj7wpici1A9erdAN2OH64x8OSP9j3Ft3b7aWkTg/Fm91siTra0f9on5sQr9INejH6CUUUpavjFNq1B+Oadhxmnfa8RfEmN8VNAsQhPqF55xHkMzz3jSmChWU6f7/XZKNH+9+hBLOHYozuKQPxyMPUKkrX/K0uWnfFaJGS1QPRtZsOPtr3NsW0uyh6NNCOkU3Yz+bXbT3I8G3xE5EXLXtCXbbqwCO9zPQYPRTZ5vIDXD7U+w7rFDEoUUf7ibHIR4y6bLVPXrz8JVZEql13trxwue/uDivd3fkWRbS6/IA2bID4uk0UpF1N8qLlbBlXs4Ee7HLTfV1j54APvODnSfOWBqtKVvjgLKzF5YdEk5ewRkGlK0i33Eofffc7HT56jD7/6U+qH3Cx7SBLNntH5YIPvODnyfIXZYRVDPqgHtLs5ABHD3YzLuespb7t79FY34DjMwrVrcTuwlT55YMPvOBnRrJ4VXTdNnYug5ucHLBjEpt30701A3Ts+HEa73u6dT3FNWwflY86eMHPk+Yu+i6pzUpRrW7SNDg5JHR4KapmM5Wv2E8Tfcb1HoqqHMHU+uWDD7zg54mz5/2BSnizi9T1Dg4QQXLToGNCkb6tb1NU+QAlGr1++eADrzhn/u8Q2YZhQVlZ5+CAOtqfbhmaUCS1ezNFVm2imDbPmPng5wmz+gwh+oHDce0eUtQ6OGDIyR0uUhUsoO3vfDmmgOezH0mZN59x7MBi++WDL1g/eEiU3avlidO671bkLfwbw5XV2P8Pzo0ydy4t2/0eu33xYSOMOD8hTf4CrBtGMSoXfPLchX+J0ruSePw3LZeK0juPJbYzrhkH0io7B3k164hiGvawhOKMLkrQLyVpZg8rHFW7E2uHOL888IBPlNZ1FPzstSJM694fWr6RwpvcJK60+0HCILTBzZLFNdtAzJaohze60T8qBzyh5ZuOg5e7uwQppofEmf2++DYvmySqGBuKaicF1blQjhuHdvCIMvp8whTTfZzI7RldpwtSzL+F1+wkdZ2TBOW2gIF88PBTzD/gpeREAMEbxnJcaJHNHrpzji0gQCS6hdkEeYt9DF/2qPcEC8RM28Hwmr3sdNyht00byAut2k3gufWNtgtOEOFGUwcXWNDbdNbpgBGxEvKkOQsxivJx33iow0Vw5S6SVTrpVq11ysA2Rp7gTfPfktc6zhtXBBC+adRLshf6sG2RfHPZ5EAc4sVZ83yCN00Fk/4kggu40ZTvIEm5g24qtU4KjBrx/BTTH8ifVASAG7gKrnWxJDcU7x8X6Ecczhm3o6YicvsLXWfh3Ch1W0k8x0nXF+0fFxgt4phz8QvypiwCCFKMqXCnqXExjq10beH+UUA7+nG6mdG/Pu0f3LgFcGrl2s0kNNjpmoJ9o4B29CMO8dMT4Q5ox8uitF6fqsrJOr8qnwNbRzv6hSnG5wP+64C7h9lp30hKNtKdWjtdkbuPA19nJ7Tz3zR/ibgARbhb4AlhavcBebmTHcFl2fvYEnW0ox9xMxKBS8btJ+KiEbq9zA4RthQXDhPa0T9TEe69gWupwc6uBUphquXgf+/FrIjweHQS4/pduMe5ERUMHUd9xv8ZR98CxkS4F2n3EUrUZ10EYNw7BWm9x1GiPssi3GgiGRDKWRYZfXlON+dfNbM+GgIwYdwAAAAASUVORK5CYII=)}.leaflet-container .leaflet-control-attribution{background:#fffc;margin:0}.leaflet-control-attribution,.leaflet-control-scale-line{color:#333;padding:0 5px;line-height:1.4}.leaflet-control-attribution a{text-decoration:none}.leaflet-control-attribution a:hover,.leaflet-control-attribution a:focus{text-decoration:underline}.leaflet-attribution-flag{width:1em;height:.6669em;vertical-align:baseline!important;display:inline!important}.leaflet-left .leaflet-control-scale{margin-left:5px}.leaflet-bottom .leaflet-control-scale{margin-bottom:5px}.leaflet-control-scale-line{white-space:nowrap;box-sizing:border-box;text-shadow:1px 1px #fff;background:#fffc;border:2px solid #777;border-top:none;padding:2px 5px 1px;line-height:1.1}.leaflet-control-scale-line:not(:first-child){border-top:2px solid #777;border-bottom:none;margin-top:-2px}.leaflet-control-scale-line:not(:first-child):not(:last-child){border-bottom:2px solid #777}.leaflet-touch .leaflet-control-attribution,.leaflet-touch .leaflet-control-layers,.leaflet-touch .leaflet-bar{box-shadow:none}.leaflet-touch .leaflet-control-layers,.leaflet-touch .leaflet-bar{background-clip:padding-box;border:2px solid #0003}.leaflet-popup{text-align:center;margin-bottom:20px;position:absolute}.leaflet-popup-content-wrapper{text-align:left;border-radius:12px;padding:1px}.leaflet-popup-content{min-height:1px;margin:13px 24px 13px 20px;font-size:1.08333em;line-height:1.3}.leaflet-popup-content p{margin:1.3em 0}.leaflet-popup-tip-container{pointer-events:none;width:40px;height:20px;margin-top:-1px;margin-left:-20px;position:absolute;left:50%;overflow:hidden}.leaflet-popup-tip{pointer-events:auto;width:17px;height:17px;margin:-10px auto 0;padding:1px;transform:rotate(45deg)}.leaflet-popup-content-wrapper,.leaflet-popup-tip{color:#333;background:#fff;box-shadow:0 3px 14px #0006}.leaflet-container a.leaflet-popup-close-button{text-align:center;color:#757575;background:0 0;border:none;width:24px;height:24px;font:16px/24px Tahoma,Verdana,sans-serif;text-decoration:none;position:absolute;top:0;right:0}.leaflet-container a.leaflet-popup-close-button:hover,.leaflet-container a.leaflet-popup-close-button:focus{color:#585858}.leaflet-popup-scrolled{overflow:auto}.leaflet-oldie .leaflet-popup-content-wrapper{-ms-zoom:1}.leaflet-oldie .leaflet-popup-tip{-ms-filter:"progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";width:24px;filter:progid:DXImageTransform.Microsoft.Matrix(M11=.707107, M12=.707107, M21=-.707107, M22=.707107);margin:0 auto}.leaflet-oldie .leaflet-control-zoom,.leaflet-oldie .leaflet-control-layers,.leaflet-oldie .leaflet-popup-content-wrapper,.leaflet-oldie .leaflet-popup-tip{border:1px solid #999}.leaflet-div-icon{background:#fff;border:1px solid #666}.leaflet-tooltip{color:#222;white-space:nowrap;-webkit-user-select:none;user-select:none;pointer-events:none;background-color:#fff;border:1px solid #fff;border-radius:3px;padding:6px;position:absolute;box-shadow:0 1px 3px #0006}.leaflet-tooltip.leaflet-interactive{cursor:pointer;pointer-events:auto}.leaflet-tooltip-top:before,.leaflet-tooltip-bottom:before,.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{pointer-events:none;content:"";background:0 0;border:6px solid #0000;position:absolute}.leaflet-tooltip-bottom{margin-top:6px}.leaflet-tooltip-top{margin-top:-6px}.leaflet-tooltip-bottom:before,.leaflet-tooltip-top:before{margin-left:-6px;left:50%}.leaflet-tooltip-top:before{border-top-color:#fff;margin-bottom:-12px;bottom:0}.leaflet-tooltip-bottom:before{border-bottom-color:#fff;margin-top:-12px;margin-left:-6px;top:0}.leaflet-tooltip-left{margin-left:-6px}.leaflet-tooltip-right{margin-left:6px}.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{margin-top:-6px;top:50%}.leaflet-tooltip-left:before{border-left-color:#fff;margin-right:-12px;right:0}.leaflet-tooltip-right:before{border-right-color:#fff;margin-left:-12px;left:0}@media print{.leaflet-control{-webkit-print-color-adjust:exact;print-color-adjust:exact}}'),x("marker-cluster",".leaflet-cluster-anim .leaflet-marker-icon,.leaflet-cluster-anim .leaflet-marker-shadow{transition:transform .3s ease-out,opacity .3s ease-in}.leaflet-cluster-spider-leg{transition:stroke-dashoffset .3s ease-out,stroke-opacity .3s ease-in}.marker-cluster-small{background-color:#b5e28c99}.marker-cluster-small div{background-color:#6ecc3999}.marker-cluster-medium{background-color:#f1d35799}.marker-cluster-medium div{background-color:#f0c20c99}.marker-cluster-large{background-color:#fd9c7399}.marker-cluster-large div{background-color:#f1801799}.leaflet-oldie .marker-cluster-small{background-color:#b5e28c}.leaflet-oldie .marker-cluster-small div{background-color:#6ecc39}.leaflet-oldie .marker-cluster-medium{background-color:#f1d357}.leaflet-oldie .marker-cluster-medium div{background-color:#f0c20c}.leaflet-oldie .marker-cluster-large{background-color:#fd9c73}.leaflet-oldie .marker-cluster-large div{background-color:#f18017}.marker-cluster{background-clip:padding-box;border-radius:20px}.marker-cluster div{text-align:center;border-radius:15px;width:30px;height:30px;margin-top:5px;margin-left:5px}.marker-cluster span{line-height:30px}");let t,o=!1;return(async()=>{try{const l=await import("./BCTYvPrD.js").then(t=>/* @__PURE__ */e(t.default,1));if(o)return;if("undefined"!=typeof window&&(window.L=l),await Promise.all([import("./CgUphJWo.js").then(t=>/* @__PURE__ */e(t.default,1)),import("./rtH8O6Hc.js")]),o)return;const r=window.L??l;if(!L.current)return;const a=l.map(L.current,{center:Z?.center?[Z.center.lat??v[0],Z.center.lng??v[1]]:v,zoom:Z?.zoom??3,minZoom:3,zoomControl:!0,worldCopyJump:!1,maxBounds:l.latLngBounds(k),maxBoundsViscosity:1});l.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:"&copy; OpenStreetMap contributors",maxZoom:19,noWrap:!0}).addTo(a);const n=l.layerGroup().addTo(a),i="function"==typeof r.heatLayer?r.heatLayer([],{radius:30,blur:30,maxZoom:10,minOpacity:.35}):null;i?.addTo(a);const f="function"==typeof r.markerClusterGroup?r.markerClusterGroup({chunkedLoading:!0,showCoverageOnHover:!1,spiderfyOnMaxZoom:!0,zoomToBoundsOnClick:!0,maxClusterRadius:48}):l.layerGroup();f.addTo(a);const c=()=>{I.current&&clearTimeout(I.current),I.current=setTimeout(()=>{try{sessionStorage.setItem(p,JSON.stringify({center:a.getCenter(),zoom:a.getZoom()}))}catch{}},250)};let s;a.on("zoomend",c),a.on("moveend",c),R.current=a,C.current=r,T.current=n,O.current=i,M.current=f,"undefined"!=typeof ResizeObserver&&L.current&&(s=new ResizeObserver(()=>a.invalidateSize(!1)),s.observe(L.current)),requestAnimationFrame(()=>a.invalidateSize(!1)),B(!0),q(!1),t=()=>{s?.disconnect(),I.current&&clearTimeout(I.current),a.off("zoomend",c),a.off("moveend",c),a.remove(),C.current=null,R.current=null,T.current=null,O.current=null,M.current=null}}finally{o||q(!1)}})(),()=>{o=!0,t?.()}},[Z]),o(()=>{if(!D)return;const e=C.current;if(!e)return;const o=R.current;if(T.current?.clearLayers(),M.current?.clearLayers(),null===N&&H.length>0){o&&O.current&&(O.current.setLatLngs?.([]),o.hasLayer(O.current)&&o.removeLayer(O.current));const t=o=>{for(const l of o)if(l.centroid){const[t,o]=l.centroid,r=e.divIcon({className:"",html:`<div style="transform:translate(-50%,-50%);background:${b(l.color,y)};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>${A(l.folder.name)}</span><span style="background:rgba(0,0,0,0.18);border-radius:10px;padding:1px 5px;font-size:10px;">${l.eventCount}</span></div>`,iconSize:[0,0],iconAnchor:[0,0]});e.marker([o,t],{icon:r}).on("click",()=>F(l.folder._id)).addTo(T.current)}else l.children.length>0&&t(l.children)};t(H)}else{if(0===U.length)return;const l=0===H.length&&null===N,r=b(P?.color,y);if(o&&O.current&&(l&&!o.hasLayer(O.current)?O.current.addTo(o):l||(O.current.setLatLngs?.([]),o.hasLayer(O.current)&&o.removeLayer(O.current))),U.forEach(o=>{const l=o.location.x,a=o.location.y,f=e.divIcon({className:"qrati-leaflet-marker-wrapper",html:`<div style="width:36px;height:36px;cursor:pointer;background:${r};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;">${u(E)?`<img src="${u(E)}" 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([a,l],{icon:f}),p=document.createElement("div");p.style.width="fit-content",((e,o,l)=>{t(/* @__PURE__ */n(i,{client:z,children:/* @__PURE__ */n(d,{event:e,onExplore:l})}),o)})(o,p,s),c.bindPopup(p,{closeButton:!0,maxWidth:256}),M.current?.addLayer(c)}),l&&O.current){const e=U.reduce((e,t)=>Math.max(e,t.views??0),1),t=U.map(e=>[e.location.y,e.location.x,e.views??1]);O.current.setOptions?.({radius:30,blur:30,maxZoom:10,minOpacity:.35,max:e}),O.current.setLatLngs?.(t)}if(l&&!S.current&&o&&(S.current=!0,!Z)){const t=e.latLngBounds([]);U.forEach(e=>t.extend([e.location.y,e.location.x])),t.isValid()&&o.fitBounds(t,{paddingTopLeft:w.topLeft,paddingBottomRight:w.bottomRight,maxZoom:8})}}},[N,H,U,D,s,E,F,P,Z]),o(()=>{if(!D)return;const e=R.current,t=C.current;if(!e||!t)return;if(!W.current&&Z)return void(W.current=!0);W.current=!0;const o={paddingTopLeft:w.topLeft,paddingBottomRight:w.bottomRight,duration:3,easeLinearity:1};if(N){const l=m(H,N);if(!l?.folder.boundary?.length)return;const r=t.latLngBounds([]);for(const e of l.folder.boundary)r.extend([e.y,e.x]);r.isValid()&&e.flyToBounds(r,{...o,maxZoom:14})}else{const l=t.latLngBounds([]),r=e=>{for(const t of e)t.centroid?l.extend([t.centroid[1],t.centroid[0]]):r(t.children)};r(H),l.isValid()&&e.flyToBounds(l,{...o,maxZoom:8})}},[N,H,D,Z]),/* @__PURE__ */n("div",{class:"relative h-screen w-full sm:h-[calc(100vh-4rem)]",style:f(J),children:[
2
2
  /* @__PURE__ */n(h,{positionClass:"absolute top-3 left-16 z-[1000]",folderTree:H,activeFolderId:N,setActiveFolderId:F}),Y&&/* @__PURE__ */n("div",{class:"absolute inset-0 z-10 flex items-center justify-center bg-white/60",children:/* @__PURE__ */n("div",{class:"border-primary size-10 animate-spin rounded-full border-4 border-t-transparent"})}),j&&/* @__PURE__ */n("div",{class:"absolute inset-0 z-20 flex items-center justify-center bg-white/85",children:/* @__PURE__ */n("div",{class:"flex flex-col items-center gap-3",children:[/* @__PURE__ */n("div",{class:"border-primary size-10 animate-spin rounded-full border-4 border-t-transparent"}),/* @__PURE__ */n("p",{class:"text-sm font-medium text-slate-700",children:"Loading map…"})]})}),
3
3
  /* @__PURE__ */n("div",{ref:L,class:"h-full w-full rounded-xl border border-slate-200"})]})};export{E as default};
package/element/web.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import{C as t,b as r,d as a,f as o,h as e,p as i,s as n,t as s,v as l,w as c,x as d}from"./C3uDEVBt.js";import{D as p,I as g,N as m,P as h,m as f,n as v,s as b,t as u,u as w,x as y,y as x}from"./BItJQVdK.js";import{t as k}from"./Be1e_ATJ.js";import{a as _,c as T,o as z,r as N,s as q,t as C,u as I}from"./b6CwQBFC.js";import{t as M}from"./ekog7y-V.js";import{t as j}from"./Cb1JRT_1.js";import{a as E,c as S,i as L,l as A,n as O,o as R,r as U,s as Z,t as D,u as Y}from"./D0VKfxwE.js";import{t as F}from"./CCLXmMXp.js";import{n as V,t as P}from"./C9ak4yUT.js";import{t as B}from"./DNAwNX6_.js";import{t as G}from"./DIYUC8M3.js";import{n as $,r as H,t as Q}from"./Dgs_iVn3.js";import{t as X}from"./BtN9y353.js";var K=class extends d{state={hasError:!1,error:null};static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t){this.props.onError?.(t);try{const r=this.base;(r instanceof Element?r:r?.parentElement||null)?.dispatchEvent(new CustomEvent("qrati-error",{detail:{error:t},bubbles:!0,composed:!0}))}catch{}}render(){return this.state.hasError?this.props.fallback??null:this.props.children}},W=()=>{const t=T(),{props:a,sessionId:e}=v(),i=a?.organizationId,n=o([]),s=o(null),c=o(null),d=o(!1),p=o(!0),g=async t=>{if(e&&t.length)try{await m.post(w.UPDATE_SESSION,{headers:{"x-org-id":i},json:{sessionId:e,pageViews:t}})}catch(r){console.error("Failed to send page views:",r)}},h=l(()=>{if(d.current)return null;d.current=!0;const t=Date.now();if(s.current&&c.current){if(t-c.current<100)return d.current=!1,null;const r={page:s.current,entryTime:c.current,exitTime:t},a=[...n.current,r];return a.length>=5?(g(a),n.current=[]):n.current=a,d.current=!1,r}return d.current=!1,null},[]),f=l(t=>{s.current!==t&&(h(),s.current=t,c.current=Date.now())},[h]);return r(()=>{if(p.current)return p.current=!1,s.current=t.pathname,void(c.current=Date.now());const r=document.getElementById("qrati-connect-container");r&&r.scrollIntoView({behavior:"smooth",block:"start"}),f(t.pathname)},[t.pathname,f]),r(()=>{const t=()=>{const t=h();if(t){const a=[...n.current,t];if(a.length>0)try{try{const t={"Content-Type":"application/json"};i&&(t["x-org-id"]=i),fetch(w.UPDATE_SESSION,{method:"POST",headers:t,body:JSON.stringify({sessionId:e,pageViews:a}),keepalive:!0})}catch(r){console.error("Failed to send final page views with fetch keepalive:",r),g(a)}}catch(r){console.error("Failed to send final page views:",r),g(a)}}};return window.addEventListener("beforeunload",t),()=>{window.removeEventListener("beforeunload",t);const r=h(),a=r?[...n.current,r]:n.current;a.length>0&&g(a)}},[h,e]),null},J=(t=[],r)=>{const a=/* @__PURE__ */new Map;t?.forEach(t=>{a.set(t._id,t)});const o=[];let e=a.get(r);for(;e;)o.unshift({_id:e._id,name:e.name,href:p.FOLDER_EVENTS(e?._id),color:e.color}),e=a.get(e.parentFolderId);return o},tt=()=>/* @__PURE__ */s("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-full",width:"885.86993",height:"622.8043",viewBox:"0 0 885.86993 622.8043",role:"img",children:[
1
+ import{C as t,b as r,d as a,f as o,h as e,p as i,s as n,t as s,v as l,w as c,x as d}from"./C3uDEVBt.js";import{D as p,I as g,N as m,P as h,m as f,n as v,s as b,t as u,u as w,x as y,y as x}from"./BItJQVdK.js";import{t as k}from"./Be1e_ATJ.js";import{a as _,c as T,o as z,r as N,s as q,t as C,u as I}from"./b6CwQBFC.js";import{t as M}from"./ekog7y-V.js";import{t as j}from"./Cb1JRT_1.js";import{a as E,c as S,i as L,l as A,n as O,o as R,r as U,s as Z,t as D,u as Y}from"./D0VKfxwE.js";import{t as F}from"./CCLXmMXp.js";import{n as V,t as P}from"./ls36Q8v0.js";import{t as B}from"./CSO2IaJ1.js";import{t as G}from"./DIYUC8M3.js";import{n as $,r as H,t as Q}from"./BYEF5Khs.js";import{t as X}from"./BtN9y353.js";var K=class extends d{state={hasError:!1,error:null};static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t){this.props.onError?.(t);try{const r=this.base;(r instanceof Element?r:r?.parentElement||null)?.dispatchEvent(new CustomEvent("qrati-error",{detail:{error:t},bubbles:!0,composed:!0}))}catch{}}render(){return this.state.hasError?this.props.fallback??null:this.props.children}},W=()=>{const t=T(),{props:a,sessionId:e}=v(),i=a?.organizationId,n=o([]),s=o(null),c=o(null),d=o(!1),p=o(!0),g=async t=>{if(e&&t.length)try{await m.post(w.UPDATE_SESSION,{headers:{"x-org-id":i},json:{sessionId:e,pageViews:t}})}catch(r){console.error("Failed to send page views:",r)}},h=l(()=>{if(d.current)return null;d.current=!0;const t=Date.now();if(s.current&&c.current){if(t-c.current<100)return d.current=!1,null;const r={page:s.current,entryTime:c.current,exitTime:t},a=[...n.current,r];return a.length>=5?(g(a),n.current=[]):n.current=a,d.current=!1,r}return d.current=!1,null},[]),f=l(t=>{s.current!==t&&(h(),s.current=t,c.current=Date.now())},[h]);return r(()=>{if(p.current)return p.current=!1,s.current=t.pathname,void(c.current=Date.now());const r=document.getElementById("qrati-connect-container");r&&r.scrollIntoView({behavior:"smooth",block:"start"}),f(t.pathname)},[t.pathname,f]),r(()=>{const t=()=>{const t=h();if(t){const a=[...n.current,t];if(a.length>0)try{try{const t={"Content-Type":"application/json"};i&&(t["x-org-id"]=i),fetch(w.UPDATE_SESSION,{method:"POST",headers:t,body:JSON.stringify({sessionId:e,pageViews:a}),keepalive:!0})}catch(r){console.error("Failed to send final page views with fetch keepalive:",r),g(a)}}catch(r){console.error("Failed to send final page views:",r),g(a)}}};return window.addEventListener("beforeunload",t),()=>{window.removeEventListener("beforeunload",t);const r=h(),a=r?[...n.current,r]:n.current;a.length>0&&g(a)}},[h,e]),null},J=(t=[],r)=>{const a=/* @__PURE__ */new Map;t?.forEach(t=>{a.set(t._id,t)});const o=[];let e=a.get(r);for(;e;)o.unshift({_id:e._id,name:e.name,href:p.FOLDER_EVENTS(e?._id),color:e.color}),e=a.get(e.parentFolderId);return o},tt=()=>/* @__PURE__ */s("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-full",width:"885.86993",height:"622.8043",viewBox:"0 0 885.86993 622.8043",role:"img",children:[
2
2
  /* @__PURE__ */s("title",{children:"through_the_park"}),
3
3
  /* @__PURE__ */s("polygon",{points:"461.601 348.37 400.416 348.37 400.416 350.344 409.958 350.344 409.958 369.094 411.932 369.094 411.932 350.344 449.098 350.344 449.098 369.094 451.072 369.094 451.072 350.344 461.601 350.344 461.601 348.37",fill:"#3f3d56"}),
4
4
  /* @__PURE__ */s("polygon",{points:"484.299 300.014 468.509 300.014 468.509 315.803 475.829 315.803 475.829 369.007 477.803 369.007 477.803 315.803 484.299 315.803 484.299 300.014",fill:"#3f3d56"}),
@@ -101,16 +101,16 @@ return s("div",{className:"mt-3 space-y-6 sm:mt-6",children:["content"===e&&y.le
101
101
  return s("div",{className:"space-y-4",children:[r===v[0]&&/* @__PURE__ */s(j,{variant:"h3",className:"mb-4",children:["Events (",m.length,")"]}),
102
102
  /* @__PURE__ */s("div",{className:"flex items-center justify-between gap-3",children:[/* @__PURE__ */s("div",{className:"flex items-center gap-2",children:[/* @__PURE__ */s("span",{className:"inline-block size-2 rounded-full",style:{backgroundColor:a.color||"#9ca3af"}}),/* @__PURE__ */s(j,{variant:"h5",className:"text-sm sm:text-base",children:a.pathLabel})]}),/* @__PURE__ */s(j,{variant:"body2",color:"muted",children:[o.length," ",1===o.length?"result":"results"]})]}),
103
103
  /* @__PURE__ */s("div",{className:"grid grid-cols-1 gap-4 gap-y-6 sm:grid-cols-2 lg:grid-cols-3",children:o.map(t=>/* @__PURE__ */s(q,{event:t},t._id))})]},`event-folder-${r}`)}):v.map(t=>{const r=w[t]||[];/* @__PURE__ */
104
- return s("div",{className:"space-y-4",children:[t===v[0]&&/* @__PURE__ */s(j,{variant:"h3",className:"mb-4",children:["Contents (",f?.totalContentCount||h.length,") Events (",f?.totalEventCount||u.length,")"]}),/* @__PURE__ */s("div",{className:"space-y-6",children:r.map(t=>/* @__PURE__ */s("div",{className:"space-y-3",children:[/* @__PURE__ */s(q,{event:t.event}),/* @__PURE__ */s("div",{className:"grid grid-cols-3 gap-3",children:t.contents.map(r=>/* @__PURE__ */s(vt,{content:r,timestampField:"captureTime",submittedQuery:a,onClick:()=>_(t.event._id,r._id)},r._id))})]},`content-event-${t.event._id}`))})]},`content-folder-${t}`)})),"content"===e&&c&&!n&&/* @__PURE__ */s("div",{ref:z,className:"h-4 w-full","aria-hidden":"true"}),"content"===e&&c&&i&&d>1&&!n&&/* @__PURE__ */s("div",{className:"flex justify-center pt-2",children:/* @__PURE__ */s(D,{className:"text-2xl"})}),"event"===e&&c&&l&&!n&&/* @__PURE__ */s("div",{className:"flex justify-center pt-2",children:/* @__PURE__ */s("button",{type:"button",disabled:i,className:"bg-primary text-primary-foreground disabled:bg-muted rounded px-4 py-2 text-sm font-medium disabled:cursor-not-allowed",onClick:g,children:i?"Loading...":"Load More"})})]})},ut=a(()=>import("./D5MjLaap2.js")),wt={grid:{icon:/* @__PURE__ */s("svg",{xmlns:"http://www.w3.org/2000/svg",className:"size-full text-inherit",width:24,height:24,viewBox:"0 0 24 24",children:/* @__PURE__ */s("path",{fill:"currentColor",d:"M5 11q-.825 0-1.412-.587T3 9V5q0-.825.588-1.412T5 3h4q.825 0 1.413.588T11 5v4q0 .825-.587 1.413T9 11zm0 10q-.825 0-1.412-.587T3 19v-4q0-.825.588-1.412T5 13h4q.825 0 1.413.588T11 15v4q0 .825-.587 1.413T9 21zm10-10q-.825 0-1.412-.587T13 9V5q0-.825.588-1.412T15 3h4q.825 0 1.413.588T21 5v4q0 .825-.587 1.413T19 11zm0 10q-.825 0-1.412-.587T13 19v-4q0-.825.588-1.412T15 13h4q.825 0 1.413.588T21 15v4q0 .825-.587 1.413T19 21zM5 9h4V5H5zm10 0h4V5h-4zm0 10h4v-4h-4zM5 19h4v-4H5zM9 9"})})},map:{icon:/* @__PURE__ */s("svg",{xmlns:"http://www.w3.org/2000/svg",className:"size-full text-inherit",width:24,height:24,viewBox:"0 0 24 24",children:/* @__PURE__ */s("path",{fill:"currentColor",d:"M14.35 20.775L9 18.9l-4.65 1.8q-.25.1-.488.063t-.437-.163t-.312-.337T3 19.775V5.75q0-.325.188-.575T3.7 4.8l4.65-1.575q.15-.05.313-.075T9 3.125t.338.025t.312.075L15 5.1l4.65-1.8q.25-.1.488-.062t.437.162t.313.338t.112.487V18.25q0 .325-.187.575t-.513.375l-4.65 1.575q-.15.05-.312.075t-.338.025t-.337-.025t-.313-.075M14 18.55V6.85l-4-1.4v11.7zm2 0l3-1V5.7l-3 1.15zM5 18.3l3-1.15V5.45l-3 1zM16 6.85v11.7zm-8-1.4v11.7z"})})}},yt=Object.keys(wt).map(t=>({icon:wt[t].icon,value:t})),xt=()=>{const t=I().folderId??"",a=v(),{folders:d,organization:g}=a,f=a.props?.organizationId,b=!1!==g?.integrationSettings?.enableGlobalSearch,u=((t,a)=>{const[n,s]=e(""),[c,d]=e("event"),[p,g]=e(1),[h,f]=e(!1),[v,b]=e(""),[u,y]=e(!1),[x,k]=e([]),[_,T]=e([]),[z,N]=e(null),q=o(0),C=o(null),I=o(null),M=i(()=>`org-inline-search-gallery-${t||"default"}`,[t]),j=l(()=>{s(""),b(""),y(!1),g(1),k([]),T([]),N(null)},[]),E=l((t,r)=>{g(1),b(""),y(!1),k([]),T([]),N(null),d(r),s(t)},[]);r(()=>{if(!t||!n)return;const r=++q.current;(async()=>{f(!0),b("");try{const a="event"===c?w.SEARCH_EVENTS:w.SEARCH_CONTENTS,o=await m.get(a,{timeout:6e4,headers:{"x-org-id":t},searchParams:{query:n,page:String(p),limit:"event"===c?"12":"8",projection:"connect"}}).json();if(r!==q.current)return;const e=o?.data||[],i=o?.meta?.totalPages||0;if(y((o?.meta?.currentPage||0)<i),"event"===c){const t=e;k(r=>1===p?t:[...r,...t])}else{N({totalContentCount:o?.meta?.totalContentCount,totalEventCount:o?.meta?.totalEventCount});const t=e;T(r=>1===p?t:[...r,...t])}}catch(a){if(r!==q.current)return;b(a?.message||"Failed to search")}finally{r===q.current&&f(!1)}})()},[t,p,n,c]);const S=i(()=>{const t={};return x.forEach(r=>{const a=r.folderId||"root";t[a]||(t[a]=[]),t[a].push(r)}),Object.values(t).forEach(t=>{t.sort((t,r)=>(t.name||"").localeCompare(r.name||"",void 0,{sensitivity:"base"}))}),t},[x]),L=i(()=>{const t=/* @__PURE__ */new Map,r=/* @__PURE__ */new Set;return _.forEach(a=>{if(!a?._id||r.has(a._id))return;r.add(a._id);const o=a.event?._id||a.eventId;o&&a.event&&(t.has(o)||t.set(o,{event:a.event,contents:[]}),t.get(o)?.contents.push({...a}))}),Array.from(t.values()).sort((t,r)=>(t.event?.name||"").localeCompare(r.event?.name||"",void 0,{sensitivity:"base"}))},[_]),A=i(()=>{const t={};return L.forEach(r=>{const a=r.event?.folderId||"root";t[a]||(t[a]=[]),t[a].push(r)}),t},[L]),O=i(()=>{const t=Object.keys("event"===c?S:A);return t.sort((t,r)=>{if("root"===t)return-1;if("root"===r)return 1;const o=J(a,t).map(t=>t.name).join("/"),e=J(a,r).map(t=>t.name).join("/");return o.localeCompare(e)}),t},[A,S,a,c]),R=i(()=>{if("content"!==c)return[];const t=[];return O.forEach(r=>{(A[r]||[]).forEach(r=>{r.contents.forEach(a=>{t.push({event:r.event,content:a})})})}),t},[O,A,c]),U=l((t,r)=>{if(!C.current?.loadAndOpen)return;const a=R.findIndex(a=>a.event._id===t&&a.content._id===r);a>=0&&C.current.loadAndOpen(a)},[R]);return r(()=>{const t=I.current;if("content"!==c||!n||0===R.length||!t)return C.current?.destroy?.(),void(C.current=null);const r=new $({gallery:t,children:"a.pswp-item",counter:!1,bgOpacity:1,wheelToZoom:!0,pinchToClose:!0,zoom:!1,pswpModule:Q});return C.current=r,r.init(),()=>{C.current?.destroy?.(),C.current=null}},[R.length,M,n,c]),{handleSearch:E,clearSearch:j,isSearchActive:n.length>0,submittedQuery:n,submittedSearchType:c,isLoading:h,errorMessage:v,hasMore:u,page:p,setPage:g,eventResults:x,contentResults:_,contentMeta:z,activeFolderKeys:O,eventGroupsByFolder:S,contentGroups:L,contentGroupsByFolder:A,flattenedContentMedia:R,lightboxRef:C,galleryElementRef:I,galleryId:M,openMediaInLightbox:U}})(f,d||[]),y=!0===g?.integrationSettings?.enableMapView,[x,k]=e(()=>{if(!f)return"grid";try{return sessionStorage.getItem(`qrati-view-mode-${f}`)||"grid"}catch{return"grid"}}),{data:_,isLoading:T}=h({queryKey:[`public-events-map-${f}`,t||"all-folders"],enabled:y&&"map"===x,staleTime:3e5,gcTime:6e5,queryFn:async()=>{const r=t.length>0?{folderId:t,limit:500,sort:"-views",projection:"connect"}:{includeAllFolders:"true",limit:500,sort:"-views",contentLimit:3,projection:"connect"};return(await m.get(w.PUBLIC_EVENTS,{headers:{"x-org-id":f},searchParams:r}).json()).data??[]}}),z=i(()=>{if("undefined"==typeof window)return null;if(window.history.state?.internalNavigation)return null;try{const t=new URLSearchParams(window.location?.search??"");let r=t.get("event"),a=t.get("page");if(!r&&!a&&window.location?.hash){const t=window.location.hash.split("?");if(t.length>1){const o=new URLSearchParams(t[1]);r=o.get("event"),a=o.get("page")}}if(r){if(a)switch(a.toLowerCase()){case"upload":return p.UPLOAD(r);case"curate":return p.CURATE(r);case"leaderboard":return p.LEADERBOARD(r);default:return p.GALLERY(r)}return p.GALLERY(r)}}catch(t){console.error("Error parsing URL parameters:",t)}return null},[]),q=i(()=>(d??[]).filter(r=>r.parentFolderId===(t?.length>0?t:null)||r.parentFolderId===(t?.length>0?t:void 0)),[d,t]),j=i(()=>J(d,t),[d,t]),{isLoading:E,data:S}=h({queryKey:[`public-events-${f}`,t],staleTime:6e4,gcTime:3e5,queryFn:async()=>(await m.get(w.PUBLIC_EVENTS,{headers:{"x-org-id":f},searchParams:{folderId:t,sort:"-createdAt",projection:"connect"}}).json()).data??[]});return z?/* @__PURE__ */s(N,{to:z,replace:!0}):/* @__PURE__ */s(c,E||!g?{children:[g?.navigationSettings?.enableNavbar&&/* @__PURE__ */s(V,{}),/* @__PURE__ */s("div",{className:"min-h-screen w-full",children:[
104
+ return s("div",{className:"space-y-4",children:[t===v[0]&&/* @__PURE__ */s(j,{variant:"h3",className:"mb-4",children:["Contents (",f?.totalContentCount||h.length,") Events (",f?.totalEventCount||u.length,")"]}),/* @__PURE__ */s("div",{className:"space-y-6",children:r.map(t=>/* @__PURE__ */s("div",{className:"space-y-3",children:[/* @__PURE__ */s(q,{event:t.event}),/* @__PURE__ */s("div",{className:"grid grid-cols-3 gap-3",children:t.contents.map(r=>/* @__PURE__ */s(vt,{content:r,timestampField:"captureTime",submittedQuery:a,onClick:()=>_(t.event._id,r._id)},r._id))})]},`content-event-${t.event._id}`))})]},`content-folder-${t}`)})),"content"===e&&c&&!n&&/* @__PURE__ */s("div",{ref:z,className:"h-4 w-full","aria-hidden":"true"}),"content"===e&&c&&i&&d>1&&!n&&/* @__PURE__ */s("div",{className:"flex justify-center pt-2",children:/* @__PURE__ */s(D,{className:"text-2xl"})}),"event"===e&&c&&l&&!n&&/* @__PURE__ */s("div",{className:"flex justify-center pt-2",children:/* @__PURE__ */s("button",{type:"button",disabled:i,className:"bg-primary text-primary-foreground disabled:bg-muted rounded px-4 py-2 text-sm font-medium disabled:cursor-not-allowed",onClick:g,children:i?"Loading...":"Load More"})})]})},ut=a(()=>import("./lrjV8c1G2.js")),wt={grid:{icon:/* @__PURE__ */s("svg",{xmlns:"http://www.w3.org/2000/svg",className:"size-full text-inherit",width:24,height:24,viewBox:"0 0 24 24",children:/* @__PURE__ */s("path",{fill:"currentColor",d:"M5 11q-.825 0-1.412-.587T3 9V5q0-.825.588-1.412T5 3h4q.825 0 1.413.588T11 5v4q0 .825-.587 1.413T9 11zm0 10q-.825 0-1.412-.587T3 19v-4q0-.825.588-1.412T5 13h4q.825 0 1.413.588T11 15v4q0 .825-.587 1.413T9 21zm10-10q-.825 0-1.412-.587T13 9V5q0-.825.588-1.412T15 3h4q.825 0 1.413.588T21 5v4q0 .825-.587 1.413T19 11zm0 10q-.825 0-1.412-.587T13 19v-4q0-.825.588-1.412T15 13h4q.825 0 1.413.588T21 15v4q0 .825-.587 1.413T19 21zM5 9h4V5H5zm10 0h4V5h-4zm0 10h4v-4h-4zM5 19h4v-4H5zM9 9"})})},map:{icon:/* @__PURE__ */s("svg",{xmlns:"http://www.w3.org/2000/svg",className:"size-full text-inherit",width:24,height:24,viewBox:"0 0 24 24",children:/* @__PURE__ */s("path",{fill:"currentColor",d:"M14.35 20.775L9 18.9l-4.65 1.8q-.25.1-.488.063t-.437-.163t-.312-.337T3 19.775V5.75q0-.325.188-.575T3.7 4.8l4.65-1.575q.15-.05.313-.075T9 3.125t.338.025t.312.075L15 5.1l4.65-1.8q.25-.1.488-.062t.437.162t.313.338t.112.487V18.25q0 .325-.187.575t-.513.375l-4.65 1.575q-.15.05-.312.075t-.338.025t-.337-.025t-.313-.075M14 18.55V6.85l-4-1.4v11.7zm2 0l3-1V5.7l-3 1.15zM5 18.3l3-1.15V5.45l-3 1zM16 6.85v11.7zm-8-1.4v11.7z"})})}},yt=Object.keys(wt).map(t=>({icon:wt[t].icon,value:t})),xt=()=>{const t=I().folderId??"",a=v(),{folders:d,organization:g}=a,f=a.props?.organizationId,b=!1!==g?.integrationSettings?.enableGlobalSearch,u=((t,a)=>{const[n,s]=e(""),[c,d]=e("event"),[p,g]=e(1),[h,f]=e(!1),[v,b]=e(""),[u,y]=e(!1),[x,k]=e([]),[_,T]=e([]),[z,N]=e(null),q=o(0),C=o(null),I=o(null),M=i(()=>`org-inline-search-gallery-${t||"default"}`,[t]),j=l(()=>{s(""),b(""),y(!1),g(1),k([]),T([]),N(null)},[]),E=l((t,r)=>{g(1),b(""),y(!1),k([]),T([]),N(null),d(r),s(t)},[]);r(()=>{if(!t||!n)return;const r=++q.current;(async()=>{f(!0),b("");try{const a="event"===c?w.SEARCH_EVENTS:w.SEARCH_CONTENTS,o=await m.get(a,{timeout:6e4,headers:{"x-org-id":t},searchParams:{query:n,page:String(p),limit:"event"===c?"12":"8",projection:"connect"}}).json();if(r!==q.current)return;const e=o?.data||[],i=o?.meta?.totalPages||0;if(y((o?.meta?.currentPage||0)<i),"event"===c){const t=e;k(r=>1===p?t:[...r,...t])}else{N({totalContentCount:o?.meta?.totalContentCount,totalEventCount:o?.meta?.totalEventCount});const t=e;T(r=>1===p?t:[...r,...t])}}catch(a){if(r!==q.current)return;b(a?.message||"Failed to search")}finally{r===q.current&&f(!1)}})()},[t,p,n,c]);const S=i(()=>{const t={};return x.forEach(r=>{const a=r.folderId||"root";t[a]||(t[a]=[]),t[a].push(r)}),Object.values(t).forEach(t=>{t.sort((t,r)=>(t.name||"").localeCompare(r.name||"",void 0,{sensitivity:"base"}))}),t},[x]),L=i(()=>{const t=/* @__PURE__ */new Map,r=/* @__PURE__ */new Set;return _.forEach(a=>{if(!a?._id||r.has(a._id))return;r.add(a._id);const o=a.event?._id||a.eventId;o&&a.event&&(t.has(o)||t.set(o,{event:a.event,contents:[]}),t.get(o)?.contents.push({...a}))}),Array.from(t.values()).sort((t,r)=>(t.event?.name||"").localeCompare(r.event?.name||"",void 0,{sensitivity:"base"}))},[_]),A=i(()=>{const t={};return L.forEach(r=>{const a=r.event?.folderId||"root";t[a]||(t[a]=[]),t[a].push(r)}),t},[L]),O=i(()=>{const t=Object.keys("event"===c?S:A);return t.sort((t,r)=>{if("root"===t)return-1;if("root"===r)return 1;const o=J(a,t).map(t=>t.name).join("/"),e=J(a,r).map(t=>t.name).join("/");return o.localeCompare(e)}),t},[A,S,a,c]),R=i(()=>{if("content"!==c)return[];const t=[];return O.forEach(r=>{(A[r]||[]).forEach(r=>{r.contents.forEach(a=>{t.push({event:r.event,content:a})})})}),t},[O,A,c]),U=l((t,r)=>{if(!C.current?.loadAndOpen)return;const a=R.findIndex(a=>a.event._id===t&&a.content._id===r);a>=0&&C.current.loadAndOpen(a)},[R]);return r(()=>{const t=I.current;if("content"!==c||!n||0===R.length||!t)return C.current?.destroy?.(),void(C.current=null);const r=new $({gallery:t,children:"a.pswp-item",counter:!1,bgOpacity:1,wheelToZoom:!0,pinchToClose:!0,zoom:!1,pswpModule:Q});return C.current=r,r.init(),()=>{C.current?.destroy?.(),C.current=null}},[R.length,M,n,c]),{handleSearch:E,clearSearch:j,isSearchActive:n.length>0,submittedQuery:n,submittedSearchType:c,isLoading:h,errorMessage:v,hasMore:u,page:p,setPage:g,eventResults:x,contentResults:_,contentMeta:z,activeFolderKeys:O,eventGroupsByFolder:S,contentGroups:L,contentGroupsByFolder:A,flattenedContentMedia:R,lightboxRef:C,galleryElementRef:I,galleryId:M,openMediaInLightbox:U}})(f,d||[]),y=!0===g?.integrationSettings?.enableMapView,[x,k]=e(()=>{if(!f)return"grid";try{return sessionStorage.getItem(`qrati-view-mode-${f}`)||"grid"}catch{return"grid"}}),{data:_,isLoading:T}=h({queryKey:[`public-events-map-${f}`,t||"all-folders"],enabled:y&&"map"===x,staleTime:3e5,gcTime:6e5,queryFn:async()=>{const r=t.length>0?{folderId:t,limit:500,sort:"-views",projection:"connect"}:{includeAllFolders:"true",limit:500,sort:"-views",contentLimit:3,projection:"connect"};return(await m.get(w.PUBLIC_EVENTS,{headers:{"x-org-id":f},searchParams:r}).json()).data??[]}}),z=i(()=>{if("undefined"==typeof window)return null;if(window.history.state?.internalNavigation)return null;try{const t=new URLSearchParams(window.location?.search??"");let r=t.get("event"),a=t.get("page");if(!r&&!a&&window.location?.hash){const t=window.location.hash.split("?");if(t.length>1){const o=new URLSearchParams(t[1]);r=o.get("event"),a=o.get("page")}}if(r){if(a)switch(a.toLowerCase()){case"upload":return p.UPLOAD(r);case"curate":return p.CURATE(r);case"leaderboard":return p.LEADERBOARD(r);default:return p.GALLERY(r)}return p.GALLERY(r)}}catch(t){console.error("Error parsing URL parameters:",t)}return null},[]),q=i(()=>(d??[]).filter(r=>r.parentFolderId===(t?.length>0?t:null)||r.parentFolderId===(t?.length>0?t:void 0)),[d,t]),j=i(()=>J(d,t),[d,t]),{isLoading:E,data:S}=h({queryKey:[`public-events-${f}`,t],staleTime:6e4,gcTime:3e5,queryFn:async()=>(await m.get(w.PUBLIC_EVENTS,{headers:{"x-org-id":f},searchParams:{folderId:t,sort:"-createdAt",projection:"connect"}}).json()).data??[]});return z?/* @__PURE__ */s(N,{to:z,replace:!0}):/* @__PURE__ */s(c,E||!g?{children:[g?.navigationSettings?.enableNavbar&&/* @__PURE__ */s(V,{}),/* @__PURE__ */s("div",{className:"min-h-screen w-full",children:[
105
105
  /* @__PURE__ */s(dt,{organization:g}),
106
106
  /* @__PURE__ */s("div",{className:"mt-4 grid grid-cols-2 gap-3 md:grid-cols-3 lg:grid-cols-4 lg:gap-6",children:Array.from({length:4}).map((t,r)=>/* @__PURE__ */s(M,{className:"h-24 rounded"},`folder-${r}`))}),
107
107
  /* @__PURE__ */s("div",{className:"mt-4 grid grid-cols-1 gap-4 sm:grid-cols-3",children:Array.from({length:6}).map((t,r)=>/* @__PURE__ */s("div",{className:"space-y-4",children:[/* @__PURE__ */s(M,{className:"h-72 overflow-hidden rounded sm:h-80"}),/* @__PURE__ */s(M,{className:"h-6 w-64 rounded"})]},r))})]})]}:{children:[g?.navigationSettings?.enableNavbar&&/* @__PURE__ */s(V,{}),
108
108
  /* @__PURE__ */s("div",{className:"min-h-screen w-full",children:[
109
109
  /* @__PURE__ */s("div",{className:"flex items-end justify-between",children:[/* @__PURE__ */s("div",{className:"mt-4 flex justify-end",children:y&&/* @__PURE__ */s(Y,{className:"flex-1 lg:flex-none",selected:x,buttons:yt,onChange:t=>(t=>{k(t);try{f&&sessionStorage.setItem(`qrati-view-mode-${f}`,t)}catch(r){}})(t)})}),/* @__PURE__ */s("div",{className:"flex flex-col items-end gap-4",children:[/* @__PURE__ */s(dt,{organization:g}),b&&/* @__PURE__ */s(gt,{onSearch:u.handleSearch,onClear:u.clearSearch,hasActiveSearch:u.isSearchActive})]})]}),u.isSearchActive&&/* @__PURE__ */s(bt,{folders:d||[],submittedQuery:u.submittedQuery,submittedSearchType:u.submittedSearchType,isLoading:u.isLoading,errorMessage:u.errorMessage,hasMore:u.hasMore,isSearchActive:u.isSearchActive,page:u.page,onLoadMore:()=>u.setPage(t=>t+1),eventResults:u.eventResults,contentResults:u.contentResults,contentMeta:u.contentMeta,activeFolderKeys:u.activeFolderKeys,eventGroupsByFolder:u.eventGroupsByFolder,contentGroups:u.contentGroups,contentGroupsByFolder:u.contentGroupsByFolder,flattenedContentMedia:u.flattenedContentMedia,galleryElementRef:u.galleryElementRef,galleryId:u.galleryId,openMediaInLightbox:u.openMediaInLightbox}),!u.isSearchActive&&/* @__PURE__ */s(c,{children:["grid"===x&&t&&/* @__PURE__ */s("div",{className:"mt-4",children:/* @__PURE__ */s(nt,{homeLink:p.PUBLIC_EVENTS,data:j})}),"grid"===x&&q.length>0&&/* @__PURE__ */s("div",{className:"mt-4 grid grid-cols-2 gap-3 md:grid-cols-3 lg:grid-cols-4 lg:gap-6",children:q.map(t=>/* @__PURE__ */s(C,{to:p.FOLDER_EVENTS(String(t?._id)),children:/* @__PURE__ */s(st,{folder:t},String(t._id))},String(t?._id)))}),"map"!==x&&(S?.length??0)<=0&&/* @__PURE__ */s("div",{className:"min-h-[80vh]",children:/* @__PURE__ */s(F,{title:((d??[]).length??0)>0?"Empty Folder":"No Events",description:((d??[]).length??0)>0?"Browse other folders for events":"Check back later for our awesome events!",className:"mt-24 md:mt-36",iconSvg:/* @__PURE__ */s(tt,{})})}),"map"===x&&y?/* @__PURE__ */s(n,{fallback:/* @__PURE__ */s(M,{className:"mt-4 h-[70vh] w-full rounded-lg"}),children:/* @__PURE__ */s(ut,{events:_??[],isLoading:T})}):(S?.length??0)>0&&/* @__PURE__ */s("div",{className:"mt-4 grid grid-cols-1 gap-4 gap-y-6 pb-16 sm:grid-cols-2 lg:grid-cols-3",children:(S??[]).map(t=>/* @__PURE__ */s(C,{to:p.GALLERY(String(t.slug)),children:/* @__PURE__ */s(at,{event:t})},t._id))})]})]}),
110
- /* @__PURE__ */s(P,{})]})},kt=a(()=>import("./DsvRTvCp.js")),_t=a(()=>import("./BNEa3Uj4.js")),Tt=a(()=>import("./D5YBxlTz2.js")),zt=a(()=>import("./d_bA36WR2.js")),Nt=a(()=>import("./MpvHkxaz2.js")),qt=a(()=>import("./CXg838Gr2.js")),Ct=a(()=>import("./CxgDoGDT2.js")),It=a(()=>import("./Cj4nJyT42.js")),Mt=a(()=>import("./C3HKK1w_2.js")),jt=a(()=>import("./CGc52QIP2.js")),Et=()=>/* @__PURE__ */s("div",{className:"flex flex-col gap-4 p-4",children:[
110
+ /* @__PURE__ */s(P,{})]})},kt=a(()=>import("./DsvRTvCp.js")),_t=a(()=>import("./Do2aldFH.js")),Tt=a(()=>import("./WxZlurdK2.js")),zt=a(()=>import("./Drl8BMLL2.js")),Nt=a(()=>import("./MpvHkxaz2.js")),qt=a(()=>import("./CXg838Gr2.js")),Ct=a(()=>import("./CxgDoGDT2.js")),It=a(()=>import("./Cj4nJyT42.js")),Mt=a(()=>import("./DB1jhaAe2.js")),jt=a(()=>import("./BpVacqmD2.js")),Et=()=>/* @__PURE__ */s("div",{className:"flex flex-col gap-4 p-4",children:[
111
111
  /* @__PURE__ */s(M,{className:"h-8 w-3/4 rounded"}),
112
112
  /* @__PURE__ */s(M,{className:"h-64 w-full rounded-lg"}),
113
- /* @__PURE__ */s("div",{className:"flex gap-3",children:[/* @__PURE__ */s(M,{className:"h-10 w-24 rounded"}),/* @__PURE__ */s(M,{className:"h-10 w-24 rounded"})]})]}),St=({router:t="memory"})=>{const a="hash"===t.toLowerCase()?"hash":"memory";return r(()=>{const t=()=>{import("./D5YBxlTz2.js"),import("./d_bA36WR2.js"),import("./C3HKK1w_2.js"),import("./CXg838Gr2.js")};if("undefined"!=typeof requestIdleCallback){const r=requestIdleCallback(t,{timeout:5e3});return()=>cancelIdleCallback(r)}const r=setTimeout(t,2e3);return()=>clearTimeout(r)},[]),/* @__PURE__ */s(z,{mode:a,children:[/* @__PURE__ */s(W,{}),/* @__PURE__ */s(n,{fallback:/* @__PURE__ */s(Et,{}),children:/* @__PURE__ */s(q,{children:[
113
+ /* @__PURE__ */s("div",{className:"flex gap-3",children:[/* @__PURE__ */s(M,{className:"h-10 w-24 rounded"}),/* @__PURE__ */s(M,{className:"h-10 w-24 rounded"})]})]}),St=({router:t="memory"})=>{const a="hash"===t.toLowerCase()?"hash":"memory";return r(()=>{const t=()=>{import("./WxZlurdK2.js"),import("./Drl8BMLL2.js"),import("./DB1jhaAe2.js"),import("./CXg838Gr2.js")};if("undefined"!=typeof requestIdleCallback){const r=requestIdleCallback(t,{timeout:5e3});return()=>cancelIdleCallback(r)}const r=setTimeout(t,2e3);return()=>clearTimeout(r)},[]),/* @__PURE__ */s(z,{mode:a,children:[/* @__PURE__ */s(W,{}),/* @__PURE__ */s(n,{fallback:/* @__PURE__ */s(Et,{}),children:/* @__PURE__ */s(q,{children:[
114
114
  /* @__PURE__ */s(_,{path:"/my-uploads",element:jt}),
115
115
  /* @__PURE__ */s(_,{path:"/:folderId?",element:xt}),
116
116
  /* @__PURE__ */s(_,{path:"/event/:eventSlug",element:_t,children:[
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qratilabs/qrati-connect",
3
- "version": "2.23.6",
3
+ "version": "2.23.7",
4
4
  "description": "Qrati Connect - Preact-based embeddable SDK with React wrapper",
5
5
  "author": "Qrati Labs",
6
6
  "license": "UNLICENSED",