@qratilabs/qrati-connect 2.23.4 → 2.23.6

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 (107) hide show
  1. package/element/{DB68-h-C.js → 4VTPoA38.js} +1 -1
  2. package/element/{BmFX4pgV2.js → 7GXdePWm2.js} +10 -10
  3. package/element/{CJpmOICA.js → B14kCOq8.js} +1 -1
  4. package/{umd/CCm2-mcE2.js → element/B78xAjNG2.js} +4 -4
  5. package/element/{TV5seYRS.js → BItJQVdK.js} +3 -3
  6. package/element/{DcLlwdC6.js → BNEa3Uj4.js} +1 -1
  7. package/element/{Hfo3iOYG2.js → BQuhYd4G2.js} +2 -2
  8. package/element/{B7EvJYrt2.js → BdOzsWR32.js} +1 -1
  9. package/element/{DGHG5MsV.js → Be1e_ATJ.js} +1 -1
  10. package/{umd/CwE8D5S0.js → element/BglDIiFp.js} +1 -1
  11. package/{umd/WX3mhhd9.js → element/BkvtmX4K.js} +1 -1
  12. package/element/{BhWrOCDI2.js → Bm_xW_Mp2.js} +3 -3
  13. package/{umd/E5aJy_fH.js → element/BtN9y353.js} +1 -1
  14. package/element/{CKk0UYyd.js → Byk0pccK.js} +1 -1
  15. package/element/{CiryJz3K2.js → C3HKK1w_2.js} +85 -86
  16. package/element/C3uDEVBt.js +1 -0
  17. package/element/{DZ2f3-jO.js → C8_zGNAf.js} +1 -1
  18. package/element/{DcL9Mr2r.js → C9ak4yUT.js} +2 -3
  19. package/element/{YJHG0sOk.js → CCLXmMXp.js} +1 -1
  20. package/element/{CslFRHxJ2.js → CGc52QIP2.js} +14 -14
  21. package/{umd/DD6up6cl2.js → element/CXg838Gr2.js} +1 -1
  22. package/element/{CtYiLBXL.js → Cb1JRT_1.js} +1 -1
  23. package/{umd/DYU4JC0C2.js → element/CebL6kYV2.js} +4 -4
  24. package/{umd/DBS5eoAD.js → element/CiiNqDJq.js} +1 -1
  25. package/element/{CpBGzCRR2.js → Cj4nJyT42.js} +1 -1
  26. package/{umd/D5TvVWUK.js → element/CnoPTYOO.js} +1 -1
  27. package/element/{CpaT2goE2.js → CxgDoGDT2.js} +1 -1
  28. package/{umd/DiBNGdQS.js → element/D0VKfxwE.js} +10 -10
  29. package/element/{DP5TIAjd2.js → D5MjLaap2.js} +1 -1
  30. package/element/{DJWnpm1A2.js → D5YBxlTz2.js} +39 -39
  31. package/{umd/BCyTQnZ1.js → element/D9NypPiv.js} +1 -1
  32. package/element/{C9HFLidt.js → DIYUC8M3.js} +1 -1
  33. package/element/{Boh-45fW.js → DNAwNX6_.js} +2 -2
  34. package/{umd/BCu0TrNB2.js → element/DNG5BSHx2.js} +1 -1
  35. package/element/DXx41__x2.js +2 -0
  36. package/{umd/DnW7WNo1.js → element/Dgs_iVn3.js} +1 -1
  37. package/{umd/BNj7xAbL.js → element/DsvRTvCp.js} +1 -1
  38. package/element/{DWbLshVZ.js → DvTRhlvs.js} +1 -1
  39. package/element/{D9MdXU5q2.js → MpvHkxaz2.js} +1 -1
  40. package/element/R0dHh5Az2.js +9 -0
  41. package/{umd/u7SUQ9Kb2.js → element/VakK6fPh2.js} +1 -1
  42. package/element/{CnAKuO192.js → _bFyk49H2.js} +3 -3
  43. package/element/{DXrH_HhZ.js → _ty2jtjs.js} +1 -1
  44. package/element/{Crix9_9X.js → b6CwQBFC.js} +5 -5
  45. package/element/{BbWh89xA2.js → d_bA36WR2.js} +1 -1
  46. package/element/{CuRZaTn5.js → ekog7y-V.js} +1 -1
  47. package/{umd/D8Se70tP2.js → element/gjXXuILV2.js} +1 -1
  48. package/element/{DmSY4t_i.js → qWp4ucdT.js} +1 -1
  49. package/element/web.es.js +42 -42
  50. package/package.json +1 -1
  51. package/react/index.d.mts +6 -117
  52. package/react/index.d.ts +6 -117
  53. package/umd/{DB68-h-C.js → 4VTPoA38.js} +1 -1
  54. package/umd/{BmFX4pgV2.js → 7GXdePWm2.js} +10 -10
  55. package/umd/{CJpmOICA.js → B14kCOq8.js} +1 -1
  56. package/{element/CCm2-mcE2.js → umd/B78xAjNG2.js} +4 -4
  57. package/umd/{TV5seYRS.js → BItJQVdK.js} +3 -3
  58. package/umd/{DcLlwdC6.js → BNEa3Uj4.js} +1 -1
  59. package/umd/{Hfo3iOYG2.js → BQuhYd4G2.js} +2 -2
  60. package/umd/{B7EvJYrt2.js → BdOzsWR32.js} +1 -1
  61. package/umd/{DGHG5MsV.js → Be1e_ATJ.js} +1 -1
  62. package/{element/CwE8D5S0.js → umd/BglDIiFp.js} +1 -1
  63. package/{element/WX3mhhd9.js → umd/BkvtmX4K.js} +1 -1
  64. package/umd/{BhWrOCDI2.js → Bm_xW_Mp2.js} +3 -3
  65. package/{element/E5aJy_fH.js → umd/BtN9y353.js} +1 -1
  66. package/umd/{CKk0UYyd.js → Byk0pccK.js} +1 -1
  67. package/umd/{CiryJz3K2.js → C3HKK1w_2.js} +85 -86
  68. package/umd/C3uDEVBt.js +1 -0
  69. package/umd/{DZ2f3-jO.js → C8_zGNAf.js} +1 -1
  70. package/umd/{DcL9Mr2r.js → C9ak4yUT.js} +2 -3
  71. package/umd/{YJHG0sOk.js → CCLXmMXp.js} +1 -1
  72. package/umd/{CslFRHxJ2.js → CGc52QIP2.js} +14 -14
  73. package/{element/DD6up6cl2.js → umd/CXg838Gr2.js} +1 -1
  74. package/umd/{CtYiLBXL.js → Cb1JRT_1.js} +1 -1
  75. package/{element/DYU4JC0C2.js → umd/CebL6kYV2.js} +4 -4
  76. package/{element/DBS5eoAD.js → umd/CiiNqDJq.js} +1 -1
  77. package/umd/{CpBGzCRR2.js → Cj4nJyT42.js} +1 -1
  78. package/{element/D5TvVWUK.js → umd/CnoPTYOO.js} +1 -1
  79. package/umd/{CpaT2goE2.js → CxgDoGDT2.js} +1 -1
  80. package/{element/DiBNGdQS.js → umd/D0VKfxwE.js} +10 -10
  81. package/umd/{DP5TIAjd2.js → D5MjLaap2.js} +1 -1
  82. package/umd/{DJWnpm1A2.js → D5YBxlTz2.js} +39 -39
  83. package/{element/BCyTQnZ1.js → umd/D9NypPiv.js} +1 -1
  84. package/umd/{C9HFLidt.js → DIYUC8M3.js} +1 -1
  85. package/umd/{Boh-45fW.js → DNAwNX6_.js} +2 -2
  86. package/{element/BCu0TrNB2.js → umd/DNG5BSHx2.js} +1 -1
  87. package/umd/DXx41__x2.js +2 -0
  88. package/{element/DnW7WNo1.js → umd/Dgs_iVn3.js} +1 -1
  89. package/{element/BNj7xAbL.js → umd/DsvRTvCp.js} +1 -1
  90. package/umd/{DWbLshVZ.js → DvTRhlvs.js} +1 -1
  91. package/umd/{D9MdXU5q2.js → MpvHkxaz2.js} +1 -1
  92. package/umd/R0dHh5Az2.js +9 -0
  93. package/{element/u7SUQ9Kb2.js → umd/VakK6fPh2.js} +1 -1
  94. package/umd/{CnAKuO192.js → _bFyk49H2.js} +3 -3
  95. package/umd/{DXrH_HhZ.js → _ty2jtjs.js} +1 -1
  96. package/umd/{Crix9_9X.js → b6CwQBFC.js} +5 -5
  97. package/umd/{BbWh89xA2.js → d_bA36WR2.js} +1 -1
  98. package/umd/{CuRZaTn5.js → ekog7y-V.js} +1 -1
  99. package/{element/D8Se70tP2.js → umd/gjXXuILV2.js} +1 -1
  100. package/umd/{DmSY4t_i.js → qWp4ucdT.js} +1 -1
  101. package/umd/web.es.js +42 -42
  102. package/element/CkgIN-cn2.js +0 -9
  103. package/element/D9_lIXvx2.js +0 -3
  104. package/element/qbHuxVSe.js +0 -1
  105. package/umd/CkgIN-cn2.js +0 -9
  106. package/umd/D9_lIXvx2.js +0 -3
  107. package/umd/qbHuxVSe.js +0 -1
@@ -1 +1 @@
1
- import{G as t,H as e,U as s}from"./TV5seYRS.js";var i=class extends e{#t;#e;#s;#i;constructor(t){super(),this.#t=t.client,this.mutationId=t.mutationId,this.#s=t.mutationCache,this.#e=[],this.state=t.state||{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0},this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){this.#e.includes(t)||(this.#e.push(t),this.clearGcTimeout(),this.#s.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.#e=this.#e.filter(e=>e!==t),this.scheduleGc(),this.#s.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.#e.length||("pending"===this.state.status?this.scheduleGc():this.#s.remove(this))}continue(){return this.#i?.continue()??this.execute(this.state.variables)}async execute(t){const e=()=>{this.#a({type:"continue"})},i={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#i=s({fn:()=>this.options.mutationFn?this.options.mutationFn(t,i):Promise.reject(/* @__PURE__ */new Error("No mutationFn found")),onFail:(t,e)=>{this.#a({type:"failed",failureCount:t,error:e})},onPause:()=>{this.#a({type:"pause"})},onContinue:e,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#s.canRun(this)});const a="pending"===this.state.status,o=!this.#i.canStart();try{if(a)e();else{this.#a({type:"pending",variables:t,isPaused:o}),this.#s.config.onMutate&&await this.#s.config.onMutate(t,this,i);const e=await(this.options.onMutate?.(t,i));e!==this.state.context&&this.#a({type:"pending",context:e,variables:t,isPaused:o})}const s=await this.#i.start();return await(this.#s.config.onSuccess?.(s,t,this.state.context,this,i)),await(this.options.onSuccess?.(s,t,this.state.context,i)),await(this.#s.config.onSettled?.(s,null,this.state.variables,this.state.context,this,i)),await(this.options.onSettled?.(s,null,t,this.state.context,i)),this.#a({type:"success",data:s}),s}catch(r){try{await(this.#s.config.onError?.(r,t,this.state.context,this,i))}catch(n){Promise.reject(n)}try{await(this.options.onError?.(r,t,this.state.context,i))}catch(n){Promise.reject(n)}try{await(this.#s.config.onSettled?.(void 0,r,this.state.variables,this.state.context,this,i))}catch(n){Promise.reject(n)}try{await(this.options.onSettled?.(void 0,r,t,this.state.context,i))}catch(n){Promise.reject(n)}throw this.#a({type:"error",error:r}),r}finally{this.#s.runNext(this)}}#a(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}})(this.state),t.batch(()=>{this.#e.forEach(t=>{t.onMutationUpdate(e)}),this.#s.notify({mutation:this,type:"updated",action:e})})}};function a(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}export{a as n,i as t};
1
+ import{G as t,H as e,U as s}from"./BItJQVdK.js";var i=class extends e{#t;#e;#s;#i;constructor(t){super(),this.#t=t.client,this.mutationId=t.mutationId,this.#s=t.mutationCache,this.#e=[],this.state=t.state||{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0},this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){this.#e.includes(t)||(this.#e.push(t),this.clearGcTimeout(),this.#s.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.#e=this.#e.filter(e=>e!==t),this.scheduleGc(),this.#s.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.#e.length||("pending"===this.state.status?this.scheduleGc():this.#s.remove(this))}continue(){return this.#i?.continue()??this.execute(this.state.variables)}async execute(t){const e=()=>{this.#a({type:"continue"})},i={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#i=s({fn:()=>this.options.mutationFn?this.options.mutationFn(t,i):Promise.reject(/* @__PURE__ */new Error("No mutationFn found")),onFail:(t,e)=>{this.#a({type:"failed",failureCount:t,error:e})},onPause:()=>{this.#a({type:"pause"})},onContinue:e,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#s.canRun(this)});const a="pending"===this.state.status,o=!this.#i.canStart();try{if(a)e();else{this.#a({type:"pending",variables:t,isPaused:o}),this.#s.config.onMutate&&await this.#s.config.onMutate(t,this,i);const e=await(this.options.onMutate?.(t,i));e!==this.state.context&&this.#a({type:"pending",context:e,variables:t,isPaused:o})}const s=await this.#i.start();return await(this.#s.config.onSuccess?.(s,t,this.state.context,this,i)),await(this.options.onSuccess?.(s,t,this.state.context,i)),await(this.#s.config.onSettled?.(s,null,this.state.variables,this.state.context,this,i)),await(this.options.onSettled?.(s,null,t,this.state.context,i)),this.#a({type:"success",data:s}),s}catch(r){try{await(this.#s.config.onError?.(r,t,this.state.context,this,i))}catch(n){Promise.reject(n)}try{await(this.options.onError?.(r,t,this.state.context,i))}catch(n){Promise.reject(n)}try{await(this.#s.config.onSettled?.(void 0,r,this.state.variables,this.state.context,this,i))}catch(n){Promise.reject(n)}try{await(this.options.onSettled?.(void 0,r,t,this.state.context,i))}catch(n){Promise.reject(n)}throw this.#a({type:"error",error:r}),r}finally{this.#s.runNext(this)}}#a(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}})(this.state),t.batch(()=>{this.#e.forEach(t=>{t.onMutationUpdate(e)}),this.#s.notify({mutation:this,type:"updated",action:e})})}};function a(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}export{a as n,i as t};
@@ -1,6 +1,6 @@
1
- import{D as t,E as e,O as n,T as i,_ as s,b as o,f as r,g as l,h as a,i as c,m as d,n as h,p as u,t as p,v as m,w as g,y as f}from"./qbHuxVSe.js";import{C as w,D as T,L as y,N as b,O as v,S as k,a as q,i as x,l as E,m as N,n as _,u as S,v as I}from"./TV5seYRS.js";import{n as C,r as L,t as M}from"./D5TvVWUK.js";import{t as R}from"./Crix9_9X.js";import{t as B}from"./CtYiLBXL.js";import{t as A}from"./BCyTQnZ1.js";import{n as V,t as z}from"./Boh-45fW.js";import{n as O}from"./BkIDQGIs.js";import{t as F}from"./Bki5T_lb.js";import{n as P,r as D,t as U}from"./DnW7WNo1.js";import{n as H}from"./E5aJy_fH.js";import{a as j,i as $,n as G,o as W,r as Q,s as K,t as Y}from"./DBS5eoAD.js";import{a as Z,n as J,o as X,r as tt,t as et}from"./Hfo3iOYG2.js";function nt(t){return["react-photo-album",t].filter(Boolean).join("--")}function it({width:t,height:e}){const n=t/e;return Number.isFinite(n)?n:1}var st=Object.freeze([1200,600,300,0]);function ot(t,e){return"function"==typeof t?t(e):t}function rt(t,e){return void 0!==e?ot(t,e):void 0}function lt(t,e,n,i=0){if(void 0===e)return;const s=rt(t,e);return Math.round(Math.max(void 0===s?function(t,e){const n=st.findIndex(t=>t<=e);return ot(t[Math.max(n,0)],e)}(n,e):s,i))}function at(t,{spacing:e,padding:n,componentsProps:i,render:s}){return{spacing:lt(e,t,[20,15,10,5]),padding:lt(n,t,[0,0,0,0]),componentsProps:ot(i,t)||{},render:ot(s,t)}}function ct(t,e=0){const n=10**e;return Math.round((t+Number.EPSILON)*n)/n}function dt(t,e,n,i,s,o,r){let l,a;const c=t=>{const e=o*(s-1)+2*r*s;return`calc((${t.match(/^\s*calc\((.*)\)\s*$/)?.[1]??t} - ${e}px) / ${ct((i-e)/n,5)})`},d=t.srcSet;return d&&d.length>0&&(l=d.concat(d.some(({width:e})=>e===t.width)?[]:[{src:t.src,width:t.width,height:t.height}]).sort((t,e)=>t.width-e.width).map(t=>`${t.src} ${t.width}w`).join(", ")),a=e?.size?(e.sizes||[]).map(({viewport:t,size:e})=>`${t} ${c(e)}`).concat(c(e.size)).join(", "):`${Math.ceil(n/i*100)}vw`,{srcSet:l,sizes:a}}var ht=c(function({as:t,render:e,context:n,classes:i=[],variables:s={},style:o,className:r,children:l,...a},c){const d=function(...t){return t.filter(Boolean).join(" ")}(...(Array.isArray(i)?i:[i]).filter(t=>"string"==typeof t).map(nt),r),h={style:{...Object.fromEntries(Object.entries(s).map(([t,e])=>{return[(n=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),`--${nt(n)}`),"number"==typeof e?ct(e,5):e];var n})),...o},className:d,children:l,...a};if(e){const t=e({ref:c,...h},n);if(t)return t}return p(t||"div",{ref:c,...h})}),ut=c(function({photo:t,index:e,width:n,height:i,onClick:s,render:{wrapper:o,link:r,button:l,image:a,extras:c}={},componentsProps:{link:d,button:h,wrapper:u,image:m}={}},g){const{href:f}=t,w={photo:t,index:e,width:ct(n,3),height:ct(i,3)};let T;return T=f?{...d,as:"a",render:r,classes:["photo","link"],href:f,onClick:s}:s?{...h,as:"button",type:"button",render:l,classes:["photo","button"],onClick:s}:{...u,render:o,classes:"photo"},p(ht,{ref:g,variables:{photoWidth:w.width,photoHeight:w.height},context:w,...T,children:[p(ht,{as:"img",classes:"image",render:a,context:w,...m}),c?.({},w)]})}),pt=c(function({layout:t,sizes:e,model:i,skeleton:s,onClick:o,render:{container:r,track:l,photo:a,...c}={},componentsProps:{container:d,track:h,link:u,button:m,wrapper:g,image:f}={}},w){const{spacing:T,padding:y,containerWidth:b,tracks:v,variables:k,horizontal:q}=i||{};return p(ht,{role:"group","aria-label":"Photo album",...d,variables:{spacing:T,padding:y,containerWidth:b,...k},classes:["",t],render:r,ref:w,children:[void 0!==T&&void 0!==y&&void 0!==b&&v?.map(({photos:t,variables:i},s)=>{const r=t.length,d=q?r:v.length;return n(ht,{...h,key:s,render:l,classes:"track",variables:{trackSize:r,...i}},t.map(t=>{const{photo:n,index:i,width:s}=t,{key:r,src:l,alt:h="",title:w,label:v}=n,k=o?t=>{o({event:t,photo:n,index:i})}:void 0;if(a){const e=a({onClick:k},t);if(e)return e}const q=t=>v?{"aria-label":v,...t}:t;return p(ut,{onClick:k,render:c,componentsProps:{image:{loading:"lazy",decoding:"async",src:l,alt:h,title:w,...dt(n,e,s,b,d,T,y),...ot(f,t)},link:q(ot(u,t)),button:q(ot(m,t)),wrapper:ot(g,t)},...t},r??i)}))}),void 0===b&&s]})});function mt(t,e,n,i){return(e-(t.length-1)*n-2*i*t.length)/t.reduce((t,e)=>t+it(e),0)}function gt(t,e,n,i,s,o,r){const l=t.slice(e,n),a=mt(l,i,s,o);return a>0?(a-r)**2*l.length:void 0}function ft(t,e){const[n,i]=t;if(n===e)return t;if(void 0!==i&&void 0!==e&&void 0!==n&&e===i&&Math.abs(e-n)<=20){const s=Math.min(n,e),o=Math.max(n,e);return s===n&&o===i?t:[s,o]}return[e,n]}function wt(t,e,n){const[[i],o]=s(ft,[n]),l=function(t){const[e,n]=a(t);return t===e||t&&e&&t.length===e.length&&!t.some((t,n)=>t!==e[n])?e:(n(t),t)}(e),c=r(void 0);return{containerRef:m(e=>{c.current?.disconnect(),c.current=void 0;const n=()=>o(function(t,e){let n=t?.clientWidth;if(void 0!==n&&e&&e.length>0){const t=[...e.filter(t=>t>0)].sort((t,e)=>e-t);t.push(Math.floor(t[t.length-1]/2)),n=t.find((e,i)=>e<=n||i===t.length-1)}return n}(e,l));n(),e&&"undefined"!=typeof ResizeObserver&&(c.current=new ResizeObserver(n),c.current.observe(e)),"function"==typeof t?t(e):t&&(t.current=e)},[t,l]),containerWidth:i}}var Tt=c(function({photos:t,breakpoints:e,defaultContainerWidth:n,...i},s){const{containerRef:o,containerWidth:r}=wt(s,e,n),{spacing:l,padding:a,targetRowHeight:c,minPhotos:d,maxPhotos:h,...m}=function(t,{photos:e,targetRowHeight:n,rowConstraints:i,...s}){const{spacing:o,padding:r,componentsProps:l,render:a}=at(t,s),{singleRowMaxHeight:c,minPhotos:d,maxPhotos:h}=rt(i,t)||{};if(void 0!==c&&void 0!==o&&void 0!==r){const t=Math.floor(e.reduce((t,{width:e,height:n})=>t+e/n*c+2*r,o*(e.length-1)));t>0&&(l.container={...l.container},l.container.style={maxWidth:t,...l.container.style})}return{...s,targetRowHeight:lt(n,t,[t=>t/5,t=>t/4,t=>t/3,t=>t/2]),render:a,spacing:o,padding:r,minPhotos:d,maxPhotos:h,componentsProps:l}}(r,{photos:t,...i});return p(pt,{layout:"rows",ref:o,model:u(()=>void 0!==r&&void 0!==l&&void 0!==a&&void 0!==c?function(t,e,n,i,s,o,r){const l=Math.min(function(t,e,n,i){return ct(e/n/Math.min(...t.map(t=>it(t))))+(i||0)+2}(t,i,s,o),r||1/0),a=o||1,c=t.length,d=new Array(c+1).fill(1/0),h=new Array(c+1).fill(-1);d[0]=0;for(let m=1;m<=c;m+=1)for(let o=m-a;o>=Math.max(0,m-l);o-=1){if(d[o]===1/0)continue;const r=gt(t,o,m,i,e,n,s);if(void 0===r)break;const l=d[o]+r;(d[m]===1/0||d[m]>l&&(d[m]/l>1.005||-1!==h[m]&&h[m]<o))&&(d[m]=l,h[m]=o)}if(d[c]===1/0)return;const u=[];for(let m=c;0!==m;m=h[m])u.push(m);u.push(0),u.reverse();const p=[];for(let m=1;m<u.length;m+=1){const s=t.slice(u[m-1],u[m]).map((t,e)=>({photo:t,index:u[m-1]+e})),o=mt(s.map(({photo:t})=>t),i,e,n);p.push({photos:s.map(({photo:t,index:e})=>({photo:t,index:e,width:o*it(t),height:o}))})}return{spacing:e,padding:n,containerWidth:i,tracks:p,horizontal:!0}}(t,l,a,r,c,d,h):void 0,[t,l,a,r,c,d,h]),...m})});function yt(t,e,n,i,s,o,r){const l=[],a=r.reduce((t,e)=>t+e,0);for(let c=0;c<t.length-1;c+=1){const d=e.slice(t[c],t[c+1]).map((e,n)=>({photo:e,index:t[c]+n})),h=r.reduce((t,e,n)=>t+(o[c]-o[n])*e,0),u=(s-(t.length-2)*n-2*(t.length-1)*i-h)*r[c]/a;l.push({photos:d.map(({photo:t,index:e})=>({photo:t,index:e,width:u,height:u/it(t)})),variables:{adjustedGaps:h,columnRatio:r[c]}})}return{tracks:l,variables:{totalRatio:a}}}function bt(t,e,n,i,s,o){const r=[],l=[];if(t.length<=o){const s=t.length>0?t.reduce((t,e)=>t+it(e),0)/t.length:1;for(let e=0;e<o;e+=1)r[e]=2*n,l[e]=e<t.length?it(t[e]):s;return yt(Array.from({length:o+1},(e,n)=>Math.min(n,t.length)),t,e,n,i,r,l)}const a=(c=function(t,e,n,i,s){return o=>{const r=[],l=1.5*s;let a=i/it(t[o])+2*n;for(let c=o+1;c<t.length+1&&(r.push([c,(s-a)**2]),!(a>l||c===t.length));c+=1)a+=i/it(t[c])+e+2*n;return r}}(t,e,n,s,(t.reduce((t,e)=>t+s/it(e),0)+e*(t.length-o)+2*n*t.length)/o),d=o,h=0,u=t.length,function(t,e,n){const i=[n];for(let s=n,o=e;o>0;o-=1)[s]=t.get(s)[o],i.push(s);return i.reverse()}(function(t,e,n,i){const s=/* @__PURE__ */new Map,o=/* @__PURE__ */new Set;o.add(n);for(let r=0;r<e;r+=1){const n=[...o.keys()];o.clear(),n.forEach(n=>{const l=r>0?s.get(n)[r][1]:0;t(n).forEach(([t,a])=>{let c=s.get(t);c||(c=[],s.set(t,c));const d=l+a,h=c[r+1];(!h||h[1]>d&&(h[1]/d>1.0001||n<h[0]))&&(c[r+1]=[n,d]),r<e-1&&t!==i&&o.add(t)})})}return s}(c,d,h,u),d,u));var c,d,h,u;for(let p=0;p<a.length-1;p+=1){const i=t.slice(a[p],a[p+1]);r[p]=e*(i.length-1)+2*n*i.length,l[p]=1/i.reduce((t,e)=>t+1/it(e),0)}return yt(a,t,e,n,i,r,l)}function vt(t,e,n,i,s){const{tracks:o,variables:r}=bt(t,e,n,i,(i-e*(s-1)-2*n*s)/s,s);return o.some(t=>t.photos.some(({width:t,height:e})=>t<=0||e<=0))?s>1?vt(t,e,n,i,s-1):void 0:{tracks:o,spacing:e,padding:n,containerWidth:i,variables:{columns:s,...r}}}var kt=c(function({photos:t,breakpoints:e,defaultContainerWidth:n,...i},s){const{containerRef:o,containerWidth:r}=wt(s,e,n),{spacing:l,padding:a,columns:c,...d}=function(t,{columns:e,...n}){return{...n,...at(t,n),columns:lt(e,t,[5,4,3,2],1)}}(r,{photos:t,...i});return p(pt,{layout:"columns",ref:o,model:u(()=>void 0!==r&&void 0!==l&&void 0!==a&&void 0!==c?vt(t,l,a,r,c):void 0,[t,l,a,r,c]),...d})});function qt(t,e,n,i,s){const o=(i-e*(s-1)-2*n*s)/s;if(o<=0)return s>1?qt(t,e,n,i,s-1):void 0;const r=[];for(let a=0;a<s;a+=1)r[a]=0;const l=t.reduce((t,i,s)=>{const l=r.reduce((t,e,n)=>e<r[t]-1?n:t,0);return r[l]=r[l]+o/it(i)+e+2*n,t[l].push({photo:i,index:s}),t},Array.from({length:s},()=>[]));return{spacing:e,padding:n,containerWidth:i,variables:{columns:s},tracks:l.map(t=>({photos:t.map(({photo:t,index:e})=>({photo:t,index:e,width:o,height:o/it(t)}))}))}}var xt=c(function({photos:t,breakpoints:e,defaultContainerWidth:n,...i},s){const{containerRef:o,containerWidth:r}=wt(s,e,n),{spacing:l,padding:a,columns:c,...d}=function(t,{columns:e,...n}){return{...n,...at(t,n),columns:lt(e,t,[5,4,3,2],1)}}(r,{photos:t,...i});return p(pt,{layout:"masonry",ref:o,model:u(()=>void 0!==r&&void 0!==l&&void 0!==a&&void 0!==c?qt(t,l,a,r,c):void 0,[t,l,a,r,c]),...d})}),Et='url("https://res.cloudinary.com/dectzk2b2/image/upload/v1736933014/black_rpie3v.png")',Nt=class{constructor(t){this.backdropOn=!1,this.lightbox=t,this.backgroundElement=null,this.backgroundVideoElement=null,this.referenceVideoElement=null,this.options={toggleBackdropButtonOrder:7},t.on("init",()=>{this.initPswpEvents(t.pswp)})}getRootNode(){return this.lightbox?.pswp?.element?.getRootNode?.()||document}querySelector(t){return this.getRootNode().querySelector?.(t)||document.querySelector(t)}initPswpEvents(t){t.on("afterInit",()=>{setTimeout(()=>{this.backgroundElement.style.display="block",this.backgroundVideoElement.style.display="block"},[500])}),t.on("uiRegister",()=>{t.ui.registerElement({name:"toggle-backdrop-button",title:"Toggle blur backdrop",order:this.options.toggleBackdropButtonOrder,isButton:!0,html:'<svg aria-hidden="true" class="pswp__icn p-0.5" viewBox="0 0 24 24"><use class="pswp__icn-shadow" xlink:href="#pswp__icn-show-backdrop"/><use class="pswp__icn-shadow" xlink:href="#pswp__icn-hide-backdrop"/><path id="pswp__icn-show-backdrop" style="display:none" d="M3 14.5q-.2 0-.35-.15T2.5 14t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m0-4q-.2 0-.35-.15T2.5 10t.15-.35T3 9.5t.35.15t.15.35t-.15.35t-.35.15M6 19q-.425 0-.712-.288T5 18t.288-.712T6 17t.713.288T7 18t-.288.713T6 19m0-4q-.425 0-.712-.288T5 14t.288-.712T6 13t.713.288T7 14t-.288.713T6 15m0-4q-.425 0-.712-.288T5 10t.288-.712T6 9t.713.288T7 10t-.288.713T6 11m0-4q-.425 0-.712-.288T5 6t.288-.712T6 5t.713.288T7 6t-.288.713T6 7m4 8.5q-.625 0-1.062-.437T8.5 14t.438-1.062T10 12.5t1.063.438T11.5 14t-.437 1.063T10 15.5m0-4q-.625 0-1.062-.437T8.5 10t.438-1.062T10 8.5t1.063.438T11.5 10t-.437 1.063T10 11.5m0 7.5q-.425 0-.712-.288T9 18t.288-.712T10 17t.713.288T11 18t-.288.713T10 19m0-12q-.425 0-.712-.288T9 6t.288-.712T10 5t.713.288T11 6t-.288.713T10 7m0 14.5q-.2 0-.35-.15T9.5 21t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m0-18q-.2 0-.35-.15T9.5 3t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m4 12q-.625 0-1.062-.437T12.5 14t.438-1.062T14 12.5t1.063.438T15.5 14t-.437 1.063T14 15.5m0-4q-.625 0-1.062-.437T12.5 10t.438-1.062T14 8.5t1.063.438T15.5 10t-.437 1.063T14 11.5m0 7.5q-.425 0-.712-.288T13 18t.288-.712T14 17t.713.288T15 18t-.288.713T14 19m0-12q-.425 0-.712-.288T13 6t.288-.712T14 5t.713.288T15 6t-.288.713T14 7m0 14.5q-.2 0-.35-.15T13.5 21t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m0-18q-.2 0-.35-.15T13.5 3t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15M18 19q-.425 0-.712-.288T17 18t.288-.712T18 17t.713.288T19 18t-.288.713T18 19m0-4q-.425 0-.712-.288T17 14t.288-.712T18 13t.713.288T19 14t-.288.713T18 15m0-4q-.425 0-.712-.288T17 10t.288-.712T18 9t.713.288T19 10t-.288.713T18 11m0-4q-.425 0-.712-.288T17 6t.288-.712T18 5t.713.288T19 6t-.288.713T18 7m3 7.5q-.2 0-.35-.15T20.5 14t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m0-4q-.2 0-.35-.15T20.5 10t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15"/><path id="pswp__icn-hide-backdrop" d="m19.1 21.9l-17-17q-.275-.275-.275-.7t.275-.7t.7-.275t.7.275l17 17q.275.275.275.7t-.275.7t-.7.275t-.7-.275m-9.1-.4q-.2 0-.35-.15T9.5 21t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m4 0q-.2 0-.35-.15T13.5 21t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15M6 19q-.425 0-.712-.288T5 18t.288-.712T6 17t.713.288T7 18t-.288.713T6 19m4 0q-.425 0-.712-.288T9 18t.288-.712T10 17t.713.288T11 18t-.288.713T10 19m4 0q-.425 0-.712-.288T13 18t.288-.712T14 17t.713.288T15 18t-.288.713T14 19m-4-3.5q-.65 0-1.075-.425T8.5 14t.425-1.075T10 12.5t1.075.425T11.5 14t-.425 1.075T10 15.5M6 15q-.425 0-.712-.288T5 14t.288-.712T6 13t.713.288T7 14t-.288.713T6 15m11.8-.025l-.775-.775q-.1-.5.213-.85T18 13q.425 0 .713.288T19 14q0 .45-.35.763t-.85.212M3 14.5q-.2 0-.35-.15T2.5 14t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m18 0q-.2 0-.35-.15T20.5 14t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m-6.7-3.05L12.55 9.7q.125-.525.5-.862T14 8.5q.65 0 1.075.425T15.5 10q0 .575-.35.963t-.85.487M6 11q-.425 0-.712-.287T5 10t.288-.712T6 9t.713.288T7 10t-.288.713T6 11m12 0q-.425 0-.712-.288T17 10t.288-.712T18 9t.713.288T19 10t-.288.713T18 11m-15-.5q-.2 0-.35-.15T2.5 10t.15-.35T3 9.5t.35.15t.15.35t-.15.35t-.35.15m18 0q-.2 0-.35-.15T20.5 10t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15M14 7q-.425 0-.712-.288T13 6t.288-.712T14 5t.713.288T15 6t-.288.713T14 7m-4.175-.025l-.8-.8q-.075-.5.225-.837T10 5q.425 0 .712.287T11 6q0 .45-.337.75t-.838.225M18 7q-.425 0-.712-.288T17 6t.288-.712T18 5t.713.288T19 6t-.288.713T18 7m-8-3.5q-.2 0-.35-.15T9.5 3t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m4 0q-.2 0-.35-.15T13.5 3t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15" /></svg>',onClick:()=>{this.toggleBackdrop(t)}}),this.createBlurBackground(t)}),t.on("change",()=>{this.backdropOn&&this.updateBlurBackground(t)}),t.on("close",()=>{this.removeBlurBackground(),this.backdropOn=!1})}createBlurBackground(t){const e=t.element;if(!this.backgroundElement){const t=document.createElement("div");t.style.position="fixed",t.style.top=0,t.style.left=0,t.style.width="100vw",t.style.height="100vh",t.style.backgroundSize="cover",t.style.backgroundPosition="center",t.style.filter="blur(44px)",t.style.zIndex=-1,t.style.transition="background-image 0.5s ease, opacity 0.5s ease",t.style.display="none",t.style.backgroundImage=Et,e.append(t),this.backgroundElement=t}if(!this.backgroundVideoElement){const t=document.createElement("video");t.style.position="fixed",t.style.top=0,t.style.left=0,t.style.width="100vw",t.style.height="100vh",t.style.objectFit="cover",t.style.filter="blur(44px)",t.style.zIndex=-1,t.style.display="none",t.style.transition="opacity 0.5s ease",t.muted=!0,t.loop=!0,t.autoplay=!1,t.muted=!0,t.volume=0,e.append(t),this.backgroundVideoElement=t}}toggleBackdrop(t){this.backdropOn?(this.backgroundElement.style.backgroundImage=Et,this.backgroundVideoElement.style.opacity=0,this.backgroundVideoElement.pause(),this.backdropOn=!1):(this.updateBlurBackground(t),this.backdropOn=!0);const e=this.querySelector("#pswp__icn-hide-backdrop"),n=this.querySelector("#pswp__icn-show-backdrop");e&&(e.style.display=this.backdropOn?"none":"inline"),n&&(n.style.display=this.backdropOn?"inline":"none")}updateBlurBackground(t){const e=t.currSlide;if(e?.data)if("video"===e.data.type){const t=this.backgroundVideoElement,n=e.content.element;"video"===n?.tagName?.toLowerCase()&&(this.referenceVideoElement=n,this.registerVideoEvents(n,t)),t.style.opacity=0,setTimeout(()=>{t.src=e.data.src,t.load(),this.initBackgroundVideo(),t.style.opacity=1},500),this.backgroundElement&&(this.backgroundElement.style.opacity=0)}else{if(this.backgroundElement){const t=((t,e=32,n=32)=>{if(!t||t.length<6||"undefined"==typeof document)return null;try{const i=O(t,e,n),s=document.createElement("canvas");s.width=e,s.height=n;const o=s.getContext("2d");if(!o)return null;const r=o.createImageData(e,n);return r.data.set(i),o.putImageData(r,0,0),s.toDataURL()}catch(i){return console.warn("[PhotoSwipeBackdrop] Failed to decode blurhash:",i),null}})(e.data.blurhash)||e.data.thumbnailUrl||e.data.src;this.backgroundElement.style.backgroundImage=t?`url("${t}")`:Et,this.backgroundElement.style.backgroundColor="transparent",this.backgroundElement.style.opacity=1}this.backgroundVideoElement&&(this.backgroundVideoElement.style.opacity=0,this.backgroundVideoElement.src="")}}initBackgroundVideo(){this.referenceVideoElement&&(this.backgroundVideoElement.currentTime=this.referenceVideoElement.currentTime,this.referenceVideoElement.currentTime>0&&!this.referenceVideoElement.paused&&!this.referenceVideoElement.ended&&this.referenceVideoElement.readyState>2&&this.backgroundVideoElement.play())}removeBlurBackground(){this.backgroundElement&&(this.backgroundElement.remove(),this.backgroundVideoElement.remove(),this.backgroundElement=null,this.backgroundVideoElement=null)}registerVideoEvents(t,e){this.foregroundVideoElement=t,t.addEventListener("play",()=>{e.currentTime=t.currentTime,e.play()}),t.addEventListener("pause",()=>{e.pause()}),t.addEventListener("ended",()=>{e.pause(),e.currentTime=0})}},_t=({contents:t=[],selectedIndex:e,onClick:n})=>{const i=r(null);o(()=>{i.current&&s(e)},[e,i.current]);const s=t=>{if(!i.current)return;const e=i.current,n=e.children;if(t<0||t>=n.length)return;const s=n[t],o=e.offsetWidth/2,r=s.offsetLeft+s.offsetWidth/2-o;e.scrollTo({left:r,behavior:"smooth"})};/* @__PURE__ */
1
+ import{C as t,D as e,E as n,T as i,_ as s,b as o,f as r,g as l,h as a,i as c,m as d,n as h,p as u,t as p,v as m,w as g,y as f}from"./C3uDEVBt.js";import{C as w,D as T,L as y,N as b,O as v,S as k,a as q,i as x,l as E,m as N,n as _,u as S,v as I}from"./BItJQVdK.js";import{n as C,r as L,t as M}from"./CnoPTYOO.js";import{t as R}from"./b6CwQBFC.js";import{t as B}from"./Cb1JRT_1.js";import{t as A}from"./D9NypPiv.js";import{n as V,t as z}from"./DNAwNX6_.js";import{n as O}from"./BkIDQGIs.js";import{t as F}from"./Bki5T_lb.js";import{n as P,r as D,t as U}from"./Dgs_iVn3.js";import{n as H}from"./BtN9y353.js";import{a as j,i as $,n as G,o as W,r as Q,s as K,t as Y}from"./CiiNqDJq.js";import{a as Z,n as J,o as X,r as tt,t as et}from"./BQuhYd4G2.js";function nt(t){return["react-photo-album",t].filter(Boolean).join("--")}function it({width:t,height:e}){const n=t/e;return Number.isFinite(n)?n:1}var st=Object.freeze([1200,600,300,0]);function ot(t,e){return"function"==typeof t?t(e):t}function rt(t,e){return void 0!==e?ot(t,e):void 0}function lt(t,e,n,i=0){if(void 0===e)return;const s=rt(t,e);return Math.round(Math.max(void 0===s?function(t,e){const n=st.findIndex(t=>t<=e);return ot(t[Math.max(n,0)],e)}(n,e):s,i))}function at(t,{spacing:e,padding:n,componentsProps:i,render:s}){return{spacing:lt(e,t,[20,15,10,5]),padding:lt(n,t,[0,0,0,0]),componentsProps:ot(i,t)||{},render:ot(s,t)}}function ct(t,e=0){const n=10**e;return Math.round((t+Number.EPSILON)*n)/n}function dt(t,e,n,i,s,o,r){let l,a;const c=t=>{const e=o*(s-1)+2*r*s;return`calc((${t.match(/^\s*calc\((.*)\)\s*$/)?.[1]??t} - ${e}px) / ${ct((i-e)/n,5)})`},d=t.srcSet;return d&&d.length>0&&(l=d.concat(d.some(({width:e})=>e===t.width)?[]:[{src:t.src,width:t.width,height:t.height}]).sort((t,e)=>t.width-e.width).map(t=>`${t.src} ${t.width}w`).join(", ")),a=e?.size?(e.sizes||[]).map(({viewport:t,size:e})=>`${t} ${c(e)}`).concat(c(e.size)).join(", "):`${Math.ceil(n/i*100)}vw`,{srcSet:l,sizes:a}}var ht=c(function({as:t,render:e,context:n,classes:i=[],variables:s={},style:o,className:r,children:l,...a},c){const d=function(...t){return t.filter(Boolean).join(" ")}(...(Array.isArray(i)?i:[i]).filter(t=>"string"==typeof t).map(nt),r),h={style:{...Object.fromEntries(Object.entries(s).map(([t,e])=>{return[(n=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),`--${nt(n)}`),"number"==typeof e?ct(e,5):e];var n})),...o},className:d,children:l,...a};if(e){const t=e({ref:c,...h},n);if(t)return t}return p(t||"div",{ref:c,...h})}),ut=c(function({photo:t,index:e,width:n,height:i,onClick:s,render:{wrapper:o,link:r,button:l,image:a,extras:c}={},componentsProps:{link:d,button:h,wrapper:u,image:m}={}},g){const{href:f}=t,w={photo:t,index:e,width:ct(n,3),height:ct(i,3)};let T;return T=f?{...d,as:"a",render:r,classes:["photo","link"],href:f,onClick:s}:s?{...h,as:"button",type:"button",render:l,classes:["photo","button"],onClick:s}:{...u,render:o,classes:"photo"},p(ht,{ref:g,variables:{photoWidth:w.width,photoHeight:w.height},context:w,...T,children:[p(ht,{as:"img",classes:"image",render:a,context:w,...m}),c?.({},w)]})}),pt=c(function({layout:t,sizes:n,model:i,skeleton:s,onClick:o,render:{container:r,track:l,photo:a,...c}={},componentsProps:{container:d,track:h,link:u,button:m,wrapper:g,image:f}={}},w){const{spacing:T,padding:y,containerWidth:b,tracks:v,variables:k,horizontal:q}=i||{};return p(ht,{role:"group","aria-label":"Photo album",...d,variables:{spacing:T,padding:y,containerWidth:b,...k},classes:["",t],render:r,ref:w,children:[void 0!==T&&void 0!==y&&void 0!==b&&v?.map(({photos:t,variables:i},s)=>{const r=t.length,d=q?r:v.length;return e(ht,{...h,key:s,render:l,classes:"track",variables:{trackSize:r,...i}},t.map(t=>{const{photo:e,index:i,width:s}=t,{key:r,src:l,alt:h="",title:w,label:v}=e,k=o?t=>{o({event:t,photo:e,index:i})}:void 0;if(a){const e=a({onClick:k},t);if(e)return e}const q=t=>v?{"aria-label":v,...t}:t;return p(ut,{onClick:k,render:c,componentsProps:{image:{loading:"lazy",decoding:"async",src:l,alt:h,title:w,...dt(e,n,s,b,d,T,y),...ot(f,t)},link:q(ot(u,t)),button:q(ot(m,t)),wrapper:ot(g,t)},...t},r??i)}))}),void 0===b&&s]})});function mt(t,e,n,i){return(e-(t.length-1)*n-2*i*t.length)/t.reduce((t,e)=>t+it(e),0)}function gt(t,e,n,i,s,o,r){const l=t.slice(e,n),a=mt(l,i,s,o);return a>0?(a-r)**2*l.length:void 0}function ft(t,e){const[n,i]=t;if(n===e)return t;if(void 0!==i&&void 0!==e&&void 0!==n&&e===i&&Math.abs(e-n)<=20){const s=Math.min(n,e),o=Math.max(n,e);return s===n&&o===i?t:[s,o]}return[e,n]}function wt(t,e,n){const[[i],o]=s(ft,[n]),l=function(t){const[e,n]=a(t);return t===e||t&&e&&t.length===e.length&&!t.some((t,n)=>t!==e[n])?e:(n(t),t)}(e),c=r(void 0);return{containerRef:m(e=>{c.current?.disconnect(),c.current=void 0;const n=()=>o(function(t,e){let n=t?.clientWidth;if(void 0!==n&&e&&e.length>0){const t=[...e.filter(t=>t>0)].sort((t,e)=>e-t);t.push(Math.floor(t[t.length-1]/2)),n=t.find((e,i)=>e<=n||i===t.length-1)}return n}(e,l));n(),e&&"undefined"!=typeof ResizeObserver&&(c.current=new ResizeObserver(n),c.current.observe(e)),"function"==typeof t?t(e):t&&(t.current=e)},[t,l]),containerWidth:i}}var Tt=c(function({photos:t,breakpoints:e,defaultContainerWidth:n,...i},s){const{containerRef:o,containerWidth:r}=wt(s,e,n),{spacing:l,padding:a,targetRowHeight:c,minPhotos:d,maxPhotos:h,...m}=function(t,{photos:e,targetRowHeight:n,rowConstraints:i,...s}){const{spacing:o,padding:r,componentsProps:l,render:a}=at(t,s),{singleRowMaxHeight:c,minPhotos:d,maxPhotos:h}=rt(i,t)||{};if(void 0!==c&&void 0!==o&&void 0!==r){const t=Math.floor(e.reduce((t,{width:e,height:n})=>t+e/n*c+2*r,o*(e.length-1)));t>0&&(l.container={...l.container},l.container.style={maxWidth:t,...l.container.style})}return{...s,targetRowHeight:lt(n,t,[t=>t/5,t=>t/4,t=>t/3,t=>t/2]),render:a,spacing:o,padding:r,minPhotos:d,maxPhotos:h,componentsProps:l}}(r,{photos:t,...i});return p(pt,{layout:"rows",ref:o,model:u(()=>void 0!==r&&void 0!==l&&void 0!==a&&void 0!==c?function(t,e,n,i,s,o,r){const l=Math.min(function(t,e,n,i){return ct(e/n/Math.min(...t.map(t=>it(t))))+(i||0)+2}(t,i,s,o),r||1/0),a=o||1,c=t.length,d=new Array(c+1).fill(1/0),h=new Array(c+1).fill(-1);d[0]=0;for(let m=1;m<=c;m+=1)for(let o=m-a;o>=Math.max(0,m-l);o-=1){if(d[o]===1/0)continue;const r=gt(t,o,m,i,e,n,s);if(void 0===r)break;const l=d[o]+r;(d[m]===1/0||d[m]>l&&(d[m]/l>1.005||-1!==h[m]&&h[m]<o))&&(d[m]=l,h[m]=o)}if(d[c]===1/0)return;const u=[];for(let m=c;0!==m;m=h[m])u.push(m);u.push(0),u.reverse();const p=[];for(let m=1;m<u.length;m+=1){const s=t.slice(u[m-1],u[m]).map((t,e)=>({photo:t,index:u[m-1]+e})),o=mt(s.map(({photo:t})=>t),i,e,n);p.push({photos:s.map(({photo:t,index:e})=>({photo:t,index:e,width:o*it(t),height:o}))})}return{spacing:e,padding:n,containerWidth:i,tracks:p,horizontal:!0}}(t,l,a,r,c,d,h):void 0,[t,l,a,r,c,d,h]),...m})});function yt(t,e,n,i,s,o,r){const l=[],a=r.reduce((t,e)=>t+e,0);for(let c=0;c<t.length-1;c+=1){const d=e.slice(t[c],t[c+1]).map((e,n)=>({photo:e,index:t[c]+n})),h=r.reduce((t,e,n)=>t+(o[c]-o[n])*e,0),u=(s-(t.length-2)*n-2*(t.length-1)*i-h)*r[c]/a;l.push({photos:d.map(({photo:t,index:e})=>({photo:t,index:e,width:u,height:u/it(t)})),variables:{adjustedGaps:h,columnRatio:r[c]}})}return{tracks:l,variables:{totalRatio:a}}}function bt(t,e,n,i,s,o){const r=[],l=[];if(t.length<=o){const s=t.length>0?t.reduce((t,e)=>t+it(e),0)/t.length:1;for(let e=0;e<o;e+=1)r[e]=2*n,l[e]=e<t.length?it(t[e]):s;return yt(Array.from({length:o+1},(e,n)=>Math.min(n,t.length)),t,e,n,i,r,l)}const a=(c=function(t,e,n,i,s){return o=>{const r=[],l=1.5*s;let a=i/it(t[o])+2*n;for(let c=o+1;c<t.length+1&&(r.push([c,(s-a)**2]),!(a>l||c===t.length));c+=1)a+=i/it(t[c])+e+2*n;return r}}(t,e,n,s,(t.reduce((t,e)=>t+s/it(e),0)+e*(t.length-o)+2*n*t.length)/o),d=o,h=0,u=t.length,function(t,e,n){const i=[n];for(let s=n,o=e;o>0;o-=1)[s]=t.get(s)[o],i.push(s);return i.reverse()}(function(t,e,n,i){const s=/* @__PURE__ */new Map,o=/* @__PURE__ */new Set;o.add(n);for(let r=0;r<e;r+=1){const n=[...o.keys()];o.clear(),n.forEach(n=>{const l=r>0?s.get(n)[r][1]:0;t(n).forEach(([t,a])=>{let c=s.get(t);c||(c=[],s.set(t,c));const d=l+a,h=c[r+1];(!h||h[1]>d&&(h[1]/d>1.0001||n<h[0]))&&(c[r+1]=[n,d]),r<e-1&&t!==i&&o.add(t)})})}return s}(c,d,h,u),d,u));var c,d,h,u;for(let p=0;p<a.length-1;p+=1){const i=t.slice(a[p],a[p+1]);r[p]=e*(i.length-1)+2*n*i.length,l[p]=1/i.reduce((t,e)=>t+1/it(e),0)}return yt(a,t,e,n,i,r,l)}function vt(t,e,n,i,s){const{tracks:o,variables:r}=bt(t,e,n,i,(i-e*(s-1)-2*n*s)/s,s);return o.some(t=>t.photos.some(({width:t,height:e})=>t<=0||e<=0))?s>1?vt(t,e,n,i,s-1):void 0:{tracks:o,spacing:e,padding:n,containerWidth:i,variables:{columns:s,...r}}}var kt=c(function({photos:t,breakpoints:e,defaultContainerWidth:n,...i},s){const{containerRef:o,containerWidth:r}=wt(s,e,n),{spacing:l,padding:a,columns:c,...d}=function(t,{columns:e,...n}){return{...n,...at(t,n),columns:lt(e,t,[5,4,3,2],1)}}(r,{photos:t,...i});return p(pt,{layout:"columns",ref:o,model:u(()=>void 0!==r&&void 0!==l&&void 0!==a&&void 0!==c?vt(t,l,a,r,c):void 0,[t,l,a,r,c]),...d})});function qt(t,e,n,i,s){const o=(i-e*(s-1)-2*n*s)/s;if(o<=0)return s>1?qt(t,e,n,i,s-1):void 0;const r=[];for(let a=0;a<s;a+=1)r[a]=0;const l=t.reduce((t,i,s)=>{const l=r.reduce((t,e,n)=>e<r[t]-1?n:t,0);return r[l]=r[l]+o/it(i)+e+2*n,t[l].push({photo:i,index:s}),t},Array.from({length:s},()=>[]));return{spacing:e,padding:n,containerWidth:i,variables:{columns:s},tracks:l.map(t=>({photos:t.map(({photo:t,index:e})=>({photo:t,index:e,width:o,height:o/it(t)}))}))}}var xt=c(function({photos:t,breakpoints:e,defaultContainerWidth:n,...i},s){const{containerRef:o,containerWidth:r}=wt(s,e,n),{spacing:l,padding:a,columns:c,...d}=function(t,{columns:e,...n}){return{...n,...at(t,n),columns:lt(e,t,[5,4,3,2],1)}}(r,{photos:t,...i});return p(pt,{layout:"masonry",ref:o,model:u(()=>void 0!==r&&void 0!==l&&void 0!==a&&void 0!==c?qt(t,l,a,r,c):void 0,[t,l,a,r,c]),...d})}),Et='url("https://res.cloudinary.com/dectzk2b2/image/upload/v1736933014/black_rpie3v.png")',Nt=class{constructor(t){this.backdropOn=!1,this.lightbox=t,this.backgroundElement=null,this.backgroundVideoElement=null,this.referenceVideoElement=null,this.options={toggleBackdropButtonOrder:7},t.on("init",()=>{this.initPswpEvents(t.pswp)})}getRootNode(){return this.lightbox?.pswp?.element?.getRootNode?.()||document}querySelector(t){return this.getRootNode().querySelector?.(t)||document.querySelector(t)}initPswpEvents(t){t.on("afterInit",()=>{setTimeout(()=>{this.backgroundElement.style.display="block",this.backgroundVideoElement.style.display="block"},[500])}),t.on("uiRegister",()=>{t.ui.registerElement({name:"toggle-backdrop-button",title:"Toggle blur backdrop",order:this.options.toggleBackdropButtonOrder,isButton:!0,html:'<svg aria-hidden="true" class="pswp__icn p-0.5" viewBox="0 0 24 24"><use class="pswp__icn-shadow" xlink:href="#pswp__icn-show-backdrop"/><use class="pswp__icn-shadow" xlink:href="#pswp__icn-hide-backdrop"/><path id="pswp__icn-show-backdrop" style="display:none" d="M3 14.5q-.2 0-.35-.15T2.5 14t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m0-4q-.2 0-.35-.15T2.5 10t.15-.35T3 9.5t.35.15t.15.35t-.15.35t-.35.15M6 19q-.425 0-.712-.288T5 18t.288-.712T6 17t.713.288T7 18t-.288.713T6 19m0-4q-.425 0-.712-.288T5 14t.288-.712T6 13t.713.288T7 14t-.288.713T6 15m0-4q-.425 0-.712-.288T5 10t.288-.712T6 9t.713.288T7 10t-.288.713T6 11m0-4q-.425 0-.712-.288T5 6t.288-.712T6 5t.713.288T7 6t-.288.713T6 7m4 8.5q-.625 0-1.062-.437T8.5 14t.438-1.062T10 12.5t1.063.438T11.5 14t-.437 1.063T10 15.5m0-4q-.625 0-1.062-.437T8.5 10t.438-1.062T10 8.5t1.063.438T11.5 10t-.437 1.063T10 11.5m0 7.5q-.425 0-.712-.288T9 18t.288-.712T10 17t.713.288T11 18t-.288.713T10 19m0-12q-.425 0-.712-.288T9 6t.288-.712T10 5t.713.288T11 6t-.288.713T10 7m0 14.5q-.2 0-.35-.15T9.5 21t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m0-18q-.2 0-.35-.15T9.5 3t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m4 12q-.625 0-1.062-.437T12.5 14t.438-1.062T14 12.5t1.063.438T15.5 14t-.437 1.063T14 15.5m0-4q-.625 0-1.062-.437T12.5 10t.438-1.062T14 8.5t1.063.438T15.5 10t-.437 1.063T14 11.5m0 7.5q-.425 0-.712-.288T13 18t.288-.712T14 17t.713.288T15 18t-.288.713T14 19m0-12q-.425 0-.712-.288T13 6t.288-.712T14 5t.713.288T15 6t-.288.713T14 7m0 14.5q-.2 0-.35-.15T13.5 21t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m0-18q-.2 0-.35-.15T13.5 3t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15M18 19q-.425 0-.712-.288T17 18t.288-.712T18 17t.713.288T19 18t-.288.713T18 19m0-4q-.425 0-.712-.288T17 14t.288-.712T18 13t.713.288T19 14t-.288.713T18 15m0-4q-.425 0-.712-.288T17 10t.288-.712T18 9t.713.288T19 10t-.288.713T18 11m0-4q-.425 0-.712-.288T17 6t.288-.712T18 5t.713.288T19 6t-.288.713T18 7m3 7.5q-.2 0-.35-.15T20.5 14t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m0-4q-.2 0-.35-.15T20.5 10t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15"/><path id="pswp__icn-hide-backdrop" d="m19.1 21.9l-17-17q-.275-.275-.275-.7t.275-.7t.7-.275t.7.275l17 17q.275.275.275.7t-.275.7t-.7.275t-.7-.275m-9.1-.4q-.2 0-.35-.15T9.5 21t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m4 0q-.2 0-.35-.15T13.5 21t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15M6 19q-.425 0-.712-.288T5 18t.288-.712T6 17t.713.288T7 18t-.288.713T6 19m4 0q-.425 0-.712-.288T9 18t.288-.712T10 17t.713.288T11 18t-.288.713T10 19m4 0q-.425 0-.712-.288T13 18t.288-.712T14 17t.713.288T15 18t-.288.713T14 19m-4-3.5q-.65 0-1.075-.425T8.5 14t.425-1.075T10 12.5t1.075.425T11.5 14t-.425 1.075T10 15.5M6 15q-.425 0-.712-.288T5 14t.288-.712T6 13t.713.288T7 14t-.288.713T6 15m11.8-.025l-.775-.775q-.1-.5.213-.85T18 13q.425 0 .713.288T19 14q0 .45-.35.763t-.85.212M3 14.5q-.2 0-.35-.15T2.5 14t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m18 0q-.2 0-.35-.15T20.5 14t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m-6.7-3.05L12.55 9.7q.125-.525.5-.862T14 8.5q.65 0 1.075.425T15.5 10q0 .575-.35.963t-.85.487M6 11q-.425 0-.712-.287T5 10t.288-.712T6 9t.713.288T7 10t-.288.713T6 11m12 0q-.425 0-.712-.288T17 10t.288-.712T18 9t.713.288T19 10t-.288.713T18 11m-15-.5q-.2 0-.35-.15T2.5 10t.15-.35T3 9.5t.35.15t.15.35t-.15.35t-.35.15m18 0q-.2 0-.35-.15T20.5 10t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15M14 7q-.425 0-.712-.288T13 6t.288-.712T14 5t.713.288T15 6t-.288.713T14 7m-4.175-.025l-.8-.8q-.075-.5.225-.837T10 5q.425 0 .712.287T11 6q0 .45-.337.75t-.838.225M18 7q-.425 0-.712-.288T17 6t.288-.712T18 5t.713.288T19 6t-.288.713T18 7m-8-3.5q-.2 0-.35-.15T9.5 3t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m4 0q-.2 0-.35-.15T13.5 3t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15" /></svg>',onClick:()=>{this.toggleBackdrop(t)}}),this.createBlurBackground(t)}),t.on("change",()=>{this.backdropOn&&this.updateBlurBackground(t)}),t.on("close",()=>{this.removeBlurBackground(),this.backdropOn=!1})}createBlurBackground(t){const e=t.element;if(!this.backgroundElement){const t=document.createElement("div");t.style.position="fixed",t.style.top=0,t.style.left=0,t.style.width="100vw",t.style.height="100vh",t.style.backgroundSize="cover",t.style.backgroundPosition="center",t.style.filter="blur(44px)",t.style.zIndex=-1,t.style.transition="background-image 0.5s ease, opacity 0.5s ease",t.style.display="none",t.style.backgroundImage=Et,e.append(t),this.backgroundElement=t}if(!this.backgroundVideoElement){const t=document.createElement("video");t.style.position="fixed",t.style.top=0,t.style.left=0,t.style.width="100vw",t.style.height="100vh",t.style.objectFit="cover",t.style.filter="blur(44px)",t.style.zIndex=-1,t.style.display="none",t.style.transition="opacity 0.5s ease",t.muted=!0,t.loop=!0,t.autoplay=!1,t.muted=!0,t.volume=0,e.append(t),this.backgroundVideoElement=t}}toggleBackdrop(t){this.backdropOn?(this.backgroundElement.style.backgroundImage=Et,this.backgroundVideoElement.style.opacity=0,this.backgroundVideoElement.pause(),this.backdropOn=!1):(this.updateBlurBackground(t),this.backdropOn=!0);const e=this.querySelector("#pswp__icn-hide-backdrop"),n=this.querySelector("#pswp__icn-show-backdrop");e&&(e.style.display=this.backdropOn?"none":"inline"),n&&(n.style.display=this.backdropOn?"inline":"none")}updateBlurBackground(t){const e=t.currSlide;if(e?.data)if("video"===e.data.type){const t=this.backgroundVideoElement,n=e.content.element;"video"===n?.tagName?.toLowerCase()&&(this.referenceVideoElement=n,this.registerVideoEvents(n,t)),t.style.opacity=0,setTimeout(()=>{t.src=e.data.src,t.load(),this.initBackgroundVideo(),t.style.opacity=1},500),this.backgroundElement&&(this.backgroundElement.style.opacity=0)}else{if(this.backgroundElement){const t=((t,e=32,n=32)=>{if(!t||t.length<6||"undefined"==typeof document)return null;try{const i=O(t,e,n),s=document.createElement("canvas");s.width=e,s.height=n;const o=s.getContext("2d");if(!o)return null;const r=o.createImageData(e,n);return r.data.set(i),o.putImageData(r,0,0),s.toDataURL()}catch(i){return console.warn("[PhotoSwipeBackdrop] Failed to decode blurhash:",i),null}})(e.data.blurhash)||e.data.thumbnailUrl||e.data.src;this.backgroundElement.style.backgroundImage=t?`url("${t}")`:Et,this.backgroundElement.style.backgroundColor="transparent",this.backgroundElement.style.opacity=1}this.backgroundVideoElement&&(this.backgroundVideoElement.style.opacity=0,this.backgroundVideoElement.src="")}}initBackgroundVideo(){this.referenceVideoElement&&(this.backgroundVideoElement.currentTime=this.referenceVideoElement.currentTime,this.referenceVideoElement.currentTime>0&&!this.referenceVideoElement.paused&&!this.referenceVideoElement.ended&&this.referenceVideoElement.readyState>2&&this.backgroundVideoElement.play())}removeBlurBackground(){this.backgroundElement&&(this.backgroundElement.remove(),this.backgroundVideoElement.remove(),this.backgroundElement=null,this.backgroundVideoElement=null)}registerVideoEvents(t,e){this.foregroundVideoElement=t,t.addEventListener("play",()=>{e.currentTime=t.currentTime,e.play()}),t.addEventListener("pause",()=>{e.pause()}),t.addEventListener("ended",()=>{e.pause(),e.currentTime=0})}},_t=({contents:t=[],selectedIndex:e,onClick:n})=>{const i=r(null);o(()=>{i.current&&s(e)},[e,i.current]);const s=t=>{if(!i.current)return;const e=i.current,n=e.children;if(t<0||t>=n.length)return;const s=n[t],o=e.offsetWidth/2,r=s.offsetLeft+s.offsetWidth/2-o;e.scrollTo({left:r,behavior:"smooth"})};/* @__PURE__ */
2
2
  return p("div",{ref:i,className:"scrollbar-hide flex h-28 w-auto items-center justify-center overflow-x-auto bg-black/50",style:{scrollBehavior:"smooth",userSelect:"none",whiteSpace:"nowrap"},children:t.map((t,i)=>/* @__PURE__ */p("button",{className:"relative mx-0.5 inline-block [contain-intrinsic-size:6rem_5rem] [content-visibility:auto] lg:mx-1.5",onClick:()=>((t,e)=>{n(e)})(0,i),children:[
3
- /* @__PURE__ */p(z,{wrapperClassName:x("h-16 w-24 rounded-md lg:h-20 lg:w-20",i===e&&"border-2 border-[#ff4800]"),src:t.thumbnailUrl,placeholderSrc:t.blurImageUrl,alt:t.caption}),t.type===N.VIDEO&&/* @__PURE__ */p("div",{className:"absolute top-0 left-0 flex size-full items-center justify-center opacity-75",children:/* @__PURE__ */p("svg",{xmlns:"http://www.w3.org/2000/svg",className:"size-6 text-white lg:size-9",viewBox:"0 0 24 24",children:/* @__PURE__ */p("path",{fill:"currentColor",d:"M8 17.175V6.825q0-.425.3-.713t.7-.287q.125 0 .263.037t.262.113l8.15 5.175q.225.15.338.375t.112.475t-.112.475t-.338.375l-8.15 5.175q-.125.075-.262.113T9 18.175q-.4 0-.7-.288t-.3-.712"})})}),t.type===N.AD&&/* @__PURE__ */p("div",{className:"absolute top-1 left-1 text-xs",children:"Ad"})]},`filmstrip-thumbnail-${i}`))})},St=class{constructor(t){this.lightbox=t,this.filmstripVisible=!0,this.options={filmstripButtonOrder:7},t.on("init",()=>{this.initPswpEvents(t.pswp)})}getRootNode(){return this.lightbox?.pswp?.element?.getRootNode?.()||document}getElementById(t){const e=this.getRootNode();return"function"==typeof e.getElementById?e.getElementById(t):e.querySelector?.(`#${t}`)||document.getElementById(t)}querySelector(t){return this.getRootNode().querySelector?.(t)||document.querySelector(t)}initPswpEvents(t){t.on("uiRegister",()=>{t.ui.registerElement({name:"filmstrip-toggle-button",title:"Toggle filmstrip view",order:this.options.filmstripButtonOrder,isButton:!0,html:'<svg aria-hidden="true" class="pswp__icn p-0.5" viewBox="0 0 24 24" id="pswp__icn-show-filmstrip"><use class="pswp__icn-shadow" xlink:href="#pswp__icn-show-filmstrip"/>\n <path\n d="M4 20q-.825 0-1.412-.587T2 18V6q0-.825.588-1.412T4 4h16q.825 0 1.413.588T22 6v12q0 .825-.587 1.413T20 20zm0-2h16V8H4z" />\n <path\n d="m 5.100795,16.58464 q -0.165328,0 -0.282961,-0.116899 Q 4.700201,16.350842 4.7,16.186347 V 13.398294 Q 4.7,13.233997 4.817834,13.117098 4.935667,13.000199 5.100795,13 h 2.805561 q 0.165328,0 0.283161,0.117098 0.117834,0.117099 0.117633,0.281196 v 2.788053 q 0,0.164296 -0.117633,0.281394 -0.117633,0.117099 -0.283161,0.116899 z"\n\n style="stroke-width:0.199771" />\n <path\n\n d="m 10.572144,16.65489 q -0.165329,0 -0.282961,-0.116899 -0.117633,-0.116899 -0.117834,-0.281394 v -2.788053 q 0,-0.164297 0.117834,-0.281196 0.117832,-0.116899 0.282961,-0.117098 h 2.805561 q 0.165328,0 0.283161,0.117098 0.117834,0.117099 0.117633,0.281196 v 2.788053 q 0,0.164296 -0.117633,0.281394 -0.117633,0.117099 -0.283161,0.116899 z"\n\n style="stroke-width:0.199771" />\n <path\n\n d="m 16.049385,16.724729 q -0.165328,0 -0.282961,-0.116899 -0.117633,-0.116899 -0.117834,-0.281394 v -2.788053 q 0,-0.164297 0.117834,-0.281196 0.117833,-0.116899 0.282961,-0.117098 h 2.805561 q 0.165328,0 0.283161,0.117098 0.117834,0.117099 0.117634,0.281196 v 2.788053 q 0,0.164296 -0.117634,0.281394 -0.117633,0.117099 -0.283161,0.116899 z"\n\n style="stroke-width:0.199771" />\n </svg>\n <svg aria-hidden="true" class="pswp__icn p-0.5" viewBox="0 0 24 24" id="pswp__icn-hide-filmstrip" style="display:none"><use class="pswp__icn-shadow" xlink:href="#pswp__icn-hide-filmstrip"/>\n <path\n d="M4 20q-.825 0-1.412-.587T2 18V6q0-.825.588-1.412T4 4v2.85L1.35 4.2q-.3-.3-.3-.712t.3-.713t.713-.3t.712.3l18.4 18.4q.3.3.3.7t-.3.7t-.712.3t-.713-.3L17.15 20zm0-2h11.15l-10-10H4zM22 6v11q0 .5-.312.75T21 18t-.687-.262t-.313-.763V8h-8.325q-.4 0-.763-.15t-.637-.425L8.55 5.7q-.225-.25-.275-.525t.075-.55t.35-.45T9.275 4H20q.825 0 1.413.588T22 6"\n />\n <path\n\n d="m 5.100795,16.58464 q -0.165328,0 -0.282961,-0.116899 Q 4.700201,16.350842 4.7,16.186347 V 13.398294 Q 4.7,13.233997 4.817834,13.117098 4.935667,13.000199 5.100795,13 h 2.805561 q 0.165328,0 0.283161,0.117098 0.117834,0.117099 0.117633,0.281196 v 2.788053 q 0,0.164296 -0.117633,0.281394 -0.117633,0.117099 -0.283161,0.116899 z"\n\n style="stroke-width:0.199771" />\n <path\n\n d="m 10.572143,16.65489 q -0.165327,0 -0.282961,-0.116899 -0.117632,-0.116899 -0.117833,-0.281394 v -2.788053 q 0,-0.164297 0.117833,-0.281196 0.117834,-0.116899 0.282961,-0.117098 h 2.805562 q 0.165328,0 0.283161,0.117098 0.117834,0.117099 0.117633,0.281196 v 2.788053 q 0,0.164296 -0.117633,0.281394 -0.117633,0.117099 -0.283161,0.116899 z"\n\n style="stroke-width:0.199771" />\n <path\n\n d="m 16.049385,16.724729 q -0.165327,0 -0.282961,-0.116899 -0.117632,-0.116899 -0.117833,-0.281394 v -2.788053 q 0,-0.164297 0.117833,-0.281196 0.117834,-0.116899 0.282961,-0.117098 h 2.805561 q 0.165328,0 0.283161,0.117098 0.117834,0.117099 0.117634,0.281196 v 2.788053 q 0,0.164296 -0.117634,0.281394 -0.117633,0.117099 -0.283161,0.116899 z"\n\n style="stroke-width:0.199771" />\n </svg>\n\n ',onClick:()=>{this.toggleFilmstrip()}}),t.ui.registerElement({name:"filmstrip",isButton:!1,appendTo:"root",html:'\n <div id="filmstrip-container" class="w-full absolute bottom-0">\n </div>\n '})}),t.on("change",()=>{this.filmstripVisible&&this.updateFilmstrip(t)}),t.on("close",()=>{this.cleanupFilmstrip()})}onThumbnailClcik(t){this.lightbox.pswp.goTo(t)}getFilmstripContents(t){const e=t?.options?.dataSource?.items,n=e?.length??0;return this.filmstripContents&&this.filmstripContents.length===n||(this.filmstripContents=(e??[]).map(t=>({id:t.getAttribute("data-pswp-id"),type:t.getAttribute("data-pswp-type"),thumbnailUrl:t.getAttribute("data-pswp-thumbnail-url"),blurImageUrl:t.getAttribute("data-pswp-blur-image-url")||t.getAttribute("data-pswp-blurhash")}))),this.filmstripContents}updateFilmstrip(t){const e=this.getElementById("filmstrip-container");if(!e)return;g(/* @__PURE__ */p(_t,{contents:this.getFilmstripContents(t),selectedIndex:t.currSlide.index,onClick:t=>this.onThumbnailClcik(t)}),e);const n=this.getElementById("pswp-caption-container");n&&"7rem"!==n.style.bottom&&(n.style.bottom="7rem")}toggleFilmstrip(){this.filmstripVisible?this.cleanupFilmstrip():this.updateFilmstrip(this.lightbox.pswp),this.filmstripVisible=!this.filmstripVisible;const t=this.querySelector("#pswp__icn-show-filmstrip"),e=this.querySelector("#pswp__icn-hide-filmstrip");t&&(t.style.display=this.filmstripVisible?"inline":"none"),e&&(e.style.display=this.filmstripVisible?"none":"inline")}cleanupFilmstrip(){const t=this.getElementById("filmstrip-container"),e=this.getElementById("pswp-caption-container");e&&(e.style.bottom="0"),t&&g(null,t),this.filmstripContents=null}},It=class{constructor(t){this.lightbox=t,this.fullscreen=!1,this.options={fullScreenButtonOrder:7},t.on("init",()=>{this.initPswpEvents(t.pswp)})}getRootNode(){return this.lightbox?.pswp?.element?.getRootNode?.()||document}querySelector(t){return this.getRootNode().querySelector?.(t)||document.querySelector(t)}syncFullscreenState(){const t=document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement;this.fullscreen=Boolean(t);const e=this.querySelector("#pswp__icn-exit-fullscreen"),n=this.querySelector("#pswp__icn-fullscreen");e&&(e.style.display=this.fullscreen?"inline":"none"),n&&(n.style.display=this.fullscreen?"none":"inline")}initPswpEvents(t){const e=()=>this.syncFullscreenState();t.events.add(document,"fullscreenchange",e),t.events.add(document,"webkitfullscreenchange",e),t.on("uiRegister",()=>{(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)&&t.ui.registerElement({name:"fullscreen-button",title:"Toggle fullscreen view",order:this.options.fullScreenButtonOrder,isButton:!0,html:'<svg aria-hidden="true" class="pswp__icn p-1" viewBox="0 0 24 24"><use class="pswp__icn-shadow" xlink:href="#pswp__icn-fullscreen"/><use class="pswp__icn-shadow" xlink:href="#pswp__icn-exit-fullscreen"/><path id="pswp__icn-fullscreen" d="M5 19h2q.425 0 .713.288T8 20t-.288.713T7 21H4q-.425 0-.712-.288T3 20v-3q0-.425.288-.712T4 16t.713.288T5 17zm14 0v-2q0-.425.288-.712T20 16t.713.288T21 17v3q0 .425-.288.713T20 21h-3q-.425 0-.712-.288T16 20t.288-.712T17 19zM5 5v2q0 .425-.288.713T4 8t-.712-.288T3 7V4q0-.425.288-.712T4 3h3q.425 0 .713.288T8 4t-.288.713T7 5zm14 0h-2q-.425 0-.712-.288T16 4t.288-.712T17 3h3q.425 0 .713.288T21 4v3q0 .425-.288.713T20 8t-.712-.288T19 7z"/><path id="pswp__icn-exit-fullscreen" style="display:none" d="M6 18H4q-.425 0-.712-.288T3 17t.288-.712T4 16h3q.425 0 .713.288T8 17v3q0 .425-.288.713T7 21t-.712-.288T6 20zm12 0v2q0 .425-.288.713T17 21t-.712-.288T16 20v-3q0-.425.288-.712T17 16h3q.425 0 .713.288T21 17t-.288.713T20 18zM6 6V4q0-.425.288-.712T7 3t.713.288T8 4v3q0 .425-.288.713T7 8H4q-.425 0-.712-.288T3 7t.288-.712T4 6zm12 0h2q.425 0 .713.288T21 7t-.288.713T20 8h-3q-.425 0-.712-.288T16 7V4q0-.425.288-.712T17 3t.713.288T18 4z"/></svg>',onClick:()=>{this.toggleFullscreen(t)}})})}toggleFullscreen(t){const e=t.element;this.fullscreen?(document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen(),t.options.showHideAnimationType="zoom",this.fullscreen=!1):(e.requestFullscreen?e.requestFullscreen():e.webkitRequestFullscreen?e.webkitRequestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.msRequestFullscreen&&e.msRequestFullscreen(),t.options.showHideAnimationType="fade",this.fullscreen=!0);const n=this.querySelector("#pswp__icn-exit-fullscreen"),i=this.querySelector("#pswp__icn-fullscreen");n&&(n.style.display=this.fullscreen?"inline":"none"),i&&(i.style.display=this.fullscreen?"none":"inline")}},Ct=class{constructor(t,e={}){this.lightbox=t,this.autoHideTimer=null,this.uiVisible=!0,this.options=Object.assign({defaultDelayMs:4e3,playPauseButtonOrder:9,progressBarPosition:"top",progressBarTransition:"ease",restartOnSlideChange:!0,autoHideProgressBar:!0},e),this.setSlideshowLength(Number(localStorage.getItem("pswp_delay"))||this.options.defaultDelayMs),this.slideshowIsRunning=!1,this.slideshowTimerID=null,this.wakeLockIsRunning=!1,this.wakeLockSentinel=null,this.lightbox.on("init",()=>{this.init(this.lightbox.pswp)})}getRootNode(){return this.lightbox?.pswp?.element?.getRootNode?.()||document}querySelector(t){return this.getRootNode().querySelector?.(t)||document.querySelector(t)}injectProgressBarStyles(){const t=this.getRootNode(),e=t===document?document.head:t;if(!e||e.querySelector("style[data-pswp-slideshow]"))return;const n=document.createElement("style");n.setAttribute("data-pswp-slideshow",""),n.textContent=`.pswp__progress-bar{position:fixed;${this.options.progressBarPosition}:0;width:0;height:0}.pswp__progress-bar.running{width:100%;height:2px;transition-property:width;background:#ff4800}`,e.appendChild(n)}init(t){t.on("uiRegister",()=>{this.injectProgressBarStyles(),t.ui.registerElement({name:"playpause-button",title:"Toggle slideshow (Space)\nChange delay with +/- while running",order:this.options.playPauseButtonOrder,isButton:!0,html:'<svg aria-hidden="true" class="pswp__icn" viewBox="0 0 24 24"><use class="pswp__icn-shadow" xlink:href="#pswp__icn-play"/><use class="pswp__icn-shadow" xlink:href="#pswp__icn-stop"/><path id="pswp__icn-play" d="M8 17.175V6.825q0-.425.3-.713t.7-.287q.125 0 .263.037t.262.113l8.15 5.175q.225.15.338.375t.112.475t-.112.475t-.338.375l-8.15 5.175q-.125.075-.262.113T9 18.175q-.4 0-.7-.288t-.3-.712"/><path id="pswp__icn-stop" style="display:none" d="M16 19q-.825 0-1.412-.587T14 17V7q0-.825.588-1.412T16 5t1.413.588T18 7v10q0 .825-.587 1.413T16 19m-8 0q-.825 0-1.412-.587T6 17V7q0-.825.588-1.412T8 5t1.413.588T10 7v10q0 .825-.587 1.413T8 19"/></svg>',onClick:()=>{this.setSlideshowState()}}),t.ui.registerElement({name:"playtime",appendTo:"wrapper",tagName:"div",className:"pswp__progress-bar"}),t.events.add(document,"keydown",t=>{switch(t.code){case"Space":this.setSlideshowState(),t.preventDefault();break;case"ArrowUp":case"NumpadAdd":case"Equal":this.changeSlideshowLength(1e3),t.preventDefault();break;case"ArrowDown":case"NumpadSubtract":case"Minus":this.changeSlideshowLength(-1e3),t.preventDefault()}})}),this.lightbox.on("change",()=>{this.slideshowIsRunning&&this.options.restartOnSlideChange&&this.goToNextSlideAfterTimeout()}),this.lightbox.on("close",()=>{this.slideshowIsRunning&&this.setSlideshowState()})}showUI(){this.lightbox&&this.lightbox.pswp&&this.lightbox.pswp.element&&this.lightbox.pswp.element.classList.add("pswp--ui-visible"),this.uiVisible=!0}stopAutoHideTimer(){this.autoHideTimer&&(clearTimeout(this.autoHideTimer),this.autoHideTimer=null)}hideUI(){this.lightbox&&this.lightbox.pswp&&this.lightbox.pswp.element&&this.lightbox.pswp.element.classList.remove("pswp--ui-visible"),this.uiVisible=!1}resetAutoHideTimer(){this.autoHideTimer&&clearTimeout(this.autoHideTimer),this.autoHideTimer=setTimeout(()=>{this.slideshowIsRunning&&this.hideUI(),this.autoHideTimer=null},[3e3])}setSlideshowState(){this.slideshowIsRunning=!this.slideshowIsRunning,this.slideshowIsRunning?(this.goToNextSlideAfterTimeout(),this.showUI(),this.resetAutoHideTimer(),document.addEventListener("touchstart",()=>{this.stopAutoHideTimer(),this.showUI()}),document.addEventListener("touchend",()=>{this.resetAutoHideTimer()}),document.addEventListener("mousemove",()=>{this.uiVisible||this.showUI(),this.resetAutoHideTimer()})):(this.showUI(),this.resetSlideshow(),this.stopAutoHideTimer());const t=this.querySelector("#pswp__icn-stop"),e=this.querySelector("#pswp__icn-play");t&&(t.style.display=this.slideshowIsRunning?"inline":"none"),e&&(e.style.display=this.slideshowIsRunning?"none":"inline");const n=this.querySelector(".pswp__progress-bar");n&&(n.style.opacity=this.options.autoHideProgressBar?null:1),this.toggleWakeLock()}setSlideshowLength(t){this.options.defaultDelayMs=Math.min(Math.max(t,1e3),2147483647),this.options.defaultDelayMs!=t&&localStorage.setItem("pswp_delay",this.options.defaultDelayMs)}changeSlideshowLength(t){if(!this.slideshowIsRunning)return;this.setSlideshowLength(this.options.defaultDelayMs+t),localStorage.setItem("pswp_delay",this.options.defaultDelayMs);const e=this.querySelector(".pswp__counter");e&&(e.innerHTML=this.options.defaultDelayMs/1e3+"s"),this.goToNextSlideAfterTimeout()}isVideoContent(t){return"video"===t?.data?.type}getSlideTimeout(){const t=this.lightbox.pswp.currSlide.content;if(this.isVideoContent(t)){const e=t.element;if(e.paused)return this.options.defaultDelayMs;const n=e.duration,i=e.currentTime;return isNaN(n)||isNaN(i)?this.options.defaultDelayMs:1e3*(n-i)}return this.options.defaultDelayMs}slideContentHasLoaded(){const t=this.lightbox.pswp.currSlide.content;if(this.isVideoContent(t)){const e=t.element;return e.ended||e.readyState===HTMLMediaElement.HAVE_ENOUGH_DATA&&[HTMLMediaElement.NETWORK_IDLE,HTMLMediaElement.NETWORK_LOADING].includes(e.networkState)}return!t.isLoading()}goToNextSlideAfterTimeout(){if(this.resetSlideshow(),this.slideContentHasLoaded()){const t=this.getSlideTimeout();this.slideshowTimerID=setTimeout(()=>{this.lightbox.pswp.next(),this.options.restartOnSlideChange||this.goToNextSlideAfterTimeout()},t),setTimeout(()=>{this.slideshowIsRunning&&this.toggleProgressBar(t)},100)}else this.slideshowTimerID=setTimeout(()=>{this.goToNextSlideAfterTimeout()},200)}getSlideTransition(){return this.isVideoContent(this.lightbox.pswp.currSlide.content)?"linear":this.options.progressBarTransition}toggleProgressBar(t){const e=this.querySelector(".pswp__progress-bar");e&&(t?(e.style.transitionTimingFunction=this.getSlideTransition(),e.style.transitionDuration=`${t}ms`,e.classList.add("running")):e.classList.remove("running"))}toggleWakeLock(){this.wakeLockIsRunning!=this.slideshowIsRunning&&("keepAwake"in screen?screen.keepAwake=this.slideshowIsRunning:"wakeLock"in navigator&&(this.wakeLockSentinel?this.wakeLockSentinel.release().then(()=>(this.wakeLockSentinel=null,!0)).catch(t=>console.error(t)):navigator.wakeLock.request("screen").then(t=>(this.wakeLockSentinel=t,this.wakeLockSentinel.addEventListener("release",()=>{this.wakeLockSentinel=null,this.wakeLockIsRunning=!1}),!0)).catch(t=>{})),this.wakeLockIsRunning=this.slideshowIsRunning)}resetSlideshow(){this.toggleProgressBar(),this.slideshowTimerID&&(clearTimeout(this.slideshowTimerID),this.slideshowTimerID=null)}},Lt={[String(E.NONE)]:function({className:t}){/* @__PURE__ */
3
+ /* @__PURE__ */p(z,{wrapperClassName:x("h-16 w-24 rounded-md lg:h-20 lg:w-20",i===e&&"border-2 border-[#ff4800]"),src:t.thumbnailUrl,placeholderSrc:t.blurImageUrl,alt:t.caption}),t.type===N.VIDEO&&/* @__PURE__ */p("div",{className:"absolute top-0 left-0 flex size-full items-center justify-center opacity-75",children:/* @__PURE__ */p("svg",{xmlns:"http://www.w3.org/2000/svg",className:"size-6 text-white lg:size-9",viewBox:"0 0 24 24",children:/* @__PURE__ */p("path",{fill:"currentColor",d:"M8 17.175V6.825q0-.425.3-.713t.7-.287q.125 0 .263.037t.262.113l8.15 5.175q.225.15.338.375t.112.475t-.112.475t-.338.375l-8.15 5.175q-.125.075-.262.113T9 18.175q-.4 0-.7-.288t-.3-.712"})})}),t.type===N.AD&&/* @__PURE__ */p("div",{className:"absolute top-1 left-1 text-xs",children:"Ad"})]},`filmstrip-thumbnail-${i}`))})},St=class{constructor(t){this.lightbox=t,this.filmstripVisible=!0,this.options={filmstripButtonOrder:7},t.on("init",()=>{this.initPswpEvents(t.pswp)})}getRootNode(){return this.lightbox?.pswp?.element?.getRootNode?.()||document}getElementById(t){const e=this.getRootNode();return"function"==typeof e.getElementById?e.getElementById(t):e.querySelector?.(`#${t}`)||document.getElementById(t)}querySelector(t){return this.getRootNode().querySelector?.(t)||document.querySelector(t)}initPswpEvents(t){t.on("uiRegister",()=>{t.ui.registerElement({name:"filmstrip-toggle-button",title:"Toggle filmstrip view",order:this.options.filmstripButtonOrder,isButton:!0,html:'<svg aria-hidden="true" class="pswp__icn p-0.5" viewBox="0 0 24 24" id="pswp__icn-show-filmstrip"><use class="pswp__icn-shadow" xlink:href="#pswp__icn-show-filmstrip"/>\n <path\n d="M4 20q-.825 0-1.412-.587T2 18V6q0-.825.588-1.412T4 4h16q.825 0 1.413.588T22 6v12q0 .825-.587 1.413T20 20zm0-2h16V8H4z" />\n <path\n d="m 5.100795,16.58464 q -0.165328,0 -0.282961,-0.116899 Q 4.700201,16.350842 4.7,16.186347 V 13.398294 Q 4.7,13.233997 4.817834,13.117098 4.935667,13.000199 5.100795,13 h 2.805561 q 0.165328,0 0.283161,0.117098 0.117834,0.117099 0.117633,0.281196 v 2.788053 q 0,0.164296 -0.117633,0.281394 -0.117633,0.117099 -0.283161,0.116899 z"\n\n style="stroke-width:0.199771" />\n <path\n\n d="m 10.572144,16.65489 q -0.165329,0 -0.282961,-0.116899 -0.117633,-0.116899 -0.117834,-0.281394 v -2.788053 q 0,-0.164297 0.117834,-0.281196 0.117832,-0.116899 0.282961,-0.117098 h 2.805561 q 0.165328,0 0.283161,0.117098 0.117834,0.117099 0.117633,0.281196 v 2.788053 q 0,0.164296 -0.117633,0.281394 -0.117633,0.117099 -0.283161,0.116899 z"\n\n style="stroke-width:0.199771" />\n <path\n\n d="m 16.049385,16.724729 q -0.165328,0 -0.282961,-0.116899 -0.117633,-0.116899 -0.117834,-0.281394 v -2.788053 q 0,-0.164297 0.117834,-0.281196 0.117833,-0.116899 0.282961,-0.117098 h 2.805561 q 0.165328,0 0.283161,0.117098 0.117834,0.117099 0.117634,0.281196 v 2.788053 q 0,0.164296 -0.117634,0.281394 -0.117633,0.117099 -0.283161,0.116899 z"\n\n style="stroke-width:0.199771" />\n </svg>\n <svg aria-hidden="true" class="pswp__icn p-0.5" viewBox="0 0 24 24" id="pswp__icn-hide-filmstrip" style="display:none"><use class="pswp__icn-shadow" xlink:href="#pswp__icn-hide-filmstrip"/>\n <path\n d="M4 20q-.825 0-1.412-.587T2 18V6q0-.825.588-1.412T4 4v2.85L1.35 4.2q-.3-.3-.3-.712t.3-.713t.713-.3t.712.3l18.4 18.4q.3.3.3.7t-.3.7t-.712.3t-.713-.3L17.15 20zm0-2h11.15l-10-10H4zM22 6v11q0 .5-.312.75T21 18t-.687-.262t-.313-.763V8h-8.325q-.4 0-.763-.15t-.637-.425L8.55 5.7q-.225-.25-.275-.525t.075-.55t.35-.45T9.275 4H20q.825 0 1.413.588T22 6"\n />\n <path\n\n d="m 5.100795,16.58464 q -0.165328,0 -0.282961,-0.116899 Q 4.700201,16.350842 4.7,16.186347 V 13.398294 Q 4.7,13.233997 4.817834,13.117098 4.935667,13.000199 5.100795,13 h 2.805561 q 0.165328,0 0.283161,0.117098 0.117834,0.117099 0.117633,0.281196 v 2.788053 q 0,0.164296 -0.117633,0.281394 -0.117633,0.117099 -0.283161,0.116899 z"\n\n style="stroke-width:0.199771" />\n <path\n\n d="m 10.572143,16.65489 q -0.165327,0 -0.282961,-0.116899 -0.117632,-0.116899 -0.117833,-0.281394 v -2.788053 q 0,-0.164297 0.117833,-0.281196 0.117834,-0.116899 0.282961,-0.117098 h 2.805562 q 0.165328,0 0.283161,0.117098 0.117834,0.117099 0.117633,0.281196 v 2.788053 q 0,0.164296 -0.117633,0.281394 -0.117633,0.117099 -0.283161,0.116899 z"\n\n style="stroke-width:0.199771" />\n <path\n\n d="m 16.049385,16.724729 q -0.165327,0 -0.282961,-0.116899 -0.117632,-0.116899 -0.117833,-0.281394 v -2.788053 q 0,-0.164297 0.117833,-0.281196 0.117834,-0.116899 0.282961,-0.117098 h 2.805561 q 0.165328,0 0.283161,0.117098 0.117834,0.117099 0.117634,0.281196 v 2.788053 q 0,0.164296 -0.117634,0.281394 -0.117633,0.117099 -0.283161,0.116899 z"\n\n style="stroke-width:0.199771" />\n </svg>\n\n ',onClick:()=>{this.toggleFilmstrip()}}),t.ui.registerElement({name:"filmstrip",isButton:!1,appendTo:"root",html:'\n <div id="filmstrip-container" class="w-full absolute bottom-0">\n </div>\n '})}),t.on("change",()=>{this.filmstripVisible&&this.updateFilmstrip(t)}),t.on("close",()=>{this.cleanupFilmstrip()})}onThumbnailClcik(t){this.lightbox.pswp.goTo(t)}getFilmstripContents(t){const e=t?.options?.dataSource?.items,n=e?.length??0;return this.filmstripContents&&this.filmstripContents.length===n||(this.filmstripContents=(e??[]).map(t=>({id:t.getAttribute("data-pswp-id"),type:t.getAttribute("data-pswp-type"),thumbnailUrl:t.getAttribute("data-pswp-thumbnail-url"),blurImageUrl:t.getAttribute("data-pswp-blur-image-url")||t.getAttribute("data-pswp-blurhash")}))),this.filmstripContents}updateFilmstrip(e){const n=this.getElementById("filmstrip-container");if(!n)return;t(/* @__PURE__ */p(_t,{contents:this.getFilmstripContents(e),selectedIndex:e.currSlide.index,onClick:t=>this.onThumbnailClcik(t)}),n);const i=this.getElementById("pswp-caption-container");i&&"7rem"!==i.style.bottom&&(i.style.bottom="7rem")}toggleFilmstrip(){this.filmstripVisible?this.cleanupFilmstrip():this.updateFilmstrip(this.lightbox.pswp),this.filmstripVisible=!this.filmstripVisible;const t=this.querySelector("#pswp__icn-show-filmstrip"),e=this.querySelector("#pswp__icn-hide-filmstrip");t&&(t.style.display=this.filmstripVisible?"inline":"none"),e&&(e.style.display=this.filmstripVisible?"none":"inline")}cleanupFilmstrip(){const e=this.getElementById("filmstrip-container"),n=this.getElementById("pswp-caption-container");n&&(n.style.bottom="0"),e&&t(null,e),this.filmstripContents=null}},It=class{constructor(t){this.lightbox=t,this.fullscreen=!1,this.options={fullScreenButtonOrder:7},t.on("init",()=>{this.initPswpEvents(t.pswp)})}getRootNode(){return this.lightbox?.pswp?.element?.getRootNode?.()||document}querySelector(t){return this.getRootNode().querySelector?.(t)||document.querySelector(t)}syncFullscreenState(){const t=document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement;this.fullscreen=Boolean(t);const e=this.querySelector("#pswp__icn-exit-fullscreen"),n=this.querySelector("#pswp__icn-fullscreen");e&&(e.style.display=this.fullscreen?"inline":"none"),n&&(n.style.display=this.fullscreen?"none":"inline")}initPswpEvents(t){const e=()=>this.syncFullscreenState();t.events.add(document,"fullscreenchange",e),t.events.add(document,"webkitfullscreenchange",e),t.on("uiRegister",()=>{(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)&&t.ui.registerElement({name:"fullscreen-button",title:"Toggle fullscreen view",order:this.options.fullScreenButtonOrder,isButton:!0,html:'<svg aria-hidden="true" class="pswp__icn p-1" viewBox="0 0 24 24"><use class="pswp__icn-shadow" xlink:href="#pswp__icn-fullscreen"/><use class="pswp__icn-shadow" xlink:href="#pswp__icn-exit-fullscreen"/><path id="pswp__icn-fullscreen" d="M5 19h2q.425 0 .713.288T8 20t-.288.713T7 21H4q-.425 0-.712-.288T3 20v-3q0-.425.288-.712T4 16t.713.288T5 17zm14 0v-2q0-.425.288-.712T20 16t.713.288T21 17v3q0 .425-.288.713T20 21h-3q-.425 0-.712-.288T16 20t.288-.712T17 19zM5 5v2q0 .425-.288.713T4 8t-.712-.288T3 7V4q0-.425.288-.712T4 3h3q.425 0 .713.288T8 4t-.288.713T7 5zm14 0h-2q-.425 0-.712-.288T16 4t.288-.712T17 3h3q.425 0 .713.288T21 4v3q0 .425-.288.713T20 8t-.712-.288T19 7z"/><path id="pswp__icn-exit-fullscreen" style="display:none" d="M6 18H4q-.425 0-.712-.288T3 17t.288-.712T4 16h3q.425 0 .713.288T8 17v3q0 .425-.288.713T7 21t-.712-.288T6 20zm12 0v2q0 .425-.288.713T17 21t-.712-.288T16 20v-3q0-.425.288-.712T17 16h3q.425 0 .713.288T21 17t-.288.713T20 18zM6 6V4q0-.425.288-.712T7 3t.713.288T8 4v3q0 .425-.288.713T7 8H4q-.425 0-.712-.288T3 7t.288-.712T4 6zm12 0h2q.425 0 .713.288T21 7t-.288.713T20 8h-3q-.425 0-.712-.288T16 7V4q0-.425.288-.712T17 3t.713.288T18 4z"/></svg>',onClick:()=>{this.toggleFullscreen(t)}})})}toggleFullscreen(t){const e=t.element;this.fullscreen?(document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen(),t.options.showHideAnimationType="zoom",this.fullscreen=!1):(e.requestFullscreen?e.requestFullscreen():e.webkitRequestFullscreen?e.webkitRequestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.msRequestFullscreen&&e.msRequestFullscreen(),t.options.showHideAnimationType="fade",this.fullscreen=!0);const n=this.querySelector("#pswp__icn-exit-fullscreen"),i=this.querySelector("#pswp__icn-fullscreen");n&&(n.style.display=this.fullscreen?"inline":"none"),i&&(i.style.display=this.fullscreen?"none":"inline")}},Ct=class{constructor(t,e={}){this.lightbox=t,this.autoHideTimer=null,this.uiVisible=!0,this.options=Object.assign({defaultDelayMs:4e3,playPauseButtonOrder:9,progressBarPosition:"top",progressBarTransition:"ease",restartOnSlideChange:!0,autoHideProgressBar:!0},e),this.setSlideshowLength(Number(localStorage.getItem("pswp_delay"))||this.options.defaultDelayMs),this.slideshowIsRunning=!1,this.slideshowTimerID=null,this.wakeLockIsRunning=!1,this.wakeLockSentinel=null,this.lightbox.on("init",()=>{this.init(this.lightbox.pswp)})}getRootNode(){return this.lightbox?.pswp?.element?.getRootNode?.()||document}querySelector(t){return this.getRootNode().querySelector?.(t)||document.querySelector(t)}injectProgressBarStyles(){const t=this.getRootNode(),e=t===document?document.head:t;if(!e||e.querySelector("style[data-pswp-slideshow]"))return;const n=document.createElement("style");n.setAttribute("data-pswp-slideshow",""),n.textContent=`.pswp__progress-bar{position:fixed;${this.options.progressBarPosition}:0;width:0;height:0}.pswp__progress-bar.running{width:100%;height:2px;transition-property:width;background:#ff4800}`,e.appendChild(n)}init(t){t.on("uiRegister",()=>{this.injectProgressBarStyles(),t.ui.registerElement({name:"playpause-button",title:"Toggle slideshow (Space)\nChange delay with +/- while running",order:this.options.playPauseButtonOrder,isButton:!0,html:'<svg aria-hidden="true" class="pswp__icn" viewBox="0 0 24 24"><use class="pswp__icn-shadow" xlink:href="#pswp__icn-play"/><use class="pswp__icn-shadow" xlink:href="#pswp__icn-stop"/><path id="pswp__icn-play" d="M8 17.175V6.825q0-.425.3-.713t.7-.287q.125 0 .263.037t.262.113l8.15 5.175q.225.15.338.375t.112.475t-.112.475t-.338.375l-8.15 5.175q-.125.075-.262.113T9 18.175q-.4 0-.7-.288t-.3-.712"/><path id="pswp__icn-stop" style="display:none" d="M16 19q-.825 0-1.412-.587T14 17V7q0-.825.588-1.412T16 5t1.413.588T18 7v10q0 .825-.587 1.413T16 19m-8 0q-.825 0-1.412-.587T6 17V7q0-.825.588-1.412T8 5t1.413.588T10 7v10q0 .825-.587 1.413T8 19"/></svg>',onClick:()=>{this.setSlideshowState()}}),t.ui.registerElement({name:"playtime",appendTo:"wrapper",tagName:"div",className:"pswp__progress-bar"}),t.events.add(document,"keydown",t=>{switch(t.code){case"Space":this.setSlideshowState(),t.preventDefault();break;case"ArrowUp":case"NumpadAdd":case"Equal":this.changeSlideshowLength(1e3),t.preventDefault();break;case"ArrowDown":case"NumpadSubtract":case"Minus":this.changeSlideshowLength(-1e3),t.preventDefault()}})}),this.lightbox.on("change",()=>{this.slideshowIsRunning&&this.options.restartOnSlideChange&&this.goToNextSlideAfterTimeout()}),this.lightbox.on("close",()=>{this.slideshowIsRunning&&this.setSlideshowState()})}showUI(){this.lightbox&&this.lightbox.pswp&&this.lightbox.pswp.element&&this.lightbox.pswp.element.classList.add("pswp--ui-visible"),this.uiVisible=!0}stopAutoHideTimer(){this.autoHideTimer&&(clearTimeout(this.autoHideTimer),this.autoHideTimer=null)}hideUI(){this.lightbox&&this.lightbox.pswp&&this.lightbox.pswp.element&&this.lightbox.pswp.element.classList.remove("pswp--ui-visible"),this.uiVisible=!1}resetAutoHideTimer(){this.autoHideTimer&&clearTimeout(this.autoHideTimer),this.autoHideTimer=setTimeout(()=>{this.slideshowIsRunning&&this.hideUI(),this.autoHideTimer=null},[3e3])}setSlideshowState(){this.slideshowIsRunning=!this.slideshowIsRunning,this.slideshowIsRunning?(this.goToNextSlideAfterTimeout(),this.showUI(),this.resetAutoHideTimer(),document.addEventListener("touchstart",()=>{this.stopAutoHideTimer(),this.showUI()}),document.addEventListener("touchend",()=>{this.resetAutoHideTimer()}),document.addEventListener("mousemove",()=>{this.uiVisible||this.showUI(),this.resetAutoHideTimer()})):(this.showUI(),this.resetSlideshow(),this.stopAutoHideTimer());const t=this.querySelector("#pswp__icn-stop"),e=this.querySelector("#pswp__icn-play");t&&(t.style.display=this.slideshowIsRunning?"inline":"none"),e&&(e.style.display=this.slideshowIsRunning?"none":"inline");const n=this.querySelector(".pswp__progress-bar");n&&(n.style.opacity=this.options.autoHideProgressBar?null:1),this.toggleWakeLock()}setSlideshowLength(t){this.options.defaultDelayMs=Math.min(Math.max(t,1e3),2147483647),this.options.defaultDelayMs!=t&&localStorage.setItem("pswp_delay",this.options.defaultDelayMs)}changeSlideshowLength(t){if(!this.slideshowIsRunning)return;this.setSlideshowLength(this.options.defaultDelayMs+t),localStorage.setItem("pswp_delay",this.options.defaultDelayMs);const e=this.querySelector(".pswp__counter");e&&(e.innerHTML=this.options.defaultDelayMs/1e3+"s"),this.goToNextSlideAfterTimeout()}isVideoContent(t){return"video"===t?.data?.type}getSlideTimeout(){const t=this.lightbox.pswp.currSlide.content;if(this.isVideoContent(t)){const e=t.element;if(e.paused)return this.options.defaultDelayMs;const n=e.duration,i=e.currentTime;return isNaN(n)||isNaN(i)?this.options.defaultDelayMs:1e3*(n-i)}return this.options.defaultDelayMs}slideContentHasLoaded(){const t=this.lightbox.pswp.currSlide.content;if(this.isVideoContent(t)){const e=t.element;return e.ended||e.readyState===HTMLMediaElement.HAVE_ENOUGH_DATA&&[HTMLMediaElement.NETWORK_IDLE,HTMLMediaElement.NETWORK_LOADING].includes(e.networkState)}return!t.isLoading()}goToNextSlideAfterTimeout(){if(this.resetSlideshow(),this.slideContentHasLoaded()){const t=this.getSlideTimeout();this.slideshowTimerID=setTimeout(()=>{this.lightbox.pswp.next(),this.options.restartOnSlideChange||this.goToNextSlideAfterTimeout()},t),setTimeout(()=>{this.slideshowIsRunning&&this.toggleProgressBar(t)},100)}else this.slideshowTimerID=setTimeout(()=>{this.goToNextSlideAfterTimeout()},200)}getSlideTransition(){return this.isVideoContent(this.lightbox.pswp.currSlide.content)?"linear":this.options.progressBarTransition}toggleProgressBar(t){const e=this.querySelector(".pswp__progress-bar");e&&(t?(e.style.transitionTimingFunction=this.getSlideTransition(),e.style.transitionDuration=`${t}ms`,e.classList.add("running")):e.classList.remove("running"))}toggleWakeLock(){this.wakeLockIsRunning!=this.slideshowIsRunning&&("keepAwake"in screen?screen.keepAwake=this.slideshowIsRunning:"wakeLock"in navigator&&(this.wakeLockSentinel?this.wakeLockSentinel.release().then(()=>(this.wakeLockSentinel=null,!0)).catch(t=>console.error(t)):navigator.wakeLock.request("screen").then(t=>(this.wakeLockSentinel=t,this.wakeLockSentinel.addEventListener("release",()=>{this.wakeLockSentinel=null,this.wakeLockIsRunning=!1}),!0)).catch(t=>{})),this.wakeLockIsRunning=this.slideshowIsRunning)}resetSlideshow(){this.toggleProgressBar(),this.slideshowTimerID&&(clearTimeout(this.slideshowTimerID),this.slideshowTimerID=null)}},Lt={[String(E.NONE)]:function({className:t}){/* @__PURE__ */
4
4
  return p("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:t,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */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"})})},[E.LINK]:function({className:t}){/* @__PURE__ */
5
5
  return p("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:t,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */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"})})},[E.EMAIL]:function({className:t}){/* @__PURE__ */
6
6
  return p("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:t,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */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"})})},[E.PHONE]:function({className:t}){/* @__PURE__ */
@@ -23,15 +23,15 @@ return p(et,{open:Boolean(t&&e),onOpenChange:t=>!t&&n?.(),children:/* @__PURE__
23
23
  /* @__PURE__ */p("div",{className:"flex flex-col gap-2 p-3",children:[/* @__PURE__ */p(B,{variant:"h4",align:"center",lines:2,children:e?.title}),/* @__PURE__ */p(B,{variant:"body3",color:"secondary",align:"center",lines:4,children:e?.description})]}),s&&/* @__PURE__ */p(A,{fullWidth:!0,className:"rounded-none",onClick:()=>{i?.(e?._id,e?.targetType??E.LINK,e?.targetUrl),n?.()},icon:/* @__PURE__ */p(o,{className:"size-5"}),children:e?.targetText})]})]})})},Rt=({style:t,content:e,curateLink:n,onAdClick:i})=>{const{captureAdImpression:s,captureAdEngagement:o,captureAdClick:r}=G(),l=Boolean(n&&i),a=e.ctaBg||"#ff4800",c=e.ctaForeground||"#FFFFFF",d=Lt[e?.targetType??E.LINK];/* @__PURE__ */
24
24
  return p("div",{style:t,className:"group relative mb-1 overflow-hidden rounded",children:[
25
25
  /* @__PURE__ */p(V,{className:"size-full",threshold:.8,triggerOnce:!0,onChange:t=>{t&&s(e._id)},onClick:()=>o(e._id),children:/* @__PURE__ */p(D,{url:e.src||e.imageUrl,thumbnailUrl:e.src||e.imageUrl,blurhash:e.blurhash,alt:e.caption,onClick:l?i:void 0,pswpData:{id:e._id,type:N.AD,hash:e._id,width:e.width,height:e.height,title:e.title,description:e.description,targetType:e.targetType,targetText:e.targetText,targetUrl:e.targetUrl,thumbnailUrl:e.imageUrl,blurhash:e.blurhash}})}),
26
- /* @__PURE__ */p("span",{className:"bg-background/70 absolute top-1 right-1 rounded px-1 text-xs font-medium",children:"Ad"}),(e.title||e.targetType!==E.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:[e.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:e.title})}),e?.targetType!==E.NONE&&/* @__PURE__ */p("button",{className:"flex w-full items-center justify-center gap-1 rounded-none border-0 py-2 text-nowrap sm:gap-2",style:{backgroundColor:a,color:c},onClick:()=>{l?i?.():r(e._id,e.targetType,e.targetUrl)},children:[/* @__PURE__ */p("span",{style:{color:c},children:/* @__PURE__ */p(d,{})}),e?.targetText]})]})]})},Bt=({style:t,gamConfig:e,slotIndex:n,eventId:i,organizationId:s})=>{const l=r(null),a=r(null),{trackGamAnalytics:c}=G(),d=`gam-slot-${i??"ev"}-${n}`,h=Math.max(1,Math.round(t?.width||e.sizes[0]?.[0]||300)),u=Math.max(1,Math.round(t?.height||e.sizes[0]?.[1]||250)),m=r({w:h,h:u});return o(()=>{let t=!1,n=null,o=null,r=null,h=null;return(async()=>{await j(),!t&&l.current&&window.googletag.cmd.push(()=>{if(t)return;Q(d);const{w:u,h:p}=m.current,g=[[u,p],...e.sizes],f=window.googletag.defineSlot(e.adUnitPath,g,d)?.addService(window.googletag.pubads());if(!f)return;a.current=f,o=window.googletag.pubads(),i?f.setConfig({targeting:{qrati_event:i,...e.categories.length>0?{qrati_category:e.categories}:{}}}):e.categories.length>0&&f.setConfig({targeting:{qrati_category:e.categories}}),r=t=>{t.slot===f&&c({eventId:i,organizationId:s,type:w.GAM_IMPRESSION,creativeId:String(t.creativeId??""),lineItemId:String(t.lineItemId??""),advertiserId:String(t.advertiserId??""),isEmpty:t.isEmpty??!1})},o.addEventListener("slotRenderEnded",r),h=t=>{t.slot===f&&c({eventId:i,organizationId:s,type:w.GAM_VIEWABLE})},o.addEventListener("impressionViewable",h);const T=l.current;T&&(n=Y({container:T,onClick:()=>{c({eventId:i,organizationId:s,type:w.GAM_CLICK})}}),$(),window.googletag.display(d))})})(),()=>{t=!0,n?.(),o&&"function"==typeof o.removeEventListener&&(r&&o.removeEventListener("slotRenderEnded",r),h&&o.removeEventListener("impressionViewable",h));const e=a.current;a.current=null,e&&window.googletag?.cmd?.push(()=>{window.googletag.destroySlots([e])})}},[i,e.adUnitPath,e.categories,s,d]),/* @__PURE__ */p("div",{style:{width:h,height:u},className:"relative overflow-hidden rounded bg-neutral-100 dark:bg-neutral-800","data-gam-slot-index":n,children:/* @__PURE__ */p("div",{id:d,ref:l,style:{width:h,height:u},className:"gam-ad-slot"})})},At=(t,e)=>{if(!t||!e)return null;const n=e[t];if(!n)return null;try{const t=new Date(String(n)),e=/* @__PURE__ */new Date,i=t.getFullYear()===e.getFullYear(),s={weekday:"long",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0};return i||(s.year="numeric"),t.toLocaleString("en-US",s).replace(","," •")}catch{return null}},Vt=t(null),zt=()=>{const t=f(Vt);if(!t)throw new Error("Popover components must be used within a Popover");return t},Ot=({children:t,className:e,open:n,onOpenChange:i})=>{const[s,o]=a(!1),c="boolean"==typeof n,d=c?n:s,h=l(),u=`popover-trigger-${h}`,m=`popover-content-${h}`,g=r(null);/* @__PURE__ */
27
- return p(Vt.Provider,{value:{isOpen:d,setIsOpen:t=>{c||o(t),i?.(t)},triggerId:u,contentId:m,triggerRef:g},children:/* @__PURE__ */p("div",{"data-slot":"popover",className:x("relative inline-block",e),children:t})})},Ft=({children:t,asChild:n,className:i,onClick:s,...o})=>{const{isOpen:r,setIsOpen:l,triggerId:a,contentId:c,triggerRef:d}=zt();if(n){const n=Array.isArray(t)?t[0]:t;if(n&&n.type){const t=n.props?.className;return e(n,{ref:t=>{d.current=t},id:a,className:i?t?`${t} ${i}`:i:t,"aria-haspopup":"dialog","aria-expanded":r,"aria-controls":r?c:void 0,onClick:t=>{l(!r),n.props?.onClick?.(t)},"data-state":r?"open":"closed"})}}/* @__PURE__ */
28
- return p("button",{ref:d,id:a,type:"button","aria-haspopup":"dialog","aria-expanded":r,"aria-controls":r?c:void 0,"data-slot":"popover-trigger","data-state":r?"open":"closed",className:i,onClick:t=>{l(!r),s?.(t)},...o,children:t})},Pt=({children:t,className:e,align:n="center",side:i="top",sideOffset:s=4,...l})=>{const{isOpen:c,setIsOpen:u,contentId:m,triggerRef:g}=zt(),{organization:f,portalContainer:w}=_(),T=r(null),[y,b]=a(null);if(d(()=>{if(!c)return;const t=()=>{if(!g.current||!T.current)return;const t=g.current.getBoundingClientRect(),e=T.current.getBoundingClientRect();let o=t.left,r=t.bottom+s;"center"===n&&(o=t.left+t.width/2-e.width/2),"end"===n&&(o=t.right-e.width),"top"===i&&(r=t.top-e.height-s),"left"===i&&(o=t.left-e.width-s,r=t.top+t.height/2-e.height/2),"right"===i&&(o=t.right+s,r=t.top+t.height/2-e.height/2),"bottom"===i&&(r=t.bottom+s),b({top:r,left:o})},e=requestAnimationFrame(t);return window.addEventListener("resize",t),window.addEventListener("scroll",t,!0),()=>{cancelAnimationFrame(e),window.removeEventListener("resize",t),window.removeEventListener("scroll",t,!0)}},[n,c,i,s,g]),o(()=>{if(!c)return;const t=t=>{const e="function"==typeof t.composedPath?t.composedPath():[],n=t.target,i=T.current&&(T.current.contains(n)||e.includes(T.current)),s=g.current&&(g.current.contains(n)||e.includes(g.current));i||s||u(!1)},e=t=>{"Escape"===t.key&&(u(!1),g.current?.focus())},n=window.setTimeout(()=>{document.addEventListener("mousedown",t)},0);return document.addEventListener("keydown",e),()=>{window.clearTimeout(n),document.removeEventListener("mousedown",t),document.removeEventListener("keydown",e)}},[c,u,g]),!c)return null;const v=/* @__PURE__ */p("div",{ref:T,id:m,role:"dialog","aria-modal":"false","data-state":c?"open":"closed",className:x("bg-background text-foreground border-border shadow-outer rounded outline-none",e),style:{position:"fixed",top:y?.top??0,left:y?.left??0,zIndex:2010,...q(f)},...l,children:t});return"undefined"!=typeof document?h(v,w??document.body):v},Dt=({eventId:t,contentId:e,emojis:n=[],counts:i={},userReaction:s})=>{const{user:l,props:c,organization:d}=_(),h=c?.loginUrl,{handleReactionClick:u,isPending:m}=(()=>{const t=y(),{props:e,user:n}=_(),i=e?.organizationId,s=L({mutationFn:async({eventId:t,contentId:e,emoji:s})=>{await b.post(S.UPDATE_REACTION,{json:{eventId:t,contentId:e,reaction:s},headers:{"x-org-id":i,Authorization:`Bearer ${n?.token}`}})},onMutate:async({eventId:e,contentId:n,emoji:i})=>{const s=[v.CONTENTS_BY_EVENT(e)];await t.cancelQueries({queryKey:s});const o=t.getQueriesData({queryKey:s});return t.setQueriesData({queryKey:s},t=>((t,e,n)=>t?.pages&&Array.isArray(t.pages)?{...t,pages:t.pages.map(t=>t.data?{...t,data:t.data.map(t=>{if(t._id!==e)return t;const i={...t.reactionCounts??{}};return t.userReaction&&t.userReaction!==n&&(i[t.userReaction]=Math.max(0,(i[t.userReaction]??1)-1)),t.userReaction===n?(i[n]=Math.max(0,(i[n]??1)-1),{...t,reactionCounts:i,userReaction:void 0}):(i[n]=(i[n]??0)+1,{...t,reactionCounts:i,userReaction:n})})}:t)}:t)(t,n,i)),{previousData:o}},onError:(e,n,i)=>{i?.previousData?.forEach(([e,n])=>{t.setQueryData(e,n)}),H.error("Failed to add reaction"),console.error("Error handling reaction click:",e,n)}});return{handleReactionClick:async(t,e,i)=>{if(!t||!e||!i)return!1;if(!n)return H.error("Please login to react"),!1;try{return await s.mutateAsync({eventId:t,contentId:e,emoji:i}),!0}catch(o){return!1}},isPending:s.isPending}})(),[g,f]=a(!1),[w,k]=a(null),q=r(null),E=Object.values(i).reduce((t,e)=>t+e,0);return o(()=>()=>{q.current&&clearTimeout(q.current)},[]),/* @__PURE__ */p(Ot,{open:g,onOpenChange:f,children:[/* @__PURE__ */p(Ft,{asChild:!0,children:/* @__PURE__ */p("button",{type:"button",className:x("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",w&&"scale-[1.03] shadow-sm"),children:[(n||[]).slice().sort((t,e)=>(i[e]||0)-(i[t]||0)).slice(0,1).map(t=>/* @__PURE__ */p("span",{className:x("text-sm transition-transform duration-150 ease-out sm:text-lg",w===(s||t)&&"scale-125"),children:s||t},`${e}-${t}-1`)),E>0&&/* @__PURE__ */p("span",{className:"text-xs font-bold sm:text-sm",children:E||0})]})}),/* @__PURE__ */p(Pt,{side:"top",align:"end",children:[l?null:/* @__PURE__ */p("div",d?.customAuth?{className:"p-2 font-semibold",children:["Please"," ",
26
+ /* @__PURE__ */p("span",{className:"bg-background/70 absolute top-1 right-1 rounded px-1 text-xs font-medium",children:"Ad"}),(e.title||e.targetType!==E.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:[e.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:e.title})}),e?.targetType!==E.NONE&&/* @__PURE__ */p("button",{className:"flex w-full items-center justify-center gap-1 rounded-none border-0 py-2 text-nowrap sm:gap-2",style:{backgroundColor:a,color:c},onClick:()=>{l?i?.():r(e._id,e.targetType,e.targetUrl)},children:[/* @__PURE__ */p("span",{style:{color:c},children:/* @__PURE__ */p(d,{})}),e?.targetText]})]})]})},Bt=({style:t,gamConfig:e,slotIndex:n,eventId:i,organizationId:s})=>{const l=r(null),a=r(null),{trackGamAnalytics:c}=G(),d=`gam-slot-${i??"ev"}-${n}`,h=Math.max(1,Math.round(t?.width||e.sizes[0]?.[0]||300)),u=Math.max(1,Math.round(t?.height||e.sizes[0]?.[1]||250)),m=r({w:h,h:u});return o(()=>{let t=!1,n=null,o=null,r=null,h=null;return(async()=>{await j(),!t&&l.current&&window.googletag.cmd.push(()=>{if(t)return;Q(d);const{w:u,h:p}=m.current,g=[[u,p],...e.sizes],f=window.googletag.defineSlot(e.adUnitPath,g,d)?.addService(window.googletag.pubads());if(!f)return;a.current=f,o=window.googletag.pubads(),i?f.setConfig({targeting:{qrati_event:i,...e.categories.length>0?{qrati_category:e.categories}:{}}}):e.categories.length>0&&f.setConfig({targeting:{qrati_category:e.categories}}),r=t=>{t.slot===f&&c({eventId:i,organizationId:s,type:w.GAM_IMPRESSION,creativeId:String(t.creativeId??""),lineItemId:String(t.lineItemId??""),advertiserId:String(t.advertiserId??""),isEmpty:t.isEmpty??!1})},o.addEventListener("slotRenderEnded",r),h=t=>{t.slot===f&&c({eventId:i,organizationId:s,type:w.GAM_VIEWABLE})},o.addEventListener("impressionViewable",h);const T=l.current;T&&(n=Y({container:T,onClick:()=>{c({eventId:i,organizationId:s,type:w.GAM_CLICK})}}),$(),window.googletag.display(d))})})(),()=>{t=!0,n?.(),o&&"function"==typeof o.removeEventListener&&(r&&o.removeEventListener("slotRenderEnded",r),h&&o.removeEventListener("impressionViewable",h));const e=a.current;a.current=null,e&&window.googletag?.cmd?.push(()=>{window.googletag.destroySlots([e])})}},[i,e.adUnitPath,e.categories,s,d]),/* @__PURE__ */p("div",{style:{width:h,height:u},className:"relative overflow-hidden rounded bg-neutral-100 dark:bg-neutral-800","data-gam-slot-index":n,children:/* @__PURE__ */p("div",{id:d,ref:l,style:{width:h,height:u},className:"gam-ad-slot"})})},At=(t,e)=>{if(!t||!e)return null;const n=e[t];if(!n)return null;try{const t=new Date(String(n)),e=/* @__PURE__ */new Date,i=t.getFullYear()===e.getFullYear(),s={weekday:"long",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0};return i||(s.year="numeric"),t.toLocaleString("en-US",s).replace(","," •")}catch{return null}},Vt=n(null),zt=()=>{const t=f(Vt);if(!t)throw new Error("Popover components must be used within a Popover");return t},Ot=({children:t,className:e,open:n,onOpenChange:i})=>{const[s,o]=a(!1),c="boolean"==typeof n,d=c?n:s,h=l(),u=`popover-trigger-${h}`,m=`popover-content-${h}`,g=r(null);/* @__PURE__ */
27
+ return p(Vt.Provider,{value:{isOpen:d,setIsOpen:t=>{c||o(t),i?.(t)},triggerId:u,contentId:m,triggerRef:g},children:/* @__PURE__ */p("div",{"data-slot":"popover",className:x("relative inline-block",e),children:t})})},Ft=({children:t,asChild:e,className:n,onClick:s,...o})=>{const{isOpen:r,setIsOpen:l,triggerId:a,contentId:c,triggerRef:d}=zt();if(e){const e=Array.isArray(t)?t[0]:t;if(e&&e.type){const t=e.props?.className;return i(e,{ref:t=>{d.current=t},id:a,className:n?t?`${t} ${n}`:n:t,"aria-haspopup":"dialog","aria-expanded":r,"aria-controls":r?c:void 0,onClick:t=>{l(!r),e.props?.onClick?.(t)},"data-state":r?"open":"closed"})}}/* @__PURE__ */
28
+ return p("button",{ref:d,id:a,type:"button","aria-haspopup":"dialog","aria-expanded":r,"aria-controls":r?c:void 0,"data-slot":"popover-trigger","data-state":r?"open":"closed",className:n,onClick:t=>{l(!r),s?.(t)},...o,children:t})},Pt=({children:t,className:e,align:n="center",side:i="top",sideOffset:s=4,...l})=>{const{isOpen:c,setIsOpen:u,contentId:m,triggerRef:g}=zt(),{organization:f,portalContainer:w}=_(),T=r(null),[y,b]=a(null);if(d(()=>{if(!c)return;const t=()=>{if(!g.current||!T.current)return;const t=g.current.getBoundingClientRect(),e=T.current.getBoundingClientRect();let o=t.left,r=t.bottom+s;"center"===n&&(o=t.left+t.width/2-e.width/2),"end"===n&&(o=t.right-e.width),"top"===i&&(r=t.top-e.height-s),"left"===i&&(o=t.left-e.width-s,r=t.top+t.height/2-e.height/2),"right"===i&&(o=t.right+s,r=t.top+t.height/2-e.height/2),"bottom"===i&&(r=t.bottom+s),b({top:r,left:o})},e=requestAnimationFrame(t);return window.addEventListener("resize",t),window.addEventListener("scroll",t,!0),()=>{cancelAnimationFrame(e),window.removeEventListener("resize",t),window.removeEventListener("scroll",t,!0)}},[n,c,i,s,g]),o(()=>{if(!c)return;const t=t=>{const e="function"==typeof t.composedPath?t.composedPath():[],n=t.target,i=T.current&&(T.current.contains(n)||e.includes(T.current)),s=g.current&&(g.current.contains(n)||e.includes(g.current));i||s||u(!1)},e=t=>{"Escape"===t.key&&(u(!1),g.current?.focus())},n=window.setTimeout(()=>{document.addEventListener("mousedown",t)},0);return document.addEventListener("keydown",e),()=>{window.clearTimeout(n),document.removeEventListener("mousedown",t),document.removeEventListener("keydown",e)}},[c,u,g]),!c)return null;const v=/* @__PURE__ */p("div",{ref:T,id:m,role:"dialog","aria-modal":"false","data-state":c?"open":"closed",className:x("bg-background text-foreground border-border shadow-outer rounded outline-none",e),style:{position:"fixed",top:y?.top??0,left:y?.left??0,zIndex:2010,...q(f)},...l,children:t});return"undefined"!=typeof document?h(v,w??document.body):v},Dt=({eventId:t,contentId:e,emojis:n=[],counts:i={},userReaction:s})=>{const{user:l,props:c,organization:d}=_(),h=c?.loginUrl,{handleReactionClick:u,isPending:m}=(()=>{const t=y(),{props:e,user:n}=_(),i=e?.organizationId,s=L({mutationFn:async({eventId:t,contentId:e,emoji:s})=>{await b.post(S.UPDATE_REACTION,{json:{eventId:t,contentId:e,reaction:s},headers:{"x-org-id":i,Authorization:`Bearer ${n?.token}`}})},onMutate:async({eventId:e,contentId:n,emoji:i})=>{const s=[v.CONTENTS_BY_EVENT(e)];await t.cancelQueries({queryKey:s});const o=t.getQueriesData({queryKey:s});return t.setQueriesData({queryKey:s},t=>((t,e,n)=>t?.pages&&Array.isArray(t.pages)?{...t,pages:t.pages.map(t=>t.data?{...t,data:t.data.map(t=>{if(t._id!==e)return t;const i={...t.reactionCounts??{}};return t.userReaction&&t.userReaction!==n&&(i[t.userReaction]=Math.max(0,(i[t.userReaction]??1)-1)),t.userReaction===n?(i[n]=Math.max(0,(i[n]??1)-1),{...t,reactionCounts:i,userReaction:void 0}):(i[n]=(i[n]??0)+1,{...t,reactionCounts:i,userReaction:n})})}:t)}:t)(t,n,i)),{previousData:o}},onError:(e,n,i)=>{i?.previousData?.forEach(([e,n])=>{t.setQueryData(e,n)}),H.error("Failed to add reaction"),console.error("Error handling reaction click:",e,n)}});return{handleReactionClick:async(t,e,i)=>{if(!t||!e||!i)return!1;if(!n)return H.error("Please login to react"),!1;try{return await s.mutateAsync({eventId:t,contentId:e,emoji:i}),!0}catch(o){return!1}},isPending:s.isPending}})(),[g,f]=a(!1),[w,k]=a(null),q=r(null),E=Object.values(i).reduce((t,e)=>t+e,0);return o(()=>()=>{q.current&&clearTimeout(q.current)},[]),/* @__PURE__ */p(Ot,{open:g,onOpenChange:f,children:[/* @__PURE__ */p(Ft,{asChild:!0,children:/* @__PURE__ */p("button",{type:"button",className:x("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",w&&"scale-[1.03] shadow-sm"),children:[(n||[]).slice().sort((t,e)=>(i[e]||0)-(i[t]||0)).slice(0,1).map(t=>/* @__PURE__ */p("span",{className:x("text-sm transition-transform duration-150 ease-out sm:text-lg",w===(s||t)&&"scale-125"),children:s||t},`${e}-${t}-1`)),E>0&&/* @__PURE__ */p("span",{className:"text-xs font-bold sm:text-sm",children:E||0})]})}),/* @__PURE__ */p(Pt,{side:"top",align:"end",children:[l?null:/* @__PURE__ */p("div",d?.customAuth?{className:"p-2 font-semibold",children:["Please"," ",
29
29
  /* @__PURE__ */p("a",{className:"text-info underline",href:h,children:"Login"})," ","to react"]}:{className:"p-2 font-semibold",children:["Please"," ",
30
30
  /* @__PURE__ */p(R,{className:"text-info underline",to:T.LOGIN,children:"Login"})," ","to react"]}),l&&/* @__PURE__ */p("div",{className:"flex gap-1 p-2",children:n.map(n=>{const o=s===n;/* @__PURE__ */
31
- return p("div",{className:"flex flex-col items-center",children:[/* @__PURE__ */p("span",{className:"text-xs font-medium",children:i[n]||0}),/* @__PURE__ */p("button",{type:"button",disabled:m,className:x("text-3xl transition-transform duration-150 ease-out disabled:opacity-50",o?"scale-125":"hover:scale-110",w===n&&"scale-125",m&&"cursor-not-allowed"),onClick:()=>(async n=>{!m&&u&&(k(n),f(!1),q.current&&clearTimeout(q.current),q.current=setTimeout(()=>k(null),180),u(t,e,n))})(n),children:n})]},`${e}-${n}-2`)})})]})]})},Ut=({event:t={},content:e,curateLink:n})=>t.engagementStyle===I.CONTEST?/* @__PURE__ */p("button",{className:"bg-background/75 flex items-center gap-1 rounded px-2 py-1",children:[/* @__PURE__ */p(K,{className:"size-4"}),/* @__PURE__ */p("span",{className:"text-xs font-semibold",children:parseFloat(String(e.score||0)).toFixed(1)})]}):t.engagementStyle===I.REACTION&&t.reactionEmojis?.length?/* @__PURE__ */p(Dt,{eventId:t?._id,contentId:e._id,emojis:t?.reactionEmojis,engagementStyle:t?.engagementStyle,counts:e.reactionCounts||{},userReaction:e.userReaction}):null,Ht=({content:t})=>/* @__PURE__ */p("div",{className:"w-full space-y-3 px-3 pb-3",children:[t?.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:t?.caption,className:"lg:text-md line-clamp-1 text-xs text-white lg:font-medium",children:t?.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:t?.user?.name})})]}),jt=({event:t,content:e,style:n,timestampField:s,curateLink:o,onChangeFaceUrl:r,hideControls:l,showQuickSearch:a})=>{const c=`content-${e._id}`,d=u(()=>At(s,e),[s,e]),h=m(()=>{r?.(e?.url);const t=document.getElementById("media-gallery-container");t&&t.scrollIntoView({behavior:"smooth",block:"start"})},[r,e?.url]),g=u(()=>({id:e._id,type:N.IMAGE,hash:e._id,width:e.width,height:e.height,thumbnailUrl:e.thumbnailUrl,blurhash:e.blurhash,caption:e.caption}),[e._id,e.width,e.height,e.thumbnailUrl,e.blurhash,e.caption]);/* @__PURE__ */
32
- return p("div",{id:c,style:n,className:"group relative mb-1 overflow-hidden rounded [content-visibility:auto]",children:[/* @__PURE__ */p(D,{url:e.src,alt:e.caption,blurhash:e.blurhash,thumbnailUrl:e.thumbnailUrl,curateLink:o,pswpData:g}),!l&&/* @__PURE__ */p(i,{children:[d&&/* @__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:d}),a&&(e.faces?.length??0)>0&&/* @__PURE__ */p("button",{className:"bg-primary absolute top-2 right-2 rounded-full p-1 text-gray-200 opacity-50 transition-all sm:p-1.5 sm:hover:scale-110 sm:hover:opacity-100",onClick:h,children:/* @__PURE__ */p(W,{className:"text-primary-foreground"})}),
33
- /* @__PURE__ */p("div",{className:"",children:[/* @__PURE__ */p("div",{className:"absolute bottom-0 w-full rounded-b",children:/* @__PURE__ */p(Ht,{content:e})}),/* @__PURE__ */p("div",{className:"absolute right-2 bottom-2",children:/* @__PURE__ */p(Ut,{event:t,content:e,curateLink:o})})]})]})]})},$t=({content:t,style:e,event:n,timestampField:i,curateLink:s,hideControls:o})=>{const r=u(()=>At(i,t),[i,t]);/* @__PURE__ */
31
+ return p("div",{className:"flex flex-col items-center",children:[/* @__PURE__ */p("span",{className:"text-xs font-medium",children:i[n]||0}),/* @__PURE__ */p("button",{type:"button",disabled:m,className:x("text-3xl transition-transform duration-150 ease-out disabled:opacity-50",o?"scale-125":"hover:scale-110",w===n&&"scale-125",m&&"cursor-not-allowed"),onClick:()=>(async n=>{!m&&u&&(k(n),f(!1),q.current&&clearTimeout(q.current),q.current=setTimeout(()=>k(null),180),u(t,e,n))})(n),children:n})]},`${e}-${n}-2`)})})]})]})},Ut=({event:t={},content:e,curateLink:n})=>t.engagementStyle===I.CONTEST?/* @__PURE__ */p("button",{className:"bg-background/75 flex items-center gap-1 rounded px-2 py-1",children:[/* @__PURE__ */p(K,{className:"size-4"}),/* @__PURE__ */p("span",{className:"text-xs font-semibold",children:parseFloat(String(e.score||0)).toFixed(1)})]}):t.engagementStyle===I.REACTION&&t.reactionEmojis?.length?/* @__PURE__ */p(Dt,{eventId:t?._id,contentId:e._id,emojis:t?.reactionEmojis,engagementStyle:t?.engagementStyle,counts:e.reactionCounts||{},userReaction:e.userReaction}):null,Ht=({content:t})=>/* @__PURE__ */p("div",{className:"w-full space-y-3 px-3 pb-3",children:[t?.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:t?.caption,className:"lg:text-md line-clamp-1 text-xs text-white lg:font-medium",children:t?.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:t?.user?.name})})]}),jt=({event:t,content:e,style:n,timestampField:i,curateLink:s,onChangeFaceUrl:o,hideControls:r,showQuickSearch:l})=>{const a=`content-${e._id}`,c=u(()=>At(i,e),[i,e]),d=m(()=>{o?.(e?.url);const t=document.getElementById("media-gallery-container");t&&t.scrollIntoView({behavior:"smooth",block:"start"})},[o,e?.url]),h=u(()=>({id:e._id,type:N.IMAGE,hash:e._id,width:e.width,height:e.height,thumbnailUrl:e.thumbnailUrl,blurhash:e.blurhash,caption:e.caption}),[e._id,e.width,e.height,e.thumbnailUrl,e.blurhash,e.caption]);/* @__PURE__ */
32
+ return p("div",{id:a,style:n,className:"group relative mb-1 overflow-hidden rounded [content-visibility:auto]",children:[/* @__PURE__ */p(D,{url:e.src,alt:e.caption,blurhash:e.blurhash,thumbnailUrl:e.thumbnailUrl,curateLink:s,pswpData:h}),!r&&/* @__PURE__ */p(g,{children:[c&&/* @__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:c}),l&&(e.faces?.length??0)>0&&/* @__PURE__ */p("button",{className:"bg-primary absolute top-2 right-2 rounded-full p-1 text-gray-200 opacity-50 transition-all sm:p-1.5 sm:hover:scale-110 sm:hover:opacity-100",onClick:d,children:/* @__PURE__ */p(W,{className:"text-primary-foreground"})}),
33
+ /* @__PURE__ */p("div",{className:"",children:[/* @__PURE__ */p("div",{className:"absolute bottom-0 w-full rounded-b",children:/* @__PURE__ */p(Ht,{content:e})}),/* @__PURE__ */p("div",{className:"absolute right-2 bottom-2",children:/* @__PURE__ */p(Ut,{event:t,content:e,curateLink:s})})]})]})]})},$t=({content:t,style:e,event:n,timestampField:i,curateLink:s,hideControls:o})=>{const r=u(()=>At(i,t),[i,t]);/* @__PURE__ */
34
34
  return p("div",{id:`content-${t._id}`,className:"group relative mb-1 overflow-hidden rounded [content-visibility:auto]",style:e,children:[/* @__PURE__ */p(D,{url:t.src??t.url,thumbnailUrl:t.thumbnailUrl,blurhash:t.blurhash,alt:t.caption,curateLink:s,pswpData:{id:t._id,type:N.VIDEO,hash:t._id,width:t.width,height:t.height,thumbnailUrl:t.thumbnailUrl,blurhash:t.blurhash,caption:t.caption}}),!o&&/* @__PURE__ */p("div",{className:"transition-opacity duration-500",children:[r&&/* @__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:r}),
35
35
  /* @__PURE__ */p("div",{className:"absolute bottom-0 w-full rounded-b",children:/* @__PURE__ */p(Ht,{content:t})}),
36
- /* @__PURE__ */p("div",{className:"absolute right-2 bottom-2",children:/* @__PURE__ */p(Ut,{event:n,content:t,curateLink:s})})]})]})},Gt=({event:t,contents:e=[],gamConfig:n,singleColumnMode:s,kioskMode:l,timestampField:c,curateLink:d,onChangeFaceUrl:h,showQuickSearch:m})=>{const g=r(null),f=r(null),w=u(()=>`gallery-${t?._id??""}`,[t?._id]),{captureAdImpression:T,captureAdClick:y}=G(),{portalContainer:b,organization:v}=_(),q=v?._id,[E,S]=a(null);o(()=>{const t=f.current;if(!d&&t){const e=new P({gallery:t,children:"a",counter:!1,bgOpacity:1,wheelToZoom:!0,pinchToClose:!0,zoom:!1,pswpModule:U,appendToEl:b??document.body});g.current=e,new M(e),new St(e),new Nt(e),new C(e,T,y),new It(e),new Ct(e),e.init()}return()=>{g.current?.destroy?.(),g.current=null}},[t?.galleryLayout,d,y,T,w,b]);const I=u(()=>{switch(t?.galleryLayout){case k.ROW:return Tt;case k.COLUMN:return kt;case k.MASONRY:return xt;default:return Tt}},[t?.galleryLayout]),L=u(()=>e.map(t=>({src:t.type===N.IMAGE||t.type===N.VIDEO?t.url:t.type===N.GAM_AD?"":t.imageUrl,...t,width:t.dimension?.width||t.width||4,height:t.dimension?.height||t.height||3})),[e]),R=u(()=>({container:({ref:t,className:e,children:n})=>/* @__PURE__ */p("div",{ref:t,className:e??"",children:n}),photo:(e,{photo:i,width:s,height:o,index:r})=>{const a=i;let u=null;switch(a.type){case N.IMAGE:u=jt;break;case N.VIDEO:u=$t;break;case N.AD:u=Rt;break;case N.GAM_AD:return n?/* @__PURE__ */p(Bt,{style:{width:s,height:o},gamConfig:n,slotIndex:a.slotIndex??r,eventId:t?._id,organizationId:q},`${a._id??r}-${r}`):null;default:u=null}return u&&/* @__PURE__ */p(u,{style:{width:s,height:o},event:t,content:a,timestampField:c,onAdClick:d?()=>S(a):void 0,hideControls:l,curateLink:d?`${d}/${a._id}`:null,onChangeFaceUrl:h,showQuickSearch:m},`${a._id??r}-${r}`)}}),[t,n,q,c,d,l,h,m]);/* @__PURE__ */
37
- return p(i,{children:[/* @__PURE__ */p("div",{id:w,ref:f,className:x(s?"w-full lg:w-1/3":"w-full"),children:/* @__PURE__ */p(I,{spacing:4,rowConstraints:t=>{const e={minPhotos:1,maxPhotos:4,singleRowMaxHeight:400};return s&&(e.minPhotos=1,e.maxPhotos=t<400?2:t<800?3:4),e},columns:t=>s?1:t<400?2:t<800?3:4,photos:L,render:R})}),/* @__PURE__ */p(Mt,{open:Boolean(E),ad:E,onClose:()=>S(null),captureAdClick:y})]})};export{Gt as default};
36
+ /* @__PURE__ */p("div",{className:"absolute right-2 bottom-2",children:/* @__PURE__ */p(Ut,{event:n,content:t,curateLink:s})})]})]})},Gt=({event:t,contents:e=[],gamConfig:n,singleColumnMode:i,kioskMode:s,timestampField:l,curateLink:c,onChangeFaceUrl:d,showQuickSearch:h})=>{const m=r(null),f=r(null),w=u(()=>`gallery-${t?._id??""}`,[t?._id]),{captureAdImpression:T,captureAdClick:y}=G(),{portalContainer:b,organization:v}=_(),q=v?._id,[E,S]=a(null);o(()=>{const t=f.current;if(!c&&t){const e=new P({gallery:t,children:"a",counter:!1,bgOpacity:1,wheelToZoom:!0,pinchToClose:!0,zoom:!1,pswpModule:U,appendToEl:b??document.body});m.current=e,new M(e),new St(e),new Nt(e),new C(e,T,y),new It(e),new Ct(e),e.init()}return()=>{m.current?.destroy?.(),m.current=null}},[t?.galleryLayout,c,y,T,w,b]);const I=u(()=>{switch(t?.galleryLayout){case k.ROW:return Tt;case k.COLUMN:return kt;case k.MASONRY:return xt;default:return Tt}},[t?.galleryLayout]),L=u(()=>e.map(t=>({src:t.type===N.IMAGE||t.type===N.VIDEO?t.url:t.type===N.GAM_AD?"":t.imageUrl,...t,width:t.dimension?.width||t.width||4,height:t.dimension?.height||t.height||3})),[e]),R=u(()=>({container:({ref:t,className:e,children:n})=>/* @__PURE__ */p("div",{ref:t,className:e??"",children:n}),photo:(e,{photo:i,width:o,height:r,index:a})=>{const u=i;let m=null;switch(u.type){case N.IMAGE:m=jt;break;case N.VIDEO:m=$t;break;case N.AD:m=Rt;break;case N.GAM_AD:return n?/* @__PURE__ */p(Bt,{style:{width:o,height:r},gamConfig:n,slotIndex:u.slotIndex??a,eventId:t?._id,organizationId:q},`${u._id??a}-${a}`):null;default:m=null}return m&&/* @__PURE__ */p(m,{style:{width:o,height:r},event:t,content:u,timestampField:l,onAdClick:c?()=>S(u):void 0,hideControls:s,curateLink:c?`${c}/${u._id}`:null,onChangeFaceUrl:d,showQuickSearch:h},`${u._id??a}-${a}`)}}),[t,n,q,l,c,s,d,h]);/* @__PURE__ */
37
+ return p(g,{children:[/* @__PURE__ */p("div",{id:w,ref:f,className:x(i?"w-full lg:w-1/3":"w-full"),children:/* @__PURE__ */p(I,{spacing:4,rowConstraints:t=>{const e={minPhotos:1,maxPhotos:4,singleRowMaxHeight:400};return i&&(e.minPhotos=1,e.maxPhotos=t<400?2:t<800?3:4),e},columns:t=>i?1:t<400?2:t<800?3:4,photos:L,render:R})}),/* @__PURE__ */p(Mt,{open:Boolean(E),ad:E,onClose:()=>S(null),captureAdClick:y})]})};export{Gt as default};
@@ -1,2 +1,2 @@
1
- import{t as h}from"./qbHuxVSe.js";function e({className:e}){/* @__PURE__ */
1
+ import{t as h}from"./C3uDEVBt.js";function e({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:"M4 19h4v-8H4zm6 0h4V5h-4zm6 0h4v-6h-4zM2 19v-8q0-.825.588-1.412T4 9h4V5q0-.825.588-1.412T10 3h4q.825 0 1.413.588T16 5v6h4q.825 0 1.413.588T22 13v6q0 .825-.587 1.413T20 21H4q-.825 0-1.412-.587T2 19"})})}export{e as t};