@qratilabs/qrati-connect 2.32.0 → 2.32.2

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 (45) hide show
  1. package/element/{DEzMsBix2.js → 3CNVs83G2.js} +1 -1
  2. package/element/{khLYL0ji.js → BNHdfdME.js} +1 -1
  3. package/element/{CBL1xGp_.js → BOsbbHJ0.js} +1 -1
  4. package/element/{Xf-0nxUX.js → BOweSM9Y.js} +1 -1
  5. package/element/{BoLYE0I62.js → BP08t9Jp2.js} +1 -1
  6. package/element/{D5ovViER2.js → BRwZXuo82.js} +1 -1
  7. package/element/{Dav-zijp2.js → BZSy_Rh42.js} +16 -15
  8. package/element/{BNAv4_JK.js → BeaTNG7m.js} +1 -1
  9. package/element/{CF0gkb5T.js → BiCaKAmb.js} +1 -1
  10. package/element/{yhFHMaGN2.js → Bv4TkNQ42.js} +28 -28
  11. package/element/{DDJfCP8g.js → BypLxR3J.js} +1 -1
  12. package/element/{YBIepScM.js → CD73UkPZ.js} +1 -1
  13. package/element/{Za2nuDJ4.js → CDBzc1CZ.js} +1 -1
  14. package/element/{2MdYrk27.js → CE0UwtGX.js} +1 -1
  15. package/element/{sLC4EOUq.js → CGlyix6P.js} +2 -2
  16. package/element/{DzMVgwWt.js → CaTxtEbg.js} +1 -1
  17. package/element/{DtjeZIUE.js → CmcA5dp5.js} +13 -13
  18. package/element/{BVHdG-zf.js → CoARa5_i.js} +1 -1
  19. package/element/{Cte8DkX6.js → Cr5o77zq.js} +73 -73
  20. package/element/{DGLG5AUs.js → D-U23_J5.js} +36 -36
  21. package/element/{BIsp1V4q2.js → D3OYeY482.js} +1 -1
  22. package/element/{BiHVoIWk.js → DFRMtMLz.js} +1 -1
  23. package/element/{Cf-ikOp2.js → DO2-BnvU.js} +1 -1
  24. package/element/{Cl4c-3Xk.js → DRD9__VZ.js} +1 -1
  25. package/element/{CvtQzVtn2.js → DUS9pix12.js} +1 -1
  26. package/element/{BJPVMd4a2.js → DVo8WBwP2.js} +1 -1
  27. package/element/{CnExGazE2.js → DXFmV-Ty2.js} +1 -1
  28. package/element/{BKaxn8Ij2.js → Da6CorI52.js} +1 -1
  29. package/element/{2OzBYBrP.js → DdQWa3ny.js} +1 -1
  30. package/element/{D4ceMHZo2.js → DiQrTagI2.js} +1 -1
  31. package/element/{dgI0MGWo.js → DjOFnmwA.js} +1 -1
  32. package/element/{CZvzyHMc2.js → DnnkdZ6w2.js} +1 -1
  33. package/element/{D92x_spc.js → DtBnBN-i.js} +1 -1
  34. package/element/GwDdmgYd.js +1 -0
  35. package/element/{krvWvnLh2.js → XVFdeOm22.js} +1 -1
  36. package/element/{CopVS738.js → _d0Pbeg3.js} +1 -1
  37. package/element/{C84zcse72.js → cjsXyqlO2.js} +1 -1
  38. package/element/{Cyp_H6gp.js → iDDlbtVI.js} +1 -1
  39. package/element/lFDEfCSm.js +1 -0
  40. package/element/{BpI67z3l.js → tvCSWnLG.js} +1 -1
  41. package/element/web.es.js +1 -1
  42. package/embed/embed.js +1 -1
  43. package/package.json +1 -1
  44. package/element/BYM2GyVF.js +0 -1
  45. package/element/Yvb3c4w2.js +0 -1
@@ -1 +1 @@
1
- import{Ot as t}from"./Cte8DkX6.js";function e(t){return t?String(t).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;"):""}var o={[t.LINK]:'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24"><path fill="currentColor" d="M5 21q-.825 0-1.412-.587T3 19V5q0-.825.588-1.412T5 3h6q.425 0 .713.288T12 4t-.288.713T11 5H5v14h14v-6q0-.425.288-.712T20 12t.713.288T21 13v6q0 .825-.587 1.413T19 21zM19 6.4L10.4 15q-.275.275-.7.275T9 15t-.275-.7t.275-.7L17.6 5H15q-.425 0-.712-.288T14 4t.288-.712T15 3h5q.425 0 .713.288T21 4v5q0 .425-.288.713T20 10t-.712-.288T19 9z"/></svg>',[t.EMAIL]:'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24"><path fill="currentColor" d="M12 22q-2.075 0-3.9-.788t-3.175-2.137T2.788 15.9T2 12t.788-3.9t2.137-3.175T8.1 2.788T12 2t3.9.788t3.175 2.137T21.213 8.1T22 12v1.45q0 1.475-1.012 2.513T18.5 17q-.875 0-1.65-.375t-1.3-1.075q-.725.725-1.638 1.088T12 17q-2.075 0-3.537-1.463T7 12t1.463-3.537T12 7t3.538 1.463T17 12v1.45q0 .65.425 1.1T18.5 15t1.075-.45t.425-1.1V12q0-3.35-2.325-5.675T12 4T6.325 6.325T4 12t2.325 5.675T12 20h4q.425 0 .713.288T17 21t-.288.713T16 22zm0-7q1.25 0 2.125-.875T15 12t-.875-2.125T12 9t-2.125.875T9 12t.875 2.125T12 15"/></svg>',[t.PHONE]:'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24"><path fill="currentColor" d="M19.95 21q-3.125 0-6.175-1.362t-5.55-3.863t-3.862-5.55T3 4.05q0-.45.3-.75t.75-.3H8.1q.35 0 .625.238t.325.562l.65 3.5q.05.4-.025.675T9.4 8.45L6.975 10.9q.5.925 1.187 1.787t1.513 1.663q.775.775 1.625 1.438T13.1 17l2.35-2.35q.225-.225.588-.337t.712-.063l3.45.7q.35.1.575.363T21 15.9v4.05q0 .45-.3.75t-.75.3M6.025 9l1.65-1.65L7.25 5H5.025q.125 1.025.35 2.025T6.025 9m8.95 8.95q.975.425 1.988.675T19 18.95v-2.2l-2.35-.475zm0 0"/></svg>',[t.SMS]:'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24"><path fill="currentColor" d="m6 18l-2.3 2.3q-.475.475-1.088.213T2 19.575V4q0-.825.588-1.412T4 2h16q.825 0 1.413.588T22 4v12q0 .825-.587 1.413T20 18zm-.85-2H20V4H4v13.125zM4 16V4zm4-5q.425 0 .713-.288T9 10t-.288-.712T8 9t-.712.288T7 10t.288.713T8 11m4 0q.425 0 .713-.288T13 10t-.288-.712T12 9t-.712.288T11 10t.288.713T12 11m4 0q.425 0 .713-.288T17 10t-.288-.712T16 9t-.712.288T15 10t.288.713T16 11"/></svg>',[t.WHATSAPP]:'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 256 258"><defs><linearGradient id="logosWhatsappIcon0" x1="50%" x2="50%" y1="100%" y2="0%"><stop offset="0%" stop-color="#1faf38"/><stop offset="100%" stop-color="#60d669"/></linearGradient><linearGradient id="logosWhatsappIcon1" x1="50%" x2="50%" y1="100%" y2="0%"><stop offset="0%" stop-color="#f9f9f9"/><stop offset="100%" stop-color="#fff"/></linearGradient></defs><path fill="url(#logosWhatsappIcon0)" d="M5.463 127.456c-.006 21.677 5.658 42.843 16.428 61.499L4.433 252.697l65.232-17.104a123 123 0 0 0 58.8 14.97h.054c67.815 0 123.018-55.183 123.047-123.01c.013-32.867-12.775-63.773-36.009-87.025c-23.23-23.25-54.125-36.061-87.043-36.076c-67.823 0-123.022 55.18-123.05 123.004"/><path fill="url(#logosWhatsappIcon1)" d="M1.07 127.416c-.007 22.457 5.86 44.38 17.014 63.704L0 257.147l67.571-17.717c18.618 10.151 39.58 15.503 60.91 15.511h.055c70.248 0 127.434-57.168 127.464-127.423c.012-34.048-13.236-66.065-37.3-90.15C194.633 13.286 162.633.014 128.536 0C58.276 0 1.099 57.16 1.071 127.416m40.24 60.376l-2.523-4.005c-10.606-16.864-16.204-36.352-16.196-56.363C22.614 69.029 70.138 21.52 128.576 21.52c28.3.012 54.896 11.044 74.9 31.06c20.003 20.018 31.01 46.628 31.003 74.93c-.026 58.395-47.551 105.91-105.943 105.91h-.042c-19.013-.01-37.66-5.116-53.922-14.765l-3.87-2.295l-40.098 10.513z"/><path fill="#fff" d="M96.678 74.148c-2.386-5.303-4.897-5.41-7.166-5.503c-1.858-.08-3.982-.074-6.104-.074c-2.124 0-5.575.799-8.492 3.984c-2.92 3.188-11.148 10.892-11.148 26.561s11.413 30.813 13.004 32.94c1.593 2.123 22.033 35.307 54.405 48.073c26.904 10.609 32.379 8.499 38.218 7.967c5.84-.53 18.844-7.702 21.497-15.139c2.655-7.436 2.655-13.81 1.859-15.142c-.796-1.327-2.92-2.124-6.105-3.716s-18.844-9.298-21.763-10.361c-2.92-1.062-5.043-1.592-7.167 1.597c-2.124 3.184-8.223 10.356-10.082 12.48c-1.857 2.129-3.716 2.394-6.9.801c-3.187-1.598-13.444-4.957-25.613-15.806c-9.468-8.442-15.86-18.867-17.718-22.056c-1.858-3.184-.199-4.91 1.398-6.497c1.431-1.427 3.186-3.719 4.78-5.578c1.588-1.86 2.118-3.187 3.18-5.311c1.063-2.126.531-3.986-.264-5.579c-.798-1.593-6.987-17.343-9.819-23.64"/></svg>',[t.MESSENGER]:'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 256 256"><defs><radialGradient id="logosMessenger0" cx="19.247%" cy="99.465%" r="108.96%" fx="19.247%" fy="99.465%"><stop offset="0%" stop-color="#09f"/><stop offset="60.975%" stop-color="#a033ff"/><stop offset="93.482%" stop-color="#ff5280"/><stop offset="100%" stop-color="#ff7061"/></radialGradient></defs><path fill="url(#logosMessenger0)" d="M128 0C55.894 0 0 52.818 0 124.16c0 37.317 15.293 69.562 40.2 91.835c2.09 1.871 3.352 4.493 3.438 7.298l.697 22.77c.223 7.262 7.724 11.988 14.37 9.054L84.111 243.9a10.22 10.22 0 0 1 6.837-.501c11.675 3.21 24.1 4.92 37.052 4.92c72.106 0 128-52.818 128-124.16S200.106 0 128 0"/><path fill="#fff" d="m51.137 160.47l37.6-59.653c5.98-9.49 18.788-11.853 27.762-5.123l29.905 22.43a7.68 7.68 0 0 0 9.252-.027l40.388-30.652c5.39-4.091 12.428 2.36 8.82 8.085l-37.6 59.654c-5.981 9.489-18.79 11.852-27.763 5.122l-29.906-22.43a7.68 7.68 0 0 0-9.25.027l-40.39 30.652c-5.39 4.09-12.427-2.36-8.818-8.085"/></svg>'},n=class{constructor(t,e,o){this.lightbox=t,this.captureAdImpression=e,this.captureAdClick=o,this.captionOn=!0,this.options={captionButtonOrder:8},t.on("init",()=>{this.initPswpEvents(t.pswp)})}getRootNode(){return this.lightbox?.pswp?.element?.getRootNode?.()||document}getElementById(t){const e=this.getRootNode();return"function"==typeof e.getElementById?e.getElementById(t):e.querySelector?.(`#${t}`)||document.getElementById(t)}querySelector(t){return this.getRootNode().querySelector?.(t)||document.querySelector(t)}initPswpEvents(t){t.on("uiRegister",()=>{t.ui.registerElement({name:"caption-toggle-button",title:"Toggle caption view",order:this.options.captionButtonOrder,isButton:!0,html:'<svg aria-hidden="true" class="pswp__icn p-0.5" viewBox="0 0 24 24"><use class="pswp__icn-shadow" xlink:href="#pswp__icn-show-caption"/><use class="pswp__icn-shadow" xlink:href="#pswp__icn-hide-caption"/><path id="pswp__icn-show-caption" d="M5 20q-.825 0-1.412-.587T3 18V6q0-.825.588-1.412T5 4h14q.825 0 1.413.588T21 6v12q0 .825-.587 1.413T19 20zm0-2h14V6H5zm2-3h3q.425 0 .713-.288T11 14v-.5q0-.225-.15-.375t-.375-.15h-.45q-.225 0-.375.15t-.15.375h-2v-3h2q0 .225.15.375t.375.15h.45q.225 0 .375-.15T11 10.5V10q0-.425-.288-.712T10 9H7q-.425 0-.712.288T6 10v4q0 .425.288.713T7 15m10-6h-3q-.425 0-.712.288T13 10v4q0 .425.288.713T14 15h3q.425 0 .713-.288T18 14v-.5q0-.225-.15-.375t-.375-.15h-.45q-.225 0-.375.15t-.15.375h-2v-3h2q0 .225.15.375t.375.15h.45q.225 0 .375-.15T18 10.5V10q0-.425-.288-.712T17 9M5 18V6z"/><path id="pswp__icn-hide-caption" style="display:none" d="m9.025 9l1.5 1.5H7.5v3h2q0-.225.15-.375t.375-.15h.45q.225 0 .375.15t.15.375v.5q0 .425-.288.713T10 15H7q-.425 0-.712-.288T6 14v-4q0-.425.288-.712T7 9zM21 6v10q0 .5-.325.763t-.7.262t-.675-.262T19 16V6H8.975q-.5 0-.75-.312T7.975 5t.25-.687t.75-.313H19q.825 0 1.413.588T21 6m-3 8q0 .225-.088.438t-.262.337L16.375 13.5h.125q0-.225.15-.375t.375-.15h.45q.225 0 .375.15t.15.375zm-1-5q.425 0 .713.288T18 10v.5q0 .225-.15.375t-.375.15h-.45q-.225 0-.375-.15t-.15-.375h-2v1.125l-1.5-1.5V10q0-.425.288-.712T14 9zM5 20q-.825 0-1.412-.587T3 18V6q0-.625.338-1.112t.862-.713L6.025 6H5v12h10.175L1.375 4.225q-.3-.3-.3-.712t.3-.713t.713-.3t.712.3l18.375 18.375q.3.3.3.713t-.3.712t-.712.3t-.713-.3L17.175 20z"/></svg>',onClick:()=>{this.toggleCaption(t)}}),t.ui.registerElement({name:"custom-caption",isButton:!1,appendTo:"root",html:'<div id="pswp-caption-container" class=" absolute bottom-0 w-full bg-transparent"></div>'})}),t.on("change",()=>{this.captionOn&&this.updateCaption(t)}),t.on("close",()=>{this.clearCaption()})}toggleCaption(t){this.captionOn?this.clearCaption():this.updateCaption(t),this.captionOn=!this.captionOn;const e=this.querySelector("#pswp__icn-show-caption"),o=this.querySelector("#pswp__icn-hide-caption");e&&(e.style.display=this.captionOn?"inline":"none"),o&&(o.style.display=this.captionOn?"none":"inline")}createCaptionHTML(n){const{id:s,type:i,caption:c,title:a,description:r,targetType:l,targetText:p,targetUrl:h}=n||{},d=Boolean(l)&&String(l)!==String(t.NONE),g=d?l:t.LINK;switch("ad"===i&&this.captureAdImpression&&this.captureAdImpression(s),i){case"image":case"video":return c?.length>0?`\n <div class=" w-full bg-black/50 p-4 text-gray-300">\n <h3 class=" text-center sm:text-lg">${e(c)}</h3>\n </div>\n `:"";case"ad":return`\n <div class=" w-full bg-black/85 p-4 text-white">\n <div class=" mx-auto w-full max-w-2xl space-y-2 text-center">\n <h3 class=" text-center sm:text-lg">${e(a)}</h3>\n <h4 class=" pb-2 text-center text-sm sm:text-base">${e(r)}</h4>\n ${d?`<button\n class=" flex w-full items-center justify-center gap-3 rounded bg-white py-1 text-lg text-black caption-action-button"\n data-id="${e(s)}"\n data-target-type="${e(g)}"\n data-target-url="${e(h)}">\n ${o[g]}\n ${e(p)}\n </button>`:""}\n </div>\n </div>\n `;default:return""}}updateCaption(t){try{const e=this.getElementById("pswp-caption-container");if(!e)return;const o=t.currSlide?.data;e.innerHTML=this.createCaptionHTML(o);const n=e.querySelector(".caption-action-button");n&&n.addEventListener("click",t=>{const e=t.currentTarget.dataset.id,o=t.currentTarget.dataset.targetType,n=t.currentTarget.dataset.targetUrl;this.captureAdClick&&e&&this.captureAdClick(e,o,n)})}catch(e){console.error("Error rendering caption:",e)}}clearCaption(){const t=this.getElementById("pswp-caption-container");t&&(t.innerHTML="")}};export{n as default};
1
+ import{Ot as t}from"./Cr5o77zq.js";function e(t){return t?String(t).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;"):""}var o={[t.LINK]:'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24"><path fill="currentColor" d="M5 21q-.825 0-1.412-.587T3 19V5q0-.825.588-1.412T5 3h6q.425 0 .713.288T12 4t-.288.713T11 5H5v14h14v-6q0-.425.288-.712T20 12t.713.288T21 13v6q0 .825-.587 1.413T19 21zM19 6.4L10.4 15q-.275.275-.7.275T9 15t-.275-.7t.275-.7L17.6 5H15q-.425 0-.712-.288T14 4t.288-.712T15 3h5q.425 0 .713.288T21 4v5q0 .425-.288.713T20 10t-.712-.288T19 9z"/></svg>',[t.EMAIL]:'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24"><path fill="currentColor" d="M12 22q-2.075 0-3.9-.788t-3.175-2.137T2.788 15.9T2 12t.788-3.9t2.137-3.175T8.1 2.788T12 2t3.9.788t3.175 2.137T21.213 8.1T22 12v1.45q0 1.475-1.012 2.513T18.5 17q-.875 0-1.65-.375t-1.3-1.075q-.725.725-1.638 1.088T12 17q-2.075 0-3.537-1.463T7 12t1.463-3.537T12 7t3.538 1.463T17 12v1.45q0 .65.425 1.1T18.5 15t1.075-.45t.425-1.1V12q0-3.35-2.325-5.675T12 4T6.325 6.325T4 12t2.325 5.675T12 20h4q.425 0 .713.288T17 21t-.288.713T16 22zm0-7q1.25 0 2.125-.875T15 12t-.875-2.125T12 9t-2.125.875T9 12t.875 2.125T12 15"/></svg>',[t.PHONE]:'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24"><path fill="currentColor" d="M19.95 21q-3.125 0-6.175-1.362t-5.55-3.863t-3.862-5.55T3 4.05q0-.45.3-.75t.75-.3H8.1q.35 0 .625.238t.325.562l.65 3.5q.05.4-.025.675T9.4 8.45L6.975 10.9q.5.925 1.187 1.787t1.513 1.663q.775.775 1.625 1.438T13.1 17l2.35-2.35q.225-.225.588-.337t.712-.063l3.45.7q.35.1.575.363T21 15.9v4.05q0 .45-.3.75t-.75.3M6.025 9l1.65-1.65L7.25 5H5.025q.125 1.025.35 2.025T6.025 9m8.95 8.95q.975.425 1.988.675T19 18.95v-2.2l-2.35-.475zm0 0"/></svg>',[t.SMS]:'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24"><path fill="currentColor" d="m6 18l-2.3 2.3q-.475.475-1.088.213T2 19.575V4q0-.825.588-1.412T4 2h16q.825 0 1.413.588T22 4v12q0 .825-.587 1.413T20 18zm-.85-2H20V4H4v13.125zM4 16V4zm4-5q.425 0 .713-.288T9 10t-.288-.712T8 9t-.712.288T7 10t.288.713T8 11m4 0q.425 0 .713-.288T13 10t-.288-.712T12 9t-.712.288T11 10t.288.713T12 11m4 0q.425 0 .713-.288T17 10t-.288-.712T16 9t-.712.288T15 10t.288.713T16 11"/></svg>',[t.WHATSAPP]:'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 256 258"><defs><linearGradient id="logosWhatsappIcon0" x1="50%" x2="50%" y1="100%" y2="0%"><stop offset="0%" stop-color="#1faf38"/><stop offset="100%" stop-color="#60d669"/></linearGradient><linearGradient id="logosWhatsappIcon1" x1="50%" x2="50%" y1="100%" y2="0%"><stop offset="0%" stop-color="#f9f9f9"/><stop offset="100%" stop-color="#fff"/></linearGradient></defs><path fill="url(#logosWhatsappIcon0)" d="M5.463 127.456c-.006 21.677 5.658 42.843 16.428 61.499L4.433 252.697l65.232-17.104a123 123 0 0 0 58.8 14.97h.054c67.815 0 123.018-55.183 123.047-123.01c.013-32.867-12.775-63.773-36.009-87.025c-23.23-23.25-54.125-36.061-87.043-36.076c-67.823 0-123.022 55.18-123.05 123.004"/><path fill="url(#logosWhatsappIcon1)" d="M1.07 127.416c-.007 22.457 5.86 44.38 17.014 63.704L0 257.147l67.571-17.717c18.618 10.151 39.58 15.503 60.91 15.511h.055c70.248 0 127.434-57.168 127.464-127.423c.012-34.048-13.236-66.065-37.3-90.15C194.633 13.286 162.633.014 128.536 0C58.276 0 1.099 57.16 1.071 127.416m40.24 60.376l-2.523-4.005c-10.606-16.864-16.204-36.352-16.196-56.363C22.614 69.029 70.138 21.52 128.576 21.52c28.3.012 54.896 11.044 74.9 31.06c20.003 20.018 31.01 46.628 31.003 74.93c-.026 58.395-47.551 105.91-105.943 105.91h-.042c-19.013-.01-37.66-5.116-53.922-14.765l-3.87-2.295l-40.098 10.513z"/><path fill="#fff" d="M96.678 74.148c-2.386-5.303-4.897-5.41-7.166-5.503c-1.858-.08-3.982-.074-6.104-.074c-2.124 0-5.575.799-8.492 3.984c-2.92 3.188-11.148 10.892-11.148 26.561s11.413 30.813 13.004 32.94c1.593 2.123 22.033 35.307 54.405 48.073c26.904 10.609 32.379 8.499 38.218 7.967c5.84-.53 18.844-7.702 21.497-15.139c2.655-7.436 2.655-13.81 1.859-15.142c-.796-1.327-2.92-2.124-6.105-3.716s-18.844-9.298-21.763-10.361c-2.92-1.062-5.043-1.592-7.167 1.597c-2.124 3.184-8.223 10.356-10.082 12.48c-1.857 2.129-3.716 2.394-6.9.801c-3.187-1.598-13.444-4.957-25.613-15.806c-9.468-8.442-15.86-18.867-17.718-22.056c-1.858-3.184-.199-4.91 1.398-6.497c1.431-1.427 3.186-3.719 4.78-5.578c1.588-1.86 2.118-3.187 3.18-5.311c1.063-2.126.531-3.986-.264-5.579c-.798-1.593-6.987-17.343-9.819-23.64"/></svg>',[t.MESSENGER]:'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 256 256"><defs><radialGradient id="logosMessenger0" cx="19.247%" cy="99.465%" r="108.96%" fx="19.247%" fy="99.465%"><stop offset="0%" stop-color="#09f"/><stop offset="60.975%" stop-color="#a033ff"/><stop offset="93.482%" stop-color="#ff5280"/><stop offset="100%" stop-color="#ff7061"/></radialGradient></defs><path fill="url(#logosMessenger0)" d="M128 0C55.894 0 0 52.818 0 124.16c0 37.317 15.293 69.562 40.2 91.835c2.09 1.871 3.352 4.493 3.438 7.298l.697 22.77c.223 7.262 7.724 11.988 14.37 9.054L84.111 243.9a10.22 10.22 0 0 1 6.837-.501c11.675 3.21 24.1 4.92 37.052 4.92c72.106 0 128-52.818 128-124.16S200.106 0 128 0"/><path fill="#fff" d="m51.137 160.47l37.6-59.653c5.98-9.49 18.788-11.853 27.762-5.123l29.905 22.43a7.68 7.68 0 0 0 9.252-.027l40.388-30.652c5.39-4.091 12.428 2.36 8.82 8.085l-37.6 59.654c-5.981 9.489-18.79 11.852-27.763 5.122l-29.906-22.43a7.68 7.68 0 0 0-9.25.027l-40.39 30.652c-5.39 4.09-12.427-2.36-8.818-8.085"/></svg>'},n=class{constructor(t,e,o){this.lightbox=t,this.captureAdImpression=e,this.captureAdClick=o,this.captionOn=!0,this.options={captionButtonOrder:8},t.on("init",()=>{this.initPswpEvents(t.pswp)})}getRootNode(){return this.lightbox?.pswp?.element?.getRootNode?.()||document}getElementById(t){const e=this.getRootNode();return"function"==typeof e.getElementById?e.getElementById(t):e.querySelector?.(`#${t}`)||document.getElementById(t)}querySelector(t){return this.getRootNode().querySelector?.(t)||document.querySelector(t)}initPswpEvents(t){t.on("uiRegister",()=>{t.ui.registerElement({name:"caption-toggle-button",title:"Toggle caption view",order:this.options.captionButtonOrder,isButton:!0,html:'<svg aria-hidden="true" class="pswp__icn p-0.5" viewBox="0 0 24 24"><use class="pswp__icn-shadow" xlink:href="#pswp__icn-show-caption"/><use class="pswp__icn-shadow" xlink:href="#pswp__icn-hide-caption"/><path id="pswp__icn-show-caption" d="M5 20q-.825 0-1.412-.587T3 18V6q0-.825.588-1.412T5 4h14q.825 0 1.413.588T21 6v12q0 .825-.587 1.413T19 20zm0-2h14V6H5zm2-3h3q.425 0 .713-.288T11 14v-.5q0-.225-.15-.375t-.375-.15h-.45q-.225 0-.375.15t-.15.375h-2v-3h2q0 .225.15.375t.375.15h.45q.225 0 .375-.15T11 10.5V10q0-.425-.288-.712T10 9H7q-.425 0-.712.288T6 10v4q0 .425.288.713T7 15m10-6h-3q-.425 0-.712.288T13 10v4q0 .425.288.713T14 15h3q.425 0 .713-.288T18 14v-.5q0-.225-.15-.375t-.375-.15h-.45q-.225 0-.375.15t-.15.375h-2v-3h2q0 .225.15.375t.375.15h.45q.225 0 .375-.15T18 10.5V10q0-.425-.288-.712T17 9M5 18V6z"/><path id="pswp__icn-hide-caption" style="display:none" d="m9.025 9l1.5 1.5H7.5v3h2q0-.225.15-.375t.375-.15h.45q.225 0 .375.15t.15.375v.5q0 .425-.288.713T10 15H7q-.425 0-.712-.288T6 14v-4q0-.425.288-.712T7 9zM21 6v10q0 .5-.325.763t-.7.262t-.675-.262T19 16V6H8.975q-.5 0-.75-.312T7.975 5t.25-.687t.75-.313H19q.825 0 1.413.588T21 6m-3 8q0 .225-.088.438t-.262.337L16.375 13.5h.125q0-.225.15-.375t.375-.15h.45q.225 0 .375.15t.15.375zm-1-5q.425 0 .713.288T18 10v.5q0 .225-.15.375t-.375.15h-.45q-.225 0-.375-.15t-.15-.375h-2v1.125l-1.5-1.5V10q0-.425.288-.712T14 9zM5 20q-.825 0-1.412-.587T3 18V6q0-.625.338-1.112t.862-.713L6.025 6H5v12h10.175L1.375 4.225q-.3-.3-.3-.712t.3-.713t.713-.3t.712.3l18.375 18.375q.3.3.3.713t-.3.712t-.712.3t-.713-.3L17.175 20z"/></svg>',onClick:()=>{this.toggleCaption(t)}}),t.ui.registerElement({name:"custom-caption",isButton:!1,appendTo:"root",html:'<div id="pswp-caption-container" class=" absolute bottom-0 w-full bg-transparent"></div>'})}),t.on("change",()=>{this.captionOn&&this.updateCaption(t)}),t.on("close",()=>{this.clearCaption()})}toggleCaption(t){this.captionOn?this.clearCaption():this.updateCaption(t),this.captionOn=!this.captionOn;const e=this.querySelector("#pswp__icn-show-caption"),o=this.querySelector("#pswp__icn-hide-caption");e&&(e.style.display=this.captionOn?"inline":"none"),o&&(o.style.display=this.captionOn?"none":"inline")}createCaptionHTML(n){const{id:s,type:i,caption:c,title:a,description:r,targetType:l,targetText:p,targetUrl:h}=n||{},d=Boolean(l)&&String(l)!==String(t.NONE),g=d?l:t.LINK;switch("ad"===i&&this.captureAdImpression&&this.captureAdImpression(s),i){case"image":case"video":return c?.length>0?`\n <div class=" w-full bg-black/50 p-4 text-gray-300">\n <h3 class=" text-center sm:text-lg">${e(c)}</h3>\n </div>\n `:"";case"ad":return`\n <div class=" w-full bg-black/85 p-4 text-white">\n <div class=" mx-auto w-full max-w-2xl space-y-2 text-center">\n <h3 class=" text-center sm:text-lg">${e(a)}</h3>\n <h4 class=" pb-2 text-center text-sm sm:text-base">${e(r)}</h4>\n ${d?`<button\n class=" flex w-full items-center justify-center gap-3 rounded bg-white py-1 text-lg text-black caption-action-button"\n data-id="${e(s)}"\n data-target-type="${e(g)}"\n data-target-url="${e(h)}">\n ${o[g]}\n ${e(p)}\n </button>`:""}\n </div>\n </div>\n `;default:return""}}updateCaption(t){try{const e=this.getElementById("pswp-caption-container");if(!e)return;const o=t.currSlide?.data;e.innerHTML=this.createCaptionHTML(o);const n=e.querySelector(".caption-action-button");n&&n.addEventListener("click",t=>{const e=t.currentTarget.dataset.id,o=t.currentTarget.dataset.targetType,n=t.currentTarget.dataset.targetUrl;this.captureAdClick&&e&&this.captureAdClick(e,o,n)})}catch(e){console.error("Error rendering caption:",e)}}clearCaption(){const t=this.getElementById("pswp-caption-container");t&&(t.innerHTML="")}};export{n as default};
@@ -1,6 +1,6 @@
1
- import{$ as e,$t as t,At as n,B as r,Bt as a,Cn as i,Ct as s,F as o,Ft as l,H as c,Ht as d,I as u,It as m,Kt as g,L as h,Lt as p,Mt as v,On as w,Pt as f,R as T,Rt as y,U as N,Vt as q,W as x,X as b,Xt as C,Zt as E,at as S,et as I,ft as L,it as z,jt as k,kt as R,ln as A,lt as M,nn as _,nt as F,qt as O,rt as P,s as B,sn as V,st as j,tn as U,tt as H,vn as $,wn as G,xn as D,xt as W,yn as K,yt as Q,z as X,zt as Y}from"./Cte8DkX6.js";import{r as Z}from"./BiHVoIWk.js";import{n as J,t as ee}from"./2MdYrk27.js";import{t as te}from"./2OzBYBrP.js";import{t as ne}from"./Cyp_H6gp.js";import{t as re}from"./D92x_spc.js";import{a as ae,i as ie,n as se,o as oe,r as le,s as ce,t as de}from"./Cl4c-3Xk.js";import{r as ue,s as me,t as ge}from"./YBIepScM.js";import{n as he,t as pe}from"./CBL1xGp_.js";function ve(e){if(e<1e3)return String(e);const[t,n]=e<1e6?[1e3,"K"]:[1e6,"M"],r=Math.round(e/t*10)/10;return`${r%1==0?r.toFixed(0):r.toFixed(1)}${n}`}function we({className:e}){/* @__PURE__ */
1
+ import{$ as e,$t as t,At as n,B as r,Bt as a,Cn as i,Ct as s,F as o,Ft as l,H as c,Ht as d,I as u,It as m,Kt as g,L as h,Lt as p,Mt as v,On as w,Pt as f,R as T,Rt as y,U as N,Vt as q,W as x,X as b,Xt as C,Zt as E,at as S,et as I,ft as L,it as z,jt as k,kt as M,ln as R,lt as A,nn as _,nt as F,qt as O,rt as P,s as B,sn as V,st as j,tn as U,tt as H,vn as $,wn as G,xn as D,xt as W,yn as K,yt as Q,z as X,zt as Y}from"./Cr5o77zq.js";import{r as Z}from"./DFRMtMLz.js";import{n as J,t as ee}from"./CE0UwtGX.js";import{t as te}from"./DdQWa3ny.js";import{t as ne}from"./iDDlbtVI.js";import{t as re}from"./DtBnBN-i.js";import{a as ae,i as ie,n as se,o as oe,r as le,s as ce,t as de}from"./DRD9__VZ.js";import{r as ue,s as me,t as ge}from"./CD73UkPZ.js";import{n as he,t as pe}from"./BOsbbHJ0.js";function ve(e){if(e<1e3)return String(e);const[t,n]=e<1e6?[1e3,"K"]:[1e6,"M"],r=Math.round(e/t*10)/10;return`${r%1==0?r.toFixed(0):r.toFixed(1)}${n}`}function we({className:e}){/* @__PURE__ */
2
2
  return _("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__ */_("path",{fill:"currentColor",d:"M5 21q-.825 0-1.412-.587T3 19V5q0-.825.588-1.412T5 3h14q.825 0 1.413.588T21 5v14q0 .825-.587 1.413T19 21zm0-2h14V5H5zm0 0V5zm2-2h10q.3 0 .45-.275t-.05-.525l-2.75-3.675q-.15-.2-.4-.2t-.4.2L11.25 16L9.4 13.525q-.15-.2-.4-.2t-.4.2l-2 2.675q-.2.25-.05.525T7 17"})})}function fe({className:e}){/* @__PURE__ */
3
- return _("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__ */_("path",{fill:"currentColor",d:"M15.188 14.688Q16.5 13.375 16.5 11.5t-1.312-3.187T12 7T8.813 8.313T7.5 11.5t1.313 3.188T12 16t3.188-1.312m-5.1-1.276Q9.3 12.625 9.3 11.5t.788-1.912T12 8.8t1.913.788t.787 1.912t-.787 1.913T12 14.2t-1.912-.787m-4.2 3.787q-2.763-1.8-4.363-4.75q-.125-.225-.187-.462t-.063-.488t.063-.488t.187-.462q1.6-2.95 4.363-4.75T12 4t6.113 1.8t4.362 4.75q.125.225.188.463t.062.487t-.062.488t-.188.462q-1.6 2.95-4.362 4.75T12 19t-6.113-1.8m11.3-1.687Q19.55 14.025 20.8 11.5q-1.25-2.525-3.613-4.012T12 6T6.813 7.488T3.2 11.5q1.25 2.525 3.613 4.013T12 17t5.188-1.487"})})}var Te=({description:e,maxLines:t=2,className:n})=>{const[r,a]=D(!1),[o,l]=D(!1),c=$(null),d=$(null);return i(()=>{a(!1)},[e]),i(()=>{if(!c.current||!e)return void l(!1);const n=c.current,r=()=>{const e=window.getComputedStyle(n),a=Math.max(0,Math.floor(n.getBoundingClientRect().width));if(!a)return void(d.current=window.requestAnimationFrame(r));const i=e.lineHeight,s=parseFloat(e.fontSize)||16;let o=1.2*s;i&&"normal"!==i&&(o=i.endsWith("px")?parseFloat(i):parseFloat(i)*s);const c=document.createElement("div");c.style.position="absolute",c.style.visibility="hidden",c.style.pointerEvents="none",c.style.whiteSpace="normal",c.style.width=`${a}px`,c.style.boxSizing=e.boxSizing,c.style.padding=e.padding,c.style.margin=e.margin,c.style.fontSize=e.fontSize,c.style.fontFamily=e.fontFamily,c.style.fontWeight=e.fontWeight,c.style.lineHeight=e.lineHeight,c.style.letterSpacing=e.letterSpacing,c.style.wordBreak="break-word",c.innerText=n.innerText||"",document.body.appendChild(c);const u=c.scrollHeight;document.body.removeChild(c),l(u>o*t+1)},a=()=>{null!==d.current&&window.cancelAnimationFrame(d.current),d.current=window.requestAnimationFrame(r)};let i;a(),window.addEventListener("resize",a);try{i=new MutationObserver(a),i.observe(n,{characterData:!0,childList:!0,subtree:!0})}catch{}return()=>{window.removeEventListener("resize",a),null!==d.current&&window.cancelAnimationFrame(d.current),i?.disconnect()}},[e,t]),e?/* @__PURE__ */_("div",{className:s("relative w-full",n),children:[/* @__PURE__ */_("p",{ref:c,className:s(P({variant:"body2",color:"muted",align:"center"}),"w-full",r?void 0:`line-clamp-${t}`),children:[e,o&&r&&/* @__PURE__ */_("button",{type:"button",onClick:()=>a(!1),className:"text-primary ml-2 text-sm font-medium hover:underline cursor-pointer",children:"see less"})]}),o&&!r&&/* @__PURE__ */_("span",{className:"bg-background absolute right-0 bottom-0 inline-flex items-center pl-2",children:[/* @__PURE__ */_("span",{className:"text-muted-foreground",children:"..."}),/* @__PURE__ */_("button",{type:"button",onClick:()=>a(!0),className:"text-primary ml-1 text-sm font-medium hover:underline cursor-pointer",children:"see more"})]})]}):null},ye=()=>{const{t:n}=Z(),{eventSlug:r}=Q(),{event:a,parameters:i}=j({eventSlug:r}),{props:s,organization:o,folders:l}=W(),{curateLabel:c,leaderboardLabel:d}=s??{},{eventViews:u,contentCount:m,curationCount:h}=(({event:e})=>{const{props:n,organization:r}=W(),a=n?.organizationId,{isLoading:i,data:s}=t({queryKey:["event-stats",a??"",e?._id??""],queryFn:async()=>{try{return(await E.get(R.GET_EVENT_STATISTICS,{searchParams:{eventSlug:e?.slug},headers:{"x-org-id":a}}).json()).data}catch(t){throw new Error(t instanceof Error?t.message:String(t)||"Failed to fetch event stats")}},enabled:!!e&&Boolean(r?.integrationSettings?.showEventStats)});return{isLoading:i,eventViews:"number"==typeof s?.eventViews?s.eventViews:s?.eventViews?.views??0,contentCount:s?.contentCount||0,curationCount:s?.curationCount||0}})({event:a}),v=Array.isArray(i)&&i.length>0,w=a?.engagementStyle===p.CONTEST||v,f=o?.integrationSettings?.showFolderBreadcrumb&&a?.folderId?b(l??[],a.folderId):[];/* @__PURE__ */
3
+ return _("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__ */_("path",{fill:"currentColor",d:"M15.188 14.688Q16.5 13.375 16.5 11.5t-1.312-3.187T12 7T8.813 8.313T7.5 11.5t1.313 3.188T12 16t3.188-1.312m-5.1-1.276Q9.3 12.625 9.3 11.5t.788-1.912T12 8.8t1.913.788t.787 1.912t-.787 1.913T12 14.2t-1.912-.787m-4.2 3.787q-2.763-1.8-4.363-4.75q-.125-.225-.187-.462t-.063-.488t.063-.488t.187-.462q1.6-2.95 4.363-4.75T12 4t6.113 1.8t4.362 4.75q.125.225.188.463t.062.487t-.062.488t-.188.462q-1.6 2.95-4.362 4.75T12 19t-6.113-1.8m11.3-1.687Q19.55 14.025 20.8 11.5q-1.25-2.525-3.613-4.012T12 6T6.813 7.488T3.2 11.5q1.25 2.525 3.613 4.013T12 17t5.188-1.487"})})}var Te=({description:e,maxLines:t=2,className:n})=>{const[r,a]=D(!1),[o,l]=D(!1),c=$(null),d=$(null);return i(()=>{a(!1)},[e]),i(()=>{if(!c.current||!e)return void l(!1);const n=c.current,r=()=>{const e=window.getComputedStyle(n),a=Math.max(0,Math.floor(n.getBoundingClientRect().width));if(!a)return void(d.current=window.requestAnimationFrame(r));const i=e.lineHeight,s=parseFloat(e.fontSize)||16;let o=1.2*s;i&&"normal"!==i&&(o=i.endsWith("px")?parseFloat(i):parseFloat(i)*s);const c=document.createElement("div");c.style.position="absolute",c.style.visibility="hidden",c.style.pointerEvents="none",c.style.whiteSpace="normal",c.style.width=`${a}px`,c.style.boxSizing=e.boxSizing,c.style.padding=e.padding,c.style.margin=e.margin,c.style.fontSize=e.fontSize,c.style.fontFamily=e.fontFamily,c.style.fontWeight=e.fontWeight,c.style.lineHeight=e.lineHeight,c.style.letterSpacing=e.letterSpacing,c.style.wordBreak="break-word",c.innerText=n.innerText||"",document.body.appendChild(c);const u=c.scrollHeight;document.body.removeChild(c),l(u>o*t+1)},a=()=>{null!==d.current&&window.cancelAnimationFrame(d.current),d.current=window.requestAnimationFrame(r)};let i;a(),window.addEventListener("resize",a);try{i=new MutationObserver(a),i.observe(n,{characterData:!0,childList:!0,subtree:!0})}catch{}return()=>{window.removeEventListener("resize",a),null!==d.current&&window.cancelAnimationFrame(d.current),i?.disconnect()}},[e,t]),e?/* @__PURE__ */_("div",{className:s("relative w-full",n),children:[/* @__PURE__ */_("p",{ref:c,className:s(P({variant:"body2",color:"muted",align:"center"}),"w-full",r?void 0:`line-clamp-${t}`),children:[e,o&&r&&/* @__PURE__ */_("button",{type:"button",onClick:()=>a(!1),className:"text-primary ml-2 text-sm font-medium hover:underline cursor-pointer",children:"see less"})]}),o&&!r&&/* @__PURE__ */_("span",{className:"bg-background absolute right-0 bottom-0 inline-flex items-center pl-2",children:[/* @__PURE__ */_("span",{className:"text-muted-foreground",children:"..."}),/* @__PURE__ */_("button",{type:"button",onClick:()=>a(!0),className:"text-primary ml-1 text-sm font-medium hover:underline cursor-pointer",children:"see more"})]})]}):null},ye=()=>{const{t:n}=Z(),{eventSlug:r}=Q(),{event:a,parameters:i}=j({eventSlug:r}),{props:s,organization:o,folders:l}=W(),{curateLabel:c,leaderboardLabel:d}=s??{},{eventViews:u,contentCount:m,curationCount:h}=(({event:e})=>{const{props:n,organization:r}=W(),a=n?.organizationId,{isLoading:i,data:s}=t({queryKey:["event-stats",a??"",e?._id??""],queryFn:async()=>{try{return(await E.get(M.GET_EVENT_STATISTICS,{searchParams:{eventSlug:e?.slug},headers:{"x-org-id":a}}).json()).data}catch(t){throw new Error(t instanceof Error?t.message:String(t)||"Failed to fetch event stats")}},enabled:!!e&&Boolean(r?.integrationSettings?.showEventStats)});return{isLoading:i,eventViews:"number"==typeof s?.eventViews?s.eventViews:s?.eventViews?.views??0,contentCount:s?.contentCount||0,curationCount:s?.curationCount||0}})({event:a}),v=Array.isArray(i)&&i.length>0,w=a?.engagementStyle===p.CONTEST||v,f=o?.integrationSettings?.showFolderBreadcrumb&&a?.folderId?b(l??[],a.folderId):[];/* @__PURE__ */
4
4
  return _("div",{className:"w-full space-y-3 md:-mt-6",children:[f.length>0&&/* @__PURE__ */_("div",{className:"flex justify-center",children:/* @__PURE__ */_(e,{homeLink:g.PUBLIC_EVENTS,data:f})}),
5
5
  /* @__PURE__ */_("div",{className:"space-y-2",children:[/* @__PURE__ */_(F,{variant:"h4",align:"center",immutable:!0,className:"mx-auto max-w-2xl",children:a?.name}),/* @__PURE__ */_(Te,{description:a?.description})]}),o?.integrationSettings?.showEventStats&&/* @__PURE__ */_("div",{className:"flex justify-center",children:/* @__PURE__ */_("div",{className:"flex items-center gap-6",children:[
6
6
  /* @__PURE__ */_("div",{className:"flex items-center gap-2",children:[/* @__PURE__ */_(fe,{className:"text-primary"}),/* @__PURE__ */_("span",{className:"font-medium",children:ve(u??0)})]}),
@@ -13,20 +13,20 @@ return _("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",view
13
13
  return _("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__ */_("path",{fill:"currentColor",d:"M11 12q-1.65 0-2.825-1.175T7 8t1.175-2.825T11 4t2.825 1.175T15 8t-1.175 2.825T11 12m0-2q.825 0 1.413-.587T13 8t-.587-1.412T11 6t-1.412.588T9 8t.588 1.413T11 10m10.4 12.8l-2.5-2.5q-.525.3-1.125.5T16.5 21q-1.875 0-3.187-1.312T12 16.5t1.313-3.187T16.5 12t3.188 1.313T21 16.5q0 .675-.2 1.275t-.5 1.125l2.5 2.5q.275.275.275.7t-.275.7t-.7.275t-.7-.275m-3.125-4.525Q19 17.55 19 16.5t-.725-1.775T16.5 14t-1.775.725T14 16.5t.725 1.775T16.5 19t1.775-.725M3 18v-.775q0-.85.425-1.575t1.175-1.1q1.05-.55 2.338-.962t2.637-.538q.425-.05.725.25t.3.725t-.3.738t-.725.362q-1.425.175-2.4.525t-1.65.7q-.25.125-.387.363T5 17.225V18h4.6q.425 0 .713.288T10.6 19t-.287.713T9.6 20H5q-.825 0-1.412-.587T3 18m7.175 0"})})}function Ie({className:e}){/* @__PURE__ */
14
14
  return _("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__ */_("path",{fill:"currentColor",d:"M5 11q-.825 0-1.412-.587T3 9V5q0-.825.588-1.412T5 3h4q.825 0 1.413.588T11 5v4q0 .825-.587 1.413T9 11zm0 10q-.825 0-1.412-.587T3 19v-4q0-.825.588-1.412T5 13h4q.825 0 1.413.588T11 15v4q0 .825-.587 1.413T9 21zm10-10q-.825 0-1.412-.587T13 9V5q0-.825.588-1.412T15 3h4q.825 0 1.413.588T21 5v4q0 .825-.587 1.413T19 11zm0 10q-.825 0-1.412-.587T13 19v-4q0-.825.588-1.412T15 13h4q.825 0 1.413.588T21 15v4q0 .825-.587 1.413T19 21zM5 9h4V5H5zm10 0h4V5h-4zm0 10h4v-4h-4zM5 19h4v-4H5zM9 9"})})}function Le({className:e}){/* @__PURE__ */
15
15
  return _("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__ */_("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 3c4.97 0 9 4.03 9 9",children:/* @__PURE__ */_("animateTransform",{attributeName:"transform",dur:"1.5s",repeatCount:"indefinite",type:"rotate",values:"0 12 12;360 12 12"})})})}var ze=({event:e})=>{const t=U(),{user:n,props:a}=W(),i=a?.organizationId,[s,o]=D(!1);/* @__PURE__ */
16
- return _(h,{children:[/* @__PURE__ */_(r,{children:/* @__PURE__ */_(s?Le:Ie,{className:"size-6"})}),/* @__PURE__ */_(T,{align:"end",side:"bottom",className:"w-44",children:Object.values(q).map(r=>/* @__PURE__ */_(X,{onClick:()=>(async r=>{o(!0);try{const a=new FormData;a.append("eventId",e?._id??""),a.append("galleryLayout",r),await E.post(R.UPDATE_EVENT_LAYOUT,{body:a,headers:{"x-org-id":i,Authorization:n?`Bearer ${n.token}`:void 0}}),t.invalidateQueries({queryKey:[`event-data-${i??""}-${e?.slug??""}`]})}catch(a){console.error(a)}o(!1)})(r),isChecked:e?.galleryLayout===r,title:he(r)},r))})]})},ke=({event:e,onAutoscrollClick:n})=>{const{t:i}=Z(),{isSuper:s,isOwner:o,isAdmin:l,isModerator:d}=x(),{inReviewCount:u}=(e=>{const n=U(),{props:r}=W(),a=r?.organizationId,{role:i,isSuper:s}=x(),{isLoading:o,data:l,isError:c,error:d}=t({queryKey:Ne(a,e?.slug),queryFn:async()=>{try{const t=await E.get(R.GET_CONTENTS_COUNT,{searchParams:{eventSlug:e?.slug,filter:`status:${v.IN_REVIEW}`},headers:{"x-org-id":a}}).json();if(t.error)throw new Error(t.error);return t.data}catch(t){throw new Error(t instanceof Error?t.message:String(t)||"Failed to fetch in review count")}},staleTime:0,enabled:Boolean(i)||Boolean(s)});return{loading:o,inReviewCount:l,error:c?d:null,increment:()=>{n.setQueryData(Ne(a,e?.slug),e=>(e??0)+1)},decrement:()=>{n.setQueryData(Ne(a,e?.slug),e=>Math.max(0,(e??0)-1))}}})(e),m=s||o||l||d,g=s||o||l,w=K(()=>{const t=[];return g&&t.push({title:i("event.shot_inspector","Shot Inspector"),icon:qe,href:a.EVENT_SHOT_INSPECTOR(e?.slug??"")}),e?.visibility===Y.PRIVATE&&m&&t.push({title:i("event.access_requests","Access Requests"),icon:Se,href:a.EVENT_ACCESS_REQUESTS(e?.slug??"")}),e?.engagementStyle===p.CONTEST&&g&&t.push({title:i("event.curation_details","Curation Details"),icon:Ee,href:a.EVENT_CURATION_DETAILS(e?.slug??"")}),g&&t.push({title:i("event.edit_event","Edit Event"),icon:c,href:a.EVENT_SETTINGS_BASIC_DETAILS(e?.slug??"")}),t},[e,g,m]);/* @__PURE__ */
17
- return _("div",{className:"text-muted-foreground sm:text-foreground flex flex-row items-center justify-end gap-6 pr-1 sm:justify-between sm:pr-4",children:["undefined"!=typeof document&&document?.fullscreenEnabled&&n&&/* @__PURE__ */_(N,{content:i("event.kiosk_mode","Kiosk Mode"),children:/* @__PURE__ */_("button",{"aria-label":i("event.kiosk_mode","Kiosk Mode"),onClick:n,className:"hidden sm:block",children:/* @__PURE__ */_(be,{className:"size-6"})})}),"undefined"!=typeof document&&document?.fullscreenEnabled&&g&&/* @__PURE__ */_(ze,{event:e}),m&&/* @__PURE__ */_(N,{content:i("event.review_contents","Review Contents"),children:/* @__PURE__ */_("a",{target:"_blank",rel:"noreferrer",href:a.EVENT_REVIEW_CONTENTS(e?.slug??""),className:"relative",children:[/* @__PURE__ */_(xe,{className:"size-6"}),Number(u)>0&&/* @__PURE__ */_("div",{className:"bg-primary text-primary-foreground absolute -top-2 -right-2 rounded-lg px-1 py-0 text-xs",children:u})]})}),w.length>0&&/* @__PURE__ */_(h,{children:[/* @__PURE__ */_(r,{children:/* @__PURE__ */_(Ce,{className:"size-6"})}),/* @__PURE__ */_(T,{align:"end",side:"bottom",className:"w-48",children:w.map(e=>/* @__PURE__ */_(X,{href:e.href,icon:/* @__PURE__ */_(e.icon,{className:"text-primary"}),title:e.title,suffix:e?.chip?/* @__PURE__ */_("span",{className:"bg-primary text-primary-foreground rounded-full px-1.5 py-0.5 text-[0.5rem] font-medium sm:text-xs",children:e.chip}):void 0,isBeta:"BETA"===e?.chip},e.href??e.title))})]})]})};function Re({className:e}){/* @__PURE__ */
18
- return _("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__ */_("path",{fill:"currentColor",d:"M4 18q-.425 0-.712-.288T3 17t.288-.712T4 16h16q.425 0 .713.288T21 17t-.288.713T20 18zm0-5q-.425 0-.712-.288T3 12t.288-.712T4 11h16q.425 0 .713.288T21 12t-.288.713T20 13zm0-5q-.425 0-.712-.288T3 7t.288-.712T4 6h16q.425 0 .713.288T21 7t-.288.713T20 8z"})})}var Ae=({engagementStyle:e,sort:t=l,order:r=m,onSortChange:a,onSortOrderChange:i})=>{const{t:o}=Z(),c=K(()=>{const t=Object.keys(k).map(e=>({text:o(`content.sortby_${k[e].label.toLowerCase()}`,k[e].label),value:e,activeClassName:"bg-primary text-primary-foreground"}));return e===p.CONTEST?t:t.filter(e=>e.value!==n.POPULAR)},[e,o]);/* @__PURE__ */
19
- return _("div",{className:"relative flex w-auto items-center gap-2",children:[/* @__PURE__ */_("button",{type:"button","aria-label":"Sort "+(r===C.ASC?"descending":"ascending"),className:"bg-background rounded p-1",onClick:i,children:/* @__PURE__ */_("svg",{xmlns:"http://www.w3.org/2000/svg",className:s("text-foreground w-7 -scale-x-100 transition-transform",r===C.ASC&&"-scale-y-100"),viewBox:"0 0 24 24",children:/* @__PURE__ */_("path",{fill:"currentColor",d:"M4 18q-.425 0-.712-.288T3 17t.288-.712T4 16h4q.425 0 .713.288T9 17t-.288.713T8 18zm0-5q-.425 0-.712-.288T3 12t.288-.712T4 11h10q.425 0 .713.288T15 12t-.288.713T14 13zm0-5q-.425 0-.712-.288T3 7t.288-.712T4 6h16q.425 0 .713.288T21 7t-.288.713T20 8z"})})}),/* @__PURE__ */_(S,{className:"flex-1 lg:flex-none",selected:t,buttons:c,onChange:e=>a&&a(e)})]})},Me=["jpg","jpeg","png","webp","heic","tiff","bmp"],_e=({value:e,onChange:t})=>{const[n,r]=D(!1),a=$(null),[s,o]=D(null);return i(()=>{if(!e)return void o(null);const t=URL.createObjectURL(e);return o(t),()=>{URL.revokeObjectURL(t)}},[e]),i(()=>{!e&&a.current&&(a.current.value="")},[e]),/* @__PURE__ */_("div",{className:"flex items-center gap-3",children:[!e&&/* @__PURE__ */_("div",{className:"flex items-center gap-4",children:/* @__PURE__ */_("button",{type:"button","aria-label":"Choose image for facial search",onClick:()=>a.current?.click(),className:"border-border flex items-center gap-2 rounded border px-3 py-2.5 "+(n?"bg-opacity-75 cursor-not-allowed":"hover:cursor-pointer"),children:/* @__PURE__ */_(n?J:oe,{})})}),e&&s&&/* @__PURE__ */_("img",{src:s,alt:"Facial Search",className:"size-10 rounded object-cover"}),
20
- /* @__PURE__ */_("input",{ref:a,type:"file",accept:"image/*",className:"hidden",onChange:e=>{const n=e.target?.files?.[0]??null;if(!n)return;const a=(n.name.split(".").pop()||"").toLowerCase();if(!Me.includes(a))return t(null);(async e=>{if(!e)return;r(!0);let n=e;try{const t=await ue(e);n=t.size/1024/1024>1?await ge(t,{maxSizeMB:1,maxWidthOrHeight:1600,useWebWorker:!0,preserveExif:!1,maxIteration:3}):t}catch(a){console.error(a)}r(!1),t(n)})(n)}})]})},Fe={[f.GRID]:{icon:/* @__PURE__ */_(Ie,{className:"size-full text-inherit"})},[f.SINGLE]:{icon:/* @__PURE__ */_(Re,{className:"size-full text-inherit"})}},Oe=Object.keys(Fe).map(e=>({icon:Fe[e].icon,value:e})),Pe=({engagementStyle:e,disabled:t,mode:n,onModeChange:r,sort:a,onSortChange:s,sortOrder:l,onSortOrderChange:c,handleChange:d,face:m,onFaceImageChange:g})=>{const{t:h}=Z(),{organization:p}=W(),v=Boolean(p?.advancedSettings?.aiSettings?.faceRecognitionEnabled),w=!0===p?.integrationSettings?.showFacialSearch&&v,[f,T]=D(""),[y,N]=D(null),q=$(null),x=G(()=>{q.current&&(URL.revokeObjectURL(q.current),q.current=null)},[]),b=G(e=>{if(N(e),x(),e){const t=URL.createObjectURL(e);q.current=t,g?.(t)}else g?.(void 0)},[g,x]),C=G(e=>{T(e.target.value)},[]),E=G(e=>{const t=e.key;"Enter"===t?d&&d(f.length>0?f:""):"Escape"===t&&(T(""),d&&d(""))},[f,d]),I=G(()=>{T(""),d&&d("")},[d]),L=G(()=>{d&&d(f)},[f,d]);return i(()=>{m||N(null)},[m]),i(()=>()=>{x()},[x]),/* @__PURE__ */_("fieldset",{disabled:t,className:"m-0 mb-3 grid min-w-0 grid-cols-3 border-0 p-0 md:space-y-0 md:space-x-4 "+(t?"opacity-50":""),children:[
16
+ return _(h,{children:[/* @__PURE__ */_(r,{children:/* @__PURE__ */_(s?Le:Ie,{className:"size-6"})}),/* @__PURE__ */_(T,{align:"end",side:"bottom",className:"w-44",children:Object.values(q).map(r=>/* @__PURE__ */_(X,{onClick:()=>(async r=>{o(!0);try{const a=new FormData;a.append("eventId",e?._id??""),a.append("galleryLayout",r),await E.post(M.UPDATE_EVENT_LAYOUT,{body:a,headers:{"x-org-id":i,Authorization:n?`Bearer ${n.token}`:void 0}}),t.invalidateQueries({queryKey:[`event-data-${i??""}-${e?.slug??""}`]})}catch(a){console.error(a)}o(!1)})(r),isChecked:e?.galleryLayout===r,title:he(r)},r))})]})},ke=({event:e,onAutoscrollClick:n})=>{const{t:i}=Z(),{isSuper:s,isOwner:o,isAdmin:l,isModerator:d}=x(),{inReviewCount:u}=(e=>{const n=U(),{props:r}=W(),a=r?.organizationId,{role:i,isSuper:s}=x(),{isLoading:o,data:l,isError:c,error:d}=t({queryKey:Ne(a,e?.slug),queryFn:async()=>{try{const t=await E.get(M.GET_CONTENTS_COUNT,{searchParams:{eventSlug:e?.slug,filter:`status:${v.IN_REVIEW}`},headers:{"x-org-id":a}}).json();if(t.error)throw new Error(t.error);return t.data}catch(t){throw new Error(t instanceof Error?t.message:String(t)||"Failed to fetch in review count")}},staleTime:0,enabled:Boolean(i)||Boolean(s)});return{loading:o,inReviewCount:l,error:c?d:null,increment:()=>{n.setQueryData(Ne(a,e?.slug),e=>(e??0)+1)},decrement:()=>{n.setQueryData(Ne(a,e?.slug),e=>Math.max(0,(e??0)-1))}}})(e),m=s||o||l||d,g=s||o||l,w=K(()=>{const t=[];return g&&t.push({title:i("event.shot_inspector","Shot Inspector"),icon:qe,href:a.EVENT_SHOT_INSPECTOR(e?.slug??"")}),e?.visibility===Y.PRIVATE&&m&&t.push({title:i("event.access_requests","Access Requests"),icon:Se,href:a.EVENT_ACCESS_REQUESTS(e?.slug??"")}),e?.engagementStyle===p.CONTEST&&g&&t.push({title:i("event.curation_details","Curation Details"),icon:Ee,href:a.EVENT_CURATION_DETAILS(e?.slug??"")}),g&&t.push({title:i("event.edit_event","Edit Event"),icon:c,href:a.EVENT_SETTINGS_BASIC_DETAILS(e?.slug??"")}),t},[e,g,m]);/* @__PURE__ */
17
+ return _("div",{className:"text-muted-foreground sm:text-foreground flex flex-row items-center justify-end gap-6 pr-1 sm:justify-between sm:pr-4",children:["undefined"!=typeof document&&document?.fullscreenEnabled&&n&&/* @__PURE__ */_(N,{content:i("event.kiosk_mode","Kiosk Mode"),children:/* @__PURE__ */_("button",{"aria-label":i("event.kiosk_mode","Kiosk Mode"),onClick:n,className:"hidden sm:block",children:/* @__PURE__ */_(be,{className:"size-6"})})}),"undefined"!=typeof document&&document?.fullscreenEnabled&&g&&/* @__PURE__ */_(ze,{event:e}),m&&/* @__PURE__ */_(N,{content:i("event.review_contents","Review Contents"),children:/* @__PURE__ */_("a",{target:"_blank",rel:"noreferrer",href:a.EVENT_REVIEW_CONTENTS(e?.slug??""),className:"relative",children:[/* @__PURE__ */_(xe,{className:"size-6"}),Number(u)>0&&/* @__PURE__ */_("div",{className:"bg-primary text-primary-foreground absolute -top-2 -right-2 rounded-lg px-1 py-0 text-xs",children:u})]})}),w.length>0&&/* @__PURE__ */_(h,{children:[/* @__PURE__ */_(r,{children:/* @__PURE__ */_(Ce,{className:"size-6"})}),/* @__PURE__ */_(T,{align:"end",side:"bottom",className:"w-48",children:w.map(e=>/* @__PURE__ */_(X,{href:e.href,icon:/* @__PURE__ */_(e.icon,{className:"text-primary"}),title:e.title,suffix:e?.chip?/* @__PURE__ */_("span",{className:"bg-primary text-primary-foreground rounded-full px-1.5 py-0.5 text-[0.5rem] font-medium sm:text-xs",children:e.chip}):void 0,isBeta:"BETA"===e?.chip},e.href??e.title))})]})]})};function Me({className:e}){/* @__PURE__ */
18
+ return _("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__ */_("path",{fill:"currentColor",d:"M4 18q-.425 0-.712-.288T3 17t.288-.712T4 16h16q.425 0 .713.288T21 17t-.288.713T20 18zm0-5q-.425 0-.712-.288T3 12t.288-.712T4 11h16q.425 0 .713.288T21 12t-.288.713T20 13zm0-5q-.425 0-.712-.288T3 7t.288-.712T4 6h16q.425 0 .713.288T21 7t-.288.713T20 8z"})})}var Re=({engagementStyle:e,sort:t=l,order:r=m,onSortChange:a,onSortOrderChange:i})=>{const{t:o}=Z(),c=K(()=>{const t=Object.keys(k).map(e=>({text:o(`content.sortby_${k[e].label.toLowerCase()}`,k[e].label),value:e,activeClassName:"bg-primary text-primary-foreground"}));return e===p.CONTEST?t:t.filter(e=>e.value!==n.POPULAR)},[e,o]);/* @__PURE__ */
19
+ return _("div",{className:"relative flex w-auto items-center gap-2",children:[/* @__PURE__ */_("button",{type:"button","aria-label":"Sort "+(r===C.ASC?"descending":"ascending"),className:"bg-background rounded p-1",onClick:i,children:/* @__PURE__ */_("svg",{xmlns:"http://www.w3.org/2000/svg",className:s("text-foreground w-7 -scale-x-100 transition-transform",r===C.ASC&&"-scale-y-100"),viewBox:"0 0 24 24",children:/* @__PURE__ */_("path",{fill:"currentColor",d:"M4 18q-.425 0-.712-.288T3 17t.288-.712T4 16h4q.425 0 .713.288T9 17t-.288.713T8 18zm0-5q-.425 0-.712-.288T3 12t.288-.712T4 11h10q.425 0 .713.288T15 12t-.288.713T14 13zm0-5q-.425 0-.712-.288T3 7t.288-.712T4 6h16q.425 0 .713.288T21 7t-.288.713T20 8z"})})}),/* @__PURE__ */_(S,{className:"flex-1 lg:flex-none",selected:t,buttons:c,onChange:e=>a&&a(e)})]})},Ae=["jpg","jpeg","png","webp","heic","tiff","bmp"],_e=({value:e,onChange:t})=>{const[n,r]=D(!1),a=$(null),[s,o]=D(null);return i(()=>{if(!e)return void o(null);const t=URL.createObjectURL(e);return o(t),()=>{URL.revokeObjectURL(t)}},[e]),i(()=>{!e&&a.current&&(a.current.value="")},[e]),/* @__PURE__ */_("div",{className:"flex items-center gap-3",children:[!e&&/* @__PURE__ */_("div",{className:"flex items-center gap-4",children:/* @__PURE__ */_("button",{type:"button","aria-label":"Choose image for facial search",onClick:()=>a.current?.click(),className:"border-border flex items-center gap-2 rounded border px-3 py-2.5 "+(n?"bg-opacity-75 cursor-not-allowed":"hover:cursor-pointer"),children:/* @__PURE__ */_(n?J:oe,{})})}),e&&s&&/* @__PURE__ */_("img",{src:s,alt:"Facial Search",className:"size-10 rounded object-cover"}),
20
+ /* @__PURE__ */_("input",{ref:a,type:"file",accept:"image/*",className:"hidden",onChange:e=>{const n=e.target?.files?.[0]??null;if(!n)return;const a=(n.name.split(".").pop()||"").toLowerCase();if(!Ae.includes(a))return t(null);(async e=>{if(!e)return;r(!0);let n=e;try{const t=await ue(e);n=t.size/1024/1024>1?await ge(t,{maxSizeMB:1,maxWidthOrHeight:1600,useWebWorker:!0,preserveExif:!1,maxIteration:3}):t}catch(a){console.error(a)}r(!1),t(n)})(n)}})]})},Fe={[f.GRID]:{icon:/* @__PURE__ */_(Ie,{className:"size-full text-inherit"})},[f.SINGLE]:{icon:/* @__PURE__ */_(Me,{className:"size-full text-inherit"})}},Oe=Object.keys(Fe).map(e=>({icon:Fe[e].icon,value:e})),Pe=({engagementStyle:e,disabled:t,mode:n,onModeChange:r,sort:a,onSortChange:s,sortOrder:l,onSortOrderChange:c,handleChange:d,face:m,onFaceImageChange:g})=>{const{t:h}=Z(),{organization:p}=W(),v=Boolean(p?.advancedSettings?.aiSettings?.faceRecognitionEnabled),w=!0===p?.integrationSettings?.showFacialSearch&&v,[f,T]=D(""),[y,N]=D(null),q=$(null),x=G(()=>{q.current&&(URL.revokeObjectURL(q.current),q.current=null)},[]),b=G(e=>{if(N(e),x(),e){const t=URL.createObjectURL(e);q.current=t,g?.(t)}else g?.(void 0)},[g,x]),C=G(e=>{T(e.target.value)},[]),E=G(e=>{const t=e.key;"Enter"===t?d&&d(f.length>0?f:""):"Escape"===t&&(T(""),d&&d(""))},[f,d]),I=G(()=>{T(""),d&&d("")},[d]),L=G(()=>{d&&d(f)},[f,d]);return i(()=>{m||N(null)},[m]),i(()=>()=>{x()},[x]),/* @__PURE__ */_("fieldset",{disabled:t,className:"m-0 mb-3 grid min-w-0 grid-cols-3 border-0 p-0 md:space-y-0 md:space-x-4 "+(t?"opacity-50":""),children:[
21
21
  /* @__PURE__ */_("div",{className:"col-span-3 flex items-center gap-4 md:col-span-1",children:[p?.integrationSettings?.showGridViewToggle&&/* @__PURE__ */_(S,{buttons:Oe,selected:n,onChange:r}),p?.integrationSettings?.showKeywordSearch&&/* @__PURE__ */_("div",{className:"flex-auto",children:/* @__PURE__ */_("div",{className:"relative min-w-32 sm:min-w-48",children:[
22
22
  /* @__PURE__ */_(pe,{placeholder:h("content.search_placeholder","Search using text"),value:f,className:"py-2",onChange:C,onKeyUp:E}),f?.length>0&&/* @__PURE__ */_("button",{type:"button","aria-label":"Clear search",className:"absolute inset-y-0 right-10 flex items-center",onClick:I,children:/* @__PURE__ */_(u,{className:"text-foreground w-5"})}),
23
23
  /* @__PURE__ */_("button",{type:"button","aria-label":"Search",className:"absolute inset-y-0 right-3 flex items-center",onClick:L,children:/* @__PURE__ */_(o,{className:"text-foreground w-5"})})]})}),w&&/* @__PURE__ */_(_e,{value:y,onChange:b})]}),
24
24
  /* @__PURE__ */_("div",{className:"col-span-3 md:col-span-1"}),
25
- /* @__PURE__ */_("div",{className:"col-span-3 mt-3 md:col-span-1 md:mt-0 lg:justify-self-end",children:/* @__PURE__ */_(Ae,{engagementStyle:e,sort:a,order:l,onSortChange:s,onSortOrderChange:c})})]})},Be=({position:e,gamConfig:t,eventId:n,organizationId:r})=>{const{trackGamAnalytics:a}=se(),s=$(null),o=`gam-${e}-banner-${n??"ev"}`,l=t.placementCategories?.[e];return i(()=>{let e=!1,i=null,c=null,u=null,m=null,g=null,h=null;const p=l?[l]:[],v=document.createElement("div");v.id=o,document.body.appendChild(v);const w=()=>{const e=s.current;if(!e)return;const t=e.getBoundingClientRect(),n=t.width>0&&t.height>0;v.style.display=n?"block":"none",n&&(v.style.position="fixed",v.style.top=`${t.top}px`,v.style.left=`${t.left}px`,v.style.width="728px",v.style.height="90px",v.style.zIndex="20")};return w(),window.addEventListener("scroll",w,{passive:!0}),window.addEventListener("resize",w),(async()=>{await ae(),e||window.googletag.cmd.push(()=>{if(e)return;le(o);const s=window.googletag.defineSlot(t.adUnitPath,[[728,90]],o)?.addService(window.googletag.pubads());s&&(i=s,m=window.googletag.pubads(),n?s.setConfig({targeting:{qrati_event:n,...p.length>0?{qrati_category:p}:{}}}):p.length>0&&s.setConfig({targeting:{qrati_category:p}}),g=e=>{e.slot===s&&a({eventId:n,organizationId:r,type:d.GAM_IMPRESSION,creativeId:String(e.creativeId??""),lineItemId:String(e.lineItemId??""),advertiserId:String(e.advertiserId??""),isEmpty:e.isEmpty??!1})},m.addEventListener("slotRenderEnded",g),h=e=>{e.slot===s&&a({eventId:n,organizationId:r,type:d.GAM_VIEWABLE})},m.addEventListener("impressionViewable",h),u=de({container:v,onClick:()=>{a({eventId:n,organizationId:r,type:d.GAM_CLICK})}}),ie(),window.googletag.display(o),c=window.setTimeout(()=>{e||(w(),s.getResponseInformation?.()||window.googletag.pubads().refresh([s]))},1500))})})(),()=>{e=!0,window.removeEventListener("scroll",w),window.removeEventListener("resize",w),null!==c&&window.clearTimeout(c),u?.(),m&&"function"==typeof m.removeEventListener&&(g&&m.removeEventListener("slotRenderEnded",g),h&&m.removeEventListener("impressionViewable",h));const t=i;i=null,t&&window.googletag?.cmd?.push(()=>{window.googletag.destroySlots([t])}),v.parentNode&&v.parentNode.removeChild(v)}},[n,t.adUnitPath,r,l,e,o]),/* @__PURE__ */_("div",{className:"flex w-full items-center justify-center overflow-x-auto py-2",children:/* @__PURE__ */_("div",{ref:s,style:{width:728,height:90,minWidth:728}})})},Ve=({gamConfig:e,eventId:t,organizationId:n})=>{const{trackGamAnalytics:r}=se(),a=$(null),s=`gam-right-${t??"ev"}`,o=e.placementCategories?.right??e.placementCategories?.sidebar;return i(()=>{let i=!1,l=null,c=null,u=null,m=null,g=null,h=null;const p=o?[o]:[],v=document.createElement("div");v.id=s,document.body.appendChild(v);const w=()=>{const e=a.current;if(!e)return;const t=e.getBoundingClientRect(),n=e.parentElement?.getBoundingClientRect(),r=t.width>0&&t.height>0;if(v.style.display=r?"block":"none",!r)return;const i=t.top<=0&&n?Math.min(0,n.bottom-600):t.top;v.style.position="fixed",v.style.top=`${i}px`,v.style.left=`${t.left}px`,v.style.width="160px",v.style.height="600px",v.style.zIndex="20"};return w(),window.addEventListener("scroll",w,{passive:!0}),window.addEventListener("resize",w),(async()=>{await ae(),i||window.googletag.cmd.push(()=>{if(i)return;le(s);const a=window.googletag.defineSlot(e.adUnitPath,[[160,600]],s)?.addService(window.googletag.pubads());a&&(l=a,m=window.googletag.pubads(),t?a.setConfig({targeting:{qrati_event:t,...p.length>0?{qrati_category:p}:{}}}):p.length>0&&a.setConfig({targeting:{qrati_category:p}}),g=e=>{e.slot===a&&r({eventId:t,organizationId:n,type:d.GAM_IMPRESSION,creativeId:String(e.creativeId??""),lineItemId:String(e.lineItemId??""),advertiserId:String(e.advertiserId??""),isEmpty:e.isEmpty??!1})},m.addEventListener("slotRenderEnded",g),h=e=>{e.slot===a&&r({eventId:t,organizationId:n,type:d.GAM_VIEWABLE})},m.addEventListener("impressionViewable",h),u=de({container:v,onClick:()=>{r({eventId:t,organizationId:n,type:d.GAM_CLICK})}}),ie(),window.googletag.display(s),c=window.setTimeout(()=>{i||(w(),a.getResponseInformation?.()||window.googletag.pubads().refresh([a]))},1500))})})(),()=>{i=!0,window.removeEventListener("scroll",w),window.removeEventListener("resize",w),null!==c&&window.clearTimeout(c),u?.(),m&&"function"==typeof m.removeEventListener&&(g&&m.removeEventListener("slotRenderEnded",g),h&&m.removeEventListener("impressionViewable",h));const e=l;l=null,e&&window.googletag?.cmd?.push(()=>{window.googletag.destroySlots([e])}),v.parentNode&&v.parentNode.removeChild(v)}},[t,e.adUnitPath,n,o,s]),/* @__PURE__ */_("div",{ref:a,style:{width:160,height:600},className:"hidden shrink-0 self-start lg:block"})},je=A(()=>import("./DGLG5AUs.js")),Ue=e=>e?.status===y.OPEN||Boolean(e?.isUnlimitedDuration&&!e?.endDate),He=e=>Array.isArray(e)&&e.length>0,$e=()=>{const e=Q().eventSlug,{loadingUser:t,organization:r}=W(),a=U(),[o,c]=D(""),[d,h]=D(void 0),[v,T]=D(l),[y,N]=D(m),[q,x]=D("undefined"!=typeof window&&window.innerWidth<768?f.SINGLE:f.GRID),b=$(null),{event:C,ads:E,gamConfig:S,customAds:L,parameters:k}=j({eventSlug:e}),{loading:R,isError:A,error:P,refetch:X,contentsWithAds:Y,hasNextPage:Z,fetchNextPage:J,isFetchingNextPage:re}=M({event:C,ads:E,gamConfig:S,customAds:L,sort:v,order:y,keywords:o,face:d}),{incrementEventView:ae}=se(),{start:ie,initializing:oe,running:le}=(({ref:e,onBottomReached:t,hasNextPage:n,fetchNextPage:r,isFetchingNextPage:a})=>{const[s,o]=D(!1),[l,c]=D(!1),d=$(1),u=$(null),m=$(null),g=$(null),h=$(0),p=$(!1),v=$(null),w=$(null),f=$(!1),T=$(),y=$(),N=$(n),q=$(a),x=$(r),b=$(t);N.current=n,q.current=a,x.current=r,b.current=t,i(()=>{a||(p.current=!1)},[a]);const C=()=>{null!==u.current&&(window.cancelAnimationFrame(u.current),u.current=null)},E=t=>{const n=e.current;if(!n)return;null===g.current&&(g.current=t);const r=Math.min((t-g.current)/1e3,.05);g.current=t,h.current+=60*d.current*r;const a=Math.floor(h.current);a>0&&(n.scrollTop+=a,h.current-=a),N.current&&!q.current&&!p.current&&"function"==typeof x.current&&n.scrollTop+n.clientHeight>=.5*n.scrollHeight&&(p.current=!0,x.current()),Math.ceil(n.scrollTop)+n.clientHeight>=n.scrollHeight?(C(),m.current=window.setTimeout(()=>{c(!0),b.current?.(),p.current=!1,m.current=window.setTimeout(()=>{e.current&&(e.current.scrollTop=0),c(!1),h.current=0,g.current=null,u.current=window.requestAnimationFrame(E)},1e3)},1e3)):u.current=window.requestAnimationFrame(E)},S=()=>{C(),m.current&&(window.clearTimeout(m.current),m.current=null),null!==v.current&&v.current.release().catch(()=>{}).finally(()=>{v.current=null}),w.current&&(document.removeEventListener("visibilitychange",w.current),w.current=null),f.current&&(T.current&&document.removeEventListener("keydown",T.current),y.current&&document.removeEventListener("fullscreenchange",y.current),f.current=!1),o(!1),c(!1),e.current&&(e.current.scrollTop=0)},I=$(e=>{"+"===e.key&&(d.current=Math.min(d.current+1,10)),"-"===e.key&&(d.current=Math.max(d.current-1,1))}),L=$(()=>{document.fullscreenElement||S()});return L.current=()=>{document.fullscreenElement||S()},i(()=>()=>{S()},[]),{start:()=>{if(e?.current?.requestFullscreen)e.current.requestFullscreen();else{const t=e.current;t?.webkitRequestFullscreen?t.webkitRequestFullscreen():t?.mozRequestFullScreen?t.mozRequestFullScreen():t?.msRequestFullscreen&&t.msRequestFullscreen()}(async()=>{try{if(!("wakeLock"in navigator))return;const e=navigator;v.current=await e.wakeLock.request("screen");const t=async()=>{"visible"===document.visibilityState&&(v.current=await e.wakeLock.request("screen"))};w.current=t,document.addEventListener("visibilitychange",t)}catch(e){}})(),f.current||(T.current=e=>I.current(e),y.current=()=>L.current(),document.addEventListener("keydown",T.current),document.addEventListener("fullscreenchange",y.current),f.current=!0),h.current=0,g.current=null,p.current=!1,o(!0),C(),m.current=window.setTimeout(()=>{u.current=window.requestAnimationFrame(E)},300)},initializing:l,running:s}})({ref:b,hasNextPage:Z,fetchNextPage:J,isFetchingNextPage:re,onBottomReached:()=>C?._id&&a.refetchQueries({queryKey:[O.CONTENTS_BY_EVENT(C._id)]})});i(()=>{C?.slug&&ae(C.slug)},[C?.slug,ae]);const ce=K(()=>q===f.SINGLE,[q]),de=K(()=>/* @__PURE__ */_(ke,{event:C,onAutoscrollClick:ie}),[C,ie]),ue=$(null),me=$({hasNextPage:Z,isFetchingNextPage:re,loading:R,running:le,fetchNextPage:J});me.current={hasNextPage:Z,isFetchingNextPage:re,loading:R,running:le,fetchNextPage:J},i(()=>(ue.current=new IntersectionObserver(e=>{const t=me.current;t.running||e[0].isIntersecting&&t.hasNextPage&&!t.isFetchingNextPage&&!t.loading&&t.fetchNextPage()},{rootMargin:"200px"}),()=>{ue.current?.disconnect(),ue.current=null}),[]);const ge=G(e=>{const t=ue.current;t&&(t.disconnect(),e&&t.observe(e))},[]),he=S?.bannerPositions??[],pe=r?._id,ve=S&&he.includes("right"),we=Boolean(r?.advancedSettings?.aiSettings?.faceRecognitionEnabled),fe=Boolean(r?.integrationSettings?.showQuickSearch)&&we;/* @__PURE__ */
25
+ /* @__PURE__ */_("div",{className:"col-span-3 mt-3 md:col-span-1 md:mt-0 lg:justify-self-end",children:/* @__PURE__ */_(Re,{engagementStyle:e,sort:a,order:l,onSortChange:s,onSortOrderChange:c})})]})},Be=({position:e,gamConfig:t,eventId:n,organizationId:r})=>{const{trackGamAnalytics:a}=se(),s=$(null),o=`gam-${e}-banner-${n??"ev"}`,l=t.placementCategories?.[e];return i(()=>{let e=!1,i=null,c=null,u=null,m=null,g=null,h=null;const p=l?[l]:[],v=document.createElement("div");v.id=o,document.body.appendChild(v);const w=()=>{const e=s.current;if(!e)return;const t=e.getBoundingClientRect(),n=t.width>0&&t.height>0;v.style.display=n?"block":"none",n&&(v.style.position="fixed",v.style.top=`${t.top}px`,v.style.left=`${t.left}px`,v.style.width="728px",v.style.height="90px",v.style.zIndex="20")};return w(),window.addEventListener("scroll",w,{passive:!0}),window.addEventListener("resize",w),(async()=>{await ae(),e||window.googletag.cmd.push(()=>{if(e)return;le(o);const s=window.googletag.defineSlot(t.adUnitPath,[[728,90]],o)?.addService(window.googletag.pubads());s&&(i=s,m=window.googletag.pubads(),n?s.setConfig({targeting:{qrati_event:n,...p.length>0?{qrati_category:p}:{}}}):p.length>0&&s.setConfig({targeting:{qrati_category:p}}),g=e=>{e.slot===s&&a({eventId:n,organizationId:r,type:d.GAM_IMPRESSION,creativeId:String(e.creativeId??""),lineItemId:String(e.lineItemId??""),advertiserId:String(e.advertiserId??""),isEmpty:e.isEmpty??!1})},m.addEventListener("slotRenderEnded",g),h=e=>{e.slot===s&&a({eventId:n,organizationId:r,type:d.GAM_VIEWABLE})},m.addEventListener("impressionViewable",h),u=de({container:v,onClick:()=>{a({eventId:n,organizationId:r,type:d.GAM_CLICK})}}),ie(),window.googletag.display(o),c=window.setTimeout(()=>{e||(w(),s.getResponseInformation?.()||window.googletag.pubads().refresh([s]))},1500))})})(),()=>{e=!0,window.removeEventListener("scroll",w),window.removeEventListener("resize",w),null!==c&&window.clearTimeout(c),u?.(),m&&"function"==typeof m.removeEventListener&&(g&&m.removeEventListener("slotRenderEnded",g),h&&m.removeEventListener("impressionViewable",h));const t=i;i=null,t&&window.googletag?.cmd?.push(()=>{window.googletag.destroySlots([t])}),v.parentNode&&v.parentNode.removeChild(v)}},[n,t.adUnitPath,r,l,e,o]),/* @__PURE__ */_("div",{className:"flex w-full items-center justify-center overflow-x-auto py-2",children:/* @__PURE__ */_("div",{ref:s,style:{width:728,height:90,minWidth:728}})})},Ve=({gamConfig:e,eventId:t,organizationId:n})=>{const{trackGamAnalytics:r}=se(),a=$(null),s=`gam-right-${t??"ev"}`,o=e.placementCategories?.right??e.placementCategories?.sidebar;return i(()=>{let i=!1,l=null,c=null,u=null,m=null,g=null,h=null;const p=o?[o]:[],v=document.createElement("div");v.id=s,document.body.appendChild(v);const w=()=>{const e=a.current;if(!e)return;const t=e.getBoundingClientRect(),n=e.parentElement?.getBoundingClientRect(),r=t.width>0&&t.height>0;if(v.style.display=r?"block":"none",!r)return;const i=t.top<=0&&n?Math.min(0,n.bottom-600):t.top;v.style.position="fixed",v.style.top=`${i}px`,v.style.left=`${t.left}px`,v.style.width="160px",v.style.height="600px",v.style.zIndex="20"};return w(),window.addEventListener("scroll",w,{passive:!0}),window.addEventListener("resize",w),(async()=>{await ae(),i||window.googletag.cmd.push(()=>{if(i)return;le(s);const a=window.googletag.defineSlot(e.adUnitPath,[[160,600]],s)?.addService(window.googletag.pubads());a&&(l=a,m=window.googletag.pubads(),t?a.setConfig({targeting:{qrati_event:t,...p.length>0?{qrati_category:p}:{}}}):p.length>0&&a.setConfig({targeting:{qrati_category:p}}),g=e=>{e.slot===a&&r({eventId:t,organizationId:n,type:d.GAM_IMPRESSION,creativeId:String(e.creativeId??""),lineItemId:String(e.lineItemId??""),advertiserId:String(e.advertiserId??""),isEmpty:e.isEmpty??!1})},m.addEventListener("slotRenderEnded",g),h=e=>{e.slot===a&&r({eventId:t,organizationId:n,type:d.GAM_VIEWABLE})},m.addEventListener("impressionViewable",h),u=de({container:v,onClick:()=>{r({eventId:t,organizationId:n,type:d.GAM_CLICK})}}),ie(),window.googletag.display(s),c=window.setTimeout(()=>{i||(w(),a.getResponseInformation?.()||window.googletag.pubads().refresh([a]))},1500))})})(),()=>{i=!0,window.removeEventListener("scroll",w),window.removeEventListener("resize",w),null!==c&&window.clearTimeout(c),u?.(),m&&"function"==typeof m.removeEventListener&&(g&&m.removeEventListener("slotRenderEnded",g),h&&m.removeEventListener("impressionViewable",h));const e=l;l=null,e&&window.googletag?.cmd?.push(()=>{window.googletag.destroySlots([e])}),v.parentNode&&v.parentNode.removeChild(v)}},[t,e.adUnitPath,n,o,s]),/* @__PURE__ */_("div",{ref:a,style:{width:160,height:600},className:"hidden shrink-0 self-start lg:block"})},je=R(()=>import("./D-U23_J5.js")),Ue=e=>e?.status===y.OPEN||Boolean(e?.isUnlimitedDuration&&!e?.endDate),He=e=>Array.isArray(e)&&e.length>0,$e=()=>{const e=Q().eventSlug,{loadingUser:t,organization:r}=W(),a=U(),[o,c]=D(""),[d,h]=D(void 0),[v,T]=D(l),[y,N]=D(m),[q,x]=D("undefined"!=typeof window&&window.innerWidth<768?f.SINGLE:f.GRID),b=$(null),{event:C,ads:E,gamConfig:S,customAds:L,parameters:k}=j({eventSlug:e}),{loading:M,isError:R,error:P,refetch:X,contentsWithAds:Y,hasNextPage:Z,fetchNextPage:J,isFetchingNextPage:re}=A({event:C,ads:E,gamConfig:S,customAds:L,sort:v,order:y,keywords:o,face:d}),{incrementEventView:ae}=se(),{start:ie,initializing:oe,running:le}=(({ref:e,onBottomReached:t,hasNextPage:n,fetchNextPage:r,isFetchingNextPage:a})=>{const[s,o]=D(!1),[l,c]=D(!1),d=$(1),u=$(null),m=$(null),g=$(null),h=$(0),p=$(!1),v=$(null),w=$(null),f=$(!1),T=$(),y=$(),N=$(n),q=$(a),x=$(r),b=$(t);N.current=n,q.current=a,x.current=r,b.current=t,i(()=>{a||(p.current=!1)},[a]);const C=()=>{null!==u.current&&(window.cancelAnimationFrame(u.current),u.current=null)},E=t=>{const n=e.current;if(!n)return;null===g.current&&(g.current=t);const r=Math.min((t-g.current)/1e3,.05);g.current=t,h.current+=60*d.current*r;const a=Math.floor(h.current);a>0&&(n.scrollTop+=a,h.current-=a),N.current&&!q.current&&!p.current&&"function"==typeof x.current&&n.scrollTop+n.clientHeight>=.5*n.scrollHeight&&(p.current=!0,x.current()),Math.ceil(n.scrollTop)+n.clientHeight>=n.scrollHeight?(C(),m.current=window.setTimeout(()=>{c(!0),b.current?.(),p.current=!1,m.current=window.setTimeout(()=>{e.current&&(e.current.scrollTop=0),c(!1),h.current=0,g.current=null,u.current=window.requestAnimationFrame(E)},1e3)},1e3)):u.current=window.requestAnimationFrame(E)},S=()=>{C(),m.current&&(window.clearTimeout(m.current),m.current=null),null!==v.current&&v.current.release().catch(()=>{}).finally(()=>{v.current=null}),w.current&&(document.removeEventListener("visibilitychange",w.current),w.current=null),f.current&&(T.current&&document.removeEventListener("keydown",T.current),y.current&&document.removeEventListener("fullscreenchange",y.current),f.current=!1),o(!1),c(!1),e.current&&(e.current.scrollTop=0)},I=$(e=>{"+"===e.key&&(d.current=Math.min(d.current+1,10)),"-"===e.key&&(d.current=Math.max(d.current-1,1))}),L=$(()=>{document.fullscreenElement||S()});return L.current=()=>{document.fullscreenElement||S()},i(()=>()=>{S()},[]),{start:()=>{if(e?.current?.requestFullscreen)e.current.requestFullscreen();else{const t=e.current;t?.webkitRequestFullscreen?t.webkitRequestFullscreen():t?.mozRequestFullScreen?t.mozRequestFullScreen():t?.msRequestFullscreen&&t.msRequestFullscreen()}(async()=>{try{if(!("wakeLock"in navigator))return;const e=navigator;v.current=await e.wakeLock.request("screen");const t=async()=>{"visible"===document.visibilityState&&(v.current=await e.wakeLock.request("screen"))};w.current=t,document.addEventListener("visibilitychange",t)}catch(e){}})(),f.current||(T.current=e=>I.current(e),y.current=()=>L.current(),document.addEventListener("keydown",T.current),document.addEventListener("fullscreenchange",y.current),f.current=!0),h.current=0,g.current=null,p.current=!1,o(!0),C(),m.current=window.setTimeout(()=>{u.current=window.requestAnimationFrame(E)},300)},initializing:l,running:s}})({ref:b,hasNextPage:Z,fetchNextPage:J,isFetchingNextPage:re,onBottomReached:()=>C?._id&&a.refetchQueries({queryKey:[O.CONTENTS_BY_EVENT(C._id)]})});i(()=>{C?.slug&&ae(C.slug)},[C?.slug,ae]);const ce=K(()=>q===f.SINGLE,[q]),de=K(()=>/* @__PURE__ */_(ke,{event:C,onAutoscrollClick:ie}),[C,ie]),ue=$(null),me=$({hasNextPage:Z,isFetchingNextPage:re,loading:M,running:le,fetchNextPage:J});me.current={hasNextPage:Z,isFetchingNextPage:re,loading:M,running:le,fetchNextPage:J},i(()=>(ue.current=new IntersectionObserver(e=>{const t=me.current;t.running||e[0].isIntersecting&&t.hasNextPage&&!t.isFetchingNextPage&&!t.loading&&t.fetchNextPage()},{rootMargin:"200px"}),()=>{ue.current?.disconnect(),ue.current=null}),[]);const ge=G(e=>{const t=ue.current;t&&(t.disconnect(),e&&t.observe(e))},[]),he=G(()=>{!re&&Z&&J()},[J,Z,re]),pe=S?.bannerPositions??[],ve=r?._id,we=S&&pe.includes("right"),fe=Boolean(r?.advancedSettings?.aiSettings?.faceRecognitionEnabled),Te=Boolean(r?.integrationSettings?.showQuickSearch)&&fe;/* @__PURE__ */
26
26
  return _("div",{className:"bg-background mx-auto min-h-[80vh]",children:[
27
27
  /* @__PURE__ */_("div",{className:"flex flex-row justify-end gap-4 pt-2",children:de}),
28
- /* @__PURE__ */_("div",{className:"pb-3",children:/* @__PURE__ */_(ye,{})}),S&&he.includes("top")&&/* @__PURE__ */_(Be,{position:"top",gamConfig:S,eventId:C?._id,organizationId:pe}),
29
- /* @__PURE__ */_(Pe,{engagementStyle:C?.engagementStyle,disabled:t||R,mode:q,onModeChange:e=>x(e),sort:v,sortOrder:y,onSortChange:e=>T(e),onSortOrderChange:()=>N("asc"===y?"desc":"asc"),handleChange:c,face:d,onFaceImageChange:e=>h(e)}),d&&/* @__PURE__ */_("div",{className:"flex gap-4 py-2",children:[/* @__PURE__ */_("div",{className:"space-y-2",children:[/* @__PURE__ */_(F,{variant:"h4",children:"Searching using"}),/* @__PURE__ */_("img",{src:d,alt:"face",className:"h-32 rounded"})]}),/* @__PURE__ */_("div",{className:"flex flex-col justify-end gap-2",children:/* @__PURE__ */_(ee,{color:"error",icon:/* @__PURE__ */_(u,{className:"size-5"}),onClick:()=>h(void 0),children:"Clear search"})})]}),
30
- /* @__PURE__ */_("div",{className:"flex items-start gap-4",children:[/* @__PURE__ */_("div",{className:"min-w-0 flex-1",children:[t||R?/* @__PURE__ */_(B,{}):A?/* @__PURE__ */_("div",{className:"my-16 flex flex-col items-center gap-4",children:/* @__PURE__ */_(H,{title:P?.message?.toLowerCase().includes("timed out")?"Request timed out":"Failed to load",description:/* @__PURE__ */_("div",{className:"flex flex-col items-center gap-4",children:[/* @__PURE__ */_(F,{variant:"body2",color:"muted",align:"center",children:P?.message?.toLowerCase().includes("timed out")?"The search took too long to respond. Please try again.":"Something went wrong while loading content."}),/* @__PURE__ */_(ee,{icon:/* @__PURE__ */_(te,{className:"size-5"}),onClick:()=>{X()},children:"Retry"})]})})}):Y?.length<=0?/* @__PURE__ */_("div",{className:"my-16 flex flex-col items-center gap-4",children:/* @__PURE__ */_(H,{title:"No Contents",description:"Check back soon for amazing contents.",iconSvg:/* @__PURE__ */_(ne,{})})}):/* @__PURE__ */_(w,{children:[
31
- /* @__PURE__ */_("div",{ref:b,className:s(ce?"flex w-full justify-center":"",oe?"opacity-0":"opacity-100",le?"scrollbar-hide pointer-events-none transition-opacity duration-300":"pointer-events-auto transition-none","relative size-full overflow-auto"),children:/* @__PURE__ */_(V,{fallback:/* @__PURE__ */_("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4",children:Array.from({length:8}).map((e,t)=>/* @__PURE__ */_(I,{className:"h-72"},t))}),children:/* @__PURE__ */_(je,{event:C,contents:Y,gamConfig:S,singleColumnMode:ce,kioskMode:le,timestampField:v===n.CAPTURE_TIME?"capturedAt":void 0,curateLink:(C?.engagementStyle===p.CONTEST||He(k))&&Ue(C)&&C?.slug?g.CURATE(C.slug):void 0,onChangeFaceUrl:e=>h(e),showQuickSearch:fe})})}),
32
- /* @__PURE__ */_("div",{ref:ge,className:"h-4 w-full","aria-hidden":"true"}),re&&/* @__PURE__ */_("div",{className:"mx-auto my-6 w-fit",children:/* @__PURE__ */_(z,{className:"size-8"})})]}),S&&he.includes("bottom")&&/* @__PURE__ */_(Be,{position:"bottom",gamConfig:S,eventId:C?._id,organizationId:pe})]}),ve&&/* @__PURE__ */_(Ve,{gamConfig:S,eventId:C?._id,organizationId:pe})]})]})};export{$e as default};
28
+ /* @__PURE__ */_("div",{className:"pb-3",children:/* @__PURE__ */_(ye,{})}),S&&pe.includes("top")&&/* @__PURE__ */_(Be,{position:"top",gamConfig:S,eventId:C?._id,organizationId:ve}),
29
+ /* @__PURE__ */_(Pe,{engagementStyle:C?.engagementStyle,disabled:t||M,mode:q,onModeChange:e=>x(e),sort:v,sortOrder:y,onSortChange:e=>T(e),onSortOrderChange:()=>N("asc"===y?"desc":"asc"),handleChange:c,face:d,onFaceImageChange:e=>h(e)}),d&&/* @__PURE__ */_("div",{className:"flex gap-4 py-2",children:[/* @__PURE__ */_("div",{className:"space-y-2",children:[/* @__PURE__ */_(F,{variant:"h4",children:"Searching using"}),/* @__PURE__ */_("img",{src:d,alt:"face",className:"h-32 rounded"})]}),/* @__PURE__ */_("div",{className:"flex flex-col justify-end gap-2",children:/* @__PURE__ */_(ee,{color:"error",icon:/* @__PURE__ */_(u,{className:"size-5"}),onClick:()=>h(void 0),children:"Clear search"})})]}),
30
+ /* @__PURE__ */_("div",{className:"flex items-start gap-4",children:[/* @__PURE__ */_("div",{className:"min-w-0 flex-1",children:[t||M?/* @__PURE__ */_(B,{}):R?/* @__PURE__ */_("div",{className:"my-16 flex flex-col items-center gap-4",children:/* @__PURE__ */_(H,{title:P?.message?.toLowerCase().includes("timed out")?"Request timed out":"Failed to load",description:/* @__PURE__ */_("div",{className:"flex flex-col items-center gap-4",children:[/* @__PURE__ */_(F,{variant:"body2",color:"muted",align:"center",children:P?.message?.toLowerCase().includes("timed out")?"The search took too long to respond. Please try again.":"Something went wrong while loading content."}),/* @__PURE__ */_(ee,{icon:/* @__PURE__ */_(te,{className:"size-5"}),onClick:()=>{X()},children:"Retry"})]})})}):Y?.length<=0?/* @__PURE__ */_("div",{className:"my-16 flex flex-col items-center gap-4",children:/* @__PURE__ */_(H,{title:"No Contents",description:"Check back soon for amazing contents.",iconSvg:/* @__PURE__ */_(ne,{})})}):/* @__PURE__ */_(w,{children:[
31
+ /* @__PURE__ */_("div",{ref:b,className:s(ce?"flex w-full justify-center":"",oe?"opacity-0":"opacity-100",le?"scrollbar-hide pointer-events-none transition-opacity duration-300":"pointer-events-auto transition-none","relative size-full overflow-auto"),children:/* @__PURE__ */_(V,{fallback:/* @__PURE__ */_("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4",children:Array.from({length:8}).map((e,t)=>/* @__PURE__ */_(I,{className:"h-72"},t))}),children:/* @__PURE__ */_(je,{event:C,contents:Y,gamConfig:S,singleColumnMode:ce,kioskMode:le,onLoadMore:he,timestampField:v===n.CAPTURE_TIME?"capturedAt":void 0,curateLink:(C?.engagementStyle===p.CONTEST||He(k))&&Ue(C)&&C?.slug?g.CURATE(C.slug):void 0,onChangeFaceUrl:e=>h(e),showQuickSearch:Te})})}),
32
+ /* @__PURE__ */_("div",{ref:ge,className:"h-4 w-full","aria-hidden":"true"}),re&&/* @__PURE__ */_("div",{className:"mx-auto my-6 w-fit",children:/* @__PURE__ */_(z,{className:"size-8"})})]}),S&&pe.includes("bottom")&&/* @__PURE__ */_(Be,{position:"bottom",gamConfig:S,eventId:C?._id,organizationId:ve})]}),we&&/* @__PURE__ */_(Ve,{gamConfig:S,eventId:C?._id,organizationId:ve})]})]})};export{$e as default};
@@ -1 +1 @@
1
- import{q as t}from"./Cte8DkX6.js";var e='url("https://res.cloudinary.com/dectzk2b2/image/upload/v1736933014/black_rpie3v.png")',n=class{constructor(t){this.backdropOn=!1,this.lightbox=t,this.backgroundElement=null,this.backgroundVideoElement=null,this.referenceVideoElement=null,this.options={toggleBackdropButtonOrder:7},t.on("init",()=>{this.initPswpEvents(t.pswp)})}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 n=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=e,n.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,n.append(t),this.backgroundVideoElement=t}}toggleBackdrop(t){this.backdropOn?(this.backgroundElement.style.backgroundImage=e,this.backgroundVideoElement.style.opacity=0,this.backgroundVideoElement.pause(),this.backdropOn=!1):(this.updateBlurBackground(t),this.backdropOn=!0);const n=this.querySelector("#pswp__icn-hide-backdrop"),o=this.querySelector("#pswp__icn-show-backdrop");n&&(n.style.display=this.backdropOn?"none":"inline"),o&&(o.style.display=this.backdropOn?"inline":"none")}updateBlurBackground(n){const o=n.currSlide;if(o?.data)if("video"===o.data.type){const t=this.backgroundVideoElement,e=o.content.element;"video"===e?.tagName?.toLowerCase()&&(this.referenceVideoElement=e,this.registerVideoEvents(e,t)),t.style.opacity=0,setTimeout(()=>{t.src=o.data.src,t.load(),this.initBackgroundVideo(),t.style.opacity=1},500),this.backgroundElement&&(this.backgroundElement.style.opacity=0)}else{if(this.backgroundElement){const n=((e,n=32,o=32)=>{if(!e||e.length<6||"undefined"==typeof document)return null;try{const i=t(e,n,o),s=document.createElement("canvas");s.width=n,s.height=o;const r=s.getContext("2d");if(!r)return null;const a=r.createImageData(n,o);return a.data.set(i),r.putImageData(a,0,0),s.toDataURL()}catch(i){return console.warn("[PhotoSwipeBackdrop] Failed to decode blurhash:",i),null}})(o.data.blurhash)||o.data.thumbnailUrl||o.data.src;this.backgroundElement.style.backgroundImage=n?`url("${n}")`:e,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})}};export{n as default};
1
+ import{q as t}from"./Cr5o77zq.js";var e='url("https://res.cloudinary.com/dectzk2b2/image/upload/v1736933014/black_rpie3v.png")',n=class{constructor(t){this.backdropOn=!1,this.lightbox=t,this.backgroundElement=null,this.backgroundVideoElement=null,this.referenceVideoElement=null,this.options={toggleBackdropButtonOrder:7},t.on("init",()=>{this.initPswpEvents(t.pswp)})}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 n=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=e,n.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,n.append(t),this.backgroundVideoElement=t}}toggleBackdrop(t){this.backdropOn?(this.backgroundElement.style.backgroundImage=e,this.backgroundVideoElement.style.opacity=0,this.backgroundVideoElement.pause(),this.backdropOn=!1):(this.updateBlurBackground(t),this.backdropOn=!0);const n=this.querySelector("#pswp__icn-hide-backdrop"),o=this.querySelector("#pswp__icn-show-backdrop");n&&(n.style.display=this.backdropOn?"none":"inline"),o&&(o.style.display=this.backdropOn?"inline":"none")}updateBlurBackground(n){const o=n.currSlide;if(o?.data)if("video"===o.data.type){const t=this.backgroundVideoElement,e=o.content.element;"video"===e?.tagName?.toLowerCase()&&(this.referenceVideoElement=e,this.registerVideoEvents(e,t)),t.style.opacity=0,setTimeout(()=>{t.src=o.data.src,t.load(),this.initBackgroundVideo(),t.style.opacity=1},500),this.backgroundElement&&(this.backgroundElement.style.opacity=0)}else{if(this.backgroundElement){const n=((e,n=32,o=32)=>{if(!e||e.length<6||"undefined"==typeof document)return null;try{const i=t(e,n,o),s=document.createElement("canvas");s.width=n,s.height=o;const r=s.getContext("2d");if(!r)return null;const a=r.createImageData(n,o);return a.data.set(i),r.putImageData(a,0,0),s.toDataURL()}catch(i){return console.warn("[PhotoSwipeBackdrop] Failed to decode blurhash:",i),null}})(o.data.blurhash)||o.data.thumbnailUrl||o.data.src;this.backgroundElement.style.backgroundImage=n?`url("${n}")`:e,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})}};export{n as default};