@qratilabs/qrati-connect 2.31.0 → 2.31.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import{h as a,t as o}from"./BXMw4kNf.js";import{n as e}from"./CdivXyOP.js";import{x as s}from"./Bb9ydqSB.js";import{l,t as r}from"./D6q-D1kv.js";import{t as i}from"./cBUXG_uS.js";import{n as t}from"./JY9kGm742.js";import{t as n}from"./DKxH7j1t2.js";import{i as d,s as m,t as p}from"./CQMPBmQq2.js";import{n as c,r as g,t as u}from"./D2-DJv4T2.js";var f=()=>{const{t:f}=t(),h=l(),[w,v]=a(""),[b,y]=a(""),[j,C]=a(!1),[N,A]=a(null),[k,x]=a(!1),[P,S]=a({}),{loginUsingEmail:E,loginWithGoogle:F,loginWithApple:L}=e(),[O,W]=a({google:!1,apple:!1}),D=a=>{S(o=>o[a]?{...o,[a]:void 0}:o)},G=async(a,o)=>{W(o=>({...o,[a]:!0})),A(null);try{await(o?.())}catch(e){e instanceof Error?A(e.message):A(`Failed to login with ${a.charAt(0).toUpperCase()+a.slice(1)}`)}finally{W(o=>({...o,[a]:!1}))}};/* @__PURE__ */
1
+ import{h as a,t as o}from"./BXMw4kNf.js";import{n as e}from"./CdivXyOP.js";import{x as s}from"./Bb9ydqSB.js";import{l,t as r}from"./BK_hWmGs.js";import{t as i}from"./cBUXG_uS.js";import{n as t}from"./JY9kGm742.js";import{t as n}from"./DKxH7j1t2.js";import{i as d,s as m,t as p}from"./CQMPBmQq2.js";import{n as c,r as g,t as u}from"./D2-DJv4T2.js";var f=()=>{const{t:f}=t(),h=l(),[w,v]=a(""),[b,y]=a(""),[j,C]=a(!1),[N,A]=a(null),[k,x]=a(!1),[P,S]=a({}),{loginUsingEmail:E,loginWithGoogle:F,loginWithApple:L}=e(),[O,W]=a({google:!1,apple:!1}),D=a=>{S(o=>o[a]?{...o,[a]:void 0}:o)},G=async(a,o)=>{W(o=>({...o,[a]:!0})),A(null);try{await(o?.())}catch(e){e instanceof Error?A(e.message):A(`Failed to login with ${a.charAt(0).toUpperCase()+a.slice(1)}`)}finally{W(o=>({...o,[a]:!1}))}};/* @__PURE__ */
2
2
  return o("div",{className:"bg-background w-full space-y-6",children:[/* @__PURE__ */o("form",{noValidate:!0,onSubmit:async a=>{a.preventDefault();const o=d(w),e=m(b);if(o||e)return void S({email:o,password:e});S({}),C(!0),A(null);const s=await(E?.(w.toLowerCase(),b));s?.error&&A(s.error),C(!1)},className:"space-y-6",children:[
3
3
  /* @__PURE__ */o("div",{className:"space-y-9",children:[/* @__PURE__ */o(p,{label:f("auth.email","Email address"),name:"email",disabled:j,type:"email",value:w,onChange:a=>{v(a.target.value),D("email")},autoComplete:"email",error:P.email}),/* @__PURE__ */o(p,{label:f("auth.password","Password"),name:"password",disabled:j,type:k?"text":"password",value:b,onChange:a=>{y(a.target.value),D("password")},autoComplete:"current-password",error:P.password,actionLabel:k?"Hide password":"Show password",actionIcon:/* @__PURE__ */o(k?u:c,{className:"size-5"}),onActionClick:()=>x(!k)})]}),N&&/* @__PURE__ */o(i,{align:"center",color:"error",className:"font-medium",children:N}),
4
4
  /* @__PURE__ */o("div",{className:"flex justify-end",children:/* @__PURE__ */o(r,{to:s.FORGOT_PASSWORD,state:{from:h.pathname},children:/* @__PURE__ */o(i,{variant:"h6",className:"w-fit",children:f("button.forgotPassword","Forgot Password?")})})}),
@@ -1,4 +1,4 @@
1
- import{E as e,S as t,T as r,_ as o,f as a,h as n,p as s,t as l,v as i,w as d,y as c}from"./BXMw4kNf.js";import{a as m,i as p,n as u}from"./CdivXyOP.js";import{t as h,x as f}from"./Bb9ydqSB.js";import{t as v}from"./D6q-D1kv.js";import{r as b,t as g}from"./cBUXG_uS.js";import{t as x}from"./DXjc6xIy.js";var q=b("inline-flex h-fit flex-auto cursor-pointer items-center justify-center border transition-all duration-200 focus:outline-none active:scale-95",{variants:{size:{sm:"gap-1.5 p-1.5 text-xs",md:"gap-3 px-3 py-2 text-sm",lg:"gap-3 px-4 py-3 text-base"}},defaultVariants:{size:"md"}}),w=({size:e,buttons:t=[],onChange:r,selected:o,className:a})=>/* @__PURE__ */l("div",{className:p("button-group-overlap shadow-outer z-0 flex h-fit rounded",a),children:t.map((a,n)=>{const s=0===n,i=n===t.length-1,d=a.value===o;/* @__PURE__ */
1
+ import{E as e,S as t,T as r,_ as o,f as a,h as n,p as s,t as l,v as i,w as d,y as c}from"./BXMw4kNf.js";import{a as m,i as p,n as u}from"./CdivXyOP.js";import{t as h,x as f}from"./Bb9ydqSB.js";import{t as v}from"./BK_hWmGs.js";import{r as b,t as g}from"./cBUXG_uS.js";import{t as x}from"./DXjc6xIy.js";var q=b("inline-flex h-fit flex-auto cursor-pointer items-center justify-center border transition-all duration-200 focus:outline-none active:scale-95",{variants:{size:{sm:"gap-1.5 p-1.5 text-xs",md:"gap-3 px-3 py-2 text-sm",lg:"gap-3 px-4 py-3 text-base"}},defaultVariants:{size:"md"}}),w=({size:e,buttons:t=[],onChange:r,selected:o,className:a})=>/* @__PURE__ */l("div",{className:p("button-group-overlap shadow-outer z-0 flex h-fit rounded",a),children:t.map((a,n)=>{const s=0===n,i=n===t.length-1,d=a.value===o;/* @__PURE__ */
2
2
  return l("button",{type:"button",onClick:()=>r?.(a.value),className:p(q({size:e}),d?a.activeClassName?a.activeClassName:"bg-primary border-primary text-primary-foreground hover:bg-primary/90 border":"hover:bg-muted/50 active:bg-muted border-border border",s&&"rounded-l",i&&"rounded-r"),children:[!a.icon&&/* @__PURE__ */l("span",{className:"font-medium sm:py-0.5",children:a.text}),a.icon&&/* @__PURE__ */l("div",{className:"size-6",children:a.icon})]},a.value)})});function N({className:e}){/* @__PURE__ */
3
3
  return l("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__ */l("path",{fill:"currentColor",d:"M6 19h3v-5q0-.425.288-.712T10 13h4q.425 0 .713.288T15 14v5h3v-9l-6-4.5L6 10zm-2 0v-9q0-.475.213-.9t.587-.7l6-4.5q.525-.4 1.2-.4t1.2.4l6 4.5q.375.275.588.7T20 10v9q0 .825-.588 1.413T18 21h-4q-.425 0-.712-.288T13 20v-5h-2v5q0 .425-.288.713T10 21H6q-.825 0-1.412-.587T4 19m8-6.75"})})}function y({className:e}){/* @__PURE__ */
4
4
  return l("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__ */l("path",{fill:"currentColor",d:"m14.475 12l-7.35-7.35q-.375-.375-.363-.888t.388-.887t.888-.375t.887.375l7.675 7.7q.3.3.45.675t.15.75t-.15.75t-.45.675l-7.7 7.7q-.375.375-.875.363T7.15 21.1t-.375-.888t.375-.887z"})})}var T=({folder:e})=>/* @__PURE__ */l("li",{className:"flex items-center",children:[/* @__PURE__ */l(y,{className:"size-4"}),/* @__PURE__ */l(v,{to:e.href??"#",className:"flex items-center gap-2 rounded px-4 py-1 transition-colors",onMouseEnter:t=>{const r=t.currentTarget;r&&e.color&&(r.style.backgroundColor=`${e.color}3A`)},onMouseLeave:e=>{const t=e.currentTarget;t&&(t.style.backgroundColor="")},children:[/* @__PURE__ */l("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",style:{color:e.color??void 0},children:/* @__PURE__ */l("path",{fill:"currentColor",d:"M4 20q-.825 0-1.412-.587T2 18V6q0-.825.588-1.412T4 4h5.175q.4 0 .763.15t.637.425L12 6h8q.825 0 1.413.588T22 8v10q0 .825-.587 1.413T20 20z"})}),/* @__PURE__ */l(g,{variant:"h5",color:"secondary",className:"whitespace-nowrap",children:e.name})]})]},e.name),C=({homeLink:e="/",data:t=[]})=>/* @__PURE__ */l("ol",{role:"list",className:"scrollbar-hide flex max-w-full items-center space-x-3 overflow-y-scroll",children:[/* @__PURE__ */l("li",{children:/* @__PURE__ */l(v,{to:e,className:"text-foreground",children:[/* @__PURE__ */l(N,{className:"size-6"}),/* @__PURE__ */l("span",{className:"sr-only",children:"Home"})]})}),t?.map(e=>/* @__PURE__ */l(T,{folder:e},e._id??e.name??e.href??"folder"))]}),k=(e=[],t)=>{const r=/* @__PURE__ */new Map;e?.forEach(e=>{r.set(e._id,e)});const o=[];let a=r.get(t);for(;a;)o.unshift({_id:a._id,name:a.name,href:f.FOLDER_EVENTS(a?._id),color:a.color}),a=r.get(a.parentFolderId);return o},z=()=>{const{initializing:e,orgRole:t,user:r,loadingUser:o}=u(),a=r?t??void 0:void 0;return{role:a,isSuper:Boolean(r?.isSuper),loading:Boolean(o||e),isOwner:a===h.OWNER,isAdmin:a===h.ADMIN,isModerator:a===h.MODERATOR}};function E({content:e,children:t,position:r="top",className:o,contentClassName:a}){const[s,i]=n(!1),{organization:d}=u();/* @__PURE__ */
@@ -1,4 +1,4 @@
1
- import{t}from"./BXMw4kNf.js";import{n as s}from"./CdivXyOP.js";import{x as o}from"./Bb9ydqSB.js";import{d as a,i as r,n as e}from"./D6q-D1kv.js";import{t as i}from"./ydzHqf5r.js";import{t as n}from"./BxQf2Aj9.js";import{t as l}from"./B6VNWZAH.js";import{t as m}from"./CLnFGdWV.js";import{t as d}from"./JY9kGm742.js";import{t as c}from"./DLHvSz1a2.js";import{t as g}from"./DKxH7j1t2.js";var f=()=>{const f=a(),{props:p,folders:v}=s(),h=p?.organizationId,{loading:u,event:N}=c({eventSlug:f.eventSlug});if(u)/* @__PURE__ */return t("div",{children:[
1
+ import{t}from"./BXMw4kNf.js";import{n as s}from"./CdivXyOP.js";import{x as o}from"./Bb9ydqSB.js";import{d as a,i as r,n as e}from"./BK_hWmGs.js";import{t as i}from"./ydzHqf5r.js";import{t as n}from"./BxQf2Aj9.js";import{t as l}from"./p4NDlPrf.js";import{t as m}from"./BqPiuAuP.js";import{t as d}from"./JY9kGm742.js";import{t as c}from"./DLHvSz1a2.js";import{t as g}from"./DKxH7j1t2.js";var f=()=>{const f=a(),{props:p,folders:v}=s(),h=p?.organizationId,{loading:u,event:N}=c({eventSlug:f.eventSlug});if(u)/* @__PURE__ */return t("div",{children:[
2
2
  /* @__PURE__ */t(n,{className:"mx-auto mt-4 h-8 w-64"}),
3
3
  /* @__PURE__ */t(n,{className:"mx-auto mt-6 h-6 w-72"}),
4
4
  /* @__PURE__ */t(n,{className:"mx-auto mt-6 h-8 w-72"}),
@@ -1,4 +1,4 @@
1
- import{g as e,t as r}from"./BXMw4kNf.js";import{i as t}from"./CdivXyOP.js";import{t as o}from"./DKxH7j1t2.js";import{n as i,o as s,r as n,t as d}from"./mZxLLxIK2.js";function a({className:e}){/* @__PURE__ */
1
+ import{g as e,t as r}from"./BXMw4kNf.js";import{i as t}from"./CdivXyOP.js";import{t as o}from"./DKxH7j1t2.js";import{n as i,o as s,r as n,t as d}from"./BrDFXZq12.js";function a({className:e}){/* @__PURE__ */
2
2
  return r("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */r("path",{fill:"currentColor",d:"M2.725 21q-.275 0-.5-.137t-.35-.363t-.137-.488t.137-.512l9.25-16q.15-.25.388-.375T12 3t.488.125t.387.375l9.25 16q.15.25.138.513t-.138.487t-.35.363t-.5.137zm1.725-2h15.1L12 6zm8.263-1.287Q13 17.425 13 17t-.288-.712T12 16t-.712.288T11 17t.288.713T12 18t.713-.288m0-3Q13 14.425 13 14v-3q0-.425-.288-.712T12 10t-.712.288T11 11v3q0 .425.288.713T12 15t.713-.288M12 12.5"})})}function l({open:e,onOpenChange:l,title:c,description:u,cancelText:m="Cancel",confirmText:g="Confirm",confirmColor:f="error",loading:b,onCancel:h,onConfirm:v}){/* @__PURE__ */
3
3
  return r(d,{open:e,onOpenChange:l,children:/* @__PURE__ */r(i,{className:"w-full max-w-lg",children:[/* @__PURE__ */r("div",{className:"flex flex-col gap-6 p-2 sm:flex-row sm:items-start sm:p-4",children:[/* @__PURE__ */r("div",{className:"bg-destructive/10 mx-auto flex size-12 shrink-0 items-center justify-center rounded-full sm:mx-0",children:/* @__PURE__ */r(a,{className:"text-destructive size-6"})}),/* @__PURE__ */r("div",{className:"flex-1 space-y-2",children:[c&&/* @__PURE__ */r(s,{children:c}),u&&/* @__PURE__ */r(n,{children:u})]})]}),/* @__PURE__ */r("div",{className:"flex flex-col-reverse gap-3 p-4 sm:flex-row sm:justify-end",children:[/* @__PURE__ */r(o,{variant:"outlined",color:"foreground",disabled:b,className:"w-full sm:w-auto",onClick:h,children:m}),/* @__PURE__ */r(o,{color:f,loading:b,disabled:b,className:t("w-full sm:w-auto","error"===f&&"text-white"),onClick:v,children:g})]})]})})}var c={xs:"size-6 [&>*]:size-4",sm:"size-8 [&>*]:size-5",md:"size-10 [&>*]:size-6",lg:"size-12 [&>*]:size-7"},u={ghost:{primary:"text-primary hover:bg-primary/10",foreground:"text-foreground hover:bg-foreground/10",muted:"text-muted-foreground hover:bg-muted/20",error:"text-destructive hover:bg-destructive/10",success:"text-success hover:bg-success/10",warning:"text-warning hover:bg-warning/10",info:"text-info hover:bg-info/10"},filled:{primary:"bg-primary text-primary-foreground hover:bg-primary/90",foreground:"bg-foreground text-background hover:bg-foreground/90",muted:"bg-muted text-muted-foreground hover:bg-muted/80",error:"bg-destructive text-white hover:bg-destructive/90",success:"bg-success text-white hover:bg-success/90",warning:"bg-warning text-white hover:bg-warning/90",info:"bg-info text-white hover:bg-info/90"},outlined:{primary:"border border-primary text-primary hover:bg-primary/10",foreground:"border border-foreground text-foreground hover:bg-foreground/10",muted:"border border-border text-muted-foreground hover:bg-muted/20",error:"border border-destructive text-destructive hover:bg-destructive/10",success:"border border-success text-success hover:bg-success/10",warning:"border border-warning text-warning hover:bg-warning/10",info:"border border-info text-info hover:bg-info/10"}};function m({icon:e,size:o="md",variant:i="ghost",color:s="foreground",loading:n,disabled:d,tooltip:a,className:l,...m}){const g="default"===i?"filled":i,f=t("inline-flex cursor-pointer items-center justify-center rounded-full transition-colors disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",c[o],u[g]?.[s]||u[g]?.foreground,l);/* @__PURE__ */
4
4
  return r("button",{type:"button",disabled:d||n,className:f,title:a,...m,children:n?/* @__PURE__ */r("svg",{className:"animate-spin",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:/* @__PURE__ */r("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}):e})}function g({className:e}){/* @__PURE__ */
@@ -1,5 +1,5 @@
1
- import{r as e,t}from"./DdACKOZr.js";import{E as r,_ as i,c as n,d as o,f as s,g as a,h as l,o as d,p as c,s as u,t as h,v as p,y as m}from"./BXMw4kNf.js";import{c as g,i as f,n as v,s as b}from"./CdivXyOP.js";import{t as y}from"./DmpmrPE5.js";import{b as w,i as x,p as S,s as T,x as C,y as F}from"./Bb9ydqSB.js";import{d as k,l as E,n as _,u as M}from"./D6q-D1kv.js";import{t as U}from"./cBUXG_uS.js";import{t as R}from"./Dl6jcv9I.js";import{t as I}from"./BkIDQGIs.js";import{t as P}from"./C0eP2utz.js";import{n as O}from"./CXRH3zmy.js";import{r as N}from"./JY9kGm742.js";import{t as A}from"./DLHvSz1a2.js";import{t as q}from"./DKxH7j1t2.js";import{a as D,c as L,i as j,o as z,r as $,s as B,t as H}from"./C2WFktw12.js";import{a as V,i as W,n as G,o as X,r as Y,t as K}from"./mZxLLxIK2.js";import{t as Q}from"./DMnbtDXS2.js";import{i as J,n as Z,r as ee,t as te}from"./Dng1_dLU.js";var re=[];for(let mn=0;mn<256;++mn)re.push((mn+256).toString(16).slice(1));var ie=/* @__PURE__ */new Uint8Array(16);function ne(e,t,r){return t||e||!crypto.randomUUID?function(e,t,r){const i=(e=e||{}).random??e.rng?.()??crypto.getRandomValues(ie);if(i.length<16)throw new Error("Random bytes length must be >= 16");if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,t){if((r=r||0)<0||r+16>t.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let e=0;e<16;++e)t[r+e]=i[e];return t}return function(e,t=0){return(re[e[t+0]]+re[e[t+1]]+re[e[t+2]]+re[e[t+3]]+"-"+re[e[t+4]]+re[e[t+5]]+"-"+re[e[t+6]]+re[e[t+7]]+"-"+re[e[t+8]]+re[e[t+9]]+"-"+re[e[t+10]]+re[e[t+11]]+re[e[t+12]]+re[e[t+13]]+re[e[t+14]]+re[e[t+15]]).toLowerCase()}(i)}(e,t,r):crypto.randomUUID()}function oe({checked:e,defaultChecked:t,onChange:r,onBlur:i,label:n,className:o,disabled:s}){const l=e??t??!1,d=l?"checked":"unchecked",c=a();/* @__PURE__ */
2
- return h("label",{htmlFor:c,className:f("flex items-center gap-2",s&&"cursor-not-allowed opacity-50",!s&&"cursor-pointer"),children:[/* @__PURE__ */h("button",{type:"button",id:c,role:"switch","aria-checked":l,disabled:s,"data-state":d,onBlur:i,onClick:()=>!s&&r?.(!l),className:f("peer relative inline-flex h-6 w-11 shrink-0 items-center rounded-full border-2 transition-colors","border-border bg-muted","focus-visible:ring-2 focus-visible:ring-offset-2","data-[state=checked]:border-primary data-[state=checked]:bg-primary","disabled:cursor-not-allowed disabled:opacity-50",!s&&"cursor-pointer",o),children:/* @__PURE__ */h("span",{"data-state":d,className:f("pointer-events-none block size-5 translate-x-0 rounded-full shadow transition-transform","border-border bg-background border","data-[state=checked]:bg-primary-foreground data-[state=checked]:translate-x-5 data-[state=checked]:border-transparent")})}),n&&/* @__PURE__ */h("span",{className:"text-sm font-medium",children:n})]})}var se=["jpg","jpeg","png","webp","heic","tiff","bmp","avif"],ae=["mp4","webm","ogg","mov","avi","flv","wmv","mkv","3gp","m4v","mpg","mpeg"];function le({open:e,oversizedUids:t,onClose:r,onRemoveAndUpload:i}){const n=Object.values(t),o=n.filter(e=>"image"===e).length,s=n.filter(e=>"video"===e).length,a=[];return o>0&&a.push(`${o} image${o>1?"s":""}`),s>0&&a.push(`${s} video${s>1?"s":""}`),/* @__PURE__ */h(K,{open:e,onOpenChange:e=>!e&&r(),children:/* @__PURE__ */h(G,{children:[/* @__PURE__ */h(V,{children:[/* @__PURE__ */h(X,{children:"Some files are too large"}),/* @__PURE__ */h(Y,{children:[a.join(" and ")," exceed",1===n.length?"s":""," the size limit (25 MB for images, 250 MB for videos) and won't be uploaded."]})]}),/* @__PURE__ */h(W,{children:/* @__PURE__ */h(q,{onClick:i,children:"Remove and Upload"})})]})})}function de({open:e,count:t,onResume:r,onDiscard:i}){/* @__PURE__ */
1
+ import{r as e,t}from"./DdACKOZr.js";import{E as r,_ as i,c as n,d as o,f as s,g as a,h as l,o as d,p as c,s as u,t as h,v as p,y as m}from"./BXMw4kNf.js";import{c as g,i as f,n as v,s as b}from"./CdivXyOP.js";import{t as y}from"./DmpmrPE5.js";import{b as w,i as x,p as S,s as T,x as C,y as F}from"./Bb9ydqSB.js";import{d as k,l as E,n as _,u as M}from"./BK_hWmGs.js";import{t as U}from"./cBUXG_uS.js";import{t as R}from"./Dl6jcv9I.js";import{t as I}from"./BkIDQGIs.js";import{t as P}from"./C0eP2utz.js";import{n as O}from"./CXRH3zmy.js";import{r as N}from"./JY9kGm742.js";import{t as A}from"./DLHvSz1a2.js";import{t as q}from"./DKxH7j1t2.js";import{a as D,c as L,i as j,o as z,r as $,s as B,t as H}from"./C2WFktw12.js";import{a as V,i as W,n as G,o as X,r as Y,t as K}from"./BrDFXZq12.js";import{t as Q}from"./DMnbtDXS2.js";import{i as J,n as Z,r as ee,t as te}from"./BALdepDv.js";var re=[];for(let mn=0;mn<256;++mn)re.push((mn+256).toString(16).slice(1));var ie=/* @__PURE__ */new Uint8Array(16);function ne(e,t,r){return t||e||!crypto.randomUUID?function(e,t,r){const i=(e=e||{}).random??e.rng?.()??crypto.getRandomValues(ie);if(i.length<16)throw new Error("Random bytes length must be >= 16");if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,t){if((r=r||0)<0||r+16>t.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let e=0;e<16;++e)t[r+e]=i[e];return t}return function(e,t=0){return(re[e[t+0]]+re[e[t+1]]+re[e[t+2]]+re[e[t+3]]+"-"+re[e[t+4]]+re[e[t+5]]+"-"+re[e[t+6]]+re[e[t+7]]+"-"+re[e[t+8]]+re[e[t+9]]+"-"+re[e[t+10]]+re[e[t+11]]+re[e[t+12]]+re[e[t+13]]+re[e[t+14]]+re[e[t+15]]).toLowerCase()}(i)}(e,t,r):crypto.randomUUID()}function oe({checked:e,defaultChecked:t,onChange:r,onBlur:i,label:n,className:o,disabled:s}){const l=e??t??!1,d=l?"checked":"unchecked",c=a();/* @__PURE__ */
2
+ return h("label",{htmlFor:c,className:f("flex items-center gap-2",s&&"cursor-not-allowed opacity-50",!s&&"cursor-pointer"),children:[/* @__PURE__ */h("button",{type:"button",id:c,role:"switch","aria-checked":l,disabled:s,"data-state":d,onBlur:i,onClick:()=>!s&&r?.(!l),className:f("peer relative inline-flex h-6 w-11 shrink-0 items-center rounded-full border-2 transition-colors","border-border bg-muted","focus-visible:ring-2 focus-visible:ring-offset-2","data-[state=checked]:border-primary data-[state=checked]:bg-primary","disabled:cursor-not-allowed disabled:opacity-50",!s&&"cursor-pointer",o),children:/* @__PURE__ */h("span",{"data-state":d,style:{transform:l?"translateX(1.25rem)":"translateX(0)"},className:f("pointer-events-none block size-5 translate-x-0 rounded-full shadow transition-transform","border-border bg-background border","data-[state=checked]:bg-primary-foreground data-[state=checked]:translate-x-5 data-[state=checked]:border-transparent")})}),n&&/* @__PURE__ */h("span",{className:"text-sm font-medium",children:n})]})}var se=["jpg","jpeg","png","webp","heic","tiff","bmp","avif"],ae=["mp4","webm","ogg","mov","avi","flv","wmv","mkv","3gp","m4v","mpg","mpeg"];function le({open:e,oversizedUids:t,onClose:r,onRemoveAndUpload:i}){const n=Object.values(t),o=n.filter(e=>"image"===e).length,s=n.filter(e=>"video"===e).length,a=[];return o>0&&a.push(`${o} image${o>1?"s":""}`),s>0&&a.push(`${s} video${s>1?"s":""}`),/* @__PURE__ */h(K,{open:e,onOpenChange:e=>!e&&r(),children:/* @__PURE__ */h(G,{children:[/* @__PURE__ */h(V,{children:[/* @__PURE__ */h(X,{children:"Some files are too large"}),/* @__PURE__ */h(Y,{children:[a.join(" and ")," exceed",1===n.length?"s":""," the size limit (25 MB for images, 250 MB for videos) and won't be uploaded."]})]}),/* @__PURE__ */h(W,{children:/* @__PURE__ */h(q,{onClick:i,children:"Remove and Upload"})})]})})}function de({open:e,count:t,onResume:r,onDiscard:i}){/* @__PURE__ */
3
3
  return h(K,{open:e,onOpenChange:e=>!e&&i(),children:/* @__PURE__ */h(G,{children:[/* @__PURE__ */h(V,{children:[/* @__PURE__ */h(X,{children:"Resume your upload?"}),/* @__PURE__ */h(Y,{children:["We found ",t," unfinished upload",t>1?"s":""," from your last visit. Resume where you left off, or remove ",t>1?"them":"it"," and start over."]})]}),/* @__PURE__ */h(W,{children:[/* @__PURE__ */h(q,{variant:"outlined",onClick:i,children:"Remove All"}),/* @__PURE__ */h(q,{onClick:r,children:"Resume"})]})]})})}var ce=["6a385dabb04f4d8783b14fe1","69ada0f82889f080a9ca53df"],ue=({open:e,onClose:t,onSuccess:r})=>{const{t:i}=N(),[n,o]=l(!1),s=v(),a=s.props?.organizationId??s.organization?._id,{user:d,updateUser:c}=s,u=!!a&&ce.includes(a.trim()),p=u?"https://qrati.com/terms-of-use-wedding-private-events":"https://qrati.com/terms-of-use",m=u?"https://qrati.com/privacy-policy-wedding-private-events":"https://qrati.com/privacy-policy";/* @__PURE__ */
4
4
  return h(K,{open:e,onOpenChange:e=>!e&&t(),children:/* @__PURE__ */h(G,{children:/* @__PURE__ */h("div",{className:"mx-auto max-w-sm p-4 text-center sm:max-w-lg",children:[
5
5
  /* @__PURE__ */h(X,{children:i("upload.terms_title","Terms & Conditions")}),
@@ -1,14 +1,14 @@
1
- import{D as e,E as t,T as n,_ as r,b as o,f as i,g as a,h as s,i as l,m as c,n as d,o as u,p as h,t as p,v as m,w as g,y as f}from"./BXMw4kNf.js";import{a as v,f as w,i as y,n as b}from"./CdivXyOP.js";import{t as x}from"./CS8uERGc.js";import{t as N}from"./DmpmrPE5.js";import{S as k,_ as T,c as C,f as I,g as S,i as E,r as q,x as M}from"./Bb9ydqSB.js";import{n as L,t as _}from"./D6q-D1kv.js";import{t as A}from"./cBUXG_uS.js";import{n as P}from"./QxKjlE-j.js";import{t as z}from"./Bki5T_lb.js";import{t as j}from"./DT0jsFeS.js";import{n as O}from"./CXRH3zmy.js";import{t as U}from"./DKxH7j1t2.js";import{n as R,t as B}from"./7IEzYICH2.js";import{a as $,i as F,n as G,o as V,r as D,s as W,t as H}from"./Be3fjihP2.js";import{a as K,n as Q,o as Y,r as Z,t as J}from"./mZxLLxIK2.js";function X(e){return["react-photo-album",e].filter(Boolean).join("--")}function ee({width:e,height:t}){const n=e/t;return Number.isFinite(n)?n:1}var te=Object.freeze([1200,600,300,0]);function ne(e,t){return"function"==typeof e?e(t):e}function re(e,t){return void 0!==t?ne(e,t):void 0}function oe(e,t,n,r=0){if(void 0===t)return;const o=re(e,t);return Math.round(Math.max(void 0===o?function(e,t){const n=te.findIndex(e=>e<=t);return ne(e[Math.max(n,0)],t)}(n,t):o,r))}function ie(e,{spacing:t,padding:n,componentsProps:r,render:o}){return{spacing:oe(t,e,[20,15,10,5]),padding:oe(n,e,[0,0,0,0]),componentsProps:ne(r,e)||{},render:ne(o,e)}}function ae(e,t=0){const n=10**t;return Math.round((e+Number.EPSILON)*n)/n}function se(e,t,n,r,o,i,a){let s,l;const c=e=>{const t=i*(o-1)+2*a*o;return`calc((${e.match(/^\s*calc\((.*)\)\s*$/)?.[1]??e} - ${t}px) / ${ae((r-t)/n,5)})`},d=e.srcSet;return d&&d.length>0&&(s=d.concat(d.some(({width:t})=>t===e.width)?[]:[{src:e.src,width:e.width,height:e.height}]).sort((e,t)=>e.width-t.width).map(e=>`${e.src} ${e.width}w`).join(", ")),l=t?.size?(t.sizes||[]).map(({viewport:e,size:t})=>`${e} ${c(t)}`).concat(c(t.size)).join(", "):`${Math.ceil(n/r*100)}vw`,{srcSet:s,sizes:l}}var le=l(function({as:e,render:t,context:n,classes:r=[],variables:o={},style:i,className:a,children:s,...l},c){const d=function(...e){return e.filter(Boolean).join(" ")}(...(Array.isArray(r)?r:[r]).filter(e=>"string"==typeof e).map(X),a),u={style:{...Object.fromEntries(Object.entries(o).map(([e,t])=>{return[(n=e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),`--${X(n)}`),"number"==typeof t?ae(t,5):t];var n})),...i},className:d,children:s,...l};if(t){const e=t({ref:c,...u},n);if(e)return e}return p(e||"div",{ref:c,...u})}),ce=l(function({photo:e,index:t,width:n,height:r,onClick:o,render:{wrapper:i,link:a,button:s,image:l,extras:c}={},componentsProps:{link:d,button:u,wrapper:h,image:m}={}},g){const{href:f}=e,v={photo:e,index:t,width:ae(n,3),height:ae(r,3)};let w;return w=f?{...d,as:"a",render:a,classes:["photo","link"],href:f,onClick:o}:o?{...u,as:"button",type:"button",render:s,classes:["photo","button"],onClick:o}:{...h,render:i,classes:"photo"},p(le,{ref:g,variables:{photoWidth:v.width,photoHeight:v.height},context:v,...w,children:[p(le,{as:"img",classes:"image",render:l,context:v,...m}),c?.({},v)]})}),de=l(function({layout:t,sizes:n,model:r,skeleton:o,onClick:i,render:{container:a,track:s,photo:l,...c}={},componentsProps:{container:d,track:u,link:h,button:m,wrapper:g,image:f}={}},v){const{spacing:w,padding:y,containerWidth:b,tracks:x,variables:N,horizontal:k}=r||{};return p(le,{role:"group","aria-label":"Photo album",...d,variables:{spacing:w,padding:y,containerWidth:b,...N},classes:["",t],render:a,ref:v,children:[void 0!==w&&void 0!==y&&void 0!==b&&x?.map(({photos:t,variables:r},o)=>{const a=t.length,d=k?a:x.length;return e(le,{...u,key:o,render:s,classes:"track",variables:{trackSize:a,...r}},t.map(e=>{const{photo:t,index:r,width:o}=e,{key:a,src:s,alt:u="",title:v,label:x}=t,N=i?e=>{i({event:e,photo:t,index:r})}:void 0;if(l){const t=l({onClick:N},e);if(t)return t}const k=e=>x?{"aria-label":x,...e}:e;return p(ce,{onClick:N,render:c,componentsProps:{image:{loading:"lazy",decoding:"async",src:s,alt:u,title:v,...se(t,n,o,b,d,w,y),...ne(f,e)},link:k(ne(h,e)),button:k(ne(m,e)),wrapper:ne(g,e)},...e},a??r)}))}),void 0===b&&o]})});function ue(e,t,n,r){return(t-(e.length-1)*n-2*r*e.length)/e.reduce((e,t)=>e+ee(t),0)}function he(e,t,n,r,o,i,a){const s=e.slice(t,n),l=ue(s,r,o,i);return l>0?(l-a)**2*s.length:void 0}function pe(e,t){const[n,r]=e;if(n===t)return e;if(void 0!==r&&void 0!==t&&void 0!==n&&t===r&&Math.abs(t-n)<=20){const o=Math.min(n,t),i=Math.max(n,t);return o===n&&i===r?e:[o,i]}return[t,n]}function me(e,t,n){const[[r],a]=o(pe,[n]),l=function(e){const[t,n]=s(e);return e===t||e&&t&&e.length===t.length&&!e.some((e,n)=>e!==t[n])?t:(n(e),e)}(t),c=i(void 0);return{containerRef:m(t=>{c.current?.disconnect(),c.current=void 0;const n=()=>a(function(e,t){let n=e?.clientWidth;if(void 0!==n&&t&&t.length>0){const e=[...t.filter(e=>e>0)].sort((e,t)=>t-e);e.push(Math.floor(e[e.length-1]/2)),n=e.find((t,r)=>t<=n||r===e.length-1)}return n}(t,l));n(),t&&"undefined"!=typeof ResizeObserver&&(c.current=new ResizeObserver(n),c.current.observe(t)),"function"==typeof e?e(t):e&&(e.current=t)},[e,l]),containerWidth:r}}var ge=l(function({photos:e,breakpoints:t,defaultContainerWidth:n,...r},o){const{containerRef:i,containerWidth:a}=me(o,t,n),{spacing:s,padding:l,targetRowHeight:c,minPhotos:d,maxPhotos:u,...m}=function(e,{photos:t,targetRowHeight:n,rowConstraints:r,...o}){const{spacing:i,padding:a,componentsProps:s,render:l}=ie(e,o),{singleRowMaxHeight:c,minPhotos:d,maxPhotos:u}=re(r,e)||{};if(void 0!==c&&void 0!==i&&void 0!==a){const e=Math.floor(t.reduce((e,{width:t,height:n})=>e+t/n*c+2*a,i*(t.length-1)));e>0&&(s.container={...s.container},s.container.style={maxWidth:e,...s.container.style})}return{...o,targetRowHeight:oe(n,e,[e=>e/5,e=>e/4,e=>e/3,e=>e/2]),render:l,spacing:i,padding:a,minPhotos:d,maxPhotos:u,componentsProps:s}}(a,{photos:e,...r});return p(de,{layout:"rows",ref:i,model:h(()=>void 0!==a&&void 0!==s&&void 0!==l&&void 0!==c?function(e,t,n,r,o,i,a){const s=Math.min(function(e,t,n,r){return ae(t/n/Math.min(...e.map(e=>ee(e))))+(r||0)+2}(e,r,o,i),a||1/0),l=i||1,c=e.length,d=new Array(c+1).fill(1/0),u=new Array(c+1).fill(-1);d[0]=0;for(let m=1;m<=c;m+=1)for(let i=m-l;i>=Math.max(0,m-s);i-=1){if(d[i]===1/0)continue;const a=he(e,i,m,r,t,n,o);if(void 0===a)break;const s=d[i]+a;(d[m]===1/0||d[m]>s&&(d[m]/s>1.005||-1!==u[m]&&u[m]<i))&&(d[m]=s,u[m]=i)}if(d[c]===1/0)return;const h=[];for(let m=c;0!==m;m=u[m])h.push(m);h.push(0),h.reverse();const p=[];for(let m=1;m<h.length;m+=1){const o=e.slice(h[m-1],h[m]).map((e,t)=>({photo:e,index:h[m-1]+t})),i=ue(o.map(({photo:e})=>e),r,t,n);p.push({photos:o.map(({photo:e,index:t})=>({photo:e,index:t,width:i*ee(e),height:i}))})}return{spacing:t,padding:n,containerWidth:r,tracks:p,horizontal:!0}}(e,s,l,a,c,d,u):void 0,[e,s,l,a,c,d,u]),...m})});function fe(e,t,n,r,o,i,a){const s=[],l=a.reduce((e,t)=>e+t,0);for(let c=0;c<e.length-1;c+=1){const d=t.slice(e[c],e[c+1]).map((t,n)=>({photo:t,index:e[c]+n})),u=a.reduce((e,t,n)=>e+(i[c]-i[n])*t,0),h=(o-(e.length-2)*n-2*(e.length-1)*r-u)*a[c]/l;s.push({photos:d.map(({photo:e,index:t})=>({photo:e,index:t,width:h,height:h/ee(e)})),variables:{adjustedGaps:u,columnRatio:a[c]}})}return{tracks:s,variables:{totalRatio:l}}}function ve(e,t,n,r,o,i){const a=[],s=[];if(e.length<=i){const o=e.length>0?e.reduce((e,t)=>e+ee(t),0)/e.length:1;for(let t=0;t<i;t+=1)a[t]=2*n,s[t]=t<e.length?ee(e[t]):o;return fe(Array.from({length:i+1},(t,n)=>Math.min(n,e.length)),e,t,n,r,a,s)}const l=(c=function(e,t,n,r,o){return i=>{const a=[],s=1.5*o;let l=r/ee(e[i])+2*n;for(let c=i+1;c<e.length+1&&(a.push([c,(o-l)**2]),!(l>s||c===e.length));c+=1)l+=r/ee(e[c])+t+2*n;return a}}(e,t,n,o,(e.reduce((e,t)=>e+o/ee(t),0)+t*(e.length-i)+2*n*e.length)/i),d=i,u=0,h=e.length,function(e,t,n){const r=[n];for(let o=n,i=t;i>0;i-=1)[o]=e.get(o)[i],r.push(o);return r.reverse()}(function(e,t,n,r){const o=/* @__PURE__ */new Map,i=/* @__PURE__ */new Set;i.add(n);for(let a=0;a<t;a+=1){const n=[...i.keys()];i.clear(),n.forEach(n=>{const s=a>0?o.get(n)[a][1]:0;e(n).forEach(([e,l])=>{let c=o.get(e);c||(c=[],o.set(e,c));const d=s+l,u=c[a+1];(!u||u[1]>d&&(u[1]/d>1.0001||n<u[0]))&&(c[a+1]=[n,d]),a<t-1&&e!==r&&i.add(e)})})}return o}(c,d,u,h),d,h));var c,d,u,h;for(let p=0;p<l.length-1;p+=1){const r=e.slice(l[p],l[p+1]);a[p]=t*(r.length-1)+2*n*r.length,s[p]=1/r.reduce((e,t)=>e+1/ee(t),0)}return fe(l,e,t,n,r,a,s)}function we(e,t,n,r,o){const{tracks:i,variables:a}=ve(e,t,n,r,(r-t*(o-1)-2*n*o)/o,o);return i.some(e=>e.photos.some(({width:e,height:t})=>e<=0||t<=0))?o>1?we(e,t,n,r,o-1):void 0:{tracks:i,spacing:t,padding:n,containerWidth:r,variables:{columns:o,...a}}}var ye=l(function({photos:e,breakpoints:t,defaultContainerWidth:n,...r},o){const{containerRef:i,containerWidth:a}=me(o,t,n),{spacing:s,padding:l,columns:c,...d}=function(e,{columns:t,...n}){return{...n,...ie(e,n),columns:oe(t,e,[5,4,3,2],1)}}(a,{photos:e,...r});return p(de,{layout:"columns",ref:i,model:h(()=>void 0!==a&&void 0!==s&&void 0!==l&&void 0!==c?we(e,s,l,a,c):void 0,[e,s,l,a,c]),...d})});function be(e,t,n,r,o){const i=(r-t*(o-1)-2*n*o)/o;if(i<=0)return o>1?be(e,t,n,r,o-1):void 0;const a=[];for(let l=0;l<o;l+=1)a[l]=0;const s=e.reduce((e,r,o)=>{const s=a.reduce((e,t,n)=>t<a[e]-1?n:e,0);return a[s]=a[s]+i/ee(r)+t+2*n,e[s].push({photo:r,index:o}),e},Array.from({length:o},()=>[]));return{spacing:t,padding:n,containerWidth:r,variables:{columns:o},tracks:s.map(e=>({photos:e.map(({photo:e,index:t})=>({photo:e,index:t,width:i,height:i/ee(e)}))}))}}var xe=l(function({photos:e,breakpoints:t,defaultContainerWidth:n,...r},o){const{containerRef:i,containerWidth:a}=me(o,t,n),{spacing:s,padding:l,columns:c,...d}=function(e,{columns:t,...n}){return{...n,...ie(e,n),columns:oe(t,e,[5,4,3,2],1)}}(a,{photos:e,...r});return p(de,{layout:"masonry",ref:i,model:h(()=>void 0!==a&&void 0!==s&&void 0!==l&&void 0!==c?be(e,s,l,a,c):void 0,[e,s,l,a,c]),...d})}),Ne="__qrati_photoswipe",ke=class{active=!1;closingByBackButton=!1;previousState;previousUrl="";getPhotoSwipe;constructor(e){this.getPhotoSwipe=e}open(){if(this.active)return;this.active=!0,this.previousState=window.history.state,this.previousUrl=window.location.href;const e=this.previousState&&"object"==typeof this.previousState?{...this.previousState,[Ne]:!0}:{[Ne]:!0};window.history.pushState(e,document.title,this.previousUrl),window.addEventListener("popstate",this.handlePopState)}close(){if(!this.active)return;const e=this.closingByBackButton;this.cleanup(),e||window.history.back()}destroy(){this.active&&window.history.state?.[Ne]&&window.history.replaceState(this.previousState,document.title,this.previousUrl),this.cleanup()}handlePopState=()=>{this.active&&(this.closingByBackButton=!0,this.getPhotoSwipe()?.close?.())};cleanup(){this.active=!1,this.closingByBackButton=!1,this.previousState=void 0,this.previousUrl="",window.removeEventListener("popstate",this.handlePopState)}},Te={[String(q.NONE)]:function({className:e}){/* @__PURE__ */
2
- return p("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__ */p("path",{fill:"currentColor",d:"M5 21q-.825 0-1.412-.587T3 19V5q0-.825.588-1.412T5 3h14q.825 0 1.413.588T21 5v14q0 .825-.587 1.413T19 21zm0-2h14V5H5z"})})},[q.LINK]:function({className:e}){/* @__PURE__ */
3
- return p("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__ */p("path",{fill:"currentColor",d:"M7.95 21q-2.05 0-3.5-1.45T3 16.05q0-1 .375-1.9t1.075-1.6l2.625-2.625q.3-.3.713-.3t.712.3t.3.7t-.3.7l-2.65 2.65q-.425.425-.637.963T5 16.05q0 1.225.863 2.088T7.95 19q.575 0 1.125-.213t.975-.637l2.625-2.65q.3-.275.7-.275t.7.3t.3.7t-.3.7L11.45 19.55q-.7.7-1.6 1.075T7.95 21m1.25-6.2q-.3-.3-.3-.712t.3-.713L13.375 9.2q.3-.3.713-.3t.712.3t.3.713t-.3.712L10.625 14.8q-.3.3-.712.3t-.713-.3m6.3-.725q-.3-.3-.3-.7t.3-.7l2.65-2.625q.425-.425.625-.95t.2-1.1q0-1.25-.85-2.125T16.025 5q-.575 0-1.112.213t-.963.637L11.325 8.5q-.3.3-.7.3t-.7-.3t-.3-.712t.3-.713L12.55 4.45q.7-.7 1.6-1.075T16.05 3q2.05 0 3.488 1.45t1.437 3.525q0 .975-.363 1.875t-1.062 1.6l-2.625 2.625q-.3.3-.712.3t-.713-.3"})})},[q.EMAIL]:function({className:e}){/* @__PURE__ */
4
- return p("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__ */p("path",{fill:"currentColor",d:"M12 22q-2.075 0-3.9-.788t-3.175-2.137T2.788 15.9T2 12t.788-3.9t2.137-3.175T8.1 2.788T12 2t3.9.788t3.175 2.137T21.213 8.1T22 12v1.45q0 1.475-1.012 2.513T18.5 17q-.875 0-1.65-.375t-1.3-1.075q-.725.725-1.638 1.088T12 17q-2.075 0-3.537-1.463T7 12t1.463-3.537T12 7t3.538 1.463T17 12v1.45q0 .65.425 1.1T18.5 15t1.075-.45t.425-1.1V12q0-3.35-2.325-5.675T12 4T6.325 6.325T4 12t2.325 5.675T12 20h4q.425 0 .713.288T17 21t-.288.713T16 22zm2.125-7.875Q15 13.25 15 12t-.875-2.125T12 9t-2.125.875T9 12t.875 2.125T12 15t2.125-.875"})})},[q.PHONE]:function({className:e}){/* @__PURE__ */
5
- return p("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__ */p("path",{fill:"currentColor",d:"M19.95 21q-3.125 0-6.175-1.362t-5.55-3.863t-3.862-5.55T3 4.05q0-.45.3-.75t.75-.3H8.1q.35 0 .625.238t.325.562l.65 3.5q.05.4-.025.675T9.4 8.45L6.975 10.9q.5.925 1.187 1.787t1.513 1.663q.775.775 1.625 1.438T13.1 17l2.35-2.35q.225-.225.588-.337t.712-.063l3.45.7q.35.1.575.363T21 15.9v4.05q0 .45-.3.75t-.75.3M6.025 9l1.65-1.65L7.25 5H5.025q.125 1.025.35 2.025T6.025 9m8.95 8.95q.975.425 1.988.675T19 18.95v-2.2l-2.35-.475zm0 0"})})},[q.SMS]:function({className:e}){/* @__PURE__ */
6
- return p("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__ */p("path",{fill:"currentColor",d:"m6 18l-2.3 2.3q-.475.475-1.088.213T2 19.575V4q0-.825.588-1.412T4 2h16q.825 0 1.413.588T22 4v12q0 .825-.587 1.413T20 18zm-.85-2H20V4H4v13.125zM4 16V4zm4.713-5.288Q9 10.425 9 10t-.288-.712T8 9t-.712.288T7 10t.288.713T8 11t.713-.288m4 0Q13 10.426 13 10t-.288-.712T12 9t-.712.288T11 10t.288.713T12 11t.713-.288m4 0Q17 10.426 17 10t-.288-.712T16 9t-.712.288T15 10t.288.713T16 11t.713-.288"})})},[q.WHATSAPP]:function({className:e}){/* @__PURE__ */
1
+ import{D as e,E as t,T as n,_ as r,b as o,f as i,g as a,h as s,i as l,m as c,n as d,o as u,p as h,t as p,v as m,w as g,y as f}from"./BXMw4kNf.js";import{a as v,f as w,i as y,n as b}from"./CdivXyOP.js";import{t as x}from"./CS8uERGc.js";import{t as N}from"./DmpmrPE5.js";import{S as k,_ as T,c as C,f as I,g as E,i as q,r as M,x as A}from"./Bb9ydqSB.js";import{f as L,l as S,n as _,t as z,u as j}from"./BK_hWmGs.js";import{t as P}from"./cBUXG_uS.js";import{n as O}from"./QxKjlE-j.js";import{t as R}from"./Bki5T_lb.js";import{n as U,r as $,t as F}from"./BuhJHzFX.js";import{n as G}from"./CXRH3zmy.js";import{t as B}from"./DKxH7j1t2.js";import{n as V,t as D}from"./7IEzYICH2.js";import{a as W,i as H,n as K,o as Q,r as Y,s as Z,t as J}from"./Be3fjihP2.js";import{a as X,n as ee,o as te,r as ne,t as re}from"./BrDFXZq12.js";function oe(e){return["react-photo-album",e].filter(Boolean).join("--")}function ie({width:e,height:t}){const n=e/t;return Number.isFinite(n)?n:1}var ae=Object.freeze([1200,600,300,0]);function se(e,t){return"function"==typeof e?e(t):e}function le(e,t){return void 0!==t?se(e,t):void 0}function ce(e,t,n,r=0){if(void 0===t)return;const o=le(e,t);return Math.round(Math.max(void 0===o?function(e,t){const n=ae.findIndex(e=>e<=t);return se(e[Math.max(n,0)],t)}(n,t):o,r))}function de(e,{spacing:t,padding:n,componentsProps:r,render:o}){return{spacing:ce(t,e,[20,15,10,5]),padding:ce(n,e,[0,0,0,0]),componentsProps:se(r,e)||{},render:se(o,e)}}function ue(e,t=0){const n=10**t;return Math.round((e+Number.EPSILON)*n)/n}function he(e,t,n,r,o,i,a){let s,l;const c=e=>{const t=i*(o-1)+2*a*o;return`calc((${e.match(/^\s*calc\((.*)\)\s*$/)?.[1]??e} - ${t}px) / ${ue((r-t)/n,5)})`},d=e.srcSet;return d&&d.length>0&&(s=d.concat(d.some(({width:t})=>t===e.width)?[]:[{src:e.src,width:e.width,height:e.height}]).sort((e,t)=>e.width-t.width).map(e=>`${e.src} ${e.width}w`).join(", ")),l=t?.size?(t.sizes||[]).map(({viewport:e,size:t})=>`${e} ${c(t)}`).concat(c(t.size)).join(", "):`${Math.ceil(n/r*100)}vw`,{srcSet:s,sizes:l}}var pe=l(function({as:e,render:t,context:n,classes:r=[],variables:o={},style:i,className:a,children:s,...l},c){const d=function(...e){return e.filter(Boolean).join(" ")}(...(Array.isArray(r)?r:[r]).filter(e=>"string"==typeof e).map(oe),a),u={style:{...Object.fromEntries(Object.entries(o).map(([e,t])=>{return[(n=e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),`--${oe(n)}`),"number"==typeof t?ue(t,5):t];var n})),...i},className:d,children:s,...l};if(t){const e=t({ref:c,...u},n);if(e)return e}return p(e||"div",{ref:c,...u})}),me=l(function({photo:e,index:t,width:n,height:r,onClick:o,render:{wrapper:i,link:a,button:s,image:l,extras:c}={},componentsProps:{link:d,button:u,wrapper:h,image:m}={}},g){const{href:f}=e,v={photo:e,index:t,width:ue(n,3),height:ue(r,3)};let w;return w=f?{...d,as:"a",render:a,classes:["photo","link"],href:f,onClick:o}:o?{...u,as:"button",type:"button",render:s,classes:["photo","button"],onClick:o}:{...h,render:i,classes:"photo"},p(pe,{ref:g,variables:{photoWidth:v.width,photoHeight:v.height},context:v,...w,children:[p(pe,{as:"img",classes:"image",render:l,context:v,...m}),c?.({},v)]})}),ge=l(function({layout:t,sizes:n,model:r,skeleton:o,onClick:i,render:{container:a,track:s,photo:l,...c}={},componentsProps:{container:d,track:u,link:h,button:m,wrapper:g,image:f}={}},v){const{spacing:w,padding:y,containerWidth:b,tracks:x,variables:N,horizontal:k}=r||{};return p(pe,{role:"group","aria-label":"Photo album",...d,variables:{spacing:w,padding:y,containerWidth:b,...N},classes:["",t],render:a,ref:v,children:[void 0!==w&&void 0!==y&&void 0!==b&&x?.map(({photos:t,variables:r},o)=>{const a=t.length,d=k?a:x.length;return e(pe,{...u,key:o,render:s,classes:"track",variables:{trackSize:a,...r}},t.map(e=>{const{photo:t,index:r,width:o}=e,{key:a,src:s,alt:u="",title:v,label:x}=t,N=i?e=>{i({event:e,photo:t,index:r})}:void 0;if(l){const t=l({onClick:N},e);if(t)return t}const k=e=>x?{"aria-label":x,...e}:e;return p(me,{onClick:N,render:c,componentsProps:{image:{loading:"lazy",decoding:"async",src:s,alt:u,title:v,...he(t,n,o,b,d,w,y),...se(f,e)},link:k(se(h,e)),button:k(se(m,e)),wrapper:se(g,e)},...e},a??r)}))}),void 0===b&&o]})});function fe(e,t,n,r){return(t-(e.length-1)*n-2*r*e.length)/e.reduce((e,t)=>e+ie(t),0)}function ve(e,t,n,r,o,i,a){const s=e.slice(t,n),l=fe(s,r,o,i);return l>0?(l-a)**2*s.length:void 0}function we(e,t){const[n,r]=e;if(n===t)return e;if(void 0!==r&&void 0!==t&&void 0!==n&&t===r&&Math.abs(t-n)<=20){const o=Math.min(n,t),i=Math.max(n,t);return o===n&&i===r?e:[o,i]}return[t,n]}function ye(e,t,n){const[[r],a]=o(we,[n]),l=function(e){const[t,n]=s(e);return e===t||e&&t&&e.length===t.length&&!e.some((e,n)=>e!==t[n])?t:(n(e),e)}(t),c=i(void 0);return{containerRef:m(t=>{c.current?.disconnect(),c.current=void 0;const n=()=>a(function(e,t){let n=e?.clientWidth;if(void 0!==n&&t&&t.length>0){const e=[...t.filter(e=>e>0)].sort((e,t)=>t-e);e.push(Math.floor(e[e.length-1]/2)),n=e.find((t,r)=>t<=n||r===e.length-1)}return n}(t,l));n(),t&&"undefined"!=typeof ResizeObserver&&(c.current=new ResizeObserver(n),c.current.observe(t)),"function"==typeof e?e(t):e&&(e.current=t)},[e,l]),containerWidth:r}}var be=l(function({photos:e,breakpoints:t,defaultContainerWidth:n,...r},o){const{containerRef:i,containerWidth:a}=ye(o,t,n),{spacing:s,padding:l,targetRowHeight:c,minPhotos:d,maxPhotos:u,...m}=function(e,{photos:t,targetRowHeight:n,rowConstraints:r,...o}){const{spacing:i,padding:a,componentsProps:s,render:l}=de(e,o),{singleRowMaxHeight:c,minPhotos:d,maxPhotos:u}=le(r,e)||{};if(void 0!==c&&void 0!==i&&void 0!==a){const e=Math.floor(t.reduce((e,{width:t,height:n})=>e+t/n*c+2*a,i*(t.length-1)));e>0&&(s.container={...s.container},s.container.style={maxWidth:e,...s.container.style})}return{...o,targetRowHeight:ce(n,e,[e=>e/5,e=>e/4,e=>e/3,e=>e/2]),render:l,spacing:i,padding:a,minPhotos:d,maxPhotos:u,componentsProps:s}}(a,{photos:e,...r});return p(ge,{layout:"rows",ref:i,model:h(()=>void 0!==a&&void 0!==s&&void 0!==l&&void 0!==c?function(e,t,n,r,o,i,a){const s=Math.min(function(e,t,n,r){return ue(t/n/Math.min(...e.map(e=>ie(e))))+(r||0)+2}(e,r,o,i),a||1/0),l=i||1,c=e.length,d=new Array(c+1).fill(1/0),u=new Array(c+1).fill(-1);d[0]=0;for(let m=1;m<=c;m+=1)for(let i=m-l;i>=Math.max(0,m-s);i-=1){if(d[i]===1/0)continue;const a=ve(e,i,m,r,t,n,o);if(void 0===a)break;const s=d[i]+a;(d[m]===1/0||d[m]>s&&(d[m]/s>1.005||-1!==u[m]&&u[m]<i))&&(d[m]=s,u[m]=i)}if(d[c]===1/0)return;const h=[];for(let m=c;0!==m;m=u[m])h.push(m);h.push(0),h.reverse();const p=[];for(let m=1;m<h.length;m+=1){const o=e.slice(h[m-1],h[m]).map((e,t)=>({photo:e,index:h[m-1]+t})),i=fe(o.map(({photo:e})=>e),r,t,n);p.push({photos:o.map(({photo:e,index:t})=>({photo:e,index:t,width:i*ie(e),height:i}))})}return{spacing:t,padding:n,containerWidth:r,tracks:p,horizontal:!0}}(e,s,l,a,c,d,u):void 0,[e,s,l,a,c,d,u]),...m})});function xe(e,t,n,r,o,i,a){const s=[],l=a.reduce((e,t)=>e+t,0);for(let c=0;c<e.length-1;c+=1){const d=t.slice(e[c],e[c+1]).map((t,n)=>({photo:t,index:e[c]+n})),u=a.reduce((e,t,n)=>e+(i[c]-i[n])*t,0),h=(o-(e.length-2)*n-2*(e.length-1)*r-u)*a[c]/l;s.push({photos:d.map(({photo:e,index:t})=>({photo:e,index:t,width:h,height:h/ie(e)})),variables:{adjustedGaps:u,columnRatio:a[c]}})}return{tracks:s,variables:{totalRatio:l}}}function Ne(e,t,n,r,o,i){const a=[],s=[];if(e.length<=i){const o=e.length>0?e.reduce((e,t)=>e+ie(t),0)/e.length:1;for(let t=0;t<i;t+=1)a[t]=2*n,s[t]=t<e.length?ie(e[t]):o;return xe(Array.from({length:i+1},(t,n)=>Math.min(n,e.length)),e,t,n,r,a,s)}const l=(c=function(e,t,n,r,o){return i=>{const a=[],s=1.5*o;let l=r/ie(e[i])+2*n;for(let c=i+1;c<e.length+1&&(a.push([c,(o-l)**2]),!(l>s||c===e.length));c+=1)l+=r/ie(e[c])+t+2*n;return a}}(e,t,n,o,(e.reduce((e,t)=>e+o/ie(t),0)+t*(e.length-i)+2*n*e.length)/i),d=i,u=0,h=e.length,function(e,t,n){const r=[n];for(let o=n,i=t;i>0;i-=1)[o]=e.get(o)[i],r.push(o);return r.reverse()}(function(e,t,n,r){const o=/* @__PURE__ */new Map,i=/* @__PURE__ */new Set;i.add(n);for(let a=0;a<t;a+=1){const n=[...i.keys()];i.clear(),n.forEach(n=>{const s=a>0?o.get(n)[a][1]:0;e(n).forEach(([e,l])=>{let c=o.get(e);c||(c=[],o.set(e,c));const d=s+l,u=c[a+1];(!u||u[1]>d&&(u[1]/d>1.0001||n<u[0]))&&(c[a+1]=[n,d]),a<t-1&&e!==r&&i.add(e)})})}return o}(c,d,u,h),d,h));var c,d,u,h;for(let p=0;p<l.length-1;p+=1){const r=e.slice(l[p],l[p+1]);a[p]=t*(r.length-1)+2*n*r.length,s[p]=1/r.reduce((e,t)=>e+1/ie(t),0)}return xe(l,e,t,n,r,a,s)}function ke(e,t,n,r,o){const{tracks:i,variables:a}=Ne(e,t,n,r,(r-t*(o-1)-2*n*o)/o,o);return i.some(e=>e.photos.some(({width:e,height:t})=>e<=0||t<=0))?o>1?ke(e,t,n,r,o-1):void 0:{tracks:i,spacing:t,padding:n,containerWidth:r,variables:{columns:o,...a}}}var Te=l(function({photos:e,breakpoints:t,defaultContainerWidth:n,...r},o){const{containerRef:i,containerWidth:a}=ye(o,t,n),{spacing:s,padding:l,columns:c,...d}=function(e,{columns:t,...n}){return{...n,...de(e,n),columns:ce(t,e,[5,4,3,2],1)}}(a,{photos:e,...r});return p(ge,{layout:"columns",ref:i,model:h(()=>void 0!==a&&void 0!==s&&void 0!==l&&void 0!==c?ke(e,s,l,a,c):void 0,[e,s,l,a,c]),...d})});function Ce(e,t,n,r,o){const i=(r-t*(o-1)-2*n*o)/o;if(i<=0)return o>1?Ce(e,t,n,r,o-1):void 0;const a=[];for(let l=0;l<o;l+=1)a[l]=0;const s=e.reduce((e,r,o)=>{const s=a.reduce((e,t,n)=>t<a[e]-1?n:e,0);return a[s]=a[s]+i/ie(r)+t+2*n,e[s].push({photo:r,index:o}),e},Array.from({length:o},()=>[]));return{spacing:t,padding:n,containerWidth:r,variables:{columns:o},tracks:s.map(e=>({photos:e.map(({photo:e,index:t})=>({photo:e,index:t,width:i,height:i/ie(e)}))}))}}var Ie=l(function({photos:e,breakpoints:t,defaultContainerWidth:n,...r},o){const{containerRef:i,containerWidth:a}=ye(o,t,n),{spacing:s,padding:l,columns:c,...d}=function(e,{columns:t,...n}){return{...n,...de(e,n),columns:ce(t,e,[5,4,3,2],1)}}(a,{photos:e,...r});return p(ge,{layout:"masonry",ref:i,model:h(()=>void 0!==a&&void 0!==s&&void 0!==l&&void 0!==c?Ce(e,s,l,a,c):void 0,[e,s,l,a,c]),...d})}),Ee={[String(M.NONE)]:function({className:e}){/* @__PURE__ */
2
+ return p("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__ */p("path",{fill:"currentColor",d:"M5 21q-.825 0-1.412-.587T3 19V5q0-.825.588-1.412T5 3h14q.825 0 1.413.588T21 5v14q0 .825-.587 1.413T19 21zm0-2h14V5H5z"})})},[M.LINK]:function({className:e}){/* @__PURE__ */
3
+ return p("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__ */p("path",{fill:"currentColor",d:"M7.95 21q-2.05 0-3.5-1.45T3 16.05q0-1 .375-1.9t1.075-1.6l2.625-2.625q.3-.3.713-.3t.712.3t.3.7t-.3.7l-2.65 2.65q-.425.425-.637.963T5 16.05q0 1.225.863 2.088T7.95 19q.575 0 1.125-.213t.975-.637l2.625-2.65q.3-.275.7-.275t.7.3t.3.7t-.3.7L11.45 19.55q-.7.7-1.6 1.075T7.95 21m1.25-6.2q-.3-.3-.3-.712t.3-.713L13.375 9.2q.3-.3.713-.3t.712.3t.3.713t-.3.712L10.625 14.8q-.3.3-.712.3t-.713-.3m6.3-.725q-.3-.3-.3-.7t.3-.7l2.65-2.625q.425-.425.625-.95t.2-1.1q0-1.25-.85-2.125T16.025 5q-.575 0-1.112.213t-.963.637L11.325 8.5q-.3.3-.7.3t-.7-.3t-.3-.712t.3-.713L12.55 4.45q.7-.7 1.6-1.075T16.05 3q2.05 0 3.488 1.45t1.437 3.525q0 .975-.363 1.875t-1.062 1.6l-2.625 2.625q-.3.3-.712.3t-.713-.3"})})},[M.EMAIL]:function({className:e}){/* @__PURE__ */
4
+ return p("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__ */p("path",{fill:"currentColor",d:"M12 22q-2.075 0-3.9-.788t-3.175-2.137T2.788 15.9T2 12t.788-3.9t2.137-3.175T8.1 2.788T12 2t3.9.788t3.175 2.137T21.213 8.1T22 12v1.45q0 1.475-1.012 2.513T18.5 17q-.875 0-1.65-.375t-1.3-1.075q-.725.725-1.638 1.088T12 17q-2.075 0-3.537-1.463T7 12t1.463-3.537T12 7t3.538 1.463T17 12v1.45q0 .65.425 1.1T18.5 15t1.075-.45t.425-1.1V12q0-3.35-2.325-5.675T12 4T6.325 6.325T4 12t2.325 5.675T12 20h4q.425 0 .713.288T17 21t-.288.713T16 22zm2.125-7.875Q15 13.25 15 12t-.875-2.125T12 9t-2.125.875T9 12t.875 2.125T12 15t2.125-.875"})})},[M.PHONE]:function({className:e}){/* @__PURE__ */
5
+ return p("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__ */p("path",{fill:"currentColor",d:"M19.95 21q-3.125 0-6.175-1.362t-5.55-3.863t-3.862-5.55T3 4.05q0-.45.3-.75t.75-.3H8.1q.35 0 .625.238t.325.562l.65 3.5q.05.4-.025.675T9.4 8.45L6.975 10.9q.5.925 1.187 1.787t1.513 1.663q.775.775 1.625 1.438T13.1 17l2.35-2.35q.225-.225.588-.337t.712-.063l3.45.7q.35.1.575.363T21 15.9v4.05q0 .45-.3.75t-.75.3M6.025 9l1.65-1.65L7.25 5H5.025q.125 1.025.35 2.025T6.025 9m8.95 8.95q.975.425 1.988.675T19 18.95v-2.2l-2.35-.475zm0 0"})})},[M.SMS]:function({className:e}){/* @__PURE__ */
6
+ return p("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__ */p("path",{fill:"currentColor",d:"m6 18l-2.3 2.3q-.475.475-1.088.213T2 19.575V4q0-.825.588-1.412T4 2h16q.825 0 1.413.588T22 4v12q0 .825-.587 1.413T20 18zm-.85-2H20V4H4v13.125zM4 16V4zm4.713-5.288Q9 10.425 9 10t-.288-.712T8 9t-.712.288T7 10t.288.713T8 11t.713-.288m4 0Q13 10.426 13 10t-.288-.712T12 9t-.712.288T11 10t.288.713T12 11t.713-.288m4 0Q17 10.426 17 10t-.288-.712T16 9t-.712.288T15 10t.288.713T16 11t.713-.288"})})},[M.WHATSAPP]:function({className:e}){/* @__PURE__ */
7
7
  return p("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 256 258",className:e,"aria-hidden":"true",focusable:"false",children:[
8
8
  /* @__PURE__ */p("defs",{children:[/* @__PURE__ */p("linearGradient",{id:"SVGK3KZq49U",x1:"50%",x2:"50%",y1:"100%",y2:"0%",children:[/* @__PURE__ */p("stop",{offset:"0%","stop-color":"#1faf38"}),/* @__PURE__ */p("stop",{offset:"100%","stop-color":"#60d669"})]}),/* @__PURE__ */p("linearGradient",{id:"SVGefMkoEOd",x1:"50%",x2:"50%",y1:"100%",y2:"0%",children:[/* @__PURE__ */p("stop",{offset:"0%","stop-color":"#f9f9f9"}),/* @__PURE__ */p("stop",{offset:"100%","stop-color":"#fff"})]})]}),
9
9
  /* @__PURE__ */p("path",{fill:"url(#SVGK3KZq49U)",d:"M5.463 127.456c-.006 21.677 5.658 42.843 16.428 61.499L4.433 252.697l65.232-17.104a123 123 0 0 0 58.8 14.97h.054c67.815 0 123.018-55.183 123.047-123.01c.013-32.867-12.775-63.773-36.009-87.025c-23.23-23.25-54.125-36.061-87.043-36.076c-67.823 0-123.022 55.18-123.05 123.004"}),
10
10
  /* @__PURE__ */p("path",{fill:"url(#SVGefMkoEOd)",d:"M1.07 127.416c-.007 22.457 5.86 44.38 17.014 63.704L0 257.147l67.571-17.717c18.618 10.151 39.58 15.503 60.91 15.511h.055c70.248 0 127.434-57.168 127.464-127.423c.012-34.048-13.236-66.065-37.3-90.15C194.633 13.286 162.633.014 128.536 0C58.276 0 1.099 57.16 1.071 127.416m40.24 60.376l-2.523-4.005c-10.606-16.864-16.204-36.352-16.196-56.363C22.614 69.029 70.138 21.52 128.576 21.52c28.3.012 54.896 11.044 74.9 31.06c20.003 20.018 31.01 46.628 31.003 74.93c-.026 58.395-47.551 105.91-105.943 105.91h-.042c-19.013-.01-37.66-5.116-53.922-14.765l-3.87-2.295l-40.098 10.513z"}),
11
- /* @__PURE__ */p("path",{fill:"#fff",d:"M96.678 74.148c-2.386-5.303-4.897-5.41-7.166-5.503c-1.858-.08-3.982-.074-6.104-.074c-2.124 0-5.575.799-8.492 3.984c-2.92 3.188-11.148 10.892-11.148 26.561s11.413 30.813 13.004 32.94c1.593 2.123 22.033 35.307 54.405 48.073c26.904 10.609 32.379 8.499 38.218 7.967c5.84-.53 18.844-7.702 21.497-15.139c2.655-7.436 2.655-13.81 1.859-15.142c-.796-1.327-2.92-2.124-6.105-3.716s-18.844-9.298-21.763-10.361c-2.92-1.062-5.043-1.592-7.167 1.597c-2.124 3.184-8.223 10.356-10.082 12.48c-1.857 2.129-3.716 2.394-6.9.801c-3.187-1.598-13.444-4.957-25.613-15.806c-9.468-8.442-15.86-18.867-17.718-22.056c-1.858-3.184-.199-4.91 1.398-6.497c1.431-1.427 3.186-3.719 4.78-5.578c1.588-1.86 2.118-3.187 3.18-5.311c1.063-2.126.531-3.986-.264-5.579c-.798-1.593-6.987-17.343-9.819-23.64"})]})},[q.MESSENGER]:function({className:e}){/* @__PURE__ */
11
+ /* @__PURE__ */p("path",{fill:"#fff",d:"M96.678 74.148c-2.386-5.303-4.897-5.41-7.166-5.503c-1.858-.08-3.982-.074-6.104-.074c-2.124 0-5.575.799-8.492 3.984c-2.92 3.188-11.148 10.892-11.148 26.561s11.413 30.813 13.004 32.94c1.593 2.123 22.033 35.307 54.405 48.073c26.904 10.609 32.379 8.499 38.218 7.967c5.84-.53 18.844-7.702 21.497-15.139c2.655-7.436 2.655-13.81 1.859-15.142c-.796-1.327-2.92-2.124-6.105-3.716s-18.844-9.298-21.763-10.361c-2.92-1.062-5.043-1.592-7.167 1.597c-2.124 3.184-8.223 10.356-10.082 12.48c-1.857 2.129-3.716 2.394-6.9.801c-3.187-1.598-13.444-4.957-25.613-15.806c-9.468-8.442-15.86-18.867-17.718-22.056c-1.858-3.184-.199-4.91 1.398-6.497c1.431-1.427 3.186-3.719 4.78-5.578c1.588-1.86 2.118-3.187 3.18-5.311c1.063-2.126.531-3.986-.264-5.579c-.798-1.593-6.987-17.343-9.819-23.64"})]})},[M.MESSENGER]:function({className:e}){/* @__PURE__ */
12
12
  return p("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 256 256",className:e,"aria-hidden":"true",focusable:"false",children:[
13
13
  /* @__PURE__ */p("defs",{children:/* @__PURE__ */p("radialGradient",{id:"SVGhphmYc3G",cx:"19.247%",cy:"99.465%",r:"108.96%",fx:"19.247%",fy:"99.465%",children:[
14
14
  /* @__PURE__ */p("stop",{offset:"0%","stop-color":"#09f"}),
@@ -16,21 +16,21 @@ return p("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",view
16
16
  /* @__PURE__ */p("stop",{offset:"93.482%","stop-color":"#ff5280"}),
17
17
  /* @__PURE__ */p("stop",{offset:"100%","stop-color":"#ff7061"})]})}),
18
18
  /* @__PURE__ */p("path",{fill:"url(#SVGhphmYc3G)",d:"M128 0C55.894 0 0 52.818 0 124.16c0 37.317 15.293 69.562 40.2 91.835c2.09 1.871 3.352 4.493 3.438 7.298l.697 22.77c.223 7.262 7.724 11.988 14.37 9.054L84.111 243.9a10.22 10.22 0 0 1 6.837-.501c11.675 3.21 24.1 4.92 37.052 4.92c72.106 0 128-52.818 128-124.16S200.106 0 128 0"}),
19
- /* @__PURE__ */p("path",{fill:"#fff",d:"m51.137 160.47l37.6-59.653c5.98-9.49 18.788-11.853 27.762-5.123l29.905 22.43a7.68 7.68 0 0 0 9.252-.027l40.388-30.652c5.39-4.091 12.428 2.36 8.82 8.085l-37.6 59.654c-5.981 9.489-18.79 11.852-27.763 5.122l-29.906-22.43a7.68 7.68 0 0 0-9.25.027l-40.39 30.652c-5.39 4.09-12.427-2.36-8.818-8.085"})]})}},Ce=({open:e,ad:t,onClose:n,captureAdClick:r})=>{const o=Boolean(t?.targetType&&t.targetType!==q.NONE),i=Te[t?.targetType]??Te[q.LINK],a=t?.imageUrl&&z(t.imageUrl,["http:","https:"])?t.imageUrl:void 0;/* @__PURE__ */
20
- return p(J,{open:Boolean(e&&t),onOpenChange:e=>!e&&n?.(),children:/* @__PURE__ */p(Q,{className:"border-none p-0",children:[/* @__PURE__ */p(K,{className:"sr-only",children:[/* @__PURE__ */p(Y,{children:t?.title}),/* @__PURE__ */p(Z,{children:t?.description})]}),/* @__PURE__ */p("div",{className:"flex max-w-2xl flex-col overflow-hidden",children:[a&&/* @__PURE__ */p("img",{className:"h-auto w-full object-contain sm:max-h-96",src:a,alt:t?.title||"Advertisement"}),
21
- /* @__PURE__ */p("div",{className:"flex flex-col gap-2 p-3",children:[/* @__PURE__ */p(A,{variant:"h4",align:"center",lines:2,children:t?.title}),/* @__PURE__ */p(A,{variant:"body3",color:"secondary",align:"center",lines:4,children:t?.description})]}),o&&/* @__PURE__ */p(U,{fullWidth:!0,className:"rounded-none",onClick:()=>{r?.(t?._id,t?.targetType??q.LINK,t?.targetUrl),n?.()},icon:/* @__PURE__ */p(i,{className:"size-5"}),children:t?.targetText})]})]})})};function Ie(e,t){if(e.content?._id!==t.content?._id)return!1;if(e.style?.width!==t.style?.width||e.style?.height!==t.style?.height)return!1;for(const n of Object.keys(e))if("content"!==n&&"style"!==n&&e[n]!==t[n])return!1;return!0}var Se=u(({style:e,content:t,curateLink:n,onAdClick:r,hideControls:o})=>{const{captureAdImpression:i,captureAdEngagement:a,captureAdClick:s}=G(),l=Boolean(n&&r),c=t.ctaBg||"#ff4800",d=t.ctaForeground||"#FFFFFF",u=Te[t?.targetType??q.LINK];/* @__PURE__ */
19
+ /* @__PURE__ */p("path",{fill:"#fff",d:"m51.137 160.47l37.6-59.653c5.98-9.49 18.788-11.853 27.762-5.123l29.905 22.43a7.68 7.68 0 0 0 9.252-.027l40.388-30.652c5.39-4.091 12.428 2.36 8.82 8.085l-37.6 59.654c-5.981 9.489-18.79 11.852-27.763 5.122l-29.906-22.43a7.68 7.68 0 0 0-9.25.027l-40.39 30.652c-5.39 4.09-12.427-2.36-8.818-8.085"})]})}},qe=({open:e,ad:t,onClose:n,captureAdClick:r})=>{const o=Boolean(t?.targetType&&t.targetType!==M.NONE),i=Ee[t?.targetType]??Ee[M.LINK],a=t?.imageUrl&&R(t.imageUrl,["http:","https:"])?t.imageUrl:void 0;/* @__PURE__ */
20
+ return p(re,{open:Boolean(e&&t),onOpenChange:e=>!e&&n?.(),children:/* @__PURE__ */p(ee,{className:"border-none p-0",children:[/* @__PURE__ */p(X,{className:"sr-only",children:[/* @__PURE__ */p(te,{children:t?.title}),/* @__PURE__ */p(ne,{children:t?.description})]}),/* @__PURE__ */p("div",{className:"flex max-w-2xl flex-col overflow-hidden",children:[a&&/* @__PURE__ */p("img",{className:"h-auto w-full object-contain sm:max-h-96",src:a,alt:t?.title||"Advertisement"}),
21
+ /* @__PURE__ */p("div",{className:"flex flex-col gap-2 p-3",children:[/* @__PURE__ */p(P,{variant:"h4",align:"center",lines:2,children:t?.title}),/* @__PURE__ */p(P,{variant:"body3",color:"secondary",align:"center",lines:4,children:t?.description})]}),o&&/* @__PURE__ */p(B,{fullWidth:!0,className:"rounded-none",onClick:()=>{r?.(t?._id,t?.targetType??M.LINK,t?.targetUrl),n?.()},icon:/* @__PURE__ */p(i,{className:"size-5"}),children:t?.targetText})]})]})})};function Me(e,t){if(e.content?._id!==t.content?._id)return!1;if(e.style?.width!==t.style?.width||e.style?.height!==t.style?.height)return!1;for(const n of Object.keys(e))if("content"!==n&&"style"!==n&&e[n]!==t[n])return!1;return!0}var Ae=u(({style:e,content:t,curateLink:n,onAdClick:r,hideControls:o})=>{const{captureAdImpression:i,captureAdEngagement:a,captureAdClick:s}=K(),l=Boolean(n&&r),c=t.ctaBg||"#ff4800",d=t.ctaForeground||"#FFFFFF",u=Ee[t?.targetType??M.LINK];/* @__PURE__ */
22
22
  return p("div",{style:e,className:"group relative mb-1 overflow-hidden rounded",children:[
23
- /* @__PURE__ */p(P,{className:"size-full",threshold:.8,triggerOnce:!0,onChange:e=>{e&&i(t._id)},onClick:()=>a(t._id),children:/* @__PURE__ */p(j,{url:t.src||t.imageUrl,thumbnailUrl:t.src||t.imageUrl,blurhash:t.blurhash,alt:t.caption,onClick:l?()=>r?.(t):void 0,pswpData:{id:t._id,type:C.AD,hash:t._id,width:t.width,height:t.height,title:t.title,description:t.description,targetType:t.targetType,targetText:t.targetText,targetUrl:t.targetUrl,thumbnailUrl:t.imageUrl,blurhash:t.blurhash}})}),
24
- /* @__PURE__ */p("span",{className:"bg-background/70 absolute top-1 right-1 rounded px-1 text-xs font-medium",children:"Ad"}),!o&&(t.title||t.targetType!==q.NONE)&&/* @__PURE__ */p("div",{className:"absolute bottom-0 flex w-full flex-col lg:opacity-0 lg:transition-opacity lg:group-hover:opacity-100",children:[t.title&&/* @__PURE__ */p("div",{className:"bg-background/60 px-3 py-1",children:/* @__PURE__ */p("h3",{className:"line-clamp-1 text-sm font-medium",children:t.title})}),t?.targetType!==q.NONE&&/* @__PURE__ */p("button",{type:"button",className:"flex w-full items-center justify-center gap-1 rounded-none border-0 py-2 text-nowrap sm:gap-2",style:{backgroundColor:c,color:d},onClick:()=>{l?r?.(t):s(t._id,t.targetType,t.targetUrl)},children:[/* @__PURE__ */p("span",{style:{color:d},children:/* @__PURE__ */p(u,{})}),t?.targetText]})]})]})},Ie),Ee=u(({style:e,gamConfig:t,slotIndex:n,eventId:o,organizationId:a})=>{const l=i(null),c=i(null),{trackGamAnalytics:d}=G(),[u,h]=s(!1),m=`gam-slot-${o??"ev"}-${n}`,g=Math.max(1,Math.round(e?.width||t.sizes[0]?.[0]||300)),f=Math.max(1,Math.round(e?.height||t.sizes[0]?.[1]||250)),v=i({w:g,h:f});return r(()=>{if(!u)return;let e=!1,n=null,r=null,i=null,s=null;return(async()=>{await $(),!e&&l.current&&window.googletag.cmd.push(()=>{if(e)return;D(m);const{w:u,h:h}=v.current,p=[[u,h],...t.sizes],g=window.googletag.defineSlot(t.adUnitPath,p,m)?.addService(window.googletag.pubads());if(!g)return;c.current=g,r=window.googletag.pubads(),o?g.setConfig({targeting:{qrati_event:o,...t.categories.length>0?{qrati_category:t.categories}:{}}}):t.categories.length>0&&g.setConfig({targeting:{qrati_category:t.categories}}),i=e=>{e.slot===g&&d({eventId:o,organizationId:a,type:T.GAM_IMPRESSION,creativeId:String(e.creativeId??""),lineItemId:String(e.lineItemId??""),advertiserId:String(e.advertiserId??""),isEmpty:e.isEmpty??!1})},r.addEventListener("slotRenderEnded",i),s=e=>{e.slot===g&&d({eventId:o,organizationId:a,type:T.GAM_VIEWABLE})},r.addEventListener("impressionViewable",s);const f=l.current;f&&(n=H({container:f,onClick:()=>{d({eventId:o,organizationId:a,type:T.GAM_CLICK})}}),F(),window.googletag.display(m))})})(),()=>{e=!0,n?.(),r&&"function"==typeof r.removeEventListener&&(i&&r.removeEventListener("slotRenderEnded",i),s&&r.removeEventListener("impressionViewable",s));const t=c.current;c.current=null,t&&window.googletag?.cmd?.push(()=>{window.googletag.destroySlots([t])})}},[u,o,t.adUnitPath,t.categories,a,m]),/* @__PURE__ */p("div",{style:{width:g,height:f},className:"relative overflow-hidden rounded bg-neutral-100 dark:bg-neutral-800","data-gam-slot-index":n,children:/* @__PURE__ */p(P,{className:"size-full",threshold:.1,rootMargin:"200px",triggerOnce:!0,onChange:h,children:/* @__PURE__ */p("div",{id:m,ref:l,style:{width:g,height:f},className:"gam-ad-slot"})})})},Ie),qe=(e,t)=>{if(!e||!t)return null;const n=t[e];if(!n)return null;try{const e=new Date(String(n)),t=/* @__PURE__ */new Date,r=e.getFullYear()===t.getFullYear(),o={weekday:"long",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0};return r||(o.year="numeric"),e.toLocaleString("en-US",o).replace(","," •")}catch{return null}},Me=t(null),Le=()=>{const e=f(Me);if(!e)throw new Error("Popover components must be used within a Popover");return e},_e=({children:e,className:t,open:n,onOpenChange:r})=>{const[o,l]=s(!1),c="boolean"==typeof n,d=c?n:o,u=a(),h=`popover-trigger-${u}`,m=`popover-content-${u}`,g=i(null);/* @__PURE__ */
25
- return p(Me.Provider,{value:{isOpen:d,setIsOpen:e=>{c||l(e),r?.(e)},triggerId:h,contentId:m,triggerRef:g},children:/* @__PURE__ */p("div",{"data-slot":"popover",className:y("relative inline-block",t),children:e})})},Ae=({children:e,asChild:t,className:r,onClick:o,...i})=>{const{isOpen:a,setIsOpen:s,triggerId:l,contentId:c,triggerRef:d}=Le();if(t){const t=Array.isArray(e)?e[0]:e;if(t&&t.type){const e=t.props?.className;return n(t,{ref:e=>{d.current=e},id:l,className:r?e?`${e} ${r}`:r:e,"aria-haspopup":"dialog","aria-expanded":a,"aria-controls":a?c:void 0,onClick:e=>{s(!a),t.props?.onClick?.(e)},"data-state":a?"open":"closed"})}}/* @__PURE__ */
26
- return p("button",{ref:d,id:l,type:"button","aria-haspopup":"dialog","aria-expanded":a,"aria-controls":a?c:void 0,"data-slot":"popover-trigger","data-state":a?"open":"closed",className:r,onClick:e=>{s(!a),o?.(e)},...i,children:e})},Pe=({children:e,className:t,align:n="center",side:o="top",sideOffset:a=4,...l})=>{const{isOpen:u,setIsOpen:h,contentId:m,triggerRef:g}=Le(),{organization:f,portalContainer:w}=b(),x=i(null),[N,k]=s(null);if(c(()=>{if(!u)return;const e=()=>{if(!g.current||!x.current)return;const e=g.current.getBoundingClientRect(),t=x.current.getBoundingClientRect();let r=e.left,i=e.bottom+a;"center"===n&&(r=e.left+e.width/2-t.width/2),"end"===n&&(r=e.right-t.width),"top"===o&&(i=e.top-t.height-a),"left"===o&&(r=e.left-t.width-a,i=e.top+e.height/2-t.height/2),"right"===o&&(r=e.right+a,i=e.top+e.height/2-t.height/2),"bottom"===o&&(i=e.bottom+a),k({top:i,left:r})},t=requestAnimationFrame(e);return window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),()=>{cancelAnimationFrame(t),window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0)}},[n,u,o,a,g]),r(()=>{if(!u)return;const e=e=>{const t="function"==typeof e.composedPath?e.composedPath():[],n=e.target,r=x.current&&(x.current.contains(n)||t.includes(x.current)),o=g.current&&(g.current.contains(n)||t.includes(g.current));r||o||h(!1)},t=e=>{"Escape"===e.key&&(h(!1),g.current?.focus())},n=window.setTimeout(()=>{document.addEventListener("mousedown",e)},0);return document.addEventListener("keydown",t),()=>{window.clearTimeout(n),document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)}},[u,h,g]),!u)return null;const T=/* @__PURE__ */p("div",{ref:x,id:m,role:"dialog","aria-modal":"false","data-state":u?"open":"closed",className:y("bg-background text-foreground border-border shadow-outer rounded outline-none",t),style:{position:"fixed",top:N?.top??0,left:N?.left??0,zIndex:2010,...v(f)},...l,children:e});return"undefined"!=typeof document?d(T,w??document.body):T},ze=({eventId:e,contentId:t,emojis:n=[],counts:o={},userReaction:a})=>{const{user:l,props:c,organization:d}=b(),u=c?.loginUrl,{handleReactionClick:h,isPending:m}=(()=>{const e=w(),{props:t,user:n}=b(),r=t?.organizationId,o=x({mutationFn:async({eventId:e,contentId:t,emoji:o})=>N.post(E.UPDATE_REACTION,{json:{eventId:e,contentId:t,reaction:o},headers:{"x-org-id":r,Authorization:`Bearer ${n?.token}`}}).json(),onMutate:async({eventId:t,contentId:n,emoji:r})=>{const o=[k.CONTENTS_BY_EVENT(t)];await e.cancelQueries({queryKey:o});const i=e.getQueriesData({queryKey:o});return e.setQueriesData({queryKey:o},e=>((e,t,n)=>e?.pages&&Array.isArray(e.pages)?{...e,pages:e.pages.map(e=>e.data?{...e,data:e.data.map(e=>{if(e._id!==t)return e;const r={...e.reactionCounts??{}};return e.userReaction&&e.userReaction!==n&&(r[e.userReaction]=Math.max(0,(r[e.userReaction]??1)-1)),e.userReaction===n?e:(r[n]=(r[n]??0)+1,{...e,reactionCounts:r,userReaction:n})})}:e)}:e)(e,n,r)),{previousData:i}},onError:(t,n,r)=>{r?.previousData?.forEach(([t,n])=>{e.setQueryData(t,n)}),O.error("Failed to add reaction"),console.error("Error handling reaction click:",t,n)},onSuccess:(t,{eventId:n})=>{e.invalidateQueries({queryKey:[k.CONTENTS_BY_EVENT(n)]})}});return{handleReactionClick:async(e,t,r)=>{if(!e||!t||!r)return!1;if(!n)return O.error("Please login to react"),!1;try{return await o.mutateAsync({eventId:e,contentId:t,emoji:r}),!0}catch(i){return!1}},isPending:o.isPending}})(),[g,f]=s(!1),[v,T]=s(null),C=i(null),I=n.reduce((e,t)=>e+(o[t]||0),0);return r(()=>()=>{C.current&&clearTimeout(C.current)},[]),/* @__PURE__ */p(_e,{open:g,onOpenChange:f,children:[/* @__PURE__ */p(Ae,{asChild:!0,children:/* @__PURE__ */p("button",{type:"button",className:y("bg-background/50 flex items-center gap-1 rounded px-2 py-1 backdrop-blur-sm transition-transform duration-150 ease-out will-change-transform active:scale-95 sm:gap-2 sm:py-0",v&&"scale-[1.03] shadow-sm"),children:[(n||[]).slice().sort((e,t)=>(o[t]||0)-(o[e]||0)).slice(0,1).map(e=>/* @__PURE__ */p("span",{className:y("text-sm transition-transform duration-150 ease-out sm:text-lg",v===(a||e)&&"scale-125"),children:a||e},`${t}-${e}-1`)),I>0&&/* @__PURE__ */p("span",{className:"text-xs font-bold sm:text-sm",children:I||0})]})}),/* @__PURE__ */p(Pe,{side:"top",align:"end",children:[l?null:/* @__PURE__ */p("div",d?.customAuth?{className:"p-2 font-semibold",children:["Please"," ",
23
+ /* @__PURE__ */p(O,{className:"size-full",threshold:.8,triggerOnce:!0,onChange:e=>{e&&i(t._id)},onClick:()=>a(t._id),children:/* @__PURE__ */p($,{url:t.src||t.imageUrl,thumbnailUrl:t.src||t.imageUrl,blurhash:t.blurhash,alt:t.caption,onClick:l?()=>r?.(t):void 0,pswpData:{id:t._id,type:C.AD,hash:t._id,width:t.width,height:t.height,title:t.title,description:t.description,targetType:t.targetType,targetText:t.targetText,targetUrl:t.targetUrl,thumbnailUrl:t.imageUrl,blurhash:t.blurhash}})}),
24
+ /* @__PURE__ */p("span",{className:"bg-background/70 absolute top-1 right-1 rounded px-1 text-xs font-medium",children:"Ad"}),!o&&(t.title||t.targetType!==M.NONE)&&/* @__PURE__ */p("div",{className:"absolute bottom-0 flex w-full flex-col lg:opacity-0 lg:transition-opacity lg:group-hover:opacity-100",children:[t.title&&/* @__PURE__ */p("div",{className:"bg-background/60 px-3 py-1",children:/* @__PURE__ */p("h3",{className:"line-clamp-1 text-sm font-medium",children:t.title})}),t?.targetType!==M.NONE&&/* @__PURE__ */p("button",{type:"button",className:"flex w-full items-center justify-center gap-1 rounded-none border-0 py-2 text-nowrap sm:gap-2",style:{backgroundColor:c,color:d},onClick:()=>{l?r?.(t):s(t._id,t.targetType,t.targetUrl)},children:[/* @__PURE__ */p("span",{style:{color:d},children:/* @__PURE__ */p(u,{})}),t?.targetText]})]})]})},Me),Le=u(({style:e,gamConfig:t,slotIndex:n,eventId:o,organizationId:a})=>{const l=i(null),c=i(null),{trackGamAnalytics:d}=K(),[u,h]=s(!1),m=`gam-slot-${o??"ev"}-${n}`,g=Math.max(1,Math.round(e?.width||t.sizes[0]?.[0]||300)),f=Math.max(1,Math.round(e?.height||t.sizes[0]?.[1]||250)),v=i({w:g,h:f});return r(()=>{if(!u)return;let e=!1,n=null,r=null,i=null,s=null;return(async()=>{await W(),!e&&l.current&&window.googletag.cmd.push(()=>{if(e)return;Y(m);const{w:u,h:h}=v.current,p=[[u,h],...t.sizes],g=window.googletag.defineSlot(t.adUnitPath,p,m)?.addService(window.googletag.pubads());if(!g)return;c.current=g,r=window.googletag.pubads(),o?g.setConfig({targeting:{qrati_event:o,...t.categories.length>0?{qrati_category:t.categories}:{}}}):t.categories.length>0&&g.setConfig({targeting:{qrati_category:t.categories}}),i=e=>{e.slot===g&&d({eventId:o,organizationId:a,type:T.GAM_IMPRESSION,creativeId:String(e.creativeId??""),lineItemId:String(e.lineItemId??""),advertiserId:String(e.advertiserId??""),isEmpty:e.isEmpty??!1})},r.addEventListener("slotRenderEnded",i),s=e=>{e.slot===g&&d({eventId:o,organizationId:a,type:T.GAM_VIEWABLE})},r.addEventListener("impressionViewable",s);const f=l.current;f&&(n=J({container:f,onClick:()=>{d({eventId:o,organizationId:a,type:T.GAM_CLICK})}}),H(),window.googletag.display(m))})})(),()=>{e=!0,n?.(),r&&"function"==typeof r.removeEventListener&&(i&&r.removeEventListener("slotRenderEnded",i),s&&r.removeEventListener("impressionViewable",s));const t=c.current;c.current=null,t&&window.googletag?.cmd?.push(()=>{window.googletag.destroySlots([t])})}},[u,o,t.adUnitPath,t.categories,a,m]),/* @__PURE__ */p("div",{style:{width:g,height:f},className:"relative overflow-hidden rounded bg-neutral-100 dark:bg-neutral-800","data-gam-slot-index":n,children:/* @__PURE__ */p(O,{className:"size-full",threshold:.1,rootMargin:"200px",triggerOnce:!0,onChange:h,children:/* @__PURE__ */p("div",{id:m,ref:l,style:{width:g,height:f},className:"gam-ad-slot"})})})},Me),Se=(e,t)=>{if(!e||!t)return null;const n=t[e];if(!n)return null;try{const e=new Date(String(n)),t=/* @__PURE__ */new Date,r=e.getFullYear()===t.getFullYear(),o={weekday:"long",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0};return r||(o.year="numeric"),e.toLocaleString("en-US",o).replace(","," •")}catch{return null}},_e=t(null),ze=()=>{const e=f(_e);if(!e)throw new Error("Popover components must be used within a Popover");return e},je=({children:e,className:t,open:n,onOpenChange:r})=>{const[o,l]=s(!1),c="boolean"==typeof n,d=c?n:o,u=a(),h=`popover-trigger-${u}`,m=`popover-content-${u}`,g=i(null);/* @__PURE__ */
25
+ return p(_e.Provider,{value:{isOpen:d,setIsOpen:e=>{c||l(e),r?.(e)},triggerId:h,contentId:m,triggerRef:g},children:/* @__PURE__ */p("div",{"data-slot":"popover",className:y("relative inline-block",t),children:e})})},Pe=({children:e,asChild:t,className:r,onClick:o,...i})=>{const{isOpen:a,setIsOpen:s,triggerId:l,contentId:c,triggerRef:d}=ze();if(t){const t=Array.isArray(e)?e[0]:e;if(t&&t.type){const e=t.props?.className;return n(t,{ref:e=>{d.current=e},id:l,className:r?e?`${e} ${r}`:r:e,"aria-haspopup":"dialog","aria-expanded":a,"aria-controls":a?c:void 0,onClick:e=>{s(!a),t.props?.onClick?.(e)},"data-state":a?"open":"closed"})}}/* @__PURE__ */
26
+ return p("button",{ref:d,id:l,type:"button","aria-haspopup":"dialog","aria-expanded":a,"aria-controls":a?c:void 0,"data-slot":"popover-trigger","data-state":a?"open":"closed",className:r,onClick:e=>{s(!a),o?.(e)},...i,children:e})},Oe=({children:e,className:t,align:n="center",side:o="top",sideOffset:a=4,...l})=>{const{isOpen:u,setIsOpen:h,contentId:m,triggerRef:g}=ze(),{organization:f,portalContainer:w}=b(),x=i(null),[N,k]=s(null);if(c(()=>{if(!u)return;const e=()=>{if(!g.current||!x.current)return;const e=g.current.getBoundingClientRect(),t=x.current.getBoundingClientRect();let r=e.left,i=e.bottom+a;"center"===n&&(r=e.left+e.width/2-t.width/2),"end"===n&&(r=e.right-t.width),"top"===o&&(i=e.top-t.height-a),"left"===o&&(r=e.left-t.width-a,i=e.top+e.height/2-t.height/2),"right"===o&&(r=e.right+a,i=e.top+e.height/2-t.height/2),"bottom"===o&&(i=e.bottom+a),k({top:i,left:r})},t=requestAnimationFrame(e);return window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),()=>{cancelAnimationFrame(t),window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0)}},[n,u,o,a,g]),r(()=>{if(!u)return;const e=e=>{const t="function"==typeof e.composedPath?e.composedPath():[],n=e.target,r=x.current&&(x.current.contains(n)||t.includes(x.current)),o=g.current&&(g.current.contains(n)||t.includes(g.current));r||o||h(!1)},t=e=>{"Escape"===e.key&&(h(!1),g.current?.focus())},n=window.setTimeout(()=>{document.addEventListener("mousedown",e)},0);return document.addEventListener("keydown",t),()=>{window.clearTimeout(n),document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)}},[u,h,g]),!u)return null;const T=/* @__PURE__ */p("div",{ref:x,id:m,role:"dialog","aria-modal":"false","data-state":u?"open":"closed",className:y("bg-background text-foreground border-border shadow-outer rounded outline-none",t),style:{position:"fixed",top:N?.top??0,left:N?.left??0,zIndex:2010,...v(f)},...l,children:e});return"undefined"!=typeof document?d(T,w??document.body):T},Re=({eventId:e,contentId:t,emojis:n=[],counts:o={},userReaction:a})=>{const{user:l,props:c,organization:d}=b(),u=c?.loginUrl,{handleReactionClick:h,isPending:m}=(()=>{const e=w(),{props:t,user:n}=b(),r=t?.organizationId,o=x({mutationFn:async({eventId:e,contentId:t,emoji:o})=>N.post(q.UPDATE_REACTION,{json:{eventId:e,contentId:t,reaction:o},headers:{"x-org-id":r,Authorization:`Bearer ${n?.token}`}}).json(),onMutate:async({eventId:t,contentId:n,emoji:r})=>{const o=[k.CONTENTS_BY_EVENT(t)];await e.cancelQueries({queryKey:o});const i=e.getQueriesData({queryKey:o});return e.setQueriesData({queryKey:o},e=>((e,t,n)=>e?.pages&&Array.isArray(e.pages)?{...e,pages:e.pages.map(e=>e.data?{...e,data:e.data.map(e=>{if(e._id!==t)return e;const r={...e.reactionCounts??{}};return e.userReaction&&e.userReaction!==n&&(r[e.userReaction]=Math.max(0,(r[e.userReaction]??1)-1)),e.userReaction===n?e:(r[n]=(r[n]??0)+1,{...e,reactionCounts:r,userReaction:n})})}:e)}:e)(e,n,r)),{previousData:i}},onError:(t,n,r)=>{r?.previousData?.forEach(([t,n])=>{e.setQueryData(t,n)}),G.error("Failed to add reaction"),console.error("Error handling reaction click:",t,n)},onSuccess:(t,{eventId:n})=>{e.invalidateQueries({queryKey:[k.CONTENTS_BY_EVENT(n)]})}});return{handleReactionClick:async(e,t,r)=>{if(!e||!t||!r)return!1;if(!n)return G.error("Please login to react"),!1;try{return await o.mutateAsync({eventId:e,contentId:t,emoji:r}),!0}catch(i){return!1}},isPending:o.isPending}})(),[g,f]=s(!1),[v,T]=s(null),C=i(null),I=n.reduce((e,t)=>e+(o[t]||0),0);return r(()=>()=>{C.current&&clearTimeout(C.current)},[]),/* @__PURE__ */p(je,{open:g,onOpenChange:f,children:[/* @__PURE__ */p(Pe,{asChild:!0,children:/* @__PURE__ */p("button",{type:"button",className:y("bg-background/50 flex items-center gap-1 rounded px-2 py-1 backdrop-blur-sm transition-transform duration-150 ease-out will-change-transform active:scale-95 sm:gap-2 sm:py-0",v&&"scale-[1.03] shadow-sm"),children:[(n||[]).slice().sort((e,t)=>(o[t]||0)-(o[e]||0)).slice(0,1).map(e=>/* @__PURE__ */p("span",{className:y("text-sm transition-transform duration-150 ease-out sm:text-lg",v===(a||e)&&"scale-125"),children:a||e},`${t}-${e}-1`)),I>0&&/* @__PURE__ */p("span",{className:"text-xs font-bold sm:text-sm",children:I||0})]})}),/* @__PURE__ */p(Oe,{side:"top",align:"end",children:[l?null:/* @__PURE__ */p("div",d?.customAuth?{className:"p-2 font-semibold",children:["Please"," ",
27
27
  /* @__PURE__ */p("a",{className:"text-info underline",href:u,children:"Login"})," ","to react"]}:{className:"p-2 font-semibold",children:["Please"," ",
28
- /* @__PURE__ */p(_,{className:"text-info underline",to:M.LOGIN,children:"Login"})," ","to react"]}),l&&/* @__PURE__ */p("div",{className:"flex gap-1 p-2",children:n.map(n=>{const r=a===n;/* @__PURE__ */
29
- return p("div",{className:"flex flex-col items-center",children:[/* @__PURE__ */p("span",{className:"text-xs font-medium",children:o[n]||0}),/* @__PURE__ */p("button",{type:"button",disabled:m,className:y("text-3xl transition-transform duration-150 ease-out disabled:opacity-50",r?"scale-125":"hover:scale-110",v===n&&"scale-125",m&&"cursor-not-allowed"),onClick:()=>(async n=>{!m&&h&&(T(n),f(!1),C.current&&clearTimeout(C.current),C.current=setTimeout(()=>T(null),180),h(e,t,n))})(n),children:n})]},`${t}-${n}-2`)})})]})]})},je=({event:e={},content:t,curateLink:n})=>{if(e.engagementStyle===I.CONTEST||n){const e=/* @__PURE__ */p("span",{className:"bg-background/75 flex items-center gap-1 rounded px-2 py-1",children:[/* @__PURE__ */p(W,{className:"size-4"}),/* @__PURE__ */p("span",{className:"text-xs font-semibold",children:parseFloat(String(t.score||0)).toFixed(1)})]});return n?/* @__PURE__ */p(L,{to:n,children:e}):e}return e.engagementStyle===I.REACTION&&e.reactionEmojis?.length?/* @__PURE__ */p(ze,{eventId:e?._id,contentId:t._id,emojis:e?.reactionEmojis,counts:t.reactionCounts||{},userReaction:t.userReaction}):null},Oe=({content:e})=>/* @__PURE__ */p("div",{className:"w-full space-y-3 px-3 pb-3",children:[e?.caption&&/* @__PURE__ */p("span",{"data-tooltip-target":"tooltip-default",className:"hidden w-full text-xs drop-shadow-[0_1.2px_1.2px_rgba(0,0,0,0.8)] sm:block",children:/* @__PURE__ */p("div",{role:"note",title:e?.caption,className:"lg:text-md line-clamp-1 text-xs text-white lg:font-medium",children:e?.caption})}),/* @__PURE__ */p("div",{className:"flex items-center justify-between",children:/* @__PURE__ */p("span",{className:"lg:text-md line-clamp-1 text-sm font-medium text-white drop-shadow-[0_1.2px_1.2px_rgba(0,0,0,0.8)]",children:e?.user?.name})})]}),Ue=u(({event:e,content:t,style:n,timestampField:r,curateLink:o,onChangeFaceUrl:i,hideControls:a,showQuickSearch:s,imageSearchProviders:l=R,organizationId:c})=>{const d=`content-${t._id}`,u=h(()=>qe(r,t),[r,t]),f=m(()=>{i?.(t?.url);const e=document.getElementById("media-gallery-container");e&&e.scrollIntoView({behavior:"smooth",block:"start"})},[i,t?.url]),v=h(()=>({id:t._id,type:C.IMAGE,hash:t._id,width:t.width,height:t.height,thumbnailUrl:t.thumbnailUrl,blurhash:t.blurhash,caption:t.caption}),[t._id,t.width,t.height,t.thumbnailUrl,t.blurhash,t.caption]);/* @__PURE__ */
30
- return p("div",{id:d,style:n,className:"group relative mb-1 overflow-hidden rounded [content-visibility:auto]",children:[/* @__PURE__ */p(j,{url:t.src,alt:t.caption,blurhash:t.blurhash,thumbnailUrl:t.thumbnailUrl,curateLink:o,pswpData:v}),!a&&/* @__PURE__ */p(g,{children:[u&&/* @__PURE__ */p("div",{className:"absolute top-2 left-2 max-w-[calc(100%-80px)] truncate rounded bg-black/50 px-2 py-0.5 text-xs text-white backdrop-blur-sm",children:u}),
31
- /* @__PURE__ */p("div",{className:"absolute top-2 right-2 flex flex-col gap-2",children:[s&&(t.faces?.length??0)>0&&/* @__PURE__ */p("button",{type:"button","aria-label":"Search by face",className:"bg-primary rounded-full p-1 text-gray-200 opacity-50 transition-[opacity,transform] sm:p-1.5 sm:hover:scale-110 sm:hover:opacity-100",onClick:f,children:/* @__PURE__ */p(V,{className:"text-primary-foreground"})}),t.url&&/* @__PURE__ */p(B,{providers:l,imageUrl:t.url,surface:"gallery",organizationId:c,eventId:e?._id,contentId:t._id})]}),
32
- /* @__PURE__ */p("div",{className:"",children:[/* @__PURE__ */p("div",{className:"absolute bottom-0 w-full rounded-b",children:/* @__PURE__ */p(Oe,{content:t})}),/* @__PURE__ */p("div",{className:"absolute right-2 bottom-2",children:/* @__PURE__ */p(je,{event:e,content:t,curateLink:o})})]})]})]})},Ie),Re=u(({content:e,style:t,event:n,timestampField:r,curateLink:o,hideControls:i})=>{const a=h(()=>qe(r,e),[r,e]);/* @__PURE__ */
33
- return p("div",{id:`content-${e._id}`,className:"group relative mb-1 overflow-hidden rounded [content-visibility:auto]",style:t,children:[/* @__PURE__ */p(j,{url:e.src??e.url,thumbnailUrl:e.thumbnailUrl,blurhash:e.blurhash,alt:e.caption,curateLink:o,pswpData:{id:e._id,type:C.VIDEO,hash:e._id,width:e.width,height:e.height,thumbnailUrl:e.thumbnailUrl,blurhash:e.blurhash,caption:e.caption}}),!i&&/* @__PURE__ */p("div",{className:"transition-opacity duration-500",children:[a&&/* @__PURE__ */p("div",{className:"absolute top-2 left-2 max-w-[calc(100%-80px)] truncate rounded bg-black/50 px-2 py-0.5 text-xs text-white backdrop-blur-sm",children:a}),
34
- /* @__PURE__ */p("div",{className:"absolute bottom-0 w-full rounded-b",children:/* @__PURE__ */p(Oe,{content:e})}),
35
- /* @__PURE__ */p("div",{className:"absolute right-2 bottom-2",children:/* @__PURE__ */p(je,{event:n,content:e,curateLink:o})})]})]})},Ie),Be=({event:e,contents:t=[],gamConfig:n,singleColumnMode:o,kioskMode:a,timestampField:l,curateLink:c,onChangeFaceUrl:d,showQuickSearch:u})=>{const f=i(null),v=i(null),w=i(!1),x=i(null),N=h(()=>`gallery-${e?._id??""}`,[e?._id]),{captureAdImpression:k,captureAdClick:T}=G(),{portalContainer:I,organization:E}=b(),q=E?._id,M=E?.advancedSettings?.imageSearchProviders?.gallery??R,L=E?.advancedSettings?.imageSearchProviders?.lightbox??R,[_,A]=s(null);r(()=>()=>{v.current?.destroy(),v.current=null,f.current?.destroy?.(),f.current=null},[e?.galleryLayout,c,N,I]);const P=m(async t=>{if(c||f.current||w.current)return;const n=x.current,r=t.target.closest("a");if(!n||!r||!n.contains(r))return;t.preventDefault(),w.current=!0;const o=Array.from(n.querySelectorAll("a")).indexOf(r);try{const[{default:t},{default:r},{default:i},{default:a},{default:s},{default:l},{default:c},{loadPhotoSwipe:d},u]=await Promise.all([import("./web.es.js").then(e=>e.n),import("./Bo39kG4k2.js"),import("./BYM2GyVF2.js"),import("./BNaRcekR2.js"),import("./DeK1vU3V2.js"),import("./CtxIOzTC2.js"),import("./1dmOpMwn2.js"),import("./web.es.js").then(e=>e.t),L.length>0?import("./CIcQE2CN2.js"):Promise.resolve(null)]),h=new t({gallery:n,children:"a",counter:!1,bgOpacity:1,wheelToZoom:!0,pinchToClose:!0,zoom:!1,pswpModule:d,appendToEl:I??document.body});f.current=h;const p=new ke(()=>window.pswp);v.current=p,h.on("beforeOpen",()=>p.open()),h.on("close",()=>{p.close(),v.current===p&&(v.current=null)}),new r(h),new i(h),u&&new u.default(h,L,{organizationId:q,eventId:e?._id}),new a(h),new s(h,k,T),new l(h),new c(h),h.init(),o>=0&&f.current?.loadAndOpen?.(o)}finally{w.current=!1}},[c,I,k,T,L,q,e?._id]),z=h(()=>{switch(e?.galleryLayout){case S.ROW:return ge;case S.COLUMN:return ye;case S.MASONRY:return xe;default:return ge}},[e?.galleryLayout]),j=h(()=>t.map(e=>{const t=e.type===C.IMAGE||e.type===C.VIDEO?e.url:e.type===C.GAM_AD?"":e.imageUrl;return{...e,src:t??"",width:e.dimension?.width||e.width||4,height:e.dimension?.height||e.height||3}}),[t]),O=h(()=>({container:({ref:e,className:t,children:n})=>/* @__PURE__ */p("div",{ref:e,className:t??"",children:n}),photo:(t,{photo:r,width:o,height:i,index:s})=>{const h=r;let m=null;switch(h.type){case C.IMAGE:m=Ue;break;case C.VIDEO:m=Re;break;case C.AD:m=Se;break;case C.GAM_AD:return n?/* @__PURE__ */p(Ee,{style:{width:o,height:i},gamConfig:n,slotIndex:h.slotIndex??s,eventId:e?._id,organizationId:q},`${h._id??s}-${s}`):null;default:m=null}return m?/* @__PURE__ */p(m,{style:{width:o,height:i},event:e,content:h,timestampField:l,onAdClick:c?A:void 0,hideControls:a,curateLink:c?`${c}/${h._id}`:null,onChangeFaceUrl:d,showQuickSearch:u,imageSearchProviders:M,organizationId:q},`${h._id??s}-${s}`):null}}),[e,n,q,l,c,a,d,u,M]);/* @__PURE__ */
36
- return p(g,{children:[/* @__PURE__ */p("div",{id:N,ref:x,onClickCapture:P,className:y(o?"w-full lg:w-1/3":"w-full"),children:/* @__PURE__ */p(z,{spacing:4,rowConstraints:e=>{const t={minPhotos:1,maxPhotos:4,singleRowMaxHeight:400};return o?(t.minPhotos=1,t.maxPhotos=1):t.maxPhotos=e<400?2:e<800?3:4,t},columns:e=>o?1:e<400?2:e<800?3:4,photos:j,render:O})}),/* @__PURE__ */p(Ce,{open:Boolean(_),ad:_,onClose:()=>A(null),captureAdClick:T})]})};export{Be as default};
28
+ /* @__PURE__ */p(z,{className:"text-info underline",to:A.LOGIN,children:"Login"})," ","to react"]}),l&&/* @__PURE__ */p("div",{className:"flex gap-1 p-2",children:n.map(n=>{const r=a===n;/* @__PURE__ */
29
+ return p("div",{className:"flex flex-col items-center",children:[/* @__PURE__ */p("span",{className:"text-xs font-medium",children:o[n]||0}),/* @__PURE__ */p("button",{type:"button",disabled:m,className:y("text-3xl transition-transform duration-150 ease-out disabled:opacity-50",r?"scale-125":"hover:scale-110",v===n&&"scale-125",m&&"cursor-not-allowed"),onClick:()=>(async n=>{!m&&h&&(T(n),f(!1),C.current&&clearTimeout(C.current),C.current=setTimeout(()=>T(null),180),h(e,t,n))})(n),children:n})]},`${t}-${n}-2`)})})]})]})},Ue=({event:e={},content:t,curateLink:n})=>{if(e.engagementStyle===I.CONTEST||n){const e=/* @__PURE__ */p("span",{className:"bg-background/75 flex items-center gap-1 rounded px-2 py-1",children:[/* @__PURE__ */p(Z,{className:"size-4"}),/* @__PURE__ */p("span",{className:"text-xs font-semibold",children:parseFloat(String(t.score||0)).toFixed(1)})]});return n?/* @__PURE__ */p(_,{to:n,children:e}):e}return e.engagementStyle===I.REACTION&&e.reactionEmojis?.length?/* @__PURE__ */p(Re,{eventId:e?._id,contentId:t._id,emojis:e?.reactionEmojis,counts:t.reactionCounts||{},userReaction:t.userReaction}):null},$e=({content:e})=>/* @__PURE__ */p("div",{className:"w-full space-y-3 px-3 pb-3",children:[e?.caption&&/* @__PURE__ */p("span",{"data-tooltip-target":"tooltip-default",className:"hidden w-full text-xs drop-shadow-[0_1.2px_1.2px_rgba(0,0,0,0.8)] sm:block",children:/* @__PURE__ */p("div",{role:"note",title:e?.caption,className:"lg:text-md line-clamp-1 text-xs text-white lg:font-medium",children:e?.caption})}),/* @__PURE__ */p("div",{className:"flex items-center justify-between",children:/* @__PURE__ */p("span",{className:"lg:text-md line-clamp-1 text-sm font-medium text-white drop-shadow-[0_1.2px_1.2px_rgba(0,0,0,0.8)]",children:e?.user?.name})})]}),Fe=u(({event:e,content:t,style:n,timestampField:r,curateLink:o,onChangeFaceUrl:i,hideControls:a,showQuickSearch:s,imageSearchProviders:l=V,organizationId:c})=>{const d=`content-${t._id}`,u=h(()=>Se(r,t),[r,t]),f=m(()=>{i?.(t?.url);const e=document.getElementById("media-gallery-container");e&&e.scrollIntoView({behavior:"smooth",block:"start"})},[i,t?.url]),v=h(()=>({id:t._id,type:C.IMAGE,hash:t._id,width:t.width,height:t.height,thumbnailUrl:t.thumbnailUrl,blurhash:t.blurhash,caption:t.caption}),[t._id,t.width,t.height,t.thumbnailUrl,t.blurhash,t.caption]);/* @__PURE__ */
30
+ return p("div",{id:d,style:n,className:"group relative mb-1 overflow-hidden rounded [content-visibility:auto]",children:[/* @__PURE__ */p($,{url:t.src,alt:t.caption,blurhash:t.blurhash,thumbnailUrl:t.thumbnailUrl,curateLink:o,pswpData:v}),!a&&/* @__PURE__ */p(g,{children:[u&&/* @__PURE__ */p("div",{className:"absolute top-2 left-2 max-w-[calc(100%-80px)] truncate rounded bg-black/50 px-2 py-0.5 text-xs text-white backdrop-blur-sm",children:u}),
31
+ /* @__PURE__ */p("div",{className:"absolute top-2 right-2 flex flex-col gap-2",children:[s&&(t.faces?.length??0)>0&&/* @__PURE__ */p("button",{type:"button","aria-label":"Search by face",className:"bg-primary rounded-full p-1 text-gray-200 opacity-50 transition-[opacity,transform] sm:p-1.5 sm:hover:scale-110 sm:hover:opacity-100",onClick:f,children:/* @__PURE__ */p(Q,{className:"text-primary-foreground"})}),t.url&&/* @__PURE__ */p(D,{providers:l,imageUrl:t.url,surface:"gallery",organizationId:c,eventId:e?._id,contentId:t._id})]}),
32
+ /* @__PURE__ */p("div",{className:"",children:[/* @__PURE__ */p("div",{className:"absolute bottom-0 w-full rounded-b",children:/* @__PURE__ */p($e,{content:t})}),/* @__PURE__ */p("div",{className:"absolute right-2 bottom-2",children:/* @__PURE__ */p(Ue,{event:e,content:t,curateLink:o})})]})]})]})},Me),Ge=u(({content:e,style:t,event:n,timestampField:r,curateLink:o,hideControls:i})=>{const a=h(()=>Se(r,e),[r,e]);/* @__PURE__ */
33
+ return p("div",{id:`content-${e._id}`,className:"group relative mb-1 overflow-hidden rounded [content-visibility:auto]",style:t,children:[/* @__PURE__ */p($,{url:e.src??e.url,thumbnailUrl:e.thumbnailUrl,blurhash:e.blurhash,alt:e.caption,curateLink:o,pswpData:{id:e._id,type:C.VIDEO,hash:e._id,width:e.width,height:e.height,thumbnailUrl:e.thumbnailUrl,blurhash:e.blurhash,caption:e.caption}}),!i&&/* @__PURE__ */p("div",{className:"transition-opacity duration-500",children:[a&&/* @__PURE__ */p("div",{className:"absolute top-2 left-2 max-w-[calc(100%-80px)] truncate rounded bg-black/50 px-2 py-0.5 text-xs text-white backdrop-blur-sm",children:a}),
34
+ /* @__PURE__ */p("div",{className:"absolute bottom-0 w-full rounded-b",children:/* @__PURE__ */p($e,{content:e})}),
35
+ /* @__PURE__ */p("div",{className:"absolute right-2 bottom-2",children:/* @__PURE__ */p(Ue,{event:n,content:e,curateLink:o})})]})]})},Me),Be=({event:e,contents:t=[],gamConfig:n,singleColumnMode:o,kioskMode:a,timestampField:l,curateLink:c,onChangeFaceUrl:d,showQuickSearch:u})=>{const f=i(null),v=i(null),w=i(!1),x=i(null),N=h(()=>`gallery-${e?._id??""}`,[e?._id]),{captureAdImpression:k,captureAdClick:T}=K(),I=j(),q=S(),M=L(),{portalContainer:A,organization:_}=b(),z=_?._id,P=_?.advancedSettings?.imageSearchProviders?.gallery??V,O=_?.advancedSettings?.imageSearchProviders?.lightbox??V,[R,$]=s(null);r(()=>()=>{v.current?.destroy(),v.current=null,f.current?.destroy?.(),f.current=null},[e?.galleryLayout,c,N,A]);const G=m(async t=>{if(c||f.current||w.current)return;const n=x.current,r=t.target.closest("a");if(!n||!r||!n.contains(r))return;t.preventDefault(),w.current=!0;const o=Array.from(n.querySelectorAll("a")).indexOf(r);try{const[{default:t},{default:r},{default:i},{default:a},{default:s},{default:l},{default:c},{loadPhotoSwipe:d},u]=await Promise.all([import("./web.es.js").then(e=>e.n),import("./Bo39kG4k2.js"),import("./BYM2GyVF2.js"),import("./BNaRcekR2.js"),import("./DeK1vU3V2.js"),import("./CtxIOzTC2.js"),import("./1dmOpMwn2.js"),import("./web.es.js").then(e=>e.t),O.length>0?import("./CIcQE2CN2.js"):Promise.resolve(null)]),h=new t({gallery:n,children:"a",counter:!1,bgOpacity:1,wheelToZoom:!0,pinchToClose:!0,zoom:!1,pswpModule:d,appendToEl:A??document.body});f.current=h;const p=new F(()=>window.pswp,"memory"===M?{location:q.pathname,state:q.state,push:(e,t)=>I(e,{state:t}),replace:(e,t)=>I(e,{state:t,replace:!0}),go:e=>I(e)}:void 0);v.current=p,h.on("beforeOpen",()=>p.open()),h.on("close",()=>{p.close(),v.current===p&&(v.current=null)}),new r(h),new i(h),u&&new u.default(h,O,{organizationId:z,eventId:e?._id}),new a(h),new s(h,k,T),new l(h),new c(h),h.init(),o>=0&&f.current?.loadAndOpen?.(o)}finally{w.current=!1}},[c,A,k,T,O,z,e?._id,q.pathname,q.state,I,M]);r(()=>{const e=v.current;"memory"===M&&e?.isActive()&&!U(q.state)&&e.handleBack()},[q.state,M]);const B=h(()=>{switch(e?.galleryLayout){case E.ROW:return be;case E.COLUMN:return Te;case E.MASONRY:return Ie;default:return be}},[e?.galleryLayout]),D=h(()=>t.map(e=>{const t=e.type===C.IMAGE||e.type===C.VIDEO?e.url:e.type===C.GAM_AD?"":e.imageUrl;return{...e,src:t??"",width:e.dimension?.width||e.width||4,height:e.dimension?.height||e.height||3}}),[t]),W=h(()=>({container:({ref:e,className:t,children:n})=>/* @__PURE__ */p("div",{ref:e,className:t??"",children:n}),photo:(t,{photo:r,width:o,height:i,index:s})=>{const h=r;let m=null;switch(h.type){case C.IMAGE:m=Fe;break;case C.VIDEO:m=Ge;break;case C.AD:m=Ae;break;case C.GAM_AD:return n?/* @__PURE__ */p(Le,{style:{width:o,height:i},gamConfig:n,slotIndex:h.slotIndex??s,eventId:e?._id,organizationId:z},`${h._id??s}-${s}`):null;default:m=null}return m?/* @__PURE__ */p(m,{style:{width:o,height:i},event:e,content:h,timestampField:l,onAdClick:c?$:void 0,hideControls:a,curateLink:c?`${c}/${h._id}`:null,onChangeFaceUrl:d,showQuickSearch:u,imageSearchProviders:P,organizationId:z},`${h._id??s}-${s}`):null}}),[e,n,z,l,c,a,d,u,P]);/* @__PURE__ */
36
+ return p(g,{children:[/* @__PURE__ */p("div",{id:N,ref:x,onClickCapture:G,className:y(o?"w-full lg:w-1/3":"w-full"),children:/* @__PURE__ */p(B,{spacing:4,rowConstraints:e=>{const t={minPhotos:1,maxPhotos:4,singleRowMaxHeight:400};return o?(t.minPhotos=1,t.maxPhotos=1):t.maxPhotos=e<400?2:e<800?3:4,t},columns:e=>o?1:e<400?2:e<800?3:4,photos:D,render:W})}),/* @__PURE__ */p(qe,{open:Boolean(R),ad:R,onClose:()=>$(null),captureAdClick:T})]})};export{Be as default};
@@ -1,5 +1,5 @@
1
- import{E as t,S as e,_ as n,f as s,h as r,p as i,t as a,v as o,w as c,y as l}from"./BXMw4kNf.js";import{i as u}from"./CdivXyOP.js";var h=t(null),p=t(null),d=class{entries;index=0;listeners=/* @__PURE__ */new Set;constructor(t="/"){this.entries=[{path:t}]}get location(){return this.entries[this.index]?.path??"/"}get state(){return this.entries[this.index]?.state}push(t,e){this.entries=this.entries.slice(0,this.index+1),this.index=this.entries.push({path:t,state:e})-1,this.notify()}replace(t,e){this.entries[this.index]={path:t,state:e},this.notify()}go(t){const e=this.index+t;e>=0&&e<this.entries.length&&(this.index=e,this.notify())}canGoBack(){return this.index>0}listen(t){return this.listeners.add(t),()=>this.listeners.delete(t)}notify(){this.listeners.forEach(t=>t(this.location))}},f=class{listeners=/* @__PURE__ */new Set;appPushCount=0;get location(){return window.location.hash.replace(/^#/,"")||"/"}get state(){return window.history.state?.__qrati_state}makeUrl(t){return`${window.location.pathname+window.location.search}#${t}`}push(t,e){window.history.pushState({__qrati_state:e},"",this.makeUrl(t)),this.appPushCount+=1,this.notify()}replace(t,e){window.history.replaceState({__qrati_state:e},"",this.makeUrl(t)),this.notify()}go(t){this.appPushCount=Math.max(0,this.appPushCount+t),window.history.go(t)}canGoBack(){return this.appPushCount>0}listen(t){this.listeners.add(t);const e=()=>this.notify();return window.addEventListener("popstate",e),window.addEventListener("hashchange",e),queueMicrotask(()=>t(this.location)),()=>{this.listeners.delete(t),window.removeEventListener("popstate",e),window.removeEventListener("hashchange",e)}}notify(){this.listeners.forEach(t=>t(this.location))}};function m(t){const e=t.search(/[?#]/);return-1===e?t||"/":t.slice(0,e)||"/"}function w(t,e,n=!0){const s=t.split("/").filter(Boolean),r=function(t){const e=[],n=t.split("/").filter(Boolean);for(const s of n)if("*"===s)e.push({type:"wildcard"});else if(s.startsWith(":")){const t=s.endsWith("?"),n=t?s.slice(1,-1):s.slice(1);e.push({type:"param",name:n,optional:t})}else e.push({type:"static",value:s});return e}(e),i={};let a=0;for(const o of r)if("static"===o.type){if(s[a]!==o.value)return null;a++}else if("param"===o.type){if(a<s.length){try{i[o.name]=decodeURIComponent(s[a])}catch{i[o.name]=s[a]}a++}else if(!o.optional)return null}else if("wildcard"===o.type){i["*"]=s.slice(a).join("/"),a=s.length;break}return n&&a<s.length?null:{params:i}}function v(t,e){return e.startsWith("/")?e:t.endsWith("/")?t+e:`${t}/${e}`}function y(t,e,n=""){const s=m(t);for(const r of e){const t=r.path.startsWith("/")?r.path:v(n,r.path);if(r.children&&r.children.length>0){const e=w(s,t,!1);if(e){const n=[{route:r,params:e.params}],i=y(s,r.children,t);if(i)n.push(...i);else{const t=r.children.find(t=>""===t.path);t&&n.push({route:t,params:{}})}return n}}const e=w(s,t,!0);if(e)return[{route:r,params:e.params}]}return null}function g(){const t=l(p);if(!t)throw new Error("useParams must be used inside a Route");return t.params}function k(){const t=l(h);if(!t)throw new Error("useNavigate must be used inside a Router");const{navigate:e,go:n}=t;return o((t,s)=>{"number"!=typeof t?e(t,s):n(t)},[e,n])}function x(){const t=l(h);if(!t)throw new Error("useCanGoBack must be used inside a Router");return t.canGoBack}function C(){const t=l(h);if(!t)throw new Error("useLocation must be used inside a Router");return function(t,e){const n=m(t),s=t.indexOf("?"),r=t.indexOf("#");return{pathname:n,state:e,search:-1===s?"":t.slice(s,-1===r?void 0:r),hash:-1===r?"":t.slice(r)}}(t.location,t.state)}function E({mode:t,initialPath:e,children:c}){const l=s("memory"===t?new d(e):new f),[u,p]=r(l.current.location),[m,w]=r(l.current.state),[v,y]=r(l.current.canGoBack());n(()=>(p(l.current.location),w(l.current.state),y(l.current.canGoBack()),l.current.listen(t=>{p(t),w(l.current.state),y(l.current.canGoBack())})),[]);const g=o((t,e)=>{const n=l.current;e&&e.replace?n.replace(t,e.state):n.push(t,e?.state)},[]),k=o(t=>{l.current.go(t)},[]),x=i(()=>({location:u,state:m,navigate:g,go:k,canGoBack:v,mode:t}),[u,m,g,k,v,t]);/* @__PURE__ */
2
- return a(h.Provider,{value:x,children:c})}function B(t){return null}function _(t){return e(t).filter(t=>t?.type===B).map(t=>({path:t.props.path,element:t.props.element,children:t.props.children?_(t.props.children):void 0}))}function P({children:t}){const{location:n}=l(h),r=s([]),o=e(t).filter(t=>t?.type===B).map(t=>t.props.path).join("\0"),u=s("");o!==u.current&&(u.current=o,r.current=_(t));const d=r.current,f=i(()=>y(n,d),[n,d]),m=i(()=>(f??[]).reduce((t,e)=>({...t,...e.params}),{}),[f]),w=i(()=>{if(!f)return null;let t=null;for(let e=f.length-1;e>=0;e--){const n=f[e].route.element;t=/* @__PURE__ */a(p.Provider,{value:{params:m,outlet:t},children:/* @__PURE__ */a(n,{})})}return t},[f,m]);return f?/* @__PURE__ */a(c,{children:w}):null}function G(){/* @__PURE__ */
3
- return a(c,{children:l(p)?.outlet})}function b({to:t,state:e,replace:n,children:s,className:r,onClick:i,...c}){const u=l(h);/* @__PURE__ */
4
- return a("a",{href:t,onClick:o(s=>{s.preventDefault(),i?.(s),u?.navigate(t,{state:e,replace:n})},[u,t,e,n,i]),className:r,...c,children:s})}function N({to:t,state:e,replace:n,children:s,className:r,activeClassName:c,onClick:p,...d}){const f=l(h),w=i(()=>{if(!f)return!1;const e=m(f.location);return e===t||!("/"===t||!e.startsWith(`${t}/`))},[f?.location,t]);/* @__PURE__ */
5
- return a("a",{href:t,onClick:o(s=>{s.preventDefault(),p?.(s),f?.navigate(t,{state:e,replace:n})},[f,t,e,n,p]),className:"function"==typeof r?r({isActive:w}):u(r,w&&c),...d,children:s})}function W({to:t,state:e,replace:s}){const r=k();return n(()=>{queueMicrotask(()=>{r(t,{state:e,replace:s})})},[r,t,e,s]),null}export{B as a,x as c,g as d,G as i,C as l,N as n,E as o,W as r,P as s,b as t,k as u};
1
+ import{E as t,S as e,_ as n,f as s,h as r,p as i,t as a,v as o,w as c,y as u}from"./BXMw4kNf.js";import{i as l}from"./CdivXyOP.js";var h=t(null),p=t(null),d=class{entries;index=0;listeners=/* @__PURE__ */new Set;constructor(t="/"){this.entries=[{path:t}]}get location(){return this.entries[this.index]?.path??"/"}get state(){return this.entries[this.index]?.state}push(t,e){this.entries=this.entries.slice(0,this.index+1),this.index=this.entries.push({path:t,state:e})-1,this.notify()}replace(t,e){this.entries[this.index]={path:t,state:e},this.notify()}go(t){const e=this.index+t;e>=0&&e<this.entries.length&&(this.index=e,this.notify())}canGoBack(){return this.index>0}listen(t){return this.listeners.add(t),()=>this.listeners.delete(t)}notify(){this.listeners.forEach(t=>t(this.location))}},f=class{listeners=/* @__PURE__ */new Set;appPushCount=0;get location(){return window.location.hash.replace(/^#/,"")||"/"}get state(){return window.history.state?.__qrati_state}makeUrl(t){return`${window.location.pathname+window.location.search}#${t}`}push(t,e){window.history.pushState({__qrati_state:e},"",this.makeUrl(t)),this.appPushCount+=1,this.notify()}replace(t,e){window.history.replaceState({__qrati_state:e},"",this.makeUrl(t)),this.notify()}go(t){this.appPushCount=Math.max(0,this.appPushCount+t),window.history.go(t)}canGoBack(){return this.appPushCount>0}listen(t){this.listeners.add(t);const e=()=>this.notify();return window.addEventListener("popstate",e),window.addEventListener("hashchange",e),queueMicrotask(()=>t(this.location)),()=>{this.listeners.delete(t),window.removeEventListener("popstate",e),window.removeEventListener("hashchange",e)}}notify(){this.listeners.forEach(t=>t(this.location))}};function m(t){const e=t.search(/[?#]/);return-1===e?t||"/":t.slice(0,e)||"/"}function w(t,e,n=!0){const s=t.split("/").filter(Boolean),r=function(t){const e=[],n=t.split("/").filter(Boolean);for(const s of n)if("*"===s)e.push({type:"wildcard"});else if(s.startsWith(":")){const t=s.endsWith("?"),n=t?s.slice(1,-1):s.slice(1);e.push({type:"param",name:n,optional:t})}else e.push({type:"static",value:s});return e}(e),i={};let a=0;for(const o of r)if("static"===o.type){if(s[a]!==o.value)return null;a++}else if("param"===o.type){if(a<s.length){try{i[o.name]=decodeURIComponent(s[a])}catch{i[o.name]=s[a]}a++}else if(!o.optional)return null}else if("wildcard"===o.type){i["*"]=s.slice(a).join("/"),a=s.length;break}return n&&a<s.length?null:{params:i}}function v(t,e){return e.startsWith("/")?e:t.endsWith("/")?t+e:`${t}/${e}`}function y(t,e,n=""){const s=m(t);for(const r of e){const t=r.path.startsWith("/")?r.path:v(n,r.path);if(r.children&&r.children.length>0){const e=w(s,t,!1);if(e){const n=[{route:r,params:e.params}],i=y(s,r.children,t);if(i)n.push(...i);else{const t=r.children.find(t=>""===t.path);t&&n.push({route:t,params:{}})}return n}}const e=w(s,t,!0);if(e)return[{route:r,params:e.params}]}return null}function g(){const t=u(p);if(!t)throw new Error("useParams must be used inside a Route");return t.params}function k(){const t=u(h);if(!t)throw new Error("useNavigate must be used inside a Router");const{navigate:e,go:n}=t;return o((t,s)=>{"number"!=typeof t?e(t,s):n(t)},[e,n])}function x(){const t=u(h);if(!t)throw new Error("useCanGoBack must be used inside a Router");return t.canGoBack}function C(){const t=u(h);if(!t)throw new Error("useRouterMode must be used inside a Router");return t.mode}function E(){const t=u(h);if(!t)throw new Error("useLocation must be used inside a Router");return function(t,e){const n=m(t),s=t.indexOf("?"),r=t.indexOf("#");return{pathname:n,state:e,search:-1===s?"":t.slice(s,-1===r?void 0:r),hash:-1===r?"":t.slice(r)}}(t.location,t.state)}function B({mode:t,initialPath:e,children:c}){const u=s("memory"===t?new d(e):new f),[l,p]=r(u.current.location),[m,w]=r(u.current.state),[v,y]=r(u.current.canGoBack());n(()=>(p(u.current.location),w(u.current.state),y(u.current.canGoBack()),u.current.listen(t=>{p(t),w(u.current.state),y(u.current.canGoBack())})),[]);const g=o((t,e)=>{const n=u.current;e&&e.replace?n.replace(t,e.state):n.push(t,e?.state)},[]),k=o(t=>{u.current.go(t)},[]),x=i(()=>({location:l,state:m,navigate:g,go:k,canGoBack:v,mode:t}),[l,m,g,k,v,t]);/* @__PURE__ */
2
+ return a(h.Provider,{value:x,children:c})}function _(t){return null}function P(t){return e(t).filter(t=>t?.type===_).map(t=>({path:t.props.path,element:t.props.element,children:t.props.children?P(t.props.children):void 0}))}function G({children:t}){const{location:n}=u(h),r=s([]),o=e(t).filter(t=>t?.type===_).map(t=>t.props.path).join("\0"),l=s("");o!==l.current&&(l.current=o,r.current=P(t));const d=r.current,f=i(()=>y(n,d),[n,d]),m=i(()=>(f??[]).reduce((t,e)=>({...t,...e.params}),{}),[f]),w=i(()=>{if(!f)return null;let t=null;for(let e=f.length-1;e>=0;e--){const n=f[e].route.element;t=/* @__PURE__ */a(p.Provider,{value:{params:m,outlet:t},children:/* @__PURE__ */a(n,{})})}return t},[f,m]);return f?/* @__PURE__ */a(c,{children:w}):null}function b(){/* @__PURE__ */
3
+ return a(c,{children:u(p)?.outlet})}function R({to:t,state:e,replace:n,children:s,className:r,onClick:i,...c}){const l=u(h);/* @__PURE__ */
4
+ return a("a",{href:t,onClick:o(s=>{s.preventDefault(),i?.(s),l?.navigate(t,{state:e,replace:n})},[l,t,e,n,i]),className:r,...c,children:s})}function N({to:t,state:e,replace:n,children:s,className:r,activeClassName:c,onClick:p,...d}){const f=u(h),w=i(()=>{if(!f)return!1;const e=m(f.location);return e===t||!("/"===t||!e.startsWith(`${t}/`))},[f?.location,t]);/* @__PURE__ */
5
+ return a("a",{href:t,onClick:o(s=>{s.preventDefault(),p?.(s),f?.navigate(t,{state:e,replace:n})},[f,t,e,n,p]),className:"function"==typeof r?r({isActive:w}):l(r,w&&c),...d,children:s})}function W({to:t,state:e,replace:s}){const r=k();return n(()=>{queueMicrotask(()=>{r(t,{state:e,replace:s})})},[r,t,e,s]),null}export{_ as a,x as c,g as d,C as f,b as i,E as l,N as n,B as o,W as r,G as s,R as t,k as u};
@@ -1,4 +1,4 @@
1
- import{d as e,s as r,t,v as o}from"./BXMw4kNf.js";import{n as s}from"./CdivXyOP.js";import{x as l}from"./Bb9ydqSB.js";import{u as i}from"./D6q-D1kv.js";import"./BVxovwox.js";var n=e(()=>import("./oZRYetXV.js")),a=e(()=>import("./DMTh6mDu.js")),c=e(()=>import("./2RASYw2m.js")),p=e(()=>import("./WYFR_OYu.js")),d=()=>/* @__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"./BXMw4kNf.js";import{n as s}from"./CdivXyOP.js";import{x as l}from"./Bb9ydqSB.js";import{u as i}from"./BK_hWmGs.js";import"./BVxovwox.js";var n=e(()=>import("./BgZyx8Pz.js")),a=e(()=>import("./Clga4U4Y.js")),c=e(()=>import("./Cnr4EYcL.js")),p=e(()=>import("./e2mrPlw-.js")),d=()=>/* @__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(),u=x?.integrationSettings??{},h=u.mapProvider??"openstreetmap",v=o(e=>{f(l.GALLERY(e))},[f]);if("openstreetmap_free"===h)/* @__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=u.mapTilerApiKey??"",b=u.googleMapsApiKey??"",j=u.mapboxApiKey??"",w=e.filter(e=>"number"==typeof e.location?.x&&"number"==typeof e.location?.y);/* @__PURE__ */