@qratilabs/qrati-connect 2.2.3 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/element/{AuthLayout-smqrs4PK.js → AuthLayout-BQsxj8DA.js} +1 -1
- package/element/{ContentsPage-BALVk95k.js → ContentsPage-BswZWICC.js} +2 -2
- package/element/{CuratePage-6O-YtfaK.js → CuratePage-l_53kq1u.js} +1 -1
- package/element/{Dialog-0wEAIe3Z.js → Dialog-xRPAHU1U.js} +1 -1
- package/element/{DotLottiePlayer-q7KyZjj4.js → DotLottiePlayer-DWbmlHl0.js} +1 -1
- package/element/{EventHeaderAdminButtons-AOGt2ZR_.js → EventHeaderAdminButtons-DpqqYPmp.js} +1 -1
- package/element/{FolderBreadcrumb-DE1SuI3R.js → FolderBreadcrumb-DgOZR2JO.js} +1 -1
- package/element/{ForgotPasswordPage-B7SQUSjQ.js → ForgotPasswordPage-CIz3_X-3.js} +1 -1
- package/element/{InputField-DCqkCRI8.js → InputField-DybXE_Ab.js} +1 -1
- package/element/{LazyLoadImage-Dx2kZ_ki.js → LazyLoadImage-8X8b06AJ.js} +1 -1
- package/element/{LeaderboardPage-ZllEyvHF.js → LeaderboardPage-Bphjksy_.js} +1 -1
- package/element/{LoginPage-CT0pEqXM.js → LoginPage-CHzBIQEq.js} +1 -1
- package/element/{NCMVHL6D-BwoIucZN.js → NCMVHL6D-CBCgRwdZ.js} +1 -1
- package/element/{PublicEvents-CIrYMBEL.js → PublicEvents-RN-_fsl2.js} +1 -1
- package/element/{RegisterPage-jGyiY6Q1.js → RegisterPage-7WLryyTX.js} +1 -1
- package/element/{SocialLoginButton-CD7hRRi3.js → SocialLoginButton-DpBl7dWg.js} +1 -1
- package/element/{UploadPage-CITq8Afj.js → UploadPage-B7BieTEU.js} +1 -1
- package/element/{VideoPlayer-BnGqOvd_.js → VideoPlayer-Bk8Hao3q.js} +1 -1
- package/element/element.es.js +1 -1
- package/element/{heic2any-DYXlMp6f.js → heic2any-DLQd-wQs.js} +1 -1
- package/element/{index-D2rVaTyg.js → index-DI8B7D73.js} +1 -1
- package/element/{index-dgkxxAYh.js → index-JyoNGo8S.js} +9 -9
- package/element/index.esm-CAQX5kI5.js +1 -0
- package/element/{photoswipe-CLqAYZuN.js → photoswipe-Coj-X7bR.js} +1 -1
- package/element/{tslib.es6-Kir8qsmG.js → tslib.es6-C9bR68b3.js} +1 -1
- package/element/{useOrgAccess-CQGTKm39.js → useOrgAccess-CnN4aiYB.js} +1 -1
- package/element/web.es.js +1 -1
- package/package.json +18 -15
- package/react/-74yB4f5.js +1 -0
- package/react/{BByYodE2.js → B1neVlFZ.js} +1 -1
- package/react/{fLcJgmSx.js → BO8jvMXn.js} +1 -1
- package/react/{COmmnujB.js → BbIY3X7C.js} +1 -1
- package/react/{BfbjKTvp.js → CN2vdtYT.js} +1 -1
- package/react/{38fKKEwY.js → CXu6PHUW.js} +1 -1
- package/react/{CqFENFZB.js → CZp0lmKh.js} +1 -1
- package/react/{DCL2O5W3.js → CfZ5_7x-.js} +1 -1
- package/react/{CsN-e_l4.js → D6nR1wv_.js} +1 -1
- package/react/DBnzOELO.js +30 -0
- package/react/{Csp0JYSr.js → D_imcCpv.js} +2 -2
- package/react/{B-cnuYGK.js → DrqnWQLs.js} +1 -1
- package/react/{BKCu0fMZ.js → DvDETl8u.js} +1 -1
- package/react/{CeAGRh0t.js → DvOl03h5.js} +1 -1
- package/react/{CUXGA7St.js → Dwry3hNI.js} +1 -1
- package/react/{T91t2h6g.js → DyklTvwE.js} +1 -1
- package/react/{B_TCkLjZ.js → Gbk2zO2l.js} +1 -1
- package/react/{CwcF5rKn.js → IbMHxVCj.js} +1 -1
- package/react/{C-DBWaEg.js → Pcjql-py.js} +1 -1
- package/react/{Fz3ptOAl.js → Ply2G2qz.js} +1 -1
- package/react/{DDq_DfWj.js → Y9TU3Znq.js} +1 -1
- package/react/{B8mLtg2-.js → fuEo08KS.js} +1 -1
- package/react/index.es.js +1 -1
- package/react/{B1i756QD.js → jRrpvD0D.js} +1 -1
- package/react/{CTjUKTPO.js → rZy1FKOQ.js} +1 -1
- package/react/types/QratiConnect.d.ts +75 -0
- package/react/types/index.d.ts +1 -0
- package/umd/web.umd.js +118 -118
- package/element/index.esm-DH681Jwb.js +0 -1
- package/react/DNOLzzZH.js +0 -30
- package/react/HhCRmfOk.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as a,j as s,E as r,c as t,T as l,I as e,A as c,a as n,b as i,d as f,N as o,P as d,e as m,S as h,f as x,g as j,h as q,F as p,k as g,i as u}from"./DNOLzzZH.js";import{useMemo as v,Fragment as b}from"react";import{F as z,g as y}from"./BByYodE2.js";import{L as w}from"./DDq_DfWj.js";import{u as N,T as L}from"./CwcF5rKn.js";const A=a=>a===r.UPCOMING?"qc:bg-warning":a===r.CLOSED?"qc:bg-destructive":"qc:bg-success",I=({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(w,{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})]})},E=({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:bg-background-primary-dark qc:bg-opacity-5 qc:p-2 qc:hover:bg-opacity-10",children:[s.jsx(e,{name:"material-symbols:folder-rounded",style:{color:a.color}}),s.jsx(l,{variant:"h5",children:a.name})]}),S=({organization:a})=>{const{role:r,isSuper:t}=N(),l=v(()=>{const s=[];return(t||r&&(r===c.OWNER||r===c.ADMIN))&&(s.push({label:"Analytics",icon:"material-symbols:analytics-outline-rounded",href:n.ORGANIZATION_DASHBOARD(a?._id)}),s.push({label:"Admins",icon:"material-symbols:supervised-user-circle-outline",href:n.ORGANIZATION_ADMINS(a?._id)}),s.push({label:"Settings",icon:"material-symbols:settings-outline-rounded",href:n.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(e,{name:a.icon,size:"lg"})})},a.label))}):null},T=()=>{const{folderId:r=""}=i(),t=f(),{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(o,{to:d.UPLOAD(r)});case"curate":return s.jsx(o,{to:d.CURATE(r)});case"leaderboard":return s.jsx(o,{to:d.LEADERBOARD(r)});default:return s.jsx(o,{to:d.GALLERY(r)})}return s.jsx(o,{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:w}=m({queryKey:[`public-events-${c}`,r],queryFn:async()=>(await g.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(h,{className:"qc:h-72 qc:overflow-hidden qc:rounded qc:sm:h-80"}),s.jsx(h,{className:"qc:h-6 qc:w-64 qc:rounded"})]},r))}):s.jsxs(b,{children:[e?.navigationSettings?.enableNavbar&&s.jsx(x,{}),s.jsxs("div",{className:"qc:min-h-screen qc:w-full",children:[s.jsx(S,{organization:e}),r&&s.jsx("div",{className:"qc:mt-4",children:s.jsx(z,{homeLink:d.PUBLIC_EVENTS,data:y(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(E,{folder:a},a._id)},a?._id))}),w?.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"})]})})}),w?.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:w?.map(a=>s.jsx(j,{to:d.GALLERY(a.slug),children:s.jsx(I,{event:a})},a._id))})]}),s.jsx(p,{})]})};export{T as default};
|
|
1
|
+
import{u as a,j as s,E as r,c as t,T as l,I as e,A as c,a as n,b as i,d as f,N as o,P as d,e as m,S as h,f as x,g as j,h as q,F as p,k as g,i as u}from"./DBnzOELO.js";import{useMemo as v,Fragment as b}from"react";import{F as z,g as y}from"./B1neVlFZ.js";import{L as w}from"./Y9TU3Znq.js";import{u as N,T as L}from"./IbMHxVCj.js";const A=a=>a===r.UPCOMING?"qc:bg-warning":a===r.CLOSED?"qc:bg-destructive":"qc:bg-success",I=({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(w,{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})]})},E=({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:bg-background-primary-dark qc:bg-opacity-5 qc:p-2 qc:hover:bg-opacity-10",children:[s.jsx(e,{name:"material-symbols:folder-rounded",style:{color:a.color}}),s.jsx(l,{variant:"h5",children:a.name})]}),S=({organization:a})=>{const{role:r,isSuper:t}=N(),l=v(()=>{const s=[];return(t||r&&(r===c.OWNER||r===c.ADMIN))&&(s.push({label:"Analytics",icon:"material-symbols:analytics-outline-rounded",href:n.ORGANIZATION_DASHBOARD(a?._id)}),s.push({label:"Admins",icon:"material-symbols:supervised-user-circle-outline",href:n.ORGANIZATION_ADMINS(a?._id)}),s.push({label:"Settings",icon:"material-symbols:settings-outline-rounded",href:n.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(e,{name:a.icon,size:"lg"})})},a.label))}):null},T=()=>{const{folderId:r=""}=i(),t=f(),{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(o,{to:d.UPLOAD(r)});case"curate":return s.jsx(o,{to:d.CURATE(r)});case"leaderboard":return s.jsx(o,{to:d.LEADERBOARD(r)});default:return s.jsx(o,{to:d.GALLERY(r)})}return s.jsx(o,{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:w}=m({queryKey:[`public-events-${c}`,r],queryFn:async()=>(await g.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(h,{className:"qc:h-72 qc:overflow-hidden qc:rounded qc:sm:h-80"}),s.jsx(h,{className:"qc:h-6 qc:w-64 qc:rounded"})]},r))}):s.jsxs(b,{children:[e?.navigationSettings?.enableNavbar&&s.jsx(x,{}),s.jsxs("div",{className:"qc:min-h-screen qc:w-full",children:[s.jsx(S,{organization:e}),r&&s.jsx("div",{className:"qc:mt-4",children:s.jsx(z,{homeLink:d.PUBLIC_EVENTS,data:y(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(E,{folder:a},a._id)},a?._id))}),w?.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"})]})})}),w?.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:w?.map(a=>s.jsx(j,{to:d.GALLERY(a.slug),children:s.jsx(I,{event:a})},a._id))})]}),s.jsx(p,{})]})};export{T as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as a,u as s,j as c,S as e,N as r,g as t,c as q,P as i,T as l,a1 as d,a2 as o}from"./
|
|
1
|
+
import{d as a,u as s,j as c,S as e,N as r,g as t,c as q,P as i,T as l,a1 as d,a2 as o}from"./DBnzOELO.js";import"react";const n=()=>{const n=a(),{initializing:m,organization:x,user:h}=s();return m?c.jsxs("div",{className:"qc:mx-auto qc:max-w-lg qc:space-y-8 qc:py-8",children:[c.jsx(e,{className:"qc:h-8"}),c.jsx(e,{className:"qc:h-8"}),c.jsx(e,{className:"qc:h-8"}),c.jsx(e,{className:"qc:h-8"})]}):!x||x?.customAuth?null:h?c.jsx(r,{replace:!0,to:n?.state?.referrer||"/"}):c.jsxs("div",{className:"qc:bg-background qc:mx-auto qc:mt-24 qc:min-h-[80vh] qc:max-w-md",children:[c.jsxs("div",{className:"qc:my-8 qc:flex qc:w-full qc:justify-around",children:[c.jsx(t,{to:i.LOGIN,state:n?.state,className:q(n.pathname===i.LOGIN?"qc:border-primary":"qc:border-border","qc:flex-1 qc:border-2 qc:border-x-0 qc:border-t-0 qc:pb-2"),children:c.jsx(l,{variant:"h5",align:"center",children:"Login"})}),c.jsx(t,{to:i.REGISTER,state:n?.state,className:q(n.pathname===i.REGISTER?"qc:border-primary":"qc:border-border","qc:flex-1 qc:border-2 qc:border-x-0 qc:border-t-0 qc:pb-2"),children:c.jsx(l,{variant:"h5",align:"center",children:"Register"})})]}),c.jsx(d,{}),c.jsx("div",{className:"qc:mt-12",children:c.jsx(o,{})})]})};export{n as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{R as e,u as t,e as n,s as r,k as o,i,X as l,j as s,I as a,O as u,U as c,c as d,T as f,d as p,A as m,a as h,Z as g,y as v,P as y}from"./DNOLzzZH.js";import*as b from"react";import w,{useRef as E,useCallback as x,useEffect as T,useState as S,useMemo as O,useLayoutEffect as P,useContext as A,createContext as I,forwardRef as L,Fragment as R,isValidElement as C,cloneElement as F,createElement as M,useId as N,useSyncExternalStore as k}from"react";import{u as D,T as q}from"./CwcF5rKn.js";import*as _ from"react-dom";import{createPortal as j,flushSync as H}from"react-dom";const V=s=>{const a=e(),{props:{organizationId:u}}=t(),{role:c,isSuper:d}=D(),{isLoading:f,data:p,isError:m,error:h}=n({queryKey:[r.EVENT_IN_REVIEW_COUNT(s?.slug)],queryFn:async()=>{try{const e=await o.get(i.GET_CONTENTS_COUNT,{searchParams:{eventSlug:s?.slug,filter:`status:${l.IN_REVIEW}`},headers:{"x-org-id":u}}).json();if(e.error)throw new Error(e.error);return e.data}catch(e){throw new Error(e?.message||e||"Failed to fetch in review count")}},staleTime:0,enabled:!!c||d});return{loading:f,inReviewCount:p,error:m?h:null,increment:()=>{a.setQueryData([r.EVENT_IN_REVIEW_COUNT(s?.slug)],e=>e+1)},decrement:()=>{a.setQueryData([r.EVENT_IN_REVIEW_COUNT(s?.slug)],e=>e-1)}}},B=e=>e&&e.length>0?e.charAt(0).toUpperCase()+e.slice(1).toLowerCase():"",W=typeof document<"u"?w.useLayoutEffect:()=>{};var U;const G=null!==(U=w.useInsertionEffect)&&void 0!==U?U:W;const $=e=>{var t;return null!==(t=e?.ownerDocument)&&void 0!==t?t:document},K=e=>e&&"window"in e&&e.window===e?e:$(e).defaultView||window;function z(e,t){return!(!t||!e)&&e.contains(t)}const Y=(e=document)=>e.activeElement;function Q(e){return e.target}function X(e){var t;if(typeof window>"u"||null==window.navigator)return!1;let n=null===(t=window.navigator.userAgentData)||void 0===t?void 0:t.brands;return Array.isArray(n)&&n.some(t=>e.test(t.brand))||e.test(window.navigator.userAgent)}function J(e){var t;return typeof window<"u"&&null!=window.navigator&&e.test((null===(t=window.navigator.userAgentData)||void 0===t?void 0:t.platform)||window.navigator.platform)}function Z(e){if("test"===process.env.NODE_ENV)return e;let t=null;return()=>(null==t&&(t=e()),t)}const ee=Z(function(){return J(/^Mac/i)}),te=Z(function(){return J(/^iPhone/i)}),ne=Z(function(){return J(/^iPad/i)||ee()&&navigator.maxTouchPoints>1}),re=Z(function(){return te()||ne()});Z(function(){return ee()||re()}),Z(function(){return X(/AppleWebKit/i)&&!oe()});const oe=Z(function(){return X(/Chrome/i)}),ie=Z(function(){return X(/Android/i)});function le(){let e=E(new Map),t=x((t,n,r,o)=>{let i=o?.once?(...t)=>{e.current.delete(r),r(...t)}:r;e.current.set(r,{type:n,eventTarget:t,fn:i,options:o}),t.addEventListener(n,i,o)},[]),n=x((t,n,r,o)=>{var i;let l=(null===(i=e.current.get(r))||void 0===i?void 0:i.fn)||r;t.removeEventListener(n,l,o),e.current.delete(r)},[]),r=x(()=>{e.current.forEach((e,t)=>{n(e.eventTarget,e.type,t,e.options)})},[n]);return T(()=>r,[r]),{addGlobalListener:t,removeGlobalListener:n,removeAllGlobalListeners:r}}function se(e){let t=e;return t.nativeEvent=e,t.isDefaultPrevented=()=>t.defaultPrevented,t.isPropagationStopped=()=>t.cancelBubble,t.persist=()=>{},t}function ae(e){let t=E({isFocused:!1,observer:null});W(()=>{const e=t.current;return()=>{e.observer&&(e.observer.disconnect(),e.observer=null)}},[]);let n=function(e){const t=E(null);return G(()=>{t.current=e},[e]),x((...e)=>{const n=t.current;return n?.(...e)},[])}(t=>{e?.(t)});return x(e=>{if(e.target instanceof HTMLButtonElement||e.target instanceof HTMLInputElement||e.target instanceof HTMLTextAreaElement||e.target instanceof HTMLSelectElement){t.current.isFocused=!0;let r=e.target,o=e=>{if(t.current.isFocused=!1,r.disabled){let t=se(e);n(t)}t.current.observer&&(t.current.observer.disconnect(),t.current.observer=null)};r.addEventListener("focusout",o,{once:!0}),t.current.observer=new MutationObserver(()=>{if(t.current.isFocused&&r.disabled){var e;null===(e=t.current.observer)||void 0===e||e.disconnect();let n=r===document.activeElement?null:document.activeElement;r.dispatchEvent(new FocusEvent("blur",{relatedTarget:n})),r.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:n}))}}),t.current.observer.observe(r,{attributes:!0,attributeFilter:["disabled"]})}},[n])}Z(function(){return X(/Firefox/i)});let ue=null,ce=new Set,de=new Map,fe=!1,pe=!1;const me={Tab:!0,Escape:!0};function he(e,t){for(let n of ce)n(e,t)}function ge(e){fe=!0,function(e){return!(e.metaKey||!ee()&&e.altKey||e.ctrlKey||"Control"===e.key||"Shift"===e.key||"Meta"===e.key)}(e)&&(ue="keyboard",he("keyboard",e))}function ve(e){ue="pointer",("mousedown"===e.type||"pointerdown"===e.type)&&(fe=!0,he("pointer",e))}function ye(e){(function(e){return!(""!==e.pointerType||!e.isTrusted)||(ie()&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)})(e)&&(fe=!0,ue="virtual")}function be(e){e.target===window||e.target===document||!e.isTrusted||(!fe&&!pe&&(ue="virtual",he("virtual",e)),fe=!1,pe=!1)}function we(){fe=!1,pe=!0}function Ee(e){if(typeof window>"u"||typeof document>"u"||de.get(K(e)))return;const t=K(e),n=$(e);let r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){fe=!0,r.apply(this,arguments)},n.addEventListener("keydown",ge,!0),n.addEventListener("keyup",ge,!0),n.addEventListener("click",ye,!0),t.addEventListener("focus",be,!0),t.addEventListener("blur",we,!1),typeof PointerEvent<"u"?(n.addEventListener("pointerdown",ve,!0),n.addEventListener("pointermove",ve,!0),n.addEventListener("pointerup",ve,!0)):"test"===process.env.NODE_ENV&&(n.addEventListener("mousedown",ve,!0),n.addEventListener("mousemove",ve,!0),n.addEventListener("mouseup",ve,!0)),t.addEventListener("beforeunload",()=>{xe(e)},{once:!0}),de.set(t,{focus:r})}const xe=(e,t)=>{const n=K(e),r=$(e);t&&r.removeEventListener("DOMContentLoaded",t),de.has(n)&&(n.HTMLElement.prototype.focus=de.get(n).focus,r.removeEventListener("keydown",ge,!0),r.removeEventListener("keyup",ge,!0),r.removeEventListener("click",ye,!0),n.removeEventListener("focus",be,!0),n.removeEventListener("blur",we,!1),typeof PointerEvent<"u"?(r.removeEventListener("pointerdown",ve,!0),r.removeEventListener("pointermove",ve,!0),r.removeEventListener("pointerup",ve,!0)):"test"===process.env.NODE_ENV&&(r.removeEventListener("mousedown",ve,!0),r.removeEventListener("mousemove",ve,!0),r.removeEventListener("mouseup",ve,!0)),de.delete(n))};function Te(){return"pointer"!==ue}typeof document<"u"&&function(e){const t=$(e);let n;"loading"!==t.readyState?Ee(e):(n=()=>{Ee(e)},t.addEventListener("DOMContentLoaded",n))}();const Se=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function Oe(e,t,n){Ee(),T(()=>{let t=(t,r)=>{(function(e,t,n){let r=$(n?.target);const o=typeof window<"u"?K(n?.target).HTMLInputElement:HTMLInputElement,i=typeof window<"u"?K(n?.target).HTMLTextAreaElement:HTMLTextAreaElement,l=typeof window<"u"?K(n?.target).HTMLElement:HTMLElement,s=typeof window<"u"?K(n?.target).KeyboardEvent:KeyboardEvent;return!((e=e||r.activeElement instanceof o&&!Se.has(r.activeElement.type)||r.activeElement instanceof i||r.activeElement instanceof l&&r.activeElement.isContentEditable)&&"keyboard"===t&&n instanceof s&&!me[n.key])})(!!n?.isTextInput,t,r)&&e(Te())};return ce.add(t),()=>{ce.delete(t)}},t)}function Pe(e){let{isDisabled:t,onBlurWithin:n,onFocusWithin:r,onFocusWithinChange:o}=e,i=E({isFocusWithin:!1}),{addGlobalListener:l,removeAllGlobalListeners:s}=le(),a=x(e=>{e.currentTarget.contains(e.target)&&i.current.isFocusWithin&&!e.currentTarget.contains(e.relatedTarget)&&(i.current.isFocusWithin=!1,s(),n&&n(e),o&&o(!1))},[n,o,i,s]),u=ae(a),c=x(e=>{if(!e.currentTarget.contains(e.target))return;const t=$(e.target),n=Y(t);if(!i.current.isFocusWithin&&n===Q(e.nativeEvent)){r&&r(e),o&&o(!0),i.current.isFocusWithin=!0,u(e);let n=e.currentTarget;l(t,"focus",e=>{if(i.current.isFocusWithin&&!z(n,e.target)){let r=new t.defaultView.FocusEvent("blur",{relatedTarget:e.target});!function(e,t){Object.defineProperty(e,"target",{value:t}),Object.defineProperty(e,"currentTarget",{value:t})}(r,n);let o=se(r);a(o)}},{capture:!0})}},[r,o,u,l,a]);return t?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:c,onBlur:a}}}let Ae=!1,Ie=0;function Le(){Ae=!0,setTimeout(()=>{Ae=!1},50)}function Re(e){"touch"===e.pointerType&&Le()}function Ce(){if(!(typeof document>"u"))return 0===Ie&&(typeof PointerEvent<"u"?document.addEventListener("pointerup",Re):"test"===process.env.NODE_ENV&&document.addEventListener("touchend",Le)),Ie++,()=>{Ie--,!(Ie>0)&&(typeof PointerEvent<"u"?document.removeEventListener("pointerup",Re):"test"===process.env.NODE_ENV&&document.removeEventListener("touchend",Le))}}function Fe(e={}){let{autoFocus:t=!1,isTextInput:n,within:r}=e,o=E({isFocused:!1,isFocusVisible:t||Te()}),[i,l]=S(!1),[s,a]=S(()=>o.current.isFocused&&o.current.isFocusVisible),u=x(()=>a(o.current.isFocused&&o.current.isFocusVisible),[]),c=x(e=>{o.current.isFocused=e,l(e),u()},[u]);Oe(e=>{o.current.isFocusVisible=e,u()},[],{isTextInput:n});let{focusProps:d}=function(e){let{isDisabled:t,onFocus:n,onBlur:r,onFocusChange:o}=e;const i=x(e=>{if(e.target===e.currentTarget)return r&&r(e),o&&o(!1),!0},[r,o]),l=ae(i),s=x(e=>{const t=$(e.target),r=t?Y(t):Y();e.target===e.currentTarget&&r===Q(e.nativeEvent)&&(n&&n(e),o&&o(!0),l(e))},[o,n,l]);return{focusProps:{onFocus:!t&&(n||o||r)?s:void 0,onBlur:t||!r&&!o?void 0:i}}}({isDisabled:r,onFocusChange:c}),{focusWithinProps:f}=Pe({isDisabled:!r,onFocusWithinChange:c});return{isFocused:i,isFocusVisible:s,focusProps:r?f:d}}var Me=Object.defineProperty,Ne=(e,t,n)=>(((e,t,n)=>{t in e?Me(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);let ke=new class{constructor(){Ne(this,"current",this.detect()),Ne(this,"handoffState","pending"),Ne(this,"currentId",0)}set(e){this.current!==e&&(this.handoffState="pending",this.currentId=0,this.current=e)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return"server"===this.current}get isClient(){return"client"===this.current}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){"pending"===this.handoffState&&(this.handoffState="complete")}get isHandoffComplete(){return"complete"===this.handoffState}};function De(e){var t;return ke.isServer?null:null==e?document:null!=(t=e?.ownerDocument)?t:document}function qe(e){var t,n;return ke.isServer?null:null==e?document:null!=(n=null==(t=e?.getRootNode)?void 0:t.call(e))?n:document}function _e(e){var t,n;return null!=(n=null==(t=qe(e))?void 0:t.activeElement)?n:null}function je(e){"function"==typeof queueMicrotask?queueMicrotask(e):Promise.resolve().then(e).catch(e=>setTimeout(()=>{throw e}))}function He(){let e=[],t={addEventListener:(e,n,r,o)=>(e.addEventListener(n,r,o),t.add(()=>e.removeEventListener(n,r,o))),requestAnimationFrame(...e){let n=requestAnimationFrame(...e);return t.add(()=>cancelAnimationFrame(n))},nextFrame:(...e)=>t.requestAnimationFrame(()=>t.requestAnimationFrame(...e)),setTimeout(...e){let n=setTimeout(...e);return t.add(()=>clearTimeout(n))},microTask(...e){let n={current:!0};return je(()=>{n.current&&e[0]()}),t.add(()=>{n.current=!1})},style(e,t,n){let r=e.style.getPropertyValue(t);return Object.assign(e.style,{[t]:n}),this.add(()=>{Object.assign(e.style,{[t]:r})})},group(e){let t=He();return e(t),this.add(()=>t.dispose())},add:t=>(e.includes(t)||e.push(t),()=>{let n=e.indexOf(t);if(n>=0)for(let t of e.splice(n,1))t()}),dispose(){for(let t of e.splice(0))t()}};return t}function Ve(){let[e]=S(He);return T(()=>()=>e.dispose(),[e]),e}let Be=(e,t)=>{ke.isServer?T(e,t):P(e,t)};function We(e){let t=E(e);return Be(()=>{t.current=e},[e]),t}let Ue=function(e){let t=We(e);return w.useCallback((...e)=>t.current(...e),[t])};function Ge(e){return O(()=>e,Object.values(e))}let $e=I(void 0);function Ke(){return A($e)}function ze(...e){return Array.from(new Set(e.flatMap(e=>"string"==typeof e?e.split(" "):[]))).filter(Boolean).join(" ")}function Ye(e,t,...n){if(e in t){let r=t[e];return"function"==typeof r?r(...n):r}let r=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(e=>`"${e}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,Ye),r}var Qe,Xe=((Qe=Xe||{})[Qe.None=0]="None",Qe[Qe.RenderStrategy=1]="RenderStrategy",Qe[Qe.Static=2]="Static",Qe),Je=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(Je||{});function Ze(){let e=function(){let e=E([]),t=x(t=>{for(let n of e.current)null!=n&&("function"==typeof n?n(t):n.current=t)},[]);return(...n)=>{if(!n.every(e=>null==e))return e.current=n,t}}();return x(t=>function({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:o,visible:i=!0,name:l,mergeRefs:s}){s=s??tt;let a=nt(t,e);if(i)return et(a,n,r,l,s);let u=o??0;if(2&u){let{static:e=!1,...t}=a;if(e)return et(t,n,r,l,s)}if(1&u){let{unmount:e=!0,...t}=a;return Ye(e?0:1,{0:()=>null,1:()=>et({...t,hidden:!0,style:{display:"none"}},n,r,l,s)})}return et(a,n,r,l,s)}({mergeRefs:e,...t}),[e])}function et(e,t={},n,r,o){let{as:i=n,children:l,refName:s="ref",...a}=lt(e,["unmount","static"]),u=void 0!==e.ref?{[s]:e.ref}:{},c="function"==typeof l?l(t):l;"className"in a&&a.className&&"function"==typeof a.className&&(a.className=a.className(t)),a["aria-labelledby"]&&a["aria-labelledby"]===a.id&&(a["aria-labelledby"]=void 0);let d={};if(t){let e=!1,n=[];for(let[r,o]of Object.entries(t))"boolean"==typeof o&&(e=!0),!0===o&&n.push(r.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`));if(e){d["data-headlessui-state"]=n.join(" ");for(let e of n)d[`data-${e}`]=""}}if(at(i)&&(Object.keys(it(a)).length>0||Object.keys(it(d)).length>0)){if(!(!C(c)||Array.isArray(c)&&c.length>1||function(e){return at(e.type)}(c))){let e=c.props,t=e?.className,n="function"==typeof t?(...e)=>ze(t(...e),a.className):ze(t,a.className),r=n?{className:n}:{},i=nt(c.props,it(lt(a,["ref"])));for(let e in d)e in i&&delete d[e];return F(c,Object.assign({},i,d,u,{ref:o(st(c),u.ref)},r))}if(Object.keys(it(a)).length>0)throw new Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(it(a)).concat(Object.keys(it(d))).map(e=>` - ${e}`).join("\n"),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(e=>` - ${e}`).join("\n")].join("\n"))}return M(i,Object.assign({},lt(a,["ref"]),!at(i)&&u,!at(i)&&d),c)}function tt(...e){return e.every(e=>null==e)?void 0:t=>{for(let n of e)null!=n&&("function"==typeof n?n(t):n.current=t)}}function nt(...e){if(0===e.length)return{};if(1===e.length)return e[0];let t={},n={};for(let r of e)for(let e in r)e.startsWith("on")&&"function"==typeof r[e]?(null!=n[e]||(n[e]=[]),n[e].push(r[e])):t[e]=r[e];if(t.disabled||t["aria-disabled"])for(let e in n)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(e)&&(n[e]=[e=>{var t;return null==(t=e?.preventDefault)?void 0:t.call(e)}]);for(let e in n)Object.assign(t,{[e](t,...r){let o=n[e];for(let e of o){if((t instanceof Event||t?.nativeEvent instanceof Event)&&t.defaultPrevented)return;e(t,...r)}}});return t}function rt(...e){if(0===e.length)return{};if(1===e.length)return e[0];let t={},n={};for(let r of e)for(let e in r)e.startsWith("on")&&"function"==typeof r[e]?(null!=n[e]||(n[e]=[]),n[e].push(r[e])):t[e]=r[e];for(let e in n)Object.assign(t,{[e](...t){let r=n[e];for(let e of r)e?.(...t)}});return t}function ot(e){var t;return Object.assign(L(e),{displayName:null!=(t=e.displayName)?t:e.name})}function it(e){let t=Object.assign({},e);for(let e in t)void 0===t[e]&&delete t[e];return t}function lt(e,t=[]){let n=Object.assign({},e);for(let e of t)e in n&&delete n[e];return n}function st(e){return w.version.split(".")[0]>="19"?e.props.ref:e.ref}function at(e){return e===R||e===Symbol.for("react.fragment")}let ut=I(void 0);function ct(e){return"object"==typeof e&&null!==e&&"nodeType"in e}function dt(e){return ct(e)&&"tagName"in e}function ft(e){return dt(e)&&"accessKey"in e}function pt(e){return dt(e)&&"tabIndex"in e}function mt(e){return ft(e)&&"INPUT"===e.nodeName}function ht(e){return ft(e)&&"LABEL"===e.nodeName}function gt(e){return ft(e)&&"FIELDSET"===e.nodeName}function vt(e){return ft(e)&&"LEGEND"===e.nodeName}function yt(e){let t=e.parentElement,n=null;for(;t&&!gt(t);)vt(t)&&(n=t),t=t.parentElement;let r=""===t?.getAttribute("disabled");return(!r||!function(e){if(!e)return!1;let t=e.previousElementSibling;for(;null!==t;){if(vt(t))return!1;t=t.previousElementSibling}return!0}(n))&&r}let bt=Symbol();function wt(...e){let t=E(e);T(()=>{t.current=e},[e]);let n=Ue(e=>{for(let n of t.current)null!=n&&("function"==typeof n?n(e):n.current=e)});return e.every(e=>null==e||e?.[bt])?void 0:n}let Et=I(null);function xt(){let e=A(Et);if(null===e){let e=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(e,xt),e}return e}Et.displayName="DescriptionContext";let Tt=ot(function(e,t){let n=N(),r=Ke(),{id:o=`headlessui-description-${n}`,...i}=e,l=xt(),s=wt(t);Be(()=>l.register(o),[o,l.register]);let a=Ge({...l.slot,disabled:r||!1}),u={ref:s,...l.props,id:o};return Ze()({ourProps:u,theirProps:i,slot:a,defaultTag:"p",name:l.name||"Description"})});Object.assign(Tt,{});var St=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(St||{});let Ot=I(null);function Pt(){let e=A(Ot);if(null===e){let e=new Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(e,Pt),e}return e}function At({inherit:e=!1}={}){let t=function(){var e,t;let n=null!=(t=null==(e=A(Ot))?void 0:e.value)?t:void 0;return n}(),[n,r]=S([]),o=e?[t,...n].filter(Boolean):n;return[o.length>0?o.join(" "):void 0,O(()=>function(e){let t=Ue(e=>(r(t=>[...t,e]),()=>r(t=>{let n=t.slice(),r=n.indexOf(e);return-1!==r&&n.splice(r,1),n}))),n=O(()=>({register:t,slot:e.slot,name:e.name,props:e.props,value:e.value}),[t,e.slot,e.name,e.props,e.value]);return w.createElement(Ot.Provider,{value:n},e.children)},[r])]}Ot.displayName="LabelContext";let It=ot(function(e,t){var n;let r=N(),o=Pt(),i=A(ut),l=Ke(),{id:s=`headlessui-label-${r}`,htmlFor:a=i??(null==(n=o.props)?void 0:n.htmlFor),passive:u=!1,...c}=e,d=wt(t);Be(()=>o.register(s),[s,o.register]);let f=Ue(e=>{let t=e.currentTarget;if((e.target===e.currentTarget||!function(e){return!!dt(e)&&e.matches('a[href],audio[controls],button,details,embed,iframe,img[usemap],input:not([type="hidden"]),label,select,textarea,video[controls]')}(e.target))&&(ht(t)&&e.preventDefault(),o.props&&"onClick"in o.props&&"function"==typeof o.props.onClick&&o.props.onClick(e),ht(t))){let e=document.getElementById(t.htmlFor);if(e){let t=e.getAttribute("disabled");if("true"===t||""===t)return;let n=e.getAttribute("aria-disabled");if("true"===n||""===n)return;(mt(e)&&("file"===e.type||"radio"===e.type||"checkbox"===e.type)||"radio"===e.role||"checkbox"===e.role||"switch"===e.role)&&e.click(),e.focus({preventScroll:!0})}}}),p=Ge({...o.slot,disabled:l||!1}),m={ref:d,...o.props,id:s,htmlFor:a,onClick:f};return u&&("onClick"in m&&(delete m.htmlFor,delete m.onClick),"onClick"in c&&delete c.onClick),Ze()({ourProps:m,theirProps:c,slot:p,defaultTag:a?"label":"div",name:o.name||"Label"})});function Lt(e){if(null===e)return{width:0,height:0};let{width:t,height:n}=e.getBoundingClientRect();return{width:t,height:n}}function Rt(e,t,n=!1){let[r,o]=S(()=>Lt(t));return Be(()=>{if(!t||!e)return;let n=He();return n.requestAnimationFrame(function e(){n.requestAnimationFrame(e),o(e=>{let n=Lt(t);return n.width===e.width&&n.height===e.height?e:n})}),()=>{n.dispose()}},[t,e]),n?{width:`${r.width}px`,height:`${r.height}px`}:r}Object.assign(It,{});var Ct=(e=>(e[e.Left=0]="Left",e[e.Right=2]="Right",e))(Ct||{});let Ft=class extends Map{constructor(e){super(),this.factory=e}get(e){let t=super.get(e);return void 0===t&&(t=this.factory(e),this.set(e,t)),t}};var Mt,Nt,kt,Dt=Object.defineProperty,qt=(e,t,n)=>(((e,t,n)=>{t in e?Dt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,t+"",n),n),_t=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},jt=(e,t,n)=>(_t(e,t,"read from private field"),n?n.call(e):t.get(e)),Ht=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},Vt=(e,t,n,r)=>(_t(e,t,"write to private field"),t.set(e,n),n);let Bt=class{constructor(e){Ht(this,Mt,{}),Ht(this,Nt,new Ft(()=>new Set)),Ht(this,kt,new Set),qt(this,"disposables",He()),Vt(this,Mt,e),ke.isServer&&this.disposables.microTask(()=>{this.dispose()})}dispose(){this.disposables.dispose()}get state(){return jt(this,Mt)}subscribe(e,t){if(ke.isServer)return()=>{};let n={selector:e,callback:t,current:e(jt(this,Mt))};return jt(this,kt).add(n),this.disposables.add(()=>{jt(this,kt).delete(n)})}on(e,t){return ke.isServer?()=>{}:(jt(this,Nt).get(e).add(t),this.disposables.add(()=>{jt(this,Nt).get(e).delete(t)}))}send(e){let t=this.reduce(jt(this,Mt),e);if(t!==jt(this,Mt)){Vt(this,Mt,t);for(let e of jt(this,kt)){let t=e.selector(jt(this,Mt));Wt(e.current,t)||(e.current=t,e.callback(t))}for(let t of jt(this,Nt).get(e.type))t(jt(this,Mt),e)}}};function Wt(e,t){return!!Object.is(e,t)||"object"==typeof e&&null!==e&&"object"==typeof t&&null!==t&&(Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&Ut(e[Symbol.iterator](),t[Symbol.iterator]()):e instanceof Map&&t instanceof Map||e instanceof Set&&t instanceof Set?e.size===t.size&&Ut(e.entries(),t.entries()):!(!Gt(e)||!Gt(t))&&Ut(Object.entries(e)[Symbol.iterator](),Object.entries(t)[Symbol.iterator]()))}function Ut(e,t){for(;;){let n=e.next(),r=t.next();if(n.done&&r.done)return!0;if(n.done||r.done||!Object.is(n.value,r.value))return!1}}function Gt(e){if("[object Object]"!==Object.prototype.toString.call(e))return!1;let t=Object.getPrototypeOf(e);return null===t||null===Object.getPrototypeOf(t)}function $t(e){let[t,n]=e(),r=He();return(...e)=>{t(...e),r.dispose(),r.microTask(n)}}Mt=new WeakMap,Nt=new WeakMap,kt=new WeakMap;var Kt=Object.defineProperty,zt=(e,t,n)=>(((e,t,n)=>{t in e?Kt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n),Yt=(e=>(e[e.Push=0]="Push",e[e.Pop=1]="Pop",e))(Yt||{});let Qt={0(e,t){let n=t.id,r=e.stack,o=e.stack.indexOf(n);if(-1!==o){let t=e.stack.slice();return t.splice(o,1),t.push(n),r=t,{...e,stack:r}}return{...e,stack:[...e.stack,n]}},1(e,t){let n=t.id,r=e.stack.indexOf(n);if(-1===r)return e;let o=e.stack.slice();return o.splice(r,1),{...e,stack:o}}},Xt=class e extends Bt{constructor(){super(...arguments),zt(this,"actions",{push:e=>this.send({type:0,id:e}),pop:e=>this.send({type:1,id:e})}),zt(this,"selectors",{isTop:(e,t)=>e.stack[e.stack.length-1]===t,inStack:(e,t)=>e.stack.includes(t)})}static new(){return new e({stack:[]})}reduce(e,t){return Ye(t.type,Qt,e,t)}};const Jt=new Ft(()=>Xt.new());var Zt,en={exports:{}},tn={};
|
|
1
|
+
import{R as e,u as t,e as n,s as r,k as o,i,X as l,j as s,I as a,O as u,U as c,c as d,T as f,d as p,A as m,a as h,Z as g,y as v,P as y}from"./DBnzOELO.js";import*as b from"react";import w,{useRef as E,useCallback as x,useEffect as T,useState as S,useMemo as O,useLayoutEffect as P,useContext as A,createContext as I,forwardRef as L,Fragment as R,isValidElement as C,cloneElement as F,createElement as M,useId as N,useSyncExternalStore as k}from"react";import{u as D,T as q}from"./IbMHxVCj.js";import*as _ from"react-dom";import{createPortal as j,flushSync as H}from"react-dom";const V=s=>{const a=e(),{props:{organizationId:u}}=t(),{role:c,isSuper:d}=D(),{isLoading:f,data:p,isError:m,error:h}=n({queryKey:[r.EVENT_IN_REVIEW_COUNT(s?.slug)],queryFn:async()=>{try{const e=await o.get(i.GET_CONTENTS_COUNT,{searchParams:{eventSlug:s?.slug,filter:`status:${l.IN_REVIEW}`},headers:{"x-org-id":u}}).json();if(e.error)throw new Error(e.error);return e.data}catch(e){throw new Error(e?.message||e||"Failed to fetch in review count")}},staleTime:0,enabled:!!c||d});return{loading:f,inReviewCount:p,error:m?h:null,increment:()=>{a.setQueryData([r.EVENT_IN_REVIEW_COUNT(s?.slug)],e=>e+1)},decrement:()=>{a.setQueryData([r.EVENT_IN_REVIEW_COUNT(s?.slug)],e=>e-1)}}},B=e=>e&&e.length>0?e.charAt(0).toUpperCase()+e.slice(1).toLowerCase():"",W=typeof document<"u"?w.useLayoutEffect:()=>{};var U;const G=null!==(U=w.useInsertionEffect)&&void 0!==U?U:W;const $=e=>{var t;return null!==(t=e?.ownerDocument)&&void 0!==t?t:document},K=e=>e&&"window"in e&&e.window===e?e:$(e).defaultView||window;function z(e,t){return!(!t||!e)&&e.contains(t)}const Y=(e=document)=>e.activeElement;function Q(e){return e.target}function X(e){var t;if(typeof window>"u"||null==window.navigator)return!1;let n=null===(t=window.navigator.userAgentData)||void 0===t?void 0:t.brands;return Array.isArray(n)&&n.some(t=>e.test(t.brand))||e.test(window.navigator.userAgent)}function J(e){var t;return typeof window<"u"&&null!=window.navigator&&e.test((null===(t=window.navigator.userAgentData)||void 0===t?void 0:t.platform)||window.navigator.platform)}function Z(e){if("test"===process.env.NODE_ENV)return e;let t=null;return()=>(null==t&&(t=e()),t)}const ee=Z(function(){return J(/^Mac/i)}),te=Z(function(){return J(/^iPhone/i)}),ne=Z(function(){return J(/^iPad/i)||ee()&&navigator.maxTouchPoints>1}),re=Z(function(){return te()||ne()});Z(function(){return ee()||re()}),Z(function(){return X(/AppleWebKit/i)&&!oe()});const oe=Z(function(){return X(/Chrome/i)}),ie=Z(function(){return X(/Android/i)});function le(){let e=E(new Map),t=x((t,n,r,o)=>{let i=o?.once?(...t)=>{e.current.delete(r),r(...t)}:r;e.current.set(r,{type:n,eventTarget:t,fn:i,options:o}),t.addEventListener(n,i,o)},[]),n=x((t,n,r,o)=>{var i;let l=(null===(i=e.current.get(r))||void 0===i?void 0:i.fn)||r;t.removeEventListener(n,l,o),e.current.delete(r)},[]),r=x(()=>{e.current.forEach((e,t)=>{n(e.eventTarget,e.type,t,e.options)})},[n]);return T(()=>r,[r]),{addGlobalListener:t,removeGlobalListener:n,removeAllGlobalListeners:r}}function se(e){let t=e;return t.nativeEvent=e,t.isDefaultPrevented=()=>t.defaultPrevented,t.isPropagationStopped=()=>t.cancelBubble,t.persist=()=>{},t}function ae(e){let t=E({isFocused:!1,observer:null});W(()=>{const e=t.current;return()=>{e.observer&&(e.observer.disconnect(),e.observer=null)}},[]);let n=function(e){const t=E(null);return G(()=>{t.current=e},[e]),x((...e)=>{const n=t.current;return n?.(...e)},[])}(t=>{e?.(t)});return x(e=>{if(e.target instanceof HTMLButtonElement||e.target instanceof HTMLInputElement||e.target instanceof HTMLTextAreaElement||e.target instanceof HTMLSelectElement){t.current.isFocused=!0;let r=e.target,o=e=>{if(t.current.isFocused=!1,r.disabled){let t=se(e);n(t)}t.current.observer&&(t.current.observer.disconnect(),t.current.observer=null)};r.addEventListener("focusout",o,{once:!0}),t.current.observer=new MutationObserver(()=>{if(t.current.isFocused&&r.disabled){var e;null===(e=t.current.observer)||void 0===e||e.disconnect();let n=r===document.activeElement?null:document.activeElement;r.dispatchEvent(new FocusEvent("blur",{relatedTarget:n})),r.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:n}))}}),t.current.observer.observe(r,{attributes:!0,attributeFilter:["disabled"]})}},[n])}Z(function(){return X(/Firefox/i)});let ue=null,ce=new Set,de=new Map,fe=!1,pe=!1;const me={Tab:!0,Escape:!0};function he(e,t){for(let n of ce)n(e,t)}function ge(e){fe=!0,function(e){return!(e.metaKey||!ee()&&e.altKey||e.ctrlKey||"Control"===e.key||"Shift"===e.key||"Meta"===e.key)}(e)&&(ue="keyboard",he("keyboard",e))}function ve(e){ue="pointer",("mousedown"===e.type||"pointerdown"===e.type)&&(fe=!0,he("pointer",e))}function ye(e){(function(e){return!(""!==e.pointerType||!e.isTrusted)||(ie()&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)})(e)&&(fe=!0,ue="virtual")}function be(e){e.target===window||e.target===document||!e.isTrusted||(!fe&&!pe&&(ue="virtual",he("virtual",e)),fe=!1,pe=!1)}function we(){fe=!1,pe=!0}function Ee(e){if(typeof window>"u"||typeof document>"u"||de.get(K(e)))return;const t=K(e),n=$(e);let r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){fe=!0,r.apply(this,arguments)},n.addEventListener("keydown",ge,!0),n.addEventListener("keyup",ge,!0),n.addEventListener("click",ye,!0),t.addEventListener("focus",be,!0),t.addEventListener("blur",we,!1),typeof PointerEvent<"u"?(n.addEventListener("pointerdown",ve,!0),n.addEventListener("pointermove",ve,!0),n.addEventListener("pointerup",ve,!0)):"test"===process.env.NODE_ENV&&(n.addEventListener("mousedown",ve,!0),n.addEventListener("mousemove",ve,!0),n.addEventListener("mouseup",ve,!0)),t.addEventListener("beforeunload",()=>{xe(e)},{once:!0}),de.set(t,{focus:r})}const xe=(e,t)=>{const n=K(e),r=$(e);t&&r.removeEventListener("DOMContentLoaded",t),de.has(n)&&(n.HTMLElement.prototype.focus=de.get(n).focus,r.removeEventListener("keydown",ge,!0),r.removeEventListener("keyup",ge,!0),r.removeEventListener("click",ye,!0),n.removeEventListener("focus",be,!0),n.removeEventListener("blur",we,!1),typeof PointerEvent<"u"?(r.removeEventListener("pointerdown",ve,!0),r.removeEventListener("pointermove",ve,!0),r.removeEventListener("pointerup",ve,!0)):"test"===process.env.NODE_ENV&&(r.removeEventListener("mousedown",ve,!0),r.removeEventListener("mousemove",ve,!0),r.removeEventListener("mouseup",ve,!0)),de.delete(n))};function Te(){return"pointer"!==ue}typeof document<"u"&&function(e){const t=$(e);let n;"loading"!==t.readyState?Ee(e):(n=()=>{Ee(e)},t.addEventListener("DOMContentLoaded",n))}();const Se=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function Oe(e,t,n){Ee(),T(()=>{let t=(t,r)=>{(function(e,t,n){let r=$(n?.target);const o=typeof window<"u"?K(n?.target).HTMLInputElement:HTMLInputElement,i=typeof window<"u"?K(n?.target).HTMLTextAreaElement:HTMLTextAreaElement,l=typeof window<"u"?K(n?.target).HTMLElement:HTMLElement,s=typeof window<"u"?K(n?.target).KeyboardEvent:KeyboardEvent;return!((e=e||r.activeElement instanceof o&&!Se.has(r.activeElement.type)||r.activeElement instanceof i||r.activeElement instanceof l&&r.activeElement.isContentEditable)&&"keyboard"===t&&n instanceof s&&!me[n.key])})(!!n?.isTextInput,t,r)&&e(Te())};return ce.add(t),()=>{ce.delete(t)}},t)}function Pe(e){let{isDisabled:t,onBlurWithin:n,onFocusWithin:r,onFocusWithinChange:o}=e,i=E({isFocusWithin:!1}),{addGlobalListener:l,removeAllGlobalListeners:s}=le(),a=x(e=>{e.currentTarget.contains(e.target)&&i.current.isFocusWithin&&!e.currentTarget.contains(e.relatedTarget)&&(i.current.isFocusWithin=!1,s(),n&&n(e),o&&o(!1))},[n,o,i,s]),u=ae(a),c=x(e=>{if(!e.currentTarget.contains(e.target))return;const t=$(e.target),n=Y(t);if(!i.current.isFocusWithin&&n===Q(e.nativeEvent)){r&&r(e),o&&o(!0),i.current.isFocusWithin=!0,u(e);let n=e.currentTarget;l(t,"focus",e=>{if(i.current.isFocusWithin&&!z(n,e.target)){let r=new t.defaultView.FocusEvent("blur",{relatedTarget:e.target});!function(e,t){Object.defineProperty(e,"target",{value:t}),Object.defineProperty(e,"currentTarget",{value:t})}(r,n);let o=se(r);a(o)}},{capture:!0})}},[r,o,u,l,a]);return t?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:c,onBlur:a}}}let Ae=!1,Ie=0;function Le(){Ae=!0,setTimeout(()=>{Ae=!1},50)}function Re(e){"touch"===e.pointerType&&Le()}function Ce(){if(!(typeof document>"u"))return 0===Ie&&(typeof PointerEvent<"u"?document.addEventListener("pointerup",Re):"test"===process.env.NODE_ENV&&document.addEventListener("touchend",Le)),Ie++,()=>{Ie--,!(Ie>0)&&(typeof PointerEvent<"u"?document.removeEventListener("pointerup",Re):"test"===process.env.NODE_ENV&&document.removeEventListener("touchend",Le))}}function Fe(e={}){let{autoFocus:t=!1,isTextInput:n,within:r}=e,o=E({isFocused:!1,isFocusVisible:t||Te()}),[i,l]=S(!1),[s,a]=S(()=>o.current.isFocused&&o.current.isFocusVisible),u=x(()=>a(o.current.isFocused&&o.current.isFocusVisible),[]),c=x(e=>{o.current.isFocused=e,l(e),u()},[u]);Oe(e=>{o.current.isFocusVisible=e,u()},[],{isTextInput:n});let{focusProps:d}=function(e){let{isDisabled:t,onFocus:n,onBlur:r,onFocusChange:o}=e;const i=x(e=>{if(e.target===e.currentTarget)return r&&r(e),o&&o(!1),!0},[r,o]),l=ae(i),s=x(e=>{const t=$(e.target),r=t?Y(t):Y();e.target===e.currentTarget&&r===Q(e.nativeEvent)&&(n&&n(e),o&&o(!0),l(e))},[o,n,l]);return{focusProps:{onFocus:!t&&(n||o||r)?s:void 0,onBlur:t||!r&&!o?void 0:i}}}({isDisabled:r,onFocusChange:c}),{focusWithinProps:f}=Pe({isDisabled:!r,onFocusWithinChange:c});return{isFocused:i,isFocusVisible:s,focusProps:r?f:d}}var Me=Object.defineProperty,Ne=(e,t,n)=>(((e,t,n)=>{t in e?Me(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);let ke=new class{constructor(){Ne(this,"current",this.detect()),Ne(this,"handoffState","pending"),Ne(this,"currentId",0)}set(e){this.current!==e&&(this.handoffState="pending",this.currentId=0,this.current=e)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return"server"===this.current}get isClient(){return"client"===this.current}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){"pending"===this.handoffState&&(this.handoffState="complete")}get isHandoffComplete(){return"complete"===this.handoffState}};function De(e){var t;return ke.isServer?null:null==e?document:null!=(t=e?.ownerDocument)?t:document}function qe(e){var t,n;return ke.isServer?null:null==e?document:null!=(n=null==(t=e?.getRootNode)?void 0:t.call(e))?n:document}function _e(e){var t,n;return null!=(n=null==(t=qe(e))?void 0:t.activeElement)?n:null}function je(e){"function"==typeof queueMicrotask?queueMicrotask(e):Promise.resolve().then(e).catch(e=>setTimeout(()=>{throw e}))}function He(){let e=[],t={addEventListener:(e,n,r,o)=>(e.addEventListener(n,r,o),t.add(()=>e.removeEventListener(n,r,o))),requestAnimationFrame(...e){let n=requestAnimationFrame(...e);return t.add(()=>cancelAnimationFrame(n))},nextFrame:(...e)=>t.requestAnimationFrame(()=>t.requestAnimationFrame(...e)),setTimeout(...e){let n=setTimeout(...e);return t.add(()=>clearTimeout(n))},microTask(...e){let n={current:!0};return je(()=>{n.current&&e[0]()}),t.add(()=>{n.current=!1})},style(e,t,n){let r=e.style.getPropertyValue(t);return Object.assign(e.style,{[t]:n}),this.add(()=>{Object.assign(e.style,{[t]:r})})},group(e){let t=He();return e(t),this.add(()=>t.dispose())},add:t=>(e.includes(t)||e.push(t),()=>{let n=e.indexOf(t);if(n>=0)for(let t of e.splice(n,1))t()}),dispose(){for(let t of e.splice(0))t()}};return t}function Ve(){let[e]=S(He);return T(()=>()=>e.dispose(),[e]),e}let Be=(e,t)=>{ke.isServer?T(e,t):P(e,t)};function We(e){let t=E(e);return Be(()=>{t.current=e},[e]),t}let Ue=function(e){let t=We(e);return w.useCallback((...e)=>t.current(...e),[t])};function Ge(e){return O(()=>e,Object.values(e))}let $e=I(void 0);function Ke(){return A($e)}function ze(...e){return Array.from(new Set(e.flatMap(e=>"string"==typeof e?e.split(" "):[]))).filter(Boolean).join(" ")}function Ye(e,t,...n){if(e in t){let r=t[e];return"function"==typeof r?r(...n):r}let r=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(e=>`"${e}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,Ye),r}var Qe,Xe=((Qe=Xe||{})[Qe.None=0]="None",Qe[Qe.RenderStrategy=1]="RenderStrategy",Qe[Qe.Static=2]="Static",Qe),Je=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(Je||{});function Ze(){let e=function(){let e=E([]),t=x(t=>{for(let n of e.current)null!=n&&("function"==typeof n?n(t):n.current=t)},[]);return(...n)=>{if(!n.every(e=>null==e))return e.current=n,t}}();return x(t=>function({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:o,visible:i=!0,name:l,mergeRefs:s}){s=s??tt;let a=nt(t,e);if(i)return et(a,n,r,l,s);let u=o??0;if(2&u){let{static:e=!1,...t}=a;if(e)return et(t,n,r,l,s)}if(1&u){let{unmount:e=!0,...t}=a;return Ye(e?0:1,{0:()=>null,1:()=>et({...t,hidden:!0,style:{display:"none"}},n,r,l,s)})}return et(a,n,r,l,s)}({mergeRefs:e,...t}),[e])}function et(e,t={},n,r,o){let{as:i=n,children:l,refName:s="ref",...a}=lt(e,["unmount","static"]),u=void 0!==e.ref?{[s]:e.ref}:{},c="function"==typeof l?l(t):l;"className"in a&&a.className&&"function"==typeof a.className&&(a.className=a.className(t)),a["aria-labelledby"]&&a["aria-labelledby"]===a.id&&(a["aria-labelledby"]=void 0);let d={};if(t){let e=!1,n=[];for(let[r,o]of Object.entries(t))"boolean"==typeof o&&(e=!0),!0===o&&n.push(r.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`));if(e){d["data-headlessui-state"]=n.join(" ");for(let e of n)d[`data-${e}`]=""}}if(at(i)&&(Object.keys(it(a)).length>0||Object.keys(it(d)).length>0)){if(!(!C(c)||Array.isArray(c)&&c.length>1||function(e){return at(e.type)}(c))){let e=c.props,t=e?.className,n="function"==typeof t?(...e)=>ze(t(...e),a.className):ze(t,a.className),r=n?{className:n}:{},i=nt(c.props,it(lt(a,["ref"])));for(let e in d)e in i&&delete d[e];return F(c,Object.assign({},i,d,u,{ref:o(st(c),u.ref)},r))}if(Object.keys(it(a)).length>0)throw new Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(it(a)).concat(Object.keys(it(d))).map(e=>` - ${e}`).join("\n"),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(e=>` - ${e}`).join("\n")].join("\n"))}return M(i,Object.assign({},lt(a,["ref"]),!at(i)&&u,!at(i)&&d),c)}function tt(...e){return e.every(e=>null==e)?void 0:t=>{for(let n of e)null!=n&&("function"==typeof n?n(t):n.current=t)}}function nt(...e){if(0===e.length)return{};if(1===e.length)return e[0];let t={},n={};for(let r of e)for(let e in r)e.startsWith("on")&&"function"==typeof r[e]?(null!=n[e]||(n[e]=[]),n[e].push(r[e])):t[e]=r[e];if(t.disabled||t["aria-disabled"])for(let e in n)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(e)&&(n[e]=[e=>{var t;return null==(t=e?.preventDefault)?void 0:t.call(e)}]);for(let e in n)Object.assign(t,{[e](t,...r){let o=n[e];for(let e of o){if((t instanceof Event||t?.nativeEvent instanceof Event)&&t.defaultPrevented)return;e(t,...r)}}});return t}function rt(...e){if(0===e.length)return{};if(1===e.length)return e[0];let t={},n={};for(let r of e)for(let e in r)e.startsWith("on")&&"function"==typeof r[e]?(null!=n[e]||(n[e]=[]),n[e].push(r[e])):t[e]=r[e];for(let e in n)Object.assign(t,{[e](...t){let r=n[e];for(let e of r)e?.(...t)}});return t}function ot(e){var t;return Object.assign(L(e),{displayName:null!=(t=e.displayName)?t:e.name})}function it(e){let t=Object.assign({},e);for(let e in t)void 0===t[e]&&delete t[e];return t}function lt(e,t=[]){let n=Object.assign({},e);for(let e of t)e in n&&delete n[e];return n}function st(e){return w.version.split(".")[0]>="19"?e.props.ref:e.ref}function at(e){return e===R||e===Symbol.for("react.fragment")}let ut=I(void 0);function ct(e){return"object"==typeof e&&null!==e&&"nodeType"in e}function dt(e){return ct(e)&&"tagName"in e}function ft(e){return dt(e)&&"accessKey"in e}function pt(e){return dt(e)&&"tabIndex"in e}function mt(e){return ft(e)&&"INPUT"===e.nodeName}function ht(e){return ft(e)&&"LABEL"===e.nodeName}function gt(e){return ft(e)&&"FIELDSET"===e.nodeName}function vt(e){return ft(e)&&"LEGEND"===e.nodeName}function yt(e){let t=e.parentElement,n=null;for(;t&&!gt(t);)vt(t)&&(n=t),t=t.parentElement;let r=""===t?.getAttribute("disabled");return(!r||!function(e){if(!e)return!1;let t=e.previousElementSibling;for(;null!==t;){if(vt(t))return!1;t=t.previousElementSibling}return!0}(n))&&r}let bt=Symbol();function wt(...e){let t=E(e);T(()=>{t.current=e},[e]);let n=Ue(e=>{for(let n of t.current)null!=n&&("function"==typeof n?n(e):n.current=e)});return e.every(e=>null==e||e?.[bt])?void 0:n}let Et=I(null);function xt(){let e=A(Et);if(null===e){let e=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(e,xt),e}return e}Et.displayName="DescriptionContext";let Tt=ot(function(e,t){let n=N(),r=Ke(),{id:o=`headlessui-description-${n}`,...i}=e,l=xt(),s=wt(t);Be(()=>l.register(o),[o,l.register]);let a=Ge({...l.slot,disabled:r||!1}),u={ref:s,...l.props,id:o};return Ze()({ourProps:u,theirProps:i,slot:a,defaultTag:"p",name:l.name||"Description"})});Object.assign(Tt,{});var St=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(St||{});let Ot=I(null);function Pt(){let e=A(Ot);if(null===e){let e=new Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(e,Pt),e}return e}function At({inherit:e=!1}={}){let t=function(){var e,t;let n=null!=(t=null==(e=A(Ot))?void 0:e.value)?t:void 0;return n}(),[n,r]=S([]),o=e?[t,...n].filter(Boolean):n;return[o.length>0?o.join(" "):void 0,O(()=>function(e){let t=Ue(e=>(r(t=>[...t,e]),()=>r(t=>{let n=t.slice(),r=n.indexOf(e);return-1!==r&&n.splice(r,1),n}))),n=O(()=>({register:t,slot:e.slot,name:e.name,props:e.props,value:e.value}),[t,e.slot,e.name,e.props,e.value]);return w.createElement(Ot.Provider,{value:n},e.children)},[r])]}Ot.displayName="LabelContext";let It=ot(function(e,t){var n;let r=N(),o=Pt(),i=A(ut),l=Ke(),{id:s=`headlessui-label-${r}`,htmlFor:a=i??(null==(n=o.props)?void 0:n.htmlFor),passive:u=!1,...c}=e,d=wt(t);Be(()=>o.register(s),[s,o.register]);let f=Ue(e=>{let t=e.currentTarget;if((e.target===e.currentTarget||!function(e){return!!dt(e)&&e.matches('a[href],audio[controls],button,details,embed,iframe,img[usemap],input:not([type="hidden"]),label,select,textarea,video[controls]')}(e.target))&&(ht(t)&&e.preventDefault(),o.props&&"onClick"in o.props&&"function"==typeof o.props.onClick&&o.props.onClick(e),ht(t))){let e=document.getElementById(t.htmlFor);if(e){let t=e.getAttribute("disabled");if("true"===t||""===t)return;let n=e.getAttribute("aria-disabled");if("true"===n||""===n)return;(mt(e)&&("file"===e.type||"radio"===e.type||"checkbox"===e.type)||"radio"===e.role||"checkbox"===e.role||"switch"===e.role)&&e.click(),e.focus({preventScroll:!0})}}}),p=Ge({...o.slot,disabled:l||!1}),m={ref:d,...o.props,id:s,htmlFor:a,onClick:f};return u&&("onClick"in m&&(delete m.htmlFor,delete m.onClick),"onClick"in c&&delete c.onClick),Ze()({ourProps:m,theirProps:c,slot:p,defaultTag:a?"label":"div",name:o.name||"Label"})});function Lt(e){if(null===e)return{width:0,height:0};let{width:t,height:n}=e.getBoundingClientRect();return{width:t,height:n}}function Rt(e,t,n=!1){let[r,o]=S(()=>Lt(t));return Be(()=>{if(!t||!e)return;let n=He();return n.requestAnimationFrame(function e(){n.requestAnimationFrame(e),o(e=>{let n=Lt(t);return n.width===e.width&&n.height===e.height?e:n})}),()=>{n.dispose()}},[t,e]),n?{width:`${r.width}px`,height:`${r.height}px`}:r}Object.assign(It,{});var Ct=(e=>(e[e.Left=0]="Left",e[e.Right=2]="Right",e))(Ct||{});let Ft=class extends Map{constructor(e){super(),this.factory=e}get(e){let t=super.get(e);return void 0===t&&(t=this.factory(e),this.set(e,t)),t}};var Mt,Nt,kt,Dt=Object.defineProperty,qt=(e,t,n)=>(((e,t,n)=>{t in e?Dt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,t+"",n),n),_t=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},jt=(e,t,n)=>(_t(e,t,"read from private field"),n?n.call(e):t.get(e)),Ht=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},Vt=(e,t,n,r)=>(_t(e,t,"write to private field"),t.set(e,n),n);let Bt=class{constructor(e){Ht(this,Mt,{}),Ht(this,Nt,new Ft(()=>new Set)),Ht(this,kt,new Set),qt(this,"disposables",He()),Vt(this,Mt,e),ke.isServer&&this.disposables.microTask(()=>{this.dispose()})}dispose(){this.disposables.dispose()}get state(){return jt(this,Mt)}subscribe(e,t){if(ke.isServer)return()=>{};let n={selector:e,callback:t,current:e(jt(this,Mt))};return jt(this,kt).add(n),this.disposables.add(()=>{jt(this,kt).delete(n)})}on(e,t){return ke.isServer?()=>{}:(jt(this,Nt).get(e).add(t),this.disposables.add(()=>{jt(this,Nt).get(e).delete(t)}))}send(e){let t=this.reduce(jt(this,Mt),e);if(t!==jt(this,Mt)){Vt(this,Mt,t);for(let e of jt(this,kt)){let t=e.selector(jt(this,Mt));Wt(e.current,t)||(e.current=t,e.callback(t))}for(let t of jt(this,Nt).get(e.type))t(jt(this,Mt),e)}}};function Wt(e,t){return!!Object.is(e,t)||"object"==typeof e&&null!==e&&"object"==typeof t&&null!==t&&(Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&Ut(e[Symbol.iterator](),t[Symbol.iterator]()):e instanceof Map&&t instanceof Map||e instanceof Set&&t instanceof Set?e.size===t.size&&Ut(e.entries(),t.entries()):!(!Gt(e)||!Gt(t))&&Ut(Object.entries(e)[Symbol.iterator](),Object.entries(t)[Symbol.iterator]()))}function Ut(e,t){for(;;){let n=e.next(),r=t.next();if(n.done&&r.done)return!0;if(n.done||r.done||!Object.is(n.value,r.value))return!1}}function Gt(e){if("[object Object]"!==Object.prototype.toString.call(e))return!1;let t=Object.getPrototypeOf(e);return null===t||null===Object.getPrototypeOf(t)}function $t(e){let[t,n]=e(),r=He();return(...e)=>{t(...e),r.dispose(),r.microTask(n)}}Mt=new WeakMap,Nt=new WeakMap,kt=new WeakMap;var Kt=Object.defineProperty,zt=(e,t,n)=>(((e,t,n)=>{t in e?Kt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n),Yt=(e=>(e[e.Push=0]="Push",e[e.Pop=1]="Pop",e))(Yt||{});let Qt={0(e,t){let n=t.id,r=e.stack,o=e.stack.indexOf(n);if(-1!==o){let t=e.stack.slice();return t.splice(o,1),t.push(n),r=t,{...e,stack:r}}return{...e,stack:[...e.stack,n]}},1(e,t){let n=t.id,r=e.stack.indexOf(n);if(-1===r)return e;let o=e.stack.slice();return o.splice(r,1),{...e,stack:o}}},Xt=class e extends Bt{constructor(){super(...arguments),zt(this,"actions",{push:e=>this.send({type:0,id:e}),pop:e=>this.send({type:1,id:e})}),zt(this,"selectors",{isTop:(e,t)=>e.stack[e.stack.length-1]===t,inStack:(e,t)=>e.stack.includes(t)})}static new(){return new e({stack:[]})}reduce(e,t){return Ye(t.type,Qt,e,t)}};const Jt=new Ft(()=>Xt.new());var Zt,en={exports:{}},tn={};
|
|
2
2
|
/**
|
|
3
3
|
* @license React
|
|
4
4
|
* use-sync-external-store-with-selector.production.js
|
|
@@ -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"./Csp0JYSr.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"./D_imcCpv.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 +1 @@
|
|
|
1
|
-
import{j as c,a3 as e}from"./
|
|
1
|
+
import{j as c,a3 as e}from"./DBnzOELO.js";const a=({disabled:a,provider:r,onClick:s,loading:i})=>c.jsx("button",{disabled:a||i,onClick:async()=>{if(!a&&!i)try{await s()}catch(c){console.error(`${e(r)} login error:`,c)}},className:"qc:group qc:h-12 qc:rounded-full qc:transition qc:duration-300 qc:disabled:cursor-not-allowed qc:disabled:border-gray-500 qc:disabled:opacity-50",children:i?c.jsx("div",{className:"qc:flex qc:h-full qc:items-center qc:justify-center",children:c.jsx("div",{className:"qc:h-5 qc:w-5 qc:animate-spin qc:rounded-full qc:border-b-2 qc:border-gray-900"})}):c.jsx("img",{className:"qc:h-auto qc:w-full",src:(c=>{switch(c){case"google":return"https://qrati.com/images/continue-with-google.svg";case"apple":return"https://qrati.com/images/continue-with-apple.svg";default:return""}})(r,a),alt:`sign in with ${e(r)}`})});export{a as S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,u as r,T as o,J as n,k as a,i as t,a4 as s,P as l}from"./
|
|
1
|
+
import{j as e,u as r,T as o,J as n,k as a,i as t,a4 as s,P as l}from"./DBnzOELO.js";import i,{useState as c}from"react";import{I as d}from"./CZp0lmKh.js";import{u,o as m,c as f,C as p,a as h,b as g}from"./-74yB4f5.js";const v=({count:r=1,currentStep:o=0,disabled:n,onStepClick:a})=>{const t=n||!a;return e.jsx("ol",{role:"list",className:"qc:flex qc:items-center qc:space-x-4 qc:pl-1.5",children:Array.from({length:r}).map((r,n)=>e.jsx("li",{children:n<o?e.jsx("button",{className:"qc:bg-primary qc:block qc:size-3 qc:rounded-full",disabled:t,onClick:()=>a&&a(n)}):n===o?e.jsxs("button",{className:"qc:relative qc:flex qc:items-center qc:justify-center","aria-current":"step",disabled:t,onClick:()=>a&&a(n),children:[e.jsx("span",{className:"qc:absolute qc:flex qc:size-6 qc:p-px","aria-hidden":"true",children:e.jsx("span",{className:"qc:bg-primary qc:size-full qc:rounded-full qc:bg-opacity-40"})}),e.jsx("span",{className:"qc:bg-primary qc:relative qc:block qc:size-3 qc:rounded-full","aria-hidden":"true"})]}):e.jsx("button",{className:"qc:block qc:size-3 qc:rounded-full qc:bg-text-secondary-light",disabled:t,onClick:()=>a&&a(n)})},`progress-dot-${n}`))})},q={email:""},w=f().shape({email:h().required("Please enter your email").email("Enter a valid email")}),x=({onCodeSent:s})=>{const[l,i]=c(!1),[f,h]=c(null),{props:{organizationId:g}}=r(),{control:v,handleSubmit:x,formState:{errors:y}}=u({mode:"onSubmit",defaultValues:q,resolver:m(w)});return e.jsxs("div",{className:"w-full space-y-6",children:[e.jsx(o,{variant:"h5",align:"center",children:"Reset password"}),e.jsxs("form",{noValidate:!0,autoComplete:"off",className:"qc:w-full qc:space-y-4 qc:lg:space-y-8",onSubmit:x(async e=>{h(null),i(!0);try{await a.post(t.SEND_PASSWORD_RESET_CODE,{json:{email:e.email?.toLowerCase()},headers:{"x-org-id":g}}),s(e.email.toLowerCase())}catch(e){console.error("Error sending verification code:",e),h(e.message||e||"An error occurred while sending the code. Please try again.")}i(!1)}),children:[e.jsx(p,{name:"email",control:v,render:({field:{value:r,onChange:o,onBlur:n}})=>e.jsx(d,{label:"Email",disabled:l,type:"email",value:r,onChange:o,onBlur:n,error:y.email?.message})}),e.jsx(n,{fullWidth:!0,type:"submit",loading:l,children:"Send verification code"})]}),f&&e.jsx(o,{variant:"h3",align:"center",color:"color",children:f})]})};var y=function(e){return"object"==typeof e&&null!==e},b=function(e){var r=e.value,o=void 0===r?"":r,n=e.numInputs,a=void 0===n?4:n,t=e.onChange,s=e.onPaste,l=e.renderInput,c=e.shouldAutoFocus,d=void 0!==c&&c,u=e.inputType,m=void 0===u?"text":u,f=e.renderSeparator,p=e.placeholder,h=e.containerStyle,g=e.inputStyle,v=e.skipDefaultStyles,q=void 0!==v&&v,w=i.useState(0),x=w[0],b=w[1],j=i.useRef([]),S=function(){return o?o.toString().split(""):[]},C="number"===m||"tel"===m;i.useEffect(function(){j.current=j.current.slice(0,a)},[a]),i.useEffect(function(){var e;d&&(null===(e=j.current[0])||void 0===e||e.focus())},[d]);var P=function(){if("string"==typeof p){if(p.length===a)return p;p.length>0&&console.error("Length of the placeholder should be equal to the number of inputs.")}},N=function(e){return(C?!isNaN(Number(e)):"string"==typeof e)&&1===e.trim().length},D=function(e){var r=e.target.value;N(r)&&(R(r),I(x+1))},E=function(e){var r=e.nativeEvent,o=e.target.value;if(!N(o)){if(o.length===a)o.split("").some(function(e){return!N(e)})||(O(o.split("")),I(a-1));null===r.data&&"deleteContentBackward"===r.inputType&&(e.preventDefault(),R(""),I(x-1)),e.target.value=""}},k=function(){b(x-1)},A=function(e){var r=S();[e.code,e.key].includes("Backspace")?(e.preventDefault(),R(""),I(x-1)):"Delete"===e.code?(e.preventDefault(),R("")):"ArrowLeft"===e.code?(e.preventDefault(),I(x-1)):"ArrowRight"===e.code||e.key===r[x]?(e.preventDefault(),I(x+1)):("Spacebar"===e.code||"Space"===e.code||"ArrowUp"===e.code||"ArrowDown"===e.code)&&e.preventDefault()},I=function(e){var r,o,n=Math.max(Math.min(a-1,e),0);j.current[n]&&(null===(r=j.current[n])||void 0===r||r.focus(),null===(o=j.current[n])||void 0===o||o.select(),b(n))},R=function(e){var r=S();r[x]=e[0],O(r)},O=function(e){var r=e.join("");t(r)},B=function(e){var r;e.preventDefault();var o=S(),n=x,t=e.clipboardData.getData("text/plain").slice(0,a-x).split("");if(!C||!t.some(function(e){return isNaN(Number(e))})){for(var s=0;s<a;++s)s>=x&&t.length>0&&(o[s]=null!==(r=t.shift())&&void 0!==r?r:"",n++);I(n),O(o)}};return i.createElement("div",{style:Object.assign({display:"flex",alignItems:"center"},y(h)&&h),className:"string"==typeof h?h:void 0,onPaste:s},Array.from({length:a},function(e,r){return r}).map(function(e){var r,o,n;return i.createElement(i.Fragment,{key:e},l({value:null!==(r=S()[e])&&void 0!==r?r:"",placeholder:null!==(n=null===(o=P())||void 0===o?void 0:o[e])&&void 0!==n?n:void 0,ref:function(r){return j.current[e]=r},onChange:D,onFocus:function(r){return function(e){return function(r){b(r),e.target.select()}}(r)(e)},onBlur:k,onKeyDown:A,onPaste:B,autoComplete:"off","aria-label":"Please enter OTP character ".concat(e+1),style:Object.assign(q?{}:{width:"1em",textAlign:"center"},y(g)?g:{}),className:"string"==typeof g?g:void 0,type:m,inputMode:C?"numeric":"text",onInput:E},e),e<a-1&&("function"==typeof f?f(e):f))}))};const j={code:""},S=f().shape({code:h().required("Please enter the code")}),C=({email:s,onCodeVerified:l})=>{const{props:{organizationId:i}}=r(),[d,f]=c(!1),[h,g]=c(null),{control:v,handleSubmit:q,watch:w}=u({mode:"onSubmit",defaultValues:j,resolver:m(S)});return e.jsxs("div",{className:"qc:space-y-4 qc:lg:space-y-8",children:[e.jsxs(o,{variant:"h5",align:"center",children:["Enter the code sent to ",e.jsx("span",{className:"qc:text-primary qc:font-medium",children:s})]}),e.jsxs("form",{noValidate:!0,autoComplete:"off",className:"qc:flex qc:w-full qc:flex-col qc:items-center qc:gap-4 qc:lg:gap-8",onSubmit:q(async e=>{g(null),f(!0);try{await a.post(t.VERIFY_PASSWORD_RESET_CODE,{json:{email:s,code:e.code},headers:{"x-org-id":i}}),l&&l()}catch(e){console.error(e.message),g("An error occurred while verifying the code. Please try again.")}f(!1)}),children:[e.jsx(p,{name:"code",control:v,render:({field:{value:r,onChange:o}})=>e.jsx(b,{value:r,onChange:o,numInputs:6,shouldAutoFocus:!0,inputType:"number",isInputNum:!0,containerStyle:"qc:flex qc:gap-4",inputStyle:"qc:rounded qc:border qc:focus:border-primary qc:text-foreground qc:bg-white qc:disabled:border-border qc:disabled:text-gray-400 otp-input qc:text-xl qc:focus:outline-none qc:focus:ring-0 qc:focus:boder-none",renderInput:r=>e.jsx("input",{...r})})}),e.jsx(n,{fullWidth:!0,type:"submit",disabled:w("code").length<6,loading:d,children:"Submit"})]}),h&&e.jsx(o,{variant:"h3",align:"center",color:"color",children:h})]})},P={password:"",confirmPassword:""},N=f().shape({password:h().required("Please enter your password").min(8,"Min password length is 8"),confirmPassword:h().required("Please confirm your password").min(8,"Min password length is 8").oneOf([g("password"),null],"Passwords do not match")}),D=({email:s,onPasswordReset:l})=>{const{props:{organizationId:i}}=r(),[f,h]=c({showPassword:!1,showConfirmPassword:!1}),[g,v]=c(!1),[q,w]=c(null),{control:x,handleSubmit:y,formState:{errors:b}}=u({defaultValues:P,mode:"onSubmit",resolver:m(N)});return e.jsxs("div",{className:"qc:w-full qc:space-y-4",children:[e.jsx(o,{variant:"h5",align:"center",children:"Set new password"}),e.jsxs("form",{noValidate:!0,autoComplete:"off",className:"qc:w-full qc:space-y-8",onSubmit:y(async e=>{w(null),v(!0);try{const r=await a.post(t.RESET_PASSWORD,{json:{email:s.toLowerCase(),password:e.password},headers:{"x-org-id":i}});r.error?w(r.error):l()}catch{w("An error occurred while resetting the password. Please try again.")}v(!1)}),children:[e.jsxs("div",{className:"qc:relative",children:[e.jsx(p,{name:"password",control:x,render:({field:{value:r,onChange:o,onBlur:n}})=>e.jsx(d,{label:"New password",disabled:g,type:f.showPassword?"text":"password",value:r,onChange:o,onBlur:n,error:b.password?.message})}),e.jsx(n,{variant:"ghost",color:"primary",className:"qc:absolute qc:-right-4 qc:top-7",icon:f.showPassword?"mdi:eye-outline":"mdi:eye-off-outline",onClick:()=>h({...f,showPassword:!f.showPassword})})]}),e.jsxs("div",{className:"qc:relative",children:[e.jsx(p,{name:"confirmPassword",control:x,render:({field:{value:r,onChange:o,onBlur:n}})=>e.jsx(d,{label:"Confirm new password",disabled:g,type:f.showConfirmPassword?"text":"password",value:r,onChange:o,onBlur:n,error:b.confirmPassword?.message})}),e.jsx(n,{variant:"ghost",color:"primary",className:"qc:absolute qc:-right-4 qc:top-7",icon:f.showConfirmPassword?"mdi:eye-outline":"mdi:eye-off-outline",onClick:()=>h({...f,showConfirmPassword:!f.showConfirmPassword})})]}),e.jsx(n,{fullWidth:!0,type:"submit",color:"primary",loading:g,children:"Reset password"})]}),q&&e.jsx(o,{variant:"h3",align:"center",color:"color",children:q})]})},E=()=>{const r=s(),[o,n]=c(null),[a,t]=c(0);return e.jsxs("div",{className:"space-y-9",children:[(({index:a})=>{switch(a){case 0:return e.jsx(x,{onCodeSent:e=>{n(e),t(1)}});case 1:return e.jsx(C,{email:o,onCodeVerified:()=>t(2)});case 2:return e.jsx(D,{email:o,onPasswordReset:()=>{r(l.LOGIN)}})}})({index:a}),e.jsx("div",{className:"qc:mt-8 qc:flex qc:justify-center",children:e.jsx(v,{count:3,currentStep:a})})]})};export{E as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as t,j as r,c as e,O as a,A as c}from"./
|
|
1
|
+
import{u as t,j as r,c as e,O as a,A as c}from"./DBnzOELO.js";import{useState as n,useRef as o}from"react";function s({content:c,children:s,position:l="bottom",className:q,contentClassName:i}){const[p,b]=n(!1),d=o(null),{organization:u}=t();return r.jsxs("div",{className:e("qc:relative qc:inline-block",q),ref:d,onMouseEnter:()=>b(!0),onMouseLeave:()=>b(!1),onClick:()=>b(!1),onBlur:()=>b(!1),children:[s,p&&r.jsxs("div",{className:e("qc:absolute qc:z-50 qc:whitespace-nowrap qc:rounded qc:bg-neutral-200 qc:px-2 qc:py-1 qc:text-sm qc:text-black",{top:"qc:bottom-full qc:left-1/2 qc:-translate-x-1/2 qc:mb-2",right:"qc:left-full qc:top-1/2 qc:-translate-y-1/2 qc:ml-2",bottom:"qc:top-full qc:left-1/2 qc:-translate-x-1/2 qc:mt-2",left:"qc:right-full qc:top-1/2 qc:-translate-y-1/2 qc:mr-2"}[l],i),style:a(u),role:"tooltip",children:[c,r.jsx("div",{className:e("qc:absolute qc:h-0 qc:w-0 qc:border-4",{top:"qc:top-full qc:left-1/2 qc:-translate-x-1/2 qc:border-l-transparent qc:border-r-transparent qc:border-b-transparent",right:"qc:right-full qc:top-1/2 qc:-translate-y-1/2 qc:border-t-transparent qc:border-b-transparent qc:border-l-transparent",bottom:"qc:bottom-full qc:left-1/2 qc:-translate-x-1/2 qc:border-l-transparent qc:border-r-transparent qc:border-t-transparent",left:"qc:left-full qc:top-1/2 qc:-translate-y-1/2 qc:border-t-transparent qc:border-b-transparent qc:border-r-transparent"}[l])})]})]})}const l=()=>{const{initializing:r,organization:e,user:a,loadingUser:n}=t(),o=e?.admins?.find(t=>t.email===a?.email)?.role;return{role:o,isSuper:a?.isSuper,loading:n||r,isOwner:o===c.OWNER,isAdmin:o===c.ADMIN,isModerator:o===c.MODERATOR}};export{s as T,l as u};
|