@qratilabs/qrati-connect 2.5.0 → 2.5.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 (56) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/element/{AuthLayout-EC2U3nsK.js → AuthLayout-IGFGeMq5.js} +1 -1
  3. package/element/{ContentsPage-BGtOyWxg.js → ContentsPage-Bu42OF-F.js} +1 -1
  4. package/element/{CuratePage-BLa771HN.js → CuratePage-CBMluidb.js} +1 -1
  5. package/element/{Dialog-D3m_eBiJ.js → Dialog-DVSvxBn8.js} +1 -1
  6. package/element/{DotLottiePlayer-FgGW1IR7.js → DotLottiePlayer-DHVhIw5H.js} +1 -1
  7. package/element/{EventHeaderAdminButtons-CW2SupWX.js → EventHeaderAdminButtons-zE3NbEUA.js} +1 -1
  8. package/element/{FolderBreadcrumb-CUpIfUTx.js → FolderBreadcrumb-1w72I1FP.js} +1 -1
  9. package/element/{ForgotPasswordPage-Cd0Oj-RE.js → ForgotPasswordPage-CIw8RrkZ.js} +1 -1
  10. package/element/{InputField-B_y35j-5.js → InputField-XP30segE.js} +1 -1
  11. package/element/{LazyLoadImage-CQL8-B3z.js → LazyLoadImage-n94OUygV.js} +1 -1
  12. package/element/{LeaderboardPage-BRBrFWpp.js → LeaderboardPage-CGuP207i.js} +1 -1
  13. package/element/{LoginPage-Ba9HTjV1.js → LoginPage-B15CMpYe.js} +1 -1
  14. package/element/{NCMVHL6D-CCAMoHuQ.js → NCMVHL6D-D_O5jdHL.js} +1 -1
  15. package/element/{PublicEvents-CddoYNW6.js → PublicEvents-DOp9N4xU.js} +1 -1
  16. package/element/{RegisterPage-DZGdPdu_.js → RegisterPage-D-6uVKjj.js} +1 -1
  17. package/element/{SocialLoginButton-BSK0uHQy.js → SocialLoginButton-BuZ03WV-.js} +1 -1
  18. package/element/{UploadPage-6k9f8u8c.js → UploadPage-Dhjmh06j.js} +1 -1
  19. package/element/{VideoPlayer-B6NcsNiP.js → VideoPlayer-cWSLl4fO.js} +1 -1
  20. package/element/element.es.js +1 -1
  21. package/element/{heic2any-JTWseCtt.js → heic2any-Dui1sz1X.js} +1 -1
  22. package/element/{index-Dq8XMn-B.js → index-DsN-W6V_.js} +1 -1
  23. package/element/{index-jVkC2DYJ.js → index-jzNVBihK.js} +1 -1
  24. package/element/{index.esm-mRBXJrk0.js → index.esm-CsbPHPGO.js} +1 -1
  25. package/element/{photoswipe-BdJR2C9a.js → photoswipe-5mcef1lI.js} +1 -1
  26. package/element/styles.css +1 -1
  27. package/element/{tslib.es6-CT89L4O4.js → tslib.es6-Dp_1P0Dk.js} +1 -1
  28. package/element/{useOrgAccess-DHToEbG_.js → useOrgAccess-B1cbGHT_.js} +1 -1
  29. package/element/web.es.js +1 -1
  30. package/package.json +1 -1
  31. package/react/{DPgWGmoG.js → 6xRxF6pz.js} +1 -1
  32. package/react/{BEzP8sbl.js → BZvhXg2G.js} +1 -1
  33. package/react/{BDeLdfbp.js → BaA7RHRf.js} +1 -1
  34. package/react/{CImTSnHg.js → Bebe5T7J.js} +1 -1
  35. package/react/{B5w5BP6w.js → C565I04Q.js} +1 -1
  36. package/react/{DPeVo4aL.js → CE-MbwCB.js} +1 -1
  37. package/react/{DH_wlDkr.js → CIlaT7eJ.js} +1 -1
  38. package/react/{JfRXqbqu.js → CS7icy9d.js} +1 -1
  39. package/react/{BUZq1uY0.js → Cp86U6va.js} +1 -1
  40. package/react/{LF1Cet66.js → Cv7EiFQU.js} +1 -1
  41. package/react/{eUvYQTPt.js → D1emifDo.js} +1 -1
  42. package/react/{BwHqpHe9.js → DPtqYlwJ.js} +1 -1
  43. package/react/{DcQdnYr8.js → DS2UD7gV.js} +1 -1
  44. package/react/{CYoLgOTC.js → DZitaH5o.js} +1 -1
  45. package/react/{CQHQocew.js → DjmC7CGh.js} +1 -1
  46. package/react/{BYYb8zAx.js → DwNWOPAY.js} +1 -1
  47. package/react/{6z8qI7He.js → Dyk2_V8r.js} +1 -1
  48. package/react/{CldWPPzn.js → LMErjmPc.js} +1 -1
  49. package/react/{BeDQQM0T.js → VOx0knsi.js} +1 -1
  50. package/react/{C-Ri1Eh9.js → W8TabW9M.js} +1 -1
  51. package/react/{CtX-oYOP.js → cWB0y40v.js} +1 -1
  52. package/react/index.es.js +1 -1
  53. package/react/{U9LCogz5.js → jM4FWKDA.js} +1 -1
  54. package/react/styles.css +1 -1
  55. package/react/{D464cx8y.js → vmkon26e.js} +1 -1
  56. package/umd/web.umd.js +2 -2
@@ -1 +1 @@
1
- import{j as e,c as r,T as t,_ as a,d as c,b as s,u as n,H as i,k as o,i as l,$ as d,S as m,h as q,N as h,P as u,E as g,w as p,J as x,g as f,a0 as v,I as j}from"./BDeLdfbp.js";import{useState as b,useEffect as y,lazy as N,Fragment as w}from"react";import{D as k,a as E,b as I,c as _,d as C}from"./DH_wlDkr.js";import{L as $}from"./DcQdnYr8.js";import{V as S}from"./CQHQocew.js";const T=(e,r)=>`${Number.parseFloat(e?.toFixed(r)??0)}`,A=(e,r)=>{switch(Math.floor(Math.abs(e-r))){case 0:return"qc:bg-green-500";case 1:return"qc:bg-lime-500";case 2:return"qc:bg-yellow-500";case 3:return"qc:bg-orange-500";case 4:return"qc:bg-red-500";default:return"qc:bg-background-500"}},O=(e,r)=>{switch(Math.floor(Math.abs(e-r))){case 0:return"qc:border-t-green-500";case 1:return"qc:border-t-lime-500";case 2:return"qc:border-t-yellow-500";case 3:return"qc:border-t-orange-500";case 4:return"qc:border-t-red-500";default:return"qc:border-t-color-500"}},z=({position:r,maxPosition:t=4,content:a,isOverlapping:c,colorclsx:s,borderColorclsx:n})=>{const i=r/t*100;let o="qc:transform qc:-translate-x-1/2 qc:left-1/2";r<2?o="qc:left-0":r>3&&(o="qc:right-0 qc:transform qc:-translate-x-full");const l=c?"qc:-top-1.5":"qc:bottom-full";return e.jsxs("div",{className:"qc:relative",children:[e.jsx("div",{style:{left:`${i}%`},className:`qc:absolute ${l} qc:text-primary-foreground qc:mb-0.5 qc:w-fit qc:whitespace-nowrap qc:rounded-md qc:px-2 qc:py-1 qc:text-sm qc:md:mb-1 ${o} qc:transition-all qc:duration-500 qc:ease-in-out ${s}`,children:a}),e.jsx("div",{style:{left:`${i}%`},className:`qc:absolute ${l} qc:-mb-1.5 qc:size-0 qc:border-x-4 qc:border-t-[1rem] qc:border-transparent ${o} qc:transition-all qc:duration-500 qc:ease-in-out ${n}`})]})},R=t=>{const{crowdScore:a,userScore:c}=t,[s,n]=b(0);y(()=>{setTimeout(()=>{n(c-1)},300)},[c]);const i=a-1,o=c-1,l=Math.abs(i-o)<1;return e.jsxs("div",{className:r("qc:relative qc:h-4",l?"qc:mb-3":"qc:mb-0"),children:[e.jsx("div",{className:"qc:absolute qc:top-1/2 qc:h-0.5 qc:w-full qc:bg-border-primary-light"}),e.jsx("div",{style:{left:(i<s?i:s)/4*100+"%",right:`calc(100% - ${(i<s?s:i)/4*100}%)`},className:r("qc:absolute qc:top-1/2 qc:h-1 qc:rounded",A(i,o))}),e.jsx(z,{position:i,content:`crowd · ${T(a,1)}`,isOverlapping:!1,colorclsx:"qc:bg-primary",borderColorclsx:"qc:border-t-primary"}),e.jsx(z,{position:s,content:`you · ${T(c,1)}`,isOverlapping:l,colorclsx:A(i,o),borderColorclsx:O(i,o)})]})},P=N(()=>import("./DwbNwe-K.js").then(e=>e.i)),F=N(()=>import("./6z8qI7He.js")),M=({feedback:r})=>{const a="#374151",[c,s]=b(10);return y(()=>{const e=(r?.parameters||[]).reduce((e,r)=>e+Math.abs(parseFloat(r.crowdRating)-parseFloat(r.userRating)),0);s(e.toFixed?e.toFixed(2):0)},[r]),r?e.jsxs("div",{className:"qc:w-full",children:[r.rateCount<=0&&e.jsxs("div",{className:"qc:-mt-4 qc:mb-4 qc:flex qc:flex-col qc:items-center",children:[e.jsx(F,{className:"qc:h-auto qc:w-72 qc:sm:h-72 qc:sm:w-auto",src:"https://res.cloudinary.com/dxtjlcra0/raw/upload/v1740374960/star-explode_h2nytb.lottie",autoplay:!0,loop:!0}),e.jsx(t,{variant:"h5",align:"center",children:"Congratulations! You are the first to rate"})]}),r.rateCount>0&&e.jsxs("div",{className:"qc:mt-4",children:[(r.parameters||[]).map(r=>e.jsxs("div",{className:"qc:mt-4 qc:space-y-4",children:[e.jsx(t,{variant:"h5",children:r.name}),e.jsx(R,{crowdScore:parseFloat(r.crowdRating),userScore:parseFloat(r.userRating)})]},r.name)),e.jsxs("div",{className:"qc:mt-4 qc:flex qc:w-full qc:flex-col qc:items-center",children:[e.jsx(P,{nrOfLevels:10,percent:(10-c)/10,colors:["#ef4444","#22c55e"],textColor:a,needleColor:a,needleBaseColor:a}),e.jsx(t,{variant:"h6",children:"Alignment with crowd"})]})]})]}):null},U=N(()=>import("./6z8qI7He.js")),B=({parameter:c,selected:s,onChange:n,showValues:i=!0})=>e.jsxs("div",{className:"qc:mb-8 qc:flex qc:w-full qc:flex-col qc:gap-2 qc:lg:mb-12 qc:lg:gap-4",children:[e.jsx(t,{variant:"h4",className:"qc:text-center qc:font-semibold qc:text-primary-light qc:md:text-left",children:c.name}),e.jsx("div",{className:"qc:grid qc:w-full qc:grid-cols-5 qc:gap-1 qc:lg:gap-2",children:(c.tooltips||[]).map(t=>{const o=`${c._id}-option-${t.value}`;return e.jsxs("div",{children:[e.jsxs("button",{type:"button",className:r("qc:border-primary qc:shadow-outer qc:flex qc:size-full qc:min-h-12 qc:items-center qc:justify-center qc:rounded qc:border qc:transition-all qc:duration-100 qc:active:scale-90",s===t.value?"qc:bg-primary":"qc:bg-background"),onClick:()=>{s!==t.value&&n?.(t.value)},children:[c.mode===a.TEXT&&e.jsx("div",{className:r("qc:p-1 qc:text-center qc:text-xs qc:font-semibold qc:md:p-2 qc:md:text-base",s===t.value?"qc:text-primary-foreground":"qc:text-foreground"),children:t.label}),c.mode===a.IMAGE&&e.jsx("img",{className:"qc:h-12 qc:w-auto qc:rounded-md qc:object-contain qc:lg:h-16",src:t.imageUrl,alt:t.value}),c.mode===a.LOTTIE&&e.jsx(U,{className:"qc:h-16 qc:w-auto qc:rounded-md qc:object-contain qc:lg:h-24",src:t.imageUrl,autoplay:!0,loop:!0})]}),i&&e.jsx("div",{className:"qc:mt-1 qc:w-full qc:text-center",children:e.jsx("span",{className:"qc:text-foreground qc:inline-flex qc:items-center qc:px-2 qc:py-[0.0625] qc:text-xs qc:font-medium qc:md:px-3 qc:md:py-0.5",children:t.value})})]},o)})})]});var L,D,G=function(e,r){var t="function"==typeof Symbol&&e[Symbol.iterator];if(!t)return e;var a,c,s=t.call(e),n=[];try{for(;(void 0===r||r-- >0)&&!(a=s.next()).done;)n.push(a.value)}catch(e){c={error:e}}finally{try{a&&!a.done&&(t=s.return)&&t.call(s)}finally{if(c)throw c.error}}return n};function V(e,r,t,a,c,s,n,i,o,l,d){var m,q,h,u;if(0!==n)if(n!==t-r+(s-c)){for(var g=t-r,p=s-c,x=Math.floor(p/2),f={},v=-n-1;v<=n+1;++v)f[v]={d:1/0,segments:0,direct:L.none};for(var j=((m={})[-n-1]={d:1/0,segments:0,direct:L.none},m[n+1]={d:1/0,segments:0,direct:L.none},m),b=0;b<=x;++b){q=G([j,f],2),f=q[0],j=q[1];var y=function(t){var s=b+t;if(0===b&&0===s)return f[t]={d:0,segments:0,direct:i},"continue";var n=[{direct:L.horizontal,d:f[t-1].d+1,segments:f[t-1].segments+(f[t-1].direct&L.horizontal?0:1)},{direct:L.vertical,d:j[t+1].d+1,segments:j[t+1].segments+(j[t+1].direct&L.vertical?0:1)}];s>0&&s<=g&&b>0&&b<=p&&l(e[r+s-1],a[c+b-1])&&n.push({direct:L.diagonal,d:j[t].d,segments:j[t].segments+(j[t].direct&L.diagonal?0:1)});var o=n.reduce(function(e,r){return e.d>r.d||e.d===r.d&&e.segments>r.segments?r:e});n.forEach(function(e){o.d===e.d&&o.segments===e.segments&&(o.direct|=e.direct)}),f[t]=o};for(v=-n;v<=n;++v)y(v)}var N={};for(v=-n-1;v<=n+1;++v)N[v]={d:1/0,segments:0,direct:L.none};var w=((h={})[-n-1]={d:1/0,segments:0,direct:L.none},h[n+1]={d:1/0,segments:0,direct:L.none},h);for(b=p;b>=x;--b){u=G([w,N],2),N=u[0],w=u[1];var k=function(t){var s=b+t;if(b===p&&s===g)return N[t]={d:0,segments:0,direct:o},"continue";var n=[{direct:L.horizontal,d:N[t+1].d+1,segments:N[t+1].segments+(N[t+1].direct&L.horizontal?0:1)},{direct:L.vertical,d:w[t-1].d+1,segments:w[t-1].segments+(w[t-1].direct&L.vertical?0:1)}];s>=0&&s<g&&b>=0&&b<p&&l(e[r+s],a[c+b])&&n.push({direct:L.diagonal,d:w[t].d,segments:w[t].segments+(w[t].direct&L.diagonal?0:1)});var i=n.reduce(function(e,r){return e.d>r.d||e.d===r.d&&e.segments>r.segments?r:e});n.forEach(function(e){i.d===e.d&&i.segments===e.segments&&(i.direct|=e.direct)}),N[t]=i};for(v=n;v>=-n;--v)k(v)}var E={k:-1,d:1/0,segments:0,direct:L.none};for(v=-n;v<=n;++v){var I=f[v].d+N[v].d;if(I<E.d)E.k=v,E.d=I,E.segments=f[v].segments+N[v].segments+(f[v].segments&N[v].segments?0:1),E.direct=N[v].direct;else if(I===E.d){var _=f[v].segments+N[v].segments+(f[v].segments&N[v].segments?0:1);(_<E.segments||_===E.segments&&!(E.direct&L.diagonal)&&N[v].direct&L.diagonal)&&(E.k=v,E.d=I,E.segments=_,E.direct=N[v].direct)}}x+E.k===0&&0===x&&(x++,f[E.k].direct=N[E.k].direct,N[E.k].direct=w[E.k].direct),V(e,r,r+x+E.k,a,c,c+x,f[E.k].d,i,N[E.k].direct,l,d),V(e,r+x+E.k,t,a,c+x,s,N[E.k].d,f[E.k].direct,o,l,d)}else(i&L.horizontal?1:0)+(o&L.vertical?1:0)>=(i&L.vertical?1:0)+(o&L.horizontal?1:0)?(r!==t&&d("remove",e,r,t,a,c,c),c!==s&&d("add",e,t,t,a,c,s)):(c!==s&&d("add",e,r,r,a,c,s),r!==t&&d("remove",e,r,t,a,s,s));else d("same",e,r,t,a,c,s)}function W(e,r,t,a){var c=function(e,r,t){for(var a=e.length,c=r.length,s=a+c,n={1:0},i=0;i<=s;++i)for(var o=-i;o<=i;o+=2){for(var l=void 0,d=(l=o===-i||o!==i&&n[o-1]+1<n[o+1]?n[o+1]:n[o-1]+1)-o;l<a&&d<c&&t(e[l],r[d]);)l++,d++;if(l===a&&d===c)return i;n[o]=l}return-1}(e,r,t);V(e,0,e.length,r,0,r.length,c,L.diagonal,L.all,t,a)}(D=L||(L={}))[D.none=0]="none",D[D.horizontal=1]="horizontal",D[D.vertical=2]="vertical",D[D.diagonal=4]="diagonal",D[D.all=7]="all";const Y=()=>{const r=c(),{eventSlug:a,contentId:j}=s(),{props:{organizationId:N,loginUrl:T},user:A,loadingUser:O,organization:z}=n(),[R,P]=b(!1),[F,U]=b(null),[L,D]=b([]),[G,V]=b(null),[Y,J]=b("contain"),[X,K]=b({}),[Q,Z]=b(null),[ee,re]=b(!1),[te,ae]=b(!0),[ce,se]=b(null),{loading:ne,event:ie,parameters:oe}=i({eventSlug:a});y(()=>{ie&&A&&de(ie._id)},[ie,A]);const le=z?.navigationSettings?.showAIDescription,de=async e=>{P(!0);try{const r=await o.get(l.CONTENT_FOR_CURATION,{headers:{"x-org-id":N,Authorization:A?`Bearer ${A.token}`:void 0},searchParams:{eventId:e,page:1,limit:10,includeDescription:le}}).json();if(r.error)throw new Error(r.error);const t=j?r.data.filter(e=>e._id!==j):r.data;let a,c=t;if(j){const e=await o.get(l.ELIGIBLE_TO_CURATE,{headers:{"x-org-id":N,Authorization:A?`Bearer ${A.token}`:void 0},searchParams:{contentId:j,includeDescription:le}}).json();if(e.error)throw new Error(e.error);const r=e.data;c=r?[r,...t]:t||[],a=r&&r.userId===A?._id?"Sorry, you cannot rate your own content":r&&r.ratingStatus===d.CURATED?"Sorry, you have already rated this photo.":null}const s=await o.get(l.GET_EVENT_POINTS,{headers:{"x-org-id":N,Authorization:A?`Bearer ${A.token}`:void 0},searchParams:{eventId:e}}).json();if(s.error)throw new Error(s.error);V(s.data),D(c),U(a)}catch(e){console.error("Failed to fetch contents",e)}P(!1)},me=async e=>{try{const r=await o.get(l.CONTENT_FOR_CURATION,{headers:{"x-org-id":N,Authorization:A?`Bearer ${A.token}`:void 0},searchParams:{eventId:ie?._id,page:1,limit:10,includeDescription:le}});if(r.error)throw new Error(r.error);if(r?.data?.length>0){const t=function(e,r,t){void 0===t&&(t=function(e,r){return e===r});var a={removed:[],added:[]};return W(e,r,t,function(e,r,t,c,s,n,i){if("add"===e)for(var o=n;o<i;++o)a.added.push(s[o]);else if("remove"===e)for(o=t;o<c;++o)a.removed.push(r[o])}),a}(e,r.data,(e,r)=>e._id===r._id),a=[...e,...t.added];D(a)}}catch(e){console.error(e)}},qe=()=>{const e=L.slice(1);U(null),Z(null),K({}),e.length===v?me(e):D(e),ae(!0)};if(O)return e.jsx(m,{className:"qc:mx-auto qc:h-6 qc:w-64"});if(!A){if(!z.customAuth)return e.jsx(h,{to:u.LOGIN,state:{referrer:r.pathname}});if(!T)return e.jsx(q,{title:"Please login to upload content"});window.history.pushState({},"",T)}return e.jsx("div",{className:"qc:min-h-[80vh] qc:bg-background",children:R||ne?e.jsxs("div",{className:"qc:mt-8 qc:grid qc:grid-cols-1 qc:gap-6 qc:md:grid-cols-2",children:[e.jsx(m,{className:"qc:h-64 qc:w-full qc:md:h-[30rem] qc:md:max-h-screen qc:md:rounded"}),e.jsx("div",{className:"qc:space-y-8",children:Array.from({length:2}).map((r,t)=>e.jsxs("div",{className:"qc:space-y-4",children:[e.jsx(m,{className:"qc:h-8 qc:w-36"}),e.jsx("div",{className:"qc:flex qc:w-full qc:gap-4",children:Array.from({length:5}).map((r,t)=>e.jsx(m,{className:"qc:h-24 qc:w-full qc:sm:h-32"},t))})]},t))})]}):e.jsxs("div",{className:"qc:lg:mt-8",children:[ie?.status===g.CLOSED&&e.jsx(t,{variant:"h3",color:"primary",align:"center",children:"Event is now closed. Thank you for participating!"}),ie?.status===g.OPEN&&L.length<=0&&e.jsx(t,{variant:"h3",color:"primary",align:"center",children:"No content to rate. Please find another event to rate contents."}),ie?.status===g.OPEN&&L.length>0&&e.jsxs("div",{children:[!(oe?.length<=0&&le)&&e.jsxs("div",{className:"qc:flex qc:w-full qc:items-center qc:justify-between",children:[e.jsxs(t,{variant:"h4",children:["Rate this ",L[0].type===p.IMAGE?"image":"video"]}),e.jsxs(t,{variant:"h4",children:[ie?.pointName,":"," ",e.jsx("span",{className:"qc:text-primary",children:G.upload+G.curate})]})]}),e.jsxs("div",{className:"qc:grid qc:grid-cols-1 qc:gap-6 qc:md:grid-cols-2",children:[e.jsxs("div",{className:"qc:relative qc:mt-4 qc:w-full",children:[L[0].type===p.IMAGE&&e.jsx(w,{children:e.jsx($,{sizeMode:Y,src:L[0].url,alt:L[0].caption,blurhash:L[0].blurhash,wrapperClassName:"qc:w-full qc:h-60 qc:md:h-[30rem] qc:md:max-h-screen qc:md:rounded"})}),L[0].type===p.VIDEO&&e.jsx("div",{className:"qc:mx-auto qc:h-80 qc:w-fit qc:overflow-hidden qc:rounded qc:sm:h-[30rem]",children:e.jsx(S,{fit:Y,src:L[0].url,loop:!0,playing:te,volume:0,muted:!0,onPlay:()=>ae(!0),onPause:()=>ae(!1),onEnd:()=>ae(!1)})}),L[0].caption&&L[0].caption.length>0&&e.jsx("div",{className:"qc:bg-background qc:absolute qc:bottom-0 qc:w-full qc:bg-opacity-75 qc:p-2",children:e.jsx(t,{variant:"body3",lines:"2",children:L[0].caption})}),L.length>1&&e.jsx("img",{style:{display:"none"},src:L[1].url,alt:"Next image"})]}),e.jsxs("div",{className:"qc:px-2 qc:md:px-4",children:[!F&&oe&&oe.map(r=>e.jsx(B,{parameter:r,selected:X[r._id],onChange:e=>K({...X,[r._id]:e})},r._id)),ce&&oe?.length>0&&e.jsx(t,{variant:"h5",color:"error",children:ce}),F&&oe?.length>0&&e.jsx("div",{className:"qc:sm:pt-16",children:e.jsx(t,{variant:"h5",color:"error",align:"center",children:F})}),oe?.length>0&&e.jsx(x,{type:"button",color:"primary",className:"qc:mt-4 qc:w-full",disabled:ee,loading:ee,icon:"material-symbols:check-rounded",onClick:F?qe:async()=>{if(oe.length<1)return void se("no parameters found");if(Object.keys(X).length<oe.length)return void se("please select your ratings");se(null),re(!0);const e=await o.post(l.CURATE_CONTENT,{headers:{"x-org-id":N,Authorization:A?`Bearer ${A.token}`:void 0},json:{eventId:ie._id,contentId:L[0]._id,parameterCount:oe.length,userRatings:oe.map(e=>({parameterId:e._id,weight:e.weight,rate:X[e._id]})),inappropriate:""}}).json();if(e.error)se(e.error);else{const r=e.data,t=r.crowdRatings||{},a={parameters:oe.map(e=>({name:e.name,crowdRating:t[e._id],userRating:r.ratings?.find(r=>r.parameterId===e._id)?.rate})),similarity:r.similarity||null,points:r.points||0,rateCount:r.rateCount||0};Z(a);const c={...G};c.curate+=ie.activityScores.curate,V(c)}re(!1)},children:F?"Rate Next Image":ee?"Rating...":"Submit"}),L?.length>0&&le&&e.jsx(H,{summary:L[0].contentSummary,url:L[0].url})]})]}),e.jsx("div",{className:"qc:mt-16",children:e.jsx(f,{to:u.GALLERY(a),state:{internalNavigation:!0},children:e.jsx(t,{color:"primary",variant:"h5",align:"center",children:"Goto gallery"})})})]}),e.jsx(k,{open:!!Q,onOpenChange:e=>!e&&qe(),children:e.jsxs(E,{children:[e.jsxs(I,{children:[e.jsxs(_,{className:"qc:hidden",children:[ie?.pointName,": ",G?.upload+G?.curate]}),e.jsx(C,{className:"qc:hidden",children:"We are here to help you"})]}),e.jsxs("div",{className:"qc:w-full qc:space-y-3 qc:px-3 qc:pb-6 qc:lg:px-6",children:[e.jsx(M,{feedback:Q}),e.jsx(x,{fullWidth:!0,color:"primary",onClick:qe,children:"Next"})]})]})})]})})},H=({summary:r,url:a})=>e.jsxs("div",{className:"qc:w-full",children:[r?.subject&&e.jsx(t,{variant:"h3",className:"qc:mb-4",align:"center",children:r?.subject}),r?.labels&&e.jsx("div",{className:"qc:space-y-2",children:Object.entries(r?.labels).filter(([e,r])=>Array.isArray(r)&&r.length>0).map(([r,a])=>e.jsxs("div",{className:"",children:[e.jsx(t,{variant:"h4",className:"qc:mb-2 qc:font-semibold qc:capitalize",children:r.replace("_"," ")}),e.jsx("ul",{className:"qc:space-y-1 qc:pl-2",children:a.map((r,a)=>e.jsxs("li",{className:"qc:flex qc:items-center qc:gap-2",children:[e.jsx(j,{name:"material-symbols:check-circle-outline",className:"qc:text-primary"}),e.jsx(t,{variant:"body1",children:r}),e.jsx("a",{href:`https://www.google.com/search?q=${encodeURIComponent(r)}`,target:"_blank",rel:"noopener noreferrer",className:"qc:ml-2",children:e.jsx(x,{variant:"outlined",icon:"flat-color-icons:google",children:e.jsx(j,{name:"material-symbols:open-in-new-rounded",size:"sm"})})})]},a))})]},r))}),r?.description&&e.jsxs(w,{children:[e.jsx("hr",{className:"qc:my-4 qc:lg:my-8"}),e.jsx(t,{variant:"body2",children:r?.description})]}),e.jsx("div",{className:"qc:mt-4 qc:flex qc:justify-center qc:lg:mt-8",children:e.jsx("a",{target:"_blank",href:`https://www.bing.com/images/search?view=detailv2&iss=SBI&form=SBIIRP&sbisrc=UrlPaste&q=imgurl:${a}&idpbck=1&selectedindex=0&id=${a}&mediaurl=${a}&exph=480&expw=640&vt=3&sim=11&cal=0&cab=1&cat=0&car=1`,rel:"noopener noreferrer",children:e.jsx(x,{icon:"logos:bing",variant:"outlined",color:"info",children:"Search on Bing"})})}),r&&e.jsx(t,{variant:"caption",align:"center",color:"secondary",className:"qc:mt-4 qc:lg:mt-8",children:"These are AI generated summaries based on the content. Please verify the information before using it."})]});export{Y as default};
1
+ import{j as e,c as r,T as t,_ as a,d as c,b as s,u as n,H as i,k as o,i as l,$ as d,S as m,h as q,N as h,P as u,E as g,w as p,J as x,g as f,a0 as v,I as j}from"./BaA7RHRf.js";import{useState as b,useEffect as y,lazy as N,Fragment as w}from"react";import{D as k,a as E,b as I,c as _,d as C}from"./CIlaT7eJ.js";import{L as $}from"./DS2UD7gV.js";import{V as S}from"./DjmC7CGh.js";const T=(e,r)=>`${Number.parseFloat(e?.toFixed(r)??0)}`,A=(e,r)=>{switch(Math.floor(Math.abs(e-r))){case 0:return"qc:bg-green-500";case 1:return"qc:bg-lime-500";case 2:return"qc:bg-yellow-500";case 3:return"qc:bg-orange-500";case 4:return"qc:bg-red-500";default:return"qc:bg-background-500"}},O=(e,r)=>{switch(Math.floor(Math.abs(e-r))){case 0:return"qc:border-t-green-500";case 1:return"qc:border-t-lime-500";case 2:return"qc:border-t-yellow-500";case 3:return"qc:border-t-orange-500";case 4:return"qc:border-t-red-500";default:return"qc:border-t-color-500"}},z=({position:r,maxPosition:t=4,content:a,isOverlapping:c,colorclsx:s,borderColorclsx:n})=>{const i=r/t*100;let o="qc:transform qc:-translate-x-1/2 qc:left-1/2";r<2?o="qc:left-0":r>3&&(o="qc:right-0 qc:transform qc:-translate-x-full");const l=c?"qc:-top-1.5":"qc:bottom-full";return e.jsxs("div",{className:"qc:relative",children:[e.jsx("div",{style:{left:`${i}%`},className:`qc:absolute ${l} qc:text-primary-foreground qc:mb-0.5 qc:w-fit qc:whitespace-nowrap qc:rounded-md qc:px-2 qc:py-1 qc:text-sm qc:md:mb-1 ${o} qc:transition-all qc:duration-500 qc:ease-in-out ${s}`,children:a}),e.jsx("div",{style:{left:`${i}%`},className:`qc:absolute ${l} qc:-mb-1.5 qc:size-0 qc:border-x-4 qc:border-t-[1rem] qc:border-transparent ${o} qc:transition-all qc:duration-500 qc:ease-in-out ${n}`})]})},R=t=>{const{crowdScore:a,userScore:c}=t,[s,n]=b(0);y(()=>{setTimeout(()=>{n(c-1)},300)},[c]);const i=a-1,o=c-1,l=Math.abs(i-o)<1;return e.jsxs("div",{className:r("qc:relative qc:h-4",l?"qc:mb-3":"qc:mb-0"),children:[e.jsx("div",{className:"qc:absolute qc:top-1/2 qc:h-0.5 qc:w-full qc:bg-border-primary-light"}),e.jsx("div",{style:{left:(i<s?i:s)/4*100+"%",right:`calc(100% - ${(i<s?s:i)/4*100}%)`},className:r("qc:absolute qc:top-1/2 qc:h-1 qc:rounded",A(i,o))}),e.jsx(z,{position:i,content:`crowd · ${T(a,1)}`,isOverlapping:!1,colorclsx:"qc:bg-primary",borderColorclsx:"qc:border-t-primary"}),e.jsx(z,{position:s,content:`you · ${T(c,1)}`,isOverlapping:l,colorclsx:A(i,o),borderColorclsx:O(i,o)})]})},P=N(()=>import("./DwbNwe-K.js").then(e=>e.i)),F=N(()=>import("./Dyk2_V8r.js")),M=({feedback:r})=>{const a="#374151",[c,s]=b(10);return y(()=>{const e=(r?.parameters||[]).reduce((e,r)=>e+Math.abs(parseFloat(r.crowdRating)-parseFloat(r.userRating)),0);s(e.toFixed?e.toFixed(2):0)},[r]),r?e.jsxs("div",{className:"qc:w-full",children:[r.rateCount<=0&&e.jsxs("div",{className:"qc:-mt-4 qc:mb-4 qc:flex qc:flex-col qc:items-center",children:[e.jsx(F,{className:"qc:h-auto qc:w-72 qc:sm:h-72 qc:sm:w-auto",src:"https://res.cloudinary.com/dxtjlcra0/raw/upload/v1740374960/star-explode_h2nytb.lottie",autoplay:!0,loop:!0}),e.jsx(t,{variant:"h5",align:"center",children:"Congratulations! You are the first to rate"})]}),r.rateCount>0&&e.jsxs("div",{className:"qc:mt-4",children:[(r.parameters||[]).map(r=>e.jsxs("div",{className:"qc:mt-4 qc:space-y-4",children:[e.jsx(t,{variant:"h5",children:r.name}),e.jsx(R,{crowdScore:parseFloat(r.crowdRating),userScore:parseFloat(r.userRating)})]},r.name)),e.jsxs("div",{className:"qc:mt-4 qc:flex qc:w-full qc:flex-col qc:items-center",children:[e.jsx(P,{nrOfLevels:10,percent:(10-c)/10,colors:["#ef4444","#22c55e"],textColor:a,needleColor:a,needleBaseColor:a}),e.jsx(t,{variant:"h6",children:"Alignment with crowd"})]})]})]}):null},U=N(()=>import("./Dyk2_V8r.js")),B=({parameter:c,selected:s,onChange:n,showValues:i=!0})=>e.jsxs("div",{className:"qc:mb-8 qc:flex qc:w-full qc:flex-col qc:gap-2 qc:lg:mb-12 qc:lg:gap-4",children:[e.jsx(t,{variant:"h4",className:"qc:text-center qc:font-semibold qc:text-primary-light qc:md:text-left",children:c.name}),e.jsx("div",{className:"qc:grid qc:w-full qc:grid-cols-5 qc:gap-1 qc:lg:gap-2",children:(c.tooltips||[]).map(t=>{const o=`${c._id}-option-${t.value}`;return e.jsxs("div",{children:[e.jsxs("button",{type:"button",className:r("qc:border-primary qc:shadow-outer qc:flex qc:size-full qc:min-h-12 qc:items-center qc:justify-center qc:rounded qc:border qc:transition-all qc:duration-100 qc:active:scale-90",s===t.value?"qc:bg-primary":"qc:bg-background"),onClick:()=>{s!==t.value&&n?.(t.value)},children:[c.mode===a.TEXT&&e.jsx("div",{className:r("qc:p-1 qc:text-center qc:text-xs qc:font-semibold qc:md:p-2 qc:md:text-base",s===t.value?"qc:text-primary-foreground":"qc:text-foreground"),children:t.label}),c.mode===a.IMAGE&&e.jsx("img",{className:"qc:h-12 qc:w-auto qc:rounded-md qc:object-contain qc:lg:h-16",src:t.imageUrl,alt:t.value}),c.mode===a.LOTTIE&&e.jsx(U,{className:"qc:h-16 qc:w-auto qc:rounded-md qc:object-contain qc:lg:h-24",src:t.imageUrl,autoplay:!0,loop:!0})]}),i&&e.jsx("div",{className:"qc:mt-1 qc:w-full qc:text-center",children:e.jsx("span",{className:"qc:text-foreground qc:inline-flex qc:items-center qc:px-2 qc:py-[0.0625] qc:text-xs qc:font-medium qc:md:px-3 qc:md:py-0.5",children:t.value})})]},o)})})]});var L,D,G=function(e,r){var t="function"==typeof Symbol&&e[Symbol.iterator];if(!t)return e;var a,c,s=t.call(e),n=[];try{for(;(void 0===r||r-- >0)&&!(a=s.next()).done;)n.push(a.value)}catch(e){c={error:e}}finally{try{a&&!a.done&&(t=s.return)&&t.call(s)}finally{if(c)throw c.error}}return n};function V(e,r,t,a,c,s,n,i,o,l,d){var m,q,h,u;if(0!==n)if(n!==t-r+(s-c)){for(var g=t-r,p=s-c,x=Math.floor(p/2),f={},v=-n-1;v<=n+1;++v)f[v]={d:1/0,segments:0,direct:L.none};for(var j=((m={})[-n-1]={d:1/0,segments:0,direct:L.none},m[n+1]={d:1/0,segments:0,direct:L.none},m),b=0;b<=x;++b){q=G([j,f],2),f=q[0],j=q[1];var y=function(t){var s=b+t;if(0===b&&0===s)return f[t]={d:0,segments:0,direct:i},"continue";var n=[{direct:L.horizontal,d:f[t-1].d+1,segments:f[t-1].segments+(f[t-1].direct&L.horizontal?0:1)},{direct:L.vertical,d:j[t+1].d+1,segments:j[t+1].segments+(j[t+1].direct&L.vertical?0:1)}];s>0&&s<=g&&b>0&&b<=p&&l(e[r+s-1],a[c+b-1])&&n.push({direct:L.diagonal,d:j[t].d,segments:j[t].segments+(j[t].direct&L.diagonal?0:1)});var o=n.reduce(function(e,r){return e.d>r.d||e.d===r.d&&e.segments>r.segments?r:e});n.forEach(function(e){o.d===e.d&&o.segments===e.segments&&(o.direct|=e.direct)}),f[t]=o};for(v=-n;v<=n;++v)y(v)}var N={};for(v=-n-1;v<=n+1;++v)N[v]={d:1/0,segments:0,direct:L.none};var w=((h={})[-n-1]={d:1/0,segments:0,direct:L.none},h[n+1]={d:1/0,segments:0,direct:L.none},h);for(b=p;b>=x;--b){u=G([w,N],2),N=u[0],w=u[1];var k=function(t){var s=b+t;if(b===p&&s===g)return N[t]={d:0,segments:0,direct:o},"continue";var n=[{direct:L.horizontal,d:N[t+1].d+1,segments:N[t+1].segments+(N[t+1].direct&L.horizontal?0:1)},{direct:L.vertical,d:w[t-1].d+1,segments:w[t-1].segments+(w[t-1].direct&L.vertical?0:1)}];s>=0&&s<g&&b>=0&&b<p&&l(e[r+s],a[c+b])&&n.push({direct:L.diagonal,d:w[t].d,segments:w[t].segments+(w[t].direct&L.diagonal?0:1)});var i=n.reduce(function(e,r){return e.d>r.d||e.d===r.d&&e.segments>r.segments?r:e});n.forEach(function(e){i.d===e.d&&i.segments===e.segments&&(i.direct|=e.direct)}),N[t]=i};for(v=n;v>=-n;--v)k(v)}var E={k:-1,d:1/0,segments:0,direct:L.none};for(v=-n;v<=n;++v){var I=f[v].d+N[v].d;if(I<E.d)E.k=v,E.d=I,E.segments=f[v].segments+N[v].segments+(f[v].segments&N[v].segments?0:1),E.direct=N[v].direct;else if(I===E.d){var _=f[v].segments+N[v].segments+(f[v].segments&N[v].segments?0:1);(_<E.segments||_===E.segments&&!(E.direct&L.diagonal)&&N[v].direct&L.diagonal)&&(E.k=v,E.d=I,E.segments=_,E.direct=N[v].direct)}}x+E.k===0&&0===x&&(x++,f[E.k].direct=N[E.k].direct,N[E.k].direct=w[E.k].direct),V(e,r,r+x+E.k,a,c,c+x,f[E.k].d,i,N[E.k].direct,l,d),V(e,r+x+E.k,t,a,c+x,s,N[E.k].d,f[E.k].direct,o,l,d)}else(i&L.horizontal?1:0)+(o&L.vertical?1:0)>=(i&L.vertical?1:0)+(o&L.horizontal?1:0)?(r!==t&&d("remove",e,r,t,a,c,c),c!==s&&d("add",e,t,t,a,c,s)):(c!==s&&d("add",e,r,r,a,c,s),r!==t&&d("remove",e,r,t,a,s,s));else d("same",e,r,t,a,c,s)}function W(e,r,t,a){var c=function(e,r,t){for(var a=e.length,c=r.length,s=a+c,n={1:0},i=0;i<=s;++i)for(var o=-i;o<=i;o+=2){for(var l=void 0,d=(l=o===-i||o!==i&&n[o-1]+1<n[o+1]?n[o+1]:n[o-1]+1)-o;l<a&&d<c&&t(e[l],r[d]);)l++,d++;if(l===a&&d===c)return i;n[o]=l}return-1}(e,r,t);V(e,0,e.length,r,0,r.length,c,L.diagonal,L.all,t,a)}(D=L||(L={}))[D.none=0]="none",D[D.horizontal=1]="horizontal",D[D.vertical=2]="vertical",D[D.diagonal=4]="diagonal",D[D.all=7]="all";const Y=()=>{const r=c(),{eventSlug:a,contentId:j}=s(),{props:{organizationId:N,loginUrl:T},user:A,loadingUser:O,organization:z}=n(),[R,P]=b(!1),[F,U]=b(null),[L,D]=b([]),[G,V]=b(null),[Y,J]=b("contain"),[X,K]=b({}),[Q,Z]=b(null),[ee,re]=b(!1),[te,ae]=b(!0),[ce,se]=b(null),{loading:ne,event:ie,parameters:oe}=i({eventSlug:a});y(()=>{ie&&A&&de(ie._id)},[ie,A]);const le=z?.navigationSettings?.showAIDescription,de=async e=>{P(!0);try{const r=await o.get(l.CONTENT_FOR_CURATION,{headers:{"x-org-id":N,Authorization:A?`Bearer ${A.token}`:void 0},searchParams:{eventId:e,page:1,limit:10,includeDescription:le}}).json();if(r.error)throw new Error(r.error);const t=j?r.data.filter(e=>e._id!==j):r.data;let a,c=t;if(j){const e=await o.get(l.ELIGIBLE_TO_CURATE,{headers:{"x-org-id":N,Authorization:A?`Bearer ${A.token}`:void 0},searchParams:{contentId:j,includeDescription:le}}).json();if(e.error)throw new Error(e.error);const r=e.data;c=r?[r,...t]:t||[],a=r&&r.userId===A?._id?"Sorry, you cannot rate your own content":r&&r.ratingStatus===d.CURATED?"Sorry, you have already rated this photo.":null}const s=await o.get(l.GET_EVENT_POINTS,{headers:{"x-org-id":N,Authorization:A?`Bearer ${A.token}`:void 0},searchParams:{eventId:e}}).json();if(s.error)throw new Error(s.error);V(s.data),D(c),U(a)}catch(e){console.error("Failed to fetch contents",e)}P(!1)},me=async e=>{try{const r=await o.get(l.CONTENT_FOR_CURATION,{headers:{"x-org-id":N,Authorization:A?`Bearer ${A.token}`:void 0},searchParams:{eventId:ie?._id,page:1,limit:10,includeDescription:le}});if(r.error)throw new Error(r.error);if(r?.data?.length>0){const t=function(e,r,t){void 0===t&&(t=function(e,r){return e===r});var a={removed:[],added:[]};return W(e,r,t,function(e,r,t,c,s,n,i){if("add"===e)for(var o=n;o<i;++o)a.added.push(s[o]);else if("remove"===e)for(o=t;o<c;++o)a.removed.push(r[o])}),a}(e,r.data,(e,r)=>e._id===r._id),a=[...e,...t.added];D(a)}}catch(e){console.error(e)}},qe=()=>{const e=L.slice(1);U(null),Z(null),K({}),e.length===v?me(e):D(e),ae(!0)};if(O)return e.jsx(m,{className:"qc:mx-auto qc:h-6 qc:w-64"});if(!A){if(!z.customAuth)return e.jsx(h,{to:u.LOGIN,state:{referrer:r.pathname}});if(!T)return e.jsx(q,{title:"Please login to upload content"});window.history.pushState({},"",T)}return e.jsx("div",{className:"qc:min-h-[80vh] qc:bg-background",children:R||ne?e.jsxs("div",{className:"qc:mt-8 qc:grid qc:grid-cols-1 qc:gap-6 qc:md:grid-cols-2",children:[e.jsx(m,{className:"qc:h-64 qc:w-full qc:md:h-[30rem] qc:md:max-h-screen qc:md:rounded"}),e.jsx("div",{className:"qc:space-y-8",children:Array.from({length:2}).map((r,t)=>e.jsxs("div",{className:"qc:space-y-4",children:[e.jsx(m,{className:"qc:h-8 qc:w-36"}),e.jsx("div",{className:"qc:flex qc:w-full qc:gap-4",children:Array.from({length:5}).map((r,t)=>e.jsx(m,{className:"qc:h-24 qc:w-full qc:sm:h-32"},t))})]},t))})]}):e.jsxs("div",{className:"qc:lg:mt-8",children:[ie?.status===g.CLOSED&&e.jsx(t,{variant:"h3",color:"primary",align:"center",children:"Event is now closed. Thank you for participating!"}),ie?.status===g.OPEN&&L.length<=0&&e.jsx(t,{variant:"h3",color:"primary",align:"center",children:"No content to rate. Please find another event to rate contents."}),ie?.status===g.OPEN&&L.length>0&&e.jsxs("div",{children:[!(oe?.length<=0&&le)&&e.jsxs("div",{className:"qc:flex qc:w-full qc:items-center qc:justify-between",children:[e.jsxs(t,{variant:"h4",children:["Rate this ",L[0].type===p.IMAGE?"image":"video"]}),e.jsxs(t,{variant:"h4",children:[ie?.pointName,":"," ",e.jsx("span",{className:"qc:text-primary",children:G.upload+G.curate})]})]}),e.jsxs("div",{className:"qc:grid qc:grid-cols-1 qc:gap-6 qc:md:grid-cols-2",children:[e.jsxs("div",{className:"qc:relative qc:mt-4 qc:w-full",children:[L[0].type===p.IMAGE&&e.jsx(w,{children:e.jsx($,{sizeMode:Y,src:L[0].url,alt:L[0].caption,blurhash:L[0].blurhash,wrapperClassName:"qc:w-full qc:h-60 qc:md:h-[30rem] qc:md:max-h-screen qc:md:rounded"})}),L[0].type===p.VIDEO&&e.jsx("div",{className:"qc:mx-auto qc:h-80 qc:w-fit qc:overflow-hidden qc:rounded qc:sm:h-[30rem]",children:e.jsx(S,{fit:Y,src:L[0].url,loop:!0,playing:te,volume:0,muted:!0,onPlay:()=>ae(!0),onPause:()=>ae(!1),onEnd:()=>ae(!1)})}),L[0].caption&&L[0].caption.length>0&&e.jsx("div",{className:"qc:bg-background qc:absolute qc:bottom-0 qc:w-full qc:bg-opacity-75 qc:p-2",children:e.jsx(t,{variant:"body3",lines:"2",children:L[0].caption})}),L.length>1&&e.jsx("img",{style:{display:"none"},src:L[1].url,alt:"Next image"})]}),e.jsxs("div",{className:"qc:px-2 qc:md:px-4",children:[!F&&oe&&oe.map(r=>e.jsx(B,{parameter:r,selected:X[r._id],onChange:e=>K({...X,[r._id]:e})},r._id)),ce&&oe?.length>0&&e.jsx(t,{variant:"h5",color:"error",children:ce}),F&&oe?.length>0&&e.jsx("div",{className:"qc:sm:pt-16",children:e.jsx(t,{variant:"h5",color:"error",align:"center",children:F})}),oe?.length>0&&e.jsx(x,{type:"button",color:"primary",className:"qc:mt-4 qc:w-full",disabled:ee,loading:ee,icon:"material-symbols:check-rounded",onClick:F?qe:async()=>{if(oe.length<1)return void se("no parameters found");if(Object.keys(X).length<oe.length)return void se("please select your ratings");se(null),re(!0);const e=await o.post(l.CURATE_CONTENT,{headers:{"x-org-id":N,Authorization:A?`Bearer ${A.token}`:void 0},json:{eventId:ie._id,contentId:L[0]._id,parameterCount:oe.length,userRatings:oe.map(e=>({parameterId:e._id,weight:e.weight,rate:X[e._id]})),inappropriate:""}}).json();if(e.error)se(e.error);else{const r=e.data,t=r.crowdRatings||{},a={parameters:oe.map(e=>({name:e.name,crowdRating:t[e._id],userRating:r.ratings?.find(r=>r.parameterId===e._id)?.rate})),similarity:r.similarity||null,points:r.points||0,rateCount:r.rateCount||0};Z(a);const c={...G};c.curate+=ie.activityScores.curate,V(c)}re(!1)},children:F?"Rate Next Image":ee?"Rating...":"Submit"}),L?.length>0&&le&&e.jsx(H,{summary:L[0].contentSummary,url:L[0].url})]})]}),e.jsx("div",{className:"qc:mt-16",children:e.jsx(f,{to:u.GALLERY(a),state:{internalNavigation:!0},children:e.jsx(t,{color:"primary",variant:"h5",align:"center",children:"Goto gallery"})})})]}),e.jsx(k,{open:!!Q,onOpenChange:e=>!e&&qe(),children:e.jsxs(E,{children:[e.jsxs(I,{children:[e.jsxs(_,{className:"qc:hidden",children:[ie?.pointName,": ",G?.upload+G?.curate]}),e.jsx(C,{className:"qc:hidden",children:"We are here to help you"})]}),e.jsxs("div",{className:"qc:w-full qc:space-y-3 qc:px-3 qc:pb-6 qc:lg:px-6",children:[e.jsx(M,{feedback:Q}),e.jsx(x,{fullWidth:!0,color:"primary",onClick:qe,children:"Next"})]})]})})]})})},H=({summary:r,url:a})=>e.jsxs("div",{className:"qc:w-full",children:[r?.subject&&e.jsx(t,{variant:"h3",className:"qc:mb-4",align:"center",children:r?.subject}),r?.labels&&e.jsx("div",{className:"qc:space-y-2",children:Object.entries(r?.labels).filter(([e,r])=>Array.isArray(r)&&r.length>0).map(([r,a])=>e.jsxs("div",{className:"",children:[e.jsx(t,{variant:"h4",className:"qc:mb-2 qc:font-semibold qc:capitalize",children:r.replace("_"," ")}),e.jsx("ul",{className:"qc:space-y-1 qc:pl-2",children:a.map((r,a)=>e.jsxs("li",{className:"qc:flex qc:items-center qc:gap-2",children:[e.jsx(j,{name:"material-symbols:check-circle-outline",className:"qc:text-primary"}),e.jsx(t,{variant:"body1",children:r}),e.jsx("a",{href:`https://www.google.com/search?q=${encodeURIComponent(r)}`,target:"_blank",rel:"noopener noreferrer",className:"qc:ml-2",children:e.jsx(x,{variant:"outlined",icon:"flat-color-icons:google",children:e.jsx(j,{name:"material-symbols:open-in-new-rounded",size:"sm"})})})]},a))})]},r))}),r?.description&&e.jsxs(w,{children:[e.jsx("hr",{className:"qc:my-4 qc:lg:my-8"}),e.jsx(t,{variant:"body2",children:r?.description})]}),e.jsx("div",{className:"qc:mt-4 qc:flex qc:justify-center qc:lg:mt-8",children:e.jsx("a",{target:"_blank",href:`https://www.bing.com/images/search?view=detailv2&iss=SBI&form=SBIIRP&sbisrc=UrlPaste&q=imgurl:${a}&idpbck=1&selectedindex=0&id=${a}&mediaurl=${a}&exph=480&expw=640&vt=3&sim=11&cal=0&cab=1&cat=0&car=1`,rel:"noopener noreferrer",children:e.jsx(x,{icon:"logos:bing",variant:"outlined",color:"info",children:"Search on Bing"})})}),r&&e.jsx(t,{variant:"caption",align:"center",color:"secondary",className:"qc:mt-4 qc:lg:mt-8",children:"These are AI generated summaries based on the content. Please verify the information before using it."})]});export{Y as default};
@@ -1 +1 @@
1
- import{P as e,j as s,I as r,g as o,T as l}from"./BDeLdfbp.js";const c=(s,r)=>{const o=new Map;s?.forEach(e=>{o.set(e._id,e)});const l=[];let c=o.get(r);for(;c;)l.unshift({_id:c._id,name:c.name,href:e.FOLDER_EVENTS(c?._id),color:c.color}),c=o.get(c.parentFolderId);return l},a=({folder:e})=>s.jsxs("li",{className:"qc:flex qc:items-center",children:[s.jsx(r,{name:"material-symbols:arrow-forward-ios-rounded",size:"sm"}),s.jsxs(o,{to:e.href,className:"qc:flex qc:items-center qc:gap-2 qc:rounded qc:px-4 qc:py-1 qc:transition-colors",onMouseEnter:s=>{s.currentTarget.style.backgroundColor=`${e.color}3A`},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=""},children:[s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",style:{color:e.color},children:s.jsx("path",{fill:"currentColor",d:"M4 20q-.825 0-1.412-.587T2 18V6q0-.825.588-1.412T4 4h5.175q.4 0 .763.15t.637.425L12 6h8q.825 0 1.413.588T22 8v10q0 .825-.587 1.413T20 20z"})}),s.jsx(l,{variant:"h5",color:"secondary",className:"qc:whitespace-nowrap",children:e.name})]})]},e.name),n=({homeLink:e,data:l})=>s.jsxs("ol",{role:"list",className:"scrollbar-hide qc:flex qc:max-w-full qc:items-center qc:space-x-3 qc:overflow-y-scroll",children:[s.jsx("li",{children:s.jsxs(o,{to:e,className:"qc:text-foreground",children:[s.jsx(r,{name:"material-symbols:home-outline-rounded",size:"lg"}),s.jsx("span",{className:"qc:sr-only",children:"Home"})]})}),l?.map(e=>s.jsx(a,{folder:e},e._id))]});export{n as F,c as g};
1
+ import{P as e,j as s,I as r,g as o,T as l}from"./BaA7RHRf.js";const c=(s,r)=>{const o=new Map;s?.forEach(e=>{o.set(e._id,e)});const l=[];let c=o.get(r);for(;c;)l.unshift({_id:c._id,name:c.name,href:e.FOLDER_EVENTS(c?._id),color:c.color}),c=o.get(c.parentFolderId);return l},a=({folder:e})=>s.jsxs("li",{className:"qc:flex qc:items-center",children:[s.jsx(r,{name:"material-symbols:arrow-forward-ios-rounded",size:"sm"}),s.jsxs(o,{to:e.href,className:"qc:flex qc:items-center qc:gap-2 qc:rounded qc:px-4 qc:py-1 qc:transition-colors",onMouseEnter:s=>{s.currentTarget.style.backgroundColor=`${e.color}3A`},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=""},children:[s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",style:{color:e.color},children:s.jsx("path",{fill:"currentColor",d:"M4 20q-.825 0-1.412-.587T2 18V6q0-.825.588-1.412T4 4h5.175q.4 0 .763.15t.637.425L12 6h8q.825 0 1.413.588T22 8v10q0 .825-.587 1.413T20 20z"})}),s.jsx(l,{variant:"h5",color:"secondary",className:"qc:whitespace-nowrap",children:e.name})]})]},e.name),n=({homeLink:e,data:l})=>s.jsxs("ol",{role:"list",className:"scrollbar-hide qc:flex qc:max-w-full qc:items-center qc:space-x-3 qc:overflow-y-scroll",children:[s.jsx("li",{children:s.jsxs(o,{to:e,className:"qc:text-foreground",children:[s.jsx(r,{name:"material-symbols:home-outline-rounded",size:"lg"}),s.jsx("span",{className:"qc:sr-only",children:"Home"})]})}),l?.map(e=>s.jsx(a,{folder:e},e._id))]});export{n as F,c as g};
@@ -1 +1 @@
1
- import{d as e,u as a,j as s,J as l,T as o,g as r,P as i}from"./BDeLdfbp.js";import{useState as t}from"react";import{I as n}from"./CImTSnHg.js";import{S as c}from"./eUvYQTPt.js";import{u as d,C as m,o as p,c as g,a as u}from"./-74yB4f5.js";const h=g().shape({email:u().required("Please enter your email").email("Enter a valid email"),password:u().required("Please enter your password").min(8,"Min password length is 8")}),j=()=>{const[g,u]=t(!1),[j,f]=t(!1),[x,w]=t({google:!1,apple:!1}),[y,q]=t(null),v=e(),{control:b,handleSubmit:C,formState:{errors:N}}=d({defaultValues:{email:"",password:""},mode:"onSubmit",resolver:p(h)}),{loginUsingEmail:S,loginWithGoogle:P,loginWithApple:k}=a(),B=async(e,a)=>{w(a=>({...a,[e]:!0})),q(null);try{await a()}catch(a){q(a.message||`Failed to login with ${e.charAt(0).toUpperCase()+e.slice(1)}`)}finally{w(a=>({...a,[e]:!1}))}};return s.jsxs("div",{className:"qc:w-full qc:space-y-6 qc:bg-background",children:[s.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:C(async e=>{const{email:a,password:s}=e;f(!0);try{const e=await S(a.toLowerCase(),s);e?.error&&q(e.error)}catch(e){q(e)}finally{f(!1)}}),className:"qc:space-y-6",children:[s.jsxs("div",{className:"qc:space-y-9",children:[s.jsx(m,{name:"email",control:b,render:({field:{value:e,onChange:a,onBlur:l}})=>s.jsx(n,{label:"Email",disabled:j,type:"email",value:e,onChange:a,onBlur:l,autoComplete:"email",error:N.email?.message})}),s.jsx(m,{name:"password",control:b,render:({field:{value:e,onChange:a,onBlur:o}})=>s.jsxs("div",{className:"qc:relative",children:[s.jsx(n,{label:"Password",disabled:j,type:g?"text":"password",value:e,onChange:a,onBlur:o,autoComplete:"current-password",error:N.password?.message}),s.jsx(l,{variant:"ghost",color:"primary",className:"qc:absolute qc:right-0 qc:top-8",icon:g?"mdi:eye-outline":"mdi:eye-off-outline",onClick:()=>u(!g)})]})})]}),y&&s.jsx(o,{align:"center",weight:"medium",color:"error",children:y}),s.jsx("div",{className:"qc:flex qc:justify-end",children:s.jsx(r,{to:i.FORGOT_PASSWORD,state:v?.state,children:s.jsx(o,{variant:"h6",className:"qc:w-fit",children:"Forgot password?"})})}),s.jsx(l,{type:"submit",color:"primary",className:"qc:w-full",loading:j,disabled:j,children:"Login"})]}),s.jsxs("div",{className:"qc:grid qc:grid-cols-2 qc:gap-4",children:[s.jsx(c,{disabled:j||x.google||x.apple,loading:x.google,onClick:()=>B("google",P),provider:"google"}),s.jsx(c,{disabled:j||x.google||x.apple,loading:x.apple,onClick:()=>B("apple",k),provider:"apple"})]})]})};export{j as default};
1
+ import{d as e,u as a,j as s,J as l,T as o,g as r,P as i}from"./BaA7RHRf.js";import{useState as t}from"react";import{I as n}from"./Bebe5T7J.js";import{S as c}from"./D1emifDo.js";import{u as d,C as m,o as p,c as g,a as u}from"./-74yB4f5.js";const h=g().shape({email:u().required("Please enter your email").email("Enter a valid email"),password:u().required("Please enter your password").min(8,"Min password length is 8")}),j=()=>{const[g,u]=t(!1),[j,f]=t(!1),[x,w]=t({google:!1,apple:!1}),[y,q]=t(null),v=e(),{control:b,handleSubmit:C,formState:{errors:N}}=d({defaultValues:{email:"",password:""},mode:"onSubmit",resolver:p(h)}),{loginUsingEmail:S,loginWithGoogle:P,loginWithApple:k}=a(),B=async(e,a)=>{w(a=>({...a,[e]:!0})),q(null);try{await a()}catch(a){q(a.message||`Failed to login with ${e.charAt(0).toUpperCase()+e.slice(1)}`)}finally{w(a=>({...a,[e]:!1}))}};return s.jsxs("div",{className:"qc:w-full qc:space-y-6 qc:bg-background",children:[s.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:C(async e=>{const{email:a,password:s}=e;f(!0);try{const e=await S(a.toLowerCase(),s);e?.error&&q(e.error)}catch(e){q(e)}finally{f(!1)}}),className:"qc:space-y-6",children:[s.jsxs("div",{className:"qc:space-y-9",children:[s.jsx(m,{name:"email",control:b,render:({field:{value:e,onChange:a,onBlur:l}})=>s.jsx(n,{label:"Email",disabled:j,type:"email",value:e,onChange:a,onBlur:l,autoComplete:"email",error:N.email?.message})}),s.jsx(m,{name:"password",control:b,render:({field:{value:e,onChange:a,onBlur:o}})=>s.jsxs("div",{className:"qc:relative",children:[s.jsx(n,{label:"Password",disabled:j,type:g?"text":"password",value:e,onChange:a,onBlur:o,autoComplete:"current-password",error:N.password?.message}),s.jsx(l,{variant:"ghost",color:"primary",className:"qc:absolute qc:right-0 qc:top-8",icon:g?"mdi:eye-outline":"mdi:eye-off-outline",onClick:()=>u(!g)})]})})]}),y&&s.jsx(o,{align:"center",weight:"medium",color:"error",children:y}),s.jsx("div",{className:"qc:flex qc:justify-end",children:s.jsx(r,{to:i.FORGOT_PASSWORD,state:v?.state,children:s.jsx(o,{variant:"h6",className:"qc:w-fit",children:"Forgot password?"})})}),s.jsx(l,{type:"submit",color:"primary",className:"qc:w-full",loading:j,disabled:j,children:"Login"})]}),s.jsxs("div",{className:"qc:grid qc:grid-cols-2 qc:gap-4",children:[s.jsx(c,{disabled:j||x.google||x.apple,loading:x.google,onClick:()=>B("google",P),provider:"google"}),s.jsx(c,{disabled:j||x.google||x.apple,loading:x.apple,onClick:()=>B("apple",k),provider:"apple"})]})]})};export{j as default};
@@ -1 +1 @@
1
- import{e as t,r as i,c as s,g as e,p as o,s as n,a,b as r,d as h,t as p,f as l,Z as c,h as d,i as u,j as m,P as _,C as v,k as g}from"./DPeVo4aL.js";class y{constructor(t){this.gestures=t,this.pswp=t.pswp,this.startPan={x:0,y:0}}start(){this.pswp.currSlide&&t(this.startPan,this.pswp.currSlide.pan),this.pswp.animations.stopAll()}change(){const{p1:t,prevP1:s,dragAxis:e}=this.gestures,{currSlide:o}=this.pswp;if("y"===e&&this.pswp.options.closeOnVerticalDrag&&o&&o.currZoomLevel<=o.zoomLevels.fit&&!this.gestures.isMultitouch){const i=o.pan.y+(t.y-s.y);if(!this.pswp.dispatch("verticalDrag",{panY:i}).defaultPrevented){this._setPanWithFriction("y",i,.6);const t=1-Math.abs(this._getVerticalDragRatio(o.pan.y));this.pswp.applyBgOpacity(t),o.applyCurrentZoomPan()}}else this._panOrMoveMainScroll("x")||(this._panOrMoveMainScroll("y"),o&&(i(o.pan),o.applyCurrentZoomPan()))}end(){const{velocity:t}=this.gestures,{mainScroll:i,currSlide:s}=this.pswp;let e=0;if(this.pswp.animations.stopAll(),i.isShifted()){const s=(i.x-i.getCurrSlideX())/this.pswp.viewportSize.x;t.x<-.5&&s<0||t.x<.1&&s<-.5?(e=1,t.x=Math.min(t.x,0)):(t.x>.5&&s>0||t.x>-.1&&s>.5)&&(e=-1,t.x=Math.max(t.x,0)),i.moveIndexBy(e,!0,t.x,!0)}s&&s.currZoomLevel>s.zoomLevels.max||this.gestures.isMultitouch?this.gestures.zoomLevels.correctZoomPan(!0):(this._finishPanGestureForAxis("x"),this._finishPanGestureForAxis("y"))}_finishPanGestureForAxis(t){const{velocity:i}=this.gestures,{currSlide:e}=this.pswp;if(!e)return;const{pan:o,bounds:n}=e,a=o[t],r=this.pswp.bgOpacity<1&&"y"===t,h=a+function(t,i){return t*i/(1-i)}(i[t],.995);if(r){const t=this._getVerticalDragRatio(a),i=this._getVerticalDragRatio(h);if(t<0&&i<-.4||t>0&&i>.4)return void this.pswp.close()}const p=n.correctPan(t,h);if(a===p)return;const l=p===h?1:.82,c=this.pswp.bgOpacity,d=p-a;this.pswp.animations.startSpring({name:"panGesture"+t,isPan:!0,start:a,end:p,velocity:i[t],dampingRatio:l,onUpdate:i=>{if(r&&this.pswp.bgOpacity<1){const t=1-(p-i)/d;this.pswp.applyBgOpacity(s(c+(1-c)*t,0,1))}o[t]=Math.floor(i),e.applyCurrentZoomPan()}})}_panOrMoveMainScroll(t){const{p1:i,dragAxis:s,prevP1:e,isMultitouch:o}=this.gestures,{currSlide:n,mainScroll:a}=this.pswp,r=i[t]-e[t],h=a.x+r;if(!r||!n)return!1;if("x"===t&&!n.isPannable()&&!o)return a.moveTo(h,!0),!0;const{bounds:p}=n,l=n.pan[t]+r;if(this.pswp.options.allowPanToNext&&"x"===s&&"x"===t&&!o){const i=a.getCurrSlideX(),s=a.x-i,e=r>0,o=!e;if(l>p.min[t]&&e){if(p.min[t]<=this.startPan[t])return a.moveTo(h,!0),!0;this._setPanWithFriction(t,l)}else if(l<p.max[t]&&o){if(this.startPan[t]<=p.max[t])return a.moveTo(h,!0),!0;this._setPanWithFriction(t,l)}else if(0!==s){if(s>0)return a.moveTo(Math.max(h,i),!0),!0;if(s<0)return a.moveTo(Math.min(h,i),!0),!0}else this._setPanWithFriction(t,l)}else"y"===t?!a.isShifted()&&p.min.y!==p.max.y&&this._setPanWithFriction(t,l):this._setPanWithFriction(t,l);return!1}_getVerticalDragRatio(t){return(t-(this.pswp.currSlide?.bounds.center.y??0))/(this.pswp.viewportSize.y/3)}_setPanWithFriction(t,i,s){const{currSlide:e}=this.pswp;if(!e)return;const{pan:o,bounds:n}=e;if(n.correctPan(t,i)!==i||s){const e=Math.round(i-o[t]);o[t]+=e*(s||.35)}else o[t]=i}}function w(t){return!!t.target.closest(".pswp__container")}class f{constructor(t){this.gestures=t}click(t,i){const s=i.target.classList,e=s.contains("pswp__img"),o=s.contains("pswp__item")||s.contains("pswp__zoom-wrap");e?this._doClickOrTapAction("imageClick",t,i):o&&this._doClickOrTapAction("bgClick",t,i)}tap(t,i){w(i)&&this._doClickOrTapAction("tap",t,i)}doubleTap(t,i){w(i)&&this._doClickOrTapAction("doubleTap",t,i)}_doClickOrTapAction(t,i,s){const{pswp:e}=this.gestures,{currSlide:o}=e,n=t+"Action",a=e.options[n];if(!e.dispatch(n,{point:i,originalEvent:s}).defaultPrevented){if("function"==typeof a)return void a.call(e,i,s);switch(a){case"close":case"next":e[a]();break;case"zoom":o?.toggleZoom(i);break;case"zoom-or-close":o?.isZoomable()&&o.zoomLevels.secondary!==o.zoomLevels.initial?o.toggleZoom(i):e.options.clickToCloseNonZoomable&&e.close();break;case"toggle-controls":this.gestures.pswp.element?.classList.toggle("pswp--ui-visible")}}}}function P(t,i,s){return t.x=(i.x+s.x)/2,t.y=(i.y+s.y)/2,t}class x{constructor(t){this.gestures=t,this._startPan={x:0,y:0},this._startZoomPoint={x:0,y:0},this._zoomPoint={x:0,y:0},this._wasOverFitZoomLevel=!1,this._startZoomLevel=1}start(){const{currSlide:i}=this.gestures.pswp;i&&(this._startZoomLevel=i.currZoomLevel,t(this._startPan,i.pan)),this.gestures.pswp.animations.stopAllPan(),this._wasOverFitZoomLevel=!1}change(){const{p1:t,startP1:i,p2:s,startP2:o,pswp:n}=this.gestures,{currSlide:a}=n;if(!a)return;const r=a.zoomLevels.min,h=a.zoomLevels.max;if(!a.isZoomable()||n.mainScroll.isShifted())return;P(this._startZoomPoint,i,o),P(this._zoomPoint,t,s);let p=1/e(i,o)*e(t,s)*this._startZoomLevel;if(p>a.zoomLevels.initial+a.zoomLevels.initial/15&&(this._wasOverFitZoomLevel=!0),p<r)if(n.options.pinchToClose&&!this._wasOverFitZoomLevel&&this._startZoomLevel<=a.zoomLevels.initial){const t=1-(r-p)/(r/1.2);n.dispatch("pinchClose",{bgOpacity:t}).defaultPrevented||n.applyBgOpacity(t)}else p=r-.15*(r-p);else p>h&&(p=h+.05*(p-h));a.pan.x=this._calculatePanForZoomLevel("x",p),a.pan.y=this._calculatePanForZoomLevel("y",p),a.setZoomLevel(p),a.applyCurrentZoomPan()}end(){const{pswp:t}=this.gestures,{currSlide:i}=t;(!i||i.currZoomLevel<i.zoomLevels.initial)&&!this._wasOverFitZoomLevel&&t.options.pinchToClose?t.close():this.correctZoomPan()}_calculatePanForZoomLevel(t,i){const s=i/this._startZoomLevel;return this._zoomPoint[t]-(this._startZoomPoint[t]-this._startPan[t])*s}correctZoomPan(i){const{pswp:e}=this.gestures,{currSlide:n}=e;if(!n?.isZoomable())return;0===this._zoomPoint.x&&(i=!0);const a=n.currZoomLevel;let r,h=!0;a<n.zoomLevels.initial?r=n.zoomLevels.initial:a>n.zoomLevels.max?r=n.zoomLevels.max:(h=!1,r=a);const p=e.bgOpacity,l=e.bgOpacity<1,c=t({x:0,y:0},n.pan);let d=t({x:0,y:0},c);i&&(this._zoomPoint.x=0,this._zoomPoint.y=0,this._startZoomPoint.x=0,this._startZoomPoint.y=0,this._startZoomLevel=a,t(this._startPan,c)),h&&(d={x:this._calculatePanForZoomLevel("x",r),y:this._calculatePanForZoomLevel("y",r)}),n.setZoomLevel(r),d={x:n.bounds.correctPan("x",d.x),y:n.bounds.correctPan("y",d.y)},n.setZoomLevel(a);const u=!o(d,c);if(!u&&!h&&!l)return n._setResolution(r),void n.applyCurrentZoomPan();e.animations.stopAllPan(),e.animations.startSpring({isPan:!0,start:0,end:1e3,velocity:0,dampingRatio:1,naturalFrequency:40,onUpdate:t=>{if(t/=1e3,u||h){if(u&&(n.pan.x=c.x+(d.x-c.x)*t,n.pan.y=c.y+(d.y-c.y)*t),h){const i=a+(r-a)*t;n.setZoomLevel(i)}n.applyCurrentZoomPan()}l&&e.bgOpacity<1&&e.applyBgOpacity(s(p+(1-p)*t,0,1))},onComplete:()=>{n._setResolution(r),n.applyCurrentZoomPan()}})}}class S{constructor(t){this.pswp=t,this.dragAxis=null,this.p1={x:0,y:0},this.p2={x:0,y:0},this.prevP1={x:0,y:0},this.prevP2={x:0,y:0},this.startP1={x:0,y:0},this.startP2={x:0,y:0},this.velocity={x:0,y:0},this._lastStartP1={x:0,y:0},this._intervalP1={x:0,y:0},this._numActivePoints=0,this._ongoingPointers=[],this._touchEventEnabled="ontouchstart"in window,this._pointerEventEnabled=!!window.PointerEvent,this.supportsTouch=this._touchEventEnabled||this._pointerEventEnabled&&navigator.maxTouchPoints>1,this._numActivePoints=0,this._intervalTime=0,this._velocityCalculated=!1,this.isMultitouch=!1,this.isDragging=!1,this.isZooming=!1,this.raf=null,this._tapTimer=null,this.supportsTouch||(t.options.allowPanToNext=!1),this.drag=new y(this),this.zoomLevels=new x(this),this.tapHandler=new f(this),t.on("bindEvents",()=>{t.events.add(t.scrollWrap,"click",this._onClick.bind(this)),this._pointerEventEnabled?this._bindEvents("pointer","down","up","cancel"):this._touchEventEnabled?(this._bindEvents("touch","start","end","cancel"),t.scrollWrap&&(t.scrollWrap.ontouchmove=()=>{},t.scrollWrap.ontouchend=()=>{})):this._bindEvents("mouse","down","up")})}_bindEvents(t,i,s,e){const{pswp:o}=this,{events:n}=o,a=e?t+e:"";n.add(o.scrollWrap,t+i,this.onPointerDown.bind(this)),n.add(window,t+"move",this.onPointerMove.bind(this)),n.add(window,t+s,this.onPointerUp.bind(this)),a&&n.add(o.scrollWrap,a,this.onPointerUp.bind(this))}onPointerDown(i){const s="mousedown"===i.type||"mouse"===i.pointerType;if(s&&i.button>0)return;const{pswp:e}=this;e.opener.isOpen?e.dispatch("pointerDown",{originalEvent:i}).defaultPrevented||(s&&(e.mouseDetected(),this._preventPointerEventBehaviour(i,"down")),e.animations.stopAll(),this._updatePoints(i,"down"),1===this._numActivePoints&&(this.dragAxis=null,t(this.startP1,this.p1)),this._numActivePoints>1?(this._clearTapTimer(),this.isMultitouch=!0):this.isMultitouch=!1):i.preventDefault()}onPointerMove(i){this._preventPointerEventBehaviour(i,"move"),this._numActivePoints&&(this._updatePoints(i,"move"),!this.pswp.dispatch("pointerMove",{originalEvent:i}).defaultPrevented&&(1!==this._numActivePoints||this.isDragging?this._numActivePoints>1&&!this.isZooming&&(this._finishDrag(),this.isZooming=!0,this._updateStartPoints(),this.zoomLevels.start(),this._rafStopLoop(),this._rafRenderLoop()):(this.dragAxis||this._calculateDragDirection(),this.dragAxis&&!this.isDragging&&(this.isZooming&&(this.isZooming=!1,this.zoomLevels.end()),this.isDragging=!0,this._clearTapTimer(),this._updateStartPoints(),this._intervalTime=Date.now(),this._velocityCalculated=!1,t(this._intervalP1,this.p1),this.velocity.x=0,this.velocity.y=0,this.drag.start(),this._rafStopLoop(),this._rafRenderLoop()))))}_finishDrag(){this.isDragging&&(this.isDragging=!1,this._velocityCalculated||this._updateVelocity(!0),this.drag.end(),this.dragAxis=null)}onPointerUp(t){this._numActivePoints&&(this._updatePoints(t,"up"),!this.pswp.dispatch("pointerUp",{originalEvent:t}).defaultPrevented&&(0===this._numActivePoints&&(this._rafStopLoop(),this.isDragging?this._finishDrag():!this.isZooming&&!this.isMultitouch&&this._finishTap(t)),this._numActivePoints<2&&this.isZooming&&(this.isZooming=!1,this.zoomLevels.end(),1===this._numActivePoints&&(this.dragAxis=null,this._updateStartPoints()))))}_rafRenderLoop(){(this.isDragging||this.isZooming)&&(this._updateVelocity(),this.isDragging?o(this.p1,this.prevP1)||this.drag.change():(!o(this.p1,this.prevP1)||!o(this.p2,this.prevP2))&&this.zoomLevels.change(),this._updatePrevPoints(),this.raf=requestAnimationFrame(this._rafRenderLoop.bind(this)))}_updateVelocity(i){const s=Date.now(),e=s-this._intervalTime;e<50&&!i||(this.velocity.x=this._getVelocity("x",e),this.velocity.y=this._getVelocity("y",e),this._intervalTime=s,t(this._intervalP1,this.p1),this._velocityCalculated=!0)}_finishTap(i){const{mainScroll:s}=this.pswp;if(s.isShifted())return void s.moveIndexBy(0,!0);if(i.type.indexOf("cancel")>0)return;if("mouseup"===i.type||"mouse"===i.pointerType)return void this.tapHandler.click(this.startP1,i);const o=this.pswp.options.doubleTapAction?300:0;this._tapTimer?(this._clearTapTimer(),e(this._lastStartP1,this.startP1)<25&&this.tapHandler.doubleTap(this.startP1,i)):(t(this._lastStartP1,this.startP1),this._tapTimer=setTimeout(()=>{this.tapHandler.tap(this.startP1,i),this._clearTapTimer()},o))}_clearTapTimer(){this._tapTimer&&(clearTimeout(this._tapTimer),this._tapTimer=null)}_getVelocity(t,i){const s=this.p1[t]-this._intervalP1[t];return Math.abs(s)>1&&i>5?s/i:0}_rafStopLoop(){this.raf&&(cancelAnimationFrame(this.raf),this.raf=null)}_preventPointerEventBehaviour(t,i){this.pswp.applyFilters("preventPointerEvent",!0,t,i)&&t.preventDefault()}_updatePoints(i,s){if(this._pointerEventEnabled){const e=i,o=this._ongoingPointers.findIndex(t=>t.id===e.pointerId);"up"===s&&o>-1?this._ongoingPointers.splice(o,1):"down"===s&&-1===o?this._ongoingPointers.push(this._convertEventPosToPoint(e,{x:0,y:0})):o>-1&&this._convertEventPosToPoint(e,this._ongoingPointers[o]),this._numActivePoints=this._ongoingPointers.length,this._numActivePoints>0&&t(this.p1,this._ongoingPointers[0]),this._numActivePoints>1&&t(this.p2,this._ongoingPointers[1])}else{const t=i;this._numActivePoints=0,t.type.indexOf("touch")>-1?t.touches&&t.touches.length>0&&(this._convertEventPosToPoint(t.touches[0],this.p1),this._numActivePoints++,t.touches.length>1&&(this._convertEventPosToPoint(t.touches[1],this.p2),this._numActivePoints++)):(this._convertEventPosToPoint(i,this.p1),"up"===s?this._numActivePoints=0:this._numActivePoints++)}}_updatePrevPoints(){t(this.prevP1,this.p1),t(this.prevP2,this.p2)}_updateStartPoints(){t(this.startP1,this.p1),t(this.startP2,this.p2),this._updatePrevPoints()}_calculateDragDirection(){if(this.pswp.mainScroll.isShifted())this.dragAxis="x";else{const t=Math.abs(this.p1.x-this.startP1.x)-Math.abs(this.p1.y-this.startP1.y);if(0!==t){const i=t>0?"x":"y";Math.abs(this.p1[i]-this.startP1[i])>=10&&(this.dragAxis=i)}}}_convertEventPosToPoint(t,i){return i.x=t.pageX-this.pswp.offset.x,i.y=t.pageY-this.pswp.offset.y,"pointerId"in t?i.id=t.pointerId:void 0!==t.identifier&&(i.id=t.identifier),i}_onClick(t){this.pswp.mainScroll.isShifted()&&(t.preventDefault(),t.stopPropagation())}}const b={Escape:27,z:90,ArrowLeft:37,ArrowUp:38,ArrowRight:39,ArrowDown:40,Tab:9},T=(t,i)=>i?t:b[t];class L{constructor(t){this.pswp=t,this._wasFocused=!1,t.on("bindEvents",()=>{t.options.trapFocus&&(t.options.initialPointerPos||this._focusRoot(),t.events.add(document,"focusin",this._onFocusIn.bind(this))),t.events.add(document,"keydown",this._onKeyDown.bind(this))});const i=document.activeElement;t.on("destroy",()=>{t.options.returnFocus&&i&&this._wasFocused&&i.focus()})}_focusRoot(){!this._wasFocused&&this.pswp.element&&(this.pswp.element.focus(),this._wasFocused=!0)}_onKeyDown(t){const{pswp:i}=this;if(i.dispatch("keydown",{originalEvent:t}).defaultPrevented||n(t))return;let s,e,o=!1;const a="key"in t;switch(a?t.key:t.keyCode){case T("Escape",a):i.options.escKey&&(s="close");break;case T("z",a):s="toggleZoom";break;case T("ArrowLeft",a):e="x";break;case T("ArrowUp",a):e="y";break;case T("ArrowRight",a):e="x",o=!0;break;case T("ArrowDown",a):o=!0,e="y";break;case T("Tab",a):this._focusRoot()}if(e){t.preventDefault();const{currSlide:n}=i;i.options.arrowKeys&&"x"===e&&i.getNumItems()>1?s=o?"next":"prev":n&&n.currZoomLevel>n.zoomLevels.fit&&(n.pan[e]+=o?-80:80,n.panTo(n.pan.x,n.pan.y))}s&&(t.preventDefault(),i[s]())}_onFocusIn(t){const{template:i}=this.pswp;i&&document!==t.target&&i!==t.target&&!i.contains(t.target)&&i.focus()}}class A{constructor(t){this.pswp=t,this.x=0,this.slideWidth=0,this._currPositionIndex=0,this._prevPositionIndex=0,this._containerShiftIndex=-1,this.itemHolders=[]}resize(t){const{pswp:i}=this,s=Math.round(i.viewportSize.x+i.viewportSize.x*i.options.spacing),e=s!==this.slideWidth;e&&(this.slideWidth=s,this.moveTo(this.getCurrSlideX())),this.itemHolders.forEach((i,s)=>{e&&a(i.el,(s+this._containerShiftIndex)*this.slideWidth),t&&i.slide&&i.slide.resize()})}resetPosition(){this._currPositionIndex=0,this._prevPositionIndex=0,this.slideWidth=0,this._containerShiftIndex=-1}appendHolders(){this.itemHolders=[];for(let t=0;t<3;t++){const i=r("pswp__item","div",this.pswp.container);i.setAttribute("role","group"),i.setAttribute("aria-roledescription","slide"),i.setAttribute("aria-hidden","true"),i.style.display=1===t?"block":"none",this.itemHolders.push({el:i})}}canBeSwiped(){return this.pswp.getNumItems()>1}moveIndexBy(t,i,s){const{pswp:e}=this;let o=e.potentialIndex+t;const n=e.getNumItems();if(e.canLoop()){o=e.getLoopedIndex(o);const i=(t+n)%n;t=i<=n/2?i:i-n}else o<0?o=0:o>=n&&(o=n-1),t=o-e.potentialIndex;e.potentialIndex=o,this._currPositionIndex-=t,e.animations.stopMainScroll();const a=this.getCurrSlideX();if(i){e.animations.startSpring({isMainScroll:!0,start:this.x,end:a,velocity:s||0,naturalFrequency:30,dampingRatio:1,onUpdate:t=>{this.moveTo(t)},onComplete:()=>{this.updateCurrItem(),e.appendHeavy()}});let t=e.potentialIndex-e.currIndex;if(e.canLoop()){const i=(t+n)%n;t=i<=n/2?i:i-n}Math.abs(t)>1&&this.updateCurrItem()}else this.moveTo(a),this.updateCurrItem();return!!t}getCurrSlideX(){return this.slideWidth*this._currPositionIndex}isShifted(){return this.x!==this.getCurrSlideX()}updateCurrItem(){const{pswp:t}=this,i=this._prevPositionIndex-this._currPositionIndex;if(!i)return;this._prevPositionIndex=this._currPositionIndex,t.currIndex=t.potentialIndex;let s,e=Math.abs(i);e>=3&&(this._containerShiftIndex+=i+(i>0?-3:3),e=3,this.itemHolders.forEach(t=>{t.slide?.destroy(),t.slide=void 0}));for(let o=0;o<e;o++)i>0?(s=this.itemHolders.shift(),s&&(this.itemHolders[2]=s,this._containerShiftIndex++,a(s.el,(this._containerShiftIndex+2)*this.slideWidth),t.setContent(s,t.currIndex-e+o+2))):(s=this.itemHolders.pop(),s&&(this.itemHolders.unshift(s),this._containerShiftIndex--,a(s.el,this._containerShiftIndex*this.slideWidth),t.setContent(s,t.currIndex+e-o-2)));Math.abs(this._containerShiftIndex)>50&&!this.isShifted()&&(this.resetPosition(),this.resize()),t.animations.stopAllPan(),this.itemHolders.forEach((t,i)=>{t.slide&&t.slide.setIsActive(1===i)}),t.currSlide=this.itemHolders[1]?.slide,t.contentLoader.updateLazy(i),t.currSlide&&t.currSlide.applyCurrentZoomPan(),t.dispatch("change")}moveTo(t,i){if(!this.pswp.canLoop()&&i){let i=(this.slideWidth*this._currPositionIndex-t)/this.slideWidth;i+=this.pswp.currIndex;const s=Math.round(t-this.x);(i<0&&s>0||i>=this.pswp.getNumItems()-1&&s<0)&&(t=this.x+.35*s)}this.x=t,this.pswp.container&&a(this.pswp.container,t),this.pswp.dispatch("moveMainScroll",{x:t,dragging:i??!1})}}const z=.003;class C{constructor(t){this.pswp=t,this.isClosed=!0,this.isOpen=!1,this.isClosing=!1,this.isOpening=!1,this._duration=void 0,this._useAnimation=!1,this._croppedZoom=!1,this._animateRootOpacity=!1,this._animateBgOpacity=!1,this._placeholder=void 0,this._opacityElement=void 0,this._cropContainer1=void 0,this._cropContainer2=void 0,this._thumbBounds=void 0,this._prepareOpen=this._prepareOpen.bind(this),t.on("firstZoomPan",this._prepareOpen)}open(){this._prepareOpen(),this._start()}close(){if(this.isClosed||this.isClosing||this.isOpening)return;const t=this.pswp.currSlide;this.isOpen=!1,this.isOpening=!1,this.isClosing=!0,this._duration=this.pswp.options.hideAnimationDuration,t&&t.currZoomLevel*t.width>=this.pswp.options.maxWidthToAnimate&&(this._duration=0),this._applyStartProps(),setTimeout(()=>{this._start()},this._croppedZoom?30:0)}_prepareOpen(){if(this.pswp.off("firstZoomPan",this._prepareOpen),!this.isOpening){const t=this.pswp.currSlide;this.isOpening=!0,this.isClosing=!1,this._duration=this.pswp.options.showAnimationDuration,t&&t.zoomLevels.initial*t.width>=this.pswp.options.maxWidthToAnimate&&(this._duration=0),this._applyStartProps()}}_applyStartProps(){const{pswp:t}=this,i=this.pswp.currSlide,{options:s}=t;if("fade"===s.showHideAnimationType?(s.showHideOpacity=!0,this._thumbBounds=void 0):"none"===s.showHideAnimationType?(s.showHideOpacity=!1,this._duration=0,this._thumbBounds=void 0):this.isOpening&&t._initialThumbBounds?this._thumbBounds=t._initialThumbBounds:this._thumbBounds=this.pswp.getThumbBounds(),this._placeholder=i?.getPlaceholderElement(),t.animations.stopAll(),this._useAnimation=!!(this._duration&&this._duration>50),this._animateZoom=!!this._thumbBounds&&i?.content.usePlaceholder()&&(!this.isClosing||!t.mainScroll.isShifted()),this._animateZoom?this._animateRootOpacity=s.showHideOpacity??!1:(this._animateRootOpacity=!0,this.isOpening&&i&&(i.zoomAndPanToInitial(),i.applyCurrentZoomPan())),this._animateBgOpacity=!this._animateRootOpacity&&this.pswp.options.bgOpacity>z,this._opacityElement=this._animateRootOpacity?t.element:t.bg,!this._useAnimation)return this._duration=0,this._animateZoom=!1,this._animateBgOpacity=!1,this._animateRootOpacity=!0,void(this.isOpening&&(t.element&&(t.element.style.opacity=String(z)),t.applyBgOpacity(1)));this._animateZoom&&this._thumbBounds&&this._thumbBounds.innerRect?(this._croppedZoom=!0,this._cropContainer1=this.pswp.container,this._cropContainer2=this.pswp.currSlide?.holderElement,t.container&&(t.container.style.overflow="hidden",t.container.style.width=t.viewportSize.x+"px")):this._croppedZoom=!1,this.isOpening?(this._animateRootOpacity?(t.element&&(t.element.style.opacity=String(z)),t.applyBgOpacity(1)):(this._animateBgOpacity&&t.bg&&(t.bg.style.opacity=String(z)),t.element&&(t.element.style.opacity="1")),this._animateZoom&&(this._setClosedStateZoomPan(),this._placeholder&&(this._placeholder.style.willChange="transform",this._placeholder.style.opacity=String(z)))):this.isClosing&&(t.mainScroll.itemHolders[0]&&(t.mainScroll.itemHolders[0].el.style.display="none"),t.mainScroll.itemHolders[2]&&(t.mainScroll.itemHolders[2].el.style.display="none"),this._croppedZoom&&0!==t.mainScroll.x&&(t.mainScroll.resetPosition(),t.mainScroll.resize()))}_start(){this.isOpening&&this._useAnimation&&this._placeholder&&"IMG"===this._placeholder.tagName?new Promise(t=>{let i=!1,s=!0;h(this._placeholder).finally(()=>{i=!0,s||t(!0)}),setTimeout(()=>{s=!1,i&&t(!0)},50),setTimeout(t,250)}).finally(()=>this._initiate()):this._initiate()}_initiate(){this.pswp.element?.style.setProperty("--pswp-transition-duration",this._duration+"ms"),this.pswp.dispatch(this.isOpening?"openingAnimationStart":"closingAnimationStart"),this.pswp.dispatch("initialZoom"+(this.isOpening?"In":"Out")),this.pswp.element?.classList.toggle("pswp--ui-visible",this.isOpening),this.isOpening?(this._placeholder&&(this._placeholder.style.opacity="1"),this._animateToOpenState()):this.isClosing&&this._animateToClosedState(),this._useAnimation||this._onAnimationComplete()}_onAnimationComplete(){const{pswp:t}=this;this.isOpen=this.isOpening,this.isClosed=this.isClosing,this.isOpening=!1,this.isClosing=!1,t.dispatch(this.isOpen?"openingAnimationEnd":"closingAnimationEnd"),t.dispatch("initialZoom"+(this.isOpen?"InEnd":"OutEnd")),this.isClosed?t.destroy():this.isOpen&&(this._animateZoom&&t.container&&(t.container.style.overflow="visible",t.container.style.width="100%"),t.currSlide?.applyCurrentZoomPan())}_animateToOpenState(){const{pswp:t}=this;this._animateZoom&&(this._croppedZoom&&this._cropContainer1&&this._cropContainer2&&(this._animateTo(this._cropContainer1,"transform","translate3d(0,0,0)"),this._animateTo(this._cropContainer2,"transform","none")),t.currSlide&&(t.currSlide.zoomAndPanToInitial(),this._animateTo(t.currSlide.container,"transform",t.currSlide.getCurrentTransform()))),this._animateBgOpacity&&t.bg&&this._animateTo(t.bg,"opacity",String(t.options.bgOpacity)),this._animateRootOpacity&&t.element&&this._animateTo(t.element,"opacity","1")}_animateToClosedState(){const{pswp:t}=this;this._animateZoom&&this._setClosedStateZoomPan(!0),this._animateBgOpacity&&t.bgOpacity>.01&&t.bg&&this._animateTo(t.bg,"opacity","0"),this._animateRootOpacity&&t.element&&this._animateTo(t.element,"opacity","0")}_setClosedStateZoomPan(i){if(!this._thumbBounds)return;const{pswp:s}=this,{innerRect:e}=this._thumbBounds,{currSlide:o,viewportSize:n}=s;if(this._croppedZoom&&e&&this._cropContainer1&&this._cropContainer2){const t=-n.x+(this._thumbBounds.x-e.x)+e.w,s=-n.y+(this._thumbBounds.y-e.y)+e.h,o=n.x-e.w,r=n.y-e.h;i?(this._animateTo(this._cropContainer1,"transform",p(t,s)),this._animateTo(this._cropContainer2,"transform",p(o,r))):(a(this._cropContainer1,t,s),a(this._cropContainer2,o,r))}o&&(t(o.pan,e||this._thumbBounds),o.currZoomLevel=this._thumbBounds.w/o.width,i?this._animateTo(o.container,"transform",o.getCurrentTransform()):o.applyCurrentZoomPan())}_animateTo(t,i,s){if(!this._duration)return void(t.style[i]=s);const{animations:e}=this.pswp,o={duration:this._duration,easing:this.pswp.options.easing,onComplete:()=>{e.activeAnimations.length||this._onAnimationComplete()},target:t};o[i]=s,e.startTransition(o)}}class Z{constructor(t){this.pswp=t,t.events.add(t.element,"wheel",this._onWheel.bind(this))}_onWheel(t){t.preventDefault();const{currSlide:i}=this.pswp;let{deltaX:s,deltaY:e}=t;if(i&&!this.pswp.dispatch("wheel",{originalEvent:t}).defaultPrevented)if(t.ctrlKey||this.pswp.options.wheelToZoom){if(i.isZoomable()){let s=-e;1===t.deltaMode?s*=.05:s*=t.deltaMode?1:.002,s=2**s;const o=i.currZoomLevel*s;i.zoomTo(o,{x:t.clientX,y:t.clientY})}}else i.isPannable()&&(1===t.deltaMode&&(s*=18,e*=18),i.panTo(i.pan.x-s,i.pan.y-e))}}class I{constructor(t){this.slide=t,this.currZoomLevel=1,this.center={x:0,y:0},this.max={x:0,y:0},this.min={x:0,y:0}}update(t){this.currZoomLevel=t,this.slide.width?(this._updateAxis("x"),this._updateAxis("y"),this.slide.pswp.dispatch("calcBounds",{slide:this.slide})):this.reset()}_updateAxis(t){const{pswp:i}=this.slide,s=this.slide["x"===t?"width":"height"]*this.currZoomLevel,e=l("x"===t?"left":"top",i.options,i.viewportSize,this.slide.data,this.slide.index),o=this.slide.panAreaSize[t];this.center[t]=Math.round((o-s)/2)+e,this.max[t]=s>o?Math.round(o-s)+e:this.center[t],this.min[t]=s>o?e:this.center[t]}reset(){this.center.x=0,this.center.y=0,this.max.x=0,this.max.y=0,this.min.x=0,this.min.y=0}correctPan(t,i){return s(i,this.max[t],this.min[t])}}class O{constructor(t,i,s){this.data=t,this.index=i,this.pswp=s,this.isActive=i===s.currIndex,this.currentResolution=0,this.panAreaSize={x:0,y:0},this.pan={x:0,y:0},this.isFirstSlide=this.isActive&&!s.opener.isOpen,this.zoomLevels=new c(s.options,t,i,s),this.pswp.dispatch("gettingData",{slide:this,data:this.data,index:i}),this.content=this.pswp.contentLoader.getContentBySlide(this),this.container=r("pswp__zoom-wrap","div"),this.holderElement=null,this.currZoomLevel=1,this.width=this.content.width,this.height=this.content.height,this.heavyAppended=!1,this.bounds=new I(this),this.prevDisplayedWidth=-1,this.prevDisplayedHeight=-1,this.pswp.dispatch("slideInit",{slide:this})}setIsActive(t){t&&!this.isActive?this.activate():!t&&this.isActive&&this.deactivate()}append(t){this.holderElement=t,this.container.style.transformOrigin="0 0",this.data&&(this.calculateSize(),this.load(),this.updateContentSize(),this.appendHeavy(),this.holderElement.appendChild(this.container),this.zoomAndPanToInitial(),this.pswp.dispatch("firstZoomPan",{slide:this}),this.applyCurrentZoomPan(),this.pswp.dispatch("afterSetContent",{slide:this}),this.isActive&&this.activate())}load(){this.content.load(!1),this.pswp.dispatch("slideLoad",{slide:this})}appendHeavy(){const{pswp:t}=this;this.heavyAppended||!t.opener.isOpen||t.mainScroll.isShifted()||(this.isActive,0)||this.pswp.dispatch("appendHeavy",{slide:this}).defaultPrevented||(this.heavyAppended=!0,this.content.append(),this.pswp.dispatch("appendHeavyContent",{slide:this}))}activate(){this.isActive=!0,this.appendHeavy(),this.content.activate(),this.pswp.dispatch("slideActivate",{slide:this})}deactivate(){this.isActive=!1,this.content.deactivate(),this.currZoomLevel!==this.zoomLevels.initial&&this.calculateSize(),this.currentResolution=0,this.zoomAndPanToInitial(),this.applyCurrentZoomPan(),this.updateContentSize(),this.pswp.dispatch("slideDeactivate",{slide:this})}destroy(){this.content.hasSlide=!1,this.content.remove(),this.container.remove(),this.pswp.dispatch("slideDestroy",{slide:this})}resize(){this.currZoomLevel!==this.zoomLevels.initial&&this.isActive?(this.calculateSize(),this.bounds.update(this.currZoomLevel),this.panTo(this.pan.x,this.pan.y)):(this.calculateSize(),this.currentResolution=0,this.zoomAndPanToInitial(),this.applyCurrentZoomPan(),this.updateContentSize())}updateContentSize(t){const i=this.currentResolution||this.zoomLevels.initial;if(!i)return;const s=Math.round(this.width*i)||this.pswp.viewportSize.x,e=Math.round(this.height*i)||this.pswp.viewportSize.y;!this.sizeChanged(s,e)&&!t||this.content.setDisplayedSize(s,e)}sizeChanged(t,i){return(t!==this.prevDisplayedWidth||i!==this.prevDisplayedHeight)&&(this.prevDisplayedWidth=t,this.prevDisplayedHeight=i,!0)}getPlaceholderElement(){return this.content.placeholder?.element}zoomTo(t,e,o,n){const{pswp:a}=this;if(!this.isZoomable()||a.mainScroll.isShifted())return;a.dispatch("beforeZoomTo",{destZoomLevel:t,centerPoint:e,transitionDuration:o}),a.animations.stopAllPan();const r=this.currZoomLevel;n||(t=s(t,this.zoomLevels.min,this.zoomLevels.max)),this.setZoomLevel(t),this.pan.x=this.calculateZoomToPanOffset("x",e,r),this.pan.y=this.calculateZoomToPanOffset("y",e,r),i(this.pan);const h=()=>{this._setResolution(t),this.applyCurrentZoomPan()};o?a.animations.startTransition({isPan:!0,name:"zoomTo",target:this.container,transform:this.getCurrentTransform(),onComplete:h,duration:o,easing:a.options.easing}):h()}toggleZoom(t){this.zoomTo(this.currZoomLevel===this.zoomLevels.initial?this.zoomLevels.secondary:this.zoomLevels.initial,t,this.pswp.options.zoomAnimationDuration)}setZoomLevel(t){this.currZoomLevel=t,this.bounds.update(this.currZoomLevel)}calculateZoomToPanOffset(t,i,s){if(this.bounds.max[t]-this.bounds.min[t]===0)return this.bounds.center[t];i||(i=this.pswp.getViewportCenterPoint()),s||(s=this.zoomLevels.initial);const e=this.currZoomLevel/s;return this.bounds.correctPan(t,(this.pan[t]-i[t])*e+i[t])}panTo(t,i){this.pan.x=this.bounds.correctPan("x",t),this.pan.y=this.bounds.correctPan("y",i),this.applyCurrentZoomPan()}isPannable(){return!!this.width&&this.currZoomLevel>this.zoomLevels.fit}isZoomable(){return!!this.width&&this.content.isZoomable()}applyCurrentZoomPan(){this._applyZoomTransform(this.pan.x,this.pan.y,this.currZoomLevel),this===this.pswp.currSlide&&this.pswp.dispatch("zoomPanUpdate",{slide:this})}zoomAndPanToInitial(){this.currZoomLevel=this.zoomLevels.initial,this.bounds.update(this.currZoomLevel),t(this.pan,this.bounds.center),this.pswp.dispatch("initialZoomPan",{slide:this})}_applyZoomTransform(t,i,s){s/=this.currentResolution||this.zoomLevels.initial,a(this.container,t,i,s)}calculateSize(){const{pswp:i}=this;t(this.panAreaSize,d(i.options,i.viewportSize,this.data,this.index)),this.zoomLevels.update(this.width,this.height,this.panAreaSize),i.dispatch("calcSlideSize",{slide:this})}getCurrentTransform(){const t=this.currZoomLevel/(this.currentResolution||this.zoomLevels.initial);return p(this.pan.x,this.pan.y,t)}_setResolution(t){t!==this.currentResolution&&(this.currentResolution=t,this.updateContentSize(),this.pswp.dispatch("resolutionChanged"))}}function D(t,i,s){t.classList.add("pswp__button--arrow"),t.setAttribute("aria-controls","pswp__items"),i.on("change",()=>{i.options.loop||(t.disabled=s?!(i.currIndex<i.getNumItems()-1):!(i.currIndex>0))})}const E={name:"arrowPrev",className:"pswp__button--arrow--prev",title:"Previous",order:10,isButton:!0,appendTo:"wrapper",html:{isCustomSVG:!0,size:60,inner:'<path d="M29 43l-3 3-16-16 16-16 3 3-13 13 13 13z" id="pswp__icn-arrow"/>',outlineID:"pswp__icn-arrow"},onClick:"prev",onInit:D},M={name:"arrowNext",className:"pswp__button--arrow--next",title:"Next",order:11,isButton:!0,appendTo:"wrapper",html:{isCustomSVG:!0,size:60,inner:'<use xlink:href="#pswp__icn-arrow"/>',outlineID:"pswp__icn-arrow"},onClick:"next",onInit:(t,i)=>{D(t,i,!0)}},F={name:"close",title:"Close",order:20,isButton:!0,html:{isCustomSVG:!0,inner:'<path d="M24 10l-2-2-6 6-6-6-2 2 6 6-6 6 2 2 6-6 6 6 2-2-6-6z" id="pswp__icn-close"/>',outlineID:"pswp__icn-close"},onClick:"close"},B={name:"zoom",title:"Zoom",order:10,isButton:!0,html:{isCustomSVG:!0,inner:'<path d="M17.426 19.926a6 6 0 1 1 1.5-1.5L23 22.5 21.5 24l-4.074-4.074z" id="pswp__icn-zoom"/><path fill="currentColor" class="pswp__zoom-icn-bar-h" d="M11 16v-2h6v2z"/><path fill="currentColor" class="pswp__zoom-icn-bar-v" d="M13 12h2v6h-2z"/>',outlineID:"pswp__icn-zoom"},onClick:"toggleZoom"},R={name:"counter",order:5,onInit:(t,i)=>{i.on("change",()=>{t.innerText=i.currIndex+1+i.options.indexIndicatorSep+i.getNumItems()})}},k={name:"preloader",appendTo:"bar",order:7,html:{isCustomSVG:!0,inner:'<path fill-rule="evenodd" clip-rule="evenodd" d="M21.2 16a5.2 5.2 0 1 1-5.2-5.2V8a8 8 0 1 0 8 8h-2.8Z" id="pswp__icn-loading"/>',outlineID:"pswp__icn-loading"},onInit:(t,i)=>{let s,e=null;const o=i=>{s!==i&&(s=i,((i,s)=>{t.classList.toggle("pswp__preloader--"+i,s)})("active",i))},n=()=>{if(!i.currSlide?.content.isLoading())return o(!1),void(e&&(clearTimeout(e),e=null));e||(e=setTimeout(()=>{o(!!i.currSlide?.content.isLoading()),e=null},i.options.preloaderDelay))};i.on("change",n),i.on("loadComplete",t=>{i.currSlide===t.slide&&n()}),i.ui&&(i.ui.updatePreloaderVisibility=n)}};class H{constructor(t,i){const s=i.name||i.className;let e=i.html;if(!1===t.options[s])return;"string"==typeof t.options[s+"SVG"]&&(e=t.options[s+"SVG"]),t.dispatch("uiElementCreate",{data:i});let o="";i.isButton?(o+="pswp__button ",o+=i.className||`pswp__button--${i.name}`):o+=i.className||`pswp__${i.name}`;let n=i.isButton?i.tagName||"button":i.tagName||"div";n=n.toLowerCase();const a=r(o,n);if(i.isButton){"button"===n&&(a.type="button");let{title:e}=i;const{ariaLabel:o}=i;"string"==typeof t.options[s+"Title"]&&(e=t.options[s+"Title"]),e&&(a.title=e);const r=o||e;r&&a.setAttribute("aria-label",r)}a.innerHTML=function(t){if("string"==typeof t)return t;if(!t||!t.isCustomSVG)return"";const i=t;let s='<svg aria-hidden="true" class="pswp__icn" viewBox="0 0 %d %d" width="%d" height="%d">';return s=s.split("%d").join(i.size||32),i.outlineID&&(s+='<use class="pswp__icn-shadow" xlink:href="#'+i.outlineID+'"/>'),s+=i.inner,s+="</svg>",s}(e),i.onInit&&i.onInit(a,t),i.onClick&&(a.onclick=s=>{"string"==typeof i.onClick?t[i.onClick]():"function"==typeof i.onClick&&i.onClick(s,a,t)});const h=i.appendTo||"bar";let p=t.element;"bar"===h?(t.topBar||(t.topBar=r("pswp__top-bar pswp__hide-on-close","div",t.scrollWrap)),p=t.topBar):(a.classList.add("pswp__hide-on-close"),"wrapper"===h&&(p=t.scrollWrap)),p?.appendChild(t.applyFilters("uiElement",a,i))}}function W(t,i){t.classList.toggle("pswp--zoomed-in",i)}class N{constructor(t){this.pswp=t,this.isRegistered=!1,this.uiElementsData=[],this.items=[],this.updatePreloaderVisibility=()=>{},this._lastUpdatedZoomLevel=void 0}init(){const{pswp:t}=this;this.isRegistered=!1,this.uiElementsData=[F,E,M,B,k,R],t.dispatch("uiRegister"),this.uiElementsData.sort((t,i)=>(t.order||0)-(i.order||0)),this.items=[],this.isRegistered=!0,this.uiElementsData.forEach(t=>{this.registerElement(t)}),t.on("change",()=>{t.element?.classList.toggle("pswp--one-slide",1===t.getNumItems())}),t.on("zoomPanUpdate",()=>this._onZoomPanUpdate())}registerElement(t){this.isRegistered?this.items.push(new H(this.pswp,t)):this.uiElementsData.push(t)}_onZoomPanUpdate(){const{template:t,currSlide:i,options:s}=this.pswp;if(this.pswp.opener.isClosing||!t||!i)return;let{currZoomLevel:e}=i;if(this.pswp.opener.isOpen||(e=i.zoomLevels.initial),e===this._lastUpdatedZoomLevel)return;this._lastUpdatedZoomLevel=e;const o=i.zoomLevels.initial-i.zoomLevels.secondary;if(Math.abs(o)<.01||!i.isZoomable())return W(t,!1),void t.classList.remove("pswp--zoom-allowed");t.classList.add("pswp--zoom-allowed");W(t,(e===i.zoomLevels.initial?i.zoomLevels.secondary:i.zoomLevels.initial)<=e),("zoom"===s.imageClickAction||"zoom-or-close"===s.imageClickAction)&&t.classList.add("pswp--click-to-zoom")}}const V="cubic-bezier(.4,0,.22,1)";class q{constructor(t){this.props=t;const{target:i,onComplete:s,transform:e,onFinish:o=()=>{},duration:n=333,easing:a=V}=t;this.onFinish=o;const r=e?"transform":"opacity",h=t[r]??"";this._target=i,this._onComplete=s,this._finished=!1,this._onTransitionEnd=this._onTransitionEnd.bind(this),this._helperTimeout=setTimeout(()=>{u(i,r,n,a),this._helperTimeout=setTimeout(()=>{i.addEventListener("transitionend",this._onTransitionEnd,!1),i.addEventListener("transitioncancel",this._onTransitionEnd,!1),this._helperTimeout=setTimeout(()=>{this._finalizeAnimation()},n+500),i.style[r]=h},30)},0)}_onTransitionEnd(t){t.target===this._target&&this._finalizeAnimation()}_finalizeAnimation(){this._finished||(this._finished=!0,this.onFinish(),this._onComplete&&this._onComplete())}destroy(){this._helperTimeout&&(clearTimeout(this._helperTimeout),this._helperTimeout=null),m(this._target),this._target.removeEventListener("transitionend",this._onTransitionEnd,!1),this._target.removeEventListener("transitioncancel",this._onTransitionEnd,!1),this._finished||this._finalizeAnimation()}}class U{constructor(t,i,s){this.velocity=1e3*t,this._dampingRatio=i||.75,this._naturalFrequency=s||12,this._dampedFrequency=this._naturalFrequency,this._dampingRatio<1&&(this._dampedFrequency*=Math.sqrt(1-this._dampingRatio*this._dampingRatio))}easeFrame(t,i){let s,e=0;i/=1e3;const o=Math.E**(-this._dampingRatio*this._naturalFrequency*i);if(1===this._dampingRatio)s=this.velocity+this._naturalFrequency*t,e=(t+s*i)*o,this.velocity=e*-this._naturalFrequency+s*o;else if(this._dampingRatio<1){s=1/this._dampedFrequency*(this._dampingRatio*this._naturalFrequency*t+this.velocity);const n=Math.cos(this._dampedFrequency*i),a=Math.sin(this._dampedFrequency*i);e=o*(t*n+s*a),this.velocity=e*-this._naturalFrequency*this._dampingRatio+o*(-this._dampedFrequency*t*a+this._dampedFrequency*s*n)}return e}}class G{constructor(t){this.props=t,this._raf=0;const{start:i,end:s,velocity:e,onUpdate:o,onComplete:n,onFinish:a=()=>{},dampingRatio:r,naturalFrequency:h}=t;this.onFinish=a;const p=new U(e,r,h);let l=Date.now(),c=i-s;const d=()=>{this._raf&&(c=p.easeFrame(c,Date.now()-l),Math.abs(c)<1&&Math.abs(p.velocity)<50?(o(s),n&&n(),this.onFinish()):(l=Date.now(),o(c+s),this._raf=requestAnimationFrame(d)))};this._raf=requestAnimationFrame(d)}destroy(){this._raf>=0&&cancelAnimationFrame(this._raf),this._raf=0}}class X{constructor(){this.activeAnimations=[]}startSpring(t){this._start(t,!0)}startTransition(t){this._start(t)}_start(t,i){const s=i?new G(t):new q(t);return this.activeAnimations.push(s),s.onFinish=()=>this.stop(s),s}stop(t){t.destroy();const i=this.activeAnimations.indexOf(t);i>-1&&this.activeAnimations.splice(i,1)}stopAll(){this.activeAnimations.forEach(t=>{t.destroy()}),this.activeAnimations=[]}stopAllPan(){this.activeAnimations=this.activeAnimations.filter(t=>!t.props.isPan||(t.destroy(),!1))}stopMainScroll(){this.activeAnimations=this.activeAnimations.filter(t=>!t.props.isMainScroll||(t.destroy(),!1))}isPanRunning(){return this.activeAnimations.some(t=>t.props.isPan)}}let K=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:()=>{K=!0}}))}catch{}class Y{constructor(){this._pool=[]}add(t,i,s,e){this._toggleListener(t,i,s,e)}remove(t,i,s,e){this._toggleListener(t,i,s,e,!0)}removeAll(){this._pool.forEach(t=>{this._toggleListener(t.target,t.type,t.listener,t.passive,!0,!0)}),this._pool=[]}_toggleListener(t,i,s,e,o,n){if(!t)return;const a=o?"removeEventListener":"addEventListener";i.split(" ").forEach(i=>{if(i){n||(o?this._pool=this._pool.filter(e=>e.type!==i||e.listener!==s||e.target!==t):this._pool.push({target:t,type:i,listener:s,passive:e}));const r=!!K&&{passive:e||!1};t[a](i,s,r)}})}}const j={allowPanToNext:!0,spacing:.1,loop:!0,pinchToClose:!0,closeOnVerticalDrag:!0,hideAnimationDuration:333,showAnimationDuration:333,zoomAnimationDuration:333,escKey:!0,arrowKeys:!0,trapFocus:!0,returnFocus:!0,maxWidthToAnimate:4e3,clickToCloseNonZoomable:!0,imageClickAction:"zoom-or-close",bgClickAction:"close",tapAction:"toggle-controls",doubleTapAction:"zoom",indexIndicatorSep:" / ",preloaderDelay:2e3,bgOpacity:.8,index:0,errorMsg:"The image cannot be loaded",preload:[1,2],easing:"cubic-bezier(.4,0,.22,1)"};class $ extends _{constructor(t){super(),this.options=this._prepareOptions(t||{}),this.offset={x:0,y:0},this._prevViewportSize={x:0,y:0},this.viewportSize={x:0,y:0},this.bgOpacity=1,this.currIndex=0,this.potentialIndex=0,this.isOpen=!1,this.isDestroying=!1,this.hasMouse=!1,this._initialItemData={},this._initialThumbBounds=void 0,this.topBar=void 0,this.element=void 0,this.template=void 0,this.container=void 0,this.scrollWrap=void 0,this.currSlide=void 0,this.events=new Y,this.animations=new X,this.mainScroll=new A(this),this.gestures=new S(this),this.opener=new C(this),this.keyboard=new L(this),this.contentLoader=new v(this)}init(){if(this.isOpen||this.isDestroying)return!1;this.isOpen=!0,this.dispatch("init"),this.dispatch("beforeOpen"),this._createMainStructure();let t="pswp--open";return this.gestures.supportsTouch&&(t+=" pswp--touch"),this.options.mainClass&&(t+=" "+this.options.mainClass),this.element&&(this.element.className+=" "+t),this.currIndex=this.options.index||0,this.potentialIndex=this.currIndex,this.dispatch("firstUpdate"),this.scrollWheel=new Z(this),(Number.isNaN(this.currIndex)||this.currIndex<0||this.currIndex>=this.getNumItems())&&(this.currIndex=0),this.gestures.supportsTouch||this.mouseDetected(),this.updateSize(),this.offset.y=window.pageYOffset,this._initialItemData=this.getItemData(this.currIndex),this.dispatch("gettingData",{index:this.currIndex,data:this._initialItemData,slide:void 0}),this._initialThumbBounds=this.getThumbBounds(),this.dispatch("initialLayout"),this.on("openingAnimationEnd",()=>{const{itemHolders:t}=this.mainScroll;t[0]&&(t[0].el.style.display="block",this.setContent(t[0],this.currIndex-1)),t[2]&&(t[2].el.style.display="block",this.setContent(t[2],this.currIndex+1)),this.appendHeavy(),this.contentLoader.updateLazy(),this.events.add(window,"resize",this._handlePageResize.bind(this)),this.events.add(window,"scroll",this._updatePageScrollOffset.bind(this)),this.dispatch("bindEvents")}),this.mainScroll.itemHolders[1]&&this.setContent(this.mainScroll.itemHolders[1],this.currIndex),this.dispatch("change"),this.opener.open(),this.dispatch("afterInit"),!0}getLoopedIndex(t){const i=this.getNumItems();return this.options.loop&&(t>i-1&&(t-=i),t<0&&(t+=i)),s(t,0,i-1)}appendHeavy(){this.mainScroll.itemHolders.forEach(t=>{t.slide?.appendHeavy()})}goTo(t){this.mainScroll.moveIndexBy(this.getLoopedIndex(t)-this.potentialIndex,!0)}next(){this.goTo(this.potentialIndex+1)}prev(){this.goTo(this.potentialIndex-1)}zoomTo(...t){this.currSlide?.zoomTo(...t)}toggleZoom(){this.currSlide?.toggleZoom()}close(){!this.opener.isOpen||this.isDestroying||(this.isDestroying=!0,this.dispatch("close"),this.events.removeAll(),this.opener.close())}destroy(){if(!this.isDestroying)return this.options.showHideAnimationType="none",void this.close();this.dispatch("destroy"),this._listeners={},this.scrollWrap&&(this.scrollWrap.ontouchmove=null,this.scrollWrap.ontouchend=null),this.element?.remove(),this.mainScroll.itemHolders.forEach(t=>{t.slide?.destroy()}),this.contentLoader.destroy(),this.events.removeAll()}refreshSlideContent(t){this.contentLoader.removeByIndex(t),this.mainScroll.itemHolders.forEach((i,s)=>{let e=(this.currSlide?.index??0)-1+s;this.canLoop()&&(e=this.getLoopedIndex(e)),e===t&&(this.setContent(i,t,!0),1===s&&(this.currSlide=i.slide,i.slide?.setIsActive(!0)))}),this.dispatch("change")}setContent(t,i,s){if(this.canLoop()&&(i=this.getLoopedIndex(i)),t.slide){if(t.slide.index===i&&!s)return;t.slide.destroy(),t.slide=void 0}if(!this.canLoop()&&(i<0||i>=this.getNumItems()))return;const e=this.getItemData(i);t.slide=new O(e,i,this),i===this.currIndex&&(this.currSlide=t.slide),t.slide.append(t.el)}getViewportCenterPoint(){return{x:this.viewportSize.x/2,y:this.viewportSize.y/2}}updateSize(i){if(this.isDestroying)return;const s=g(this.options,this);!i&&o(s,this._prevViewportSize)||(t(this._prevViewportSize,s),this.dispatch("beforeResize"),t(this.viewportSize,this._prevViewportSize),this._updatePageScrollOffset(),this.dispatch("viewportSize"),this.mainScroll.resize(this.opener.isOpen),!this.hasMouse&&window.matchMedia("(any-hover: hover)").matches&&this.mouseDetected(),this.dispatch("resize"))}applyBgOpacity(t){this.bgOpacity=Math.max(t,0),this.bg&&(this.bg.style.opacity=String(this.bgOpacity*this.options.bgOpacity))}mouseDetected(){this.hasMouse||(this.hasMouse=!0,this.element?.classList.add("pswp--has_mouse"))}_handlePageResize(){this.updateSize(),/iPhone|iPad|iPod/i.test(window.navigator.userAgent)&&setTimeout(()=>{this.updateSize()},500)}_updatePageScrollOffset(){this.setScrollOffset(0,window.pageYOffset)}setScrollOffset(t,i){this.offset.x=t,this.offset.y=i,this.dispatch("updateScrollOffset")}_createMainStructure(){this.element=r("pswp","div"),this.element.setAttribute("tabindex","-1"),this.element.setAttribute("role","dialog"),this.template=this.element,this.bg=r("pswp__bg","div",this.element),this.scrollWrap=r("pswp__scroll-wrap","section",this.element),this.container=r("pswp__container","div",this.scrollWrap),this.scrollWrap.setAttribute("aria-roledescription","carousel"),this.container.setAttribute("aria-live","off"),this.container.setAttribute("id","pswp__items"),this.mainScroll.appendHolders(),this.ui=new N(this),this.ui.init(),(this.options.appendToEl||document.body).appendChild(this.element)}getThumbBounds(){return function(t,i,s){const e=s.dispatch("thumbBounds",{index:t,itemData:i,instance:s});if(e.thumbBounds)return e.thumbBounds;const{element:o}=i;let n,a;if(o&&!1!==s.options.thumbSelector){const t=s.options.thumbSelector||"img";a=o.matches(t)?o:o.querySelector(t)}return a=s.applyFilters("thumbEl",a,i,t),a&&(n=i.thumbCropped?function(t,i,s){const e=t.getBoundingClientRect(),o=e.width/i,n=e.height/s,a=o>n?o:n,r=(e.width-i*a)/2,h=(e.height-s*a)/2,p={x:e.left+r,y:e.top+h,w:i*a};return p.innerRect={w:e.width,h:e.height,x:r,y:h},p}(a,i.width||i.w||0,i.height||i.h||0):function(t){const i=t.getBoundingClientRect();return{x:i.left,y:i.top,w:i.width}}(a)),s.applyFilters("thumbBounds",n,i,t)}(this.currIndex,this.currSlide?this.currSlide.data:this._initialItemData,this)}canLoop(){return this.options.loop&&this.getNumItems()>2}_prepareOptions(t){return window.matchMedia("(prefers-reduced-motion), (update: slow)").matches&&(t.showHideAnimationType="none",t.zoomAnimationDuration=0),{...j,...t}}}export{$ as default};
1
+ import{e as t,r as i,c as s,g as e,p as o,s as n,a,b as r,d as h,t as p,f as l,Z as c,h as d,i as u,j as m,P as _,C as v,k as g}from"./CE-MbwCB.js";class y{constructor(t){this.gestures=t,this.pswp=t.pswp,this.startPan={x:0,y:0}}start(){this.pswp.currSlide&&t(this.startPan,this.pswp.currSlide.pan),this.pswp.animations.stopAll()}change(){const{p1:t,prevP1:s,dragAxis:e}=this.gestures,{currSlide:o}=this.pswp;if("y"===e&&this.pswp.options.closeOnVerticalDrag&&o&&o.currZoomLevel<=o.zoomLevels.fit&&!this.gestures.isMultitouch){const i=o.pan.y+(t.y-s.y);if(!this.pswp.dispatch("verticalDrag",{panY:i}).defaultPrevented){this._setPanWithFriction("y",i,.6);const t=1-Math.abs(this._getVerticalDragRatio(o.pan.y));this.pswp.applyBgOpacity(t),o.applyCurrentZoomPan()}}else this._panOrMoveMainScroll("x")||(this._panOrMoveMainScroll("y"),o&&(i(o.pan),o.applyCurrentZoomPan()))}end(){const{velocity:t}=this.gestures,{mainScroll:i,currSlide:s}=this.pswp;let e=0;if(this.pswp.animations.stopAll(),i.isShifted()){const s=(i.x-i.getCurrSlideX())/this.pswp.viewportSize.x;t.x<-.5&&s<0||t.x<.1&&s<-.5?(e=1,t.x=Math.min(t.x,0)):(t.x>.5&&s>0||t.x>-.1&&s>.5)&&(e=-1,t.x=Math.max(t.x,0)),i.moveIndexBy(e,!0,t.x,!0)}s&&s.currZoomLevel>s.zoomLevels.max||this.gestures.isMultitouch?this.gestures.zoomLevels.correctZoomPan(!0):(this._finishPanGestureForAxis("x"),this._finishPanGestureForAxis("y"))}_finishPanGestureForAxis(t){const{velocity:i}=this.gestures,{currSlide:e}=this.pswp;if(!e)return;const{pan:o,bounds:n}=e,a=o[t],r=this.pswp.bgOpacity<1&&"y"===t,h=a+function(t,i){return t*i/(1-i)}(i[t],.995);if(r){const t=this._getVerticalDragRatio(a),i=this._getVerticalDragRatio(h);if(t<0&&i<-.4||t>0&&i>.4)return void this.pswp.close()}const p=n.correctPan(t,h);if(a===p)return;const l=p===h?1:.82,c=this.pswp.bgOpacity,d=p-a;this.pswp.animations.startSpring({name:"panGesture"+t,isPan:!0,start:a,end:p,velocity:i[t],dampingRatio:l,onUpdate:i=>{if(r&&this.pswp.bgOpacity<1){const t=1-(p-i)/d;this.pswp.applyBgOpacity(s(c+(1-c)*t,0,1))}o[t]=Math.floor(i),e.applyCurrentZoomPan()}})}_panOrMoveMainScroll(t){const{p1:i,dragAxis:s,prevP1:e,isMultitouch:o}=this.gestures,{currSlide:n,mainScroll:a}=this.pswp,r=i[t]-e[t],h=a.x+r;if(!r||!n)return!1;if("x"===t&&!n.isPannable()&&!o)return a.moveTo(h,!0),!0;const{bounds:p}=n,l=n.pan[t]+r;if(this.pswp.options.allowPanToNext&&"x"===s&&"x"===t&&!o){const i=a.getCurrSlideX(),s=a.x-i,e=r>0,o=!e;if(l>p.min[t]&&e){if(p.min[t]<=this.startPan[t])return a.moveTo(h,!0),!0;this._setPanWithFriction(t,l)}else if(l<p.max[t]&&o){if(this.startPan[t]<=p.max[t])return a.moveTo(h,!0),!0;this._setPanWithFriction(t,l)}else if(0!==s){if(s>0)return a.moveTo(Math.max(h,i),!0),!0;if(s<0)return a.moveTo(Math.min(h,i),!0),!0}else this._setPanWithFriction(t,l)}else"y"===t?!a.isShifted()&&p.min.y!==p.max.y&&this._setPanWithFriction(t,l):this._setPanWithFriction(t,l);return!1}_getVerticalDragRatio(t){return(t-(this.pswp.currSlide?.bounds.center.y??0))/(this.pswp.viewportSize.y/3)}_setPanWithFriction(t,i,s){const{currSlide:e}=this.pswp;if(!e)return;const{pan:o,bounds:n}=e;if(n.correctPan(t,i)!==i||s){const e=Math.round(i-o[t]);o[t]+=e*(s||.35)}else o[t]=i}}function w(t){return!!t.target.closest(".pswp__container")}class f{constructor(t){this.gestures=t}click(t,i){const s=i.target.classList,e=s.contains("pswp__img"),o=s.contains("pswp__item")||s.contains("pswp__zoom-wrap");e?this._doClickOrTapAction("imageClick",t,i):o&&this._doClickOrTapAction("bgClick",t,i)}tap(t,i){w(i)&&this._doClickOrTapAction("tap",t,i)}doubleTap(t,i){w(i)&&this._doClickOrTapAction("doubleTap",t,i)}_doClickOrTapAction(t,i,s){const{pswp:e}=this.gestures,{currSlide:o}=e,n=t+"Action",a=e.options[n];if(!e.dispatch(n,{point:i,originalEvent:s}).defaultPrevented){if("function"==typeof a)return void a.call(e,i,s);switch(a){case"close":case"next":e[a]();break;case"zoom":o?.toggleZoom(i);break;case"zoom-or-close":o?.isZoomable()&&o.zoomLevels.secondary!==o.zoomLevels.initial?o.toggleZoom(i):e.options.clickToCloseNonZoomable&&e.close();break;case"toggle-controls":this.gestures.pswp.element?.classList.toggle("pswp--ui-visible")}}}}function P(t,i,s){return t.x=(i.x+s.x)/2,t.y=(i.y+s.y)/2,t}class x{constructor(t){this.gestures=t,this._startPan={x:0,y:0},this._startZoomPoint={x:0,y:0},this._zoomPoint={x:0,y:0},this._wasOverFitZoomLevel=!1,this._startZoomLevel=1}start(){const{currSlide:i}=this.gestures.pswp;i&&(this._startZoomLevel=i.currZoomLevel,t(this._startPan,i.pan)),this.gestures.pswp.animations.stopAllPan(),this._wasOverFitZoomLevel=!1}change(){const{p1:t,startP1:i,p2:s,startP2:o,pswp:n}=this.gestures,{currSlide:a}=n;if(!a)return;const r=a.zoomLevels.min,h=a.zoomLevels.max;if(!a.isZoomable()||n.mainScroll.isShifted())return;P(this._startZoomPoint,i,o),P(this._zoomPoint,t,s);let p=1/e(i,o)*e(t,s)*this._startZoomLevel;if(p>a.zoomLevels.initial+a.zoomLevels.initial/15&&(this._wasOverFitZoomLevel=!0),p<r)if(n.options.pinchToClose&&!this._wasOverFitZoomLevel&&this._startZoomLevel<=a.zoomLevels.initial){const t=1-(r-p)/(r/1.2);n.dispatch("pinchClose",{bgOpacity:t}).defaultPrevented||n.applyBgOpacity(t)}else p=r-.15*(r-p);else p>h&&(p=h+.05*(p-h));a.pan.x=this._calculatePanForZoomLevel("x",p),a.pan.y=this._calculatePanForZoomLevel("y",p),a.setZoomLevel(p),a.applyCurrentZoomPan()}end(){const{pswp:t}=this.gestures,{currSlide:i}=t;(!i||i.currZoomLevel<i.zoomLevels.initial)&&!this._wasOverFitZoomLevel&&t.options.pinchToClose?t.close():this.correctZoomPan()}_calculatePanForZoomLevel(t,i){const s=i/this._startZoomLevel;return this._zoomPoint[t]-(this._startZoomPoint[t]-this._startPan[t])*s}correctZoomPan(i){const{pswp:e}=this.gestures,{currSlide:n}=e;if(!n?.isZoomable())return;0===this._zoomPoint.x&&(i=!0);const a=n.currZoomLevel;let r,h=!0;a<n.zoomLevels.initial?r=n.zoomLevels.initial:a>n.zoomLevels.max?r=n.zoomLevels.max:(h=!1,r=a);const p=e.bgOpacity,l=e.bgOpacity<1,c=t({x:0,y:0},n.pan);let d=t({x:0,y:0},c);i&&(this._zoomPoint.x=0,this._zoomPoint.y=0,this._startZoomPoint.x=0,this._startZoomPoint.y=0,this._startZoomLevel=a,t(this._startPan,c)),h&&(d={x:this._calculatePanForZoomLevel("x",r),y:this._calculatePanForZoomLevel("y",r)}),n.setZoomLevel(r),d={x:n.bounds.correctPan("x",d.x),y:n.bounds.correctPan("y",d.y)},n.setZoomLevel(a);const u=!o(d,c);if(!u&&!h&&!l)return n._setResolution(r),void n.applyCurrentZoomPan();e.animations.stopAllPan(),e.animations.startSpring({isPan:!0,start:0,end:1e3,velocity:0,dampingRatio:1,naturalFrequency:40,onUpdate:t=>{if(t/=1e3,u||h){if(u&&(n.pan.x=c.x+(d.x-c.x)*t,n.pan.y=c.y+(d.y-c.y)*t),h){const i=a+(r-a)*t;n.setZoomLevel(i)}n.applyCurrentZoomPan()}l&&e.bgOpacity<1&&e.applyBgOpacity(s(p+(1-p)*t,0,1))},onComplete:()=>{n._setResolution(r),n.applyCurrentZoomPan()}})}}class S{constructor(t){this.pswp=t,this.dragAxis=null,this.p1={x:0,y:0},this.p2={x:0,y:0},this.prevP1={x:0,y:0},this.prevP2={x:0,y:0},this.startP1={x:0,y:0},this.startP2={x:0,y:0},this.velocity={x:0,y:0},this._lastStartP1={x:0,y:0},this._intervalP1={x:0,y:0},this._numActivePoints=0,this._ongoingPointers=[],this._touchEventEnabled="ontouchstart"in window,this._pointerEventEnabled=!!window.PointerEvent,this.supportsTouch=this._touchEventEnabled||this._pointerEventEnabled&&navigator.maxTouchPoints>1,this._numActivePoints=0,this._intervalTime=0,this._velocityCalculated=!1,this.isMultitouch=!1,this.isDragging=!1,this.isZooming=!1,this.raf=null,this._tapTimer=null,this.supportsTouch||(t.options.allowPanToNext=!1),this.drag=new y(this),this.zoomLevels=new x(this),this.tapHandler=new f(this),t.on("bindEvents",()=>{t.events.add(t.scrollWrap,"click",this._onClick.bind(this)),this._pointerEventEnabled?this._bindEvents("pointer","down","up","cancel"):this._touchEventEnabled?(this._bindEvents("touch","start","end","cancel"),t.scrollWrap&&(t.scrollWrap.ontouchmove=()=>{},t.scrollWrap.ontouchend=()=>{})):this._bindEvents("mouse","down","up")})}_bindEvents(t,i,s,e){const{pswp:o}=this,{events:n}=o,a=e?t+e:"";n.add(o.scrollWrap,t+i,this.onPointerDown.bind(this)),n.add(window,t+"move",this.onPointerMove.bind(this)),n.add(window,t+s,this.onPointerUp.bind(this)),a&&n.add(o.scrollWrap,a,this.onPointerUp.bind(this))}onPointerDown(i){const s="mousedown"===i.type||"mouse"===i.pointerType;if(s&&i.button>0)return;const{pswp:e}=this;e.opener.isOpen?e.dispatch("pointerDown",{originalEvent:i}).defaultPrevented||(s&&(e.mouseDetected(),this._preventPointerEventBehaviour(i,"down")),e.animations.stopAll(),this._updatePoints(i,"down"),1===this._numActivePoints&&(this.dragAxis=null,t(this.startP1,this.p1)),this._numActivePoints>1?(this._clearTapTimer(),this.isMultitouch=!0):this.isMultitouch=!1):i.preventDefault()}onPointerMove(i){this._preventPointerEventBehaviour(i,"move"),this._numActivePoints&&(this._updatePoints(i,"move"),!this.pswp.dispatch("pointerMove",{originalEvent:i}).defaultPrevented&&(1!==this._numActivePoints||this.isDragging?this._numActivePoints>1&&!this.isZooming&&(this._finishDrag(),this.isZooming=!0,this._updateStartPoints(),this.zoomLevels.start(),this._rafStopLoop(),this._rafRenderLoop()):(this.dragAxis||this._calculateDragDirection(),this.dragAxis&&!this.isDragging&&(this.isZooming&&(this.isZooming=!1,this.zoomLevels.end()),this.isDragging=!0,this._clearTapTimer(),this._updateStartPoints(),this._intervalTime=Date.now(),this._velocityCalculated=!1,t(this._intervalP1,this.p1),this.velocity.x=0,this.velocity.y=0,this.drag.start(),this._rafStopLoop(),this._rafRenderLoop()))))}_finishDrag(){this.isDragging&&(this.isDragging=!1,this._velocityCalculated||this._updateVelocity(!0),this.drag.end(),this.dragAxis=null)}onPointerUp(t){this._numActivePoints&&(this._updatePoints(t,"up"),!this.pswp.dispatch("pointerUp",{originalEvent:t}).defaultPrevented&&(0===this._numActivePoints&&(this._rafStopLoop(),this.isDragging?this._finishDrag():!this.isZooming&&!this.isMultitouch&&this._finishTap(t)),this._numActivePoints<2&&this.isZooming&&(this.isZooming=!1,this.zoomLevels.end(),1===this._numActivePoints&&(this.dragAxis=null,this._updateStartPoints()))))}_rafRenderLoop(){(this.isDragging||this.isZooming)&&(this._updateVelocity(),this.isDragging?o(this.p1,this.prevP1)||this.drag.change():(!o(this.p1,this.prevP1)||!o(this.p2,this.prevP2))&&this.zoomLevels.change(),this._updatePrevPoints(),this.raf=requestAnimationFrame(this._rafRenderLoop.bind(this)))}_updateVelocity(i){const s=Date.now(),e=s-this._intervalTime;e<50&&!i||(this.velocity.x=this._getVelocity("x",e),this.velocity.y=this._getVelocity("y",e),this._intervalTime=s,t(this._intervalP1,this.p1),this._velocityCalculated=!0)}_finishTap(i){const{mainScroll:s}=this.pswp;if(s.isShifted())return void s.moveIndexBy(0,!0);if(i.type.indexOf("cancel")>0)return;if("mouseup"===i.type||"mouse"===i.pointerType)return void this.tapHandler.click(this.startP1,i);const o=this.pswp.options.doubleTapAction?300:0;this._tapTimer?(this._clearTapTimer(),e(this._lastStartP1,this.startP1)<25&&this.tapHandler.doubleTap(this.startP1,i)):(t(this._lastStartP1,this.startP1),this._tapTimer=setTimeout(()=>{this.tapHandler.tap(this.startP1,i),this._clearTapTimer()},o))}_clearTapTimer(){this._tapTimer&&(clearTimeout(this._tapTimer),this._tapTimer=null)}_getVelocity(t,i){const s=this.p1[t]-this._intervalP1[t];return Math.abs(s)>1&&i>5?s/i:0}_rafStopLoop(){this.raf&&(cancelAnimationFrame(this.raf),this.raf=null)}_preventPointerEventBehaviour(t,i){this.pswp.applyFilters("preventPointerEvent",!0,t,i)&&t.preventDefault()}_updatePoints(i,s){if(this._pointerEventEnabled){const e=i,o=this._ongoingPointers.findIndex(t=>t.id===e.pointerId);"up"===s&&o>-1?this._ongoingPointers.splice(o,1):"down"===s&&-1===o?this._ongoingPointers.push(this._convertEventPosToPoint(e,{x:0,y:0})):o>-1&&this._convertEventPosToPoint(e,this._ongoingPointers[o]),this._numActivePoints=this._ongoingPointers.length,this._numActivePoints>0&&t(this.p1,this._ongoingPointers[0]),this._numActivePoints>1&&t(this.p2,this._ongoingPointers[1])}else{const t=i;this._numActivePoints=0,t.type.indexOf("touch")>-1?t.touches&&t.touches.length>0&&(this._convertEventPosToPoint(t.touches[0],this.p1),this._numActivePoints++,t.touches.length>1&&(this._convertEventPosToPoint(t.touches[1],this.p2),this._numActivePoints++)):(this._convertEventPosToPoint(i,this.p1),"up"===s?this._numActivePoints=0:this._numActivePoints++)}}_updatePrevPoints(){t(this.prevP1,this.p1),t(this.prevP2,this.p2)}_updateStartPoints(){t(this.startP1,this.p1),t(this.startP2,this.p2),this._updatePrevPoints()}_calculateDragDirection(){if(this.pswp.mainScroll.isShifted())this.dragAxis="x";else{const t=Math.abs(this.p1.x-this.startP1.x)-Math.abs(this.p1.y-this.startP1.y);if(0!==t){const i=t>0?"x":"y";Math.abs(this.p1[i]-this.startP1[i])>=10&&(this.dragAxis=i)}}}_convertEventPosToPoint(t,i){return i.x=t.pageX-this.pswp.offset.x,i.y=t.pageY-this.pswp.offset.y,"pointerId"in t?i.id=t.pointerId:void 0!==t.identifier&&(i.id=t.identifier),i}_onClick(t){this.pswp.mainScroll.isShifted()&&(t.preventDefault(),t.stopPropagation())}}const b={Escape:27,z:90,ArrowLeft:37,ArrowUp:38,ArrowRight:39,ArrowDown:40,Tab:9},T=(t,i)=>i?t:b[t];class L{constructor(t){this.pswp=t,this._wasFocused=!1,t.on("bindEvents",()=>{t.options.trapFocus&&(t.options.initialPointerPos||this._focusRoot(),t.events.add(document,"focusin",this._onFocusIn.bind(this))),t.events.add(document,"keydown",this._onKeyDown.bind(this))});const i=document.activeElement;t.on("destroy",()=>{t.options.returnFocus&&i&&this._wasFocused&&i.focus()})}_focusRoot(){!this._wasFocused&&this.pswp.element&&(this.pswp.element.focus(),this._wasFocused=!0)}_onKeyDown(t){const{pswp:i}=this;if(i.dispatch("keydown",{originalEvent:t}).defaultPrevented||n(t))return;let s,e,o=!1;const a="key"in t;switch(a?t.key:t.keyCode){case T("Escape",a):i.options.escKey&&(s="close");break;case T("z",a):s="toggleZoom";break;case T("ArrowLeft",a):e="x";break;case T("ArrowUp",a):e="y";break;case T("ArrowRight",a):e="x",o=!0;break;case T("ArrowDown",a):o=!0,e="y";break;case T("Tab",a):this._focusRoot()}if(e){t.preventDefault();const{currSlide:n}=i;i.options.arrowKeys&&"x"===e&&i.getNumItems()>1?s=o?"next":"prev":n&&n.currZoomLevel>n.zoomLevels.fit&&(n.pan[e]+=o?-80:80,n.panTo(n.pan.x,n.pan.y))}s&&(t.preventDefault(),i[s]())}_onFocusIn(t){const{template:i}=this.pswp;i&&document!==t.target&&i!==t.target&&!i.contains(t.target)&&i.focus()}}class A{constructor(t){this.pswp=t,this.x=0,this.slideWidth=0,this._currPositionIndex=0,this._prevPositionIndex=0,this._containerShiftIndex=-1,this.itemHolders=[]}resize(t){const{pswp:i}=this,s=Math.round(i.viewportSize.x+i.viewportSize.x*i.options.spacing),e=s!==this.slideWidth;e&&(this.slideWidth=s,this.moveTo(this.getCurrSlideX())),this.itemHolders.forEach((i,s)=>{e&&a(i.el,(s+this._containerShiftIndex)*this.slideWidth),t&&i.slide&&i.slide.resize()})}resetPosition(){this._currPositionIndex=0,this._prevPositionIndex=0,this.slideWidth=0,this._containerShiftIndex=-1}appendHolders(){this.itemHolders=[];for(let t=0;t<3;t++){const i=r("pswp__item","div",this.pswp.container);i.setAttribute("role","group"),i.setAttribute("aria-roledescription","slide"),i.setAttribute("aria-hidden","true"),i.style.display=1===t?"block":"none",this.itemHolders.push({el:i})}}canBeSwiped(){return this.pswp.getNumItems()>1}moveIndexBy(t,i,s){const{pswp:e}=this;let o=e.potentialIndex+t;const n=e.getNumItems();if(e.canLoop()){o=e.getLoopedIndex(o);const i=(t+n)%n;t=i<=n/2?i:i-n}else o<0?o=0:o>=n&&(o=n-1),t=o-e.potentialIndex;e.potentialIndex=o,this._currPositionIndex-=t,e.animations.stopMainScroll();const a=this.getCurrSlideX();if(i){e.animations.startSpring({isMainScroll:!0,start:this.x,end:a,velocity:s||0,naturalFrequency:30,dampingRatio:1,onUpdate:t=>{this.moveTo(t)},onComplete:()=>{this.updateCurrItem(),e.appendHeavy()}});let t=e.potentialIndex-e.currIndex;if(e.canLoop()){const i=(t+n)%n;t=i<=n/2?i:i-n}Math.abs(t)>1&&this.updateCurrItem()}else this.moveTo(a),this.updateCurrItem();return!!t}getCurrSlideX(){return this.slideWidth*this._currPositionIndex}isShifted(){return this.x!==this.getCurrSlideX()}updateCurrItem(){const{pswp:t}=this,i=this._prevPositionIndex-this._currPositionIndex;if(!i)return;this._prevPositionIndex=this._currPositionIndex,t.currIndex=t.potentialIndex;let s,e=Math.abs(i);e>=3&&(this._containerShiftIndex+=i+(i>0?-3:3),e=3,this.itemHolders.forEach(t=>{t.slide?.destroy(),t.slide=void 0}));for(let o=0;o<e;o++)i>0?(s=this.itemHolders.shift(),s&&(this.itemHolders[2]=s,this._containerShiftIndex++,a(s.el,(this._containerShiftIndex+2)*this.slideWidth),t.setContent(s,t.currIndex-e+o+2))):(s=this.itemHolders.pop(),s&&(this.itemHolders.unshift(s),this._containerShiftIndex--,a(s.el,this._containerShiftIndex*this.slideWidth),t.setContent(s,t.currIndex+e-o-2)));Math.abs(this._containerShiftIndex)>50&&!this.isShifted()&&(this.resetPosition(),this.resize()),t.animations.stopAllPan(),this.itemHolders.forEach((t,i)=>{t.slide&&t.slide.setIsActive(1===i)}),t.currSlide=this.itemHolders[1]?.slide,t.contentLoader.updateLazy(i),t.currSlide&&t.currSlide.applyCurrentZoomPan(),t.dispatch("change")}moveTo(t,i){if(!this.pswp.canLoop()&&i){let i=(this.slideWidth*this._currPositionIndex-t)/this.slideWidth;i+=this.pswp.currIndex;const s=Math.round(t-this.x);(i<0&&s>0||i>=this.pswp.getNumItems()-1&&s<0)&&(t=this.x+.35*s)}this.x=t,this.pswp.container&&a(this.pswp.container,t),this.pswp.dispatch("moveMainScroll",{x:t,dragging:i??!1})}}const z=.003;class C{constructor(t){this.pswp=t,this.isClosed=!0,this.isOpen=!1,this.isClosing=!1,this.isOpening=!1,this._duration=void 0,this._useAnimation=!1,this._croppedZoom=!1,this._animateRootOpacity=!1,this._animateBgOpacity=!1,this._placeholder=void 0,this._opacityElement=void 0,this._cropContainer1=void 0,this._cropContainer2=void 0,this._thumbBounds=void 0,this._prepareOpen=this._prepareOpen.bind(this),t.on("firstZoomPan",this._prepareOpen)}open(){this._prepareOpen(),this._start()}close(){if(this.isClosed||this.isClosing||this.isOpening)return;const t=this.pswp.currSlide;this.isOpen=!1,this.isOpening=!1,this.isClosing=!0,this._duration=this.pswp.options.hideAnimationDuration,t&&t.currZoomLevel*t.width>=this.pswp.options.maxWidthToAnimate&&(this._duration=0),this._applyStartProps(),setTimeout(()=>{this._start()},this._croppedZoom?30:0)}_prepareOpen(){if(this.pswp.off("firstZoomPan",this._prepareOpen),!this.isOpening){const t=this.pswp.currSlide;this.isOpening=!0,this.isClosing=!1,this._duration=this.pswp.options.showAnimationDuration,t&&t.zoomLevels.initial*t.width>=this.pswp.options.maxWidthToAnimate&&(this._duration=0),this._applyStartProps()}}_applyStartProps(){const{pswp:t}=this,i=this.pswp.currSlide,{options:s}=t;if("fade"===s.showHideAnimationType?(s.showHideOpacity=!0,this._thumbBounds=void 0):"none"===s.showHideAnimationType?(s.showHideOpacity=!1,this._duration=0,this._thumbBounds=void 0):this.isOpening&&t._initialThumbBounds?this._thumbBounds=t._initialThumbBounds:this._thumbBounds=this.pswp.getThumbBounds(),this._placeholder=i?.getPlaceholderElement(),t.animations.stopAll(),this._useAnimation=!!(this._duration&&this._duration>50),this._animateZoom=!!this._thumbBounds&&i?.content.usePlaceholder()&&(!this.isClosing||!t.mainScroll.isShifted()),this._animateZoom?this._animateRootOpacity=s.showHideOpacity??!1:(this._animateRootOpacity=!0,this.isOpening&&i&&(i.zoomAndPanToInitial(),i.applyCurrentZoomPan())),this._animateBgOpacity=!this._animateRootOpacity&&this.pswp.options.bgOpacity>z,this._opacityElement=this._animateRootOpacity?t.element:t.bg,!this._useAnimation)return this._duration=0,this._animateZoom=!1,this._animateBgOpacity=!1,this._animateRootOpacity=!0,void(this.isOpening&&(t.element&&(t.element.style.opacity=String(z)),t.applyBgOpacity(1)));this._animateZoom&&this._thumbBounds&&this._thumbBounds.innerRect?(this._croppedZoom=!0,this._cropContainer1=this.pswp.container,this._cropContainer2=this.pswp.currSlide?.holderElement,t.container&&(t.container.style.overflow="hidden",t.container.style.width=t.viewportSize.x+"px")):this._croppedZoom=!1,this.isOpening?(this._animateRootOpacity?(t.element&&(t.element.style.opacity=String(z)),t.applyBgOpacity(1)):(this._animateBgOpacity&&t.bg&&(t.bg.style.opacity=String(z)),t.element&&(t.element.style.opacity="1")),this._animateZoom&&(this._setClosedStateZoomPan(),this._placeholder&&(this._placeholder.style.willChange="transform",this._placeholder.style.opacity=String(z)))):this.isClosing&&(t.mainScroll.itemHolders[0]&&(t.mainScroll.itemHolders[0].el.style.display="none"),t.mainScroll.itemHolders[2]&&(t.mainScroll.itemHolders[2].el.style.display="none"),this._croppedZoom&&0!==t.mainScroll.x&&(t.mainScroll.resetPosition(),t.mainScroll.resize()))}_start(){this.isOpening&&this._useAnimation&&this._placeholder&&"IMG"===this._placeholder.tagName?new Promise(t=>{let i=!1,s=!0;h(this._placeholder).finally(()=>{i=!0,s||t(!0)}),setTimeout(()=>{s=!1,i&&t(!0)},50),setTimeout(t,250)}).finally(()=>this._initiate()):this._initiate()}_initiate(){this.pswp.element?.style.setProperty("--pswp-transition-duration",this._duration+"ms"),this.pswp.dispatch(this.isOpening?"openingAnimationStart":"closingAnimationStart"),this.pswp.dispatch("initialZoom"+(this.isOpening?"In":"Out")),this.pswp.element?.classList.toggle("pswp--ui-visible",this.isOpening),this.isOpening?(this._placeholder&&(this._placeholder.style.opacity="1"),this._animateToOpenState()):this.isClosing&&this._animateToClosedState(),this._useAnimation||this._onAnimationComplete()}_onAnimationComplete(){const{pswp:t}=this;this.isOpen=this.isOpening,this.isClosed=this.isClosing,this.isOpening=!1,this.isClosing=!1,t.dispatch(this.isOpen?"openingAnimationEnd":"closingAnimationEnd"),t.dispatch("initialZoom"+(this.isOpen?"InEnd":"OutEnd")),this.isClosed?t.destroy():this.isOpen&&(this._animateZoom&&t.container&&(t.container.style.overflow="visible",t.container.style.width="100%"),t.currSlide?.applyCurrentZoomPan())}_animateToOpenState(){const{pswp:t}=this;this._animateZoom&&(this._croppedZoom&&this._cropContainer1&&this._cropContainer2&&(this._animateTo(this._cropContainer1,"transform","translate3d(0,0,0)"),this._animateTo(this._cropContainer2,"transform","none")),t.currSlide&&(t.currSlide.zoomAndPanToInitial(),this._animateTo(t.currSlide.container,"transform",t.currSlide.getCurrentTransform()))),this._animateBgOpacity&&t.bg&&this._animateTo(t.bg,"opacity",String(t.options.bgOpacity)),this._animateRootOpacity&&t.element&&this._animateTo(t.element,"opacity","1")}_animateToClosedState(){const{pswp:t}=this;this._animateZoom&&this._setClosedStateZoomPan(!0),this._animateBgOpacity&&t.bgOpacity>.01&&t.bg&&this._animateTo(t.bg,"opacity","0"),this._animateRootOpacity&&t.element&&this._animateTo(t.element,"opacity","0")}_setClosedStateZoomPan(i){if(!this._thumbBounds)return;const{pswp:s}=this,{innerRect:e}=this._thumbBounds,{currSlide:o,viewportSize:n}=s;if(this._croppedZoom&&e&&this._cropContainer1&&this._cropContainer2){const t=-n.x+(this._thumbBounds.x-e.x)+e.w,s=-n.y+(this._thumbBounds.y-e.y)+e.h,o=n.x-e.w,r=n.y-e.h;i?(this._animateTo(this._cropContainer1,"transform",p(t,s)),this._animateTo(this._cropContainer2,"transform",p(o,r))):(a(this._cropContainer1,t,s),a(this._cropContainer2,o,r))}o&&(t(o.pan,e||this._thumbBounds),o.currZoomLevel=this._thumbBounds.w/o.width,i?this._animateTo(o.container,"transform",o.getCurrentTransform()):o.applyCurrentZoomPan())}_animateTo(t,i,s){if(!this._duration)return void(t.style[i]=s);const{animations:e}=this.pswp,o={duration:this._duration,easing:this.pswp.options.easing,onComplete:()=>{e.activeAnimations.length||this._onAnimationComplete()},target:t};o[i]=s,e.startTransition(o)}}class Z{constructor(t){this.pswp=t,t.events.add(t.element,"wheel",this._onWheel.bind(this))}_onWheel(t){t.preventDefault();const{currSlide:i}=this.pswp;let{deltaX:s,deltaY:e}=t;if(i&&!this.pswp.dispatch("wheel",{originalEvent:t}).defaultPrevented)if(t.ctrlKey||this.pswp.options.wheelToZoom){if(i.isZoomable()){let s=-e;1===t.deltaMode?s*=.05:s*=t.deltaMode?1:.002,s=2**s;const o=i.currZoomLevel*s;i.zoomTo(o,{x:t.clientX,y:t.clientY})}}else i.isPannable()&&(1===t.deltaMode&&(s*=18,e*=18),i.panTo(i.pan.x-s,i.pan.y-e))}}class I{constructor(t){this.slide=t,this.currZoomLevel=1,this.center={x:0,y:0},this.max={x:0,y:0},this.min={x:0,y:0}}update(t){this.currZoomLevel=t,this.slide.width?(this._updateAxis("x"),this._updateAxis("y"),this.slide.pswp.dispatch("calcBounds",{slide:this.slide})):this.reset()}_updateAxis(t){const{pswp:i}=this.slide,s=this.slide["x"===t?"width":"height"]*this.currZoomLevel,e=l("x"===t?"left":"top",i.options,i.viewportSize,this.slide.data,this.slide.index),o=this.slide.panAreaSize[t];this.center[t]=Math.round((o-s)/2)+e,this.max[t]=s>o?Math.round(o-s)+e:this.center[t],this.min[t]=s>o?e:this.center[t]}reset(){this.center.x=0,this.center.y=0,this.max.x=0,this.max.y=0,this.min.x=0,this.min.y=0}correctPan(t,i){return s(i,this.max[t],this.min[t])}}class O{constructor(t,i,s){this.data=t,this.index=i,this.pswp=s,this.isActive=i===s.currIndex,this.currentResolution=0,this.panAreaSize={x:0,y:0},this.pan={x:0,y:0},this.isFirstSlide=this.isActive&&!s.opener.isOpen,this.zoomLevels=new c(s.options,t,i,s),this.pswp.dispatch("gettingData",{slide:this,data:this.data,index:i}),this.content=this.pswp.contentLoader.getContentBySlide(this),this.container=r("pswp__zoom-wrap","div"),this.holderElement=null,this.currZoomLevel=1,this.width=this.content.width,this.height=this.content.height,this.heavyAppended=!1,this.bounds=new I(this),this.prevDisplayedWidth=-1,this.prevDisplayedHeight=-1,this.pswp.dispatch("slideInit",{slide:this})}setIsActive(t){t&&!this.isActive?this.activate():!t&&this.isActive&&this.deactivate()}append(t){this.holderElement=t,this.container.style.transformOrigin="0 0",this.data&&(this.calculateSize(),this.load(),this.updateContentSize(),this.appendHeavy(),this.holderElement.appendChild(this.container),this.zoomAndPanToInitial(),this.pswp.dispatch("firstZoomPan",{slide:this}),this.applyCurrentZoomPan(),this.pswp.dispatch("afterSetContent",{slide:this}),this.isActive&&this.activate())}load(){this.content.load(!1),this.pswp.dispatch("slideLoad",{slide:this})}appendHeavy(){const{pswp:t}=this;this.heavyAppended||!t.opener.isOpen||t.mainScroll.isShifted()||(this.isActive,0)||this.pswp.dispatch("appendHeavy",{slide:this}).defaultPrevented||(this.heavyAppended=!0,this.content.append(),this.pswp.dispatch("appendHeavyContent",{slide:this}))}activate(){this.isActive=!0,this.appendHeavy(),this.content.activate(),this.pswp.dispatch("slideActivate",{slide:this})}deactivate(){this.isActive=!1,this.content.deactivate(),this.currZoomLevel!==this.zoomLevels.initial&&this.calculateSize(),this.currentResolution=0,this.zoomAndPanToInitial(),this.applyCurrentZoomPan(),this.updateContentSize(),this.pswp.dispatch("slideDeactivate",{slide:this})}destroy(){this.content.hasSlide=!1,this.content.remove(),this.container.remove(),this.pswp.dispatch("slideDestroy",{slide:this})}resize(){this.currZoomLevel!==this.zoomLevels.initial&&this.isActive?(this.calculateSize(),this.bounds.update(this.currZoomLevel),this.panTo(this.pan.x,this.pan.y)):(this.calculateSize(),this.currentResolution=0,this.zoomAndPanToInitial(),this.applyCurrentZoomPan(),this.updateContentSize())}updateContentSize(t){const i=this.currentResolution||this.zoomLevels.initial;if(!i)return;const s=Math.round(this.width*i)||this.pswp.viewportSize.x,e=Math.round(this.height*i)||this.pswp.viewportSize.y;!this.sizeChanged(s,e)&&!t||this.content.setDisplayedSize(s,e)}sizeChanged(t,i){return(t!==this.prevDisplayedWidth||i!==this.prevDisplayedHeight)&&(this.prevDisplayedWidth=t,this.prevDisplayedHeight=i,!0)}getPlaceholderElement(){return this.content.placeholder?.element}zoomTo(t,e,o,n){const{pswp:a}=this;if(!this.isZoomable()||a.mainScroll.isShifted())return;a.dispatch("beforeZoomTo",{destZoomLevel:t,centerPoint:e,transitionDuration:o}),a.animations.stopAllPan();const r=this.currZoomLevel;n||(t=s(t,this.zoomLevels.min,this.zoomLevels.max)),this.setZoomLevel(t),this.pan.x=this.calculateZoomToPanOffset("x",e,r),this.pan.y=this.calculateZoomToPanOffset("y",e,r),i(this.pan);const h=()=>{this._setResolution(t),this.applyCurrentZoomPan()};o?a.animations.startTransition({isPan:!0,name:"zoomTo",target:this.container,transform:this.getCurrentTransform(),onComplete:h,duration:o,easing:a.options.easing}):h()}toggleZoom(t){this.zoomTo(this.currZoomLevel===this.zoomLevels.initial?this.zoomLevels.secondary:this.zoomLevels.initial,t,this.pswp.options.zoomAnimationDuration)}setZoomLevel(t){this.currZoomLevel=t,this.bounds.update(this.currZoomLevel)}calculateZoomToPanOffset(t,i,s){if(this.bounds.max[t]-this.bounds.min[t]===0)return this.bounds.center[t];i||(i=this.pswp.getViewportCenterPoint()),s||(s=this.zoomLevels.initial);const e=this.currZoomLevel/s;return this.bounds.correctPan(t,(this.pan[t]-i[t])*e+i[t])}panTo(t,i){this.pan.x=this.bounds.correctPan("x",t),this.pan.y=this.bounds.correctPan("y",i),this.applyCurrentZoomPan()}isPannable(){return!!this.width&&this.currZoomLevel>this.zoomLevels.fit}isZoomable(){return!!this.width&&this.content.isZoomable()}applyCurrentZoomPan(){this._applyZoomTransform(this.pan.x,this.pan.y,this.currZoomLevel),this===this.pswp.currSlide&&this.pswp.dispatch("zoomPanUpdate",{slide:this})}zoomAndPanToInitial(){this.currZoomLevel=this.zoomLevels.initial,this.bounds.update(this.currZoomLevel),t(this.pan,this.bounds.center),this.pswp.dispatch("initialZoomPan",{slide:this})}_applyZoomTransform(t,i,s){s/=this.currentResolution||this.zoomLevels.initial,a(this.container,t,i,s)}calculateSize(){const{pswp:i}=this;t(this.panAreaSize,d(i.options,i.viewportSize,this.data,this.index)),this.zoomLevels.update(this.width,this.height,this.panAreaSize),i.dispatch("calcSlideSize",{slide:this})}getCurrentTransform(){const t=this.currZoomLevel/(this.currentResolution||this.zoomLevels.initial);return p(this.pan.x,this.pan.y,t)}_setResolution(t){t!==this.currentResolution&&(this.currentResolution=t,this.updateContentSize(),this.pswp.dispatch("resolutionChanged"))}}function D(t,i,s){t.classList.add("pswp__button--arrow"),t.setAttribute("aria-controls","pswp__items"),i.on("change",()=>{i.options.loop||(t.disabled=s?!(i.currIndex<i.getNumItems()-1):!(i.currIndex>0))})}const E={name:"arrowPrev",className:"pswp__button--arrow--prev",title:"Previous",order:10,isButton:!0,appendTo:"wrapper",html:{isCustomSVG:!0,size:60,inner:'<path d="M29 43l-3 3-16-16 16-16 3 3-13 13 13 13z" id="pswp__icn-arrow"/>',outlineID:"pswp__icn-arrow"},onClick:"prev",onInit:D},M={name:"arrowNext",className:"pswp__button--arrow--next",title:"Next",order:11,isButton:!0,appendTo:"wrapper",html:{isCustomSVG:!0,size:60,inner:'<use xlink:href="#pswp__icn-arrow"/>',outlineID:"pswp__icn-arrow"},onClick:"next",onInit:(t,i)=>{D(t,i,!0)}},F={name:"close",title:"Close",order:20,isButton:!0,html:{isCustomSVG:!0,inner:'<path d="M24 10l-2-2-6 6-6-6-2 2 6 6-6 6 2 2 6-6 6 6 2-2-6-6z" id="pswp__icn-close"/>',outlineID:"pswp__icn-close"},onClick:"close"},B={name:"zoom",title:"Zoom",order:10,isButton:!0,html:{isCustomSVG:!0,inner:'<path d="M17.426 19.926a6 6 0 1 1 1.5-1.5L23 22.5 21.5 24l-4.074-4.074z" id="pswp__icn-zoom"/><path fill="currentColor" class="pswp__zoom-icn-bar-h" d="M11 16v-2h6v2z"/><path fill="currentColor" class="pswp__zoom-icn-bar-v" d="M13 12h2v6h-2z"/>',outlineID:"pswp__icn-zoom"},onClick:"toggleZoom"},R={name:"counter",order:5,onInit:(t,i)=>{i.on("change",()=>{t.innerText=i.currIndex+1+i.options.indexIndicatorSep+i.getNumItems()})}},k={name:"preloader",appendTo:"bar",order:7,html:{isCustomSVG:!0,inner:'<path fill-rule="evenodd" clip-rule="evenodd" d="M21.2 16a5.2 5.2 0 1 1-5.2-5.2V8a8 8 0 1 0 8 8h-2.8Z" id="pswp__icn-loading"/>',outlineID:"pswp__icn-loading"},onInit:(t,i)=>{let s,e=null;const o=i=>{s!==i&&(s=i,((i,s)=>{t.classList.toggle("pswp__preloader--"+i,s)})("active",i))},n=()=>{if(!i.currSlide?.content.isLoading())return o(!1),void(e&&(clearTimeout(e),e=null));e||(e=setTimeout(()=>{o(!!i.currSlide?.content.isLoading()),e=null},i.options.preloaderDelay))};i.on("change",n),i.on("loadComplete",t=>{i.currSlide===t.slide&&n()}),i.ui&&(i.ui.updatePreloaderVisibility=n)}};class H{constructor(t,i){const s=i.name||i.className;let e=i.html;if(!1===t.options[s])return;"string"==typeof t.options[s+"SVG"]&&(e=t.options[s+"SVG"]),t.dispatch("uiElementCreate",{data:i});let o="";i.isButton?(o+="pswp__button ",o+=i.className||`pswp__button--${i.name}`):o+=i.className||`pswp__${i.name}`;let n=i.isButton?i.tagName||"button":i.tagName||"div";n=n.toLowerCase();const a=r(o,n);if(i.isButton){"button"===n&&(a.type="button");let{title:e}=i;const{ariaLabel:o}=i;"string"==typeof t.options[s+"Title"]&&(e=t.options[s+"Title"]),e&&(a.title=e);const r=o||e;r&&a.setAttribute("aria-label",r)}a.innerHTML=function(t){if("string"==typeof t)return t;if(!t||!t.isCustomSVG)return"";const i=t;let s='<svg aria-hidden="true" class="pswp__icn" viewBox="0 0 %d %d" width="%d" height="%d">';return s=s.split("%d").join(i.size||32),i.outlineID&&(s+='<use class="pswp__icn-shadow" xlink:href="#'+i.outlineID+'"/>'),s+=i.inner,s+="</svg>",s}(e),i.onInit&&i.onInit(a,t),i.onClick&&(a.onclick=s=>{"string"==typeof i.onClick?t[i.onClick]():"function"==typeof i.onClick&&i.onClick(s,a,t)});const h=i.appendTo||"bar";let p=t.element;"bar"===h?(t.topBar||(t.topBar=r("pswp__top-bar pswp__hide-on-close","div",t.scrollWrap)),p=t.topBar):(a.classList.add("pswp__hide-on-close"),"wrapper"===h&&(p=t.scrollWrap)),p?.appendChild(t.applyFilters("uiElement",a,i))}}function W(t,i){t.classList.toggle("pswp--zoomed-in",i)}class N{constructor(t){this.pswp=t,this.isRegistered=!1,this.uiElementsData=[],this.items=[],this.updatePreloaderVisibility=()=>{},this._lastUpdatedZoomLevel=void 0}init(){const{pswp:t}=this;this.isRegistered=!1,this.uiElementsData=[F,E,M,B,k,R],t.dispatch("uiRegister"),this.uiElementsData.sort((t,i)=>(t.order||0)-(i.order||0)),this.items=[],this.isRegistered=!0,this.uiElementsData.forEach(t=>{this.registerElement(t)}),t.on("change",()=>{t.element?.classList.toggle("pswp--one-slide",1===t.getNumItems())}),t.on("zoomPanUpdate",()=>this._onZoomPanUpdate())}registerElement(t){this.isRegistered?this.items.push(new H(this.pswp,t)):this.uiElementsData.push(t)}_onZoomPanUpdate(){const{template:t,currSlide:i,options:s}=this.pswp;if(this.pswp.opener.isClosing||!t||!i)return;let{currZoomLevel:e}=i;if(this.pswp.opener.isOpen||(e=i.zoomLevels.initial),e===this._lastUpdatedZoomLevel)return;this._lastUpdatedZoomLevel=e;const o=i.zoomLevels.initial-i.zoomLevels.secondary;if(Math.abs(o)<.01||!i.isZoomable())return W(t,!1),void t.classList.remove("pswp--zoom-allowed");t.classList.add("pswp--zoom-allowed");W(t,(e===i.zoomLevels.initial?i.zoomLevels.secondary:i.zoomLevels.initial)<=e),("zoom"===s.imageClickAction||"zoom-or-close"===s.imageClickAction)&&t.classList.add("pswp--click-to-zoom")}}const V="cubic-bezier(.4,0,.22,1)";class q{constructor(t){this.props=t;const{target:i,onComplete:s,transform:e,onFinish:o=()=>{},duration:n=333,easing:a=V}=t;this.onFinish=o;const r=e?"transform":"opacity",h=t[r]??"";this._target=i,this._onComplete=s,this._finished=!1,this._onTransitionEnd=this._onTransitionEnd.bind(this),this._helperTimeout=setTimeout(()=>{u(i,r,n,a),this._helperTimeout=setTimeout(()=>{i.addEventListener("transitionend",this._onTransitionEnd,!1),i.addEventListener("transitioncancel",this._onTransitionEnd,!1),this._helperTimeout=setTimeout(()=>{this._finalizeAnimation()},n+500),i.style[r]=h},30)},0)}_onTransitionEnd(t){t.target===this._target&&this._finalizeAnimation()}_finalizeAnimation(){this._finished||(this._finished=!0,this.onFinish(),this._onComplete&&this._onComplete())}destroy(){this._helperTimeout&&(clearTimeout(this._helperTimeout),this._helperTimeout=null),m(this._target),this._target.removeEventListener("transitionend",this._onTransitionEnd,!1),this._target.removeEventListener("transitioncancel",this._onTransitionEnd,!1),this._finished||this._finalizeAnimation()}}class U{constructor(t,i,s){this.velocity=1e3*t,this._dampingRatio=i||.75,this._naturalFrequency=s||12,this._dampedFrequency=this._naturalFrequency,this._dampingRatio<1&&(this._dampedFrequency*=Math.sqrt(1-this._dampingRatio*this._dampingRatio))}easeFrame(t,i){let s,e=0;i/=1e3;const o=Math.E**(-this._dampingRatio*this._naturalFrequency*i);if(1===this._dampingRatio)s=this.velocity+this._naturalFrequency*t,e=(t+s*i)*o,this.velocity=e*-this._naturalFrequency+s*o;else if(this._dampingRatio<1){s=1/this._dampedFrequency*(this._dampingRatio*this._naturalFrequency*t+this.velocity);const n=Math.cos(this._dampedFrequency*i),a=Math.sin(this._dampedFrequency*i);e=o*(t*n+s*a),this.velocity=e*-this._naturalFrequency*this._dampingRatio+o*(-this._dampedFrequency*t*a+this._dampedFrequency*s*n)}return e}}class G{constructor(t){this.props=t,this._raf=0;const{start:i,end:s,velocity:e,onUpdate:o,onComplete:n,onFinish:a=()=>{},dampingRatio:r,naturalFrequency:h}=t;this.onFinish=a;const p=new U(e,r,h);let l=Date.now(),c=i-s;const d=()=>{this._raf&&(c=p.easeFrame(c,Date.now()-l),Math.abs(c)<1&&Math.abs(p.velocity)<50?(o(s),n&&n(),this.onFinish()):(l=Date.now(),o(c+s),this._raf=requestAnimationFrame(d)))};this._raf=requestAnimationFrame(d)}destroy(){this._raf>=0&&cancelAnimationFrame(this._raf),this._raf=0}}class X{constructor(){this.activeAnimations=[]}startSpring(t){this._start(t,!0)}startTransition(t){this._start(t)}_start(t,i){const s=i?new G(t):new q(t);return this.activeAnimations.push(s),s.onFinish=()=>this.stop(s),s}stop(t){t.destroy();const i=this.activeAnimations.indexOf(t);i>-1&&this.activeAnimations.splice(i,1)}stopAll(){this.activeAnimations.forEach(t=>{t.destroy()}),this.activeAnimations=[]}stopAllPan(){this.activeAnimations=this.activeAnimations.filter(t=>!t.props.isPan||(t.destroy(),!1))}stopMainScroll(){this.activeAnimations=this.activeAnimations.filter(t=>!t.props.isMainScroll||(t.destroy(),!1))}isPanRunning(){return this.activeAnimations.some(t=>t.props.isPan)}}let K=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:()=>{K=!0}}))}catch{}class Y{constructor(){this._pool=[]}add(t,i,s,e){this._toggleListener(t,i,s,e)}remove(t,i,s,e){this._toggleListener(t,i,s,e,!0)}removeAll(){this._pool.forEach(t=>{this._toggleListener(t.target,t.type,t.listener,t.passive,!0,!0)}),this._pool=[]}_toggleListener(t,i,s,e,o,n){if(!t)return;const a=o?"removeEventListener":"addEventListener";i.split(" ").forEach(i=>{if(i){n||(o?this._pool=this._pool.filter(e=>e.type!==i||e.listener!==s||e.target!==t):this._pool.push({target:t,type:i,listener:s,passive:e}));const r=!!K&&{passive:e||!1};t[a](i,s,r)}})}}const j={allowPanToNext:!0,spacing:.1,loop:!0,pinchToClose:!0,closeOnVerticalDrag:!0,hideAnimationDuration:333,showAnimationDuration:333,zoomAnimationDuration:333,escKey:!0,arrowKeys:!0,trapFocus:!0,returnFocus:!0,maxWidthToAnimate:4e3,clickToCloseNonZoomable:!0,imageClickAction:"zoom-or-close",bgClickAction:"close",tapAction:"toggle-controls",doubleTapAction:"zoom",indexIndicatorSep:" / ",preloaderDelay:2e3,bgOpacity:.8,index:0,errorMsg:"The image cannot be loaded",preload:[1,2],easing:"cubic-bezier(.4,0,.22,1)"};class $ extends _{constructor(t){super(),this.options=this._prepareOptions(t||{}),this.offset={x:0,y:0},this._prevViewportSize={x:0,y:0},this.viewportSize={x:0,y:0},this.bgOpacity=1,this.currIndex=0,this.potentialIndex=0,this.isOpen=!1,this.isDestroying=!1,this.hasMouse=!1,this._initialItemData={},this._initialThumbBounds=void 0,this.topBar=void 0,this.element=void 0,this.template=void 0,this.container=void 0,this.scrollWrap=void 0,this.currSlide=void 0,this.events=new Y,this.animations=new X,this.mainScroll=new A(this),this.gestures=new S(this),this.opener=new C(this),this.keyboard=new L(this),this.contentLoader=new v(this)}init(){if(this.isOpen||this.isDestroying)return!1;this.isOpen=!0,this.dispatch("init"),this.dispatch("beforeOpen"),this._createMainStructure();let t="pswp--open";return this.gestures.supportsTouch&&(t+=" pswp--touch"),this.options.mainClass&&(t+=" "+this.options.mainClass),this.element&&(this.element.className+=" "+t),this.currIndex=this.options.index||0,this.potentialIndex=this.currIndex,this.dispatch("firstUpdate"),this.scrollWheel=new Z(this),(Number.isNaN(this.currIndex)||this.currIndex<0||this.currIndex>=this.getNumItems())&&(this.currIndex=0),this.gestures.supportsTouch||this.mouseDetected(),this.updateSize(),this.offset.y=window.pageYOffset,this._initialItemData=this.getItemData(this.currIndex),this.dispatch("gettingData",{index:this.currIndex,data:this._initialItemData,slide:void 0}),this._initialThumbBounds=this.getThumbBounds(),this.dispatch("initialLayout"),this.on("openingAnimationEnd",()=>{const{itemHolders:t}=this.mainScroll;t[0]&&(t[0].el.style.display="block",this.setContent(t[0],this.currIndex-1)),t[2]&&(t[2].el.style.display="block",this.setContent(t[2],this.currIndex+1)),this.appendHeavy(),this.contentLoader.updateLazy(),this.events.add(window,"resize",this._handlePageResize.bind(this)),this.events.add(window,"scroll",this._updatePageScrollOffset.bind(this)),this.dispatch("bindEvents")}),this.mainScroll.itemHolders[1]&&this.setContent(this.mainScroll.itemHolders[1],this.currIndex),this.dispatch("change"),this.opener.open(),this.dispatch("afterInit"),!0}getLoopedIndex(t){const i=this.getNumItems();return this.options.loop&&(t>i-1&&(t-=i),t<0&&(t+=i)),s(t,0,i-1)}appendHeavy(){this.mainScroll.itemHolders.forEach(t=>{t.slide?.appendHeavy()})}goTo(t){this.mainScroll.moveIndexBy(this.getLoopedIndex(t)-this.potentialIndex,!0)}next(){this.goTo(this.potentialIndex+1)}prev(){this.goTo(this.potentialIndex-1)}zoomTo(...t){this.currSlide?.zoomTo(...t)}toggleZoom(){this.currSlide?.toggleZoom()}close(){!this.opener.isOpen||this.isDestroying||(this.isDestroying=!0,this.dispatch("close"),this.events.removeAll(),this.opener.close())}destroy(){if(!this.isDestroying)return this.options.showHideAnimationType="none",void this.close();this.dispatch("destroy"),this._listeners={},this.scrollWrap&&(this.scrollWrap.ontouchmove=null,this.scrollWrap.ontouchend=null),this.element?.remove(),this.mainScroll.itemHolders.forEach(t=>{t.slide?.destroy()}),this.contentLoader.destroy(),this.events.removeAll()}refreshSlideContent(t){this.contentLoader.removeByIndex(t),this.mainScroll.itemHolders.forEach((i,s)=>{let e=(this.currSlide?.index??0)-1+s;this.canLoop()&&(e=this.getLoopedIndex(e)),e===t&&(this.setContent(i,t,!0),1===s&&(this.currSlide=i.slide,i.slide?.setIsActive(!0)))}),this.dispatch("change")}setContent(t,i,s){if(this.canLoop()&&(i=this.getLoopedIndex(i)),t.slide){if(t.slide.index===i&&!s)return;t.slide.destroy(),t.slide=void 0}if(!this.canLoop()&&(i<0||i>=this.getNumItems()))return;const e=this.getItemData(i);t.slide=new O(e,i,this),i===this.currIndex&&(this.currSlide=t.slide),t.slide.append(t.el)}getViewportCenterPoint(){return{x:this.viewportSize.x/2,y:this.viewportSize.y/2}}updateSize(i){if(this.isDestroying)return;const s=g(this.options,this);!i&&o(s,this._prevViewportSize)||(t(this._prevViewportSize,s),this.dispatch("beforeResize"),t(this.viewportSize,this._prevViewportSize),this._updatePageScrollOffset(),this.dispatch("viewportSize"),this.mainScroll.resize(this.opener.isOpen),!this.hasMouse&&window.matchMedia("(any-hover: hover)").matches&&this.mouseDetected(),this.dispatch("resize"))}applyBgOpacity(t){this.bgOpacity=Math.max(t,0),this.bg&&(this.bg.style.opacity=String(this.bgOpacity*this.options.bgOpacity))}mouseDetected(){this.hasMouse||(this.hasMouse=!0,this.element?.classList.add("pswp--has_mouse"))}_handlePageResize(){this.updateSize(),/iPhone|iPad|iPod/i.test(window.navigator.userAgent)&&setTimeout(()=>{this.updateSize()},500)}_updatePageScrollOffset(){this.setScrollOffset(0,window.pageYOffset)}setScrollOffset(t,i){this.offset.x=t,this.offset.y=i,this.dispatch("updateScrollOffset")}_createMainStructure(){this.element=r("pswp","div"),this.element.setAttribute("tabindex","-1"),this.element.setAttribute("role","dialog"),this.template=this.element,this.bg=r("pswp__bg","div",this.element),this.scrollWrap=r("pswp__scroll-wrap","section",this.element),this.container=r("pswp__container","div",this.scrollWrap),this.scrollWrap.setAttribute("aria-roledescription","carousel"),this.container.setAttribute("aria-live","off"),this.container.setAttribute("id","pswp__items"),this.mainScroll.appendHolders(),this.ui=new N(this),this.ui.init(),(this.options.appendToEl||document.body).appendChild(this.element)}getThumbBounds(){return function(t,i,s){const e=s.dispatch("thumbBounds",{index:t,itemData:i,instance:s});if(e.thumbBounds)return e.thumbBounds;const{element:o}=i;let n,a;if(o&&!1!==s.options.thumbSelector){const t=s.options.thumbSelector||"img";a=o.matches(t)?o:o.querySelector(t)}return a=s.applyFilters("thumbEl",a,i,t),a&&(n=i.thumbCropped?function(t,i,s){const e=t.getBoundingClientRect(),o=e.width/i,n=e.height/s,a=o>n?o:n,r=(e.width-i*a)/2,h=(e.height-s*a)/2,p={x:e.left+r,y:e.top+h,w:i*a};return p.innerRect={w:e.width,h:e.height,x:r,y:h},p}(a,i.width||i.w||0,i.height||i.h||0):function(t){const i=t.getBoundingClientRect();return{x:i.left,y:i.top,w:i.width}}(a)),s.applyFilters("thumbBounds",n,i,t)}(this.currIndex,this.currSlide?this.currSlide.data:this._initialItemData,this)}canLoop(){return this.options.loop&&this.getNumItems()>2}_prepareOptions(t){return window.matchMedia("(prefers-reduced-motion), (update: slow)").matches&&(t.showHideAnimationType="none",t.zoomAnimationDuration=0),{...j,...t}}}export{$ as default};
package/react/index.es.js CHANGED
@@ -1 +1 @@
1
- import{aT as a}from"./BDeLdfbp.js";export{a as default};
1
+ import{aT as a}from"./BaA7RHRf.js";export{a as default};
@@ -1 +1 @@
1
- import{u as a,j as s,E as r,c as t,T as l,A as e,a as c,I as n,b as i,d as o,N as f,P as d,e as h,S as m,f as x,g as j,h as q,F as g,k as p,i as u}from"./BDeLdfbp.js";import{useMemo as v,Fragment as z}from"react";import{F as b,g as w}from"./BeDQQM0T.js";import{L as y}from"./DcQdnYr8.js";import{u as N,T as L}from"./BYYb8zAx.js";const A=a=>a===r.UPCOMING?"qc:bg-warning":a===r.CLOSED?"qc:bg-destructive":"qc:bg-success",E=({event:e})=>{const{organization:c}=a(),n=e?.coverImageUrl?e?.coverImageUrl:e?.contents?.length>0?e.contents[0].thumbnailUrl||e.contents[0].url:void 0;return s.jsxs("div",{className:"qc:space-y-4",children:[s.jsxs("div",{className:"qc:relative qc:h-72 qc:overflow-hidden qc:rounded qc:sm:h-80",children:[n?s.jsx(y,{wrapperClassName:"qc:size-full qc:sm:hover:scale-105 qc:sm:transition-transform",src:e?.coverImageUrl?e?.coverImageUrl:e?.contents?.length>0?e.contents[0].thumbnailUrl||e.contents[0].url:`https://placehold.co/600x400/${c?.color?.slice(1)}/white`,blurhash:e?.coverBlurHash?e?.coverBlurHash:e?.contents?.length>0?e.contents[0].blurHash:void 0}):s.jsx("div",{className:"qc:bg-primary qc:flex qc:size-full qc:items-center qc:justify-center",children:s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"qc:text-primary-foreground qc:size-16",viewBox:"0 0 24 24",children:s.jsx("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"})})}),!c?.integrationSettings?.hideEventStatus&&e?.status!==r.CLOSED&&s.jsx("span",{className:t("qc:absolute qc:right-4 qc:top-4 qc:inline-flex qc:items-center qc:rounded-full qc:px-3 qc:py-2",A(e.status)),children:s.jsx(l,{variant:"h6",color:"white",children:e.status})})]}),s.jsx(l,{variant:"h4",immutable:!0,lines:"2",children:e.name})]})},I=({folder:a})=>s.jsxs("div",{className:"qc:shadow-outer qc:border-border qc:flex qc:items-center qc:gap-4 qc:rounded qc:border qc:p-2 qc:transition-colors qc:duration-200",onMouseEnter:s=>{s.currentTarget.style.backgroundColor=`${a.color}3A`},onMouseLeave:a=>{a.currentTarget.style.backgroundColor=""},children:[s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",style:{color:a.color},children:s.jsx("path",{fill:"currentColor",d:"M4 20q-.825 0-1.412-.587T2 18V6q0-.825.588-1.412T4 4h5.175q.4 0 .763.15t.637.425L12 6h8q.825 0 1.413.588T22 8v10q0 .825-.587 1.413T20 20z"})}),s.jsx(l,{variant:"h5",children:a.name})]}),T=({organization:a})=>{const{role:r,isSuper:t}=N(),l=v(()=>{const s=[];return(t||r&&(r===e.OWNER||r===e.ADMIN))&&(s.push({label:"Analytics",icon:"material-symbols:analytics-outline-rounded",href:c.ORGANIZATION_DASHBOARD(a?._id)}),s.push({label:"Admins",icon:"material-symbols:supervised-user-circle-outline",href:c.ORGANIZATION_ADMINS(a?._id)}),s.push({label:"Settings",icon:"material-symbols:settings-outline-rounded",href:c.ORGANIZATION_SETTINGS(a?._id)})),s},[r,t]);return l?.length>0?s.jsx("div",{className:"qc:text-muted qc:sm:text-foreground qc:flex qc:flex-row qc:items-center qc:justify-end qc:gap-8 qc:pr-4",children:l.map(a=>s.jsx(L,{content:a?.label,children:s.jsx("a",{target:"_blank",href:a.href,rel:"noreferrer",children:s.jsx(n,{name:a.icon,size:"lg"})})},a.label))}):null},S=()=>{const{folderId:r=""}=i(),t=o(),{folders:l,organization:e,props:{organizationId:c}}=a();if(!t?.state?.internalNavigation)try{const a=new URLSearchParams(window?.location?.search);let r=a.get("event"),t=a.get("page");if(!r&&!t&&window?.location?.hash){const a=window.location.hash.split("?");if(a.length>1){const s=new URLSearchParams(a[1]);r=s.get("event"),t=s.get("page")}}if(r){if(t)switch(t.toLowerCase()){case"upload":return s.jsx(f,{to:d.UPLOAD(r)});case"curate":return s.jsx(f,{to:d.CURATE(r)});case"leaderboard":return s.jsx(f,{to:d.LEADERBOARD(r)});default:return s.jsx(f,{to:d.GALLERY(r)})}return s.jsx(f,{to:d.GALLERY(r)})}}catch(a){console.error("Error parsing URL parameters:",a)}const n=l?.filter(a=>a.parentFolderId===(r?.length>0?r:null)||a.parentFolderId===(r?.length>0?r:void 0)),{isLoading:v,data:y}=h({queryKey:[`public-events-${c}`,r],queryFn:async()=>(await p.get(u.PUBLIC_EVENTS,{headers:{"x-org-id":c},searchParams:{folderId:r,sort:"-createdAt"}}).json()).data});return v?s.jsx("div",{className:"qc:grid qc:grid-cols-1 qc:gap-4 qc:sm:grid-cols-3 qc-mt-4",children:Array.from({length:3}).map((a,r)=>s.jsxs("div",{className:"qc:space-y-4",children:[s.jsx(m,{className:"qc:h-72 qc:overflow-hidden qc:rounded qc:sm:h-80"}),s.jsx(m,{className:"qc:h-6 qc:w-64 qc:rounded"})]},r))}):s.jsxs(z,{children:[e?.navigationSettings?.enableNavbar&&s.jsx(x,{}),s.jsxs("div",{className:"qc:min-h-screen qc:w-full",children:[s.jsx(T,{organization:e}),r&&s.jsx("div",{className:"qc:mt-4",children:s.jsx(b,{homeLink:d.PUBLIC_EVENTS,data:w(l,r)})}),n?.length>0&&s.jsx("div",{className:"qc:mt-4 qc:grid qc:grid-cols-2 qc:gap-3 qc:md:grid-cols-2 qc:lg:grid-cols-4 qc:lg:gap-6",children:n?.map(a=>s.jsx(j,{to:d.FOLDER_EVENTS(a?._id),children:s.jsx(I,{folder:a},a._id)},a?._id))}),y?.length<=0&&s.jsx("div",{className:"min-h-[80vh]",children:s.jsx(q,{title:l?.length>0?"Empty folder":"No events",description:l?.length>0?"Browse other folders for events":"Check back later for our awesome events!",className:"qc:mt-24 qc:md:mt-36",iconSvg:s.jsxs("svg",{"data-name":"Layer 1",className:"qc:size-full",viewBox:"0 0 858.76 581.93",xmlns:"http://www.w3.org/2000/svg",children:[s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m982.6 738.67a198.59 198.59 0 0 1 16.436-62.675q3.7094-8.2865 8.1655-16.208a1.2103 1.2103 0 0 0-2.0886-1.2208 201.33 201.33 0 0 0-22.403 61.805q-1.682 9.0855-2.5283 18.299c-0.14337 1.5493 2.2763 1.5396 2.4188 0z",fill:"#f2f2f2"}),s.jsx("circle",{cx:"842.44",cy:"489.32",r:"15.319",fill:"#f2f2f2"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m984.17 739.08a128.83 128.83 0 0 1 10.662-40.66q2.4064-5.3758 5.2973-10.515a0.78518 0.78518 0 0 0-1.355-0.792 130.61 130.61 0 0 0-14.534 40.096q-1.0912 5.8942-1.6402 11.872c-0.093 1.0051 1.4768 0.99878 1.5692 0z",fill:"#f2f2f2"}),s.jsx("circle",{cx:"833.31",cy:"521.45",r:"9.9382",fill:"#f2f2f2"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m982.19 738.14a128.83 128.83 0 0 1-16.601-38.618q-1.409-5.7188-2.2905-11.549a0.78518 0.78518 0 0 0-1.5555 0.2089 130.61 130.61 0 0 0 13.202 40.554q2.7649 5.3186 6.0085 10.369c0.54487 0.84972 1.7787-0.12078 1.2373-0.96515z",fill:"#f2f2f2"}),s.jsx("circle",{cx:"791.11",cy:"520.75",r:"9.9382",fill:"#f2f2f2"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m341.05 738.67a198.59 198.59 0 0 0-16.436-62.675q-3.7094-8.2865-8.1655-16.208a1.2103 1.2103 0 0 1 2.0886-1.2208 201.33 201.33 0 0 1 22.403 61.805q1.682 9.0855 2.5283 18.299c0.14338 1.5493-2.2763 1.5396-2.4188 0z",fill:"#f2f2f2"}),s.jsx("circle",{cx:"139.97",cy:"489.32",r:"15.319",fill:"#f2f2f2"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m339.48 739.08a128.83 128.83 0 0 0-10.662-40.66q-2.4064-5.3758-5.2973-10.515a0.78518 0.78518 0 0 1 1.355-0.792 130.61 130.61 0 0 1 14.534 40.096q1.0912 5.8942 1.6402 11.872c0.093 1.0051-1.4768 0.99878-1.5692 0z",fill:"#f2f2f2"}),s.jsx("circle",{cx:"149.1",cy:"521.45",r:"9.9382",fill:"#f2f2f2"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m341.46 738.14a128.83 128.83 0 0 0 16.601-38.618q1.409-5.7188 2.2905-11.549a0.78518 0.78518 0 0 1 1.5555 0.2089 130.61 130.61 0 0 1-13.202 40.554q-2.7649 5.3186-6.0084 10.369c-0.54487 0.84972-1.7787-0.12078-1.2373-0.96515z",fill:"#f2f2f2"}),s.jsx("circle",{cx:"191.3",cy:"520.75",r:"9.9382",fill:"#f2f2f2"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m925.02 538.41 0.2391 180.11a12.626 12.626 0 0 1-12.593 12.63l-74.817 0.10967c21.062-39.4 32.987-101.41 32.917-149.22a281.27 281.27 0 0 0-5.721-56.161l47.345-0.0694a12.626 12.626 0 0 1 12.63 12.593z",fill:"currentColor"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m1028.2 740.97h-738.29a1.1907 1.1907 0 0 1 0-2.3814h738.29a1.1907 1.1907 0 0 1 0 2.3814z",fill:"#3f3d56"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m815.39 513.79-133.34-0.52295 12.966-43.137a16.599 16.599 0 0 1 15.804-11.75h0.06274l76.106 0.29883a16.597 16.597 0 0 1 15.774 11.875z",fill:"#3f3d56"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m889.83 499.03a14 14 0 0 0-14 14h28a14 14 0 0 0-14-14z",fill:"currentColor"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m932.83 740.03h-368a17.019 17.019 0 0 1-17-17v-194a17.019 17.019 0 0 1 17-17h368a17.019 17.019 0 0 1 17 17v194a17.019 17.019 0 0 1-17 17zm-368-226a15.017 15.017 0 0 0-15 15v194a15.017 15.017 0 0 0 15 15h368a15.017 15.017 0 0 0 15-15v-194a15.017 15.017 0 0 0-15-15z",fill:"#3f3d56"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m764.83 497.53h-32a8.5 8.5 0 0 1 0-17h32a8.5 8.5 0 0 1 0 17z",fill:"#fff"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m748.83 702.03a76 76 0 1 1 76-76 76.086 76.086 0 0 1-76 76zm0-150a74 74 0 1 0 74 74 74.084 74.084 0 0 0-74-74z",fill:"#3f3d56"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m748.83 676.03a50 50 0 1 1 50-50 50.056 50.056 0 0 1-50 50zm0-98a48 48 0 1 0 48 48 48.054 48.054 0 0 0-48-48z",fill:"#3f3d56"}),s.jsx("circle",{cx:"578.2",cy:"467",r:"38",fill:"#ccc"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m725.83 626.03a25.001 25.001 0 0 1 21.5-24.751 25 25 0 1 0 0 49.502 25.001 25.001 0 0 1-21.5-24.751z",fill:"#fff"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m914.83 514.03h-50v-1a25 25 0 0 1 50 0zm-47.979-2h45.957a23 23 0 0 0-45.957 0z",fill:"#3f3d56"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m572.83 542.03a10 10 0 1 1 10-10 10.011 10.011 0 0 1-10 10zm0-18a8 8 0 1 0 8 8 8.0092 8.0092 0 0 0-8-8z",fill:"#3f3d56"}),s.jsx("circle",{cx:"402.2",cy:"373",r:"5",fill:"currentColor"}),s.jsx("circle",{cx:"428.2",cy:"373",r:"5",fill:"#ccc"}),s.jsx("circle",{cx:"454.2",cy:"373",r:"5",fill:"#ccc"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m598.83 542.03a10 10 0 1 1 10-10 10.011 10.011 0 0 1-10 10zm0-18a8 8 0 1 0 8 8 8.0092 8.0092 0 0 0-8-8z",fill:"#3f3d56"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m624.83 542.03a10 10 0 1 1 10-10 10.011 10.011 0 0 1-10 10zm0-18a8 8 0 1 0 8 8 8.0092 8.0092 0 0 0-8-8z",fill:"#3f3d56"}),s.jsx("rect",{x:"378.2",y:"439.87",width:"130",height:"2",fill:"#3f3d56"}),s.jsx("rect",{x:"378.2",y:"480.13",width:"126.77",height:"2",fill:"#3f3d56"}),s.jsx("rect",{x:"648.2",y:"439.87",width:"130",height:"2",fill:"#3f3d56"}),s.jsx("rect",{x:"651.2",y:"480.13",width:"126.77",height:"2",fill:"#3f3d56"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m443.45 401.51c-8.1095-3.7255-13.44-14.377-13.137-24.881s5.8315-20.329 13.456-25.338a26.649 26.649 0 0 1 25.219-1.9056c8.1825 3.483 19.169 4.4318 24.087 13.089 3.7796 6.6528 2.4181 21.495-0.25792 28.892-2.3129 6.394-7.9684 9.9966-13.483 12.013a45.34 45.34 0 0 1-37.511-3.0216",fill:"#2f2e41"}),s.jsx("polygon",{points:"223.38 568.71 211.72 564.91 220.8 518.14 238.01 523.74",fill:"#ffb8b8"}),s.jsx("path",{transform:"translate(72.575 -240.02) rotate(18.021)",d:"m372.58 718.9h23.644v14.887h-38.531a14.887 14.887 0 0 1 14.887-14.887z",fill:"#2f2e41"}),s.jsx("polygon",{points:"327.75 568.96 315.49 568.96 309.66 521.67 327.75 521.67",fill:"#ffb8b8"}),s.jsx("path",{d:"m306.73 565.46h23.644v14.887h-38.531a14.887 14.887 0 0 1 14.887-14.887z",fill:"#2f2e41"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m497.75 708.65c-0.07373 0-0.14746-2e-3 -0.22168-0.00585l-13.586-0.64747a4.5061 4.5061 0 0 1-4.2854-4.4326l-1.8411-134.39a1.5 1.5 0 0 0-2.8267-0.67871l-71.958 136.44a4.4762 4.4762 0 0 1-4.822 2.3213l-13.521-2.5752a4.4992 4.4992 0 0 1-3.4014-5.918l52.43-148.55 4.0344-43.943a4.4698 4.4698 0 0 1 3.936-4.0498c15.277-1.877 36.624-14.395 45.092-19.689a4.446 4.446 0 0 1 3.5305-0.53125 4.5558 4.5558 0 0 1 2.8308 2.2451 202.75 202.75 0 0 1 22.277 123.98l-13.217 96.54a4.4752 4.4752 0 0 1-4.4507 3.8907z",fill:"#2f2e41"}),s.jsx("circle",{cx:"290.56",cy:"228.24",r:"24.561",fill:"#ffb8b8"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m436.71 516.82-7.3955-52.845a31.045 31.045 0 0 1 60.574-13.635c2.106 9.7686 6.385 21.66 4.8218 34.479-10.953 30.399-30.835 39.772-58 32z",fill:"#b3b3b3"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m469.21 434.82h-18a4.5051 4.5051 0 0 1-4.5-4.5v-6a4.5051 4.5051 0 0 1 4.5-4.5h18a4.5051 4.5051 0 0 1 4.5 4.5v6a4.5051 4.5051 0 0 1-4.5 4.5z",fill:"#b3b3b3"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m560.44 534.7a10.743 10.743 0 0 0-8.7149-13.979l-56.029-80.214-16.614 16.425 60.299 73.683a10.801 10.801 0 0 0 21.059 4.0847z",fill:"#ffb8b8"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m513.22 465.05-20.234 13.507a4.8169 4.8169 0 0 1-7.0291-1.9475l-10.365-21.928a13.377 13.377 0 0 1 22.295-14.789l16.229 17.919a4.8169 4.8169 0 0 1-0.8968 7.2386z",fill:"#b3b3b3"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m362.5 426.92a10.526 10.526 0 0 1 0.2393 1.6401l42.957 24.782 10.441-6.0109 11.131 14.572-17.45 12.438a8 8 0 0 1-9.5982-0.23384l-44.297-34.946a10.497 10.497 0 1 1 6.5757-12.241z",fill:"#ffb8b8"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m418.18 471.35-10.794-21.802a4.8169 4.8169 0 0 1 2.835-6.7204l23.078-7.4597a13.377 13.377 0 0 1 11.8 24.012l-19.857 13.79a4.8169 4.8169 0 0 1-7.0632-1.82z",fill:"#b3b3b3"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m477.67 356.34a4.0633 4.0633 0 0 0 4.3168-2.4094 5.8506 5.8506 0 0 0-0.41558-5.1377 10.736 10.736 0 0 0-3.7759-3.7034 12.406 12.406 0 0 0-5.9816-2.0579 7.4612 7.4612 0 0 0-5.7939 2.1993 5.3768 5.3768 0 0 0-0.97171 5.9276c0.89811 1.7319 2.7825 2.7031 4.6186 3.3625a27.094 27.094 0 0 0 11.378 1.4944",fill:"#2f2e41"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m485.52 398.45c-4.2928 0.20179-3.5536-8.9072-4.8971-12.989s-3.1955-8.9513-7.4212-9.734c-3.463-0.6414-6.5925 1.8908-9.609 3.7086-5.3764 3.24-12.336 4.4352-17.981 1.6906s-9.0786-10.078-6.3329-15.723a12.876 12.876 0 0 1 8.049-6.3415 25.906 25.906 0 0 1 10.462-0.50253 53.527 53.527 0 0 1 21.886 7.7574c4.5819 2.8736 8.9417 6.7864 10.306 12.02s1.9198 19.465-3.413 20.366z",fill:"#2f2e41"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m474.29 343.67c-3.2427-4.1108-2.0213-10.588 1.7582-14.211s9.3995-4.7529 14.615-4.292a29.621 29.621 0 0 1 24.025 17.275c3.2959 7.5393 3.2687 16.163 6.2494 23.832a32.137 32.137 0 0 0 43.41 17.543c5.1881-2.3921 10.128-7.0763 9.8321-12.782 3.2802 12.646-2.6276 27.112-13.823 33.847-6.5573 3.9448-14.323 5.284-21.92 6.2056-4.9507 0.60059-10.039 1.0474-14.87-0.18987-6.7592-1.731-12.418-6.7198-15.845-12.798s-4.7748-13.161-4.827-20.138c-0.04071-5.4353 0.67085-10.873 0.29483-16.296s-2.0061-11.031-5.9367-14.785-10.564-4.9899-14.878-1.6831c-1.7337 1.329-3.0043 3.2697-4.9563 4.2502s-5.036 0.21793-5.1666-1.9626z",fill:"#2f2e41"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m380.18 427.1h-202.58a6.9935 6.9935 0 0 1-6.9854-6.9854v-114.1a6.9936 6.9936 0 0 1 6.9854-6.9854h202.58a6.9933 6.9933 0 0 1 6.9854 6.9854v114.1a6.9933 6.9933 0 0 1-6.9854 6.9854zm-202.58-126.51a5.4392 5.4392 0 0 0-5.4331 5.4331v114.1a5.4392 5.4392 0 0 0 5.4331 5.4331h202.58a5.4395 5.4395 0 0 0 5.4331-5.4331v-114.1a5.4394 5.4394 0 0 0-5.4331-5.4331z",fill:"#3f3d56"}),s.jsx("circle",{cx:"73.768",cy:"191.12",r:"28.967",fill:"#e6e6e6"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m356.01 401.31-34.003-58.895a2.4215 2.4215 0 0 0-4.1941 0l-20.751 35.942-30.936-53.582a3.1047 3.1047 0 0 0-5.3774 0l-43.596 75.511a3.1046 3.1046 0 0 0 2.6887 4.657h134.07a2.4215 2.4215 0 0 0 2.0971-3.6322z",fill:"currentColor"}),s.jsx("rect",{x:"14.747",y:"153.97",width:"12.419",height:"12.419",fill:"#3f3d56"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m459.04 259.1h-158.29a5.4645 5.4645 0 0 1-5.4581-5.4582v-89.15a5.4645 5.4645 0 0 1 5.4581-5.4582h158.29a5.4643 5.4643 0 0 1 5.4582 5.4582v89.15a5.4643 5.4643 0 0 1-5.4582 5.4582zm-158.29-98.853a4.25 4.25 0 0 0-4.2452 4.2452v89.15a4.25 4.25 0 0 0 4.2452 4.2452h158.29a4.2502 4.2502 0 0 0 4.2452-4.2452v-89.15a4.2502 4.2502 0 0 0-4.2452-4.2452z",fill:"#ccc"}),s.jsx("circle",{cx:"182.31",cy:"39.947",r:"22.634",fill:"#f2f2f2"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m440.15 238.95-26.569-46.018a1.892 1.892 0 0 0-3.2771 0l-16.214 28.084-24.172-41.867a2.4259 2.4259 0 0 0-4.2017 0l-34.064 59.001a2.4258 2.4258 0 0 0 2.1008 3.6388h104.76a1.8921 1.8921 0 0 0 1.6386-2.8381z",fill:"#e6e6e6"}),s.jsx("rect",{x:"136.2",y:"10.916",width:"9.7034",height:"9.7034",fill:"#ccc"})]})})}),y?.length>0&&s.jsx("div",{className:"qc:grid qc:grid-cols-1 qc:gap-4 qc:gap-y-6 qc:pb-16 qc:sm:grid-cols-3 qc:mt-4",children:y?.map(a=>s.jsx(j,{to:d.GALLERY(a.slug),children:s.jsx(E,{event:a})},a._id))})]}),s.jsx(g,{})]})};export{S as default};
1
+ import{u as a,j as s,E as r,c as t,T as l,A as e,a as c,I as n,b as i,d as o,N as f,P as d,e as h,S as m,f as x,g as j,h as q,F as g,k as p,i as u}from"./BaA7RHRf.js";import{useMemo as v,Fragment as z}from"react";import{F as b,g as w}from"./VOx0knsi.js";import{L as y}from"./DS2UD7gV.js";import{u as N,T as L}from"./DwNWOPAY.js";const A=a=>a===r.UPCOMING?"qc:bg-warning":a===r.CLOSED?"qc:bg-destructive":"qc:bg-success",E=({event:e})=>{const{organization:c}=a(),n=e?.coverImageUrl?e?.coverImageUrl:e?.contents?.length>0?e.contents[0].thumbnailUrl||e.contents[0].url:void 0;return s.jsxs("div",{className:"qc:space-y-4",children:[s.jsxs("div",{className:"qc:relative qc:h-72 qc:overflow-hidden qc:rounded qc:sm:h-80",children:[n?s.jsx(y,{wrapperClassName:"qc:size-full qc:sm:hover:scale-105 qc:sm:transition-transform",src:e?.coverImageUrl?e?.coverImageUrl:e?.contents?.length>0?e.contents[0].thumbnailUrl||e.contents[0].url:`https://placehold.co/600x400/${c?.color?.slice(1)}/white`,blurhash:e?.coverBlurHash?e?.coverBlurHash:e?.contents?.length>0?e.contents[0].blurHash:void 0}):s.jsx("div",{className:"qc:bg-primary qc:flex qc:size-full qc:items-center qc:justify-center",children:s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"qc:text-primary-foreground qc:size-16",viewBox:"0 0 24 24",children:s.jsx("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"})})}),!c?.integrationSettings?.hideEventStatus&&e?.status!==r.CLOSED&&s.jsx("span",{className:t("qc:absolute qc:right-4 qc:top-4 qc:inline-flex qc:items-center qc:rounded-full qc:px-3 qc:py-2",A(e.status)),children:s.jsx(l,{variant:"h6",color:"white",children:e.status})})]}),s.jsx(l,{variant:"h4",immutable:!0,lines:"2",children:e.name})]})},I=({folder:a})=>s.jsxs("div",{className:"qc:shadow-outer qc:border-border qc:flex qc:items-center qc:gap-4 qc:rounded qc:border qc:p-2 qc:transition-colors qc:duration-200",onMouseEnter:s=>{s.currentTarget.style.backgroundColor=`${a.color}3A`},onMouseLeave:a=>{a.currentTarget.style.backgroundColor=""},children:[s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",style:{color:a.color},children:s.jsx("path",{fill:"currentColor",d:"M4 20q-.825 0-1.412-.587T2 18V6q0-.825.588-1.412T4 4h5.175q.4 0 .763.15t.637.425L12 6h8q.825 0 1.413.588T22 8v10q0 .825-.587 1.413T20 20z"})}),s.jsx(l,{variant:"h5",children:a.name})]}),T=({organization:a})=>{const{role:r,isSuper:t}=N(),l=v(()=>{const s=[];return(t||r&&(r===e.OWNER||r===e.ADMIN))&&(s.push({label:"Analytics",icon:"material-symbols:analytics-outline-rounded",href:c.ORGANIZATION_DASHBOARD(a?._id)}),s.push({label:"Admins",icon:"material-symbols:supervised-user-circle-outline",href:c.ORGANIZATION_ADMINS(a?._id)}),s.push({label:"Settings",icon:"material-symbols:settings-outline-rounded",href:c.ORGANIZATION_SETTINGS(a?._id)})),s},[r,t]);return l?.length>0?s.jsx("div",{className:"qc:text-muted qc:sm:text-foreground qc:flex qc:flex-row qc:items-center qc:justify-end qc:gap-8 qc:pr-4",children:l.map(a=>s.jsx(L,{content:a?.label,children:s.jsx("a",{target:"_blank",href:a.href,rel:"noreferrer",children:s.jsx(n,{name:a.icon,size:"lg"})})},a.label))}):null},S=()=>{const{folderId:r=""}=i(),t=o(),{folders:l,organization:e,props:{organizationId:c}}=a();if(!t?.state?.internalNavigation)try{const a=new URLSearchParams(window?.location?.search);let r=a.get("event"),t=a.get("page");if(!r&&!t&&window?.location?.hash){const a=window.location.hash.split("?");if(a.length>1){const s=new URLSearchParams(a[1]);r=s.get("event"),t=s.get("page")}}if(r){if(t)switch(t.toLowerCase()){case"upload":return s.jsx(f,{to:d.UPLOAD(r)});case"curate":return s.jsx(f,{to:d.CURATE(r)});case"leaderboard":return s.jsx(f,{to:d.LEADERBOARD(r)});default:return s.jsx(f,{to:d.GALLERY(r)})}return s.jsx(f,{to:d.GALLERY(r)})}}catch(a){console.error("Error parsing URL parameters:",a)}const n=l?.filter(a=>a.parentFolderId===(r?.length>0?r:null)||a.parentFolderId===(r?.length>0?r:void 0)),{isLoading:v,data:y}=h({queryKey:[`public-events-${c}`,r],queryFn:async()=>(await p.get(u.PUBLIC_EVENTS,{headers:{"x-org-id":c},searchParams:{folderId:r,sort:"-createdAt"}}).json()).data});return v?s.jsx("div",{className:"qc:grid qc:grid-cols-1 qc:gap-4 qc:sm:grid-cols-3 qc-mt-4",children:Array.from({length:3}).map((a,r)=>s.jsxs("div",{className:"qc:space-y-4",children:[s.jsx(m,{className:"qc:h-72 qc:overflow-hidden qc:rounded qc:sm:h-80"}),s.jsx(m,{className:"qc:h-6 qc:w-64 qc:rounded"})]},r))}):s.jsxs(z,{children:[e?.navigationSettings?.enableNavbar&&s.jsx(x,{}),s.jsxs("div",{className:"qc:min-h-screen qc:w-full",children:[s.jsx(T,{organization:e}),r&&s.jsx("div",{className:"qc:mt-4",children:s.jsx(b,{homeLink:d.PUBLIC_EVENTS,data:w(l,r)})}),n?.length>0&&s.jsx("div",{className:"qc:mt-4 qc:grid qc:grid-cols-2 qc:gap-3 qc:md:grid-cols-2 qc:lg:grid-cols-4 qc:lg:gap-6",children:n?.map(a=>s.jsx(j,{to:d.FOLDER_EVENTS(a?._id),children:s.jsx(I,{folder:a},a._id)},a?._id))}),y?.length<=0&&s.jsx("div",{className:"min-h-[80vh]",children:s.jsx(q,{title:l?.length>0?"Empty folder":"No events",description:l?.length>0?"Browse other folders for events":"Check back later for our awesome events!",className:"qc:mt-24 qc:md:mt-36",iconSvg:s.jsxs("svg",{"data-name":"Layer 1",className:"qc:size-full",viewBox:"0 0 858.76 581.93",xmlns:"http://www.w3.org/2000/svg",children:[s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m982.6 738.67a198.59 198.59 0 0 1 16.436-62.675q3.7094-8.2865 8.1655-16.208a1.2103 1.2103 0 0 0-2.0886-1.2208 201.33 201.33 0 0 0-22.403 61.805q-1.682 9.0855-2.5283 18.299c-0.14337 1.5493 2.2763 1.5396 2.4188 0z",fill:"#f2f2f2"}),s.jsx("circle",{cx:"842.44",cy:"489.32",r:"15.319",fill:"#f2f2f2"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m984.17 739.08a128.83 128.83 0 0 1 10.662-40.66q2.4064-5.3758 5.2973-10.515a0.78518 0.78518 0 0 0-1.355-0.792 130.61 130.61 0 0 0-14.534 40.096q-1.0912 5.8942-1.6402 11.872c-0.093 1.0051 1.4768 0.99878 1.5692 0z",fill:"#f2f2f2"}),s.jsx("circle",{cx:"833.31",cy:"521.45",r:"9.9382",fill:"#f2f2f2"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m982.19 738.14a128.83 128.83 0 0 1-16.601-38.618q-1.409-5.7188-2.2905-11.549a0.78518 0.78518 0 0 0-1.5555 0.2089 130.61 130.61 0 0 0 13.202 40.554q2.7649 5.3186 6.0085 10.369c0.54487 0.84972 1.7787-0.12078 1.2373-0.96515z",fill:"#f2f2f2"}),s.jsx("circle",{cx:"791.11",cy:"520.75",r:"9.9382",fill:"#f2f2f2"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m341.05 738.67a198.59 198.59 0 0 0-16.436-62.675q-3.7094-8.2865-8.1655-16.208a1.2103 1.2103 0 0 1 2.0886-1.2208 201.33 201.33 0 0 1 22.403 61.805q1.682 9.0855 2.5283 18.299c0.14338 1.5493-2.2763 1.5396-2.4188 0z",fill:"#f2f2f2"}),s.jsx("circle",{cx:"139.97",cy:"489.32",r:"15.319",fill:"#f2f2f2"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m339.48 739.08a128.83 128.83 0 0 0-10.662-40.66q-2.4064-5.3758-5.2973-10.515a0.78518 0.78518 0 0 1 1.355-0.792 130.61 130.61 0 0 1 14.534 40.096q1.0912 5.8942 1.6402 11.872c0.093 1.0051-1.4768 0.99878-1.5692 0z",fill:"#f2f2f2"}),s.jsx("circle",{cx:"149.1",cy:"521.45",r:"9.9382",fill:"#f2f2f2"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m341.46 738.14a128.83 128.83 0 0 0 16.601-38.618q1.409-5.7188 2.2905-11.549a0.78518 0.78518 0 0 1 1.5555 0.2089 130.61 130.61 0 0 1-13.202 40.554q-2.7649 5.3186-6.0084 10.369c-0.54487 0.84972-1.7787-0.12078-1.2373-0.96515z",fill:"#f2f2f2"}),s.jsx("circle",{cx:"191.3",cy:"520.75",r:"9.9382",fill:"#f2f2f2"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m925.02 538.41 0.2391 180.11a12.626 12.626 0 0 1-12.593 12.63l-74.817 0.10967c21.062-39.4 32.987-101.41 32.917-149.22a281.27 281.27 0 0 0-5.721-56.161l47.345-0.0694a12.626 12.626 0 0 1 12.63 12.593z",fill:"currentColor"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m1028.2 740.97h-738.29a1.1907 1.1907 0 0 1 0-2.3814h738.29a1.1907 1.1907 0 0 1 0 2.3814z",fill:"#3f3d56"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m815.39 513.79-133.34-0.52295 12.966-43.137a16.599 16.599 0 0 1 15.804-11.75h0.06274l76.106 0.29883a16.597 16.597 0 0 1 15.774 11.875z",fill:"#3f3d56"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m889.83 499.03a14 14 0 0 0-14 14h28a14 14 0 0 0-14-14z",fill:"currentColor"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m932.83 740.03h-368a17.019 17.019 0 0 1-17-17v-194a17.019 17.019 0 0 1 17-17h368a17.019 17.019 0 0 1 17 17v194a17.019 17.019 0 0 1-17 17zm-368-226a15.017 15.017 0 0 0-15 15v194a15.017 15.017 0 0 0 15 15h368a15.017 15.017 0 0 0 15-15v-194a15.017 15.017 0 0 0-15-15z",fill:"#3f3d56"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m764.83 497.53h-32a8.5 8.5 0 0 1 0-17h32a8.5 8.5 0 0 1 0 17z",fill:"#fff"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m748.83 702.03a76 76 0 1 1 76-76 76.086 76.086 0 0 1-76 76zm0-150a74 74 0 1 0 74 74 74.084 74.084 0 0 0-74-74z",fill:"#3f3d56"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m748.83 676.03a50 50 0 1 1 50-50 50.056 50.056 0 0 1-50 50zm0-98a48 48 0 1 0 48 48 48.054 48.054 0 0 0-48-48z",fill:"#3f3d56"}),s.jsx("circle",{cx:"578.2",cy:"467",r:"38",fill:"#ccc"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m725.83 626.03a25.001 25.001 0 0 1 21.5-24.751 25 25 0 1 0 0 49.502 25.001 25.001 0 0 1-21.5-24.751z",fill:"#fff"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m914.83 514.03h-50v-1a25 25 0 0 1 50 0zm-47.979-2h45.957a23 23 0 0 0-45.957 0z",fill:"#3f3d56"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m572.83 542.03a10 10 0 1 1 10-10 10.011 10.011 0 0 1-10 10zm0-18a8 8 0 1 0 8 8 8.0092 8.0092 0 0 0-8-8z",fill:"#3f3d56"}),s.jsx("circle",{cx:"402.2",cy:"373",r:"5",fill:"currentColor"}),s.jsx("circle",{cx:"428.2",cy:"373",r:"5",fill:"#ccc"}),s.jsx("circle",{cx:"454.2",cy:"373",r:"5",fill:"#ccc"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m598.83 542.03a10 10 0 1 1 10-10 10.011 10.011 0 0 1-10 10zm0-18a8 8 0 1 0 8 8 8.0092 8.0092 0 0 0-8-8z",fill:"#3f3d56"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m624.83 542.03a10 10 0 1 1 10-10 10.011 10.011 0 0 1-10 10zm0-18a8 8 0 1 0 8 8 8.0092 8.0092 0 0 0-8-8z",fill:"#3f3d56"}),s.jsx("rect",{x:"378.2",y:"439.87",width:"130",height:"2",fill:"#3f3d56"}),s.jsx("rect",{x:"378.2",y:"480.13",width:"126.77",height:"2",fill:"#3f3d56"}),s.jsx("rect",{x:"648.2",y:"439.87",width:"130",height:"2",fill:"#3f3d56"}),s.jsx("rect",{x:"651.2",y:"480.13",width:"126.77",height:"2",fill:"#3f3d56"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m443.45 401.51c-8.1095-3.7255-13.44-14.377-13.137-24.881s5.8315-20.329 13.456-25.338a26.649 26.649 0 0 1 25.219-1.9056c8.1825 3.483 19.169 4.4318 24.087 13.089 3.7796 6.6528 2.4181 21.495-0.25792 28.892-2.3129 6.394-7.9684 9.9966-13.483 12.013a45.34 45.34 0 0 1-37.511-3.0216",fill:"#2f2e41"}),s.jsx("polygon",{points:"223.38 568.71 211.72 564.91 220.8 518.14 238.01 523.74",fill:"#ffb8b8"}),s.jsx("path",{transform:"translate(72.575 -240.02) rotate(18.021)",d:"m372.58 718.9h23.644v14.887h-38.531a14.887 14.887 0 0 1 14.887-14.887z",fill:"#2f2e41"}),s.jsx("polygon",{points:"327.75 568.96 315.49 568.96 309.66 521.67 327.75 521.67",fill:"#ffb8b8"}),s.jsx("path",{d:"m306.73 565.46h23.644v14.887h-38.531a14.887 14.887 0 0 1 14.887-14.887z",fill:"#2f2e41"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m497.75 708.65c-0.07373 0-0.14746-2e-3 -0.22168-0.00585l-13.586-0.64747a4.5061 4.5061 0 0 1-4.2854-4.4326l-1.8411-134.39a1.5 1.5 0 0 0-2.8267-0.67871l-71.958 136.44a4.4762 4.4762 0 0 1-4.822 2.3213l-13.521-2.5752a4.4992 4.4992 0 0 1-3.4014-5.918l52.43-148.55 4.0344-43.943a4.4698 4.4698 0 0 1 3.936-4.0498c15.277-1.877 36.624-14.395 45.092-19.689a4.446 4.446 0 0 1 3.5305-0.53125 4.5558 4.5558 0 0 1 2.8308 2.2451 202.75 202.75 0 0 1 22.277 123.98l-13.217 96.54a4.4752 4.4752 0 0 1-4.4507 3.8907z",fill:"#2f2e41"}),s.jsx("circle",{cx:"290.56",cy:"228.24",r:"24.561",fill:"#ffb8b8"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m436.71 516.82-7.3955-52.845a31.045 31.045 0 0 1 60.574-13.635c2.106 9.7686 6.385 21.66 4.8218 34.479-10.953 30.399-30.835 39.772-58 32z",fill:"#b3b3b3"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m469.21 434.82h-18a4.5051 4.5051 0 0 1-4.5-4.5v-6a4.5051 4.5051 0 0 1 4.5-4.5h18a4.5051 4.5051 0 0 1 4.5 4.5v6a4.5051 4.5051 0 0 1-4.5 4.5z",fill:"#b3b3b3"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m560.44 534.7a10.743 10.743 0 0 0-8.7149-13.979l-56.029-80.214-16.614 16.425 60.299 73.683a10.801 10.801 0 0 0 21.059 4.0847z",fill:"#ffb8b8"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m513.22 465.05-20.234 13.507a4.8169 4.8169 0 0 1-7.0291-1.9475l-10.365-21.928a13.377 13.377 0 0 1 22.295-14.789l16.229 17.919a4.8169 4.8169 0 0 1-0.8968 7.2386z",fill:"#b3b3b3"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m362.5 426.92a10.526 10.526 0 0 1 0.2393 1.6401l42.957 24.782 10.441-6.0109 11.131 14.572-17.45 12.438a8 8 0 0 1-9.5982-0.23384l-44.297-34.946a10.497 10.497 0 1 1 6.5757-12.241z",fill:"#ffb8b8"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m418.18 471.35-10.794-21.802a4.8169 4.8169 0 0 1 2.835-6.7204l23.078-7.4597a13.377 13.377 0 0 1 11.8 24.012l-19.857 13.79a4.8169 4.8169 0 0 1-7.0632-1.82z",fill:"#b3b3b3"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m477.67 356.34a4.0633 4.0633 0 0 0 4.3168-2.4094 5.8506 5.8506 0 0 0-0.41558-5.1377 10.736 10.736 0 0 0-3.7759-3.7034 12.406 12.406 0 0 0-5.9816-2.0579 7.4612 7.4612 0 0 0-5.7939 2.1993 5.3768 5.3768 0 0 0-0.97171 5.9276c0.89811 1.7319 2.7825 2.7031 4.6186 3.3625a27.094 27.094 0 0 0 11.378 1.4944",fill:"#2f2e41"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m485.52 398.45c-4.2928 0.20179-3.5536-8.9072-4.8971-12.989s-3.1955-8.9513-7.4212-9.734c-3.463-0.6414-6.5925 1.8908-9.609 3.7086-5.3764 3.24-12.336 4.4352-17.981 1.6906s-9.0786-10.078-6.3329-15.723a12.876 12.876 0 0 1 8.049-6.3415 25.906 25.906 0 0 1 10.462-0.50253 53.527 53.527 0 0 1 21.886 7.7574c4.5819 2.8736 8.9417 6.7864 10.306 12.02s1.9198 19.465-3.413 20.366z",fill:"#2f2e41"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m474.29 343.67c-3.2427-4.1108-2.0213-10.588 1.7582-14.211s9.3995-4.7529 14.615-4.292a29.621 29.621 0 0 1 24.025 17.275c3.2959 7.5393 3.2687 16.163 6.2494 23.832a32.137 32.137 0 0 0 43.41 17.543c5.1881-2.3921 10.128-7.0763 9.8321-12.782 3.2802 12.646-2.6276 27.112-13.823 33.847-6.5573 3.9448-14.323 5.284-21.92 6.2056-4.9507 0.60059-10.039 1.0474-14.87-0.18987-6.7592-1.731-12.418-6.7198-15.845-12.798s-4.7748-13.161-4.827-20.138c-0.04071-5.4353 0.67085-10.873 0.29483-16.296s-2.0061-11.031-5.9367-14.785-10.564-4.9899-14.878-1.6831c-1.7337 1.329-3.0043 3.2697-4.9563 4.2502s-5.036 0.21793-5.1666-1.9626z",fill:"#2f2e41"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m380.18 427.1h-202.58a6.9935 6.9935 0 0 1-6.9854-6.9854v-114.1a6.9936 6.9936 0 0 1 6.9854-6.9854h202.58a6.9933 6.9933 0 0 1 6.9854 6.9854v114.1a6.9933 6.9933 0 0 1-6.9854 6.9854zm-202.58-126.51a5.4392 5.4392 0 0 0-5.4331 5.4331v114.1a5.4392 5.4392 0 0 0 5.4331 5.4331h202.58a5.4395 5.4395 0 0 0 5.4331-5.4331v-114.1a5.4394 5.4394 0 0 0-5.4331-5.4331z",fill:"#3f3d56"}),s.jsx("circle",{cx:"73.768",cy:"191.12",r:"28.967",fill:"#e6e6e6"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m356.01 401.31-34.003-58.895a2.4215 2.4215 0 0 0-4.1941 0l-20.751 35.942-30.936-53.582a3.1047 3.1047 0 0 0-5.3774 0l-43.596 75.511a3.1046 3.1046 0 0 0 2.6887 4.657h134.07a2.4215 2.4215 0 0 0 2.0971-3.6322z",fill:"currentColor"}),s.jsx("rect",{x:"14.747",y:"153.97",width:"12.419",height:"12.419",fill:"#3f3d56"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m459.04 259.1h-158.29a5.4645 5.4645 0 0 1-5.4581-5.4582v-89.15a5.4645 5.4645 0 0 1 5.4581-5.4582h158.29a5.4643 5.4643 0 0 1 5.4582 5.4582v89.15a5.4643 5.4643 0 0 1-5.4582 5.4582zm-158.29-98.853a4.25 4.25 0 0 0-4.2452 4.2452v89.15a4.25 4.25 0 0 0 4.2452 4.2452h158.29a4.2502 4.2502 0 0 0 4.2452-4.2452v-89.15a4.2502 4.2502 0 0 0-4.2452-4.2452z",fill:"#ccc"}),s.jsx("circle",{cx:"182.31",cy:"39.947",r:"22.634",fill:"#f2f2f2"}),s.jsx("path",{transform:"translate(-170.62 -159.03)",d:"m440.15 238.95-26.569-46.018a1.892 1.892 0 0 0-3.2771 0l-16.214 28.084-24.172-41.867a2.4259 2.4259 0 0 0-4.2017 0l-34.064 59.001a2.4258 2.4258 0 0 0 2.1008 3.6388h104.76a1.8921 1.8921 0 0 0 1.6386-2.8381z",fill:"#e6e6e6"}),s.jsx("rect",{x:"136.2",y:"10.916",width:"9.7034",height:"9.7034",fill:"#ccc"})]})})}),y?.length>0&&s.jsx("div",{className:"qc:grid qc:grid-cols-1 qc:gap-4 qc:gap-y-6 qc:pb-16 qc:sm:grid-cols-3 qc:mt-4",children:y?.map(a=>s.jsx(j,{to:d.GALLERY(a.slug),children:s.jsx(E,{event:a})},a._id))})]}),s.jsx(g,{})]})};export{S as default};