@qratilabs/qrati-connect 2.2.2 → 2.2.3
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 +6 -0
- package/element/{AuthLayout-yBnXbTdQ.js → AuthLayout-smqrs4PK.js} +1 -1
- package/element/{ContentsPage-BpGmiu2Y.js → ContentsPage-BALVk95k.js} +2 -2
- package/element/{CuratePage-Bf96ltsu.js → CuratePage-6O-YtfaK.js} +1 -1
- package/element/{Dialog-BqAbQiPJ.js → Dialog-0wEAIe3Z.js} +1 -1
- package/element/{DotLottiePlayer-BtxapiSJ.js → DotLottiePlayer-q7KyZjj4.js} +1 -1
- package/element/{EventHeaderAdminButtons-BplHheBN.js → EventHeaderAdminButtons-AOGt2ZR_.js} +2 -2
- package/element/FolderBreadcrumb-DE1SuI3R.js +1 -0
- package/element/{ForgotPasswordPage-Z0fY0XwU.js → ForgotPasswordPage-B7SQUSjQ.js} +1 -1
- package/element/{InputField-B4v4KXcE.js → InputField-DCqkCRI8.js} +1 -1
- package/element/{LazyLoadImage-DAovisp3.js → LazyLoadImage-Dx2kZ_ki.js} +1 -1
- package/element/{LeaderboardPage-Ygaebr-t.js → LeaderboardPage-ZllEyvHF.js} +1 -1
- package/element/{LoginPage-DIZ7qlYO.js → LoginPage-CT0pEqXM.js} +1 -1
- package/element/{NCMVHL6D-CxiMFMqg.js → NCMVHL6D-BwoIucZN.js} +1 -1
- package/element/PublicEvents-CIrYMBEL.js +1 -0
- package/element/{RegisterPage-Bg7pyJeh.js → RegisterPage-jGyiY6Q1.js} +1 -1
- package/element/{SocialLoginButton-DsAt02H9.js → SocialLoginButton-CD7hRRi3.js} +1 -1
- package/element/{UploadPage-C0ek4Qqe.js → UploadPage-CITq8Afj.js} +1 -1
- package/element/{VideoPlayer-g56XT4-3.js → VideoPlayer-BnGqOvd_.js} +1 -1
- package/element/element.es.js +1 -1
- package/element/{heic2any-z2RaaSEC.js → heic2any-DYXlMp6f.js} +1 -1
- package/element/{index-BhzTVsTo.js → index-D2rVaTyg.js} +1 -1
- package/element/{index-DDOpdb3i.js → index-dgkxxAYh.js} +2 -2
- package/element/{index.esm-BbqgTw7t.js → index.esm-DH681Jwb.js} +1 -1
- package/element/{photoswipe-B7SExy7W.js → photoswipe-CLqAYZuN.js} +1 -1
- package/element/styles.css +1 -1
- package/element/{tslib.es6-DIRCPYhi.js → tslib.es6-Kir8qsmG.js} +1 -1
- package/element/{useOrgAccess-CQNPoSFq.js → useOrgAccess-CQGTKm39.js} +1 -1
- package/element/web.es.js +1 -1
- package/package.json +1 -1
- package/react/{Ck9enZ3e.js → 38fKKEwY.js} +1 -1
- package/react/B-cnuYGK.js +1 -0
- package/react/{FcDLBnwX.js → B1i756QD.js} +1 -1
- package/react/{qwl23nTI.js → B8mLtg2-.js} +1 -1
- package/react/BByYodE2.js +1 -0
- package/react/{MZeQHhBV.js → BKCu0fMZ.js} +1 -1
- package/react/{CouLaMtF.js → B_TCkLjZ.js} +1 -1
- package/react/{CBpEkjwz.js → BfbjKTvp.js} +1 -1
- package/react/{Dx52SzWS.js → C-DBWaEg.js} +1 -1
- package/react/{DqmSOLfe.js → COmmnujB.js} +1 -1
- package/react/{BE9_Ublk.js → CTjUKTPO.js} +1 -1
- package/react/{BBaDMfm_.js → CUXGA7St.js} +1 -1
- package/react/{Cr9MgBeI.js → CeAGRh0t.js} +2 -2
- package/react/{Dhcvm9yI.js → CqFENFZB.js} +1 -1
- package/react/{Cb66NH94.js → CsN-e_l4.js} +1 -1
- package/react/{C1kBrsed.js → Csp0JYSr.js} +2 -2
- package/react/{x0a0HaZy.js → CwcF5rKn.js} +1 -1
- package/react/{C5XgHCIU.js → DCL2O5W3.js} +1 -1
- package/react/{DLUmYnVL.js → DDq_DfWj.js} +1 -1
- package/react/{Ld9VPzmf.js → DNOLzzZH.js} +2 -2
- package/react/{BX9GvyM-.js → Fz3ptOAl.js} +1 -1
- package/react/{C27Sy5Nr.js → T91t2h6g.js} +1 -1
- package/react/{DppB7lia.js → fLcJgmSx.js} +1 -1
- package/react/index.es.js +2 -2
- package/umd/web.umd.js +7 -7
- package/element/FolderBreadcrumb-DhqYRcyB.js +0 -1
- package/element/PublicEvents-D4eUZCHS.js +0 -1
- package/react/DZqtPzMv.js +0 -1
- package/react/U0g8gQE-.js +0 -1
|
@@ -0,0 +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 +1 @@
|
|
|
1
|
-
import{j as e,T as c,b as t,u as s,H as a,e as l,c as i,S as r,y as n,k as q,i as d}from"./
|
|
1
|
+
import{j as e,T as c,b as t,u as s,H as a,e as l,c as i,S as r,y as n,k as q,i as d}from"./DNOLzzZH.js";import"react";const o=({title:t,entries:s=[],showFloatingPoint:a=!1,hidePictures:l=!0})=>{const i=t.replace(/\s+/g,"-").toLowerCase(),r=e=>{if(!e)return"";const c=e.trim().split(" ");return 1===c.length?c[0]:`${c[0]} ${c[1][0]}.`};return e.jsxs("div",{className:"qc:border-border qc:mx-auto qc:flex qc:max-w-lg qc:flex-col qc:space-y-4 qc:rounded qc:border qc:p-4 qc:lg:space-y-8",children:[e.jsx(c,{variant:"h4",align:"center",color:"primary",children:t}),0===s.length?e.jsx(c,{variant:"h5",align:"center",color:"error",children:"Not available"}):e.jsxs("div",{className:"",children:[e.jsxs("div",{className:"qc:flex qc:w-full qc:items-end qc:justify-center qc:gap-4 qc:lg:gap-24",children:[s.length>1&&e.jsxs("div",{className:"qc:flex qc:flex-col qc:items-center qc:justify-center",children:[e.jsx("div",{className:"qc:bg-warning qc:text-primary-foreground qc:flex qc:size-16 qc:items-center qc:justify-center qc:rounded-full qc:text-2xl",children:"2"}),e.jsx("div",{className:"qc-text-primary qc-mt-3 qc-text-center qc-font-semibold",children:r(s[1].name)}),e.jsx("div",{className:"qc:text-foreground qc:text-primary qc:mt-1 qc:text-center qc:font-semibold",children:void 0===s[1].totalPoint?s[1].maxScore?.toFixed(a?2:0):s[1].totalPoint?.toFixed(a?2:0)})]}),s.length>0&&e.jsxs("div",{className:"qc:flex qc:flex-col qc:items-center qc:justify-center",children:[e.jsx("div",{className:"qc:bg-destructive qc:text-primary-foreground qc:flex qc:size-24 qc:items-center qc:justify-center qc:rounded-full qc:text-4xl",children:"1"}),e.jsx("div",{className:"qc-text-primary qc-mt-3 qc-text-center qc-font-semibold",children:r(s[0].name)}),e.jsx("div",{className:"qc:text-primary qc:mt-1 qc:text-center qc:font-semibold",children:void 0===s[0].totalPoint?s[0].maxScore?.toFixed(a?2:0):s[0].totalPoint?.toFixed(a?2:0)})]}),s.length>2&&e.jsxs("div",{className:"qc:flex qc:flex-col qc:items-center qc:justify-center",children:[e.jsx("div",{className:"qc:bg-success qc:text-primary-foreground qc:flex qc:size-16 qc:items-center qc:justify-center qc:rounded-full qc:text-2xl",children:"3"}),e.jsx("div",{className:"qc-text-primary qc-mt-3 qc-text-center qc-font-semibold",children:r(s[2].name)}),e.jsx("div",{className:"qc:text-foreground qc:text-primary qc:mt-1 qc:text-center qc:font-semibold",children:void 0===s[2].totalPoint?s[2].maxScore?.toFixed(a?2:0):s[2].totalPoint?.toFixed(a?2:0)})]})]}),e.jsx("div",{className:"qc:mt-6",children:e.jsx("div",{className:"qc:-my-2 qc:overflow-x-auto qc:sm:-mx-6 qc:lg:-mx-8",children:e.jsx("div",{className:"qc:inline-block qc:min-w-full qc:py-2 qc:align-middle qc:md:px-6 qc:lg:px-8",children:e.jsx("div",{className:"qc:shadow-outer qc:overflow-hidden qc:ring-1 qc:ring-black qc:ring-opacity-5 qc:md:rounded",children:e.jsx("table",{className:"qc:w-full qc:divide-y qc:divide-gray-300",children:e.jsx("tbody",{className:"qc:bg-background qc:bg-opacity-50",children:s.slice(3).map((c,t)=>e.jsxs("tr",{children:[e.jsx("td",{className:"qc:text-muted qc:whitespace-nowrap qc:py-4 qc:pl-4 qc:text-sm qc:font-medium",children:e.jsx("span",{className:"qc:px-2",children:t+4})}),e.jsx("td",{className:"qc:whitespace-nowrap qc:py-4",children:e.jsxs("div",{className:"qc:flex qc:items-center",children:[!l&&e.jsx("div",{className:"qc:size-8 qc:shrink-0"}),e.jsx("div",{className:"qc-ml-4",children:e.jsx("div",{className:"qc-text-primary qc-font-medium",children:r(c.name)})})]})}),e.jsx("td",{className:"qc:text-foreground qc:whitespace-nowrap qc:py-4 qc:pr-4 qc:text-right qc:text-base qc:font-medium qc:italic",children:void 0===c.totalPoint?c.maxScore?.toFixed(a?2:0):c.totalPoint?.toFixed(a?2:0)})]},`${i}-${t}`))})})})})})})]})]})},m=()=>{const{eventSlug:c}=t(),{props:{organizationId:m}}=s(),{event:x}=a({eventSlug:c}),{isLoading:f,data:h}=l({queryKey:[`leaderboard-${m}-${x?._id}`],queryFn:async()=>(await q.get(d.GET_LEADERBOARD,{headers:{"x-org-id":m},searchParams:{eventId:x?._id}}).json()).data,enabled:!!x});return f?e.jsxs("div",{className:i("qc:mt-4 qc:flex qc:min-h-[80vh] qc:w-full qc:gap-8 qc:px-2 qc:py-4 qc:sm:px-0 qc:lg:gap-0 qc:lg:py-8",x?.engagementStyle===n.REACTION?"qc:flex-col-reverse qc:md:flex-row-reverse qc:md:justify-between":"qc:flex-col qc:md:flex-row"),children:[e.jsxs("div",{className:"qc:flex-1",children:[e.jsx(r,{className:"qc:h-64 qc:w-full qc:rounded"}),e.jsx(r,{className:"qc:h-64 qc:w-full qc:rounded"})]}),e.jsx("div",{className:"qc:flex-1",children:e.jsx(o,{title:x?.engagementStyle===n.REACTION?"Reaction Counts":"Top Rated Photos",showFloatingPoint:x?.engagementStyle===n.CONTEST,entries:h?.leaderboardByScore?.topRankers||[],pointName:x?.pointName})})]}):e.jsxs("div",{className:i("qc:mt-4 qc:flex qc:min-h-[80vh] qc:w-full qc:gap-8 qc:px-2 qc:py-4 qc:sm:px-0 qc:lg:gap-0 qc:lg:py-8",x?.engagementStyle===n.REACTION?"qc:flex-col-reverse qc:md:flex-row-reverse qc:md:justify-between":"qc:flex-col qc:md:flex-row"),children:[e.jsx("div",{className:"qc:flex-1",children:e.jsx(o,{title:"Point Leaders",entries:h?.leaderboardByPoint?.topRankers||[],pointName:x?.pointName})}),e.jsx("div",{className:"qc:flex-1",children:e.jsx(o,{title:x?.engagementStyle===n.REACTION?"Reaction Counts":"Top Rated Photos",showFloatingPoint:x?.engagementStyle===n.CONTEST,entries:h?.leaderboardByScore?.topRankers||[],pointName:x?.pointName})})]})};export{m as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,M as t,L as n,u as r,O as o,c as a}from"./Ld9VPzmf.js";import*as c from"react";import{useState as i}from"react";import*as s from"react-dom";import u from"react-dom";import{a as l,b as d,c as f}from"./D6nr9_KD.js";function p(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),!1===n||!r.defaultPrevented)return t?.(r)}}function m(t,n=[]){let r=[];const o=()=>{const e=r.map(e=>c.createContext(e));return function(n){const r=n?.[t]||e;return c.useMemo(()=>({[`__scope${t}`]:{...n,[t]:r}}),[n,r])}};return o.scopeName=t,[function(n,o){const a=c.createContext(o),i=r.length;r=[...r,o];const s=n=>{const{scope:r,children:o,...s}=n,u=r?.[t]?.[i]||a,l=c.useMemo(()=>s,Object.values(s));return e.jsx(u.Provider,{value:l,children:o})};return s.displayName=n+"Provider",[s,function(e,r){const s=r?.[t]?.[i]||a,u=c.useContext(s);if(u)return u;if(void 0!==o)return o;throw new Error(`\`${e}\` must be used within \`${n}\``)}]},v(o,...n)]}function v(...e){const t=e[0];if(1===e.length)return t;const n=()=>{const n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){const r=n.reduce((t,{useScope:n,scopeName:r})=>({...t,...n(e)[`__scope${r}`]}),{});return c.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}var h=globalThis?.document?c.useLayoutEffect:()=>{},g=c[" useId ".trim().toString()]||(()=>{}),y=0;function b(e){const[t,n]=c.useState(g());return h(()=>{n(e=>e??String(y++))},[e]),e||(t?`radix-${t}`:"")}var E=c[" useInsertionEffect ".trim().toString()]||h;function w({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,a,i]=function({defaultProp:e,onChange:t}){const[n,r]=c.useState(e),o=c.useRef(n),a=c.useRef(t);return E(()=>{a.current=t},[t]),c.useEffect(()=>{o.current!==n&&(a.current?.(n),o.current=n)},[n,o]),[n,r,a]}({defaultProp:t,onChange:n}),s=void 0!==e,u=s?e:o;{const t=c.useRef(void 0!==e);c.useEffect(()=>{const e=t.current;e!==s&&console.warn(`${r} is changing from ${e?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=s},[s,r])}return[u,c.useCallback(t=>{if(s){const n=function(e){return"function"==typeof e}(t)?t(e):t;n!==e&&i.current?.(n)}else a(t)},[s,e,a,i])]}var N=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((n,r)=>{const o=t(`Primitive.${r}`),a=c.forwardRef((t,n)=>{const{asChild:a,...c}=t,i=a?o:r;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),e.jsx(i,{...c,ref:n})});return a.displayName=`Primitive.${r}`,{...n,[r]:a}},{});function x(e){const t=c.useRef(e);return c.useEffect(()=>{t.current=e}),c.useMemo(()=>(...e)=>t.current?.(...e),[])}var C,R="dismissableLayer.update",D="dismissableLayer.pointerDownOutside",S="dismissableLayer.focusOutside",q=c.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),M=c.forwardRef((t,r)=>{const{disableOutsidePointerEvents:o=!1,onEscapeKeyDown:a,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:u,onDismiss:l,...d}=t,f=c.useContext(q),[m,v]=c.useState(null),h=m?.ownerDocument??globalThis?.document,[,g]=c.useState({}),y=n(r,e=>v(e)),b=Array.from(f.layers),[E]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),w=b.indexOf(E),M=m?b.indexOf(m):-1,O=f.layersWithOutsidePointerEventsDisabled.size>0,L=M>=w,_=function(e,t=globalThis?.document){const n=x(e),r=c.useRef(!1),o=c.useRef(()=>{});return c.useEffect(()=>{const e=e=>{if(e.target&&!r.current){let r=function(){T(D,n,a,{discrete:!0})};const a={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",o.current),o.current=r,t.addEventListener("click",o.current,{once:!0})):r()}else t.removeEventListener("click",o.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",e),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}(e=>{const t=e.target,n=[...f.branches].some(e=>e.contains(t));!L||n||(i?.(e),u?.(e),e.defaultPrevented||l?.())},h),k=function(e,t=globalThis?.document){const n=x(e),r=c.useRef(!1);return c.useEffect(()=>{const e=e=>{e.target&&!r.current&&T(S,n,{originalEvent:e},{discrete:!1})};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}(e=>{const t=e.target;[...f.branches].some(e=>e.contains(t))||(s?.(e),u?.(e),e.defaultPrevented||l?.())},h);return function(e,t=globalThis?.document){const n=x(e);c.useEffect(()=>{const e=e=>{"Escape"===e.key&&n(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})},[n,t])}(e=>{M===f.layers.size-1&&(a?.(e),!e.defaultPrevented&&l&&(e.preventDefault(),l()))},h),c.useEffect(()=>{if(m)return o&&(0===f.layersWithOutsidePointerEventsDisabled.size&&(C=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(m)),f.layers.add(m),P(),()=>{o&&1===f.layersWithOutsidePointerEventsDisabled.size&&(h.body.style.pointerEvents=C)}},[m,h,o,f]),c.useEffect(()=>()=>{m&&(f.layers.delete(m),f.layersWithOutsidePointerEventsDisabled.delete(m),P())},[m,f]),c.useEffect(()=>{const e=()=>g({});return document.addEventListener(R,e),()=>document.removeEventListener(R,e)},[]),e.jsx(N.div,{...d,ref:y,style:{pointerEvents:O?L?"auto":"none":void 0,...t.style},onFocusCapture:p(t.onFocusCapture,k.onFocusCapture),onBlurCapture:p(t.onBlurCapture,k.onBlurCapture),onPointerDownCapture:p(t.onPointerDownCapture,_.onPointerDownCapture)})});M.displayName="DismissableLayer";var O=c.forwardRef((t,r)=>{const o=c.useContext(q),a=c.useRef(null),i=n(r,a);return c.useEffect(()=>{const e=a.current;if(e)return o.branches.add(e),()=>{o.branches.delete(e)}},[o.branches]),e.jsx(N.div,{...t,ref:i})});function P(){const e=new CustomEvent(R);document.dispatchEvent(e)}function T(e,t,n,{discrete:r}){const o=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?function(e,t){e&&s.flushSync(()=>e.dispatchEvent(t))}(o,a):o.dispatchEvent(a)}O.displayName="DismissableLayerBranch";var L="focusScope.autoFocusOnMount",_="focusScope.autoFocusOnUnmount",k={bubbles:!1,cancelable:!0},A=c.forwardRef((t,r)=>{const{loop:o=!1,trapped:a=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...u}=t,[l,d]=c.useState(null),f=x(i),p=x(s),m=c.useRef(null),v=n(r,e=>d(e)),h=c.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;c.useEffect(()=>{if(a){let e=function(e){if(h.paused||!l)return;const t=e.target;l.contains(t)?m.current=t:W(m.current,{select:!0})},t=function(e){if(h.paused||!l)return;const t=e.relatedTarget;null!==t&&(l.contains(t)||W(m.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&W(l)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const r=new MutationObserver(n);return l&&r.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}},[a,l,h.paused]),c.useEffect(()=>{if(l){$.add(h);const e=document.activeElement;if(!l.contains(e)){const t=new CustomEvent(L,k);l.addEventListener(L,f),l.dispatchEvent(t),t.defaultPrevented||(function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(W(r,{select:t}),document.activeElement!==n)return}(function(e){return e.filter(e=>"A"!==e.tagName)}(j(l)),{select:!0}),document.activeElement===e&&W(l))}return()=>{l.removeEventListener(L,f),setTimeout(()=>{const t=new CustomEvent(_,k);l.addEventListener(_,p),l.dispatchEvent(t),t.defaultPrevented||W(e??document.body,{select:!0}),l.removeEventListener(_,p),$.remove(h)},0)}}},[l,f,p,h]);const g=c.useCallback(e=>{if(!o&&!a||h.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,n=document.activeElement;if(t&&n){const t=e.currentTarget,[r,a]=function(e){const t=j(e),n=I(t,e),r=I(t.reverse(),e);return[n,r]}(t);r&&a?e.shiftKey||n!==a?e.shiftKey&&n===r&&(e.preventDefault(),o&&W(a,{select:!0})):(e.preventDefault(),o&&W(r,{select:!0})):n===t&&e.preventDefault()}},[o,a,h.paused]);return e.jsx(N.div,{tabIndex:-1,...u,ref:v,onKeyDown:g})});function j(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function I(e,t){for(const n of e)if(!F(n,{upTo:t}))return n}function F(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function W(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}A.displayName="FocusScope";var $=function(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=B(e,t),e.unshift(t)},remove(t){e=B(e,t),e[0]?.resume()}}}();function B(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}var U=c.forwardRef((t,n)=>{const{container:r,...o}=t,[a,i]=c.useState(!1);h(()=>i(!0),[]);const s=r||a&&globalThis?.document?.body;return s?u.createPortal(e.jsx(N.div,{...o,ref:n}),s):null});U.displayName="Portal";var z=e=>{const{present:t,children:r}=e,o=function(e){const[t,n]=c.useState(),r=c.useRef(null),o=c.useRef(e),a=c.useRef("none"),i=e?"mounted":"unmounted",[s,u]=function(e,t){return c.useReducer((e,n)=>t[e][n]??e,e)}(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return c.useEffect(()=>{const e=K(r.current);a.current="mounted"===s?e:"none"},[s]),h(()=>{const t=r.current,n=o.current;if(n!==e){const r=a.current,c=K(t);u(e?"MOUNT":"none"===c||"none"===t?.display?"UNMOUNT":n&&r!==c?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,u]),h(()=>{if(t){let e;const n=t.ownerDocument.defaultView??window,c=a=>{const c=K(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&c&&(u("ANIMATION_END"),!o.current)){const r=t.style.animationFillMode;t.style.animationFillMode="forwards",e=n.setTimeout(()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=r)})}},i=e=>{e.target===t&&(a.current=K(r.current))};return t.addEventListener("animationstart",i),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{n.clearTimeout(e),t.removeEventListener("animationstart",i),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:c.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}(t),a="function"==typeof r?r({present:o.isPresent}):c.Children.only(r),i=n(o.ref,function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}(a));return"function"==typeof r||o.isPresent?c.cloneElement(a,{ref:i}):null};function K(e){return e?.animationName||"none"}z.displayName="Presence";var X=0;function Y(){c.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??H()),document.body.insertAdjacentElement("beforeend",e[1]??H()),X++,()=>{1===X&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),X--}},[])}function H(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Z="right-scroll-bar-position",V="width-before-scroll-bar";function G(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var J=typeof window<"u"?c.useLayoutEffect:c.useEffect,Q=new WeakMap;function ee(e,t){var n=function(e,t){var n=i(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}(null,function(t){return e.forEach(function(e){return G(e,t)})});return J(function(){var t=Q.get(n);if(t){var r=new Set(t),o=new Set(e),a=n.current;r.forEach(function(e){o.has(e)||G(e,null)}),o.forEach(function(e){r.has(e)||G(e,a)})}Q.set(n,e)},[e]),n}function te(e){return e}var ne=function(e){var t=e.sideCar,n=d(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return c.createElement(r,l({},n))};ne.isSideCarExport=!0;var re=function(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=te);var n=[],r=!1;return{read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var o=t(e,r);return n.push(o),function(){n=n.filter(function(e){return e!==o})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var o=n;n=[],o.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},c=function(){return Promise.resolve().then(a)};c(),n={push:function(e){t.push(e),c()},filter:function(e){return t=t.filter(e),n}}}}}(null);return t.options=l({async:!0,ssr:!1},e),t}(),oe=function(){},ae=c.forwardRef(function(e,t){var n=c.useRef(null),r=c.useState({onScrollCapture:oe,onWheelCapture:oe,onTouchMoveCapture:oe}),o=r[0],a=r[1],i=e.forwardProps,s=e.children,u=e.className,f=e.removeScrollBar,p=e.enabled,m=e.shards,v=e.sideCar,h=e.noRelative,g=e.noIsolation,y=e.inert,b=e.allowPinchZoom,E=e.as,w=void 0===E?"div":E,N=e.gapMode,x=d(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=v,R=ee([n,t]),D=l(l({},x),o);return c.createElement(c.Fragment,null,p&&c.createElement(C,{sideCar:re,removeScrollBar:f,shards:m,noRelative:h,noIsolation:g,inert:y,setCallbacks:a,allowPinchZoom:!!b,lockRef:n,gapMode:N}),i?c.cloneElement(c.Children.only(s),l(l({},D),{ref:R})):c.createElement(w,l({},D,{className:u,ref:R}),s))});ae.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},ae.classNames={fullWidth:V,zeroRight:Z};function ce(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__}();return t&&e.setAttribute("nonce",t),e}var ie=function(){var e=0,t=null;return{add:function(n){0==e&&(t=ce())&&(function(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}(t,n),function(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}(t)),e++},remove:function(){! --e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},se=function(){var e=function(){var e=ie();return function(t,n){c.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}}();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},ue={left:0,top:0,right:0,gap:0},le=function(e){return parseInt(e||"",10)||0},de=function(e){if(void 0===e&&(e="margin"),typeof window>"u")return ue;var t=function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingLeft":"marginLeft"],r=t["padding"===e?"paddingTop":"marginTop"],o=t["padding"===e?"paddingRight":"marginRight"];return[le(n),le(r),le(o)]}(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},fe=se(),pe="data-scroll-locked",me=function(e,t,n,r){var o=e.left,a=e.top,c=e.right,i=e.gap;return void 0===n&&(n="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(r,";\n padding-right: ").concat(i,"px ").concat(r,";\n }\n body[").concat(pe,"] {\n overflow: hidden ").concat(r,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(r,";"),"margin"===n&&"\n padding-left: ".concat(o,"px;\n padding-top: ").concat(a,"px;\n padding-right: ").concat(c,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(i,"px ").concat(r,";\n "),"padding"===n&&"padding-right: ".concat(i,"px ").concat(r,";")].filter(Boolean).join(""),"\n }\n \n .").concat(Z," {\n right: ").concat(i,"px ").concat(r,";\n }\n \n .").concat(V," {\n margin-right: ").concat(i,"px ").concat(r,";\n }\n \n .").concat(Z," .").concat(Z," {\n right: 0 ").concat(r,";\n }\n \n .").concat(V," .").concat(V," {\n margin-right: 0 ").concat(r,";\n }\n \n body[").concat(pe,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(i,"px;\n }\n")},ve=function(){var e=parseInt(document.body.getAttribute(pe)||"0",10);return isFinite(e)?e:0},he=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=void 0===r?"margin":r;c.useEffect(function(){return document.body.setAttribute(pe,(ve()+1).toString()),function(){var e=ve()-1;e<=0?document.body.removeAttribute(pe):document.body.setAttribute(pe,e.toString())}},[]);var a=c.useMemo(function(){return de(o)},[o]);return c.createElement(fe,{styles:me(a,!t,o,n?"":"!important")})},ge=!1;if(typeof window<"u")try{var ye=Object.defineProperty({},"passive",{get:function(){return ge=!0,!0}});window.addEventListener("test",ye,ye),window.removeEventListener("test",ye,ye)}catch{ge=!1}var be=!!ge&&{passive:!1},Ee=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return"hidden"!==n[t]&&!(n.overflowY===n.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===n[t])},we=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host),Ne(e,r)){var o=xe(e,r);if(o[1]>o[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Ne=function(e,t){return"v"===e?function(e){return Ee(e,"overflowY")}(t):function(e){return Ee(e,"overflowX")}(t)},xe=function(e,t){return"v"===e?function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]}(t):function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t)},Ce=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Re=function(e){return[e.deltaX,e.deltaY]},De=function(e){return e&&"current"in e?e.current:e},Se=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},qe=0,Me=[];function Oe(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Pe=(Te=function(e){var t=c.useRef([]),n=c.useRef([0,0]),r=c.useRef(),o=c.useState(qe++)[0],a=c.useState(se)[0],i=c.useRef(e);c.useEffect(function(){i.current=e},[e]),c.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var t=f([e.lockRef.current],(e.shards||[]).map(De),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),t.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var s=c.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!i.current.allowPinchZoom;var o,a=Ce(e),c=n.current,s="deltaX"in e?e.deltaX:c[0]-a[0],u="deltaY"in e?e.deltaY:c[1]-a[1],l=e.target,d=Math.abs(s)>Math.abs(u)?"h":"v";if("touches"in e&&"h"===d&&"range"===l.type)return!1;var f=we(d,l);if(!f)return!0;if(f?o=d:(o="v"===d?"h":"v",f=we(d,l)),!f)return!1;if(!r.current&&"changedTouches"in e&&(s||u)&&(r.current=o),!o)return!0;var p=r.current||o;return function(e,t,n,r){var o=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),a=o*r,c=n.target,i=t.contains(c),s=!1,u=a>0,l=0,d=0;do{if(!c)break;var f=xe(e,c),p=f[0],m=f[1]-f[2]-o*p;(p||m)&&Ne(e,c)&&(l+=m,d+=p);var v=c.parentNode;c=v&&v.nodeType===Node.DOCUMENT_FRAGMENT_NODE?v.host:v}while(!i&&c!==document.body||i&&(t.contains(c)||t===c));return(u&&Math.abs(l)<1||!u&&Math.abs(d)<1)&&(s=!0),s}(p,t,e,"h"===p?s:u)},[]),u=c.useCallback(function(e){var n=e;if(Me.length&&Me[Me.length-1]===a){var r="deltaY"in n?Re(n):Ce(n),o=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&function(e,t){return e[0]===t[0]&&e[1]===t[1]}(e.delta,r)})[0];if(o&&o.should)return void(n.cancelable&&n.preventDefault());if(!o){var c=(i.current.shards||[]).map(De).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!i.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=c.useCallback(function(e,n,r,o){var a={name:e,delta:n,target:r,should:o,shadowParent:Oe(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),d=c.useCallback(function(e){n.current=Ce(e),r.current=void 0},[]),p=c.useCallback(function(t){l(t.type,Re(t),t.target,s(t,e.lockRef.current))},[]),m=c.useCallback(function(t){l(t.type,Ce(t),t.target,s(t,e.lockRef.current))},[]);c.useEffect(function(){return Me.push(a),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:m}),document.addEventListener("wheel",u,be),document.addEventListener("touchmove",u,be),document.addEventListener("touchstart",d,be),function(){Me=Me.filter(function(e){return e!==a}),document.removeEventListener("wheel",u,be),document.removeEventListener("touchmove",u,be),document.removeEventListener("touchstart",d,be)}},[]);var v=e.removeScrollBar,h=e.inert;return c.createElement(c.Fragment,null,h?c.createElement(a,{styles:Se(o)}):null,v?c.createElement(he,{noRelative:e.noRelative,gapMode:e.gapMode}):null)},re.useMedium(Te),ne);var Te,Le=c.forwardRef(function(e,t){return c.createElement(ae,l({},e,{ref:t,sideCar:Pe}))});Le.classNames=ae.classNames;var _e=new WeakMap,ke=new WeakMap,Ae={},je=0,Ie=function(e){return e&&(e.host||Ie(e.parentNode))},Fe=function(e,t,n,r){var o=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Ie(t);return n&&e.contains(n)?n:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)}).filter(function(e){return!!e})}(t,Array.isArray(e)?e:[e]);Ae[n]||(Ae[n]=new WeakMap);var a=Ae[n],c=[],i=new Set,s=new Set(o),u=function(e){!e||i.has(e)||(i.add(e),u(e.parentNode))};o.forEach(u);var l=function(e){!e||s.has(e)||Array.prototype.forEach.call(e.children,function(e){if(i.has(e))l(e);else try{var t=e.getAttribute(r),o=null!==t&&"false"!==t,s=(_e.get(e)||0)+1,u=(a.get(e)||0)+1;_e.set(e,s),a.set(e,u),c.push(e),1===s&&o&&ke.set(e,!0),1===u&&e.setAttribute(n,"true"),o||e.setAttribute(r,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}})};return l(t),i.clear(),je++,function(){c.forEach(function(e){var t=_e.get(e)-1,o=a.get(e)-1;_e.set(e,t),a.set(e,o),t||(ke.has(e)||e.removeAttribute(r),ke.delete(e)),o||e.removeAttribute(n)}),--je||(_e=new WeakMap,_e=new WeakMap,ke=new WeakMap,Ae={})}},We=function(e,t,n){void 0===n&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=function(e){return typeof document>"u"?null:(Array.isArray(e)?e[0]:e).ownerDocument.body}(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),Fe(r,o,n,"aria-hidden")):function(){return null}},$e="Dialog",[Be]=m($e),[Ue,ze]=Be($e),Ke=t=>{const{__scopeDialog:n,children:r,open:o,defaultOpen:a,onOpenChange:i,modal:s=!0}=t,u=c.useRef(null),l=c.useRef(null),[d,f]=w({prop:o,defaultProp:a??!1,onChange:i,caller:$e});return e.jsx(Ue,{scope:n,triggerRef:u,contentRef:l,contentId:b(),titleId:b(),descriptionId:b(),open:d,onOpenChange:f,onOpenToggle:c.useCallback(()=>f(e=>!e),[f]),modal:s,children:r})};Ke.displayName=$e;var Xe="DialogTrigger",Ye=c.forwardRef((t,r)=>{const{__scopeDialog:o,...a}=t,c=ze(Xe,o),i=n(r,c.triggerRef);return e.jsx(N.button,{type:"button","aria-haspopup":"dialog","aria-expanded":c.open,"aria-controls":c.contentId,"data-state":pt(c.open),...a,ref:i,onClick:p(t.onClick,c.onOpenToggle)})});Ye.displayName=Xe;var He="DialogPortal",[Ze,Ve]=Be(He,{forceMount:void 0}),Ge=t=>{const{__scopeDialog:n,forceMount:r,children:o,container:a}=t,i=ze(He,n);return e.jsx(Ze,{scope:n,forceMount:r,children:c.Children.map(o,t=>e.jsx(z,{present:r||i.open,children:e.jsx(U,{asChild:!0,container:a,children:t})}))})};Ge.displayName=He;var Je="DialogOverlay",Qe=c.forwardRef((t,n)=>{const r=Ve(Je,t.__scopeDialog),{forceMount:o=r.forceMount,...a}=t,c=ze(Je,t.__scopeDialog);return c.modal?e.jsx(z,{present:o||c.open,children:e.jsx(tt,{...a,ref:n})}):null});Qe.displayName=Je;var et=t("DialogOverlay.RemoveScroll"),tt=c.forwardRef((t,n)=>{const{__scopeDialog:r,...o}=t,a=ze(Je,r);return e.jsx(Le,{as:et,allowPinchZoom:!0,shards:[a.contentRef],children:e.jsx(N.div,{"data-state":pt(a.open),...o,ref:n,style:{pointerEvents:"auto",...o.style}})})}),nt="DialogContent",rt=c.forwardRef((t,n)=>{const r=Ve(nt,t.__scopeDialog),{forceMount:o=r.forceMount,...a}=t,c=ze(nt,t.__scopeDialog);return e.jsx(z,{present:o||c.open,children:c.modal?e.jsx(ot,{...a,ref:n}):e.jsx(at,{...a,ref:n})})});rt.displayName=nt;var ot=c.forwardRef((t,r)=>{const o=ze(nt,t.__scopeDialog),a=c.useRef(null),i=n(r,o.contentRef,a);return c.useEffect(()=>{const e=a.current;if(e)return We(e)},[]),e.jsx(ct,{...t,ref:i,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:p(t.onCloseAutoFocus,e=>{e.preventDefault(),o.triggerRef.current?.focus()}),onPointerDownOutside:p(t.onPointerDownOutside,e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey;(2===t.button||n)&&e.preventDefault()}),onFocusOutside:p(t.onFocusOutside,e=>e.preventDefault())})}),at=c.forwardRef((t,n)=>{const r=ze(nt,t.__scopeDialog),o=c.useRef(!1),a=c.useRef(!1);return e.jsx(ct,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:e=>{t.onCloseAutoFocus?.(e),e.defaultPrevented||(o.current||r.triggerRef.current?.focus(),e.preventDefault()),o.current=!1,a.current=!1},onInteractOutside:e=>{t.onInteractOutside?.(e),e.defaultPrevented||(o.current=!0,"pointerdown"===e.detail.originalEvent.type&&(a.current=!0));const n=e.target;r.triggerRef.current?.contains(n)&&e.preventDefault(),"focusin"===e.detail.originalEvent.type&&a.current&&e.preventDefault()}})}),ct=c.forwardRef((t,r)=>{const{__scopeDialog:o,trapFocus:a,onOpenAutoFocus:i,onCloseAutoFocus:s,...u}=t,l=ze(nt,o),d=c.useRef(null),f=n(r,d);return Y(),e.jsxs(e.Fragment,{children:[e.jsx(A,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:i,onUnmountAutoFocus:s,children:e.jsx(M,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":pt(l.open),...u,ref:f,onDismiss:()=>l.onOpenChange(!1)})}),e.jsxs(e.Fragment,{children:[e.jsx(gt,{titleId:l.titleId}),e.jsx(yt,{contentRef:d,descriptionId:l.descriptionId})]})]})}),it="DialogTitle",st=c.forwardRef((t,n)=>{const{__scopeDialog:r,...o}=t,a=ze(it,r);return e.jsx(N.h2,{id:a.titleId,...o,ref:n})});st.displayName=it;var ut="DialogDescription",lt=c.forwardRef((t,n)=>{const{__scopeDialog:r,...o}=t,a=ze(ut,r);return e.jsx(N.p,{id:a.descriptionId,...o,ref:n})});lt.displayName=ut;var dt="DialogClose",ft=c.forwardRef((t,n)=>{const{__scopeDialog:r,...o}=t,a=ze(dt,r);return e.jsx(N.button,{type:"button",...o,ref:n,onClick:p(t.onClick,()=>a.onOpenChange(!1))})});function pt(e){return e?"open":"closed"}ft.displayName=dt;var mt="DialogTitleWarning",[vt,ht]=function(t,n){const r=c.createContext(n),o=t=>{const{children:n,...o}=t,a=c.useMemo(()=>o,Object.values(o));return e.jsx(r.Provider,{value:a,children:n})};return o.displayName=t+"Provider",[o,function(e){const o=c.useContext(r);if(o)return o;if(void 0!==n)return n;throw new Error(`\`${e}\` must be used within \`${t}\``)}]}(mt,{contentName:nt,titleName:it,docsSlug:"dialog"}),gt=({titleId:e})=>{const t=ht(mt),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.\n\nIf you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return c.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},yt=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${ht("DialogDescriptionWarning").contentName}}.`;return c.useEffect(()=>{const r=e.current?.getAttribute("aria-describedby");t&&r&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},bt=Qe,Et=rt,wt=st,Nt=lt,xt=ft;const Ct=Ke,Rt=Ge,Dt=c.forwardRef(({className:t,...n},r)=>e.jsx(bt,{ref:r,className:a("data-[state=open]:qc:animate-in data-[state=closed]:qc:animate-out data-[state=closed]:qc:fade-out-0 data-[state=open]:qc:fade-in-0 qc:fixed qc:inset-0 qc:z-2001 qc:backdrop-blur-md",t),...n})),St=c.forwardRef(({className:t,children:n,...c},i)=>{const{organization:s,props:{fontClassName:u,textClassName:l}}=r();return e.jsxs(Rt,{children:[e.jsx(Dt,{}),e.jsxs(Et,{ref:i,className:a("qc:bg-background qc:shadow-outer qc:border-border qc:max-w-screen data-[state=open]:qc:animate-in data-[state=closed]:qc:animate-out data-[state=closed]:qc:fade-out-0 data-[state=open]:qc:fade-in-0 data-[state=closed]:qc:zoom-out-95 data-[state=open]:qc:zoom-in-95 data-[state=closed]:qc:slide-out-to-left-1/2 data-[state=closed]:qc:slide-out-to-top-[48%] data-[state=open]:qc:slide-in-from-left-1/2 data-[state=open]:qc:slide-in-from-top-[48%] qc:fixed qc:left-[50%] qc:top-[50%] qc:z-2002 qc:w-auto qc:translate-x-[-50%] qc:translate-y-[-50%] qc:rounded qc:duration-300 qc:sm:rounded",u,l,t),style:o(s),...c,children:[n,e.jsx(xt,{className:"qc:ring-offset-background focus:qc:ring-ring data-[state=open]:qc:text-foreground qc:hover:opacity-100 qc:focus:outline-none qc:disabled:pointer-events-none qc:focus:qc:ring-2 qc:focus:qc:ring-offset-2 qc:absolute qc:right-3 qc:top-3 qc:rounded qc:opacity-70 qc:transition-opacity",children:e.jsx("span",{className:"qc:sr-only",children:"Close"})})]})]})}),qt=({className:t,...n})=>e.jsx("div",{className:a("qc:flex qc:flex-col qc:space-y-1 qc:p-3 qc:text-center qc:sm:text-left",t),...n}),Mt=c.forwardRef(({className:t,...n},r)=>e.jsx(wt,{ref:r,className:a("qc:text-foreground qc:text-center qc:text-lg qc:font-semibold",t),...n})),Ot=c.forwardRef(({className:t,...n},r)=>e.jsx(Nt,{ref:r,className:a("qc:text-muted qc:text-center qc:text-sm",t),...n}));export{Ct as D,A as F,N as P,Le as R,St as a,qt as b,Mt as c,Ot as d,m as e,x as f,z as g,U as h,We as i,p as j,Y as k,M as l,w as m,b as n,h as u};
|
|
1
|
+
import{j as e,M as t,L as n,u as r,O as o,c as a}from"./DNOLzzZH.js";import*as c from"react";import{useState as i}from"react";import*as s from"react-dom";import u from"react-dom";import{a as l,b as d,c as f}from"./D6nr9_KD.js";function p(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),!1===n||!r.defaultPrevented)return t?.(r)}}function m(t,n=[]){let r=[];const o=()=>{const e=r.map(e=>c.createContext(e));return function(n){const r=n?.[t]||e;return c.useMemo(()=>({[`__scope${t}`]:{...n,[t]:r}}),[n,r])}};return o.scopeName=t,[function(n,o){const a=c.createContext(o),i=r.length;r=[...r,o];const s=n=>{const{scope:r,children:o,...s}=n,u=r?.[t]?.[i]||a,l=c.useMemo(()=>s,Object.values(s));return e.jsx(u.Provider,{value:l,children:o})};return s.displayName=n+"Provider",[s,function(e,r){const s=r?.[t]?.[i]||a,u=c.useContext(s);if(u)return u;if(void 0!==o)return o;throw new Error(`\`${e}\` must be used within \`${n}\``)}]},v(o,...n)]}function v(...e){const t=e[0];if(1===e.length)return t;const n=()=>{const n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){const r=n.reduce((t,{useScope:n,scopeName:r})=>({...t,...n(e)[`__scope${r}`]}),{});return c.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}var h=globalThis?.document?c.useLayoutEffect:()=>{},g=c[" useId ".trim().toString()]||(()=>{}),y=0;function b(e){const[t,n]=c.useState(g());return h(()=>{n(e=>e??String(y++))},[e]),e||(t?`radix-${t}`:"")}var E=c[" useInsertionEffect ".trim().toString()]||h;function w({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,a,i]=function({defaultProp:e,onChange:t}){const[n,r]=c.useState(e),o=c.useRef(n),a=c.useRef(t);return E(()=>{a.current=t},[t]),c.useEffect(()=>{o.current!==n&&(a.current?.(n),o.current=n)},[n,o]),[n,r,a]}({defaultProp:t,onChange:n}),s=void 0!==e,u=s?e:o;{const t=c.useRef(void 0!==e);c.useEffect(()=>{const e=t.current;e!==s&&console.warn(`${r} is changing from ${e?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=s},[s,r])}return[u,c.useCallback(t=>{if(s){const n=function(e){return"function"==typeof e}(t)?t(e):t;n!==e&&i.current?.(n)}else a(t)},[s,e,a,i])]}var N=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((n,r)=>{const o=t(`Primitive.${r}`),a=c.forwardRef((t,n)=>{const{asChild:a,...c}=t,i=a?o:r;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),e.jsx(i,{...c,ref:n})});return a.displayName=`Primitive.${r}`,{...n,[r]:a}},{});function x(e){const t=c.useRef(e);return c.useEffect(()=>{t.current=e}),c.useMemo(()=>(...e)=>t.current?.(...e),[])}var C,R="dismissableLayer.update",D="dismissableLayer.pointerDownOutside",S="dismissableLayer.focusOutside",q=c.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),M=c.forwardRef((t,r)=>{const{disableOutsidePointerEvents:o=!1,onEscapeKeyDown:a,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:u,onDismiss:l,...d}=t,f=c.useContext(q),[m,v]=c.useState(null),h=m?.ownerDocument??globalThis?.document,[,g]=c.useState({}),y=n(r,e=>v(e)),b=Array.from(f.layers),[E]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),w=b.indexOf(E),M=m?b.indexOf(m):-1,O=f.layersWithOutsidePointerEventsDisabled.size>0,L=M>=w,_=function(e,t=globalThis?.document){const n=x(e),r=c.useRef(!1),o=c.useRef(()=>{});return c.useEffect(()=>{const e=e=>{if(e.target&&!r.current){let r=function(){T(D,n,a,{discrete:!0})};const a={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",o.current),o.current=r,t.addEventListener("click",o.current,{once:!0})):r()}else t.removeEventListener("click",o.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",e),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}(e=>{const t=e.target,n=[...f.branches].some(e=>e.contains(t));!L||n||(i?.(e),u?.(e),e.defaultPrevented||l?.())},h),k=function(e,t=globalThis?.document){const n=x(e),r=c.useRef(!1);return c.useEffect(()=>{const e=e=>{e.target&&!r.current&&T(S,n,{originalEvent:e},{discrete:!1})};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}(e=>{const t=e.target;[...f.branches].some(e=>e.contains(t))||(s?.(e),u?.(e),e.defaultPrevented||l?.())},h);return function(e,t=globalThis?.document){const n=x(e);c.useEffect(()=>{const e=e=>{"Escape"===e.key&&n(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})},[n,t])}(e=>{M===f.layers.size-1&&(a?.(e),!e.defaultPrevented&&l&&(e.preventDefault(),l()))},h),c.useEffect(()=>{if(m)return o&&(0===f.layersWithOutsidePointerEventsDisabled.size&&(C=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(m)),f.layers.add(m),P(),()=>{o&&1===f.layersWithOutsidePointerEventsDisabled.size&&(h.body.style.pointerEvents=C)}},[m,h,o,f]),c.useEffect(()=>()=>{m&&(f.layers.delete(m),f.layersWithOutsidePointerEventsDisabled.delete(m),P())},[m,f]),c.useEffect(()=>{const e=()=>g({});return document.addEventListener(R,e),()=>document.removeEventListener(R,e)},[]),e.jsx(N.div,{...d,ref:y,style:{pointerEvents:O?L?"auto":"none":void 0,...t.style},onFocusCapture:p(t.onFocusCapture,k.onFocusCapture),onBlurCapture:p(t.onBlurCapture,k.onBlurCapture),onPointerDownCapture:p(t.onPointerDownCapture,_.onPointerDownCapture)})});M.displayName="DismissableLayer";var O=c.forwardRef((t,r)=>{const o=c.useContext(q),a=c.useRef(null),i=n(r,a);return c.useEffect(()=>{const e=a.current;if(e)return o.branches.add(e),()=>{o.branches.delete(e)}},[o.branches]),e.jsx(N.div,{...t,ref:i})});function P(){const e=new CustomEvent(R);document.dispatchEvent(e)}function T(e,t,n,{discrete:r}){const o=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?function(e,t){e&&s.flushSync(()=>e.dispatchEvent(t))}(o,a):o.dispatchEvent(a)}O.displayName="DismissableLayerBranch";var L="focusScope.autoFocusOnMount",_="focusScope.autoFocusOnUnmount",k={bubbles:!1,cancelable:!0},A=c.forwardRef((t,r)=>{const{loop:o=!1,trapped:a=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...u}=t,[l,d]=c.useState(null),f=x(i),p=x(s),m=c.useRef(null),v=n(r,e=>d(e)),h=c.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;c.useEffect(()=>{if(a){let e=function(e){if(h.paused||!l)return;const t=e.target;l.contains(t)?m.current=t:W(m.current,{select:!0})},t=function(e){if(h.paused||!l)return;const t=e.relatedTarget;null!==t&&(l.contains(t)||W(m.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&W(l)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const r=new MutationObserver(n);return l&&r.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}},[a,l,h.paused]),c.useEffect(()=>{if(l){$.add(h);const e=document.activeElement;if(!l.contains(e)){const t=new CustomEvent(L,k);l.addEventListener(L,f),l.dispatchEvent(t),t.defaultPrevented||(function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(W(r,{select:t}),document.activeElement!==n)return}(function(e){return e.filter(e=>"A"!==e.tagName)}(j(l)),{select:!0}),document.activeElement===e&&W(l))}return()=>{l.removeEventListener(L,f),setTimeout(()=>{const t=new CustomEvent(_,k);l.addEventListener(_,p),l.dispatchEvent(t),t.defaultPrevented||W(e??document.body,{select:!0}),l.removeEventListener(_,p),$.remove(h)},0)}}},[l,f,p,h]);const g=c.useCallback(e=>{if(!o&&!a||h.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,n=document.activeElement;if(t&&n){const t=e.currentTarget,[r,a]=function(e){const t=j(e),n=I(t,e),r=I(t.reverse(),e);return[n,r]}(t);r&&a?e.shiftKey||n!==a?e.shiftKey&&n===r&&(e.preventDefault(),o&&W(a,{select:!0})):(e.preventDefault(),o&&W(r,{select:!0})):n===t&&e.preventDefault()}},[o,a,h.paused]);return e.jsx(N.div,{tabIndex:-1,...u,ref:v,onKeyDown:g})});function j(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function I(e,t){for(const n of e)if(!F(n,{upTo:t}))return n}function F(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function W(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}A.displayName="FocusScope";var $=function(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=B(e,t),e.unshift(t)},remove(t){e=B(e,t),e[0]?.resume()}}}();function B(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}var U=c.forwardRef((t,n)=>{const{container:r,...o}=t,[a,i]=c.useState(!1);h(()=>i(!0),[]);const s=r||a&&globalThis?.document?.body;return s?u.createPortal(e.jsx(N.div,{...o,ref:n}),s):null});U.displayName="Portal";var z=e=>{const{present:t,children:r}=e,o=function(e){const[t,n]=c.useState(),r=c.useRef(null),o=c.useRef(e),a=c.useRef("none"),i=e?"mounted":"unmounted",[s,u]=function(e,t){return c.useReducer((e,n)=>t[e][n]??e,e)}(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return c.useEffect(()=>{const e=K(r.current);a.current="mounted"===s?e:"none"},[s]),h(()=>{const t=r.current,n=o.current;if(n!==e){const r=a.current,c=K(t);u(e?"MOUNT":"none"===c||"none"===t?.display?"UNMOUNT":n&&r!==c?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,u]),h(()=>{if(t){let e;const n=t.ownerDocument.defaultView??window,c=a=>{const c=K(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&c&&(u("ANIMATION_END"),!o.current)){const r=t.style.animationFillMode;t.style.animationFillMode="forwards",e=n.setTimeout(()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=r)})}},i=e=>{e.target===t&&(a.current=K(r.current))};return t.addEventListener("animationstart",i),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{n.clearTimeout(e),t.removeEventListener("animationstart",i),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:c.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}(t),a="function"==typeof r?r({present:o.isPresent}):c.Children.only(r),i=n(o.ref,function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}(a));return"function"==typeof r||o.isPresent?c.cloneElement(a,{ref:i}):null};function K(e){return e?.animationName||"none"}z.displayName="Presence";var X=0;function Y(){c.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??H()),document.body.insertAdjacentElement("beforeend",e[1]??H()),X++,()=>{1===X&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),X--}},[])}function H(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Z="right-scroll-bar-position",V="width-before-scroll-bar";function G(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var J=typeof window<"u"?c.useLayoutEffect:c.useEffect,Q=new WeakMap;function ee(e,t){var n=function(e,t){var n=i(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}(null,function(t){return e.forEach(function(e){return G(e,t)})});return J(function(){var t=Q.get(n);if(t){var r=new Set(t),o=new Set(e),a=n.current;r.forEach(function(e){o.has(e)||G(e,null)}),o.forEach(function(e){r.has(e)||G(e,a)})}Q.set(n,e)},[e]),n}function te(e){return e}var ne=function(e){var t=e.sideCar,n=d(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return c.createElement(r,l({},n))};ne.isSideCarExport=!0;var re=function(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=te);var n=[],r=!1;return{read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var o=t(e,r);return n.push(o),function(){n=n.filter(function(e){return e!==o})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var o=n;n=[],o.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},c=function(){return Promise.resolve().then(a)};c(),n={push:function(e){t.push(e),c()},filter:function(e){return t=t.filter(e),n}}}}}(null);return t.options=l({async:!0,ssr:!1},e),t}(),oe=function(){},ae=c.forwardRef(function(e,t){var n=c.useRef(null),r=c.useState({onScrollCapture:oe,onWheelCapture:oe,onTouchMoveCapture:oe}),o=r[0],a=r[1],i=e.forwardProps,s=e.children,u=e.className,f=e.removeScrollBar,p=e.enabled,m=e.shards,v=e.sideCar,h=e.noRelative,g=e.noIsolation,y=e.inert,b=e.allowPinchZoom,E=e.as,w=void 0===E?"div":E,N=e.gapMode,x=d(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=v,R=ee([n,t]),D=l(l({},x),o);return c.createElement(c.Fragment,null,p&&c.createElement(C,{sideCar:re,removeScrollBar:f,shards:m,noRelative:h,noIsolation:g,inert:y,setCallbacks:a,allowPinchZoom:!!b,lockRef:n,gapMode:N}),i?c.cloneElement(c.Children.only(s),l(l({},D),{ref:R})):c.createElement(w,l({},D,{className:u,ref:R}),s))});ae.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},ae.classNames={fullWidth:V,zeroRight:Z};function ce(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__}();return t&&e.setAttribute("nonce",t),e}var ie=function(){var e=0,t=null;return{add:function(n){0==e&&(t=ce())&&(function(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}(t,n),function(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}(t)),e++},remove:function(){! --e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},se=function(){var e=function(){var e=ie();return function(t,n){c.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}}();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},ue={left:0,top:0,right:0,gap:0},le=function(e){return parseInt(e||"",10)||0},de=function(e){if(void 0===e&&(e="margin"),typeof window>"u")return ue;var t=function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingLeft":"marginLeft"],r=t["padding"===e?"paddingTop":"marginTop"],o=t["padding"===e?"paddingRight":"marginRight"];return[le(n),le(r),le(o)]}(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},fe=se(),pe="data-scroll-locked",me=function(e,t,n,r){var o=e.left,a=e.top,c=e.right,i=e.gap;return void 0===n&&(n="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(r,";\n padding-right: ").concat(i,"px ").concat(r,";\n }\n body[").concat(pe,"] {\n overflow: hidden ").concat(r,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(r,";"),"margin"===n&&"\n padding-left: ".concat(o,"px;\n padding-top: ").concat(a,"px;\n padding-right: ").concat(c,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(i,"px ").concat(r,";\n "),"padding"===n&&"padding-right: ".concat(i,"px ").concat(r,";")].filter(Boolean).join(""),"\n }\n \n .").concat(Z," {\n right: ").concat(i,"px ").concat(r,";\n }\n \n .").concat(V," {\n margin-right: ").concat(i,"px ").concat(r,";\n }\n \n .").concat(Z," .").concat(Z," {\n right: 0 ").concat(r,";\n }\n \n .").concat(V," .").concat(V," {\n margin-right: 0 ").concat(r,";\n }\n \n body[").concat(pe,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(i,"px;\n }\n")},ve=function(){var e=parseInt(document.body.getAttribute(pe)||"0",10);return isFinite(e)?e:0},he=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=void 0===r?"margin":r;c.useEffect(function(){return document.body.setAttribute(pe,(ve()+1).toString()),function(){var e=ve()-1;e<=0?document.body.removeAttribute(pe):document.body.setAttribute(pe,e.toString())}},[]);var a=c.useMemo(function(){return de(o)},[o]);return c.createElement(fe,{styles:me(a,!t,o,n?"":"!important")})},ge=!1;if(typeof window<"u")try{var ye=Object.defineProperty({},"passive",{get:function(){return ge=!0,!0}});window.addEventListener("test",ye,ye),window.removeEventListener("test",ye,ye)}catch{ge=!1}var be=!!ge&&{passive:!1},Ee=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return"hidden"!==n[t]&&!(n.overflowY===n.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===n[t])},we=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host),Ne(e,r)){var o=xe(e,r);if(o[1]>o[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Ne=function(e,t){return"v"===e?function(e){return Ee(e,"overflowY")}(t):function(e){return Ee(e,"overflowX")}(t)},xe=function(e,t){return"v"===e?function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]}(t):function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t)},Ce=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Re=function(e){return[e.deltaX,e.deltaY]},De=function(e){return e&&"current"in e?e.current:e},Se=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},qe=0,Me=[];function Oe(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Pe=(Te=function(e){var t=c.useRef([]),n=c.useRef([0,0]),r=c.useRef(),o=c.useState(qe++)[0],a=c.useState(se)[0],i=c.useRef(e);c.useEffect(function(){i.current=e},[e]),c.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var t=f([e.lockRef.current],(e.shards||[]).map(De),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),t.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var s=c.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!i.current.allowPinchZoom;var o,a=Ce(e),c=n.current,s="deltaX"in e?e.deltaX:c[0]-a[0],u="deltaY"in e?e.deltaY:c[1]-a[1],l=e.target,d=Math.abs(s)>Math.abs(u)?"h":"v";if("touches"in e&&"h"===d&&"range"===l.type)return!1;var f=we(d,l);if(!f)return!0;if(f?o=d:(o="v"===d?"h":"v",f=we(d,l)),!f)return!1;if(!r.current&&"changedTouches"in e&&(s||u)&&(r.current=o),!o)return!0;var p=r.current||o;return function(e,t,n,r){var o=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),a=o*r,c=n.target,i=t.contains(c),s=!1,u=a>0,l=0,d=0;do{if(!c)break;var f=xe(e,c),p=f[0],m=f[1]-f[2]-o*p;(p||m)&&Ne(e,c)&&(l+=m,d+=p);var v=c.parentNode;c=v&&v.nodeType===Node.DOCUMENT_FRAGMENT_NODE?v.host:v}while(!i&&c!==document.body||i&&(t.contains(c)||t===c));return(u&&Math.abs(l)<1||!u&&Math.abs(d)<1)&&(s=!0),s}(p,t,e,"h"===p?s:u)},[]),u=c.useCallback(function(e){var n=e;if(Me.length&&Me[Me.length-1]===a){var r="deltaY"in n?Re(n):Ce(n),o=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&function(e,t){return e[0]===t[0]&&e[1]===t[1]}(e.delta,r)})[0];if(o&&o.should)return void(n.cancelable&&n.preventDefault());if(!o){var c=(i.current.shards||[]).map(De).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!i.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=c.useCallback(function(e,n,r,o){var a={name:e,delta:n,target:r,should:o,shadowParent:Oe(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),d=c.useCallback(function(e){n.current=Ce(e),r.current=void 0},[]),p=c.useCallback(function(t){l(t.type,Re(t),t.target,s(t,e.lockRef.current))},[]),m=c.useCallback(function(t){l(t.type,Ce(t),t.target,s(t,e.lockRef.current))},[]);c.useEffect(function(){return Me.push(a),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:m}),document.addEventListener("wheel",u,be),document.addEventListener("touchmove",u,be),document.addEventListener("touchstart",d,be),function(){Me=Me.filter(function(e){return e!==a}),document.removeEventListener("wheel",u,be),document.removeEventListener("touchmove",u,be),document.removeEventListener("touchstart",d,be)}},[]);var v=e.removeScrollBar,h=e.inert;return c.createElement(c.Fragment,null,h?c.createElement(a,{styles:Se(o)}):null,v?c.createElement(he,{noRelative:e.noRelative,gapMode:e.gapMode}):null)},re.useMedium(Te),ne);var Te,Le=c.forwardRef(function(e,t){return c.createElement(ae,l({},e,{ref:t,sideCar:Pe}))});Le.classNames=ae.classNames;var _e=new WeakMap,ke=new WeakMap,Ae={},je=0,Ie=function(e){return e&&(e.host||Ie(e.parentNode))},Fe=function(e,t,n,r){var o=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Ie(t);return n&&e.contains(n)?n:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)}).filter(function(e){return!!e})}(t,Array.isArray(e)?e:[e]);Ae[n]||(Ae[n]=new WeakMap);var a=Ae[n],c=[],i=new Set,s=new Set(o),u=function(e){!e||i.has(e)||(i.add(e),u(e.parentNode))};o.forEach(u);var l=function(e){!e||s.has(e)||Array.prototype.forEach.call(e.children,function(e){if(i.has(e))l(e);else try{var t=e.getAttribute(r),o=null!==t&&"false"!==t,s=(_e.get(e)||0)+1,u=(a.get(e)||0)+1;_e.set(e,s),a.set(e,u),c.push(e),1===s&&o&&ke.set(e,!0),1===u&&e.setAttribute(n,"true"),o||e.setAttribute(r,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}})};return l(t),i.clear(),je++,function(){c.forEach(function(e){var t=_e.get(e)-1,o=a.get(e)-1;_e.set(e,t),a.set(e,o),t||(ke.has(e)||e.removeAttribute(r),ke.delete(e)),o||e.removeAttribute(n)}),--je||(_e=new WeakMap,_e=new WeakMap,ke=new WeakMap,Ae={})}},We=function(e,t,n){void 0===n&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=function(e){return typeof document>"u"?null:(Array.isArray(e)?e[0]:e).ownerDocument.body}(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),Fe(r,o,n,"aria-hidden")):function(){return null}},$e="Dialog",[Be]=m($e),[Ue,ze]=Be($e),Ke=t=>{const{__scopeDialog:n,children:r,open:o,defaultOpen:a,onOpenChange:i,modal:s=!0}=t,u=c.useRef(null),l=c.useRef(null),[d,f]=w({prop:o,defaultProp:a??!1,onChange:i,caller:$e});return e.jsx(Ue,{scope:n,triggerRef:u,contentRef:l,contentId:b(),titleId:b(),descriptionId:b(),open:d,onOpenChange:f,onOpenToggle:c.useCallback(()=>f(e=>!e),[f]),modal:s,children:r})};Ke.displayName=$e;var Xe="DialogTrigger",Ye=c.forwardRef((t,r)=>{const{__scopeDialog:o,...a}=t,c=ze(Xe,o),i=n(r,c.triggerRef);return e.jsx(N.button,{type:"button","aria-haspopup":"dialog","aria-expanded":c.open,"aria-controls":c.contentId,"data-state":pt(c.open),...a,ref:i,onClick:p(t.onClick,c.onOpenToggle)})});Ye.displayName=Xe;var He="DialogPortal",[Ze,Ve]=Be(He,{forceMount:void 0}),Ge=t=>{const{__scopeDialog:n,forceMount:r,children:o,container:a}=t,i=ze(He,n);return e.jsx(Ze,{scope:n,forceMount:r,children:c.Children.map(o,t=>e.jsx(z,{present:r||i.open,children:e.jsx(U,{asChild:!0,container:a,children:t})}))})};Ge.displayName=He;var Je="DialogOverlay",Qe=c.forwardRef((t,n)=>{const r=Ve(Je,t.__scopeDialog),{forceMount:o=r.forceMount,...a}=t,c=ze(Je,t.__scopeDialog);return c.modal?e.jsx(z,{present:o||c.open,children:e.jsx(tt,{...a,ref:n})}):null});Qe.displayName=Je;var et=t("DialogOverlay.RemoveScroll"),tt=c.forwardRef((t,n)=>{const{__scopeDialog:r,...o}=t,a=ze(Je,r);return e.jsx(Le,{as:et,allowPinchZoom:!0,shards:[a.contentRef],children:e.jsx(N.div,{"data-state":pt(a.open),...o,ref:n,style:{pointerEvents:"auto",...o.style}})})}),nt="DialogContent",rt=c.forwardRef((t,n)=>{const r=Ve(nt,t.__scopeDialog),{forceMount:o=r.forceMount,...a}=t,c=ze(nt,t.__scopeDialog);return e.jsx(z,{present:o||c.open,children:c.modal?e.jsx(ot,{...a,ref:n}):e.jsx(at,{...a,ref:n})})});rt.displayName=nt;var ot=c.forwardRef((t,r)=>{const o=ze(nt,t.__scopeDialog),a=c.useRef(null),i=n(r,o.contentRef,a);return c.useEffect(()=>{const e=a.current;if(e)return We(e)},[]),e.jsx(ct,{...t,ref:i,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:p(t.onCloseAutoFocus,e=>{e.preventDefault(),o.triggerRef.current?.focus()}),onPointerDownOutside:p(t.onPointerDownOutside,e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey;(2===t.button||n)&&e.preventDefault()}),onFocusOutside:p(t.onFocusOutside,e=>e.preventDefault())})}),at=c.forwardRef((t,n)=>{const r=ze(nt,t.__scopeDialog),o=c.useRef(!1),a=c.useRef(!1);return e.jsx(ct,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:e=>{t.onCloseAutoFocus?.(e),e.defaultPrevented||(o.current||r.triggerRef.current?.focus(),e.preventDefault()),o.current=!1,a.current=!1},onInteractOutside:e=>{t.onInteractOutside?.(e),e.defaultPrevented||(o.current=!0,"pointerdown"===e.detail.originalEvent.type&&(a.current=!0));const n=e.target;r.triggerRef.current?.contains(n)&&e.preventDefault(),"focusin"===e.detail.originalEvent.type&&a.current&&e.preventDefault()}})}),ct=c.forwardRef((t,r)=>{const{__scopeDialog:o,trapFocus:a,onOpenAutoFocus:i,onCloseAutoFocus:s,...u}=t,l=ze(nt,o),d=c.useRef(null),f=n(r,d);return Y(),e.jsxs(e.Fragment,{children:[e.jsx(A,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:i,onUnmountAutoFocus:s,children:e.jsx(M,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":pt(l.open),...u,ref:f,onDismiss:()=>l.onOpenChange(!1)})}),e.jsxs(e.Fragment,{children:[e.jsx(gt,{titleId:l.titleId}),e.jsx(yt,{contentRef:d,descriptionId:l.descriptionId})]})]})}),it="DialogTitle",st=c.forwardRef((t,n)=>{const{__scopeDialog:r,...o}=t,a=ze(it,r);return e.jsx(N.h2,{id:a.titleId,...o,ref:n})});st.displayName=it;var ut="DialogDescription",lt=c.forwardRef((t,n)=>{const{__scopeDialog:r,...o}=t,a=ze(ut,r);return e.jsx(N.p,{id:a.descriptionId,...o,ref:n})});lt.displayName=ut;var dt="DialogClose",ft=c.forwardRef((t,n)=>{const{__scopeDialog:r,...o}=t,a=ze(dt,r);return e.jsx(N.button,{type:"button",...o,ref:n,onClick:p(t.onClick,()=>a.onOpenChange(!1))})});function pt(e){return e?"open":"closed"}ft.displayName=dt;var mt="DialogTitleWarning",[vt,ht]=function(t,n){const r=c.createContext(n),o=t=>{const{children:n,...o}=t,a=c.useMemo(()=>o,Object.values(o));return e.jsx(r.Provider,{value:a,children:n})};return o.displayName=t+"Provider",[o,function(e){const o=c.useContext(r);if(o)return o;if(void 0!==n)return n;throw new Error(`\`${e}\` must be used within \`${t}\``)}]}(mt,{contentName:nt,titleName:it,docsSlug:"dialog"}),gt=({titleId:e})=>{const t=ht(mt),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.\n\nIf you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return c.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},yt=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${ht("DialogDescriptionWarning").contentName}}.`;return c.useEffect(()=>{const r=e.current?.getAttribute("aria-describedby");t&&r&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},bt=Qe,Et=rt,wt=st,Nt=lt,xt=ft;const Ct=Ke,Rt=Ge,Dt=c.forwardRef(({className:t,...n},r)=>e.jsx(bt,{ref:r,className:a("qc:data-[state=open]:animate-in qc:data-[state=closed]:animate-out qc:data-[state=closed]:fade-out-0 qc:data-[state=open]:fade-in-0 qc:fixed qc:inset-0 qc:z-2001 qc:backdrop-blur-md",t),...n})),St=c.forwardRef(({className:t,children:n,...c},i)=>{const{organization:s,props:{fontClassName:u,textClassName:l}}=r();return e.jsxs(Rt,{children:[e.jsx(Dt,{}),e.jsxs(Et,{ref:i,className:a("qc:bg-background qc:shadow-outer qc:border-border qc:max-w-screen qc:data-[state=open]:animate-in qc:data-[state=closed]:animate-out qc:data-[state=closed]:fade-out-0 qc:data-[state=open]:fade-in-0 qc:data-[state=closed]:zoom-out-95 qc:data-[state=open]:zoom-in-95 qc:data-[state=closed]:slide-out-to-left-1/2 qc:data-[state=closed]:slide-out-to-top-[48%] qc:data-[state=open]:slide-in-from-left-1/2 qc:data-[state=open]:slide-in-from-top-[48%] qc:fixed qc:left-[50%] qc:top-[50%] qc:z-2002 qc:w-auto qc:translate-x-[-50%] qc:translate-y-[-50%] qc:rounded qc:duration-300 qc:sm:rounded",u,l,t),style:o(s),...c,children:[n,e.jsx(xt,{className:"qc:ring-offset-background qc:focus:ring-ring qc:data-[state=open]:text-foreground qc:hover:opacity-100 qc:focus:outline-none qc:disabled:pointer-events-none qc:focus:ring-2 qc:focus:ring-offset-2 qc:absolute qc:right-3 qc:top-3 qc:rounded qc:opacity-70 qc:transition-opacity",children:e.jsx("span",{className:"qc:sr-only",children:"Close"})})]})]})}),qt=({className:t,...n})=>e.jsx("div",{className:a("qc:flex qc:flex-col qc:space-y-1 qc:p-3 qc:text-center qc:sm:text-left",t),...n}),Mt=c.forwardRef(({className:t,...n},r)=>e.jsx(wt,{ref:r,className:a("qc:text-foreground qc:text-center qc:text-lg qc:font-semibold",t),...n})),Ot=c.forwardRef(({className:t,...n},r)=>e.jsx(Nt,{ref:r,className:a("qc:text-muted qc:text-center qc:text-sm",t),...n}));export{Ct as D,A as F,N as P,Le as R,St as a,qt as b,Mt as c,Ot as d,m as e,x as f,z as g,U as h,We as i,p as j,Y as k,M as l,w as m,b as n,h as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{P as e,j as s,I as r,g as a,T as o}from"./DNOLzzZH.js";const l=(s,r)=>{const a=new Map;s?.forEach(e=>{a.set(e._id,e)});const o=[];let l=a.get(r);for(;l;)o.unshift({_id:l._id,name:l.name,href:e.FOLDER_EVENTS(l?._id),color:l.color}),l=a.get(l.parentFolderId);return o},c=({folder:e})=>s.jsxs("li",{className:"qc:flex qc:items-center",children:[s.jsx(r,{name:"material-symbols:arrow-forward-ios-rounded",size:"sm"}),s.jsxs(a,{to:e.href,className:"qc:flex qc:items-center qc:gap-2 qc:rounded qc:px-4 qc:py-1 qc:transition-colors qc:hover:bg-primary/10",children:[s.jsx(r,{name:"material-symbols:folder",size:"lg",style:{color:e.color}}),s.jsx(o,{variant:"h5",color:"secondary",className:"qc:whitespace-nowrap",children:e.name})]})]},e.name),n=({homeLink:e,data:o})=>s.jsxs("ol",{role:"list",className:"scrollbar-hide qc:flex qc:max-w-full qc:items-center qc:space-x-3 qc:overflow-y-scroll",children:[s.jsx("li",{children:s.jsxs(a,{to:e,className:"qc:text-foreground",children:[s.jsx(r,{name:"material-symbols:home-outline-rounded",size:"lg"}),s.jsx("span",{className:"qc:sr-only",children:"Home"})]})}),o?.map(e=>s.jsx(c,{folder:e},e._id))]});export{n as F,l as g};
|
|
@@ -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"./DNOLzzZH.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 +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"./DNOLzzZH.js";import i,{useState as c}from"react";import{I as d}from"./CqFENFZB.js";import{u,o as m,c as f,C as p,a as h,b as g}from"./HhCRmfOk.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{d as e,u as a,j as s,J as l,T as o,g as r,P as i}from"./
|
|
1
|
+
import{d as e,u as a,j as s,J as l,T as o,g as r,P as i}from"./DNOLzzZH.js";import{useState as t}from"react";import{I as n}from"./CqFENFZB.js";import{S as c}from"./T91t2h6g.js";import{u as d,C as m,o as p,c as g,a as u}from"./HhCRmfOk.js";const h=g().shape({email:u().required("Please enter your email").email("Enter a valid email"),password:u().required("Please enter your password").min(8,"Min password length is 8")}),j=()=>{const[g,u]=t(!1),[j,f]=t(!1),[x,w]=t({google:!1,apple:!1}),[y,q]=t(null),v=e(),{control:C,handleSubmit:b,formState:{errors:N}}=d({defaultValues:{email:"",password:""},mode:"onSubmit",resolver:p(h)}),{loginUsingEmail:S,loginWithGoogle:P,loginWithApple:B}=a(),k=async(e,a)=>{w(a=>({...a,[e]:!0})),q(null);try{await a()}catch(a){q(a.message||`Failed to login with ${e.charAt(0).toUpperCase()+e.slice(1)}`)}finally{w(a=>({...a,[e]:!1}))}};return s.jsxs("div",{className:"qc:w-full qc:space-y-6",children:[s.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:b(async e=>{const{email:a,password:s}=e;f(!0);try{const e=await S(a.toLowerCase(),s);e?.error&&q(e.error)}catch(e){q(e)}finally{f(!1)}}),className:"qc:space-y-6",children:[s.jsxs("div",{className:"qc:space-y-9",children:[s.jsx(m,{name:"email",control:C,render:({field:{value:e,onChange:a,onBlur:l}})=>s.jsx(n,{label:"Email",disabled:j,type:"email",value:e,onChange:a,onBlur:l,autoComplete:"email",error:N.email?.message})}),s.jsx(m,{name:"password",control:C,render:({field:{value:e,onChange:a,onBlur:o}})=>s.jsxs("div",{className:"qc:relative",children:[s.jsx(n,{label:"Password",disabled:j,type:g?"text":"password",value:e,onChange:a,onBlur:o,autoComplete:"current-password",error:N.password?.message}),s.jsx(l,{variant:"ghost",color:"primary",className:"qc:absolute qc:right-0 qc:top-8",icon:g?"mdi:eye-outline":"mdi:eye-off-outline",onClick:()=>u(!g)})]})})]}),y&&s.jsx(o,{align:"center",weight:"medium",color:"error",children:y}),s.jsx("div",{className:"qc:flex qc:justify-end",children:s.jsx(r,{to:i.FORGOT_PASSWORD,state:v?.state,children:s.jsx(o,{variant:"h6",className:"qc:w-fit",children:"Forgot password?"})})}),s.jsx(l,{type:"submit",color:"primary",className:"qc:w-full",loading:j,disabled:j,children:"Login"})]}),s.jsxs("div",{className:"qc:grid qc:grid-cols-2 qc:gap-4",children:[s.jsx(c,{disabled:j||x.google||x.apple,loading:x.google,onClick:()=>k("google",P),provider:"google"}),s.jsx(c,{disabled:j||x.google||x.apple,loading:x.apple,onClick:()=>k("apple",B),provider:"apple"})]})]})};export{j as default};
|