@qratilabs/qrati-connect 2.5.2 → 2.5.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.
Files changed (54) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/element/{AuthLayout-IGFGeMq5.js → AuthLayout-dLrNjfTG.js} +1 -1
  3. package/element/{ContentsPage-Bu42OF-F.js → ContentsPage-D5N_Bxqd.js} +1 -1
  4. package/element/{CuratePage-CBMluidb.js → CuratePage-Bd-mjSun.js} +1 -1
  5. package/element/{Dialog-DVSvxBn8.js → Dialog-BCT4uBAd.js} +1 -1
  6. package/element/{DotLottiePlayer-DHVhIw5H.js → DotLottiePlayer-CAuE83oi.js} +1 -1
  7. package/element/{EventHeaderAdminButtons-zE3NbEUA.js → EventHeaderAdminButtons-CF3CCL_D.js} +1 -1
  8. package/element/{FolderBreadcrumb-1w72I1FP.js → FolderBreadcrumb-DNjgRkum.js} +1 -1
  9. package/element/{ForgotPasswordPage-CIw8RrkZ.js → ForgotPasswordPage-d4qE75sD.js} +1 -1
  10. package/element/{InputField-XP30segE.js → InputField-DzVZ8doF.js} +1 -1
  11. package/element/{LazyLoadImage-n94OUygV.js → LazyLoadImage-D3GY3Wjr.js} +1 -1
  12. package/element/{LeaderboardPage-CGuP207i.js → LeaderboardPage-C_VE9Ci4.js} +1 -1
  13. package/element/{LoginPage-B15CMpYe.js → LoginPage-Cg8pF-HK.js} +1 -1
  14. package/element/{NCMVHL6D-D_O5jdHL.js → NCMVHL6D-cxuYBLSe.js} +1 -1
  15. package/element/{PublicEvents-DOp9N4xU.js → PublicEvents-A6FN3YA_.js} +1 -1
  16. package/element/{RegisterPage-D-6uVKjj.js → RegisterPage-C3Zm2pLv.js} +1 -1
  17. package/element/{SocialLoginButton-BuZ03WV-.js → SocialLoginButton-B_JXlwJD.js} +1 -1
  18. package/element/{UploadPage-Dhjmh06j.js → UploadPage-BBNlsruc.js} +1 -1
  19. package/element/{VideoPlayer-cWSLl4fO.js → VideoPlayer-bxfQ_8-7.js} +1 -1
  20. package/element/element.es.js +1 -1
  21. package/element/{heic2any-Dui1sz1X.js → heic2any-DhrJ4jGE.js} +1 -1
  22. package/element/{index-jzNVBihK.js → index-B07nTRSZ.js} +1 -1
  23. package/element/{index-DsN-W6V_.js → index-B7W6Qazn.js} +1 -1
  24. package/element/{index.esm-CsbPHPGO.js → index.esm-nbz30aE_.js} +1 -1
  25. package/element/{photoswipe-5mcef1lI.js → photoswipe-uy_xfi0k.js} +1 -1
  26. package/element/{tslib.es6-Dp_1P0Dk.js → tslib.es6-D07ckMAp.js} +1 -1
  27. package/element/{useOrgAccess-B1cbGHT_.js → useOrgAccess-Bc4D_9qX.js} +1 -1
  28. package/element/web.es.js +1 -1
  29. package/package.json +1 -1
  30. package/react/{VOx0knsi.js → B4U_edoH.js} +1 -1
  31. package/react/{BZvhXg2G.js → BXUUE4i8.js} +1 -1
  32. package/react/{CE-MbwCB.js → BgO9hwgt.js} +1 -1
  33. package/react/{cWB0y40v.js → BjeC9muX.js} +1 -1
  34. package/react/{DS2UD7gV.js → BsbGC0mb.js} +1 -1
  35. package/react/{6xRxF6pz.js → BtS27Hrp.js} +1 -1
  36. package/react/{Dyk2_V8r.js → BvPG5WOQ.js} +1 -1
  37. package/react/{jM4FWKDA.js → CCcmkpg2.js} +1 -1
  38. package/react/{Bebe5T7J.js → CVCROaIm.js} +1 -1
  39. package/react/{CS7icy9d.js → DDKdRpJD.js} +1 -1
  40. package/react/{C565I04Q.js → DEeNislJ.js} +1 -1
  41. package/react/{LMErjmPc.js → DFu2hVZT.js} +1 -1
  42. package/react/{Cp86U6va.js → DIbZ1HTT.js} +1 -1
  43. package/react/{vmkon26e.js → DKIOd50z.js} +1 -1
  44. package/react/{D1emifDo.js → DR1lh2_F.js} +1 -1
  45. package/react/{W8TabW9M.js → Dc_aR8k5.js} +1 -1
  46. package/react/{DPtqYlwJ.js → DhHfT-f_.js} +1 -1
  47. package/react/{DjmC7CGh.js → Dso7YRKD.js} +1 -1
  48. package/react/{CIlaT7eJ.js → Dv6l17gK.js} +1 -1
  49. package/react/{BaA7RHRf.js → DzIjyaQc.js} +1 -1
  50. package/react/{DwNWOPAY.js → XORV3RdW.js} +1 -1
  51. package/react/{DZitaH5o.js → YDJF25E_.js} +1 -1
  52. package/react/index.es.js +1 -1
  53. package/react/{Cv7EiFQU.js → zaA1B6UI.js} +1 -1
  54. package/umd/web.umd.js +1 -1
@@ -1 +1 @@
1
- import{c as e,T as r,P as t,a,D as o,Q as s}from"./Cp86U6va.js";import{a5 as l,a6 as n,a7 as c}from"./BaA7RHRf.js";var u=u=>{const[i,d]=e({prefix:"TanstackQueryDevtools"}),m=l(),v=n(()=>{const e=i.theme_preference||r;return"system"!==e?e:m()});return c(s.Provider,{value:u,get children(){return c(t,{localStore:i,setLocalStore:d,get children(){return c(a.Provider,{value:v,get children(){return c(o,{localStore:i,setLocalStore:d})}})}})}})};export{u as default};
1
+ import{c as e,T as r,P as t,a,D as o,Q as s}from"./DIbZ1HTT.js";import{a5 as l,a6 as n,a7 as c}from"./DzIjyaQc.js";var u=u=>{const[i,d]=e({prefix:"TanstackQueryDevtools"}),m=l(),v=n(()=>{const e=i.theme_preference||r;return"system"!==e?e:m()});return c(s.Provider,{value:u,get children(){return c(t,{localStore:i,setLocalStore:d,get children(){return c(a.Provider,{value:v,get children(){return c(o,{localStore:i,setLocalStore:d})}})}})}})};export{u as default};
@@ -1 +1 @@
1
- import{j as c,a3 as e}from"./BaA7RHRf.js";const a=({disabled:a,provider:r,onClick:s,loading:i})=>c.jsx("button",{disabled:a||i,onClick:async()=>{if(!a&&!i)try{await s()}catch(c){console.error(`${e(r)} login error:`,c)}},className:"qc:group qc:h-12 qc:rounded-full qc:transition qc:duration-300 qc:disabled:cursor-not-allowed qc:disabled:border-gray-500 qc:disabled:opacity-50",children:i?c.jsx("div",{className:"qc:flex qc:h-full qc:items-center qc:justify-center",children:c.jsx("div",{className:"qc:h-5 qc:w-5 qc:animate-spin qc:rounded-full qc:border-b-2 qc:border-gray-900"})}):c.jsx("img",{className:"qc:h-auto qc:w-full",src:(c=>{switch(c){case"google":return"https://qrati.com/images/continue-with-google.svg";case"apple":return"https://qrati.com/images/continue-with-apple.svg";default:return""}})(r,a),alt:`sign in with ${e(r)}`})});export{a as S};
1
+ import{j as c,a3 as e}from"./DzIjyaQc.js";const a=({disabled:a,provider:r,onClick:s,loading:i})=>c.jsx("button",{disabled:a||i,onClick:async()=>{if(!a&&!i)try{await s()}catch(c){console.error(`${e(r)} login error:`,c)}},className:"qc:group qc:h-12 qc:rounded-full qc:transition qc:duration-300 qc:disabled:cursor-not-allowed qc:disabled:border-gray-500 qc:disabled:opacity-50",children:i?c.jsx("div",{className:"qc:flex qc:h-full qc:items-center qc:justify-center",children:c.jsx("div",{className:"qc:h-5 qc:w-5 qc:animate-spin qc:rounded-full qc:border-b-2 qc:border-gray-900"})}):c.jsx("img",{className:"qc:h-auto qc:w-full",src:(c=>{switch(c){case"google":return"https://qrati.com/images/continue-with-google.svg";case"apple":return"https://qrati.com/images/continue-with-apple.svg";default:return""}})(r,a),alt:`sign in with ${e(r)}`})});export{a as S};
@@ -1 +1 @@
1
- import{d as e,u as a,j as s,J as l,T as o,g as r,P as i}from"./BaA7RHRf.js";import{useState as t}from"react";import{I as n}from"./Bebe5T7J.js";import{S as c}from"./D1emifDo.js";import{u as d,C as m,o as p,c as g,a as u}from"./-74yB4f5.js";const h=g().shape({email:u().required("Please enter your email").email("Enter a valid email"),password:u().required("Please enter your password").min(8,"Min password length is 8")}),j=()=>{const[g,u]=t(!1),[j,f]=t(!1),[x,w]=t({google:!1,apple:!1}),[y,q]=t(null),v=e(),{control:b,handleSubmit:C,formState:{errors:N}}=d({defaultValues:{email:"",password:""},mode:"onSubmit",resolver:p(h)}),{loginUsingEmail:S,loginWithGoogle:P,loginWithApple:k}=a(),B=async(e,a)=>{w(a=>({...a,[e]:!0})),q(null);try{await a()}catch(a){q(a.message||`Failed to login with ${e.charAt(0).toUpperCase()+e.slice(1)}`)}finally{w(a=>({...a,[e]:!1}))}};return s.jsxs("div",{className:"qc:w-full qc:space-y-6 qc:bg-background",children:[s.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:C(async e=>{const{email:a,password:s}=e;f(!0);try{const e=await S(a.toLowerCase(),s);e?.error&&q(e.error)}catch(e){q(e)}finally{f(!1)}}),className:"qc:space-y-6",children:[s.jsxs("div",{className:"qc:space-y-9",children:[s.jsx(m,{name:"email",control:b,render:({field:{value:e,onChange:a,onBlur:l}})=>s.jsx(n,{label:"Email",disabled:j,type:"email",value:e,onChange:a,onBlur:l,autoComplete:"email",error:N.email?.message})}),s.jsx(m,{name:"password",control:b,render:({field:{value:e,onChange:a,onBlur:o}})=>s.jsxs("div",{className:"qc:relative",children:[s.jsx(n,{label:"Password",disabled:j,type:g?"text":"password",value:e,onChange:a,onBlur:o,autoComplete:"current-password",error:N.password?.message}),s.jsx(l,{variant:"ghost",color:"primary",className:"qc:absolute qc:right-0 qc:top-8",icon:g?"mdi:eye-outline":"mdi:eye-off-outline",onClick:()=>u(!g)})]})})]}),y&&s.jsx(o,{align:"center",weight:"medium",color:"error",children:y}),s.jsx("div",{className:"qc:flex qc:justify-end",children:s.jsx(r,{to:i.FORGOT_PASSWORD,state:v?.state,children:s.jsx(o,{variant:"h6",className:"qc:w-fit",children:"Forgot password?"})})}),s.jsx(l,{type:"submit",color:"primary",className:"qc:w-full",loading:j,disabled:j,children:"Login"})]}),s.jsxs("div",{className:"qc:grid qc:grid-cols-2 qc:gap-4",children:[s.jsx(c,{disabled:j||x.google||x.apple,loading:x.google,onClick:()=>B("google",P),provider:"google"}),s.jsx(c,{disabled:j||x.google||x.apple,loading:x.apple,onClick:()=>B("apple",k),provider:"apple"})]})]})};export{j as default};
1
+ import{d as e,u as a,j as s,J as l,T as o,g as r,P as i}from"./DzIjyaQc.js";import{useState as t}from"react";import{I as n}from"./CVCROaIm.js";import{S as c}from"./DR1lh2_F.js";import{u as d,C as m,o as p,c as g,a as u}from"./-74yB4f5.js";const h=g().shape({email:u().required("Please enter your email").email("Enter a valid email"),password:u().required("Please enter your password").min(8,"Min password length is 8")}),j=()=>{const[g,u]=t(!1),[j,f]=t(!1),[x,w]=t({google:!1,apple:!1}),[y,q]=t(null),v=e(),{control:b,handleSubmit:C,formState:{errors:N}}=d({defaultValues:{email:"",password:""},mode:"onSubmit",resolver:p(h)}),{loginUsingEmail:S,loginWithGoogle:P,loginWithApple:k}=a(),B=async(e,a)=>{w(a=>({...a,[e]:!0})),q(null);try{await a()}catch(a){q(a.message||`Failed to login with ${e.charAt(0).toUpperCase()+e.slice(1)}`)}finally{w(a=>({...a,[e]:!1}))}};return s.jsxs("div",{className:"qc:w-full qc:space-y-6 qc:bg-background",children:[s.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:C(async e=>{const{email:a,password:s}=e;f(!0);try{const e=await S(a.toLowerCase(),s);e?.error&&q(e.error)}catch(e){q(e)}finally{f(!1)}}),className:"qc:space-y-6",children:[s.jsxs("div",{className:"qc:space-y-9",children:[s.jsx(m,{name:"email",control:b,render:({field:{value:e,onChange:a,onBlur:l}})=>s.jsx(n,{label:"Email",disabled:j,type:"email",value:e,onChange:a,onBlur:l,autoComplete:"email",error:N.email?.message})}),s.jsx(m,{name:"password",control:b,render:({field:{value:e,onChange:a,onBlur:o}})=>s.jsxs("div",{className:"qc:relative",children:[s.jsx(n,{label:"Password",disabled:j,type:g?"text":"password",value:e,onChange:a,onBlur:o,autoComplete:"current-password",error:N.password?.message}),s.jsx(l,{variant:"ghost",color:"primary",className:"qc:absolute qc:right-0 qc:top-8",icon:g?"mdi:eye-outline":"mdi:eye-off-outline",onClick:()=>u(!g)})]})})]}),y&&s.jsx(o,{align:"center",weight:"medium",color:"error",children:y}),s.jsx("div",{className:"qc:flex qc:justify-end",children:s.jsx(r,{to:i.FORGOT_PASSWORD,state:v?.state,children:s.jsx(o,{variant:"h6",className:"qc:w-fit",children:"Forgot password?"})})}),s.jsx(l,{type:"submit",color:"primary",className:"qc:w-full",loading:j,disabled:j,children:"Login"})]}),s.jsxs("div",{className:"qc:grid qc:grid-cols-2 qc:gap-4",children:[s.jsx(c,{disabled:j||x.google||x.apple,loading:x.google,onClick:()=>B("google",P),provider:"google"}),s.jsx(c,{disabled:j||x.google||x.apple,loading:x.apple,onClick:()=>B("apple",k),provider:"apple"})]})]})};export{j as default};
@@ -1 +1 @@
1
- import{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"./BaA7RHRf.js";import c,{useState as i}from"react";import{I as d}from"./Bebe5T7J.js";import{u,o as m,c as f,C as p,a as h,b as g}from"./-74yB4f5.js";const v=({count:r=1,currentStep:o=0,disabled:n,onStepClick:a})=>{const t=n||!a;return e.jsx("ol",{role:"list",className:"qc:flex qc:items-center qc:space-x-4 qc:pl-1.5",children:Array.from({length:r}).map((r,n)=>e.jsx("li",{children:n<o?e.jsx("button",{className:"qc:bg-primary qc:block qc:size-3 qc:rounded-full",disabled:t,onClick:()=>a&&a(n)}):n===o?e.jsxs("button",{className:"qc:relative qc:flex qc:items-center qc:justify-center","aria-current":"step",disabled:t,onClick:()=>a&&a(n),children:[e.jsx("span",{className:"qc:absolute qc:flex qc:size-6 qc:p-px","aria-hidden":"true",children:e.jsx("span",{className:"qc:bg-primary qc:size-full qc:rounded-full qc:bg-opacity-40"})}),e.jsx("span",{className:"qc:bg-primary qc:relative qc:block qc:size-3 qc:rounded-full","aria-hidden":"true"})]}):e.jsx("button",{className:"qc:block qc:size-3 qc:rounded-full qc:bg-text-secondary-light",disabled:t,onClick:()=>a&&a(n)})},`progress-dot-${n}`))})},q={email:""},w=f().shape({email:h().required("Please enter your email").email("Enter a valid email")}),x=({onCodeSent:s})=>{const[l,c]=i(!1),[f,h]=i(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),c(!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.")}c(!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,i=e.shouldAutoFocus,d=void 0!==i&&i,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=c.useState(0),x=w[0],b=w[1],j=c.useRef([]),S=function(){return o?o.toString().split(""):[]},C="number"===m||"tel"===m;c.useEffect(function(){j.current=j.current.slice(0,a)},[a]),c.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 c.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 c.createElement(c.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:c}}=r(),[d,f]=i(!1),[h,g]=i(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":c}}),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:c}}=r(),[f,h]=i({showPassword:!1,showConfirmPassword:!1}),[g,v]=i(!1),[q,w]=i(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":c}});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]=i(null),[a,t]=i(0);return e.jsxs("div",{className:"qc:space-y-9 qc:bg-background",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
+ 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"./DzIjyaQc.js";import c,{useState as i}from"react";import{I as d}from"./CVCROaIm.js";import{u,o as m,c as f,C as p,a as h,b as g}from"./-74yB4f5.js";const v=({count:r=1,currentStep:o=0,disabled:n,onStepClick:a})=>{const t=n||!a;return e.jsx("ol",{role:"list",className:"qc:flex qc:items-center qc:space-x-4 qc:pl-1.5",children:Array.from({length:r}).map((r,n)=>e.jsx("li",{children:n<o?e.jsx("button",{className:"qc:bg-primary qc:block qc:size-3 qc:rounded-full",disabled:t,onClick:()=>a&&a(n)}):n===o?e.jsxs("button",{className:"qc:relative qc:flex qc:items-center qc:justify-center","aria-current":"step",disabled:t,onClick:()=>a&&a(n),children:[e.jsx("span",{className:"qc:absolute qc:flex qc:size-6 qc:p-px","aria-hidden":"true",children:e.jsx("span",{className:"qc:bg-primary qc:size-full qc:rounded-full qc:bg-opacity-40"})}),e.jsx("span",{className:"qc:bg-primary qc:relative qc:block qc:size-3 qc:rounded-full","aria-hidden":"true"})]}):e.jsx("button",{className:"qc:block qc:size-3 qc:rounded-full qc:bg-text-secondary-light",disabled:t,onClick:()=>a&&a(n)})},`progress-dot-${n}`))})},q={email:""},w=f().shape({email:h().required("Please enter your email").email("Enter a valid email")}),x=({onCodeSent:s})=>{const[l,c]=i(!1),[f,h]=i(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),c(!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.")}c(!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,i=e.shouldAutoFocus,d=void 0!==i&&i,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=c.useState(0),x=w[0],b=w[1],j=c.useRef([]),S=function(){return o?o.toString().split(""):[]},C="number"===m||"tel"===m;c.useEffect(function(){j.current=j.current.slice(0,a)},[a]),c.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 c.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 c.createElement(c.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:c}}=r(),[d,f]=i(!1),[h,g]=i(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":c}}),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:c}}=r(),[f,h]=i({showPassword:!1,showConfirmPassword:!1}),[g,v]=i(!1),[q,w]=i(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":c}});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]=i(null),[a,t]=i(0);return e.jsxs("div",{className:"qc:space-y-9 qc:bg-background",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{j as e,c as t}from"./BaA7RHRf.js";import{useRef as s,useState as r,useCallback as c,useEffect as l}from"react";const n=({src:n,thumbnailUrl:o,playing:a=!1,controls:u=!1,playsInline:i=!0,fit:q="cover",muted:h=!0,showFullscreen:m=!0,onClick:d,onPlay:v,onPause:T,onEnd:p})=>{const w=s(null),x=s(null),[f,g]=r(!0),j=s(typeof window<"u"&&window.matchMedia("(hover: hover)").matches),b=c(()=>{a?T?.():v?.()},[a,T,v]),y=c(()=>{if(!w.current)return;const e=w.current;e.requestFullscreen?e.requestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullscreen?e.webkitRequestFullscreen():e.msRequestFullscreen&&e.msRequestFullscreen()},[]);return l(()=>{const e=w.current;if(!e)return;const t=()=>{try{a&&e.play().catch(()=>{})}catch(e){console.error("Error handling video play:",e)}};return e.addEventListener("canplay",t),()=>e.removeEventListener("canplay",t)},[a]),l(()=>{const e=w.current;if(e){try{a?(e.play().catch(()=>{}),j.current||(x.current=setTimeout(()=>g(!1),1e3))):(e.pause(),g(!0))}catch(e){console.error("Error controlling video playback:",e)}return()=>{x.current&&(clearTimeout(x.current),x.current=null)}}},[a]),e.jsxs("div",{className:"qc:hover:cursor-pointer qc:relative qc:size-full",onMouseEnter:()=>g(!0),onMouseLeave:()=>g(!1),children:[e.jsx("video",{ref:w,className:t("qc:size-full",`qc:object-${q}`),src:n,muted:h,poster:o,controls:u,playsInline:i,onEnded:p,onClick:d,children:"Your browser does not support the video tag."}),!u&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"qc:absolute qc:left-0 qc:top-0 qc:flex qc:size-full qc:items-center qc:justify-center",children:f&&e.jsx("button",{onClick:b,className:"qc:text-white","aria-label":a?"Pause":"Play",children:a?e.jsxs("svg",{className:"qc:absolute qc:inset-0 qc:m-auto qc:size-12",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[" ",e.jsx("path",{fill:"white",d:"M16 19q-.825 0-1.412-.587T14 17V7q0-.825.588-1.412T16 5t1.413.588T18 7v10q0 .825-.587 1.413T16 19m-8 0q-.825 0-1.412-.587T6 17V7q0-.825.588-1.412T8 5t1.413.588T10 7v10q0 .825-.587 1.413T8 19"})]}):e.jsxs("svg",{className:"qc:absolute qc:inset-0 qc:m-auto qc:size-12",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[" ",e.jsx("path",{fill:"white",d:"M8 17.175V6.825q0-.425.3-.713t.7-.287q.125 0 .263.037t.262.113l8.15 5.175q.225.15.338.375t.112.475t-.112.475t-.338.375l-8.15 5.175q-.125.075-.262.113T9 18.175q-.4 0-.7-.288t-.3-.712"})," "]})})}),f&&m&&e.jsx("button",{onClick:y,className:"qc:absolute qc:right-3 qc:top-3 qc:size-8 qc:rounded-lg qc:p-2 qc:text-white","aria-label":"Enter fullscreen",children:e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:"qc:size-6",children:[" ",e.jsx("path",{fill:"currentColor",d:"M5 19h2q.425 0 .713.288T8 20t-.288.713T7 21H4q-.425 0-.712-.288T3 20v-3q0-.425.288-.712T4 16t.713.288T5 17zm14 0v-2q0-.425.288-.712T20 16t.713.288T21 17v3q0 .425-.288.713T20 21h-3q-.425 0-.712-.288T16 20t.288-.712T17 19zM5 5v2q0 .425-.288.713T4 8t-.712-.288T3 7V4q0-.425.288-.712T4 3h3q.425 0 .713.288T8 4t-.288.713T7 5zm14 0h-2q-.425 0-.712-.288T16 4t.288-.712T17 3h3q.425 0 .713.288T21 4v3q0 .425-.288.713T20 8t-.712-.288T19 7z"})," "]})})]})]})};export{n as V};
1
+ import{j as e,c as t}from"./DzIjyaQc.js";import{useRef as s,useState as r,useCallback as c,useEffect as l}from"react";const n=({src:n,thumbnailUrl:o,playing:a=!1,controls:u=!1,playsInline:i=!0,fit:q="cover",muted:h=!0,showFullscreen:m=!0,onClick:d,onPlay:v,onPause:T,onEnd:p})=>{const w=s(null),x=s(null),[f,g]=r(!0),j=s(typeof window<"u"&&window.matchMedia("(hover: hover)").matches),b=c(()=>{a?T?.():v?.()},[a,T,v]),y=c(()=>{if(!w.current)return;const e=w.current;e.requestFullscreen?e.requestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullscreen?e.webkitRequestFullscreen():e.msRequestFullscreen&&e.msRequestFullscreen()},[]);return l(()=>{const e=w.current;if(!e)return;const t=()=>{try{a&&e.play().catch(()=>{})}catch(e){console.error("Error handling video play:",e)}};return e.addEventListener("canplay",t),()=>e.removeEventListener("canplay",t)},[a]),l(()=>{const e=w.current;if(e){try{a?(e.play().catch(()=>{}),j.current||(x.current=setTimeout(()=>g(!1),1e3))):(e.pause(),g(!0))}catch(e){console.error("Error controlling video playback:",e)}return()=>{x.current&&(clearTimeout(x.current),x.current=null)}}},[a]),e.jsxs("div",{className:"qc:hover:cursor-pointer qc:relative qc:size-full",onMouseEnter:()=>g(!0),onMouseLeave:()=>g(!1),children:[e.jsx("video",{ref:w,className:t("qc:size-full",`qc:object-${q}`),src:n,muted:h,poster:o,controls:u,playsInline:i,onEnded:p,onClick:d,children:"Your browser does not support the video tag."}),!u&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"qc:absolute qc:left-0 qc:top-0 qc:flex qc:size-full qc:items-center qc:justify-center",children:f&&e.jsx("button",{onClick:b,className:"qc:text-white","aria-label":a?"Pause":"Play",children:a?e.jsxs("svg",{className:"qc:absolute qc:inset-0 qc:m-auto qc:size-12",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[" ",e.jsx("path",{fill:"white",d:"M16 19q-.825 0-1.412-.587T14 17V7q0-.825.588-1.412T16 5t1.413.588T18 7v10q0 .825-.587 1.413T16 19m-8 0q-.825 0-1.412-.587T6 17V7q0-.825.588-1.412T8 5t1.413.588T10 7v10q0 .825-.587 1.413T8 19"})]}):e.jsxs("svg",{className:"qc:absolute qc:inset-0 qc:m-auto qc:size-12",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[" ",e.jsx("path",{fill:"white",d:"M8 17.175V6.825q0-.425.3-.713t.7-.287q.125 0 .263.037t.262.113l8.15 5.175q.225.15.338.375t.112.475t-.112.475t-.338.375l-8.15 5.175q-.125.075-.262.113T9 18.175q-.4 0-.7-.288t-.3-.712"})," "]})})}),f&&m&&e.jsx("button",{onClick:y,className:"qc:absolute qc:right-3 qc:top-3 qc:size-8 qc:rounded-lg qc:p-2 qc:text-white","aria-label":"Enter fullscreen",children:e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:"qc:size-6",children:[" ",e.jsx("path",{fill:"currentColor",d:"M5 19h2q.425 0 .713.288T8 20t-.288.713T7 21H4q-.425 0-.712-.288T3 20v-3q0-.425.288-.712T4 16t.713.288T5 17zm14 0v-2q0-.425.288-.712T20 16t.713.288T21 17v3q0 .425-.288.713T20 21h-3q-.425 0-.712-.288T16 20t.288-.712T17 19zM5 5v2q0 .425-.288.713T4 8t-.712-.288T3 7V4q0-.425.288-.712T4 3h3q.425 0 .713.288T8 4t-.288.713T7 5zm14 0h-2q-.425 0-.712-.288T16 4t.288-.712T17 3h3q.425 0 .713.288T21 4v3q0 .425-.288.713T20 8t-.712-.288T19 7z"})," "]})})]})]})};export{n as V};
@@ -1 +1 @@
1
- import{j as e,M as t,L as n,u as r,O as o,c as a}from"./BaA7RHRf.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 E(e){const[t,n]=c.useState(g());return h(()=>{n(e=>e??String(y++))},[e]),e||(t?`radix-${t}`:"")}var b=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 b(()=>{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])]}function N(t){const n=C(t),r=c.forwardRef((t,r)=>{const{children:o,...a}=t,i=c.Children.toArray(o),s=i.find(R);if(s){const t=s.props.children,o=i.map(e=>e===s?c.Children.count(t)>1?c.Children.only(null):c.isValidElement(t)?t.props.children:null:e);return e.jsx(n,{...a,ref:r,children:c.isValidElement(t)?c.cloneElement(t,void 0,o):null})}return e.jsx(n,{...a,ref:r,children:o})});return r.displayName=`${t}.Slot`,r}function C(e){const n=c.forwardRef((e,n)=>{const{children:r,...o}=e;if(c.isValidElement(r)){const e=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)}(r),a=function(e,t){const n={...t};for(const r in t){const o=e[r],a=t[r];/^on[A-Z]/.test(r)?o&&a?n[r]=(...e)=>{const t=a(...e);return o(...e),t}:o&&(n[r]=o):"style"===r?n[r]={...o,...a}:"className"===r&&(n[r]=[o,a].filter(Boolean).join(" "))}return{...e,...n}}(o,r.props);return r.type!==c.Fragment&&(a.ref=n?t(n,e):e),c.cloneElement(r,a)}return c.Children.count(r)>1?c.Children.only(null):null});return n.displayName=`${e}.SlotClone`,n}var x=Symbol("radix.slottable");function R(e){return c.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===x}var D=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((t,n)=>{const r=N(`Primitive.${n}`),o=c.forwardRef((t,o)=>{const{asChild:a,...c}=t,i=a?r:n;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),e.jsx(i,{...c,ref:o})});return o.displayName=`Primitive.${n}`,{...t,[n]:o}},{});function S(e){const t=c.useRef(e);return c.useEffect(()=>{t.current=e}),c.useMemo(()=>(...e)=>t.current?.(...e),[])}var O,P="dismissableLayer.update",q="dismissableLayer.pointerDownOutside",M="dismissableLayer.focusOutside",_=c.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),j=c.forwardRef((t,r)=>{const{disableOutsidePointerEvents:o=!1,onEscapeKeyDown:a,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:u,onDismiss:l,...d}=t,f=c.useContext(_),[m,v]=c.useState(null),h=m?.ownerDocument??globalThis?.document,[,g]=c.useState({}),y=n(r,e=>v(e)),E=Array.from(f.layers),[b]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),w=E.indexOf(b),N=m?E.indexOf(m):-1,C=f.layersWithOutsidePointerEventsDisabled.size>0,x=N>=w,R=function(e,t=globalThis?.document){const n=S(e),r=c.useRef(!1),o=c.useRef(()=>{});return c.useEffect(()=>{const e=e=>{if(e.target&&!r.current){let r=function(){L(q,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));!x||n||(i?.(e),u?.(e),e.defaultPrevented||l?.())},h),j=function(e,t=globalThis?.document){const n=S(e),r=c.useRef(!1);return c.useEffect(()=>{const e=e=>{e.target&&!r.current&&L(M,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=S(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=>{N===f.layers.size-1&&(a?.(e),!e.defaultPrevented&&l&&(e.preventDefault(),l()))},h),c.useEffect(()=>{if(m)return o&&(0===f.layersWithOutsidePointerEventsDisabled.size&&(O=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(m)),f.layers.add(m),A(),()=>{o&&1===f.layersWithOutsidePointerEventsDisabled.size&&(h.body.style.pointerEvents=O)}},[m,h,o,f]),c.useEffect(()=>()=>{m&&(f.layers.delete(m),f.layersWithOutsidePointerEventsDisabled.delete(m),A())},[m,f]),c.useEffect(()=>{const e=()=>g({});return document.addEventListener(P,e),()=>document.removeEventListener(P,e)},[]),e.jsx(D.div,{...d,ref:y,style:{pointerEvents:C?x?"auto":"none":void 0,...t.style},onFocusCapture:p(t.onFocusCapture,j.onFocusCapture),onBlurCapture:p(t.onBlurCapture,j.onBlurCapture),onPointerDownCapture:p(t.onPointerDownCapture,R.onPointerDownCapture)})});j.displayName="DismissableLayer";var T=c.forwardRef((t,r)=>{const o=c.useContext(_),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(D.div,{...t,ref:i})});function A(){const e=new CustomEvent(P);document.dispatchEvent(e)}function L(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)}T.displayName="DismissableLayerBranch";var I="focusScope.autoFocusOnMount",k="focusScope.autoFocusOnUnmount",F={bubbles:!1,cancelable:!0},W=c.forwardRef((t,r)=>{const{loop:o=!1,trapped:a=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...u}=t,[l,d]=c.useState(null),f=S(i),p=S(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:z(m.current,{select:!0})},t=function(e){if(h.paused||!l)return;const t=e.relatedTarget;null!==t&&(l.contains(t)||z(m.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&z(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){K.add(h);const e=document.activeElement;if(!l.contains(e)){const t=new CustomEvent(I,F);l.addEventListener(I,f),l.dispatchEvent(t),t.defaultPrevented||(function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(z(r,{select:t}),document.activeElement!==n)return}(function(e){return e.filter(e=>"A"!==e.tagName)}($(l)),{select:!0}),document.activeElement===e&&z(l))}return()=>{l.removeEventListener(I,f),setTimeout(()=>{const t=new CustomEvent(k,F);l.addEventListener(k,p),l.dispatchEvent(t),t.defaultPrevented||z(e??document.body,{select:!0}),l.removeEventListener(k,p),K.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=$(e),n=B(t,e),r=B(t.reverse(),e);return[n,r]}(t);r&&a?e.shiftKey||n!==a?e.shiftKey&&n===r&&(e.preventDefault(),o&&z(a,{select:!0})):(e.preventDefault(),o&&z(r,{select:!0})):n===t&&e.preventDefault()}},[o,a,h.paused]);return e.jsx(D.div,{tabIndex:-1,...u,ref:v,onKeyDown:g})});function $(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 B(e,t){for(const n of e)if(!U(n,{upTo:t}))return n}function U(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 z(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()}}W.displayName="FocusScope";var K=function(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=V(e,t),e.unshift(t)},remove(t){e=V(e,t),e[0]?.resume()}}}();function V(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}var X=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(D.div,{...o,ref:n}),s):null});X.displayName="Portal";var Y=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=Z(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=Z(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=Z(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=Z(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 Z(e){return e?.animationName||"none"}Y.displayName="Presence";var H=0;function G(){c.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??J()),document.body.insertAdjacentElement("beforeend",e[1]??J()),H++,()=>{1===H&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),H--}},[])}function J(){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 Q="right-scroll-bar-position",ee="width-before-scroll-bar";function te(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var ne=typeof window<"u"?c.useLayoutEffect:c.useEffect,re=new WeakMap;function oe(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 te(e,t)})});return ne(function(){var t=re.get(n);if(t){var r=new Set(t),o=new Set(e),a=n.current;r.forEach(function(e){o.has(e)||te(e,null)}),o.forEach(function(e){r.has(e)||te(e,a)})}re.set(n,e)},[e]),n}function ae(e){return e}var ce=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))};ce.isSideCarExport=!0;var ie=function(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=ae);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}(),se=function(){},ue=c.forwardRef(function(e,t){var n=c.useRef(null),r=c.useState({onScrollCapture:se,onWheelCapture:se,onTouchMoveCapture:se}),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,E=e.allowPinchZoom,b=e.as,w=void 0===b?"div":b,N=e.gapMode,C=d(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),x=v,R=oe([n,t]),D=l(l({},C),o);return c.createElement(c.Fragment,null,p&&c.createElement(x,{sideCar:ie,removeScrollBar:f,shards:m,noRelative:h,noIsolation:g,inert:y,setCallbacks:a,allowPinchZoom:!!E,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))});ue.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},ue.classNames={fullWidth:ee,zeroRight:Q};function le(){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 de=function(){var e=0,t=null;return{add:function(n){0==e&&(t=le())&&(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)}}},fe=function(){var e=function(){var e=de();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}},pe={left:0,top:0,right:0,gap:0},me=function(e){return parseInt(e||"",10)||0},ve=function(e){if(void 0===e&&(e="margin"),typeof window>"u")return pe;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[me(n),me(r),me(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])}},he=fe(),ge="data-scroll-locked",ye=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(ge,"] {\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(Q," {\n right: ").concat(i,"px ").concat(r,";\n }\n \n .").concat(ee," {\n margin-right: ").concat(i,"px ").concat(r,";\n }\n \n .").concat(Q," .").concat(Q," {\n right: 0 ").concat(r,";\n }\n \n .").concat(ee," .").concat(ee," {\n margin-right: 0 ").concat(r,";\n }\n \n body[").concat(ge,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(i,"px;\n }\n")},Ee=function(){var e=parseInt(document.body.getAttribute(ge)||"0",10);return isFinite(e)?e:0},be=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(ge,(Ee()+1).toString()),function(){var e=Ee()-1;e<=0?document.body.removeAttribute(ge):document.body.setAttribute(ge,e.toString())}},[]);var a=c.useMemo(function(){return ve(o)},[o]);return c.createElement(he,{styles:ye(a,!t,o,n?"":"!important")})},we=!1;if(typeof window<"u")try{var Ne=Object.defineProperty({},"passive",{get:function(){return we=!0,!0}});window.addEventListener("test",Ne,Ne),window.removeEventListener("test",Ne,Ne)}catch{we=!1}var Ce=!!we&&{passive:!1},xe=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])},Re=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host),De(e,r)){var o=Se(e,r);if(o[1]>o[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},De=function(e,t){return"v"===e?function(e){return xe(e,"overflowY")}(t):function(e){return xe(e,"overflowX")}(t)},Se=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)},Oe=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Pe=function(e){return[e.deltaX,e.deltaY]},qe=function(e){return e&&"current"in e?e.current:e},Me=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},_e=0,je=[];function Te(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Ae=(Le=function(e){var t=c.useRef([]),n=c.useRef([0,0]),r=c.useRef(),o=c.useState(_e++)[0],a=c.useState(fe)[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(qe),!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=Oe(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=Re(d,l);if(!f)return!0;if(f?o=d:(o="v"===d?"h":"v",f=Re(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=Se(e,c),p=f[0],m=f[1]-f[2]-o*p;(p||m)&&De(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(je.length&&je[je.length-1]===a){var r="deltaY"in n?Pe(n):Oe(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(qe).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:Te(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=Oe(e),r.current=void 0},[]),p=c.useCallback(function(t){l(t.type,Pe(t),t.target,s(t,e.lockRef.current))},[]),m=c.useCallback(function(t){l(t.type,Oe(t),t.target,s(t,e.lockRef.current))},[]);c.useEffect(function(){return je.push(a),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:m}),document.addEventListener("wheel",u,Ce),document.addEventListener("touchmove",u,Ce),document.addEventListener("touchstart",d,Ce),function(){je=je.filter(function(e){return e!==a}),document.removeEventListener("wheel",u,Ce),document.removeEventListener("touchmove",u,Ce),document.removeEventListener("touchstart",d,Ce)}},[]);var v=e.removeScrollBar,h=e.inert;return c.createElement(c.Fragment,null,h?c.createElement(a,{styles:Me(o)}):null,v?c.createElement(be,{noRelative:e.noRelative,gapMode:e.gapMode}):null)},ie.useMedium(Le),ce);var Le,Ie=c.forwardRef(function(e,t){return c.createElement(ue,l({},e,{ref:t,sideCar:Ae}))});Ie.classNames=ue.classNames;var ke=new WeakMap,Fe=new WeakMap,We={},$e=0,Be=function(e){return e&&(e.host||Be(e.parentNode))},Ue=function(e,t,n,r){var o=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Be(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]);We[n]||(We[n]=new WeakMap);var a=We[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=(ke.get(e)||0)+1,u=(a.get(e)||0)+1;ke.set(e,s),a.set(e,u),c.push(e),1===s&&o&&Fe.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(),$e++,function(){c.forEach(function(e){var t=ke.get(e)-1,o=a.get(e)-1;ke.set(e,t),a.set(e,o),t||(Fe.has(e)||e.removeAttribute(r),Fe.delete(e)),o||e.removeAttribute(n)}),--$e||(ke=new WeakMap,ke=new WeakMap,Fe=new WeakMap,We={})}},ze=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"))),Ue(r,o,n,"aria-hidden")):function(){return null}};function Ke(t){const n=Ve(t),r=c.forwardRef((t,r)=>{const{children:o,...a}=t,i=c.Children.toArray(o),s=i.find(Ye);if(s){const t=s.props.children,o=i.map(e=>e===s?c.Children.count(t)>1?c.Children.only(null):c.isValidElement(t)?t.props.children:null:e);return e.jsx(n,{...a,ref:r,children:c.isValidElement(t)?c.cloneElement(t,void 0,o):null})}return e.jsx(n,{...a,ref:r,children:o})});return r.displayName=`${t}.Slot`,r}function Ve(e){const n=c.forwardRef((e,n)=>{const{children:r,...o}=e;if(c.isValidElement(r)){const e=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)}(r),a=function(e,t){const n={...t};for(const r in t){const o=e[r],a=t[r];/^on[A-Z]/.test(r)?o&&a?n[r]=(...e)=>{const t=a(...e);return o(...e),t}:o&&(n[r]=o):"style"===r?n[r]={...o,...a}:"className"===r&&(n[r]=[o,a].filter(Boolean).join(" "))}return{...e,...n}}(o,r.props);return r.type!==c.Fragment&&(a.ref=n?t(n,e):e),c.cloneElement(r,a)}return c.Children.count(r)>1?c.Children.only(null):null});return n.displayName=`${e}.SlotClone`,n}var Xe=Symbol("radix.slottable");function Ye(e){return c.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===Xe}var Ze="Dialog",[He]=m(Ze),[Ge,Je]=He(Ze),Qe=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:Ze});return e.jsx(Ge,{scope:n,triggerRef:u,contentRef:l,contentId:E(),titleId:E(),descriptionId:E(),open:d,onOpenChange:f,onOpenToggle:c.useCallback(()=>f(e=>!e),[f]),modal:s,children:r})};Qe.displayName=Ze;var et="DialogTrigger",tt=c.forwardRef((t,r)=>{const{__scopeDialog:o,...a}=t,c=Je(et,o),i=n(r,c.triggerRef);return e.jsx(D.button,{type:"button","aria-haspopup":"dialog","aria-expanded":c.open,"aria-controls":c.contentId,"data-state":wt(c.open),...a,ref:i,onClick:p(t.onClick,c.onOpenToggle)})});tt.displayName=et;var nt="DialogPortal",[rt,ot]=He(nt,{forceMount:void 0}),at=t=>{const{__scopeDialog:n,forceMount:r,children:o,container:a}=t,i=Je(nt,n);return e.jsx(rt,{scope:n,forceMount:r,children:c.Children.map(o,t=>e.jsx(Y,{present:r||i.open,children:e.jsx(X,{asChild:!0,container:a,children:t})}))})};at.displayName=nt;var ct="DialogOverlay",it=c.forwardRef((t,n)=>{const r=ot(ct,t.__scopeDialog),{forceMount:o=r.forceMount,...a}=t,c=Je(ct,t.__scopeDialog);return c.modal?e.jsx(Y,{present:o||c.open,children:e.jsx(ut,{...a,ref:n})}):null});it.displayName=ct;var st=Ke("DialogOverlay.RemoveScroll"),ut=c.forwardRef((t,n)=>{const{__scopeDialog:r,...o}=t,a=Je(ct,r);return e.jsx(Ie,{as:st,allowPinchZoom:!0,shards:[a.contentRef],children:e.jsx(D.div,{"data-state":wt(a.open),...o,ref:n,style:{pointerEvents:"auto",...o.style}})})}),lt="DialogContent",dt=c.forwardRef((t,n)=>{const r=ot(lt,t.__scopeDialog),{forceMount:o=r.forceMount,...a}=t,c=Je(lt,t.__scopeDialog);return e.jsx(Y,{present:o||c.open,children:c.modal?e.jsx(ft,{...a,ref:n}):e.jsx(pt,{...a,ref:n})})});dt.displayName=lt;var ft=c.forwardRef((t,r)=>{const o=Je(lt,t.__scopeDialog),a=c.useRef(null),i=n(r,o.contentRef,a);return c.useEffect(()=>{const e=a.current;if(e)return ze(e)},[]),e.jsx(mt,{...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())})}),pt=c.forwardRef((t,n)=>{const r=Je(lt,t.__scopeDialog),o=c.useRef(!1),a=c.useRef(!1);return e.jsx(mt,{...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()}})}),mt=c.forwardRef((t,r)=>{const{__scopeDialog:o,trapFocus:a,onOpenAutoFocus:i,onCloseAutoFocus:s,...u}=t,l=Je(lt,o),d=c.useRef(null),f=n(r,d);return G(),e.jsxs(e.Fragment,{children:[e.jsx(W,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:i,onUnmountAutoFocus:s,children:e.jsx(j,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":wt(l.open),...u,ref:f,onDismiss:()=>l.onOpenChange(!1)})}),e.jsxs(e.Fragment,{children:[e.jsx(Rt,{titleId:l.titleId}),e.jsx(Dt,{contentRef:d,descriptionId:l.descriptionId})]})]})}),vt="DialogTitle",ht=c.forwardRef((t,n)=>{const{__scopeDialog:r,...o}=t,a=Je(vt,r);return e.jsx(D.h2,{id:a.titleId,...o,ref:n})});ht.displayName=vt;var gt="DialogDescription",yt=c.forwardRef((t,n)=>{const{__scopeDialog:r,...o}=t,a=Je(gt,r);return e.jsx(D.p,{id:a.descriptionId,...o,ref:n})});yt.displayName=gt;var Et="DialogClose",bt=c.forwardRef((t,n)=>{const{__scopeDialog:r,...o}=t,a=Je(Et,r);return e.jsx(D.button,{type:"button",...o,ref:n,onClick:p(t.onClick,()=>a.onOpenChange(!1))})});function wt(e){return e?"open":"closed"}bt.displayName=Et;var Nt="DialogTitleWarning",[Ct,xt]=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}\``)}]}(Nt,{contentName:lt,titleName:vt,docsSlug:"dialog"}),Rt=({titleId:e})=>{const t=xt(Nt),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},Dt=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${xt("DialogDescriptionWarning").contentName}}.`;return c.useEffect(()=>{const r=e.current?.getAttribute("aria-describedby");t&&r&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},St=it,Ot=dt,Pt=ht,qt=yt,Mt=bt;const _t=Qe,jt=at,Tt=c.forwardRef(({className:t,...n},r)=>e.jsx(St,{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})),At=c.forwardRef(({className:t,children:n,...c},i)=>{const{organization:s,props:{fontClassName:u,textClassName:l}}=r();return e.jsxs(jt,{children:[e.jsx(Tt,{}),e.jsxs(Ot,{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(Mt,{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"})})]})]})}),Lt=({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}),It=c.forwardRef(({className:t,...n},r)=>e.jsx(Pt,{ref:r,className:a("qc:text-foreground qc:text-center qc:text-lg qc:font-semibold",t),...n})),kt=c.forwardRef(({className:t,...n},r)=>e.jsx(qt,{ref:r,className:a("qc:text-muted qc:text-center qc:text-sm",t),...n}));export{_t as D,W as F,D as P,Ie as R,At as a,Lt as b,It as c,kt as d,m as e,S as f,Y as g,X as h,ze as i,p as j,G as k,j as l,w as m,E 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"./DzIjyaQc.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 E(e){const[t,n]=c.useState(g());return h(()=>{n(e=>e??String(y++))},[e]),e||(t?`radix-${t}`:"")}var b=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 b(()=>{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])]}function N(t){const n=C(t),r=c.forwardRef((t,r)=>{const{children:o,...a}=t,i=c.Children.toArray(o),s=i.find(R);if(s){const t=s.props.children,o=i.map(e=>e===s?c.Children.count(t)>1?c.Children.only(null):c.isValidElement(t)?t.props.children:null:e);return e.jsx(n,{...a,ref:r,children:c.isValidElement(t)?c.cloneElement(t,void 0,o):null})}return e.jsx(n,{...a,ref:r,children:o})});return r.displayName=`${t}.Slot`,r}function C(e){const n=c.forwardRef((e,n)=>{const{children:r,...o}=e;if(c.isValidElement(r)){const e=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)}(r),a=function(e,t){const n={...t};for(const r in t){const o=e[r],a=t[r];/^on[A-Z]/.test(r)?o&&a?n[r]=(...e)=>{const t=a(...e);return o(...e),t}:o&&(n[r]=o):"style"===r?n[r]={...o,...a}:"className"===r&&(n[r]=[o,a].filter(Boolean).join(" "))}return{...e,...n}}(o,r.props);return r.type!==c.Fragment&&(a.ref=n?t(n,e):e),c.cloneElement(r,a)}return c.Children.count(r)>1?c.Children.only(null):null});return n.displayName=`${e}.SlotClone`,n}var x=Symbol("radix.slottable");function R(e){return c.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===x}var D=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((t,n)=>{const r=N(`Primitive.${n}`),o=c.forwardRef((t,o)=>{const{asChild:a,...c}=t,i=a?r:n;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),e.jsx(i,{...c,ref:o})});return o.displayName=`Primitive.${n}`,{...t,[n]:o}},{});function S(e){const t=c.useRef(e);return c.useEffect(()=>{t.current=e}),c.useMemo(()=>(...e)=>t.current?.(...e),[])}var O,P="dismissableLayer.update",q="dismissableLayer.pointerDownOutside",M="dismissableLayer.focusOutside",_=c.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),j=c.forwardRef((t,r)=>{const{disableOutsidePointerEvents:o=!1,onEscapeKeyDown:a,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:u,onDismiss:l,...d}=t,f=c.useContext(_),[m,v]=c.useState(null),h=m?.ownerDocument??globalThis?.document,[,g]=c.useState({}),y=n(r,e=>v(e)),E=Array.from(f.layers),[b]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),w=E.indexOf(b),N=m?E.indexOf(m):-1,C=f.layersWithOutsidePointerEventsDisabled.size>0,x=N>=w,R=function(e,t=globalThis?.document){const n=S(e),r=c.useRef(!1),o=c.useRef(()=>{});return c.useEffect(()=>{const e=e=>{if(e.target&&!r.current){let r=function(){L(q,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));!x||n||(i?.(e),u?.(e),e.defaultPrevented||l?.())},h),j=function(e,t=globalThis?.document){const n=S(e),r=c.useRef(!1);return c.useEffect(()=>{const e=e=>{e.target&&!r.current&&L(M,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=S(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=>{N===f.layers.size-1&&(a?.(e),!e.defaultPrevented&&l&&(e.preventDefault(),l()))},h),c.useEffect(()=>{if(m)return o&&(0===f.layersWithOutsidePointerEventsDisabled.size&&(O=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(m)),f.layers.add(m),A(),()=>{o&&1===f.layersWithOutsidePointerEventsDisabled.size&&(h.body.style.pointerEvents=O)}},[m,h,o,f]),c.useEffect(()=>()=>{m&&(f.layers.delete(m),f.layersWithOutsidePointerEventsDisabled.delete(m),A())},[m,f]),c.useEffect(()=>{const e=()=>g({});return document.addEventListener(P,e),()=>document.removeEventListener(P,e)},[]),e.jsx(D.div,{...d,ref:y,style:{pointerEvents:C?x?"auto":"none":void 0,...t.style},onFocusCapture:p(t.onFocusCapture,j.onFocusCapture),onBlurCapture:p(t.onBlurCapture,j.onBlurCapture),onPointerDownCapture:p(t.onPointerDownCapture,R.onPointerDownCapture)})});j.displayName="DismissableLayer";var T=c.forwardRef((t,r)=>{const o=c.useContext(_),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(D.div,{...t,ref:i})});function A(){const e=new CustomEvent(P);document.dispatchEvent(e)}function L(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)}T.displayName="DismissableLayerBranch";var I="focusScope.autoFocusOnMount",k="focusScope.autoFocusOnUnmount",F={bubbles:!1,cancelable:!0},W=c.forwardRef((t,r)=>{const{loop:o=!1,trapped:a=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...u}=t,[l,d]=c.useState(null),f=S(i),p=S(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:z(m.current,{select:!0})},t=function(e){if(h.paused||!l)return;const t=e.relatedTarget;null!==t&&(l.contains(t)||z(m.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&z(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){K.add(h);const e=document.activeElement;if(!l.contains(e)){const t=new CustomEvent(I,F);l.addEventListener(I,f),l.dispatchEvent(t),t.defaultPrevented||(function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(z(r,{select:t}),document.activeElement!==n)return}(function(e){return e.filter(e=>"A"!==e.tagName)}($(l)),{select:!0}),document.activeElement===e&&z(l))}return()=>{l.removeEventListener(I,f),setTimeout(()=>{const t=new CustomEvent(k,F);l.addEventListener(k,p),l.dispatchEvent(t),t.defaultPrevented||z(e??document.body,{select:!0}),l.removeEventListener(k,p),K.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=$(e),n=B(t,e),r=B(t.reverse(),e);return[n,r]}(t);r&&a?e.shiftKey||n!==a?e.shiftKey&&n===r&&(e.preventDefault(),o&&z(a,{select:!0})):(e.preventDefault(),o&&z(r,{select:!0})):n===t&&e.preventDefault()}},[o,a,h.paused]);return e.jsx(D.div,{tabIndex:-1,...u,ref:v,onKeyDown:g})});function $(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 B(e,t){for(const n of e)if(!U(n,{upTo:t}))return n}function U(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 z(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()}}W.displayName="FocusScope";var K=function(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=V(e,t),e.unshift(t)},remove(t){e=V(e,t),e[0]?.resume()}}}();function V(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}var X=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(D.div,{...o,ref:n}),s):null});X.displayName="Portal";var Y=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=Z(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=Z(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=Z(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=Z(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 Z(e){return e?.animationName||"none"}Y.displayName="Presence";var H=0;function G(){c.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??J()),document.body.insertAdjacentElement("beforeend",e[1]??J()),H++,()=>{1===H&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),H--}},[])}function J(){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 Q="right-scroll-bar-position",ee="width-before-scroll-bar";function te(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var ne=typeof window<"u"?c.useLayoutEffect:c.useEffect,re=new WeakMap;function oe(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 te(e,t)})});return ne(function(){var t=re.get(n);if(t){var r=new Set(t),o=new Set(e),a=n.current;r.forEach(function(e){o.has(e)||te(e,null)}),o.forEach(function(e){r.has(e)||te(e,a)})}re.set(n,e)},[e]),n}function ae(e){return e}var ce=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))};ce.isSideCarExport=!0;var ie=function(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=ae);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}(),se=function(){},ue=c.forwardRef(function(e,t){var n=c.useRef(null),r=c.useState({onScrollCapture:se,onWheelCapture:se,onTouchMoveCapture:se}),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,E=e.allowPinchZoom,b=e.as,w=void 0===b?"div":b,N=e.gapMode,C=d(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),x=v,R=oe([n,t]),D=l(l({},C),o);return c.createElement(c.Fragment,null,p&&c.createElement(x,{sideCar:ie,removeScrollBar:f,shards:m,noRelative:h,noIsolation:g,inert:y,setCallbacks:a,allowPinchZoom:!!E,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))});ue.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},ue.classNames={fullWidth:ee,zeroRight:Q};function le(){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 de=function(){var e=0,t=null;return{add:function(n){0==e&&(t=le())&&(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)}}},fe=function(){var e=function(){var e=de();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}},pe={left:0,top:0,right:0,gap:0},me=function(e){return parseInt(e||"",10)||0},ve=function(e){if(void 0===e&&(e="margin"),typeof window>"u")return pe;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[me(n),me(r),me(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])}},he=fe(),ge="data-scroll-locked",ye=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(ge,"] {\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(Q," {\n right: ").concat(i,"px ").concat(r,";\n }\n \n .").concat(ee," {\n margin-right: ").concat(i,"px ").concat(r,";\n }\n \n .").concat(Q," .").concat(Q," {\n right: 0 ").concat(r,";\n }\n \n .").concat(ee," .").concat(ee," {\n margin-right: 0 ").concat(r,";\n }\n \n body[").concat(ge,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(i,"px;\n }\n")},Ee=function(){var e=parseInt(document.body.getAttribute(ge)||"0",10);return isFinite(e)?e:0},be=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(ge,(Ee()+1).toString()),function(){var e=Ee()-1;e<=0?document.body.removeAttribute(ge):document.body.setAttribute(ge,e.toString())}},[]);var a=c.useMemo(function(){return ve(o)},[o]);return c.createElement(he,{styles:ye(a,!t,o,n?"":"!important")})},we=!1;if(typeof window<"u")try{var Ne=Object.defineProperty({},"passive",{get:function(){return we=!0,!0}});window.addEventListener("test",Ne,Ne),window.removeEventListener("test",Ne,Ne)}catch{we=!1}var Ce=!!we&&{passive:!1},xe=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])},Re=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host),De(e,r)){var o=Se(e,r);if(o[1]>o[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},De=function(e,t){return"v"===e?function(e){return xe(e,"overflowY")}(t):function(e){return xe(e,"overflowX")}(t)},Se=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)},Oe=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Pe=function(e){return[e.deltaX,e.deltaY]},qe=function(e){return e&&"current"in e?e.current:e},Me=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},_e=0,je=[];function Te(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Ae=(Le=function(e){var t=c.useRef([]),n=c.useRef([0,0]),r=c.useRef(),o=c.useState(_e++)[0],a=c.useState(fe)[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(qe),!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=Oe(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=Re(d,l);if(!f)return!0;if(f?o=d:(o="v"===d?"h":"v",f=Re(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=Se(e,c),p=f[0],m=f[1]-f[2]-o*p;(p||m)&&De(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(je.length&&je[je.length-1]===a){var r="deltaY"in n?Pe(n):Oe(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(qe).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:Te(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=Oe(e),r.current=void 0},[]),p=c.useCallback(function(t){l(t.type,Pe(t),t.target,s(t,e.lockRef.current))},[]),m=c.useCallback(function(t){l(t.type,Oe(t),t.target,s(t,e.lockRef.current))},[]);c.useEffect(function(){return je.push(a),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:m}),document.addEventListener("wheel",u,Ce),document.addEventListener("touchmove",u,Ce),document.addEventListener("touchstart",d,Ce),function(){je=je.filter(function(e){return e!==a}),document.removeEventListener("wheel",u,Ce),document.removeEventListener("touchmove",u,Ce),document.removeEventListener("touchstart",d,Ce)}},[]);var v=e.removeScrollBar,h=e.inert;return c.createElement(c.Fragment,null,h?c.createElement(a,{styles:Me(o)}):null,v?c.createElement(be,{noRelative:e.noRelative,gapMode:e.gapMode}):null)},ie.useMedium(Le),ce);var Le,Ie=c.forwardRef(function(e,t){return c.createElement(ue,l({},e,{ref:t,sideCar:Ae}))});Ie.classNames=ue.classNames;var ke=new WeakMap,Fe=new WeakMap,We={},$e=0,Be=function(e){return e&&(e.host||Be(e.parentNode))},Ue=function(e,t,n,r){var o=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Be(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]);We[n]||(We[n]=new WeakMap);var a=We[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=(ke.get(e)||0)+1,u=(a.get(e)||0)+1;ke.set(e,s),a.set(e,u),c.push(e),1===s&&o&&Fe.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(),$e++,function(){c.forEach(function(e){var t=ke.get(e)-1,o=a.get(e)-1;ke.set(e,t),a.set(e,o),t||(Fe.has(e)||e.removeAttribute(r),Fe.delete(e)),o||e.removeAttribute(n)}),--$e||(ke=new WeakMap,ke=new WeakMap,Fe=new WeakMap,We={})}},ze=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"))),Ue(r,o,n,"aria-hidden")):function(){return null}};function Ke(t){const n=Ve(t),r=c.forwardRef((t,r)=>{const{children:o,...a}=t,i=c.Children.toArray(o),s=i.find(Ye);if(s){const t=s.props.children,o=i.map(e=>e===s?c.Children.count(t)>1?c.Children.only(null):c.isValidElement(t)?t.props.children:null:e);return e.jsx(n,{...a,ref:r,children:c.isValidElement(t)?c.cloneElement(t,void 0,o):null})}return e.jsx(n,{...a,ref:r,children:o})});return r.displayName=`${t}.Slot`,r}function Ve(e){const n=c.forwardRef((e,n)=>{const{children:r,...o}=e;if(c.isValidElement(r)){const e=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)}(r),a=function(e,t){const n={...t};for(const r in t){const o=e[r],a=t[r];/^on[A-Z]/.test(r)?o&&a?n[r]=(...e)=>{const t=a(...e);return o(...e),t}:o&&(n[r]=o):"style"===r?n[r]={...o,...a}:"className"===r&&(n[r]=[o,a].filter(Boolean).join(" "))}return{...e,...n}}(o,r.props);return r.type!==c.Fragment&&(a.ref=n?t(n,e):e),c.cloneElement(r,a)}return c.Children.count(r)>1?c.Children.only(null):null});return n.displayName=`${e}.SlotClone`,n}var Xe=Symbol("radix.slottable");function Ye(e){return c.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===Xe}var Ze="Dialog",[He]=m(Ze),[Ge,Je]=He(Ze),Qe=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:Ze});return e.jsx(Ge,{scope:n,triggerRef:u,contentRef:l,contentId:E(),titleId:E(),descriptionId:E(),open:d,onOpenChange:f,onOpenToggle:c.useCallback(()=>f(e=>!e),[f]),modal:s,children:r})};Qe.displayName=Ze;var et="DialogTrigger",tt=c.forwardRef((t,r)=>{const{__scopeDialog:o,...a}=t,c=Je(et,o),i=n(r,c.triggerRef);return e.jsx(D.button,{type:"button","aria-haspopup":"dialog","aria-expanded":c.open,"aria-controls":c.contentId,"data-state":wt(c.open),...a,ref:i,onClick:p(t.onClick,c.onOpenToggle)})});tt.displayName=et;var nt="DialogPortal",[rt,ot]=He(nt,{forceMount:void 0}),at=t=>{const{__scopeDialog:n,forceMount:r,children:o,container:a}=t,i=Je(nt,n);return e.jsx(rt,{scope:n,forceMount:r,children:c.Children.map(o,t=>e.jsx(Y,{present:r||i.open,children:e.jsx(X,{asChild:!0,container:a,children:t})}))})};at.displayName=nt;var ct="DialogOverlay",it=c.forwardRef((t,n)=>{const r=ot(ct,t.__scopeDialog),{forceMount:o=r.forceMount,...a}=t,c=Je(ct,t.__scopeDialog);return c.modal?e.jsx(Y,{present:o||c.open,children:e.jsx(ut,{...a,ref:n})}):null});it.displayName=ct;var st=Ke("DialogOverlay.RemoveScroll"),ut=c.forwardRef((t,n)=>{const{__scopeDialog:r,...o}=t,a=Je(ct,r);return e.jsx(Ie,{as:st,allowPinchZoom:!0,shards:[a.contentRef],children:e.jsx(D.div,{"data-state":wt(a.open),...o,ref:n,style:{pointerEvents:"auto",...o.style}})})}),lt="DialogContent",dt=c.forwardRef((t,n)=>{const r=ot(lt,t.__scopeDialog),{forceMount:o=r.forceMount,...a}=t,c=Je(lt,t.__scopeDialog);return e.jsx(Y,{present:o||c.open,children:c.modal?e.jsx(ft,{...a,ref:n}):e.jsx(pt,{...a,ref:n})})});dt.displayName=lt;var ft=c.forwardRef((t,r)=>{const o=Je(lt,t.__scopeDialog),a=c.useRef(null),i=n(r,o.contentRef,a);return c.useEffect(()=>{const e=a.current;if(e)return ze(e)},[]),e.jsx(mt,{...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())})}),pt=c.forwardRef((t,n)=>{const r=Je(lt,t.__scopeDialog),o=c.useRef(!1),a=c.useRef(!1);return e.jsx(mt,{...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()}})}),mt=c.forwardRef((t,r)=>{const{__scopeDialog:o,trapFocus:a,onOpenAutoFocus:i,onCloseAutoFocus:s,...u}=t,l=Je(lt,o),d=c.useRef(null),f=n(r,d);return G(),e.jsxs(e.Fragment,{children:[e.jsx(W,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:i,onUnmountAutoFocus:s,children:e.jsx(j,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":wt(l.open),...u,ref:f,onDismiss:()=>l.onOpenChange(!1)})}),e.jsxs(e.Fragment,{children:[e.jsx(Rt,{titleId:l.titleId}),e.jsx(Dt,{contentRef:d,descriptionId:l.descriptionId})]})]})}),vt="DialogTitle",ht=c.forwardRef((t,n)=>{const{__scopeDialog:r,...o}=t,a=Je(vt,r);return e.jsx(D.h2,{id:a.titleId,...o,ref:n})});ht.displayName=vt;var gt="DialogDescription",yt=c.forwardRef((t,n)=>{const{__scopeDialog:r,...o}=t,a=Je(gt,r);return e.jsx(D.p,{id:a.descriptionId,...o,ref:n})});yt.displayName=gt;var Et="DialogClose",bt=c.forwardRef((t,n)=>{const{__scopeDialog:r,...o}=t,a=Je(Et,r);return e.jsx(D.button,{type:"button",...o,ref:n,onClick:p(t.onClick,()=>a.onOpenChange(!1))})});function wt(e){return e?"open":"closed"}bt.displayName=Et;var Nt="DialogTitleWarning",[Ct,xt]=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}\``)}]}(Nt,{contentName:lt,titleName:vt,docsSlug:"dialog"}),Rt=({titleId:e})=>{const t=xt(Nt),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},Dt=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${xt("DialogDescriptionWarning").contentName}}.`;return c.useEffect(()=>{const r=e.current?.getAttribute("aria-describedby");t&&r&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},St=it,Ot=dt,Pt=ht,qt=yt,Mt=bt;const _t=Qe,jt=at,Tt=c.forwardRef(({className:t,...n},r)=>e.jsx(St,{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})),At=c.forwardRef(({className:t,children:n,...c},i)=>{const{organization:s,props:{fontClassName:u,textClassName:l}}=r();return e.jsxs(jt,{children:[e.jsx(Tt,{}),e.jsxs(Ot,{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(Mt,{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"})})]})]})}),Lt=({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}),It=c.forwardRef(({className:t,...n},r)=>e.jsx(Pt,{ref:r,className:a("qc:text-foreground qc:text-center qc:text-lg qc:font-semibold",t),...n})),kt=c.forwardRef(({className:t,...n},r)=>e.jsx(qt,{ref:r,className:a("qc:text-muted qc:text-center qc:text-sm",t),...n}));export{_t as D,W as F,D as P,Ie as R,At as a,Lt as b,It as c,kt as d,m as e,S as f,Y as g,X as h,ze as i,p as j,G as k,j as l,w as m,E as n,h as u};