@qratilabs/qrati-connect 2.26.0 → 2.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/element/{CVdpS1mF2.js → 1eQ9Ef0M2.js} +3 -3
  2. package/element/B0sEsGHn.js +8 -0
  3. package/element/B9ImRAum.js +1 -0
  4. package/element/{DwanMJWW.js → BKENYwOQ.js} +1 -1
  5. package/element/{DpD2Abx9.js → BLeZg2Bz.js} +1 -1
  6. package/element/{BfPopwQu2.js → BdkTKcG52.js} +8 -8
  7. package/element/{CwPz_TbG.js → BmsDSHUi.js} +1 -1
  8. package/element/{CM46pkhP2.js → BqiJLitq2.js} +1 -1
  9. package/element/{DLSVYuRG.js → BspExsK7.js} +2 -2
  10. package/element/Bspyv2wJ2.js +24 -0
  11. package/element/{D6nJgjWV.js → C4DSwLWc.js} +1 -1
  12. package/element/{CMR1TPJ1.js → C6MqLLDX.js} +1 -1
  13. package/element/C6YE4WUG2.js +5 -0
  14. package/element/C8meSsHD.js +1 -0
  15. package/element/CBM5QMn8.js +1 -0
  16. package/element/CKQOToSD.js +41 -0
  17. package/element/{DDyjgYNE.js → CUBxHQ8u.js} +1 -1
  18. package/element/CeHBrY_i.js +1 -0
  19. package/element/{BXZi_HIE.js → CfTdZB8y.js} +1 -1
  20. package/element/{xW6UboQF.js → CgxypkdG.js} +1 -1
  21. package/element/{DBUAmPz_.js → Cl0CwL5p.js} +1 -1
  22. package/element/DGZEznLT2.js +1 -0
  23. package/element/{Cw3szkAB.js → DLF5ysgi.js} +1 -1
  24. package/element/{BBWyJmHC.js → DOOdI-Oh.js} +1 -1
  25. package/element/DRPgs6nu2.js +16 -0
  26. package/element/{CDUjv5F52.js → DSx5wvUb2.js} +1 -1
  27. package/element/{BmU1kgIz2.js → DVFC5Z2L2.js} +14 -14
  28. package/element/{D9UPX_0d2.js → DWqIpaZ02.js} +1 -1
  29. package/element/{Bt5DH8OK.js → DZGp2V2-.js} +1 -1
  30. package/element/{DER_7fjj2.js → D_FNRN5A2.js} +1 -1
  31. package/element/{OGzsLhnG.js → DdYePHxG.js} +1 -1
  32. package/element/{BlD6lUxS.js → DlAI3J0X.js} +1 -1
  33. package/element/{CE4Zhv-W.js → DmIYOIw1.js} +1 -1
  34. package/element/DmpmrPE5.js +1 -0
  35. package/element/{Cqyszkb5.js → DvisvxzJ.js} +1 -1
  36. package/element/{CtWIgfGz.js → DyemeRjE2.js} +1 -1
  37. package/element/MU5QuIq0.js +3 -0
  38. package/element/{nOtAuUm1.js → QDuBhueG.js} +1 -1
  39. package/element/{Bb4v1eCh2.js → SgRzjPnr.js} +11 -11
  40. package/element/{PRmGsKkz2.js → Vk429P022.js} +1 -1
  41. package/element/{uIYtFcCq2.js → aXvUP7X72.js} +4 -4
  42. package/element/{BvrbBj1F.js → p0Q_2x6C.js} +1 -1
  43. package/element/{CzHEb5lR2.js → qBKIp1ZW2.js} +14 -14
  44. package/element/web.es.js +4 -4
  45. package/element/{CCDjXLSf.js → xJZs5Gan.js} +1 -1
  46. package/package.json +1 -1
  47. package/element/2CzUGwUv.js +0 -1
  48. package/element/BlmPmkho.js +0 -41
  49. package/element/CD7ZeUsI2.js +0 -9
  50. package/element/CitgNM58.js +0 -3
  51. package/element/DAjJ8IJf.js +0 -1
  52. package/element/DhbEeiM3.js +0 -8
  53. package/element/DvW8TE7T.js +0 -1
  54. package/element/KcnPb5CZ.js +0 -1
  55. package/element/PVzBLdl-2.js +0 -5
  56. package/element/VF9qDLJE2.js +0 -1
  57. package/element/b3Wjw4T02.js +0 -16
@@ -1,4 +1,4 @@
1
- import{_ as e,h as t,t as l,w as n}from"./DrrpB4Om.js";import{i as r}from"./BlmPmkho.js";import{t as s}from"./Bt5DH8OK.js";var a=()=>/* @__PURE__ */l("svg",{className:"size-5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:/* @__PURE__ */l("path",{d:"m15 18-6-6 6-6"})}),o=()=>/* @__PURE__ */l("svg",{className:"size-5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:/* @__PURE__ */l("path",{d:"m9 18 6-6-6-6"})});function i({items:s,autoplayInterval:i=3e3,showControls:d=!1,className:c}){const[u,h]=t(0);return e(()=>{if(s.length<=1)return;const e=setInterval(()=>h(e=>(e+1)%s.length),i);return()=>clearInterval(e)},[s.length,i]),0===s.length?null:/* @__PURE__ */l("div",{className:r("relative size-full overflow-hidden",c),children:[s.map((e,t)=>/* @__PURE__ */l("div",{className:r("absolute inset-0 transition-opacity duration-500",t===u?"opacity-100":"opacity-0"),children:e},t)),s.length>1&&/* @__PURE__ */l("div",{className:"absolute bottom-2 left-1/2 z-10 flex -translate-x-1/2 gap-1",children:s.map((e,t)=>/* @__PURE__ */l("button",{onClick:()=>h(t),className:r("h-1.5 rounded-full transition-all",t===u?"w-4 bg-white":"w-1.5 bg-white/50 hover:bg-white/75"),"aria-label":`Go to slide ${t+1}`},t))}),d&&s.length>1&&/* @__PURE__ */l(n,{children:[/* @__PURE__ */l("button",{onClick:()=>h(e=>0===e?s.length-1:e-1),className:"absolute top-1/2 left-2 z-10 flex size-8 -translate-y-1/2 items-center justify-center rounded-full bg-black/40 text-white hover:bg-black/60","aria-label":"Previous",children:/* @__PURE__ */l(a,{})}),/* @__PURE__ */l("button",{onClick:()=>h(e=>(e+1)%s.length),className:"absolute top-1/2 right-2 z-10 flex size-8 -translate-y-1/2 items-center justify-center rounded-full bg-black/40 text-white hover:bg-black/60","aria-label":"Next",children:/* @__PURE__ */l(o,{})})]})]})}var d=({event:e,onExplore:t})=>{const n=(e.contents||[]).map(t=>/* @__PURE__ */l(s,{alt:e.name,src:t.thumbnailUrl||t.url,containerClassName:"size-full",imgClassName:"rounded"},t._id)),r=e?.status?.toUpperCase();/* @__PURE__ */
1
+ import{_ as e,h as t,t as l,w as n}from"./DrrpB4Om.js";import{i as r}from"./CKQOToSD.js";import{t as s}from"./DZGp2V2-.js";var a=()=>/* @__PURE__ */l("svg",{className:"size-5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:/* @__PURE__ */l("path",{d:"m15 18-6-6 6-6"})}),o=()=>/* @__PURE__ */l("svg",{className:"size-5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:/* @__PURE__ */l("path",{d:"m9 18 6-6-6-6"})});function i({items:s,autoplayInterval:i=3e3,showControls:d=!1,className:c}){const[u,h]=t(0);return e(()=>{if(s.length<=1)return;const e=setInterval(()=>h(e=>(e+1)%s.length),i);return()=>clearInterval(e)},[s.length,i]),0===s.length?null:/* @__PURE__ */l("div",{className:r("relative size-full overflow-hidden",c),children:[s.map((e,t)=>/* @__PURE__ */l("div",{className:r("absolute inset-0 transition-opacity duration-500",t===u?"opacity-100":"opacity-0"),children:e},t)),s.length>1&&/* @__PURE__ */l("div",{className:"absolute bottom-2 left-1/2 z-10 flex -translate-x-1/2 gap-1",children:s.map((e,t)=>/* @__PURE__ */l("button",{onClick:()=>h(t),className:r("h-1.5 rounded-full transition-all",t===u?"w-4 bg-white":"w-1.5 bg-white/50 hover:bg-white/75"),"aria-label":`Go to slide ${t+1}`},t))}),d&&s.length>1&&/* @__PURE__ */l(n,{children:[/* @__PURE__ */l("button",{onClick:()=>h(e=>0===e?s.length-1:e-1),className:"absolute top-1/2 left-2 z-10 flex size-8 -translate-y-1/2 items-center justify-center rounded-full bg-black/40 text-white hover:bg-black/60","aria-label":"Previous",children:/* @__PURE__ */l(a,{})}),/* @__PURE__ */l("button",{onClick:()=>h(e=>(e+1)%s.length),className:"absolute top-1/2 right-2 z-10 flex size-8 -translate-y-1/2 items-center justify-center rounded-full bg-black/40 text-white hover:bg-black/60","aria-label":"Next",children:/* @__PURE__ */l(o,{})})]})]})}var d=({event:e,onExplore:t})=>{const n=(e.contents||[]).map(t=>/* @__PURE__ */l(s,{alt:e.name,src:t.thumbnailUrl||t.url,containerClassName:"size-full",imgClassName:"rounded"},t._id)),r=e?.status?.toUpperCase();/* @__PURE__ */
2
2
  return l("div",{className:"w-40 rounded pt-2 pl-1",children:[
3
3
  /* @__PURE__ */l("div",{className:"relative h-32 w-full overflow-hidden rounded",children:[/* @__PURE__ */l(i,{items:n,autoplayInterval:3e3}),"OPEN"===r&&/* @__PURE__ */l("span",{className:"absolute top-2 left-2 inline-flex items-center gap-1 rounded-full bg-green-500 px-2 py-0.5 text-[10px] font-medium text-white",children:[/* @__PURE__ */l("span",{className:"size-1.5 animate-pulse rounded-full bg-white"}),"Open"]})]}),
4
4
  /* @__PURE__ */l("div",{className:"line-clamp-2 pt-2 pb-0.5 text-sm font-medium text-black",children:e.name}),
@@ -1,4 +1,4 @@
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,p as u,t as h,v as p,w as m,y as g}from"./DrrpB4Om.js";import{a as f,d as v,i as w,n as b,s as y}from"./BlmPmkho.js";import{t as x}from"./Cw3szkAB.js";import{S as N,_ as k,c as C,f as T,g as I,i as E,r as q,x as M}from"./DpD2Abx9.js";import{t as A}from"./OGzsLhnG.js";import{t as L}from"./CE4Zhv-W.js";import{n as S}from"./Bt5DH8OK.js";import{t as j}from"./Bki5T_lb.js";import{t as z}from"./Cqyszkb5.js";import{n as _}from"./BBWyJmHC.js";import{t as O}from"./CtWIgfGz.js";import{n as P,t as R}from"./CD7ZeUsI2.js";import{a as U,i as $,n as B,o as G,r as F,s as D,t as V}from"./CM46pkhP2.js";import{a as W,n as H,o as K,r as Q,t as Y}from"./PRmGsKkz2.js";function Z(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 J(e,t,n){const[[r],a]=o(Z,[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:p(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}}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 h(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:p,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}:{...p,render:i,classes:"photo"},h(le,{ref:g,variables:{photoWidth:v.width,photoHeight:v.height},context:v,...w,children:[h(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:p,button:m,wrapper:g,image:f}={}},v){const{spacing:w,padding:b,containerWidth:y,tracks:x,variables:N,horizontal:k}=r||{};return h(le,{role:"group","aria-label":"Photo album",...d,variables:{spacing:w,padding:b,containerWidth:y,...N},classes:["",t],render:a,ref:v,children:[void 0!==w&&void 0!==b&&void 0!==y&&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 h(ce,{onClick:N,render:c,componentsProps:{image:{loading:"lazy",decoding:"async",src:s,alt:u,title:v,...se(t,n,o,y,d,w,b),...ne(f,e)},link:k(ne(p,e)),button:k(ne(m,e)),wrapper:ne(g,e)},...e},a??r)}))}),void 0===y&&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}var pe=l(function({photos:e,breakpoints:t,defaultContainerWidth:n,...r},o){const{containerRef:i,containerWidth:a}=J(o,t,n),{spacing:s,padding:l,targetRowHeight:c,minPhotos:d,maxPhotos:p,...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 h(de,{layout:"rows",ref:i,model:u(()=>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,p):void 0,[e,s,l,a,c,d,p]),...m})});function me(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 ge(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 me(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 me(l,e,t,n,r,a,s)}function fe(e,t,n,r,o){const{tracks:i,variables:a}=ge(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?fe(e,t,n,r,o-1):void 0:{tracks:i,spacing:t,padding:n,containerWidth:r,variables:{columns:o,...a}}}var ve=l(function({photos:e,breakpoints:t,defaultContainerWidth:n,...r},o){const{containerRef:i,containerWidth:a}=J(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 h(de,{layout:"columns",ref:i,model:u(()=>void 0!==a&&void 0!==s&&void 0!==l&&void 0!==c?fe(e,s,l,a,c):void 0,[e,s,l,a,c]),...d})});function we(e,t,n,r,o){const i=(r-t*(o-1)-2*n*o)/o;if(i<=0)return o>1?we(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 be=l(function({photos:e,breakpoints:t,defaultContainerWidth:n,...r},o){const{containerRef:i,containerWidth:a}=J(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 h(de,{layout:"masonry",ref:i,model:u(()=>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})}),ye={[String(q.NONE)]: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,p as u,t as h,v as p,w as m,y as g}from"./DrrpB4Om.js";import{a as f,i as v,n as w,u as b}from"./CKQOToSD.js";import{t as y}from"./DLF5ysgi.js";import{t as x}from"./DmpmrPE5.js";import{S as N,_ as k,c as T,f as C,g as I,i as E,r as q,x as M}from"./BLeZg2Bz.js";import{t as A}from"./DdYePHxG.js";import{t as L}from"./DmIYOIw1.js";import{n as S}from"./DZGp2V2-.js";import{t as z}from"./Bki5T_lb.js";import{t as _}from"./DvisvxzJ.js";import{n as j}from"./DOOdI-Oh.js";import{t as P}from"./DyemeRjE2.js";import{n as O,t as R}from"./Bspyv2wJ2.js";import{a as U,i as $,n as F,o as G,r as D,s as B,t as V}from"./BqiJLitq2.js";import{a as W,n as H,o as K,r as Q,t as Y}from"./Vk429P022.js";function Z(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 J(e,t,n){const[[r],a]=o(Z,[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:p(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}}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 h(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:p,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}:{...p,render:i,classes:"photo"},h(le,{ref:g,variables:{photoWidth:v.width,photoHeight:v.height},context:v,...w,children:[h(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:p,button:m,wrapper:g,image:f}={}},v){const{spacing:w,padding:b,containerWidth:y,tracks:x,variables:N,horizontal:k}=r||{};return h(le,{role:"group","aria-label":"Photo album",...d,variables:{spacing:w,padding:b,containerWidth:y,...N},classes:["",t],render:a,ref:v,children:[void 0!==w&&void 0!==b&&void 0!==y&&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 h(ce,{onClick:N,render:c,componentsProps:{image:{loading:"lazy",decoding:"async",src:s,alt:u,title:v,...se(t,n,o,y,d,w,b),...ne(f,e)},link:k(ne(p,e)),button:k(ne(m,e)),wrapper:ne(g,e)},...e},a??r)}))}),void 0===y&&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}var pe=l(function({photos:e,breakpoints:t,defaultContainerWidth:n,...r},o){const{containerRef:i,containerWidth:a}=J(o,t,n),{spacing:s,padding:l,targetRowHeight:c,minPhotos:d,maxPhotos:p,...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 h(de,{layout:"rows",ref:i,model:u(()=>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,p):void 0,[e,s,l,a,c,d,p]),...m})});function me(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 ge(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 me(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 me(l,e,t,n,r,a,s)}function fe(e,t,n,r,o){const{tracks:i,variables:a}=ge(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?fe(e,t,n,r,o-1):void 0:{tracks:i,spacing:t,padding:n,containerWidth:r,variables:{columns:o,...a}}}var ve=l(function({photos:e,breakpoints:t,defaultContainerWidth:n,...r},o){const{containerRef:i,containerWidth:a}=J(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 h(de,{layout:"columns",ref:i,model:u(()=>void 0!==a&&void 0!==s&&void 0!==l&&void 0!==c?fe(e,s,l,a,c):void 0,[e,s,l,a,c]),...d})});function we(e,t,n,r,o){const i=(r-t*(o-1)-2*n*o)/o;if(i<=0)return o>1?we(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 be=l(function({photos:e,breakpoints:t,defaultContainerWidth:n,...r},o){const{containerRef:i,containerWidth:a}=J(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 h(de,{layout:"masonry",ref:i,model:u(()=>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})}),ye={[String(q.NONE)]:function({className:e}){/* @__PURE__ */
2
2
  return h("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__ */h("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
3
  return h("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__ */h("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
4
  return h("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__ */h("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__ */
@@ -16,21 +16,21 @@ return h("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",view
16
16
  /* @__PURE__ */h("stop",{offset:"93.482%","stop-color":"#ff5280"}),
17
17
  /* @__PURE__ */h("stop",{offset:"100%","stop-color":"#ff7061"})]})}),
18
18
  /* @__PURE__ */h("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__ */h("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"})]})}},xe=({open:e,ad:t,onClose:n,captureAdClick:r})=>{const o=Boolean(t?.targetType&&t.targetType!==q.NONE),i=ye[t?.targetType]??ye[q.LINK],a=t?.imageUrl&&j(t.imageUrl,["http:","https:"])?t.imageUrl:void 0;/* @__PURE__ */
19
+ /* @__PURE__ */h("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"})]})}},xe=({open:e,ad:t,onClose:n,captureAdClick:r})=>{const o=Boolean(t?.targetType&&t.targetType!==q.NONE),i=ye[t?.targetType]??ye[q.LINK],a=t?.imageUrl&&z(t.imageUrl,["http:","https:"])?t.imageUrl:void 0;/* @__PURE__ */
20
20
  return h(Y,{open:Boolean(e&&t),onOpenChange:e=>!e&&n?.(),children:/* @__PURE__ */h(H,{className:"border-none p-0",children:[/* @__PURE__ */h(W,{className:"sr-only",children:[/* @__PURE__ */h(K,{children:t?.title}),/* @__PURE__ */h(Q,{children:t?.description})]}),/* @__PURE__ */h("div",{className:"flex max-w-2xl flex-col overflow-hidden",children:[a&&/* @__PURE__ */h("img",{className:"h-auto w-full object-contain sm:max-h-96",src:a,alt:t?.title||"Advertisement"}),
21
- /* @__PURE__ */h("div",{className:"flex flex-col gap-2 p-3",children:[/* @__PURE__ */h(L,{variant:"h4",align:"center",lines:2,children:t?.title}),/* @__PURE__ */h(L,{variant:"body3",color:"secondary",align:"center",lines:4,children:t?.description})]}),o&&/* @__PURE__ */h(O,{fullWidth:!0,className:"rounded-none",onClick:()=>{r?.(t?._id,t?.targetType??q.LINK,t?.targetUrl),n?.()},icon:/* @__PURE__ */h(i,{className:"size-5"}),children:t?.targetText})]})]})})},Ne=({style:e,content:t,curateLink:n,onAdClick:r,hideControls:o})=>{const{captureAdImpression:i,captureAdEngagement:a,captureAdClick:s}=B(),l=Boolean(n&&r),c=t.ctaBg||"#ff4800",d=t.ctaForeground||"#FFFFFF",u=ye[t?.targetType??q.LINK];/* @__PURE__ */
21
+ /* @__PURE__ */h("div",{className:"flex flex-col gap-2 p-3",children:[/* @__PURE__ */h(L,{variant:"h4",align:"center",lines:2,children:t?.title}),/* @__PURE__ */h(L,{variant:"body3",color:"secondary",align:"center",lines:4,children:t?.description})]}),o&&/* @__PURE__ */h(P,{fullWidth:!0,className:"rounded-none",onClick:()=>{r?.(t?._id,t?.targetType??q.LINK,t?.targetUrl),n?.()},icon:/* @__PURE__ */h(i,{className:"size-5"}),children:t?.targetText})]})]})})},Ne=({style:e,content:t,curateLink:n,onAdClick:r,hideControls:o})=>{const{captureAdImpression:i,captureAdEngagement:a,captureAdClick:s}=F(),l=Boolean(n&&r),c=t.ctaBg||"#ff4800",d=t.ctaForeground||"#FFFFFF",u=ye[t?.targetType??q.LINK];/* @__PURE__ */
22
22
  return h("div",{style:e,className:"group relative mb-1 overflow-hidden rounded",children:[
23
- /* @__PURE__ */h(S,{className:"size-full",threshold:.8,triggerOnce:!0,onChange:e=>{e&&i(t._id)},onClick:()=>a(t._id),children:/* @__PURE__ */h(z,{url:t.src||t.imageUrl,thumbnailUrl:t.src||t.imageUrl,blurhash:t.blurhash,alt:t.caption,onClick:l?r: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__ */h("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__ */h("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__ */h("div",{className:"bg-background/60 px-3 py-1",children:/* @__PURE__ */h("h3",{className:"line-clamp-1 text-sm font-medium",children:t.title})}),t?.targetType!==q.NONE&&/* @__PURE__ */h("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?.():s(t._id,t.targetType,t.targetUrl)},children:[/* @__PURE__ */h("span",{style:{color:d},children:/* @__PURE__ */h(u,{})}),t?.targetText]})]})]})},ke=({style:e,gamConfig:t,slotIndex:n,eventId:o,organizationId:a})=>{const s=i(null),l=i(null),{trackGamAnalytics:c}=B(),d=`gam-slot-${o??"ev"}-${n}`,u=Math.max(1,Math.round(e?.width||t.sizes[0]?.[0]||300)),p=Math.max(1,Math.round(e?.height||t.sizes[0]?.[1]||250)),m=i({w:u,h:p});return r(()=>{let e=!1,n=null,r=null,i=null,u=null;return(async()=>{await U(),!e&&s.current&&window.googletag.cmd.push(()=>{if(e)return;F(d);const{w:h,h:p}=m.current,g=[[h,p],...t.sizes],f=window.googletag.defineSlot(t.adUnitPath,g,d)?.addService(window.googletag.pubads());if(!f)return;l.current=f,r=window.googletag.pubads(),o?f.setConfig({targeting:{qrati_event:o,...t.categories.length>0?{qrati_category:t.categories}:{}}}):t.categories.length>0&&f.setConfig({targeting:{qrati_category:t.categories}}),i=e=>{e.slot===f&&c({eventId:o,organizationId:a,type:k.GAM_IMPRESSION,creativeId:String(e.creativeId??""),lineItemId:String(e.lineItemId??""),advertiserId:String(e.advertiserId??""),isEmpty:e.isEmpty??!1})},r.addEventListener("slotRenderEnded",i),u=e=>{e.slot===f&&c({eventId:o,organizationId:a,type:k.GAM_VIEWABLE})},r.addEventListener("impressionViewable",u);const v=s.current;v&&(n=V({container:v,onClick:()=>{c({eventId:o,organizationId:a,type:k.GAM_CLICK})}}),$(),window.googletag.display(d))})})(),()=>{e=!0,n?.(),r&&"function"==typeof r.removeEventListener&&(i&&r.removeEventListener("slotRenderEnded",i),u&&r.removeEventListener("impressionViewable",u));const t=l.current;l.current=null,t&&window.googletag?.cmd?.push(()=>{window.googletag.destroySlots([t])})}},[o,t.adUnitPath,t.categories,a,d]),/* @__PURE__ */h("div",{style:{width:u,height:p},className:"relative overflow-hidden rounded bg-neutral-100 dark:bg-neutral-800","data-gam-slot-index":n,children:/* @__PURE__ */h("div",{id:d,ref:s,style:{width:u,height:p},className:"gam-ad-slot"})})},Ce=(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}},Te=t(null),Ie=()=>{const e=g(Te);if(!e)throw new Error("Popover components must be used within a Popover");return e},Ee=({children:e,className:t,open:n,onOpenChange:r})=>{const[o,l]=s(!1),c="boolean"==typeof n,d=c?n:o,u=a(),p=`popover-trigger-${u}`,m=`popover-content-${u}`,g=i(null);/* @__PURE__ */
25
- return h(Te.Provider,{value:{isOpen:d,setIsOpen:e=>{c||l(e),r?.(e)},triggerId:p,contentId:m,triggerRef:g},children:/* @__PURE__ */h("div",{"data-slot":"popover",className:w("relative inline-block",t),children:e})})},qe=({children:e,asChild:t,className:r,onClick:o,...i})=>{const{isOpen:a,setIsOpen:s,triggerId:l,contentId:c,triggerRef:d}=Ie();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 h("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})},Me=({children:e,className:t,align:n="center",side:o="top",sideOffset:a=4,...l})=>{const{isOpen:u,setIsOpen:p,contentId:m,triggerRef:g}=Ie(),{organization:v,portalContainer:y}=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||p(!1)},t=e=>{"Escape"===e.key&&(p(!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,p,g]),!u)return null;const C=/* @__PURE__ */h("div",{ref:x,id:m,role:"dialog","aria-modal":"false","data-state":u?"open":"closed",className:w("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,...f(v)},...l,children:e});return"undefined"!=typeof document?d(C,y??document.body):C},Ae=({eventId:e,contentId:t,emojis:n=[],counts:o={},userReaction:a})=>{const{user:l,props:c,organization:d}=b(),u=c?.loginUrl,{handleReactionClick:p,isPending:m}=(()=>{const e=v(),{props:t,user:n}=b(),r=t?.organizationId,o=x({mutationFn:async({eventId:e,contentId:t,emoji:o})=>{await y.post(E.UPDATE_REACTION,{json:{eventId:e,contentId:t,reaction:o},headers:{"x-org-id":r,Authorization:`Bearer ${n?.token}`}})},onMutate:async({eventId:t,contentId:n,emoji:r})=>{const o=[N.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?(r[n]=Math.max(0,(r[n]??1)-1),{...e,reactionCounts:r,userReaction:void 0}):(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)}),_.error("Failed to add reaction"),console.error("Error handling reaction click:",t,n)}});return{handleReactionClick:async(e,t,r)=>{if(!e||!t||!r)return!1;if(!n)return _.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),[k,C]=s(null),T=i(null),I=Object.values(o).reduce((e,t)=>e+t,0);return r(()=>()=>{T.current&&clearTimeout(T.current)},[]),/* @__PURE__ */h(Ee,{open:g,onOpenChange:f,children:[/* @__PURE__ */h(qe,{asChild:!0,children:/* @__PURE__ */h("button",{type:"button",className:w("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",k&&"scale-[1.03] shadow-sm"),children:[(n||[]).slice().sort((e,t)=>(o[t]||0)-(o[e]||0)).slice(0,1).map(e=>/* @__PURE__ */h("span",{className:w("text-sm transition-transform duration-150 ease-out sm:text-lg",k===(a||e)&&"scale-125"),children:a||e},`${t}-${e}-1`)),I>0&&/* @__PURE__ */h("span",{className:"text-xs font-bold sm:text-sm",children:I||0})]})}),/* @__PURE__ */h(Me,{side:"top",align:"end",children:[l?null:/* @__PURE__ */h("div",d?.customAuth?{className:"p-2 font-semibold",children:["Please"," ",
23
+ /* @__PURE__ */h(S,{className:"size-full",threshold:.8,triggerOnce:!0,onChange:e=>{e&&i(t._id)},onClick:()=>a(t._id),children:/* @__PURE__ */h(_,{url:t.src||t.imageUrl,thumbnailUrl:t.src||t.imageUrl,blurhash:t.blurhash,alt:t.caption,onClick:l?r:void 0,pswpData:{id:t._id,type:T.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__ */h("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__ */h("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__ */h("div",{className:"bg-background/60 px-3 py-1",children:/* @__PURE__ */h("h3",{className:"line-clamp-1 text-sm font-medium",children:t.title})}),t?.targetType!==q.NONE&&/* @__PURE__ */h("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?.():s(t._id,t.targetType,t.targetUrl)},children:[/* @__PURE__ */h("span",{style:{color:d},children:/* @__PURE__ */h(u,{})}),t?.targetText]})]})]})},ke=({style:e,gamConfig:t,slotIndex:n,eventId:o,organizationId:a})=>{const s=i(null),l=i(null),{trackGamAnalytics:c}=F(),d=`gam-slot-${o??"ev"}-${n}`,u=Math.max(1,Math.round(e?.width||t.sizes[0]?.[0]||300)),p=Math.max(1,Math.round(e?.height||t.sizes[0]?.[1]||250)),m=i({w:u,h:p});return r(()=>{let e=!1,n=null,r=null,i=null,u=null;return(async()=>{await U(),!e&&s.current&&window.googletag.cmd.push(()=>{if(e)return;D(d);const{w:h,h:p}=m.current,g=[[h,p],...t.sizes],f=window.googletag.defineSlot(t.adUnitPath,g,d)?.addService(window.googletag.pubads());if(!f)return;l.current=f,r=window.googletag.pubads(),o?f.setConfig({targeting:{qrati_event:o,...t.categories.length>0?{qrati_category:t.categories}:{}}}):t.categories.length>0&&f.setConfig({targeting:{qrati_category:t.categories}}),i=e=>{e.slot===f&&c({eventId:o,organizationId:a,type:k.GAM_IMPRESSION,creativeId:String(e.creativeId??""),lineItemId:String(e.lineItemId??""),advertiserId:String(e.advertiserId??""),isEmpty:e.isEmpty??!1})},r.addEventListener("slotRenderEnded",i),u=e=>{e.slot===f&&c({eventId:o,organizationId:a,type:k.GAM_VIEWABLE})},r.addEventListener("impressionViewable",u);const v=s.current;v&&(n=V({container:v,onClick:()=>{c({eventId:o,organizationId:a,type:k.GAM_CLICK})}}),$(),window.googletag.display(d))})})(),()=>{e=!0,n?.(),r&&"function"==typeof r.removeEventListener&&(i&&r.removeEventListener("slotRenderEnded",i),u&&r.removeEventListener("impressionViewable",u));const t=l.current;l.current=null,t&&window.googletag?.cmd?.push(()=>{window.googletag.destroySlots([t])})}},[o,t.adUnitPath,t.categories,a,d]),/* @__PURE__ */h("div",{style:{width:u,height:p},className:"relative overflow-hidden rounded bg-neutral-100 dark:bg-neutral-800","data-gam-slot-index":n,children:/* @__PURE__ */h("div",{id:d,ref:s,style:{width:u,height:p},className:"gam-ad-slot"})})},Te=(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}},Ce=t(null),Ie=()=>{const e=g(Ce);if(!e)throw new Error("Popover components must be used within a Popover");return e},Ee=({children:e,className:t,open:n,onOpenChange:r})=>{const[o,l]=s(!1),c="boolean"==typeof n,d=c?n:o,u=a(),p=`popover-trigger-${u}`,m=`popover-content-${u}`,g=i(null);/* @__PURE__ */
25
+ return h(Ce.Provider,{value:{isOpen:d,setIsOpen:e=>{c||l(e),r?.(e)},triggerId:p,contentId:m,triggerRef:g},children:/* @__PURE__ */h("div",{"data-slot":"popover",className:v("relative inline-block",t),children:e})})},qe=({children:e,asChild:t,className:r,onClick:o,...i})=>{const{isOpen:a,setIsOpen:s,triggerId:l,contentId:c,triggerRef:d}=Ie();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 h("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})},Me=({children:e,className:t,align:n="center",side:o="top",sideOffset:a=4,...l})=>{const{isOpen:u,setIsOpen:p,contentId:m,triggerRef:g}=Ie(),{organization:b,portalContainer:y}=w(),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||p(!1)},t=e=>{"Escape"===e.key&&(p(!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,p,g]),!u)return null;const T=/* @__PURE__ */h("div",{ref:x,id:m,role:"dialog","aria-modal":"false","data-state":u?"open":"closed",className:v("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,...f(b)},...l,children:e});return"undefined"!=typeof document?d(T,y??document.body):T},Ae=({eventId:e,contentId:t,emojis:n=[],counts:o={},userReaction:a})=>{const{user:l,props:c,organization:d}=w(),u=c?.loginUrl,{handleReactionClick:p,isPending:m}=(()=>{const e=b(),{props:t,user:n}=w(),r=t?.organizationId,o=y({mutationFn:async({eventId:e,contentId:t,emoji:o})=>{await x.post(E.UPDATE_REACTION,{json:{eventId:e,contentId:t,reaction:o},headers:{"x-org-id":r,Authorization:`Bearer ${n?.token}`}})},onMutate:async({eventId:t,contentId:n,emoji:r})=>{const o=[N.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?(r[n]=Math.max(0,(r[n]??1)-1),{...e,reactionCounts:r,userReaction:void 0}):(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)}),j.error("Failed to add reaction"),console.error("Error handling reaction click:",t,n)}});return{handleReactionClick:async(e,t,r)=>{if(!e||!t||!r)return!1;if(!n)return j.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),[k,T]=s(null),C=i(null),I=Object.values(o).reduce((e,t)=>e+t,0);return r(()=>()=>{C.current&&clearTimeout(C.current)},[]),/* @__PURE__ */h(Ee,{open:g,onOpenChange:f,children:[/* @__PURE__ */h(qe,{asChild:!0,children:/* @__PURE__ */h("button",{type:"button",className:v("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",k&&"scale-[1.03] shadow-sm"),children:[(n||[]).slice().sort((e,t)=>(o[t]||0)-(o[e]||0)).slice(0,1).map(e=>/* @__PURE__ */h("span",{className:v("text-sm transition-transform duration-150 ease-out sm:text-lg",k===(a||e)&&"scale-125"),children:a||e},`${t}-${e}-1`)),I>0&&/* @__PURE__ */h("span",{className:"text-xs font-bold sm:text-sm",children:I||0})]})}),/* @__PURE__ */h(Me,{side:"top",align:"end",children:[l?null:/* @__PURE__ */h("div",d?.customAuth?{className:"p-2 font-semibold",children:["Please"," ",
27
27
  /* @__PURE__ */h("a",{className:"text-info underline",href:u,children:"Login"})," ","to react"]}:{className:"p-2 font-semibold",children:["Please"," ",
28
28
  /* @__PURE__ */h(A,{className:"text-info underline",to:M.LOGIN,children:"Login"})," ","to react"]}),l&&/* @__PURE__ */h("div",{className:"flex gap-1 p-2",children:n.map(n=>{const r=a===n;/* @__PURE__ */
29
- return h("div",{className:"flex flex-col items-center",children:[/* @__PURE__ */h("span",{className:"text-xs font-medium",children:o[n]||0}),/* @__PURE__ */h("button",{type:"button",disabled:m,className:w("text-3xl transition-transform duration-150 ease-out disabled:opacity-50",r?"scale-125":"hover:scale-110",k===n&&"scale-125",m&&"cursor-not-allowed"),onClick:()=>(async n=>{!m&&p&&(C(n),f(!1),T.current&&clearTimeout(T.current),T.current=setTimeout(()=>C(null),180),p(e,t,n))})(n),children:n})]},`${t}-${n}-2`)})})]})]})},Le=({event:e={},content:t,curateLink:n})=>e.engagementStyle===T.CONTEST?/* @__PURE__ */h("button",{className:"bg-background/75 flex items-center gap-1 rounded px-2 py-1",children:[/* @__PURE__ */h(D,{className:"size-4"}),/* @__PURE__ */h("span",{className:"text-xs font-semibold",children:parseFloat(String(t.score||0)).toFixed(1)})]}):e.engagementStyle===T.REACTION&&e.reactionEmojis?.length?/* @__PURE__ */h(Ae,{eventId:e?._id,contentId:t._id,emojis:e?.reactionEmojis,engagementStyle:e?.engagementStyle,counts:t.reactionCounts||{},userReaction:t.userReaction}):null,Se=({content:e})=>/* @__PURE__ */h("div",{className:"w-full space-y-3 px-3 pb-3",children:[e?.caption&&/* @__PURE__ */h("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__ */h("div",{role:"note",title:e?.caption,className:"lg:text-md line-clamp-1 text-xs text-white lg:font-medium",children:e?.caption})}),/* @__PURE__ */h("div",{className:"flex items-center justify-between",children:/* @__PURE__ */h("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})})]}),je=({event:e,content:t,style:n,timestampField:r,curateLink:o,onChangeFaceUrl:i,hideControls:a,showQuickSearch:s,showBingSearch:l})=>{const c=`content-${t._id}`,d=u(()=>Ce(r,t),[r,t]),g=p(()=>{i?.(t?.url);const e=document.getElementById("media-gallery-container");e&&e.scrollIntoView({behavior:"smooth",block:"start"})},[i,t?.url]),f=u(()=>({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 h("div",{id:c,style:n,className:"group relative mb-1 overflow-hidden rounded [content-visibility:auto]",children:[/* @__PURE__ */h(z,{url:t.src,alt:t.caption,blurhash:t.blurhash,thumbnailUrl:t.thumbnailUrl,curateLink:o,pswpData:f}),!a&&/* @__PURE__ */h(m,{children:[d&&/* @__PURE__ */h("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:d}),
31
- /* @__PURE__ */h("div",{className:"absolute top-2 right-2 flex flex-col gap-2",children:[s&&(t.faces?.length??0)>0&&/* @__PURE__ */h("button",{className:"bg-primary rounded-full p-1 text-gray-200 opacity-50 transition-all sm:p-1.5 sm:hover:scale-110 sm:hover:opacity-100",onClick:g,children:/* @__PURE__ */h(G,{className:"text-primary-foreground"})}),l&&t.url&&/* @__PURE__ */h("button",{className:"bg-background cursor-pointer bg-opacity-50 rounded-full p-1 opacity-50 transition-all sm:p-1.5 sm:hover:scale-110 sm:hover:opacity-100",onClick:()=>window.open(P(t.url),"_blank","noopener,noreferrer"),"aria-label":"Search this image on Bing",children:/* @__PURE__ */h(R,{})})]}),
32
- /* @__PURE__ */h("div",{className:"",children:[/* @__PURE__ */h("div",{className:"absolute bottom-0 w-full rounded-b",children:/* @__PURE__ */h(Se,{content:t})}),/* @__PURE__ */h("div",{className:"absolute right-2 bottom-2",children:/* @__PURE__ */h(Le,{event:e,content:t,curateLink:o})})]})]})]})},ze=({content:e,style:t,event:n,timestampField:r,curateLink:o,hideControls:i})=>{const a=u(()=>Ce(r,e),[r,e]);/* @__PURE__ */
33
- return h("div",{id:`content-${e._id}`,className:"group relative mb-1 overflow-hidden rounded [content-visibility:auto]",style:t,children:[/* @__PURE__ */h(z,{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__ */h("div",{className:"transition-opacity duration-500",children:[a&&/* @__PURE__ */h("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}),
29
+ return h("div",{className:"flex flex-col items-center",children:[/* @__PURE__ */h("span",{className:"text-xs font-medium",children:o[n]||0}),/* @__PURE__ */h("button",{type:"button",disabled:m,className:v("text-3xl transition-transform duration-150 ease-out disabled:opacity-50",r?"scale-125":"hover:scale-110",k===n&&"scale-125",m&&"cursor-not-allowed"),onClick:()=>(async n=>{!m&&p&&(T(n),f(!1),C.current&&clearTimeout(C.current),C.current=setTimeout(()=>T(null),180),p(e,t,n))})(n),children:n})]},`${t}-${n}-2`)})})]})]})},Le=({event:e={},content:t,curateLink:n})=>e.engagementStyle===C.CONTEST?/* @__PURE__ */h("button",{className:"bg-background/75 flex items-center gap-1 rounded px-2 py-1",children:[/* @__PURE__ */h(B,{className:"size-4"}),/* @__PURE__ */h("span",{className:"text-xs font-semibold",children:parseFloat(String(t.score||0)).toFixed(1)})]}):e.engagementStyle===C.REACTION&&e.reactionEmojis?.length?/* @__PURE__ */h(Ae,{eventId:e?._id,contentId:t._id,emojis:e?.reactionEmojis,engagementStyle:e?.engagementStyle,counts:t.reactionCounts||{},userReaction:t.userReaction}):null,Se=({content:e})=>/* @__PURE__ */h("div",{className:"w-full space-y-3 px-3 pb-3",children:[e?.caption&&/* @__PURE__ */h("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__ */h("div",{role:"note",title:e?.caption,className:"lg:text-md line-clamp-1 text-xs text-white lg:font-medium",children:e?.caption})}),/* @__PURE__ */h("div",{className:"flex items-center justify-between",children:/* @__PURE__ */h("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})})]}),ze=({event:e,content:t,style:n,timestampField:r,curateLink:o,onChangeFaceUrl:i,hideControls:a,showQuickSearch:s,imageSearchProviders:l=O,organizationId:c})=>{const d=`content-${t._id}`,g=u(()=>Te(r,t),[r,t]),f=p(()=>{i?.(t?.url);const e=document.getElementById("media-gallery-container");e&&e.scrollIntoView({behavior:"smooth",block:"start"})},[i,t?.url]),v=u(()=>({id:t._id,type:T.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 h("div",{id:d,style:n,className:"group relative mb-1 overflow-hidden rounded [content-visibility:auto]",children:[/* @__PURE__ */h(_,{url:t.src,alt:t.caption,blurhash:t.blurhash,thumbnailUrl:t.thumbnailUrl,curateLink:o,pswpData:v}),!a&&/* @__PURE__ */h(m,{children:[g&&/* @__PURE__ */h("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:g}),
31
+ /* @__PURE__ */h("div",{className:"absolute top-2 right-2 flex flex-col gap-2",children:[s&&(t.faces?.length??0)>0&&/* @__PURE__ */h("button",{className:"bg-primary rounded-full p-1 text-gray-200 opacity-50 transition-all sm:p-1.5 sm:hover:scale-110 sm:hover:opacity-100",onClick:f,children:/* @__PURE__ */h(G,{className:"text-primary-foreground"})}),t.url&&/* @__PURE__ */h(R,{providers:l,imageUrl:t.url,surface:"gallery",organizationId:c,eventId:e?._id,contentId:t._id})]}),
32
+ /* @__PURE__ */h("div",{className:"",children:[/* @__PURE__ */h("div",{className:"absolute bottom-0 w-full rounded-b",children:/* @__PURE__ */h(Se,{content:t})}),/* @__PURE__ */h("div",{className:"absolute right-2 bottom-2",children:/* @__PURE__ */h(Le,{event:e,content:t,curateLink:o})})]})]})]})},_e=({content:e,style:t,event:n,timestampField:r,curateLink:o,hideControls:i})=>{const a=u(()=>Te(r,e),[r,e]);/* @__PURE__ */
33
+ return h("div",{id:`content-${e._id}`,className:"group relative mb-1 overflow-hidden rounded [content-visibility:auto]",style:t,children:[/* @__PURE__ */h(_,{url:e.src??e.url,thumbnailUrl:e.thumbnailUrl,blurhash:e.blurhash,alt:e.caption,curateLink:o,pswpData:{id:e._id,type:T.VIDEO,hash:e._id,width:e.width,height:e.height,thumbnailUrl:e.thumbnailUrl,blurhash:e.blurhash,caption:e.caption}}),!i&&/* @__PURE__ */h("div",{className:"transition-opacity duration-500",children:[a&&/* @__PURE__ */h("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
34
  /* @__PURE__ */h("div",{className:"absolute bottom-0 w-full rounded-b",children:/* @__PURE__ */h(Se,{content:e})}),
35
- /* @__PURE__ */h("div",{className:"absolute right-2 bottom-2",children:/* @__PURE__ */h(Le,{event:n,content:e,curateLink:o})})]})]})},_e=({event:e,contents:t=[],gamConfig:n,singleColumnMode:o,kioskMode:a,timestampField:l,curateLink:c,onChangeFaceUrl:d,showQuickSearch:g})=>{const f=i(null),v=i(!1),y=i(null),x=u(()=>`gallery-${e?._id??""}`,[e?._id]),{captureAdImpression:N,captureAdClick:k}=B(),{portalContainer:T,organization:E}=b(),q=E?._id,M=Boolean(E?.advancedSettings?.bingImageSearch?.showInGallery),A=Boolean(E?.advancedSettings?.bingImageSearch?.showInLightbox),[L,S]=s(null);r(()=>()=>{f.current?.destroy?.(),f.current=null},[e?.galleryLayout,c,x,T]);const j=p(async e=>{if(c||f.current||v.current)return;const t=y.current,n=e.target.closest("a");if(!t||!n||!t.contains(n))return;e.preventDefault(),v.current=!0;const r=Array.from(t.querySelectorAll("a")).indexOf(n);try{const[{default:e},{default:n},{default:o},{default:i},{default:a},{default:s},{default:l},{loadPhotoSwipe:c},d]=await Promise.all([import("./web.es.js").then(e=>e.n),import("./Bo39kG4k2.js"),import("./BwwxqSTC2.js"),import("./BNaRcekR2.js"),import("./CDUjv5F52.js"),import("./CtxIOzTC2.js"),import("./1dmOpMwn2.js"),import("./web.es.js").then(e=>e.t),A?import("./VF9qDLJE2.js"):Promise.resolve(null)]),u=new e({gallery:t,children:"a",counter:!1,bgOpacity:1,wheelToZoom:!0,pinchToClose:!0,zoom:!1,pswpModule:c,appendToEl:T??document.body});f.current=u,new n(u),new o(u),new i(u),new a(u,N,k),new s(u),new l(u),d&&new d.default(u),u.init(),r>=0&&f.current?.loadAndOpen?.(r)}finally{v.current=!1}},[c,T,N,k,A]),z=u(()=>{switch(e?.galleryLayout){case I.ROW:return pe;case I.COLUMN:return ve;case I.MASONRY:return be;default:return pe}},[e?.galleryLayout]),_=u(()=>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=u(()=>({container:({ref:e,className:t,children:n})=>/* @__PURE__ */h("div",{ref:e,className:t??"",children:n}),photo:(t,{photo:r,width:o,height:i,index:s})=>{const u=r;let p=null;switch(u.type){case C.IMAGE:p=je;break;case C.VIDEO:p=ze;break;case C.AD:p=Ne;break;case C.GAM_AD:return n?/* @__PURE__ */h(ke,{style:{width:o,height:i},gamConfig:n,slotIndex:u.slotIndex??s,eventId:e?._id,organizationId:q},`${u._id??s}-${s}`):null;default:p=null}return p?/* @__PURE__ */h(p,{style:{width:o,height:i},event:e,content:u,timestampField:l,onAdClick:c?()=>S(u):void 0,hideControls:a,curateLink:c?`${c}/${u._id}`:null,onChangeFaceUrl:d,showQuickSearch:g,showBingSearch:M},`${u._id??s}-${s}`):null}}),[e,n,q,l,c,a,d,g,M]);/* @__PURE__ */
36
- return h(m,{children:[/* @__PURE__ */h("div",{id:x,ref:y,onClickCapture:j,className:w(o?"w-full lg:w-1/3":"w-full"),children:/* @__PURE__ */h(z,{spacing:4,rowConstraints:e=>{const t={minPhotos:1,maxPhotos:4,singleRowMaxHeight:400};return o&&(t.minPhotos=1,t.maxPhotos=e<400?2:e<800?3:4),t},columns:e=>o?1:e<400?2:e<800?3:4,photos:_,render:O})}),/* @__PURE__ */h(xe,{open:Boolean(L),ad:L,onClose:()=>S(null),captureAdClick:k})]})};export{_e as default};
35
+ /* @__PURE__ */h("div",{className:"absolute right-2 bottom-2",children:/* @__PURE__ */h(Le,{event:n,content:e,curateLink:o})})]})]})},je=({event:e,contents:t=[],gamConfig:n,singleColumnMode:o,kioskMode:a,timestampField:l,curateLink:c,onChangeFaceUrl:d,showQuickSearch:g})=>{const f=i(null),b=i(!1),y=i(null),x=u(()=>`gallery-${e?._id??""}`,[e?._id]),{captureAdImpression:N,captureAdClick:k}=F(),{portalContainer:C,organization:E}=w(),q=E?._id,M=E?.advancedSettings?.imageSearchProviders?.gallery??O,A=E?.advancedSettings?.imageSearchProviders?.lightbox??O,[L,S]=s(null);r(()=>()=>{f.current?.destroy?.(),f.current=null},[e?.galleryLayout,c,x,C]);const z=p(async t=>{if(c||f.current||b.current)return;const n=y.current,r=t.target.closest("a");if(!n||!r||!n.contains(r))return;t.preventDefault(),b.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("./BwwxqSTC2.js"),import("./BNaRcekR2.js"),import("./DSx5wvUb2.js"),import("./CtxIOzTC2.js"),import("./1dmOpMwn2.js"),import("./web.es.js").then(e=>e.t),A.length>0?import("./DGZEznLT2.js"):Promise.resolve(null)]),h=new t({gallery:n,children:"a",counter:!1,bgOpacity:1,wheelToZoom:!0,pinchToClose:!0,zoom:!1,pswpModule:d,appendToEl:C??document.body});f.current=h,new r(h),new i(h),u&&new u.default(h,A,{organizationId:q,eventId:e?._id}),new a(h),new s(h,N,k),new l(h),new c(h),h.init(),o>=0&&f.current?.loadAndOpen?.(o)}finally{b.current=!1}},[c,C,N,k,A,q,e?._id]),_=u(()=>{switch(e?.galleryLayout){case I.ROW:return pe;case I.COLUMN:return ve;case I.MASONRY:return be;default:return pe}},[e?.galleryLayout]),j=u(()=>t.map(e=>{const t=e.type===T.IMAGE||e.type===T.VIDEO?e.url:e.type===T.GAM_AD?"":e.imageUrl;return{...e,src:t??"",width:e.dimension?.width||e.width||4,height:e.dimension?.height||e.height||3}}),[t]),P=u(()=>({container:({ref:e,className:t,children:n})=>/* @__PURE__ */h("div",{ref:e,className:t??"",children:n}),photo:(t,{photo:r,width:o,height:i,index:s})=>{const u=r;let p=null;switch(u.type){case T.IMAGE:p=ze;break;case T.VIDEO:p=_e;break;case T.AD:p=Ne;break;case T.GAM_AD:return n?/* @__PURE__ */h(ke,{style:{width:o,height:i},gamConfig:n,slotIndex:u.slotIndex??s,eventId:e?._id,organizationId:q},`${u._id??s}-${s}`):null;default:p=null}return p?/* @__PURE__ */h(p,{style:{width:o,height:i},event:e,content:u,timestampField:l,onAdClick:c?()=>S(u):void 0,hideControls:a,curateLink:c?`${c}/${u._id}`:null,onChangeFaceUrl:d,showQuickSearch:g,imageSearchProviders:M,organizationId:q},`${u._id??s}-${s}`):null}}),[e,n,q,l,c,a,d,g,M]);/* @__PURE__ */
36
+ return h(m,{children:[/* @__PURE__ */h("div",{id:x,ref:y,onClickCapture:z,className:v(o?"w-full lg:w-1/3":"w-full"),children:/* @__PURE__ */h(_,{spacing:4,rowConstraints:e=>{const t={minPhotos:1,maxPhotos:4,singleRowMaxHeight:400};return o&&(t.minPhotos=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:P})}),/* @__PURE__ */h(xe,{open:Boolean(L),ad:L,onClose:()=>S(null),captureAdClick:k})]})};export{je as default};