@buildbase/sdk 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,23 +1,23 @@
1
- "use strict";var e=require("react/jsx-runtime"),t=require("react"),r=require("react-dom");function n(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}}),t.default=e,Object.freeze(t)}var a=n(t),o=n(r);const s=()=>({type:"AUTHENTICATION_STARTED"}),i=()=>({type:"AUTHENTICATION_FAILED"}),l=e=>({type:"SET_SESSION",payload:e}),c=()=>({type:"REMOVE_SESSION"});function u({name:r,initialState:n,reducer:a,initializer:o}){const s=t.createContext(null),i=t.createContext(null),l=t.createContext(null),c=t.memo(({children:r})=>{const[c,u]=t.useReducer(a,n,o||(e=>e)),d=t.useMemo(()=>({state:c,dispatch:u}),[c,u]);return e.jsx(l.Provider,{value:d,children:e.jsx(s.Provider,{value:c,children:e.jsx(i.Provider,{value:u,children:r})})})});c.displayName=`${r}Provider`;const u=()=>{const e=t.useContext(s);if(null===e)throw new Error(`use${r}State must be used within a ${r}Provider. Make sure SaaSOSProvider is wrapping your application.`);return e};return{Provider:c,useContext:()=>{const e=t.useContext(l);if(!e)throw new Error(`use${r}Context must be used within a ${r}Provider. Make sure SaaSOSProvider is wrapping your application.`);return e},useState:u,useDispatch:()=>{const e=t.useContext(i);if(null===e)throw new Error(`use${r}Dispatch must be used within a ${r}Provider. Make sure SaaSOSProvider is wrapping your application.`);return e},useSelector:(e,r)=>{const n=u(),a=e||(e=>e),o=t.useRef(a),s=t.useRef(r),i=t.useRef(void 0),l=t.useRef(n);e&&(o.current=a),r&&(s.current=r);return t.useMemo(()=>{const e=o.current(n);if(void 0!==i.current){if((s.current?s.current(i.current,e):Object.is(i.current,e))&&l.current===n)return i.current}return i.current=e,l.current=n,e},[n])}}}var d;function f(e){if("undefined"==typeof window)return null;try{return localStorage.getItem(e)}catch(t){return console.warn(`Failed to load ${e} from localStorage:`,t),null}}function m(e,t){if("undefined"!=typeof window)try{localStorage.setItem(e,t)}catch(t){console.warn(`Failed to save ${e} to localStorage:`,t)}}function p(e){if("undefined"!=typeof window)try{localStorage.removeItem(e)}catch(t){console.warn(`Failed to remove ${e} from localStorage:`,t)}}!function(e){e.loading="loading",e.authenticated="authenticated",e.unauthenticated="unauthenticated",e.authenticating="authenticating"}(d||(d={}));const h="saas_os_auth_token";function g(e){!function(e,t){try{m(e,JSON.stringify(t))}catch(t){console.warn(`Failed to save ${e} to localStorage:`,t)}}(h,e)}const v=()=>({user:null,session:null,isLoading:!1,isAuthenticated:!1,isRedirecting:!1,status:d.unauthenticated}),{Provider:b,useState:y,useDispatch:w}=u({name:"Auth",initialState:v(),reducer:(e,t)=>{switch(t.type){case"AUTHENTICATION_STARTED":return{...e,isLoading:!0,isAuthenticated:!1,isRedirecting:!0,status:d.authenticating};case"AUTHENTICATION_FAILED":return{...e,isLoading:!1,isAuthenticated:!1,isRedirecting:!1,status:d.unauthenticated};case"SET_SESSION":{const r=t.payload;return g(r),{...e,session:r,user:r.user,isAuthenticated:!0,isRedirecting:!1,isLoading:!1,status:d.authenticated}}case"REMOVE_SESSION":return p(h),{...e,user:null,session:null,isLoading:!1,isAuthenticated:!1,isRedirecting:!1,status:d.unauthenticated};default:return e}},initializer:v}),x=b,S=y,k=w,A=e=>({type:"SET_SAAS_OS_CONFIG",payload:e}),{Provider:E,useState:C,useDispatch:T}=u({name:"OS",initialState:{serverUrl:"",version:"",orgId:""},reducer:(e,t)=>{switch(t.type){case"SET_SAAS_OS_CONFIG":return{...e,...t.payload};case"REMOVE_SAAS_OS_CONFIG":return{serverUrl:"",version:"",orgId:""};default:return e}}}),j=E,_=C,N=T,R=e=>({type:"SET_WORKSPACES",payload:e}),P=e=>({type:"SET_ALL_FEATURES",payload:e}),O=e=>({type:"SET_CURRENT_WORKSPACE",payload:e}),D=()=>({type:"RESET_CURRENT_WORKSPACE"}),I=e=>({type:"SET_IS_INITIALIZED",payload:e}),M=e=>({type:"SET_LOADING",payload:e}),L=e=>({type:"SET_ERROR",payload:e}),U=e=>({type:"SET_REFRESHING",payload:e}),z="saas-workspace-current";const{Provider:F,useState:B,useDispatch:V}=u({name:"Workspace",initialState:{workspaces:[],loading:!1,error:null,currentWorkspace:null,refreshing:!1,switching:!1,isInitialized:!1,allFeatures:[]},reducer:(e,t)=>{switch(t.type){case"SET_WORKSPACES":return{...e,workspaces:t.payload};case"SET_ALL_FEATURES":return{...e,allFeatures:t.payload};case"SET_CURRENT_WORKSPACE":return(r=t.payload._id)?m(z,r):p(z),{...e,currentWorkspace:t.payload};case"RESET_CURRENT_WORKSPACE":return p(z),{...e,currentWorkspace:null};case"SET_IS_INITIALIZED":return{...e,isInitialized:t.payload};case"SET_LOADING":return{...e,loading:t.payload};case"SET_ERROR":return{...e,error:t.payload};case"SET_REFRESHING":return{...e,refreshing:t.payload};case"SET_SWITCHING":return{...e,switching:t.payload};default:return e}var r}}),$=F,W=B,G=V,K=t.memo(({children:t})=>e.jsx(j,{children:e.jsx(x,{children:e.jsx($,{children:t})})}));function H(e,r){const n=_(),a=S(),o=W(),s=t.useMemo(()=>({os:n,auth:a,workspaces:o}),[n,a,o]),i=e||(e=>e),l=t.useRef(i),c=t.useRef(r),u=t.useRef(void 0),d=t.useRef(s);e&&(l.current=i);return t.useMemo(()=>{const e=l.current(s);if(void 0!==u.current){if((c.current?c.current(u.current,e):Object.is(u.current,e))&&d.current===s)return u.current}return u.current=e,d.current=s,e},[s])}function Z(){const e=k(),r=N(),n=G();return t.useMemo(()=>({auth:e,os:r,workspaces:n}),[e,r,n])}K.displayName="SDKContextProvider";class q extends Error{}function J(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return function(e){return decodeURIComponent(atob(e).replace(/(.)/g,(e,t)=>{let r=t.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r}))}(t)}catch(e){return atob(t)}}q.prototype.name="InvalidTokenError";const Y="token";const X=t.memo(({children:r,callbacks:n})=>{const a=Z(),o=H(e=>e.auth),s=H(e=>e.os.serverUrl),c=t.useMemo(()=>n,[n]),u=t.useCallback(async e=>{try{const t=function(e,t){if("string"!=typeof e)throw new q("Invalid token specified: must be a string");t||(t={});const r=!0===t.header?0:1,n=e.split(".")[r];if("string"!=typeof n)throw new q(`Invalid token specified: missing part #${r+1}`);let a;try{a=J(n)}catch(e){throw new q(`Invalid token specified: invalid base64 for part #${r+1} (${e.message})`)}try{return JSON.parse(a)}catch(e){throw new q(`Invalid token specified: invalid json for part #${r+1} (${e.message})`)}}(e),r=function(e,t,r=24){return{user:e,accessToken:t,expires:new Date(Date.now()+60*r*60*1e3).toISOString()}}(t,e,24);if(a.auth(l(r)),c?.verifyToken){if(!await c.verifyToken(e))return void a.auth(i());c?.handleAuthentication&&await c.handleAuthentication(e)}!function(){try{const e=new URL(window.location.href);e.searchParams.delete(Y),window.history.replaceState({},"",e.toString())}catch(e){console.error("Error removing token from URL:",e)}}()}catch(e){throw console.error("Auth redirect error:",e),a.auth(i()),e}},[s,a,c]);return t.useEffect(()=>{if("undefined"!=typeof window&&!o.isAuthenticated)try{const e=function(e){const t=f(e);if(!t)return null;try{return JSON.parse(t)}catch(t){return console.warn(`Failed to parse ${e} from localStorage:`,t),p(e),null}}(h);e&&new Date(e.expires)>new Date&&a.auth(l(e))}catch(e){console.error("Failed to hydrate session from localStorage:",e)}},[]),t.useEffect(()=>{const e=function(){try{return new URL(window.location.href).searchParams.get(Y)}catch(e){return null}}();e&&u(e).catch(e=>{console.error("Failed to handle auth redirect:",e)})},[u]),e.jsx(e.Fragment,{children:r})});X.displayName="AuthProviderWrapper";const Q=t.memo(({config:r,auth:n,children:a})=>{const o=Z(),s=t.useMemo(()=>({clientId:n?.clientId||"",redirectUrl:n?.redirectUrl||""}),[n?.clientId,n?.redirectUrl]);t.useEffect(()=>{o.os(A({...r,auth:s}))},[r,s,o]);const i=t.useMemo(()=>a,[a]);return e.jsx(e.Fragment,{children:i})});Q.displayName="ContextConfigProvider";const ee=t.createContext({container:null,setContainer:()=>{}}),te=t.memo(({children:r})=>{const[n,a]=t.useState(null),o=t.useMemo(()=>({container:n,setContainer:a}),[n]),s=t.useMemo(()=>r,[r]);return e.jsxs(ee.Provider,{value:o,children:[s,e.jsx("div",{ref:a,id:"saas-os-portal",className:"saas-os-ui",style:{width:"100%",height:"100%"}})]})});te.displayName="PortalProvider";const re=t.memo(({serverUrl:r,version:n,orgId:a,auth:o,children:s})=>{const i=t.useMemo(()=>({serverUrl:r,version:n,orgId:a}),[r,n,a]),l=t.useMemo(()=>o?.callbacks,[o?.callbacks]);return e.jsx(K,{children:e.jsx(X,{callbacks:l,children:e.jsx(te,{children:e.jsx(Q,{config:i,auth:o,children:s})})})})});re.displayName="SaaSOSProvider";var ne=e=>"checkbox"===e.type,ae=e=>e instanceof Date,oe=e=>null==e;const se=e=>"object"==typeof e;var ie=e=>!oe(e)&&!Array.isArray(e)&&se(e)&&!ae(e),le=e=>ie(e)&&e.target?ne(e.target)?e.target.checked:e.target.value:e,ce=(e,t)=>e.has((e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e)(t)),ue="undefined"!=typeof window&&void 0!==window.HTMLElement&&"undefined"!=typeof document;function de(e){let t;const r=Array.isArray(e),n="undefined"!=typeof FileList&&e instanceof FileList;if(e instanceof Date)t=new Date(e);else{if(ue&&(e instanceof Blob||n)||!r&&!ie(e))return e;if(t=r?[]:Object.create(Object.getPrototypeOf(e)),r||(e=>{const t=e.constructor&&e.constructor.prototype;return ie(t)&&t.hasOwnProperty("isPrototypeOf")})(e))for(const r in e)e.hasOwnProperty(r)&&(t[r]=de(e[r]));else t=e}return t}var fe=e=>/^\w*$/.test(e),me=e=>void 0===e,pe=e=>Array.isArray(e)?e.filter(Boolean):[],he=e=>pe(e.replace(/["|']|\]/g,"").split(/\.|\[/)),ge=(e,t,r)=>{if(!t||!ie(e))return r;const n=(fe(t)?[t]:he(t)).reduce((e,t)=>oe(e)?e:e[t],e);return me(n)||n===e?me(e[t])?r:e[t]:n},ve=e=>"boolean"==typeof e,be=(e,t,r)=>{let n=-1;const a=fe(t)?[t]:he(t),o=a.length,s=o-1;for(;++n<o;){const t=a[n];let o=r;if(n!==s){const r=e[t];o=ie(r)||Array.isArray(r)?r:isNaN(+a[n+1])?{}:[]}if("__proto__"===t||"constructor"===t||"prototype"===t)return;e[t]=o,e=e[t]}};const ye="blur",we="focusout",xe="change",Se="onBlur",ke="onChange",Ae="onSubmit",Ee="onTouched",Ce="all",Te="max",je="min",_e="maxLength",Ne="minLength",Re="pattern",Pe="required",Oe="validate",De=t.createContext(null);De.displayName="HookFormContext";const Ie=()=>t.useContext(De),Me=e=>{const{children:r,...n}=e;return t.createElement(De.Provider,{value:n},r)};var Le=(e,t,r,n=!0)=>{const a={defaultValues:t._defaultValues};for(const o in e)Object.defineProperty(a,o,{get:()=>{const a=o;return t._proxyFormState[a]!==Ce&&(t._proxyFormState[a]=!n||Ce),r&&(r[a]=!0),e[a]}});return a};const Ue="undefined"!=typeof window?t.useLayoutEffect:t.useEffect;var ze=e=>"string"==typeof e,Fe=(e,t,r,n,a)=>ze(e)?(n&&t.watch.add(e),ge(r,e,a)):Array.isArray(e)?e.map(e=>(n&&t.watch.add(e),ge(r,e))):(n&&(t.watchAll=!0),r),Be=e=>oe(e)||!se(e);function Ve(e,t,r=new WeakSet){if(Be(e)||Be(t))return e===t;if(ae(e)&&ae(t))return e.getTime()===t.getTime();const n=Object.keys(e),a=Object.keys(t);if(n.length!==a.length)return!1;if(r.has(e)||r.has(t))return!0;r.add(e),r.add(t);for(const o of n){const n=e[o];if(!a.includes(o))return!1;if("ref"!==o){const e=t[o];if(ae(n)&&ae(e)||ie(n)&&ie(e)||Array.isArray(n)&&Array.isArray(e)?!Ve(n,e,r):n!==e)return!1}}return!0}function $e(e){const r=Ie(),{name:n,disabled:a,control:o=r.control,shouldUnregister:s,defaultValue:i}=e,l=ce(o._names.array,n),c=t.useMemo(()=>ge(o._formValues,n,ge(o._defaultValues,n,i)),[o,n,i]),u=function(e){const r=Ie(),{control:n=r.control,name:a,defaultValue:o,disabled:s,exact:i,compute:l}=e||{},c=t.useRef(o),u=t.useRef(l),d=t.useRef(void 0);u.current=l;const f=t.useMemo(()=>n._getWatch(a,c.current),[n,a]),[m,p]=t.useState(u.current?u.current(f):f);return Ue(()=>n._subscribe({name:a,formState:{values:!0},exact:i,callback:e=>{if(!s){const t=Fe(a,n._names,e.values||n._formValues,!1,c.current);if(u.current){const e=u.current(t);Ve(e,d.current)||(p(e),d.current=e)}else p(t)}}}),[n,s,a,i]),t.useEffect(()=>n._removeUnmounted()),m}({control:o,name:n,defaultValue:c,exact:!0}),d=function(e){const r=Ie(),{control:n=r.control,disabled:a,name:o,exact:s}=e||{},[i,l]=t.useState(n._formState),c=t.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return Ue(()=>n._subscribe({name:o,formState:c.current,exact:s,callback:e=>{!a&&l({...n._formState,...e})}}),[o,a,s]),t.useEffect(()=>{c.current.isValid&&n._setValid(!0)},[n]),t.useMemo(()=>Le(i,n,c.current,!1),[i,n])}({control:o,name:n,exact:!0}),f=t.useRef(e),m=t.useRef(o.register(n,{...e.rules,value:u,...ve(e.disabled)?{disabled:e.disabled}:{}}));f.current=e;const p=t.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!ge(d.errors,n)},isDirty:{enumerable:!0,get:()=>!!ge(d.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!ge(d.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!ge(d.validatingFields,n)},error:{enumerable:!0,get:()=>ge(d.errors,n)}}),[d,n]),h=t.useCallback(e=>m.current.onChange({target:{value:le(e),name:n},type:xe}),[n]),g=t.useCallback(()=>m.current.onBlur({target:{value:ge(o._formValues,n),name:n},type:ye}),[n,o._formValues]),v=t.useCallback(e=>{const t=ge(o._fields,n);t&&e&&(t._f.ref={focus:()=>e.focus&&e.focus(),select:()=>e.select&&e.select(),setCustomValidity:t=>e.setCustomValidity(t),reportValidity:()=>e.reportValidity()})},[o._fields,n]),b=t.useMemo(()=>({name:n,value:u,...ve(a)||d.disabled?{disabled:d.disabled||a}:{},onChange:h,onBlur:g,ref:v}),[n,a,d.disabled,h,g,v,u]);return t.useEffect(()=>{const e=o._options.shouldUnregister||s;o.register(n,{...f.current.rules,...ve(f.current.disabled)?{disabled:f.current.disabled}:{}});const t=(e,t)=>{const r=ge(o._fields,e);r&&r._f&&(r._f.mount=t)};if(t(n,!0),e){const e=de(ge(o._options.defaultValues,n));be(o._defaultValues,n,e),me(ge(o._formValues,n))&&be(o._formValues,n,e)}return!l&&o.register(n),()=>{(l?e&&!o._state.action:e)?o.unregister(n):t(n,!1)}},[n,o,l,s]),t.useEffect(()=>{o._setDisabledField({disabled:a,name:n})},[a,n,o]),t.useMemo(()=>({field:b,formState:d,fieldState:p}),[b,d,p])}const We=e=>e.render($e(e));var Ge=(e,t,r,n,a)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:a||!0}}:{},Ke=e=>Array.isArray(e)?e:[e],He=()=>{let e=[];return{get observers(){return e},next:t=>{for(const r of e)r.next&&r.next(t)},subscribe:t=>(e.push(t),{unsubscribe:()=>{e=e.filter(e=>e!==t)}}),unsubscribe:()=>{e=[]}}},Ze=e=>ie(e)&&!Object.keys(e).length,qe=e=>"file"===e.type,Je=e=>"function"==typeof e,Ye=e=>{if(!ue)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Xe=e=>"select-multiple"===e.type,Qe=e=>"radio"===e.type,et=e=>Ye(e)&&e.isConnected;function tt(e,t){const r=Array.isArray(t)?t:fe(t)?[t]:he(t),n=1===r.length?e:function(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;)e=me(e)?n++:e[t[n++]];return e}(e,r),a=r.length-1,o=r[a];return n&&delete n[o],0!==a&&(ie(n)&&Ze(n)||Array.isArray(n)&&function(e){for(const t in e)if(e.hasOwnProperty(t)&&!me(e[t]))return!1;return!0}(n))&&tt(e,r.slice(0,-1)),e}var rt=e=>{for(const t in e)if(Je(e[t]))return!0;return!1};function nt(e,t={}){const r=Array.isArray(e);if(ie(e)||r)for(const r in e)Array.isArray(e[r])||ie(e[r])&&!rt(e[r])?(t[r]=Array.isArray(e[r])?[]:{},nt(e[r],t[r])):oe(e[r])||(t[r]=!0);return t}function at(e,t,r){const n=Array.isArray(e);if(ie(e)||n)for(const n in e)Array.isArray(e[n])||ie(e[n])&&!rt(e[n])?me(t)||Be(r[n])?r[n]=Array.isArray(e[n])?nt(e[n],[]):{...nt(e[n])}:at(e[n],oe(t)?{}:t[n],r[n]):r[n]=!Ve(e[n],t[n]);return r}var ot=(e,t)=>at(e,t,nt(t));const st={value:!1,isValid:!1},it={value:!0,isValid:!0};var lt=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(e=>e&&e.checked&&!e.disabled).map(e=>e.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!me(e[0].attributes.value)?me(e[0].value)||""===e[0].value?it:{value:e[0].value,isValid:!0}:it:st}return st},ct=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>me(e)?e:t?""===e?NaN:e?+e:e:r&&ze(e)?new Date(e):n?n(e):e;const ut={isValid:!1,value:null};var dt=e=>Array.isArray(e)?e.reduce((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e,ut):ut;function ft(e){const t=e.ref;return qe(t)?t.files:Qe(t)?dt(e.refs).value:Xe(t)?[...t.selectedOptions].map(({value:e})=>e):ne(t)?lt(e.refs).value:ct(me(t.value)?e.ref.value:t.value,e)}var mt=e=>e instanceof RegExp,pt=e=>me(e)?e:mt(e)?e.source:ie(e)?mt(e.value)?e.value.source:e.value:e,ht=e=>({isOnSubmit:!e||e===Ae,isOnBlur:e===Se,isOnChange:e===ke,isOnAll:e===Ce,isOnTouch:e===Ee});const gt="AsyncFunction";var vt=e=>!!e&&!!e.validate&&!!(Je(e.validate)&&e.validate.constructor.name===gt||ie(e.validate)&&Object.values(e.validate).find(e=>e.constructor.name===gt)),bt=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(t=>e.startsWith(t)&&/^\.\w+/.test(e.slice(t.length))));const yt=(e,t,r,n)=>{for(const a of r||Object.keys(e)){const r=ge(e,a);if(r){const{_f:e,...o}=r;if(e){if(e.refs&&e.refs[0]&&t(e.refs[0],a)&&!n)return!0;if(e.ref&&t(e.ref,e.name)&&!n)return!0;if(yt(o,t))break}else if(ie(o)&&yt(o,t))break}}};function wt(e,t,r){const n=ge(e,r);if(n||fe(r))return{error:n,name:r};const a=r.split(".");for(;a.length;){const n=a.join("."),o=ge(t,n),s=ge(e,n);if(o&&!Array.isArray(o)&&r!==n)return{name:r};if(s&&s.type)return{name:n,error:s};if(s&&s.root&&s.root.type)return{name:`${n}.root`,error:s.root};a.pop()}return{name:r}}var xt=(e,t,r)=>{const n=Ke(ge(e,r));return be(n,"root",t[r]),be(e,r,n),e},St=e=>ze(e);function kt(e,t,r="validate"){if(St(e)||Array.isArray(e)&&e.every(St)||ve(e)&&!e)return{type:r,message:St(e)?e:"",ref:t}}var At=e=>ie(e)&&!mt(e)?e:{value:e,message:""},Et=async(e,t,r,n,a,o)=>{const{ref:s,refs:i,required:l,maxLength:c,minLength:u,min:d,max:f,pattern:m,validate:p,name:h,valueAsNumber:g,mount:v}=e._f,b=ge(r,h);if(!v||t.has(h))return{};const y=i?i[0]:s,w=e=>{a&&y.reportValidity&&(y.setCustomValidity(ve(e)?"":e||""),y.reportValidity())},x={},S=Qe(s),k=ne(s),A=S||k,E=(g||qe(s))&&me(s.value)&&me(b)||Ye(s)&&""===s.value||""===b||Array.isArray(b)&&!b.length,C=Ge.bind(null,h,n,x),T=(e,t,r,n=_e,a=Ne)=>{const o=e?t:r;x[h]={type:e?n:a,message:o,ref:s,...C(e?n:a,o)}};if(o?!Array.isArray(b)||!b.length:l&&(!A&&(E||oe(b))||ve(b)&&!b||k&&!lt(i).isValid||S&&!dt(i).isValid)){const{value:e,message:t}=St(l)?{value:!!l,message:l}:At(l);if(e&&(x[h]={type:Pe,message:t,ref:y,...C(Pe,t)},!n))return w(t),x}if(!(E||oe(d)&&oe(f))){let e,t;const r=At(f),a=At(d);if(oe(b)||isNaN(b)){const n=s.valueAsDate||new Date(b),o=e=>new Date((new Date).toDateString()+" "+e),i="time"==s.type,l="week"==s.type;ze(r.value)&&b&&(e=i?o(b)>o(r.value):l?b>r.value:n>new Date(r.value)),ze(a.value)&&b&&(t=i?o(b)<o(a.value):l?b<a.value:n<new Date(a.value))}else{const n=s.valueAsNumber||(b?+b:b);oe(r.value)||(e=n>r.value),oe(a.value)||(t=n<a.value)}if((e||t)&&(T(!!e,r.message,a.message,Te,je),!n))return w(x[h].message),x}if((c||u)&&!E&&(ze(b)||o&&Array.isArray(b))){const e=At(c),t=At(u),r=!oe(e.value)&&b.length>+e.value,a=!oe(t.value)&&b.length<+t.value;if((r||a)&&(T(r,e.message,t.message),!n))return w(x[h].message),x}if(m&&!E&&ze(b)){const{value:e,message:t}=At(m);if(mt(e)&&!b.match(e)&&(x[h]={type:Re,message:t,ref:s,...C(Re,t)},!n))return w(t),x}if(p)if(Je(p)){const e=kt(await p(b,r),y);if(e&&(x[h]={...e,...C(Oe,e.message)},!n))return w(e.message),x}else if(ie(p)){let e={};for(const t in p){if(!Ze(e)&&!n)break;const a=kt(await p[t](b,r),y,t);a&&(e={...a,...C(t,a.message)},w(a.message),n&&(x[h]=e))}if(!Ze(e)&&(x[h]={ref:y,...e},!n))return x}return w(!0),x};const Ct={mode:Ae,reValidateMode:ke,shouldFocusError:!0};function Tt(e={}){let t,r={...Ct,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:Je(r.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:r.errors||{},disabled:r.disabled||!1},a={},o=(ie(r.defaultValues)||ie(r.values))&&de(r.defaultValues||r.values)||{},s=r.shouldUnregister?{}:de(o),i={action:!1,mount:!1,watch:!1},l={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},c=0;const u={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let d={...u};const f={array:He(),state:He()},m=r.criteriaMode===Ce,p=async e=>{if(!r.disabled&&(u.isValid||d.isValid||e)){const e=r.resolver?Ze((await y()).errors):await w(a,!0);e!==n.isValid&&f.state.next({isValid:e})}},h=(e,t)=>{!r.disabled&&(u.isValidating||u.validatingFields||d.isValidating||d.validatingFields)&&((e||Array.from(l.mount)).forEach(e=>{e&&(t?be(n.validatingFields,e,t):tt(n.validatingFields,e))}),f.state.next({validatingFields:n.validatingFields,isValidating:!Ze(n.validatingFields)}))},g=(e,t,r,n)=>{const l=ge(a,e);if(l){const a=ge(s,e,me(r)?ge(o,e):r);me(a)||n&&n.defaultChecked||t?be(s,e,t?a:ft(l._f)):k(e,a),i.mount&&p()}},v=(e,t,a,s,i)=>{let l=!1,c=!1;const m={name:e};if(!r.disabled){if(!a||s){(u.isDirty||d.isDirty)&&(c=n.isDirty,n.isDirty=m.isDirty=x(),l=c!==m.isDirty);const r=Ve(ge(o,e),t);c=!!ge(n.dirtyFields,e),r?tt(n.dirtyFields,e):be(n.dirtyFields,e,!0),m.dirtyFields=n.dirtyFields,l=l||(u.dirtyFields||d.dirtyFields)&&c!==!r}if(a){const t=ge(n.touchedFields,e);t||(be(n.touchedFields,e,a),m.touchedFields=n.touchedFields,l=l||(u.touchedFields||d.touchedFields)&&t!==a)}l&&i&&f.state.next(m)}return l?m:{}},b=(e,a,o,s)=>{const i=ge(n.errors,e),l=(u.isValid||d.isValid)&&ve(a)&&n.isValid!==a;var m;if(r.delayError&&o?(m=()=>((e,t)=>{be(n.errors,e,t),f.state.next({errors:n.errors})})(e,o),t=e=>{clearTimeout(c),c=setTimeout(m,e)},t(r.delayError)):(clearTimeout(c),t=null,o?be(n.errors,e,o):tt(n.errors,e)),(o?!Ve(i,o):i)||!Ze(s)||l){const t={...s,...l&&ve(a)?{isValid:a}:{},errors:n.errors,name:e};n={...n,...t},f.state.next(t)}},y=async e=>{h(e,!0);const t=await r.resolver(s,r.context,((e,t,r,n)=>{const a={};for(const r of e){const e=ge(t,r);e&&be(a,r,e._f)}return{criteriaMode:r,names:[...e],fields:a,shouldUseNativeValidation:n}})(e||l.mount,a,r.criteriaMode,r.shouldUseNativeValidation));return h(e),t},w=async(e,t,a={valid:!0})=>{for(const o in e){const i=e[o];if(i){const{_f:e,...c}=i;if(e){const c=l.array.has(e.name),d=i._f&&vt(i._f);d&&u.validatingFields&&h([o],!0);const f=await Et(i,l.disabled,s,m,r.shouldUseNativeValidation&&!t,c);if(d&&u.validatingFields&&h([o]),f[e.name]&&(a.valid=!1,t))break;!t&&(ge(f,e.name)?c?xt(n.errors,f,e.name):be(n.errors,e.name,f[e.name]):tt(n.errors,e.name))}!Ze(c)&&await w(c,t,a)}}return a.valid},x=(e,t)=>!r.disabled&&(e&&t&&be(s,e,t),!Ve(_(),o)),S=(e,t,r)=>Fe(e,l,{...i.mount?s:me(t)?o:ze(e)?{[e]:t}:t},r,t),k=(e,t,r={})=>{const n=ge(a,e);let o=t;if(n){const r=n._f;r&&(!r.disabled&&be(s,e,ct(t,r)),o=Ye(r.ref)&&oe(t)?"":t,Xe(r.ref)?[...r.ref.options].forEach(e=>e.selected=o.includes(e.value)):r.refs?ne(r.ref)?r.refs.forEach(e=>{e.defaultChecked&&e.disabled||(Array.isArray(o)?e.checked=!!o.find(t=>t===e.value):e.checked=o===e.value||!!o)}):r.refs.forEach(e=>e.checked=e.value===o):qe(r.ref)?r.ref.value="":(r.ref.value=o,r.ref.type||f.state.next({name:e,values:de(s)})))}(r.shouldDirty||r.shouldTouch)&&v(e,o,r.shouldTouch,r.shouldDirty,!0),r.shouldValidate&&j(e)},A=(e,t,r)=>{for(const n in t){if(!t.hasOwnProperty(n))return;const o=t[n],s=e+"."+n,i=ge(a,s);(l.array.has(e)||ie(o)||i&&!i._f)&&!ae(o)?A(s,o,r):k(s,o,r)}},E=(e,t,r={})=>{const c=ge(a,e),m=l.array.has(e),p=de(t);be(s,e,p),m?(f.array.next({name:e,values:de(s)}),(u.isDirty||u.dirtyFields||d.isDirty||d.dirtyFields)&&r.shouldDirty&&f.state.next({name:e,dirtyFields:ot(o,s),isDirty:x(e,p)})):!c||c._f||oe(p)?k(e,p,r):A(e,p,r),bt(e,l)&&f.state.next({...n,name:e}),f.state.next({name:i.mount?e:void 0,values:de(s)})},C=async e=>{i.mount=!0;const o=e.target;let c=o.name,g=!0;const x=ge(a,c),S=e=>{g=Number.isNaN(e)||ae(e)&&isNaN(e.getTime())||Ve(e,ge(s,c,e))},k=ht(r.mode),A=ht(r.reValidateMode);if(x){let i,E;const C=o.type?ft(x._f):le(e),T=e.type===ye||e.type===we,_=!(e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate))(x._f)&&!r.resolver&&!ge(n.errors,c)&&!x._f.deps||((e,t,r,n,a)=>!a.isOnAll&&(!r&&a.isOnTouch?!(t||e):(r?n.isOnBlur:a.isOnBlur)?!e:!(r?n.isOnChange:a.isOnChange)||e))(T,ge(n.touchedFields,c),n.isSubmitted,A,k),N=bt(c,l,T);be(s,c,C),T?o&&o.readOnly||(x._f.onBlur&&x._f.onBlur(e),t&&t(0)):x._f.onChange&&x._f.onChange(e);const R=v(c,C,T),P=!Ze(R)||N;if(!T&&f.state.next({name:c,type:e.type,values:de(s)}),_)return(u.isValid||d.isValid)&&("onBlur"===r.mode?T&&p():T||p()),P&&f.state.next({name:c,...N?{}:R});if(!T&&N&&f.state.next({...n}),r.resolver){const{errors:e}=await y([c]);if(S(C),g){const t=wt(n.errors,a,c),r=wt(e,a,t.name||c);i=r.error,c=r.name,E=Ze(e)}}else h([c],!0),i=(await Et(x,l.disabled,s,m,r.shouldUseNativeValidation))[c],h([c]),S(C),g&&(i?E=!1:(u.isValid||d.isValid)&&(E=await w(a,!0)));g&&(x._f.deps&&j(x._f.deps),b(c,E,i,R))}},T=(e,t)=>{if(ge(n.errors,t)&&e.focus)return e.focus(),1},j=async(e,t={})=>{let o,s;const i=Ke(e);if(r.resolver){const t=await(async e=>{const{errors:t}=await y(e);if(e)for(const r of e){const e=ge(t,r);e?be(n.errors,r,e):tt(n.errors,r)}else n.errors=t;return t})(me(e)?e:i);o=Ze(t),s=e?!i.some(e=>ge(t,e)):o}else e?(s=(await Promise.all(i.map(async e=>{const t=ge(a,e);return await w(t&&t._f?{[e]:t}:t)}))).every(Boolean),(s||n.isValid)&&p()):s=o=await w(a);return f.state.next({...!ze(e)||(u.isValid||d.isValid)&&o!==n.isValid?{}:{name:e},...r.resolver||!e?{isValid:o}:{},errors:n.errors}),t.shouldFocus&&!s&&yt(a,T,e?i:l.mount),s},_=e=>{const t={...i.mount?s:o};return me(e)?t:ze(e)?ge(t,e):e.map(e=>ge(t,e))},N=(e,t)=>({invalid:!!ge((t||n).errors,e),isDirty:!!ge((t||n).dirtyFields,e),error:ge((t||n).errors,e),isValidating:!!ge(n.validatingFields,e),isTouched:!!ge((t||n).touchedFields,e)}),R=(e,t,r)=>{const o=(ge(a,e,{_f:{}})._f||{}).ref,s=ge(n.errors,e)||{},{ref:i,message:l,type:c,...u}=s;be(n.errors,e,{...u,...t,ref:o}),f.state.next({name:e,errors:n.errors,isValid:!1}),r&&r.shouldFocus&&o&&o.focus&&o.focus()},P=e=>f.state.subscribe({next:t=>{var r,a,i;r=e.name,a=t.name,i=e.exact,r&&a&&r!==a&&!Ke(r).some(e=>e&&(i?e===a:e.startsWith(a)||a.startsWith(e)))||!((e,t,r,n)=>{r(e);const{name:a,...o}=e;return Ze(o)||Object.keys(o).length>=Object.keys(t).length||Object.keys(o).find(e=>t[e]===(!n||Ce))})(t,e.formState||u,F,e.reRenderRoot)||e.callback({values:{...s},...n,...t,defaultValues:o})}}).unsubscribe,O=(e,t={})=>{for(const i of e?Ke(e):l.mount)l.mount.delete(i),l.array.delete(i),t.keepValue||(tt(a,i),tt(s,i)),!t.keepError&&tt(n.errors,i),!t.keepDirty&&tt(n.dirtyFields,i),!t.keepTouched&&tt(n.touchedFields,i),!t.keepIsValidating&&tt(n.validatingFields,i),!r.shouldUnregister&&!t.keepDefaultValue&&tt(o,i);f.state.next({values:de(s)}),f.state.next({...n,...t.keepDirty?{isDirty:x()}:{}}),!t.keepIsValid&&p()},D=({disabled:e,name:t})=>{(ve(e)&&i.mount||e||l.disabled.has(t))&&(e?l.disabled.add(t):l.disabled.delete(t))},I=(e,t={})=>{let n=ge(a,e);const s=ve(t.disabled)||ve(r.disabled);return be(a,e,{...n||{},_f:{...n&&n._f?n._f:{ref:{name:e}},name:e,mount:!0,...t}}),l.mount.add(e),n?D({disabled:ve(t.disabled)?t.disabled:r.disabled,name:e}):g(e,!0,t.value),{...s?{disabled:t.disabled||r.disabled}:{},...r.progressive?{required:!!t.required,min:pt(t.min),max:pt(t.max),minLength:pt(t.minLength),maxLength:pt(t.maxLength),pattern:pt(t.pattern)}:{},name:e,onChange:C,onBlur:C,ref:s=>{if(s){I(e,t),n=ge(a,e);const r=me(s.value)&&s.querySelectorAll&&s.querySelectorAll("input,select,textarea")[0]||s,i=(e=>Qe(e)||ne(e))(r),l=n._f.refs||[];if(i?l.find(e=>e===r):r===n._f.ref)return;be(a,e,{_f:{...n._f,...i?{refs:[...l.filter(et),r,...Array.isArray(ge(o,e))?[{}]:[]],ref:{type:r.type,name:e}}:{ref:r}}}),g(e,!1,void 0,r)}else n=ge(a,e,{}),n._f&&(n._f.mount=!1),(r.shouldUnregister||t.shouldUnregister)&&(!ce(l.array,e)||!i.action)&&l.unMount.add(e)}}},M=()=>r.shouldFocusError&&yt(a,T,l.mount),L=(e,t)=>async o=>{let i;o&&(o.preventDefault&&o.preventDefault(),o.persist&&o.persist());let c=de(s);if(f.state.next({isSubmitting:!0}),r.resolver){const{errors:e,values:t}=await y();n.errors=e,c=de(t)}else await w(a);if(l.disabled.size)for(const e of l.disabled)tt(c,e);if(tt(n.errors,"root"),Ze(n.errors)){f.state.next({errors:{}});try{await e(c,o)}catch(e){i=e}}else t&&await t({...n.errors},o),M(),setTimeout(M);if(f.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Ze(n.errors)&&!i,submitCount:n.submitCount+1,errors:n.errors}),i)throw i},U=(e,t={})=>{const c=e?de(e):o,d=de(c),m=Ze(e),p=m?o:d;if(t.keepDefaultValues||(o=c),!t.keepValues){if(t.keepDirtyValues){const e=new Set([...l.mount,...Object.keys(ot(o,s))]);for(const t of Array.from(e))ge(n.dirtyFields,t)?be(p,t,ge(s,t)):E(t,ge(p,t))}else{if(ue&&me(e))for(const e of l.mount){const t=ge(a,e);if(t&&t._f){const e=Array.isArray(t._f.refs)?t._f.refs[0]:t._f.ref;if(Ye(e)){const t=e.closest("form");if(t){t.reset();break}}}}if(t.keepFieldsRef)for(const e of l.mount)E(e,ge(p,e));else a={}}s=r.shouldUnregister?t.keepDefaultValues?de(o):{}:de(p),f.array.next({values:{...p}}),f.state.next({values:{...p}})}l={mount:t.keepDirtyValues?l.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},i.mount=!u.isValid||!!t.keepIsValid||!!t.keepDirtyValues,i.watch=!!r.shouldUnregister,f.state.next({submitCount:t.keepSubmitCount?n.submitCount:0,isDirty:!m&&(t.keepDirty?n.isDirty:!(!t.keepDefaultValues||Ve(e,o))),isSubmitted:!!t.keepIsSubmitted&&n.isSubmitted,dirtyFields:m?{}:t.keepDirtyValues?t.keepDefaultValues&&s?ot(o,s):n.dirtyFields:t.keepDefaultValues&&e?ot(o,e):t.keepDirty?n.dirtyFields:{},touchedFields:t.keepTouched?n.touchedFields:{},errors:t.keepErrors?n.errors:{},isSubmitSuccessful:!!t.keepIsSubmitSuccessful&&n.isSubmitSuccessful,isSubmitting:!1,defaultValues:o})},z=(e,t)=>U(Je(e)?e(s):e,t),F=e=>{n={...n,...e}},B={control:{register:I,unregister:O,getFieldState:N,handleSubmit:L,setError:R,_subscribe:P,_runSchema:y,_focusError:M,_getWatch:S,_getDirty:x,_setValid:p,_setFieldArray:(e,t=[],l,c,m=!0,p=!0)=>{if(c&&l&&!r.disabled){if(i.action=!0,p&&Array.isArray(ge(a,e))){const t=l(ge(a,e),c.argA,c.argB);m&&be(a,e,t)}if(p&&Array.isArray(ge(n.errors,e))){const t=l(ge(n.errors,e),c.argA,c.argB);m&&be(n.errors,e,t),((e,t)=>{!pe(ge(e,t)).length&&tt(e,t)})(n.errors,e)}if((u.touchedFields||d.touchedFields)&&p&&Array.isArray(ge(n.touchedFields,e))){const t=l(ge(n.touchedFields,e),c.argA,c.argB);m&&be(n.touchedFields,e,t)}(u.dirtyFields||d.dirtyFields)&&(n.dirtyFields=ot(o,s)),f.state.next({name:e,isDirty:x(e,t),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else be(s,e,t)},_setDisabledField:D,_setErrors:e=>{n.errors=e,f.state.next({errors:n.errors,isValid:!1})},_getFieldArray:e=>pe(ge(i.mount?s:o,e,r.shouldUnregister?ge(o,e,[]):[])),_reset:U,_resetDefaultValues:()=>Je(r.defaultValues)&&r.defaultValues().then(e=>{z(e,r.resetOptions),f.state.next({isLoading:!1})}),_removeUnmounted:()=>{for(const e of l.unMount){const t=ge(a,e);t&&(t._f.refs?t._f.refs.every(e=>!et(e)):!et(t._f.ref))&&O(e)}l.unMount=new Set},_disableForm:e=>{ve(e)&&(f.state.next({disabled:e}),yt(a,(t,r)=>{const n=ge(a,r);n&&(t.disabled=n._f.disabled||e,Array.isArray(n._f.refs)&&n._f.refs.forEach(t=>{t.disabled=n._f.disabled||e}))},0,!1))},_subjects:f,_proxyFormState:u,get _fields(){return a},get _formValues(){return s},get _state(){return i},set _state(e){i=e},get _defaultValues(){return o},get _names(){return l},set _names(e){l=e},get _formState(){return n},get _options(){return r},set _options(e){r={...r,...e}}},subscribe:e=>(i.mount=!0,d={...d,...e.formState},P({...e,formState:d})),trigger:j,register:I,handleSubmit:L,watch:(e,t)=>Je(e)?f.state.subscribe({next:r=>"values"in r&&e(S(void 0,t),r)}):S(e,t,!0),setValue:E,getValues:_,reset:z,resetField:(e,t={})=>{ge(a,e)&&(me(t.defaultValue)?E(e,de(ge(o,e))):(E(e,t.defaultValue),be(o,e,de(t.defaultValue))),t.keepTouched||tt(n.touchedFields,e),t.keepDirty||(tt(n.dirtyFields,e),n.isDirty=t.defaultValue?x(e,de(ge(o,e))):x()),t.keepError||(tt(n.errors,e),u.isValid&&p()),f.state.next({...n}))},clearErrors:e=>{e&&Ke(e).forEach(e=>tt(n.errors,e)),f.state.next({errors:e?n.errors:{}})},unregister:O,setError:R,setFocus:(e,t={})=>{const r=ge(a,e),n=r&&r._f;if(n){const e=n.refs?n.refs[0]:n.ref;e.focus&&(e.focus(),t.shouldSelect&&Je(e.select)&&e.select())}},getFieldState:N};return{...B,formControl:B}}function jt(e={}){const r=t.useRef(void 0),n=t.useRef(void 0),[a,o]=t.useState({isDirty:!1,isValidating:!1,isLoading:Je(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:Je(e.defaultValues)?void 0:e.defaultValues});if(!r.current)if(e.formControl)r.current={...e.formControl,formState:a},e.defaultValues&&!Je(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:t,...n}=Tt(e);r.current={...n,formState:a}}const s=r.current.control;return s._options=e,Ue(()=>{const e=s._subscribe({formState:s._proxyFormState,callback:()=>o({...s._formState}),reRenderRoot:!0});return o(e=>({...e,isReady:!0})),s._formState.isReady=!0,e},[s]),t.useEffect(()=>s._disableForm(e.disabled),[s,e.disabled]),t.useEffect(()=>{e.mode&&(s._options.mode=e.mode),e.reValidateMode&&(s._options.reValidateMode=e.reValidateMode)},[s,e.mode,e.reValidateMode]),t.useEffect(()=>{e.errors&&(s._setErrors(e.errors),s._focusError())},[s,e.errors]),t.useEffect(()=>{e.shouldUnregister&&s._subjects.state.next({values:s._getWatch()})},[s,e.shouldUnregister]),t.useEffect(()=>{if(s._proxyFormState.isDirty){const e=s._getDirty();e!==a.isDirty&&s._subjects.state.next({isDirty:e})}},[s,a.isDirty]),t.useEffect(()=>{e.values&&!Ve(e.values,n.current)?(s._reset(e.values,{keepFieldsRef:!0,...s._options.resetOptions}),n.current=e.values,o(e=>({...e}))):s._resetDefaultValues()},[s,e.values]),t.useEffect(()=>{s._state.mount||(s._setValid(),s._state.mount=!0),s._state.watch&&(s._state.watch=!1,s._subjects.state.next({...s._formState})),s._removeUnmounted()}),r.current.formState=Le(a,s),r.current}const _t=(e,t,r)=>{if(e&&"reportValidity"in e){const n=ge(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},Nt=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?_t(n.ref,r,e):n&&n.refs&&n.refs.forEach(t=>_t(t,r,e))}},Rt=(e,t)=>{t.shouldUseNativeValidation&&Nt(e,t);const r={};for(const n in e){const a=ge(t.fields,n),o=Object.assign(e[n]||{},{ref:a&&a.ref});if(Pt(t.names||Object.keys(e),n)){const e=Object.assign({},ge(r,n));be(e,"root",o),be(r,n,e)}else be(r,n,o)}return r},Pt=(e,t)=>{const r=Ot(t);return e.some(e=>Ot(e).match(`^${r}\\.\\d+`))};function Ot(e){return e.replace(/\]|\[/g,"")}function Dt(e,t,r){function n(r,n){var a;Object.defineProperty(r,"_zod",{value:r._zod??{},enumerable:!1}),(a=r._zod).traits??(a.traits=new Set),r._zod.traits.add(e),t(r,n);for(const e in s.prototype)e in r||Object.defineProperty(r,e,{value:s.prototype[e].bind(r)});r._zod.constr=s,r._zod.def=n}const a=r?.Parent??Object;class o extends a{}function s(e){var t;const a=r?.Parent?new o:this;n(a,e),(t=a._zod).deferred??(t.deferred=[]);for(const e of a._zod.deferred)e();return a}return Object.defineProperty(o,"name",{value:e}),Object.defineProperty(s,"init",{value:n}),Object.defineProperty(s,Symbol.hasInstance,{value:t=>!!(r?.Parent&&t instanceof r.Parent)||t?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}class It extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Mt extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}const Lt={};function Ut(e){return Lt}function zt(e,t){return"bigint"==typeof t?t.toString():t}function Ft(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Bt(e){return null==e}function Vt(e){const t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}const $t=Symbol("evaluating");function Wt(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==$t)return void 0===n&&(n=$t,n=r()),n},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function Gt(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Kt(...e){const t={};for(const r of e){const e=Object.getOwnPropertyDescriptors(r);Object.assign(t,e)}return Object.defineProperties({},t)}function Ht(e){return JSON.stringify(e)}const Zt="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function qt(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const Jt=Ft(()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function Yt(e){if(!1===qt(e))return!1;const t=e.constructor;if(void 0===t)return!0;const r=t.prototype;return!1!==qt(r)&&!1!==Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")}function Xt(e){return Yt(e)?{...e}:Array.isArray(e)?[...e]:e}const Qt=new Set(["string","number","symbol"]);function er(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function tr(e,t,r){const n=new e._zod.constr(t??e._zod.def);return t&&!r?.parent||(n._zod.parent=e),n}function rr(e){const t=e;if(!t)return{};if("string"==typeof t)return{error:()=>t};if(void 0!==t?.message){if(void 0!==t?.error)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,"string"==typeof t.error?{...t,error:()=>t.error}:t}function nr(e,t=0){if(!0===e.aborted)return!0;for(let r=t;r<e.issues.length;r++)if(!0!==e.issues[r]?.continue)return!0;return!1}function ar(e,t){return t.map(t=>{var r;return(r=t).path??(r.path=[]),t.path.unshift(e),t})}function or(e){return"string"==typeof e?e:e?.message}function sr(e,t,r){const n={...e,path:e.path??[]};if(!e.message){const a=or(e.inst?._zod.def?.error?.(e))??or(t?.error?.(e))??or(r.customError?.(e))??or(r.localeError?.(e))??"Invalid input";n.message=a}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}function ir(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function lr(...e){const[t,r,n]=e;return"string"==typeof t?{message:t,code:"custom",input:r,inst:n}:{...t}}const cr=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,zt,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},ur=Dt("$ZodError",cr),dr=Dt("$ZodError",cr,{Parent:Error});const fr=e=>(t,r,n,a)=>{const o=n?Object.assign(n,{async:!1}):{async:!1},s=t._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new It;if(s.issues.length){const t=new(a?.Err??e)(s.issues.map(e=>sr(e,o,Ut())));throw Zt(t,a?.callee),t}return s.value},mr=fr(dr),pr=e=>async(t,r,n,a)=>{const o=n?Object.assign(n,{async:!0}):{async:!0};let s=t._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){const t=new(a?.Err??e)(s.issues.map(e=>sr(e,o,Ut())));throw Zt(t,a?.callee),t}return s.value},hr=pr(dr),gr=e=>(t,r,n)=>{const a=n?{...n,async:!1}:{async:!1},o=t._zod.run({value:r,issues:[]},a);if(o instanceof Promise)throw new It;return o.issues.length?{success:!1,error:new(e??ur)(o.issues.map(e=>sr(e,a,Ut())))}:{success:!0,data:o.value}},vr=gr(dr),br=e=>async(t,r,n)=>{const a=n?Object.assign(n,{async:!0}):{async:!0};let o=t._zod.run({value:r,issues:[]},a);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map(e=>sr(e,a,Ut())))}:{success:!0,data:o.value}},yr=br(dr),wr=e=>(t,r,n)=>{const a=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return fr(e)(t,r,a)},xr=e=>(t,r,n)=>fr(e)(t,r,n),Sr=e=>async(t,r,n)=>{const a=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return pr(e)(t,r,a)},kr=e=>async(t,r,n)=>pr(e)(t,r,n),Ar=e=>(t,r,n)=>{const a=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return gr(e)(t,r,a)},Er=e=>(t,r,n)=>gr(e)(t,r,n),Cr=e=>async(t,r,n)=>{const a=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return br(e)(t,r,a)},Tr=e=>async(t,r,n)=>br(e)(t,r,n),jr=/^[cC][^\s-]{8,}$/,_r=/^[0-9a-z]+$/,Nr=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Rr=/^[0-9a-vA-V]{20}$/,Pr=/^[A-Za-z0-9]{27}$/,Or=/^[a-zA-Z0-9_-]{21}$/,Dr=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Ir=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Mr=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Lr=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;const Ur=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,zr=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Fr=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Br=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Vr=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,$r=/^[A-Za-z0-9_-]*$/,Wr=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,Gr=/^\+(?:[0-9]){6,14}[0-9]$/,Kr="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Hr=new RegExp(`^${Kr}$`);function Zr(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}const qr=/^[^A-Z]*$/,Jr=/^[^a-z]*$/,Yr=Dt("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),Xr=Dt("$ZodCheckMaxLength",(e,t)=>{var r;Yr.init(e,t),(r=e._zod.def).when??(r.when=e=>{const t=e.value;return!Bt(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const r=e._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<r&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const n=r.value;if(n.length<=t.maximum)return;const a=ir(n);r.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Qr=Dt("$ZodCheckMinLength",(e,t)=>{var r;Yr.init(e,t),(r=e._zod.def).when??(r.when=e=>{const t=e.value;return!Bt(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const r=e._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>r&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const n=r.value;if(n.length>=t.minimum)return;const a=ir(n);r.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),en=Dt("$ZodCheckLengthEquals",(e,t)=>{var r;Yr.init(e,t),(r=e._zod.def).when??(r.when=e=>{const t=e.value;return!Bt(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const r=e._zod.bag;r.minimum=t.length,r.maximum=t.length,r.length=t.length}),e._zod.check=r=>{const n=r.value,a=n.length;if(a===t.length)return;const o=ir(n),s=a>t.length;r.issues.push({origin:o,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),tn=Dt("$ZodCheckStringFormat",(e,t)=>{var r,n;Yr.init(e,t),e._zod.onattach.push(e=>{const r=e._zod.bag;r.format=t.format,t.pattern&&(r.patterns??(r.patterns=new Set),r.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=r=>{t.pattern.lastIndex=0,t.pattern.test(r.value)||r.issues.push({origin:"string",code:"invalid_format",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),rn=Dt("$ZodCheckRegex",(e,t)=>{tn.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,t.pattern.test(r.value)||r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),nn=Dt("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=qr),tn.init(e,t)}),an=Dt("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Jr),tn.init(e,t)}),on=Dt("$ZodCheckIncludes",(e,t)=>{Yr.init(e,t);const r=er(t.includes),n=new RegExp("number"==typeof t.position?`^.{${t.position}}${r}`:r);t.pattern=n,e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),e._zod.check=r=>{r.value.includes(t.includes,t.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:r.value,inst:e,continue:!t.abort})}}),sn=Dt("$ZodCheckStartsWith",(e,t)=>{Yr.init(e,t);const r=new RegExp(`^${er(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),ln=Dt("$ZodCheckEndsWith",(e,t)=>{Yr.init(e,t);const r=new RegExp(`.*${er(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),cn=Dt("$ZodCheckOverwrite",(e,t)=>{Yr.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});class un{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if("function"==typeof e)return e(this,{execution:"sync"}),void e(this,{execution:"async"});const t=e.split("\n").filter(e=>e),r=Math.min(...t.map(e=>e.length-e.trimStart().length)),n=t.map(e=>e.slice(r)).map(e=>" ".repeat(2*this.indent)+e);for(const e of n)this.content.push(e)}compile(){const e=Function,t=this?.args;return new e(...t,[...(this?.content??[""]).map(e=>` ${e}`)].join("\n"))}}const dn={major:4,minor:1,patch:8},fn=Dt("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=dn;const n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(const t of n)for(const r of t._zod.onattach)r(e);if(0===n.length)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const t=(e,t,r)=>{let n,a=nr(e);for(const o of t){if(o._zod.def.when){if(!o._zod.def.when(e))continue}else if(a)continue;const t=e.issues.length,s=o._zod.check(e);if(s instanceof Promise&&!1===r?.async)throw new It;if(n||s instanceof Promise)n=(n??Promise.resolve()).then(async()=>{await s;e.issues.length!==t&&(a||(a=nr(e,t)))});else{if(e.issues.length===t)continue;a||(a=nr(e,t))}}return n?n.then(()=>e):e},r=(r,a,o)=>{if(nr(r))return r.aborted=!0,r;const s=t(a,n,o);if(s instanceof Promise){if(!1===o.async)throw new It;return s.then(t=>e._zod.parse(t,o))}return e._zod.parse(s,o)};e._zod.run=(a,o)=>{if(o.skipChecks)return e._zod.parse(a,o);if("backward"===o.direction){const t=e._zod.parse({value:a.value,issues:[]},{...o,skipChecks:!0});return t instanceof Promise?t.then(e=>r(e,a,o)):r(t,a,o)}const s=e._zod.parse(a,o);if(s instanceof Promise){if(!1===o.async)throw new It;return s.then(e=>t(e,n,o))}return t(s,n,o)}}e["~standard"]={validate:t=>{try{const r=vr(e,t);return r.success?{value:r.data}:{issues:r.error?.issues}}catch(r){return yr(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1}}),mn=Dt("$ZodString",(e,t)=>{var r;fn.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??(r=e._zod.bag,new RegExp(`^${r?`[\\s\\S]{${r?.minimum??0},${r?.maximum??""}}`:"[\\s\\S]*"}$`)),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch(n){}return"string"==typeof r.value||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),pn=Dt("$ZodStringFormat",(e,t)=>{tn.init(e,t),mn.init(e,t)}),hn=Dt("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Ir),pn.init(e,t)}),gn=Dt("$ZodUUID",(e,t)=>{if(t.version){const e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Mr(e))}else t.pattern??(t.pattern=Mr());pn.init(e,t)}),vn=Dt("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Lr),pn.init(e,t)}),bn=Dt("$ZodURL",(e,t)=>{pn.init(e,t),e._zod.check=r=>{try{const n=r.value.trim(),a=new URL(n);return t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(a.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:Wr.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(a.protocol.endsWith(":")?a.protocol.slice(0,-1):a.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),void(t.normalize?r.value=a.href:r.value=n)}catch(n){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),yn=Dt("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),pn.init(e,t)}),wn=Dt("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Or),pn.init(e,t)}),xn=Dt("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=jr),pn.init(e,t)}),Sn=Dt("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=_r),pn.init(e,t)}),kn=Dt("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Nr),pn.init(e,t)}),An=Dt("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Rr),pn.init(e,t)}),En=Dt("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Pr),pn.init(e,t)}),Cn=Dt("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=function(e){const t=Zr({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const n=`${t}(?:${r.join("|")})`;return new RegExp(`^${Kr}T(?:${n})$`)}(t)),pn.init(e,t)}),Tn=Dt("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Hr),pn.init(e,t)}),jn=Dt("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=new RegExp(`^${Zr(t)}$`)),pn.init(e,t)}),_n=Dt("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Dr),pn.init(e,t)}),Nn=Dt("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Ur),pn.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.format="ipv4"})}),Rn=Dt("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=zr),pn.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.format="ipv6"}),e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),Pn=Dt("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Fr),pn.init(e,t)}),On=Dt("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Br),pn.init(e,t),e._zod.check=r=>{const n=r.value.split("/");try{if(2!==n.length)throw new Error;const[e,t]=n;if(!t)throw new Error;const r=Number(t);if(`${r}`!==t)throw new Error;if(r<0||r>128)throw new Error;new URL(`http://[${e}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function Dn(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const In=Dt("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Vr),pn.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding="base64"}),e._zod.check=r=>{Dn(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});const Mn=Dt("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=$r),pn.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding="base64url"}),e._zod.check=r=>{(function(e){if(!$r.test(e))return!1;const t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return Dn(t.padEnd(4*Math.ceil(t.length/4),"="))})(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),Ln=Dt("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Gr),pn.init(e,t)});const Un=Dt("$ZodJWT",(e,t)=>{pn.init(e,t),e._zod.check=r=>{(function(e,t=null){try{const r=e.split(".");if(3!==r.length)return!1;const[n]=r;if(!n)return!1;const a=JSON.parse(atob(n));return!("typ"in a&&"JWT"!==a?.typ||!a.alg||t&&(!("alg"in a)||a.alg!==t))}catch{return!1}})(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),zn=Dt("$ZodUnknown",(e,t)=>{fn.init(e,t),e._zod.parse=e=>e}),Fn=Dt("$ZodNever",(e,t)=>{fn.init(e,t),e._zod.parse=(t,r)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)});function Bn(e,t,r){e.issues.length&&t.issues.push(...ar(r,e.issues)),t.value[r]=e.value}const Vn=Dt("$ZodArray",(e,t)=>{fn.init(e,t),e._zod.parse=(r,n)=>{const a=r.value;if(!Array.isArray(a))return r.issues.push({expected:"array",code:"invalid_type",input:a,inst:e}),r;r.value=Array(a.length);const o=[];for(let e=0;e<a.length;e++){const s=a[e],i=t.element._zod.run({value:s,issues:[]},n);i instanceof Promise?o.push(i.then(t=>Bn(t,r,e))):Bn(i,r,e)}return o.length?Promise.all(o).then(()=>r):r}});function $n(e,t,r,n){e.issues.length&&t.issues.push(...ar(r,e.issues)),void 0===e.value?r in n&&(t.value[r]=void 0):t.value[r]=e.value}function Wn(e){const t=Object.keys(e.shape);for(const r of t)if(!e.shape?.[r]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${r}": expected a Zod schema`);const r=(n=e.shape,Object.keys(n).filter(e=>"optional"===n[e]._zod.optin&&"optional"===n[e]._zod.optout));var n;return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function Gn(e,t,r,n,a,o){const s=[],i=a.keySet,l=a.catchall._zod,c=l.def.type;for(const a of Object.keys(t)){if(i.has(a))continue;if("never"===c){s.push(a);continue}const o=l.run({value:t[a],issues:[]},n);o instanceof Promise?e.push(o.then(e=>$n(e,r,a,t))):$n(o,r,a,t)}return s.length&&r.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:o}),e.length?Promise.all(e).then(()=>r):r}const Kn=Dt("$ZodObject",(e,t)=>{fn.init(e,t);const r=Ft(()=>Wn(t));Wt(e._zod,"propValues",()=>{const e=t.shape,r={};for(const t in e){const n=e[t]._zod;if(n.values){r[t]??(r[t]=new Set);for(const e of n.values)r[t].add(e)}}return r});const n=qt,a=t.catchall;let o;e._zod.parse=(t,s)=>{o??(o=r.value);const i=t.value;if(!n(i))return t.issues.push({expected:"object",code:"invalid_type",input:i,inst:e}),t;t.value={};const l=[],c=o.shape;for(const e of o.keys){const r=c[e]._zod.run({value:i[e],issues:[]},s);r instanceof Promise?l.push(r.then(r=>$n(r,t,e,i))):$n(r,t,e,i)}return a?Gn(l,i,t,s,r.value,e):l.length?Promise.all(l).then(()=>t):t}}),Hn=Dt("$ZodObjectJIT",(e,t)=>{Kn.init(e,t);const r=e._zod.parse,n=Ft(()=>Wn(t));let a;const o=qt,s=!Lt.jitless,i=s&&Jt.value,l=t.catchall;let c;e._zod.parse=(u,d)=>{c??(c=n.value);const f=u.value;return o(f)?s&&i&&!1===d?.async&&!0!==d.jitless?(a||(a=(e=>{const t=new un(["shape","payload","ctx"]),r=n.value,a=e=>{const t=Ht(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");const o=Object.create(null);let s=0;for(const e of r.keys)o[e]="key_"+s++;t.write("const newResult = {};");for(const e of r.keys){const r=o[e],n=Ht(e);t.write(`const ${r} = ${a(e)};`),t.write(`\n if (${r}.issues.length) {\n payload.issues = payload.issues.concat(${r}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${n}, ...iss.path] : [${n}]\n })));\n }\n \n \n if (${r}.value === undefined) {\n if (${n} in input) {\n newResult[${n}] = undefined;\n }\n } else {\n newResult[${n}] = ${r}.value;\n }\n \n `)}t.write("payload.value = newResult;"),t.write("return payload;");const i=t.compile();return(t,r)=>i(e,t,r)})(t.shape)),u=a(u,d),l?Gn([],f,u,d,c,e):u):r(u,d):(u.issues.push({expected:"object",code:"invalid_type",input:f,inst:e}),u)}});function Zn(e,t,r,n){for(const r of e)if(0===r.issues.length)return t.value=r.value,t;const a=e.filter(e=>!nr(e));return 1===a.length?(t.value=a[0].value,a[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(e=>e.issues.map(e=>sr(e,n,Ut())))}),t)}const qn=Dt("$ZodUnion",(e,t)=>{fn.init(e,t),Wt(e._zod,"optin",()=>t.options.some(e=>"optional"===e._zod.optin)?"optional":void 0),Wt(e._zod,"optout",()=>t.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),Wt(e._zod,"values",()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),Wt(e._zod,"pattern",()=>{if(t.options.every(e=>e._zod.pattern)){const e=t.options.map(e=>e._zod.pattern);return new RegExp(`^(${e.map(e=>Vt(e.source)).join("|")})$`)}});const r=1===t.options.length,n=t.options[0]._zod.run;e._zod.parse=(a,o)=>{if(r)return n(a,o);let s=!1;const i=[];for(const e of t.options){const t=e._zod.run({value:a.value,issues:[]},o);if(t instanceof Promise)i.push(t),s=!0;else{if(0===t.issues.length)return t;i.push(t)}}return s?Promise.all(i).then(t=>Zn(t,a,e,o)):Zn(i,a,e,o)}}),Jn=Dt("$ZodIntersection",(e,t)=>{fn.init(e,t),e._zod.parse=(e,r)=>{const n=e.value,a=t.left._zod.run({value:n,issues:[]},r),o=t.right._zod.run({value:n,issues:[]},r);return a instanceof Promise||o instanceof Promise?Promise.all([a,o]).then(([t,r])=>Xn(e,t,r)):Xn(e,a,o)}});function Yn(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e===+t)return{valid:!0,data:e};if(Yt(e)&&Yt(t)){const r=Object.keys(t),n=Object.keys(e).filter(e=>-1!==r.indexOf(e)),a={...e,...t};for(const r of n){const n=Yn(e[r],t[r]);if(!n.valid)return{valid:!1,mergeErrorPath:[r,...n.mergeErrorPath]};a[r]=n.data}return{valid:!0,data:a}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let n=0;n<e.length;n++){const a=Yn(e[n],t[n]);if(!a.valid)return{valid:!1,mergeErrorPath:[n,...a.mergeErrorPath]};r.push(a.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function Xn(e,t,r){if(t.issues.length&&e.issues.push(...t.issues),r.issues.length&&e.issues.push(...r.issues),nr(e))return e;const n=Yn(t.value,r.value);if(!n.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(n.mergeErrorPath)}`);return e.value=n.data,e}const Qn=Dt("$ZodEnum",(e,t)=>{fn.init(e,t);const r=function(e){const t=Object.values(e).filter(e=>"number"==typeof e),r=Object.entries(e).filter(([e,r])=>-1===t.indexOf(+e)).map(([e,t])=>t);return r}(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(e=>Qt.has(typeof e)).map(e=>"string"==typeof e?er(e):e.toString()).join("|")})$`),e._zod.parse=(t,a)=>{const o=t.value;return n.has(o)||t.issues.push({code:"invalid_value",values:r,input:o,inst:e}),t}}),ea=Dt("$ZodTransform",(e,t)=>{fn.init(e,t),e._zod.parse=(r,n)=>{if("backward"===n.direction)throw new Mt(e.constructor.name);const a=t.transform(r.value,r);if(n.async){return(a instanceof Promise?a:Promise.resolve(a)).then(e=>(r.value=e,r))}if(a instanceof Promise)throw new It;return r.value=a,r}});function ta(e,t){return e.issues.length&&void 0===t?{issues:[],value:void 0}:e}const ra=Dt("$ZodOptional",(e,t)=>{fn.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Wt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Wt(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${Vt(e.source)})?$`):void 0}),e._zod.parse=(e,r)=>{if("optional"===t.innerType._zod.optin){const n=t.innerType._zod.run(e,r);return n instanceof Promise?n.then(t=>ta(t,e.value)):ta(n,e.value)}return void 0===e.value?e:t.innerType._zod.run(e,r)}}),na=Dt("$ZodNullable",(e,t)=>{fn.init(e,t),Wt(e._zod,"optin",()=>t.innerType._zod.optin),Wt(e._zod,"optout",()=>t.innerType._zod.optout),Wt(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${Vt(e.source)}|null)$`):void 0}),Wt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,r)=>null===e.value?e:t.innerType._zod.run(e,r)}),aa=Dt("$ZodDefault",(e,t)=>{fn.init(e,t),e._zod.optin="optional",Wt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,r)=>{if("backward"===r.direction)return t.innerType._zod.run(e,r);if(void 0===e.value)return e.value=t.defaultValue,e;const n=t.innerType._zod.run(e,r);return n instanceof Promise?n.then(e=>oa(e,t)):oa(n,t)}});function oa(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const sa=Dt("$ZodPrefault",(e,t)=>{fn.init(e,t),e._zod.optin="optional",Wt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,r)=>("backward"===r.direction||void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,r))}),ia=Dt("$ZodNonOptional",(e,t)=>{fn.init(e,t),Wt(e._zod,"values",()=>{const e=t.innerType._zod.values;return e?new Set([...e].filter(e=>void 0!==e)):void 0}),e._zod.parse=(r,n)=>{const a=t.innerType._zod.run(r,n);return a instanceof Promise?a.then(t=>la(t,e)):la(a,e)}});function la(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const ca=Dt("$ZodCatch",(e,t)=>{fn.init(e,t),Wt(e._zod,"optin",()=>t.innerType._zod.optin),Wt(e._zod,"optout",()=>t.innerType._zod.optout),Wt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,r)=>{if("backward"===r.direction)return t.innerType._zod.run(e,r);const n=t.innerType._zod.run(e,r);return n instanceof Promise?n.then(n=>(e.value=n.value,n.issues.length&&(e.value=t.catchValue({...e,error:{issues:n.issues.map(e=>sr(e,r,Ut()))},input:e.value}),e.issues=[]),e)):(e.value=n.value,n.issues.length&&(e.value=t.catchValue({...e,error:{issues:n.issues.map(e=>sr(e,r,Ut()))},input:e.value}),e.issues=[]),e)}}),ua=Dt("$ZodPipe",(e,t)=>{fn.init(e,t),Wt(e._zod,"values",()=>t.in._zod.values),Wt(e._zod,"optin",()=>t.in._zod.optin),Wt(e._zod,"optout",()=>t.out._zod.optout),Wt(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(e,r)=>{if("backward"===r.direction){const n=t.out._zod.run(e,r);return n instanceof Promise?n.then(e=>da(e,t.in,r)):da(n,t.in,r)}const n=t.in._zod.run(e,r);return n instanceof Promise?n.then(e=>da(e,t.out,r)):da(n,t.out,r)}});function da(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}const fa=Dt("$ZodReadonly",(e,t)=>{fn.init(e,t),Wt(e._zod,"propValues",()=>t.innerType._zod.propValues),Wt(e._zod,"values",()=>t.innerType._zod.values),Wt(e._zod,"optin",()=>t.innerType._zod.optin),Wt(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(e,r)=>{if("backward"===r.direction)return t.innerType._zod.run(e,r);const n=t.innerType._zod.run(e,r);return n instanceof Promise?n.then(ma):ma(n)}});function ma(e){return e.value=Object.freeze(e.value),e}const pa=Dt("$ZodCustom",(e,t)=>{Yr.init(e,t),fn.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=r=>{const n=r.value,a=t.fn(n);if(a instanceof Promise)return a.then(t=>ha(t,r,n,e));ha(a,r,n,e)}});function ha(e,t,r,n){if(!e){const e={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(e.params=n._zod.def.params),t.issues.push(lr(e))}}class ga{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){const r=t[0];if(this._map.set(e,r),r&&"object"==typeof r&&"id"in r){if(this._idmap.has(r.id))throw new Error(`ID ${r.id} already exists in the registry`);this._idmap.set(r.id,e)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){const t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){const t=e._zod.parent;if(t){const r={...this.get(t)??{}};delete r.id;const n={...r,...this._map.get(e)};return Object.keys(n).length?n:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function va(){return new ga}const ba=va();function ya(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...rr(t)})}function wa(e,t){return new Xr({check:"max_length",...rr(t),maximum:e})}function xa(e,t){return new Qr({check:"min_length",...rr(t),minimum:e})}function Sa(e,t){return new en({check:"length_equals",...rr(t),length:e})}function ka(e){return new cn({check:"overwrite",tx:e})}function Aa(e){const t=function(e,t){const r=new Yr({check:"custom",...rr(t)});return r._zod.check=e,r}(r=>(r.addIssue=e=>{if("string"==typeof e)r.issues.push(lr(e,r.value,t._zod.def));else{const n=e;n.fatal&&(n.continue=!1),n.code??(n.code="custom"),n.input??(n.input=r.value),n.inst??(n.inst=t),n.continue??(n.continue=!t._zod.def.abort),r.issues.push(lr(n))}},e(r.value,r)));return t}function Ea(e,t){try{var r=e()}catch(e){return t(e)}return r&&r.then?r.then(void 0,t):r}function Ca(e,t){for(var r={};e.length;){var n=e[0],a=n.code,o=n.message,s=n.path.join(".");if(!r[s])if("unionErrors"in n){var i=n.unionErrors[0].errors[0];r[s]={message:i.message,type:i.code}}else r[s]={message:o,type:a};if("unionErrors"in n&&n.unionErrors.forEach(function(t){return t.errors.forEach(function(t){return e.push(t)})}),t){var l=r[s].types,c=l&&l[n.code];r[s]=Ge(s,t,r,a,c?[].concat(c,n.message):n.message)}e.shift()}return r}function Ta(e,t){for(var r={};e.length;){var n=e[0],a=n.code,o=n.message,s=n.path.join(".");if(!r[s])if("invalid_union"===n.code&&n.errors.length>0){var i=n.errors[0][0];r[s]={message:i.message,type:i.code}}else r[s]={message:o,type:a};if("invalid_union"===n.code&&n.errors.forEach(function(t){return t.forEach(function(t){return e.push(t)})}),t){var l=r[s].types,c=l&&l[n.code];r[s]=Ge(s,t,r,a,c?[].concat(c,n.message):n.message)}e.shift()}return r}function ja(e,t,r){if(void 0===r&&(r={}),function(e){return"_def"in e&&"object"==typeof e._def&&"typeName"in e._def}(e))return function(n,a,o){try{return Promise.resolve(Ea(function(){return Promise.resolve(e["sync"===r.mode?"parse":"parseAsync"](n,t)).then(function(e){return o.shouldUseNativeValidation&&Nt({},o),{errors:{},values:r.raw?Object.assign({},n):e}})},function(e){if(function(e){return Array.isArray(null==e?void 0:e.issues)}(e))return{values:{},errors:Rt(Ca(e.errors,!o.shouldUseNativeValidation&&"all"===o.criteriaMode),o)};throw e}))}catch(e){return Promise.reject(e)}};if(function(e){return"_zod"in e&&"object"==typeof e._zod}(e))return function(n,a,o){try{return Promise.resolve(Ea(function(){return Promise.resolve(("sync"===r.mode?mr:hr)(e,n,t)).then(function(e){return o.shouldUseNativeValidation&&Nt({},o),{errors:{},values:r.raw?Object.assign({},n):e}})},function(e){if(function(e){return e instanceof ur}(e))return{values:{},errors:Rt(Ta(e.issues,!o.shouldUseNativeValidation&&"all"===o.criteriaMode),o)};throw e}))}catch(e){return Promise.reject(e)}};throw new Error("Invalid input: not a Zod schema")}function _a(e){var t,r,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(r=_a(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function Na(){for(var e,t,r=0,n="",a=arguments.length;r<a;r++)(e=arguments[r])&&(t=_a(e))&&(n&&(n+=" "),n+=t);return n}const Ra=e=>{const t=Ia(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:e=>{const r=e.split("-");return""===r[0]&&1!==r.length&&r.shift(),Pa(r,t)||Da(e)},getConflictingClassGroupIds:(e,t)=>{const a=r[e]||[];return t&&n[e]?[...a,...n[e]]:a}}},Pa=(e,t)=>{if(0===e.length)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),a=n?Pa(e.slice(1),n):void 0;if(a)return a;if(0===t.validators.length)return;const o=e.join("-");return t.validators.find(({validator:e})=>e(o))?.classGroupId},Oa=/^\[(.+)\]$/,Da=e=>{if(Oa.test(e)){const t=Oa.exec(e)[1],r=t?.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},Ia=e=>{const{theme:t,classGroups:r}=e,n={nextPart:new Map,validators:[]};for(const e in r)Ma(r[e],n,e,t);return n},Ma=(e,t,r,n)=>{e.forEach(e=>{if("string"==typeof e){return void((""===e?t:La(t,e)).classGroupId=r)}if("function"==typeof e)return Ua(e)?void Ma(e(n),t,r,n):void t.validators.push({validator:e,classGroupId:r});Object.entries(e).forEach(([e,a])=>{Ma(a,La(t,e),r,n)})})},La=(e,t)=>{let r=e;return t.split("-").forEach(e=>{r.nextPart.has(e)||r.nextPart.set(e,{nextPart:new Map,validators:[]}),r=r.nextPart.get(e)}),r},Ua=e=>e.isThemeGetter,za=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const a=(a,o)=>{r.set(a,o),t++,t>e&&(t=0,n=r,r=new Map)};return{get(e){let t=r.get(e);return void 0!==t?t:void 0!==(t=n.get(e))?(a(e,t),t):void 0},set(e,t){r.has(e)?r.set(e,t):a(e,t)}}},Fa=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=e=>{const t=[];let r,n=0,a=0,o=0;for(let s=0;s<e.length;s++){let i=e[s];if(0===n&&0===a){if(":"===i){t.push(e.slice(o,s)),o=s+1;continue}if("/"===i){r=s;continue}}"["===i?n++:"]"===i?n--:"("===i?a++:")"===i&&a--}const s=0===t.length?e:e.substring(o),i=Ba(s);return{modifiers:t,hasImportantModifier:i!==s,baseClassName:i,maybePostfixModifierPosition:r&&r>o?r-o:void 0}};if(t){const e=t+":",r=n;n=t=>t.startsWith(e)?r(t.substring(e.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:t,maybePostfixModifierPosition:void 0}}if(r){const e=n;n=t=>r({className:t,parseClassName:e})}return n},Ba=e=>e.endsWith("!")?e.substring(0,e.length-1):e.startsWith("!")?e.substring(1):e,Va=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(e=>[e,!0]));return e=>{if(e.length<=1)return e;const r=[];let n=[];return e.forEach(e=>{"["===e[0]||t[e]?(r.push(...n.sort(),e),n=[]):n.push(e)}),r.push(...n.sort()),r}},$a=/\s+/;function Wa(){let e,t,r=0,n="";for(;r<arguments.length;)(e=arguments[r++])&&(t=Ga(e))&&(n&&(n+=" "),n+=t);return n}const Ga=e=>{if("string"==typeof e)return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=Ga(e[n]))&&(r&&(r+=" "),r+=t);return r};function Ka(e,...t){let r,n,a,o=function(i){const l=t.reduce((e,t)=>t(e),e());return r=(e=>({cache:za(e.cacheSize),parseClassName:Fa(e),sortModifiers:Va(e),...Ra(e)}))(l),n=r.cache.get,a=r.cache.set,o=s,s(i)};function s(e){const t=n(e);if(t)return t;const o=((e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:a,sortModifiers:o}=t,s=[],i=e.trim().split($a);let l="";for(let e=i.length-1;e>=0;e-=1){const t=i[e],{isExternal:c,modifiers:u,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:m}=r(t);if(c){l=t+(l.length>0?" "+l:l);continue}let p=!!m,h=n(p?f.substring(0,m):f);if(!h){if(!p){l=t+(l.length>0?" "+l:l);continue}if(h=n(f),!h){l=t+(l.length>0?" "+l:l);continue}p=!1}const g=o(u).join(":"),v=d?g+"!":g,b=v+h;if(s.includes(b))continue;s.push(b);const y=a(h,p);for(let e=0;e<y.length;++e){const t=y[e];s.push(v+t)}l=t+(l.length>0?" "+l:l)}return l})(e,r);return a(e,o),o}return function(){return o(Wa.apply(null,arguments))}}const Ha=e=>{const t=t=>t[e]||[];return t.isThemeGetter=!0,t},Za=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,qa=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Ja=/^\d+\/\d+$/,Ya=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Xa=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Qa=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,eo=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,to=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ro=e=>Ja.test(e),no=e=>!!e&&!Number.isNaN(Number(e)),ao=e=>!!e&&Number.isInteger(Number(e)),oo=e=>e.endsWith("%")&&no(e.slice(0,-1)),so=e=>Ya.test(e),io=()=>!0,lo=e=>Xa.test(e)&&!Qa.test(e),co=()=>!1,uo=e=>eo.test(e),fo=e=>to.test(e),mo=e=>!ho(e)&&!xo(e),po=e=>jo(e,Po,co),ho=e=>Za.test(e),go=e=>jo(e,Oo,lo),vo=e=>jo(e,Do,no),bo=e=>jo(e,No,co),yo=e=>jo(e,Ro,fo),wo=e=>jo(e,Mo,uo),xo=e=>qa.test(e),So=e=>_o(e,Oo),ko=e=>_o(e,Io),Ao=e=>_o(e,No),Eo=e=>_o(e,Po),Co=e=>_o(e,Ro),To=e=>_o(e,Mo,!0),jo=(e,t,r)=>{const n=Za.exec(e);return!!n&&(n[1]?t(n[1]):r(n[2]))},_o=(e,t,r=!1)=>{const n=qa.exec(e);return!!n&&(n[1]?t(n[1]):r)},No=e=>"position"===e||"percentage"===e,Ro=e=>"image"===e||"url"===e,Po=e=>"length"===e||"size"===e||"bg-size"===e,Oo=e=>"length"===e,Do=e=>"number"===e,Io=e=>"family-name"===e,Mo=e=>"shadow"===e,Lo=Ka(()=>{const e=Ha("color"),t=Ha("font"),r=Ha("text"),n=Ha("font-weight"),a=Ha("tracking"),o=Ha("leading"),s=Ha("breakpoint"),i=Ha("container"),l=Ha("spacing"),c=Ha("radius"),u=Ha("shadow"),d=Ha("inset-shadow"),f=Ha("text-shadow"),m=Ha("drop-shadow"),p=Ha("blur"),h=Ha("perspective"),g=Ha("aspect"),v=Ha("ease"),b=Ha("animate"),y=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",xo,ho],w=()=>[xo,ho,l],x=()=>[ro,"full","auto",...w()],S=()=>[ao,"none","subgrid",xo,ho],k=()=>["auto",{span:["full",ao,xo,ho]},ao,xo,ho],A=()=>[ao,"auto",xo,ho],E=()=>["auto","min","max","fr",xo,ho],C=()=>["auto",...w()],T=()=>[ro,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...w()],j=()=>[e,xo,ho],_=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",Ao,bo,{position:[xo,ho]}],N=()=>["auto","cover","contain",Eo,po,{size:[xo,ho]}],R=()=>[oo,So,go],P=()=>["","none","full",c,xo,ho],O=()=>["",no,So,go],D=()=>[no,oo,Ao,bo],I=()=>["","none",p,xo,ho],M=()=>["none",no,xo,ho],L=()=>["none",no,xo,ho],U=()=>[no,xo,ho],z=()=>[ro,"full",...w()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[so],breakpoint:[so],color:[io],container:[so],"drop-shadow":[so],ease:["in","out","in-out"],font:[mo],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[so],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[so],shadow:[so],spacing:["px",no],text:[so],"text-shadow":[so],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ro,ho,xo,g]}],container:["container"],columns:[{columns:[no,ho,xo,i]}],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:y()}],overflow:[{overflow:["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],overscroll:[{overscroll:["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:x()}],"inset-x":[{"inset-x":x()}],"inset-y":[{"inset-y":x()}],start:[{start:x()}],end:[{end:x()}],top:[{top:x()}],right:[{right:x()}],bottom:[{bottom:x()}],left:[{left:x()}],visibility:["visible","invisible","collapse"],z:[{z:[ao,"auto",xo,ho]}],basis:[{basis:[ro,"full","auto",i,...w()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[no,ro,"auto","initial","none",ho]}],grow:[{grow:["",no,xo,ho]}],shrink:[{shrink:["",no,xo,ho]}],order:[{order:[ao,"first","last","none",xo,ho]}],"grid-cols":[{"grid-cols":S()}],"col-start-end":[{col:k()}],"col-start":[{"col-start":A()}],"col-end":[{"col-end":A()}],"grid-rows":[{"grid-rows":S()}],"row-start-end":[{row:k()}],"row-start":[{"row-start":A()}],"row-end":[{"row-end":A()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":E()}],"auto-rows":[{"auto-rows":E()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe","normal"]}],"justify-items":[{"justify-items":["start","end","center","stretch","center-safe","end-safe","normal"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],"align-content":[{content:["normal","start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"align-items":[{items:["start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"align-self":[{self:["auto","start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"place-items":[{"place-items":["start","end","center","stretch","center-safe","end-safe","baseline"]}],"place-self":[{"place-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:C()}],mx:[{mx:C()}],my:[{my:C()}],ms:[{ms:C()}],me:[{me:C()}],mt:[{mt:C()}],mr:[{mr:C()}],mb:[{mb:C()}],ml:[{ml:C()}],"space-x":[{"space-x":w()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":w()}],"space-y-reverse":["space-y-reverse"],size:[{size:T()}],w:[{w:[i,"screen",...T()]}],"min-w":[{"min-w":[i,"screen","none",...T()]}],"max-w":[{"max-w":[i,"screen","none","prose",{screen:[s]},...T()]}],h:[{h:["screen","lh",...T()]}],"min-h":[{"min-h":["screen","lh","none",...T()]}],"max-h":[{"max-h":["screen","lh",...T()]}],"font-size":[{text:["base",r,So,go]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,xo,vo]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",oo,ho]}],"font-family":[{font:[ko,ho,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[a,xo,ho]}],"line-clamp":[{"line-clamp":[no,"none",xo,vo]}],leading:[{leading:[o,...w()]}],"list-image":[{"list-image":["none",xo,ho]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",xo,ho]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:j()}],"text-color":[{text:j()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","wavy"]}],"text-decoration-thickness":[{decoration:[no,"from-font","auto",xo,go]}],"text-decoration-color":[{decoration:j()}],"underline-offset":[{"underline-offset":[no,"auto",xo,ho]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:w()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",xo,ho]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",xo,ho]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:_()}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:N()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ao,xo,ho],radial:["",xo,ho],conic:[ao,xo,ho]},Co,yo]}],"bg-color":[{bg:j()}],"gradient-from-pos":[{from:R()}],"gradient-via-pos":[{via:R()}],"gradient-to-pos":[{to:R()}],"gradient-from":[{from:j()}],"gradient-via":[{via:j()}],"gradient-to":[{to:j()}],rounded:[{rounded:P()}],"rounded-s":[{"rounded-s":P()}],"rounded-e":[{"rounded-e":P()}],"rounded-t":[{"rounded-t":P()}],"rounded-r":[{"rounded-r":P()}],"rounded-b":[{"rounded-b":P()}],"rounded-l":[{"rounded-l":P()}],"rounded-ss":[{"rounded-ss":P()}],"rounded-se":[{"rounded-se":P()}],"rounded-ee":[{"rounded-ee":P()}],"rounded-es":[{"rounded-es":P()}],"rounded-tl":[{"rounded-tl":P()}],"rounded-tr":[{"rounded-tr":P()}],"rounded-br":[{"rounded-br":P()}],"rounded-bl":[{"rounded-bl":P()}],"border-w":[{border:O()}],"border-w-x":[{"border-x":O()}],"border-w-y":[{"border-y":O()}],"border-w-s":[{"border-s":O()}],"border-w-e":[{"border-e":O()}],"border-w-t":[{"border-t":O()}],"border-w-r":[{"border-r":O()}],"border-w-b":[{"border-b":O()}],"border-w-l":[{"border-l":O()}],"divide-x":[{"divide-x":O()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":O()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:["solid","dashed","dotted","double","hidden","none"]}],"divide-style":[{divide:["solid","dashed","dotted","double","hidden","none"]}],"border-color":[{border:j()}],"border-color-x":[{"border-x":j()}],"border-color-y":[{"border-y":j()}],"border-color-s":[{"border-s":j()}],"border-color-e":[{"border-e":j()}],"border-color-t":[{"border-t":j()}],"border-color-r":[{"border-r":j()}],"border-color-b":[{"border-b":j()}],"border-color-l":[{"border-l":j()}],"divide-color":[{divide:j()}],"outline-style":[{outline:["solid","dashed","dotted","double","none","hidden"]}],"outline-offset":[{"outline-offset":[no,xo,ho]}],"outline-w":[{outline:["",no,So,go]}],"outline-color":[{outline:j()}],shadow:[{shadow:["","none",u,To,wo]}],"shadow-color":[{shadow:j()}],"inset-shadow":[{"inset-shadow":["none",d,To,wo]}],"inset-shadow-color":[{"inset-shadow":j()}],"ring-w":[{ring:O()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:j()}],"ring-offset-w":[{"ring-offset":[no,go]}],"ring-offset-color":[{"ring-offset":j()}],"inset-ring-w":[{"inset-ring":O()}],"inset-ring-color":[{"inset-ring":j()}],"text-shadow":[{"text-shadow":["none",f,To,wo]}],"text-shadow-color":[{"text-shadow":j()}],opacity:[{opacity:[no,xo,ho]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[no]}],"mask-image-linear-from-pos":[{"mask-linear-from":D()}],"mask-image-linear-to-pos":[{"mask-linear-to":D()}],"mask-image-linear-from-color":[{"mask-linear-from":j()}],"mask-image-linear-to-color":[{"mask-linear-to":j()}],"mask-image-t-from-pos":[{"mask-t-from":D()}],"mask-image-t-to-pos":[{"mask-t-to":D()}],"mask-image-t-from-color":[{"mask-t-from":j()}],"mask-image-t-to-color":[{"mask-t-to":j()}],"mask-image-r-from-pos":[{"mask-r-from":D()}],"mask-image-r-to-pos":[{"mask-r-to":D()}],"mask-image-r-from-color":[{"mask-r-from":j()}],"mask-image-r-to-color":[{"mask-r-to":j()}],"mask-image-b-from-pos":[{"mask-b-from":D()}],"mask-image-b-to-pos":[{"mask-b-to":D()}],"mask-image-b-from-color":[{"mask-b-from":j()}],"mask-image-b-to-color":[{"mask-b-to":j()}],"mask-image-l-from-pos":[{"mask-l-from":D()}],"mask-image-l-to-pos":[{"mask-l-to":D()}],"mask-image-l-from-color":[{"mask-l-from":j()}],"mask-image-l-to-color":[{"mask-l-to":j()}],"mask-image-x-from-pos":[{"mask-x-from":D()}],"mask-image-x-to-pos":[{"mask-x-to":D()}],"mask-image-x-from-color":[{"mask-x-from":j()}],"mask-image-x-to-color":[{"mask-x-to":j()}],"mask-image-y-from-pos":[{"mask-y-from":D()}],"mask-image-y-to-pos":[{"mask-y-to":D()}],"mask-image-y-from-color":[{"mask-y-from":j()}],"mask-image-y-to-color":[{"mask-y-to":j()}],"mask-image-radial":[{"mask-radial":[xo,ho]}],"mask-image-radial-from-pos":[{"mask-radial-from":D()}],"mask-image-radial-to-pos":[{"mask-radial-to":D()}],"mask-image-radial-from-color":[{"mask-radial-from":j()}],"mask-image-radial-to-color":[{"mask-radial-to":j()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"]}],"mask-image-conic-pos":[{"mask-conic":[no]}],"mask-image-conic-from-pos":[{"mask-conic-from":D()}],"mask-image-conic-to-pos":[{"mask-conic-to":D()}],"mask-image-conic-from-color":[{"mask-conic-from":j()}],"mask-image-conic-to-color":[{"mask-conic-to":j()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:_()}],"mask-repeat":[{mask:["no-repeat",{repeat:["","x","y","space","round"]}]}],"mask-size":[{mask:N()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",xo,ho]}],filter:[{filter:["","none",xo,ho]}],blur:[{blur:I()}],brightness:[{brightness:[no,xo,ho]}],contrast:[{contrast:[no,xo,ho]}],"drop-shadow":[{"drop-shadow":["","none",m,To,wo]}],"drop-shadow-color":[{"drop-shadow":j()}],grayscale:[{grayscale:["",no,xo,ho]}],"hue-rotate":[{"hue-rotate":[no,xo,ho]}],invert:[{invert:["",no,xo,ho]}],saturate:[{saturate:[no,xo,ho]}],sepia:[{sepia:["",no,xo,ho]}],"backdrop-filter":[{"backdrop-filter":["","none",xo,ho]}],"backdrop-blur":[{"backdrop-blur":I()}],"backdrop-brightness":[{"backdrop-brightness":[no,xo,ho]}],"backdrop-contrast":[{"backdrop-contrast":[no,xo,ho]}],"backdrop-grayscale":[{"backdrop-grayscale":["",no,xo,ho]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[no,xo,ho]}],"backdrop-invert":[{"backdrop-invert":["",no,xo,ho]}],"backdrop-opacity":[{"backdrop-opacity":[no,xo,ho]}],"backdrop-saturate":[{"backdrop-saturate":[no,xo,ho]}],"backdrop-sepia":[{"backdrop-sepia":["",no,xo,ho]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",xo,ho]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[no,"initial",xo,ho]}],ease:[{ease:["linear","initial",v,xo,ho]}],delay:[{delay:[no,xo,ho]}],animate:[{animate:["none",b,xo,ho]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[h,xo,ho]}],"perspective-origin":[{"perspective-origin":y()}],rotate:[{rotate:M()}],"rotate-x":[{"rotate-x":M()}],"rotate-y":[{"rotate-y":M()}],"rotate-z":[{"rotate-z":M()}],scale:[{scale:L()}],"scale-x":[{"scale-x":L()}],"scale-y":[{"scale-y":L()}],"scale-z":[{"scale-z":L()}],"scale-3d":["scale-3d"],skew:[{skew:U()}],"skew-x":[{"skew-x":U()}],"skew-y":[{"skew-y":U()}],transform:[{transform:[xo,ho,"","none","gpu","cpu"]}],"transform-origin":[{origin:y()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:z()}],"translate-x":[{"translate-x":z()}],"translate-y":[{"translate-y":z()}],"translate-z":[{"translate-z":z()}],"translate-none":["translate-none"],accent:[{accent:j()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:j()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",xo,ho]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",xo,ho]}],fill:[{fill:["none",...j()]}],"stroke-w":[{stroke:[no,So,go,vo]}],stroke:[{stroke:["none",...j()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function Uo(...e){return Lo(Na(e))}function zo(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function Fo(...e){return t=>{let r=!1;const n=e.map(e=>{const n=zo(e,t);return r||"function"!=typeof n||(r=!0),n});if(r)return()=>{for(let t=0;t<n.length;t++){const r=n[t];"function"==typeof r?r():zo(e[t],null)}}}}function Bo(...e){return a.useCallback(Fo(...e),e)}function Vo(t){const r=Wo(t),n=a.forwardRef((t,n)=>{const{children:o,...s}=t,i=a.Children.toArray(o),l=i.find(Ko);if(l){const t=l.props.children,o=i.map(e=>e===l?a.Children.count(t)>1?a.Children.only(null):a.isValidElement(t)?t.props.children:null:e);return e.jsx(r,{...s,ref:n,children:a.isValidElement(t)?a.cloneElement(t,void 0,o):null})}return e.jsx(r,{...s,ref:n,children:o})});return n.displayName=`${t}.Slot`,n}var $o=Vo("Slot");function Wo(e){const t=a.forwardRef((e,t)=>{const{children:r,...n}=e;if(a.isValidElement(r)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;if(r)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r)return e.props.ref;return e.props.ref||e.ref}(r),o=function(e,t){const r={...t};for(const n in t){const a=e[n],o=t[n];/^on[A-Z]/.test(n)?a&&o?r[n]=(...e)=>{const t=o(...e);return a(...e),t}:a&&(r[n]=a):"style"===n?r[n]={...a,...o}:"className"===n&&(r[n]=[a,o].filter(Boolean).join(" "))}return{...e,...r}}(n,r.props);return r.type!==a.Fragment&&(o.ref=t?Fo(t,e):e),a.cloneElement(r,o)}return a.Children.count(r)>1?a.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Go=Symbol("radix.slottable");function Ko(e){return a.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===Go}const Ho=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,Zo=Na,qo=(e,t)=>r=>{var n;if(null==(null==t?void 0:t.variants))return Zo(e,null==r?void 0:r.class,null==r?void 0:r.className);const{variants:a,defaultVariants:o}=t,s=Object.keys(a).map(e=>{const t=null==r?void 0:r[e],n=null==o?void 0:o[e];if(null===t)return null;const s=Ho(t)||Ho(n);return a[e][s]}),i=r&&Object.entries(r).reduce((e,t)=>{let[r,n]=t;return void 0===n||(e[r]=n),e},{}),l=null==t||null===(n=t.compoundVariants)||void 0===n?void 0:n.reduce((e,t)=>{let{class:r,className:n,...a}=t;return Object.entries(a).every(e=>{let[t,r]=e;return Array.isArray(r)?r.includes({...o,...i}[t]):{...o,...i}[t]===r})?[...e,r,n]:e},[]);return Zo(e,s,l,null==r?void 0:r.class,null==r?void 0:r.className)},Jo=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Yo=e=>{const t=(e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,r)=>r?r.toUpperCase():t.toLowerCase()))(e);return t.charAt(0).toUpperCase()+t.slice(1)},Xo=(...e)=>e.filter((e,t,r)=>Boolean(e)&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim(),Qo=e=>{for(const t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0};
1
+ "use strict";var e=require("react/jsx-runtime"),t=require("react"),r=require("react-dom");function n(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}}),t.default=e,Object.freeze(t)}var a=n(t),o=n(r);exports.ApiVersion=void 0,(exports.ApiVersion||(exports.ApiVersion={})).V1="v1";const s=()=>({type:"AUTHENTICATION_STARTED"}),i=()=>({type:"AUTHENTICATION_FAILED"}),l=e=>({type:"SET_SESSION",payload:e}),c=()=>({type:"REMOVE_SESSION"});function d({name:r,initialState:n,reducer:a,initializer:o}){const s=t.createContext(null),i=t.createContext(null),l=t.createContext(null),c=t.memo(({children:r})=>{const[c,d]=t.useReducer(a,n,o||(e=>e)),u=t.useMemo(()=>({state:c,dispatch:d}),[c,d]);return e.jsx(l.Provider,{value:u,children:e.jsx(s.Provider,{value:c,children:e.jsx(i.Provider,{value:d,children:r})})})});c.displayName=`${r}Provider`;const d=()=>{const e=t.useContext(s);if(null===e)throw new Error(`use${r}State must be used within a ${r}Provider. Make sure SaaSOSProvider is wrapping your application.`);return e};return{Provider:c,useContext:()=>{const e=t.useContext(l);if(!e)throw new Error(`use${r}Context must be used within a ${r}Provider. Make sure SaaSOSProvider is wrapping your application.`);return e},useState:d,useDispatch:()=>{const e=t.useContext(i);if(null===e)throw new Error(`use${r}Dispatch must be used within a ${r}Provider. Make sure SaaSOSProvider is wrapping your application.`);return e},useSelector:(e,r)=>{const n=d(),a=e||(e=>e),o=t.useRef(a),s=t.useRef(r),i=t.useRef(void 0),l=t.useRef(n);e&&(o.current=a),r&&(s.current=r);return t.useMemo(()=>{const e=o.current(n);if(void 0!==i.current){if((s.current?s.current(i.current,e):Object.is(i.current,e))&&l.current===n)return i.current}return i.current=e,l.current=n,e},[n])}}}var u;function f(e){if("undefined"==typeof window)return null;try{return localStorage.getItem(e)}catch(t){return console.warn(`Failed to load ${e} from localStorage:`,t),null}}function m(e,t){if("undefined"!=typeof window)try{localStorage.setItem(e,t)}catch(t){console.warn(`Failed to save ${e} to localStorage:`,t)}}function p(e){if("undefined"!=typeof window)try{localStorage.removeItem(e)}catch(t){console.warn(`Failed to remove ${e} from localStorage:`,t)}}!function(e){e.loading="loading",e.authenticated="authenticated",e.unauthenticated="unauthenticated",e.authenticating="authenticating"}(u||(u={}));const h="code",g="saas-session-id";function v(){p(g)}function b(){if("undefined"==typeof window)return null;try{return f(g)}catch(e){return console.warn("Failed to get sessionId from localStorage:",e),null}}function y(){const e=b(),t={};return e&&(t["x-session-id"]=e),t}function w(e,t){return{user:e,sessionId:t,expires:new Date(Date.now()+864e5).toISOString()}}const x=()=>({session:null,isLoading:!1,isAuthenticated:!1,isRedirecting:!1,status:u.unauthenticated}),{Provider:S,useState:k,useDispatch:A}=d({name:"Auth",initialState:x(),reducer:(e,t)=>{switch(t.type){case"AUTHENTICATION_STARTED":return{...e,isLoading:!0,isAuthenticated:!1,isRedirecting:!0,status:u.authenticating};case"AUTHENTICATION_FAILED":return{...e,isLoading:!1,isAuthenticated:!1,isRedirecting:!1,status:u.unauthenticated};case"SET_SESSION":{const n=t.payload;return r=n.sessionId,m(g,r),{...e,session:n,isAuthenticated:!0,isRedirecting:!1,isLoading:!1,status:u.authenticated}}case"REMOVE_SESSION":return v(),{...e,session:null,isLoading:!1,isAuthenticated:!1,isRedirecting:!1,status:u.unauthenticated};default:return e}var r},initializer:x}),E=S,C=k,j=A,T=e=>({type:"SET_SAAS_OS_CONFIG",payload:e}),N=e=>({type:"SET_SETTINGS",payload:e}),_=()=>({serverUrl:"",version:exports.ApiVersion.V1,orgId:"",settings:null}),{Provider:R,useState:P,useDispatch:O}=d({name:"OS",initialState:_(),reducer:(e,t)=>{switch(t.type){case"SET_SAAS_OS_CONFIG":return{...e,...t.payload};case"REMOVE_SAAS_OS_CONFIG":return _();case"SET_SETTINGS":return{...e,settings:t.payload};default:return e}}}),D=R,I=P,M=O,U=e=>({type:"SET_WORKSPACES",payload:e}),L=e=>({type:"SET_ALL_FEATURES",payload:e}),F=e=>({type:"SET_CURRENT_WORKSPACE",payload:e}),z=()=>({type:"RESET_CURRENT_WORKSPACE"}),B=e=>({type:"SET_IS_INITIALIZED",payload:e}),V=e=>({type:"SET_LOADING",payload:e}),W=e=>({type:"SET_ERROR",payload:e}),$=e=>({type:"SET_REFRESHING",payload:e}),G="saas-workspace-current";const{Provider:K,useState:H,useDispatch:Z}=d({name:"Workspace",initialState:{workspaces:[],loading:!1,error:null,currentWorkspace:null,refreshing:!1,switching:!1,isInitialized:!1,allFeatures:[]},reducer:(e,t)=>{switch(t.type){case"SET_WORKSPACES":return{...e,workspaces:t.payload};case"SET_ALL_FEATURES":return{...e,allFeatures:t.payload};case"SET_CURRENT_WORKSPACE":return(r=t.payload._id)?m(G,r):p(G),{...e,currentWorkspace:t.payload};case"RESET_CURRENT_WORKSPACE":return p(G),{...e,currentWorkspace:null};case"SET_IS_INITIALIZED":return{...e,isInitialized:t.payload};case"SET_LOADING":return{...e,loading:t.payload};case"SET_ERROR":return{...e,error:t.payload};case"SET_REFRESHING":return{...e,refreshing:t.payload};case"SET_SWITCHING":return{...e,switching:t.payload};default:return e}var r}}),q=K,J=H,Y=Z,X=t.memo(({children:t})=>e.jsx(D,{children:e.jsx(E,{children:e.jsx(q,{children:t})})}));function Q(e,r){const n=I(),a=C(),o=J(),s=t.useMemo(()=>({os:n,auth:a,workspaces:o}),[n,a,o]),i=e||(e=>e),l=t.useRef(i),c=t.useRef(r),d=t.useRef(void 0),u=t.useRef(s);e&&(l.current=i);return t.useMemo(()=>{const e=l.current(s);if(void 0!==d.current){if((c.current?c.current(d.current,e):Object.is(d.current,e))&&u.current===s)return d.current}return d.current=e,u.current=s,e},[s])}function ee(){const e=j(),r=M(),n=Y();return t.useMemo(()=>({auth:e,os:r,workspaces:n}),[e,r,n])}X.displayName="SDKContextProvider";const te=t.memo(({children:r,callbacks:n})=>{const a=ee(),o=Q(e=>e.auth),s=Q(e=>e.os),c=t.useRef(!1),d=t.useRef(null),u=t.useMemo(()=>n,[n]),f=t.useCallback(async e=>{try{if(u?.handleAuthentication){const{sessionId:t}=await u.handleAuthentication(e);if(!t||"string"!=typeof t||""===t.trim())throw new Error("Invalid sessionId received from authentication callback");const r=s,{serverUrl:n,version:o,orgId:i}=r;if(!n||!o||!i)throw new Error("OS configuration is not available");const c=await fetch(`${n}/api/${o}/public/profile`,{headers:{"x-session-id":t,"Content-Type":"application/json"}});if(!c.ok)throw new Error("Failed to fetch user profile");let d;try{d=await c.json()}catch(e){throw new Error("Failed to parse user profile response")}const f=w({id:d._id||d.id,name:d.name||"",org:i,email:d.email||"",emailVerified:!0,clientId:r.auth?.clientId||"",role:d.role||"",image:d.image},t);a.auth(l(f)),function(){try{const e=new URL(window.location.href);e.searchParams.delete(h),window.history.replaceState({},"",e.toString())}catch(e){console.error("Error removing token from URL:",e)}}()}}catch(e){throw console.error("Auth redirect error:",e),a.auth(i()),e}},[a,u,s]);return t.useEffect(()=>{if("undefined"==typeof window)return;if(o.isAuthenticated)return;const e=b();if(!e)return;(async()=>{try{const{serverUrl:t,version:r,orgId:n}=s;if(!t||!r||!n)return void console.warn("OS configuration not available, cannot fetch user profile");const o=await fetch(`${t}/api/${r}/public/profile`,{headers:{"x-session-id":e,"Content-Type":"application/json"}});if(!o.ok)return console.warn("Session invalid, removing from localStorage"),void v();let i;try{i=await o.json()}catch(e){return console.error("Failed to parse user profile response:",e),void v()}const c=w({id:i._id||i.id,name:i.name||"",org:n,email:i.email||"",emailVerified:!0,clientId:s.auth?.clientId||"",role:i.role||"",image:i.image},e);a.auth(l(c))}catch(e){console.error("Failed to fetch user profile on page load:",e),v()}})()},[o.isAuthenticated,a,s]),t.useEffect(()=>{const e=function(){if("undefined"==typeof window)return null;try{return new URLSearchParams(window.location.search).get(h)}catch(e){return console.error("Error getting token from URL:",e),null}}();if(!e)return;if(c.current||d.current===e)return;const{serverUrl:t,version:r,orgId:n}=s;t&&r&&n&&(c.current=!0,d.current=e,f(e).then(()=>{d.current=null}).catch(e=>{console.error("Failed to handle auth redirect:",e),d.current=null}).finally(()=>{c.current=!1}))},[f,s.serverUrl,s.version,s.orgId]),e.jsx(e.Fragment,{children:r})});te.displayName="AuthProviderWrapper";const re=t.memo(({config:r,auth:n,children:a})=>{const o=ee(),s=Q(e=>e.os),i=t.useMemo(()=>({clientId:n?.clientId||"",redirectUrl:n?.redirectUrl||"",callbacks:n?.callbacks}),[n?.clientId,n?.redirectUrl,n?.callbacks]);t.useEffect(()=>{o.os(T({...r,auth:i}))},[r,i,o]),t.useEffect(()=>{const{serverUrl:e,version:t,orgId:r,settings:n}=s;if(e&&t&&r&&!n){(async()=>{try{const n=y(),a=await fetch(`${e}/api/${t}/public/${r}/settings`,{headers:n});if(a.ok){const e=await a.json();o.os(N(e))}}catch(e){console.error("Failed to fetch settings:",e)}})()}},[s.serverUrl,s.version,s.orgId,s.settings,o]);const l=t.useMemo(()=>a,[a]);return e.jsx(e.Fragment,{children:l})});re.displayName="ContextConfigProvider";const ne=new class{constructor(){this.callbacks=null}setCallbacks(e){this.callbacks=e}getCallbacks(){return this.callbacks}async emit(e,t){if(this.callbacks?.handleEvent)try{await this.callbacks.handleEvent(e,t)}catch(t){console.error(`Error in handleEvent callback for ${e}:`,t)}}async emitUserCreated(e){await this.emit("user:created",{user:e})}async emitUserUpdated(e,t){await this.emit("user:updated",{user:e,previousUser:t})}async emitWorkspaceChanged(e,t){await this.emit("workspace:changed",{workspace:e,previousWorkspace:t})}async emitWorkspaceUpdated(e){await this.emit("workspace:updated",{workspace:e})}async emitWorkspaceUserAdded(e,t,r){await this.emit("workspace:user-added",{userId:e,workspace:t,role:r})}async emitWorkspaceUserRemoved(e,t,r){await this.emit("workspace:user-removed",{userId:e,workspace:t,role:r})}async emitWorkspaceUserRoleChanged(e,t,r,n){await this.emit("workspace:user-role-changed",{userId:e,workspace:t,previousRole:r,newRole:n})}async emitWorkspaceCreated(e){await this.emit("workspace:created",{workspace:e})}async emitWorkspaceDeleted(e){await this.emit("workspace:deleted",{workspace:e})}},ae=t.createContext({container:null,setContainer:()=>{}}),oe=t.memo(({children:r})=>{const[n,a]=t.useState(null),o=t.useMemo(()=>({container:n,setContainer:a}),[n]),s=t.useMemo(()=>r,[r]);return e.jsxs(ae.Provider,{value:o,children:[s,e.jsx("div",{ref:a,id:"saas-os-portal",className:"saas-os-ui",style:{width:"100%",height:"100%"}})]})});oe.displayName="PortalProvider";const se=(e,t,r)=>{if(t!==exports.ApiVersion.V1)throw new Error(`Invalid version: "${t}". Only "${exports.ApiVersion.V1}" is currently supported.`);if(!e||"string"!=typeof e)throw new Error("serverUrl is required and must be a string");if(!(e=>{try{return new URL(e),!0}catch{return!1}})(e))throw new Error(`Invalid serverUrl: "${e}". Must be a valid URL.`);if(!r||"string"!=typeof r)throw new Error("orgId is required and must be a string");if(!/^[0-9a-fA-F]{24}$/.test(r))throw new Error(`Invalid orgId: "${r}". Must be a valid MongoDB ObjectId (24 hexadecimal characters).`)},ie=t.memo(({serverUrl:r,version:n,orgId:a,auth:o,children:s})=>{se(r,n,a);const i=t.useMemo(()=>({serverUrl:r,version:n,orgId:a}),[r,n,a]),l=t.useMemo(()=>o?.callbacks,[o?.callbacks]),c=t.useMemo(()=>o?.callbacks?.handleEvent,[o?.callbacks]);return t.useEffect(()=>(ne.setCallbacks(c?{handleEvent:c}:null),()=>{ne.setCallbacks(null)}),[c]),e.jsx(X,{children:e.jsx(te,{callbacks:l,children:e.jsx(oe,{children:e.jsx(re,{config:i,auth:o,children:s})})})})});ie.displayName="SaaSOSProvider";var le=e=>"checkbox"===e.type,ce=e=>e instanceof Date,de=e=>null==e;const ue=e=>"object"==typeof e;var fe=e=>!de(e)&&!Array.isArray(e)&&ue(e)&&!ce(e),me=e=>fe(e)&&e.target?le(e.target)?e.target.checked:e.target.value:e,pe=(e,t)=>e.has((e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e)(t)),he="undefined"!=typeof window&&void 0!==window.HTMLElement&&"undefined"!=typeof document;function ge(e){let t;const r=Array.isArray(e),n="undefined"!=typeof FileList&&e instanceof FileList;if(e instanceof Date)t=new Date(e);else{if(he&&(e instanceof Blob||n)||!r&&!fe(e))return e;if(t=r?[]:Object.create(Object.getPrototypeOf(e)),r||(e=>{const t=e.constructor&&e.constructor.prototype;return fe(t)&&t.hasOwnProperty("isPrototypeOf")})(e))for(const r in e)e.hasOwnProperty(r)&&(t[r]=ge(e[r]));else t=e}return t}var ve=e=>/^\w*$/.test(e),be=e=>void 0===e,ye=e=>Array.isArray(e)?e.filter(Boolean):[],we=e=>ye(e.replace(/["|']|\]/g,"").split(/\.|\[/)),xe=(e,t,r)=>{if(!t||!fe(e))return r;const n=(ve(t)?[t]:we(t)).reduce((e,t)=>de(e)?e:e[t],e);return be(n)||n===e?be(e[t])?r:e[t]:n},Se=e=>"boolean"==typeof e,ke=(e,t,r)=>{let n=-1;const a=ve(t)?[t]:we(t),o=a.length,s=o-1;for(;++n<o;){const t=a[n];let o=r;if(n!==s){const r=e[t];o=fe(r)||Array.isArray(r)?r:isNaN(+a[n+1])?{}:[]}if("__proto__"===t||"constructor"===t||"prototype"===t)return;e[t]=o,e=e[t]}};const Ae="blur",Ee="focusout",Ce="change",je="onBlur",Te="onChange",Ne="onSubmit",_e="onTouched",Re="all",Pe="max",Oe="min",De="maxLength",Ie="minLength",Me="pattern",Ue="required",Le="validate",Fe=t.createContext(null);Fe.displayName="HookFormContext";const ze=()=>t.useContext(Fe),Be=e=>{const{children:r,...n}=e;return t.createElement(Fe.Provider,{value:n},r)};var Ve=(e,t,r,n=!0)=>{const a={defaultValues:t._defaultValues};for(const o in e)Object.defineProperty(a,o,{get:()=>{const a=o;return t._proxyFormState[a]!==Re&&(t._proxyFormState[a]=!n||Re),r&&(r[a]=!0),e[a]}});return a};const We="undefined"!=typeof window?t.useLayoutEffect:t.useEffect;var $e=e=>"string"==typeof e,Ge=(e,t,r,n,a)=>$e(e)?(n&&t.watch.add(e),xe(r,e,a)):Array.isArray(e)?e.map(e=>(n&&t.watch.add(e),xe(r,e))):(n&&(t.watchAll=!0),r),Ke=e=>de(e)||!ue(e);function He(e,t,r=new WeakSet){if(Ke(e)||Ke(t))return e===t;if(ce(e)&&ce(t))return e.getTime()===t.getTime();const n=Object.keys(e),a=Object.keys(t);if(n.length!==a.length)return!1;if(r.has(e)||r.has(t))return!0;r.add(e),r.add(t);for(const o of n){const n=e[o];if(!a.includes(o))return!1;if("ref"!==o){const e=t[o];if(ce(n)&&ce(e)||fe(n)&&fe(e)||Array.isArray(n)&&Array.isArray(e)?!He(n,e,r):n!==e)return!1}}return!0}function Ze(e){const r=ze(),{name:n,disabled:a,control:o=r.control,shouldUnregister:s,defaultValue:i}=e,l=pe(o._names.array,n),c=t.useMemo(()=>xe(o._formValues,n,xe(o._defaultValues,n,i)),[o,n,i]),d=function(e){const r=ze(),{control:n=r.control,name:a,defaultValue:o,disabled:s,exact:i,compute:l}=e||{},c=t.useRef(o),d=t.useRef(l),u=t.useRef(void 0);d.current=l;const f=t.useMemo(()=>n._getWatch(a,c.current),[n,a]),[m,p]=t.useState(d.current?d.current(f):f);return We(()=>n._subscribe({name:a,formState:{values:!0},exact:i,callback:e=>{if(!s){const t=Ge(a,n._names,e.values||n._formValues,!1,c.current);if(d.current){const e=d.current(t);He(e,u.current)||(p(e),u.current=e)}else p(t)}}}),[n,s,a,i]),t.useEffect(()=>n._removeUnmounted()),m}({control:o,name:n,defaultValue:c,exact:!0}),u=function(e){const r=ze(),{control:n=r.control,disabled:a,name:o,exact:s}=e||{},[i,l]=t.useState(n._formState),c=t.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return We(()=>n._subscribe({name:o,formState:c.current,exact:s,callback:e=>{!a&&l({...n._formState,...e})}}),[o,a,s]),t.useEffect(()=>{c.current.isValid&&n._setValid(!0)},[n]),t.useMemo(()=>Ve(i,n,c.current,!1),[i,n])}({control:o,name:n,exact:!0}),f=t.useRef(e),m=t.useRef(o.register(n,{...e.rules,value:d,...Se(e.disabled)?{disabled:e.disabled}:{}}));f.current=e;const p=t.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!xe(u.errors,n)},isDirty:{enumerable:!0,get:()=>!!xe(u.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!xe(u.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!xe(u.validatingFields,n)},error:{enumerable:!0,get:()=>xe(u.errors,n)}}),[u,n]),h=t.useCallback(e=>m.current.onChange({target:{value:me(e),name:n},type:Ce}),[n]),g=t.useCallback(()=>m.current.onBlur({target:{value:xe(o._formValues,n),name:n},type:Ae}),[n,o._formValues]),v=t.useCallback(e=>{const t=xe(o._fields,n);t&&e&&(t._f.ref={focus:()=>e.focus&&e.focus(),select:()=>e.select&&e.select(),setCustomValidity:t=>e.setCustomValidity(t),reportValidity:()=>e.reportValidity()})},[o._fields,n]),b=t.useMemo(()=>({name:n,value:d,...Se(a)||u.disabled?{disabled:u.disabled||a}:{},onChange:h,onBlur:g,ref:v}),[n,a,u.disabled,h,g,v,d]);return t.useEffect(()=>{const e=o._options.shouldUnregister||s;o.register(n,{...f.current.rules,...Se(f.current.disabled)?{disabled:f.current.disabled}:{}});const t=(e,t)=>{const r=xe(o._fields,e);r&&r._f&&(r._f.mount=t)};if(t(n,!0),e){const e=ge(xe(o._options.defaultValues,n));ke(o._defaultValues,n,e),be(xe(o._formValues,n))&&ke(o._formValues,n,e)}return!l&&o.register(n),()=>{(l?e&&!o._state.action:e)?o.unregister(n):t(n,!1)}},[n,o,l,s]),t.useEffect(()=>{o._setDisabledField({disabled:a,name:n})},[a,n,o]),t.useMemo(()=>({field:b,formState:u,fieldState:p}),[b,u,p])}const qe=e=>e.render(Ze(e));var Je=(e,t,r,n,a)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:a||!0}}:{},Ye=e=>Array.isArray(e)?e:[e],Xe=()=>{let e=[];return{get observers(){return e},next:t=>{for(const r of e)r.next&&r.next(t)},subscribe:t=>(e.push(t),{unsubscribe:()=>{e=e.filter(e=>e!==t)}}),unsubscribe:()=>{e=[]}}},Qe=e=>fe(e)&&!Object.keys(e).length,et=e=>"file"===e.type,tt=e=>"function"==typeof e,rt=e=>{if(!he)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},nt=e=>"select-multiple"===e.type,at=e=>"radio"===e.type,ot=e=>rt(e)&&e.isConnected;function st(e,t){const r=Array.isArray(t)?t:ve(t)?[t]:we(t),n=1===r.length?e:function(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;)e=be(e)?n++:e[t[n++]];return e}(e,r),a=r.length-1,o=r[a];return n&&delete n[o],0!==a&&(fe(n)&&Qe(n)||Array.isArray(n)&&function(e){for(const t in e)if(e.hasOwnProperty(t)&&!be(e[t]))return!1;return!0}(n))&&st(e,r.slice(0,-1)),e}var it=e=>{for(const t in e)if(tt(e[t]))return!0;return!1};function lt(e,t={}){const r=Array.isArray(e);if(fe(e)||r)for(const r in e)Array.isArray(e[r])||fe(e[r])&&!it(e[r])?(t[r]=Array.isArray(e[r])?[]:{},lt(e[r],t[r])):de(e[r])||(t[r]=!0);return t}function ct(e,t,r){const n=Array.isArray(e);if(fe(e)||n)for(const n in e)Array.isArray(e[n])||fe(e[n])&&!it(e[n])?be(t)||Ke(r[n])?r[n]=Array.isArray(e[n])?lt(e[n],[]):{...lt(e[n])}:ct(e[n],de(t)?{}:t[n],r[n]):r[n]=!He(e[n],t[n]);return r}var dt=(e,t)=>ct(e,t,lt(t));const ut={value:!1,isValid:!1},ft={value:!0,isValid:!0};var mt=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(e=>e&&e.checked&&!e.disabled).map(e=>e.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!be(e[0].attributes.value)?be(e[0].value)||""===e[0].value?ft:{value:e[0].value,isValid:!0}:ft:ut}return ut},pt=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>be(e)?e:t?""===e?NaN:e?+e:e:r&&$e(e)?new Date(e):n?n(e):e;const ht={isValid:!1,value:null};var gt=e=>Array.isArray(e)?e.reduce((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e,ht):ht;function vt(e){const t=e.ref;return et(t)?t.files:at(t)?gt(e.refs).value:nt(t)?[...t.selectedOptions].map(({value:e})=>e):le(t)?mt(e.refs).value:pt(be(t.value)?e.ref.value:t.value,e)}var bt=e=>e instanceof RegExp,yt=e=>be(e)?e:bt(e)?e.source:fe(e)?bt(e.value)?e.value.source:e.value:e,wt=e=>({isOnSubmit:!e||e===Ne,isOnBlur:e===je,isOnChange:e===Te,isOnAll:e===Re,isOnTouch:e===_e});const xt="AsyncFunction";var St=e=>!!e&&!!e.validate&&!!(tt(e.validate)&&e.validate.constructor.name===xt||fe(e.validate)&&Object.values(e.validate).find(e=>e.constructor.name===xt)),kt=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(t=>e.startsWith(t)&&/^\.\w+/.test(e.slice(t.length))));const At=(e,t,r,n)=>{for(const a of r||Object.keys(e)){const r=xe(e,a);if(r){const{_f:e,...o}=r;if(e){if(e.refs&&e.refs[0]&&t(e.refs[0],a)&&!n)return!0;if(e.ref&&t(e.ref,e.name)&&!n)return!0;if(At(o,t))break}else if(fe(o)&&At(o,t))break}}};function Et(e,t,r){const n=xe(e,r);if(n||ve(r))return{error:n,name:r};const a=r.split(".");for(;a.length;){const n=a.join("."),o=xe(t,n),s=xe(e,n);if(o&&!Array.isArray(o)&&r!==n)return{name:r};if(s&&s.type)return{name:n,error:s};if(s&&s.root&&s.root.type)return{name:`${n}.root`,error:s.root};a.pop()}return{name:r}}var Ct=(e,t,r)=>{const n=Ye(xe(e,r));return ke(n,"root",t[r]),ke(e,r,n),e},jt=e=>$e(e);function Tt(e,t,r="validate"){if(jt(e)||Array.isArray(e)&&e.every(jt)||Se(e)&&!e)return{type:r,message:jt(e)?e:"",ref:t}}var Nt=e=>fe(e)&&!bt(e)?e:{value:e,message:""},_t=async(e,t,r,n,a,o)=>{const{ref:s,refs:i,required:l,maxLength:c,minLength:d,min:u,max:f,pattern:m,validate:p,name:h,valueAsNumber:g,mount:v}=e._f,b=xe(r,h);if(!v||t.has(h))return{};const y=i?i[0]:s,w=e=>{a&&y.reportValidity&&(y.setCustomValidity(Se(e)?"":e||""),y.reportValidity())},x={},S=at(s),k=le(s),A=S||k,E=(g||et(s))&&be(s.value)&&be(b)||rt(s)&&""===s.value||""===b||Array.isArray(b)&&!b.length,C=Je.bind(null,h,n,x),j=(e,t,r,n=De,a=Ie)=>{const o=e?t:r;x[h]={type:e?n:a,message:o,ref:s,...C(e?n:a,o)}};if(o?!Array.isArray(b)||!b.length:l&&(!A&&(E||de(b))||Se(b)&&!b||k&&!mt(i).isValid||S&&!gt(i).isValid)){const{value:e,message:t}=jt(l)?{value:!!l,message:l}:Nt(l);if(e&&(x[h]={type:Ue,message:t,ref:y,...C(Ue,t)},!n))return w(t),x}if(!(E||de(u)&&de(f))){let e,t;const r=Nt(f),a=Nt(u);if(de(b)||isNaN(b)){const n=s.valueAsDate||new Date(b),o=e=>new Date((new Date).toDateString()+" "+e),i="time"==s.type,l="week"==s.type;$e(r.value)&&b&&(e=i?o(b)>o(r.value):l?b>r.value:n>new Date(r.value)),$e(a.value)&&b&&(t=i?o(b)<o(a.value):l?b<a.value:n<new Date(a.value))}else{const n=s.valueAsNumber||(b?+b:b);de(r.value)||(e=n>r.value),de(a.value)||(t=n<a.value)}if((e||t)&&(j(!!e,r.message,a.message,Pe,Oe),!n))return w(x[h].message),x}if((c||d)&&!E&&($e(b)||o&&Array.isArray(b))){const e=Nt(c),t=Nt(d),r=!de(e.value)&&b.length>+e.value,a=!de(t.value)&&b.length<+t.value;if((r||a)&&(j(r,e.message,t.message),!n))return w(x[h].message),x}if(m&&!E&&$e(b)){const{value:e,message:t}=Nt(m);if(bt(e)&&!b.match(e)&&(x[h]={type:Me,message:t,ref:s,...C(Me,t)},!n))return w(t),x}if(p)if(tt(p)){const e=Tt(await p(b,r),y);if(e&&(x[h]={...e,...C(Le,e.message)},!n))return w(e.message),x}else if(fe(p)){let e={};for(const t in p){if(!Qe(e)&&!n)break;const a=Tt(await p[t](b,r),y,t);a&&(e={...a,...C(t,a.message)},w(a.message),n&&(x[h]=e))}if(!Qe(e)&&(x[h]={ref:y,...e},!n))return x}return w(!0),x};const Rt={mode:Ne,reValidateMode:Te,shouldFocusError:!0};function Pt(e={}){let t,r={...Rt,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:tt(r.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:r.errors||{},disabled:r.disabled||!1},a={},o=(fe(r.defaultValues)||fe(r.values))&&ge(r.defaultValues||r.values)||{},s=r.shouldUnregister?{}:ge(o),i={action:!1,mount:!1,watch:!1},l={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},c=0;const d={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let u={...d};const f={array:Xe(),state:Xe()},m=r.criteriaMode===Re,p=async e=>{if(!r.disabled&&(d.isValid||u.isValid||e)){const e=r.resolver?Qe((await y()).errors):await w(a,!0);e!==n.isValid&&f.state.next({isValid:e})}},h=(e,t)=>{!r.disabled&&(d.isValidating||d.validatingFields||u.isValidating||u.validatingFields)&&((e||Array.from(l.mount)).forEach(e=>{e&&(t?ke(n.validatingFields,e,t):st(n.validatingFields,e))}),f.state.next({validatingFields:n.validatingFields,isValidating:!Qe(n.validatingFields)}))},g=(e,t,r,n)=>{const l=xe(a,e);if(l){const a=xe(s,e,be(r)?xe(o,e):r);be(a)||n&&n.defaultChecked||t?ke(s,e,t?a:vt(l._f)):k(e,a),i.mount&&p()}},v=(e,t,a,s,i)=>{let l=!1,c=!1;const m={name:e};if(!r.disabled){if(!a||s){(d.isDirty||u.isDirty)&&(c=n.isDirty,n.isDirty=m.isDirty=x(),l=c!==m.isDirty);const r=He(xe(o,e),t);c=!!xe(n.dirtyFields,e),r?st(n.dirtyFields,e):ke(n.dirtyFields,e,!0),m.dirtyFields=n.dirtyFields,l=l||(d.dirtyFields||u.dirtyFields)&&c!==!r}if(a){const t=xe(n.touchedFields,e);t||(ke(n.touchedFields,e,a),m.touchedFields=n.touchedFields,l=l||(d.touchedFields||u.touchedFields)&&t!==a)}l&&i&&f.state.next(m)}return l?m:{}},b=(e,a,o,s)=>{const i=xe(n.errors,e),l=(d.isValid||u.isValid)&&Se(a)&&n.isValid!==a;var m;if(r.delayError&&o?(m=()=>((e,t)=>{ke(n.errors,e,t),f.state.next({errors:n.errors})})(e,o),t=e=>{clearTimeout(c),c=setTimeout(m,e)},t(r.delayError)):(clearTimeout(c),t=null,o?ke(n.errors,e,o):st(n.errors,e)),(o?!He(i,o):i)||!Qe(s)||l){const t={...s,...l&&Se(a)?{isValid:a}:{},errors:n.errors,name:e};n={...n,...t},f.state.next(t)}},y=async e=>{h(e,!0);const t=await r.resolver(s,r.context,((e,t,r,n)=>{const a={};for(const r of e){const e=xe(t,r);e&&ke(a,r,e._f)}return{criteriaMode:r,names:[...e],fields:a,shouldUseNativeValidation:n}})(e||l.mount,a,r.criteriaMode,r.shouldUseNativeValidation));return h(e),t},w=async(e,t,a={valid:!0})=>{for(const o in e){const i=e[o];if(i){const{_f:e,...c}=i;if(e){const c=l.array.has(e.name),u=i._f&&St(i._f);u&&d.validatingFields&&h([o],!0);const f=await _t(i,l.disabled,s,m,r.shouldUseNativeValidation&&!t,c);if(u&&d.validatingFields&&h([o]),f[e.name]&&(a.valid=!1,t))break;!t&&(xe(f,e.name)?c?Ct(n.errors,f,e.name):ke(n.errors,e.name,f[e.name]):st(n.errors,e.name))}!Qe(c)&&await w(c,t,a)}}return a.valid},x=(e,t)=>!r.disabled&&(e&&t&&ke(s,e,t),!He(N(),o)),S=(e,t,r)=>Ge(e,l,{...i.mount?s:be(t)?o:$e(e)?{[e]:t}:t},r,t),k=(e,t,r={})=>{const n=xe(a,e);let o=t;if(n){const r=n._f;r&&(!r.disabled&&ke(s,e,pt(t,r)),o=rt(r.ref)&&de(t)?"":t,nt(r.ref)?[...r.ref.options].forEach(e=>e.selected=o.includes(e.value)):r.refs?le(r.ref)?r.refs.forEach(e=>{e.defaultChecked&&e.disabled||(Array.isArray(o)?e.checked=!!o.find(t=>t===e.value):e.checked=o===e.value||!!o)}):r.refs.forEach(e=>e.checked=e.value===o):et(r.ref)?r.ref.value="":(r.ref.value=o,r.ref.type||f.state.next({name:e,values:ge(s)})))}(r.shouldDirty||r.shouldTouch)&&v(e,o,r.shouldTouch,r.shouldDirty,!0),r.shouldValidate&&T(e)},A=(e,t,r)=>{for(const n in t){if(!t.hasOwnProperty(n))return;const o=t[n],s=e+"."+n,i=xe(a,s);(l.array.has(e)||fe(o)||i&&!i._f)&&!ce(o)?A(s,o,r):k(s,o,r)}},E=(e,t,r={})=>{const c=xe(a,e),m=l.array.has(e),p=ge(t);ke(s,e,p),m?(f.array.next({name:e,values:ge(s)}),(d.isDirty||d.dirtyFields||u.isDirty||u.dirtyFields)&&r.shouldDirty&&f.state.next({name:e,dirtyFields:dt(o,s),isDirty:x(e,p)})):!c||c._f||de(p)?k(e,p,r):A(e,p,r),kt(e,l)&&f.state.next({...n,name:e}),f.state.next({name:i.mount?e:void 0,values:ge(s)})},C=async e=>{i.mount=!0;const o=e.target;let c=o.name,g=!0;const x=xe(a,c),S=e=>{g=Number.isNaN(e)||ce(e)&&isNaN(e.getTime())||He(e,xe(s,c,e))},k=wt(r.mode),A=wt(r.reValidateMode);if(x){let i,E;const C=o.type?vt(x._f):me(e),j=e.type===Ae||e.type===Ee,N=!(e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate))(x._f)&&!r.resolver&&!xe(n.errors,c)&&!x._f.deps||((e,t,r,n,a)=>!a.isOnAll&&(!r&&a.isOnTouch?!(t||e):(r?n.isOnBlur:a.isOnBlur)?!e:!(r?n.isOnChange:a.isOnChange)||e))(j,xe(n.touchedFields,c),n.isSubmitted,A,k),_=kt(c,l,j);ke(s,c,C),j?o&&o.readOnly||(x._f.onBlur&&x._f.onBlur(e),t&&t(0)):x._f.onChange&&x._f.onChange(e);const R=v(c,C,j),P=!Qe(R)||_;if(!j&&f.state.next({name:c,type:e.type,values:ge(s)}),N)return(d.isValid||u.isValid)&&("onBlur"===r.mode?j&&p():j||p()),P&&f.state.next({name:c,..._?{}:R});if(!j&&_&&f.state.next({...n}),r.resolver){const{errors:e}=await y([c]);if(S(C),g){const t=Et(n.errors,a,c),r=Et(e,a,t.name||c);i=r.error,c=r.name,E=Qe(e)}}else h([c],!0),i=(await _t(x,l.disabled,s,m,r.shouldUseNativeValidation))[c],h([c]),S(C),g&&(i?E=!1:(d.isValid||u.isValid)&&(E=await w(a,!0)));g&&(x._f.deps&&T(x._f.deps),b(c,E,i,R))}},j=(e,t)=>{if(xe(n.errors,t)&&e.focus)return e.focus(),1},T=async(e,t={})=>{let o,s;const i=Ye(e);if(r.resolver){const t=await(async e=>{const{errors:t}=await y(e);if(e)for(const r of e){const e=xe(t,r);e?ke(n.errors,r,e):st(n.errors,r)}else n.errors=t;return t})(be(e)?e:i);o=Qe(t),s=e?!i.some(e=>xe(t,e)):o}else e?(s=(await Promise.all(i.map(async e=>{const t=xe(a,e);return await w(t&&t._f?{[e]:t}:t)}))).every(Boolean),(s||n.isValid)&&p()):s=o=await w(a);return f.state.next({...!$e(e)||(d.isValid||u.isValid)&&o!==n.isValid?{}:{name:e},...r.resolver||!e?{isValid:o}:{},errors:n.errors}),t.shouldFocus&&!s&&At(a,j,e?i:l.mount),s},N=e=>{const t={...i.mount?s:o};return be(e)?t:$e(e)?xe(t,e):e.map(e=>xe(t,e))},_=(e,t)=>({invalid:!!xe((t||n).errors,e),isDirty:!!xe((t||n).dirtyFields,e),error:xe((t||n).errors,e),isValidating:!!xe(n.validatingFields,e),isTouched:!!xe((t||n).touchedFields,e)}),R=(e,t,r)=>{const o=(xe(a,e,{_f:{}})._f||{}).ref,s=xe(n.errors,e)||{},{ref:i,message:l,type:c,...d}=s;ke(n.errors,e,{...d,...t,ref:o}),f.state.next({name:e,errors:n.errors,isValid:!1}),r&&r.shouldFocus&&o&&o.focus&&o.focus()},P=e=>f.state.subscribe({next:t=>{var r,a,i;r=e.name,a=t.name,i=e.exact,r&&a&&r!==a&&!Ye(r).some(e=>e&&(i?e===a:e.startsWith(a)||a.startsWith(e)))||!((e,t,r,n)=>{r(e);const{name:a,...o}=e;return Qe(o)||Object.keys(o).length>=Object.keys(t).length||Object.keys(o).find(e=>t[e]===(!n||Re))})(t,e.formState||d,z,e.reRenderRoot)||e.callback({values:{...s},...n,...t,defaultValues:o})}}).unsubscribe,O=(e,t={})=>{for(const i of e?Ye(e):l.mount)l.mount.delete(i),l.array.delete(i),t.keepValue||(st(a,i),st(s,i)),!t.keepError&&st(n.errors,i),!t.keepDirty&&st(n.dirtyFields,i),!t.keepTouched&&st(n.touchedFields,i),!t.keepIsValidating&&st(n.validatingFields,i),!r.shouldUnregister&&!t.keepDefaultValue&&st(o,i);f.state.next({values:ge(s)}),f.state.next({...n,...t.keepDirty?{isDirty:x()}:{}}),!t.keepIsValid&&p()},D=({disabled:e,name:t})=>{(Se(e)&&i.mount||e||l.disabled.has(t))&&(e?l.disabled.add(t):l.disabled.delete(t))},I=(e,t={})=>{let n=xe(a,e);const s=Se(t.disabled)||Se(r.disabled);return ke(a,e,{...n||{},_f:{...n&&n._f?n._f:{ref:{name:e}},name:e,mount:!0,...t}}),l.mount.add(e),n?D({disabled:Se(t.disabled)?t.disabled:r.disabled,name:e}):g(e,!0,t.value),{...s?{disabled:t.disabled||r.disabled}:{},...r.progressive?{required:!!t.required,min:yt(t.min),max:yt(t.max),minLength:yt(t.minLength),maxLength:yt(t.maxLength),pattern:yt(t.pattern)}:{},name:e,onChange:C,onBlur:C,ref:s=>{if(s){I(e,t),n=xe(a,e);const r=be(s.value)&&s.querySelectorAll&&s.querySelectorAll("input,select,textarea")[0]||s,i=(e=>at(e)||le(e))(r),l=n._f.refs||[];if(i?l.find(e=>e===r):r===n._f.ref)return;ke(a,e,{_f:{...n._f,...i?{refs:[...l.filter(ot),r,...Array.isArray(xe(o,e))?[{}]:[]],ref:{type:r.type,name:e}}:{ref:r}}}),g(e,!1,void 0,r)}else n=xe(a,e,{}),n._f&&(n._f.mount=!1),(r.shouldUnregister||t.shouldUnregister)&&(!pe(l.array,e)||!i.action)&&l.unMount.add(e)}}},M=()=>r.shouldFocusError&&At(a,j,l.mount),U=(e,t)=>async o=>{let i;o&&(o.preventDefault&&o.preventDefault(),o.persist&&o.persist());let c=ge(s);if(f.state.next({isSubmitting:!0}),r.resolver){const{errors:e,values:t}=await y();n.errors=e,c=ge(t)}else await w(a);if(l.disabled.size)for(const e of l.disabled)st(c,e);if(st(n.errors,"root"),Qe(n.errors)){f.state.next({errors:{}});try{await e(c,o)}catch(e){i=e}}else t&&await t({...n.errors},o),M(),setTimeout(M);if(f.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Qe(n.errors)&&!i,submitCount:n.submitCount+1,errors:n.errors}),i)throw i},L=(e,t={})=>{const c=e?ge(e):o,u=ge(c),m=Qe(e),p=m?o:u;if(t.keepDefaultValues||(o=c),!t.keepValues){if(t.keepDirtyValues){const e=new Set([...l.mount,...Object.keys(dt(o,s))]);for(const t of Array.from(e))xe(n.dirtyFields,t)?ke(p,t,xe(s,t)):E(t,xe(p,t))}else{if(he&&be(e))for(const e of l.mount){const t=xe(a,e);if(t&&t._f){const e=Array.isArray(t._f.refs)?t._f.refs[0]:t._f.ref;if(rt(e)){const t=e.closest("form");if(t){t.reset();break}}}}if(t.keepFieldsRef)for(const e of l.mount)E(e,xe(p,e));else a={}}s=r.shouldUnregister?t.keepDefaultValues?ge(o):{}:ge(p),f.array.next({values:{...p}}),f.state.next({values:{...p}})}l={mount:t.keepDirtyValues?l.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},i.mount=!d.isValid||!!t.keepIsValid||!!t.keepDirtyValues,i.watch=!!r.shouldUnregister,f.state.next({submitCount:t.keepSubmitCount?n.submitCount:0,isDirty:!m&&(t.keepDirty?n.isDirty:!(!t.keepDefaultValues||He(e,o))),isSubmitted:!!t.keepIsSubmitted&&n.isSubmitted,dirtyFields:m?{}:t.keepDirtyValues?t.keepDefaultValues&&s?dt(o,s):n.dirtyFields:t.keepDefaultValues&&e?dt(o,e):t.keepDirty?n.dirtyFields:{},touchedFields:t.keepTouched?n.touchedFields:{},errors:t.keepErrors?n.errors:{},isSubmitSuccessful:!!t.keepIsSubmitSuccessful&&n.isSubmitSuccessful,isSubmitting:!1,defaultValues:o})},F=(e,t)=>L(tt(e)?e(s):e,t),z=e=>{n={...n,...e}},B={control:{register:I,unregister:O,getFieldState:_,handleSubmit:U,setError:R,_subscribe:P,_runSchema:y,_focusError:M,_getWatch:S,_getDirty:x,_setValid:p,_setFieldArray:(e,t=[],l,c,m=!0,p=!0)=>{if(c&&l&&!r.disabled){if(i.action=!0,p&&Array.isArray(xe(a,e))){const t=l(xe(a,e),c.argA,c.argB);m&&ke(a,e,t)}if(p&&Array.isArray(xe(n.errors,e))){const t=l(xe(n.errors,e),c.argA,c.argB);m&&ke(n.errors,e,t),((e,t)=>{!ye(xe(e,t)).length&&st(e,t)})(n.errors,e)}if((d.touchedFields||u.touchedFields)&&p&&Array.isArray(xe(n.touchedFields,e))){const t=l(xe(n.touchedFields,e),c.argA,c.argB);m&&ke(n.touchedFields,e,t)}(d.dirtyFields||u.dirtyFields)&&(n.dirtyFields=dt(o,s)),f.state.next({name:e,isDirty:x(e,t),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else ke(s,e,t)},_setDisabledField:D,_setErrors:e=>{n.errors=e,f.state.next({errors:n.errors,isValid:!1})},_getFieldArray:e=>ye(xe(i.mount?s:o,e,r.shouldUnregister?xe(o,e,[]):[])),_reset:L,_resetDefaultValues:()=>tt(r.defaultValues)&&r.defaultValues().then(e=>{F(e,r.resetOptions),f.state.next({isLoading:!1})}),_removeUnmounted:()=>{for(const e of l.unMount){const t=xe(a,e);t&&(t._f.refs?t._f.refs.every(e=>!ot(e)):!ot(t._f.ref))&&O(e)}l.unMount=new Set},_disableForm:e=>{Se(e)&&(f.state.next({disabled:e}),At(a,(t,r)=>{const n=xe(a,r);n&&(t.disabled=n._f.disabled||e,Array.isArray(n._f.refs)&&n._f.refs.forEach(t=>{t.disabled=n._f.disabled||e}))},0,!1))},_subjects:f,_proxyFormState:d,get _fields(){return a},get _formValues(){return s},get _state(){return i},set _state(e){i=e},get _defaultValues(){return o},get _names(){return l},set _names(e){l=e},get _formState(){return n},get _options(){return r},set _options(e){r={...r,...e}}},subscribe:e=>(i.mount=!0,u={...u,...e.formState},P({...e,formState:u})),trigger:T,register:I,handleSubmit:U,watch:(e,t)=>tt(e)?f.state.subscribe({next:r=>"values"in r&&e(S(void 0,t),r)}):S(e,t,!0),setValue:E,getValues:N,reset:F,resetField:(e,t={})=>{xe(a,e)&&(be(t.defaultValue)?E(e,ge(xe(o,e))):(E(e,t.defaultValue),ke(o,e,ge(t.defaultValue))),t.keepTouched||st(n.touchedFields,e),t.keepDirty||(st(n.dirtyFields,e),n.isDirty=t.defaultValue?x(e,ge(xe(o,e))):x()),t.keepError||(st(n.errors,e),d.isValid&&p()),f.state.next({...n}))},clearErrors:e=>{e&&Ye(e).forEach(e=>st(n.errors,e)),f.state.next({errors:e?n.errors:{}})},unregister:O,setError:R,setFocus:(e,t={})=>{const r=xe(a,e),n=r&&r._f;if(n){const e=n.refs?n.refs[0]:n.ref;e.focus&&(e.focus(),t.shouldSelect&&tt(e.select)&&e.select())}},getFieldState:_};return{...B,formControl:B}}function Ot(e={}){const r=t.useRef(void 0),n=t.useRef(void 0),[a,o]=t.useState({isDirty:!1,isValidating:!1,isLoading:tt(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:tt(e.defaultValues)?void 0:e.defaultValues});if(!r.current)if(e.formControl)r.current={...e.formControl,formState:a},e.defaultValues&&!tt(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:t,...n}=Pt(e);r.current={...n,formState:a}}const s=r.current.control;return s._options=e,We(()=>{const e=s._subscribe({formState:s._proxyFormState,callback:()=>o({...s._formState}),reRenderRoot:!0});return o(e=>({...e,isReady:!0})),s._formState.isReady=!0,e},[s]),t.useEffect(()=>s._disableForm(e.disabled),[s,e.disabled]),t.useEffect(()=>{e.mode&&(s._options.mode=e.mode),e.reValidateMode&&(s._options.reValidateMode=e.reValidateMode)},[s,e.mode,e.reValidateMode]),t.useEffect(()=>{e.errors&&(s._setErrors(e.errors),s._focusError())},[s,e.errors]),t.useEffect(()=>{e.shouldUnregister&&s._subjects.state.next({values:s._getWatch()})},[s,e.shouldUnregister]),t.useEffect(()=>{if(s._proxyFormState.isDirty){const e=s._getDirty();e!==a.isDirty&&s._subjects.state.next({isDirty:e})}},[s,a.isDirty]),t.useEffect(()=>{e.values&&!He(e.values,n.current)?(s._reset(e.values,{keepFieldsRef:!0,...s._options.resetOptions}),n.current=e.values,o(e=>({...e}))):s._resetDefaultValues()},[s,e.values]),t.useEffect(()=>{s._state.mount||(s._setValid(),s._state.mount=!0),s._state.watch&&(s._state.watch=!1,s._subjects.state.next({...s._formState})),s._removeUnmounted()}),r.current.formState=Ve(a,s),r.current}const Dt=(e,t,r)=>{if(e&&"reportValidity"in e){const n=xe(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},It=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?Dt(n.ref,r,e):n&&n.refs&&n.refs.forEach(t=>Dt(t,r,e))}},Mt=(e,t)=>{t.shouldUseNativeValidation&&It(e,t);const r={};for(const n in e){const a=xe(t.fields,n),o=Object.assign(e[n]||{},{ref:a&&a.ref});if(Ut(t.names||Object.keys(e),n)){const e=Object.assign({},xe(r,n));ke(e,"root",o),ke(r,n,e)}else ke(r,n,o)}return r},Ut=(e,t)=>{const r=Lt(t);return e.some(e=>Lt(e).match(`^${r}\\.\\d+`))};function Lt(e){return e.replace(/\]|\[/g,"")}function Ft(e,t,r){function n(r,n){var a;Object.defineProperty(r,"_zod",{value:r._zod??{},enumerable:!1}),(a=r._zod).traits??(a.traits=new Set),r._zod.traits.add(e),t(r,n);for(const e in s.prototype)e in r||Object.defineProperty(r,e,{value:s.prototype[e].bind(r)});r._zod.constr=s,r._zod.def=n}const a=r?.Parent??Object;class o extends a{}function s(e){var t;const a=r?.Parent?new o:this;n(a,e),(t=a._zod).deferred??(t.deferred=[]);for(const e of a._zod.deferred)e();return a}return Object.defineProperty(o,"name",{value:e}),Object.defineProperty(s,"init",{value:n}),Object.defineProperty(s,Symbol.hasInstance,{value:t=>!!(r?.Parent&&t instanceof r.Parent)||t?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}class zt extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Bt extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}const Vt={};function Wt(e){return Vt}function $t(e,t){return"bigint"==typeof t?t.toString():t}function Gt(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Kt(e){return null==e}function Ht(e){const t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}const Zt=Symbol("evaluating");function qt(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==Zt)return void 0===n&&(n=Zt,n=r()),n},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function Jt(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Yt(...e){const t={};for(const r of e){const e=Object.getOwnPropertyDescriptors(r);Object.assign(t,e)}return Object.defineProperties({},t)}function Xt(e){return JSON.stringify(e)}const Qt="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function er(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const tr=Gt(()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function rr(e){if(!1===er(e))return!1;const t=e.constructor;if(void 0===t)return!0;const r=t.prototype;return!1!==er(r)&&!1!==Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")}function nr(e){return rr(e)?{...e}:Array.isArray(e)?[...e]:e}const ar=new Set(["string","number","symbol"]);function or(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function sr(e,t,r){const n=new e._zod.constr(t??e._zod.def);return t&&!r?.parent||(n._zod.parent=e),n}function ir(e){const t=e;if(!t)return{};if("string"==typeof t)return{error:()=>t};if(void 0!==t?.message){if(void 0!==t?.error)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,"string"==typeof t.error?{...t,error:()=>t.error}:t}function lr(e,t=0){if(!0===e.aborted)return!0;for(let r=t;r<e.issues.length;r++)if(!0!==e.issues[r]?.continue)return!0;return!1}function cr(e,t){return t.map(t=>{var r;return(r=t).path??(r.path=[]),t.path.unshift(e),t})}function dr(e){return"string"==typeof e?e:e?.message}function ur(e,t,r){const n={...e,path:e.path??[]};if(!e.message){const a=dr(e.inst?._zod.def?.error?.(e))??dr(t?.error?.(e))??dr(r.customError?.(e))??dr(r.localeError?.(e))??"Invalid input";n.message=a}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}function fr(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function mr(...e){const[t,r,n]=e;return"string"==typeof t?{message:t,code:"custom",input:r,inst:n}:{...t}}const pr=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,$t,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},hr=Ft("$ZodError",pr),gr=Ft("$ZodError",pr,{Parent:Error});const vr=e=>(t,r,n,a)=>{const o=n?Object.assign(n,{async:!1}):{async:!1},s=t._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new zt;if(s.issues.length){const t=new(a?.Err??e)(s.issues.map(e=>ur(e,o,Wt())));throw Qt(t,a?.callee),t}return s.value},br=vr(gr),yr=e=>async(t,r,n,a)=>{const o=n?Object.assign(n,{async:!0}):{async:!0};let s=t._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){const t=new(a?.Err??e)(s.issues.map(e=>ur(e,o,Wt())));throw Qt(t,a?.callee),t}return s.value},wr=yr(gr),xr=e=>(t,r,n)=>{const a=n?{...n,async:!1}:{async:!1},o=t._zod.run({value:r,issues:[]},a);if(o instanceof Promise)throw new zt;return o.issues.length?{success:!1,error:new(e??hr)(o.issues.map(e=>ur(e,a,Wt())))}:{success:!0,data:o.value}},Sr=xr(gr),kr=e=>async(t,r,n)=>{const a=n?Object.assign(n,{async:!0}):{async:!0};let o=t._zod.run({value:r,issues:[]},a);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map(e=>ur(e,a,Wt())))}:{success:!0,data:o.value}},Ar=kr(gr),Er=e=>(t,r,n)=>{const a=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return vr(e)(t,r,a)},Cr=e=>(t,r,n)=>vr(e)(t,r,n),jr=e=>async(t,r,n)=>{const a=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return yr(e)(t,r,a)},Tr=e=>async(t,r,n)=>yr(e)(t,r,n),Nr=e=>(t,r,n)=>{const a=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return xr(e)(t,r,a)},_r=e=>(t,r,n)=>xr(e)(t,r,n),Rr=e=>async(t,r,n)=>{const a=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return kr(e)(t,r,a)},Pr=e=>async(t,r,n)=>kr(e)(t,r,n),Or=/^[cC][^\s-]{8,}$/,Dr=/^[0-9a-z]+$/,Ir=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Mr=/^[0-9a-vA-V]{20}$/,Ur=/^[A-Za-z0-9]{27}$/,Lr=/^[a-zA-Z0-9_-]{21}$/,Fr=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,zr=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Br=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Vr=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;const Wr=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,$r=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Gr=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Kr=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Hr=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Zr=/^[A-Za-z0-9_-]*$/,qr=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,Jr=/^\+(?:[0-9]){6,14}[0-9]$/,Yr="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Xr=new RegExp(`^${Yr}$`);function Qr(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}const en=/^[^A-Z]*$/,tn=/^[^a-z]*$/,rn=Ft("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),nn=Ft("$ZodCheckMaxLength",(e,t)=>{var r;rn.init(e,t),(r=e._zod.def).when??(r.when=e=>{const t=e.value;return!Kt(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const r=e._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<r&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const n=r.value;if(n.length<=t.maximum)return;const a=fr(n);r.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),an=Ft("$ZodCheckMinLength",(e,t)=>{var r;rn.init(e,t),(r=e._zod.def).when??(r.when=e=>{const t=e.value;return!Kt(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const r=e._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>r&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const n=r.value;if(n.length>=t.minimum)return;const a=fr(n);r.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),on=Ft("$ZodCheckLengthEquals",(e,t)=>{var r;rn.init(e,t),(r=e._zod.def).when??(r.when=e=>{const t=e.value;return!Kt(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const r=e._zod.bag;r.minimum=t.length,r.maximum=t.length,r.length=t.length}),e._zod.check=r=>{const n=r.value,a=n.length;if(a===t.length)return;const o=fr(n),s=a>t.length;r.issues.push({origin:o,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),sn=Ft("$ZodCheckStringFormat",(e,t)=>{var r,n;rn.init(e,t),e._zod.onattach.push(e=>{const r=e._zod.bag;r.format=t.format,t.pattern&&(r.patterns??(r.patterns=new Set),r.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=r=>{t.pattern.lastIndex=0,t.pattern.test(r.value)||r.issues.push({origin:"string",code:"invalid_format",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),ln=Ft("$ZodCheckRegex",(e,t)=>{sn.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,t.pattern.test(r.value)||r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),cn=Ft("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=en),sn.init(e,t)}),dn=Ft("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=tn),sn.init(e,t)}),un=Ft("$ZodCheckIncludes",(e,t)=>{rn.init(e,t);const r=or(t.includes),n=new RegExp("number"==typeof t.position?`^.{${t.position}}${r}`:r);t.pattern=n,e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),e._zod.check=r=>{r.value.includes(t.includes,t.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:r.value,inst:e,continue:!t.abort})}}),fn=Ft("$ZodCheckStartsWith",(e,t)=>{rn.init(e,t);const r=new RegExp(`^${or(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),mn=Ft("$ZodCheckEndsWith",(e,t)=>{rn.init(e,t);const r=new RegExp(`.*${or(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),pn=Ft("$ZodCheckOverwrite",(e,t)=>{rn.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});class hn{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if("function"==typeof e)return e(this,{execution:"sync"}),void e(this,{execution:"async"});const t=e.split("\n").filter(e=>e),r=Math.min(...t.map(e=>e.length-e.trimStart().length)),n=t.map(e=>e.slice(r)).map(e=>" ".repeat(2*this.indent)+e);for(const e of n)this.content.push(e)}compile(){const e=Function,t=this?.args;return new e(...t,[...(this?.content??[""]).map(e=>` ${e}`)].join("\n"))}}const gn={major:4,minor:1,patch:8},vn=Ft("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=gn;const n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(const t of n)for(const r of t._zod.onattach)r(e);if(0===n.length)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const t=(e,t,r)=>{let n,a=lr(e);for(const o of t){if(o._zod.def.when){if(!o._zod.def.when(e))continue}else if(a)continue;const t=e.issues.length,s=o._zod.check(e);if(s instanceof Promise&&!1===r?.async)throw new zt;if(n||s instanceof Promise)n=(n??Promise.resolve()).then(async()=>{await s;e.issues.length!==t&&(a||(a=lr(e,t)))});else{if(e.issues.length===t)continue;a||(a=lr(e,t))}}return n?n.then(()=>e):e},r=(r,a,o)=>{if(lr(r))return r.aborted=!0,r;const s=t(a,n,o);if(s instanceof Promise){if(!1===o.async)throw new zt;return s.then(t=>e._zod.parse(t,o))}return e._zod.parse(s,o)};e._zod.run=(a,o)=>{if(o.skipChecks)return e._zod.parse(a,o);if("backward"===o.direction){const t=e._zod.parse({value:a.value,issues:[]},{...o,skipChecks:!0});return t instanceof Promise?t.then(e=>r(e,a,o)):r(t,a,o)}const s=e._zod.parse(a,o);if(s instanceof Promise){if(!1===o.async)throw new zt;return s.then(e=>t(e,n,o))}return t(s,n,o)}}e["~standard"]={validate:t=>{try{const r=Sr(e,t);return r.success?{value:r.data}:{issues:r.error?.issues}}catch(r){return Ar(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1}}),bn=Ft("$ZodString",(e,t)=>{var r;vn.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??(r=e._zod.bag,new RegExp(`^${r?`[\\s\\S]{${r?.minimum??0},${r?.maximum??""}}`:"[\\s\\S]*"}$`)),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch(n){}return"string"==typeof r.value||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),yn=Ft("$ZodStringFormat",(e,t)=>{sn.init(e,t),bn.init(e,t)}),wn=Ft("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=zr),yn.init(e,t)}),xn=Ft("$ZodUUID",(e,t)=>{if(t.version){const e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Br(e))}else t.pattern??(t.pattern=Br());yn.init(e,t)}),Sn=Ft("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Vr),yn.init(e,t)}),kn=Ft("$ZodURL",(e,t)=>{yn.init(e,t),e._zod.check=r=>{try{const n=r.value.trim(),a=new URL(n);return t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(a.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:qr.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(a.protocol.endsWith(":")?a.protocol.slice(0,-1):a.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),void(t.normalize?r.value=a.href:r.value=n)}catch(n){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),An=Ft("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),yn.init(e,t)}),En=Ft("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Lr),yn.init(e,t)}),Cn=Ft("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Or),yn.init(e,t)}),jn=Ft("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Dr),yn.init(e,t)}),Tn=Ft("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Ir),yn.init(e,t)}),Nn=Ft("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Mr),yn.init(e,t)}),_n=Ft("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Ur),yn.init(e,t)}),Rn=Ft("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=function(e){const t=Qr({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const n=`${t}(?:${r.join("|")})`;return new RegExp(`^${Yr}T(?:${n})$`)}(t)),yn.init(e,t)}),Pn=Ft("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Xr),yn.init(e,t)}),On=Ft("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=new RegExp(`^${Qr(t)}$`)),yn.init(e,t)}),Dn=Ft("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Fr),yn.init(e,t)}),In=Ft("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Wr),yn.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.format="ipv4"})}),Mn=Ft("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=$r),yn.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.format="ipv6"}),e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),Un=Ft("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Gr),yn.init(e,t)}),Ln=Ft("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Kr),yn.init(e,t),e._zod.check=r=>{const n=r.value.split("/");try{if(2!==n.length)throw new Error;const[e,t]=n;if(!t)throw new Error;const r=Number(t);if(`${r}`!==t)throw new Error;if(r<0||r>128)throw new Error;new URL(`http://[${e}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function Fn(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const zn=Ft("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Hr),yn.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding="base64"}),e._zod.check=r=>{Fn(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});const Bn=Ft("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Zr),yn.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding="base64url"}),e._zod.check=r=>{(function(e){if(!Zr.test(e))return!1;const t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return Fn(t.padEnd(4*Math.ceil(t.length/4),"="))})(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),Vn=Ft("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Jr),yn.init(e,t)});const Wn=Ft("$ZodJWT",(e,t)=>{yn.init(e,t),e._zod.check=r=>{(function(e,t=null){try{const r=e.split(".");if(3!==r.length)return!1;const[n]=r;if(!n)return!1;const a=JSON.parse(atob(n));return!("typ"in a&&"JWT"!==a?.typ||!a.alg||t&&(!("alg"in a)||a.alg!==t))}catch{return!1}})(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),$n=Ft("$ZodUnknown",(e,t)=>{vn.init(e,t),e._zod.parse=e=>e}),Gn=Ft("$ZodNever",(e,t)=>{vn.init(e,t),e._zod.parse=(t,r)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)});function Kn(e,t,r){e.issues.length&&t.issues.push(...cr(r,e.issues)),t.value[r]=e.value}const Hn=Ft("$ZodArray",(e,t)=>{vn.init(e,t),e._zod.parse=(r,n)=>{const a=r.value;if(!Array.isArray(a))return r.issues.push({expected:"array",code:"invalid_type",input:a,inst:e}),r;r.value=Array(a.length);const o=[];for(let e=0;e<a.length;e++){const s=a[e],i=t.element._zod.run({value:s,issues:[]},n);i instanceof Promise?o.push(i.then(t=>Kn(t,r,e))):Kn(i,r,e)}return o.length?Promise.all(o).then(()=>r):r}});function Zn(e,t,r,n){e.issues.length&&t.issues.push(...cr(r,e.issues)),void 0===e.value?r in n&&(t.value[r]=void 0):t.value[r]=e.value}function qn(e){const t=Object.keys(e.shape);for(const r of t)if(!e.shape?.[r]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${r}": expected a Zod schema`);const r=(n=e.shape,Object.keys(n).filter(e=>"optional"===n[e]._zod.optin&&"optional"===n[e]._zod.optout));var n;return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function Jn(e,t,r,n,a,o){const s=[],i=a.keySet,l=a.catchall._zod,c=l.def.type;for(const a of Object.keys(t)){if(i.has(a))continue;if("never"===c){s.push(a);continue}const o=l.run({value:t[a],issues:[]},n);o instanceof Promise?e.push(o.then(e=>Zn(e,r,a,t))):Zn(o,r,a,t)}return s.length&&r.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:o}),e.length?Promise.all(e).then(()=>r):r}const Yn=Ft("$ZodObject",(e,t)=>{vn.init(e,t);const r=Gt(()=>qn(t));qt(e._zod,"propValues",()=>{const e=t.shape,r={};for(const t in e){const n=e[t]._zod;if(n.values){r[t]??(r[t]=new Set);for(const e of n.values)r[t].add(e)}}return r});const n=er,a=t.catchall;let o;e._zod.parse=(t,s)=>{o??(o=r.value);const i=t.value;if(!n(i))return t.issues.push({expected:"object",code:"invalid_type",input:i,inst:e}),t;t.value={};const l=[],c=o.shape;for(const e of o.keys){const r=c[e]._zod.run({value:i[e],issues:[]},s);r instanceof Promise?l.push(r.then(r=>Zn(r,t,e,i))):Zn(r,t,e,i)}return a?Jn(l,i,t,s,r.value,e):l.length?Promise.all(l).then(()=>t):t}}),Xn=Ft("$ZodObjectJIT",(e,t)=>{Yn.init(e,t);const r=e._zod.parse,n=Gt(()=>qn(t));let a;const o=er,s=!Vt.jitless,i=s&&tr.value,l=t.catchall;let c;e._zod.parse=(d,u)=>{c??(c=n.value);const f=d.value;return o(f)?s&&i&&!1===u?.async&&!0!==u.jitless?(a||(a=(e=>{const t=new hn(["shape","payload","ctx"]),r=n.value,a=e=>{const t=Xt(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");const o=Object.create(null);let s=0;for(const e of r.keys)o[e]="key_"+s++;t.write("const newResult = {};");for(const e of r.keys){const r=o[e],n=Xt(e);t.write(`const ${r} = ${a(e)};`),t.write(`\n if (${r}.issues.length) {\n payload.issues = payload.issues.concat(${r}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${n}, ...iss.path] : [${n}]\n })));\n }\n \n \n if (${r}.value === undefined) {\n if (${n} in input) {\n newResult[${n}] = undefined;\n }\n } else {\n newResult[${n}] = ${r}.value;\n }\n \n `)}t.write("payload.value = newResult;"),t.write("return payload;");const i=t.compile();return(t,r)=>i(e,t,r)})(t.shape)),d=a(d,u),l?Jn([],f,d,u,c,e):d):r(d,u):(d.issues.push({expected:"object",code:"invalid_type",input:f,inst:e}),d)}});function Qn(e,t,r,n){for(const r of e)if(0===r.issues.length)return t.value=r.value,t;const a=e.filter(e=>!lr(e));return 1===a.length?(t.value=a[0].value,a[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(e=>e.issues.map(e=>ur(e,n,Wt())))}),t)}const ea=Ft("$ZodUnion",(e,t)=>{vn.init(e,t),qt(e._zod,"optin",()=>t.options.some(e=>"optional"===e._zod.optin)?"optional":void 0),qt(e._zod,"optout",()=>t.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),qt(e._zod,"values",()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),qt(e._zod,"pattern",()=>{if(t.options.every(e=>e._zod.pattern)){const e=t.options.map(e=>e._zod.pattern);return new RegExp(`^(${e.map(e=>Ht(e.source)).join("|")})$`)}});const r=1===t.options.length,n=t.options[0]._zod.run;e._zod.parse=(a,o)=>{if(r)return n(a,o);let s=!1;const i=[];for(const e of t.options){const t=e._zod.run({value:a.value,issues:[]},o);if(t instanceof Promise)i.push(t),s=!0;else{if(0===t.issues.length)return t;i.push(t)}}return s?Promise.all(i).then(t=>Qn(t,a,e,o)):Qn(i,a,e,o)}}),ta=Ft("$ZodIntersection",(e,t)=>{vn.init(e,t),e._zod.parse=(e,r)=>{const n=e.value,a=t.left._zod.run({value:n,issues:[]},r),o=t.right._zod.run({value:n,issues:[]},r);return a instanceof Promise||o instanceof Promise?Promise.all([a,o]).then(([t,r])=>na(e,t,r)):na(e,a,o)}});function ra(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e===+t)return{valid:!0,data:e};if(rr(e)&&rr(t)){const r=Object.keys(t),n=Object.keys(e).filter(e=>-1!==r.indexOf(e)),a={...e,...t};for(const r of n){const n=ra(e[r],t[r]);if(!n.valid)return{valid:!1,mergeErrorPath:[r,...n.mergeErrorPath]};a[r]=n.data}return{valid:!0,data:a}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let n=0;n<e.length;n++){const a=ra(e[n],t[n]);if(!a.valid)return{valid:!1,mergeErrorPath:[n,...a.mergeErrorPath]};r.push(a.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function na(e,t,r){if(t.issues.length&&e.issues.push(...t.issues),r.issues.length&&e.issues.push(...r.issues),lr(e))return e;const n=ra(t.value,r.value);if(!n.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(n.mergeErrorPath)}`);return e.value=n.data,e}const aa=Ft("$ZodEnum",(e,t)=>{vn.init(e,t);const r=function(e){const t=Object.values(e).filter(e=>"number"==typeof e),r=Object.entries(e).filter(([e,r])=>-1===t.indexOf(+e)).map(([e,t])=>t);return r}(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(e=>ar.has(typeof e)).map(e=>"string"==typeof e?or(e):e.toString()).join("|")})$`),e._zod.parse=(t,a)=>{const o=t.value;return n.has(o)||t.issues.push({code:"invalid_value",values:r,input:o,inst:e}),t}}),oa=Ft("$ZodTransform",(e,t)=>{vn.init(e,t),e._zod.parse=(r,n)=>{if("backward"===n.direction)throw new Bt(e.constructor.name);const a=t.transform(r.value,r);if(n.async){return(a instanceof Promise?a:Promise.resolve(a)).then(e=>(r.value=e,r))}if(a instanceof Promise)throw new zt;return r.value=a,r}});function sa(e,t){return e.issues.length&&void 0===t?{issues:[],value:void 0}:e}const ia=Ft("$ZodOptional",(e,t)=>{vn.init(e,t),e._zod.optin="optional",e._zod.optout="optional",qt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),qt(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${Ht(e.source)})?$`):void 0}),e._zod.parse=(e,r)=>{if("optional"===t.innerType._zod.optin){const n=t.innerType._zod.run(e,r);return n instanceof Promise?n.then(t=>sa(t,e.value)):sa(n,e.value)}return void 0===e.value?e:t.innerType._zod.run(e,r)}}),la=Ft("$ZodNullable",(e,t)=>{vn.init(e,t),qt(e._zod,"optin",()=>t.innerType._zod.optin),qt(e._zod,"optout",()=>t.innerType._zod.optout),qt(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${Ht(e.source)}|null)$`):void 0}),qt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,r)=>null===e.value?e:t.innerType._zod.run(e,r)}),ca=Ft("$ZodDefault",(e,t)=>{vn.init(e,t),e._zod.optin="optional",qt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,r)=>{if("backward"===r.direction)return t.innerType._zod.run(e,r);if(void 0===e.value)return e.value=t.defaultValue,e;const n=t.innerType._zod.run(e,r);return n instanceof Promise?n.then(e=>da(e,t)):da(n,t)}});function da(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const ua=Ft("$ZodPrefault",(e,t)=>{vn.init(e,t),e._zod.optin="optional",qt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,r)=>("backward"===r.direction||void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,r))}),fa=Ft("$ZodNonOptional",(e,t)=>{vn.init(e,t),qt(e._zod,"values",()=>{const e=t.innerType._zod.values;return e?new Set([...e].filter(e=>void 0!==e)):void 0}),e._zod.parse=(r,n)=>{const a=t.innerType._zod.run(r,n);return a instanceof Promise?a.then(t=>ma(t,e)):ma(a,e)}});function ma(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const pa=Ft("$ZodCatch",(e,t)=>{vn.init(e,t),qt(e._zod,"optin",()=>t.innerType._zod.optin),qt(e._zod,"optout",()=>t.innerType._zod.optout),qt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,r)=>{if("backward"===r.direction)return t.innerType._zod.run(e,r);const n=t.innerType._zod.run(e,r);return n instanceof Promise?n.then(n=>(e.value=n.value,n.issues.length&&(e.value=t.catchValue({...e,error:{issues:n.issues.map(e=>ur(e,r,Wt()))},input:e.value}),e.issues=[]),e)):(e.value=n.value,n.issues.length&&(e.value=t.catchValue({...e,error:{issues:n.issues.map(e=>ur(e,r,Wt()))},input:e.value}),e.issues=[]),e)}}),ha=Ft("$ZodPipe",(e,t)=>{vn.init(e,t),qt(e._zod,"values",()=>t.in._zod.values),qt(e._zod,"optin",()=>t.in._zod.optin),qt(e._zod,"optout",()=>t.out._zod.optout),qt(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(e,r)=>{if("backward"===r.direction){const n=t.out._zod.run(e,r);return n instanceof Promise?n.then(e=>ga(e,t.in,r)):ga(n,t.in,r)}const n=t.in._zod.run(e,r);return n instanceof Promise?n.then(e=>ga(e,t.out,r)):ga(n,t.out,r)}});function ga(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}const va=Ft("$ZodReadonly",(e,t)=>{vn.init(e,t),qt(e._zod,"propValues",()=>t.innerType._zod.propValues),qt(e._zod,"values",()=>t.innerType._zod.values),qt(e._zod,"optin",()=>t.innerType._zod.optin),qt(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(e,r)=>{if("backward"===r.direction)return t.innerType._zod.run(e,r);const n=t.innerType._zod.run(e,r);return n instanceof Promise?n.then(ba):ba(n)}});function ba(e){return e.value=Object.freeze(e.value),e}const ya=Ft("$ZodCustom",(e,t)=>{rn.init(e,t),vn.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=r=>{const n=r.value,a=t.fn(n);if(a instanceof Promise)return a.then(t=>wa(t,r,n,e));wa(a,r,n,e)}});function wa(e,t,r,n){if(!e){const e={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(e.params=n._zod.def.params),t.issues.push(mr(e))}}class xa{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){const r=t[0];if(this._map.set(e,r),r&&"object"==typeof r&&"id"in r){if(this._idmap.has(r.id))throw new Error(`ID ${r.id} already exists in the registry`);this._idmap.set(r.id,e)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){const t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){const t=e._zod.parent;if(t){const r={...this.get(t)??{}};delete r.id;const n={...r,...this._map.get(e)};return Object.keys(n).length?n:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function Sa(){return new xa}const ka=Sa();function Aa(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...ir(t)})}function Ea(e,t){return new nn({check:"max_length",...ir(t),maximum:e})}function Ca(e,t){return new an({check:"min_length",...ir(t),minimum:e})}function ja(e,t){return new on({check:"length_equals",...ir(t),length:e})}function Ta(e){return new pn({check:"overwrite",tx:e})}function Na(e){const t=function(e,t){const r=new rn({check:"custom",...ir(t)});return r._zod.check=e,r}(r=>(r.addIssue=e=>{if("string"==typeof e)r.issues.push(mr(e,r.value,t._zod.def));else{const n=e;n.fatal&&(n.continue=!1),n.code??(n.code="custom"),n.input??(n.input=r.value),n.inst??(n.inst=t),n.continue??(n.continue=!t._zod.def.abort),r.issues.push(mr(n))}},e(r.value,r)));return t}function _a(e,t){try{var r=e()}catch(e){return t(e)}return r&&r.then?r.then(void 0,t):r}function Ra(e,t){for(var r={};e.length;){var n=e[0],a=n.code,o=n.message,s=n.path.join(".");if(!r[s])if("unionErrors"in n){var i=n.unionErrors[0].errors[0];r[s]={message:i.message,type:i.code}}else r[s]={message:o,type:a};if("unionErrors"in n&&n.unionErrors.forEach(function(t){return t.errors.forEach(function(t){return e.push(t)})}),t){var l=r[s].types,c=l&&l[n.code];r[s]=Je(s,t,r,a,c?[].concat(c,n.message):n.message)}e.shift()}return r}function Pa(e,t){for(var r={};e.length;){var n=e[0],a=n.code,o=n.message,s=n.path.join(".");if(!r[s])if("invalid_union"===n.code&&n.errors.length>0){var i=n.errors[0][0];r[s]={message:i.message,type:i.code}}else r[s]={message:o,type:a};if("invalid_union"===n.code&&n.errors.forEach(function(t){return t.forEach(function(t){return e.push(t)})}),t){var l=r[s].types,c=l&&l[n.code];r[s]=Je(s,t,r,a,c?[].concat(c,n.message):n.message)}e.shift()}return r}function Oa(e,t,r){if(void 0===r&&(r={}),function(e){return"_def"in e&&"object"==typeof e._def&&"typeName"in e._def}(e))return function(n,a,o){try{return Promise.resolve(_a(function(){return Promise.resolve(e["sync"===r.mode?"parse":"parseAsync"](n,t)).then(function(e){return o.shouldUseNativeValidation&&It({},o),{errors:{},values:r.raw?Object.assign({},n):e}})},function(e){if(function(e){return Array.isArray(null==e?void 0:e.issues)}(e))return{values:{},errors:Mt(Ra(e.errors,!o.shouldUseNativeValidation&&"all"===o.criteriaMode),o)};throw e}))}catch(e){return Promise.reject(e)}};if(function(e){return"_zod"in e&&"object"==typeof e._zod}(e))return function(n,a,o){try{return Promise.resolve(_a(function(){return Promise.resolve(("sync"===r.mode?br:wr)(e,n,t)).then(function(e){return o.shouldUseNativeValidation&&It({},o),{errors:{},values:r.raw?Object.assign({},n):e}})},function(e){if(function(e){return e instanceof hr}(e))return{values:{},errors:Mt(Pa(e.issues,!o.shouldUseNativeValidation&&"all"===o.criteriaMode),o)};throw e}))}catch(e){return Promise.reject(e)}};throw new Error("Invalid input: not a Zod schema")}function Da(e){var t,r,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(r=Da(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function Ia(){for(var e,t,r=0,n="",a=arguments.length;r<a;r++)(e=arguments[r])&&(t=Da(e))&&(n&&(n+=" "),n+=t);return n}const Ma=e=>{const t=za(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:e=>{const r=e.split("-");return""===r[0]&&1!==r.length&&r.shift(),Ua(r,t)||Fa(e)},getConflictingClassGroupIds:(e,t)=>{const a=r[e]||[];return t&&n[e]?[...a,...n[e]]:a}}},Ua=(e,t)=>{if(0===e.length)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),a=n?Ua(e.slice(1),n):void 0;if(a)return a;if(0===t.validators.length)return;const o=e.join("-");return t.validators.find(({validator:e})=>e(o))?.classGroupId},La=/^\[(.+)\]$/,Fa=e=>{if(La.test(e)){const t=La.exec(e)[1],r=t?.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},za=e=>{const{theme:t,classGroups:r}=e,n={nextPart:new Map,validators:[]};for(const e in r)Ba(r[e],n,e,t);return n},Ba=(e,t,r,n)=>{e.forEach(e=>{if("string"==typeof e){return void((""===e?t:Va(t,e)).classGroupId=r)}if("function"==typeof e)return Wa(e)?void Ba(e(n),t,r,n):void t.validators.push({validator:e,classGroupId:r});Object.entries(e).forEach(([e,a])=>{Ba(a,Va(t,e),r,n)})})},Va=(e,t)=>{let r=e;return t.split("-").forEach(e=>{r.nextPart.has(e)||r.nextPart.set(e,{nextPart:new Map,validators:[]}),r=r.nextPart.get(e)}),r},Wa=e=>e.isThemeGetter,$a=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const a=(a,o)=>{r.set(a,o),t++,t>e&&(t=0,n=r,r=new Map)};return{get(e){let t=r.get(e);return void 0!==t?t:void 0!==(t=n.get(e))?(a(e,t),t):void 0},set(e,t){r.has(e)?r.set(e,t):a(e,t)}}},Ga=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=e=>{const t=[];let r,n=0,a=0,o=0;for(let s=0;s<e.length;s++){let i=e[s];if(0===n&&0===a){if(":"===i){t.push(e.slice(o,s)),o=s+1;continue}if("/"===i){r=s;continue}}"["===i?n++:"]"===i?n--:"("===i?a++:")"===i&&a--}const s=0===t.length?e:e.substring(o),i=Ka(s);return{modifiers:t,hasImportantModifier:i!==s,baseClassName:i,maybePostfixModifierPosition:r&&r>o?r-o:void 0}};if(t){const e=t+":",r=n;n=t=>t.startsWith(e)?r(t.substring(e.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:t,maybePostfixModifierPosition:void 0}}if(r){const e=n;n=t=>r({className:t,parseClassName:e})}return n},Ka=e=>e.endsWith("!")?e.substring(0,e.length-1):e.startsWith("!")?e.substring(1):e,Ha=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(e=>[e,!0]));return e=>{if(e.length<=1)return e;const r=[];let n=[];return e.forEach(e=>{"["===e[0]||t[e]?(r.push(...n.sort(),e),n=[]):n.push(e)}),r.push(...n.sort()),r}},Za=/\s+/;function qa(){let e,t,r=0,n="";for(;r<arguments.length;)(e=arguments[r++])&&(t=Ja(e))&&(n&&(n+=" "),n+=t);return n}const Ja=e=>{if("string"==typeof e)return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=Ja(e[n]))&&(r&&(r+=" "),r+=t);return r};function Ya(e,...t){let r,n,a,o=function(i){const l=t.reduce((e,t)=>t(e),e());return r=(e=>({cache:$a(e.cacheSize),parseClassName:Ga(e),sortModifiers:Ha(e),...Ma(e)}))(l),n=r.cache.get,a=r.cache.set,o=s,s(i)};function s(e){const t=n(e);if(t)return t;const o=((e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:a,sortModifiers:o}=t,s=[],i=e.trim().split(Za);let l="";for(let e=i.length-1;e>=0;e-=1){const t=i[e],{isExternal:c,modifiers:d,hasImportantModifier:u,baseClassName:f,maybePostfixModifierPosition:m}=r(t);if(c){l=t+(l.length>0?" "+l:l);continue}let p=!!m,h=n(p?f.substring(0,m):f);if(!h){if(!p){l=t+(l.length>0?" "+l:l);continue}if(h=n(f),!h){l=t+(l.length>0?" "+l:l);continue}p=!1}const g=o(d).join(":"),v=u?g+"!":g,b=v+h;if(s.includes(b))continue;s.push(b);const y=a(h,p);for(let e=0;e<y.length;++e){const t=y[e];s.push(v+t)}l=t+(l.length>0?" "+l:l)}return l})(e,r);return a(e,o),o}return function(){return o(qa.apply(null,arguments))}}const Xa=e=>{const t=t=>t[e]||[];return t.isThemeGetter=!0,t},Qa=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,eo=/^\((?:(\w[\w-]*):)?(.+)\)$/i,to=/^\d+\/\d+$/,ro=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,no=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,ao=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,oo=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,so=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,io=e=>to.test(e),lo=e=>!!e&&!Number.isNaN(Number(e)),co=e=>!!e&&Number.isInteger(Number(e)),uo=e=>e.endsWith("%")&&lo(e.slice(0,-1)),fo=e=>ro.test(e),mo=()=>!0,po=e=>no.test(e)&&!ao.test(e),ho=()=>!1,go=e=>oo.test(e),vo=e=>so.test(e),bo=e=>!wo(e)&&!Co(e),yo=e=>Oo(e,Uo,ho),wo=e=>Qa.test(e),xo=e=>Oo(e,Lo,po),So=e=>Oo(e,Fo,lo),ko=e=>Oo(e,Io,ho),Ao=e=>Oo(e,Mo,vo),Eo=e=>Oo(e,Bo,go),Co=e=>eo.test(e),jo=e=>Do(e,Lo),To=e=>Do(e,zo),No=e=>Do(e,Io),_o=e=>Do(e,Uo),Ro=e=>Do(e,Mo),Po=e=>Do(e,Bo,!0),Oo=(e,t,r)=>{const n=Qa.exec(e);return!!n&&(n[1]?t(n[1]):r(n[2]))},Do=(e,t,r=!1)=>{const n=eo.exec(e);return!!n&&(n[1]?t(n[1]):r)},Io=e=>"position"===e||"percentage"===e,Mo=e=>"image"===e||"url"===e,Uo=e=>"length"===e||"size"===e||"bg-size"===e,Lo=e=>"length"===e,Fo=e=>"number"===e,zo=e=>"family-name"===e,Bo=e=>"shadow"===e,Vo=Ya(()=>{const e=Xa("color"),t=Xa("font"),r=Xa("text"),n=Xa("font-weight"),a=Xa("tracking"),o=Xa("leading"),s=Xa("breakpoint"),i=Xa("container"),l=Xa("spacing"),c=Xa("radius"),d=Xa("shadow"),u=Xa("inset-shadow"),f=Xa("text-shadow"),m=Xa("drop-shadow"),p=Xa("blur"),h=Xa("perspective"),g=Xa("aspect"),v=Xa("ease"),b=Xa("animate"),y=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",Co,wo],w=()=>[Co,wo,l],x=()=>[io,"full","auto",...w()],S=()=>[co,"none","subgrid",Co,wo],k=()=>["auto",{span:["full",co,Co,wo]},co,Co,wo],A=()=>[co,"auto",Co,wo],E=()=>["auto","min","max","fr",Co,wo],C=()=>["auto",...w()],j=()=>[io,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...w()],T=()=>[e,Co,wo],N=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",No,ko,{position:[Co,wo]}],_=()=>["auto","cover","contain",_o,yo,{size:[Co,wo]}],R=()=>[uo,jo,xo],P=()=>["","none","full",c,Co,wo],O=()=>["",lo,jo,xo],D=()=>[lo,uo,No,ko],I=()=>["","none",p,Co,wo],M=()=>["none",lo,Co,wo],U=()=>["none",lo,Co,wo],L=()=>[lo,Co,wo],F=()=>[io,"full",...w()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[fo],breakpoint:[fo],color:[mo],container:[fo],"drop-shadow":[fo],ease:["in","out","in-out"],font:[bo],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[fo],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[fo],shadow:[fo],spacing:["px",lo],text:[fo],"text-shadow":[fo],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",io,wo,Co,g]}],container:["container"],columns:[{columns:[lo,wo,Co,i]}],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:y()}],overflow:[{overflow:["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],overscroll:[{overscroll:["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:x()}],"inset-x":[{"inset-x":x()}],"inset-y":[{"inset-y":x()}],start:[{start:x()}],end:[{end:x()}],top:[{top:x()}],right:[{right:x()}],bottom:[{bottom:x()}],left:[{left:x()}],visibility:["visible","invisible","collapse"],z:[{z:[co,"auto",Co,wo]}],basis:[{basis:[io,"full","auto",i,...w()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[lo,io,"auto","initial","none",wo]}],grow:[{grow:["",lo,Co,wo]}],shrink:[{shrink:["",lo,Co,wo]}],order:[{order:[co,"first","last","none",Co,wo]}],"grid-cols":[{"grid-cols":S()}],"col-start-end":[{col:k()}],"col-start":[{"col-start":A()}],"col-end":[{"col-end":A()}],"grid-rows":[{"grid-rows":S()}],"row-start-end":[{row:k()}],"row-start":[{"row-start":A()}],"row-end":[{"row-end":A()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":E()}],"auto-rows":[{"auto-rows":E()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe","normal"]}],"justify-items":[{"justify-items":["start","end","center","stretch","center-safe","end-safe","normal"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],"align-content":[{content:["normal","start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"align-items":[{items:["start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"align-self":[{self:["auto","start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"place-items":[{"place-items":["start","end","center","stretch","center-safe","end-safe","baseline"]}],"place-self":[{"place-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:C()}],mx:[{mx:C()}],my:[{my:C()}],ms:[{ms:C()}],me:[{me:C()}],mt:[{mt:C()}],mr:[{mr:C()}],mb:[{mb:C()}],ml:[{ml:C()}],"space-x":[{"space-x":w()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":w()}],"space-y-reverse":["space-y-reverse"],size:[{size:j()}],w:[{w:[i,"screen",...j()]}],"min-w":[{"min-w":[i,"screen","none",...j()]}],"max-w":[{"max-w":[i,"screen","none","prose",{screen:[s]},...j()]}],h:[{h:["screen","lh",...j()]}],"min-h":[{"min-h":["screen","lh","none",...j()]}],"max-h":[{"max-h":["screen","lh",...j()]}],"font-size":[{text:["base",r,jo,xo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,Co,So]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",uo,wo]}],"font-family":[{font:[To,wo,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[a,Co,wo]}],"line-clamp":[{"line-clamp":[lo,"none",Co,So]}],leading:[{leading:[o,...w()]}],"list-image":[{"list-image":["none",Co,wo]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Co,wo]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:T()}],"text-color":[{text:T()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","wavy"]}],"text-decoration-thickness":[{decoration:[lo,"from-font","auto",Co,xo]}],"text-decoration-color":[{decoration:T()}],"underline-offset":[{"underline-offset":[lo,"auto",Co,wo]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:w()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Co,wo]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Co,wo]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:N()}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:_()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},co,Co,wo],radial:["",Co,wo],conic:[co,Co,wo]},Ro,Ao]}],"bg-color":[{bg:T()}],"gradient-from-pos":[{from:R()}],"gradient-via-pos":[{via:R()}],"gradient-to-pos":[{to:R()}],"gradient-from":[{from:T()}],"gradient-via":[{via:T()}],"gradient-to":[{to:T()}],rounded:[{rounded:P()}],"rounded-s":[{"rounded-s":P()}],"rounded-e":[{"rounded-e":P()}],"rounded-t":[{"rounded-t":P()}],"rounded-r":[{"rounded-r":P()}],"rounded-b":[{"rounded-b":P()}],"rounded-l":[{"rounded-l":P()}],"rounded-ss":[{"rounded-ss":P()}],"rounded-se":[{"rounded-se":P()}],"rounded-ee":[{"rounded-ee":P()}],"rounded-es":[{"rounded-es":P()}],"rounded-tl":[{"rounded-tl":P()}],"rounded-tr":[{"rounded-tr":P()}],"rounded-br":[{"rounded-br":P()}],"rounded-bl":[{"rounded-bl":P()}],"border-w":[{border:O()}],"border-w-x":[{"border-x":O()}],"border-w-y":[{"border-y":O()}],"border-w-s":[{"border-s":O()}],"border-w-e":[{"border-e":O()}],"border-w-t":[{"border-t":O()}],"border-w-r":[{"border-r":O()}],"border-w-b":[{"border-b":O()}],"border-w-l":[{"border-l":O()}],"divide-x":[{"divide-x":O()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":O()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:["solid","dashed","dotted","double","hidden","none"]}],"divide-style":[{divide:["solid","dashed","dotted","double","hidden","none"]}],"border-color":[{border:T()}],"border-color-x":[{"border-x":T()}],"border-color-y":[{"border-y":T()}],"border-color-s":[{"border-s":T()}],"border-color-e":[{"border-e":T()}],"border-color-t":[{"border-t":T()}],"border-color-r":[{"border-r":T()}],"border-color-b":[{"border-b":T()}],"border-color-l":[{"border-l":T()}],"divide-color":[{divide:T()}],"outline-style":[{outline:["solid","dashed","dotted","double","none","hidden"]}],"outline-offset":[{"outline-offset":[lo,Co,wo]}],"outline-w":[{outline:["",lo,jo,xo]}],"outline-color":[{outline:T()}],shadow:[{shadow:["","none",d,Po,Eo]}],"shadow-color":[{shadow:T()}],"inset-shadow":[{"inset-shadow":["none",u,Po,Eo]}],"inset-shadow-color":[{"inset-shadow":T()}],"ring-w":[{ring:O()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:T()}],"ring-offset-w":[{"ring-offset":[lo,xo]}],"ring-offset-color":[{"ring-offset":T()}],"inset-ring-w":[{"inset-ring":O()}],"inset-ring-color":[{"inset-ring":T()}],"text-shadow":[{"text-shadow":["none",f,Po,Eo]}],"text-shadow-color":[{"text-shadow":T()}],opacity:[{opacity:[lo,Co,wo]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[lo]}],"mask-image-linear-from-pos":[{"mask-linear-from":D()}],"mask-image-linear-to-pos":[{"mask-linear-to":D()}],"mask-image-linear-from-color":[{"mask-linear-from":T()}],"mask-image-linear-to-color":[{"mask-linear-to":T()}],"mask-image-t-from-pos":[{"mask-t-from":D()}],"mask-image-t-to-pos":[{"mask-t-to":D()}],"mask-image-t-from-color":[{"mask-t-from":T()}],"mask-image-t-to-color":[{"mask-t-to":T()}],"mask-image-r-from-pos":[{"mask-r-from":D()}],"mask-image-r-to-pos":[{"mask-r-to":D()}],"mask-image-r-from-color":[{"mask-r-from":T()}],"mask-image-r-to-color":[{"mask-r-to":T()}],"mask-image-b-from-pos":[{"mask-b-from":D()}],"mask-image-b-to-pos":[{"mask-b-to":D()}],"mask-image-b-from-color":[{"mask-b-from":T()}],"mask-image-b-to-color":[{"mask-b-to":T()}],"mask-image-l-from-pos":[{"mask-l-from":D()}],"mask-image-l-to-pos":[{"mask-l-to":D()}],"mask-image-l-from-color":[{"mask-l-from":T()}],"mask-image-l-to-color":[{"mask-l-to":T()}],"mask-image-x-from-pos":[{"mask-x-from":D()}],"mask-image-x-to-pos":[{"mask-x-to":D()}],"mask-image-x-from-color":[{"mask-x-from":T()}],"mask-image-x-to-color":[{"mask-x-to":T()}],"mask-image-y-from-pos":[{"mask-y-from":D()}],"mask-image-y-to-pos":[{"mask-y-to":D()}],"mask-image-y-from-color":[{"mask-y-from":T()}],"mask-image-y-to-color":[{"mask-y-to":T()}],"mask-image-radial":[{"mask-radial":[Co,wo]}],"mask-image-radial-from-pos":[{"mask-radial-from":D()}],"mask-image-radial-to-pos":[{"mask-radial-to":D()}],"mask-image-radial-from-color":[{"mask-radial-from":T()}],"mask-image-radial-to-color":[{"mask-radial-to":T()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"]}],"mask-image-conic-pos":[{"mask-conic":[lo]}],"mask-image-conic-from-pos":[{"mask-conic-from":D()}],"mask-image-conic-to-pos":[{"mask-conic-to":D()}],"mask-image-conic-from-color":[{"mask-conic-from":T()}],"mask-image-conic-to-color":[{"mask-conic-to":T()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:N()}],"mask-repeat":[{mask:["no-repeat",{repeat:["","x","y","space","round"]}]}],"mask-size":[{mask:_()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Co,wo]}],filter:[{filter:["","none",Co,wo]}],blur:[{blur:I()}],brightness:[{brightness:[lo,Co,wo]}],contrast:[{contrast:[lo,Co,wo]}],"drop-shadow":[{"drop-shadow":["","none",m,Po,Eo]}],"drop-shadow-color":[{"drop-shadow":T()}],grayscale:[{grayscale:["",lo,Co,wo]}],"hue-rotate":[{"hue-rotate":[lo,Co,wo]}],invert:[{invert:["",lo,Co,wo]}],saturate:[{saturate:[lo,Co,wo]}],sepia:[{sepia:["",lo,Co,wo]}],"backdrop-filter":[{"backdrop-filter":["","none",Co,wo]}],"backdrop-blur":[{"backdrop-blur":I()}],"backdrop-brightness":[{"backdrop-brightness":[lo,Co,wo]}],"backdrop-contrast":[{"backdrop-contrast":[lo,Co,wo]}],"backdrop-grayscale":[{"backdrop-grayscale":["",lo,Co,wo]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[lo,Co,wo]}],"backdrop-invert":[{"backdrop-invert":["",lo,Co,wo]}],"backdrop-opacity":[{"backdrop-opacity":[lo,Co,wo]}],"backdrop-saturate":[{"backdrop-saturate":[lo,Co,wo]}],"backdrop-sepia":[{"backdrop-sepia":["",lo,Co,wo]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Co,wo]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[lo,"initial",Co,wo]}],ease:[{ease:["linear","initial",v,Co,wo]}],delay:[{delay:[lo,Co,wo]}],animate:[{animate:["none",b,Co,wo]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[h,Co,wo]}],"perspective-origin":[{"perspective-origin":y()}],rotate:[{rotate:M()}],"rotate-x":[{"rotate-x":M()}],"rotate-y":[{"rotate-y":M()}],"rotate-z":[{"rotate-z":M()}],scale:[{scale:U()}],"scale-x":[{"scale-x":U()}],"scale-y":[{"scale-y":U()}],"scale-z":[{"scale-z":U()}],"scale-3d":["scale-3d"],skew:[{skew:L()}],"skew-x":[{"skew-x":L()}],"skew-y":[{"skew-y":L()}],transform:[{transform:[Co,wo,"","none","gpu","cpu"]}],"transform-origin":[{origin:y()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:F()}],"translate-x":[{"translate-x":F()}],"translate-y":[{"translate-y":F()}],"translate-z":[{"translate-z":F()}],"translate-none":["translate-none"],accent:[{accent:T()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:T()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Co,wo]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Co,wo]}],fill:[{fill:["none",...T()]}],"stroke-w":[{stroke:[lo,jo,xo,So]}],stroke:[{stroke:["none",...T()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function Wo(...e){return Vo(Ia(e))}function $o(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function Go(...e){return t=>{let r=!1;const n=e.map(e=>{const n=$o(e,t);return r||"function"!=typeof n||(r=!0),n});if(r)return()=>{for(let t=0;t<n.length;t++){const r=n[t];"function"==typeof r?r():$o(e[t],null)}}}}function Ko(...e){return a.useCallback(Go(...e),e)}function Ho(t){const r=qo(t),n=a.forwardRef((t,n)=>{const{children:o,...s}=t,i=a.Children.toArray(o),l=i.find(Yo);if(l){const t=l.props.children,o=i.map(e=>e===l?a.Children.count(t)>1?a.Children.only(null):a.isValidElement(t)?t.props.children:null:e);return e.jsx(r,{...s,ref:n,children:a.isValidElement(t)?a.cloneElement(t,void 0,o):null})}return e.jsx(r,{...s,ref:n,children:o})});return n.displayName=`${t}.Slot`,n}var Zo=Ho("Slot");function qo(e){const t=a.forwardRef((e,t)=>{const{children:r,...n}=e;if(a.isValidElement(r)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;if(r)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r)return e.props.ref;return e.props.ref||e.ref}(r),o=function(e,t){const r={...t};for(const n in t){const a=e[n],o=t[n];/^on[A-Z]/.test(n)?a&&o?r[n]=(...e)=>{const t=o(...e);return a(...e),t}:a&&(r[n]=a):"style"===n?r[n]={...a,...o}:"className"===n&&(r[n]=[a,o].filter(Boolean).join(" "))}return{...e,...r}}(n,r.props);return r.type!==a.Fragment&&(o.ref=t?Go(t,e):e),a.cloneElement(r,o)}return a.Children.count(r)>1?a.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Jo=Symbol("radix.slottable");function Yo(e){return a.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===Jo}const Xo=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,Qo=Ia,es=(e,t)=>r=>{var n;if(null==(null==t?void 0:t.variants))return Qo(e,null==r?void 0:r.class,null==r?void 0:r.className);const{variants:a,defaultVariants:o}=t,s=Object.keys(a).map(e=>{const t=null==r?void 0:r[e],n=null==o?void 0:o[e];if(null===t)return null;const s=Xo(t)||Xo(n);return a[e][s]}),i=r&&Object.entries(r).reduce((e,t)=>{let[r,n]=t;return void 0===n||(e[r]=n),e},{}),l=null==t||null===(n=t.compoundVariants)||void 0===n?void 0:n.reduce((e,t)=>{let{class:r,className:n,...a}=t;return Object.entries(a).every(e=>{let[t,r]=e;return Array.isArray(r)?r.includes({...o,...i}[t]):{...o,...i}[t]===r})?[...e,r,n]:e},[]);return Qo(e,s,l,null==r?void 0:r.class,null==r?void 0:r.className)},ts=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),rs=e=>{const t=(e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,r)=>r?r.toUpperCase():t.toLowerCase()))(e);return t.charAt(0).toUpperCase()+t.slice(1)},ns=(...e)=>e.filter((e,t,r)=>Boolean(e)&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim(),as=e=>{for(const t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0};
2
2
  /**
3
3
  * @license lucide-react v0.544.0 - ISC
4
4
  *
5
5
  * This source code is licensed under the ISC license.
6
6
  * See the LICENSE file in the root directory of this source tree.
7
7
  */
8
- var es={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};
8
+ var os={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};
9
9
  /**
10
10
  * @license lucide-react v0.544.0 - ISC
11
11
  *
12
12
  * This source code is licensed under the ISC license.
13
13
  * See the LICENSE file in the root directory of this source tree.
14
- */const ts=t.forwardRef(({color:e="currentColor",size:r=24,strokeWidth:n=2,absoluteStrokeWidth:a,className:o="",children:s,iconNode:i,...l},c)=>t.createElement("svg",{ref:c,...es,width:r,height:r,stroke:e,strokeWidth:a?24*Number(n)/Number(r):n,className:Xo("lucide",o),...!s&&!Qo(l)&&{"aria-hidden":"true"},...l},[...i.map(([e,r])=>t.createElement(e,r)),...Array.isArray(s)?s:[s]])),rs=(e,r)=>{const n=t.forwardRef(({className:n,...a},o)=>t.createElement(ts,{ref:o,iconNode:r,className:Xo(`lucide-${Jo(Yo(e))}`,`lucide-${e}`,n),...a}));return n.displayName=Yo(e),n},ns=rs("building-2",[["path",{d:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",key:"1b4qmf"}],["path",{d:"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2",key:"i71pzd"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2",key:"10jefs"}],["path",{d:"M10 6h4",key:"1itunk"}],["path",{d:"M10 10h4",key:"tcdvrf"}],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]]),as=rs("check-check",[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]]),os=rs("chevrons-up-down",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]),ss=rs("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]),is=rs("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),ls=rs("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),cs=rs("refresh-ccw",[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}]]),us=rs("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]),ds=rs("settings",[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),fs=rs("smile",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 14s1.5 2 4 2 4-2 4-2",key:"1y1vjs"}],["line",{x1:"9",x2:"9.01",y1:"9",y2:"9",key:"yxxnd0"}],["line",{x1:"15",x2:"15.01",y1:"9",y2:"9",key:"1p4y9e"}]]),ms=rs("toggle-right",[["circle",{cx:"15",cy:"12",r:"3",key:"1afu0r"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]]),ps=rs("trash",[["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]),hs=rs("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]),gs=rs("users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]),vs=qo("inline-flex items-center justify-center rounded-full font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:opacity-50 disabled:pointer-events-none ring-offset-background",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"underline-offset-4 hover:underline text-primary"},withIcon:{true:"flex"},fullWidth:{true:"w-full"},size:{default:"h-9 py-2 px-4 text-sm",sm:"h-8 px-3 text-xs",lg:"h-10 px-6 text-base",icon:"h-9 w-9"}},compoundVariants:[{size:"lg",withIcon:!0,className:"gap-x-1.5"},{size:"default",withIcon:!0,className:"gap-x-1"},{size:"sm",withIcon:!0,className:"gap-x-0.5"}],defaultVariants:{variant:"default",size:"default"}}),bs=a.forwardRef(({className:t,variant:r,progress:n,size:o,startIcon:s,endIcon:i,asChild:l=!1,...c},u)=>{const d=l?$o:"button",f=function(e){switch(e){case"lg":return 20;case"sm":return 14;default:return 16}}(o);return e.jsxs(d,{disabled:n||c.disabled,className:Uo(vs({variant:r,size:o,withIcon:null!=n||null!=s||null!=i,className:t})),ref:u,...c,children:[n&&e.jsx(is,{size:f,className:"animate-spin"}),s&&a.cloneElement(s,{size:f}),c.children,i&&a.cloneElement(i,{size:f})]})});
14
+ */const ss=t.forwardRef(({color:e="currentColor",size:r=24,strokeWidth:n=2,absoluteStrokeWidth:a,className:o="",children:s,iconNode:i,...l},c)=>t.createElement("svg",{ref:c,...os,width:r,height:r,stroke:e,strokeWidth:a?24*Number(n)/Number(r):n,className:ns("lucide",o),...!s&&!as(l)&&{"aria-hidden":"true"},...l},[...i.map(([e,r])=>t.createElement(e,r)),...Array.isArray(s)?s:[s]])),is=(e,r)=>{const n=t.forwardRef(({className:n,...a},o)=>t.createElement(ss,{ref:o,iconNode:r,className:ns(`lucide-${ts(rs(e))}`,`lucide-${e}`,n),...a}));return n.displayName=rs(e),n},ls=is("building-2",[["path",{d:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",key:"1b4qmf"}],["path",{d:"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2",key:"i71pzd"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2",key:"10jefs"}],["path",{d:"M10 6h4",key:"1itunk"}],["path",{d:"M10 10h4",key:"tcdvrf"}],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]]),cs=is("check-check",[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]]),ds=is("chevrons-up-down",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]),us=is("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]),fs=is("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),ms=is("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),ps=is("refresh-ccw",[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}]]),hs=is("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]),gs=is("settings",[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),vs=is("smile",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 14s1.5 2 4 2 4-2 4-2",key:"1y1vjs"}],["line",{x1:"9",x2:"9.01",y1:"9",y2:"9",key:"yxxnd0"}],["line",{x1:"15",x2:"15.01",y1:"9",y2:"9",key:"1p4y9e"}]]),bs=is("toggle-right",[["circle",{cx:"15",cy:"12",r:"3",key:"1afu0r"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]]),ys=is("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]),ws=is("trash",[["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]),xs=is("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),Ss=is("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]),ks=is("users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]),As=es("inline-flex items-center justify-center rounded-full font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:opacity-50 disabled:pointer-events-none ring-offset-background",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"underline-offset-4 hover:underline text-primary"},withIcon:{true:"flex"},fullWidth:{true:"w-full"},size:{default:"h-9 py-2 px-4 text-sm",sm:"h-8 px-3 text-xs",lg:"h-10 px-6 text-base",icon:"h-9 w-9"}},compoundVariants:[{size:"lg",withIcon:!0,className:"gap-x-1.5"},{size:"default",withIcon:!0,className:"gap-x-1"},{size:"sm",withIcon:!0,className:"gap-x-0.5"}],defaultVariants:{variant:"default",size:"default"}}),Es=a.forwardRef(({className:t,variant:r,progress:n,size:o,startIcon:s,endIcon:i,asChild:l=!1,...c},d)=>{const u=l?Zo:"button",f=function(e){switch(e){case"lg":return 20;case"sm":return 14;default:return 16}}(o);return e.jsxs(u,{disabled:n||c.disabled,className:Wo(As({variant:r,size:o,withIcon:null!=n||null!=s||null!=i,className:t})),ref:d,...c,children:[n&&e.jsx(fs,{size:f,className:"animate-spin"}),s&&a.cloneElement(s,{size:f}),c.children,i&&a.cloneElement(i,{size:f})]})});
15
15
  /**
16
16
  * @license lucide-react v0.544.0 - ISC
17
17
  *
18
18
  * This source code is licensed under the ISC license.
19
19
  * See the LICENSE file in the root directory of this source tree.
20
- */bs.displayName="Button";var ys=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((t,r)=>{const n=Vo(`Primitive.${r}`),o=a.forwardRef((t,a)=>{const{asChild:o,...s}=t,i=o?n:r;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),e.jsx(i,{...s,ref:a})});return o.displayName=`Primitive.${r}`,{...t,[r]:o}},{});var ws=a.forwardRef((t,r)=>e.jsx(ys.label,{...t,ref:r,onMouseDown:e=>{e.target.closest("button, input, select, textarea")||(t.onMouseDown?.(e),!e.defaultPrevented&&e.detail>1&&e.preventDefault())}}));ws.displayName="Label";var xs=ws;const Ss=qo("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),ks=a.forwardRef(({className:t,...r},n)=>e.jsx(xs,{ref:n,className:Uo(Ss(),t),...r}));ks.displayName=xs.displayName;const As=Me,Es=a.createContext({}),Cs=({...t})=>e.jsx(Es.Provider,{value:{name:t.name},children:e.jsx(We,{...t})}),Ts=()=>{const e=a.useContext(Es),t=a.useContext(js),{getFieldState:r,formState:n}=Ie(),o=r(e.name,n);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:s}=t;return{id:s,name:e.name,formItemId:`${s}-form-item`,formDescriptionId:`${s}-form-item-description`,formMessageId:`${s}-form-item-message`,...o}},js=a.createContext({}),_s=a.forwardRef(({className:t,...r},n)=>{const o=a.useId();return e.jsx(js.Provider,{value:{id:o},children:e.jsx("div",{ref:n,className:Uo("space-y-2",t),...r})})});_s.displayName="FormItem";const Ns=a.forwardRef(({className:t,...r},n)=>{const{error:a,formItemId:o}=Ts();return e.jsx(ks,{ref:n,className:Uo(a&&"text-destructive",t),htmlFor:o,...r})});Ns.displayName="FormLabel";const Rs=a.forwardRef(({...t},r)=>{const{error:n,formItemId:a,formDescriptionId:o,formMessageId:s}=Ts();return e.jsx($o,{ref:r,id:a,"aria-describedby":n?`${o} ${s}`:`${o}`,"aria-invalid":!!n,...t})});Rs.displayName="FormControl";const Ps=a.forwardRef(({className:t,...r},n)=>{const{formDescriptionId:a}=Ts();return e.jsx("p",{ref:n,id:a,className:Uo("text-sm text-muted-foreground",t),...r})});Ps.displayName="FormDescription";const Os=a.forwardRef(({className:t,children:r,...n},a)=>{const{error:o,formMessageId:s}=Ts(),i=o?String(o?.message):r;return i?e.jsx("p",{ref:a,id:s,className:Uo("text-sm font-medium text-destructive",t),...n,children:i}):null});Os.displayName="FormMessage";const Ds=a.forwardRef(({className:t,type:r,...n},a)=>e.jsx("input",{type:r,className:Uo("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",t),ref:a,...n}));function Is({className:t,...r}){return e.jsx("div",{className:Uo("animate-pulse rounded-md bg-primary/10",t),...r})}Ds.displayName="Input";let Ms=class{constructor(e){this.version=e.version,this.orgId=e.orgId,this.serverUrl=e.serverUrl}async fetchConfig(){const e=await fetch(`${this.serverUrl}/api/${this.version}/beta/config?orgId=${this.orgId}`);if(!e.ok)throw new Error(`Failed to fetch beta form configuration: ${e.statusText}`);return e.json()}async submitBetaUser(e){const t=e?.context??{},r=t?.country??("undefined"!=typeof navigator&&navigator.language?navigator.language.split("-")[1]:void 0),n=t?.language??("undefined"!=typeof navigator&&navigator.language?navigator.language.split("-")[0]:void 0),a=t?.timezone??("undefined"!=typeof Intl&&Intl.DateTimeFormat?Intl.DateTimeFormat().resolvedOptions().timeZone:void 0),o=t?.currency??("undefined"!=typeof Intl&&Intl.NumberFormat&&Intl.NumberFormat().resolvedOptions().currency?Intl.NumberFormat().resolvedOptions().currency:void 0),s=await fetch(`${this.serverUrl}/api/${this.version}/beta/submit`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({orgId:this.orgId,formData:{...e,country:r,language:n,timezone:a,currency:o}})});if(!s.ok)throw new Error(`Failed to submit beta user request: ${s.statusText}`);return s.json()}};const Ls=Dt("ZodISODateTime",(e,t)=>{Cn.init(e,t),li.init(e,t)});function Us(e){return function(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...rr(t)})}(Ls,e)}const zs=Dt("ZodISODate",(e,t)=>{Tn.init(e,t),li.init(e,t)});function Fs(e){return function(e,t){return new e({type:"string",format:"date",check:"string_format",...rr(t)})}(zs,e)}const Bs=Dt("ZodISOTime",(e,t)=>{jn.init(e,t),li.init(e,t)});function Vs(e){return function(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...rr(t)})}(Bs,e)}const $s=Dt("ZodISODuration",(e,t)=>{_n.init(e,t),li.init(e,t)});function Ws(e){return function(e,t){return new e({type:"string",format:"duration",check:"string_format",...rr(t)})}($s,e)}const Gs=Dt("ZodError",(e,t)=>{ur.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>function(e,t){const r=t||function(e){return e.message},n={_errors:[]},a=e=>{for(const t of e.issues)if("invalid_union"===t.code&&t.errors.length)t.errors.map(e=>a({issues:e}));else if("invalid_key"===t.code)a({issues:t.issues});else if("invalid_element"===t.code)a({issues:t.issues});else if(0===t.path.length)n._errors.push(r(t));else{let e=n,a=0;for(;a<t.path.length;){const n=t.path[a];a===t.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(r(t))):e[n]=e[n]||{_errors:[]},e=e[n],a++}}};return a(e),n}(e,t)},flatten:{value:t=>function(e,t=e=>e.message){const r={},n=[];for(const a of e.issues)a.path.length>0?(r[a.path[0]]=r[a.path[0]]||[],r[a.path[0]].push(t(a))):n.push(t(a));return{formErrors:n,fieldErrors:r}}(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,zt,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,zt,2)}},isEmpty:{get:()=>0===e.issues.length}})},{Parent:Error}),Ks=fr(Gs),Hs=pr(Gs),Zs=gr(Gs),qs=br(Gs),Js=wr(Gs),Ys=xr(Gs),Xs=Sr(Gs),Qs=kr(Gs),ei=Ar(Gs),ti=Er(Gs),ri=Cr(Gs),ni=Tr(Gs),ai=Dt("ZodType",(e,t)=>(fn.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]}),e.clone=(t,r)=>tr(e,t,r),e.brand=()=>e,e.register=(t,r)=>(t.add(e,r),e),e.parse=(t,r)=>Ks(e,t,r,{callee:e.parse}),e.safeParse=(t,r)=>Zs(e,t,r),e.parseAsync=async(t,r)=>Hs(e,t,r,{callee:e.parseAsync}),e.safeParseAsync=async(t,r)=>qs(e,t,r),e.spa=e.safeParseAsync,e.encode=(t,r)=>Js(e,t,r),e.decode=(t,r)=>Ys(e,t,r),e.encodeAsync=async(t,r)=>Xs(e,t,r),e.decodeAsync=async(t,r)=>Qs(e,t,r),e.safeEncode=(t,r)=>ei(e,t,r),e.safeDecode=(t,r)=>ti(e,t,r),e.safeEncodeAsync=async(t,r)=>ri(e,t,r),e.safeDecodeAsync=async(t,r)=>ni(e,t,r),e.refine=(t,r)=>e.check(function(e,t={}){return function(e,t,r){return new e({type:"custom",check:"custom",fn:t,...rr(r)})}(Ji,e,t)}(t,r)),e.superRefine=t=>e.check(Aa(t)),e.overwrite=t=>e.check(ka(t)),e.optional=()=>Fi(e),e.nullable=()=>Vi(e),e.nullish=()=>Fi(Vi(e)),e.nonoptional=t=>function(e,t){return new Gi({type:"nonoptional",innerType:e,...rr(t)})}(e,t),e.array=()=>{return function(e,t,r){return new e({type:"array",element:t,...rr(r)})}(Pi,e,t);var t},e.or=t=>function(e,t){return new Ii({type:"union",options:e,...rr(t)})}([e,t]),e.and=t=>new Mi({type:"intersection",left:e,right:t}),e.transform=t=>Zi(e,new Ui({type:"transform",transform:t})),e.default=t=>{return r=t,new $i({type:"default",innerType:e,get defaultValue(){return"function"==typeof r?r():Xt(r)}});var r},e.prefault=t=>{return r=t,new Wi({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof r?r():Xt(r)}});var r},e.catch=t=>{return new Ki({type:"catch",innerType:e,catchValue:"function"==typeof(r=t)?r:()=>r});var r},e.pipe=t=>Zi(e,t),e.readonly=()=>new qi({type:"readonly",innerType:e}),e.describe=t=>{const r=e.clone();return ba.add(r,{description:t}),r},Object.defineProperty(e,"description",{get:()=>ba.get(e)?.description,configurable:!0}),e.meta=(...t)=>{if(0===t.length)return ba.get(e);const r=e.clone();return ba.add(r,t[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),oi=Dt("_ZodString",(e,t)=>{mn.init(e,t),ai.init(e,t);const r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...t)=>e.check(function(e,t){return new rn({check:"string_format",format:"regex",...rr(t),pattern:e})}(...t)),e.includes=(...t)=>e.check(function(e,t){return new on({check:"string_format",format:"includes",...rr(t),includes:e})}(...t)),e.startsWith=(...t)=>e.check(function(e,t){return new sn({check:"string_format",format:"starts_with",...rr(t),prefix:e})}(...t)),e.endsWith=(...t)=>e.check(function(e,t){return new ln({check:"string_format",format:"ends_with",...rr(t),suffix:e})}(...t)),e.min=(...t)=>e.check(xa(...t)),e.max=(...t)=>e.check(wa(...t)),e.length=(...t)=>e.check(Sa(...t)),e.nonempty=(...t)=>e.check(xa(1,...t)),e.lowercase=t=>e.check(function(e){return new nn({check:"string_format",format:"lowercase",...rr(e)})}(t)),e.uppercase=t=>e.check(function(e){return new an({check:"string_format",format:"uppercase",...rr(e)})}(t)),e.trim=()=>e.check(ka(e=>e.trim())),e.normalize=(...t)=>e.check(function(e){return ka(t=>t.normalize(e))}(...t)),e.toLowerCase=()=>e.check(ka(e=>e.toLowerCase())),e.toUpperCase=()=>e.check(ka(e=>e.toUpperCase()))}),si=Dt("ZodString",(e,t)=>{mn.init(e,t),oi.init(e,t),e.email=t=>e.check(function(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...rr(t)})}(ci,t)),e.url=t=>e.check(function(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...rr(t)})}(fi,t)),e.jwt=t=>e.check(function(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...rr(t)})}(Ti,t)),e.emoji=t=>e.check(function(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...rr(t)})}(mi,t)),e.guid=t=>e.check(ya(ui,t)),e.uuid=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...rr(t)})}(di,t)),e.uuidv4=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...rr(t)})}(di,t)),e.uuidv6=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...rr(t)})}(di,t)),e.uuidv7=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...rr(t)})}(di,t)),e.nanoid=t=>e.check(function(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...rr(t)})}(pi,t)),e.guid=t=>e.check(ya(ui,t)),e.cuid=t=>e.check(function(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...rr(t)})}(hi,t)),e.cuid2=t=>e.check(function(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...rr(t)})}(gi,t)),e.ulid=t=>e.check(function(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...rr(t)})}(vi,t)),e.base64=t=>e.check(function(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...rr(t)})}(Ai,t)),e.base64url=t=>e.check(function(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...rr(t)})}(Ei,t)),e.xid=t=>e.check(function(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...rr(t)})}(bi,t)),e.ksuid=t=>e.check(function(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...rr(t)})}(yi,t)),e.ipv4=t=>e.check(function(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...rr(t)})}(wi,t)),e.ipv6=t=>e.check(function(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...rr(t)})}(xi,t)),e.cidrv4=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...rr(t)})}(Si,t)),e.cidrv6=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...rr(t)})}(ki,t)),e.e164=t=>e.check(function(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...rr(t)})}(Ci,t)),e.datetime=t=>e.check(Us(t)),e.date=t=>e.check(Fs(t)),e.time=t=>e.check(Vs(t)),e.duration=t=>e.check(Ws(t))});function ii(e){return function(e,t){return new e({type:"string",...rr(t)})}(si,e)}const li=Dt("ZodStringFormat",(e,t)=>{pn.init(e,t),oi.init(e,t)}),ci=Dt("ZodEmail",(e,t)=>{vn.init(e,t),li.init(e,t)}),ui=Dt("ZodGUID",(e,t)=>{hn.init(e,t),li.init(e,t)}),di=Dt("ZodUUID",(e,t)=>{gn.init(e,t),li.init(e,t)}),fi=Dt("ZodURL",(e,t)=>{bn.init(e,t),li.init(e,t)}),mi=Dt("ZodEmoji",(e,t)=>{yn.init(e,t),li.init(e,t)}),pi=Dt("ZodNanoID",(e,t)=>{wn.init(e,t),li.init(e,t)}),hi=Dt("ZodCUID",(e,t)=>{xn.init(e,t),li.init(e,t)}),gi=Dt("ZodCUID2",(e,t)=>{Sn.init(e,t),li.init(e,t)}),vi=Dt("ZodULID",(e,t)=>{kn.init(e,t),li.init(e,t)}),bi=Dt("ZodXID",(e,t)=>{An.init(e,t),li.init(e,t)}),yi=Dt("ZodKSUID",(e,t)=>{En.init(e,t),li.init(e,t)}),wi=Dt("ZodIPv4",(e,t)=>{Nn.init(e,t),li.init(e,t)}),xi=Dt("ZodIPv6",(e,t)=>{Rn.init(e,t),li.init(e,t)}),Si=Dt("ZodCIDRv4",(e,t)=>{Pn.init(e,t),li.init(e,t)}),ki=Dt("ZodCIDRv6",(e,t)=>{On.init(e,t),li.init(e,t)}),Ai=Dt("ZodBase64",(e,t)=>{In.init(e,t),li.init(e,t)}),Ei=Dt("ZodBase64URL",(e,t)=>{Mn.init(e,t),li.init(e,t)}),Ci=Dt("ZodE164",(e,t)=>{Ln.init(e,t),li.init(e,t)}),Ti=Dt("ZodJWT",(e,t)=>{Un.init(e,t),li.init(e,t)}),ji=Dt("ZodUnknown",(e,t)=>{zn.init(e,t),ai.init(e,t)});function _i(){return new ji({type:"unknown"})}const Ni=Dt("ZodNever",(e,t)=>{Fn.init(e,t),ai.init(e,t)});function Ri(e){return function(e,t){return new e({type:"never",...rr(t)})}(Ni,e)}const Pi=Dt("ZodArray",(e,t)=>{Vn.init(e,t),ai.init(e,t),e.element=t.element,e.min=(t,r)=>e.check(xa(t,r)),e.nonempty=t=>e.check(xa(1,t)),e.max=(t,r)=>e.check(wa(t,r)),e.length=(t,r)=>e.check(Sa(t,r)),e.unwrap=()=>e.element});const Oi=Dt("ZodObject",(e,t)=>{Hn.init(e,t),ai.init(e,t),Wt(e,"shape",()=>t.shape),e.keyof=()=>function(e,t){const r=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new Li({type:"enum",entries:r,...rr(t)})}(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:_i()}),e.loose=()=>e.clone({...e._zod.def,catchall:_i()}),e.strict=()=>e.clone({...e._zod.def,catchall:Ri()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>function(e,t){if(!Yt(t))throw new Error("Invalid input to extend: expected a plain object");const r=e._zod.def.checks;if(r&&r.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");const n=Kt(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return Gt(this,"shape",r),r},checks:[]});return tr(e,n)}(e,t),e.safeExtend=t=>function(e,t){if(!Yt(t))throw new Error("Invalid input to safeExtend: expected a plain object");const r={...e._zod.def,get shape(){const r={...e._zod.def.shape,...t};return Gt(this,"shape",r),r},checks:e._zod.def.checks};return tr(e,r)}(e,t),e.merge=t=>function(e,t){const r=Kt(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return Gt(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return tr(e,r)}(e,t),e.pick=t=>function(e,t){const r=e._zod.def;return tr(e,Kt(e._zod.def,{get shape(){const e={};for(const n in t){if(!(n in r.shape))throw new Error(`Unrecognized key: "${n}"`);t[n]&&(e[n]=r.shape[n])}return Gt(this,"shape",e),e},checks:[]}))}(e,t),e.omit=t=>function(e,t){const r=e._zod.def,n=Kt(e._zod.def,{get shape(){const n={...e._zod.def.shape};for(const e in t){if(!(e in r.shape))throw new Error(`Unrecognized key: "${e}"`);t[e]&&delete n[e]}return Gt(this,"shape",n),n},checks:[]});return tr(e,n)}(e,t),e.partial=(...t)=>function(e,t,r){const n=Kt(t._zod.def,{get shape(){const n=t._zod.def.shape,a={...n};if(r)for(const t in r){if(!(t in n))throw new Error(`Unrecognized key: "${t}"`);r[t]&&(a[t]=e?new e({type:"optional",innerType:n[t]}):n[t])}else for(const t in n)a[t]=e?new e({type:"optional",innerType:n[t]}):n[t];return Gt(this,"shape",a),a},checks:[]});return tr(t,n)}(zi,e,t[0]),e.required=(...t)=>function(e,t,r){const n=Kt(t._zod.def,{get shape(){const n=t._zod.def.shape,a={...n};if(r)for(const t in r){if(!(t in a))throw new Error(`Unrecognized key: "${t}"`);r[t]&&(a[t]=new e({type:"nonoptional",innerType:n[t]}))}else for(const t in n)a[t]=new e({type:"nonoptional",innerType:n[t]});return Gt(this,"shape",a),a},checks:[]});return tr(t,n)}(Gi,e,t[0])});function Di(e,t){const r={type:"object",get shape(){var t;return Gt(this,"shape",e?(t=e,Object.create(Object.getPrototypeOf(t),Object.getOwnPropertyDescriptors(t))):{}),this.shape},...rr(t)};return new Oi(r)}const Ii=Dt("ZodUnion",(e,t)=>{qn.init(e,t),ai.init(e,t),e.options=t.options});const Mi=Dt("ZodIntersection",(e,t)=>{Jn.init(e,t),ai.init(e,t)});const Li=Dt("ZodEnum",(e,t)=>{Qn.init(e,t),ai.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const r=new Set(Object.keys(t.entries));e.extract=(e,n)=>{const a={};for(const n of e){if(!r.has(n))throw new Error(`Key ${n} not found in enum`);a[n]=t.entries[n]}return new Li({...t,checks:[],...rr(n),entries:a})},e.exclude=(e,n)=>{const a={...t.entries};for(const t of e){if(!r.has(t))throw new Error(`Key ${t} not found in enum`);delete a[t]}return new Li({...t,checks:[],...rr(n),entries:a})}});const Ui=Dt("ZodTransform",(e,t)=>{ea.init(e,t),ai.init(e,t),e._zod.parse=(r,n)=>{if("backward"===n.direction)throw new Mt(e.constructor.name);r.addIssue=n=>{if("string"==typeof n)r.issues.push(lr(n,r.value,t));else{const t=n;t.fatal&&(t.continue=!1),t.code??(t.code="custom"),t.input??(t.input=r.value),t.inst??(t.inst=e),r.issues.push(lr(t))}};const a=t.transform(r.value,r);return a instanceof Promise?a.then(e=>(r.value=e,r)):(r.value=a,r)}});const zi=Dt("ZodOptional",(e,t)=>{ra.init(e,t),ai.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Fi(e){return new zi({type:"optional",innerType:e})}const Bi=Dt("ZodNullable",(e,t)=>{na.init(e,t),ai.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Vi(e){return new Bi({type:"nullable",innerType:e})}const $i=Dt("ZodDefault",(e,t)=>{aa.init(e,t),ai.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});const Wi=Dt("ZodPrefault",(e,t)=>{sa.init(e,t),ai.init(e,t),e.unwrap=()=>e._zod.def.innerType});const Gi=Dt("ZodNonOptional",(e,t)=>{ia.init(e,t),ai.init(e,t),e.unwrap=()=>e._zod.def.innerType});const Ki=Dt("ZodCatch",(e,t)=>{ca.init(e,t),ai.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});const Hi=Dt("ZodPipe",(e,t)=>{ua.init(e,t),ai.init(e,t),e.in=t.in,e.out=t.out});function Zi(e,t){return new Hi({type:"pipe",in:e,out:t})}const qi=Dt("ZodReadonly",(e,t)=>{fa.init(e,t),ai.init(e,t),e.unwrap=()=>e._zod.def.innerType});const Ji=Dt("ZodCustom",(e,t)=>{pa.init(e,t),ai.init(e,t)});const Yi=Di({name:ii().min(1,"Please enter your name").max(50,"Name must be less than 50 characters").regex(/^[a-zA-Z\s]*$/,"Name can only contain letters and spaces"),email:ii().min(1,"Please enter your email address").email("Please enter a valid email address").max(100,"Email must be less than 100 characters").regex(/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,"Please enter a valid email format (e.g., name@domain.com)")}),Xi={en:{nameLabel:"Name",emailLabel:"Email",submitText:"Submit",submittingText:"Submitting...",errorMessage:"An error occurred"},es:{nameLabel:"Nombre",emailLabel:"Correo electrónico",submitText:"Enviar",submittingText:"Enviando...",errorMessage:"Ocurrió un error"},fr:{nameLabel:"Nom",emailLabel:"Email",submitText:"Soumettre",submittingText:"Soumission...",errorMessage:"Une erreur est survenue"},de:{nameLabel:"Name",emailLabel:"E-Mail",submitText:"Absenden",submittingText:"Wird gesendet...",errorMessage:"Ein Fehler ist aufgetreten"},zh:{nameLabel:"姓名",emailLabel:"电子邮件",submitText:"提交",submittingText:"提交中...",errorMessage:"发生错误"},ja:{nameLabel:"名前",emailLabel:"メールアドレス",submitText:"送信",submittingText:"送信中...",errorMessage:"エラーが発生しました"},ko:{nameLabel:"이름",emailLabel:"이메일",submitText:"제출",submittingText:"제출 중...",errorMessage:"오류가 발생했습니다"}};function Qi({screen:t}){return e.jsxs("div",{className:"flex flex-col items-center justify-center w-full",children:[e.jsx("p",{className:"text-2xl font-bold",children:t?.title}),e.jsx("p",{className:"text-sm text-muted-foreground",children:t?.description})]})}function el({logo:t}){return"string"==typeof t?e.jsx("img",{src:t,alt:"Logo",className:"max-h-24"}):e.jsx("img",{src:t.bucket?.url,alt:"Logo",className:"max-h-24"})}function tl(e,t){return function(){return e.apply(t,arguments)}}const{toString:rl}=Object.prototype,{getPrototypeOf:nl}=Object,{iterator:al,toStringTag:ol}=Symbol,sl=(il=Object.create(null),e=>{const t=rl.call(e);return il[t]||(il[t]=t.slice(8,-1).toLowerCase())});var il;const ll=e=>(e=e.toLowerCase(),t=>sl(t)===e),cl=e=>t=>typeof t===e,{isArray:ul}=Array,dl=cl("undefined");function fl(e){return null!==e&&!dl(e)&&null!==e.constructor&&!dl(e.constructor)&&hl(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const ml=ll("ArrayBuffer");const pl=cl("string"),hl=cl("function"),gl=cl("number"),vl=e=>null!==e&&"object"==typeof e,bl=e=>{if("object"!==sl(e))return!1;const t=nl(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||ol in e||al in e)},yl=ll("Date"),wl=ll("File"),xl=ll("Blob"),Sl=ll("FileList"),kl=ll("URLSearchParams"),[Al,El,Cl,Tl]=["ReadableStream","Request","Response","Headers"].map(ll);function jl(e,t,{allOwnKeys:r=!1}={}){if(null==e)return;let n,a;if("object"!=typeof e&&(e=[e]),ul(e))for(n=0,a=e.length;n<a;n++)t.call(null,e[n],n,e);else{if(fl(e))return;const a=r?Object.getOwnPropertyNames(e):Object.keys(e),o=a.length;let s;for(n=0;n<o;n++)s=a[n],t.call(null,e[s],s,e)}}function _l(e,t){if(fl(e))return null;t=t.toLowerCase();const r=Object.keys(e);let n,a=r.length;for(;a-- >0;)if(n=r[a],t===n.toLowerCase())return n;return null}const Nl="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,Rl=e=>!dl(e)&&e!==Nl;const Pl=(Ol="undefined"!=typeof Uint8Array&&nl(Uint8Array),e=>Ol&&e instanceof Ol);var Ol;const Dl=ll("HTMLFormElement"),Il=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),Ml=ll("RegExp"),Ll=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};jl(r,(r,a)=>{let o;!1!==(o=t(r,a,e))&&(n[a]=o||r)}),Object.defineProperties(e,n)};const Ul=ll("AsyncFunction"),zl=(Fl="function"==typeof setImmediate,Bl=hl(Nl.postMessage),Fl?setImmediate:Bl?(Vl=`axios@${Math.random()}`,$l=[],Nl.addEventListener("message",({source:e,data:t})=>{e===Nl&&t===Vl&&$l.length&&$l.shift()()},!1),e=>{$l.push(e),Nl.postMessage(Vl,"*")}):e=>setTimeout(e));var Fl,Bl,Vl,$l;const Wl="undefined"!=typeof queueMicrotask?queueMicrotask.bind(Nl):"undefined"!=typeof process&&process.nextTick||zl;var Gl={isArray:ul,isArrayBuffer:ml,isBuffer:fl,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||hl(e.append)&&("formdata"===(t=sl(e))||"object"===t&&hl(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&ml(e.buffer),t},isString:pl,isNumber:gl,isBoolean:e=>!0===e||!1===e,isObject:vl,isPlainObject:bl,isEmptyObject:e=>{if(!vl(e)||fl(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:Al,isRequest:El,isResponse:Cl,isHeaders:Tl,isUndefined:dl,isDate:yl,isFile:wl,isBlob:xl,isRegExp:Ml,isFunction:hl,isStream:e=>vl(e)&&hl(e.pipe),isURLSearchParams:kl,isTypedArray:Pl,isFileList:Sl,forEach:jl,merge:function e(){const{caseless:t,skipUndefined:r}=Rl(this)&&this||{},n={},a=(a,o)=>{const s=t&&_l(n,o)||o;bl(n[s])&&bl(a)?n[s]=e(n[s],a):bl(a)?n[s]=e({},a):ul(a)?n[s]=a.slice():r&&dl(a)||(n[s]=a)};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&jl(arguments[e],a);return n},extend:(e,t,r,{allOwnKeys:n}={})=>(jl(t,(t,n)=>{r&&hl(t)?e[n]=tl(t,r):e[n]=t},{allOwnKeys:n}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},toFlatObject:(e,t,r,n)=>{let a,o,s;const i={};if(t=t||{},null==e)return t;do{for(a=Object.getOwnPropertyNames(e),o=a.length;o-- >0;)s=a[o],n&&!n(s,e,t)||i[s]||(t[s]=e[s],i[s]=!0);e=!1!==r&&nl(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:sl,kindOfTest:ll,endsWith:(e,t,r)=>{e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return-1!==n&&n===r},toArray:e=>{if(!e)return null;if(ul(e))return e;let t=e.length;if(!gl(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},forEachEntry:(e,t)=>{const r=(e&&e[al]).call(e);let n;for(;(n=r.next())&&!n.done;){const r=n.value;t.call(e,r[0],r[1])}},matchAll:(e,t)=>{let r;const n=[];for(;null!==(r=e.exec(t));)n.push(r);return n},isHTMLForm:Dl,hasOwnProperty:Il,hasOwnProp:Il,reduceDescriptors:Ll,freezeMethods:e=>{Ll(e,(t,r)=>{if(hl(e)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;const n=e[r];hl(n)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")}))})},toObjectSet:(e,t)=>{const r={},n=e=>{e.forEach(e=>{r[e]=!0})};return ul(e)?n(e):n(String(e).split(t)),r},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,r){return t.toUpperCase()+r}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:_l,global:Nl,isContextDefined:Rl,isSpecCompliantForm:function(e){return!!(e&&hl(e.append)&&"FormData"===e[ol]&&e[al])},toJSONObject:e=>{const t=new Array(10),r=(e,n)=>{if(vl(e)){if(t.indexOf(e)>=0)return;if(fl(e))return e;if(!("toJSON"in e)){t[n]=e;const a=ul(e)?[]:{};return jl(e,(e,t)=>{const o=r(e,n+1);!dl(o)&&(a[t]=o)}),t[n]=void 0,a}}return e};return r(e,0)},isAsyncFn:Ul,isThenable:e=>e&&(vl(e)||hl(e))&&hl(e.then)&&hl(e.catch),setImmediate:zl,asap:Wl,isIterable:e=>null!=e&&hl(e[al])};function Kl(e,t,r,n,a){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),a&&(this.response=a,this.status=a.status?a.status:null)}Gl.inherits(Kl,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Gl.toJSONObject(this.config),code:this.code,status:this.status}}});const Hl=Kl.prototype,Zl={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Zl[e]={value:e}}),Object.defineProperties(Kl,Zl),Object.defineProperty(Hl,"isAxiosError",{value:!0}),Kl.from=(e,t,r,n,a,o)=>{const s=Object.create(Hl);Gl.toFlatObject(e,s,function(e){return e!==Error.prototype},e=>"isAxiosError"!==e);const i=e&&e.message?e.message:"Error",l=null==t&&e?e.code:t;return Kl.call(s,i,l,r,n,a),e&&null==s.cause&&Object.defineProperty(s,"cause",{value:e,configurable:!0}),s.name=e&&e.name||"Error",o&&Object.assign(s,o),s};function ql(e){return Gl.isPlainObject(e)||Gl.isArray(e)}function Jl(e){return Gl.endsWith(e,"[]")?e.slice(0,-2):e}function Yl(e,t,r){return e?e.concat(t).map(function(e,t){return e=Jl(e),!r&&t?"["+e+"]":e}).join(r?".":""):t}const Xl=Gl.toFlatObject(Gl,{},null,function(e){return/^is[A-Z]/.test(e)});function Ql(e,t,r){if(!Gl.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const n=(r=Gl.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!Gl.isUndefined(t[e])})).metaTokens,a=r.visitor||c,o=r.dots,s=r.indexes,i=(r.Blob||"undefined"!=typeof Blob&&Blob)&&Gl.isSpecCompliantForm(t);if(!Gl.isFunction(a))throw new TypeError("visitor must be a function");function l(e){if(null===e)return"";if(Gl.isDate(e))return e.toISOString();if(Gl.isBoolean(e))return e.toString();if(!i&&Gl.isBlob(e))throw new Kl("Blob is not supported. Use a Buffer instead.");return Gl.isArrayBuffer(e)||Gl.isTypedArray(e)?i&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function c(e,r,a){let i=e;if(e&&!a&&"object"==typeof e)if(Gl.endsWith(r,"{}"))r=n?r:r.slice(0,-2),e=JSON.stringify(e);else if(Gl.isArray(e)&&function(e){return Gl.isArray(e)&&!e.some(ql)}(e)||(Gl.isFileList(e)||Gl.endsWith(r,"[]"))&&(i=Gl.toArray(e)))return r=Jl(r),i.forEach(function(e,n){!Gl.isUndefined(e)&&null!==e&&t.append(!0===s?Yl([r],n,o):null===s?r:r+"[]",l(e))}),!1;return!!ql(e)||(t.append(Yl(a,r,o),l(e)),!1)}const u=[],d=Object.assign(Xl,{defaultVisitor:c,convertValue:l,isVisitable:ql});if(!Gl.isObject(e))throw new TypeError("data must be an object");return function e(r,n){if(!Gl.isUndefined(r)){if(-1!==u.indexOf(r))throw Error("Circular reference detected in "+n.join("."));u.push(r),Gl.forEach(r,function(r,o){!0===(!(Gl.isUndefined(r)||null===r)&&a.call(t,r,Gl.isString(o)?o.trim():o,n,d))&&e(r,n?n.concat(o):[o])}),u.pop()}}(e),t}function ec(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function tc(e,t){this._pairs=[],e&&Ql(e,this,t)}const rc=tc.prototype;function nc(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function ac(e,t,r){if(!t)return e;const n=r&&r.encode||nc;Gl.isFunction(r)&&(r={serialize:r});const a=r&&r.serialize;let o;if(o=a?a(t,r):Gl.isURLSearchParams(t)?t.toString():new tc(t,r).toString(n),o){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}rc.append=function(e,t){this._pairs.push([e,t])},rc.toString=function(e){const t=e?function(t){return e.call(this,t,ec)}:ec;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};class oc{constructor(){this.handlers=[]}use(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){Gl.forEach(this.handlers,function(t){null!==t&&e(t)})}}var sc={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},ic={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:tc,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const lc="undefined"!=typeof window&&"undefined"!=typeof document,cc="object"==typeof navigator&&navigator||void 0,uc=lc&&(!cc||["ReactNative","NativeScript","NS"].indexOf(cc.product)<0),dc="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,fc=lc&&window.location.href||"http://localhost";var mc={...Object.freeze({__proto__:null,hasBrowserEnv:lc,hasStandardBrowserEnv:uc,hasStandardBrowserWebWorkerEnv:dc,navigator:cc,origin:fc}),...ic};function pc(e){function t(e,r,n,a){let o=e[a++];if("__proto__"===o)return!0;const s=Number.isFinite(+o),i=a>=e.length;if(o=!o&&Gl.isArray(n)?n.length:o,i)return Gl.hasOwnProp(n,o)?n[o]=[n[o],r]:n[o]=r,!s;n[o]&&Gl.isObject(n[o])||(n[o]=[]);return t(e,r,n[o],a)&&Gl.isArray(n[o])&&(n[o]=function(e){const t={},r=Object.keys(e);let n;const a=r.length;let o;for(n=0;n<a;n++)o=r[n],t[o]=e[o];return t}(n[o])),!s}if(Gl.isFormData(e)&&Gl.isFunction(e.entries)){const r={};return Gl.forEachEntry(e,(e,n)=>{t(function(e){return Gl.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),n,r,0)}),r}return null}const hc={transitional:sc,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const r=t.getContentType()||"",n=r.indexOf("application/json")>-1,a=Gl.isObject(e);a&&Gl.isHTMLForm(e)&&(e=new FormData(e));if(Gl.isFormData(e))return n?JSON.stringify(pc(e)):e;if(Gl.isArrayBuffer(e)||Gl.isBuffer(e)||Gl.isStream(e)||Gl.isFile(e)||Gl.isBlob(e)||Gl.isReadableStream(e))return e;if(Gl.isArrayBufferView(e))return e.buffer;if(Gl.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let o;if(a){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Ql(e,new mc.classes.URLSearchParams,{visitor:function(e,t,r,n){return mc.isNode&&Gl.isBuffer(e)?(this.append(t,e.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((o=Gl.isFileList(e))||r.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Ql(o?{"files[]":e}:e,t&&new t,this.formSerializer)}}return a||n?(t.setContentType("application/json",!1),function(e,t,r){if(Gl.isString(e))try{return(t||JSON.parse)(e),Gl.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(r||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||hc.transitional,r=t&&t.forcedJSONParsing,n="json"===this.responseType;if(Gl.isResponse(e)||Gl.isReadableStream(e))return e;if(e&&Gl.isString(e)&&(r&&!this.responseType||n)){const r=!(t&&t.silentJSONParsing)&&n;try{return JSON.parse(e,this.parseReviver)}catch(e){if(r){if("SyntaxError"===e.name)throw Kl.from(e,Kl.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:mc.classes.FormData,Blob:mc.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Gl.forEach(["delete","get","head","post","put","patch"],e=>{hc.headers[e]={}});const gc=Gl.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);const vc=Symbol("internals");function bc(e){return e&&String(e).trim().toLowerCase()}function yc(e){return!1===e||null==e?e:Gl.isArray(e)?e.map(yc):String(e)}function wc(e,t,r,n,a){return Gl.isFunction(n)?n.call(this,t,r):(a&&(t=r),Gl.isString(t)?Gl.isString(n)?-1!==t.indexOf(n):Gl.isRegExp(n)?n.test(t):void 0:void 0)}let xc=class{constructor(e){e&&this.set(e)}set(e,t,r){const n=this;function a(e,t,r){const a=bc(t);if(!a)throw new Error("header name must be a non-empty string");const o=Gl.findKey(n,a);(!o||void 0===n[o]||!0===r||void 0===r&&!1!==n[o])&&(n[o||t]=yc(e))}const o=(e,t)=>Gl.forEach(e,(e,r)=>a(e,r,t));if(Gl.isPlainObject(e)||e instanceof this.constructor)o(e,t);else if(Gl.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))o((e=>{const t={};let r,n,a;return e&&e.split("\n").forEach(function(e){a=e.indexOf(":"),r=e.substring(0,a).trim().toLowerCase(),n=e.substring(a+1).trim(),!r||t[r]&&gc[r]||("set-cookie"===r?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t})(e),t);else if(Gl.isObject(e)&&Gl.isIterable(e)){let r,n,a={};for(const t of e){if(!Gl.isArray(t))throw TypeError("Object iterator must return a key-value pair");a[n=t[0]]=(r=a[n])?Gl.isArray(r)?[...r,t[1]]:[r,t[1]]:t[1]}o(a,t)}else null!=e&&a(t,e,r);return this}get(e,t){if(e=bc(e)){const r=Gl.findKey(this,e);if(r){const e=this[r];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}(e);if(Gl.isFunction(t))return t.call(this,e,r);if(Gl.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=bc(e)){const r=Gl.findKey(this,e);return!(!r||void 0===this[r]||t&&!wc(0,this[r],r,t))}return!1}delete(e,t){const r=this;let n=!1;function a(e){if(e=bc(e)){const a=Gl.findKey(r,e);!a||t&&!wc(0,r[a],a,t)||(delete r[a],n=!0)}}return Gl.isArray(e)?e.forEach(a):a(e),n}clear(e){const t=Object.keys(this);let r=t.length,n=!1;for(;r--;){const a=t[r];e&&!wc(0,this[a],a,e,!0)||(delete this[a],n=!0)}return n}normalize(e){const t=this,r={};return Gl.forEach(this,(n,a)=>{const o=Gl.findKey(r,a);if(o)return t[o]=yc(n),void delete t[a];const s=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,r)=>t.toUpperCase()+r)}(a):String(a).trim();s!==a&&delete t[a],t[s]=yc(n),r[s]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return Gl.forEach(this,(r,n)=>{null!=r&&!1!==r&&(t[n]=e&&Gl.isArray(r)?r.join(", "):r)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const r=new this(e);return t.forEach(e=>r.set(e)),r}static accessor(e){const t=(this[vc]=this[vc]={accessors:{}}).accessors,r=this.prototype;function n(e){const n=bc(e);t[n]||(!function(e,t){const r=Gl.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(e,r,a){return this[n].call(this,t,e,r,a)},configurable:!0})})}(r,e),t[n]=!0)}return Gl.isArray(e)?e.forEach(n):n(e),this}};function Sc(e,t){const r=this||hc,n=t||r,a=xc.from(n.headers);let o=n.data;return Gl.forEach(e,function(e){o=e.call(r,o,a.normalize(),t?t.status:void 0)}),a.normalize(),o}function kc(e){return!(!e||!e.__CANCEL__)}function Ac(e,t,r){Kl.call(this,null==e?"canceled":e,Kl.ERR_CANCELED,t,r),this.name="CanceledError"}function Ec(e,t,r){const n=r.config.validateStatus;r.status&&n&&!n(r.status)?t(new Kl("Request failed with status code "+r.status,[Kl.ERR_BAD_REQUEST,Kl.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):e(r)}xc.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Gl.reduceDescriptors(xc.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[r]=e}}}),Gl.freezeMethods(xc),Gl.inherits(Ac,Kl,{__CANCEL__:!0});const Cc=(e,t,r=3)=>{let n=0;const a=function(e,t){e=e||10;const r=new Array(e),n=new Array(e);let a,o=0,s=0;return t=void 0!==t?t:1e3,function(i){const l=Date.now(),c=n[s];a||(a=l),r[o]=i,n[o]=l;let u=s,d=0;for(;u!==o;)d+=r[u++],u%=e;if(o=(o+1)%e,o===s&&(s=(s+1)%e),l-a<t)return;const f=c&&l-c;return f?Math.round(1e3*d/f):void 0}}(50,250);return function(e,t){let r,n,a=0,o=1e3/t;const s=(t,o=Date.now())=>{a=o,r=null,n&&(clearTimeout(n),n=null),e(...t)};return[(...e)=>{const t=Date.now(),i=t-a;i>=o?s(e,t):(r=e,n||(n=setTimeout(()=>{n=null,s(r)},o-i)))},()=>r&&s(r)]}(r=>{const o=r.loaded,s=r.lengthComputable?r.total:void 0,i=o-n,l=a(i);n=o;e({loaded:o,total:s,progress:s?o/s:void 0,bytes:i,rate:l||void 0,estimated:l&&s&&o<=s?(s-o)/l:void 0,event:r,lengthComputable:null!=s,[t?"download":"upload"]:!0})},r)},Tc=(e,t)=>{const r=null!=e;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},jc=e=>(...t)=>Gl.asap(()=>e(...t));var _c=mc.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,mc.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(mc.origin),mc.navigator&&/(msie|trident)/i.test(mc.navigator.userAgent)):()=>!0,Nc=mc.hasStandardBrowserEnv?{write(e,t,r,n,a,o){const s=[e+"="+encodeURIComponent(t)];Gl.isNumber(r)&&s.push("expires="+new Date(r).toGMTString()),Gl.isString(n)&&s.push("path="+n),Gl.isString(a)&&s.push("domain="+a),!0===o&&s.push("secure"),document.cookie=s.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function Rc(e,t,r){let n=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&(n||0==r)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const Pc=e=>e instanceof xc?{...e}:e;function Oc(e,t){t=t||{};const r={};function n(e,t,r,n){return Gl.isPlainObject(e)&&Gl.isPlainObject(t)?Gl.merge.call({caseless:n},e,t):Gl.isPlainObject(t)?Gl.merge({},t):Gl.isArray(t)?t.slice():t}function a(e,t,r,a){return Gl.isUndefined(t)?Gl.isUndefined(e)?void 0:n(void 0,e,0,a):n(e,t,0,a)}function o(e,t){if(!Gl.isUndefined(t))return n(void 0,t)}function s(e,t){return Gl.isUndefined(t)?Gl.isUndefined(e)?void 0:n(void 0,e):n(void 0,t)}function i(r,a,o){return o in t?n(r,a):o in e?n(void 0,r):void 0}const l={url:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:i,headers:(e,t,r)=>a(Pc(e),Pc(t),0,!0)};return Gl.forEach(Object.keys({...e,...t}),function(n){const o=l[n]||a,s=o(e[n],t[n],n);Gl.isUndefined(s)&&o!==i||(r[n]=s)}),r}var Dc=e=>{const t=Oc({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:a,xsrfCookieName:o,headers:s,auth:i}=t;if(t.headers=s=xc.from(s),t.url=ac(Rc(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),i&&s.set("Authorization","Basic "+btoa((i.username||"")+":"+(i.password?unescape(encodeURIComponent(i.password)):""))),Gl.isFormData(r))if(mc.hasStandardBrowserEnv||mc.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(Gl.isFunction(r.getHeaders)){const e=r.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach(([e,r])=>{t.includes(e.toLowerCase())&&s.set(e,r)})}if(mc.hasStandardBrowserEnv&&(n&&Gl.isFunction(n)&&(n=n(t)),n||!1!==n&&_c(t.url))){const e=a&&o&&Nc.read(o);e&&s.set(a,e)}return t};var Ic="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,r){const n=Dc(e);let a=n.data;const o=xc.from(n.headers).normalize();let s,i,l,c,u,{responseType:d,onUploadProgress:f,onDownloadProgress:m}=n;function p(){c&&c(),u&&u(),n.cancelToken&&n.cancelToken.unsubscribe(s),n.signal&&n.signal.removeEventListener("abort",s)}let h=new XMLHttpRequest;function g(){if(!h)return;const n=xc.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders());Ec(function(e){t(e),p()},function(e){r(e),p()},{data:d&&"text"!==d&&"json"!==d?h.response:h.responseText,status:h.status,statusText:h.statusText,headers:n,config:e,request:h}),h=null}h.open(n.method.toUpperCase(),n.url,!0),h.timeout=n.timeout,"onloadend"in h?h.onloadend=g:h.onreadystatechange=function(){h&&4===h.readyState&&(0!==h.status||h.responseURL&&0===h.responseURL.indexOf("file:"))&&setTimeout(g)},h.onabort=function(){h&&(r(new Kl("Request aborted",Kl.ECONNABORTED,e,h)),h=null)},h.onerror=function(t){const n=new Kl(t&&t.message?t.message:"Network Error",Kl.ERR_NETWORK,e,h);n.event=t||null,r(n),h=null},h.ontimeout=function(){let t=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded";const a=n.transitional||sc;n.timeoutErrorMessage&&(t=n.timeoutErrorMessage),r(new Kl(t,a.clarifyTimeoutError?Kl.ETIMEDOUT:Kl.ECONNABORTED,e,h)),h=null},void 0===a&&o.setContentType(null),"setRequestHeader"in h&&Gl.forEach(o.toJSON(),function(e,t){h.setRequestHeader(t,e)}),Gl.isUndefined(n.withCredentials)||(h.withCredentials=!!n.withCredentials),d&&"json"!==d&&(h.responseType=n.responseType),m&&([l,u]=Cc(m,!0),h.addEventListener("progress",l)),f&&h.upload&&([i,c]=Cc(f),h.upload.addEventListener("progress",i),h.upload.addEventListener("loadend",c)),(n.cancelToken||n.signal)&&(s=t=>{h&&(r(!t||t.type?new Ac(null,e,h):t),h.abort(),h=null)},n.cancelToken&&n.cancelToken.subscribe(s),n.signal&&(n.signal.aborted?s():n.signal.addEventListener("abort",s)));const v=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(n.url);v&&-1===mc.protocols.indexOf(v)?r(new Kl("Unsupported protocol "+v+":",Kl.ERR_BAD_REQUEST,e)):h.send(a||null)})};const Mc=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let r,n=new AbortController;const a=function(e){if(!r){r=!0,s();const t=e instanceof Error?e:this.reason;n.abort(t instanceof Kl?t:new Ac(t instanceof Error?t.message:t))}};let o=t&&setTimeout(()=>{o=null,a(new Kl(`timeout ${t} of ms exceeded`,Kl.ETIMEDOUT))},t);const s=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(a):e.removeEventListener("abort",a)}),e=null)};e.forEach(e=>e.addEventListener("abort",a));const{signal:i}=n;return i.unsubscribe=()=>Gl.asap(s),i}},Lc=function*(e,t){let r=e.byteLength;if(r<t)return void(yield e);let n,a=0;for(;a<r;)n=a+t,yield e.slice(a,n),a=n},Uc=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:r}=await t.read();if(e)break;yield r}}finally{await t.cancel()}},zc=(e,t,r,n)=>{const a=async function*(e,t){for await(const r of Uc(e))yield*Lc(r,t)}(e,t);let o,s=0,i=e=>{o||(o=!0,n&&n(e))};return new ReadableStream({async pull(e){try{const{done:t,value:n}=await a.next();if(t)return i(),void e.close();let o=n.byteLength;if(r){let e=s+=o;r(e)}e.enqueue(new Uint8Array(n))}catch(e){throw i(e),e}},cancel:e=>(i(e),a.return())},{highWaterMark:2})},{isFunction:Fc}=Gl,Bc=(({Request:e,Response:t})=>({Request:e,Response:t}))(Gl.global),{ReadableStream:Vc,TextEncoder:$c}=Gl.global,Wc=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},Gc=e=>{e=Gl.merge.call({skipUndefined:!0},Bc,e);const{fetch:t,Request:r,Response:n}=e,a=t?Fc(t):"function"==typeof fetch,o=Fc(r),s=Fc(n);if(!a)return!1;const i=a&&Fc(Vc),l=a&&("function"==typeof $c?(c=new $c,e=>c.encode(e)):async e=>new Uint8Array(await new r(e).arrayBuffer()));var c;const u=o&&i&&Wc(()=>{let e=!1;const t=new r(mc.origin,{body:new Vc,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),d=s&&i&&Wc(()=>Gl.isReadableStream(new n("").body)),f={stream:d&&(e=>e.body)};a&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!f[e]&&(f[e]=(t,r)=>{let n=t&&t[e];if(n)return n.call(t);throw new Kl(`Response type '${e}' is not supported`,Kl.ERR_NOT_SUPPORT,r)})});const m=async(e,t)=>{const n=Gl.toFiniteNumber(e.getContentLength());return null==n?(async e=>{if(null==e)return 0;if(Gl.isBlob(e))return e.size;if(Gl.isSpecCompliantForm(e)){const t=new r(mc.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return Gl.isArrayBufferView(e)||Gl.isArrayBuffer(e)?e.byteLength:(Gl.isURLSearchParams(e)&&(e+=""),Gl.isString(e)?(await l(e)).byteLength:void 0)})(t):n};return async e=>{let{url:a,method:s,data:i,signal:l,cancelToken:c,timeout:p,onDownloadProgress:h,onUploadProgress:g,responseType:v,headers:b,withCredentials:y="same-origin",fetchOptions:w}=Dc(e),x=t||fetch;v=v?(v+"").toLowerCase():"text";let S=Mc([l,c&&c.toAbortSignal()],p),k=null;const A=S&&S.unsubscribe&&(()=>{S.unsubscribe()});let E;try{if(g&&u&&"get"!==s&&"head"!==s&&0!==(E=await m(b,i))){let e,t=new r(a,{method:"POST",body:i,duplex:"half"});if(Gl.isFormData(i)&&(e=t.headers.get("content-type"))&&b.setContentType(e),t.body){const[e,r]=Tc(E,Cc(jc(g)));i=zc(t.body,65536,e,r)}}Gl.isString(y)||(y=y?"include":"omit");const t=o&&"credentials"in r.prototype,l={...w,signal:S,method:s.toUpperCase(),headers:b.normalize().toJSON(),body:i,duplex:"half",credentials:t?y:void 0};k=o&&new r(a,l);let c=await(o?x(k,w):x(a,l));const p=d&&("stream"===v||"response"===v);if(d&&(h||p&&A)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=c[t]});const t=Gl.toFiniteNumber(c.headers.get("content-length")),[r,a]=h&&Tc(t,Cc(jc(h),!0))||[];c=new n(zc(c.body,65536,r,()=>{a&&a(),A&&A()}),e)}v=v||"text";let C=await f[Gl.findKey(f,v)||"text"](c,e);return!p&&A&&A(),await new Promise((t,r)=>{Ec(t,r,{data:C,headers:xc.from(c.headers),status:c.status,statusText:c.statusText,config:e,request:k})})}catch(t){if(A&&A(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new Kl("Network Error",Kl.ERR_NETWORK,e,k),{cause:t.cause||t});throw Kl.from(t,t&&t.code,e,k)}}},Kc=new Map,Hc=e=>{let t=e?e.env:{};const{fetch:r,Request:n,Response:a}=t,o=[n,a,r];let s,i,l=o.length,c=Kc;for(;l--;)s=o[l],i=c.get(s),void 0===i&&c.set(s,i=l?new Map:Gc(t)),c=i;return i};Hc();const Zc={http:null,xhr:Ic,fetch:{get:Hc}};Gl.forEach(Zc,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});const qc=e=>`- ${e}`,Jc=e=>Gl.isFunction(e)||null===e||!1===e;var Yc=(e,t)=>{e=Gl.isArray(e)?e:[e];const{length:r}=e;let n,a;const o={};for(let s=0;s<r;s++){let r;if(n=e[s],a=n,!Jc(n)&&(a=Zc[(r=String(n)).toLowerCase()],void 0===a))throw new Kl(`Unknown adapter '${r}'`);if(a&&(Gl.isFunction(a)||(a=a.get(t))))break;o[r||"#"+s]=a}if(!a){const e=Object.entries(o).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));throw new Kl("There is no suitable adapter to dispatch the request "+(r?e.length>1?"since :\n"+e.map(qc).join("\n"):" "+qc(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return a};function Xc(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Ac(null,e)}function Qc(e){Xc(e),e.headers=xc.from(e.headers),e.data=Sc.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return Yc(e.adapter||hc.adapter,e)(e).then(function(t){return Xc(e),t.data=Sc.call(e,e.transformResponse,t),t.headers=xc.from(t.headers),t},function(t){return kc(t)||(Xc(e),t&&t.response&&(t.response.data=Sc.call(e,e.transformResponse,t.response),t.response.headers=xc.from(t.response.headers))),Promise.reject(t)})}const eu="1.12.2",tu={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{tu[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const ru={};tu.transitional=function(e,t,r){function n(e,t){return"[Axios v"+eu+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}return(r,a,o)=>{if(!1===e)throw new Kl(n(a," has been removed"+(t?" in "+t:"")),Kl.ERR_DEPRECATED);return t&&!ru[a]&&(ru[a]=!0,console.warn(n(a," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,a,o)}},tu.spelling=function(e){return(t,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};var nu={assertOptions:function(e,t,r){if("object"!=typeof e)throw new Kl("options must be an object",Kl.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let a=n.length;for(;a-- >0;){const o=n[a],s=t[o];if(s){const t=e[o],r=void 0===t||s(t,o,e);if(!0!==r)throw new Kl("option "+o+" must be "+r,Kl.ERR_BAD_OPTION_VALUE);continue}if(!0!==r)throw new Kl("Unknown option "+o,Kl.ERR_BAD_OPTION)}},validators:tu};const au=nu.validators;let ou=class{constructor(e){this.defaults=e||{},this.interceptors={request:new oc,response:new oc}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const r=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?r&&!String(e.stack).endsWith(r.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+r):e.stack=r}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Oc(this.defaults,t);const{transitional:r,paramsSerializer:n,headers:a}=t;void 0!==r&&nu.assertOptions(r,{silentJSONParsing:au.transitional(au.boolean),forcedJSONParsing:au.transitional(au.boolean),clarifyTimeoutError:au.transitional(au.boolean)},!1),null!=n&&(Gl.isFunction(n)?t.paramsSerializer={serialize:n}:nu.assertOptions(n,{encode:au.function,serialize:au.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),nu.assertOptions(t,{baseUrl:au.spelling("baseURL"),withXsrfToken:au.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=a&&Gl.merge(a.common,a[t.method]);a&&Gl.forEach(["delete","get","head","post","put","patch","common"],e=>{delete a[e]}),t.headers=xc.concat(o,a);const s=[];let i=!0;this.interceptors.request.forEach(function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(i=i&&e.synchronous,s.unshift(e.fulfilled,e.rejected))});const l=[];let c;this.interceptors.response.forEach(function(e){l.push(e.fulfilled,e.rejected)});let u,d=0;if(!i){const e=[Qc.bind(this),void 0];for(e.unshift(...s),e.push(...l),u=e.length,c=Promise.resolve(t);d<u;)c=c.then(e[d++],e[d++]);return c}u=s.length;let f=t;for(;d<u;){const e=s[d++],t=s[d++];try{f=e(f)}catch(e){t.call(this,e);break}}try{c=Qc.call(this,f)}catch(e){return Promise.reject(e)}for(d=0,u=l.length;d<u;)c=c.then(l[d++],l[d++]);return c}getUri(e){return ac(Rc((e=Oc(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}};Gl.forEach(["delete","get","head","options"],function(e){ou.prototype[e]=function(t,r){return this.request(Oc(r||{},{method:e,url:t,data:(r||{}).data}))}}),Gl.forEach(["post","put","patch"],function(e){function t(t){return function(r,n,a){return this.request(Oc(a||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}ou.prototype[e]=t(),ou.prototype[e+"Form"]=t(!0)});const su={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(su).forEach(([e,t])=>{su[t]=e});const iu=function e(t){const r=new ou(t),n=tl(ou.prototype.request,r);return Gl.extend(n,ou.prototype,r,{allOwnKeys:!0}),Gl.extend(n,r,null,{allOwnKeys:!0}),n.create=function(r){return e(Oc(t,r))},n}(hc);iu.Axios=ou,iu.CanceledError=Ac,iu.CancelToken=class e{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(e){t=e});const r=this;this.promise.then(e=>{if(!r._listeners)return;let t=r._listeners.length;for(;t-- >0;)r._listeners[t](e);r._listeners=null}),this.promise.then=e=>{let t;const n=new Promise(e=>{r.subscribe(e),t=e}).then(e);return n.cancel=function(){r.unsubscribe(t)},n},e(function(e,n,a){r.reason||(r.reason=new Ac(e,n,a),t(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let t;return{token:new e(function(e){t=e}),cancel:t}}},iu.isCancel=kc,iu.VERSION=eu,iu.toFormData=Ql,iu.AxiosError=Kl,iu.Cancel=iu.CanceledError,iu.all=function(e){return Promise.all(e)},iu.spread=function(e){return function(t){return e.apply(null,t)}},iu.isAxiosError=function(e){return Gl.isObject(e)&&!0===e.isAxiosError},iu.mergeConfig=Oc,iu.AxiosHeaders=xc,iu.formToJSON=e=>pc(Gl.isHTMLForm(e)?new FormData(e):e),iu.getAdapter=Yc,iu.HttpStatusCode=su,iu.default=iu;const{Axios:lu,AxiosError:cu,CanceledError:uu,isCancel:du,CancelToken:fu,VERSION:mu,all:pu,Cancel:hu,isAxiosError:gu,spread:vu,toFormData:bu,AxiosHeaders:yu,HttpStatusCode:wu,formToJSON:xu,getAdapter:Su,mergeConfig:ku}=iu,Au="undefined"!=typeof window;const Eu=new class{constructor(e={}){this.client=iu.create({baseURL:e.baseURL||"https://api.example.com",timeout:e.timeout||1e4,headers:{"Content-Type":"application/json",...e.headers}}),this.client.interceptors.request.use(e=>{const t=this.getAuthToken();return t&&(e.headers.Authorization=`Bearer ${t}`),e},e=>Promise.reject(e)),this.client.interceptors.response.use(e=>e,e=>(401===e.response?.status&&this.handleUnauthorized(),Promise.reject(e)))}getAuthToken(){return Au?localStorage.getItem("auth_token"):null}handleUnauthorized(){Au&&localStorage.removeItem("auth_token")}async get(e,t){const r=await this.client.get(e,t);return{data:r.data,status:r.status,statusText:r.statusText,headers:r.headers}}async post(e,t,r){const n=await this.client.post(e,t,r);return{data:n.data,status:n.status,statusText:n.statusText,headers:n.headers}}async put(e,t,r){const n=await this.client.put(e,t,r);return{data:n.data,status:n.status,statusText:n.statusText,headers:n.headers}}async delete(e,t){const r=await this.client.delete(e,t);return{data:r.data,status:r.status,statusText:r.statusText,headers:r.headers}}async patch(e,t,r){const n=await this.client.patch(e,t,r);return{data:n.data,status:n.status,statusText:n.statusText,headers:n.headers}}setAuthToken(e){Au&&localStorage.setItem("auth_token",e)}removeAuthToken(){Au&&localStorage.removeItem("auth_token")}setBaseURL(e){this.client.defaults.baseURL=e}setHeader(e,t){this.client.defaults.headers.common[e]=t}removeHeader(e){delete this.client.defaults.headers.common[e]}};class Cu{constructor(e){this.version=e.version,this.orgId=e.orgId,this.serverUrl=e.serverUrl}getAuthHeader(){const e=function(){if("undefined"==typeof window)return null;const e=localStorage.getItem("saas_os_auth_token");try{return e?JSON.parse(e).accessToken:null}catch(e){return null}}();let t={};return e&&(t.Authorization=`Bearer ${e}`),t}async getWorkspaces(){const e=await fetch(`${this.serverUrl}/api/${this.version}/public/workspaces`,{headers:this.getAuthHeader()});if(!e.ok)throw new Error("Failed to fetch workspaces");return e.json()}async createWorkspace(e){const t=await fetch(`${this.serverUrl}/api/${this.version}/public/workspaces`,{method:"POST",headers:{"Content-Type":"application/json",...this.getAuthHeader()},body:JSON.stringify(e)});if(!t.ok)throw new Error("Failed to create workspace");return t.json()}async updateWorkspace(e,t){const r=await fetch(`${this.serverUrl}/api/${this.version}/public/workspaces/${e}`,{method:"PUT",headers:{"Content-Type":"application/json",...this.getAuthHeader()},body:JSON.stringify(t)});if(!r.ok)throw new Error("Failed to update workspace");return r.json()}async deleteWorkspace(e){const t=await fetch(`${this.serverUrl}/api/${this.version}/public/workspaces/${e}`,{method:"DELETE",headers:this.getAuthHeader()});if(!t.ok)throw new Error("Failed to delete workspace");return t.json()}async getWorkspaceUsers(e){const t=await fetch(`${this.serverUrl}/api/${this.version}/public/workspaces/${e}/users`,{headers:this.getAuthHeader()});if(!t.ok)throw new Error("Failed to fetch workspace users");return t.json()}async addUser(e,t){const r=await fetch(`${this.serverUrl}/api/${this.version}/public/workspaces/${e}/users/add`,{method:"POST",headers:{"Content-Type":"application/json",...this.getAuthHeader()},body:JSON.stringify(t)});if(!r.ok){const e=await r.json();throw new Error(e.message||"Failed to invite member")}return r.json()}async removeUser(e,t){const r=await fetch(`${this.serverUrl}/api/${this.version}/public/workspaces/${e}/users/${t}`,{method:"DELETE",headers:this.getAuthHeader()});if(!r.ok){const e=await r.json();throw new Error(e.message||"Failed to remove user")}return r.json()}async updateUser(e,t,r){const n=await fetch(`${this.serverUrl}/api/${this.version}/public/workspaces/${e}/users/${t}`,{method:"PATCH",headers:{"Content-Type":"application/json",...this.getAuthHeader()},body:JSON.stringify(r)});if(!n.ok){const e=await n.json();throw new Error(e.message||"Failed to update user")}return n.json()}async getFeatures(){const e=await fetch(`${this.serverUrl}/api/${this.version}/public/workspaces/features`,{headers:this.getAuthHeader()});if(!e.ok)throw new Error("Failed to fetch features");return e.json()}async updateFeature(e,t,r){const n=await fetch(`${this.serverUrl}/api/${this.version}/public/workspaces/${e}/features`,{method:"PATCH",headers:{"Content-Type":"application/json",...this.getAuthHeader()},body:JSON.stringify({features:{[t]:r}})});if(!n.ok)throw new Error("Failed to update feature");return n.json()}async getWorkspace(e){const t=await fetch(`${this.serverUrl}/api/${this.version}/public/workspaces/${e}`,{headers:this.getAuthHeader()});if(!t.ok)throw new Error("Failed to fetch workspace");return t.json()}async getProfile(){const e=await fetch(`${this.serverUrl}/api/${this.version}/public/profile`,{headers:this.getAuthHeader()});if(!e.ok)throw new Error("Failed to fetch profile");return e.json()}async updateUserProfile(e){const t=await fetch(`${this.serverUrl}/api/${this.version}/public/profile`,{method:"PATCH",headers:{"Content-Type":"application/json",...this.getAuthHeader()},body:JSON.stringify(e)});if(!t.ok)throw new Error("Failed to update user profile");return t.json()}}function Tu(t,r=[]){let n=[];const o=()=>{const e=n.map(e=>a.createContext(e));return function(r){const n=r?.[t]||e;return a.useMemo(()=>({[`__scope${t}`]:{...r,[t]:n}}),[r,n])}};return o.scopeName=t,[function(r,o){const s=a.createContext(o),i=n.length;n=[...n,o];const l=r=>{const{scope:n,children:o,...l}=r,c=n?.[t]?.[i]||s,u=a.useMemo(()=>l,Object.values(l));return e.jsx(c.Provider,{value:u,children:o})};return l.displayName=r+"Provider",[l,function(e,n){const l=n?.[t]?.[i]||s,c=a.useContext(l);if(c)return c;if(void 0!==o)return o;throw new Error(`\`${e}\` must be used within \`${r}\``)}]},ju(o,...r)]}function ju(...e){const t=e[0];if(1===e.length)return t;const r=()=>{const r=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){const n=r.reduce((t,{useScope:r,scopeName:n})=>({...t,...r(e)[`__scope${n}`]}),{});return a.useMemo(()=>({[`__scope${t.scopeName}`]:n}),[n])}};return r.scopeName=t.scopeName,r}function _u(e){const t=a.useRef(e);return a.useEffect(()=>{t.current=e}),a.useMemo(()=>(...e)=>t.current?.(...e),[])}var Nu,Ru=globalThis?.document?a.useLayoutEffect:()=>{},Pu={exports:{}},Ou={};function Du(){if(Nu)return Ou;Nu=1;var e=t;var r="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},n=e.useState,a=e.useEffect,o=e.useLayoutEffect,s=e.useDebugValue;function i(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch(e){return!0}}var l="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var r=t(),l=n({inst:{value:r,getSnapshot:t}}),c=l[0].inst,u=l[1];return o(function(){c.value=r,c.getSnapshot=t,i(c)&&u({inst:c})},[e,r,t]),a(function(){return i(c)&&u({inst:c}),e(function(){i(c)&&u({inst:c})})},[e]),s(r),r};return Ou.useSyncExternalStore=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:l,Ou}var Iu,Mu,Lu={};
20
+ */Es.displayName="Button";var Cs=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((t,r)=>{const n=Ho(`Primitive.${r}`),o=a.forwardRef((t,a)=>{const{asChild:o,...s}=t,i=o?n:r;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),e.jsx(i,{...s,ref:a})});return o.displayName=`Primitive.${r}`,{...t,[r]:o}},{});var js=a.forwardRef((t,r)=>e.jsx(Cs.label,{...t,ref:r,onMouseDown:e=>{e.target.closest("button, input, select, textarea")||(t.onMouseDown?.(e),!e.defaultPrevented&&e.detail>1&&e.preventDefault())}}));js.displayName="Label";var Ts=js;const Ns=es("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),_s=a.forwardRef(({className:t,...r},n)=>e.jsx(Ts,{ref:n,className:Wo(Ns(),t),...r}));_s.displayName=Ts.displayName;const Rs=Be,Ps=a.createContext({}),Os=({...t})=>e.jsx(Ps.Provider,{value:{name:t.name},children:e.jsx(qe,{...t})}),Ds=()=>{const e=a.useContext(Ps),t=a.useContext(Is),{getFieldState:r,formState:n}=ze(),o=r(e.name,n);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:s}=t;return{id:s,name:e.name,formItemId:`${s}-form-item`,formDescriptionId:`${s}-form-item-description`,formMessageId:`${s}-form-item-message`,...o}},Is=a.createContext({}),Ms=a.forwardRef(({className:t,...r},n)=>{const o=a.useId();return e.jsx(Is.Provider,{value:{id:o},children:e.jsx("div",{ref:n,className:Wo("space-y-2",t),...r})})});Ms.displayName="FormItem";const Us=a.forwardRef(({className:t,...r},n)=>{const{error:a,formItemId:o}=Ds();return e.jsx(_s,{ref:n,className:Wo(a&&"text-destructive",t),htmlFor:o,...r})});Us.displayName="FormLabel";const Ls=a.forwardRef(({...t},r)=>{const{error:n,formItemId:a,formDescriptionId:o,formMessageId:s}=Ds();return e.jsx(Zo,{ref:r,id:a,"aria-describedby":n?`${o} ${s}`:`${o}`,"aria-invalid":!!n,...t})});Ls.displayName="FormControl";const Fs=a.forwardRef(({className:t,...r},n)=>{const{formDescriptionId:a}=Ds();return e.jsx("p",{ref:n,id:a,className:Wo("text-sm text-muted-foreground",t),...r})});Fs.displayName="FormDescription";const zs=a.forwardRef(({className:t,children:r,...n},a)=>{const{error:o,formMessageId:s}=Ds(),i=o?String(o?.message):r;return i?e.jsx("p",{ref:a,id:s,className:Wo("text-sm font-medium text-destructive",t),...n,children:i}):null});zs.displayName="FormMessage";const Bs=a.forwardRef(({className:t,type:r,...n},a)=>e.jsx("input",{type:r,className:Wo("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",t),ref:a,...n}));function Vs({className:t,...r}){return e.jsx("div",{className:Wo("animate-pulse rounded-md bg-primary/10",t),...r})}Bs.displayName="Input";let Ws=class{constructor(e){this.version=e.version,this.orgId=e.orgId,this.serverUrl=e.serverUrl}async fetchConfig(){const e=await fetch(`${this.serverUrl}/api/${this.version}/beta/config?orgId=${this.orgId}`);if(!e.ok)throw new Error(`Failed to fetch beta form configuration: ${e.statusText}`);return e.json()}async submitBetaUser(e){const t=e?.context??{},r=t?.country??("undefined"!=typeof navigator&&navigator.language?navigator.language.split("-")[1]:void 0),n=t?.language??("undefined"!=typeof navigator&&navigator.language?navigator.language.split("-")[0]:void 0),a=t?.timezone??("undefined"!=typeof Intl&&Intl.DateTimeFormat?Intl.DateTimeFormat().resolvedOptions().timeZone:void 0),o=t?.currency??("undefined"!=typeof Intl&&Intl.NumberFormat&&Intl.NumberFormat().resolvedOptions().currency?Intl.NumberFormat().resolvedOptions().currency:void 0),s=await fetch(`${this.serverUrl}/api/${this.version}/beta/submit`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({orgId:this.orgId,formData:{...e,country:r,language:n,timezone:a,currency:o}})});if(!s.ok)throw new Error(`Failed to submit beta user request: ${s.statusText}`);return s.json()}};const $s=Ft("ZodISODateTime",(e,t)=>{Rn.init(e,t),hi.init(e,t)});function Gs(e){return function(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ir(t)})}($s,e)}const Ks=Ft("ZodISODate",(e,t)=>{Pn.init(e,t),hi.init(e,t)});function Hs(e){return function(e,t){return new e({type:"string",format:"date",check:"string_format",...ir(t)})}(Ks,e)}const Zs=Ft("ZodISOTime",(e,t)=>{On.init(e,t),hi.init(e,t)});function qs(e){return function(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...ir(t)})}(Zs,e)}const Js=Ft("ZodISODuration",(e,t)=>{Dn.init(e,t),hi.init(e,t)});function Ys(e){return function(e,t){return new e({type:"string",format:"duration",check:"string_format",...ir(t)})}(Js,e)}const Xs=Ft("ZodError",(e,t)=>{hr.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>function(e,t){const r=t||function(e){return e.message},n={_errors:[]},a=e=>{for(const t of e.issues)if("invalid_union"===t.code&&t.errors.length)t.errors.map(e=>a({issues:e}));else if("invalid_key"===t.code)a({issues:t.issues});else if("invalid_element"===t.code)a({issues:t.issues});else if(0===t.path.length)n._errors.push(r(t));else{let e=n,a=0;for(;a<t.path.length;){const n=t.path[a];a===t.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(r(t))):e[n]=e[n]||{_errors:[]},e=e[n],a++}}};return a(e),n}(e,t)},flatten:{value:t=>function(e,t=e=>e.message){const r={},n=[];for(const a of e.issues)a.path.length>0?(r[a.path[0]]=r[a.path[0]]||[],r[a.path[0]].push(t(a))):n.push(t(a));return{formErrors:n,fieldErrors:r}}(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,$t,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,$t,2)}},isEmpty:{get:()=>0===e.issues.length}})},{Parent:Error}),Qs=vr(Xs),ei=yr(Xs),ti=xr(Xs),ri=kr(Xs),ni=Er(Xs),ai=Cr(Xs),oi=jr(Xs),si=Tr(Xs),ii=Nr(Xs),li=_r(Xs),ci=Rr(Xs),di=Pr(Xs),ui=Ft("ZodType",(e,t)=>(vn.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]}),e.clone=(t,r)=>sr(e,t,r),e.brand=()=>e,e.register=(t,r)=>(t.add(e,r),e),e.parse=(t,r)=>Qs(e,t,r,{callee:e.parse}),e.safeParse=(t,r)=>ti(e,t,r),e.parseAsync=async(t,r)=>ei(e,t,r,{callee:e.parseAsync}),e.safeParseAsync=async(t,r)=>ri(e,t,r),e.spa=e.safeParseAsync,e.encode=(t,r)=>ni(e,t,r),e.decode=(t,r)=>ai(e,t,r),e.encodeAsync=async(t,r)=>oi(e,t,r),e.decodeAsync=async(t,r)=>si(e,t,r),e.safeEncode=(t,r)=>ii(e,t,r),e.safeDecode=(t,r)=>li(e,t,r),e.safeEncodeAsync=async(t,r)=>ci(e,t,r),e.safeDecodeAsync=async(t,r)=>di(e,t,r),e.refine=(t,r)=>e.check(function(e,t={}){return function(e,t,r){return new e({type:"custom",check:"custom",fn:t,...ir(r)})}(nl,e,t)}(t,r)),e.superRefine=t=>e.check(Na(t)),e.overwrite=t=>e.check(Ta(t)),e.optional=()=>Hi(e),e.nullable=()=>qi(e),e.nullish=()=>Hi(qi(e)),e.nonoptional=t=>function(e,t){return new Xi({type:"nonoptional",innerType:e,...ir(t)})}(e,t),e.array=()=>{return function(e,t,r){return new e({type:"array",element:t,...ir(r)})}(Fi,e,t);var t},e.or=t=>function(e,t){return new Vi({type:"union",options:e,...ir(t)})}([e,t]),e.and=t=>new Wi({type:"intersection",left:e,right:t}),e.transform=t=>tl(e,new Gi({type:"transform",transform:t})),e.default=t=>{return r=t,new Ji({type:"default",innerType:e,get defaultValue(){return"function"==typeof r?r():nr(r)}});var r},e.prefault=t=>{return r=t,new Yi({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof r?r():nr(r)}});var r},e.catch=t=>{return new Qi({type:"catch",innerType:e,catchValue:"function"==typeof(r=t)?r:()=>r});var r},e.pipe=t=>tl(e,t),e.readonly=()=>new rl({type:"readonly",innerType:e}),e.describe=t=>{const r=e.clone();return ka.add(r,{description:t}),r},Object.defineProperty(e,"description",{get:()=>ka.get(e)?.description,configurable:!0}),e.meta=(...t)=>{if(0===t.length)return ka.get(e);const r=e.clone();return ka.add(r,t[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),fi=Ft("_ZodString",(e,t)=>{bn.init(e,t),ui.init(e,t);const r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...t)=>e.check(function(e,t){return new ln({check:"string_format",format:"regex",...ir(t),pattern:e})}(...t)),e.includes=(...t)=>e.check(function(e,t){return new un({check:"string_format",format:"includes",...ir(t),includes:e})}(...t)),e.startsWith=(...t)=>e.check(function(e,t){return new fn({check:"string_format",format:"starts_with",...ir(t),prefix:e})}(...t)),e.endsWith=(...t)=>e.check(function(e,t){return new mn({check:"string_format",format:"ends_with",...ir(t),suffix:e})}(...t)),e.min=(...t)=>e.check(Ca(...t)),e.max=(...t)=>e.check(Ea(...t)),e.length=(...t)=>e.check(ja(...t)),e.nonempty=(...t)=>e.check(Ca(1,...t)),e.lowercase=t=>e.check(function(e){return new cn({check:"string_format",format:"lowercase",...ir(e)})}(t)),e.uppercase=t=>e.check(function(e){return new dn({check:"string_format",format:"uppercase",...ir(e)})}(t)),e.trim=()=>e.check(Ta(e=>e.trim())),e.normalize=(...t)=>e.check(function(e){return Ta(t=>t.normalize(e))}(...t)),e.toLowerCase=()=>e.check(Ta(e=>e.toLowerCase())),e.toUpperCase=()=>e.check(Ta(e=>e.toUpperCase()))}),mi=Ft("ZodString",(e,t)=>{bn.init(e,t),fi.init(e,t),e.email=t=>e.check(function(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...ir(t)})}(gi,t)),e.url=t=>e.check(function(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ir(t)})}(yi,t)),e.jwt=t=>e.check(function(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...ir(t)})}(Di,t)),e.emoji=t=>e.check(function(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...ir(t)})}(wi,t)),e.guid=t=>e.check(Aa(vi,t)),e.uuid=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...ir(t)})}(bi,t)),e.uuidv4=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ir(t)})}(bi,t)),e.uuidv6=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ir(t)})}(bi,t)),e.uuidv7=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ir(t)})}(bi,t)),e.nanoid=t=>e.check(function(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...ir(t)})}(xi,t)),e.guid=t=>e.check(Aa(vi,t)),e.cuid=t=>e.check(function(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...ir(t)})}(Si,t)),e.cuid2=t=>e.check(function(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...ir(t)})}(ki,t)),e.ulid=t=>e.check(function(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...ir(t)})}(Ai,t)),e.base64=t=>e.check(function(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...ir(t)})}(Ri,t)),e.base64url=t=>e.check(function(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...ir(t)})}(Pi,t)),e.xid=t=>e.check(function(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...ir(t)})}(Ei,t)),e.ksuid=t=>e.check(function(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...ir(t)})}(Ci,t)),e.ipv4=t=>e.check(function(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...ir(t)})}(ji,t)),e.ipv6=t=>e.check(function(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...ir(t)})}(Ti,t)),e.cidrv4=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ir(t)})}(Ni,t)),e.cidrv6=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ir(t)})}(_i,t)),e.e164=t=>e.check(function(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...ir(t)})}(Oi,t)),e.datetime=t=>e.check(Gs(t)),e.date=t=>e.check(Hs(t)),e.time=t=>e.check(qs(t)),e.duration=t=>e.check(Ys(t))});function pi(e){return function(e,t){return new e({type:"string",...ir(t)})}(mi,e)}const hi=Ft("ZodStringFormat",(e,t)=>{yn.init(e,t),fi.init(e,t)}),gi=Ft("ZodEmail",(e,t)=>{Sn.init(e,t),hi.init(e,t)}),vi=Ft("ZodGUID",(e,t)=>{wn.init(e,t),hi.init(e,t)}),bi=Ft("ZodUUID",(e,t)=>{xn.init(e,t),hi.init(e,t)}),yi=Ft("ZodURL",(e,t)=>{kn.init(e,t),hi.init(e,t)}),wi=Ft("ZodEmoji",(e,t)=>{An.init(e,t),hi.init(e,t)}),xi=Ft("ZodNanoID",(e,t)=>{En.init(e,t),hi.init(e,t)}),Si=Ft("ZodCUID",(e,t)=>{Cn.init(e,t),hi.init(e,t)}),ki=Ft("ZodCUID2",(e,t)=>{jn.init(e,t),hi.init(e,t)}),Ai=Ft("ZodULID",(e,t)=>{Tn.init(e,t),hi.init(e,t)}),Ei=Ft("ZodXID",(e,t)=>{Nn.init(e,t),hi.init(e,t)}),Ci=Ft("ZodKSUID",(e,t)=>{_n.init(e,t),hi.init(e,t)}),ji=Ft("ZodIPv4",(e,t)=>{In.init(e,t),hi.init(e,t)}),Ti=Ft("ZodIPv6",(e,t)=>{Mn.init(e,t),hi.init(e,t)}),Ni=Ft("ZodCIDRv4",(e,t)=>{Un.init(e,t),hi.init(e,t)}),_i=Ft("ZodCIDRv6",(e,t)=>{Ln.init(e,t),hi.init(e,t)}),Ri=Ft("ZodBase64",(e,t)=>{zn.init(e,t),hi.init(e,t)}),Pi=Ft("ZodBase64URL",(e,t)=>{Bn.init(e,t),hi.init(e,t)}),Oi=Ft("ZodE164",(e,t)=>{Vn.init(e,t),hi.init(e,t)}),Di=Ft("ZodJWT",(e,t)=>{Wn.init(e,t),hi.init(e,t)}),Ii=Ft("ZodUnknown",(e,t)=>{$n.init(e,t),ui.init(e,t)});function Mi(){return new Ii({type:"unknown"})}const Ui=Ft("ZodNever",(e,t)=>{Gn.init(e,t),ui.init(e,t)});function Li(e){return function(e,t){return new e({type:"never",...ir(t)})}(Ui,e)}const Fi=Ft("ZodArray",(e,t)=>{Hn.init(e,t),ui.init(e,t),e.element=t.element,e.min=(t,r)=>e.check(Ca(t,r)),e.nonempty=t=>e.check(Ca(1,t)),e.max=(t,r)=>e.check(Ea(t,r)),e.length=(t,r)=>e.check(ja(t,r)),e.unwrap=()=>e.element});const zi=Ft("ZodObject",(e,t)=>{Xn.init(e,t),ui.init(e,t),qt(e,"shape",()=>t.shape),e.keyof=()=>function(e,t){const r=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new $i({type:"enum",entries:r,...ir(t)})}(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Mi()}),e.loose=()=>e.clone({...e._zod.def,catchall:Mi()}),e.strict=()=>e.clone({...e._zod.def,catchall:Li()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>function(e,t){if(!rr(t))throw new Error("Invalid input to extend: expected a plain object");const r=e._zod.def.checks;if(r&&r.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");const n=Yt(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return Jt(this,"shape",r),r},checks:[]});return sr(e,n)}(e,t),e.safeExtend=t=>function(e,t){if(!rr(t))throw new Error("Invalid input to safeExtend: expected a plain object");const r={...e._zod.def,get shape(){const r={...e._zod.def.shape,...t};return Jt(this,"shape",r),r},checks:e._zod.def.checks};return sr(e,r)}(e,t),e.merge=t=>function(e,t){const r=Yt(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return Jt(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return sr(e,r)}(e,t),e.pick=t=>function(e,t){const r=e._zod.def;return sr(e,Yt(e._zod.def,{get shape(){const e={};for(const n in t){if(!(n in r.shape))throw new Error(`Unrecognized key: "${n}"`);t[n]&&(e[n]=r.shape[n])}return Jt(this,"shape",e),e},checks:[]}))}(e,t),e.omit=t=>function(e,t){const r=e._zod.def,n=Yt(e._zod.def,{get shape(){const n={...e._zod.def.shape};for(const e in t){if(!(e in r.shape))throw new Error(`Unrecognized key: "${e}"`);t[e]&&delete n[e]}return Jt(this,"shape",n),n},checks:[]});return sr(e,n)}(e,t),e.partial=(...t)=>function(e,t,r){const n=Yt(t._zod.def,{get shape(){const n=t._zod.def.shape,a={...n};if(r)for(const t in r){if(!(t in n))throw new Error(`Unrecognized key: "${t}"`);r[t]&&(a[t]=e?new e({type:"optional",innerType:n[t]}):n[t])}else for(const t in n)a[t]=e?new e({type:"optional",innerType:n[t]}):n[t];return Jt(this,"shape",a),a},checks:[]});return sr(t,n)}(Ki,e,t[0]),e.required=(...t)=>function(e,t,r){const n=Yt(t._zod.def,{get shape(){const n=t._zod.def.shape,a={...n};if(r)for(const t in r){if(!(t in a))throw new Error(`Unrecognized key: "${t}"`);r[t]&&(a[t]=new e({type:"nonoptional",innerType:n[t]}))}else for(const t in n)a[t]=new e({type:"nonoptional",innerType:n[t]});return Jt(this,"shape",a),a},checks:[]});return sr(t,n)}(Xi,e,t[0])});function Bi(e,t){const r={type:"object",get shape(){var t;return Jt(this,"shape",e?(t=e,Object.create(Object.getPrototypeOf(t),Object.getOwnPropertyDescriptors(t))):{}),this.shape},...ir(t)};return new zi(r)}const Vi=Ft("ZodUnion",(e,t)=>{ea.init(e,t),ui.init(e,t),e.options=t.options});const Wi=Ft("ZodIntersection",(e,t)=>{ta.init(e,t),ui.init(e,t)});const $i=Ft("ZodEnum",(e,t)=>{aa.init(e,t),ui.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const r=new Set(Object.keys(t.entries));e.extract=(e,n)=>{const a={};for(const n of e){if(!r.has(n))throw new Error(`Key ${n} not found in enum`);a[n]=t.entries[n]}return new $i({...t,checks:[],...ir(n),entries:a})},e.exclude=(e,n)=>{const a={...t.entries};for(const t of e){if(!r.has(t))throw new Error(`Key ${t} not found in enum`);delete a[t]}return new $i({...t,checks:[],...ir(n),entries:a})}});const Gi=Ft("ZodTransform",(e,t)=>{oa.init(e,t),ui.init(e,t),e._zod.parse=(r,n)=>{if("backward"===n.direction)throw new Bt(e.constructor.name);r.addIssue=n=>{if("string"==typeof n)r.issues.push(mr(n,r.value,t));else{const t=n;t.fatal&&(t.continue=!1),t.code??(t.code="custom"),t.input??(t.input=r.value),t.inst??(t.inst=e),r.issues.push(mr(t))}};const a=t.transform(r.value,r);return a instanceof Promise?a.then(e=>(r.value=e,r)):(r.value=a,r)}});const Ki=Ft("ZodOptional",(e,t)=>{ia.init(e,t),ui.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Hi(e){return new Ki({type:"optional",innerType:e})}const Zi=Ft("ZodNullable",(e,t)=>{la.init(e,t),ui.init(e,t),e.unwrap=()=>e._zod.def.innerType});function qi(e){return new Zi({type:"nullable",innerType:e})}const Ji=Ft("ZodDefault",(e,t)=>{ca.init(e,t),ui.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});const Yi=Ft("ZodPrefault",(e,t)=>{ua.init(e,t),ui.init(e,t),e.unwrap=()=>e._zod.def.innerType});const Xi=Ft("ZodNonOptional",(e,t)=>{fa.init(e,t),ui.init(e,t),e.unwrap=()=>e._zod.def.innerType});const Qi=Ft("ZodCatch",(e,t)=>{pa.init(e,t),ui.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});const el=Ft("ZodPipe",(e,t)=>{ha.init(e,t),ui.init(e,t),e.in=t.in,e.out=t.out});function tl(e,t){return new el({type:"pipe",in:e,out:t})}const rl=Ft("ZodReadonly",(e,t)=>{va.init(e,t),ui.init(e,t),e.unwrap=()=>e._zod.def.innerType});const nl=Ft("ZodCustom",(e,t)=>{ya.init(e,t),ui.init(e,t)});const al=Bi({name:pi().min(1,"Please enter your name").max(50,"Name must be less than 50 characters").regex(/^[a-zA-Z\s]*$/,"Name can only contain letters and spaces"),email:pi().min(1,"Please enter your email address").email("Please enter a valid email address").max(100,"Email must be less than 100 characters").regex(/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,"Please enter a valid email format (e.g., name@domain.com)")}),ol={en:{nameLabel:"Name",emailLabel:"Email",submitText:"Submit",submittingText:"Submitting...",errorMessage:"An error occurred"},es:{nameLabel:"Nombre",emailLabel:"Correo electrónico",submitText:"Enviar",submittingText:"Enviando...",errorMessage:"Ocurrió un error"},fr:{nameLabel:"Nom",emailLabel:"Email",submitText:"Soumettre",submittingText:"Soumission...",errorMessage:"Une erreur est survenue"},de:{nameLabel:"Name",emailLabel:"E-Mail",submitText:"Absenden",submittingText:"Wird gesendet...",errorMessage:"Ein Fehler ist aufgetreten"},zh:{nameLabel:"姓名",emailLabel:"电子邮件",submitText:"提交",submittingText:"提交中...",errorMessage:"发生错误"},ja:{nameLabel:"名前",emailLabel:"メールアドレス",submitText:"送信",submittingText:"送信中...",errorMessage:"エラーが発生しました"},ko:{nameLabel:"이름",emailLabel:"이메일",submitText:"제출",submittingText:"제출 중...",errorMessage:"오류가 발생했습니다"}};function sl({screen:t}){return e.jsxs("div",{className:"flex flex-col items-center justify-center w-full",children:[e.jsx("p",{className:"text-2xl font-bold",children:t?.title}),e.jsx("p",{className:"text-sm text-muted-foreground",children:t?.description})]})}function il({logo:t}){return"string"==typeof t?e.jsx("img",{src:t,alt:"Logo",className:"max-h-24"}):e.jsx("img",{src:t.bucket?.url,alt:"Logo",className:"max-h-24"})}function ll(e,t){return function(){return e.apply(t,arguments)}}const{toString:cl}=Object.prototype,{getPrototypeOf:dl}=Object,{iterator:ul,toStringTag:fl}=Symbol,ml=(pl=Object.create(null),e=>{const t=cl.call(e);return pl[t]||(pl[t]=t.slice(8,-1).toLowerCase())});var pl;const hl=e=>(e=e.toLowerCase(),t=>ml(t)===e),gl=e=>t=>typeof t===e,{isArray:vl}=Array,bl=gl("undefined");function yl(e){return null!==e&&!bl(e)&&null!==e.constructor&&!bl(e.constructor)&&Sl(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const wl=hl("ArrayBuffer");const xl=gl("string"),Sl=gl("function"),kl=gl("number"),Al=e=>null!==e&&"object"==typeof e,El=e=>{if("object"!==ml(e))return!1;const t=dl(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||fl in e||ul in e)},Cl=hl("Date"),jl=hl("File"),Tl=hl("Blob"),Nl=hl("FileList"),_l=hl("URLSearchParams"),[Rl,Pl,Ol,Dl]=["ReadableStream","Request","Response","Headers"].map(hl);function Il(e,t,{allOwnKeys:r=!1}={}){if(null==e)return;let n,a;if("object"!=typeof e&&(e=[e]),vl(e))for(n=0,a=e.length;n<a;n++)t.call(null,e[n],n,e);else{if(yl(e))return;const a=r?Object.getOwnPropertyNames(e):Object.keys(e),o=a.length;let s;for(n=0;n<o;n++)s=a[n],t.call(null,e[s],s,e)}}function Ml(e,t){if(yl(e))return null;t=t.toLowerCase();const r=Object.keys(e);let n,a=r.length;for(;a-- >0;)if(n=r[a],t===n.toLowerCase())return n;return null}const Ul="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,Ll=e=>!bl(e)&&e!==Ul;const Fl=(zl="undefined"!=typeof Uint8Array&&dl(Uint8Array),e=>zl&&e instanceof zl);var zl;const Bl=hl("HTMLFormElement"),Vl=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),Wl=hl("RegExp"),$l=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};Il(r,(r,a)=>{let o;!1!==(o=t(r,a,e))&&(n[a]=o||r)}),Object.defineProperties(e,n)};const Gl=hl("AsyncFunction"),Kl=(Hl="function"==typeof setImmediate,Zl=Sl(Ul.postMessage),Hl?setImmediate:Zl?(ql=`axios@${Math.random()}`,Jl=[],Ul.addEventListener("message",({source:e,data:t})=>{e===Ul&&t===ql&&Jl.length&&Jl.shift()()},!1),e=>{Jl.push(e),Ul.postMessage(ql,"*")}):e=>setTimeout(e));var Hl,Zl,ql,Jl;const Yl="undefined"!=typeof queueMicrotask?queueMicrotask.bind(Ul):"undefined"!=typeof process&&process.nextTick||Kl;var Xl={isArray:vl,isArrayBuffer:wl,isBuffer:yl,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||Sl(e.append)&&("formdata"===(t=ml(e))||"object"===t&&Sl(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&wl(e.buffer),t},isString:xl,isNumber:kl,isBoolean:e=>!0===e||!1===e,isObject:Al,isPlainObject:El,isEmptyObject:e=>{if(!Al(e)||yl(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:Rl,isRequest:Pl,isResponse:Ol,isHeaders:Dl,isUndefined:bl,isDate:Cl,isFile:jl,isBlob:Tl,isRegExp:Wl,isFunction:Sl,isStream:e=>Al(e)&&Sl(e.pipe),isURLSearchParams:_l,isTypedArray:Fl,isFileList:Nl,forEach:Il,merge:function e(){const{caseless:t,skipUndefined:r}=Ll(this)&&this||{},n={},a=(a,o)=>{const s=t&&Ml(n,o)||o;El(n[s])&&El(a)?n[s]=e(n[s],a):El(a)?n[s]=e({},a):vl(a)?n[s]=a.slice():r&&bl(a)||(n[s]=a)};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&Il(arguments[e],a);return n},extend:(e,t,r,{allOwnKeys:n}={})=>(Il(t,(t,n)=>{r&&Sl(t)?e[n]=ll(t,r):e[n]=t},{allOwnKeys:n}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},toFlatObject:(e,t,r,n)=>{let a,o,s;const i={};if(t=t||{},null==e)return t;do{for(a=Object.getOwnPropertyNames(e),o=a.length;o-- >0;)s=a[o],n&&!n(s,e,t)||i[s]||(t[s]=e[s],i[s]=!0);e=!1!==r&&dl(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:ml,kindOfTest:hl,endsWith:(e,t,r)=>{e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return-1!==n&&n===r},toArray:e=>{if(!e)return null;if(vl(e))return e;let t=e.length;if(!kl(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},forEachEntry:(e,t)=>{const r=(e&&e[ul]).call(e);let n;for(;(n=r.next())&&!n.done;){const r=n.value;t.call(e,r[0],r[1])}},matchAll:(e,t)=>{let r;const n=[];for(;null!==(r=e.exec(t));)n.push(r);return n},isHTMLForm:Bl,hasOwnProperty:Vl,hasOwnProp:Vl,reduceDescriptors:$l,freezeMethods:e=>{$l(e,(t,r)=>{if(Sl(e)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;const n=e[r];Sl(n)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")}))})},toObjectSet:(e,t)=>{const r={},n=e=>{e.forEach(e=>{r[e]=!0})};return vl(e)?n(e):n(String(e).split(t)),r},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,r){return t.toUpperCase()+r}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:Ml,global:Ul,isContextDefined:Ll,isSpecCompliantForm:function(e){return!!(e&&Sl(e.append)&&"FormData"===e[fl]&&e[ul])},toJSONObject:e=>{const t=new Array(10),r=(e,n)=>{if(Al(e)){if(t.indexOf(e)>=0)return;if(yl(e))return e;if(!("toJSON"in e)){t[n]=e;const a=vl(e)?[]:{};return Il(e,(e,t)=>{const o=r(e,n+1);!bl(o)&&(a[t]=o)}),t[n]=void 0,a}}return e};return r(e,0)},isAsyncFn:Gl,isThenable:e=>e&&(Al(e)||Sl(e))&&Sl(e.then)&&Sl(e.catch),setImmediate:Kl,asap:Yl,isIterable:e=>null!=e&&Sl(e[ul])};function Ql(e,t,r,n,a){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),a&&(this.response=a,this.status=a.status?a.status:null)}Xl.inherits(Ql,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Xl.toJSONObject(this.config),code:this.code,status:this.status}}});const ec=Ql.prototype,tc={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{tc[e]={value:e}}),Object.defineProperties(Ql,tc),Object.defineProperty(ec,"isAxiosError",{value:!0}),Ql.from=(e,t,r,n,a,o)=>{const s=Object.create(ec);Xl.toFlatObject(e,s,function(e){return e!==Error.prototype},e=>"isAxiosError"!==e);const i=e&&e.message?e.message:"Error",l=null==t&&e?e.code:t;return Ql.call(s,i,l,r,n,a),e&&null==s.cause&&Object.defineProperty(s,"cause",{value:e,configurable:!0}),s.name=e&&e.name||"Error",o&&Object.assign(s,o),s};function rc(e){return Xl.isPlainObject(e)||Xl.isArray(e)}function nc(e){return Xl.endsWith(e,"[]")?e.slice(0,-2):e}function ac(e,t,r){return e?e.concat(t).map(function(e,t){return e=nc(e),!r&&t?"["+e+"]":e}).join(r?".":""):t}const oc=Xl.toFlatObject(Xl,{},null,function(e){return/^is[A-Z]/.test(e)});function sc(e,t,r){if(!Xl.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const n=(r=Xl.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!Xl.isUndefined(t[e])})).metaTokens,a=r.visitor||c,o=r.dots,s=r.indexes,i=(r.Blob||"undefined"!=typeof Blob&&Blob)&&Xl.isSpecCompliantForm(t);if(!Xl.isFunction(a))throw new TypeError("visitor must be a function");function l(e){if(null===e)return"";if(Xl.isDate(e))return e.toISOString();if(Xl.isBoolean(e))return e.toString();if(!i&&Xl.isBlob(e))throw new Ql("Blob is not supported. Use a Buffer instead.");return Xl.isArrayBuffer(e)||Xl.isTypedArray(e)?i&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function c(e,r,a){let i=e;if(e&&!a&&"object"==typeof e)if(Xl.endsWith(r,"{}"))r=n?r:r.slice(0,-2),e=JSON.stringify(e);else if(Xl.isArray(e)&&function(e){return Xl.isArray(e)&&!e.some(rc)}(e)||(Xl.isFileList(e)||Xl.endsWith(r,"[]"))&&(i=Xl.toArray(e)))return r=nc(r),i.forEach(function(e,n){!Xl.isUndefined(e)&&null!==e&&t.append(!0===s?ac([r],n,o):null===s?r:r+"[]",l(e))}),!1;return!!rc(e)||(t.append(ac(a,r,o),l(e)),!1)}const d=[],u=Object.assign(oc,{defaultVisitor:c,convertValue:l,isVisitable:rc});if(!Xl.isObject(e))throw new TypeError("data must be an object");return function e(r,n){if(!Xl.isUndefined(r)){if(-1!==d.indexOf(r))throw Error("Circular reference detected in "+n.join("."));d.push(r),Xl.forEach(r,function(r,o){!0===(!(Xl.isUndefined(r)||null===r)&&a.call(t,r,Xl.isString(o)?o.trim():o,n,u))&&e(r,n?n.concat(o):[o])}),d.pop()}}(e),t}function ic(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function lc(e,t){this._pairs=[],e&&sc(e,this,t)}const cc=lc.prototype;function dc(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function uc(e,t,r){if(!t)return e;const n=r&&r.encode||dc;Xl.isFunction(r)&&(r={serialize:r});const a=r&&r.serialize;let o;if(o=a?a(t,r):Xl.isURLSearchParams(t)?t.toString():new lc(t,r).toString(n),o){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}cc.append=function(e,t){this._pairs.push([e,t])},cc.toString=function(e){const t=e?function(t){return e.call(this,t,ic)}:ic;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};class fc{constructor(){this.handlers=[]}use(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){Xl.forEach(this.handlers,function(t){null!==t&&e(t)})}}var mc={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},pc={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:lc,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const hc="undefined"!=typeof window&&"undefined"!=typeof document,gc="object"==typeof navigator&&navigator||void 0,vc=hc&&(!gc||["ReactNative","NativeScript","NS"].indexOf(gc.product)<0),bc="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,yc=hc&&window.location.href||"http://localhost";var wc={...Object.freeze({__proto__:null,hasBrowserEnv:hc,hasStandardBrowserEnv:vc,hasStandardBrowserWebWorkerEnv:bc,navigator:gc,origin:yc}),...pc};function xc(e){function t(e,r,n,a){let o=e[a++];if("__proto__"===o)return!0;const s=Number.isFinite(+o),i=a>=e.length;if(o=!o&&Xl.isArray(n)?n.length:o,i)return Xl.hasOwnProp(n,o)?n[o]=[n[o],r]:n[o]=r,!s;n[o]&&Xl.isObject(n[o])||(n[o]=[]);return t(e,r,n[o],a)&&Xl.isArray(n[o])&&(n[o]=function(e){const t={},r=Object.keys(e);let n;const a=r.length;let o;for(n=0;n<a;n++)o=r[n],t[o]=e[o];return t}(n[o])),!s}if(Xl.isFormData(e)&&Xl.isFunction(e.entries)){const r={};return Xl.forEachEntry(e,(e,n)=>{t(function(e){return Xl.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),n,r,0)}),r}return null}const Sc={transitional:mc,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const r=t.getContentType()||"",n=r.indexOf("application/json")>-1,a=Xl.isObject(e);a&&Xl.isHTMLForm(e)&&(e=new FormData(e));if(Xl.isFormData(e))return n?JSON.stringify(xc(e)):e;if(Xl.isArrayBuffer(e)||Xl.isBuffer(e)||Xl.isStream(e)||Xl.isFile(e)||Xl.isBlob(e)||Xl.isReadableStream(e))return e;if(Xl.isArrayBufferView(e))return e.buffer;if(Xl.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let o;if(a){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return sc(e,new wc.classes.URLSearchParams,{visitor:function(e,t,r,n){return wc.isNode&&Xl.isBuffer(e)?(this.append(t,e.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((o=Xl.isFileList(e))||r.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return sc(o?{"files[]":e}:e,t&&new t,this.formSerializer)}}return a||n?(t.setContentType("application/json",!1),function(e,t,r){if(Xl.isString(e))try{return(t||JSON.parse)(e),Xl.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(r||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||Sc.transitional,r=t&&t.forcedJSONParsing,n="json"===this.responseType;if(Xl.isResponse(e)||Xl.isReadableStream(e))return e;if(e&&Xl.isString(e)&&(r&&!this.responseType||n)){const r=!(t&&t.silentJSONParsing)&&n;try{return JSON.parse(e,this.parseReviver)}catch(e){if(r){if("SyntaxError"===e.name)throw Ql.from(e,Ql.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:wc.classes.FormData,Blob:wc.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Xl.forEach(["delete","get","head","post","put","patch"],e=>{Sc.headers[e]={}});const kc=Xl.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);const Ac=Symbol("internals");function Ec(e){return e&&String(e).trim().toLowerCase()}function Cc(e){return!1===e||null==e?e:Xl.isArray(e)?e.map(Cc):String(e)}function jc(e,t,r,n,a){return Xl.isFunction(n)?n.call(this,t,r):(a&&(t=r),Xl.isString(t)?Xl.isString(n)?-1!==t.indexOf(n):Xl.isRegExp(n)?n.test(t):void 0:void 0)}let Tc=class{constructor(e){e&&this.set(e)}set(e,t,r){const n=this;function a(e,t,r){const a=Ec(t);if(!a)throw new Error("header name must be a non-empty string");const o=Xl.findKey(n,a);(!o||void 0===n[o]||!0===r||void 0===r&&!1!==n[o])&&(n[o||t]=Cc(e))}const o=(e,t)=>Xl.forEach(e,(e,r)=>a(e,r,t));if(Xl.isPlainObject(e)||e instanceof this.constructor)o(e,t);else if(Xl.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))o((e=>{const t={};let r,n,a;return e&&e.split("\n").forEach(function(e){a=e.indexOf(":"),r=e.substring(0,a).trim().toLowerCase(),n=e.substring(a+1).trim(),!r||t[r]&&kc[r]||("set-cookie"===r?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t})(e),t);else if(Xl.isObject(e)&&Xl.isIterable(e)){let r,n,a={};for(const t of e){if(!Xl.isArray(t))throw TypeError("Object iterator must return a key-value pair");a[n=t[0]]=(r=a[n])?Xl.isArray(r)?[...r,t[1]]:[r,t[1]]:t[1]}o(a,t)}else null!=e&&a(t,e,r);return this}get(e,t){if(e=Ec(e)){const r=Xl.findKey(this,e);if(r){const e=this[r];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}(e);if(Xl.isFunction(t))return t.call(this,e,r);if(Xl.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Ec(e)){const r=Xl.findKey(this,e);return!(!r||void 0===this[r]||t&&!jc(0,this[r],r,t))}return!1}delete(e,t){const r=this;let n=!1;function a(e){if(e=Ec(e)){const a=Xl.findKey(r,e);!a||t&&!jc(0,r[a],a,t)||(delete r[a],n=!0)}}return Xl.isArray(e)?e.forEach(a):a(e),n}clear(e){const t=Object.keys(this);let r=t.length,n=!1;for(;r--;){const a=t[r];e&&!jc(0,this[a],a,e,!0)||(delete this[a],n=!0)}return n}normalize(e){const t=this,r={};return Xl.forEach(this,(n,a)=>{const o=Xl.findKey(r,a);if(o)return t[o]=Cc(n),void delete t[a];const s=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,r)=>t.toUpperCase()+r)}(a):String(a).trim();s!==a&&delete t[a],t[s]=Cc(n),r[s]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return Xl.forEach(this,(r,n)=>{null!=r&&!1!==r&&(t[n]=e&&Xl.isArray(r)?r.join(", "):r)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const r=new this(e);return t.forEach(e=>r.set(e)),r}static accessor(e){const t=(this[Ac]=this[Ac]={accessors:{}}).accessors,r=this.prototype;function n(e){const n=Ec(e);t[n]||(!function(e,t){const r=Xl.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(e,r,a){return this[n].call(this,t,e,r,a)},configurable:!0})})}(r,e),t[n]=!0)}return Xl.isArray(e)?e.forEach(n):n(e),this}};function Nc(e,t){const r=this||Sc,n=t||r,a=Tc.from(n.headers);let o=n.data;return Xl.forEach(e,function(e){o=e.call(r,o,a.normalize(),t?t.status:void 0)}),a.normalize(),o}function _c(e){return!(!e||!e.__CANCEL__)}function Rc(e,t,r){Ql.call(this,null==e?"canceled":e,Ql.ERR_CANCELED,t,r),this.name="CanceledError"}function Pc(e,t,r){const n=r.config.validateStatus;r.status&&n&&!n(r.status)?t(new Ql("Request failed with status code "+r.status,[Ql.ERR_BAD_REQUEST,Ql.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):e(r)}Tc.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Xl.reduceDescriptors(Tc.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[r]=e}}}),Xl.freezeMethods(Tc),Xl.inherits(Rc,Ql,{__CANCEL__:!0});const Oc=(e,t,r=3)=>{let n=0;const a=function(e,t){e=e||10;const r=new Array(e),n=new Array(e);let a,o=0,s=0;return t=void 0!==t?t:1e3,function(i){const l=Date.now(),c=n[s];a||(a=l),r[o]=i,n[o]=l;let d=s,u=0;for(;d!==o;)u+=r[d++],d%=e;if(o=(o+1)%e,o===s&&(s=(s+1)%e),l-a<t)return;const f=c&&l-c;return f?Math.round(1e3*u/f):void 0}}(50,250);return function(e,t){let r,n,a=0,o=1e3/t;const s=(t,o=Date.now())=>{a=o,r=null,n&&(clearTimeout(n),n=null),e(...t)};return[(...e)=>{const t=Date.now(),i=t-a;i>=o?s(e,t):(r=e,n||(n=setTimeout(()=>{n=null,s(r)},o-i)))},()=>r&&s(r)]}(r=>{const o=r.loaded,s=r.lengthComputable?r.total:void 0,i=o-n,l=a(i);n=o;e({loaded:o,total:s,progress:s?o/s:void 0,bytes:i,rate:l||void 0,estimated:l&&s&&o<=s?(s-o)/l:void 0,event:r,lengthComputable:null!=s,[t?"download":"upload"]:!0})},r)},Dc=(e,t)=>{const r=null!=e;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},Ic=e=>(...t)=>Xl.asap(()=>e(...t));var Mc=wc.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,wc.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(wc.origin),wc.navigator&&/(msie|trident)/i.test(wc.navigator.userAgent)):()=>!0,Uc=wc.hasStandardBrowserEnv?{write(e,t,r,n,a,o){const s=[e+"="+encodeURIComponent(t)];Xl.isNumber(r)&&s.push("expires="+new Date(r).toGMTString()),Xl.isString(n)&&s.push("path="+n),Xl.isString(a)&&s.push("domain="+a),!0===o&&s.push("secure"),document.cookie=s.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function Lc(e,t,r){let n=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&(n||0==r)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const Fc=e=>e instanceof Tc?{...e}:e;function zc(e,t){t=t||{};const r={};function n(e,t,r,n){return Xl.isPlainObject(e)&&Xl.isPlainObject(t)?Xl.merge.call({caseless:n},e,t):Xl.isPlainObject(t)?Xl.merge({},t):Xl.isArray(t)?t.slice():t}function a(e,t,r,a){return Xl.isUndefined(t)?Xl.isUndefined(e)?void 0:n(void 0,e,0,a):n(e,t,0,a)}function o(e,t){if(!Xl.isUndefined(t))return n(void 0,t)}function s(e,t){return Xl.isUndefined(t)?Xl.isUndefined(e)?void 0:n(void 0,e):n(void 0,t)}function i(r,a,o){return o in t?n(r,a):o in e?n(void 0,r):void 0}const l={url:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:i,headers:(e,t,r)=>a(Fc(e),Fc(t),0,!0)};return Xl.forEach(Object.keys({...e,...t}),function(n){const o=l[n]||a,s=o(e[n],t[n],n);Xl.isUndefined(s)&&o!==i||(r[n]=s)}),r}var Bc=e=>{const t=zc({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:a,xsrfCookieName:o,headers:s,auth:i}=t;if(t.headers=s=Tc.from(s),t.url=uc(Lc(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),i&&s.set("Authorization","Basic "+btoa((i.username||"")+":"+(i.password?unescape(encodeURIComponent(i.password)):""))),Xl.isFormData(r))if(wc.hasStandardBrowserEnv||wc.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(Xl.isFunction(r.getHeaders)){const e=r.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach(([e,r])=>{t.includes(e.toLowerCase())&&s.set(e,r)})}if(wc.hasStandardBrowserEnv&&(n&&Xl.isFunction(n)&&(n=n(t)),n||!1!==n&&Mc(t.url))){const e=a&&o&&Uc.read(o);e&&s.set(a,e)}return t};var Vc="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,r){const n=Bc(e);let a=n.data;const o=Tc.from(n.headers).normalize();let s,i,l,c,d,{responseType:u,onUploadProgress:f,onDownloadProgress:m}=n;function p(){c&&c(),d&&d(),n.cancelToken&&n.cancelToken.unsubscribe(s),n.signal&&n.signal.removeEventListener("abort",s)}let h=new XMLHttpRequest;function g(){if(!h)return;const n=Tc.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders());Pc(function(e){t(e),p()},function(e){r(e),p()},{data:u&&"text"!==u&&"json"!==u?h.response:h.responseText,status:h.status,statusText:h.statusText,headers:n,config:e,request:h}),h=null}h.open(n.method.toUpperCase(),n.url,!0),h.timeout=n.timeout,"onloadend"in h?h.onloadend=g:h.onreadystatechange=function(){h&&4===h.readyState&&(0!==h.status||h.responseURL&&0===h.responseURL.indexOf("file:"))&&setTimeout(g)},h.onabort=function(){h&&(r(new Ql("Request aborted",Ql.ECONNABORTED,e,h)),h=null)},h.onerror=function(t){const n=new Ql(t&&t.message?t.message:"Network Error",Ql.ERR_NETWORK,e,h);n.event=t||null,r(n),h=null},h.ontimeout=function(){let t=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded";const a=n.transitional||mc;n.timeoutErrorMessage&&(t=n.timeoutErrorMessage),r(new Ql(t,a.clarifyTimeoutError?Ql.ETIMEDOUT:Ql.ECONNABORTED,e,h)),h=null},void 0===a&&o.setContentType(null),"setRequestHeader"in h&&Xl.forEach(o.toJSON(),function(e,t){h.setRequestHeader(t,e)}),Xl.isUndefined(n.withCredentials)||(h.withCredentials=!!n.withCredentials),u&&"json"!==u&&(h.responseType=n.responseType),m&&([l,d]=Oc(m,!0),h.addEventListener("progress",l)),f&&h.upload&&([i,c]=Oc(f),h.upload.addEventListener("progress",i),h.upload.addEventListener("loadend",c)),(n.cancelToken||n.signal)&&(s=t=>{h&&(r(!t||t.type?new Rc(null,e,h):t),h.abort(),h=null)},n.cancelToken&&n.cancelToken.subscribe(s),n.signal&&(n.signal.aborted?s():n.signal.addEventListener("abort",s)));const v=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(n.url);v&&-1===wc.protocols.indexOf(v)?r(new Ql("Unsupported protocol "+v+":",Ql.ERR_BAD_REQUEST,e)):h.send(a||null)})};const Wc=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let r,n=new AbortController;const a=function(e){if(!r){r=!0,s();const t=e instanceof Error?e:this.reason;n.abort(t instanceof Ql?t:new Rc(t instanceof Error?t.message:t))}};let o=t&&setTimeout(()=>{o=null,a(new Ql(`timeout ${t} of ms exceeded`,Ql.ETIMEDOUT))},t);const s=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(a):e.removeEventListener("abort",a)}),e=null)};e.forEach(e=>e.addEventListener("abort",a));const{signal:i}=n;return i.unsubscribe=()=>Xl.asap(s),i}},$c=function*(e,t){let r=e.byteLength;if(r<t)return void(yield e);let n,a=0;for(;a<r;)n=a+t,yield e.slice(a,n),a=n},Gc=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:r}=await t.read();if(e)break;yield r}}finally{await t.cancel()}},Kc=(e,t,r,n)=>{const a=async function*(e,t){for await(const r of Gc(e))yield*$c(r,t)}(e,t);let o,s=0,i=e=>{o||(o=!0,n&&n(e))};return new ReadableStream({async pull(e){try{const{done:t,value:n}=await a.next();if(t)return i(),void e.close();let o=n.byteLength;if(r){let e=s+=o;r(e)}e.enqueue(new Uint8Array(n))}catch(e){throw i(e),e}},cancel:e=>(i(e),a.return())},{highWaterMark:2})},{isFunction:Hc}=Xl,Zc=(({Request:e,Response:t})=>({Request:e,Response:t}))(Xl.global),{ReadableStream:qc,TextEncoder:Jc}=Xl.global,Yc=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},Xc=e=>{e=Xl.merge.call({skipUndefined:!0},Zc,e);const{fetch:t,Request:r,Response:n}=e,a=t?Hc(t):"function"==typeof fetch,o=Hc(r),s=Hc(n);if(!a)return!1;const i=a&&Hc(qc),l=a&&("function"==typeof Jc?(c=new Jc,e=>c.encode(e)):async e=>new Uint8Array(await new r(e).arrayBuffer()));var c;const d=o&&i&&Yc(()=>{let e=!1;const t=new r(wc.origin,{body:new qc,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),u=s&&i&&Yc(()=>Xl.isReadableStream(new n("").body)),f={stream:u&&(e=>e.body)};a&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!f[e]&&(f[e]=(t,r)=>{let n=t&&t[e];if(n)return n.call(t);throw new Ql(`Response type '${e}' is not supported`,Ql.ERR_NOT_SUPPORT,r)})});const m=async(e,t)=>{const n=Xl.toFiniteNumber(e.getContentLength());return null==n?(async e=>{if(null==e)return 0;if(Xl.isBlob(e))return e.size;if(Xl.isSpecCompliantForm(e)){const t=new r(wc.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return Xl.isArrayBufferView(e)||Xl.isArrayBuffer(e)?e.byteLength:(Xl.isURLSearchParams(e)&&(e+=""),Xl.isString(e)?(await l(e)).byteLength:void 0)})(t):n};return async e=>{let{url:a,method:s,data:i,signal:l,cancelToken:c,timeout:p,onDownloadProgress:h,onUploadProgress:g,responseType:v,headers:b,withCredentials:y="same-origin",fetchOptions:w}=Bc(e),x=t||fetch;v=v?(v+"").toLowerCase():"text";let S=Wc([l,c&&c.toAbortSignal()],p),k=null;const A=S&&S.unsubscribe&&(()=>{S.unsubscribe()});let E;try{if(g&&d&&"get"!==s&&"head"!==s&&0!==(E=await m(b,i))){let e,t=new r(a,{method:"POST",body:i,duplex:"half"});if(Xl.isFormData(i)&&(e=t.headers.get("content-type"))&&b.setContentType(e),t.body){const[e,r]=Dc(E,Oc(Ic(g)));i=Kc(t.body,65536,e,r)}}Xl.isString(y)||(y=y?"include":"omit");const t=o&&"credentials"in r.prototype,l={...w,signal:S,method:s.toUpperCase(),headers:b.normalize().toJSON(),body:i,duplex:"half",credentials:t?y:void 0};k=o&&new r(a,l);let c=await(o?x(k,w):x(a,l));const p=u&&("stream"===v||"response"===v);if(u&&(h||p&&A)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=c[t]});const t=Xl.toFiniteNumber(c.headers.get("content-length")),[r,a]=h&&Dc(t,Oc(Ic(h),!0))||[];c=new n(Kc(c.body,65536,r,()=>{a&&a(),A&&A()}),e)}v=v||"text";let C=await f[Xl.findKey(f,v)||"text"](c,e);return!p&&A&&A(),await new Promise((t,r)=>{Pc(t,r,{data:C,headers:Tc.from(c.headers),status:c.status,statusText:c.statusText,config:e,request:k})})}catch(t){if(A&&A(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new Ql("Network Error",Ql.ERR_NETWORK,e,k),{cause:t.cause||t});throw Ql.from(t,t&&t.code,e,k)}}},Qc=new Map,ed=e=>{let t=e?e.env:{};const{fetch:r,Request:n,Response:a}=t,o=[n,a,r];let s,i,l=o.length,c=Qc;for(;l--;)s=o[l],i=c.get(s),void 0===i&&c.set(s,i=l?new Map:Xc(t)),c=i;return i};ed();const td={http:null,xhr:Vc,fetch:{get:ed}};Xl.forEach(td,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});const rd=e=>`- ${e}`,nd=e=>Xl.isFunction(e)||null===e||!1===e;var ad=(e,t)=>{e=Xl.isArray(e)?e:[e];const{length:r}=e;let n,a;const o={};for(let s=0;s<r;s++){let r;if(n=e[s],a=n,!nd(n)&&(a=td[(r=String(n)).toLowerCase()],void 0===a))throw new Ql(`Unknown adapter '${r}'`);if(a&&(Xl.isFunction(a)||(a=a.get(t))))break;o[r||"#"+s]=a}if(!a){const e=Object.entries(o).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));throw new Ql("There is no suitable adapter to dispatch the request "+(r?e.length>1?"since :\n"+e.map(rd).join("\n"):" "+rd(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return a};function od(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Rc(null,e)}function sd(e){od(e),e.headers=Tc.from(e.headers),e.data=Nc.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return ad(e.adapter||Sc.adapter,e)(e).then(function(t){return od(e),t.data=Nc.call(e,e.transformResponse,t),t.headers=Tc.from(t.headers),t},function(t){return _c(t)||(od(e),t&&t.response&&(t.response.data=Nc.call(e,e.transformResponse,t.response),t.response.headers=Tc.from(t.response.headers))),Promise.reject(t)})}const id="1.12.2",ld={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{ld[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const cd={};ld.transitional=function(e,t,r){function n(e,t){return"[Axios v"+id+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}return(r,a,o)=>{if(!1===e)throw new Ql(n(a," has been removed"+(t?" in "+t:"")),Ql.ERR_DEPRECATED);return t&&!cd[a]&&(cd[a]=!0,console.warn(n(a," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,a,o)}},ld.spelling=function(e){return(t,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};var dd={assertOptions:function(e,t,r){if("object"!=typeof e)throw new Ql("options must be an object",Ql.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let a=n.length;for(;a-- >0;){const o=n[a],s=t[o];if(s){const t=e[o],r=void 0===t||s(t,o,e);if(!0!==r)throw new Ql("option "+o+" must be "+r,Ql.ERR_BAD_OPTION_VALUE);continue}if(!0!==r)throw new Ql("Unknown option "+o,Ql.ERR_BAD_OPTION)}},validators:ld};const ud=dd.validators;let fd=class{constructor(e){this.defaults=e||{},this.interceptors={request:new fc,response:new fc}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const r=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?r&&!String(e.stack).endsWith(r.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+r):e.stack=r}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=zc(this.defaults,t);const{transitional:r,paramsSerializer:n,headers:a}=t;void 0!==r&&dd.assertOptions(r,{silentJSONParsing:ud.transitional(ud.boolean),forcedJSONParsing:ud.transitional(ud.boolean),clarifyTimeoutError:ud.transitional(ud.boolean)},!1),null!=n&&(Xl.isFunction(n)?t.paramsSerializer={serialize:n}:dd.assertOptions(n,{encode:ud.function,serialize:ud.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),dd.assertOptions(t,{baseUrl:ud.spelling("baseURL"),withXsrfToken:ud.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=a&&Xl.merge(a.common,a[t.method]);a&&Xl.forEach(["delete","get","head","post","put","patch","common"],e=>{delete a[e]}),t.headers=Tc.concat(o,a);const s=[];let i=!0;this.interceptors.request.forEach(function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(i=i&&e.synchronous,s.unshift(e.fulfilled,e.rejected))});const l=[];let c;this.interceptors.response.forEach(function(e){l.push(e.fulfilled,e.rejected)});let d,u=0;if(!i){const e=[sd.bind(this),void 0];for(e.unshift(...s),e.push(...l),d=e.length,c=Promise.resolve(t);u<d;)c=c.then(e[u++],e[u++]);return c}d=s.length;let f=t;for(;u<d;){const e=s[u++],t=s[u++];try{f=e(f)}catch(e){t.call(this,e);break}}try{c=sd.call(this,f)}catch(e){return Promise.reject(e)}for(u=0,d=l.length;u<d;)c=c.then(l[u++],l[u++]);return c}getUri(e){return uc(Lc((e=zc(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}};Xl.forEach(["delete","get","head","options"],function(e){fd.prototype[e]=function(t,r){return this.request(zc(r||{},{method:e,url:t,data:(r||{}).data}))}}),Xl.forEach(["post","put","patch"],function(e){function t(t){return function(r,n,a){return this.request(zc(a||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}fd.prototype[e]=t(),fd.prototype[e+"Form"]=t(!0)});const md={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(md).forEach(([e,t])=>{md[t]=e});const pd=function e(t){const r=new fd(t),n=ll(fd.prototype.request,r);return Xl.extend(n,fd.prototype,r,{allOwnKeys:!0}),Xl.extend(n,r,null,{allOwnKeys:!0}),n.create=function(r){return e(zc(t,r))},n}(Sc);pd.Axios=fd,pd.CanceledError=Rc,pd.CancelToken=class e{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(e){t=e});const r=this;this.promise.then(e=>{if(!r._listeners)return;let t=r._listeners.length;for(;t-- >0;)r._listeners[t](e);r._listeners=null}),this.promise.then=e=>{let t;const n=new Promise(e=>{r.subscribe(e),t=e}).then(e);return n.cancel=function(){r.unsubscribe(t)},n},e(function(e,n,a){r.reason||(r.reason=new Rc(e,n,a),t(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let t;return{token:new e(function(e){t=e}),cancel:t}}},pd.isCancel=_c,pd.VERSION=id,pd.toFormData=sc,pd.AxiosError=Ql,pd.Cancel=pd.CanceledError,pd.all=function(e){return Promise.all(e)},pd.spread=function(e){return function(t){return e.apply(null,t)}},pd.isAxiosError=function(e){return Xl.isObject(e)&&!0===e.isAxiosError},pd.mergeConfig=zc,pd.AxiosHeaders=Tc,pd.formToJSON=e=>xc(Xl.isHTMLForm(e)?new FormData(e):e),pd.getAdapter=ad,pd.HttpStatusCode=md,pd.default=pd;const{Axios:hd,AxiosError:gd,CanceledError:vd,isCancel:bd,CancelToken:yd,VERSION:wd,all:xd,Cancel:Sd,isAxiosError:kd,spread:Ad,toFormData:Ed,AxiosHeaders:Cd,HttpStatusCode:jd,formToJSON:Td,getAdapter:Nd,mergeConfig:_d}=pd;const Rd=new class{constructor(e={}){this.client=pd.create({baseURL:e.baseURL||"https://api.example.com",timeout:e.timeout||1e4,headers:{"Content-Type":"application/json",...e.headers}}),this.client.interceptors.request.use(e=>{const t=b();return t&&(e.headers["x-session-id"]=t),e},e=>Promise.reject(e))}async get(e,t){const r=await this.client.get(e,t);return{data:r.data,status:r.status,statusText:r.statusText,headers:r.headers}}async post(e,t,r){const n=await this.client.post(e,t,r);return{data:n.data,status:n.status,statusText:n.statusText,headers:n.headers}}async put(e,t,r){const n=await this.client.put(e,t,r);return{data:n.data,status:n.status,statusText:n.statusText,headers:n.headers}}async delete(e,t){const r=await this.client.delete(e,t);return{data:r.data,status:r.status,statusText:r.statusText,headers:r.headers}}async patch(e,t,r){const n=await this.client.patch(e,t,r);return{data:n.data,status:n.status,statusText:n.statusText,headers:n.headers}}setBaseURL(e){this.client.defaults.baseURL=e}setHeader(e,t){this.client.defaults.headers.common[e]=t}removeHeader(e){delete this.client.defaults.headers.common[e]}};class Pd{constructor(e){this.version=e.version,this.orgId=e.orgId,this.serverUrl=e.serverUrl}getAuthHeader(){return y()}async getWorkspaces(){const e=await fetch(`${this.serverUrl}/api/${this.version}/public/workspaces`,{headers:this.getAuthHeader()});if(!e.ok)throw new Error("Failed to fetch workspaces");return e.json()}async createWorkspace(e){const t=await fetch(`${this.serverUrl}/api/${this.version}/public/workspaces`,{method:"POST",headers:{"Content-Type":"application/json",...this.getAuthHeader()},body:JSON.stringify(e)});if(!t.ok)throw new Error("Failed to create workspace");return t.json()}async updateWorkspace(e,t){const r=await fetch(`${this.serverUrl}/api/${this.version}/public/workspaces/${e}`,{method:"PUT",headers:{"Content-Type":"application/json",...this.getAuthHeader()},body:JSON.stringify(t)});if(!r.ok)throw new Error("Failed to update workspace");return r.json()}async deleteWorkspace(e){const t=await fetch(`${this.serverUrl}/api/${this.version}/public/workspaces/${e}`,{method:"DELETE",headers:this.getAuthHeader()});if(!t.ok)throw new Error("Failed to delete workspace");return t.json()}async getWorkspaceUsers(e){const t=await fetch(`${this.serverUrl}/api/${this.version}/public/workspaces/${e}/users`,{headers:this.getAuthHeader()});if(!t.ok)throw new Error("Failed to fetch workspace users");return t.json()}async addUser(e,t){const r=await fetch(`${this.serverUrl}/api/${this.version}/public/workspaces/${e}/users/add`,{method:"POST",headers:{"Content-Type":"application/json",...this.getAuthHeader()},body:JSON.stringify(t)});if(!r.ok){const e=await r.json();throw new Error(e.message||"Failed to invite member")}return r.json()}async removeUser(e,t){const r=await fetch(`${this.serverUrl}/api/${this.version}/public/workspaces/${e}/users/${t}`,{method:"DELETE",headers:this.getAuthHeader()});if(!r.ok){const e=await r.json();throw new Error(e.message||"Failed to remove user")}return r.json()}async updateUser(e,t,r){const n=await fetch(`${this.serverUrl}/api/${this.version}/public/workspaces/${e}/users/${t}`,{method:"PATCH",headers:{"Content-Type":"application/json",...this.getAuthHeader()},body:JSON.stringify(r)});if(!n.ok){const e=await n.json();throw new Error(e.message||"Failed to update user")}return n.json()}async getFeatures(){const e=await fetch(`${this.serverUrl}/api/${this.version}/public/workspaces/features`,{headers:this.getAuthHeader()});if(!e.ok)throw new Error("Failed to fetch features");return e.json()}async updateFeature(e,t,r){const n=await fetch(`${this.serverUrl}/api/${this.version}/public/workspaces/${e}/features`,{method:"PATCH",headers:{"Content-Type":"application/json",...this.getAuthHeader()},body:JSON.stringify({features:{[t]:r}})});if(!n.ok)throw new Error("Failed to update feature");return n.json()}async getWorkspace(e){const t=await fetch(`${this.serverUrl}/api/${this.version}/public/workspaces/${e}`,{headers:this.getAuthHeader()});if(!t.ok)throw new Error("Failed to fetch workspace");return t.json()}async getProfile(){const e=await fetch(`${this.serverUrl}/api/${this.version}/public/profile`,{headers:this.getAuthHeader()});if(!e.ok)throw new Error("Failed to fetch profile");return e.json()}async updateUserProfile(e){const t=await fetch(`${this.serverUrl}/api/${this.version}/public/profile`,{method:"PATCH",headers:{"Content-Type":"application/json",...this.getAuthHeader()},body:JSON.stringify(e)});if(!t.ok)throw new Error("Failed to update user profile");return t.json()}}function Od(t,r=[]){let n=[];const o=()=>{const e=n.map(e=>a.createContext(e));return function(r){const n=r?.[t]||e;return a.useMemo(()=>({[`__scope${t}`]:{...r,[t]:n}}),[r,n])}};return o.scopeName=t,[function(r,o){const s=a.createContext(o),i=n.length;n=[...n,o];const l=r=>{const{scope:n,children:o,...l}=r,c=n?.[t]?.[i]||s,d=a.useMemo(()=>l,Object.values(l));return e.jsx(c.Provider,{value:d,children:o})};return l.displayName=r+"Provider",[l,function(e,n){const l=n?.[t]?.[i]||s,c=a.useContext(l);if(c)return c;if(void 0!==o)return o;throw new Error(`\`${e}\` must be used within \`${r}\``)}]},Dd(o,...r)]}function Dd(...e){const t=e[0];if(1===e.length)return t;const r=()=>{const r=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){const n=r.reduce((t,{useScope:r,scopeName:n})=>({...t,...r(e)[`__scope${n}`]}),{});return a.useMemo(()=>({[`__scope${t.scopeName}`]:n}),[n])}};return r.scopeName=t.scopeName,r}function Id(e){const t=a.useRef(e);return a.useEffect(()=>{t.current=e}),a.useMemo(()=>(...e)=>t.current?.(...e),[])}var Md,Ud=globalThis?.document?a.useLayoutEffect:()=>{},Ld={exports:{}},Fd={};function zd(){if(Md)return Fd;Md=1;var e=t;var r="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},n=e.useState,a=e.useEffect,o=e.useLayoutEffect,s=e.useDebugValue;function i(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch(e){return!0}}var l="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var r=t(),l=n({inst:{value:r,getSnapshot:t}}),c=l[0].inst,d=l[1];return o(function(){c.value=r,c.getSnapshot=t,i(c)&&d({inst:c})},[e,r,t]),a(function(){return i(c)&&d({inst:c}),e(function(){i(c)&&d({inst:c})})},[e]),s(r),r};return Fd.useSyncExternalStore=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:l,Fd}var Bd,Vd,Wd={};
21
21
  /**
22
22
  * @license React
23
23
  * use-sync-external-store-shim.development.js
@@ -26,5 +26,5 @@ var es={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24
26
26
  *
27
27
  * This source code is licensed under the MIT license found in the
28
28
  * LICENSE file in the root directory of this source tree.
29
- */function Uu(){return Iu||(Iu=1,"production"!==process.env.NODE_ENV&&function(){function e(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!n(e,r)}catch(e){return!0}}"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var r=t,n="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},a=r.useState,o=r.useEffect,s=r.useLayoutEffect,i=r.useDebugValue,l=!1,c=!1,u="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(t,u){l||void 0===r.startTransition||(l=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var d=u();if(!c){var f=u();n(d,f)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),c=!0)}var m=(f=a({inst:{value:d,getSnapshot:u}}))[0].inst,p=f[1];return s(function(){m.value=d,m.getSnapshot=u,e(m)&&p({inst:m})},[t,d,u]),o(function(){return e(m)&&p({inst:m}),t(function(){e(m)&&p({inst:m})})},[t]),i(d),d};Lu.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:u,"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),Lu}function zu(){return Mu||(Mu=1,"production"===process.env.NODE_ENV?Pu.exports=Du():Pu.exports=Uu()),Pu.exports}var Fu=zu();function Bu(){return()=>{}}var Vu="Avatar",[$u,Wu]=Tu(Vu),[Gu,Ku]=$u(Vu),Hu=a.forwardRef((t,r)=>{const{__scopeAvatar:n,...o}=t,[s,i]=a.useState("idle");return e.jsx(Gu,{scope:n,imageLoadingStatus:s,onImageLoadingStatusChange:i,children:e.jsx(ys.span,{...o,ref:r})})});Hu.displayName=Vu;var Zu="AvatarImage",qu=a.forwardRef((t,r)=>{const{__scopeAvatar:n,src:o,onLoadingStatusChange:s=()=>{},...i}=t,l=Ku(Zu,n),c=function(e,{referrerPolicy:t,crossOrigin:r}){const n=Fu.useSyncExternalStore(Bu,()=>!0,()=>!1),o=a.useRef(null),s=n?(o.current||(o.current=new window.Image),o.current):null,[i,l]=a.useState(()=>Xu(s,e));return Ru(()=>{l(Xu(s,e))},[s,e]),Ru(()=>{const e=e=>()=>{l(e)};if(!s)return;const n=e("loaded"),a=e("error");return s.addEventListener("load",n),s.addEventListener("error",a),t&&(s.referrerPolicy=t),"string"==typeof r&&(s.crossOrigin=r),()=>{s.removeEventListener("load",n),s.removeEventListener("error",a)}},[s,r,t]),i}(o,i),u=_u(e=>{s(e),l.onImageLoadingStatusChange(e)});return Ru(()=>{"idle"!==c&&u(c)},[c,u]),"loaded"===c?e.jsx(ys.img,{...i,ref:r,src:o}):null});qu.displayName=Zu;var Ju="AvatarFallback",Yu=a.forwardRef((t,r)=>{const{__scopeAvatar:n,delayMs:o,...s}=t,i=Ku(Ju,n),[l,c]=a.useState(void 0===o);return a.useEffect(()=>{if(void 0!==o){const e=window.setTimeout(()=>c(!0),o);return()=>window.clearTimeout(e)}},[o]),l&&"loaded"!==i.imageLoadingStatus?e.jsx(ys.span,{...s,ref:r}):null});function Xu(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}Yu.displayName=Ju;var Qu=Hu,ed=qu,td=Yu;const rd=a.forwardRef(({className:t,...r},n)=>e.jsx(Qu,{ref:n,className:Uo("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",t),...r}));rd.displayName=Qu.displayName;const nd=a.forwardRef(({className:t,...r},n)=>e.jsx(ed,{ref:n,className:Uo("aspect-square h-full w-full",t),...r}));nd.displayName=ed.displayName;const ad=a.forwardRef(({className:t,...r},n)=>e.jsx(td,{ref:n,className:Uo("flex h-full w-full items-center justify-center rounded-full bg-muted",t),...r}));function od(e,t,{checkForDefaultPrevented:r=!0}={}){return function(n){if(e?.(n),!1===r||!n.defaultPrevented)return t?.(n)}}ad.displayName=td.displayName;var sd=a[" useId ".trim().toString()]||(()=>{}),id=0;function ld(e){const[t,r]=a.useState(sd());return Ru(()=>{r(e=>e??String(id++))},[e]),e||(t?`radix-${t}`:"")}var cd=a[" useInsertionEffect ".trim().toString()]||Ru;function ud({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[o,s,i]=function({defaultProp:e,onChange:t}){const[r,n]=a.useState(e),o=a.useRef(r),s=a.useRef(t);return cd(()=>{s.current=t},[t]),a.useEffect(()=>{o.current!==r&&(s.current?.(r),o.current=r)},[r,o]),[r,n,s]}({defaultProp:t,onChange:r}),l=void 0!==e,c=l?e:o;{const t=a.useRef(void 0!==e);a.useEffect(()=>{const e=t.current;if(e!==l){const t=e?"controlled":"uncontrolled",r=l?"controlled":"uncontrolled";console.warn(`${n} is changing from ${t} to ${r}. 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=l},[l,n])}const u=a.useCallback(t=>{if(l){const r=function(e){return"function"==typeof e}(t)?t(e):t;r!==e&&i.current?.(r)}else s(t)},[l,e,s,i]);return[c,u]}var dd,fd="dismissableLayer.update",md="dismissableLayer.pointerDownOutside",pd="dismissableLayer.focusOutside",hd=a.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),gd=a.forwardRef((t,r)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:l,onDismiss:c,...u}=t,d=a.useContext(hd),[f,m]=a.useState(null),p=f?.ownerDocument??globalThis?.document,[,h]=a.useState({}),g=Bo(r,e=>m(e)),v=Array.from(d.layers),[b]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),y=v.indexOf(b),w=f?v.indexOf(f):-1,x=d.layersWithOutsidePointerEventsDisabled.size>0,S=w>=y,k=function(e,t=globalThis?.document){const r=_u(e),n=a.useRef(!1),o=a.useRef(()=>{});return a.useEffect(()=>{const e=e=>{if(e.target&&!n.current){let n=function(){bd(md,r,a,{discrete:!0})};const a={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",o.current),o.current=n,t.addEventListener("click",o.current,{once:!0})):n()}else t.removeEventListener("click",o.current);n.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",e),t.removeEventListener("click",o.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}(e=>{const t=e.target,r=[...d.branches].some(e=>e.contains(t));S&&!r&&(s?.(e),l?.(e),e.defaultPrevented||c?.())},p),A=function(e,t=globalThis?.document){const r=_u(e),n=a.useRef(!1);return a.useEffect(()=>{const e=e=>{if(e.target&&!n.current){bd(pd,r,{originalEvent:e},{discrete:!1})}};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}(e=>{const t=e.target;[...d.branches].some(e=>e.contains(t))||(i?.(e),l?.(e),e.defaultPrevented||c?.())},p);return function(e,t=globalThis?.document){const r=_u(e);a.useEffect(()=>{const e=e=>{"Escape"===e.key&&r(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})},[r,t])}(e=>{w===d.layers.size-1&&(o?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))},p),a.useEffect(()=>{if(f)return n&&(0===d.layersWithOutsidePointerEventsDisabled.size&&(dd=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),vd(),()=>{n&&1===d.layersWithOutsidePointerEventsDisabled.size&&(p.body.style.pointerEvents=dd)}},[f,p,n,d]),a.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),vd())},[f,d]),a.useEffect(()=>{const e=()=>h({});return document.addEventListener(fd,e),()=>document.removeEventListener(fd,e)},[]),e.jsx(ys.div,{...u,ref:g,style:{pointerEvents:x?S?"auto":"none":void 0,...t.style},onFocusCapture:od(t.onFocusCapture,A.onFocusCapture),onBlurCapture:od(t.onBlurCapture,A.onBlurCapture),onPointerDownCapture:od(t.onPointerDownCapture,k.onPointerDownCapture)})});gd.displayName="DismissableLayer";function vd(){const e=new CustomEvent(fd);document.dispatchEvent(e)}function bd(e,t,r,{discrete:n}){const a=r.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&a.addEventListener(e,t,{once:!0}),n?function(e,t){e&&o.flushSync(()=>e.dispatchEvent(t))}(a,s):a.dispatchEvent(s)}a.forwardRef((t,r)=>{const n=a.useContext(hd),o=a.useRef(null),s=Bo(r,o);return a.useEffect(()=>{const e=o.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),e.jsx(ys.div,{...t,ref:s})}).displayName="DismissableLayerBranch";var yd="focusScope.autoFocusOnMount",wd="focusScope.autoFocusOnUnmount",xd={bubbles:!1,cancelable:!0},Sd=a.forwardRef((t,r)=>{const{loop:n=!1,trapped:o=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...l}=t,[c,u]=a.useState(null),d=_u(s),f=_u(i),m=a.useRef(null),p=Bo(r,e=>u(e)),h=a.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;a.useEffect(()=>{if(o){let e=function(e){if(h.paused||!c)return;const t=e.target;c.contains(t)?m.current=t:Cd(m.current,{select:!0})},t=function(e){if(h.paused||!c)return;const t=e.relatedTarget;null!==t&&(c.contains(t)||Cd(m.current,{select:!0}))},r=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&Cd(c)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const n=new MutationObserver(r);return c&&n.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),n.disconnect()}}},[o,c,h.paused]),a.useEffect(()=>{if(c){Td.add(h);const t=document.activeElement;if(!c.contains(t)){const r=new CustomEvent(yd,xd);c.addEventListener(yd,d),c.dispatchEvent(r),r.defaultPrevented||(!function(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(Cd(n,{select:t}),document.activeElement!==r)return}((e=kd(c),e.filter(e=>"A"!==e.tagName)),{select:!0}),document.activeElement===t&&Cd(c))}return()=>{c.removeEventListener(yd,d),setTimeout(()=>{const e=new CustomEvent(wd,xd);c.addEventListener(wd,f),c.dispatchEvent(e),e.defaultPrevented||Cd(t??document.body,{select:!0}),c.removeEventListener(wd,f),Td.remove(h)},0)}}var e},[c,d,f,h]);const g=a.useCallback(e=>{if(!n&&!o)return;if(h.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,r=document.activeElement;if(t&&r){const t=e.currentTarget,[a,o]=function(e){const t=kd(e),r=Ad(t,e),n=Ad(t.reverse(),e);return[r,n]}(t);a&&o?e.shiftKey||r!==o?e.shiftKey&&r===a&&(e.preventDefault(),n&&Cd(o,{select:!0})):(e.preventDefault(),n&&Cd(a,{select:!0})):r===t&&e.preventDefault()}},[n,o,h.paused]);return e.jsx(ys.div,{tabIndex:-1,...l,ref:p,onKeyDown:g})});function kd(e){const t=[],r=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(;r.nextNode();)t.push(r.currentNode);return t}function Ad(e,t){for(const r of e)if(!Ed(r,{upTo:t}))return r}function Ed(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 Cd(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}Sd.displayName="FocusScope";var Td=function(){let e=[];return{add(t){const r=e[0];t!==r&&r?.pause(),e=jd(e,t),e.unshift(t)},remove(t){e=jd(e,t),e[0]?.resume()}}}();function jd(e,t){const r=[...e],n=r.indexOf(t);return-1!==n&&r.splice(n,1),r}var _d=a.forwardRef((t,n)=>{const{container:o,...s}=t,[i,l]=a.useState(!1);Ru(()=>l(!0),[]);const c=o||i&&globalThis?.document?.body;return c?r.createPortal(e.jsx(ys.div,{...s,ref:n}),c):null});_d.displayName="Portal";var Nd=e=>{const{present:t,children:r}=e,n=function(e){const[t,r]=a.useState(),n=a.useRef(null),o=a.useRef(e),s=a.useRef("none"),i=e?"mounted":"unmounted",[l,c]=function(e,t){return a.useReducer((e,r)=>t[e][r]??e,e)}(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return a.useEffect(()=>{const e=Rd(n.current);s.current="mounted"===l?e:"none"},[l]),Ru(()=>{const t=n.current,r=o.current;if(r!==e){const n=s.current,a=Rd(t);if(e)c("MOUNT");else if("none"===a||"none"===t?.display)c("UNMOUNT");else{c(r&&n!==a?"ANIMATION_OUT":"UNMOUNT")}o.current=e}},[e,c]),Ru(()=>{if(t){let e;const r=t.ownerDocument.defaultView??window,a=a=>{const s=Rd(n.current).includes(CSS.escape(a.animationName));if(a.target===t&&s&&(c("ANIMATION_END"),!o.current)){const n=t.style.animationFillMode;t.style.animationFillMode="forwards",e=r.setTimeout(()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=n)})}},i=e=>{e.target===t&&(s.current=Rd(n.current))};return t.addEventListener("animationstart",i),t.addEventListener("animationcancel",a),t.addEventListener("animationend",a),()=>{r.clearTimeout(e),t.removeEventListener("animationstart",i),t.removeEventListener("animationcancel",a),t.removeEventListener("animationend",a)}}c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:a.useCallback(e=>{n.current=e?getComputedStyle(e):null,r(e)},[])}}(t),o="function"==typeof r?r({present:n.isPresent}):a.Children.only(r),s=Bo(n.ref,function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;if(r)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r)return e.props.ref;return e.props.ref||e.ref}(o));return"function"==typeof r||n.isPresent?a.cloneElement(o,{ref:s}):null};function Rd(e){return e?.animationName||"none"}Nd.displayName="Presence";var Pd=0;function Od(){a.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Dd()),document.body.insertAdjacentElement("beforeend",e[1]??Dd()),Pd++,()=>{1===Pd&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),Pd--}},[])}function Dd(){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 Id=function(){return Id=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},Id.apply(this,arguments)};function Md(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]])}return r}"function"==typeof SuppressedError&&SuppressedError;var Ld="right-scroll-bar-position",Ud="width-before-scroll-bar";function zd(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var Fd="undefined"!=typeof window?a.useLayoutEffect:a.useEffect,Bd=new WeakMap;function Vd(e,r){var n,a,o,s=(n=null,a=function(t){return e.forEach(function(e){return zd(e,t)})},(o=t.useState(function(){return{value:n,callback:a,facade:{get current(){return o.value},set current(e){var t=o.value;t!==e&&(o.value=e,o.callback(e,t))}}}})[0]).callback=a,o.facade);return Fd(function(){var t=Bd.get(s);if(t){var r=new Set(t),n=new Set(e),a=s.current;r.forEach(function(e){n.has(e)||zd(e,null)}),n.forEach(function(e){r.has(e)||zd(e,a)})}Bd.set(s,e)},[e]),s}function $d(e){return e}var Wd=function(e){var t=e.sideCar,r=Md(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return a.createElement(n,Id({},r))};Wd.isSideCarExport=!0;var Gd=function(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=$d);var r=[],n=!1;return{read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(e){var a=t(e,n);return r.push(a),function(){r=r.filter(function(e){return e!==a})}},assignSyncMedium:function(e){for(n=!0;r.length;){var t=r;r=[],t.forEach(e)}r={push:function(t){return e(t)},filter:function(){return r}}},assignMedium:function(e){n=!0;var t=[];if(r.length){var a=r;r=[],a.forEach(e),t=r}var o=function(){var r=t;t=[],r.forEach(e)},s=function(){return Promise.resolve().then(o)};s(),r={push:function(e){t.push(e),s()},filter:function(e){return t=t.filter(e),r}}}}}(null);return t.options=Id({async:!0,ssr:!1},e),t}(),Kd=function(){},Hd=a.forwardRef(function(e,t){var r=a.useRef(null),n=a.useState({onScrollCapture:Kd,onWheelCapture:Kd,onTouchMoveCapture:Kd}),o=n[0],s=n[1],i=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,m=e.sideCar,p=e.noRelative,h=e.noIsolation,g=e.inert,v=e.allowPinchZoom,b=e.as,y=void 0===b?"div":b,w=e.gapMode,x=Md(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=m,k=Vd([r,t]),A=Id(Id({},x),o);return a.createElement(a.Fragment,null,d&&a.createElement(S,{sideCar:Gd,removeScrollBar:u,shards:f,noRelative:p,noIsolation:h,inert:g,setCallbacks:s,allowPinchZoom:!!v,lockRef:r,gapMode:w}),i?a.cloneElement(a.Children.only(l),Id(Id({},A),{ref:k})):a.createElement(y,Id({},A,{className:c,ref:k}),l))});Hd.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Hd.classNames={fullWidth:Ud,zeroRight:Ld};function Zd(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=function(){if("undefined"!=typeof __webpack_nonce__)return __webpack_nonce__}();return t&&e.setAttribute("nonce",t),e}var qd=function(){var e=0,t=null;return{add:function(r){var n,a;0==e&&(t=Zd())&&(a=r,(n=t).styleSheet?n.styleSheet.cssText=a:n.appendChild(document.createTextNode(a)),function(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}(t)),e++},remove:function(){! --e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Jd=function(){var e,t=(e=qd(),function(t,r){a.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])});return function(e){var r=e.styles,n=e.dynamic;return t(r,n),null}},Yd={left:0,top:0,right:0,gap:0},Xd=function(e){return parseInt(e||"",10)||0},Qd=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return Yd;var t=function(e){var t=window.getComputedStyle(document.body),r=t["padding"===e?"paddingLeft":"marginLeft"],n=t["padding"===e?"paddingTop":"marginTop"],a=t["padding"===e?"paddingRight":"marginRight"];return[Xd(r),Xd(n),Xd(a)]}(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},ef=Jd(),tf="data-scroll-locked",rf=function(e,t,r,n){var a=e.left,o=e.top,s=e.right,i=e.gap;return void 0===r&&(r="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(n,";\n padding-right: ").concat(i,"px ").concat(n,";\n }\n body[").concat(tf,"] {\n overflow: hidden ").concat(n,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(n,";"),"margin"===r&&"\n padding-left: ".concat(a,"px;\n padding-top: ").concat(o,"px;\n padding-right: ").concat(s,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(i,"px ").concat(n,";\n "),"padding"===r&&"padding-right: ".concat(i,"px ").concat(n,";")].filter(Boolean).join(""),"\n }\n \n .").concat(Ld," {\n right: ").concat(i,"px ").concat(n,";\n }\n \n .").concat(Ud," {\n margin-right: ").concat(i,"px ").concat(n,";\n }\n \n .").concat(Ld," .").concat(Ld," {\n right: 0 ").concat(n,";\n }\n \n .").concat(Ud," .").concat(Ud," {\n margin-right: 0 ").concat(n,";\n }\n \n body[").concat(tf,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(i,"px;\n }\n")},nf=function(){var e=parseInt(document.body.getAttribute(tf)||"0",10);return isFinite(e)?e:0},af=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,o=void 0===n?"margin":n;a.useEffect(function(){return document.body.setAttribute(tf,(nf()+1).toString()),function(){var e=nf()-1;e<=0?document.body.removeAttribute(tf):document.body.setAttribute(tf,e.toString())}},[]);var s=a.useMemo(function(){return Qd(o)},[o]);return a.createElement(ef,{styles:rf(s,!t,o,r?"":"!important")})},of=!1;if("undefined"!=typeof window)try{var sf=Object.defineProperty({},"passive",{get:function(){return of=!0,!0}});window.addEventListener("test",sf,sf),window.removeEventListener("test",sf,sf)}catch(e){of=!1}var lf=!!of&&{passive:!1},cf=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return"hidden"!==r[t]&&!(r.overflowY===r.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===r[t])},uf=function(e,t){var r=t.ownerDocument,n=t;do{if("undefined"!=typeof ShadowRoot&&n instanceof ShadowRoot&&(n=n.host),df(e,n)){var a=ff(e,n);if(a[1]>a[2])return!0}n=n.parentNode}while(n&&n!==r.body);return!1},df=function(e,t){return"v"===e?function(e){return cf(e,"overflowY")}(t):function(e){return cf(e,"overflowX")}(t)},ff=function(e,t){return"v"===e?[(r=t).scrollTop,r.scrollHeight,r.clientHeight]:function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t);var r},mf=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},pf=function(e){return[e.deltaX,e.deltaY]},hf=function(e){return e&&"current"in e?e.current:e},gf=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},vf=0,bf=[];function yf(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var wf,xf=(wf=function(e){var t=a.useRef([]),r=a.useRef([0,0]),n=a.useRef(),o=a.useState(vf++)[0],s=a.useState(Jd)[0],i=a.useRef(e);a.useEffect(function(){i.current=e},[e]),a.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var t=function(e,t,r){if(r||2===arguments.length)for(var n,a=0,o=t.length;a<o;a++)!n&&a in t||(n||(n=Array.prototype.slice.call(t,0,a)),n[a]=t[a]);return e.concat(n||Array.prototype.slice.call(t))}([e.lockRef.current],(e.shards||[]).map(hf),!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 l=a.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!i.current.allowPinchZoom;var a,o=mf(e),s=r.current,l="deltaX"in e?e.deltaX:s[0]-o[0],c="deltaY"in e?e.deltaY:s[1]-o[1],u=e.target,d=Math.abs(l)>Math.abs(c)?"h":"v";if("touches"in e&&"h"===d&&"range"===u.type)return!1;var f=uf(d,u);if(!f)return!0;if(f?a=d:(a="v"===d?"h":"v",f=uf(d,u)),!f)return!1;if(!n.current&&"changedTouches"in e&&(l||c)&&(n.current=a),!a)return!0;var m=n.current||a;return function(e,t,r,n){var a=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),o=a*n,s=r.target,i=t.contains(s),l=!1,c=o>0,u=0,d=0;do{if(!s)break;var f=ff(e,s),m=f[0],p=f[1]-f[2]-a*m;(m||p)&&df(e,s)&&(u+=p,d+=m);var h=s.parentNode;s=h&&h.nodeType===Node.DOCUMENT_FRAGMENT_NODE?h.host:h}while(!i&&s!==document.body||i&&(t.contains(s)||t===s));return(c&&Math.abs(u)<1||!c&&Math.abs(d)<1)&&(l=!0),l}(m,t,e,"h"===m?l:c)},[]),c=a.useCallback(function(e){var r=e;if(bf.length&&bf[bf.length-1]===s){var n="deltaY"in r?pf(r):mf(r),a=t.current.filter(function(e){return e.name===r.type&&(e.target===r.target||r.target===e.shadowParent)&&(t=e.delta,a=n,t[0]===a[0]&&t[1]===a[1]);var t,a})[0];if(a&&a.should)r.cancelable&&r.preventDefault();else if(!a){var o=(i.current.shards||[]).map(hf).filter(Boolean).filter(function(e){return e.contains(r.target)});(o.length>0?l(r,o[0]):!i.current.noIsolation)&&r.cancelable&&r.preventDefault()}}},[]),u=a.useCallback(function(e,r,n,a){var o={name:e,delta:r,target:n,should:a,shadowParent:yf(n)};t.current.push(o),setTimeout(function(){t.current=t.current.filter(function(e){return e!==o})},1)},[]),d=a.useCallback(function(e){r.current=mf(e),n.current=void 0},[]),f=a.useCallback(function(t){u(t.type,pf(t),t.target,l(t,e.lockRef.current))},[]),m=a.useCallback(function(t){u(t.type,mf(t),t.target,l(t,e.lockRef.current))},[]);a.useEffect(function(){return bf.push(s),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:m}),document.addEventListener("wheel",c,lf),document.addEventListener("touchmove",c,lf),document.addEventListener("touchstart",d,lf),function(){bf=bf.filter(function(e){return e!==s}),document.removeEventListener("wheel",c,lf),document.removeEventListener("touchmove",c,lf),document.removeEventListener("touchstart",d,lf)}},[]);var p=e.removeScrollBar,h=e.inert;return a.createElement(a.Fragment,null,h?a.createElement(s,{styles:gf(o)}):null,p?a.createElement(af,{noRelative:e.noRelative,gapMode:e.gapMode}):null)},Gd.useMedium(wf),Wd),Sf=a.forwardRef(function(e,t){return a.createElement(Hd,Id({},e,{ref:t,sideCar:xf}))});Sf.classNames=Hd.classNames;var kf=new WeakMap,Af=new WeakMap,Ef={},Cf=0,Tf=function(e){return e&&(e.host||Tf(e.parentNode))},jf=function(e,t,r,n){var a=function(e,t){return t.map(function(t){if(e.contains(t))return t;var r=Tf(t);return r&&e.contains(r)?r:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)}).filter(function(e){return Boolean(e)})}(t,Array.isArray(e)?e:[e]);Ef[r]||(Ef[r]=new WeakMap);var o=Ef[r],s=[],i=new Set,l=new Set(a),c=function(e){e&&!i.has(e)&&(i.add(e),c(e.parentNode))};a.forEach(c);var u=function(e){e&&!l.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(i.has(e))u(e);else try{var t=e.getAttribute(n),a=null!==t&&"false"!==t,l=(kf.get(e)||0)+1,c=(o.get(e)||0)+1;kf.set(e,l),o.set(e,c),s.push(e),1===l&&a&&Af.set(e,!0),1===c&&e.setAttribute(r,"true"),a||e.setAttribute(n,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}})};return u(t),i.clear(),Cf++,function(){s.forEach(function(e){var t=kf.get(e)-1,a=o.get(e)-1;kf.set(e,t),o.set(e,a),t||(Af.has(e)||e.removeAttribute(n),Af.delete(e)),a||e.removeAttribute(r)}),--Cf||(kf=new WeakMap,kf=new WeakMap,Af=new WeakMap,Ef={})}},_f=function(e,t,r){void 0===r&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),a=function(e){return"undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body}(e);return a?(n.push.apply(n,Array.from(a.querySelectorAll("[aria-live], script"))),jf(n,a,r,"aria-hidden")):function(){return null}},Nf="Dialog",[Rf,Pf]=Tu(Nf),[Of,Df]=Rf(Nf),If=t=>{const{__scopeDialog:r,children:n,open:o,defaultOpen:s,onOpenChange:i,modal:l=!0}=t,c=a.useRef(null),u=a.useRef(null),[d,f]=ud({prop:o,defaultProp:s??!1,onChange:i,caller:Nf});return e.jsx(Of,{scope:r,triggerRef:c,contentRef:u,contentId:ld(),titleId:ld(),descriptionId:ld(),open:d,onOpenChange:f,onOpenToggle:a.useCallback(()=>f(e=>!e),[f]),modal:l,children:n})};If.displayName=Nf;var Mf="DialogTrigger",Lf=a.forwardRef((t,r)=>{const{__scopeDialog:n,...a}=t,o=Df(Mf,n),s=Bo(r,o.triggerRef);return e.jsx(ys.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":nm(o.open),...a,ref:s,onClick:od(t.onClick,o.onOpenToggle)})});Lf.displayName=Mf;var Uf="DialogPortal",[zf,Ff]=Rf(Uf,{forceMount:void 0}),Bf=t=>{const{__scopeDialog:r,forceMount:n,children:o,container:s}=t,i=Df(Uf,r);return e.jsx(zf,{scope:r,forceMount:n,children:a.Children.map(o,t=>e.jsx(Nd,{present:n||i.open,children:e.jsx(_d,{asChild:!0,container:s,children:t})}))})};Bf.displayName=Uf;var Vf="DialogOverlay",$f=a.forwardRef((t,r)=>{const n=Ff(Vf,t.__scopeDialog),{forceMount:a=n.forceMount,...o}=t,s=Df(Vf,t.__scopeDialog);return s.modal?e.jsx(Nd,{present:a||s.open,children:e.jsx(Gf,{...o,ref:r})}):null});$f.displayName=Vf;var Wf=Vo("DialogOverlay.RemoveScroll"),Gf=a.forwardRef((t,r)=>{const{__scopeDialog:n,...a}=t,o=Df(Vf,n);return e.jsx(Sf,{as:Wf,allowPinchZoom:!0,shards:[o.contentRef],children:e.jsx(ys.div,{"data-state":nm(o.open),...a,ref:r,style:{pointerEvents:"auto",...a.style}})})}),Kf="DialogContent",Hf=a.forwardRef((t,r)=>{const n=Ff(Kf,t.__scopeDialog),{forceMount:a=n.forceMount,...o}=t,s=Df(Kf,t.__scopeDialog);return e.jsx(Nd,{present:a||s.open,children:s.modal?e.jsx(Zf,{...o,ref:r}):e.jsx(qf,{...o,ref:r})})});Hf.displayName=Kf;var Zf=a.forwardRef((t,r)=>{const n=Df(Kf,t.__scopeDialog),o=a.useRef(null),s=Bo(r,n.contentRef,o);return a.useEffect(()=>{const e=o.current;if(e)return _f(e)},[]),e.jsx(Jf,{...t,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:od(t.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:od(t.onPointerDownOutside,e=>{const t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;(2===t.button||r)&&e.preventDefault()}),onFocusOutside:od(t.onFocusOutside,e=>e.preventDefault())})}),qf=a.forwardRef((t,r)=>{const n=Df(Kf,t.__scopeDialog),o=a.useRef(!1),s=a.useRef(!1);return e.jsx(Jf,{...t,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:e=>{t.onCloseAutoFocus?.(e),e.defaultPrevented||(o.current||n.triggerRef.current?.focus(),e.preventDefault()),o.current=!1,s.current=!1},onInteractOutside:e=>{t.onInteractOutside?.(e),e.defaultPrevented||(o.current=!0,"pointerdown"===e.detail.originalEvent.type&&(s.current=!0));const r=e.target,a=n.triggerRef.current?.contains(r);a&&e.preventDefault(),"focusin"===e.detail.originalEvent.type&&s.current&&e.preventDefault()}})}),Jf=a.forwardRef((t,r)=>{const{__scopeDialog:n,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:i,...l}=t,c=Df(Kf,n),u=a.useRef(null),d=Bo(r,u);return Od(),e.jsxs(e.Fragment,{children:[e.jsx(Sd,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:s,onUnmountAutoFocus:i,children:e.jsx(gd,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":nm(c.open),...l,ref:d,onDismiss:()=>c.onOpenChange(!1)})}),e.jsxs(e.Fragment,{children:[e.jsx(im,{titleId:c.titleId}),e.jsx(lm,{contentRef:u,descriptionId:c.descriptionId})]})]})}),Yf="DialogTitle",Xf=a.forwardRef((t,r)=>{const{__scopeDialog:n,...a}=t,o=Df(Yf,n);return e.jsx(ys.h2,{id:o.titleId,...a,ref:r})});Xf.displayName=Yf;var Qf="DialogDescription",em=a.forwardRef((t,r)=>{const{__scopeDialog:n,...a}=t,o=Df(Qf,n);return e.jsx(ys.p,{id:o.descriptionId,...a,ref:r})});em.displayName=Qf;var tm="DialogClose",rm=a.forwardRef((t,r)=>{const{__scopeDialog:n,...a}=t,o=Df(tm,n);return e.jsx(ys.button,{type:"button",...a,ref:r,onClick:od(t.onClick,()=>o.onOpenChange(!1))})});function nm(e){return e?"open":"closed"}rm.displayName=tm;var am="DialogTitleWarning",[om,sm]=function(t,r){const n=a.createContext(r),o=t=>{const{children:r,...o}=t,s=a.useMemo(()=>o,Object.values(o));return e.jsx(n.Provider,{value:s,children:r})};return o.displayName=t+"Provider",[o,function(e){const o=a.useContext(n);if(o)return o;if(void 0!==r)return r;throw new Error(`\`${e}\` must be used within \`${t}\``)}]}(am,{contentName:Kf,titleName:Yf,docsSlug:"dialog"}),im=({titleId:e})=>{const t=sm(am),r=`\`${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 a.useEffect(()=>{if(e){document.getElementById(e)||console.error(r)}},[r,e]),null},lm=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${sm("DialogDescriptionWarning").contentName}}.`;return a.useEffect(()=>{const n=e.current?.getAttribute("aria-describedby");if(t&&n){document.getElementById(t)||console.warn(r)}},[r,e,t]),null},cm=If,um=Lf,dm=Bf,fm=$f,mm=Hf,pm=Xf,hm=em,gm=rm;function vm(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}var bm=["color"],ym=t.forwardRef(function(e,r){var n=e.color,a=void 0===n?"currentColor":n,o=vm(e,bm);return t.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:r}),t.createElement("path",{d:"M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))}),wm=["color"],xm=t.forwardRef(function(e,r){var n=e.color,a=void 0===n?"currentColor":n,o=vm(e,wm);return t.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:r}),t.createElement("path",{d:"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))}),Sm=["color"],km=t.forwardRef(function(e,r){var n=e.color,a=void 0===n?"currentColor":n,o=vm(e,Sm);return t.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:r}),t.createElement("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))}),Am=["color"],Em=t.forwardRef(function(e,r){var n=e.color,a=void 0===n?"currentColor":n,o=vm(e,Am);return t.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:r}),t.createElement("path",{d:"M10 6.5C10 8.433 8.433 10 6.5 10C4.567 10 3 8.433 3 6.5C3 4.567 4.567 3 6.5 3C8.433 3 10 4.567 10 6.5ZM9.30884 10.0159C8.53901 10.6318 7.56251 11 6.5 11C4.01472 11 2 8.98528 2 6.5C2 4.01472 4.01472 2 6.5 2C8.98528 2 11 4.01472 11 6.5C11 7.56251 10.6318 8.53901 10.0159 9.30884L12.8536 12.1464C13.0488 12.3417 13.0488 12.6583 12.8536 12.8536C12.6583 13.0488 12.3417 13.0488 12.1464 12.8536L9.30884 10.0159Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))});const Cm=cm,Tm=um,jm=dm,_m=a.forwardRef(({className:t,...r},n)=>e.jsx(fm,{ref:n,className:Uo("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...r}));_m.displayName=fm.displayName;const Nm=a.forwardRef(({className:t,children:r,...n},o)=>{const{container:s}=a.useContext(ee);return e.jsxs(jm,{container:s,children:[e.jsx(_m,{}),e.jsxs(mm,{ref:o,className:Uo("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg md:w-full",t),...n,children:[r,e.jsxs(gm,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[e.jsx(km,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]})});Nm.displayName=mm.displayName;const Rm=({className:t,...r})=>e.jsx("div",{className:Uo("flex flex-col space-y-1.5 text-center sm:text-left",t),...r});Rm.displayName="DialogHeader";const Pm=a.forwardRef(({className:t,...r},n)=>e.jsx(pm,{ref:n,className:Uo("text-lg font-semibold leading-none tracking-tight",t),...r}));Pm.displayName=pm.displayName;const Om=a.forwardRef(({className:t,...r},n)=>e.jsx(hm,{ref:n,className:Uo("text-sm text-muted-foreground",t),...r}));function Dm(r){const n=r+"CollectionProvider",[a,o]=Tu(n),[s,i]=a(n,{collectionRef:{current:null},itemMap:new Map}),l=r=>{const{scope:n,children:a}=r,o=t.useRef(null),i=t.useRef(new Map).current;return e.jsx(s,{scope:n,itemMap:i,collectionRef:o,children:a})};l.displayName=n;const c=r+"CollectionSlot",u=Vo(c),d=t.forwardRef((t,r)=>{const{scope:n,children:a}=t,o=Bo(r,i(c,n).collectionRef);return e.jsx(u,{ref:o,children:a})});d.displayName=c;const f=r+"CollectionItemSlot",m="data-radix-collection-item",p=Vo(f),h=t.forwardRef((r,n)=>{const{scope:a,children:o,...s}=r,l=t.useRef(null),c=Bo(n,l),u=i(f,a);return t.useEffect(()=>(u.itemMap.set(l,{ref:l,...s}),()=>{u.itemMap.delete(l)})),e.jsx(p,{[m]:"",ref:c,children:o})});return h.displayName=f,[{Provider:l,Slot:d,ItemSlot:h},function(e){const n=i(r+"CollectionConsumer",e),a=t.useCallback(()=>{const e=n.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${m}]`)),r=Array.from(n.itemMap.values()).sort((e,r)=>t.indexOf(e.ref.current)-t.indexOf(r.ref.current));return r},[n.collectionRef,n.itemMap]);return a},o]}Om.displayName=hm.displayName;var Im=a.createContext(void 0);function Mm(e){const t=a.useContext(Im);return e||t||"ltr"}var Lm="rovingFocusGroup.onEntryFocus",Um={bubbles:!1,cancelable:!0},zm="RovingFocusGroup",[Fm,Bm,Vm]=Dm(zm),[$m,Wm]=Tu(zm,[Vm]),[Gm,Km]=$m(zm),Hm=a.forwardRef((t,r)=>e.jsx(Fm.Provider,{scope:t.__scopeRovingFocusGroup,children:e.jsx(Fm.Slot,{scope:t.__scopeRovingFocusGroup,children:e.jsx(Zm,{...t,ref:r})})}));Hm.displayName=zm;var Zm=a.forwardRef((t,r)=>{const{__scopeRovingFocusGroup:n,orientation:o,loop:s=!1,dir:i,currentTabStopId:l,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:f=!1,...m}=t,p=a.useRef(null),h=Bo(r,p),g=Mm(i),[v,b]=ud({prop:l,defaultProp:c??null,onChange:u,caller:zm}),[y,w]=a.useState(!1),x=_u(d),S=Bm(n),k=a.useRef(!1),[A,E]=a.useState(0);return a.useEffect(()=>{const e=p.current;if(e)return e.addEventListener(Lm,x),()=>e.removeEventListener(Lm,x)},[x]),e.jsx(Gm,{scope:n,orientation:o,dir:g,loop:s,currentTabStopId:v,onItemFocus:a.useCallback(e=>b(e),[b]),onItemShiftTab:a.useCallback(()=>w(!0),[]),onFocusableItemAdd:a.useCallback(()=>E(e=>e+1),[]),onFocusableItemRemove:a.useCallback(()=>E(e=>e-1),[]),children:e.jsx(ys.div,{tabIndex:y||0===A?-1:0,"data-orientation":o,...m,ref:h,style:{outline:"none",...t.style},onMouseDown:od(t.onMouseDown,()=>{k.current=!0}),onFocus:od(t.onFocus,e=>{const t=!k.current;if(e.target===e.currentTarget&&t&&!y){const t=new CustomEvent(Lm,Um);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=S().filter(e=>e.focusable);Xm([e.find(e=>e.active),e.find(e=>e.id===v),...e].filter(Boolean).map(e=>e.ref.current),f)}}k.current=!1}),onBlur:od(t.onBlur,()=>w(!1))})})}),qm="RovingFocusGroupItem",Jm=a.forwardRef((t,r)=>{const{__scopeRovingFocusGroup:n,focusable:o=!0,active:s=!1,tabStopId:i,children:l,...c}=t,u=ld(),d=i||u,f=Km(qm,n),m=f.currentTabStopId===d,p=Bm(n),{onFocusableItemAdd:h,onFocusableItemRemove:g,currentTabStopId:v}=f;return a.useEffect(()=>{if(o)return h(),()=>g()},[o,h,g]),e.jsx(Fm.ItemSlot,{scope:n,id:d,focusable:o,active:s,children:e.jsx(ys.span,{tabIndex:m?0:-1,"data-orientation":f.orientation,...c,ref:r,onMouseDown:od(t.onMouseDown,e=>{o?f.onItemFocus(d):e.preventDefault()}),onFocus:od(t.onFocus,()=>f.onItemFocus(d)),onKeyDown:od(t.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void f.onItemShiftTab();if(e.target!==e.currentTarget)return;const t=function(e,t,r){const n=function(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,r);return"vertical"===t&&["ArrowLeft","ArrowRight"].includes(n)||"horizontal"===t&&["ArrowUp","ArrowDown"].includes(n)?void 0:Ym[n]}(e,f.orientation,f.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let r=p().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)r.reverse();else if("prev"===t||"next"===t){"prev"===t&&r.reverse();const n=r.indexOf(e.currentTarget);r=f.loop?function(e,t){return e.map((r,n)=>e[(t+n)%e.length])}(r,n+1):r.slice(n+1)}setTimeout(()=>Xm(r))}}),children:"function"==typeof l?l({isCurrentTabStop:m,hasTabStop:null!=v}):l})})});Jm.displayName=qm;var Ym={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Xm(e,t=!1){const r=document.activeElement;for(const n of e){if(n===r)return;if(n.focus({preventScroll:t}),document.activeElement!==r)return}}var Qm=Hm,ep=Jm;function tp(e){const[t,r]=a.useState(void 0);return Ru(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver(t=>{if(!Array.isArray(t))return;if(!t.length)return;const n=t[0];let a,o;if("borderBoxSize"in n){const e=n.borderBoxSize,t=Array.isArray(e)?e[0]:e;a=t.inlineSize,o=t.blockSize}else a=e.offsetWidth,o=e.offsetHeight;r({width:a,height:o})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}r(void 0)},[e]),t}function rp(e){const t=a.useRef({value:e,previous:e});return a.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var np="Radio",[ap,op]=Tu(np),[sp,ip]=ap(np),lp=a.forwardRef((t,r)=>{const{__scopeRadio:n,name:o,checked:s=!1,required:i,disabled:l,value:c="on",onCheck:u,form:d,...f}=t,[m,p]=a.useState(null),h=Bo(r,e=>p(e)),g=a.useRef(!1),v=!m||(d||!!m.closest("form"));return e.jsxs(sp,{scope:n,checked:s,disabled:l,children:[e.jsx(ys.button,{type:"button",role:"radio","aria-checked":s,"data-state":fp(s),"data-disabled":l?"":void 0,disabled:l,value:c,...f,ref:h,onClick:od(t.onClick,e=>{s||u?.(),v&&(g.current=e.isPropagationStopped(),g.current||e.stopPropagation())})}),v&&e.jsx(dp,{control:m,bubbles:!g.current,name:o,value:c,checked:s,required:i,disabled:l,form:d,style:{transform:"translateX(-100%)"}})]})});lp.displayName=np;var cp="RadioIndicator",up=a.forwardRef((t,r)=>{const{__scopeRadio:n,forceMount:a,...o}=t,s=ip(cp,n);return e.jsx(Nd,{present:a||s.checked,children:e.jsx(ys.span,{"data-state":fp(s.checked),"data-disabled":s.disabled?"":void 0,...o,ref:r})})});up.displayName=cp;var dp=a.forwardRef(({__scopeRadio:t,control:r,checked:n,bubbles:o=!0,...s},i)=>{const l=a.useRef(null),c=Bo(l,i),u=rp(n),d=tp(r);return a.useEffect(()=>{const e=l.current;if(!e)return;const t=window.HTMLInputElement.prototype,r=Object.getOwnPropertyDescriptor(t,"checked").set;if(u!==n&&r){const t=new Event("click",{bubbles:o});r.call(e,n),e.dispatchEvent(t)}},[u,n,o]),e.jsx(ys.input,{type:"radio","aria-hidden":!0,defaultChecked:n,...s,tabIndex:-1,ref:c,style:{...s.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function fp(e){return e?"checked":"unchecked"}dp.displayName="RadioBubbleInput";var mp=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],pp="RadioGroup",[hp,gp]=Tu(pp,[Wm,op]),vp=Wm(),bp=op(),[yp,wp]=hp(pp),xp=a.forwardRef((t,r)=>{const{__scopeRadioGroup:n,name:a,defaultValue:o,value:s,required:i=!1,disabled:l=!1,orientation:c,dir:u,loop:d=!0,onValueChange:f,...m}=t,p=vp(n),h=Mm(u),[g,v]=ud({prop:s,defaultProp:o??null,onChange:f,caller:pp});return e.jsx(yp,{scope:n,name:a,required:i,disabled:l,value:g,onValueChange:v,children:e.jsx(Qm,{asChild:!0,...p,orientation:c,dir:h,loop:d,children:e.jsx(ys.div,{role:"radiogroup","aria-required":i,"aria-orientation":c,"data-disabled":l?"":void 0,dir:h,...m,ref:r})})})});xp.displayName=pp;var Sp="RadioGroupItem",kp=a.forwardRef((t,r)=>{const{__scopeRadioGroup:n,disabled:o,...s}=t,i=wp(Sp,n),l=i.disabled||o,c=vp(n),u=bp(n),d=a.useRef(null),f=Bo(r,d),m=i.value===s.value,p=a.useRef(!1);return a.useEffect(()=>{const e=e=>{mp.includes(e.key)&&(p.current=!0)},t=()=>p.current=!1;return document.addEventListener("keydown",e),document.addEventListener("keyup",t),()=>{document.removeEventListener("keydown",e),document.removeEventListener("keyup",t)}},[]),e.jsx(ep,{asChild:!0,...c,focusable:!l,active:m,children:e.jsx(lp,{disabled:l,required:i.required,checked:m,...u,...s,name:i.name,ref:f,onCheck:()=>i.onValueChange(s.value),onKeyDown:od(e=>{"Enter"===e.key&&e.preventDefault()}),onFocus:od(s.onFocus,()=>{p.current&&d.current?.click()})})})});kp.displayName=Sp;var Ap=a.forwardRef((t,r)=>{const{__scopeRadioGroup:n,...a}=t,o=bp(n);return e.jsx(up,{...o,...a,ref:r})});Ap.displayName="RadioGroupIndicator";var Ep=xp,Cp=kp,Tp=Ap;const jp=a.forwardRef(({className:t,...r},n)=>e.jsx(Ep,{className:Uo("grid gap-2",t),...r,ref:n}));jp.displayName=Ep.displayName;const _p=a.forwardRef(({className:t,...r},n)=>e.jsx(Cp,{ref:n,className:Uo("aspect-square h-4 w-4 rounded-full border border-primary text-primary shadow focus:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",t),...r,children:e.jsx(Tp,{className:"flex items-center justify-center",children:e.jsx(xm,{className:"h-3.5 w-3.5 fill-primary"})})}));function Np(e,[t,r]){return Math.min(r,Math.max(t,e))}_p.displayName=Cp.displayName;var Rp="ScrollArea",[Pp,Op]=Tu(Rp),[Dp,Ip]=Pp(Rp),Mp=a.forwardRef((t,r)=>{const{__scopeScrollArea:n,type:o="hover",dir:s,scrollHideDelay:i=600,...l}=t,[c,u]=a.useState(null),[d,f]=a.useState(null),[m,p]=a.useState(null),[h,g]=a.useState(null),[v,b]=a.useState(null),[y,w]=a.useState(0),[x,S]=a.useState(0),[k,A]=a.useState(!1),[E,C]=a.useState(!1),T=Bo(r,e=>u(e)),j=Mm(s);return e.jsx(Dp,{scope:n,type:o,dir:j,scrollHideDelay:i,scrollArea:c,viewport:d,onViewportChange:f,content:m,onContentChange:p,scrollbarX:h,onScrollbarXChange:g,scrollbarXEnabled:k,onScrollbarXEnabledChange:A,scrollbarY:v,onScrollbarYChange:b,scrollbarYEnabled:E,onScrollbarYEnabledChange:C,onCornerWidthChange:w,onCornerHeightChange:S,children:e.jsx(ys.div,{dir:j,...l,ref:T,style:{position:"relative","--radix-scroll-area-corner-width":y+"px","--radix-scroll-area-corner-height":x+"px",...t.style}})})});Mp.displayName=Rp;var Lp="ScrollAreaViewport",Up=a.forwardRef((t,r)=>{const{__scopeScrollArea:n,children:o,nonce:s,...i}=t,l=Ip(Lp,n),c=Bo(r,a.useRef(null),l.onViewportChange);return e.jsxs(e.Fragment,{children:[e.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),e.jsx(ys.div,{"data-radix-scroll-area-viewport":"",...i,ref:c,style:{overflowX:l.scrollbarXEnabled?"scroll":"hidden",overflowY:l.scrollbarYEnabled?"scroll":"hidden",...t.style},children:e.jsx("div",{ref:l.onContentChange,style:{minWidth:"100%",display:"table"},children:o})})]})});Up.displayName=Lp;var zp="ScrollAreaScrollbar",Fp=a.forwardRef((t,r)=>{const{forceMount:n,...o}=t,s=Ip(zp,t.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:l}=s,c="horizontal"===t.orientation;return a.useEffect(()=>(c?i(!0):l(!0),()=>{c?i(!1):l(!1)}),[c,i,l]),"hover"===s.type?e.jsx(Bp,{...o,ref:r,forceMount:n}):"scroll"===s.type?e.jsx(Vp,{...o,ref:r,forceMount:n}):"auto"===s.type?e.jsx($p,{...o,ref:r,forceMount:n}):"always"===s.type?e.jsx(Wp,{...o,ref:r}):null});Fp.displayName=zp;var Bp=a.forwardRef((t,r)=>{const{forceMount:n,...o}=t,s=Ip(zp,t.__scopeScrollArea),[i,l]=a.useState(!1);return a.useEffect(()=>{const e=s.scrollArea;let t=0;if(e){const r=()=>{window.clearTimeout(t),l(!0)},n=()=>{t=window.setTimeout(()=>l(!1),s.scrollHideDelay)};return e.addEventListener("pointerenter",r),e.addEventListener("pointerleave",n),()=>{window.clearTimeout(t),e.removeEventListener("pointerenter",r),e.removeEventListener("pointerleave",n)}}},[s.scrollArea,s.scrollHideDelay]),e.jsx(Nd,{present:n||i,children:e.jsx($p,{"data-state":i?"visible":"hidden",...o,ref:r})})}),Vp=a.forwardRef((t,r)=>{const{forceMount:n,...o}=t,s=Ip(zp,t.__scopeScrollArea),i="horizontal"===t.orientation,l=ch(()=>u("SCROLL_END"),100),[c,u]=(d="hidden",f={hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}},a.useReducer((e,t)=>f[e][t]??e,d));var d,f;return a.useEffect(()=>{if("idle"===c){const e=window.setTimeout(()=>u("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(e)}},[c,s.scrollHideDelay,u]),a.useEffect(()=>{const e=s.viewport,t=i?"scrollLeft":"scrollTop";if(e){let r=e[t];const n=()=>{const n=e[t];r!==n&&(u("SCROLL"),l()),r=n};return e.addEventListener("scroll",n),()=>e.removeEventListener("scroll",n)}},[s.viewport,i,u,l]),e.jsx(Nd,{present:n||"hidden"!==c,children:e.jsx(Wp,{"data-state":"hidden"===c?"hidden":"visible",...o,ref:r,onPointerEnter:od(t.onPointerEnter,()=>u("POINTER_ENTER")),onPointerLeave:od(t.onPointerLeave,()=>u("POINTER_LEAVE"))})})}),$p=a.forwardRef((t,r)=>{const n=Ip(zp,t.__scopeScrollArea),{forceMount:o,...s}=t,[i,l]=a.useState(!1),c="horizontal"===t.orientation,u=ch(()=>{if(n.viewport){const e=n.viewport.offsetWidth<n.viewport.scrollWidth,t=n.viewport.offsetHeight<n.viewport.scrollHeight;l(c?e:t)}},10);return uh(n.viewport,u),uh(n.content,u),e.jsx(Nd,{present:o||i,children:e.jsx(Wp,{"data-state":i?"visible":"hidden",...s,ref:r})})}),Wp=a.forwardRef((t,r)=>{const{orientation:n="vertical",...o}=t,s=Ip(zp,t.__scopeScrollArea),i=a.useRef(null),l=a.useRef(0),[c,u]=a.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=nh(c.viewport,c.content),f={...o,sizes:c,onSizesChange:u,hasThumb:Boolean(d>0&&d<1),onThumbChange:e=>i.current=e,onThumbPointerUp:()=>l.current=0,onThumbPointerDown:e=>l.current=e};function m(e,t){return function(e,t,r,n="ltr"){const a=ah(r),o=a/2,s=t||o,i=a-s,l=r.scrollbar.paddingStart+s,c=r.scrollbar.size-r.scrollbar.paddingEnd-i,u=r.content-r.viewport,d="ltr"===n?[0,u]:[-1*u,0];return sh([l,c],d)(e)}(e,l.current,c,t)}return"horizontal"===n?e.jsx(Gp,{...f,ref:r,onThumbPositionChange:()=>{if(s.viewport&&i.current){const e=oh(s.viewport.scrollLeft,c,s.dir);i.current.style.transform=`translate3d(${e}px, 0, 0)`}},onWheelScroll:e=>{s.viewport&&(s.viewport.scrollLeft=e)},onDragScroll:e=>{s.viewport&&(s.viewport.scrollLeft=m(e,s.dir))}}):"vertical"===n?e.jsx(Kp,{...f,ref:r,onThumbPositionChange:()=>{if(s.viewport&&i.current){const e=oh(s.viewport.scrollTop,c);i.current.style.transform=`translate3d(0, ${e}px, 0)`}},onWheelScroll:e=>{s.viewport&&(s.viewport.scrollTop=e)},onDragScroll:e=>{s.viewport&&(s.viewport.scrollTop=m(e))}}):null}),Gp=a.forwardRef((t,r)=>{const{sizes:n,onSizesChange:o,...s}=t,i=Ip(zp,t.__scopeScrollArea),[l,c]=a.useState(),u=a.useRef(null),d=Bo(r,u,i.onScrollbarXChange);return a.useEffect(()=>{u.current&&c(getComputedStyle(u.current))},[u]),e.jsx(qp,{"data-orientation":"horizontal",...s,ref:d,sizes:n,style:{bottom:0,left:"rtl"===i.dir?"var(--radix-scroll-area-corner-width)":0,right:"ltr"===i.dir?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":ah(n)+"px",...t.style},onThumbPointerDown:e=>t.onThumbPointerDown(e.x),onDragScroll:e=>t.onDragScroll(e.x),onWheelScroll:(e,r)=>{if(i.viewport){const n=i.viewport.scrollLeft+e.deltaX;t.onWheelScroll(n),ih(n,r)&&e.preventDefault()}},onResize:()=>{u.current&&i.viewport&&l&&o({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:u.current.clientWidth,paddingStart:rh(l.paddingLeft),paddingEnd:rh(l.paddingRight)}})}})}),Kp=a.forwardRef((t,r)=>{const{sizes:n,onSizesChange:o,...s}=t,i=Ip(zp,t.__scopeScrollArea),[l,c]=a.useState(),u=a.useRef(null),d=Bo(r,u,i.onScrollbarYChange);return a.useEffect(()=>{u.current&&c(getComputedStyle(u.current))},[u]),e.jsx(qp,{"data-orientation":"vertical",...s,ref:d,sizes:n,style:{top:0,right:"ltr"===i.dir?0:void 0,left:"rtl"===i.dir?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":ah(n)+"px",...t.style},onThumbPointerDown:e=>t.onThumbPointerDown(e.y),onDragScroll:e=>t.onDragScroll(e.y),onWheelScroll:(e,r)=>{if(i.viewport){const n=i.viewport.scrollTop+e.deltaY;t.onWheelScroll(n),ih(n,r)&&e.preventDefault()}},onResize:()=>{u.current&&i.viewport&&l&&o({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:u.current.clientHeight,paddingStart:rh(l.paddingTop),paddingEnd:rh(l.paddingBottom)}})}})}),[Hp,Zp]=Pp(zp),qp=a.forwardRef((t,r)=>{const{__scopeScrollArea:n,sizes:o,hasThumb:s,onThumbChange:i,onThumbPointerUp:l,onThumbPointerDown:c,onThumbPositionChange:u,onDragScroll:d,onWheelScroll:f,onResize:m,...p}=t,h=Ip(zp,n),[g,v]=a.useState(null),b=Bo(r,e=>v(e)),y=a.useRef(null),w=a.useRef(""),x=h.viewport,S=o.content-o.viewport,k=_u(f),A=_u(u),E=ch(m,10);function C(e){if(y.current){const t=e.clientX-y.current.left,r=e.clientY-y.current.top;d({x:t,y:r})}}return a.useEffect(()=>{const e=e=>{const t=e.target,r=g?.contains(t);r&&k(e,S)};return document.addEventListener("wheel",e,{passive:!1}),()=>document.removeEventListener("wheel",e,{passive:!1})},[x,g,S,k]),a.useEffect(A,[o,A]),uh(g,E),uh(h.content,E),e.jsx(Hp,{scope:n,scrollbar:g,hasThumb:s,onThumbChange:_u(i),onThumbPointerUp:_u(l),onThumbPositionChange:A,onThumbPointerDown:_u(c),children:e.jsx(ys.div,{...p,ref:b,style:{position:"absolute",...p.style},onPointerDown:od(t.onPointerDown,e=>{if(0===e.button){e.target.setPointerCapture(e.pointerId),y.current=g.getBoundingClientRect(),w.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",h.viewport&&(h.viewport.style.scrollBehavior="auto"),C(e)}}),onPointerMove:od(t.onPointerMove,C),onPointerUp:od(t.onPointerUp,e=>{const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=w.current,h.viewport&&(h.viewport.style.scrollBehavior=""),y.current=null})})})}),Jp="ScrollAreaThumb",Yp=a.forwardRef((t,r)=>{const{forceMount:n,...a}=t,o=Zp(Jp,t.__scopeScrollArea);return e.jsx(Nd,{present:n||o.hasThumb,children:e.jsx(Xp,{ref:r,...a})})}),Xp=a.forwardRef((t,r)=>{const{__scopeScrollArea:n,style:o,...s}=t,i=Ip(Jp,n),l=Zp(Jp,n),{onThumbPositionChange:c}=l,u=Bo(r,e=>l.onThumbChange(e)),d=a.useRef(void 0),f=ch(()=>{d.current&&(d.current(),d.current=void 0)},100);return a.useEffect(()=>{const e=i.viewport;if(e){const t=()=>{if(f(),!d.current){const t=lh(e,c);d.current=t,c()}};return c(),e.addEventListener("scroll",t),()=>e.removeEventListener("scroll",t)}},[i.viewport,f,c]),e.jsx(ys.div,{"data-state":l.hasThumb?"visible":"hidden",...s,ref:u,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...o},onPointerDownCapture:od(t.onPointerDownCapture,e=>{const t=e.target.getBoundingClientRect(),r=e.clientX-t.left,n=e.clientY-t.top;l.onThumbPointerDown({x:r,y:n})}),onPointerUp:od(t.onPointerUp,l.onThumbPointerUp)})});Yp.displayName=Jp;var Qp="ScrollAreaCorner",eh=a.forwardRef((t,r)=>{const n=Ip(Qp,t.__scopeScrollArea),a=Boolean(n.scrollbarX&&n.scrollbarY);return"scroll"!==n.type&&a?e.jsx(th,{...t,ref:r}):null});eh.displayName=Qp;var th=a.forwardRef((t,r)=>{const{__scopeScrollArea:n,...o}=t,s=Ip(Qp,n),[i,l]=a.useState(0),[c,u]=a.useState(0),d=Boolean(i&&c);return uh(s.scrollbarX,()=>{const e=s.scrollbarX?.offsetHeight||0;s.onCornerHeightChange(e),u(e)}),uh(s.scrollbarY,()=>{const e=s.scrollbarY?.offsetWidth||0;s.onCornerWidthChange(e),l(e)}),d?e.jsx(ys.div,{...o,ref:r,style:{width:i,height:c,position:"absolute",right:"ltr"===s.dir?0:void 0,left:"rtl"===s.dir?0:void 0,bottom:0,...t.style}}):null});function rh(e){return e?parseInt(e,10):0}function nh(e,t){const r=e/t;return isNaN(r)?0:r}function ah(e){const t=nh(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*t;return Math.max(n,18)}function oh(e,t,r="ltr"){const n=ah(t),a=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-a,s=t.content-t.viewport,i=o-n,l=Np(e,"ltr"===r?[0,s]:[-1*s,0]);return sh([0,s],[0,i])(l)}function sh(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(r-e[0])}}function ih(e,t){return e>0&&e<t}var lh=(e,t=()=>{})=>{let r={left:e.scrollLeft,top:e.scrollTop},n=0;return function a(){const o={left:e.scrollLeft,top:e.scrollTop},s=r.left!==o.left,i=r.top!==o.top;(s||i)&&t(),r=o,n=window.requestAnimationFrame(a)}(),()=>window.cancelAnimationFrame(n)};function ch(e,t){const r=_u(e),n=a.useRef(0);return a.useEffect(()=>()=>window.clearTimeout(n.current),[]),a.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(r,t)},[r,t])}function uh(e,t){const r=_u(t);Ru(()=>{let t=0;if(e){const n=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(r)});return n.observe(e),()=>{window.cancelAnimationFrame(t),n.unobserve(e)}}},[e,r])}var dh=Mp,fh=Up,mh=eh;const ph=a.forwardRef(({className:t,children:r,...n},a)=>e.jsxs(dh,{ref:a,className:Uo("relative overflow-hidden",t),...n,children:[e.jsx(fh,{className:"h-full w-full rounded-[inherit]",children:r}),e.jsx(hh,{}),e.jsx(mh,{})]}));ph.displayName=dh.displayName;const hh=a.forwardRef(({className:t,orientation:r="vertical",...n},a)=>e.jsx(Fp,{ref:a,orientation:r,className:Uo("flex touch-none select-none transition-colors","vertical"===r&&"h-full w-2.5 border-l border-l-transparent p-[1px]","horizontal"===r&&"h-2.5 border-t border-t-transparent p-[1px]",t),...n,children:e.jsx(Yp,{className:Uo("relative rounded-full bg-border","vertical"===r&&"flex-1")})}));hh.displayName=Fp.displayName;var gh="horizontal",vh=["horizontal","vertical"],bh=a.forwardRef((t,r)=>{const{decorative:n,orientation:a=gh,...o}=t,s=function(e){return vh.includes(e)}(a)?a:gh,i=n?{role:"none"}:{"aria-orientation":"vertical"===s?s:void 0,role:"separator"};return e.jsx(ys.div,{"data-orientation":s,...i,...o,ref:r})});bh.displayName="Separator";var yh=bh;const wh=a.forwardRef(({className:t,orientation:r="horizontal",decorative:n=!0,...a},o)=>e.jsx(yh,{ref:o,decorative:n,orientation:r,className:Uo("shrink-0 bg-border","horizontal"===r?"h-[1px] w-full":"h-full w-[1px]",t),...a}));wh.displayName=yh.displayName;var xh="Switch",[Sh,kh]=Tu(xh),[Ah,Eh]=Sh(xh),Ch=a.forwardRef((t,r)=>{const{__scopeSwitch:n,name:o,checked:s,defaultChecked:i,required:l,disabled:c,value:u="on",onCheckedChange:d,form:f,...m}=t,[p,h]=a.useState(null),g=Bo(r,e=>h(e)),v=a.useRef(!1),b=!p||(f||!!p.closest("form")),[y,w]=ud({prop:s,defaultProp:i??!1,onChange:d,caller:xh});return e.jsxs(Ah,{scope:n,checked:y,disabled:c,children:[e.jsx(ys.button,{type:"button",role:"switch","aria-checked":y,"aria-required":l,"data-state":Nh(y),"data-disabled":c?"":void 0,disabled:c,value:u,...m,ref:g,onClick:od(t.onClick,e=>{w(e=>!e),b&&(v.current=e.isPropagationStopped(),v.current||e.stopPropagation())})}),b&&e.jsx(_h,{control:p,bubbles:!v.current,name:o,value:u,checked:y,required:l,disabled:c,form:f,style:{transform:"translateX(-100%)"}})]})});Ch.displayName=xh;var Th="SwitchThumb",jh=a.forwardRef((t,r)=>{const{__scopeSwitch:n,...a}=t,o=Eh(Th,n);return e.jsx(ys.span,{"data-state":Nh(o.checked),"data-disabled":o.disabled?"":void 0,...a,ref:r})});jh.displayName=Th;var _h=a.forwardRef(({__scopeSwitch:t,control:r,checked:n,bubbles:o=!0,...s},i)=>{const l=a.useRef(null),c=Bo(l,i),u=rp(n),d=tp(r);return a.useEffect(()=>{const e=l.current;if(!e)return;const t=window.HTMLInputElement.prototype,r=Object.getOwnPropertyDescriptor(t,"checked").set;if(u!==n&&r){const t=new Event("click",{bubbles:o});r.call(e,n),e.dispatchEvent(t)}},[u,n,o]),e.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...s,tabIndex:-1,ref:c,style:{...s.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function Nh(e){return e?"checked":"unchecked"}_h.displayName="SwitchBubbleInput";var Rh=Ch,Ph=jh;const Oh=a.forwardRef(({className:t,...r},n)=>e.jsx(Rh,{className:Uo("peer inline-flex h-[20px] w-[36px] shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",t),...r,ref:n,children:e.jsx(Ph,{className:Uo("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));function Dh(){return e.jsxs("div",{className:"space-y-3.5",children:[e.jsx(Is,{className:"h-10 w-full"}),e.jsx(Is,{className:"h-10 w-full"}),e.jsx(Is,{className:"h-10 w-full"})]})}Oh.displayName=Rh.displayName;const Ih=({workspaceId:r})=>{const[n,a]=t.useState({}),{allFeatures:o,updateFeature:s,getWorkspace:i}=nx(),[l,c]=t.useState(null),u=H(e=>e.auth.user);if(t.useEffect(()=>{i(r).then(c)},[r]),!l)return e.jsx(Dh,{});const d=l?.users.find(e=>("string"==typeof e?e:e._id)===u?.id)?.role,f="admin"===d?.toLowerCase();return e.jsx("div",{children:e.jsxs("div",{className:"flex flex-col gap-y-3.5 pr-4",children:[!f&&e.jsx("div",{className:"text-red-500",children:"Only workspace admin can change the features."}),!o.length&&e.jsx("div",{className:"text-muted-foreground",children:"Workspace has no features to manage."}),o.length>0&&e.jsx("div",{className:"flex flex-col gap-y-3.5",children:o.map(t=>{const r=l?.features?.[t.slug];return e.jsxs("div",{className:"flex items-center gap-x-2 justify-between w-full",children:[e.jsxs("div",{className:"flex gap-x-2 flex-col",children:[e.jsx("h3",{className:"font-medium text-ellipsis",children:t.name}),e.jsx("p",{className:"text-muted-foreground",children:t.description})]}),e.jsx(Oh,{disabled:n[t.slug]||!f,checked:r??t.defaultValue,onCheckedChange:e=>async function(e,t){if(!l)return;a(r=>({...r,[e]:t}));const r=await s(l._id,e,t);c(r),a(t=>({...t,[e]:!1}))}(t.slug,e)})]},t._id)})})]})})};function Mh(e){return`data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text x="50%" y="50%" dominant-baseline="middle" alignment-baseline="middle" text-anchor="middle" font-size="50" font-family="sans-serif">${e}</text></svg>`}const Lh=["🏢","🏬","🏣","🏤","🏦","🏛️","🏠","🏡","🏭","🏗️","🏪","🏨","🏫","🏥","💼","📊","📈","📉","📋","📁","📂","🗂️","🗃️","🗄️","📅","🗓️","📝","🖋️","✏️","🖊️","🖌️","🖍️","📇","📌","📍","📎","🖇️","💻","🖥️","🖨️","🖱️","⌨️","📱","📲","📡","🌐","🔗","🔒","🔓","⚙️","🔧","🛠️","🧑‍💻","👨‍💻","👩‍💻","🕹️","💾","📟","🖥️","🖲️","🚀","💡","🎨","🖼️","🧪","🔬","🧬","🎯","⚡","🎲","🎮","🧩","📷","🎥","✉️","📨","📩","📧","📞","☎️","📠","🗣️","💬","🗨️","📢","📣","🔔","🛎️","💰","💸","💳","🏦","📈","📉","⚖️","🧾","🪙","🏛️","⚗️","🧪","🔭","🔬","🩺","🧬","🩻","🏥","🌱","🌍","🌏","🌎","🌡️","👨‍💼","👩‍💼","👨‍🏫","👩‍🏫","👨‍🔬","👩‍🔬","👨‍🎨","👩‍🎨","👨‍🔧","👩‍🔧","👨‍🚀","👩‍🚀","👨‍⚖️","👩‍⚖️","🏅","🎖️","🥇","🥈","🥉","🏆","🎗️","🔑","🗝️","🧭","🛡️","🚩","🏳️‍🌈","🎟️","🎫"],Uh=({workspace:r})=>{const[n,a]=t.useState(!1),[o,s]=t.useState("emoji"),[i,l]=t.useState(),{updateWorkspace:c}=nx(),u=H(e=>e.auth.user),d=jt({resolver:ja(Di({name:ii().min(2,{message:"Workspace name must be at least 2 characters."}),image:ii().optional()})),defaultValues:{name:r.name||"",image:r.image||""}});if(!r)return e.jsx(Dh,{});const f=r?.users.find(e=>("object"==typeof e&&null!==e?e._id:e)===u?.id)?.role,m="admin"===f?.toLowerCase();return e.jsxs("div",{children:[!m&&e.jsx("div",{className:"text-red-500",children:"Only workspace admin can change the workspace settings."}),e.jsx(As,{...d,children:e.jsxs("form",{onSubmit:d.handleSubmit(async function(e){a(!0);try{await c(r,e)}catch(e){console.error("Failed to update workspace:",e)}finally{a(!1)}}),className:"space-y-6",children:[e.jsx(Cs,{control:d.control,name:"name",render:({field:t})=>e.jsxs(_s,{children:[e.jsx(Ns,{children:"Name"}),e.jsx(Rs,{children:e.jsx(Ds,{placeholder:"My Awesome Workspace",...t,disabled:!m})}),e.jsx(Os,{})]})}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(ks,{className:"text-sm font-medium",children:"Icon"}),e.jsx(Ps,{children:"Choose an emoji or upload a custom image for your workspace."})]}),e.jsxs(jp,{value:o,disabled:!m,onValueChange:e=>s(e),className:"flex flex-col space-y-3",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(_p,{value:"emoji",id:"emoji"}),e.jsxs(ks,{htmlFor:"emoji",className:"flex items-center gap-2",children:[e.jsx(fs,{className:"h-4 w-4"}),"Choose Emoji"]})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(_p,{value:"url",id:"url"}),e.jsxs(ks,{htmlFor:"url",className:"flex items-center gap-2",children:[e.jsx(ss,{className:"h-4 w-4"}),"Custom Image URL"]})]})]}),"emoji"===o&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm font-medium",children:"Preview:"}),e.jsxs("div",{className:"w-12 h-12 rounded-lg border-2 border-border flex items-center justify-center text-2xl bg-muted",children:[i&&e.jsx("span",{className:"text-2xl",children:i}),!i&&e.jsx("img",{src:d.watch("image")})]})]}),e.jsx(ph,{className:"h-32 w-full rounded-md border",children:e.jsx("div",{className:"p-4 grid grid-cols-8 gap-2",children:Lh.map((t,r)=>e.jsx("button",{type:"button",onClick:()=>(e=>{l(e),d.setValue("image",Mh(e))})(t),disabled:!m,className:"w-8 h-8 rounded flex items-center justify-center text-lg hover:bg-muted transition-colors "+(i===t?"bg-primary text-primary-foreground":""),children:t},r))})})]}),"url"===o&&e.jsxs("div",{className:"space-y-3",children:[e.jsx(Cs,{control:d.control,name:"image",render:({field:t})=>e.jsxs(_s,{children:[e.jsx(Ns,{children:"Image URL"}),e.jsx(Rs,{children:e.jsx(Ds,{placeholder:"https://example.com/image.png",...t,disabled:!m})}),e.jsx(Ps,{children:"Enter a valid URL for your workspace image. Supports PNG, JPG, and SVG formats."}),e.jsx(Os,{})]})}),d.watch("image")&&e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm font-medium",children:"Preview:"}),e.jsx("div",{className:"w-12 h-12 rounded-lg border-2 border-border overflow-hidden bg-muted",children:e.jsx("img",{src:d.watch("image"),className:"w-full h-full object-cover"})})]})]})]}),e.jsx("div",{className:"flex justify-end gap-3 pt-4",children:m&&e.jsx(bs,{type:"submit",disabled:n,progress:n,children:"Update Workspace"})})]})})]})};var zh=.999,Fh=/[\\\/_+.#"@\[\(\{&]/,Bh=/[\\\/_+.#"@\[\(\{&]/g,Vh=/[\s-]/,$h=/[\s-]/g;function Wh(e,t,r,n,a,o,s){if(o===t.length)return a===e.length?1:.99;var i=`${a},${o}`;if(void 0!==s[i])return s[i];for(var l,c,u,d,f=n.charAt(o),m=r.indexOf(f,a),p=0;m>=0;)(l=Wh(e,t,r,n,m+1,o+1,s))>p&&(m===a?l*=1:Fh.test(e.charAt(m-1))?(l*=.8,(u=e.slice(a,m-1).match(Bh))&&a>0&&(l*=Math.pow(zh,u.length))):Vh.test(e.charAt(m-1))?(l*=.9,(d=e.slice(a,m-1).match($h))&&a>0&&(l*=Math.pow(zh,d.length))):(l*=.17,a>0&&(l*=Math.pow(zh,m-a))),e.charAt(m)!==t.charAt(o)&&(l*=.9999)),(l<.1&&r.charAt(m-1)===n.charAt(o+1)||n.charAt(o+1)===n.charAt(o)&&r.charAt(m-1)!==n.charAt(o))&&(.1*(c=Wh(e,t,r,n,m+1,o+2,s))>l&&(l=.1*c)),l>p&&(p=l),m=r.indexOf(f,m+1);return s[i]=p,p}function Gh(e){return e.toLowerCase().replace($h," ")}function Kh(e,t,r){return Wh(e=r&&r.length>0?""+(e+" "+r.join(" ")):e,t,Gh(e),Gh(t),0,0,{})}var Hh='[cmdk-group=""]',Zh='[cmdk-group-items=""]',qh='[cmdk-item=""]',Jh=`${qh}:not([aria-disabled="true"])`,Yh="cmdk-item-select",Xh="data-value",Qh=(e,t,r)=>Kh(e,t,r),eg=a.createContext(void 0),tg=()=>a.useContext(eg),rg=a.createContext(void 0),ng=()=>a.useContext(rg),ag=a.createContext(void 0),og=a.forwardRef((e,t)=>{let r=yg(()=>{var t,r;return{search:"",value:null!=(r=null!=(t=e.value)?t:e.defaultValue)?r:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),n=yg(()=>new Set),o=yg(()=>new Map),s=yg(()=>new Map),i=yg(()=>new Set),l=vg(e),{label:c,children:u,value:d,onValueChange:f,filter:m,shouldFilter:p,loop:h,disablePointerSelection:g=!1,vimBindings:v=!0,...b}=e,y=ld(),w=ld(),x=ld(),S=a.useRef(null),k=Sg();bg(()=>{if(void 0!==d){let e=d.trim();r.current.value=e,A.emit()}},[d]),bg(()=>{k(6,N)},[]);let A=a.useMemo(()=>({subscribe:e=>(i.current.add(e),()=>i.current.delete(e)),snapshot:()=>r.current,setState:(e,t,n)=>{var a,o,s,i;if(!Object.is(r.current[e],t)){if(r.current[e]=t,"search"===e)_(),T(),k(1,j);else if("value"===e){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let e=document.getElementById(x);e?e.focus():null==(a=document.getElementById(y))||a.focus()}if(k(7,()=>{var e;r.current.selectedItemId=null==(e=R())?void 0:e.id,A.emit()}),n||k(5,N),void 0!==(null==(o=l.current)?void 0:o.value)){let e=null!=t?t:"";return void(null==(i=(s=l.current).onValueChange)||i.call(s,e))}}A.emit()}},emit:()=>{i.current.forEach(e=>e())}}),[]),E=a.useMemo(()=>({value:(e,t,n)=>{var a;t!==(null==(a=s.current.get(e))?void 0:a.value)&&(s.current.set(e,{value:t,keywords:n}),r.current.filtered.items.set(e,C(t,n)),k(2,()=>{T(),A.emit()}))},item:(e,t)=>(n.current.add(e),t&&(o.current.has(t)?o.current.get(t).add(e):o.current.set(t,new Set([e]))),k(3,()=>{_(),T(),r.current.value||j(),A.emit()}),()=>{s.current.delete(e),n.current.delete(e),r.current.filtered.items.delete(e);let t=R();k(4,()=>{_(),(null==t?void 0:t.getAttribute("id"))===e&&j(),A.emit()})}),group:e=>(o.current.has(e)||o.current.set(e,new Set),()=>{s.current.delete(e),o.current.delete(e)}),filter:()=>l.current.shouldFilter,label:c||e["aria-label"],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:y,inputId:x,labelId:w,listInnerRef:S}),[]);function C(e,t){var n,a;let o=null!=(a=null==(n=l.current)?void 0:n.filter)?a:Qh;return e?o(e,r.current.search,t):0}function T(){if(!r.current.search||!1===l.current.shouldFilter)return;let e=r.current.filtered.items,t=[];r.current.filtered.groups.forEach(r=>{let n=o.current.get(r),a=0;n.forEach(t=>{let r=e.get(t);a=Math.max(r,a)}),t.push([r,a])});let n=S.current;P().sort((t,r)=>{var n,a;let o=t.getAttribute("id"),s=r.getAttribute("id");return(null!=(n=e.get(s))?n:0)-(null!=(a=e.get(o))?a:0)}).forEach(e=>{let t=e.closest(Zh);t?t.appendChild(e.parentElement===t?e:e.closest(`${Zh} > *`)):n.appendChild(e.parentElement===n?e:e.closest(`${Zh} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{var t;let r=null==(t=S.current)?void 0:t.querySelector(`${Hh}[${Xh}="${encodeURIComponent(e[0])}"]`);null==r||r.parentElement.appendChild(r)})}function j(){let e=P().find(e=>"true"!==e.getAttribute("aria-disabled")),t=null==e?void 0:e.getAttribute(Xh);A.setState("value",t||void 0)}function _(){var e,t,a,i;if(!r.current.search||!1===l.current.shouldFilter)return void(r.current.filtered.count=n.current.size);r.current.filtered.groups=new Set;let c=0;for(let o of n.current){let n=C(null!=(t=null==(e=s.current.get(o))?void 0:e.value)?t:"",null!=(i=null==(a=s.current.get(o))?void 0:a.keywords)?i:[]);r.current.filtered.items.set(o,n),n>0&&c++}for(let[e,t]of o.current)for(let n of t)if(r.current.filtered.items.get(n)>0){r.current.filtered.groups.add(e);break}r.current.filtered.count=c}function N(){var e,t,r;let n=R();n&&((null==(e=n.parentElement)?void 0:e.firstChild)===n&&(null==(r=null==(t=n.closest(Hh))?void 0:t.querySelector('[cmdk-group-heading=""]'))||r.scrollIntoView({block:"nearest"})),n.scrollIntoView({block:"nearest"}))}function R(){var e;return null==(e=S.current)?void 0:e.querySelector(`${qh}[aria-selected="true"]`)}function P(){var e;return Array.from((null==(e=S.current)?void 0:e.querySelectorAll(Jh))||[])}function O(e){let t=P()[e];t&&A.setState("value",t.getAttribute(Xh))}function D(e){var t;let r=R(),n=P(),a=n.findIndex(e=>e===r),o=n[a+e];null!=(t=l.current)&&t.loop&&(o=a+e<0?n[n.length-1]:a+e===n.length?n[0]:n[a+e]),o&&A.setState("value",o.getAttribute(Xh))}function I(e){let t,r=R(),n=null==r?void 0:r.closest(Hh);for(;n&&!t;)n=e>0?hg(n,Hh):gg(n,Hh),t=null==n?void 0:n.querySelector(Jh);t?A.setState("value",t.getAttribute(Xh)):D(e)}let M=()=>O(P().length-1),L=e=>{e.preventDefault(),e.metaKey?M():e.altKey?I(1):D(1)},U=e=>{e.preventDefault(),e.metaKey?O(0):e.altKey?I(-1):D(-1)};return a.createElement(ys.div,{ref:t,tabIndex:-1,...b,"cmdk-root":"",onKeyDown:e=>{var t;null==(t=b.onKeyDown)||t.call(b,e);let r=e.nativeEvent.isComposing||229===e.keyCode;if(!e.defaultPrevented&&!r)switch(e.key){case"n":case"j":v&&e.ctrlKey&&L(e);break;case"ArrowDown":L(e);break;case"p":case"k":v&&e.ctrlKey&&U(e);break;case"ArrowUp":U(e);break;case"Home":e.preventDefault(),O(0);break;case"End":e.preventDefault(),M();break;case"Enter":{e.preventDefault();let t=R();if(t){let e=new Event(Yh);t.dispatchEvent(e)}}}}},a.createElement("label",{"cmdk-label":"",htmlFor:E.inputId,id:E.labelId,style:Ag},c),kg(e,e=>a.createElement(rg.Provider,{value:A},a.createElement(eg.Provider,{value:E},e))))}),sg=a.forwardRef((e,t)=>{var r,n;let o=ld(),s=a.useRef(null),i=a.useContext(ag),l=tg(),c=vg(e),u=null!=(n=null==(r=c.current)?void 0:r.forceMount)?n:null==i?void 0:i.forceMount;bg(()=>{if(!u)return l.item(o,null==i?void 0:i.id)},[u]);let d=xg(o,s,[e.value,e.children,s],e.keywords),f=ng(),m=wg(e=>e.value&&e.value===d.current),p=wg(e=>!(!u&&!1!==l.filter())||(!e.search||e.filtered.items.get(o)>0));function h(){var e,t;g(),null==(t=(e=c.current).onSelect)||t.call(e,d.current)}function g(){f.setState("value",d.current,!0)}if(a.useEffect(()=>{let t=s.current;if(t&&!e.disabled)return t.addEventListener(Yh,h),()=>t.removeEventListener(Yh,h)},[p,e.onSelect,e.disabled]),!p)return null;let{disabled:v,value:b,onSelect:y,forceMount:w,keywords:x,...S}=e;return a.createElement(ys.div,{ref:Fo(s,t),...S,id:o,"cmdk-item":"",role:"option","aria-disabled":!!v,"aria-selected":!!m,"data-disabled":!!v,"data-selected":!!m,onPointerMove:v||l.getDisablePointerSelection()?void 0:g,onClick:v?void 0:h},e.children)}),ig=a.forwardRef((e,t)=>{let{heading:r,children:n,forceMount:o,...s}=e,i=ld(),l=a.useRef(null),c=a.useRef(null),u=ld(),d=tg(),f=wg(e=>!(!o&&!1!==d.filter())||(!e.search||e.filtered.groups.has(i)));bg(()=>d.group(i),[]),xg(i,l,[e.value,e.heading,c]);let m=a.useMemo(()=>({id:i,forceMount:o}),[o]);return a.createElement(ys.div,{ref:Fo(l,t),...s,"cmdk-group":"",role:"presentation",hidden:!f||void 0},r&&a.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:u},r),kg(e,e=>a.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?u:void 0},a.createElement(ag.Provider,{value:m},e))))}),lg=a.forwardRef((e,t)=>{let{alwaysRender:r,...n}=e,o=a.useRef(null),s=wg(e=>!e.search);return r||s?a.createElement(ys.div,{ref:Fo(o,t),...n,"cmdk-separator":"",role:"separator"}):null}),cg=a.forwardRef((e,t)=>{let{onValueChange:r,...n}=e,o=null!=e.value,s=ng(),i=wg(e=>e.search),l=wg(e=>e.selectedItemId),c=tg();return a.useEffect(()=>{null!=e.value&&s.setState("search",e.value)},[e.value]),a.createElement(ys.input,{ref:t,...n,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":l,id:c.inputId,type:"text",value:o?e.value:i,onChange:e=>{o||s.setState("search",e.target.value),null==r||r(e.target.value)}})}),ug=a.forwardRef((e,t)=>{let{children:r,label:n="Suggestions",...o}=e,s=a.useRef(null),i=a.useRef(null),l=wg(e=>e.selectedItemId),c=tg();return a.useEffect(()=>{if(i.current&&s.current){let e,t=i.current,r=s.current,n=new ResizeObserver(()=>{e=requestAnimationFrame(()=>{let e=t.offsetHeight;r.style.setProperty("--cmdk-list-height",e.toFixed(1)+"px")})});return n.observe(t),()=>{cancelAnimationFrame(e),n.unobserve(t)}}},[]),a.createElement(ys.div,{ref:Fo(s,t),...o,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":l,"aria-label":n,id:c.listId},kg(e,e=>a.createElement("div",{ref:Fo(i,c.listInnerRef),"cmdk-list-sizer":""},e)))}),dg=a.forwardRef((e,t)=>{let{open:r,onOpenChange:n,overlayClassName:o,contentClassName:s,container:i,...l}=e;return a.createElement(cm,{open:r,onOpenChange:n},a.createElement(dm,{container:i},a.createElement(fm,{"cmdk-overlay":"",className:o}),a.createElement(mm,{"aria-label":e.label,"cmdk-dialog":"",className:s},a.createElement(og,{ref:t,...l}))))}),fg=a.forwardRef((e,t)=>wg(e=>0===e.filtered.count)?a.createElement(ys.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),mg=a.forwardRef((e,t)=>{let{progress:r,children:n,label:o="Loading...",...s}=e;return a.createElement(ys.div,{ref:t,...s,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},kg(e,e=>a.createElement("div",{"aria-hidden":!0},e)))}),pg=Object.assign(og,{List:ug,Item:sg,Input:cg,Group:ig,Separator:lg,Dialog:dg,Empty:fg,Loading:mg});function hg(e,t){let r=e.nextElementSibling;for(;r;){if(r.matches(t))return r;r=r.nextElementSibling}}function gg(e,t){let r=e.previousElementSibling;for(;r;){if(r.matches(t))return r;r=r.previousElementSibling}}function vg(e){let t=a.useRef(e);return bg(()=>{t.current=e}),t}var bg="undefined"==typeof window?a.useEffect:a.useLayoutEffect;function yg(e){let t=a.useRef();return void 0===t.current&&(t.current=e()),t}function wg(e){let t=ng(),r=()=>e(t.snapshot());return a.useSyncExternalStore(t.subscribe,r,r)}function xg(e,t,r,n=[]){let o=a.useRef(),s=tg();return bg(()=>{var a;let i=(()=>{var e;for(let t of r){if("string"==typeof t)return t.trim();if("object"==typeof t&&"current"in t)return t.current?null==(e=t.current.textContent)?void 0:e.trim():o.current}})(),l=n.map(e=>e.trim());s.value(e,i,l),null==(a=t.current)||a.setAttribute(Xh,i),o.current=i}),o}var Sg=()=>{let[e,t]=a.useState(),r=yg(()=>new Map);return bg(()=>{r.current.forEach(e=>e()),r.current=new Map},[e]),(e,n)=>{r.current.set(e,n),t({})}};function kg({asChild:e,children:t},r){return e&&a.isValidElement(t)?a.cloneElement(function(e){let t=e.type;return"function"==typeof t?t(e.props):"render"in t?t.render(e.props):e}(t),{ref:t.ref},r(t.props.children)):r(t)}var Ag={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const Eg=a.forwardRef(({className:t,...r},n)=>e.jsx(pg,{ref:n,className:Uo("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",t),...r}));Eg.displayName=pg.displayName;const Cg=a.forwardRef(({className:t,...r},n)=>e.jsxs("div",{className:"flex items-center border-b px-3","data-cmdk-input-wrapper":"",children:[e.jsx(Em,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),e.jsx(pg.Input,{ref:n,className:Uo("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",t),...r})]}));Cg.displayName=pg.Input.displayName;const Tg=a.forwardRef(({className:t,...r},n)=>e.jsx(pg.List,{ref:n,className:Uo("max-h-[300px] overflow-y-auto overflow-x-hidden",t),...r}));Tg.displayName=pg.List.displayName;a.forwardRef((t,r)=>e.jsx(pg.Empty,{ref:r,className:"py-6 text-center text-sm",...t})).displayName=pg.Empty.displayName;const jg=a.forwardRef(({className:t,...r},n)=>e.jsx(pg.Group,{ref:n,className:Uo("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",t),...r}));jg.displayName=pg.Group.displayName;a.forwardRef(({className:t,...r},n)=>e.jsx(pg.Separator,{ref:n,className:Uo("-mx-1 h-px bg-border",t),...r})).displayName=pg.Separator.displayName;const _g=a.forwardRef(({className:t,...r},n)=>e.jsx(pg.Item,{ref:n,className:Uo("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...r}));_g.displayName=pg.Item.displayName;const Ng=["top","right","bottom","left"],Rg=Math.min,Pg=Math.max,Og=Math.round,Dg=Math.floor,Ig=e=>({x:e,y:e}),Mg={left:"right",right:"left",bottom:"top",top:"bottom"},Lg={start:"end",end:"start"};function Ug(e,t,r){return Pg(e,Rg(t,r))}function zg(e,t){return"function"==typeof e?e(t):e}function Fg(e){return e.split("-")[0]}function Bg(e){return e.split("-")[1]}function Vg(e){return"x"===e?"y":"x"}function $g(e){return"y"===e?"height":"width"}const Wg=new Set(["top","bottom"]);function Gg(e){return Wg.has(Fg(e))?"y":"x"}function Kg(e){return Vg(Gg(e))}function Hg(e){return e.replace(/start|end/g,e=>Lg[e])}const Zg=["left","right"],qg=["right","left"],Jg=["top","bottom"],Yg=["bottom","top"];function Xg(e,t,r,n){const a=Bg(e);let o=function(e,t,r){switch(e){case"top":case"bottom":return r?t?qg:Zg:t?Zg:qg;case"left":case"right":return t?Jg:Yg;default:return[]}}(Fg(e),"start"===r,n);return a&&(o=o.map(e=>e+"-"+a),t&&(o=o.concat(o.map(Hg)))),o}function Qg(e){return e.replace(/left|right|bottom|top/g,e=>Mg[e])}function ev(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function tv(e){const{x:t,y:r,width:n,height:a}=e;return{width:n,height:a,top:r,left:t,right:t+n,bottom:r+a,x:t,y:r}}function rv(e,t,r){let{reference:n,floating:a}=e;const o=Gg(t),s=Kg(t),i=$g(s),l=Fg(t),c="y"===o,u=n.x+n.width/2-a.width/2,d=n.y+n.height/2-a.height/2,f=n[i]/2-a[i]/2;let m;switch(l){case"top":m={x:u,y:n.y-a.height};break;case"bottom":m={x:u,y:n.y+n.height};break;case"right":m={x:n.x+n.width,y:d};break;case"left":m={x:n.x-a.width,y:d};break;default:m={x:n.x,y:n.y}}switch(Bg(t)){case"start":m[s]-=f*(r&&c?-1:1);break;case"end":m[s]+=f*(r&&c?-1:1)}return m}async function nv(e,t){var r;void 0===t&&(t={});const{x:n,y:a,platform:o,rects:s,elements:i,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:m=0}=zg(t,e),p=ev(m),h=i[f?"floating"===d?"reference":"floating":d],g=tv(await o.getClippingRect({element:null==(r=await(null==o.isElement?void 0:o.isElement(h)))||r?h:h.contextElement||await(null==o.getDocumentElement?void 0:o.getDocumentElement(i.floating)),boundary:c,rootBoundary:u,strategy:l})),v="floating"===d?{x:n,y:a,width:s.floating.width,height:s.floating.height}:s.reference,b=await(null==o.getOffsetParent?void 0:o.getOffsetParent(i.floating)),y=await(null==o.isElement?void 0:o.isElement(b))&&await(null==o.getScale?void 0:o.getScale(b))||{x:1,y:1},w=tv(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:i,rect:v,offsetParent:b,strategy:l}):v);return{top:(g.top-w.top+p.top)/y.y,bottom:(w.bottom-g.bottom+p.bottom)/y.y,left:(g.left-w.left+p.left)/y.x,right:(w.right-g.right+p.right)/y.x}}function av(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ov(e){return Ng.some(t=>e[t]>=0)}const sv=new Set(["left","top"]);function iv(){return"undefined"!=typeof window}function lv(e){return dv(e)?(e.nodeName||"").toLowerCase():"#document"}function cv(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function uv(e){var t;return null==(t=(dv(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function dv(e){return!!iv()&&(e instanceof Node||e instanceof cv(e).Node)}function fv(e){return!!iv()&&(e instanceof Element||e instanceof cv(e).Element)}function mv(e){return!!iv()&&(e instanceof HTMLElement||e instanceof cv(e).HTMLElement)}function pv(e){return!(!iv()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof cv(e).ShadowRoot)}const hv=new Set(["inline","contents"]);function gv(e){const{overflow:t,overflowX:r,overflowY:n,display:a}=jv(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!hv.has(a)}const vv=new Set(["table","td","th"]);function bv(e){return vv.has(lv(e))}const yv=[":popover-open",":modal"];function wv(e){return yv.some(t=>{try{return e.matches(t)}catch(e){return!1}})}const xv=["transform","translate","scale","rotate","perspective"],Sv=["transform","translate","scale","rotate","perspective","filter"],kv=["paint","layout","strict","content"];function Av(e){const t=Ev(),r=fv(e)?jv(e):e;return xv.some(e=>!!r[e]&&"none"!==r[e])||!!r.containerType&&"normal"!==r.containerType||!t&&!!r.backdropFilter&&"none"!==r.backdropFilter||!t&&!!r.filter&&"none"!==r.filter||Sv.some(e=>(r.willChange||"").includes(e))||kv.some(e=>(r.contain||"").includes(e))}function Ev(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const Cv=new Set(["html","body","#document"]);function Tv(e){return Cv.has(lv(e))}function jv(e){return cv(e).getComputedStyle(e)}function _v(e){return fv(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Nv(e){if("html"===lv(e))return e;const t=e.assignedSlot||e.parentNode||pv(e)&&e.host||uv(e);return pv(t)?t.host:t}function Rv(e){const t=Nv(e);return Tv(t)?e.ownerDocument?e.ownerDocument.body:e.body:mv(t)&&gv(t)?t:Rv(t)}function Pv(e,t,r){var n;void 0===t&&(t=[]),void 0===r&&(r=!0);const a=Rv(e),o=a===(null==(n=e.ownerDocument)?void 0:n.body),s=cv(a);if(o){const e=Ov(s);return t.concat(s,s.visualViewport||[],gv(a)?a:[],e&&r?Pv(e):[])}return t.concat(a,Pv(a,[],r))}function Ov(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Dv(e){const t=jv(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const a=mv(e),o=a?e.offsetWidth:r,s=a?e.offsetHeight:n,i=Og(r)!==o||Og(n)!==s;return i&&(r=o,n=s),{width:r,height:n,$:i}}function Iv(e){return fv(e)?e:e.contextElement}function Mv(e){const t=Iv(e);if(!mv(t))return Ig(1);const r=t.getBoundingClientRect(),{width:n,height:a,$:o}=Dv(t);let s=(o?Og(r.width):r.width)/n,i=(o?Og(r.height):r.height)/a;return s&&Number.isFinite(s)||(s=1),i&&Number.isFinite(i)||(i=1),{x:s,y:i}}const Lv=Ig(0);function Uv(e){const t=cv(e);return Ev()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Lv}function zv(e,t,r,n){void 0===t&&(t=!1),void 0===r&&(r=!1);const a=e.getBoundingClientRect(),o=Iv(e);let s=Ig(1);t&&(n?fv(n)&&(s=Mv(n)):s=Mv(e));const i=function(e,t,r){return void 0===t&&(t=!1),!(!r||t&&r!==cv(e))&&t}(o,r,n)?Uv(o):Ig(0);let l=(a.left+i.x)/s.x,c=(a.top+i.y)/s.y,u=a.width/s.x,d=a.height/s.y;if(o){const e=cv(o),t=n&&fv(n)?cv(n):n;let r=e,a=Ov(r);for(;a&&n&&t!==r;){const e=Mv(a),t=a.getBoundingClientRect(),n=jv(a),o=t.left+(a.clientLeft+parseFloat(n.paddingLeft))*e.x,s=t.top+(a.clientTop+parseFloat(n.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=o,c+=s,r=cv(a),a=Ov(r)}}return tv({width:u,height:d,x:l,y:c})}function Fv(e,t){const r=_v(e).scrollLeft;return t?t.left+r:zv(uv(e)).left+r}function Bv(e,t){const r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-Fv(e,r),y:r.top+t.scrollTop}}const Vv=new Set(["absolute","fixed"]);function $v(e,t,r){let n;if("viewport"===t)n=function(e,t){const r=cv(e),n=uv(e),a=r.visualViewport;let o=n.clientWidth,s=n.clientHeight,i=0,l=0;if(a){o=a.width,s=a.height;const e=Ev();(!e||e&&"fixed"===t)&&(i=a.offsetLeft,l=a.offsetTop)}const c=Fv(n);if(c<=0){const e=n.ownerDocument,t=e.body,r=getComputedStyle(t),a="CSS1Compat"===e.compatMode&&parseFloat(r.marginLeft)+parseFloat(r.marginRight)||0,s=Math.abs(n.clientWidth-t.clientWidth-a);s<=25&&(o-=s)}else c<=25&&(o+=c);return{width:o,height:s,x:i,y:l}}(e,r);else if("document"===t)n=function(e){const t=uv(e),r=_v(e),n=e.ownerDocument.body,a=Pg(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),o=Pg(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let s=-r.scrollLeft+Fv(e);const i=-r.scrollTop;return"rtl"===jv(n).direction&&(s+=Pg(t.clientWidth,n.clientWidth)-a),{width:a,height:o,x:s,y:i}}(uv(e));else if(fv(t))n=function(e,t){const r=zv(e,!0,"fixed"===t),n=r.top+e.clientTop,a=r.left+e.clientLeft,o=mv(e)?Mv(e):Ig(1);return{width:e.clientWidth*o.x,height:e.clientHeight*o.y,x:a*o.x,y:n*o.y}}(t,r);else{const r=Uv(e);n={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return tv(n)}function Wv(e,t){const r=Nv(e);return!(r===t||!fv(r)||Tv(r))&&("fixed"===jv(r).position||Wv(r,t))}function Gv(e,t,r){const n=mv(t),a=uv(t),o="fixed"===r,s=zv(e,!0,o,t);let i={scrollLeft:0,scrollTop:0};const l=Ig(0);function c(){l.x=Fv(a)}if(n||!n&&!o)if(("body"!==lv(t)||gv(a))&&(i=_v(t)),n){const e=zv(t,!0,o,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else a&&c();o&&!n&&a&&c();const u=!a||n||o?Ig(0):Bv(a,i);return{x:s.left+i.scrollLeft-l.x-u.x,y:s.top+i.scrollTop-l.y-u.y,width:s.width,height:s.height}}function Kv(e){return"static"===jv(e).position}function Hv(e,t){if(!mv(e)||"fixed"===jv(e).position)return null;if(t)return t(e);let r=e.offsetParent;return uv(e)===r&&(r=r.ownerDocument.body),r}function Zv(e,t){const r=cv(e);if(wv(e))return r;if(!mv(e)){let t=Nv(e);for(;t&&!Tv(t);){if(fv(t)&&!Kv(t))return t;t=Nv(t)}return r}let n=Hv(e,t);for(;n&&bv(n)&&Kv(n);)n=Hv(n,t);return n&&Tv(n)&&Kv(n)&&!Av(n)?r:n||function(e){let t=Nv(e);for(;mv(t)&&!Tv(t);){if(Av(t))return t;if(wv(t))return null;t=Nv(t)}return null}(e)||r}const qv={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:r,offsetParent:n,strategy:a}=e;const o="fixed"===a,s=uv(n),i=!!t&&wv(t.floating);if(n===s||i&&o)return r;let l={scrollLeft:0,scrollTop:0},c=Ig(1);const u=Ig(0),d=mv(n);if((d||!d&&!o)&&(("body"!==lv(n)||gv(s))&&(l=_v(n)),mv(n))){const e=zv(n);c=Mv(n),u.x=e.x+n.clientLeft,u.y=e.y+n.clientTop}const f=!s||d||o?Ig(0):Bv(s,l);return{width:r.width*c.x,height:r.height*c.y,x:r.x*c.x-l.scrollLeft*c.x+u.x+f.x,y:r.y*c.y-l.scrollTop*c.y+u.y+f.y}},getDocumentElement:uv,getClippingRect:function(e){let{element:t,boundary:r,rootBoundary:n,strategy:a}=e;const o="clippingAncestors"===r?wv(t)?[]:function(e,t){const r=t.get(e);if(r)return r;let n=Pv(e,[],!1).filter(e=>fv(e)&&"body"!==lv(e)),a=null;const o="fixed"===jv(e).position;let s=o?Nv(e):e;for(;fv(s)&&!Tv(s);){const t=jv(s),r=Av(s);r||"fixed"!==t.position||(a=null),(o?!r&&!a:!r&&"static"===t.position&&a&&Vv.has(a.position)||gv(s)&&!r&&Wv(e,s))?n=n.filter(e=>e!==s):a=t,s=Nv(s)}return t.set(e,n),n}(t,this._c):[].concat(r),s=[...o,n],i=s[0],l=s.reduce((e,r)=>{const n=$v(t,r,a);return e.top=Pg(n.top,e.top),e.right=Rg(n.right,e.right),e.bottom=Rg(n.bottom,e.bottom),e.left=Pg(n.left,e.left),e},$v(t,i,a));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:Zv,getElementRects:async function(e){const t=this.getOffsetParent||Zv,r=this.getDimensions,n=await r(e.floating);return{reference:Gv(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:r}=Dv(e);return{width:t,height:r}},getScale:Mv,isElement:fv,isRTL:function(e){return"rtl"===jv(e).direction}};function Jv(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Yv(e,t,r,n){void 0===n&&(n={});const{ancestorScroll:a=!0,ancestorResize:o=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:i="function"==typeof IntersectionObserver,animationFrame:l=!1}=n,c=Iv(e),u=a||o?[...c?Pv(c):[],...Pv(t)]:[];u.forEach(e=>{a&&e.addEventListener("scroll",r,{passive:!0}),o&&e.addEventListener("resize",r)});const d=c&&i?function(e,t){let r,n=null;const a=uv(e);function o(){var e;clearTimeout(r),null==(e=n)||e.disconnect(),n=null}return function s(i,l){void 0===i&&(i=!1),void 0===l&&(l=1),o();const c=e.getBoundingClientRect(),{left:u,top:d,width:f,height:m}=c;if(i||t(),!f||!m)return;const p={rootMargin:-Dg(d)+"px "+-Dg(a.clientWidth-(u+f))+"px "+-Dg(a.clientHeight-(d+m))+"px "+-Dg(u)+"px",threshold:Pg(0,Rg(1,l))||1};let h=!0;function g(t){const n=t[0].intersectionRatio;if(n!==l){if(!h)return s();n?s(!1,n):r=setTimeout(()=>{s(!1,1e-7)},1e3)}1!==n||Jv(c,e.getBoundingClientRect())||s(),h=!1}try{n=new IntersectionObserver(g,{...p,root:a.ownerDocument})}catch(e){n=new IntersectionObserver(g,p)}n.observe(e)}(!0),o}(c,r):null;let f,m=-1,p=null;s&&(p=new ResizeObserver(e=>{let[n]=e;n&&n.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var e;null==(e=p)||e.observe(t)})),r()}),c&&!l&&p.observe(c),p.observe(t));let h=l?zv(e):null;return l&&function t(){const n=zv(e);h&&!Jv(h,n)&&r();h=n,f=requestAnimationFrame(t)}(),r(),()=>{var e;u.forEach(e=>{a&&e.removeEventListener("scroll",r),o&&e.removeEventListener("resize",r)}),null==d||d(),null==(e=p)||e.disconnect(),p=null,l&&cancelAnimationFrame(f)}}const Xv=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:a,y:o,placement:s,middlewareData:i}=t,l=await async function(e,t){const{placement:r,platform:n,elements:a}=e,o=await(null==n.isRTL?void 0:n.isRTL(a.floating)),s=Fg(r),i=Bg(r),l="y"===Gg(r),c=sv.has(s)?-1:1,u=o&&l?-1:1,d=zg(t,e);let{mainAxis:f,crossAxis:m,alignmentAxis:p}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return i&&"number"==typeof p&&(m="end"===i?-1*p:p),l?{x:m*u,y:f*c}:{x:f*c,y:m*u}}(t,e);return s===(null==(r=i.offset)?void 0:r.placement)&&null!=(n=i.arrow)&&n.alignmentOffset?{}:{x:a+l.x,y:o+l.y,data:{...l,placement:s}}}}},Qv=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:i={fn:e=>{let{x:t,y:r}=e;return{x:t,y:r}}},...l}=zg(e,t),c={x:r,y:n},u=await nv(t,l),d=Gg(Fg(a)),f=Vg(d);let m=c[f],p=c[d];if(o){const e="y"===f?"bottom":"right";m=Ug(m+u["y"===f?"top":"left"],m,m-u[e])}if(s){const e="y"===d?"bottom":"right";p=Ug(p+u["y"===d?"top":"left"],p,p-u[e])}const h=i.fn({...t,[f]:m,[d]:p});return{...h,data:{x:h.x-r,y:h.y-n,enabled:{[f]:o,[d]:s}}}}}},eb=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:a,middlewareData:o,rects:s,initialPlacement:i,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:h=!0,...g}=zg(e,t);if(null!=(r=o.arrow)&&r.alignmentOffset)return{};const v=Fg(a),b=Gg(i),y=Fg(i)===i,w=await(null==l.isRTL?void 0:l.isRTL(c.floating)),x=f||(y||!h?[Qg(i)]:function(e){const t=Qg(e);return[Hg(e),t,Hg(t)]}(i)),S="none"!==p;!f&&S&&x.push(...Xg(i,h,p,w));const k=[i,...x],A=await nv(t,g),E=[];let C=(null==(n=o.flip)?void 0:n.overflows)||[];if(u&&E.push(A[v]),d){const e=function(e,t,r){void 0===r&&(r=!1);const n=Bg(e),a=Kg(e),o=$g(a);let s="x"===a?n===(r?"end":"start")?"right":"left":"start"===n?"bottom":"top";return t.reference[o]>t.floating[o]&&(s=Qg(s)),[s,Qg(s)]}(a,s,w);E.push(A[e[0]],A[e[1]])}if(C=[...C,{placement:a,overflows:E}],!E.every(e=>e<=0)){var T,j;const e=((null==(T=o.flip)?void 0:T.index)||0)+1,t=k[e];if(t){if(!("alignment"===d&&b!==Gg(t))||C.every(e=>Gg(e.placement)!==b||e.overflows[0]>0))return{data:{index:e,overflows:C},reset:{placement:t}}}let r=null==(j=C.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:j.placement;if(!r)switch(m){case"bestFit":{var _;const e=null==(_=C.filter(e=>{if(S){const t=Gg(e.placement);return t===b||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:_[0];e&&(r=e);break}case"initialPlacement":r=i}if(a!==r)return{reset:{placement:r}}}return{}}}},tb=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:a,rects:o,platform:s,elements:i}=t,{apply:l=()=>{},...c}=zg(e,t),u=await nv(t,c),d=Fg(a),f=Bg(a),m="y"===Gg(a),{width:p,height:h}=o.floating;let g,v;"top"===d||"bottom"===d?(g=d,v=f===(await(null==s.isRTL?void 0:s.isRTL(i.floating))?"start":"end")?"left":"right"):(v=d,g="end"===f?"top":"bottom");const b=h-u.top-u.bottom,y=p-u.left-u.right,w=Rg(h-u[g],b),x=Rg(p-u[v],y),S=!t.middlewareData.shift;let k=w,A=x;if(null!=(r=t.middlewareData.shift)&&r.enabled.x&&(A=y),null!=(n=t.middlewareData.shift)&&n.enabled.y&&(k=b),S&&!f){const e=Pg(u.left,0),t=Pg(u.right,0),r=Pg(u.top,0),n=Pg(u.bottom,0);m?A=p-2*(0!==e||0!==t?e+t:Pg(u.left,u.right)):k=h-2*(0!==r||0!==n?r+n:Pg(u.top,u.bottom))}await l({...t,availableWidth:A,availableHeight:k});const E=await s.getDimensions(i.floating);return p!==E.width||h!==E.height?{reset:{rects:!0}}:{}}}},rb=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...a}=zg(e,t);switch(n){case"referenceHidden":{const e=av(await nv(t,{...a,elementContext:"reference"}),r.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:ov(e)}}}case"escaped":{const e=av(await nv(t,{...a,altBoundary:!0}),r.floating);return{data:{escapedOffsets:e,escaped:ov(e)}}}default:return{}}}}},nb=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:a,rects:o,platform:s,elements:i,middlewareData:l}=t,{element:c,padding:u=0}=zg(e,t)||{};if(null==c)return{};const d=ev(u),f={x:r,y:n},m=Kg(a),p=$g(m),h=await s.getDimensions(c),g="y"===m,v=g?"top":"left",b=g?"bottom":"right",y=g?"clientHeight":"clientWidth",w=o.reference[p]+o.reference[m]-f[m]-o.floating[p],x=f[m]-o.reference[m],S=await(null==s.getOffsetParent?void 0:s.getOffsetParent(c));let k=S?S[y]:0;k&&await(null==s.isElement?void 0:s.isElement(S))||(k=i.floating[y]||o.floating[p]);const A=w/2-x/2,E=k/2-h[p]/2-1,C=Rg(d[v],E),T=Rg(d[b],E),j=C,_=k-h[p]-T,N=k/2-h[p]/2+A,R=Ug(j,N,_),P=!l.arrow&&null!=Bg(a)&&N!==R&&o.reference[p]/2-(N<j?C:T)-h[p]/2<0,O=P?N<j?N-j:N-_:0;return{[m]:f[m]+O,data:{[m]:R,centerOffset:N-R-O,...P&&{alignmentOffset:O}},reset:P}}}),ab=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:a,rects:o,middlewareData:s}=t,{offset:i=0,mainAxis:l=!0,crossAxis:c=!0}=zg(e,t),u={x:r,y:n},d=Gg(a),f=Vg(d);let m=u[f],p=u[d];const h=zg(i,t),g="number"==typeof h?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(l){const e="y"===f?"height":"width",t=o.reference[f]-o.floating[e]+g.mainAxis,r=o.reference[f]+o.reference[e]-g.mainAxis;m<t?m=t:m>r&&(m=r)}if(c){var v,b;const e="y"===f?"width":"height",t=sv.has(Fg(a)),r=o.reference[d]-o.floating[e]+(t&&(null==(v=s.offset)?void 0:v[d])||0)+(t?0:g.crossAxis),n=o.reference[d]+o.reference[e]+(t?0:(null==(b=s.offset)?void 0:b[d])||0)-(t?g.crossAxis:0);p<r?p=r:p>n&&(p=n)}return{[f]:m,[d]:p}}}},ob=(e,t,r)=>{const n=new Map,a={platform:qv,...r},o={...a.platform,_c:n};return(async(e,t,r)=>{const{placement:n="bottom",strategy:a="absolute",middleware:o=[],platform:s}=r,i=o.filter(Boolean),l=await(null==s.isRTL?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:a}),{x:u,y:d}=rv(c,n,l),f=n,m={},p=0;for(let r=0;r<i.length;r++){const{name:o,fn:h}=i[r],{x:g,y:v,data:b,reset:y}=await h({x:u,y:d,initialPlacement:n,placement:f,strategy:a,middlewareData:m,rects:c,platform:s,elements:{reference:e,floating:t}});u=null!=g?g:u,d=null!=v?v:d,m={...m,[o]:{...m[o],...b}},y&&p<=50&&(p++,"object"==typeof y&&(y.placement&&(f=y.placement),y.rects&&(c=!0===y.rects?await s.getElementRects({reference:e,floating:t,strategy:a}):y.rects),({x:u,y:d}=rv(c,f,l))),r=-1)}return{x:u,y:d,placement:f,strategy:a,middlewareData:m}})(e,t,{...a,platform:o})};var sb="undefined"!=typeof document?t.useLayoutEffect:function(){};function ib(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let r,n,a;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;0!==n--;)if(!ib(e[n],t[n]))return!1;return!0}if(a=Object.keys(e),r=a.length,r!==Object.keys(t).length)return!1;for(n=r;0!==n--;)if(!{}.hasOwnProperty.call(t,a[n]))return!1;for(n=r;0!==n--;){const r=a[n];if(("_owner"!==r||!e.$$typeof)&&!ib(e[r],t[r]))return!1}return!0}return e!=e&&t!=t}function lb(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function cb(e,t){const r=lb(e);return Math.round(t*r)/r}function ub(e){const t=a.useRef(e);return sb(()=>{t.current=e}),t}const db=e=>({name:"arrow",options:e,fn(t){const{element:r,padding:n}="function"==typeof e?e(t):e;return r&&(a=r,{}.hasOwnProperty.call(a,"current"))?null!=r.current?nb({element:r.current,padding:n}).fn(t):{}:r?nb({element:r,padding:n}).fn(t):{};var a}}),fb=(e,t)=>({...Xv(e),options:[e,t]}),mb=(e,t)=>({...Qv(e),options:[e,t]}),pb=(e,t)=>({...ab(e),options:[e,t]}),hb=(e,t)=>({...eb(e),options:[e,t]}),gb=(e,t)=>({...tb(e),options:[e,t]}),vb=(e,t)=>({...rb(e),options:[e,t]}),bb=(e,t)=>({...db(e),options:[e,t]});var yb=a.forwardRef((t,r)=>{const{children:n,width:a=10,height:o=5,...s}=t;return e.jsx(ys.svg,{...s,ref:r,width:a,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:e.jsx("polygon",{points:"0,0 30,0 15,10"})})});yb.displayName="Arrow";var wb=yb,xb="Popper",[Sb,kb]=Tu(xb),[Ab,Eb]=Sb(xb),Cb=t=>{const{__scopePopper:r,children:n}=t,[o,s]=a.useState(null);return e.jsx(Ab,{scope:r,anchor:o,onAnchorChange:s,children:n})};Cb.displayName=xb;var Tb="PopperAnchor",jb=a.forwardRef((t,r)=>{const{__scopePopper:n,virtualRef:o,...s}=t,i=Eb(Tb,n),l=a.useRef(null),c=Bo(r,l),u=a.useRef(null);return a.useEffect(()=>{const e=u.current;u.current=o?.current||l.current,e!==u.current&&i.onAnchorChange(u.current)}),o?null:e.jsx(ys.div,{...s,ref:c})});jb.displayName=Tb;var _b="PopperContent",[Nb,Rb]=Sb(_b),Pb=a.forwardRef((t,r)=>{const{__scopePopper:n,side:s="bottom",sideOffset:i=0,align:l="center",alignOffset:c=0,arrowPadding:u=0,avoidCollisions:d=!0,collisionBoundary:f=[],collisionPadding:m=0,sticky:p="partial",hideWhenDetached:h=!1,updatePositionStrategy:g="optimized",onPlaced:v,...b}=t,y=Eb(_b,n),[w,x]=a.useState(null),S=Bo(r,e=>x(e)),[k,A]=a.useState(null),E=tp(k),C=E?.width??0,T=E?.height??0,j=s+("center"!==l?"-"+l:""),_="number"==typeof m?m:{top:0,right:0,bottom:0,left:0,...m},N=Array.isArray(f)?f:[f],R=N.length>0,P={padding:_,boundary:N.filter(Mb),altBoundary:R},{refs:O,floatingStyles:D,placement:I,isPositioned:M,middlewareData:L}=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:s,elements:{reference:i,floating:l}={},transform:c=!0,whileElementsMounted:u,open:d}=e,[f,m]=a.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=a.useState(n);ib(p,n)||h(n);const[g,v]=a.useState(null),[b,y]=a.useState(null),w=a.useCallback(e=>{e!==A.current&&(A.current=e,v(e))},[]),x=a.useCallback(e=>{e!==E.current&&(E.current=e,y(e))},[]),S=i||g,k=l||b,A=a.useRef(null),E=a.useRef(null),C=a.useRef(f),T=null!=u,j=ub(u),_=ub(s),N=ub(d),R=a.useCallback(()=>{if(!A.current||!E.current)return;const e={placement:t,strategy:r,middleware:p};_.current&&(e.platform=_.current),ob(A.current,E.current,e).then(e=>{const t={...e,isPositioned:!1!==N.current};P.current&&!ib(C.current,t)&&(C.current=t,o.flushSync(()=>{m(t)}))})},[p,t,r,_,N]);sb(()=>{!1===d&&C.current.isPositioned&&(C.current.isPositioned=!1,m(e=>({...e,isPositioned:!1})))},[d]);const P=a.useRef(!1);sb(()=>(P.current=!0,()=>{P.current=!1}),[]),sb(()=>{if(S&&(A.current=S),k&&(E.current=k),S&&k){if(j.current)return j.current(S,k,R);R()}},[S,k,R,j,T]);const O=a.useMemo(()=>({reference:A,floating:E,setReference:w,setFloating:x}),[w,x]),D=a.useMemo(()=>({reference:S,floating:k}),[S,k]),I=a.useMemo(()=>{const e={position:r,left:0,top:0};if(!D.floating)return e;const t=cb(D.floating,f.x),n=cb(D.floating,f.y);return c?{...e,transform:"translate("+t+"px, "+n+"px)",...lb(D.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}},[r,c,D.floating,f.x,f.y]);return a.useMemo(()=>({...f,update:R,refs:O,elements:D,floatingStyles:I}),[f,R,O,D,I])}({strategy:"fixed",placement:j,whileElementsMounted:(...e)=>Yv(...e,{animationFrame:"always"===g}),elements:{reference:y.anchor},middleware:[fb({mainAxis:i+T,alignmentAxis:c}),d&&mb({mainAxis:!0,crossAxis:!1,limiter:"partial"===p?pb():void 0,...P}),d&&hb({...P}),gb({...P,apply:({elements:e,rects:t,availableWidth:r,availableHeight:n})=>{const{width:a,height:o}=t.reference,s=e.floating.style;s.setProperty("--radix-popper-available-width",`${r}px`),s.setProperty("--radix-popper-available-height",`${n}px`),s.setProperty("--radix-popper-anchor-width",`${a}px`),s.setProperty("--radix-popper-anchor-height",`${o}px`)}}),k&&bb({element:k,padding:u}),Lb({arrowWidth:C,arrowHeight:T}),h&&vb({strategy:"referenceHidden",...P})]}),[U,z]=Ub(I),F=_u(v);Ru(()=>{M&&F?.()},[M,F]);const B=L.arrow?.x,V=L.arrow?.y,$=0!==L.arrow?.centerOffset,[W,G]=a.useState();return Ru(()=>{w&&G(window.getComputedStyle(w).zIndex)},[w]),e.jsx("div",{ref:O.setFloating,"data-radix-popper-content-wrapper":"",style:{...D,transform:M?D.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:W,"--radix-popper-transform-origin":[L.transformOrigin?.x,L.transformOrigin?.y].join(" "),...L.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:e.jsx(Nb,{scope:n,placedSide:U,onArrowChange:A,arrowX:B,arrowY:V,shouldHideArrow:$,children:e.jsx(ys.div,{"data-side":U,"data-align":z,...b,ref:S,style:{...b.style,animation:M?void 0:"none"}})})})});Pb.displayName=_b;var Ob="PopperArrow",Db={top:"bottom",right:"left",bottom:"top",left:"right"},Ib=a.forwardRef(function(t,r){const{__scopePopper:n,...a}=t,o=Rb(Ob,n),s=Db[o.placedSide];return e.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:e.jsx(wb,{...a,ref:r,style:{...a.style,display:"block"}})})});function Mb(e){return null!==e}Ib.displayName=Ob;var Lb=e=>({name:"transformOrigin",options:e,fn(t){const{placement:r,rects:n,middlewareData:a}=t,o=0!==a.arrow?.centerOffset,s=o?0:e.arrowWidth,i=o?0:e.arrowHeight,[l,c]=Ub(r),u={start:"0%",center:"50%",end:"100%"}[c],d=(a.arrow?.x??0)+s/2,f=(a.arrow?.y??0)+i/2;let m="",p="";return"bottom"===l?(m=o?u:`${d}px`,p=-i+"px"):"top"===l?(m=o?u:`${d}px`,p=`${n.floating.height+i}px`):"right"===l?(m=-i+"px",p=o?u:`${f}px`):"left"===l&&(m=`${n.floating.width+i}px`,p=o?u:`${f}px`),{data:{x:m,y:p}}}});function Ub(e){const[t,r="center"]=e.split("-");return[t,r]}var zb=Cb,Fb=jb,Bb=Pb,Vb=Ib,$b="Popover",[Wb,Gb]=Tu($b,[kb]),Kb=kb(),[Hb,Zb]=Wb($b),qb=t=>{const{__scopePopover:r,children:n,open:o,defaultOpen:s,onOpenChange:i,modal:l=!1}=t,c=Kb(r),u=a.useRef(null),[d,f]=a.useState(!1),[m,p]=ud({prop:o,defaultProp:s??!1,onChange:i,caller:$b});return e.jsx(zb,{...c,children:e.jsx(Hb,{scope:r,contentId:ld(),triggerRef:u,open:m,onOpenChange:p,onOpenToggle:a.useCallback(()=>p(e=>!e),[p]),hasCustomAnchor:d,onCustomAnchorAdd:a.useCallback(()=>f(!0),[]),onCustomAnchorRemove:a.useCallback(()=>f(!1),[]),modal:l,children:n})})};qb.displayName=$b;var Jb="PopoverAnchor";a.forwardRef((t,r)=>{const{__scopePopover:n,...o}=t,s=Zb(Jb,n),i=Kb(n),{onCustomAnchorAdd:l,onCustomAnchorRemove:c}=s;return a.useEffect(()=>(l(),()=>c()),[l,c]),e.jsx(Fb,{...i,...o,ref:r})}).displayName=Jb;var Yb="PopoverTrigger",Xb=a.forwardRef((t,r)=>{const{__scopePopover:n,...a}=t,o=Zb(Yb,n),s=Kb(n),i=Bo(r,o.triggerRef),l=e.jsx(ys.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":uy(o.open),...a,ref:i,onClick:od(t.onClick,o.onOpenToggle)});return o.hasCustomAnchor?l:e.jsx(Fb,{asChild:!0,...s,children:l})});Xb.displayName=Yb;var Qb="PopoverPortal",[ey,ty]=Wb(Qb,{forceMount:void 0}),ry=t=>{const{__scopePopover:r,forceMount:n,children:a,container:o}=t,s=Zb(Qb,r);return e.jsx(ey,{scope:r,forceMount:n,children:e.jsx(Nd,{present:n||s.open,children:e.jsx(_d,{asChild:!0,container:o,children:a})})})};ry.displayName=Qb;var ny="PopoverContent",ay=a.forwardRef((t,r)=>{const n=ty(ny,t.__scopePopover),{forceMount:a=n.forceMount,...o}=t,s=Zb(ny,t.__scopePopover);return e.jsx(Nd,{present:a||s.open,children:s.modal?e.jsx(sy,{...o,ref:r}):e.jsx(iy,{...o,ref:r})})});ay.displayName=ny;var oy=Vo("PopoverContent.RemoveScroll"),sy=a.forwardRef((t,r)=>{const n=Zb(ny,t.__scopePopover),o=a.useRef(null),s=Bo(r,o),i=a.useRef(!1);return a.useEffect(()=>{const e=o.current;if(e)return _f(e)},[]),e.jsx(Sf,{as:oy,allowPinchZoom:!0,children:e.jsx(ly,{...t,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:od(t.onCloseAutoFocus,e=>{e.preventDefault(),i.current||n.triggerRef.current?.focus()}),onPointerDownOutside:od(t.onPointerDownOutside,e=>{const t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey,n=2===t.button||r;i.current=n},{checkForDefaultPrevented:!1}),onFocusOutside:od(t.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),iy=a.forwardRef((t,r)=>{const n=Zb(ny,t.__scopePopover),o=a.useRef(!1),s=a.useRef(!1);return e.jsx(ly,{...t,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:e=>{t.onCloseAutoFocus?.(e),e.defaultPrevented||(o.current||n.triggerRef.current?.focus(),e.preventDefault()),o.current=!1,s.current=!1},onInteractOutside:e=>{t.onInteractOutside?.(e),e.defaultPrevented||(o.current=!0,"pointerdown"===e.detail.originalEvent.type&&(s.current=!0));const r=e.target,a=n.triggerRef.current?.contains(r);a&&e.preventDefault(),"focusin"===e.detail.originalEvent.type&&s.current&&e.preventDefault()}})}),ly=a.forwardRef((t,r)=>{const{__scopePopover:n,trapFocus:a,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:i,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onInteractOutside:d,...f}=t,m=Zb(ny,n),p=Kb(n);return Od(),e.jsx(Sd,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:o,onUnmountAutoFocus:s,children:e.jsx(gd,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:d,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onDismiss:()=>m.onOpenChange(!1),children:e.jsx(Bb,{"data-state":uy(m.open),role:"dialog",id:m.contentId,...p,...f,ref:r,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),cy="PopoverClose";a.forwardRef((t,r)=>{const{__scopePopover:n,...a}=t,o=Zb(cy,n);return e.jsx(ys.button,{type:"button",...a,ref:r,onClick:od(t.onClick,()=>o.onOpenChange(!1))})}).displayName=cy;function uy(e){return e?"open":"closed"}a.forwardRef((t,r)=>{const{__scopePopover:n,...a}=t,o=Kb(n);return e.jsx(Vb,{...o,...a,ref:r})}).displayName="PopoverArrow";var dy=ry,fy=ay;const my=qb,py=Xb,hy=a.forwardRef(({className:t,align:r="center",sideOffset:n=4,...o},s)=>{const{container:i}=a.useContext(ee);return e.jsx(dy,{container:i,children:e.jsx(fy,{ref:s,align:r,sideOffset:n,className:Uo("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...o})})});hy.displayName=fy.displayName;const gy={USD:"$",EUR:"€",JPY:"¥",GBP:"£",AUD:"A$",CAD:"C$",CHF:"CHF",CNY:"¥",SEK:"kr",NZD:"NZ$",INR:"₹",RUB:"₽",KRW:"₩",BRL:"R$",ZAR:"R",HKD:"HK$",SGD:"S$",MXN:"Mex$",NOK:"kr",TRY:"₺",IDR:"Rp",PLN:"zł",THB:"฿",ILS:"₪",PHP:"₱",MYR:"RM",CZK:"Kč",HUF:"Ft",DKK:"kr",PKR:"₨",EGP:"£",NGN:"₦",BDT:"৳",UAH:"₴",KZT:"₸",VND:"₫",ARS:"$",BGN:"лв",COP:"COL$",HRK:"kn",ISK:"kr",KES:"KSh",LKR:"Rs",MAD:"د.م.",MNT:"₮",NPR:"रू",RSD:"дин.",SAR:"ر.س",TWD:"NT$",UYU:"$U",YER:"﷼",FJD:"FJ$",JMD:"J$",HTG:"G",BHD:"ب.د",KWD:"د.ك",OMR:"ر.ع.",BND:"B$",KPW:"₩",GHS:"₵",SYP:"ل.س",SLL:"Le",SSP:"£",AFN:"؋",MGA:"Ar",MDL:"lei",FOK:"kr",GMD:"D",LTL:"Lt",LVL:"Ls",HNL:"L",GEL:"₾",BMD:"$",AWG:"Afl",BTN:"Nu",GTQ:"Q",TZS:"TSh",BBD:"Bds$",NAD:"N$",BZD:"$",JEP:"£",WST:"T",PGK:"K",KGS:"лв",AZN:"₼",QAR:"ر.ق",XOF:"CFA",XPF:"CFP"},vy={AF:"AFN",AX:"EUR",AL:"ALL",DZ:"DZD",AS:"USD",AD:"EUR",AO:"AOA",AI:"XCD",AQ:"USD",AG:"XCD",AR:"ARS",AM:"AMD",AW:"AWG",AU:"AUD",AT:"EUR",AZ:"AZN",BS:"BSD",BH:"BHD",BD:"BDT",BB:"BBD",BY:"BYN",BE:"EUR",BZ:"BZD",BJ:"XOF",BM:"BMD",BT:"BTN",BO:"BOB",BA:"BAM",BW:"BWP",BV:"NOK",BR:"BRL",IO:"USD",BN:"BND",BG:"BGN",BF:"XOF",BI:"BIF",KH:"KHR",CM:"XAF",CA:"CAD",CV:"CVE",KY:"KYD",CF:"XAF",TD:"XAF",CL:"CLP",CN:"CNY",CX:"AUD",CC:"AUD",CO:"COP",KM:"KMF",CG:"XAF",CD:"CDF",CK:"NZD",CR:"CRC",CI:"XOF",HR:"HRK",CU:"CUP",CY:"EUR",CZ:"CZK",DK:"DKK",DJ:"DJF",DM:"XCD",DO:"DOP",EC:"USD",EG:"EGP",SV:"USD",GQ:"XAF",ER:"ERN",EE:"EUR",ET:"ETB",FK:"FKP",FO:"DKK",FJ:"FJD",FI:"EUR",FR:"EUR",GF:"EUR",PF:"XPF",TF:"EUR",GA:"XAF",GM:"GMD",GE:"GEL",DE:"EUR",GH:"GHS",GI:"GIP",GR:"EUR",GL:"DKK",GD:"XCD",GP:"EUR",GU:"USD",GT:"GTQ",GG:"GBP",GN:"GNF",GW:"XOF",GY:"GYD",HT:"HTG",HM:"AUD",VA:"EUR",HN:"HNL",HK:"HKD",HU:"HUF",IS:"ISK",IN:"INR",ID:"IDR",IR:"IRR",IQ:"IQD",IE:"EUR",IM:"GBP",IL:"ILS",IT:"EUR",JM:"JMD",JP:"JPY",JE:"GBP",JO:"JOD",KZ:"KZT",KE:"KES",KI:"AUD",KP:"KPW",KR:"KRW",KW:"KWD",KG:"KGS",LA:"LAK",LV:"EUR",LB:"LBP",LS:"LSL",LR:"LRD",LY:"LYD",LI:"CHF",LT:"EUR",LU:"EUR",MO:"MOP",MK:"MKD",MG:"MGA",MW:"MWK",MY:"MYR",MV:"MVR",ML:"XOF",MT:"EUR",MH:"USD",MQ:"EUR",MR:"MRU",MU:"MUR",YT:"EUR",MX:"MXN",FM:"USD",MD:"MDL",MC:"EUR",MN:"MNT",ME:"EUR",MS:"XCD",MA:"MAD",MZ:"MZN",MM:"MMK",NA:"NAD",NR:"AUD",NP:"NPR",NL:"EUR",AN:"ANG",NC:"XPF",NZ:"NZD",NI:"NIO",NE:"XOF",NG:"NGN",NU:"NZD",NF:"AUD",MP:"USD",NO:"NOK",OM:"OMR",PK:"PKR",PW:"USD",PS:"ILS",PA:"PAB",PG:"PGK",PY:"PYG",PE:"PEN",PH:"PHP",PN:"NZD",PL:"PLN",PT:"EUR",PR:"USD",QA:"QAR",RE:"EUR",RO:"RON",RU:"RUB",RW:"RWF",SH:"SHP",KN:"XCD",LC:"XCD",PM:"EUR",VC:"XCD",WS:"WST",SM:"EUR",ST:"STN",SA:"SAR",SN:"XOF",RS:"RSD",SC:"SCR",SL:"SLL",SG:"SGD",SK:"EUR",SI:"EUR",SB:"SBD",SO:"SOS",ZA:"ZAR",GS:"GBP",ES:"EUR",LK:"LKR",SD:"SDG",SR:"SRD",SJ:"NOK",SZ:"SZL",SE:"SEK",CH:"CHF",SY:"SYP",TW:"TWD",TJ:"TJS",TZ:"TZS",TH:"THB"},by=[{name:"Afghanistan",code:"AF"},{name:"land Islands",code:"AX"},{name:"Albania",code:"AL"},{name:"Algeria",code:"DZ"},{name:"American Samoa",code:"AS"},{name:"AndorrA",code:"AD"},{name:"Angola",code:"AO"},{name:"Anguilla",code:"AI"},{name:"Antarctica",code:"AQ"},{name:"Antigua and Barbuda",code:"AG"},{name:"Argentina",code:"AR"},{name:"Armenia",code:"AM"},{name:"Aruba",code:"AW"},{name:"Australia",code:"AU"},{name:"Austria",code:"AT"},{name:"Azerbaijan",code:"AZ"},{name:"Bahamas",code:"BS"},{name:"Bahrain",code:"BH"},{name:"Bangladesh",code:"BD"},{name:"Barbados",code:"BB"},{name:"Belarus",code:"BY"},{name:"Belgium",code:"BE"},{name:"Belize",code:"BZ"},{name:"Benin",code:"BJ"},{name:"Bermuda",code:"BM"},{name:"Bhutan",code:"BT"},{name:"Bolivia",code:"BO"},{name:"Bosnia and Herzegovina",code:"BA"},{name:"Botswana",code:"BW"},{name:"Bouvet Island",code:"BV"},{name:"Brazil",code:"BR"},{name:"British Indian Ocean Territory",code:"IO"},{name:"Brunei Darussalam",code:"BN"},{name:"Bulgaria",code:"BG"},{name:"Burkina Faso",code:"BF"},{name:"Burundi",code:"BI"},{name:"Cambodia",code:"KH"},{name:"Cameroon",code:"CM"},{name:"Canada",code:"CA"},{name:"Cape Verde",code:"CV"},{name:"Cayman Islands",code:"KY"},{name:"Central African Republic",code:"CF"},{name:"Chad",code:"TD"},{name:"Chile",code:"CL"},{name:"China",code:"CN"},{name:"Christmas Island",code:"CX"},{name:"Cocos (Keeling) Islands",code:"CC"},{name:"Colombia",code:"CO"},{name:"Comoros",code:"KM"},{name:"Congo",code:"CG"},{name:"Congo, The Democratic Republic of the",code:"CD"},{name:"Cook Islands",code:"CK"},{name:"Costa Rica",code:"CR"},{name:"Cote D Ivoire",code:"CI"},{name:"Croatia",code:"HR"},{name:"Cuba",code:"CU"},{name:"Cyprus",code:"CY"},{name:"Czech Republic",code:"CZ"},{name:"Denmark",code:"DK"},{name:"Djibouti",code:"DJ"},{name:"Dominica",code:"DM"},{name:"Dominican Republic",code:"DO"},{name:"Ecuador",code:"EC"},{name:"Egypt",code:"EG"},{name:"El Salvador",code:"SV"},{name:"Equatorial Guinea",code:"GQ"},{name:"Eritrea",code:"ER"},{name:"Estonia",code:"EE"},{name:"Ethiopia",code:"ET"},{name:"Falkland Islands (Malvinas)",code:"FK"},{name:"Faroe Islands",code:"FO"},{name:"Fiji",code:"FJ"},{name:"Finland",code:"FI"},{name:"France",code:"FR"},{name:"French Guiana",code:"GF"},{name:"French Polynesia",code:"PF"},{name:"French Southern Territories",code:"TF"},{name:"Gabon",code:"GA"},{name:"Gambia",code:"GM"},{name:"Georgia",code:"GE"},{name:"Germany",code:"DE"},{name:"Ghana",code:"GH"},{name:"Gibraltar",code:"GI"},{name:"Greece",code:"GR"},{name:"Greenland",code:"GL"},{name:"Grenada",code:"GD"},{name:"Guadeloupe",code:"GP"},{name:"Guam",code:"GU"},{name:"Guatemala",code:"GT"},{name:"Guernsey",code:"GG"},{name:"Guinea",code:"GN"},{name:"Guinea-Bissau",code:"GW"},{name:"Guyana",code:"GY"},{name:"Haiti",code:"HT"},{name:"Heard Island and Mcdonald Islands",code:"HM"},{name:"Holy See (Vatican City State)",code:"VA"},{name:"Honduras",code:"HN"},{name:"Hong Kong",code:"HK"},{name:"Hungary",code:"HU"},{name:"Iceland",code:"IS"},{name:"India",code:"IN"},{name:"Indonesia",code:"ID"},{name:"Iran, Islamic Republic Of",code:"IR"},{name:"Iraq",code:"IQ"},{name:"Ireland",code:"IE"},{name:"Isle of Man",code:"IM"},{name:"Israel",code:"IL"},{name:"Italy",code:"IT"},{name:"Jamaica",code:"JM"},{name:"Japan",code:"JP"},{name:"Jersey",code:"JE"},{name:"Jordan",code:"JO"},{name:"Kazakhstan",code:"KZ"},{name:"Kenya",code:"KE"},{name:"Kiribati",code:"KI"},{name:'Korea, Democratic People"S Republic of',code:"KP"},{name:"Korea, Republic of",code:"KR"},{name:"Kuwait",code:"KW"},{name:"Kyrgyzstan",code:"KG"},{name:'Lao People"S Democratic Republic',code:"LA"},{name:"Latvia",code:"LV"},{name:"Lebanon",code:"LB"},{name:"Lesotho",code:"LS"},{name:"Liberia",code:"LR"},{name:"Libyan Arab Jamahiriya",code:"LY"},{name:"Liechtenstein",code:"LI"},{name:"Lithuania",code:"LT"},{name:"Luxembourg",code:"LU"},{name:"Macao",code:"MO"},{name:"Macedonia, The Former Yugoslav Republic of",code:"MK"},{name:"Madagascar",code:"MG"},{name:"Malawi",code:"MW"},{name:"Malaysia",code:"MY"},{name:"Maldives",code:"MV"},{name:"Mali",code:"ML"},{name:"Malta",code:"MT"},{name:"Marshall Islands",code:"MH"},{name:"Martinique",code:"MQ"},{name:"Mauritania",code:"MR"},{name:"Mauritius",code:"MU"},{name:"Mayotte",code:"YT"},{name:"Mexico",code:"MX"},{name:"Micronesia, Federated States of",code:"FM"},{name:"Moldova, Republic of",code:"MD"},{name:"Monaco",code:"MC"},{name:"Mongolia",code:"MN"},{name:"Montenegro",code:"ME"},{name:"Montserrat",code:"MS"},{name:"Morocco",code:"MA"},{name:"Mozambique",code:"MZ"},{name:"Myanmar",code:"MM"},{name:"Namibia",code:"NA"},{name:"Nauru",code:"NR"},{name:"Nepal",code:"NP"},{name:"Netherlands",code:"NL"},{name:"Netherlands Antilles",code:"AN"},{name:"New Caledonia",code:"NC"},{name:"New Zealand",code:"NZ"},{name:"Nicaragua",code:"NI"},{name:"Niger",code:"NE"},{name:"Nigeria",code:"NG"},{name:"Niue",code:"NU"},{name:"Norfolk Island",code:"NF"},{name:"Northern Mariana Islands",code:"MP"},{name:"Norway",code:"NO"},{name:"Oman",code:"OM"},{name:"Pakistan",code:"PK"},{name:"Palau",code:"PW"},{name:"Palestinian Territory, Occupied",code:"PS"},{name:"Panama",code:"PA"},{name:"Papua New Guinea",code:"PG"},{name:"Paraguay",code:"PY"},{name:"Peru",code:"PE"},{name:"Philippines",code:"PH"},{name:"Pitcairn",code:"PN"},{name:"Poland",code:"PL"},{name:"Portugal",code:"PT"},{name:"Puerto Rico",code:"PR"},{name:"Qatar",code:"QA"},{name:"Reunion",code:"RE"},{name:"Romania",code:"RO"},{name:"Russian Federation",code:"RU"},{name:"RWANDA",code:"RW"},{name:"Saint Helena",code:"SH"},{name:"Saint Kitts and Nevis",code:"KN"},{name:"Saint Lucia",code:"LC"},{name:"Saint Pierre and Miquelon",code:"PM"},{name:"Saint Vincent and the Grenadines",code:"VC"},{name:"Samoa",code:"WS"},{name:"San Marino",code:"SM"},{name:"Sao Tome and Principe",code:"ST"},{name:"Saudi Arabia",code:"SA"},{name:"Senegal",code:"SN"},{name:"Serbia",code:"RS"},{name:"Seychelles",code:"SC"},{name:"Sierra Leone",code:"SL"},{name:"Singapore",code:"SG"},{name:"Slovakia",code:"SK"},{name:"Slovenia",code:"SI"},{name:"Solomon Islands",code:"SB"},{name:"Somalia",code:"SO"},{name:"South Africa",code:"ZA"},{name:"South Georgia and the South Sandwich Islands",code:"GS"},{name:"Spain",code:"ES"},{name:"Sri Lanka",code:"LK"},{name:"Sudan",code:"SD"},{name:"Suriname",code:"SR"},{name:"Svalbard and Jan Mayen",code:"SJ"},{name:"Swaziland",code:"SZ"},{name:"Sweden",code:"SE"},{name:"Switzerland",code:"CH"},{name:"Syrian Arab Republic",code:"SY"},{name:"Taiwan, Province of China",code:"TW"},{name:"Tajikistan",code:"TJ"},{name:"Tanzania, United Republic of",code:"TZ"},{name:"Thailand",code:"TH"},{name:"Timor-Leste",code:"TL"},{name:"Togo",code:"TG"},{name:"Tokelau",code:"TK"},{name:"Tonga",code:"TO"},{name:"Trinidad and Tobago",code:"TT"},{name:"Tunisia",code:"TN"},{name:"Turkey",code:"TR"},{name:"Turkmenistan",code:"TM"},{name:"Turks and Caicos Islands",code:"TC"},{name:"Tuvalu",code:"TV"},{name:"Uganda",code:"UG"},{name:"Ukraine",code:"UA"},{name:"United Arab Emirates",code:"AE"},{name:"United Kingdom",code:"GB"},{name:"United States",code:"US"},{name:"United States Minor Outlying Islands",code:"UM"},{name:"Uruguay",code:"UY"},{name:"Uzbekistan",code:"UZ"},{name:"Vanuatu",code:"VU"},{name:"Venezuela",code:"VE"},{name:"Viet Nam",code:"VN"},{name:"Virgin Islands, British",code:"VG"},{name:"Virgin Islands, U.S.",code:"VI"},{name:"Wallis and Futuna",code:"WF"},{name:"Western Sahara",code:"EH"},{name:"Yemen",code:"YE"},{name:"Zambia",code:"ZM"},{name:"Zimbabwe",code:"ZW"}].map(e=>{const t=vy[e.code]||"USD",r=gy[t]||"";return{value:e.code,flag:(n=e.code,n.toUpperCase().replace(/./g,e=>String.fromCodePoint(127397+e.charCodeAt(0)))),text:e.name,currencyCode:t,currencyIcon:r};var n});function yy(r){const[n,a]=t.useState(r.value||""),[o,s]=t.useState(!1),i=by.find(e=>e.value==n);return e.jsxs(my,{open:o,onOpenChange:s,children:[e.jsx(py,{asChild:!0,children:e.jsxs(bs,{variant:"outline",role:"combobox","aria-expanded":o,className:"justify-between overflow-hidden text-ellipsis",children:[i?.text&&e.jsxs("div",{children:[String(i.text).trim(),e.jsx("span",{className:"ml-2 text-xs text-muted-foreground",children:i.flag})]}),!i&&e.jsx("span",{className:"text-muted-foreground",children:"Choose country"}),e.jsx(os,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),e.jsx(hy,{className:"p-0 overflow-hidden text-ellipsis",children:e.jsxs(Eg,{children:[e.jsx(Cg,{placeholder:"Choose country..."}),e.jsx(Tg,{children:e.jsx(jg,{children:by.map(t=>e.jsxs(_g,{className:Uo("whitespace-nowrap text-left",{"text-green-500":n===t.value}),value:t.value,defaultValue:t.value,onSelect:e=>{const n=t.value;a(n),r.onChange&&"function"==typeof r.onChange&&r.onChange(n),s(!1)},children:[n===t.value&&e.jsx(as,{className:Uo("mr-2 h-4 w-4 text-green-400",n===t.value?"opacity-100":"opacity-0")}),String(t.text).trim(),e.jsx("span",{className:"ml-2 text-xs text-muted-foreground",children:t.flag})]},t.value))})})]})})]})}const wy=by.map(e=>({value:e.currencyCode,text:e.currencyCode,icon:e.currencyIcon??null})),xy=Array.from(new Set(wy.map(e=>e.value))).map(e=>wy.find(t=>t.value===e)).filter(e=>void 0!==e);function Sy(r){const[n,a]=t.useState(r.value||""),[o,s]=t.useState(!1),i=xy.find(e=>e.value==n);return e.jsxs(my,{open:o,onOpenChange:s,children:[e.jsx(py,{asChild:!0,children:e.jsxs(bs,{variant:"outline",role:"combobox","aria-expanded":o,className:"justify-between overflow-hidden text-ellipsis",children:[i?.text&&e.jsxs("div",{children:[String(i.text).trim(),e.jsx("span",{className:"ml-2 text-xs text-muted-foreground",children:i.icon})]}),!i&&e.jsx("span",{className:"text-muted-foreground",children:"Choose Currency"}),e.jsx(os,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),e.jsx(hy,{className:"p-0 overflow-hidden text-ellipsis",children:e.jsxs(Eg,{children:[e.jsx(Cg,{placeholder:"Choose currency..."}),e.jsx(Tg,{children:e.jsx(jg,{children:xy.map(t=>e.jsxs(_g,{className:Uo("whitespace-nowrap text-left",{"text-green-500":n===t.value}),value:t.value,defaultValue:t.value,onSelect:e=>{const n=t.value;a(n),r.onChange&&"function"==typeof r.onChange&&r.onChange(n),s(!1)},children:[n===t.value&&e.jsx(as,{className:Uo("mr-2 h-4 w-4 text-green-400",n===t.value?"opacity-100":"opacity-0")}),String(t.text).trim(),e.jsx("span",{className:"ml-2 text-xs text-muted-foreground",children:t.icon})]},t.value))})})]})})]})}let ky=[{code:"en",label:"English",flag:"🇬🇧"},{code:"en-GB",label:"English (United Kingdom)",flag:"🇬🇧"},{code:"en-US",label:"English (United States)",flag:"🇺🇸"},{code:"en-AU",label:"English (Australia)",flag:"🇦🇺"},{code:"en-CA",label:"English (Canada)",flag:"🇨🇦"},{code:"en-NZ",label:"English (New Zealand)",flag:"🇳🇿"},{code:"es",label:"Spanish",flag:"🇪🇸"},{code:"es-ES",label:"Spanish (Spain)",flag:"🇪🇸"},{code:"es-MX",label:"Spanish (Mexico)",flag:"🇲🇽"},{code:"fr",label:"French",flag:"🇫🇷"},{code:"fr-FR",label:"French (France)",flag:"🇫🇷"},{code:"de",label:"German",flag:"🇩🇪"},{code:"de-DE",label:"German (Germany)",flag:"🇩🇪"},{code:"it",label:"Italian",flag:"🇮🇹"},{code:"it-IT",label:"Italian (Italy)",flag:"🇮🇹"},{code:"pt",label:"Portuguese",flag:"🇵🇹"},{code:"pt-PT",label:"Portuguese (Portugal)",flag:"🇵🇹"},{code:"pt-BR",label:"Portuguese (Brazil)",flag:"🇧🇷"},{code:"ru",label:"Russian",flag:"🇷🇺"},{code:"ru-RU",label:"Russian (Russia)",flag:"🇷🇺"},{code:"zh",label:"Chinese",flag:"🇨🇳"},{code:"zh-CN",label:"Chinese (Simplified)",flag:"🇨🇳"},{code:"zh-TW",label:"Chinese (Traditional)",flag:"🇹🇼"},{code:"ja",label:"Japanese",flag:"🇯🇵"},{code:"ja-JP",label:"Japanese (Japan)",flag:"🇯🇵"},{code:"ko",label:"Korean",flag:"🇰🇷"},{code:"ko-KR",label:"Korean (South Korea)",flag:"🇰🇷"},{code:"ar",label:"Arabic",flag:"🇸🇦"},{code:"ar-SA",label:"Arabic (Saudi Arabia)",flag:"🇸🇦"},{code:"hi",label:"Hindi",flag:"🇮🇳"},{code:"hi-IN",label:"Hindi (India)",flag:"🇮🇳"},{code:"bn",label:"Bengali",flag:"🇮🇳"},{code:"bn-IN",label:"Bengali (India)",flag:"🇮🇳"},{code:"gu",label:"Gujarati",flag:"🇮🇳"},{code:"gu-IN",label:"Gujarati (India)",flag:"🇮🇳"},{code:"ta",label:"Tamil",flag:"🇮🇳"},{code:"ta-IN",label:"Tamil (India)",flag:"🇮🇳"},{code:"te",label:"Telugu",flag:"🇮🇳"},{code:"te-IN",label:"Telugu (India)",flag:"🇮🇳"},{code:"ml",label:"Malayalam",flag:"🇮🇳"},{code:"ml-IN",label:"Malayalam (India)",flag:"🇮🇳"},{code:"kn",label:"Kannada",flag:"🇮🇳"},{code:"kn-IN",label:"Kannada (India)",flag:"🇮🇳"},{code:"mr",label:"Marathi",flag:"🇮🇳"},{code:"mr-IN",label:"Marathi (India)",flag:"🇮🇳"},{code:"pa",label:"Punjabi",flag:"🇮🇳"},{code:"pa-IN",label:"Punjabi (India)",flag:"🇮🇳"},{code:"ur",label:"Urdu",flag:"🇮🇳"},{code:"ur-IN",label:"Urdu (India)",flag:"🇮🇳"},{code:"or",label:"Odia",flag:"🇮🇳"},{code:"or-IN",label:"Odia (India)",flag:"🇮🇳"},{code:"as",label:"Assamese",flag:"🇮🇳"},{code:"as-IN",label:"Assamese (India)",flag:"🇮🇳"},{code:"zh-HK",label:"Chinese (Hong Kong)",flag:"🇭🇰"},{code:"nl",label:"Dutch",flag:"🇳🇱"},{code:"nl-NL",label:"Dutch (Netherlands)",flag:"🇳🇱"},{code:"pl",label:"Polish",flag:"🇵🇱"},{code:"pl-PL",label:"Polish (Poland)",flag:"🇵🇱"},{code:"sv",label:"Swedish",flag:"🇸🇪"},{code:"sv-SE",label:"Swedish (Sweden)",flag:"🇸🇪"},{code:"da",label:"Danish",flag:"🇩🇰"},{code:"da-DK",label:"Danish (Denmark)",flag:"🇩🇰"},{code:"no",label:"Norwegian",flag:"🇳🇴"},{code:"no-NO",label:"Norwegian (Norway)",flag:"🇳🇴"},{code:"fi",label:"Finnish",flag:"🇫🇮"},{code:"fi-FI",label:"Finnish (Finland)",flag:"🇫🇮"},{code:"tr",label:"Turkish",flag:"🇹🇷"},{code:"tr-TR",label:"Turkish (Turkey)",flag:"🇹🇷"},{code:"cs",label:"Czech",flag:"🇨🇿"},{code:"cs-CZ",label:"Czech (Czech Republic)",flag:"🇨🇿"},{code:"sk",label:"Slovak",flag:"🇸🇰"},{code:"sk-SK",label:"Slovak (Slovakia)",flag:"🇸🇰"},{code:"hu",label:"Hungarian",flag:"🇭🇺"},{code:"hu-HU",label:"Hungarian (Hungary)",flag:"🇭🇺"},{code:"ro",label:"Romanian",flag:"🇷🇴"},{code:"ro-RO",label:"Romanian (Romania)",flag:"🇷🇴"},{code:"el",label:"Greek",flag:"🇬🇷"},{code:"el-GR",label:"Greek (Greece)",flag:"🇬🇷"},{code:"th",label:"Thai",flag:"🇹🇭"},{code:"th-TH",label:"Thai (Thailand)",flag:"🇹🇭"},{code:"id",label:"Indonesian",flag:"🇮🇩"},{code:"id-ID",label:"Indonesian (Indonesia)",flag:"🇮🇩"},{code:"ms",label:"Malay",flag:"🇲🇾"},{code:"ms-MY",label:"Malay (Malaysia)",flag:"🇲🇾"},{code:"vi",label:"Vietnamese",flag:"🇻🇳"},{code:"vi-VN",label:"Vietnamese (Vietnam)",flag:"🇻🇳"},{code:"he",label:"Hebrew",flag:"🇮🇱"},{code:"he-IL",label:"Hebrew (Israel)",flag:"🇮🇱"}];ky=ky.filter((e,t,r)=>t===r.findIndex(t=>t.code===e.code&&t.label===e.label)),ky.sort((e,t)=>e.label<t.label?-1:e.label>t.label?1:0);const Ay=ky.filter(e=>function(e){try{const t=new Intl.DateTimeFormat(e);return t.resolvedOptions().locale===e||t.resolvedOptions().locale.startsWith(e)}catch{return!1}}(e.code)).filter((e,t,r)=>t===r.findIndex(t=>t.code===e.code&&t.label===e.label)).map(e=>({value:e.code,label:e.label,flag:e.flag}));function Ey(r){const[n,a]=t.useState(r.value||""),[o,s]=t.useState(!1),i=Ay.find(e=>e.value==n);return e.jsxs(my,{open:o,onOpenChange:s,children:[e.jsx(py,{asChild:!0,children:e.jsxs(bs,{variant:"outline",role:"combobox","aria-expanded":o,className:"justify-between overflow-hidden text-ellipsis",children:[i&&e.jsxs("div",{children:[String(i.label).trim(),e.jsx("span",{className:"ml-2 text-xs text-muted-foreground",children:i.flag})]}),!i&&"Choose language",e.jsx(os,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),e.jsx(hy,{className:"p-0 overflow-hidden text-ellipsis",children:e.jsxs(Eg,{children:[e.jsx(Cg,{placeholder:"Choose timezone..."}),e.jsx(Tg,{children:e.jsx(jg,{children:Ay.map(t=>e.jsxs(_g,{className:Uo("whitespace-nowrap text-left",{"text-green-500":n===t.value}),value:t.value,defaultValue:t.value,onSelect:e=>{const n=t.value;a(n),r.onChange&&"function"==typeof r.onChange&&r.onChange(n),s(!1)},children:[n===t.value&&e.jsx(as,{className:Uo("mr-2 h-4 w-4 text-green-400",n===t.value?"opacity-100":"opacity-0")}),String(t.label).trim(),e.jsx("span",{className:"ml-2 text-xs text-muted-foreground",children:t.flag})]},t.value))})})]})})]})}const Cy=[{value:"Dateline Standard Time",abbr:"DST",offset:-12,isdst:!1,text:"(UTC-12:00) International Date Line West",utc:["Etc/GMT+12"]},{value:"UTC-11",abbr:"U",offset:-11,isdst:!1,text:"(UTC-11:00) Coordinated Universal Time-11",utc:["Etc/GMT+11","Pacific/Midway","Pacific/Niue","Pacific/Pago_Pago"]},{value:"Hawaiian Standard Time",abbr:"HST",offset:-10,isdst:!1,text:"(UTC-10:00) Hawaii",utc:["Etc/GMT+10","Pacific/Honolulu","Pacific/Johnston","Pacific/Rarotonga","Pacific/Tahiti"]},{value:"Alaskan Standard Time",abbr:"AKDT",offset:-8,isdst:!0,text:"(UTC-09:00) Alaska",utc:["America/Anchorage","America/Juneau","America/Nome","America/Sitka","America/Yakutat"]},{value:"Pacific Standard Time (Mexico)",abbr:"PDT",offset:-7,isdst:!0,text:"(UTC-08:00) Baja California",utc:["America/Santa_Isabel"]},{value:"Pacific Daylight Time",abbr:"PDT",offset:-7,isdst:!0,text:"(UTC-07:00) Pacific Daylight Time (US & Canada)",utc:["America/Los_Angeles","America/Tijuana","America/Vancouver"]},{value:"Pacific Standard Time",abbr:"PST",offset:-8,isdst:!1,text:"(UTC-08:00) Pacific Standard Time (US & Canada)",utc:["America/Los_Angeles","America/Tijuana","America/Vancouver","PST8PDT"]},{value:"US Mountain Standard Time",abbr:"UMST",offset:-7,isdst:!1,text:"(UTC-07:00) Arizona",utc:["America/Creston","America/Dawson","America/Dawson_Creek","America/Hermosillo","America/Phoenix","America/Whitehorse","Etc/GMT+7"]},{value:"Mountain Standard Time (Mexico)",abbr:"MDT",offset:-6,isdst:!0,text:"(UTC-07:00) Chihuahua, La Paz, Mazatlan",utc:["America/Chihuahua","America/Mazatlan"]},{value:"Mountain Standard Time",abbr:"MDT",offset:-6,isdst:!0,text:"(UTC-07:00) Mountain Time (US & Canada)",utc:["America/Boise","America/Cambridge_Bay","America/Denver","America/Edmonton","America/Inuvik","America/Ojinaga","America/Yellowknife","MST7MDT"]},{value:"Central America Standard Time",abbr:"CAST",offset:-6,isdst:!1,text:"(UTC-06:00) Central America",utc:["America/Belize","America/Costa_Rica","America/El_Salvador","America/Guatemala","America/Managua","America/Tegucigalpa","Etc/GMT+6","Pacific/Galapagos"]},{value:"Central Standard Time",abbr:"CDT",offset:-5,isdst:!0,text:"(UTC-06:00) Central Time (US & Canada)",utc:["America/Chicago","America/Indiana/Knox","America/Indiana/Tell_City","America/Matamoros","America/Menominee","America/North_Dakota/Beulah","America/North_Dakota/Center","America/North_Dakota/New_Salem","America/Rainy_River","America/Rankin_Inlet","America/Resolute","America/Winnipeg","CST6CDT"]},{value:"Central Standard Time (Mexico)",abbr:"CDT",offset:-5,isdst:!0,text:"(UTC-06:00) Guadalajara, Mexico City, Monterrey",utc:["America/Bahia_Banderas","America/Cancun","America/Merida","America/Mexico_City","America/Monterrey"]},{value:"Canada Central Standard Time",abbr:"CCST",offset:-6,isdst:!1,text:"(UTC-06:00) Saskatchewan",utc:["America/Regina","America/Swift_Current"]},{value:"SA Pacific Standard Time",abbr:"SPST",offset:-5,isdst:!1,text:"(UTC-05:00) Bogota, Lima, Quito",utc:["America/Bogota","America/Cayman","America/Coral_Harbour","America/Eirunepe","America/Guayaquil","America/Jamaica","America/Lima","America/Panama","America/Rio_Branco","Etc/GMT+5"]},{value:"Eastern Standard Time",abbr:"EST",offset:-5,isdst:!1,text:"(UTC-05:00) Eastern Time (US & Canada)",utc:["America/Detroit","America/Havana","America/Indiana/Petersburg","America/Indiana/Vincennes","America/Indiana/Winamac","America/Iqaluit","America/Kentucky/Monticello","America/Louisville","America/Montreal","America/Nassau","America/New_York","America/Nipigon","America/Pangnirtung","America/Port-au-Prince","America/Thunder_Bay","America/Toronto"]},{value:"Eastern Daylight Time",abbr:"EDT",offset:-4,isdst:!0,text:"(UTC-04:00) Eastern Daylight Time (US & Canada)",utc:["America/Detroit","America/Havana","America/Indiana/Petersburg","America/Indiana/Vincennes","America/Indiana/Winamac","America/Iqaluit","America/Kentucky/Monticello","America/Louisville","America/Montreal","America/Nassau","America/New_York","America/Nipigon","America/Pangnirtung","America/Port-au-Prince","America/Thunder_Bay","America/Toronto"]},{value:"US Eastern Standard Time",abbr:"UEDT",offset:-5,isdst:!1,text:"(UTC-05:00) Indiana (East)",utc:["America/Indiana/Marengo","America/Indiana/Vevay","America/Indianapolis"]},{value:"Venezuela Standard Time",abbr:"VST",offset:-4.5,isdst:!1,text:"(UTC-04:30) Caracas",utc:["America/Caracas"]},{value:"Paraguay Standard Time",abbr:"PYT",offset:-4,isdst:!1,text:"(UTC-04:00) Asuncion",utc:["America/Asuncion"]},{value:"Atlantic Standard Time",abbr:"ADT",offset:-3,isdst:!0,text:"(UTC-04:00) Atlantic Time (Canada)",utc:["America/Glace_Bay","America/Goose_Bay","America/Halifax","America/Moncton","America/Thule","Atlantic/Bermuda"]},{value:"Central Brazilian Standard Time",abbr:"CBST",offset:-4,isdst:!1,text:"(UTC-04:00) Cuiaba",utc:["America/Campo_Grande","America/Cuiaba"]},{value:"SA Western Standard Time",abbr:"SWST",offset:-4,isdst:!1,text:"(UTC-04:00) Georgetown, La Paz, Manaus, San Juan",utc:["America/Anguilla","America/Antigua","America/Aruba","America/Barbados","America/Blanc-Sablon","America/Boa_Vista","America/Curacao","America/Dominica","America/Grand_Turk","America/Grenada","America/Guadeloupe","America/Guyana","America/Kralendijk","America/La_Paz","America/Lower_Princes","America/Manaus","America/Marigot","America/Martinique","America/Montserrat","America/Port_of_Spain","America/Porto_Velho","America/Puerto_Rico","America/Santo_Domingo","America/St_Barthelemy","America/St_Kitts","America/St_Lucia","America/St_Thomas","America/St_Vincent","America/Tortola","Etc/GMT+4"]},{value:"Pacific SA Standard Time",abbr:"PSST",offset:-4,isdst:!1,text:"(UTC-04:00) Santiago",utc:["America/Santiago","Antarctica/Palmer"]},{value:"Newfoundland Standard Time",abbr:"NDT",offset:-2.5,isdst:!0,text:"(UTC-03:30) Newfoundland",utc:["America/St_Johns"]},{value:"E. South America Standard Time",abbr:"ESAST",offset:-3,isdst:!1,text:"(UTC-03:00) Brasilia",utc:["America/Sao_Paulo"]},{value:"Argentina Standard Time",abbr:"AST",offset:-3,isdst:!1,text:"(UTC-03:00) Buenos Aires",utc:["America/Argentina/Buenos_Aires","America/Argentina/Catamarca","America/Argentina/Cordoba","America/Argentina/Jujuy","America/Argentina/La_Rioja","America/Argentina/Mendoza","America/Argentina/Rio_Gallegos","America/Argentina/Salta","America/Argentina/San_Juan","America/Argentina/San_Luis","America/Argentina/Tucuman","America/Argentina/Ushuaia","America/Buenos_Aires","America/Catamarca","America/Cordoba","America/Jujuy","America/Mendoza"]},{value:"SA Eastern Standard Time",abbr:"SEST",offset:-3,isdst:!1,text:"(UTC-03:00) Cayenne, Fortaleza",utc:["America/Araguaina","America/Belem","America/Cayenne","America/Fortaleza","America/Maceio","America/Paramaribo","America/Recife","America/Santarem","Antarctica/Rothera","Atlantic/Stanley","Etc/GMT+3"]},{value:"Greenland Standard Time",abbr:"GDT",offset:-3,isdst:!0,text:"(UTC-03:00) Greenland",utc:["America/Godthab"]},{value:"Montevideo Standard Time",abbr:"MST",offset:-3,isdst:!1,text:"(UTC-03:00) Montevideo",utc:["America/Montevideo"]},{value:"Bahia Standard Time",abbr:"BST",offset:-3,isdst:!1,text:"(UTC-03:00) Salvador",utc:["America/Bahia"]},{value:"UTC-02",abbr:"U",offset:-2,isdst:!1,text:"(UTC-02:00) Coordinated Universal Time-02",utc:["America/Noronha","Atlantic/South_Georgia","Etc/GMT+2"]},{value:"Mid-Atlantic Standard Time",abbr:"MDT",offset:-1,isdst:!0,text:"(UTC-02:00) Mid-Atlantic - Old",utc:[]},{value:"Azores Standard Time",abbr:"ADT",offset:0,isdst:!0,text:"(UTC-01:00) Azores",utc:["America/Scoresbysund","Atlantic/Azores"]},{value:"Cape Verde Standard Time",abbr:"CVST",offset:-1,isdst:!1,text:"(UTC-01:00) Cape Verde Is.",utc:["Atlantic/Cape_Verde","Etc/GMT+1"]},{value:"Morocco Standard Time",abbr:"MDT",offset:1,isdst:!0,text:"(UTC) Casablanca",utc:["Africa/Casablanca","Africa/El_Aaiun"]},{value:"UTC",abbr:"UTC",offset:0,isdst:!1,text:"(UTC) Coordinated Universal Time",utc:["America/Danmarkshavn","Etc/GMT"]},{value:"GMT Standard Time",abbr:"GMT",offset:0,isdst:!1,text:"(UTC) Edinburgh, London",utc:["Europe/Isle_of_Man","Europe/Guernsey","Europe/Jersey","Europe/London"]},{value:"British Summer Time",abbr:"BST",offset:1,isdst:!0,text:"(UTC+01:00) Edinburgh, London",utc:["Europe/Isle_of_Man","Europe/Guernsey","Europe/Jersey","Europe/London"]},{value:"GMT Standard Time",abbr:"GDT",offset:1,isdst:!0,text:"(UTC) Dublin, Lisbon",utc:["Atlantic/Canary","Atlantic/Faeroe","Atlantic/Madeira","Europe/Dublin","Europe/Lisbon"]},{value:"Greenwich Standard Time",abbr:"GST",offset:0,isdst:!1,text:"(UTC) Monrovia, Reykjavik",utc:["Africa/Abidjan","Africa/Accra","Africa/Bamako","Africa/Banjul","Africa/Bissau","Africa/Conakry","Africa/Dakar","Africa/Freetown","Africa/Lome","Africa/Monrovia","Africa/Nouakchott","Africa/Ouagadougou","Africa/Sao_Tome","Atlantic/Reykjavik","Atlantic/St_Helena"]},{value:"W. Europe Standard Time",abbr:"WEDT",offset:2,isdst:!0,text:"(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna",utc:["Arctic/Longyearbyen","Europe/Amsterdam","Europe/Andorra","Europe/Berlin","Europe/Busingen","Europe/Gibraltar","Europe/Luxembourg","Europe/Malta","Europe/Monaco","Europe/Oslo","Europe/Rome","Europe/San_Marino","Europe/Stockholm","Europe/Vaduz","Europe/Vatican","Europe/Vienna","Europe/Zurich"]},{value:"Central Europe Standard Time",abbr:"CEDT",offset:2,isdst:!0,text:"(UTC+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague",utc:["Europe/Belgrade","Europe/Bratislava","Europe/Budapest","Europe/Ljubljana","Europe/Podgorica","Europe/Prague","Europe/Tirane"]},{value:"Romance Standard Time",abbr:"RDT",offset:2,isdst:!0,text:"(UTC+01:00) Brussels, Copenhagen, Madrid, Paris",utc:["Africa/Ceuta","Europe/Brussels","Europe/Copenhagen","Europe/Madrid","Europe/Paris"]},{value:"Central European Standard Time",abbr:"CEDT",offset:2,isdst:!0,text:"(UTC+01:00) Sarajevo, Skopje, Warsaw, Zagreb",utc:["Europe/Sarajevo","Europe/Skopje","Europe/Warsaw","Europe/Zagreb"]},{value:"W. Central Africa Standard Time",abbr:"WCAST",offset:1,isdst:!1,text:"(UTC+01:00) West Central Africa",utc:["Africa/Algiers","Africa/Bangui","Africa/Brazzaville","Africa/Douala","Africa/Kinshasa","Africa/Lagos","Africa/Libreville","Africa/Luanda","Africa/Malabo","Africa/Ndjamena","Africa/Niamey","Africa/Porto-Novo","Africa/Tunis","Etc/GMT-1"]},{value:"Namibia Standard Time",abbr:"NST",offset:1,isdst:!1,text:"(UTC+01:00) Windhoek",utc:["Africa/Windhoek"]},{value:"GTB Standard Time",abbr:"GDT",offset:3,isdst:!0,text:"(UTC+02:00) Athens, Bucharest",utc:["Asia/Nicosia","Europe/Athens","Europe/Bucharest","Europe/Chisinau"]},{value:"Middle East Standard Time",abbr:"MEDT",offset:3,isdst:!0,text:"(UTC+02:00) Beirut",utc:["Asia/Beirut"]},{value:"Egypt Standard Time",abbr:"EST",offset:2,isdst:!1,text:"(UTC+02:00) Cairo",utc:["Africa/Cairo"]},{value:"Syria Standard Time",abbr:"SDT",offset:3,isdst:!0,text:"(UTC+02:00) Damascus",utc:["Asia/Damascus"]},{value:"E. Europe Standard Time",abbr:"EEDT",offset:3,isdst:!0,text:"(UTC+02:00) E. Europe",utc:["Asia/Nicosia","Europe/Athens","Europe/Bucharest","Europe/Chisinau","Europe/Helsinki","Europe/Kyiv","Europe/Mariehamn","Europe/Nicosia","Europe/Riga","Europe/Sofia","Europe/Tallinn","Europe/Uzhhorod","Europe/Vilnius","Europe/Zaporizhzhia"]},{value:"South Africa Standard Time",abbr:"SAST",offset:2,isdst:!1,text:"(UTC+02:00) Harare, Pretoria",utc:["Africa/Blantyre","Africa/Bujumbura","Africa/Gaborone","Africa/Harare","Africa/Johannesburg","Africa/Kigali","Africa/Lubumbashi","Africa/Lusaka","Africa/Maputo","Africa/Maseru","Africa/Mbabane","Etc/GMT-2"]},{value:"FLE Standard Time",abbr:"FDT",offset:3,isdst:!0,text:"(UTC+02:00) Helsinki, Kyiv, Riga, Sofia, Tallinn, Vilnius",utc:["Europe/Helsinki","Europe/Kyiv","Europe/Mariehamn","Europe/Riga","Europe/Sofia","Europe/Tallinn","Europe/Uzhhorod","Europe/Vilnius","Europe/Zaporizhzhia"]},{value:"Turkey Standard Time",abbr:"TDT",offset:3,isdst:!1,text:"(UTC+03:00) Istanbul",utc:["Europe/Istanbul"]},{value:"Israel Standard Time",abbr:"JDT",offset:3,isdst:!0,text:"(UTC+02:00) Jerusalem",utc:["Asia/Jerusalem"]},{value:"Libya Standard Time",abbr:"LST",offset:2,isdst:!1,text:"(UTC+02:00) Tripoli",utc:["Africa/Tripoli"]},{value:"Jordan Standard Time",abbr:"JST",offset:3,isdst:!1,text:"(UTC+03:00) Amman",utc:["Asia/Amman"]},{value:"Arabic Standard Time",abbr:"AST",offset:3,isdst:!1,text:"(UTC+03:00) Baghdad",utc:["Asia/Baghdad"]},{value:"Kaliningrad Standard Time",abbr:"KST",offset:3,isdst:!1,text:"(UTC+02:00) Kaliningrad",utc:["Europe/Kaliningrad"]},{value:"Arab Standard Time",abbr:"AST",offset:3,isdst:!1,text:"(UTC+03:00) Kuwait, Riyadh",utc:["Asia/Aden","Asia/Bahrain","Asia/Kuwait","Asia/Qatar","Asia/Riyadh"]},{value:"E. Africa Standard Time",abbr:"EAST",offset:3,isdst:!1,text:"(UTC+03:00) Nairobi",utc:["Africa/Addis_Ababa","Africa/Asmera","Africa/Dar_es_Salaam","Africa/Djibouti","Africa/Juba","Africa/Kampala","Africa/Khartoum","Africa/Mogadishu","Africa/Nairobi","Antarctica/Syowa","Etc/GMT-3","Indian/Antananarivo","Indian/Comoro","Indian/Mayotte"]},{value:"Moscow Standard Time",abbr:"MSK",offset:3,isdst:!1,text:"(UTC+03:00) Moscow, St. Petersburg, Volgograd, Minsk",utc:["Europe/Kirov","Europe/Moscow","Europe/Simferopol","Europe/Volgograd","Europe/Minsk"]},{value:"Samara Time",abbr:"SAMT",offset:4,isdst:!1,text:"(UTC+04:00) Samara, Ulyanovsk, Saratov",utc:["Europe/Astrakhan","Europe/Samara","Europe/Ulyanovsk"]},{value:"Iran Standard Time",abbr:"IDT",offset:4.5,isdst:!0,text:"(UTC+03:30) Tehran",utc:["Asia/Tehran"]},{value:"Arabian Standard Time",abbr:"AST",offset:4,isdst:!1,text:"(UTC+04:00) Abu Dhabi, Muscat",utc:["Asia/Dubai","Asia/Muscat","Etc/GMT-4"]},{value:"Azerbaijan Standard Time",abbr:"ADT",offset:5,isdst:!0,text:"(UTC+04:00) Baku",utc:["Asia/Baku"]},{value:"Mauritius Standard Time",abbr:"MST",offset:4,isdst:!1,text:"(UTC+04:00) Port Louis",utc:["Indian/Mahe","Indian/Mauritius","Indian/Reunion"]},{value:"Georgian Standard Time",abbr:"GET",offset:4,isdst:!1,text:"(UTC+04:00) Tbilisi",utc:["Asia/Tbilisi"]},{value:"Caucasus Standard Time",abbr:"CST",offset:4,isdst:!1,text:"(UTC+04:00) Yerevan",utc:["Asia/Yerevan"]},{value:"Afghanistan Standard Time",abbr:"AST",offset:4.5,isdst:!1,text:"(UTC+04:30) Kabul",utc:["Asia/Kabul"]},{value:"West Asia Standard Time",abbr:"WAST",offset:5,isdst:!1,text:"(UTC+05:00) Ashgabat, Tashkent",utc:["Antarctica/Mawson","Asia/Aqtau","Asia/Aqtobe","Asia/Ashgabat","Asia/Dushanbe","Asia/Oral","Asia/Samarkand","Asia/Tashkent","Etc/GMT-5","Indian/Kerguelen","Indian/Maldives"]},{value:"Yekaterinburg Time",abbr:"YEKT",offset:5,isdst:!1,text:"(UTC+05:00) Yekaterinburg",utc:["Asia/Yekaterinburg"]},{value:"Pakistan Standard Time",abbr:"PKT",offset:5,isdst:!1,text:"(UTC+05:00) Islamabad, Karachi",utc:["Asia/Karachi"]},{value:"India Standard Time",abbr:"IST",offset:5.5,isdst:!1,text:"(UTC+05:30) Chennai, Kolkata, Mumbai, New Delhi",utc:["Asia/Kolkata","Asia/Calcutta"]},{value:"Sri Lanka Standard Time",abbr:"SLST",offset:5.5,isdst:!1,text:"(UTC+05:30) Sri Jayawardenepura",utc:["Asia/Colombo"]},{value:"Nepal Standard Time",abbr:"NST",offset:5.75,isdst:!1,text:"(UTC+05:45) Kathmandu",utc:["Asia/Kathmandu"]},{value:"Central Asia Standard Time",abbr:"CAST",offset:6,isdst:!1,text:"(UTC+06:00) Nur-Sultan (Astana)",utc:["Antarctica/Vostok","Asia/Almaty","Asia/Bishkek","Asia/Qyzylorda","Asia/Urumqi","Etc/GMT-6","Indian/Chagos"]},{value:"Bangladesh Standard Time",abbr:"BST",offset:6,isdst:!1,text:"(UTC+06:00) Dhaka",utc:["Asia/Dhaka","Asia/Thimphu"]},{value:"Myanmar Standard Time",abbr:"MST",offset:6.5,isdst:!1,text:"(UTC+06:30) Yangon (Rangoon)",utc:["Asia/Rangoon","Indian/Cocos"]},{value:"SE Asia Standard Time",abbr:"SAST",offset:7,isdst:!1,text:"(UTC+07:00) Bangkok, Hanoi, Jakarta",utc:["Antarctica/Davis","Asia/Bangkok","Asia/Hovd","Asia/Jakarta","Asia/Phnom_Penh","Asia/Pontianak","Asia/Saigon","Asia/Vientiane","Etc/GMT-7","Indian/Christmas"]},{value:"N. Central Asia Standard Time",abbr:"NCAST",offset:7,isdst:!1,text:"(UTC+07:00) Novosibirsk",utc:["Asia/Novokuznetsk","Asia/Novosibirsk","Asia/Omsk"]},{value:"China Standard Time",abbr:"CST",offset:8,isdst:!1,text:"(UTC+08:00) Beijing, Chongqing, Hong Kong, Urumqi",utc:["Asia/Hong_Kong","Asia/Macau","Asia/Shanghai"]},{value:"North Asia Standard Time",abbr:"NAST",offset:8,isdst:!1,text:"(UTC+08:00) Krasnoyarsk",utc:["Asia/Krasnoyarsk"]},{value:"Singapore Standard Time",abbr:"MPST",offset:8,isdst:!1,text:"(UTC+08:00) Kuala Lumpur, Singapore",utc:["Asia/Brunei","Asia/Kuala_Lumpur","Asia/Kuching","Asia/Makassar","Asia/Manila","Asia/Singapore","Etc/GMT-8"]},{value:"W. Australia Standard Time",abbr:"WAST",offset:8,isdst:!1,text:"(UTC+08:00) Perth",utc:["Antarctica/Casey","Australia/Perth"]},{value:"Taipei Standard Time",abbr:"TST",offset:8,isdst:!1,text:"(UTC+08:00) Taipei",utc:["Asia/Taipei"]},{value:"Ulaanbaatar Standard Time",abbr:"UST",offset:8,isdst:!1,text:"(UTC+08:00) Ulaanbaatar",utc:["Asia/Choibalsan","Asia/Ulaanbaatar"]},{value:"North Asia East Standard Time",abbr:"NAEST",offset:8,isdst:!1,text:"(UTC+08:00) Irkutsk",utc:["Asia/Irkutsk"]},{value:"Japan Standard Time",abbr:"JST",offset:9,isdst:!1,text:"(UTC+09:00) Osaka, Sapporo, Tokyo",utc:["Asia/Dili","Asia/Jayapura","Asia/Tokyo","Etc/GMT-9","Pacific/Palau"]},{value:"Korea Standard Time",abbr:"KST",offset:9,isdst:!1,text:"(UTC+09:00) Seoul",utc:["Asia/Pyongyang","Asia/Seoul"]},{value:"Cen. Australia Standard Time",abbr:"CAST",offset:9.5,isdst:!1,text:"(UTC+09:30) Adelaide",utc:["Australia/Adelaide","Australia/Broken_Hill"]},{value:"AUS Central Standard Time",abbr:"ACST",offset:9.5,isdst:!1,text:"(UTC+09:30) Darwin",utc:["Australia/Darwin"]},{value:"E. Australia Standard Time",abbr:"EAST",offset:10,isdst:!1,text:"(UTC+10:00) Brisbane",utc:["Australia/Brisbane","Australia/Lindeman"]},{value:"AUS Eastern Standard Time",abbr:"AEST",offset:10,isdst:!1,text:"(UTC+10:00) Canberra, Melbourne, Sydney",utc:["Australia/Melbourne","Australia/Sydney"]},{value:"West Pacific Standard Time",abbr:"WPST",offset:10,isdst:!1,text:"(UTC+10:00) Guam, Port Moresby",utc:["Antarctica/DumontDUrville","Etc/GMT-10","Pacific/Guam","Pacific/Port_Moresby","Pacific/Saipan","Pacific/Truk"]},{value:"Tasmania Standard Time",abbr:"TST",offset:10,isdst:!1,text:"(UTC+10:00) Hobart",utc:["Australia/Currie","Australia/Hobart"]},{value:"Yakutsk Standard Time",abbr:"YST",offset:9,isdst:!1,text:"(UTC+09:00) Yakutsk",utc:["Asia/Chita","Asia/Khandyga","Asia/Yakutsk"]},{value:"Central Pacific Standard Time",abbr:"CPST",offset:11,isdst:!1,text:"(UTC+11:00) Solomon Is., New Caledonia",utc:["Antarctica/Macquarie","Etc/GMT-11","Pacific/Efate","Pacific/Guadalcanal","Pacific/Kosrae","Pacific/Noumea","Pacific/Ponape"]},{value:"Vladivostok Standard Time",abbr:"VST",offset:11,isdst:!1,text:"(UTC+11:00) Vladivostok",utc:["Asia/Sakhalin","Asia/Ust-Nera","Asia/Vladivostok"]},{value:"New Zealand Standard Time",abbr:"NZST",offset:12,isdst:!1,text:"(UTC+12:00) Auckland, Wellington",utc:["Antarctica/McMurdo","Pacific/Auckland"]},{value:"UTC+12",abbr:"U",offset:12,isdst:!1,text:"(UTC+12:00) Coordinated Universal Time+12",utc:["Etc/GMT-12","Pacific/Funafuti","Pacific/Kwajalein","Pacific/Majuro","Pacific/Nauru","Pacific/Tarawa","Pacific/Wake","Pacific/Wallis"]},{value:"Fiji Standard Time",abbr:"FST",offset:12,isdst:!1,text:"(UTC+12:00) Fiji",utc:["Pacific/Fiji"]},{value:"Magadan Standard Time",abbr:"MST",offset:12,isdst:!1,text:"(UTC+12:00) Magadan",utc:["Asia/Anadyr","Asia/Kamchatka","Asia/Magadan","Asia/Srednekolymsk"]},{value:"Kamchatka Standard Time",abbr:"KDT",offset:13,isdst:!0,text:"(UTC+12:00) Petropavlovsk-Kamchatsky - Old",utc:["Asia/Kamchatka"]},{value:"Tonga Standard Time",abbr:"TST",offset:13,isdst:!1,text:"(UTC+13:00) Nuku'alofa",utc:["Etc/GMT-13","Pacific/Enderbury","Pacific/Fakaofo","Pacific/Tongatapu"]},{value:"Samoa Standard Time",abbr:"SST",offset:13,isdst:!1,text:"(UTC+13:00) Samoa",utc:["Pacific/Apia"]}].filter(e=>e.utc.length).reduce((e,t)=>{let r=t.utc;for(let n=0;n<r.length;n++){const a=r[n],o=t.text;let s=o.substring(o.indexOf("(")+1,o.indexOf(")"));-1!==s.indexOf("UTC")&&e.push({value:a,abbr:t.abbr,offset:t.offset,isdst:t.isdst,text:`(${s}) ${a}`,utc:["Etc/GMT-13","Pacific/Enderbury","Pacific/Fakaofo","Pacific/Tongatapu"]})}return e},[]).filter((e,t,r)=>t===r.findIndex(t=>t.value===e.value));function Ty(r){const[n,a]=t.useState(r.value||""),[o,s]=t.useState(!1),i=Cy.find(e=>e.value==n);return e.jsxs(my,{open:o,onOpenChange:s,children:[e.jsx(py,{asChild:!0,children:e.jsxs(bs,{variant:"outline",role:"combobox","aria-expanded":o,className:"justify-between overflow-hidden text-ellipsis",children:[i?.text||"Choose timezone",e.jsx(os,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),e.jsx(hy,{className:"p-0 overflow-hidden text-ellipsis",children:e.jsxs(Eg,{children:[e.jsx(Cg,{placeholder:"Choose timezone..."}),e.jsx(Tg,{children:e.jsx(jg,{children:Cy.map(t=>e.jsxs(_g,{className:Uo("whitespace-nowrap text-left",{"text-green-500":n===t.value}),value:t.value,defaultValue:t.value,onSelect:e=>{const n=t.value;a(n),r.onChange&&"function"==typeof r.onChange&&r.onChange(n),s(!1)},children:[n===t.value&&e.jsx(as,{className:Uo("mr-2 h-4 w-4 text-green-400",n===t.value?"opacity-100":"opacity-0")}),String(t.text).trim()]},t.value))})})]})})]})}const jy=({workspace:r})=>{const{updateUserProfile:n,getProfile:a}=nx(),[o,s]=t.useState(!1),[i,l]=t.useState(),[c,u]=t.useState(0),d=jt({resolver:ja(Di({name:ii().min(2,{message:"Name must be at least 2 characters."}),country:ii().optional(),timezone:ii().optional(),language:ii().optional(),currency:ii().optional()})),defaultValues:{name:i?.name||"",country:i?.country||"",timezone:i?.timezone||"",language:i?.language||"",currency:i?.currency||""}});return t.useEffect(()=>{a().then(e=>{l(e),d.setValue("name",e.name),d.setValue("country",e.country),d.setValue("timezone",e.timezone),d.setValue("language",e.language),d.setValue("currency",e.currency)})},[c]),i?e.jsxs("div",{children:[e.jsx("div",{className:"space-y-4",children:e.jsx(As,{...d,children:e.jsxs("form",{onSubmit:d.handleSubmit(async function(e){s(!0),await n({name:e.name,country:e.country,timezone:e.timezone,language:e.language,currency:e.currency}),s(!1)}),className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium mb-1",children:"Email"}),e.jsx(Ds,{disabled:!0,className:"w-full border rounded px-3 py-2 bg-gray-100",value:i?.email})]}),e.jsx(Cs,{disabled:o,control:d.control,name:"name",render:({field:t})=>e.jsxs(_s,{children:[e.jsx(Ns,{children:"Name"}),e.jsx(Rs,{children:e.jsx(Ds,{...t})}),e.jsx(Os,{})]})}),e.jsxs("div",{className:"flex gap-y-2 my-4 flex-col",children:[e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("div",{className:"text-sm font-medium",children:"Language"}),e.jsx(Ey,{value:d.getValues("language"),onChange:e=>{d.setValue("language",e)}})]}),e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("div",{className:"text-sm font-medium",children:"Country"}),e.jsx(yy,{value:d.getValues("country"),onChange:e=>{d.setValue("country",e)}})]}),e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("div",{className:"text-sm font-medium",children:"Currency"}),e.jsx(Sy,{value:d.getValues("currency"),onChange:e=>{d.setValue("currency",e)}})]}),e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("div",{className:"text-sm font-medium",children:"Timezone"}),e.jsx(Ty,{value:d.getValues("timezone"),onChange:e=>{d.setValue("timezone",e)}})]})]}),e.jsxs("div",{className:"flex justify-end gap-x-2",children:[e.jsx(bs,{type:"submit",progress:o,disabled:o,children:"Save"}),e.jsx(bs,{type:"button",variant:"outline",onClick:()=>{u(e=>e+1)},disabled:o,children:"Reset"})]})]})})}),i?.image&&e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium mb-1",children:"Profile Image"}),e.jsx("div",{className:"w-16 h-16 rounded-full overflow-hidden",children:e.jsx("img",{src:i.image,alt:i.name,className:"w-full h-full object-cover"})})]})]}):e.jsx(Dh,{})};var _y=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"});a.forwardRef((t,r)=>e.jsx(ys.span,{...t,ref:r,style:{..._y,...t.style}})).displayName="VisuallyHidden";var Ny=[" ","Enter","ArrowUp","ArrowDown"],Ry=[" ","Enter"],Py="Select",[Oy,Dy,Iy]=Dm(Py),[My,Ly]=Tu(Py,[Iy,kb]),Uy=kb(),[zy,Fy]=My(Py),[By,Vy]=My(Py),$y=t=>{const{__scopeSelect:r,children:n,open:o,defaultOpen:s,onOpenChange:i,value:l,defaultValue:c,onValueChange:u,dir:d,name:f,autoComplete:m,disabled:p,required:h,form:g}=t,v=Uy(r),[b,y]=a.useState(null),[w,x]=a.useState(null),[S,k]=a.useState(!1),A=Mm(d),[E,C]=ud({prop:o,defaultProp:s??!1,onChange:i,caller:Py}),[T,j]=ud({prop:l,defaultProp:c,onChange:u,caller:Py}),_=a.useRef(null),N=!b||(g||!!b.closest("form")),[R,P]=a.useState(new Set),O=Array.from(R).map(e=>e.props.value).join(";");return e.jsx(zb,{...v,children:e.jsxs(zy,{required:h,scope:r,trigger:b,onTriggerChange:y,valueNode:w,onValueNodeChange:x,valueNodeHasChildren:S,onValueNodeHasChildrenChange:k,contentId:ld(),value:T,onValueChange:j,open:E,onOpenChange:C,dir:A,triggerPointerDownPosRef:_,disabled:p,children:[e.jsx(Oy.Provider,{scope:r,children:e.jsx(By,{scope:t.__scopeSelect,onNativeOptionAdd:a.useCallback(e=>{P(t=>new Set(t).add(e))},[]),onNativeOptionRemove:a.useCallback(e=>{P(t=>{const r=new Set(t);return r.delete(e),r})},[]),children:n})}),N?e.jsxs(Tw,{"aria-hidden":!0,required:h,tabIndex:-1,name:f,autoComplete:m,value:T,onChange:e=>j(e.target.value),disabled:p,form:g,children:[void 0===T?e.jsx("option",{value:""}):null,Array.from(R)]},O):null]})})};$y.displayName=Py;var Wy="SelectTrigger",Gy=a.forwardRef((t,r)=>{const{__scopeSelect:n,disabled:o=!1,...s}=t,i=Uy(n),l=Fy(Wy,n),c=l.disabled||o,u=Bo(r,l.onTriggerChange),d=Dy(n),f=a.useRef("touch"),[m,p,h]=_w(e=>{const t=d().filter(e=>!e.disabled),r=t.find(e=>e.value===l.value),n=Nw(t,e,r);void 0!==n&&l.onValueChange(n.value)}),g=e=>{c||(l.onOpenChange(!0),h()),e&&(l.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return e.jsx(Fb,{asChild:!0,...i,children:e.jsx(ys.button,{type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":jw(l.value)?"":void 0,...s,ref:u,onClick:od(s.onClick,e=>{e.currentTarget.focus(),"mouse"!==f.current&&g(e)}),onPointerDown:od(s.onPointerDown,e=>{f.current=e.pointerType;const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),0===e.button&&!1===e.ctrlKey&&"mouse"===e.pointerType&&(g(e),e.preventDefault())}),onKeyDown:od(s.onKeyDown,e=>{const t=""!==m.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||p(e.key),t&&" "===e.key||Ny.includes(e.key)&&(g(),e.preventDefault())})})})});Gy.displayName=Wy;var Ky="SelectValue",Hy=a.forwardRef((t,r)=>{const{__scopeSelect:n,className:a,style:o,children:s,placeholder:i="",...l}=t,c=Fy(Ky,n),{onValueNodeHasChildrenChange:u}=c,d=void 0!==s,f=Bo(r,c.onValueNodeChange);return Ru(()=>{u(d)},[u,d]),e.jsx(ys.span,{...l,ref:f,style:{pointerEvents:"none"},children:jw(c.value)?e.jsx(e.Fragment,{children:i}):s})});Hy.displayName=Ky;var Zy=a.forwardRef((t,r)=>{const{__scopeSelect:n,children:a,...o}=t;return e.jsx(ys.span,{"aria-hidden":!0,...o,ref:r,children:a||"▼"})});Zy.displayName="SelectIcon";var qy=t=>e.jsx(_d,{asChild:!0,...t});qy.displayName="SelectPortal";var Jy="SelectContent",Yy=a.forwardRef((t,r)=>{const n=Fy(Jy,t.__scopeSelect),[s,i]=a.useState();if(Ru(()=>{i(new DocumentFragment)},[]),!n.open){const r=s;return r?o.createPortal(e.jsx(Qy,{scope:t.__scopeSelect,children:e.jsx(Oy.Slot,{scope:t.__scopeSelect,children:e.jsx("div",{children:t.children})})}),r):null}return e.jsx(rw,{...t,ref:r})});Yy.displayName=Jy;var Xy=10,[Qy,ew]=My(Jy),tw=Vo("SelectContent.RemoveScroll"),rw=a.forwardRef((t,r)=>{const{__scopeSelect:n,position:o="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:i,onPointerDownOutside:l,side:c,sideOffset:u,align:d,alignOffset:f,arrowPadding:m,collisionBoundary:p,collisionPadding:h,sticky:g,hideWhenDetached:v,avoidCollisions:b,...y}=t,w=Fy(Jy,n),[x,S]=a.useState(null),[k,A]=a.useState(null),E=Bo(r,e=>S(e)),[C,T]=a.useState(null),[j,_]=a.useState(null),N=Dy(n),[R,P]=a.useState(!1),O=a.useRef(!1);a.useEffect(()=>{if(x)return _f(x)},[x]),Od();const D=a.useCallback(e=>{const[t,...r]=N().map(e=>e.ref.current),[n]=r.slice(-1),a=document.activeElement;for(const r of e){if(r===a)return;if(r?.scrollIntoView({block:"nearest"}),r===t&&k&&(k.scrollTop=0),r===n&&k&&(k.scrollTop=k.scrollHeight),r?.focus(),document.activeElement!==a)return}},[N,k]),I=a.useCallback(()=>D([C,x]),[D,C,x]);a.useEffect(()=>{R&&I()},[R,I]);const{onOpenChange:M,triggerPointerDownPosRef:L}=w;a.useEffect(()=>{if(x){let e={x:0,y:0};const t=t=>{e={x:Math.abs(Math.round(t.pageX)-(L.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(L.current?.y??0))}},r=r=>{e.x<=10&&e.y<=10?r.preventDefault():x.contains(r.target)||M(!1),document.removeEventListener("pointermove",t),L.current=null};return null!==L.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",r,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",r,{capture:!0})}}},[x,M,L]),a.useEffect(()=>{const e=()=>M(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[M]);const[U,z]=_w(e=>{const t=N().filter(e=>!e.disabled),r=t.find(e=>e.ref.current===document.activeElement),n=Nw(t,e,r);n&&setTimeout(()=>n.ref.current.focus())}),F=a.useCallback((e,t,r)=>{const n=!O.current&&!r;(void 0!==w.value&&w.value===t||n)&&(T(e),n&&(O.current=!0))},[w.value]),B=a.useCallback(()=>x?.focus(),[x]),V=a.useCallback((e,t,r)=>{const n=!O.current&&!r;(void 0!==w.value&&w.value===t||n)&&_(e)},[w.value]),$="popper"===o?aw:nw,W=$===aw?{side:c,sideOffset:u,align:d,alignOffset:f,arrowPadding:m,collisionBoundary:p,collisionPadding:h,sticky:g,hideWhenDetached:v,avoidCollisions:b}:{};return e.jsx(Qy,{scope:n,content:x,viewport:k,onViewportChange:A,itemRefCallback:F,selectedItem:C,onItemLeave:B,itemTextRefCallback:V,focusSelectedItem:I,selectedItemText:j,position:o,isPositioned:R,searchRef:U,children:e.jsx(Sf,{as:tw,allowPinchZoom:!0,children:e.jsx(Sd,{asChild:!0,trapped:w.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:od(s,e=>{w.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:e.jsx(gd,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>w.onOpenChange(!1),children:e.jsx($,{role:"listbox",id:w.contentId,"data-state":w.open?"open":"closed",dir:w.dir,onContextMenu:e=>e.preventDefault(),...y,...W,onPlaced:()=>P(!0),ref:E,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:od(y.onKeyDown,e=>{const t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||z(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=N().filter(e=>!e.disabled).map(e=>e.ref.current);if(["ArrowUp","End"].includes(e.key)&&(t=t.slice().reverse()),["ArrowUp","ArrowDown"].includes(e.key)){const r=e.target,n=t.indexOf(r);t=t.slice(n+1)}setTimeout(()=>D(t)),e.preventDefault()}})})})})})})});rw.displayName="SelectContentImpl";var nw=a.forwardRef((t,r)=>{const{__scopeSelect:n,onPlaced:o,...s}=t,i=Fy(Jy,n),l=ew(Jy,n),[c,u]=a.useState(null),[d,f]=a.useState(null),m=Bo(r,e=>f(e)),p=Dy(n),h=a.useRef(!1),g=a.useRef(!0),{viewport:v,selectedItem:b,selectedItemText:y,focusSelectedItem:w}=l,x=a.useCallback(()=>{if(i.trigger&&i.valueNode&&c&&d&&v&&b&&y){const e=i.trigger.getBoundingClientRect(),t=d.getBoundingClientRect(),r=i.valueNode.getBoundingClientRect(),n=y.getBoundingClientRect();if("rtl"!==i.dir){const a=n.left-t.left,o=r.left-a,s=e.left-o,i=e.width+s,l=Math.max(i,t.width),u=window.innerWidth-Xy,d=Np(o,[Xy,Math.max(Xy,u-l)]);c.style.minWidth=i+"px",c.style.left=d+"px"}else{const a=t.right-n.right,o=window.innerWidth-r.right-a,s=window.innerWidth-e.right-o,i=e.width+s,l=Math.max(i,t.width),u=window.innerWidth-Xy,d=Np(o,[Xy,Math.max(Xy,u-l)]);c.style.minWidth=i+"px",c.style.right=d+"px"}const a=p(),s=window.innerHeight-2*Xy,l=v.scrollHeight,u=window.getComputedStyle(d),f=parseInt(u.borderTopWidth,10),m=parseInt(u.paddingTop,10),g=parseInt(u.borderBottomWidth,10),w=f+m+l+parseInt(u.paddingBottom,10)+g,x=Math.min(5*b.offsetHeight,w),S=window.getComputedStyle(v),k=parseInt(S.paddingTop,10),A=parseInt(S.paddingBottom,10),E=e.top+e.height/2-Xy,C=s-E,T=b.offsetHeight/2,j=f+m+(b.offsetTop+T),_=w-j;if(j<=E){const e=a.length>0&&b===a[a.length-1].ref.current;c.style.bottom="0px";const t=d.clientHeight-v.offsetTop-v.offsetHeight,r=j+Math.max(C,T+(e?A:0)+t+g);c.style.height=r+"px"}else{const e=a.length>0&&b===a[0].ref.current;c.style.top="0px";const t=Math.max(E,f+v.offsetTop+(e?k:0)+T)+_;c.style.height=t+"px",v.scrollTop=j-E+v.offsetTop}c.style.margin=`${Xy}px 0`,c.style.minHeight=x+"px",c.style.maxHeight=s+"px",o?.(),requestAnimationFrame(()=>h.current=!0)}},[p,i.trigger,i.valueNode,c,d,v,b,y,i.dir,o]);Ru(()=>x(),[x]);const[S,k]=a.useState();Ru(()=>{d&&k(window.getComputedStyle(d).zIndex)},[d]);const A=a.useCallback(e=>{e&&!0===g.current&&(x(),w?.(),g.current=!1)},[x,w]);return e.jsx(ow,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:h,onScrollButtonChange:A,children:e.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:e.jsx(ys.div,{...s,ref:m,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});nw.displayName="SelectItemAlignedPosition";var aw=a.forwardRef((t,r)=>{const{__scopeSelect:n,align:a="start",collisionPadding:o=Xy,...s}=t,i=Uy(n);return e.jsx(Bb,{...i,...s,ref:r,align:a,collisionPadding:o,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});aw.displayName="SelectPopperPosition";var[ow,sw]=My(Jy,{}),iw="SelectViewport",lw=a.forwardRef((t,r)=>{const{__scopeSelect:n,nonce:o,...s}=t,i=ew(iw,n),l=sw(iw,n),c=Bo(r,i.onViewportChange),u=a.useRef(0);return e.jsxs(e.Fragment,{children:[e.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),e.jsx(Oy.Slot,{scope:n,children:e.jsx(ys.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:od(s.onScroll,e=>{const t=e.currentTarget,{contentWrapper:r,shouldExpandOnScrollRef:n}=l;if(n?.current&&r){const e=Math.abs(u.current-t.scrollTop);if(e>0){const n=window.innerHeight-2*Xy,a=parseFloat(r.style.minHeight),o=parseFloat(r.style.height),s=Math.max(a,o);if(s<n){const a=s+e,o=Math.min(n,a),i=a-o;r.style.height=o+"px","0px"===r.style.bottom&&(t.scrollTop=i>0?i:0,r.style.justifyContent="flex-end")}}}u.current=t.scrollTop})})})]})});lw.displayName=iw;var cw="SelectGroup",[uw,dw]=My(cw);a.forwardRef((t,r)=>{const{__scopeSelect:n,...a}=t,o=ld();return e.jsx(uw,{scope:n,id:o,children:e.jsx(ys.div,{role:"group","aria-labelledby":o,...a,ref:r})})}).displayName=cw;var fw="SelectLabel",mw=a.forwardRef((t,r)=>{const{__scopeSelect:n,...a}=t,o=dw(fw,n);return e.jsx(ys.div,{id:o.id,...a,ref:r})});mw.displayName=fw;var pw="SelectItem",[hw,gw]=My(pw),vw=a.forwardRef((t,r)=>{const{__scopeSelect:n,value:o,disabled:s=!1,textValue:i,...l}=t,c=Fy(pw,n),u=ew(pw,n),d=c.value===o,[f,m]=a.useState(i??""),[p,h]=a.useState(!1),g=Bo(r,e=>u.itemRefCallback?.(e,o,s)),v=ld(),b=a.useRef("touch"),y=()=>{s||(c.onValueChange(o),c.onOpenChange(!1))};if(""===o)throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return e.jsx(hw,{scope:n,value:o,disabled:s,textId:v,isSelected:d,onItemTextChange:a.useCallback(e=>{m(t=>t||(e?.textContent??"").trim())},[]),children:e.jsx(Oy.ItemSlot,{scope:n,value:o,disabled:s,textValue:f,children:e.jsx(ys.div,{role:"option","aria-labelledby":v,"data-highlighted":p?"":void 0,"aria-selected":d&&p,"data-state":d?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...l,ref:g,onFocus:od(l.onFocus,()=>h(!0)),onBlur:od(l.onBlur,()=>h(!1)),onClick:od(l.onClick,()=>{"mouse"!==b.current&&y()}),onPointerUp:od(l.onPointerUp,()=>{"mouse"===b.current&&y()}),onPointerDown:od(l.onPointerDown,e=>{b.current=e.pointerType}),onPointerMove:od(l.onPointerMove,e=>{b.current=e.pointerType,s?u.onItemLeave?.():"mouse"===b.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:od(l.onPointerLeave,e=>{e.currentTarget===document.activeElement&&u.onItemLeave?.()}),onKeyDown:od(l.onKeyDown,e=>{""!==u.searchRef?.current&&" "===e.key||(Ry.includes(e.key)&&y()," "===e.key&&e.preventDefault())})})})})});vw.displayName=pw;var bw="SelectItemText",yw=a.forwardRef((t,r)=>{const{__scopeSelect:n,className:s,style:i,...l}=t,c=Fy(bw,n),u=ew(bw,n),d=gw(bw,n),f=Vy(bw,n),[m,p]=a.useState(null),h=Bo(r,e=>p(e),d.onItemTextChange,e=>u.itemTextRefCallback?.(e,d.value,d.disabled)),g=m?.textContent,v=a.useMemo(()=>e.jsx("option",{value:d.value,disabled:d.disabled,children:g},d.value),[d.disabled,d.value,g]),{onNativeOptionAdd:b,onNativeOptionRemove:y}=f;return Ru(()=>(b(v),()=>y(v)),[b,y,v]),e.jsxs(e.Fragment,{children:[e.jsx(ys.span,{id:d.textId,...l,ref:h}),d.isSelected&&c.valueNode&&!c.valueNodeHasChildren?o.createPortal(l.children,c.valueNode):null]})});yw.displayName=bw;var ww="SelectItemIndicator",xw=a.forwardRef((t,r)=>{const{__scopeSelect:n,...a}=t;return gw(ww,n).isSelected?e.jsx(ys.span,{"aria-hidden":!0,...a,ref:r}):null});xw.displayName=ww;var Sw="SelectScrollUpButton";a.forwardRef((t,r)=>{const n=ew(Sw,t.__scopeSelect),o=sw(Sw,t.__scopeSelect),[s,i]=a.useState(!1),l=Bo(r,o.onScrollButtonChange);return Ru(()=>{if(n.viewport&&n.isPositioned){let e=function(){const e=t.scrollTop>0;i(e)};const t=n.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[n.viewport,n.isPositioned]),s?e.jsx(Aw,{...t,ref:l,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null}).displayName=Sw;var kw="SelectScrollDownButton";a.forwardRef((t,r)=>{const n=ew(kw,t.__scopeSelect),o=sw(kw,t.__scopeSelect),[s,i]=a.useState(!1),l=Bo(r,o.onScrollButtonChange);return Ru(()=>{if(n.viewport&&n.isPositioned){let e=function(){const e=t.scrollHeight-t.clientHeight,r=Math.ceil(t.scrollTop)<e;i(r)};const t=n.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[n.viewport,n.isPositioned]),s?e.jsx(Aw,{...t,ref:l,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null}).displayName=kw;var Aw=a.forwardRef((t,r)=>{const{__scopeSelect:n,onAutoScroll:o,...s}=t,i=ew("SelectScrollButton",n),l=a.useRef(null),c=Dy(n),u=a.useCallback(()=>{null!==l.current&&(window.clearInterval(l.current),l.current=null)},[]);return a.useEffect(()=>()=>u(),[u]),Ru(()=>{const e=c().find(e=>e.ref.current===document.activeElement);e?.ref.current?.scrollIntoView({block:"nearest"})},[c]),e.jsx(ys.div,{"aria-hidden":!0,...s,ref:r,style:{flexShrink:0,...s.style},onPointerDown:od(s.onPointerDown,()=>{null===l.current&&(l.current=window.setInterval(o,50))}),onPointerMove:od(s.onPointerMove,()=>{i.onItemLeave?.(),null===l.current&&(l.current=window.setInterval(o,50))}),onPointerLeave:od(s.onPointerLeave,()=>{u()})})}),Ew=a.forwardRef((t,r)=>{const{__scopeSelect:n,...a}=t;return e.jsx(ys.div,{"aria-hidden":!0,...a,ref:r})});Ew.displayName="SelectSeparator";var Cw="SelectArrow";a.forwardRef((t,r)=>{const{__scopeSelect:n,...a}=t,o=Uy(n),s=Fy(Cw,n),i=ew(Cw,n);return s.open&&"popper"===i.position?e.jsx(Vb,{...o,...a,ref:r}):null}).displayName=Cw;var Tw=a.forwardRef(({__scopeSelect:t,value:r,...n},o)=>{const s=a.useRef(null),i=Bo(o,s),l=rp(r);return a.useEffect(()=>{const e=s.current;if(!e)return;const t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,"value").set;if(l!==r&&n){const t=new Event("change",{bubbles:!0});n.call(e,r),e.dispatchEvent(t)}},[l,r]),e.jsx(ys.select,{...n,style:{..._y,...n.style},ref:i,defaultValue:r})});function jw(e){return""===e||void 0===e}function _w(e){const t=_u(e),r=a.useRef(""),n=a.useRef(0),o=a.useCallback(e=>{const a=r.current+e;t(a),function e(t){r.current=t,window.clearTimeout(n.current),""!==t&&(n.current=window.setTimeout(()=>e(""),1e3))}(a)},[t]),s=a.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return a.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,o,s]}function Nw(e,t,r){const n=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,a=r?e.indexOf(r):-1;let o=function(e,t){return e.map((r,n)=>e[(t+n)%e.length])}(e,Math.max(a,0));1===n.length&&(o=o.filter(e=>e!==r));const s=o.find(e=>e.textValue.toLowerCase().startsWith(n.toLowerCase()));return s!==r?s:void 0}Tw.displayName="SelectBubbleInput";var Rw=Gy,Pw=Zy,Ow=qy,Dw=Yy,Iw=lw,Mw=mw,Lw=vw,Uw=yw,zw=xw,Fw=Ew;const Bw=$y,Vw=a.forwardRef(({className:t,children:r,...n},a)=>e.jsxs(Rw,{ref:a,className:Uo("flex h-9 w-full items-center justify-between rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50",t),...n,children:[r,e.jsx(Pw,{asChild:!0,children:e.jsx(ym,{className:"h-4 w-4 opacity-50"})})]}));Vw.displayName=Rw.displayName;const $w=a.forwardRef(({className:t,children:r,position:n="popper",...o},s)=>{const{container:i}=a.useContext(ee);return e.jsx(Ow,{container:i,children:e.jsx(Dw,{ref:s,className:Uo("relative z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2","popper"===n&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:n,...o,children:e.jsx(Iw,{className:Uo("p-1","popper"===n&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:r})})})});$w.displayName=Dw.displayName;a.forwardRef(({className:t,...r},n)=>e.jsx(Mw,{ref:n,className:Uo("px-2 py-1.5 text-sm font-semibold",t),...r})).displayName=Mw.displayName;const Ww=a.forwardRef(({className:t,children:r,...n},a)=>e.jsxs(Lw,{ref:a,className:Uo("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...n,children:[e.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(zw,{children:e.jsx(xm,{className:"h-4 w-4"})})}),e.jsx(Uw,{children:r})]}));Ww.displayName=Lw.displayName;a.forwardRef(({className:t,...r},n)=>e.jsx(Fw,{ref:n,className:Uo("-mx-1 my-1 h-px bg-muted",t),...r})).displayName=Fw.displayName;const Gw=({workspace:r})=>{const n=H(e=>e.auth.user),[a,o]=t.useState(0),[s,i]=t.useState(!1),[l,c]=t.useState([]),{getUsers:u,removeUser:d,updateUser:f}=nx();t.useEffect(()=>{r&&(i(!0),u(r._id).then(e=>{c(e)}).catch(e=>{console.error(e)}).finally(()=>{i(!1)}))},[r,a]);const m=()=>{o(e=>e+1)};if(s||!r)return e.jsx(Dh,{});const p=e=>"string"==typeof e?{name:"Unknown User",email:e,id:e,role:"-"}:{name:e.name,email:e.email,id:e._id},h=l.map(e=>({...e,...p(e.user)})),g=l.find(e=>("string"==typeof e.user?e.user:e.user._id)===n?.id)?.role,v="admin"===g;return e.jsxs("div",{children:[!v&&e.jsx("div",{className:"text-red-500",children:"Only workspace admin can manage users and roles."}),v&&e.jsx("div",{className:"mb-4",children:e.jsx(Kw,{onInvite:m,workspaceId:r._id})}),e.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[e.jsx("div",{children:e.jsxs("div",{className:"text-sm text-gray-600 mb-2",children:[l.length," member",1!==l.length?"s":""]})}),e.jsx("div",{children:e.jsx(bs,{variant:"ghost",size:"sm",onClick:m,progress:s,startIcon:e.jsx(cs,{}),children:"Refresh"})})]}),e.jsx("ul",{className:"space-y-2",children:h.map((t,a)=>{const o=t.id===n?.id;return e.jsxs("li",{className:"flex items-center justify-between border rounded-lg p-3",children:[e.jsxs("div",{className:"flex items-center space-x-3",children:[e.jsx("div",{className:"w-8 h-8 bg-gray-200 rounded-full flex items-center justify-center text-sm font-medium",children:t.name.charAt(0).toUpperCase()}),e.jsxs("div",{children:[e.jsx("div",{className:"font-medium",children:t.name}),e.jsx("div",{className:"text-xs text-gray-500",children:t.email})]})]}),e.jsxs("div",{className:"flex items-center gap-x-1",children:[e.jsx("div",{children:e.jsxs(Bw,{disabled:o||!v,value:t.role,onValueChange:e=>{return n=r._id,a=t.id,void f(n,a,{role:e}).then(()=>{m()});var n,a},children:[e.jsx(Vw,{children:e.jsx(Hy,{placeholder:"Select a role"})}),e.jsx($w,{children:r?.roles.map(t=>e.jsx(Ww,{value:t,children:t},t))})]})}),o&&e.jsx("span",{className:"text-xs bg-blue-100 text-blue-800 px-2 py-1 rounded",children:"You"}),!o&&v&&e.jsx(bs,{variant:"destructive",size:"sm",startIcon:e.jsx(ps,{}),onClick:()=>{var e;e=t.id,d(r._id,e).then(()=>{m()})}})]})]},a)})}),0===l.length&&e.jsx("div",{className:"text-center py-8 text-gray-500",children:"No members found in this workspace."})]})};function Kw({onInvite:r,workspaceId:n}){const[a,o]=t.useState(""),[s,i]=t.useState("admin"),[l,c]=t.useState(!1),[u,d]=t.useState(null),[f,m]=t.useState(null),{addUser:p,getWorkspace:h}=nx(),[g,v]=t.useState(null);t.useEffect(()=>{n&&h(n).then(v)},[n]);const b=()=>{d(null),m(null),o(""),i("admin")};return e.jsxs("div",{className:"flex gap-2 flex-col gap-y-2",children:[u&&e.jsx("div",{className:"text-red-500 capitalize",children:u}),f&&e.jsx("div",{className:"text-green-500 capitalize",children:f}),e.jsxs("div",{children:[e.jsx(ks,{children:"Invite member by email"}),e.jsx(Ds,{type:"email",value:a,onChange:e=>o(e.target.value),placeholder:"example@example.com"})]}),e.jsxs("div",{children:[e.jsx(ks,{children:"Role"}),e.jsxs(Bw,{value:s,onValueChange:i,children:[e.jsx(Vw,{children:e.jsx(Hy,{placeholder:"Select a role"})}),e.jsx($w,{children:g?.roles.map(t=>e.jsx(Ww,{value:t,children:t},t))})]})]}),e.jsx("div",{children:e.jsx(bs,{progress:l,onClick:async()=>{const e=a.trim();if(!e)return void d("Email is required");/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)?(c(!0),await p(n,e,s).then(()=>{m("User invited successfully"),r?.()}).catch(e=>{console.error(e),d(e.message||"Failed to invite member")}).finally(()=>{c(!1),setTimeout(()=>{b()},6e3)})):d("Invalid email address format")},disabled:l||!a||!s,children:l?"Inviting...":`Invite as ${s}`})})]})}const Hw=({workspace:t,section:r,setSection:n})=>e.jsxs("div",{className:"w-56 h-full flex flex-col space-y-6",children:[t&&e.jsx("div",{className:"border-b p-2 py-4",children:e.jsxs("div",{className:"flex items-center gap-x-2",children:[t.image&&e.jsx("div",{className:"bg-blue-100 rounded flex items-center justify-center text-blue-600 font-medium px-0.5 py-0.5",style:{width:"40px",height:"40px",minWidth:"40px",minHeight:"40px"},children:e.jsx("img",{src:t.image,className:"w-full h-full object-contain",style:{width:"36px",height:"36px",maxWidth:"36px",maxHeight:"36px",objectFit:"contain"}})}),e.jsxs("div",{className:Uo("flex-1 min-w-0",t.image?"":"pl-2"),children:[e.jsx("div",{className:"font-medium text-sm line-clamp-1 text-ellipsis overflow-hidden",children:t.name}),e.jsx("div",{className:"text-xs text-gray-500",children:t.workspaceId})]})]})}),e.jsx(Zw,{title:"Account",children:e.jsx(qw,{activeSection:r,icon:e.jsx(hs,{className:"h-3.5 w-3.5"}),label:"Profile",section:"profile",onClick:()=>n("profile")})}),e.jsxs(Zw,{title:"Workspace",children:[e.jsx(qw,{activeSection:r,icon:e.jsx(ds,{className:"h-3.5 w-3.5"}),label:"General",section:"general",onClick:()=>n("general")}),e.jsx(qw,{activeSection:r,icon:e.jsx(gs,{className:"h-3.5 w-3.5"}),label:"Users",section:"users",onClick:()=>n("users")}),e.jsx(qw,{activeSection:r,icon:e.jsx(ms,{className:"h-3.5 w-3.5"}),label:"Features",section:"features",onClick:()=>n("features")})]})]});function Zw({title:t,children:r}){return e.jsxs("div",{className:"px-2 flex flex-col space-y-1",children:[e.jsx("div",{className:"text-xs font-bold mb-2 text-gray-500 uppercase tracking-wide px-2",children:t}),r]})}function qw({icon:t,label:r,section:n,onClick:a,activeSection:o}){return e.jsxs("button",{className:Uo("flex w-full text-left px-2 py-1 rounded text-sm items-center gap-x-1",n===o?"bg-blue-100 text-blue-700 font-medium":"hover:bg-gray-200 hover:text-gray-700"),onClick:()=>a(n),children:[t,r]})}const Jw=({workspace:r,onClose:n})=>{const[a,o]=t.useState(!1),[s,i]=t.useState("profile");return r?e.jsxs(Cm,{open:a,onOpenChange:e=>{o(e),e||n()},children:[e.jsx(Tm,{asChild:!0,children:e.jsx(bs,{variant:"outline",size:"icon",children:e.jsx(ds,{className:"h-4 w-4"})})}),e.jsxs(Nm,{className:"flex max-w-2xl min-w-full sm:min-w-[800px] p-0 m-0 bg-muted sm:min-h-[600px] min-h-full gap-x-0 space-x-0",children:[e.jsx(Om,{className:"sr-only",children:"Workspace settings dialog"}),e.jsx(Hw,{workspace:r,section:s,setSection:i}),e.jsxs("div",{className:"flex-1 p-6 overflow-auto flex flex-col bg-background",children:[e.jsxs(Pm,{className:"text-xl font-bold mb-4 capitalize",children:["profile"===s&&"Account","general"===s&&"Workspace Settings","users"===s&&"Workspace Members","features"===s&&"Workspace Features"]}),e.jsxs("div",{className:"max-h-[500px] overflow-y-auto",children:["profile"===s&&e.jsx(jy,{workspace:r}),"general"===s&&e.jsx(Uh,{workspace:r}),"users"===s&&e.jsx(Gw,{workspace:r}),"features"===s&&e.jsx(Ih,{workspaceId:r._id?.toString()})]})]})]})]}):null};function Yw(r){const{workspaces:n,currentWorkspace:a,loading:o,refreshing:s}=H(e=>e.workspaces),i=H(e=>e.auth.user),[l,c]=t.useState(!1),[u,d]=t.useState(0),[f,m]=t.useState(""),{fetchWorkspaces:p,getFeatures:h,refreshWorkspaces:g,setCurrentWorkspace:v,workspaces:b}=nx(),y=o||s;t.useEffect(()=>{0===b.length?(p(),h()):h()},[]),t.useEffect(()=>{u>0&&g()},[u]);const w=b.length>0?b:n,x=w.filter(e=>e._id!==a?._id).filter(e=>e.name.toLowerCase().includes(f.toLowerCase()));return e.jsxs(Cm,{open:l,onOpenChange:c,children:[e.jsx(Tm,{children:r.trigger?.(y,a)}),e.jsxs(Nm,{className:"max-w-2xl min-w-full sm:min-w-[800px]",children:[e.jsxs(Rm,{children:[e.jsxs(Pm,{className:"flex items-center gap-2",children:[e.jsx(ns,{className:"h-5 w-5"}),"Switch Workspace"]}),e.jsx(Om,{children:"Select a workspace to switch to or create a new one."})]}),!i&&e.jsx("div",{className:"flex flex-col items-center justify-center h-full py-4 sm:py-8",children:e.jsx("div",{className:"text-sm font-medium text-muted-foreground",children:"Looks like you are not logged in. Please login to continue."})}),i&&e.jsxs("div",{className:"flex flex-col gap-4",children:[a&&e.jsx(Xw,{workspace:a,isCurrentWorkspace:!0,onWorkspaceChange:r.onWorkspaceChange,onClose:()=>c(!1),setCurrentWorkspace:v,setOpen:c,workspacesToUse:w}),e.jsx(wh,{}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"text-sm font-medium text-muted-foreground",children:["Available Workspaces (",x.length,")"]}),e.jsx("div",{children:e.jsx(bs,{progress:s,disabled:s,variant:"ghost",onClick:function(){d(e=>e+1)},startIcon:e.jsx(cs,{}),children:s?"Refreshing...":"Refresh"})})]}),e.jsxs("div",{className:"relative",children:[e.jsx(us,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground pointer-events-none"}),e.jsx(Ds,{placeholder:"Search workspaces...",value:f,onChange:e=>m(e.target.value),className:"pl-10"})]}),o?e.jsxs("div",{className:"flex items-center justify-center py-8",children:[e.jsx(is,{className:"h-6 w-6 animate-spin text-muted-foreground"}),e.jsx("span",{className:"ml-2 text-sm text-muted-foreground",children:"Loading workspaces..."})]}):0===x.length?e.jsxs("div",{className:"text-center py-8",children:[e.jsx(ns,{className:"mx-auto h-12 w-12 text-muted-foreground"}),e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:f?"No workspaces found":"No workspaces available"})]}):e.jsx(ph,{className:"h-64",children:e.jsx("div",{className:"flex flex-col gap-2 my-2.5",children:x.map(t=>{const n=t._id===a?._id;return e.jsx(Xw,{workspace:t,isCurrentWorkspace:n,onWorkspaceChange:r.onWorkspaceChange,onClose:()=>c(!1),setCurrentWorkspace:v,setOpen:c,workspacesToUse:w},t._id)})})})]}),e.jsx(wh,{}),e.jsx(Qw,{onCreated:()=>{p()}})]})]})]})}function Xw(t){const{workspace:r,setCurrentWorkspace:n,setOpen:a,workspacesToUse:o}=t,s=t.isCurrentWorkspace??!1;return e.jsxs("div",{className:Uo("flex items-center gap-3 rounded-lg border-2 p-3 border-border",{"bg-muted text-muted-foreground":s}),children:[e.jsxs(rd,{className:"h-8 w-8 flex items-center justify-center",children:[e.jsx("div",{children:e.jsx(nd,{src:r.image})}),e.jsx(ad,{children:(i=r.name,i.split(" ").map(e=>e[0]).join("").toUpperCase().slice(0,2))})]}),e.jsxs("div",{className:"flex-1 min-w-0 max-w-full",children:[e.jsx("div",{className:"flex items-center gap-2",children:e.jsx("span",{className:"font-medium line-clamp-1 text-ellipsis overflow-hidden max-w-full",children:r.name})}),e.jsxs("div",{className:"flex items-center gap-1 text-sm text-muted-foreground",children:[e.jsx(gs,{className:"h-3 w-3"}),e.jsxs("span",{children:[r.users?.length||0," members"]})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[s?null:e.jsx(bs,{size:"sm",onClick:async()=>{await t.onWorkspaceChange(r),n(r),a(!1)},children:"Switch to"}),e.jsx(Jw,{workspace:r,onClose:()=>{if(s){const e=o.findIndex(e=>e._id?.toString()===r._id?.toString());-1!==e&&n(o[e])}}})]})]});var i}function Qw(r){const[n,a]=t.useState(!1),[o,s]=t.useState("emoji"),[i,l]=t.useState("🏢"),[c,u]=t.useState(!1),{createWorkspace:d}=nx(),f=jt({resolver:ja(Di({name:ii().min(2,{message:"Workspace name must be at least 2 characters."}),image:ii().optional()})),defaultValues:{name:"",image:""}});return e.jsxs(Cm,{open:n,onOpenChange:a,children:[e.jsx(Tm,{asChild:!0,children:e.jsxs(bs,{className:"w-full rounded-none",children:[e.jsx(ls,{className:"h-4 w-4 mr-2"}),"Create New Workspace"]})}),e.jsxs(Nm,{className:"max-w-xl min-w-full sm:min-w-[600px]",children:[e.jsxs(Rm,{children:[e.jsx(Pm,{children:"Create New Workspace"}),e.jsx(Om,{children:"Create a new workspace to get started."})]}),e.jsx(As,{...f,children:e.jsxs("form",{onSubmit:f.handleSubmit(async function(e){let t="";if("emoji"===o)t=Mh(i);else if("url"===o&&e.image)try{new URL(e.image),t=e.image}catch{return void f.setError("image",{message:"Please enter a valid URL"})}u(!0);try{await d(e.name,t),a(!1),f.reset(),l("🏢"),s("emoji"),r?.onCreated?.()}catch(e){console.error("Failed to create workspace:",e)}finally{u(!1)}}),children:[e.jsx(Cs,{control:f.control,name:"name",render:({field:t})=>e.jsxs(_s,{children:[e.jsx(Ns,{children:"Workspace Name"}),e.jsx(Rs,{children:e.jsx(Ds,{placeholder:"My Awesome Workspace",...t})}),e.jsx(Os,{})]})}),e.jsxs("div",{className:"flex flex-col gap-y-2 my-2",children:[e.jsxs("div",{children:[e.jsx(ks,{className:"text-sm font-medium",children:"Workspace Icon"}),e.jsx(Ps,{children:"Choose an emoji or upload a custom image for your workspace."})]}),e.jsxs(jp,{value:o,onValueChange:e=>s(e),className:"flex flex-col gap-y-2",children:[e.jsxs("div",{className:"flex items-center gap-x-2 my-1",children:[e.jsx(_p,{value:"emoji",id:"emoji"}),e.jsxs(ks,{htmlFor:"emoji",className:"flex items-center gap-2",children:[e.jsx(fs,{className:"h-4 w-4"}),"Choose Emoji"]})]}),e.jsxs("div",{className:"flex items-center gap-x-2 my-1",children:[e.jsx(_p,{value:"url",id:"url"}),e.jsxs(ks,{htmlFor:"url",className:"flex items-center gap-2",children:[e.jsx(ss,{className:"h-4 w-4"}),"Custom Image URL"]})]})]}),"emoji"===o&&e.jsxs("div",{className:"flex flex-col gap-y-2",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm font-medium",children:"Preview:"}),e.jsx("div",{className:"w-12 h-12 rounded-lg border-2 border-border flex items-center justify-center text-2xl bg-muted",children:i})]}),e.jsx(ph,{className:"h-32 w-full rounded-md border",children:e.jsx("div",{className:"p-4 grid grid-cols-8 gap-2",children:Lh.map((t,r)=>e.jsx("button",{type:"button",onClick:()=>(e=>{l(e),f.setValue("image",Mh(e))})(t),className:"w-8 h-8 rounded flex items-center justify-center text-lg hover:bg-muted transition-colors "+(i===t?"bg-primary text-primary-foreground":""),children:t},r))})})]}),"url"===o&&e.jsxs("div",{className:"flex flex-col gap-y-2",children:[e.jsx(Cs,{control:f.control,name:"image",render:({field:t})=>e.jsxs(_s,{children:[e.jsx(Ns,{children:"Image URL"}),e.jsx(Rs,{children:e.jsx(Ds,{placeholder:"https://example.com/image.png",...t})}),e.jsx(Ps,{children:"Enter a valid URL for your workspace image. Supports PNG, JPG, and SVG formats."}),e.jsx(Os,{})]})}),f.watch("image")&&e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm font-medium",children:"Preview:"}),e.jsx("div",{className:"w-12 h-12 rounded-lg border-2 border-border overflow-hidden bg-muted",children:e.jsx("img",{src:f.watch("image"),alt:"Workspace preview",className:"w-full h-full object-cover",onError:e=>{e.currentTarget.style.display="none"}})})]})]})]}),e.jsxs("div",{className:"flex justify-end gap-3 pt-4",children:[e.jsx(bs,{type:"button",variant:"outline",onClick:()=>{a(!1),f.reset(),l("🏢"),s("emoji")},disabled:c,children:"Cancel"}),e.jsx(bs,{type:"submit",disabled:c,children:c?e.jsxs(e.Fragment,{children:[e.jsx(is,{className:"mr-2 h-4 w-4 animate-spin"}),"Creating..."]}):"Create Workspace"})]})]})})]})]})}const ex="saas-workspace-current",tx=()=>f(ex),rx=(e,t)=>!!e&&t.some(t=>t._id===e),nx=()=>{const e=Z(),r=H(e=>e.os),n=t.useMemo(()=>new Cu(r),[r]),a=H(e=>e.workspaces),o=t.useCallback(t=>{t._id!==a.currentWorkspace?._id&&t&&e.workspaces(O(t))},[a.currentWorkspace,e]);t.useEffect(()=>{if(!a.isInitialized){const t=tx();if(e.workspaces(I(!0)),t){const e=a.workspaces.find(e=>e._id===t);if(e){if(e._id===a.currentWorkspace?._id)return;o(e)}}}},[a.isInitialized,a.workspaces,a.currentWorkspace,e,o]);const s=t.useCallback(()=>{e.workspaces(D())},[e]),i=t.useRef(!1),l=t.useRef(!1),c=t.useCallback(async()=>{if(!a.loading&&!i.current){i.current=!0,e.workspaces(M(!0)),e.workspaces(L(null));try{const t=await n.getWorkspaces();if(e.workspaces(R(t)),t.length>0){const e=tx();if(e&&rx(e,t)){const r=t.find(t=>t._id===e);r&&o(r)}else t.length>0&&(a.currentWorkspace||o(t[0]))}}catch(t){e.workspaces(L(t instanceof Error?t.message:"Failed to fetch workspaces"))}finally{e.workspaces(M(!1)),i.current=!1}}},[n,a.loading,a.currentWorkspace,e,o]),u=t.useCallback(async()=>{if(!a.refreshing&&!i.current){i.current=!0,e.workspaces(U(!0));try{const t=await n.getWorkspaces();e.workspaces(R(t))}catch(e){}finally{e.workspaces(U(!1)),i.current=!1}}},[n,a.refreshing,e]),d=t.useCallback(async(t,r)=>{const o=await n.createWorkspace({name:t,image:r});e.workspaces(R([...a.workspaces,o]))},[n,a.workspaces,e]),f=t.useCallback(async(t,r)=>{const o=await n.updateWorkspace(t._id,r);e.workspaces(R(a.workspaces.map(e=>e._id===t._id?o:e)))},[n,a.workspaces,e]),m=t.useCallback(async()=>{if(l.current)return a.allFeatures.length>0?a.allFeatures:null;if(a.allFeatures.length>0)return a.allFeatures;l.current=!0;try{const t=await n.getFeatures();return e.workspaces(P(t)),t}catch(e){return console.error("Failed to fetch features:",e),null}finally{l.current=!1}},[n,e,a.allFeatures]),p=t.useCallback(async(e,t,r)=>await n.updateFeature(e,t,r),[n]);t.useEffect(()=>{if(a.currentWorkspace?._id){const e=a.workspaces.find(e=>e._id===a.currentWorkspace?._id);if(e){if(e._id===a.currentWorkspace._id)return;o(e)}else if(a.workspaces.length>0){if(a.workspaces[0]._id===a.currentWorkspace._id)return;o(a.workspaces[0])}}},[a.currentWorkspace?._id,a.workspaces,o]);const h=t.useCallback(async e=>await n.getWorkspaceUsers(e),[n]),g=t.useCallback(async(e,t,r)=>await n.addUser(e,{email:t,role:r}),[n]),v=t.useCallback(async(e,t)=>await n.removeUser(e,t),[n]),b=t.useCallback(async(e,t,r)=>await n.updateUser(e,t,r),[n]),y=t.useCallback(async e=>await n.updateUserProfile(e),[n]),w=t.useCallback(async()=>await n.getProfile(),[n]),x=t.useCallback(async e=>await n.getWorkspace(e),[n]);return{workspaces:a.workspaces,loading:a.loading,error:a.error,fetchWorkspaces:c,refreshWorkspaces:u,refreshing:a.refreshing,WorkspaceSwitcher:Yw,currentWorkspace:a.currentWorkspace,setCurrentWorkspace:o,resetCurrentWorkspace:s,createWorkspace:d,allFeatures:a.allFeatures,getFeatures:m,updateFeature:p,getWorkspace:x,switching:a.switching,updateWorkspace:f,getUsers:h,addUser:g,removeUser:v,updateUser:b,getProfile:w,updateUserProfile:y}};function ax(){const e=Z(),r=H(e=>e.auth),n=H(e=>e.os),{serverUrl:a,orgId:o,auth:l}=n,{resetCurrentWorkspace:u}=nx(),d=t.useCallback(async()=>{e.auth(s());try{const t=await Eu.post(`${a}/api/v1/auth/request`,{orgId:o,clientId:l?.clientId,redirect:{success:l?.redirectUrl||window.location.href,error:l?.redirectUrl||window.location.href}});if(!t.data.success)throw e.auth(i()),new Error(t.data.message||"Authentication failed");window.location.href=t.data.data.redirectUrl}catch(t){throw e.auth(i()),console.error("Sign in error:",t),t}},[a,o,l,e]),f=t.useCallback(async()=>{try{e.auth(c()),u()}catch(e){console.error("Logout error:",e)}},[e,u]);return t.useMemo(()=>({user:r.user,session:r.session,isLoading:r.isLoading,isAuthenticated:r.isAuthenticated,isRedirecting:r.isRedirecting,status:r.status,signIn:d,signOut:f}),[r,d,f])}exports.BetaForm=({onSuccess:r,onError:n,className:a="w-full",fieldClassName:o="flex flex-col gap-1.5 w-full",language:s,customTexts:i={},autoFocus:l=!0,showSuccessMessage:c=!0,hideLogo:u=!1,hideTitles:d=!1})=>{const[f,m]=t.useState("en"),[p,h]=t.useState(!1),[g,v]=t.useState(!1),{submitBetaForm:b,isLoading:y,isSubmitting:w,error:x,config:S,success:k,message:A}=(()=>{const e=H(e=>e.os),[r,n]=t.useState(null),[a,o]=t.useState(!0),[s,i]=t.useState(!1),[l,c]=t.useState(null),[u,d]=t.useState(!1),[f,m]=t.useState(null);return t.useEffect(()=>{(async()=>{o(!0);const t=new Ms(e),r=await t.fetchConfig();n(r),o(!1)})()},[e]),{isLoading:a,isSubmitting:s,config:r,error:l,success:u,message:f,submitBetaForm:t.useCallback(async t=>{if(!e){const e="SaaS OS context is not initialized";return c(e),{success:!1,message:e}}try{i(!0),c(null),d(!1),m(null);const r=new Ms(e),n=await r.submitBetaUser({name:t.name||"",email:t.email}),a="success"===n.status;return d(a),m(n.message),{success:a,message:n.message}}catch(e){const t=e instanceof Error?e.message:"Failed to submit beta form";return c(t),d(!1),m(t),{success:!1,message:t}}finally{i(!1)}},[e])}})();t.useEffect(()=>{m((()=>{if("undefined"==typeof window)return"en";const e=window.navigator.language.split("-")[0];return-1!==Object.keys(Xi).indexOf(e)?e:"en"})())},[]),t.useEffect(()=>{k&&c&&(h(!0),v(!0)),x&&v(!0)},[k,c,x]);const E={...Xi[s||f],...i},C=jt({resolver:ja(Yi),defaultValues:{email:"",name:""},mode:"onChange",reValidateMode:"onChange"});t.useEffect(()=>{l&&C.setFocus("name")},[l,C]);const T=C.formState.isValid&&!w;return e.jsx("div",{className:"saas-os-ui",style:{width:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:y?e.jsxs("div",{className:Uo("flex flex-col items-center justify-center w-full px-2.5 sm:px-6 py-2.5 sm:py-6 gap-y-2.5 sm:gap-y-4",a),children:[e.jsx(Is,{className:"h-24 w-24 rounded-lg"}),e.jsx(Is,{className:"h-6 w-32"}),e.jsxs("div",{className:"w-full space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(Is,{className:"h-4 w-16"}),e.jsx(Is,{className:"h-10 w-full"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Is,{className:"h-4 w-16"}),e.jsx(Is,{className:"h-10 w-full"})]}),e.jsx(Is,{className:"h-10 w-full"})]})]}):e.jsxs("div",{className:"flex flex-col items-center justify-center w-full px-2.5 sm:px-6 py-2.5 sm:py-6 gap-y-2.5 sm:gap-y-4",children:[!u&&e.jsxs("div",{className:"flex flex-col items-center justify-center w-full",children:[S?.logo&&e.jsx(el,{logo:S?.logo}),S?.name&&e.jsx("div",{children:S?.name})]}),e.jsx(Me,{...C,children:e.jsxs("form",{onSubmit:C.handleSubmit(async e=>{try{const t=await b(e);t.success?(r?.(),C.reset(),c&&h(!0),v(!0)):(n?.(t.message),v(!0))}catch(e){n?.(e instanceof Error?e.message:E.errorMessage),v(!0)}}),className:a,noValidate:!0,"aria-busy":w,children:[!g&&e.jsxs(e.Fragment,{children:[!d&&S?.screen?.register&&e.jsx(Qi,{screen:S?.screen?.register}),e.jsx(Cs,{control:C.control,name:"name",render:({field:t})=>e.jsxs(_s,{className:o,children:[e.jsx(Ns,{children:E.nameLabel}),e.jsx(Rs,{children:e.jsx(Ds,{...t})}),e.jsx(Ps,{}),e.jsx(Os,{})]})}),e.jsx(Cs,{control:C.control,name:"email",render:({field:t})=>e.jsxs(_s,{className:o,children:[e.jsx(Ns,{children:E.emailLabel}),e.jsx(Rs,{children:e.jsx(Ds,{...t})}),e.jsx(Ps,{}),e.jsx(Os,{})]})}),e.jsx(bs,{type:"submit",disabled:!T,className:o,children:w?E.submittingText:E.submitText})]}),g&&x&&e.jsxs("div",{className:"flex flex-col items-center justify-center w-full",children:[e.jsxs("div",{className:"border-red-300 text-red-700",role:"alert","aria-live":"assertive","aria-atomic":!0,children:[e.jsx("span",{className:"text-4xl mb-2",role:"img","aria-label":"Error",children:"❗"}),x]}),e.jsx("div",{className:"mt-4 flex justify-center",children:e.jsx(bs,{type:"button",onClick:()=>{v(!1),C.reset()},className:o,children:"Try Again"})})]}),g&&p&&A&&e.jsx("div",{className:"flex flex-col items-center justify-center w-full text-green-700 border-green-300 text-center",children:S?.screen?.thankYou&&e.jsx(Qi,{screen:S?.screen?.thankYou})})]})}),!g&&e.jsx("div",{children:e.jsxs("div",{children:["By submitting this form, you consent to our"," ",e.jsx("a",{href:S?.privacyPolicy,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-700",children:"Privacy Policy"})," ","and"," ",e.jsx("a",{href:S?.termsOfService,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-700",children:"Terms of Service"}),"."]})})]})})},exports.SaaSOSProvider=re,exports.WhenAuthenticated=e=>{const{children:t}=e,{status:r}=ax();return r!==d.authenticated?null:t},exports.WhenRoles=e=>{const{children:t,fallback:r,roles:n}=e,{user:a}=ax();return n.includes(a?.role??"")?t:r||null},exports.WhenUnauthenticated=e=>{const{children:t}=e,{status:r}=ax();return r===d.authenticated?null:t},exports.WhenWorkspaceFeatureDisabled=e=>{const{children:t,slug:r}=e,{currentWorkspace:n}=nx(),a=n?.features?.[r];return a?null:t},exports.WhenWorkspaceFeatureEnabled=e=>{const{children:t,slug:r}=e,{currentWorkspace:n}=nx(),a=n?.features?.[r];return a?t:null},exports.WhenWorkspaceRoles=e=>{const{children:t,fallback:r,roles:n}=e,{user:a}=ax(),{currentWorkspace:o}=nx(),s=o?.users.find(e=>e._id===a?.id);return s&&n.includes(s?.role??"")?t:r||null},exports.WorkspaceSwitcher=Yw,exports.useSaaSAuth=ax,exports.useSaaSWorkspaces=nx;
29
+ */function $d(){return Bd||(Bd=1,"production"!==process.env.NODE_ENV&&function(){function e(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!n(e,r)}catch(e){return!0}}"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var r=t,n="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},a=r.useState,o=r.useEffect,s=r.useLayoutEffect,i=r.useDebugValue,l=!1,c=!1,d="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(t,d){l||void 0===r.startTransition||(l=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var u=d();if(!c){var f=d();n(u,f)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),c=!0)}var m=(f=a({inst:{value:u,getSnapshot:d}}))[0].inst,p=f[1];return s(function(){m.value=u,m.getSnapshot=d,e(m)&&p({inst:m})},[t,u,d]),o(function(){return e(m)&&p({inst:m}),t(function(){e(m)&&p({inst:m})})},[t]),i(u),u};Wd.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:d,"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),Wd}function Gd(){return Vd||(Vd=1,"production"===process.env.NODE_ENV?Ld.exports=zd():Ld.exports=$d()),Ld.exports}var Kd=Gd();function Hd(){return()=>{}}var Zd="Avatar",[qd,Jd]=Od(Zd),[Yd,Xd]=qd(Zd),Qd=a.forwardRef((t,r)=>{const{__scopeAvatar:n,...o}=t,[s,i]=a.useState("idle");return e.jsx(Yd,{scope:n,imageLoadingStatus:s,onImageLoadingStatusChange:i,children:e.jsx(Cs.span,{...o,ref:r})})});Qd.displayName=Zd;var eu="AvatarImage",tu=a.forwardRef((t,r)=>{const{__scopeAvatar:n,src:o,onLoadingStatusChange:s=()=>{},...i}=t,l=Xd(eu,n),c=function(e,{referrerPolicy:t,crossOrigin:r}){const n=Kd.useSyncExternalStore(Hd,()=>!0,()=>!1),o=a.useRef(null),s=n?(o.current||(o.current=new window.Image),o.current):null,[i,l]=a.useState(()=>au(s,e));return Ud(()=>{l(au(s,e))},[s,e]),Ud(()=>{const e=e=>()=>{l(e)};if(!s)return;const n=e("loaded"),a=e("error");return s.addEventListener("load",n),s.addEventListener("error",a),t&&(s.referrerPolicy=t),"string"==typeof r&&(s.crossOrigin=r),()=>{s.removeEventListener("load",n),s.removeEventListener("error",a)}},[s,r,t]),i}(o,i),d=Id(e=>{s(e),l.onImageLoadingStatusChange(e)});return Ud(()=>{"idle"!==c&&d(c)},[c,d]),"loaded"===c?e.jsx(Cs.img,{...i,ref:r,src:o}):null});tu.displayName=eu;var ru="AvatarFallback",nu=a.forwardRef((t,r)=>{const{__scopeAvatar:n,delayMs:o,...s}=t,i=Xd(ru,n),[l,c]=a.useState(void 0===o);return a.useEffect(()=>{if(void 0!==o){const e=window.setTimeout(()=>c(!0),o);return()=>window.clearTimeout(e)}},[o]),l&&"loaded"!==i.imageLoadingStatus?e.jsx(Cs.span,{...s,ref:r}):null});function au(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}nu.displayName=ru;var ou=Qd,su=tu,iu=nu;const lu=a.forwardRef(({className:t,...r},n)=>e.jsx(ou,{ref:n,className:Wo("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",t),...r}));lu.displayName=ou.displayName;const cu=a.forwardRef(({className:t,...r},n)=>e.jsx(su,{ref:n,className:Wo("aspect-square h-full w-full",t),...r}));cu.displayName=su.displayName;const du=a.forwardRef(({className:t,...r},n)=>e.jsx(iu,{ref:n,className:Wo("flex h-full w-full items-center justify-center rounded-full bg-muted",t),...r}));function uu(e,t,{checkForDefaultPrevented:r=!0}={}){return function(n){if(e?.(n),!1===r||!n.defaultPrevented)return t?.(n)}}du.displayName=iu.displayName;var fu=a[" useId ".trim().toString()]||(()=>{}),mu=0;function pu(e){const[t,r]=a.useState(fu());return Ud(()=>{r(e=>e??String(mu++))},[e]),e||(t?`radix-${t}`:"")}var hu=a[" useInsertionEffect ".trim().toString()]||Ud;function gu({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[o,s,i]=function({defaultProp:e,onChange:t}){const[r,n]=a.useState(e),o=a.useRef(r),s=a.useRef(t);return hu(()=>{s.current=t},[t]),a.useEffect(()=>{o.current!==r&&(s.current?.(r),o.current=r)},[r,o]),[r,n,s]}({defaultProp:t,onChange:r}),l=void 0!==e,c=l?e:o;{const t=a.useRef(void 0!==e);a.useEffect(()=>{const e=t.current;if(e!==l){const t=e?"controlled":"uncontrolled",r=l?"controlled":"uncontrolled";console.warn(`${n} is changing from ${t} to ${r}. 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=l},[l,n])}const d=a.useCallback(t=>{if(l){const r=function(e){return"function"==typeof e}(t)?t(e):t;r!==e&&i.current?.(r)}else s(t)},[l,e,s,i]);return[c,d]}var vu,bu="dismissableLayer.update",yu="dismissableLayer.pointerDownOutside",wu="dismissableLayer.focusOutside",xu=a.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Su=a.forwardRef((t,r)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:l,onDismiss:c,...d}=t,u=a.useContext(xu),[f,m]=a.useState(null),p=f?.ownerDocument??globalThis?.document,[,h]=a.useState({}),g=Ko(r,e=>m(e)),v=Array.from(u.layers),[b]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=v.indexOf(b),w=f?v.indexOf(f):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,S=w>=y,k=function(e,t=globalThis?.document){const r=Id(e),n=a.useRef(!1),o=a.useRef(()=>{});return a.useEffect(()=>{const e=e=>{if(e.target&&!n.current){let n=function(){Au(yu,r,a,{discrete:!0})};const a={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",o.current),o.current=n,t.addEventListener("click",o.current,{once:!0})):n()}else t.removeEventListener("click",o.current);n.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",e),t.removeEventListener("click",o.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}(e=>{const t=e.target,r=[...u.branches].some(e=>e.contains(t));S&&!r&&(s?.(e),l?.(e),e.defaultPrevented||c?.())},p),A=function(e,t=globalThis?.document){const r=Id(e),n=a.useRef(!1);return a.useEffect(()=>{const e=e=>{if(e.target&&!n.current){Au(wu,r,{originalEvent:e},{discrete:!1})}};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}(e=>{const t=e.target;[...u.branches].some(e=>e.contains(t))||(i?.(e),l?.(e),e.defaultPrevented||c?.())},p);return function(e,t=globalThis?.document){const r=Id(e);a.useEffect(()=>{const e=e=>{"Escape"===e.key&&r(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})},[r,t])}(e=>{w===u.layers.size-1&&(o?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))},p),a.useEffect(()=>{if(f)return n&&(0===u.layersWithOutsidePointerEventsDisabled.size&&(vu=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),ku(),()=>{n&&1===u.layersWithOutsidePointerEventsDisabled.size&&(p.body.style.pointerEvents=vu)}},[f,p,n,u]),a.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),ku())},[f,u]),a.useEffect(()=>{const e=()=>h({});return document.addEventListener(bu,e),()=>document.removeEventListener(bu,e)},[]),e.jsx(Cs.div,{...d,ref:g,style:{pointerEvents:x?S?"auto":"none":void 0,...t.style},onFocusCapture:uu(t.onFocusCapture,A.onFocusCapture),onBlurCapture:uu(t.onBlurCapture,A.onBlurCapture),onPointerDownCapture:uu(t.onPointerDownCapture,k.onPointerDownCapture)})});Su.displayName="DismissableLayer";function ku(){const e=new CustomEvent(bu);document.dispatchEvent(e)}function Au(e,t,r,{discrete:n}){const a=r.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&a.addEventListener(e,t,{once:!0}),n?function(e,t){e&&o.flushSync(()=>e.dispatchEvent(t))}(a,s):a.dispatchEvent(s)}a.forwardRef((t,r)=>{const n=a.useContext(xu),o=a.useRef(null),s=Ko(r,o);return a.useEffect(()=>{const e=o.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),e.jsx(Cs.div,{...t,ref:s})}).displayName="DismissableLayerBranch";var Eu="focusScope.autoFocusOnMount",Cu="focusScope.autoFocusOnUnmount",ju={bubbles:!1,cancelable:!0},Tu=a.forwardRef((t,r)=>{const{loop:n=!1,trapped:o=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...l}=t,[c,d]=a.useState(null),u=Id(s),f=Id(i),m=a.useRef(null),p=Ko(r,e=>d(e)),h=a.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;a.useEffect(()=>{if(o){let e=function(e){if(h.paused||!c)return;const t=e.target;c.contains(t)?m.current=t:Pu(m.current,{select:!0})},t=function(e){if(h.paused||!c)return;const t=e.relatedTarget;null!==t&&(c.contains(t)||Pu(m.current,{select:!0}))},r=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&Pu(c)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const n=new MutationObserver(r);return c&&n.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),n.disconnect()}}},[o,c,h.paused]),a.useEffect(()=>{if(c){Ou.add(h);const t=document.activeElement;if(!c.contains(t)){const r=new CustomEvent(Eu,ju);c.addEventListener(Eu,u),c.dispatchEvent(r),r.defaultPrevented||(!function(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(Pu(n,{select:t}),document.activeElement!==r)return}((e=Nu(c),e.filter(e=>"A"!==e.tagName)),{select:!0}),document.activeElement===t&&Pu(c))}return()=>{c.removeEventListener(Eu,u),setTimeout(()=>{const e=new CustomEvent(Cu,ju);c.addEventListener(Cu,f),c.dispatchEvent(e),e.defaultPrevented||Pu(t??document.body,{select:!0}),c.removeEventListener(Cu,f),Ou.remove(h)},0)}}var e},[c,u,f,h]);const g=a.useCallback(e=>{if(!n&&!o)return;if(h.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,r=document.activeElement;if(t&&r){const t=e.currentTarget,[a,o]=function(e){const t=Nu(e),r=_u(t,e),n=_u(t.reverse(),e);return[r,n]}(t);a&&o?e.shiftKey||r!==o?e.shiftKey&&r===a&&(e.preventDefault(),n&&Pu(o,{select:!0})):(e.preventDefault(),n&&Pu(a,{select:!0})):r===t&&e.preventDefault()}},[n,o,h.paused]);return e.jsx(Cs.div,{tabIndex:-1,...l,ref:p,onKeyDown:g})});function Nu(e){const t=[],r=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(;r.nextNode();)t.push(r.currentNode);return t}function _u(e,t){for(const r of e)if(!Ru(r,{upTo:t}))return r}function Ru(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 Pu(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}Tu.displayName="FocusScope";var Ou=function(){let e=[];return{add(t){const r=e[0];t!==r&&r?.pause(),e=Du(e,t),e.unshift(t)},remove(t){e=Du(e,t),e[0]?.resume()}}}();function Du(e,t){const r=[...e],n=r.indexOf(t);return-1!==n&&r.splice(n,1),r}var Iu=a.forwardRef((t,n)=>{const{container:o,...s}=t,[i,l]=a.useState(!1);Ud(()=>l(!0),[]);const c=o||i&&globalThis?.document?.body;return c?r.createPortal(e.jsx(Cs.div,{...s,ref:n}),c):null});Iu.displayName="Portal";var Mu=e=>{const{present:t,children:r}=e,n=function(e){const[t,r]=a.useState(),n=a.useRef(null),o=a.useRef(e),s=a.useRef("none"),i=e?"mounted":"unmounted",[l,c]=function(e,t){return a.useReducer((e,r)=>t[e][r]??e,e)}(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return a.useEffect(()=>{const e=Uu(n.current);s.current="mounted"===l?e:"none"},[l]),Ud(()=>{const t=n.current,r=o.current;if(r!==e){const n=s.current,a=Uu(t);if(e)c("MOUNT");else if("none"===a||"none"===t?.display)c("UNMOUNT");else{c(r&&n!==a?"ANIMATION_OUT":"UNMOUNT")}o.current=e}},[e,c]),Ud(()=>{if(t){let e;const r=t.ownerDocument.defaultView??window,a=a=>{const s=Uu(n.current).includes(CSS.escape(a.animationName));if(a.target===t&&s&&(c("ANIMATION_END"),!o.current)){const n=t.style.animationFillMode;t.style.animationFillMode="forwards",e=r.setTimeout(()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=n)})}},i=e=>{e.target===t&&(s.current=Uu(n.current))};return t.addEventListener("animationstart",i),t.addEventListener("animationcancel",a),t.addEventListener("animationend",a),()=>{r.clearTimeout(e),t.removeEventListener("animationstart",i),t.removeEventListener("animationcancel",a),t.removeEventListener("animationend",a)}}c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:a.useCallback(e=>{n.current=e?getComputedStyle(e):null,r(e)},[])}}(t),o="function"==typeof r?r({present:n.isPresent}):a.Children.only(r),s=Ko(n.ref,function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;if(r)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r)return e.props.ref;return e.props.ref||e.ref}(o));return"function"==typeof r||n.isPresent?a.cloneElement(o,{ref:s}):null};function Uu(e){return e?.animationName||"none"}Mu.displayName="Presence";var Lu=0;function Fu(){a.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??zu()),document.body.insertAdjacentElement("beforeend",e[1]??zu()),Lu++,()=>{1===Lu&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),Lu--}},[])}function zu(){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 Bu=function(){return Bu=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},Bu.apply(this,arguments)};function Vu(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]])}return r}"function"==typeof SuppressedError&&SuppressedError;var Wu="right-scroll-bar-position",$u="width-before-scroll-bar";function Gu(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var Ku="undefined"!=typeof window?a.useLayoutEffect:a.useEffect,Hu=new WeakMap;function Zu(e,r){var n,a,o,s=(n=null,a=function(t){return e.forEach(function(e){return Gu(e,t)})},(o=t.useState(function(){return{value:n,callback:a,facade:{get current(){return o.value},set current(e){var t=o.value;t!==e&&(o.value=e,o.callback(e,t))}}}})[0]).callback=a,o.facade);return Ku(function(){var t=Hu.get(s);if(t){var r=new Set(t),n=new Set(e),a=s.current;r.forEach(function(e){n.has(e)||Gu(e,null)}),n.forEach(function(e){r.has(e)||Gu(e,a)})}Hu.set(s,e)},[e]),s}function qu(e){return e}var Ju=function(e){var t=e.sideCar,r=Vu(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return a.createElement(n,Bu({},r))};Ju.isSideCarExport=!0;var Yu=function(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=qu);var r=[],n=!1;return{read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(e){var a=t(e,n);return r.push(a),function(){r=r.filter(function(e){return e!==a})}},assignSyncMedium:function(e){for(n=!0;r.length;){var t=r;r=[],t.forEach(e)}r={push:function(t){return e(t)},filter:function(){return r}}},assignMedium:function(e){n=!0;var t=[];if(r.length){var a=r;r=[],a.forEach(e),t=r}var o=function(){var r=t;t=[],r.forEach(e)},s=function(){return Promise.resolve().then(o)};s(),r={push:function(e){t.push(e),s()},filter:function(e){return t=t.filter(e),r}}}}}(null);return t.options=Bu({async:!0,ssr:!1},e),t}(),Xu=function(){},Qu=a.forwardRef(function(e,t){var r=a.useRef(null),n=a.useState({onScrollCapture:Xu,onWheelCapture:Xu,onTouchMoveCapture:Xu}),o=n[0],s=n[1],i=e.forwardProps,l=e.children,c=e.className,d=e.removeScrollBar,u=e.enabled,f=e.shards,m=e.sideCar,p=e.noRelative,h=e.noIsolation,g=e.inert,v=e.allowPinchZoom,b=e.as,y=void 0===b?"div":b,w=e.gapMode,x=Vu(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=m,k=Zu([r,t]),A=Bu(Bu({},x),o);return a.createElement(a.Fragment,null,u&&a.createElement(S,{sideCar:Yu,removeScrollBar:d,shards:f,noRelative:p,noIsolation:h,inert:g,setCallbacks:s,allowPinchZoom:!!v,lockRef:r,gapMode:w}),i?a.cloneElement(a.Children.only(l),Bu(Bu({},A),{ref:k})):a.createElement(y,Bu({},A,{className:c,ref:k}),l))});Qu.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Qu.classNames={fullWidth:$u,zeroRight:Wu};function ef(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=function(){if("undefined"!=typeof __webpack_nonce__)return __webpack_nonce__}();return t&&e.setAttribute("nonce",t),e}var tf=function(){var e=0,t=null;return{add:function(r){var n,a;0==e&&(t=ef())&&(a=r,(n=t).styleSheet?n.styleSheet.cssText=a:n.appendChild(document.createTextNode(a)),function(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}(t)),e++},remove:function(){! --e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},rf=function(){var e,t=(e=tf(),function(t,r){a.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])});return function(e){var r=e.styles,n=e.dynamic;return t(r,n),null}},nf={left:0,top:0,right:0,gap:0},af=function(e){return parseInt(e||"",10)||0},of=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return nf;var t=function(e){var t=window.getComputedStyle(document.body),r=t["padding"===e?"paddingLeft":"marginLeft"],n=t["padding"===e?"paddingTop":"marginTop"],a=t["padding"===e?"paddingRight":"marginRight"];return[af(r),af(n),af(a)]}(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},sf=rf(),lf="data-scroll-locked",cf=function(e,t,r,n){var a=e.left,o=e.top,s=e.right,i=e.gap;return void 0===r&&(r="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(n,";\n padding-right: ").concat(i,"px ").concat(n,";\n }\n body[").concat(lf,"] {\n overflow: hidden ").concat(n,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(n,";"),"margin"===r&&"\n padding-left: ".concat(a,"px;\n padding-top: ").concat(o,"px;\n padding-right: ").concat(s,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(i,"px ").concat(n,";\n "),"padding"===r&&"padding-right: ".concat(i,"px ").concat(n,";")].filter(Boolean).join(""),"\n }\n \n .").concat(Wu," {\n right: ").concat(i,"px ").concat(n,";\n }\n \n .").concat($u," {\n margin-right: ").concat(i,"px ").concat(n,";\n }\n \n .").concat(Wu," .").concat(Wu," {\n right: 0 ").concat(n,";\n }\n \n .").concat($u," .").concat($u," {\n margin-right: 0 ").concat(n,";\n }\n \n body[").concat(lf,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(i,"px;\n }\n")},df=function(){var e=parseInt(document.body.getAttribute(lf)||"0",10);return isFinite(e)?e:0},uf=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,o=void 0===n?"margin":n;a.useEffect(function(){return document.body.setAttribute(lf,(df()+1).toString()),function(){var e=df()-1;e<=0?document.body.removeAttribute(lf):document.body.setAttribute(lf,e.toString())}},[]);var s=a.useMemo(function(){return of(o)},[o]);return a.createElement(sf,{styles:cf(s,!t,o,r?"":"!important")})},ff=!1;if("undefined"!=typeof window)try{var mf=Object.defineProperty({},"passive",{get:function(){return ff=!0,!0}});window.addEventListener("test",mf,mf),window.removeEventListener("test",mf,mf)}catch(e){ff=!1}var pf=!!ff&&{passive:!1},hf=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return"hidden"!==r[t]&&!(r.overflowY===r.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===r[t])},gf=function(e,t){var r=t.ownerDocument,n=t;do{if("undefined"!=typeof ShadowRoot&&n instanceof ShadowRoot&&(n=n.host),vf(e,n)){var a=bf(e,n);if(a[1]>a[2])return!0}n=n.parentNode}while(n&&n!==r.body);return!1},vf=function(e,t){return"v"===e?function(e){return hf(e,"overflowY")}(t):function(e){return hf(e,"overflowX")}(t)},bf=function(e,t){return"v"===e?[(r=t).scrollTop,r.scrollHeight,r.clientHeight]:function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t);var r},yf=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},wf=function(e){return[e.deltaX,e.deltaY]},xf=function(e){return e&&"current"in e?e.current:e},Sf=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},kf=0,Af=[];function Ef(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Cf,jf=(Cf=function(e){var t=a.useRef([]),r=a.useRef([0,0]),n=a.useRef(),o=a.useState(kf++)[0],s=a.useState(rf)[0],i=a.useRef(e);a.useEffect(function(){i.current=e},[e]),a.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var t=function(e,t,r){if(r||2===arguments.length)for(var n,a=0,o=t.length;a<o;a++)!n&&a in t||(n||(n=Array.prototype.slice.call(t,0,a)),n[a]=t[a]);return e.concat(n||Array.prototype.slice.call(t))}([e.lockRef.current],(e.shards||[]).map(xf),!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 l=a.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!i.current.allowPinchZoom;var a,o=yf(e),s=r.current,l="deltaX"in e?e.deltaX:s[0]-o[0],c="deltaY"in e?e.deltaY:s[1]-o[1],d=e.target,u=Math.abs(l)>Math.abs(c)?"h":"v";if("touches"in e&&"h"===u&&"range"===d.type)return!1;var f=gf(u,d);if(!f)return!0;if(f?a=u:(a="v"===u?"h":"v",f=gf(u,d)),!f)return!1;if(!n.current&&"changedTouches"in e&&(l||c)&&(n.current=a),!a)return!0;var m=n.current||a;return function(e,t,r,n){var a=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),o=a*n,s=r.target,i=t.contains(s),l=!1,c=o>0,d=0,u=0;do{if(!s)break;var f=bf(e,s),m=f[0],p=f[1]-f[2]-a*m;(m||p)&&vf(e,s)&&(d+=p,u+=m);var h=s.parentNode;s=h&&h.nodeType===Node.DOCUMENT_FRAGMENT_NODE?h.host:h}while(!i&&s!==document.body||i&&(t.contains(s)||t===s));return(c&&Math.abs(d)<1||!c&&Math.abs(u)<1)&&(l=!0),l}(m,t,e,"h"===m?l:c)},[]),c=a.useCallback(function(e){var r=e;if(Af.length&&Af[Af.length-1]===s){var n="deltaY"in r?wf(r):yf(r),a=t.current.filter(function(e){return e.name===r.type&&(e.target===r.target||r.target===e.shadowParent)&&(t=e.delta,a=n,t[0]===a[0]&&t[1]===a[1]);var t,a})[0];if(a&&a.should)r.cancelable&&r.preventDefault();else if(!a){var o=(i.current.shards||[]).map(xf).filter(Boolean).filter(function(e){return e.contains(r.target)});(o.length>0?l(r,o[0]):!i.current.noIsolation)&&r.cancelable&&r.preventDefault()}}},[]),d=a.useCallback(function(e,r,n,a){var o={name:e,delta:r,target:n,should:a,shadowParent:Ef(n)};t.current.push(o),setTimeout(function(){t.current=t.current.filter(function(e){return e!==o})},1)},[]),u=a.useCallback(function(e){r.current=yf(e),n.current=void 0},[]),f=a.useCallback(function(t){d(t.type,wf(t),t.target,l(t,e.lockRef.current))},[]),m=a.useCallback(function(t){d(t.type,yf(t),t.target,l(t,e.lockRef.current))},[]);a.useEffect(function(){return Af.push(s),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:m}),document.addEventListener("wheel",c,pf),document.addEventListener("touchmove",c,pf),document.addEventListener("touchstart",u,pf),function(){Af=Af.filter(function(e){return e!==s}),document.removeEventListener("wheel",c,pf),document.removeEventListener("touchmove",c,pf),document.removeEventListener("touchstart",u,pf)}},[]);var p=e.removeScrollBar,h=e.inert;return a.createElement(a.Fragment,null,h?a.createElement(s,{styles:Sf(o)}):null,p?a.createElement(uf,{noRelative:e.noRelative,gapMode:e.gapMode}):null)},Yu.useMedium(Cf),Ju),Tf=a.forwardRef(function(e,t){return a.createElement(Qu,Bu({},e,{ref:t,sideCar:jf}))});Tf.classNames=Qu.classNames;var Nf=new WeakMap,_f=new WeakMap,Rf={},Pf=0,Of=function(e){return e&&(e.host||Of(e.parentNode))},Df=function(e,t,r,n){var a=function(e,t){return t.map(function(t){if(e.contains(t))return t;var r=Of(t);return r&&e.contains(r)?r:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)}).filter(function(e){return Boolean(e)})}(t,Array.isArray(e)?e:[e]);Rf[r]||(Rf[r]=new WeakMap);var o=Rf[r],s=[],i=new Set,l=new Set(a),c=function(e){e&&!i.has(e)&&(i.add(e),c(e.parentNode))};a.forEach(c);var d=function(e){e&&!l.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(i.has(e))d(e);else try{var t=e.getAttribute(n),a=null!==t&&"false"!==t,l=(Nf.get(e)||0)+1,c=(o.get(e)||0)+1;Nf.set(e,l),o.set(e,c),s.push(e),1===l&&a&&_f.set(e,!0),1===c&&e.setAttribute(r,"true"),a||e.setAttribute(n,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}})};return d(t),i.clear(),Pf++,function(){s.forEach(function(e){var t=Nf.get(e)-1,a=o.get(e)-1;Nf.set(e,t),o.set(e,a),t||(_f.has(e)||e.removeAttribute(n),_f.delete(e)),a||e.removeAttribute(r)}),--Pf||(Nf=new WeakMap,Nf=new WeakMap,_f=new WeakMap,Rf={})}},If=function(e,t,r){void 0===r&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),a=function(e){return"undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body}(e);return a?(n.push.apply(n,Array.from(a.querySelectorAll("[aria-live], script"))),Df(n,a,r,"aria-hidden")):function(){return null}},Mf="Dialog",[Uf,Lf]=Od(Mf),[Ff,zf]=Uf(Mf),Bf=t=>{const{__scopeDialog:r,children:n,open:o,defaultOpen:s,onOpenChange:i,modal:l=!0}=t,c=a.useRef(null),d=a.useRef(null),[u,f]=gu({prop:o,defaultProp:s??!1,onChange:i,caller:Mf});return e.jsx(Ff,{scope:r,triggerRef:c,contentRef:d,contentId:pu(),titleId:pu(),descriptionId:pu(),open:u,onOpenChange:f,onOpenToggle:a.useCallback(()=>f(e=>!e),[f]),modal:l,children:n})};Bf.displayName=Mf;var Vf="DialogTrigger",Wf=a.forwardRef((t,r)=>{const{__scopeDialog:n,...a}=t,o=zf(Vf,n),s=Ko(r,o.triggerRef);return e.jsx(Cs.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":cm(o.open),...a,ref:s,onClick:uu(t.onClick,o.onOpenToggle)})});Wf.displayName=Vf;var $f="DialogPortal",[Gf,Kf]=Uf($f,{forceMount:void 0}),Hf=t=>{const{__scopeDialog:r,forceMount:n,children:o,container:s}=t,i=zf($f,r);return e.jsx(Gf,{scope:r,forceMount:n,children:a.Children.map(o,t=>e.jsx(Mu,{present:n||i.open,children:e.jsx(Iu,{asChild:!0,container:s,children:t})}))})};Hf.displayName=$f;var Zf="DialogOverlay",qf=a.forwardRef((t,r)=>{const n=Kf(Zf,t.__scopeDialog),{forceMount:a=n.forceMount,...o}=t,s=zf(Zf,t.__scopeDialog);return s.modal?e.jsx(Mu,{present:a||s.open,children:e.jsx(Yf,{...o,ref:r})}):null});qf.displayName=Zf;var Jf=Ho("DialogOverlay.RemoveScroll"),Yf=a.forwardRef((t,r)=>{const{__scopeDialog:n,...a}=t,o=zf(Zf,n);return e.jsx(Tf,{as:Jf,allowPinchZoom:!0,shards:[o.contentRef],children:e.jsx(Cs.div,{"data-state":cm(o.open),...a,ref:r,style:{pointerEvents:"auto",...a.style}})})}),Xf="DialogContent",Qf=a.forwardRef((t,r)=>{const n=Kf(Xf,t.__scopeDialog),{forceMount:a=n.forceMount,...o}=t,s=zf(Xf,t.__scopeDialog);return e.jsx(Mu,{present:a||s.open,children:s.modal?e.jsx(em,{...o,ref:r}):e.jsx(tm,{...o,ref:r})})});Qf.displayName=Xf;var em=a.forwardRef((t,r)=>{const n=zf(Xf,t.__scopeDialog),o=a.useRef(null),s=Ko(r,n.contentRef,o);return a.useEffect(()=>{const e=o.current;if(e)return If(e)},[]),e.jsx(rm,{...t,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:uu(t.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:uu(t.onPointerDownOutside,e=>{const t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;(2===t.button||r)&&e.preventDefault()}),onFocusOutside:uu(t.onFocusOutside,e=>e.preventDefault())})}),tm=a.forwardRef((t,r)=>{const n=zf(Xf,t.__scopeDialog),o=a.useRef(!1),s=a.useRef(!1);return e.jsx(rm,{...t,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:e=>{t.onCloseAutoFocus?.(e),e.defaultPrevented||(o.current||n.triggerRef.current?.focus(),e.preventDefault()),o.current=!1,s.current=!1},onInteractOutside:e=>{t.onInteractOutside?.(e),e.defaultPrevented||(o.current=!0,"pointerdown"===e.detail.originalEvent.type&&(s.current=!0));const r=e.target,a=n.triggerRef.current?.contains(r);a&&e.preventDefault(),"focusin"===e.detail.originalEvent.type&&s.current&&e.preventDefault()}})}),rm=a.forwardRef((t,r)=>{const{__scopeDialog:n,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:i,...l}=t,c=zf(Xf,n),d=a.useRef(null),u=Ko(r,d);return Fu(),e.jsxs(e.Fragment,{children:[e.jsx(Tu,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:s,onUnmountAutoFocus:i,children:e.jsx(Su,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":cm(c.open),...l,ref:u,onDismiss:()=>c.onOpenChange(!1)})}),e.jsxs(e.Fragment,{children:[e.jsx(mm,{titleId:c.titleId}),e.jsx(pm,{contentRef:d,descriptionId:c.descriptionId})]})]})}),nm="DialogTitle",am=a.forwardRef((t,r)=>{const{__scopeDialog:n,...a}=t,o=zf(nm,n);return e.jsx(Cs.h2,{id:o.titleId,...a,ref:r})});am.displayName=nm;var om="DialogDescription",sm=a.forwardRef((t,r)=>{const{__scopeDialog:n,...a}=t,o=zf(om,n);return e.jsx(Cs.p,{id:o.descriptionId,...a,ref:r})});sm.displayName=om;var im="DialogClose",lm=a.forwardRef((t,r)=>{const{__scopeDialog:n,...a}=t,o=zf(im,n);return e.jsx(Cs.button,{type:"button",...a,ref:r,onClick:uu(t.onClick,()=>o.onOpenChange(!1))})});function cm(e){return e?"open":"closed"}lm.displayName=im;var dm="DialogTitleWarning",[um,fm]=function(t,r){const n=a.createContext(r),o=t=>{const{children:r,...o}=t,s=a.useMemo(()=>o,Object.values(o));return e.jsx(n.Provider,{value:s,children:r})};return o.displayName=t+"Provider",[o,function(e){const o=a.useContext(n);if(o)return o;if(void 0!==r)return r;throw new Error(`\`${e}\` must be used within \`${t}\``)}]}(dm,{contentName:Xf,titleName:nm,docsSlug:"dialog"}),mm=({titleId:e})=>{const t=fm(dm),r=`\`${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 a.useEffect(()=>{if(e){document.getElementById(e)||console.error(r)}},[r,e]),null},pm=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${fm("DialogDescriptionWarning").contentName}}.`;return a.useEffect(()=>{const n=e.current?.getAttribute("aria-describedby");if(t&&n){document.getElementById(t)||console.warn(r)}},[r,e,t]),null},hm=Bf,gm=Wf,vm=Hf,bm=qf,ym=Qf,wm=am,xm=sm,Sm=lm;function km(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}var Am=["color"],Em=t.forwardRef(function(e,r){var n=e.color,a=void 0===n?"currentColor":n,o=km(e,Am);return t.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:r}),t.createElement("path",{d:"M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))}),Cm=["color"],jm=t.forwardRef(function(e,r){var n=e.color,a=void 0===n?"currentColor":n,o=km(e,Cm);return t.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:r}),t.createElement("path",{d:"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))}),Tm=["color"],Nm=t.forwardRef(function(e,r){var n=e.color,a=void 0===n?"currentColor":n,o=km(e,Tm);return t.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:r}),t.createElement("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))}),_m=["color"],Rm=t.forwardRef(function(e,r){var n=e.color,a=void 0===n?"currentColor":n,o=km(e,_m);return t.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:r}),t.createElement("path",{d:"M10 6.5C10 8.433 8.433 10 6.5 10C4.567 10 3 8.433 3 6.5C3 4.567 4.567 3 6.5 3C8.433 3 10 4.567 10 6.5ZM9.30884 10.0159C8.53901 10.6318 7.56251 11 6.5 11C4.01472 11 2 8.98528 2 6.5C2 4.01472 4.01472 2 6.5 2C8.98528 2 11 4.01472 11 6.5C11 7.56251 10.6318 8.53901 10.0159 9.30884L12.8536 12.1464C13.0488 12.3417 13.0488 12.6583 12.8536 12.8536C12.6583 13.0488 12.3417 13.0488 12.1464 12.8536L9.30884 10.0159Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))});const Pm=hm,Om=gm,Dm=vm,Im=a.forwardRef(({className:t,...r},n)=>e.jsx(bm,{ref:n,className:Wo("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...r}));Im.displayName=bm.displayName;const Mm=a.forwardRef(({className:t,children:r,...n},o)=>{const{container:s}=a.useContext(ae);return e.jsxs(Dm,{container:s,children:[e.jsx(Im,{}),e.jsxs(ym,{ref:o,className:Wo("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg md:w-full",t),...n,children:[r,e.jsxs(Sm,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[e.jsx(Nm,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]})});Mm.displayName=ym.displayName;const Um=({className:t,...r})=>e.jsx("div",{className:Wo("flex flex-col space-y-1.5 text-center sm:text-left",t),...r});Um.displayName="DialogHeader";const Lm=a.forwardRef(({className:t,...r},n)=>e.jsx(wm,{ref:n,className:Wo("text-lg font-semibold leading-none tracking-tight",t),...r}));Lm.displayName=wm.displayName;const Fm=a.forwardRef(({className:t,...r},n)=>e.jsx(xm,{ref:n,className:Wo("text-sm text-muted-foreground",t),...r}));function zm(r){const n=r+"CollectionProvider",[a,o]=Od(n),[s,i]=a(n,{collectionRef:{current:null},itemMap:new Map}),l=r=>{const{scope:n,children:a}=r,o=t.useRef(null),i=t.useRef(new Map).current;return e.jsx(s,{scope:n,itemMap:i,collectionRef:o,children:a})};l.displayName=n;const c=r+"CollectionSlot",d=Ho(c),u=t.forwardRef((t,r)=>{const{scope:n,children:a}=t,o=Ko(r,i(c,n).collectionRef);return e.jsx(d,{ref:o,children:a})});u.displayName=c;const f=r+"CollectionItemSlot",m="data-radix-collection-item",p=Ho(f),h=t.forwardRef((r,n)=>{const{scope:a,children:o,...s}=r,l=t.useRef(null),c=Ko(n,l),d=i(f,a);return t.useEffect(()=>(d.itemMap.set(l,{ref:l,...s}),()=>{d.itemMap.delete(l)})),e.jsx(p,{[m]:"",ref:c,children:o})});return h.displayName=f,[{Provider:l,Slot:u,ItemSlot:h},function(e){const n=i(r+"CollectionConsumer",e),a=t.useCallback(()=>{const e=n.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${m}]`)),r=Array.from(n.itemMap.values()).sort((e,r)=>t.indexOf(e.ref.current)-t.indexOf(r.ref.current));return r},[n.collectionRef,n.itemMap]);return a},o]}Fm.displayName=xm.displayName;var Bm=a.createContext(void 0);function Vm(e){const t=a.useContext(Bm);return e||t||"ltr"}var Wm="rovingFocusGroup.onEntryFocus",$m={bubbles:!1,cancelable:!0},Gm="RovingFocusGroup",[Km,Hm,Zm]=zm(Gm),[qm,Jm]=Od(Gm,[Zm]),[Ym,Xm]=qm(Gm),Qm=a.forwardRef((t,r)=>e.jsx(Km.Provider,{scope:t.__scopeRovingFocusGroup,children:e.jsx(Km.Slot,{scope:t.__scopeRovingFocusGroup,children:e.jsx(ep,{...t,ref:r})})}));Qm.displayName=Gm;var ep=a.forwardRef((t,r)=>{const{__scopeRovingFocusGroup:n,orientation:o,loop:s=!1,dir:i,currentTabStopId:l,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:d,onEntryFocus:u,preventScrollOnEntryFocus:f=!1,...m}=t,p=a.useRef(null),h=Ko(r,p),g=Vm(i),[v,b]=gu({prop:l,defaultProp:c??null,onChange:d,caller:Gm}),[y,w]=a.useState(!1),x=Id(u),S=Hm(n),k=a.useRef(!1),[A,E]=a.useState(0);return a.useEffect(()=>{const e=p.current;if(e)return e.addEventListener(Wm,x),()=>e.removeEventListener(Wm,x)},[x]),e.jsx(Ym,{scope:n,orientation:o,dir:g,loop:s,currentTabStopId:v,onItemFocus:a.useCallback(e=>b(e),[b]),onItemShiftTab:a.useCallback(()=>w(!0),[]),onFocusableItemAdd:a.useCallback(()=>E(e=>e+1),[]),onFocusableItemRemove:a.useCallback(()=>E(e=>e-1),[]),children:e.jsx(Cs.div,{tabIndex:y||0===A?-1:0,"data-orientation":o,...m,ref:h,style:{outline:"none",...t.style},onMouseDown:uu(t.onMouseDown,()=>{k.current=!0}),onFocus:uu(t.onFocus,e=>{const t=!k.current;if(e.target===e.currentTarget&&t&&!y){const t=new CustomEvent(Wm,$m);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=S().filter(e=>e.focusable);ap([e.find(e=>e.active),e.find(e=>e.id===v),...e].filter(Boolean).map(e=>e.ref.current),f)}}k.current=!1}),onBlur:uu(t.onBlur,()=>w(!1))})})}),tp="RovingFocusGroupItem",rp=a.forwardRef((t,r)=>{const{__scopeRovingFocusGroup:n,focusable:o=!0,active:s=!1,tabStopId:i,children:l,...c}=t,d=pu(),u=i||d,f=Xm(tp,n),m=f.currentTabStopId===u,p=Hm(n),{onFocusableItemAdd:h,onFocusableItemRemove:g,currentTabStopId:v}=f;return a.useEffect(()=>{if(o)return h(),()=>g()},[o,h,g]),e.jsx(Km.ItemSlot,{scope:n,id:u,focusable:o,active:s,children:e.jsx(Cs.span,{tabIndex:m?0:-1,"data-orientation":f.orientation,...c,ref:r,onMouseDown:uu(t.onMouseDown,e=>{o?f.onItemFocus(u):e.preventDefault()}),onFocus:uu(t.onFocus,()=>f.onItemFocus(u)),onKeyDown:uu(t.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void f.onItemShiftTab();if(e.target!==e.currentTarget)return;const t=function(e,t,r){const n=function(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,r);return"vertical"===t&&["ArrowLeft","ArrowRight"].includes(n)||"horizontal"===t&&["ArrowUp","ArrowDown"].includes(n)?void 0:np[n]}(e,f.orientation,f.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let r=p().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)r.reverse();else if("prev"===t||"next"===t){"prev"===t&&r.reverse();const n=r.indexOf(e.currentTarget);r=f.loop?function(e,t){return e.map((r,n)=>e[(t+n)%e.length])}(r,n+1):r.slice(n+1)}setTimeout(()=>ap(r))}}),children:"function"==typeof l?l({isCurrentTabStop:m,hasTabStop:null!=v}):l})})});rp.displayName=tp;var np={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function ap(e,t=!1){const r=document.activeElement;for(const n of e){if(n===r)return;if(n.focus({preventScroll:t}),document.activeElement!==r)return}}var op=Qm,sp=rp;function ip(e){const[t,r]=a.useState(void 0);return Ud(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver(t=>{if(!Array.isArray(t))return;if(!t.length)return;const n=t[0];let a,o;if("borderBoxSize"in n){const e=n.borderBoxSize,t=Array.isArray(e)?e[0]:e;a=t.inlineSize,o=t.blockSize}else a=e.offsetWidth,o=e.offsetHeight;r({width:a,height:o})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}r(void 0)},[e]),t}function lp(e){const t=a.useRef({value:e,previous:e});return a.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var cp="Radio",[dp,up]=Od(cp),[fp,mp]=dp(cp),pp=a.forwardRef((t,r)=>{const{__scopeRadio:n,name:o,checked:s=!1,required:i,disabled:l,value:c="on",onCheck:d,form:u,...f}=t,[m,p]=a.useState(null),h=Ko(r,e=>p(e)),g=a.useRef(!1),v=!m||(u||!!m.closest("form"));return e.jsxs(fp,{scope:n,checked:s,disabled:l,children:[e.jsx(Cs.button,{type:"button",role:"radio","aria-checked":s,"data-state":bp(s),"data-disabled":l?"":void 0,disabled:l,value:c,...f,ref:h,onClick:uu(t.onClick,e=>{s||d?.(),v&&(g.current=e.isPropagationStopped(),g.current||e.stopPropagation())})}),v&&e.jsx(vp,{control:m,bubbles:!g.current,name:o,value:c,checked:s,required:i,disabled:l,form:u,style:{transform:"translateX(-100%)"}})]})});pp.displayName=cp;var hp="RadioIndicator",gp=a.forwardRef((t,r)=>{const{__scopeRadio:n,forceMount:a,...o}=t,s=mp(hp,n);return e.jsx(Mu,{present:a||s.checked,children:e.jsx(Cs.span,{"data-state":bp(s.checked),"data-disabled":s.disabled?"":void 0,...o,ref:r})})});gp.displayName=hp;var vp=a.forwardRef(({__scopeRadio:t,control:r,checked:n,bubbles:o=!0,...s},i)=>{const l=a.useRef(null),c=Ko(l,i),d=lp(n),u=ip(r);return a.useEffect(()=>{const e=l.current;if(!e)return;const t=window.HTMLInputElement.prototype,r=Object.getOwnPropertyDescriptor(t,"checked").set;if(d!==n&&r){const t=new Event("click",{bubbles:o});r.call(e,n),e.dispatchEvent(t)}},[d,n,o]),e.jsx(Cs.input,{type:"radio","aria-hidden":!0,defaultChecked:n,...s,tabIndex:-1,ref:c,style:{...s.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function bp(e){return e?"checked":"unchecked"}vp.displayName="RadioBubbleInput";var yp=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],wp="RadioGroup",[xp,Sp]=Od(wp,[Jm,up]),kp=Jm(),Ap=up(),[Ep,Cp]=xp(wp),jp=a.forwardRef((t,r)=>{const{__scopeRadioGroup:n,name:a,defaultValue:o,value:s,required:i=!1,disabled:l=!1,orientation:c,dir:d,loop:u=!0,onValueChange:f,...m}=t,p=kp(n),h=Vm(d),[g,v]=gu({prop:s,defaultProp:o??null,onChange:f,caller:wp});return e.jsx(Ep,{scope:n,name:a,required:i,disabled:l,value:g,onValueChange:v,children:e.jsx(op,{asChild:!0,...p,orientation:c,dir:h,loop:u,children:e.jsx(Cs.div,{role:"radiogroup","aria-required":i,"aria-orientation":c,"data-disabled":l?"":void 0,dir:h,...m,ref:r})})})});jp.displayName=wp;var Tp="RadioGroupItem",Np=a.forwardRef((t,r)=>{const{__scopeRadioGroup:n,disabled:o,...s}=t,i=Cp(Tp,n),l=i.disabled||o,c=kp(n),d=Ap(n),u=a.useRef(null),f=Ko(r,u),m=i.value===s.value,p=a.useRef(!1);return a.useEffect(()=>{const e=e=>{yp.includes(e.key)&&(p.current=!0)},t=()=>p.current=!1;return document.addEventListener("keydown",e),document.addEventListener("keyup",t),()=>{document.removeEventListener("keydown",e),document.removeEventListener("keyup",t)}},[]),e.jsx(sp,{asChild:!0,...c,focusable:!l,active:m,children:e.jsx(pp,{disabled:l,required:i.required,checked:m,...d,...s,name:i.name,ref:f,onCheck:()=>i.onValueChange(s.value),onKeyDown:uu(e=>{"Enter"===e.key&&e.preventDefault()}),onFocus:uu(s.onFocus,()=>{p.current&&u.current?.click()})})})});Np.displayName=Tp;var _p=a.forwardRef((t,r)=>{const{__scopeRadioGroup:n,...a}=t,o=Ap(n);return e.jsx(gp,{...o,...a,ref:r})});_p.displayName="RadioGroupIndicator";var Rp=jp,Pp=Np,Op=_p;const Dp=a.forwardRef(({className:t,...r},n)=>e.jsx(Rp,{className:Wo("grid gap-2",t),...r,ref:n}));Dp.displayName=Rp.displayName;const Ip=a.forwardRef(({className:t,...r},n)=>e.jsx(Pp,{ref:n,className:Wo("aspect-square h-4 w-4 rounded-full border border-primary text-primary shadow focus:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",t),...r,children:e.jsx(Op,{className:"flex items-center justify-center",children:e.jsx(jm,{className:"h-3.5 w-3.5 fill-primary"})})}));function Mp(e,[t,r]){return Math.min(r,Math.max(t,e))}Ip.displayName=Pp.displayName;var Up="ScrollArea",[Lp,Fp]=Od(Up),[zp,Bp]=Lp(Up),Vp=a.forwardRef((t,r)=>{const{__scopeScrollArea:n,type:o="hover",dir:s,scrollHideDelay:i=600,...l}=t,[c,d]=a.useState(null),[u,f]=a.useState(null),[m,p]=a.useState(null),[h,g]=a.useState(null),[v,b]=a.useState(null),[y,w]=a.useState(0),[x,S]=a.useState(0),[k,A]=a.useState(!1),[E,C]=a.useState(!1),j=Ko(r,e=>d(e)),T=Vm(s);return e.jsx(zp,{scope:n,type:o,dir:T,scrollHideDelay:i,scrollArea:c,viewport:u,onViewportChange:f,content:m,onContentChange:p,scrollbarX:h,onScrollbarXChange:g,scrollbarXEnabled:k,onScrollbarXEnabledChange:A,scrollbarY:v,onScrollbarYChange:b,scrollbarYEnabled:E,onScrollbarYEnabledChange:C,onCornerWidthChange:w,onCornerHeightChange:S,children:e.jsx(Cs.div,{dir:T,...l,ref:j,style:{position:"relative","--radix-scroll-area-corner-width":y+"px","--radix-scroll-area-corner-height":x+"px",...t.style}})})});Vp.displayName=Up;var Wp="ScrollAreaViewport",$p=a.forwardRef((t,r)=>{const{__scopeScrollArea:n,children:o,nonce:s,...i}=t,l=Bp(Wp,n),c=Ko(r,a.useRef(null),l.onViewportChange);return e.jsxs(e.Fragment,{children:[e.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),e.jsx(Cs.div,{"data-radix-scroll-area-viewport":"",...i,ref:c,style:{overflowX:l.scrollbarXEnabled?"scroll":"hidden",overflowY:l.scrollbarYEnabled?"scroll":"hidden",...t.style},children:e.jsx("div",{ref:l.onContentChange,style:{minWidth:"100%",display:"table"},children:o})})]})});$p.displayName=Wp;var Gp="ScrollAreaScrollbar",Kp=a.forwardRef((t,r)=>{const{forceMount:n,...o}=t,s=Bp(Gp,t.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:l}=s,c="horizontal"===t.orientation;return a.useEffect(()=>(c?i(!0):l(!0),()=>{c?i(!1):l(!1)}),[c,i,l]),"hover"===s.type?e.jsx(Hp,{...o,ref:r,forceMount:n}):"scroll"===s.type?e.jsx(Zp,{...o,ref:r,forceMount:n}):"auto"===s.type?e.jsx(qp,{...o,ref:r,forceMount:n}):"always"===s.type?e.jsx(Jp,{...o,ref:r}):null});Kp.displayName=Gp;var Hp=a.forwardRef((t,r)=>{const{forceMount:n,...o}=t,s=Bp(Gp,t.__scopeScrollArea),[i,l]=a.useState(!1);return a.useEffect(()=>{const e=s.scrollArea;let t=0;if(e){const r=()=>{window.clearTimeout(t),l(!0)},n=()=>{t=window.setTimeout(()=>l(!1),s.scrollHideDelay)};return e.addEventListener("pointerenter",r),e.addEventListener("pointerleave",n),()=>{window.clearTimeout(t),e.removeEventListener("pointerenter",r),e.removeEventListener("pointerleave",n)}}},[s.scrollArea,s.scrollHideDelay]),e.jsx(Mu,{present:n||i,children:e.jsx(qp,{"data-state":i?"visible":"hidden",...o,ref:r})})}),Zp=a.forwardRef((t,r)=>{const{forceMount:n,...o}=t,s=Bp(Gp,t.__scopeScrollArea),i="horizontal"===t.orientation,l=hh(()=>d("SCROLL_END"),100),[c,d]=(u="hidden",f={hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}},a.useReducer((e,t)=>f[e][t]??e,u));var u,f;return a.useEffect(()=>{if("idle"===c){const e=window.setTimeout(()=>d("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(e)}},[c,s.scrollHideDelay,d]),a.useEffect(()=>{const e=s.viewport,t=i?"scrollLeft":"scrollTop";if(e){let r=e[t];const n=()=>{const n=e[t];r!==n&&(d("SCROLL"),l()),r=n};return e.addEventListener("scroll",n),()=>e.removeEventListener("scroll",n)}},[s.viewport,i,d,l]),e.jsx(Mu,{present:n||"hidden"!==c,children:e.jsx(Jp,{"data-state":"hidden"===c?"hidden":"visible",...o,ref:r,onPointerEnter:uu(t.onPointerEnter,()=>d("POINTER_ENTER")),onPointerLeave:uu(t.onPointerLeave,()=>d("POINTER_LEAVE"))})})}),qp=a.forwardRef((t,r)=>{const n=Bp(Gp,t.__scopeScrollArea),{forceMount:o,...s}=t,[i,l]=a.useState(!1),c="horizontal"===t.orientation,d=hh(()=>{if(n.viewport){const e=n.viewport.offsetWidth<n.viewport.scrollWidth,t=n.viewport.offsetHeight<n.viewport.scrollHeight;l(c?e:t)}},10);return gh(n.viewport,d),gh(n.content,d),e.jsx(Mu,{present:o||i,children:e.jsx(Jp,{"data-state":i?"visible":"hidden",...s,ref:r})})}),Jp=a.forwardRef((t,r)=>{const{orientation:n="vertical",...o}=t,s=Bp(Gp,t.__scopeScrollArea),i=a.useRef(null),l=a.useRef(0),[c,d]=a.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=ch(c.viewport,c.content),f={...o,sizes:c,onSizesChange:d,hasThumb:Boolean(u>0&&u<1),onThumbChange:e=>i.current=e,onThumbPointerUp:()=>l.current=0,onThumbPointerDown:e=>l.current=e};function m(e,t){return function(e,t,r,n="ltr"){const a=dh(r),o=a/2,s=t||o,i=a-s,l=r.scrollbar.paddingStart+s,c=r.scrollbar.size-r.scrollbar.paddingEnd-i,d=r.content-r.viewport,u="ltr"===n?[0,d]:[-1*d,0];return fh([l,c],u)(e)}(e,l.current,c,t)}return"horizontal"===n?e.jsx(Yp,{...f,ref:r,onThumbPositionChange:()=>{if(s.viewport&&i.current){const e=uh(s.viewport.scrollLeft,c,s.dir);i.current.style.transform=`translate3d(${e}px, 0, 0)`}},onWheelScroll:e=>{s.viewport&&(s.viewport.scrollLeft=e)},onDragScroll:e=>{s.viewport&&(s.viewport.scrollLeft=m(e,s.dir))}}):"vertical"===n?e.jsx(Xp,{...f,ref:r,onThumbPositionChange:()=>{if(s.viewport&&i.current){const e=uh(s.viewport.scrollTop,c);i.current.style.transform=`translate3d(0, ${e}px, 0)`}},onWheelScroll:e=>{s.viewport&&(s.viewport.scrollTop=e)},onDragScroll:e=>{s.viewport&&(s.viewport.scrollTop=m(e))}}):null}),Yp=a.forwardRef((t,r)=>{const{sizes:n,onSizesChange:o,...s}=t,i=Bp(Gp,t.__scopeScrollArea),[l,c]=a.useState(),d=a.useRef(null),u=Ko(r,d,i.onScrollbarXChange);return a.useEffect(()=>{d.current&&c(getComputedStyle(d.current))},[d]),e.jsx(th,{"data-orientation":"horizontal",...s,ref:u,sizes:n,style:{bottom:0,left:"rtl"===i.dir?"var(--radix-scroll-area-corner-width)":0,right:"ltr"===i.dir?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":dh(n)+"px",...t.style},onThumbPointerDown:e=>t.onThumbPointerDown(e.x),onDragScroll:e=>t.onDragScroll(e.x),onWheelScroll:(e,r)=>{if(i.viewport){const n=i.viewport.scrollLeft+e.deltaX;t.onWheelScroll(n),mh(n,r)&&e.preventDefault()}},onResize:()=>{d.current&&i.viewport&&l&&o({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:d.current.clientWidth,paddingStart:lh(l.paddingLeft),paddingEnd:lh(l.paddingRight)}})}})}),Xp=a.forwardRef((t,r)=>{const{sizes:n,onSizesChange:o,...s}=t,i=Bp(Gp,t.__scopeScrollArea),[l,c]=a.useState(),d=a.useRef(null),u=Ko(r,d,i.onScrollbarYChange);return a.useEffect(()=>{d.current&&c(getComputedStyle(d.current))},[d]),e.jsx(th,{"data-orientation":"vertical",...s,ref:u,sizes:n,style:{top:0,right:"ltr"===i.dir?0:void 0,left:"rtl"===i.dir?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":dh(n)+"px",...t.style},onThumbPointerDown:e=>t.onThumbPointerDown(e.y),onDragScroll:e=>t.onDragScroll(e.y),onWheelScroll:(e,r)=>{if(i.viewport){const n=i.viewport.scrollTop+e.deltaY;t.onWheelScroll(n),mh(n,r)&&e.preventDefault()}},onResize:()=>{d.current&&i.viewport&&l&&o({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:d.current.clientHeight,paddingStart:lh(l.paddingTop),paddingEnd:lh(l.paddingBottom)}})}})}),[Qp,eh]=Lp(Gp),th=a.forwardRef((t,r)=>{const{__scopeScrollArea:n,sizes:o,hasThumb:s,onThumbChange:i,onThumbPointerUp:l,onThumbPointerDown:c,onThumbPositionChange:d,onDragScroll:u,onWheelScroll:f,onResize:m,...p}=t,h=Bp(Gp,n),[g,v]=a.useState(null),b=Ko(r,e=>v(e)),y=a.useRef(null),w=a.useRef(""),x=h.viewport,S=o.content-o.viewport,k=Id(f),A=Id(d),E=hh(m,10);function C(e){if(y.current){const t=e.clientX-y.current.left,r=e.clientY-y.current.top;u({x:t,y:r})}}return a.useEffect(()=>{const e=e=>{const t=e.target,r=g?.contains(t);r&&k(e,S)};return document.addEventListener("wheel",e,{passive:!1}),()=>document.removeEventListener("wheel",e,{passive:!1})},[x,g,S,k]),a.useEffect(A,[o,A]),gh(g,E),gh(h.content,E),e.jsx(Qp,{scope:n,scrollbar:g,hasThumb:s,onThumbChange:Id(i),onThumbPointerUp:Id(l),onThumbPositionChange:A,onThumbPointerDown:Id(c),children:e.jsx(Cs.div,{...p,ref:b,style:{position:"absolute",...p.style},onPointerDown:uu(t.onPointerDown,e=>{if(0===e.button){e.target.setPointerCapture(e.pointerId),y.current=g.getBoundingClientRect(),w.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",h.viewport&&(h.viewport.style.scrollBehavior="auto"),C(e)}}),onPointerMove:uu(t.onPointerMove,C),onPointerUp:uu(t.onPointerUp,e=>{const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=w.current,h.viewport&&(h.viewport.style.scrollBehavior=""),y.current=null})})})}),rh="ScrollAreaThumb",nh=a.forwardRef((t,r)=>{const{forceMount:n,...a}=t,o=eh(rh,t.__scopeScrollArea);return e.jsx(Mu,{present:n||o.hasThumb,children:e.jsx(ah,{ref:r,...a})})}),ah=a.forwardRef((t,r)=>{const{__scopeScrollArea:n,style:o,...s}=t,i=Bp(rh,n),l=eh(rh,n),{onThumbPositionChange:c}=l,d=Ko(r,e=>l.onThumbChange(e)),u=a.useRef(void 0),f=hh(()=>{u.current&&(u.current(),u.current=void 0)},100);return a.useEffect(()=>{const e=i.viewport;if(e){const t=()=>{if(f(),!u.current){const t=ph(e,c);u.current=t,c()}};return c(),e.addEventListener("scroll",t),()=>e.removeEventListener("scroll",t)}},[i.viewport,f,c]),e.jsx(Cs.div,{"data-state":l.hasThumb?"visible":"hidden",...s,ref:d,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...o},onPointerDownCapture:uu(t.onPointerDownCapture,e=>{const t=e.target.getBoundingClientRect(),r=e.clientX-t.left,n=e.clientY-t.top;l.onThumbPointerDown({x:r,y:n})}),onPointerUp:uu(t.onPointerUp,l.onThumbPointerUp)})});nh.displayName=rh;var oh="ScrollAreaCorner",sh=a.forwardRef((t,r)=>{const n=Bp(oh,t.__scopeScrollArea),a=Boolean(n.scrollbarX&&n.scrollbarY);return"scroll"!==n.type&&a?e.jsx(ih,{...t,ref:r}):null});sh.displayName=oh;var ih=a.forwardRef((t,r)=>{const{__scopeScrollArea:n,...o}=t,s=Bp(oh,n),[i,l]=a.useState(0),[c,d]=a.useState(0),u=Boolean(i&&c);return gh(s.scrollbarX,()=>{const e=s.scrollbarX?.offsetHeight||0;s.onCornerHeightChange(e),d(e)}),gh(s.scrollbarY,()=>{const e=s.scrollbarY?.offsetWidth||0;s.onCornerWidthChange(e),l(e)}),u?e.jsx(Cs.div,{...o,ref:r,style:{width:i,height:c,position:"absolute",right:"ltr"===s.dir?0:void 0,left:"rtl"===s.dir?0:void 0,bottom:0,...t.style}}):null});function lh(e){return e?parseInt(e,10):0}function ch(e,t){const r=e/t;return isNaN(r)?0:r}function dh(e){const t=ch(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*t;return Math.max(n,18)}function uh(e,t,r="ltr"){const n=dh(t),a=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-a,s=t.content-t.viewport,i=o-n,l=Mp(e,"ltr"===r?[0,s]:[-1*s,0]);return fh([0,s],[0,i])(l)}function fh(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(r-e[0])}}function mh(e,t){return e>0&&e<t}var ph=(e,t=()=>{})=>{let r={left:e.scrollLeft,top:e.scrollTop},n=0;return function a(){const o={left:e.scrollLeft,top:e.scrollTop},s=r.left!==o.left,i=r.top!==o.top;(s||i)&&t(),r=o,n=window.requestAnimationFrame(a)}(),()=>window.cancelAnimationFrame(n)};function hh(e,t){const r=Id(e),n=a.useRef(0);return a.useEffect(()=>()=>window.clearTimeout(n.current),[]),a.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(r,t)},[r,t])}function gh(e,t){const r=Id(t);Ud(()=>{let t=0;if(e){const n=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(r)});return n.observe(e),()=>{window.cancelAnimationFrame(t),n.unobserve(e)}}},[e,r])}var vh=Vp,bh=$p,yh=sh;const wh=a.forwardRef(({className:t,children:r,...n},a)=>e.jsxs(vh,{ref:a,className:Wo("relative overflow-hidden",t),...n,children:[e.jsx(bh,{className:"h-full w-full rounded-[inherit]",children:r}),e.jsx(xh,{}),e.jsx(yh,{})]}));wh.displayName=vh.displayName;const xh=a.forwardRef(({className:t,orientation:r="vertical",...n},a)=>e.jsx(Kp,{ref:a,orientation:r,className:Wo("flex touch-none select-none transition-colors","vertical"===r&&"h-full w-2.5 border-l border-l-transparent p-[1px]","horizontal"===r&&"h-2.5 border-t border-t-transparent p-[1px]",t),...n,children:e.jsx(nh,{className:Wo("relative rounded-full bg-border","vertical"===r&&"flex-1")})}));xh.displayName=Kp.displayName;var Sh="horizontal",kh=["horizontal","vertical"],Ah=a.forwardRef((t,r)=>{const{decorative:n,orientation:a=Sh,...o}=t,s=function(e){return kh.includes(e)}(a)?a:Sh,i=n?{role:"none"}:{"aria-orientation":"vertical"===s?s:void 0,role:"separator"};return e.jsx(Cs.div,{"data-orientation":s,...i,...o,ref:r})});Ah.displayName="Separator";var Eh=Ah;const Ch=a.forwardRef(({className:t,orientation:r="horizontal",decorative:n=!0,...a},o)=>e.jsx(Eh,{ref:o,decorative:n,orientation:r,className:Wo("shrink-0 bg-border","horizontal"===r?"h-[1px] w-full":"h-full w-[1px]",t),...a}));function jh(){const e=ee(),r=Q(e=>e.os),{serverUrl:n,version:a,orgId:o,settings:s}=r,i=t.useRef(!1),l=t.useCallback(async()=>{if(i.current)return s||null;if(s)return s;if(!n||!a||!o)return null;i.current=!0;try{const t=y(),r=await fetch(`${n}/api/${a}/public/${o}/settings`,{headers:t});if(!r.ok)throw new Error("Failed to fetch settings");const s=await r.json();return e.os(N(s)),s}catch(e){return console.error("Failed to fetch settings:",e),null}finally{i.current=!1}},[n,a,o,s,e]);return t.useEffect(()=>{n&&a&&o&&!s&&!i.current&&l()},[n,a,o]),t.useMemo(()=>({settings:s,getSettings:l}),[s,l])}Ch.displayName=Eh.displayName;var Th="AlertDialog",[Nh,_h]=Od(Th,[Lf]),Rh=Lf(),Ph=t=>{const{__scopeAlertDialog:r,...n}=t,a=Rh(r);return e.jsx(hm,{...a,...n,modal:!0})};Ph.displayName=Th;var Oh=a.forwardRef((t,r)=>{const{__scopeAlertDialog:n,...a}=t,o=Rh(n);return e.jsx(gm,{...o,...a,ref:r})});Oh.displayName="AlertDialogTrigger";var Dh=t=>{const{__scopeAlertDialog:r,...n}=t,a=Rh(r);return e.jsx(vm,{...a,...n})};Dh.displayName="AlertDialogPortal";var Ih=a.forwardRef((t,r)=>{const{__scopeAlertDialog:n,...a}=t,o=Rh(n);return e.jsx(bm,{...o,...a,ref:r})});Ih.displayName="AlertDialogOverlay";var Mh="AlertDialogContent",[Uh,Lh]=Nh(Mh),Fh=function(t){const r=({children:t})=>e.jsx(e.Fragment,{children:t});return r.displayName=`${t}.Slottable`,r.__radixId=Jo,r}("AlertDialogContent"),zh=a.forwardRef((t,r)=>{const{__scopeAlertDialog:n,children:o,...s}=t,i=Rh(n),l=a.useRef(null),c=Ko(r,l),d=a.useRef(null);return e.jsx(um,{contentName:Mh,titleName:Bh,docsSlug:"alert-dialog",children:e.jsx(Uh,{scope:n,cancelRef:d,children:e.jsxs(ym,{role:"alertdialog",...i,...s,ref:c,onOpenAutoFocus:uu(s.onOpenAutoFocus,e=>{e.preventDefault(),d.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:[e.jsx(Fh,{children:o}),e.jsx(Zh,{contentRef:l})]})})})});zh.displayName=Mh;var Bh="AlertDialogTitle",Vh=a.forwardRef((t,r)=>{const{__scopeAlertDialog:n,...a}=t,o=Rh(n);return e.jsx(wm,{...o,...a,ref:r})});Vh.displayName=Bh;var Wh="AlertDialogDescription",$h=a.forwardRef((t,r)=>{const{__scopeAlertDialog:n,...a}=t,o=Rh(n);return e.jsx(xm,{...o,...a,ref:r})});$h.displayName=Wh;var Gh=a.forwardRef((t,r)=>{const{__scopeAlertDialog:n,...a}=t,o=Rh(n);return e.jsx(Sm,{...o,...a,ref:r})});Gh.displayName="AlertDialogAction";var Kh="AlertDialogCancel",Hh=a.forwardRef((t,r)=>{const{__scopeAlertDialog:n,...a}=t,{cancelRef:o}=Lh(Kh,n),s=Rh(n),i=Ko(r,o);return e.jsx(Sm,{...s,...a,ref:i})});Hh.displayName=Kh;var Zh=({contentRef:e})=>{const t=`\`${Mh}\` requires a description for the component to be accessible for screen reader users.\n\nYou can add a description to the \`${Mh}\` by passing a \`${Wh}\` component as a child, which also benefits sighted users by adding visible context to the dialog.\n\nAlternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${Mh}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return a.useEffect(()=>{document.getElementById(e.current?.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},qh=Ih,Jh=zh,Yh=Gh,Xh=Hh,Qh=Vh,eg=$h;const tg=Ph,rg=Oh,ng=Dh,ag=a.forwardRef(({className:t,...r},n)=>e.jsx(qh,{className:Wo("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...r,ref:n}));ag.displayName=qh.displayName;const og=a.forwardRef(({className:t,...r},n)=>{const{container:o}=a.useContext(ae);return e.jsxs(ng,{container:o,children:[e.jsx(ag,{}),e.jsx(Jh,{ref:n,className:Wo("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg md:w-full",t),...r})]})});og.displayName=Jh.displayName;const sg=({className:t,...r})=>e.jsx("div",{className:Wo("flex flex-col space-y-2 text-center sm:text-left",t),...r});sg.displayName="AlertDialogHeader";const ig=({className:t,...r})=>e.jsx("div",{className:Wo("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...r});ig.displayName="AlertDialogFooter";const lg=a.forwardRef(({className:t,...r},n)=>e.jsx(Qh,{ref:n,className:Wo("text-lg font-semibold",t),...r}));lg.displayName=Qh.displayName;const cg=a.forwardRef(({className:t,...r},n)=>e.jsx(eg,{ref:n,className:Wo("text-sm text-muted-foreground",t),...r}));cg.displayName=eg.displayName;const dg=a.forwardRef(({className:t,...r},n)=>e.jsx(Yh,{ref:n,className:Wo(As(),t),...r}));dg.displayName=Yh.displayName;const ug=a.forwardRef(({className:t,...r},n)=>e.jsx(Xh,{ref:n,className:Wo(As({variant:"outline"}),"mt-2 sm:mt-0",t),...r}));function fg(){return e.jsxs("div",{className:"space-y-3.5",children:[e.jsx(Vs,{className:"h-10 w-full"}),e.jsx(Vs,{className:"h-10 w-full"}),e.jsx(Vs,{className:"h-10 w-full"})]})}ug.displayName=Xh.displayName;const mg=({workspace:r})=>{const[n,a]=t.useState(!1),{deleteWorkspace:o}=qx(),s=Q(e=>e.auth.session?.user||null);if(!r)return e.jsx(fg,{});const i=r?.users.find(e=>("object"==typeof e&&null!==e?e._id:e)===s?.id)?.role;return"admin"===i?.toLowerCase()?e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold text-destructive",children:"Delete Workspace"}),e.jsxs("p",{className:"text-sm text-muted-foreground mt-2",children:["Once you delete a workspace, there is no going back. This will permanently delete the workspace ",e.jsx("strong",{children:r.name})," and all of its data, including members, settings, and features."]})]}),e.jsxs(tg,{children:[e.jsx(rg,{asChild:!0,children:e.jsxs(Es,{variant:"destructive",disabled:n,children:[e.jsx(ys,{className:"h-4 w-4 mr-2"}),"Delete Workspace"]})}),e.jsxs(og,{children:[e.jsxs(sg,{children:[e.jsx(lg,{children:"Are you absolutely sure?"}),e.jsxs(cg,{children:["This action cannot be undone. This will permanently delete the workspace"," ",e.jsx("strong",{children:r.name})," and all of its data."]})]}),e.jsxs(ig,{children:[e.jsx(ug,{children:"Cancel"}),e.jsx(dg,{onClick:async()=>{a(!0);try{await o(r._id)}catch(e){console.error("Failed to delete workspace:",e),alert(e instanceof Error?e.message:"Failed to delete workspace")}finally{a(!1)}},disabled:n,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:n?"Deleting...":"Delete Workspace"})]})]})]})]}):e.jsx("div",{className:"space-y-4",children:e.jsx("div",{className:"text-red-500",children:"Only workspace admins can delete workspaces."})})};var pg="Switch",[hg,gg]=Od(pg),[vg,bg]=hg(pg),yg=a.forwardRef((t,r)=>{const{__scopeSwitch:n,name:o,checked:s,defaultChecked:i,required:l,disabled:c,value:d="on",onCheckedChange:u,form:f,...m}=t,[p,h]=a.useState(null),g=Ko(r,e=>h(e)),v=a.useRef(!1),b=!p||(f||!!p.closest("form")),[y,w]=gu({prop:s,defaultProp:i??!1,onChange:u,caller:pg});return e.jsxs(vg,{scope:n,checked:y,disabled:c,children:[e.jsx(Cs.button,{type:"button",role:"switch","aria-checked":y,"aria-required":l,"data-state":kg(y),"data-disabled":c?"":void 0,disabled:c,value:d,...m,ref:g,onClick:uu(t.onClick,e=>{w(e=>!e),b&&(v.current=e.isPropagationStopped(),v.current||e.stopPropagation())})}),b&&e.jsx(Sg,{control:p,bubbles:!v.current,name:o,value:d,checked:y,required:l,disabled:c,form:f,style:{transform:"translateX(-100%)"}})]})});yg.displayName=pg;var wg="SwitchThumb",xg=a.forwardRef((t,r)=>{const{__scopeSwitch:n,...a}=t,o=bg(wg,n);return e.jsx(Cs.span,{"data-state":kg(o.checked),"data-disabled":o.disabled?"":void 0,...a,ref:r})});xg.displayName=wg;var Sg=a.forwardRef(({__scopeSwitch:t,control:r,checked:n,bubbles:o=!0,...s},i)=>{const l=a.useRef(null),c=Ko(l,i),d=lp(n),u=ip(r);return a.useEffect(()=>{const e=l.current;if(!e)return;const t=window.HTMLInputElement.prototype,r=Object.getOwnPropertyDescriptor(t,"checked").set;if(d!==n&&r){const t=new Event("click",{bubbles:o});r.call(e,n),e.dispatchEvent(t)}},[d,n,o]),e.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...s,tabIndex:-1,ref:c,style:{...s.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function kg(e){return e?"checked":"unchecked"}Sg.displayName="SwitchBubbleInput";var Ag=yg,Eg=xg;const Cg=a.forwardRef(({className:t,...r},n)=>e.jsx(Ag,{className:Wo("peer inline-flex h-[20px] w-[36px] shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",t),...r,ref:n,children:e.jsx(Eg,{className:Wo("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));Cg.displayName=Ag.displayName;const jg=({workspaceId:r})=>{const[n,a]=t.useState({}),{allFeatures:o,updateFeature:s,getWorkspace:i}=qx(),[l,c]=t.useState(null),d=Q(e=>e.auth.session?.user||null);if(t.useEffect(()=>{i(r).then(c)},[r]),!l)return e.jsx(fg,{});const u=l?.users.find(e=>("string"==typeof e?e:e._id)===d?.id)?.role,f="admin"===u?.toLowerCase();return e.jsx("div",{children:e.jsxs("div",{className:"flex flex-col gap-y-3.5 pr-4",children:[!f&&e.jsx("div",{className:"text-red-500",children:"Only workspace admin can change the features."}),!o.length&&e.jsx("div",{className:"text-muted-foreground",children:"Workspace has no features to manage."}),o.length>0&&e.jsx("div",{className:"flex flex-col gap-y-3.5",children:o.map(t=>{const r=l?.features?.[t.slug];return e.jsxs("div",{className:"flex items-center gap-x-2 justify-between w-full",children:[e.jsxs("div",{className:"flex gap-x-2 flex-col",children:[e.jsx("h3",{className:"font-medium text-ellipsis",children:t.name}),e.jsx("p",{className:"text-muted-foreground",children:t.description})]}),e.jsx(Cg,{disabled:n[t.slug]||!f,checked:r??t.defaultValue,onCheckedChange:e=>async function(e,t){if(!l)return;a(r=>({...r,[e]:t}));const r=await s(l._id,e,t);c(r),a(t=>({...t,[e]:!1}))}(t.slug,e)})]},t._id)})})]})})};function Tg(e){return`data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text x="50%" y="50%" dominant-baseline="middle" alignment-baseline="middle" text-anchor="middle" font-size="50" font-family="sans-serif">${e}</text></svg>`}const Ng=["🏢","🏬","🏣","🏤","🏦","🏛️","🏠","🏡","🏭","🏗️","🏪","🏨","🏫","🏥","💼","📊","📈","📉","📋","📁","📂","🗂️","🗃️","🗄️","📅","🗓️","📝","🖋️","✏️","🖊️","🖌️","🖍️","📇","📌","📍","📎","🖇️","💻","🖥️","🖨️","🖱️","⌨️","📱","📲","📡","🌐","🔗","🔒","🔓","⚙️","🔧","🛠️","🧑‍💻","👨‍💻","👩‍💻","🕹️","💾","📟","🖥️","🖲️","🚀","💡","🎨","🖼️","🧪","🔬","🧬","🎯","⚡","🎲","🎮","🧩","📷","🎥","✉️","📨","📩","📧","📞","☎️","📠","🗣️","💬","🗨️","📢","📣","🔔","🛎️","💰","💸","💳","🏦","📈","📉","⚖️","🧾","🪙","🏛️","⚗️","🧪","🔭","🔬","🩺","🧬","🩻","🏥","🌱","🌍","🌏","🌎","🌡️","👨‍💼","👩‍💼","👨‍🏫","👩‍🏫","👨‍🔬","👩‍🔬","👨‍🎨","👩‍🎨","👨‍🔧","👩‍🔧","👨‍🚀","👩‍🚀","👨‍⚖️","👩‍⚖️","🏅","🎖️","🥇","🥈","🥉","🏆","🎗️","🔑","🗝️","🧭","🛡️","🚩","🏳️‍🌈","🎟️","🎫"],_g=({workspace:r})=>{const[n,a]=t.useState(!1),[o,s]=t.useState("emoji"),[i,l]=t.useState(),{updateWorkspace:c}=qx(),d=Q(e=>e.auth.session?.user||null),u=Ot({resolver:Oa(Bi({name:pi().min(2,{message:"Workspace name must be at least 2 characters."}),image:pi().optional()})),defaultValues:{name:r.name||"",image:r.image||""}});if(!r)return e.jsx(fg,{});const f=r?.users.find(e=>("object"==typeof e&&null!==e?e._id:e)===d?.id)?.role,m="admin"===f?.toLowerCase();return e.jsxs("div",{children:[!m&&e.jsx("div",{className:"text-red-500",children:"Only workspace admin can change the workspace settings."}),e.jsx(Rs,{...u,children:e.jsxs("form",{onSubmit:u.handleSubmit(async function(e){a(!0);try{await c(r,e)}catch(e){console.error("Failed to update workspace:",e)}finally{a(!1)}}),className:"space-y-6",children:[e.jsx(Os,{control:u.control,name:"name",render:({field:t})=>e.jsxs(Ms,{children:[e.jsx(Us,{children:"Name"}),e.jsx(Ls,{children:e.jsx(Bs,{placeholder:"My Awesome Workspace",...t,disabled:!m})}),e.jsx(zs,{})]})}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(_s,{className:"text-sm font-medium",children:"Icon"}),e.jsx(Fs,{children:"Choose an emoji or upload a custom image for your workspace."})]}),e.jsxs(Dp,{value:o,disabled:!m,onValueChange:e=>s(e),className:"flex flex-col space-y-3",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ip,{value:"emoji",id:"emoji"}),e.jsxs(_s,{htmlFor:"emoji",className:"flex items-center gap-2",children:[e.jsx(vs,{className:"h-4 w-4"}),"Choose Emoji"]})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ip,{value:"url",id:"url"}),e.jsxs(_s,{htmlFor:"url",className:"flex items-center gap-2",children:[e.jsx(us,{className:"h-4 w-4"}),"Custom Image URL"]})]})]}),"emoji"===o&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm font-medium",children:"Preview:"}),e.jsxs("div",{className:"w-12 h-12 rounded-lg border-2 border-border flex items-center justify-center text-2xl bg-muted",children:[i&&e.jsx("span",{className:"text-2xl",children:i}),!i&&e.jsx("img",{src:u.watch("image")})]})]}),e.jsx(wh,{className:"h-32 w-full rounded-md border",children:e.jsx("div",{className:"p-4 grid grid-cols-8 gap-2",children:Ng.map((t,r)=>e.jsx("button",{type:"button",onClick:()=>(e=>{l(e),u.setValue("image",Tg(e))})(t),disabled:!m,className:"w-8 h-8 rounded flex items-center justify-center text-lg hover:bg-muted transition-colors "+(i===t?"bg-primary text-primary-foreground":""),children:t},r))})})]}),"url"===o&&e.jsxs("div",{className:"space-y-3",children:[e.jsx(Os,{control:u.control,name:"image",render:({field:t})=>e.jsxs(Ms,{children:[e.jsx(Us,{children:"Image URL"}),e.jsx(Ls,{children:e.jsx(Bs,{placeholder:"https://example.com/image.png",...t,disabled:!m})}),e.jsx(Fs,{children:"Enter a valid URL for your workspace image. Supports PNG, JPG, and SVG formats."}),e.jsx(zs,{})]})}),u.watch("image")&&e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm font-medium",children:"Preview:"}),e.jsx("div",{className:"w-12 h-12 rounded-lg border-2 border-border overflow-hidden bg-muted",children:e.jsx("img",{src:u.watch("image"),className:"w-full h-full object-cover"})})]})]})]}),e.jsx("div",{className:"flex justify-end gap-3 pt-4",children:m&&e.jsx(Es,{type:"submit",disabled:n,progress:n,children:"Update Workspace"})})]})})]})};var Rg=.999,Pg=/[\\\/_+.#"@\[\(\{&]/,Og=/[\\\/_+.#"@\[\(\{&]/g,Dg=/[\s-]/,Ig=/[\s-]/g;function Mg(e,t,r,n,a,o,s){if(o===t.length)return a===e.length?1:.99;var i=`${a},${o}`;if(void 0!==s[i])return s[i];for(var l,c,d,u,f=n.charAt(o),m=r.indexOf(f,a),p=0;m>=0;)(l=Mg(e,t,r,n,m+1,o+1,s))>p&&(m===a?l*=1:Pg.test(e.charAt(m-1))?(l*=.8,(d=e.slice(a,m-1).match(Og))&&a>0&&(l*=Math.pow(Rg,d.length))):Dg.test(e.charAt(m-1))?(l*=.9,(u=e.slice(a,m-1).match(Ig))&&a>0&&(l*=Math.pow(Rg,u.length))):(l*=.17,a>0&&(l*=Math.pow(Rg,m-a))),e.charAt(m)!==t.charAt(o)&&(l*=.9999)),(l<.1&&r.charAt(m-1)===n.charAt(o+1)||n.charAt(o+1)===n.charAt(o)&&r.charAt(m-1)!==n.charAt(o))&&(.1*(c=Mg(e,t,r,n,m+1,o+2,s))>l&&(l=.1*c)),l>p&&(p=l),m=r.indexOf(f,m+1);return s[i]=p,p}function Ug(e){return e.toLowerCase().replace(Ig," ")}function Lg(e,t,r){return Mg(e=r&&r.length>0?""+(e+" "+r.join(" ")):e,t,Ug(e),Ug(t),0,0,{})}var Fg='[cmdk-group=""]',zg='[cmdk-group-items=""]',Bg='[cmdk-item=""]',Vg=`${Bg}:not([aria-disabled="true"])`,Wg="cmdk-item-select",$g="data-value",Gg=(e,t,r)=>Lg(e,t,r),Kg=a.createContext(void 0),Hg=()=>a.useContext(Kg),Zg=a.createContext(void 0),qg=()=>a.useContext(Zg),Jg=a.createContext(void 0),Yg=a.forwardRef((e,t)=>{let r=uv(()=>{var t,r;return{search:"",value:null!=(r=null!=(t=e.value)?t:e.defaultValue)?r:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),n=uv(()=>new Set),o=uv(()=>new Map),s=uv(()=>new Map),i=uv(()=>new Set),l=cv(e),{label:c,children:d,value:u,onValueChange:f,filter:m,shouldFilter:p,loop:h,disablePointerSelection:g=!1,vimBindings:v=!0,...b}=e,y=pu(),w=pu(),x=pu(),S=a.useRef(null),k=pv();dv(()=>{if(void 0!==u){let e=u.trim();r.current.value=e,A.emit()}},[u]),dv(()=>{k(6,_)},[]);let A=a.useMemo(()=>({subscribe:e=>(i.current.add(e),()=>i.current.delete(e)),snapshot:()=>r.current,setState:(e,t,n)=>{var a,o,s,i;if(!Object.is(r.current[e],t)){if(r.current[e]=t,"search"===e)N(),j(),k(1,T);else if("value"===e){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let e=document.getElementById(x);e?e.focus():null==(a=document.getElementById(y))||a.focus()}if(k(7,()=>{var e;r.current.selectedItemId=null==(e=R())?void 0:e.id,A.emit()}),n||k(5,_),void 0!==(null==(o=l.current)?void 0:o.value)){let e=null!=t?t:"";return void(null==(i=(s=l.current).onValueChange)||i.call(s,e))}}A.emit()}},emit:()=>{i.current.forEach(e=>e())}}),[]),E=a.useMemo(()=>({value:(e,t,n)=>{var a;t!==(null==(a=s.current.get(e))?void 0:a.value)&&(s.current.set(e,{value:t,keywords:n}),r.current.filtered.items.set(e,C(t,n)),k(2,()=>{j(),A.emit()}))},item:(e,t)=>(n.current.add(e),t&&(o.current.has(t)?o.current.get(t).add(e):o.current.set(t,new Set([e]))),k(3,()=>{N(),j(),r.current.value||T(),A.emit()}),()=>{s.current.delete(e),n.current.delete(e),r.current.filtered.items.delete(e);let t=R();k(4,()=>{N(),(null==t?void 0:t.getAttribute("id"))===e&&T(),A.emit()})}),group:e=>(o.current.has(e)||o.current.set(e,new Set),()=>{s.current.delete(e),o.current.delete(e)}),filter:()=>l.current.shouldFilter,label:c||e["aria-label"],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:y,inputId:x,labelId:w,listInnerRef:S}),[]);function C(e,t){var n,a;let o=null!=(a=null==(n=l.current)?void 0:n.filter)?a:Gg;return e?o(e,r.current.search,t):0}function j(){if(!r.current.search||!1===l.current.shouldFilter)return;let e=r.current.filtered.items,t=[];r.current.filtered.groups.forEach(r=>{let n=o.current.get(r),a=0;n.forEach(t=>{let r=e.get(t);a=Math.max(r,a)}),t.push([r,a])});let n=S.current;P().sort((t,r)=>{var n,a;let o=t.getAttribute("id"),s=r.getAttribute("id");return(null!=(n=e.get(s))?n:0)-(null!=(a=e.get(o))?a:0)}).forEach(e=>{let t=e.closest(zg);t?t.appendChild(e.parentElement===t?e:e.closest(`${zg} > *`)):n.appendChild(e.parentElement===n?e:e.closest(`${zg} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{var t;let r=null==(t=S.current)?void 0:t.querySelector(`${Fg}[${$g}="${encodeURIComponent(e[0])}"]`);null==r||r.parentElement.appendChild(r)})}function T(){let e=P().find(e=>"true"!==e.getAttribute("aria-disabled")),t=null==e?void 0:e.getAttribute($g);A.setState("value",t||void 0)}function N(){var e,t,a,i;if(!r.current.search||!1===l.current.shouldFilter)return void(r.current.filtered.count=n.current.size);r.current.filtered.groups=new Set;let c=0;for(let o of n.current){let n=C(null!=(t=null==(e=s.current.get(o))?void 0:e.value)?t:"",null!=(i=null==(a=s.current.get(o))?void 0:a.keywords)?i:[]);r.current.filtered.items.set(o,n),n>0&&c++}for(let[e,t]of o.current)for(let n of t)if(r.current.filtered.items.get(n)>0){r.current.filtered.groups.add(e);break}r.current.filtered.count=c}function _(){var e,t,r;let n=R();n&&((null==(e=n.parentElement)?void 0:e.firstChild)===n&&(null==(r=null==(t=n.closest(Fg))?void 0:t.querySelector('[cmdk-group-heading=""]'))||r.scrollIntoView({block:"nearest"})),n.scrollIntoView({block:"nearest"}))}function R(){var e;return null==(e=S.current)?void 0:e.querySelector(`${Bg}[aria-selected="true"]`)}function P(){var e;return Array.from((null==(e=S.current)?void 0:e.querySelectorAll(Vg))||[])}function O(e){let t=P()[e];t&&A.setState("value",t.getAttribute($g))}function D(e){var t;let r=R(),n=P(),a=n.findIndex(e=>e===r),o=n[a+e];null!=(t=l.current)&&t.loop&&(o=a+e<0?n[n.length-1]:a+e===n.length?n[0]:n[a+e]),o&&A.setState("value",o.getAttribute($g))}function I(e){let t,r=R(),n=null==r?void 0:r.closest(Fg);for(;n&&!t;)n=e>0?iv(n,Fg):lv(n,Fg),t=null==n?void 0:n.querySelector(Vg);t?A.setState("value",t.getAttribute($g)):D(e)}let M=()=>O(P().length-1),U=e=>{e.preventDefault(),e.metaKey?M():e.altKey?I(1):D(1)},L=e=>{e.preventDefault(),e.metaKey?O(0):e.altKey?I(-1):D(-1)};return a.createElement(Cs.div,{ref:t,tabIndex:-1,...b,"cmdk-root":"",onKeyDown:e=>{var t;null==(t=b.onKeyDown)||t.call(b,e);let r=e.nativeEvent.isComposing||229===e.keyCode;if(!e.defaultPrevented&&!r)switch(e.key){case"n":case"j":v&&e.ctrlKey&&U(e);break;case"ArrowDown":U(e);break;case"p":case"k":v&&e.ctrlKey&&L(e);break;case"ArrowUp":L(e);break;case"Home":e.preventDefault(),O(0);break;case"End":e.preventDefault(),M();break;case"Enter":{e.preventDefault();let t=R();if(t){let e=new Event(Wg);t.dispatchEvent(e)}}}}},a.createElement("label",{"cmdk-label":"",htmlFor:E.inputId,id:E.labelId,style:gv},c),hv(e,e=>a.createElement(Zg.Provider,{value:A},a.createElement(Kg.Provider,{value:E},e))))}),Xg=a.forwardRef((e,t)=>{var r,n;let o=pu(),s=a.useRef(null),i=a.useContext(Jg),l=Hg(),c=cv(e),d=null!=(n=null==(r=c.current)?void 0:r.forceMount)?n:null==i?void 0:i.forceMount;dv(()=>{if(!d)return l.item(o,null==i?void 0:i.id)},[d]);let u=mv(o,s,[e.value,e.children,s],e.keywords),f=qg(),m=fv(e=>e.value&&e.value===u.current),p=fv(e=>!(!d&&!1!==l.filter())||(!e.search||e.filtered.items.get(o)>0));function h(){var e,t;g(),null==(t=(e=c.current).onSelect)||t.call(e,u.current)}function g(){f.setState("value",u.current,!0)}if(a.useEffect(()=>{let t=s.current;if(t&&!e.disabled)return t.addEventListener(Wg,h),()=>t.removeEventListener(Wg,h)},[p,e.onSelect,e.disabled]),!p)return null;let{disabled:v,value:b,onSelect:y,forceMount:w,keywords:x,...S}=e;return a.createElement(Cs.div,{ref:Go(s,t),...S,id:o,"cmdk-item":"",role:"option","aria-disabled":!!v,"aria-selected":!!m,"data-disabled":!!v,"data-selected":!!m,onPointerMove:v||l.getDisablePointerSelection()?void 0:g,onClick:v?void 0:h},e.children)}),Qg=a.forwardRef((e,t)=>{let{heading:r,children:n,forceMount:o,...s}=e,i=pu(),l=a.useRef(null),c=a.useRef(null),d=pu(),u=Hg(),f=fv(e=>!(!o&&!1!==u.filter())||(!e.search||e.filtered.groups.has(i)));dv(()=>u.group(i),[]),mv(i,l,[e.value,e.heading,c]);let m=a.useMemo(()=>({id:i,forceMount:o}),[o]);return a.createElement(Cs.div,{ref:Go(l,t),...s,"cmdk-group":"",role:"presentation",hidden:!f||void 0},r&&a.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:d},r),hv(e,e=>a.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?d:void 0},a.createElement(Jg.Provider,{value:m},e))))}),ev=a.forwardRef((e,t)=>{let{alwaysRender:r,...n}=e,o=a.useRef(null),s=fv(e=>!e.search);return r||s?a.createElement(Cs.div,{ref:Go(o,t),...n,"cmdk-separator":"",role:"separator"}):null}),tv=a.forwardRef((e,t)=>{let{onValueChange:r,...n}=e,o=null!=e.value,s=qg(),i=fv(e=>e.search),l=fv(e=>e.selectedItemId),c=Hg();return a.useEffect(()=>{null!=e.value&&s.setState("search",e.value)},[e.value]),a.createElement(Cs.input,{ref:t,...n,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":l,id:c.inputId,type:"text",value:o?e.value:i,onChange:e=>{o||s.setState("search",e.target.value),null==r||r(e.target.value)}})}),rv=a.forwardRef((e,t)=>{let{children:r,label:n="Suggestions",...o}=e,s=a.useRef(null),i=a.useRef(null),l=fv(e=>e.selectedItemId),c=Hg();return a.useEffect(()=>{if(i.current&&s.current){let e,t=i.current,r=s.current,n=new ResizeObserver(()=>{e=requestAnimationFrame(()=>{let e=t.offsetHeight;r.style.setProperty("--cmdk-list-height",e.toFixed(1)+"px")})});return n.observe(t),()=>{cancelAnimationFrame(e),n.unobserve(t)}}},[]),a.createElement(Cs.div,{ref:Go(s,t),...o,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":l,"aria-label":n,id:c.listId},hv(e,e=>a.createElement("div",{ref:Go(i,c.listInnerRef),"cmdk-list-sizer":""},e)))}),nv=a.forwardRef((e,t)=>{let{open:r,onOpenChange:n,overlayClassName:o,contentClassName:s,container:i,...l}=e;return a.createElement(hm,{open:r,onOpenChange:n},a.createElement(vm,{container:i},a.createElement(bm,{"cmdk-overlay":"",className:o}),a.createElement(ym,{"aria-label":e.label,"cmdk-dialog":"",className:s},a.createElement(Yg,{ref:t,...l}))))}),av=a.forwardRef((e,t)=>fv(e=>0===e.filtered.count)?a.createElement(Cs.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),ov=a.forwardRef((e,t)=>{let{progress:r,children:n,label:o="Loading...",...s}=e;return a.createElement(Cs.div,{ref:t,...s,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},hv(e,e=>a.createElement("div",{"aria-hidden":!0},e)))}),sv=Object.assign(Yg,{List:rv,Item:Xg,Input:tv,Group:Qg,Separator:ev,Dialog:nv,Empty:av,Loading:ov});function iv(e,t){let r=e.nextElementSibling;for(;r;){if(r.matches(t))return r;r=r.nextElementSibling}}function lv(e,t){let r=e.previousElementSibling;for(;r;){if(r.matches(t))return r;r=r.previousElementSibling}}function cv(e){let t=a.useRef(e);return dv(()=>{t.current=e}),t}var dv="undefined"==typeof window?a.useEffect:a.useLayoutEffect;function uv(e){let t=a.useRef();return void 0===t.current&&(t.current=e()),t}function fv(e){let t=qg(),r=()=>e(t.snapshot());return a.useSyncExternalStore(t.subscribe,r,r)}function mv(e,t,r,n=[]){let o=a.useRef(),s=Hg();return dv(()=>{var a;let i=(()=>{var e;for(let t of r){if("string"==typeof t)return t.trim();if("object"==typeof t&&"current"in t)return t.current?null==(e=t.current.textContent)?void 0:e.trim():o.current}})(),l=n.map(e=>e.trim());s.value(e,i,l),null==(a=t.current)||a.setAttribute($g,i),o.current=i}),o}var pv=()=>{let[e,t]=a.useState(),r=uv(()=>new Map);return dv(()=>{r.current.forEach(e=>e()),r.current=new Map},[e]),(e,n)=>{r.current.set(e,n),t({})}};function hv({asChild:e,children:t},r){return e&&a.isValidElement(t)?a.cloneElement(function(e){let t=e.type;return"function"==typeof t?t(e.props):"render"in t?t.render(e.props):e}(t),{ref:t.ref},r(t.props.children)):r(t)}var gv={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const vv=a.forwardRef(({className:t,...r},n)=>e.jsx(sv,{ref:n,className:Wo("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",t),...r}));vv.displayName=sv.displayName;const bv=a.forwardRef(({className:t,...r},n)=>e.jsxs("div",{className:"flex items-center border-b px-3","data-cmdk-input-wrapper":"",children:[e.jsx(Rm,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),e.jsx(sv.Input,{ref:n,className:Wo("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",t),...r})]}));bv.displayName=sv.Input.displayName;const yv=a.forwardRef(({className:t,...r},n)=>e.jsx(sv.List,{ref:n,className:Wo("max-h-[300px] overflow-y-auto overflow-x-hidden",t),...r}));yv.displayName=sv.List.displayName;a.forwardRef((t,r)=>e.jsx(sv.Empty,{ref:r,className:"py-6 text-center text-sm",...t})).displayName=sv.Empty.displayName;const wv=a.forwardRef(({className:t,...r},n)=>e.jsx(sv.Group,{ref:n,className:Wo("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",t),...r}));wv.displayName=sv.Group.displayName;a.forwardRef(({className:t,...r},n)=>e.jsx(sv.Separator,{ref:n,className:Wo("-mx-1 h-px bg-border",t),...r})).displayName=sv.Separator.displayName;const xv=a.forwardRef(({className:t,...r},n)=>e.jsx(sv.Item,{ref:n,className:Wo("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...r}));xv.displayName=sv.Item.displayName;const Sv=["top","right","bottom","left"],kv=Math.min,Av=Math.max,Ev=Math.round,Cv=Math.floor,jv=e=>({x:e,y:e}),Tv={left:"right",right:"left",bottom:"top",top:"bottom"},Nv={start:"end",end:"start"};function _v(e,t,r){return Av(e,kv(t,r))}function Rv(e,t){return"function"==typeof e?e(t):e}function Pv(e){return e.split("-")[0]}function Ov(e){return e.split("-")[1]}function Dv(e){return"x"===e?"y":"x"}function Iv(e){return"y"===e?"height":"width"}const Mv=new Set(["top","bottom"]);function Uv(e){return Mv.has(Pv(e))?"y":"x"}function Lv(e){return Dv(Uv(e))}function Fv(e){return e.replace(/start|end/g,e=>Nv[e])}const zv=["left","right"],Bv=["right","left"],Vv=["top","bottom"],Wv=["bottom","top"];function $v(e,t,r,n){const a=Ov(e);let o=function(e,t,r){switch(e){case"top":case"bottom":return r?t?Bv:zv:t?zv:Bv;case"left":case"right":return t?Vv:Wv;default:return[]}}(Pv(e),"start"===r,n);return a&&(o=o.map(e=>e+"-"+a),t&&(o=o.concat(o.map(Fv)))),o}function Gv(e){return e.replace(/left|right|bottom|top/g,e=>Tv[e])}function Kv(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function Hv(e){const{x:t,y:r,width:n,height:a}=e;return{width:n,height:a,top:r,left:t,right:t+n,bottom:r+a,x:t,y:r}}function Zv(e,t,r){let{reference:n,floating:a}=e;const o=Uv(t),s=Lv(t),i=Iv(s),l=Pv(t),c="y"===o,d=n.x+n.width/2-a.width/2,u=n.y+n.height/2-a.height/2,f=n[i]/2-a[i]/2;let m;switch(l){case"top":m={x:d,y:n.y-a.height};break;case"bottom":m={x:d,y:n.y+n.height};break;case"right":m={x:n.x+n.width,y:u};break;case"left":m={x:n.x-a.width,y:u};break;default:m={x:n.x,y:n.y}}switch(Ov(t)){case"start":m[s]-=f*(r&&c?-1:1);break;case"end":m[s]+=f*(r&&c?-1:1)}return m}async function qv(e,t){var r;void 0===t&&(t={});const{x:n,y:a,platform:o,rects:s,elements:i,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:f=!1,padding:m=0}=Rv(t,e),p=Kv(m),h=i[f?"floating"===u?"reference":"floating":u],g=Hv(await o.getClippingRect({element:null==(r=await(null==o.isElement?void 0:o.isElement(h)))||r?h:h.contextElement||await(null==o.getDocumentElement?void 0:o.getDocumentElement(i.floating)),boundary:c,rootBoundary:d,strategy:l})),v="floating"===u?{x:n,y:a,width:s.floating.width,height:s.floating.height}:s.reference,b=await(null==o.getOffsetParent?void 0:o.getOffsetParent(i.floating)),y=await(null==o.isElement?void 0:o.isElement(b))&&await(null==o.getScale?void 0:o.getScale(b))||{x:1,y:1},w=Hv(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:i,rect:v,offsetParent:b,strategy:l}):v);return{top:(g.top-w.top+p.top)/y.y,bottom:(w.bottom-g.bottom+p.bottom)/y.y,left:(g.left-w.left+p.left)/y.x,right:(w.right-g.right+p.right)/y.x}}function Jv(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Yv(e){return Sv.some(t=>e[t]>=0)}const Xv=new Set(["left","top"]);function Qv(){return"undefined"!=typeof window}function eb(e){return nb(e)?(e.nodeName||"").toLowerCase():"#document"}function tb(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function rb(e){var t;return null==(t=(nb(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function nb(e){return!!Qv()&&(e instanceof Node||e instanceof tb(e).Node)}function ab(e){return!!Qv()&&(e instanceof Element||e instanceof tb(e).Element)}function ob(e){return!!Qv()&&(e instanceof HTMLElement||e instanceof tb(e).HTMLElement)}function sb(e){return!(!Qv()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof tb(e).ShadowRoot)}const ib=new Set(["inline","contents"]);function lb(e){const{overflow:t,overflowX:r,overflowY:n,display:a}=wb(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!ib.has(a)}const cb=new Set(["table","td","th"]);function db(e){return cb.has(eb(e))}const ub=[":popover-open",":modal"];function fb(e){return ub.some(t=>{try{return e.matches(t)}catch(e){return!1}})}const mb=["transform","translate","scale","rotate","perspective"],pb=["transform","translate","scale","rotate","perspective","filter"],hb=["paint","layout","strict","content"];function gb(e){const t=vb(),r=ab(e)?wb(e):e;return mb.some(e=>!!r[e]&&"none"!==r[e])||!!r.containerType&&"normal"!==r.containerType||!t&&!!r.backdropFilter&&"none"!==r.backdropFilter||!t&&!!r.filter&&"none"!==r.filter||pb.some(e=>(r.willChange||"").includes(e))||hb.some(e=>(r.contain||"").includes(e))}function vb(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const bb=new Set(["html","body","#document"]);function yb(e){return bb.has(eb(e))}function wb(e){return tb(e).getComputedStyle(e)}function xb(e){return ab(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Sb(e){if("html"===eb(e))return e;const t=e.assignedSlot||e.parentNode||sb(e)&&e.host||rb(e);return sb(t)?t.host:t}function kb(e){const t=Sb(e);return yb(t)?e.ownerDocument?e.ownerDocument.body:e.body:ob(t)&&lb(t)?t:kb(t)}function Ab(e,t,r){var n;void 0===t&&(t=[]),void 0===r&&(r=!0);const a=kb(e),o=a===(null==(n=e.ownerDocument)?void 0:n.body),s=tb(a);if(o){const e=Eb(s);return t.concat(s,s.visualViewport||[],lb(a)?a:[],e&&r?Ab(e):[])}return t.concat(a,Ab(a,[],r))}function Eb(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Cb(e){const t=wb(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const a=ob(e),o=a?e.offsetWidth:r,s=a?e.offsetHeight:n,i=Ev(r)!==o||Ev(n)!==s;return i&&(r=o,n=s),{width:r,height:n,$:i}}function jb(e){return ab(e)?e:e.contextElement}function Tb(e){const t=jb(e);if(!ob(t))return jv(1);const r=t.getBoundingClientRect(),{width:n,height:a,$:o}=Cb(t);let s=(o?Ev(r.width):r.width)/n,i=(o?Ev(r.height):r.height)/a;return s&&Number.isFinite(s)||(s=1),i&&Number.isFinite(i)||(i=1),{x:s,y:i}}const Nb=jv(0);function _b(e){const t=tb(e);return vb()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Nb}function Rb(e,t,r,n){void 0===t&&(t=!1),void 0===r&&(r=!1);const a=e.getBoundingClientRect(),o=jb(e);let s=jv(1);t&&(n?ab(n)&&(s=Tb(n)):s=Tb(e));const i=function(e,t,r){return void 0===t&&(t=!1),!(!r||t&&r!==tb(e))&&t}(o,r,n)?_b(o):jv(0);let l=(a.left+i.x)/s.x,c=(a.top+i.y)/s.y,d=a.width/s.x,u=a.height/s.y;if(o){const e=tb(o),t=n&&ab(n)?tb(n):n;let r=e,a=Eb(r);for(;a&&n&&t!==r;){const e=Tb(a),t=a.getBoundingClientRect(),n=wb(a),o=t.left+(a.clientLeft+parseFloat(n.paddingLeft))*e.x,s=t.top+(a.clientTop+parseFloat(n.paddingTop))*e.y;l*=e.x,c*=e.y,d*=e.x,u*=e.y,l+=o,c+=s,r=tb(a),a=Eb(r)}}return Hv({width:d,height:u,x:l,y:c})}function Pb(e,t){const r=xb(e).scrollLeft;return t?t.left+r:Rb(rb(e)).left+r}function Ob(e,t){const r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-Pb(e,r),y:r.top+t.scrollTop}}const Db=new Set(["absolute","fixed"]);function Ib(e,t,r){let n;if("viewport"===t)n=function(e,t){const r=tb(e),n=rb(e),a=r.visualViewport;let o=n.clientWidth,s=n.clientHeight,i=0,l=0;if(a){o=a.width,s=a.height;const e=vb();(!e||e&&"fixed"===t)&&(i=a.offsetLeft,l=a.offsetTop)}const c=Pb(n);if(c<=0){const e=n.ownerDocument,t=e.body,r=getComputedStyle(t),a="CSS1Compat"===e.compatMode&&parseFloat(r.marginLeft)+parseFloat(r.marginRight)||0,s=Math.abs(n.clientWidth-t.clientWidth-a);s<=25&&(o-=s)}else c<=25&&(o+=c);return{width:o,height:s,x:i,y:l}}(e,r);else if("document"===t)n=function(e){const t=rb(e),r=xb(e),n=e.ownerDocument.body,a=Av(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),o=Av(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let s=-r.scrollLeft+Pb(e);const i=-r.scrollTop;return"rtl"===wb(n).direction&&(s+=Av(t.clientWidth,n.clientWidth)-a),{width:a,height:o,x:s,y:i}}(rb(e));else if(ab(t))n=function(e,t){const r=Rb(e,!0,"fixed"===t),n=r.top+e.clientTop,a=r.left+e.clientLeft,o=ob(e)?Tb(e):jv(1);return{width:e.clientWidth*o.x,height:e.clientHeight*o.y,x:a*o.x,y:n*o.y}}(t,r);else{const r=_b(e);n={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return Hv(n)}function Mb(e,t){const r=Sb(e);return!(r===t||!ab(r)||yb(r))&&("fixed"===wb(r).position||Mb(r,t))}function Ub(e,t,r){const n=ob(t),a=rb(t),o="fixed"===r,s=Rb(e,!0,o,t);let i={scrollLeft:0,scrollTop:0};const l=jv(0);function c(){l.x=Pb(a)}if(n||!n&&!o)if(("body"!==eb(t)||lb(a))&&(i=xb(t)),n){const e=Rb(t,!0,o,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else a&&c();o&&!n&&a&&c();const d=!a||n||o?jv(0):Ob(a,i);return{x:s.left+i.scrollLeft-l.x-d.x,y:s.top+i.scrollTop-l.y-d.y,width:s.width,height:s.height}}function Lb(e){return"static"===wb(e).position}function Fb(e,t){if(!ob(e)||"fixed"===wb(e).position)return null;if(t)return t(e);let r=e.offsetParent;return rb(e)===r&&(r=r.ownerDocument.body),r}function zb(e,t){const r=tb(e);if(fb(e))return r;if(!ob(e)){let t=Sb(e);for(;t&&!yb(t);){if(ab(t)&&!Lb(t))return t;t=Sb(t)}return r}let n=Fb(e,t);for(;n&&db(n)&&Lb(n);)n=Fb(n,t);return n&&yb(n)&&Lb(n)&&!gb(n)?r:n||function(e){let t=Sb(e);for(;ob(t)&&!yb(t);){if(gb(t))return t;if(fb(t))return null;t=Sb(t)}return null}(e)||r}const Bb={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:r,offsetParent:n,strategy:a}=e;const o="fixed"===a,s=rb(n),i=!!t&&fb(t.floating);if(n===s||i&&o)return r;let l={scrollLeft:0,scrollTop:0},c=jv(1);const d=jv(0),u=ob(n);if((u||!u&&!o)&&(("body"!==eb(n)||lb(s))&&(l=xb(n)),ob(n))){const e=Rb(n);c=Tb(n),d.x=e.x+n.clientLeft,d.y=e.y+n.clientTop}const f=!s||u||o?jv(0):Ob(s,l);return{width:r.width*c.x,height:r.height*c.y,x:r.x*c.x-l.scrollLeft*c.x+d.x+f.x,y:r.y*c.y-l.scrollTop*c.y+d.y+f.y}},getDocumentElement:rb,getClippingRect:function(e){let{element:t,boundary:r,rootBoundary:n,strategy:a}=e;const o="clippingAncestors"===r?fb(t)?[]:function(e,t){const r=t.get(e);if(r)return r;let n=Ab(e,[],!1).filter(e=>ab(e)&&"body"!==eb(e)),a=null;const o="fixed"===wb(e).position;let s=o?Sb(e):e;for(;ab(s)&&!yb(s);){const t=wb(s),r=gb(s);r||"fixed"!==t.position||(a=null),(o?!r&&!a:!r&&"static"===t.position&&a&&Db.has(a.position)||lb(s)&&!r&&Mb(e,s))?n=n.filter(e=>e!==s):a=t,s=Sb(s)}return t.set(e,n),n}(t,this._c):[].concat(r),s=[...o,n],i=s[0],l=s.reduce((e,r)=>{const n=Ib(t,r,a);return e.top=Av(n.top,e.top),e.right=kv(n.right,e.right),e.bottom=kv(n.bottom,e.bottom),e.left=Av(n.left,e.left),e},Ib(t,i,a));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:zb,getElementRects:async function(e){const t=this.getOffsetParent||zb,r=this.getDimensions,n=await r(e.floating);return{reference:Ub(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:r}=Cb(e);return{width:t,height:r}},getScale:Tb,isElement:ab,isRTL:function(e){return"rtl"===wb(e).direction}};function Vb(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Wb(e,t,r,n){void 0===n&&(n={});const{ancestorScroll:a=!0,ancestorResize:o=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:i="function"==typeof IntersectionObserver,animationFrame:l=!1}=n,c=jb(e),d=a||o?[...c?Ab(c):[],...Ab(t)]:[];d.forEach(e=>{a&&e.addEventListener("scroll",r,{passive:!0}),o&&e.addEventListener("resize",r)});const u=c&&i?function(e,t){let r,n=null;const a=rb(e);function o(){var e;clearTimeout(r),null==(e=n)||e.disconnect(),n=null}return function s(i,l){void 0===i&&(i=!1),void 0===l&&(l=1),o();const c=e.getBoundingClientRect(),{left:d,top:u,width:f,height:m}=c;if(i||t(),!f||!m)return;const p={rootMargin:-Cv(u)+"px "+-Cv(a.clientWidth-(d+f))+"px "+-Cv(a.clientHeight-(u+m))+"px "+-Cv(d)+"px",threshold:Av(0,kv(1,l))||1};let h=!0;function g(t){const n=t[0].intersectionRatio;if(n!==l){if(!h)return s();n?s(!1,n):r=setTimeout(()=>{s(!1,1e-7)},1e3)}1!==n||Vb(c,e.getBoundingClientRect())||s(),h=!1}try{n=new IntersectionObserver(g,{...p,root:a.ownerDocument})}catch(e){n=new IntersectionObserver(g,p)}n.observe(e)}(!0),o}(c,r):null;let f,m=-1,p=null;s&&(p=new ResizeObserver(e=>{let[n]=e;n&&n.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var e;null==(e=p)||e.observe(t)})),r()}),c&&!l&&p.observe(c),p.observe(t));let h=l?Rb(e):null;return l&&function t(){const n=Rb(e);h&&!Vb(h,n)&&r();h=n,f=requestAnimationFrame(t)}(),r(),()=>{var e;d.forEach(e=>{a&&e.removeEventListener("scroll",r),o&&e.removeEventListener("resize",r)}),null==u||u(),null==(e=p)||e.disconnect(),p=null,l&&cancelAnimationFrame(f)}}const $b=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:a,y:o,placement:s,middlewareData:i}=t,l=await async function(e,t){const{placement:r,platform:n,elements:a}=e,o=await(null==n.isRTL?void 0:n.isRTL(a.floating)),s=Pv(r),i=Ov(r),l="y"===Uv(r),c=Xv.has(s)?-1:1,d=o&&l?-1:1,u=Rv(t,e);let{mainAxis:f,crossAxis:m,alignmentAxis:p}="number"==typeof u?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return i&&"number"==typeof p&&(m="end"===i?-1*p:p),l?{x:m*d,y:f*c}:{x:f*c,y:m*d}}(t,e);return s===(null==(r=i.offset)?void 0:r.placement)&&null!=(n=i.arrow)&&n.alignmentOffset?{}:{x:a+l.x,y:o+l.y,data:{...l,placement:s}}}}},Gb=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:i={fn:e=>{let{x:t,y:r}=e;return{x:t,y:r}}},...l}=Rv(e,t),c={x:r,y:n},d=await qv(t,l),u=Uv(Pv(a)),f=Dv(u);let m=c[f],p=c[u];if(o){const e="y"===f?"bottom":"right";m=_v(m+d["y"===f?"top":"left"],m,m-d[e])}if(s){const e="y"===u?"bottom":"right";p=_v(p+d["y"===u?"top":"left"],p,p-d[e])}const h=i.fn({...t,[f]:m,[u]:p});return{...h,data:{x:h.x-r,y:h.y-n,enabled:{[f]:o,[u]:s}}}}}},Kb=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:a,middlewareData:o,rects:s,initialPlacement:i,platform:l,elements:c}=t,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:f,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:h=!0,...g}=Rv(e,t);if(null!=(r=o.arrow)&&r.alignmentOffset)return{};const v=Pv(a),b=Uv(i),y=Pv(i)===i,w=await(null==l.isRTL?void 0:l.isRTL(c.floating)),x=f||(y||!h?[Gv(i)]:function(e){const t=Gv(e);return[Fv(e),t,Fv(t)]}(i)),S="none"!==p;!f&&S&&x.push(...$v(i,h,p,w));const k=[i,...x],A=await qv(t,g),E=[];let C=(null==(n=o.flip)?void 0:n.overflows)||[];if(d&&E.push(A[v]),u){const e=function(e,t,r){void 0===r&&(r=!1);const n=Ov(e),a=Lv(e),o=Iv(a);let s="x"===a?n===(r?"end":"start")?"right":"left":"start"===n?"bottom":"top";return t.reference[o]>t.floating[o]&&(s=Gv(s)),[s,Gv(s)]}(a,s,w);E.push(A[e[0]],A[e[1]])}if(C=[...C,{placement:a,overflows:E}],!E.every(e=>e<=0)){var j,T;const e=((null==(j=o.flip)?void 0:j.index)||0)+1,t=k[e];if(t){if(!("alignment"===u&&b!==Uv(t))||C.every(e=>Uv(e.placement)!==b||e.overflows[0]>0))return{data:{index:e,overflows:C},reset:{placement:t}}}let r=null==(T=C.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:T.placement;if(!r)switch(m){case"bestFit":{var N;const e=null==(N=C.filter(e=>{if(S){const t=Uv(e.placement);return t===b||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:N[0];e&&(r=e);break}case"initialPlacement":r=i}if(a!==r)return{reset:{placement:r}}}return{}}}},Hb=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:a,rects:o,platform:s,elements:i}=t,{apply:l=()=>{},...c}=Rv(e,t),d=await qv(t,c),u=Pv(a),f=Ov(a),m="y"===Uv(a),{width:p,height:h}=o.floating;let g,v;"top"===u||"bottom"===u?(g=u,v=f===(await(null==s.isRTL?void 0:s.isRTL(i.floating))?"start":"end")?"left":"right"):(v=u,g="end"===f?"top":"bottom");const b=h-d.top-d.bottom,y=p-d.left-d.right,w=kv(h-d[g],b),x=kv(p-d[v],y),S=!t.middlewareData.shift;let k=w,A=x;if(null!=(r=t.middlewareData.shift)&&r.enabled.x&&(A=y),null!=(n=t.middlewareData.shift)&&n.enabled.y&&(k=b),S&&!f){const e=Av(d.left,0),t=Av(d.right,0),r=Av(d.top,0),n=Av(d.bottom,0);m?A=p-2*(0!==e||0!==t?e+t:Av(d.left,d.right)):k=h-2*(0!==r||0!==n?r+n:Av(d.top,d.bottom))}await l({...t,availableWidth:A,availableHeight:k});const E=await s.getDimensions(i.floating);return p!==E.width||h!==E.height?{reset:{rects:!0}}:{}}}},Zb=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...a}=Rv(e,t);switch(n){case"referenceHidden":{const e=Jv(await qv(t,{...a,elementContext:"reference"}),r.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Yv(e)}}}case"escaped":{const e=Jv(await qv(t,{...a,altBoundary:!0}),r.floating);return{data:{escapedOffsets:e,escaped:Yv(e)}}}default:return{}}}}},qb=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:a,rects:o,platform:s,elements:i,middlewareData:l}=t,{element:c,padding:d=0}=Rv(e,t)||{};if(null==c)return{};const u=Kv(d),f={x:r,y:n},m=Lv(a),p=Iv(m),h=await s.getDimensions(c),g="y"===m,v=g?"top":"left",b=g?"bottom":"right",y=g?"clientHeight":"clientWidth",w=o.reference[p]+o.reference[m]-f[m]-o.floating[p],x=f[m]-o.reference[m],S=await(null==s.getOffsetParent?void 0:s.getOffsetParent(c));let k=S?S[y]:0;k&&await(null==s.isElement?void 0:s.isElement(S))||(k=i.floating[y]||o.floating[p]);const A=w/2-x/2,E=k/2-h[p]/2-1,C=kv(u[v],E),j=kv(u[b],E),T=C,N=k-h[p]-j,_=k/2-h[p]/2+A,R=_v(T,_,N),P=!l.arrow&&null!=Ov(a)&&_!==R&&o.reference[p]/2-(_<T?C:j)-h[p]/2<0,O=P?_<T?_-T:_-N:0;return{[m]:f[m]+O,data:{[m]:R,centerOffset:_-R-O,...P&&{alignmentOffset:O}},reset:P}}}),Jb=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:a,rects:o,middlewareData:s}=t,{offset:i=0,mainAxis:l=!0,crossAxis:c=!0}=Rv(e,t),d={x:r,y:n},u=Uv(a),f=Dv(u);let m=d[f],p=d[u];const h=Rv(i,t),g="number"==typeof h?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(l){const e="y"===f?"height":"width",t=o.reference[f]-o.floating[e]+g.mainAxis,r=o.reference[f]+o.reference[e]-g.mainAxis;m<t?m=t:m>r&&(m=r)}if(c){var v,b;const e="y"===f?"width":"height",t=Xv.has(Pv(a)),r=o.reference[u]-o.floating[e]+(t&&(null==(v=s.offset)?void 0:v[u])||0)+(t?0:g.crossAxis),n=o.reference[u]+o.reference[e]+(t?0:(null==(b=s.offset)?void 0:b[u])||0)-(t?g.crossAxis:0);p<r?p=r:p>n&&(p=n)}return{[f]:m,[u]:p}}}},Yb=(e,t,r)=>{const n=new Map,a={platform:Bb,...r},o={...a.platform,_c:n};return(async(e,t,r)=>{const{placement:n="bottom",strategy:a="absolute",middleware:o=[],platform:s}=r,i=o.filter(Boolean),l=await(null==s.isRTL?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:a}),{x:d,y:u}=Zv(c,n,l),f=n,m={},p=0;for(let r=0;r<i.length;r++){const{name:o,fn:h}=i[r],{x:g,y:v,data:b,reset:y}=await h({x:d,y:u,initialPlacement:n,placement:f,strategy:a,middlewareData:m,rects:c,platform:s,elements:{reference:e,floating:t}});d=null!=g?g:d,u=null!=v?v:u,m={...m,[o]:{...m[o],...b}},y&&p<=50&&(p++,"object"==typeof y&&(y.placement&&(f=y.placement),y.rects&&(c=!0===y.rects?await s.getElementRects({reference:e,floating:t,strategy:a}):y.rects),({x:d,y:u}=Zv(c,f,l))),r=-1)}return{x:d,y:u,placement:f,strategy:a,middlewareData:m}})(e,t,{...a,platform:o})};var Xb="undefined"!=typeof document?t.useLayoutEffect:function(){};function Qb(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let r,n,a;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;0!==n--;)if(!Qb(e[n],t[n]))return!1;return!0}if(a=Object.keys(e),r=a.length,r!==Object.keys(t).length)return!1;for(n=r;0!==n--;)if(!{}.hasOwnProperty.call(t,a[n]))return!1;for(n=r;0!==n--;){const r=a[n];if(("_owner"!==r||!e.$$typeof)&&!Qb(e[r],t[r]))return!1}return!0}return e!=e&&t!=t}function ey(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ty(e,t){const r=ey(e);return Math.round(t*r)/r}function ry(e){const t=a.useRef(e);return Xb(()=>{t.current=e}),t}const ny=e=>({name:"arrow",options:e,fn(t){const{element:r,padding:n}="function"==typeof e?e(t):e;return r&&(a=r,{}.hasOwnProperty.call(a,"current"))?null!=r.current?qb({element:r.current,padding:n}).fn(t):{}:r?qb({element:r,padding:n}).fn(t):{};var a}}),ay=(e,t)=>({...$b(e),options:[e,t]}),oy=(e,t)=>({...Gb(e),options:[e,t]}),sy=(e,t)=>({...Jb(e),options:[e,t]}),iy=(e,t)=>({...Kb(e),options:[e,t]}),ly=(e,t)=>({...Hb(e),options:[e,t]}),cy=(e,t)=>({...Zb(e),options:[e,t]}),dy=(e,t)=>({...ny(e),options:[e,t]});var uy=a.forwardRef((t,r)=>{const{children:n,width:a=10,height:o=5,...s}=t;return e.jsx(Cs.svg,{...s,ref:r,width:a,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:e.jsx("polygon",{points:"0,0 30,0 15,10"})})});uy.displayName="Arrow";var fy=uy,my="Popper",[py,hy]=Od(my),[gy,vy]=py(my),by=t=>{const{__scopePopper:r,children:n}=t,[o,s]=a.useState(null);return e.jsx(gy,{scope:r,anchor:o,onAnchorChange:s,children:n})};by.displayName=my;var yy="PopperAnchor",wy=a.forwardRef((t,r)=>{const{__scopePopper:n,virtualRef:o,...s}=t,i=vy(yy,n),l=a.useRef(null),c=Ko(r,l),d=a.useRef(null);return a.useEffect(()=>{const e=d.current;d.current=o?.current||l.current,e!==d.current&&i.onAnchorChange(d.current)}),o?null:e.jsx(Cs.div,{...s,ref:c})});wy.displayName=yy;var xy="PopperContent",[Sy,ky]=py(xy),Ay=a.forwardRef((t,r)=>{const{__scopePopper:n,side:s="bottom",sideOffset:i=0,align:l="center",alignOffset:c=0,arrowPadding:d=0,avoidCollisions:u=!0,collisionBoundary:f=[],collisionPadding:m=0,sticky:p="partial",hideWhenDetached:h=!1,updatePositionStrategy:g="optimized",onPlaced:v,...b}=t,y=vy(xy,n),[w,x]=a.useState(null),S=Ko(r,e=>x(e)),[k,A]=a.useState(null),E=ip(k),C=E?.width??0,j=E?.height??0,T=s+("center"!==l?"-"+l:""),N="number"==typeof m?m:{top:0,right:0,bottom:0,left:0,...m},_=Array.isArray(f)?f:[f],R=_.length>0,P={padding:N,boundary:_.filter(Ty),altBoundary:R},{refs:O,floatingStyles:D,placement:I,isPositioned:M,middlewareData:U}=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:s,elements:{reference:i,floating:l}={},transform:c=!0,whileElementsMounted:d,open:u}=e,[f,m]=a.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=a.useState(n);Qb(p,n)||h(n);const[g,v]=a.useState(null),[b,y]=a.useState(null),w=a.useCallback(e=>{e!==A.current&&(A.current=e,v(e))},[]),x=a.useCallback(e=>{e!==E.current&&(E.current=e,y(e))},[]),S=i||g,k=l||b,A=a.useRef(null),E=a.useRef(null),C=a.useRef(f),j=null!=d,T=ry(d),N=ry(s),_=ry(u),R=a.useCallback(()=>{if(!A.current||!E.current)return;const e={placement:t,strategy:r,middleware:p};N.current&&(e.platform=N.current),Yb(A.current,E.current,e).then(e=>{const t={...e,isPositioned:!1!==_.current};P.current&&!Qb(C.current,t)&&(C.current=t,o.flushSync(()=>{m(t)}))})},[p,t,r,N,_]);Xb(()=>{!1===u&&C.current.isPositioned&&(C.current.isPositioned=!1,m(e=>({...e,isPositioned:!1})))},[u]);const P=a.useRef(!1);Xb(()=>(P.current=!0,()=>{P.current=!1}),[]),Xb(()=>{if(S&&(A.current=S),k&&(E.current=k),S&&k){if(T.current)return T.current(S,k,R);R()}},[S,k,R,T,j]);const O=a.useMemo(()=>({reference:A,floating:E,setReference:w,setFloating:x}),[w,x]),D=a.useMemo(()=>({reference:S,floating:k}),[S,k]),I=a.useMemo(()=>{const e={position:r,left:0,top:0};if(!D.floating)return e;const t=ty(D.floating,f.x),n=ty(D.floating,f.y);return c?{...e,transform:"translate("+t+"px, "+n+"px)",...ey(D.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}},[r,c,D.floating,f.x,f.y]);return a.useMemo(()=>({...f,update:R,refs:O,elements:D,floatingStyles:I}),[f,R,O,D,I])}({strategy:"fixed",placement:T,whileElementsMounted:(...e)=>Wb(...e,{animationFrame:"always"===g}),elements:{reference:y.anchor},middleware:[ay({mainAxis:i+j,alignmentAxis:c}),u&&oy({mainAxis:!0,crossAxis:!1,limiter:"partial"===p?sy():void 0,...P}),u&&iy({...P}),ly({...P,apply:({elements:e,rects:t,availableWidth:r,availableHeight:n})=>{const{width:a,height:o}=t.reference,s=e.floating.style;s.setProperty("--radix-popper-available-width",`${r}px`),s.setProperty("--radix-popper-available-height",`${n}px`),s.setProperty("--radix-popper-anchor-width",`${a}px`),s.setProperty("--radix-popper-anchor-height",`${o}px`)}}),k&&dy({element:k,padding:d}),Ny({arrowWidth:C,arrowHeight:j}),h&&cy({strategy:"referenceHidden",...P})]}),[L,F]=_y(I),z=Id(v);Ud(()=>{M&&z?.()},[M,z]);const B=U.arrow?.x,V=U.arrow?.y,W=0!==U.arrow?.centerOffset,[$,G]=a.useState();return Ud(()=>{w&&G(window.getComputedStyle(w).zIndex)},[w]),e.jsx("div",{ref:O.setFloating,"data-radix-popper-content-wrapper":"",style:{...D,transform:M?D.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:$,"--radix-popper-transform-origin":[U.transformOrigin?.x,U.transformOrigin?.y].join(" "),...U.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:e.jsx(Sy,{scope:n,placedSide:L,onArrowChange:A,arrowX:B,arrowY:V,shouldHideArrow:W,children:e.jsx(Cs.div,{"data-side":L,"data-align":F,...b,ref:S,style:{...b.style,animation:M?void 0:"none"}})})})});Ay.displayName=xy;var Ey="PopperArrow",Cy={top:"bottom",right:"left",bottom:"top",left:"right"},jy=a.forwardRef(function(t,r){const{__scopePopper:n,...a}=t,o=ky(Ey,n),s=Cy[o.placedSide];return e.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:e.jsx(fy,{...a,ref:r,style:{...a.style,display:"block"}})})});function Ty(e){return null!==e}jy.displayName=Ey;var Ny=e=>({name:"transformOrigin",options:e,fn(t){const{placement:r,rects:n,middlewareData:a}=t,o=0!==a.arrow?.centerOffset,s=o?0:e.arrowWidth,i=o?0:e.arrowHeight,[l,c]=_y(r),d={start:"0%",center:"50%",end:"100%"}[c],u=(a.arrow?.x??0)+s/2,f=(a.arrow?.y??0)+i/2;let m="",p="";return"bottom"===l?(m=o?d:`${u}px`,p=-i+"px"):"top"===l?(m=o?d:`${u}px`,p=`${n.floating.height+i}px`):"right"===l?(m=-i+"px",p=o?d:`${f}px`):"left"===l&&(m=`${n.floating.width+i}px`,p=o?d:`${f}px`),{data:{x:m,y:p}}}});function _y(e){const[t,r="center"]=e.split("-");return[t,r]}var Ry=by,Py=wy,Oy=Ay,Dy=jy,Iy="Popover",[My,Uy]=Od(Iy,[hy]),Ly=hy(),[Fy,zy]=My(Iy),By=t=>{const{__scopePopover:r,children:n,open:o,defaultOpen:s,onOpenChange:i,modal:l=!1}=t,c=Ly(r),d=a.useRef(null),[u,f]=a.useState(!1),[m,p]=gu({prop:o,defaultProp:s??!1,onChange:i,caller:Iy});return e.jsx(Ry,{...c,children:e.jsx(Fy,{scope:r,contentId:pu(),triggerRef:d,open:m,onOpenChange:p,onOpenToggle:a.useCallback(()=>p(e=>!e),[p]),hasCustomAnchor:u,onCustomAnchorAdd:a.useCallback(()=>f(!0),[]),onCustomAnchorRemove:a.useCallback(()=>f(!1),[]),modal:l,children:n})})};By.displayName=Iy;var Vy="PopoverAnchor";a.forwardRef((t,r)=>{const{__scopePopover:n,...o}=t,s=zy(Vy,n),i=Ly(n),{onCustomAnchorAdd:l,onCustomAnchorRemove:c}=s;return a.useEffect(()=>(l(),()=>c()),[l,c]),e.jsx(Py,{...i,...o,ref:r})}).displayName=Vy;var Wy="PopoverTrigger",$y=a.forwardRef((t,r)=>{const{__scopePopover:n,...a}=t,o=zy(Wy,n),s=Ly(n),i=Ko(r,o.triggerRef),l=e.jsx(Cs.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":rw(o.open),...a,ref:i,onClick:uu(t.onClick,o.onOpenToggle)});return o.hasCustomAnchor?l:e.jsx(Py,{asChild:!0,...s,children:l})});$y.displayName=Wy;var Gy="PopoverPortal",[Ky,Hy]=My(Gy,{forceMount:void 0}),Zy=t=>{const{__scopePopover:r,forceMount:n,children:a,container:o}=t,s=zy(Gy,r);return e.jsx(Ky,{scope:r,forceMount:n,children:e.jsx(Mu,{present:n||s.open,children:e.jsx(Iu,{asChild:!0,container:o,children:a})})})};Zy.displayName=Gy;var qy="PopoverContent",Jy=a.forwardRef((t,r)=>{const n=Hy(qy,t.__scopePopover),{forceMount:a=n.forceMount,...o}=t,s=zy(qy,t.__scopePopover);return e.jsx(Mu,{present:a||s.open,children:s.modal?e.jsx(Xy,{...o,ref:r}):e.jsx(Qy,{...o,ref:r})})});Jy.displayName=qy;var Yy=Ho("PopoverContent.RemoveScroll"),Xy=a.forwardRef((t,r)=>{const n=zy(qy,t.__scopePopover),o=a.useRef(null),s=Ko(r,o),i=a.useRef(!1);return a.useEffect(()=>{const e=o.current;if(e)return If(e)},[]),e.jsx(Tf,{as:Yy,allowPinchZoom:!0,children:e.jsx(ew,{...t,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:uu(t.onCloseAutoFocus,e=>{e.preventDefault(),i.current||n.triggerRef.current?.focus()}),onPointerDownOutside:uu(t.onPointerDownOutside,e=>{const t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey,n=2===t.button||r;i.current=n},{checkForDefaultPrevented:!1}),onFocusOutside:uu(t.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),Qy=a.forwardRef((t,r)=>{const n=zy(qy,t.__scopePopover),o=a.useRef(!1),s=a.useRef(!1);return e.jsx(ew,{...t,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:e=>{t.onCloseAutoFocus?.(e),e.defaultPrevented||(o.current||n.triggerRef.current?.focus(),e.preventDefault()),o.current=!1,s.current=!1},onInteractOutside:e=>{t.onInteractOutside?.(e),e.defaultPrevented||(o.current=!0,"pointerdown"===e.detail.originalEvent.type&&(s.current=!0));const r=e.target,a=n.triggerRef.current?.contains(r);a&&e.preventDefault(),"focusin"===e.detail.originalEvent.type&&s.current&&e.preventDefault()}})}),ew=a.forwardRef((t,r)=>{const{__scopePopover:n,trapFocus:a,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:i,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:u,...f}=t,m=zy(qy,n),p=Ly(n);return Fu(),e.jsx(Tu,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:o,onUnmountAutoFocus:s,children:e.jsx(Su,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:u,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onDismiss:()=>m.onOpenChange(!1),children:e.jsx(Oy,{"data-state":rw(m.open),role:"dialog",id:m.contentId,...p,...f,ref:r,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),tw="PopoverClose";a.forwardRef((t,r)=>{const{__scopePopover:n,...a}=t,o=zy(tw,n);return e.jsx(Cs.button,{type:"button",...a,ref:r,onClick:uu(t.onClick,()=>o.onOpenChange(!1))})}).displayName=tw;function rw(e){return e?"open":"closed"}a.forwardRef((t,r)=>{const{__scopePopover:n,...a}=t,o=Ly(n);return e.jsx(Dy,{...o,...a,ref:r})}).displayName="PopoverArrow";var nw=Zy,aw=Jy;const ow=By,sw=$y,iw=a.forwardRef(({className:t,align:r="center",sideOffset:n=4,...o},s)=>{const{container:i}=a.useContext(ae);return e.jsx(nw,{container:i,children:e.jsx(aw,{ref:s,align:r,sideOffset:n,className:Wo("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...o})})});iw.displayName=aw.displayName;const lw={USD:"$",EUR:"€",JPY:"¥",GBP:"£",AUD:"A$",CAD:"C$",CHF:"CHF",CNY:"¥",SEK:"kr",NZD:"NZ$",INR:"₹",RUB:"₽",KRW:"₩",BRL:"R$",ZAR:"R",HKD:"HK$",SGD:"S$",MXN:"Mex$",NOK:"kr",TRY:"₺",IDR:"Rp",PLN:"zł",THB:"฿",ILS:"₪",PHP:"₱",MYR:"RM",CZK:"Kč",HUF:"Ft",DKK:"kr",PKR:"₨",EGP:"£",NGN:"₦",BDT:"৳",UAH:"₴",KZT:"₸",VND:"₫",ARS:"$",BGN:"лв",COP:"COL$",HRK:"kn",ISK:"kr",KES:"KSh",LKR:"Rs",MAD:"د.م.",MNT:"₮",NPR:"रू",RSD:"дин.",SAR:"ر.س",TWD:"NT$",UYU:"$U",YER:"﷼",FJD:"FJ$",JMD:"J$",HTG:"G",BHD:"ب.د",KWD:"د.ك",OMR:"ر.ع.",BND:"B$",KPW:"₩",GHS:"₵",SYP:"ل.س",SLL:"Le",SSP:"£",AFN:"؋",MGA:"Ar",MDL:"lei",FOK:"kr",GMD:"D",LTL:"Lt",LVL:"Ls",HNL:"L",GEL:"₾",BMD:"$",AWG:"Afl",BTN:"Nu",GTQ:"Q",TZS:"TSh",BBD:"Bds$",NAD:"N$",BZD:"$",JEP:"£",WST:"T",PGK:"K",KGS:"лв",AZN:"₼",QAR:"ر.ق",XOF:"CFA",XPF:"CFP"},cw={AF:"AFN",AX:"EUR",AL:"ALL",DZ:"DZD",AS:"USD",AD:"EUR",AO:"AOA",AI:"XCD",AQ:"USD",AG:"XCD",AR:"ARS",AM:"AMD",AW:"AWG",AU:"AUD",AT:"EUR",AZ:"AZN",BS:"BSD",BH:"BHD",BD:"BDT",BB:"BBD",BY:"BYN",BE:"EUR",BZ:"BZD",BJ:"XOF",BM:"BMD",BT:"BTN",BO:"BOB",BA:"BAM",BW:"BWP",BV:"NOK",BR:"BRL",IO:"USD",BN:"BND",BG:"BGN",BF:"XOF",BI:"BIF",KH:"KHR",CM:"XAF",CA:"CAD",CV:"CVE",KY:"KYD",CF:"XAF",TD:"XAF",CL:"CLP",CN:"CNY",CX:"AUD",CC:"AUD",CO:"COP",KM:"KMF",CG:"XAF",CD:"CDF",CK:"NZD",CR:"CRC",CI:"XOF",HR:"HRK",CU:"CUP",CY:"EUR",CZ:"CZK",DK:"DKK",DJ:"DJF",DM:"XCD",DO:"DOP",EC:"USD",EG:"EGP",SV:"USD",GQ:"XAF",ER:"ERN",EE:"EUR",ET:"ETB",FK:"FKP",FO:"DKK",FJ:"FJD",FI:"EUR",FR:"EUR",GF:"EUR",PF:"XPF",TF:"EUR",GA:"XAF",GM:"GMD",GE:"GEL",DE:"EUR",GH:"GHS",GI:"GIP",GR:"EUR",GL:"DKK",GD:"XCD",GP:"EUR",GU:"USD",GT:"GTQ",GG:"GBP",GN:"GNF",GW:"XOF",GY:"GYD",HT:"HTG",HM:"AUD",VA:"EUR",HN:"HNL",HK:"HKD",HU:"HUF",IS:"ISK",IN:"INR",ID:"IDR",IR:"IRR",IQ:"IQD",IE:"EUR",IM:"GBP",IL:"ILS",IT:"EUR",JM:"JMD",JP:"JPY",JE:"GBP",JO:"JOD",KZ:"KZT",KE:"KES",KI:"AUD",KP:"KPW",KR:"KRW",KW:"KWD",KG:"KGS",LA:"LAK",LV:"EUR",LB:"LBP",LS:"LSL",LR:"LRD",LY:"LYD",LI:"CHF",LT:"EUR",LU:"EUR",MO:"MOP",MK:"MKD",MG:"MGA",MW:"MWK",MY:"MYR",MV:"MVR",ML:"XOF",MT:"EUR",MH:"USD",MQ:"EUR",MR:"MRU",MU:"MUR",YT:"EUR",MX:"MXN",FM:"USD",MD:"MDL",MC:"EUR",MN:"MNT",ME:"EUR",MS:"XCD",MA:"MAD",MZ:"MZN",MM:"MMK",NA:"NAD",NR:"AUD",NP:"NPR",NL:"EUR",AN:"ANG",NC:"XPF",NZ:"NZD",NI:"NIO",NE:"XOF",NG:"NGN",NU:"NZD",NF:"AUD",MP:"USD",NO:"NOK",OM:"OMR",PK:"PKR",PW:"USD",PS:"ILS",PA:"PAB",PG:"PGK",PY:"PYG",PE:"PEN",PH:"PHP",PN:"NZD",PL:"PLN",PT:"EUR",PR:"USD",QA:"QAR",RE:"EUR",RO:"RON",RU:"RUB",RW:"RWF",SH:"SHP",KN:"XCD",LC:"XCD",PM:"EUR",VC:"XCD",WS:"WST",SM:"EUR",ST:"STN",SA:"SAR",SN:"XOF",RS:"RSD",SC:"SCR",SL:"SLL",SG:"SGD",SK:"EUR",SI:"EUR",SB:"SBD",SO:"SOS",ZA:"ZAR",GS:"GBP",ES:"EUR",LK:"LKR",SD:"SDG",SR:"SRD",SJ:"NOK",SZ:"SZL",SE:"SEK",CH:"CHF",SY:"SYP",TW:"TWD",TJ:"TJS",TZ:"TZS",TH:"THB"},dw=[{name:"Afghanistan",code:"AF"},{name:"land Islands",code:"AX"},{name:"Albania",code:"AL"},{name:"Algeria",code:"DZ"},{name:"American Samoa",code:"AS"},{name:"AndorrA",code:"AD"},{name:"Angola",code:"AO"},{name:"Anguilla",code:"AI"},{name:"Antarctica",code:"AQ"},{name:"Antigua and Barbuda",code:"AG"},{name:"Argentina",code:"AR"},{name:"Armenia",code:"AM"},{name:"Aruba",code:"AW"},{name:"Australia",code:"AU"},{name:"Austria",code:"AT"},{name:"Azerbaijan",code:"AZ"},{name:"Bahamas",code:"BS"},{name:"Bahrain",code:"BH"},{name:"Bangladesh",code:"BD"},{name:"Barbados",code:"BB"},{name:"Belarus",code:"BY"},{name:"Belgium",code:"BE"},{name:"Belize",code:"BZ"},{name:"Benin",code:"BJ"},{name:"Bermuda",code:"BM"},{name:"Bhutan",code:"BT"},{name:"Bolivia",code:"BO"},{name:"Bosnia and Herzegovina",code:"BA"},{name:"Botswana",code:"BW"},{name:"Bouvet Island",code:"BV"},{name:"Brazil",code:"BR"},{name:"British Indian Ocean Territory",code:"IO"},{name:"Brunei Darussalam",code:"BN"},{name:"Bulgaria",code:"BG"},{name:"Burkina Faso",code:"BF"},{name:"Burundi",code:"BI"},{name:"Cambodia",code:"KH"},{name:"Cameroon",code:"CM"},{name:"Canada",code:"CA"},{name:"Cape Verde",code:"CV"},{name:"Cayman Islands",code:"KY"},{name:"Central African Republic",code:"CF"},{name:"Chad",code:"TD"},{name:"Chile",code:"CL"},{name:"China",code:"CN"},{name:"Christmas Island",code:"CX"},{name:"Cocos (Keeling) Islands",code:"CC"},{name:"Colombia",code:"CO"},{name:"Comoros",code:"KM"},{name:"Congo",code:"CG"},{name:"Congo, The Democratic Republic of the",code:"CD"},{name:"Cook Islands",code:"CK"},{name:"Costa Rica",code:"CR"},{name:"Cote D Ivoire",code:"CI"},{name:"Croatia",code:"HR"},{name:"Cuba",code:"CU"},{name:"Cyprus",code:"CY"},{name:"Czech Republic",code:"CZ"},{name:"Denmark",code:"DK"},{name:"Djibouti",code:"DJ"},{name:"Dominica",code:"DM"},{name:"Dominican Republic",code:"DO"},{name:"Ecuador",code:"EC"},{name:"Egypt",code:"EG"},{name:"El Salvador",code:"SV"},{name:"Equatorial Guinea",code:"GQ"},{name:"Eritrea",code:"ER"},{name:"Estonia",code:"EE"},{name:"Ethiopia",code:"ET"},{name:"Falkland Islands (Malvinas)",code:"FK"},{name:"Faroe Islands",code:"FO"},{name:"Fiji",code:"FJ"},{name:"Finland",code:"FI"},{name:"France",code:"FR"},{name:"French Guiana",code:"GF"},{name:"French Polynesia",code:"PF"},{name:"French Southern Territories",code:"TF"},{name:"Gabon",code:"GA"},{name:"Gambia",code:"GM"},{name:"Georgia",code:"GE"},{name:"Germany",code:"DE"},{name:"Ghana",code:"GH"},{name:"Gibraltar",code:"GI"},{name:"Greece",code:"GR"},{name:"Greenland",code:"GL"},{name:"Grenada",code:"GD"},{name:"Guadeloupe",code:"GP"},{name:"Guam",code:"GU"},{name:"Guatemala",code:"GT"},{name:"Guernsey",code:"GG"},{name:"Guinea",code:"GN"},{name:"Guinea-Bissau",code:"GW"},{name:"Guyana",code:"GY"},{name:"Haiti",code:"HT"},{name:"Heard Island and Mcdonald Islands",code:"HM"},{name:"Holy See (Vatican City State)",code:"VA"},{name:"Honduras",code:"HN"},{name:"Hong Kong",code:"HK"},{name:"Hungary",code:"HU"},{name:"Iceland",code:"IS"},{name:"India",code:"IN"},{name:"Indonesia",code:"ID"},{name:"Iran, Islamic Republic Of",code:"IR"},{name:"Iraq",code:"IQ"},{name:"Ireland",code:"IE"},{name:"Isle of Man",code:"IM"},{name:"Israel",code:"IL"},{name:"Italy",code:"IT"},{name:"Jamaica",code:"JM"},{name:"Japan",code:"JP"},{name:"Jersey",code:"JE"},{name:"Jordan",code:"JO"},{name:"Kazakhstan",code:"KZ"},{name:"Kenya",code:"KE"},{name:"Kiribati",code:"KI"},{name:'Korea, Democratic People"S Republic of',code:"KP"},{name:"Korea, Republic of",code:"KR"},{name:"Kuwait",code:"KW"},{name:"Kyrgyzstan",code:"KG"},{name:'Lao People"S Democratic Republic',code:"LA"},{name:"Latvia",code:"LV"},{name:"Lebanon",code:"LB"},{name:"Lesotho",code:"LS"},{name:"Liberia",code:"LR"},{name:"Libyan Arab Jamahiriya",code:"LY"},{name:"Liechtenstein",code:"LI"},{name:"Lithuania",code:"LT"},{name:"Luxembourg",code:"LU"},{name:"Macao",code:"MO"},{name:"Macedonia, The Former Yugoslav Republic of",code:"MK"},{name:"Madagascar",code:"MG"},{name:"Malawi",code:"MW"},{name:"Malaysia",code:"MY"},{name:"Maldives",code:"MV"},{name:"Mali",code:"ML"},{name:"Malta",code:"MT"},{name:"Marshall Islands",code:"MH"},{name:"Martinique",code:"MQ"},{name:"Mauritania",code:"MR"},{name:"Mauritius",code:"MU"},{name:"Mayotte",code:"YT"},{name:"Mexico",code:"MX"},{name:"Micronesia, Federated States of",code:"FM"},{name:"Moldova, Republic of",code:"MD"},{name:"Monaco",code:"MC"},{name:"Mongolia",code:"MN"},{name:"Montenegro",code:"ME"},{name:"Montserrat",code:"MS"},{name:"Morocco",code:"MA"},{name:"Mozambique",code:"MZ"},{name:"Myanmar",code:"MM"},{name:"Namibia",code:"NA"},{name:"Nauru",code:"NR"},{name:"Nepal",code:"NP"},{name:"Netherlands",code:"NL"},{name:"Netherlands Antilles",code:"AN"},{name:"New Caledonia",code:"NC"},{name:"New Zealand",code:"NZ"},{name:"Nicaragua",code:"NI"},{name:"Niger",code:"NE"},{name:"Nigeria",code:"NG"},{name:"Niue",code:"NU"},{name:"Norfolk Island",code:"NF"},{name:"Northern Mariana Islands",code:"MP"},{name:"Norway",code:"NO"},{name:"Oman",code:"OM"},{name:"Pakistan",code:"PK"},{name:"Palau",code:"PW"},{name:"Palestinian Territory, Occupied",code:"PS"},{name:"Panama",code:"PA"},{name:"Papua New Guinea",code:"PG"},{name:"Paraguay",code:"PY"},{name:"Peru",code:"PE"},{name:"Philippines",code:"PH"},{name:"Pitcairn",code:"PN"},{name:"Poland",code:"PL"},{name:"Portugal",code:"PT"},{name:"Puerto Rico",code:"PR"},{name:"Qatar",code:"QA"},{name:"Reunion",code:"RE"},{name:"Romania",code:"RO"},{name:"Russian Federation",code:"RU"},{name:"RWANDA",code:"RW"},{name:"Saint Helena",code:"SH"},{name:"Saint Kitts and Nevis",code:"KN"},{name:"Saint Lucia",code:"LC"},{name:"Saint Pierre and Miquelon",code:"PM"},{name:"Saint Vincent and the Grenadines",code:"VC"},{name:"Samoa",code:"WS"},{name:"San Marino",code:"SM"},{name:"Sao Tome and Principe",code:"ST"},{name:"Saudi Arabia",code:"SA"},{name:"Senegal",code:"SN"},{name:"Serbia",code:"RS"},{name:"Seychelles",code:"SC"},{name:"Sierra Leone",code:"SL"},{name:"Singapore",code:"SG"},{name:"Slovakia",code:"SK"},{name:"Slovenia",code:"SI"},{name:"Solomon Islands",code:"SB"},{name:"Somalia",code:"SO"},{name:"South Africa",code:"ZA"},{name:"South Georgia and the South Sandwich Islands",code:"GS"},{name:"Spain",code:"ES"},{name:"Sri Lanka",code:"LK"},{name:"Sudan",code:"SD"},{name:"Suriname",code:"SR"},{name:"Svalbard and Jan Mayen",code:"SJ"},{name:"Swaziland",code:"SZ"},{name:"Sweden",code:"SE"},{name:"Switzerland",code:"CH"},{name:"Syrian Arab Republic",code:"SY"},{name:"Taiwan, Province of China",code:"TW"},{name:"Tajikistan",code:"TJ"},{name:"Tanzania, United Republic of",code:"TZ"},{name:"Thailand",code:"TH"},{name:"Timor-Leste",code:"TL"},{name:"Togo",code:"TG"},{name:"Tokelau",code:"TK"},{name:"Tonga",code:"TO"},{name:"Trinidad and Tobago",code:"TT"},{name:"Tunisia",code:"TN"},{name:"Turkey",code:"TR"},{name:"Turkmenistan",code:"TM"},{name:"Turks and Caicos Islands",code:"TC"},{name:"Tuvalu",code:"TV"},{name:"Uganda",code:"UG"},{name:"Ukraine",code:"UA"},{name:"United Arab Emirates",code:"AE"},{name:"United Kingdom",code:"GB"},{name:"United States",code:"US"},{name:"United States Minor Outlying Islands",code:"UM"},{name:"Uruguay",code:"UY"},{name:"Uzbekistan",code:"UZ"},{name:"Vanuatu",code:"VU"},{name:"Venezuela",code:"VE"},{name:"Viet Nam",code:"VN"},{name:"Virgin Islands, British",code:"VG"},{name:"Virgin Islands, U.S.",code:"VI"},{name:"Wallis and Futuna",code:"WF"},{name:"Western Sahara",code:"EH"},{name:"Yemen",code:"YE"},{name:"Zambia",code:"ZM"},{name:"Zimbabwe",code:"ZW"}].map(e=>{const t=cw[e.code]||"USD",r=lw[t]||"";return{value:e.code,flag:(n=e.code,n.toUpperCase().replace(/./g,e=>String.fromCodePoint(127397+e.charCodeAt(0)))),text:e.name,currencyCode:t,currencyIcon:r};var n});function uw(r){const[n,a]=t.useState(r.value||""),[o,s]=t.useState(!1),i=dw.find(e=>e.value==n);return e.jsxs(ow,{open:o,onOpenChange:s,children:[e.jsx(sw,{asChild:!0,children:e.jsxs(Es,{variant:"outline",role:"combobox","aria-expanded":o,className:"justify-between overflow-hidden text-ellipsis",children:[i?.text&&e.jsxs("div",{children:[String(i.text).trim(),e.jsx("span",{className:"ml-2 text-xs text-muted-foreground",children:i.flag})]}),!i&&e.jsx("span",{className:"text-muted-foreground",children:"Choose country"}),e.jsx(ds,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),e.jsx(iw,{className:"p-0 overflow-hidden text-ellipsis",children:e.jsxs(vv,{children:[e.jsx(bv,{placeholder:"Choose country..."}),e.jsx(yv,{children:e.jsx(wv,{children:dw.map(t=>e.jsxs(xv,{className:Wo("whitespace-nowrap text-left",{"text-green-500":n===t.value}),value:t.value,defaultValue:t.value,onSelect:e=>{const n=t.value;a(n),r.onChange&&"function"==typeof r.onChange&&r.onChange(n),s(!1)},children:[n===t.value&&e.jsx(cs,{className:Wo("mr-2 h-4 w-4 text-green-400",n===t.value?"opacity-100":"opacity-0")}),String(t.text).trim(),e.jsx("span",{className:"ml-2 text-xs text-muted-foreground",children:t.flag})]},t.value))})})]})})]})}const fw=dw.map(e=>({value:e.currencyCode,text:e.currencyCode,icon:e.currencyIcon??null})),mw=Array.from(new Set(fw.map(e=>e.value))).map(e=>fw.find(t=>t.value===e)).filter(e=>void 0!==e);function pw(r){const[n,a]=t.useState(r.value||""),[o,s]=t.useState(!1),i=mw.find(e=>e.value==n);return e.jsxs(ow,{open:o,onOpenChange:s,children:[e.jsx(sw,{asChild:!0,children:e.jsxs(Es,{variant:"outline",role:"combobox","aria-expanded":o,className:"justify-between overflow-hidden text-ellipsis",children:[i?.text&&e.jsxs("div",{children:[String(i.text).trim(),e.jsx("span",{className:"ml-2 text-xs text-muted-foreground",children:i.icon})]}),!i&&e.jsx("span",{className:"text-muted-foreground",children:"Choose Currency"}),e.jsx(ds,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),e.jsx(iw,{className:"p-0 overflow-hidden text-ellipsis",children:e.jsxs(vv,{children:[e.jsx(bv,{placeholder:"Choose currency..."}),e.jsx(yv,{children:e.jsx(wv,{children:mw.map(t=>e.jsxs(xv,{className:Wo("whitespace-nowrap text-left",{"text-green-500":n===t.value}),value:t.value,defaultValue:t.value,onSelect:e=>{const n=t.value;a(n),r.onChange&&"function"==typeof r.onChange&&r.onChange(n),s(!1)},children:[n===t.value&&e.jsx(cs,{className:Wo("mr-2 h-4 w-4 text-green-400",n===t.value?"opacity-100":"opacity-0")}),String(t.text).trim(),e.jsx("span",{className:"ml-2 text-xs text-muted-foreground",children:t.icon})]},t.value))})})]})})]})}let hw=[{code:"en",label:"English",flag:"🇬🇧"},{code:"en-GB",label:"English (United Kingdom)",flag:"🇬🇧"},{code:"en-US",label:"English (United States)",flag:"🇺🇸"},{code:"en-AU",label:"English (Australia)",flag:"🇦🇺"},{code:"en-CA",label:"English (Canada)",flag:"🇨🇦"},{code:"en-NZ",label:"English (New Zealand)",flag:"🇳🇿"},{code:"es",label:"Spanish",flag:"🇪🇸"},{code:"es-ES",label:"Spanish (Spain)",flag:"🇪🇸"},{code:"es-MX",label:"Spanish (Mexico)",flag:"🇲🇽"},{code:"fr",label:"French",flag:"🇫🇷"},{code:"fr-FR",label:"French (France)",flag:"🇫🇷"},{code:"de",label:"German",flag:"🇩🇪"},{code:"de-DE",label:"German (Germany)",flag:"🇩🇪"},{code:"it",label:"Italian",flag:"🇮🇹"},{code:"it-IT",label:"Italian (Italy)",flag:"🇮🇹"},{code:"pt",label:"Portuguese",flag:"🇵🇹"},{code:"pt-PT",label:"Portuguese (Portugal)",flag:"🇵🇹"},{code:"pt-BR",label:"Portuguese (Brazil)",flag:"🇧🇷"},{code:"ru",label:"Russian",flag:"🇷🇺"},{code:"ru-RU",label:"Russian (Russia)",flag:"🇷🇺"},{code:"zh",label:"Chinese",flag:"🇨🇳"},{code:"zh-CN",label:"Chinese (Simplified)",flag:"🇨🇳"},{code:"zh-TW",label:"Chinese (Traditional)",flag:"🇹🇼"},{code:"ja",label:"Japanese",flag:"🇯🇵"},{code:"ja-JP",label:"Japanese (Japan)",flag:"🇯🇵"},{code:"ko",label:"Korean",flag:"🇰🇷"},{code:"ko-KR",label:"Korean (South Korea)",flag:"🇰🇷"},{code:"ar",label:"Arabic",flag:"🇸🇦"},{code:"ar-SA",label:"Arabic (Saudi Arabia)",flag:"🇸🇦"},{code:"hi",label:"Hindi",flag:"🇮🇳"},{code:"hi-IN",label:"Hindi (India)",flag:"🇮🇳"},{code:"bn",label:"Bengali",flag:"🇮🇳"},{code:"bn-IN",label:"Bengali (India)",flag:"🇮🇳"},{code:"gu",label:"Gujarati",flag:"🇮🇳"},{code:"gu-IN",label:"Gujarati (India)",flag:"🇮🇳"},{code:"ta",label:"Tamil",flag:"🇮🇳"},{code:"ta-IN",label:"Tamil (India)",flag:"🇮🇳"},{code:"te",label:"Telugu",flag:"🇮🇳"},{code:"te-IN",label:"Telugu (India)",flag:"🇮🇳"},{code:"ml",label:"Malayalam",flag:"🇮🇳"},{code:"ml-IN",label:"Malayalam (India)",flag:"🇮🇳"},{code:"kn",label:"Kannada",flag:"🇮🇳"},{code:"kn-IN",label:"Kannada (India)",flag:"🇮🇳"},{code:"mr",label:"Marathi",flag:"🇮🇳"},{code:"mr-IN",label:"Marathi (India)",flag:"🇮🇳"},{code:"pa",label:"Punjabi",flag:"🇮🇳"},{code:"pa-IN",label:"Punjabi (India)",flag:"🇮🇳"},{code:"ur",label:"Urdu",flag:"🇮🇳"},{code:"ur-IN",label:"Urdu (India)",flag:"🇮🇳"},{code:"or",label:"Odia",flag:"🇮🇳"},{code:"or-IN",label:"Odia (India)",flag:"🇮🇳"},{code:"as",label:"Assamese",flag:"🇮🇳"},{code:"as-IN",label:"Assamese (India)",flag:"🇮🇳"},{code:"zh-HK",label:"Chinese (Hong Kong)",flag:"🇭🇰"},{code:"nl",label:"Dutch",flag:"🇳🇱"},{code:"nl-NL",label:"Dutch (Netherlands)",flag:"🇳🇱"},{code:"pl",label:"Polish",flag:"🇵🇱"},{code:"pl-PL",label:"Polish (Poland)",flag:"🇵🇱"},{code:"sv",label:"Swedish",flag:"🇸🇪"},{code:"sv-SE",label:"Swedish (Sweden)",flag:"🇸🇪"},{code:"da",label:"Danish",flag:"🇩🇰"},{code:"da-DK",label:"Danish (Denmark)",flag:"🇩🇰"},{code:"no",label:"Norwegian",flag:"🇳🇴"},{code:"no-NO",label:"Norwegian (Norway)",flag:"🇳🇴"},{code:"fi",label:"Finnish",flag:"🇫🇮"},{code:"fi-FI",label:"Finnish (Finland)",flag:"🇫🇮"},{code:"tr",label:"Turkish",flag:"🇹🇷"},{code:"tr-TR",label:"Turkish (Turkey)",flag:"🇹🇷"},{code:"cs",label:"Czech",flag:"🇨🇿"},{code:"cs-CZ",label:"Czech (Czech Republic)",flag:"🇨🇿"},{code:"sk",label:"Slovak",flag:"🇸🇰"},{code:"sk-SK",label:"Slovak (Slovakia)",flag:"🇸🇰"},{code:"hu",label:"Hungarian",flag:"🇭🇺"},{code:"hu-HU",label:"Hungarian (Hungary)",flag:"🇭🇺"},{code:"ro",label:"Romanian",flag:"🇷🇴"},{code:"ro-RO",label:"Romanian (Romania)",flag:"🇷🇴"},{code:"el",label:"Greek",flag:"🇬🇷"},{code:"el-GR",label:"Greek (Greece)",flag:"🇬🇷"},{code:"th",label:"Thai",flag:"🇹🇭"},{code:"th-TH",label:"Thai (Thailand)",flag:"🇹🇭"},{code:"id",label:"Indonesian",flag:"🇮🇩"},{code:"id-ID",label:"Indonesian (Indonesia)",flag:"🇮🇩"},{code:"ms",label:"Malay",flag:"🇲🇾"},{code:"ms-MY",label:"Malay (Malaysia)",flag:"🇲🇾"},{code:"vi",label:"Vietnamese",flag:"🇻🇳"},{code:"vi-VN",label:"Vietnamese (Vietnam)",flag:"🇻🇳"},{code:"he",label:"Hebrew",flag:"🇮🇱"},{code:"he-IL",label:"Hebrew (Israel)",flag:"🇮🇱"}];hw=hw.filter((e,t,r)=>t===r.findIndex(t=>t.code===e.code&&t.label===e.label)),hw.sort((e,t)=>e.label<t.label?-1:e.label>t.label?1:0);const gw=hw.filter(e=>function(e){try{const t=new Intl.DateTimeFormat(e);return t.resolvedOptions().locale===e||t.resolvedOptions().locale.startsWith(e)}catch{return!1}}(e.code)).filter((e,t,r)=>t===r.findIndex(t=>t.code===e.code&&t.label===e.label)).map(e=>({value:e.code,label:e.label,flag:e.flag}));function vw(r){const[n,a]=t.useState(r.value||""),[o,s]=t.useState(!1),i=gw.find(e=>e.value==n);return e.jsxs(ow,{open:o,onOpenChange:s,children:[e.jsx(sw,{asChild:!0,children:e.jsxs(Es,{variant:"outline",role:"combobox","aria-expanded":o,className:"justify-between overflow-hidden text-ellipsis",children:[i&&e.jsxs("div",{children:[String(i.label).trim(),e.jsx("span",{className:"ml-2 text-xs text-muted-foreground",children:i.flag})]}),!i&&"Choose language",e.jsx(ds,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),e.jsx(iw,{className:"p-0 overflow-hidden text-ellipsis",children:e.jsxs(vv,{children:[e.jsx(bv,{placeholder:"Choose timezone..."}),e.jsx(yv,{children:e.jsx(wv,{children:gw.map(t=>e.jsxs(xv,{className:Wo("whitespace-nowrap text-left",{"text-green-500":n===t.value}),value:t.value,defaultValue:t.value,onSelect:e=>{const n=t.value;a(n),r.onChange&&"function"==typeof r.onChange&&r.onChange(n),s(!1)},children:[n===t.value&&e.jsx(cs,{className:Wo("mr-2 h-4 w-4 text-green-400",n===t.value?"opacity-100":"opacity-0")}),String(t.label).trim(),e.jsx("span",{className:"ml-2 text-xs text-muted-foreground",children:t.flag})]},t.value))})})]})})]})}const bw=[{value:"Dateline Standard Time",abbr:"DST",offset:-12,isdst:!1,text:"(UTC-12:00) International Date Line West",utc:["Etc/GMT+12"]},{value:"UTC-11",abbr:"U",offset:-11,isdst:!1,text:"(UTC-11:00) Coordinated Universal Time-11",utc:["Etc/GMT+11","Pacific/Midway","Pacific/Niue","Pacific/Pago_Pago"]},{value:"Hawaiian Standard Time",abbr:"HST",offset:-10,isdst:!1,text:"(UTC-10:00) Hawaii",utc:["Etc/GMT+10","Pacific/Honolulu","Pacific/Johnston","Pacific/Rarotonga","Pacific/Tahiti"]},{value:"Alaskan Standard Time",abbr:"AKDT",offset:-8,isdst:!0,text:"(UTC-09:00) Alaska",utc:["America/Anchorage","America/Juneau","America/Nome","America/Sitka","America/Yakutat"]},{value:"Pacific Standard Time (Mexico)",abbr:"PDT",offset:-7,isdst:!0,text:"(UTC-08:00) Baja California",utc:["America/Santa_Isabel"]},{value:"Pacific Daylight Time",abbr:"PDT",offset:-7,isdst:!0,text:"(UTC-07:00) Pacific Daylight Time (US & Canada)",utc:["America/Los_Angeles","America/Tijuana","America/Vancouver"]},{value:"Pacific Standard Time",abbr:"PST",offset:-8,isdst:!1,text:"(UTC-08:00) Pacific Standard Time (US & Canada)",utc:["America/Los_Angeles","America/Tijuana","America/Vancouver","PST8PDT"]},{value:"US Mountain Standard Time",abbr:"UMST",offset:-7,isdst:!1,text:"(UTC-07:00) Arizona",utc:["America/Creston","America/Dawson","America/Dawson_Creek","America/Hermosillo","America/Phoenix","America/Whitehorse","Etc/GMT+7"]},{value:"Mountain Standard Time (Mexico)",abbr:"MDT",offset:-6,isdst:!0,text:"(UTC-07:00) Chihuahua, La Paz, Mazatlan",utc:["America/Chihuahua","America/Mazatlan"]},{value:"Mountain Standard Time",abbr:"MDT",offset:-6,isdst:!0,text:"(UTC-07:00) Mountain Time (US & Canada)",utc:["America/Boise","America/Cambridge_Bay","America/Denver","America/Edmonton","America/Inuvik","America/Ojinaga","America/Yellowknife","MST7MDT"]},{value:"Central America Standard Time",abbr:"CAST",offset:-6,isdst:!1,text:"(UTC-06:00) Central America",utc:["America/Belize","America/Costa_Rica","America/El_Salvador","America/Guatemala","America/Managua","America/Tegucigalpa","Etc/GMT+6","Pacific/Galapagos"]},{value:"Central Standard Time",abbr:"CDT",offset:-5,isdst:!0,text:"(UTC-06:00) Central Time (US & Canada)",utc:["America/Chicago","America/Indiana/Knox","America/Indiana/Tell_City","America/Matamoros","America/Menominee","America/North_Dakota/Beulah","America/North_Dakota/Center","America/North_Dakota/New_Salem","America/Rainy_River","America/Rankin_Inlet","America/Resolute","America/Winnipeg","CST6CDT"]},{value:"Central Standard Time (Mexico)",abbr:"CDT",offset:-5,isdst:!0,text:"(UTC-06:00) Guadalajara, Mexico City, Monterrey",utc:["America/Bahia_Banderas","America/Cancun","America/Merida","America/Mexico_City","America/Monterrey"]},{value:"Canada Central Standard Time",abbr:"CCST",offset:-6,isdst:!1,text:"(UTC-06:00) Saskatchewan",utc:["America/Regina","America/Swift_Current"]},{value:"SA Pacific Standard Time",abbr:"SPST",offset:-5,isdst:!1,text:"(UTC-05:00) Bogota, Lima, Quito",utc:["America/Bogota","America/Cayman","America/Coral_Harbour","America/Eirunepe","America/Guayaquil","America/Jamaica","America/Lima","America/Panama","America/Rio_Branco","Etc/GMT+5"]},{value:"Eastern Standard Time",abbr:"EST",offset:-5,isdst:!1,text:"(UTC-05:00) Eastern Time (US & Canada)",utc:["America/Detroit","America/Havana","America/Indiana/Petersburg","America/Indiana/Vincennes","America/Indiana/Winamac","America/Iqaluit","America/Kentucky/Monticello","America/Louisville","America/Montreal","America/Nassau","America/New_York","America/Nipigon","America/Pangnirtung","America/Port-au-Prince","America/Thunder_Bay","America/Toronto"]},{value:"Eastern Daylight Time",abbr:"EDT",offset:-4,isdst:!0,text:"(UTC-04:00) Eastern Daylight Time (US & Canada)",utc:["America/Detroit","America/Havana","America/Indiana/Petersburg","America/Indiana/Vincennes","America/Indiana/Winamac","America/Iqaluit","America/Kentucky/Monticello","America/Louisville","America/Montreal","America/Nassau","America/New_York","America/Nipigon","America/Pangnirtung","America/Port-au-Prince","America/Thunder_Bay","America/Toronto"]},{value:"US Eastern Standard Time",abbr:"UEDT",offset:-5,isdst:!1,text:"(UTC-05:00) Indiana (East)",utc:["America/Indiana/Marengo","America/Indiana/Vevay","America/Indianapolis"]},{value:"Venezuela Standard Time",abbr:"VST",offset:-4.5,isdst:!1,text:"(UTC-04:30) Caracas",utc:["America/Caracas"]},{value:"Paraguay Standard Time",abbr:"PYT",offset:-4,isdst:!1,text:"(UTC-04:00) Asuncion",utc:["America/Asuncion"]},{value:"Atlantic Standard Time",abbr:"ADT",offset:-3,isdst:!0,text:"(UTC-04:00) Atlantic Time (Canada)",utc:["America/Glace_Bay","America/Goose_Bay","America/Halifax","America/Moncton","America/Thule","Atlantic/Bermuda"]},{value:"Central Brazilian Standard Time",abbr:"CBST",offset:-4,isdst:!1,text:"(UTC-04:00) Cuiaba",utc:["America/Campo_Grande","America/Cuiaba"]},{value:"SA Western Standard Time",abbr:"SWST",offset:-4,isdst:!1,text:"(UTC-04:00) Georgetown, La Paz, Manaus, San Juan",utc:["America/Anguilla","America/Antigua","America/Aruba","America/Barbados","America/Blanc-Sablon","America/Boa_Vista","America/Curacao","America/Dominica","America/Grand_Turk","America/Grenada","America/Guadeloupe","America/Guyana","America/Kralendijk","America/La_Paz","America/Lower_Princes","America/Manaus","America/Marigot","America/Martinique","America/Montserrat","America/Port_of_Spain","America/Porto_Velho","America/Puerto_Rico","America/Santo_Domingo","America/St_Barthelemy","America/St_Kitts","America/St_Lucia","America/St_Thomas","America/St_Vincent","America/Tortola","Etc/GMT+4"]},{value:"Pacific SA Standard Time",abbr:"PSST",offset:-4,isdst:!1,text:"(UTC-04:00) Santiago",utc:["America/Santiago","Antarctica/Palmer"]},{value:"Newfoundland Standard Time",abbr:"NDT",offset:-2.5,isdst:!0,text:"(UTC-03:30) Newfoundland",utc:["America/St_Johns"]},{value:"E. South America Standard Time",abbr:"ESAST",offset:-3,isdst:!1,text:"(UTC-03:00) Brasilia",utc:["America/Sao_Paulo"]},{value:"Argentina Standard Time",abbr:"AST",offset:-3,isdst:!1,text:"(UTC-03:00) Buenos Aires",utc:["America/Argentina/Buenos_Aires","America/Argentina/Catamarca","America/Argentina/Cordoba","America/Argentina/Jujuy","America/Argentina/La_Rioja","America/Argentina/Mendoza","America/Argentina/Rio_Gallegos","America/Argentina/Salta","America/Argentina/San_Juan","America/Argentina/San_Luis","America/Argentina/Tucuman","America/Argentina/Ushuaia","America/Buenos_Aires","America/Catamarca","America/Cordoba","America/Jujuy","America/Mendoza"]},{value:"SA Eastern Standard Time",abbr:"SEST",offset:-3,isdst:!1,text:"(UTC-03:00) Cayenne, Fortaleza",utc:["America/Araguaina","America/Belem","America/Cayenne","America/Fortaleza","America/Maceio","America/Paramaribo","America/Recife","America/Santarem","Antarctica/Rothera","Atlantic/Stanley","Etc/GMT+3"]},{value:"Greenland Standard Time",abbr:"GDT",offset:-3,isdst:!0,text:"(UTC-03:00) Greenland",utc:["America/Godthab"]},{value:"Montevideo Standard Time",abbr:"MST",offset:-3,isdst:!1,text:"(UTC-03:00) Montevideo",utc:["America/Montevideo"]},{value:"Bahia Standard Time",abbr:"BST",offset:-3,isdst:!1,text:"(UTC-03:00) Salvador",utc:["America/Bahia"]},{value:"UTC-02",abbr:"U",offset:-2,isdst:!1,text:"(UTC-02:00) Coordinated Universal Time-02",utc:["America/Noronha","Atlantic/South_Georgia","Etc/GMT+2"]},{value:"Mid-Atlantic Standard Time",abbr:"MDT",offset:-1,isdst:!0,text:"(UTC-02:00) Mid-Atlantic - Old",utc:[]},{value:"Azores Standard Time",abbr:"ADT",offset:0,isdst:!0,text:"(UTC-01:00) Azores",utc:["America/Scoresbysund","Atlantic/Azores"]},{value:"Cape Verde Standard Time",abbr:"CVST",offset:-1,isdst:!1,text:"(UTC-01:00) Cape Verde Is.",utc:["Atlantic/Cape_Verde","Etc/GMT+1"]},{value:"Morocco Standard Time",abbr:"MDT",offset:1,isdst:!0,text:"(UTC) Casablanca",utc:["Africa/Casablanca","Africa/El_Aaiun"]},{value:"UTC",abbr:"UTC",offset:0,isdst:!1,text:"(UTC) Coordinated Universal Time",utc:["America/Danmarkshavn","Etc/GMT"]},{value:"GMT Standard Time",abbr:"GMT",offset:0,isdst:!1,text:"(UTC) Edinburgh, London",utc:["Europe/Isle_of_Man","Europe/Guernsey","Europe/Jersey","Europe/London"]},{value:"British Summer Time",abbr:"BST",offset:1,isdst:!0,text:"(UTC+01:00) Edinburgh, London",utc:["Europe/Isle_of_Man","Europe/Guernsey","Europe/Jersey","Europe/London"]},{value:"GMT Standard Time",abbr:"GDT",offset:1,isdst:!0,text:"(UTC) Dublin, Lisbon",utc:["Atlantic/Canary","Atlantic/Faeroe","Atlantic/Madeira","Europe/Dublin","Europe/Lisbon"]},{value:"Greenwich Standard Time",abbr:"GST",offset:0,isdst:!1,text:"(UTC) Monrovia, Reykjavik",utc:["Africa/Abidjan","Africa/Accra","Africa/Bamako","Africa/Banjul","Africa/Bissau","Africa/Conakry","Africa/Dakar","Africa/Freetown","Africa/Lome","Africa/Monrovia","Africa/Nouakchott","Africa/Ouagadougou","Africa/Sao_Tome","Atlantic/Reykjavik","Atlantic/St_Helena"]},{value:"W. Europe Standard Time",abbr:"WEDT",offset:2,isdst:!0,text:"(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna",utc:["Arctic/Longyearbyen","Europe/Amsterdam","Europe/Andorra","Europe/Berlin","Europe/Busingen","Europe/Gibraltar","Europe/Luxembourg","Europe/Malta","Europe/Monaco","Europe/Oslo","Europe/Rome","Europe/San_Marino","Europe/Stockholm","Europe/Vaduz","Europe/Vatican","Europe/Vienna","Europe/Zurich"]},{value:"Central Europe Standard Time",abbr:"CEDT",offset:2,isdst:!0,text:"(UTC+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague",utc:["Europe/Belgrade","Europe/Bratislava","Europe/Budapest","Europe/Ljubljana","Europe/Podgorica","Europe/Prague","Europe/Tirane"]},{value:"Romance Standard Time",abbr:"RDT",offset:2,isdst:!0,text:"(UTC+01:00) Brussels, Copenhagen, Madrid, Paris",utc:["Africa/Ceuta","Europe/Brussels","Europe/Copenhagen","Europe/Madrid","Europe/Paris"]},{value:"Central European Standard Time",abbr:"CEDT",offset:2,isdst:!0,text:"(UTC+01:00) Sarajevo, Skopje, Warsaw, Zagreb",utc:["Europe/Sarajevo","Europe/Skopje","Europe/Warsaw","Europe/Zagreb"]},{value:"W. Central Africa Standard Time",abbr:"WCAST",offset:1,isdst:!1,text:"(UTC+01:00) West Central Africa",utc:["Africa/Algiers","Africa/Bangui","Africa/Brazzaville","Africa/Douala","Africa/Kinshasa","Africa/Lagos","Africa/Libreville","Africa/Luanda","Africa/Malabo","Africa/Ndjamena","Africa/Niamey","Africa/Porto-Novo","Africa/Tunis","Etc/GMT-1"]},{value:"Namibia Standard Time",abbr:"NST",offset:1,isdst:!1,text:"(UTC+01:00) Windhoek",utc:["Africa/Windhoek"]},{value:"GTB Standard Time",abbr:"GDT",offset:3,isdst:!0,text:"(UTC+02:00) Athens, Bucharest",utc:["Asia/Nicosia","Europe/Athens","Europe/Bucharest","Europe/Chisinau"]},{value:"Middle East Standard Time",abbr:"MEDT",offset:3,isdst:!0,text:"(UTC+02:00) Beirut",utc:["Asia/Beirut"]},{value:"Egypt Standard Time",abbr:"EST",offset:2,isdst:!1,text:"(UTC+02:00) Cairo",utc:["Africa/Cairo"]},{value:"Syria Standard Time",abbr:"SDT",offset:3,isdst:!0,text:"(UTC+02:00) Damascus",utc:["Asia/Damascus"]},{value:"E. Europe Standard Time",abbr:"EEDT",offset:3,isdst:!0,text:"(UTC+02:00) E. Europe",utc:["Asia/Nicosia","Europe/Athens","Europe/Bucharest","Europe/Chisinau","Europe/Helsinki","Europe/Kyiv","Europe/Mariehamn","Europe/Nicosia","Europe/Riga","Europe/Sofia","Europe/Tallinn","Europe/Uzhhorod","Europe/Vilnius","Europe/Zaporizhzhia"]},{value:"South Africa Standard Time",abbr:"SAST",offset:2,isdst:!1,text:"(UTC+02:00) Harare, Pretoria",utc:["Africa/Blantyre","Africa/Bujumbura","Africa/Gaborone","Africa/Harare","Africa/Johannesburg","Africa/Kigali","Africa/Lubumbashi","Africa/Lusaka","Africa/Maputo","Africa/Maseru","Africa/Mbabane","Etc/GMT-2"]},{value:"FLE Standard Time",abbr:"FDT",offset:3,isdst:!0,text:"(UTC+02:00) Helsinki, Kyiv, Riga, Sofia, Tallinn, Vilnius",utc:["Europe/Helsinki","Europe/Kyiv","Europe/Mariehamn","Europe/Riga","Europe/Sofia","Europe/Tallinn","Europe/Uzhhorod","Europe/Vilnius","Europe/Zaporizhzhia"]},{value:"Turkey Standard Time",abbr:"TDT",offset:3,isdst:!1,text:"(UTC+03:00) Istanbul",utc:["Europe/Istanbul"]},{value:"Israel Standard Time",abbr:"JDT",offset:3,isdst:!0,text:"(UTC+02:00) Jerusalem",utc:["Asia/Jerusalem"]},{value:"Libya Standard Time",abbr:"LST",offset:2,isdst:!1,text:"(UTC+02:00) Tripoli",utc:["Africa/Tripoli"]},{value:"Jordan Standard Time",abbr:"JST",offset:3,isdst:!1,text:"(UTC+03:00) Amman",utc:["Asia/Amman"]},{value:"Arabic Standard Time",abbr:"AST",offset:3,isdst:!1,text:"(UTC+03:00) Baghdad",utc:["Asia/Baghdad"]},{value:"Kaliningrad Standard Time",abbr:"KST",offset:3,isdst:!1,text:"(UTC+02:00) Kaliningrad",utc:["Europe/Kaliningrad"]},{value:"Arab Standard Time",abbr:"AST",offset:3,isdst:!1,text:"(UTC+03:00) Kuwait, Riyadh",utc:["Asia/Aden","Asia/Bahrain","Asia/Kuwait","Asia/Qatar","Asia/Riyadh"]},{value:"E. Africa Standard Time",abbr:"EAST",offset:3,isdst:!1,text:"(UTC+03:00) Nairobi",utc:["Africa/Addis_Ababa","Africa/Asmera","Africa/Dar_es_Salaam","Africa/Djibouti","Africa/Juba","Africa/Kampala","Africa/Khartoum","Africa/Mogadishu","Africa/Nairobi","Antarctica/Syowa","Etc/GMT-3","Indian/Antananarivo","Indian/Comoro","Indian/Mayotte"]},{value:"Moscow Standard Time",abbr:"MSK",offset:3,isdst:!1,text:"(UTC+03:00) Moscow, St. Petersburg, Volgograd, Minsk",utc:["Europe/Kirov","Europe/Moscow","Europe/Simferopol","Europe/Volgograd","Europe/Minsk"]},{value:"Samara Time",abbr:"SAMT",offset:4,isdst:!1,text:"(UTC+04:00) Samara, Ulyanovsk, Saratov",utc:["Europe/Astrakhan","Europe/Samara","Europe/Ulyanovsk"]},{value:"Iran Standard Time",abbr:"IDT",offset:4.5,isdst:!0,text:"(UTC+03:30) Tehran",utc:["Asia/Tehran"]},{value:"Arabian Standard Time",abbr:"AST",offset:4,isdst:!1,text:"(UTC+04:00) Abu Dhabi, Muscat",utc:["Asia/Dubai","Asia/Muscat","Etc/GMT-4"]},{value:"Azerbaijan Standard Time",abbr:"ADT",offset:5,isdst:!0,text:"(UTC+04:00) Baku",utc:["Asia/Baku"]},{value:"Mauritius Standard Time",abbr:"MST",offset:4,isdst:!1,text:"(UTC+04:00) Port Louis",utc:["Indian/Mahe","Indian/Mauritius","Indian/Reunion"]},{value:"Georgian Standard Time",abbr:"GET",offset:4,isdst:!1,text:"(UTC+04:00) Tbilisi",utc:["Asia/Tbilisi"]},{value:"Caucasus Standard Time",abbr:"CST",offset:4,isdst:!1,text:"(UTC+04:00) Yerevan",utc:["Asia/Yerevan"]},{value:"Afghanistan Standard Time",abbr:"AST",offset:4.5,isdst:!1,text:"(UTC+04:30) Kabul",utc:["Asia/Kabul"]},{value:"West Asia Standard Time",abbr:"WAST",offset:5,isdst:!1,text:"(UTC+05:00) Ashgabat, Tashkent",utc:["Antarctica/Mawson","Asia/Aqtau","Asia/Aqtobe","Asia/Ashgabat","Asia/Dushanbe","Asia/Oral","Asia/Samarkand","Asia/Tashkent","Etc/GMT-5","Indian/Kerguelen","Indian/Maldives"]},{value:"Yekaterinburg Time",abbr:"YEKT",offset:5,isdst:!1,text:"(UTC+05:00) Yekaterinburg",utc:["Asia/Yekaterinburg"]},{value:"Pakistan Standard Time",abbr:"PKT",offset:5,isdst:!1,text:"(UTC+05:00) Islamabad, Karachi",utc:["Asia/Karachi"]},{value:"India Standard Time",abbr:"IST",offset:5.5,isdst:!1,text:"(UTC+05:30) Chennai, Kolkata, Mumbai, New Delhi",utc:["Asia/Kolkata","Asia/Calcutta"]},{value:"Sri Lanka Standard Time",abbr:"SLST",offset:5.5,isdst:!1,text:"(UTC+05:30) Sri Jayawardenepura",utc:["Asia/Colombo"]},{value:"Nepal Standard Time",abbr:"NST",offset:5.75,isdst:!1,text:"(UTC+05:45) Kathmandu",utc:["Asia/Kathmandu"]},{value:"Central Asia Standard Time",abbr:"CAST",offset:6,isdst:!1,text:"(UTC+06:00) Nur-Sultan (Astana)",utc:["Antarctica/Vostok","Asia/Almaty","Asia/Bishkek","Asia/Qyzylorda","Asia/Urumqi","Etc/GMT-6","Indian/Chagos"]},{value:"Bangladesh Standard Time",abbr:"BST",offset:6,isdst:!1,text:"(UTC+06:00) Dhaka",utc:["Asia/Dhaka","Asia/Thimphu"]},{value:"Myanmar Standard Time",abbr:"MST",offset:6.5,isdst:!1,text:"(UTC+06:30) Yangon (Rangoon)",utc:["Asia/Rangoon","Indian/Cocos"]},{value:"SE Asia Standard Time",abbr:"SAST",offset:7,isdst:!1,text:"(UTC+07:00) Bangkok, Hanoi, Jakarta",utc:["Antarctica/Davis","Asia/Bangkok","Asia/Hovd","Asia/Jakarta","Asia/Phnom_Penh","Asia/Pontianak","Asia/Saigon","Asia/Vientiane","Etc/GMT-7","Indian/Christmas"]},{value:"N. Central Asia Standard Time",abbr:"NCAST",offset:7,isdst:!1,text:"(UTC+07:00) Novosibirsk",utc:["Asia/Novokuznetsk","Asia/Novosibirsk","Asia/Omsk"]},{value:"China Standard Time",abbr:"CST",offset:8,isdst:!1,text:"(UTC+08:00) Beijing, Chongqing, Hong Kong, Urumqi",utc:["Asia/Hong_Kong","Asia/Macau","Asia/Shanghai"]},{value:"North Asia Standard Time",abbr:"NAST",offset:8,isdst:!1,text:"(UTC+08:00) Krasnoyarsk",utc:["Asia/Krasnoyarsk"]},{value:"Singapore Standard Time",abbr:"MPST",offset:8,isdst:!1,text:"(UTC+08:00) Kuala Lumpur, Singapore",utc:["Asia/Brunei","Asia/Kuala_Lumpur","Asia/Kuching","Asia/Makassar","Asia/Manila","Asia/Singapore","Etc/GMT-8"]},{value:"W. Australia Standard Time",abbr:"WAST",offset:8,isdst:!1,text:"(UTC+08:00) Perth",utc:["Antarctica/Casey","Australia/Perth"]},{value:"Taipei Standard Time",abbr:"TST",offset:8,isdst:!1,text:"(UTC+08:00) Taipei",utc:["Asia/Taipei"]},{value:"Ulaanbaatar Standard Time",abbr:"UST",offset:8,isdst:!1,text:"(UTC+08:00) Ulaanbaatar",utc:["Asia/Choibalsan","Asia/Ulaanbaatar"]},{value:"North Asia East Standard Time",abbr:"NAEST",offset:8,isdst:!1,text:"(UTC+08:00) Irkutsk",utc:["Asia/Irkutsk"]},{value:"Japan Standard Time",abbr:"JST",offset:9,isdst:!1,text:"(UTC+09:00) Osaka, Sapporo, Tokyo",utc:["Asia/Dili","Asia/Jayapura","Asia/Tokyo","Etc/GMT-9","Pacific/Palau"]},{value:"Korea Standard Time",abbr:"KST",offset:9,isdst:!1,text:"(UTC+09:00) Seoul",utc:["Asia/Pyongyang","Asia/Seoul"]},{value:"Cen. Australia Standard Time",abbr:"CAST",offset:9.5,isdst:!1,text:"(UTC+09:30) Adelaide",utc:["Australia/Adelaide","Australia/Broken_Hill"]},{value:"AUS Central Standard Time",abbr:"ACST",offset:9.5,isdst:!1,text:"(UTC+09:30) Darwin",utc:["Australia/Darwin"]},{value:"E. Australia Standard Time",abbr:"EAST",offset:10,isdst:!1,text:"(UTC+10:00) Brisbane",utc:["Australia/Brisbane","Australia/Lindeman"]},{value:"AUS Eastern Standard Time",abbr:"AEST",offset:10,isdst:!1,text:"(UTC+10:00) Canberra, Melbourne, Sydney",utc:["Australia/Melbourne","Australia/Sydney"]},{value:"West Pacific Standard Time",abbr:"WPST",offset:10,isdst:!1,text:"(UTC+10:00) Guam, Port Moresby",utc:["Antarctica/DumontDUrville","Etc/GMT-10","Pacific/Guam","Pacific/Port_Moresby","Pacific/Saipan","Pacific/Truk"]},{value:"Tasmania Standard Time",abbr:"TST",offset:10,isdst:!1,text:"(UTC+10:00) Hobart",utc:["Australia/Currie","Australia/Hobart"]},{value:"Yakutsk Standard Time",abbr:"YST",offset:9,isdst:!1,text:"(UTC+09:00) Yakutsk",utc:["Asia/Chita","Asia/Khandyga","Asia/Yakutsk"]},{value:"Central Pacific Standard Time",abbr:"CPST",offset:11,isdst:!1,text:"(UTC+11:00) Solomon Is., New Caledonia",utc:["Antarctica/Macquarie","Etc/GMT-11","Pacific/Efate","Pacific/Guadalcanal","Pacific/Kosrae","Pacific/Noumea","Pacific/Ponape"]},{value:"Vladivostok Standard Time",abbr:"VST",offset:11,isdst:!1,text:"(UTC+11:00) Vladivostok",utc:["Asia/Sakhalin","Asia/Ust-Nera","Asia/Vladivostok"]},{value:"New Zealand Standard Time",abbr:"NZST",offset:12,isdst:!1,text:"(UTC+12:00) Auckland, Wellington",utc:["Antarctica/McMurdo","Pacific/Auckland"]},{value:"UTC+12",abbr:"U",offset:12,isdst:!1,text:"(UTC+12:00) Coordinated Universal Time+12",utc:["Etc/GMT-12","Pacific/Funafuti","Pacific/Kwajalein","Pacific/Majuro","Pacific/Nauru","Pacific/Tarawa","Pacific/Wake","Pacific/Wallis"]},{value:"Fiji Standard Time",abbr:"FST",offset:12,isdst:!1,text:"(UTC+12:00) Fiji",utc:["Pacific/Fiji"]},{value:"Magadan Standard Time",abbr:"MST",offset:12,isdst:!1,text:"(UTC+12:00) Magadan",utc:["Asia/Anadyr","Asia/Kamchatka","Asia/Magadan","Asia/Srednekolymsk"]},{value:"Kamchatka Standard Time",abbr:"KDT",offset:13,isdst:!0,text:"(UTC+12:00) Petropavlovsk-Kamchatsky - Old",utc:["Asia/Kamchatka"]},{value:"Tonga Standard Time",abbr:"TST",offset:13,isdst:!1,text:"(UTC+13:00) Nuku'alofa",utc:["Etc/GMT-13","Pacific/Enderbury","Pacific/Fakaofo","Pacific/Tongatapu"]},{value:"Samoa Standard Time",abbr:"SST",offset:13,isdst:!1,text:"(UTC+13:00) Samoa",utc:["Pacific/Apia"]}].filter(e=>e.utc.length).reduce((e,t)=>{let r=t.utc;for(let n=0;n<r.length;n++){const a=r[n],o=t.text;let s=o.substring(o.indexOf("(")+1,o.indexOf(")"));-1!==s.indexOf("UTC")&&e.push({value:a,abbr:t.abbr,offset:t.offset,isdst:t.isdst,text:`(${s}) ${a}`,utc:["Etc/GMT-13","Pacific/Enderbury","Pacific/Fakaofo","Pacific/Tongatapu"]})}return e},[]).filter((e,t,r)=>t===r.findIndex(t=>t.value===e.value));function yw(r){const[n,a]=t.useState(r.value||""),[o,s]=t.useState(!1),i=bw.find(e=>e.value==n);return e.jsxs(ow,{open:o,onOpenChange:s,children:[e.jsx(sw,{asChild:!0,children:e.jsxs(Es,{variant:"outline",role:"combobox","aria-expanded":o,className:"justify-between overflow-hidden text-ellipsis",children:[i?.text||"Choose timezone",e.jsx(ds,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),e.jsx(iw,{className:"p-0 overflow-hidden text-ellipsis",children:e.jsxs(vv,{children:[e.jsx(bv,{placeholder:"Choose timezone..."}),e.jsx(yv,{children:e.jsx(wv,{children:bw.map(t=>e.jsxs(xv,{className:Wo("whitespace-nowrap text-left",{"text-green-500":n===t.value}),value:t.value,defaultValue:t.value,onSelect:e=>{const n=t.value;a(n),r.onChange&&"function"==typeof r.onChange&&r.onChange(n),s(!1)},children:[n===t.value&&e.jsx(cs,{className:Wo("mr-2 h-4 w-4 text-green-400",n===t.value?"opacity-100":"opacity-0")}),String(t.text).trim()]},t.value))})})]})})]})}const ww=({workspace:r})=>{const{updateUserProfile:n,getProfile:a}=qx(),[o,s]=t.useState(!1),[i,l]=t.useState(),[c,d]=t.useState(0),u=Ot({resolver:Oa(Bi({name:pi().min(2,{message:"Name must be at least 2 characters."}),country:pi().optional(),timezone:pi().optional(),language:pi().optional(),currency:pi().optional()})),defaultValues:{name:i?.name||"",country:i?.country||"",timezone:i?.timezone||"",language:i?.language||"",currency:i?.currency||""}});return t.useEffect(()=>{a().then(e=>{l(e),u.setValue("name",e.name),u.setValue("country",e.country),u.setValue("timezone",e.timezone),u.setValue("language",e.language),u.setValue("currency",e.currency)})},[c]),i?e.jsxs("div",{children:[e.jsx("div",{className:"space-y-4",children:e.jsx(Rs,{...u,children:e.jsxs("form",{onSubmit:u.handleSubmit(async function(e){s(!0),await n({name:e.name,country:e.country,timezone:e.timezone,language:e.language,currency:e.currency}),s(!1)}),className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium mb-1",children:"Email"}),e.jsx(Bs,{disabled:!0,className:"w-full border rounded px-3 py-2 bg-gray-100",value:i?.email})]}),e.jsx(Os,{disabled:o,control:u.control,name:"name",render:({field:t})=>e.jsxs(Ms,{children:[e.jsx(Us,{children:"Name"}),e.jsx(Ls,{children:e.jsx(Bs,{...t})}),e.jsx(zs,{})]})}),e.jsxs("div",{className:"flex gap-y-2 my-4 flex-col",children:[e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("div",{className:"text-sm font-medium",children:"Language"}),e.jsx(vw,{value:u.getValues("language"),onChange:e=>{u.setValue("language",e)}})]}),e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("div",{className:"text-sm font-medium",children:"Country"}),e.jsx(uw,{value:u.getValues("country"),onChange:e=>{u.setValue("country",e)}})]}),e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("div",{className:"text-sm font-medium",children:"Currency"}),e.jsx(pw,{value:u.getValues("currency"),onChange:e=>{u.setValue("currency",e)}})]}),e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("div",{className:"text-sm font-medium",children:"Timezone"}),e.jsx(yw,{value:u.getValues("timezone"),onChange:e=>{u.setValue("timezone",e)}})]})]}),e.jsxs("div",{className:"flex justify-end gap-x-2",children:[e.jsx(Es,{type:"submit",progress:o,disabled:o,children:"Save"}),e.jsx(Es,{type:"button",variant:"outline",onClick:()=>{d(e=>e+1)},disabled:o,children:"Reset"})]})]})})}),i?.image&&e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium mb-1",children:"Profile Image"}),e.jsx("div",{className:"w-16 h-16 rounded-full overflow-hidden",children:e.jsx("img",{src:i.image,alt:i.name,className:"w-full h-full object-cover"})})]})]}):e.jsx(fg,{})};var xw=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"});a.forwardRef((t,r)=>e.jsx(Cs.span,{...t,ref:r,style:{...xw,...t.style}})).displayName="VisuallyHidden";var Sw=[" ","Enter","ArrowUp","ArrowDown"],kw=[" ","Enter"],Aw="Select",[Ew,Cw,jw]=zm(Aw),[Tw,Nw]=Od(Aw,[jw,hy]),_w=hy(),[Rw,Pw]=Tw(Aw),[Ow,Dw]=Tw(Aw),Iw=t=>{const{__scopeSelect:r,children:n,open:o,defaultOpen:s,onOpenChange:i,value:l,defaultValue:c,onValueChange:d,dir:u,name:f,autoComplete:m,disabled:p,required:h,form:g}=t,v=_w(r),[b,y]=a.useState(null),[w,x]=a.useState(null),[S,k]=a.useState(!1),A=Vm(u),[E,C]=gu({prop:o,defaultProp:s??!1,onChange:i,caller:Aw}),[j,T]=gu({prop:l,defaultProp:c,onChange:d,caller:Aw}),N=a.useRef(null),_=!b||(g||!!b.closest("form")),[R,P]=a.useState(new Set),O=Array.from(R).map(e=>e.props.value).join(";");return e.jsx(Ry,{...v,children:e.jsxs(Rw,{required:h,scope:r,trigger:b,onTriggerChange:y,valueNode:w,onValueNodeChange:x,valueNodeHasChildren:S,onValueNodeHasChildrenChange:k,contentId:pu(),value:j,onValueChange:T,open:E,onOpenChange:C,dir:A,triggerPointerDownPosRef:N,disabled:p,children:[e.jsx(Ew.Provider,{scope:r,children:e.jsx(Ow,{scope:t.__scopeSelect,onNativeOptionAdd:a.useCallback(e=>{P(t=>new Set(t).add(e))},[]),onNativeOptionRemove:a.useCallback(e=>{P(t=>{const r=new Set(t);return r.delete(e),r})},[]),children:n})}),_?e.jsxs(yx,{"aria-hidden":!0,required:h,tabIndex:-1,name:f,autoComplete:m,value:j,onChange:e=>T(e.target.value),disabled:p,form:g,children:[void 0===j?e.jsx("option",{value:""}):null,Array.from(R)]},O):null]})})};Iw.displayName=Aw;var Mw="SelectTrigger",Uw=a.forwardRef((t,r)=>{const{__scopeSelect:n,disabled:o=!1,...s}=t,i=_w(n),l=Pw(Mw,n),c=l.disabled||o,d=Ko(r,l.onTriggerChange),u=Cw(n),f=a.useRef("touch"),[m,p,h]=xx(e=>{const t=u().filter(e=>!e.disabled),r=t.find(e=>e.value===l.value),n=Sx(t,e,r);void 0!==n&&l.onValueChange(n.value)}),g=e=>{c||(l.onOpenChange(!0),h()),e&&(l.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return e.jsx(Py,{asChild:!0,...i,children:e.jsx(Cs.button,{type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":wx(l.value)?"":void 0,...s,ref:d,onClick:uu(s.onClick,e=>{e.currentTarget.focus(),"mouse"!==f.current&&g(e)}),onPointerDown:uu(s.onPointerDown,e=>{f.current=e.pointerType;const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),0===e.button&&!1===e.ctrlKey&&"mouse"===e.pointerType&&(g(e),e.preventDefault())}),onKeyDown:uu(s.onKeyDown,e=>{const t=""!==m.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||p(e.key),t&&" "===e.key||Sw.includes(e.key)&&(g(),e.preventDefault())})})})});Uw.displayName=Mw;var Lw="SelectValue",Fw=a.forwardRef((t,r)=>{const{__scopeSelect:n,className:a,style:o,children:s,placeholder:i="",...l}=t,c=Pw(Lw,n),{onValueNodeHasChildrenChange:d}=c,u=void 0!==s,f=Ko(r,c.onValueNodeChange);return Ud(()=>{d(u)},[d,u]),e.jsx(Cs.span,{...l,ref:f,style:{pointerEvents:"none"},children:wx(c.value)?e.jsx(e.Fragment,{children:i}):s})});Fw.displayName=Lw;var zw=a.forwardRef((t,r)=>{const{__scopeSelect:n,children:a,...o}=t;return e.jsx(Cs.span,{"aria-hidden":!0,...o,ref:r,children:a||"▼"})});zw.displayName="SelectIcon";var Bw=t=>e.jsx(Iu,{asChild:!0,...t});Bw.displayName="SelectPortal";var Vw="SelectContent",Ww=a.forwardRef((t,r)=>{const n=Pw(Vw,t.__scopeSelect),[s,i]=a.useState();if(Ud(()=>{i(new DocumentFragment)},[]),!n.open){const r=s;return r?o.createPortal(e.jsx(Gw,{scope:t.__scopeSelect,children:e.jsx(Ew.Slot,{scope:t.__scopeSelect,children:e.jsx("div",{children:t.children})})}),r):null}return e.jsx(Zw,{...t,ref:r})});Ww.displayName=Vw;var $w=10,[Gw,Kw]=Tw(Vw),Hw=Ho("SelectContent.RemoveScroll"),Zw=a.forwardRef((t,r)=>{const{__scopeSelect:n,position:o="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:i,onPointerDownOutside:l,side:c,sideOffset:d,align:u,alignOffset:f,arrowPadding:m,collisionBoundary:p,collisionPadding:h,sticky:g,hideWhenDetached:v,avoidCollisions:b,...y}=t,w=Pw(Vw,n),[x,S]=a.useState(null),[k,A]=a.useState(null),E=Ko(r,e=>S(e)),[C,j]=a.useState(null),[T,N]=a.useState(null),_=Cw(n),[R,P]=a.useState(!1),O=a.useRef(!1);a.useEffect(()=>{if(x)return If(x)},[x]),Fu();const D=a.useCallback(e=>{const[t,...r]=_().map(e=>e.ref.current),[n]=r.slice(-1),a=document.activeElement;for(const r of e){if(r===a)return;if(r?.scrollIntoView({block:"nearest"}),r===t&&k&&(k.scrollTop=0),r===n&&k&&(k.scrollTop=k.scrollHeight),r?.focus(),document.activeElement!==a)return}},[_,k]),I=a.useCallback(()=>D([C,x]),[D,C,x]);a.useEffect(()=>{R&&I()},[R,I]);const{onOpenChange:M,triggerPointerDownPosRef:U}=w;a.useEffect(()=>{if(x){let e={x:0,y:0};const t=t=>{e={x:Math.abs(Math.round(t.pageX)-(U.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(U.current?.y??0))}},r=r=>{e.x<=10&&e.y<=10?r.preventDefault():x.contains(r.target)||M(!1),document.removeEventListener("pointermove",t),U.current=null};return null!==U.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",r,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",r,{capture:!0})}}},[x,M,U]),a.useEffect(()=>{const e=()=>M(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[M]);const[L,F]=xx(e=>{const t=_().filter(e=>!e.disabled),r=t.find(e=>e.ref.current===document.activeElement),n=Sx(t,e,r);n&&setTimeout(()=>n.ref.current.focus())}),z=a.useCallback((e,t,r)=>{const n=!O.current&&!r;(void 0!==w.value&&w.value===t||n)&&(j(e),n&&(O.current=!0))},[w.value]),B=a.useCallback(()=>x?.focus(),[x]),V=a.useCallback((e,t,r)=>{const n=!O.current&&!r;(void 0!==w.value&&w.value===t||n)&&N(e)},[w.value]),W="popper"===o?Jw:qw,$=W===Jw?{side:c,sideOffset:d,align:u,alignOffset:f,arrowPadding:m,collisionBoundary:p,collisionPadding:h,sticky:g,hideWhenDetached:v,avoidCollisions:b}:{};return e.jsx(Gw,{scope:n,content:x,viewport:k,onViewportChange:A,itemRefCallback:z,selectedItem:C,onItemLeave:B,itemTextRefCallback:V,focusSelectedItem:I,selectedItemText:T,position:o,isPositioned:R,searchRef:L,children:e.jsx(Tf,{as:Hw,allowPinchZoom:!0,children:e.jsx(Tu,{asChild:!0,trapped:w.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:uu(s,e=>{w.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:e.jsx(Su,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>w.onOpenChange(!1),children:e.jsx(W,{role:"listbox",id:w.contentId,"data-state":w.open?"open":"closed",dir:w.dir,onContextMenu:e=>e.preventDefault(),...y,...$,onPlaced:()=>P(!0),ref:E,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:uu(y.onKeyDown,e=>{const t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||F(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=_().filter(e=>!e.disabled).map(e=>e.ref.current);if(["ArrowUp","End"].includes(e.key)&&(t=t.slice().reverse()),["ArrowUp","ArrowDown"].includes(e.key)){const r=e.target,n=t.indexOf(r);t=t.slice(n+1)}setTimeout(()=>D(t)),e.preventDefault()}})})})})})})});Zw.displayName="SelectContentImpl";var qw=a.forwardRef((t,r)=>{const{__scopeSelect:n,onPlaced:o,...s}=t,i=Pw(Vw,n),l=Kw(Vw,n),[c,d]=a.useState(null),[u,f]=a.useState(null),m=Ko(r,e=>f(e)),p=Cw(n),h=a.useRef(!1),g=a.useRef(!0),{viewport:v,selectedItem:b,selectedItemText:y,focusSelectedItem:w}=l,x=a.useCallback(()=>{if(i.trigger&&i.valueNode&&c&&u&&v&&b&&y){const e=i.trigger.getBoundingClientRect(),t=u.getBoundingClientRect(),r=i.valueNode.getBoundingClientRect(),n=y.getBoundingClientRect();if("rtl"!==i.dir){const a=n.left-t.left,o=r.left-a,s=e.left-o,i=e.width+s,l=Math.max(i,t.width),d=window.innerWidth-$w,u=Mp(o,[$w,Math.max($w,d-l)]);c.style.minWidth=i+"px",c.style.left=u+"px"}else{const a=t.right-n.right,o=window.innerWidth-r.right-a,s=window.innerWidth-e.right-o,i=e.width+s,l=Math.max(i,t.width),d=window.innerWidth-$w,u=Mp(o,[$w,Math.max($w,d-l)]);c.style.minWidth=i+"px",c.style.right=u+"px"}const a=p(),s=window.innerHeight-2*$w,l=v.scrollHeight,d=window.getComputedStyle(u),f=parseInt(d.borderTopWidth,10),m=parseInt(d.paddingTop,10),g=parseInt(d.borderBottomWidth,10),w=f+m+l+parseInt(d.paddingBottom,10)+g,x=Math.min(5*b.offsetHeight,w),S=window.getComputedStyle(v),k=parseInt(S.paddingTop,10),A=parseInt(S.paddingBottom,10),E=e.top+e.height/2-$w,C=s-E,j=b.offsetHeight/2,T=f+m+(b.offsetTop+j),N=w-T;if(T<=E){const e=a.length>0&&b===a[a.length-1].ref.current;c.style.bottom="0px";const t=u.clientHeight-v.offsetTop-v.offsetHeight,r=T+Math.max(C,j+(e?A:0)+t+g);c.style.height=r+"px"}else{const e=a.length>0&&b===a[0].ref.current;c.style.top="0px";const t=Math.max(E,f+v.offsetTop+(e?k:0)+j)+N;c.style.height=t+"px",v.scrollTop=T-E+v.offsetTop}c.style.margin=`${$w}px 0`,c.style.minHeight=x+"px",c.style.maxHeight=s+"px",o?.(),requestAnimationFrame(()=>h.current=!0)}},[p,i.trigger,i.valueNode,c,u,v,b,y,i.dir,o]);Ud(()=>x(),[x]);const[S,k]=a.useState();Ud(()=>{u&&k(window.getComputedStyle(u).zIndex)},[u]);const A=a.useCallback(e=>{e&&!0===g.current&&(x(),w?.(),g.current=!1)},[x,w]);return e.jsx(Yw,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:h,onScrollButtonChange:A,children:e.jsx("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:e.jsx(Cs.div,{...s,ref:m,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});qw.displayName="SelectItemAlignedPosition";var Jw=a.forwardRef((t,r)=>{const{__scopeSelect:n,align:a="start",collisionPadding:o=$w,...s}=t,i=_w(n);return e.jsx(Oy,{...i,...s,ref:r,align:a,collisionPadding:o,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Jw.displayName="SelectPopperPosition";var[Yw,Xw]=Tw(Vw,{}),Qw="SelectViewport",ex=a.forwardRef((t,r)=>{const{__scopeSelect:n,nonce:o,...s}=t,i=Kw(Qw,n),l=Xw(Qw,n),c=Ko(r,i.onViewportChange),d=a.useRef(0);return e.jsxs(e.Fragment,{children:[e.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),e.jsx(Ew.Slot,{scope:n,children:e.jsx(Cs.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:uu(s.onScroll,e=>{const t=e.currentTarget,{contentWrapper:r,shouldExpandOnScrollRef:n}=l;if(n?.current&&r){const e=Math.abs(d.current-t.scrollTop);if(e>0){const n=window.innerHeight-2*$w,a=parseFloat(r.style.minHeight),o=parseFloat(r.style.height),s=Math.max(a,o);if(s<n){const a=s+e,o=Math.min(n,a),i=a-o;r.style.height=o+"px","0px"===r.style.bottom&&(t.scrollTop=i>0?i:0,r.style.justifyContent="flex-end")}}}d.current=t.scrollTop})})})]})});ex.displayName=Qw;var tx="SelectGroup",[rx,nx]=Tw(tx);a.forwardRef((t,r)=>{const{__scopeSelect:n,...a}=t,o=pu();return e.jsx(rx,{scope:n,id:o,children:e.jsx(Cs.div,{role:"group","aria-labelledby":o,...a,ref:r})})}).displayName=tx;var ax="SelectLabel",ox=a.forwardRef((t,r)=>{const{__scopeSelect:n,...a}=t,o=nx(ax,n);return e.jsx(Cs.div,{id:o.id,...a,ref:r})});ox.displayName=ax;var sx="SelectItem",[ix,lx]=Tw(sx),cx=a.forwardRef((t,r)=>{const{__scopeSelect:n,value:o,disabled:s=!1,textValue:i,...l}=t,c=Pw(sx,n),d=Kw(sx,n),u=c.value===o,[f,m]=a.useState(i??""),[p,h]=a.useState(!1),g=Ko(r,e=>d.itemRefCallback?.(e,o,s)),v=pu(),b=a.useRef("touch"),y=()=>{s||(c.onValueChange(o),c.onOpenChange(!1))};if(""===o)throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return e.jsx(ix,{scope:n,value:o,disabled:s,textId:v,isSelected:u,onItemTextChange:a.useCallback(e=>{m(t=>t||(e?.textContent??"").trim())},[]),children:e.jsx(Ew.ItemSlot,{scope:n,value:o,disabled:s,textValue:f,children:e.jsx(Cs.div,{role:"option","aria-labelledby":v,"data-highlighted":p?"":void 0,"aria-selected":u&&p,"data-state":u?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...l,ref:g,onFocus:uu(l.onFocus,()=>h(!0)),onBlur:uu(l.onBlur,()=>h(!1)),onClick:uu(l.onClick,()=>{"mouse"!==b.current&&y()}),onPointerUp:uu(l.onPointerUp,()=>{"mouse"===b.current&&y()}),onPointerDown:uu(l.onPointerDown,e=>{b.current=e.pointerType}),onPointerMove:uu(l.onPointerMove,e=>{b.current=e.pointerType,s?d.onItemLeave?.():"mouse"===b.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:uu(l.onPointerLeave,e=>{e.currentTarget===document.activeElement&&d.onItemLeave?.()}),onKeyDown:uu(l.onKeyDown,e=>{""!==d.searchRef?.current&&" "===e.key||(kw.includes(e.key)&&y()," "===e.key&&e.preventDefault())})})})})});cx.displayName=sx;var dx="SelectItemText",ux=a.forwardRef((t,r)=>{const{__scopeSelect:n,className:s,style:i,...l}=t,c=Pw(dx,n),d=Kw(dx,n),u=lx(dx,n),f=Dw(dx,n),[m,p]=a.useState(null),h=Ko(r,e=>p(e),u.onItemTextChange,e=>d.itemTextRefCallback?.(e,u.value,u.disabled)),g=m?.textContent,v=a.useMemo(()=>e.jsx("option",{value:u.value,disabled:u.disabled,children:g},u.value),[u.disabled,u.value,g]),{onNativeOptionAdd:b,onNativeOptionRemove:y}=f;return Ud(()=>(b(v),()=>y(v)),[b,y,v]),e.jsxs(e.Fragment,{children:[e.jsx(Cs.span,{id:u.textId,...l,ref:h}),u.isSelected&&c.valueNode&&!c.valueNodeHasChildren?o.createPortal(l.children,c.valueNode):null]})});ux.displayName=dx;var fx="SelectItemIndicator",mx=a.forwardRef((t,r)=>{const{__scopeSelect:n,...a}=t;return lx(fx,n).isSelected?e.jsx(Cs.span,{"aria-hidden":!0,...a,ref:r}):null});mx.displayName=fx;var px="SelectScrollUpButton";a.forwardRef((t,r)=>{const n=Kw(px,t.__scopeSelect),o=Xw(px,t.__scopeSelect),[s,i]=a.useState(!1),l=Ko(r,o.onScrollButtonChange);return Ud(()=>{if(n.viewport&&n.isPositioned){let e=function(){const e=t.scrollTop>0;i(e)};const t=n.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[n.viewport,n.isPositioned]),s?e.jsx(gx,{...t,ref:l,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null}).displayName=px;var hx="SelectScrollDownButton";a.forwardRef((t,r)=>{const n=Kw(hx,t.__scopeSelect),o=Xw(hx,t.__scopeSelect),[s,i]=a.useState(!1),l=Ko(r,o.onScrollButtonChange);return Ud(()=>{if(n.viewport&&n.isPositioned){let e=function(){const e=t.scrollHeight-t.clientHeight,r=Math.ceil(t.scrollTop)<e;i(r)};const t=n.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[n.viewport,n.isPositioned]),s?e.jsx(gx,{...t,ref:l,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null}).displayName=hx;var gx=a.forwardRef((t,r)=>{const{__scopeSelect:n,onAutoScroll:o,...s}=t,i=Kw("SelectScrollButton",n),l=a.useRef(null),c=Cw(n),d=a.useCallback(()=>{null!==l.current&&(window.clearInterval(l.current),l.current=null)},[]);return a.useEffect(()=>()=>d(),[d]),Ud(()=>{const e=c().find(e=>e.ref.current===document.activeElement);e?.ref.current?.scrollIntoView({block:"nearest"})},[c]),e.jsx(Cs.div,{"aria-hidden":!0,...s,ref:r,style:{flexShrink:0,...s.style},onPointerDown:uu(s.onPointerDown,()=>{null===l.current&&(l.current=window.setInterval(o,50))}),onPointerMove:uu(s.onPointerMove,()=>{i.onItemLeave?.(),null===l.current&&(l.current=window.setInterval(o,50))}),onPointerLeave:uu(s.onPointerLeave,()=>{d()})})}),vx=a.forwardRef((t,r)=>{const{__scopeSelect:n,...a}=t;return e.jsx(Cs.div,{"aria-hidden":!0,...a,ref:r})});vx.displayName="SelectSeparator";var bx="SelectArrow";a.forwardRef((t,r)=>{const{__scopeSelect:n,...a}=t,o=_w(n),s=Pw(bx,n),i=Kw(bx,n);return s.open&&"popper"===i.position?e.jsx(Dy,{...o,...a,ref:r}):null}).displayName=bx;var yx=a.forwardRef(({__scopeSelect:t,value:r,...n},o)=>{const s=a.useRef(null),i=Ko(o,s),l=lp(r);return a.useEffect(()=>{const e=s.current;if(!e)return;const t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,"value").set;if(l!==r&&n){const t=new Event("change",{bubbles:!0});n.call(e,r),e.dispatchEvent(t)}},[l,r]),e.jsx(Cs.select,{...n,style:{...xw,...n.style},ref:i,defaultValue:r})});function wx(e){return""===e||void 0===e}function xx(e){const t=Id(e),r=a.useRef(""),n=a.useRef(0),o=a.useCallback(e=>{const a=r.current+e;t(a),function e(t){r.current=t,window.clearTimeout(n.current),""!==t&&(n.current=window.setTimeout(()=>e(""),1e3))}(a)},[t]),s=a.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return a.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,o,s]}function Sx(e,t,r){const n=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,a=r?e.indexOf(r):-1;let o=function(e,t){return e.map((r,n)=>e[(t+n)%e.length])}(e,Math.max(a,0));1===n.length&&(o=o.filter(e=>e!==r));const s=o.find(e=>e.textValue.toLowerCase().startsWith(n.toLowerCase()));return s!==r?s:void 0}yx.displayName="SelectBubbleInput";var kx=Uw,Ax=zw,Ex=Bw,Cx=Ww,jx=ex,Tx=ox,Nx=cx,_x=ux,Rx=mx,Px=vx;const Ox=Iw,Dx=a.forwardRef(({className:t,children:r,...n},a)=>e.jsxs(kx,{ref:a,className:Wo("flex h-9 w-full items-center justify-between rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50",t),...n,children:[r,e.jsx(Ax,{asChild:!0,children:e.jsx(Em,{className:"h-4 w-4 opacity-50"})})]}));Dx.displayName=kx.displayName;const Ix=a.forwardRef(({className:t,children:r,position:n="popper",...o},s)=>{const{container:i}=a.useContext(ae);return e.jsx(Ex,{container:i,children:e.jsx(Cx,{ref:s,className:Wo("relative z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2","popper"===n&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:n,...o,children:e.jsx(jx,{className:Wo("p-1","popper"===n&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:r})})})});Ix.displayName=Cx.displayName;a.forwardRef(({className:t,...r},n)=>e.jsx(Tx,{ref:n,className:Wo("px-2 py-1.5 text-sm font-semibold",t),...r})).displayName=Tx.displayName;const Mx=a.forwardRef(({className:t,children:r,...n},a)=>e.jsxs(Nx,{ref:a,className:Wo("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...n,children:[e.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(Rx,{children:e.jsx(jm,{className:"h-4 w-4"})})}),e.jsx(_x,{children:r})]}));Mx.displayName=Nx.displayName;a.forwardRef(({className:t,...r},n)=>e.jsx(Px,{ref:n,className:Wo("-mx-1 my-1 h-px bg-muted",t),...r})).displayName=Px.displayName;const Ux=({workspace:r})=>{const n=Q(e=>e.auth.session?.user||null),[a,o]=t.useState(0),[s,i]=t.useState(!1),[l,c]=t.useState([]),{getUsers:d,removeUser:u,updateUser:f}=qx(),{settings:m}=jh();t.useEffect(()=>{r&&(i(!0),d(r._id).then(e=>{c(e)}).catch(e=>{console.error(e)}).finally(()=>{i(!1)}))},[r,a]);const p=()=>{o(e=>e+1)};if(s||!r)return e.jsx(fg,{});const h=e=>"string"==typeof e?{name:"Unknown User",email:e,id:e,role:"-"}:{name:e.name,email:e.email,id:e._id},g=l.map(e=>({...e,...h(e.user)})),v=l.find(e=>("string"==typeof e.user?e.user:e.user._id)===n?.id)?.role,b="admin"===v,y=(m?.workspace.maxWorkspaceUsers??Number.MAX_VALUE)>(l.length??0);return e.jsxs("div",{children:[!b&&e.jsx("div",{className:"text-red-500",children:"Only workspace admin can manage users and roles."}),b&&e.jsxs("div",{className:"mb-4",children:[y&&e.jsx(Lx,{onInvite:p,workspaceId:r._id}),!y&&e.jsx("div",{className:"text-red-500",children:"You have reached the maximum number of users for this workspace."})]}),e.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[e.jsx("div",{children:e.jsxs("div",{className:"text-sm text-gray-600 mb-2",children:[l.length," member",1!==l.length?"s":""]})}),e.jsx("div",{children:e.jsx(Es,{variant:"ghost",size:"sm",onClick:p,progress:s,startIcon:e.jsx(ps,{}),children:"Refresh"})})]}),e.jsx("ul",{className:"space-y-2",children:g.map((t,a)=>{const o=t.id===n?.id,s=("object"==typeof r.createdBy&&null!==r.createdBy?r.createdBy._id:r.createdBy)===t.id;return e.jsxs("li",{className:"flex items-center justify-between border rounded p-3",children:[e.jsxs("div",{className:"flex items-center space-x-3",children:[e.jsx("div",{className:"w-8 h-8 bg-gray-200 rounded-full flex items-center justify-center text-sm font-medium",children:t.name.charAt(0).toUpperCase()}),e.jsxs("div",{children:[e.jsx("div",{className:"font-medium",children:t.name}),e.jsx("div",{className:"text-xs text-gray-500",children:t.email})]})]}),e.jsxs("div",{className:"flex items-center gap-x-1",children:[e.jsx("div",{children:e.jsxs(Ox,{disabled:o||!b||s,value:t.role,onValueChange:e=>{return n=r._id,a=t.id,o=e,void(("object"==typeof r.createdBy&&null!==r.createdBy?r.createdBy._id:r.createdBy)!==a?f(n,a,{role:o}).then(()=>{p()}):console.error("Cannot change the role of the workspace owner"));var n,a,o},children:[e.jsx(Dx,{children:e.jsx(Fw,{placeholder:"Select a role"})}),e.jsx(Ix,{children:r?.roles.map(t=>e.jsx(Mx,{value:t,children:t},t))})]})}),o&&e.jsx("span",{className:"text-xs bg-blue-100 text-blue-800 px-2 py-1 rounded",children:"You"}),s&&e.jsx("span",{className:"text-xs bg-purple-100 text-purple-800 px-2 py-1 rounded",children:"Owner"}),!o&&!s&&b&&e.jsx(Es,{variant:"destructive",size:"sm",startIcon:e.jsx(ws,{}),onClick:()=>{var e;e=t.id,("object"==typeof r.createdBy&&null!==r.createdBy?r.createdBy._id:r.createdBy)!==e?u(r._id,e).then(()=>{p()}):console.error("Cannot remove the workspace owner")}})]})]},a)})}),0===l.length&&e.jsx("div",{className:"text-center py-8 text-gray-500",children:"No members found in this workspace."})]})};function Lx({onInvite:r,workspaceId:n}){const[a,o]=t.useState(""),[s,i]=t.useState("admin"),[l,c]=t.useState(!1),[d,u]=t.useState(null),[f,m]=t.useState(null),{addUser:p,getWorkspace:h}=qx(),[g,v]=t.useState(null),{settings:b}=jh(),y=b?.workspace.roles??g?.roles??[];t.useEffect(()=>{n&&h(n).then(v)},[n]);const w=()=>{u(null),m(null),o(""),i("admin")};return e.jsxs("div",{className:"flex gap-2 flex-col gap-y-2",children:[d&&e.jsx("div",{className:"text-red-500 capitalize",children:d}),f&&e.jsx("div",{className:"text-green-500 capitalize",children:f}),e.jsxs("div",{children:[e.jsx(_s,{children:"Invite member by email"}),e.jsx(Bs,{type:"email",value:a,onChange:e=>o(e.target.value),placeholder:"example@example.com"})]}),e.jsxs("div",{children:[e.jsx(_s,{children:"Role"}),e.jsxs(Ox,{value:s,onValueChange:i,children:[e.jsx(Dx,{children:e.jsx(Fw,{placeholder:"Select a role"})}),e.jsx(Ix,{children:y.map(t=>e.jsx(Mx,{value:t,children:t},t))})]})]}),e.jsx("div",{children:e.jsx(Es,{progress:l,onClick:async()=>{const e=a.trim();if(!e)return void u("Email is required");/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)?(c(!0),await p(n,e,s).then(()=>{m("User invited successfully"),r?.()}).catch(e=>{console.error(e),u(e.message||"Failed to invite member")}).finally(()=>{c(!1),setTimeout(()=>{w()},6e3)})):u("Invalid email address format")},disabled:l||!a||!s,children:l?"Inviting...":`Invite as ${s}`})})]})}const Fx=({workspace:t,section:r,setSection:n})=>{const a=Q(e=>e.auth.session?.user||null),o=("object"==typeof t.createdBy&&null!==t.createdBy?t.createdBy._id:t.createdBy)===a?.id;return e.jsxs("div",{className:"w-56 h-full flex flex-col space-y-6",children:[t&&e.jsx("div",{className:"border-b p-2 py-4",children:e.jsxs("div",{className:"flex items-center gap-x-2",children:[t.image&&e.jsx("div",{className:"bg-blue-100 rounded flex items-center justify-center text-blue-600 font-medium px-0.5 py-0.5",style:{width:"40px",height:"40px",minWidth:"40px",minHeight:"40px"},children:e.jsx("img",{src:t.image,className:"w-full h-full object-contain",style:{width:"36px",height:"36px",maxWidth:"36px",maxHeight:"36px",objectFit:"contain"}})}),e.jsxs("div",{className:Wo("flex-1 min-w-0",t.image?"":"pl-2"),children:[e.jsx("div",{className:"font-medium text-sm line-clamp-1 text-ellipsis overflow-hidden",children:t.name}),e.jsx("div",{className:"text-xs text-gray-500",children:t.workspaceId})]})]})}),e.jsx(zx,{title:"Account",children:e.jsx(Bx,{activeSection:r,icon:e.jsx(Ss,{className:"h-3.5 w-3.5"}),label:"Profile",section:"profile",onClick:()=>n("profile")})}),e.jsxs(zx,{title:"Workspace",children:[e.jsx(Bx,{activeSection:r,icon:e.jsx(gs,{className:"h-3.5 w-3.5"}),label:"General",section:"general",onClick:()=>n("general")}),e.jsx(Bx,{activeSection:r,icon:e.jsx(ks,{className:"h-3.5 w-3.5"}),label:"Users",section:"users",onClick:()=>n("users")}),e.jsx(Bx,{activeSection:r,icon:e.jsx(bs,{className:"h-3.5 w-3.5"}),label:"Features",section:"features",onClick:()=>n("features")}),o&&e.jsx(Bx,{activeSection:r,icon:e.jsx(xs,{className:"h-3.5 w-3.5"}),label:"Danger Zone",section:"danger",onClick:()=>n("danger")})]})]})};function zx({title:t,children:r}){return e.jsxs("div",{className:"px-2 flex flex-col space-y-1",children:[e.jsx("div",{className:"text-xs font-bold mb-2 text-gray-500 uppercase tracking-wide px-2",children:t}),r]})}function Bx({icon:t,label:r,section:n,onClick:a,activeSection:o}){return e.jsxs("button",{className:Wo("flex w-full text-left px-2 py-1 rounded text-sm items-center gap-x-1",n===o?"bg-blue-100 text-blue-700 font-medium":"hover:bg-gray-200 hover:text-gray-700"),onClick:()=>a(n),children:[t,r]})}const Vx=({workspace:r,onClose:n})=>{const[a,o]=t.useState(!1),[s,i]=t.useState("profile");return r?e.jsxs(Pm,{open:a,onOpenChange:e=>{o(e),e||n()},children:[e.jsx(Om,{asChild:!0,children:e.jsx(Es,{variant:"outline",size:"icon",children:e.jsx(gs,{className:"h-4 w-4"})})}),e.jsxs(Mm,{className:"flex max-w-2xl min-w-full sm:min-w-[800px] p-0 m-0 bg-muted sm:min-h-[600px] min-h-full gap-x-0 space-x-0",children:[e.jsx(Fm,{className:"sr-only",children:"Workspace settings dialog"}),e.jsx(Fx,{workspace:r,section:s,setSection:i}),e.jsxs("div",{className:"flex-1 p-6 overflow-auto flex flex-col bg-background",children:[e.jsxs(Lm,{className:"text-xl font-bold mb-4 capitalize",children:["profile"===s&&"Account","general"===s&&"Workspace Settings","users"===s&&"Workspace Members","features"===s&&"Workspace Features","danger"===s&&"Danger Zone"]}),e.jsxs("div",{className:"max-h-[500px] overflow-y-auto",children:["profile"===s&&e.jsx(ww,{workspace:r}),"general"===s&&e.jsx(_g,{workspace:r}),"users"===s&&e.jsx(Ux,{workspace:r}),"features"===s&&e.jsx(jg,{workspaceId:r._id?.toString()}),"danger"===s&&e.jsx(mg,{workspace:r})]})]})]})]}):null};function Wx(r){const{workspaces:n,currentWorkspace:a,loading:o,refreshing:s}=Q(e=>e.workspaces),i=Q(e=>e.auth.session?.user),{settings:l}=jh(),[c,d]=t.useState(!1),[u,f]=t.useState(0),[m,p]=t.useState(""),{fetchWorkspaces:h,getFeatures:g,refreshWorkspaces:v,setCurrentWorkspace:b,workspaces:y}=qx(),w=o||s;t.useEffect(()=>{0===y.length?(h(),g()):g()},[]),t.useEffect(()=>{u>0&&v()},[u]);const x=y.length>0?y:n,S=x.filter(e=>e._id!==a?._id).filter(e=>e.name.toLowerCase().includes(m.toLowerCase())),k=l?.workspace.maxWorkspaces??Number.MAX_VALUE,A=x?.filter(e=>("object"==typeof e.createdBy?e.createdBy._id?.toString():e.createdBy?.toString())===i?.id?.toString()).length,E=k>(A??0);return e.jsxs(Pm,{open:c,onOpenChange:d,children:[e.jsx(Om,{children:r.trigger?.(w,a)}),e.jsxs(Mm,{className:"max-w-2xl min-w-full sm:min-w-[800px]",children:[e.jsxs(Um,{children:[e.jsxs(Lm,{className:"flex items-center gap-2",children:[e.jsx(ls,{className:"h-5 w-5"}),"Switch Workspace"]}),e.jsx(Fm,{children:"Select a workspace to switch to or create a new one."})]}),!i&&e.jsx("div",{className:"flex flex-col items-center justify-center h-full py-4 sm:py-8",children:e.jsx("div",{className:"text-sm font-medium text-muted-foreground",children:"Looks like you are not logged in. Please login to continue."})}),i&&e.jsxs("div",{className:"flex flex-col gap-4",children:[a&&e.jsx($x,{workspace:a,isCurrentWorkspace:!0,onWorkspaceChange:r.onWorkspaceChange,onClose:()=>d(!1),setCurrentWorkspace:b,setOpen:d,workspacesToUse:x}),e.jsx(Ch,{}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"text-sm font-medium text-muted-foreground",children:["Available Workspaces (",S.length,")"]}),e.jsx("div",{children:e.jsx(Es,{progress:s,disabled:s,variant:"ghost",onClick:function(){f(e=>e+1)},startIcon:e.jsx(ps,{}),children:s?"Refreshing...":"Refresh"})})]}),e.jsxs("div",{className:"relative",children:[e.jsx(hs,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground pointer-events-none"}),e.jsx(Bs,{placeholder:"Search workspaces...",value:m,onChange:e=>p(e.target.value),className:"pl-10"})]}),o?e.jsxs("div",{className:"flex items-center justify-center py-8",children:[e.jsx(fs,{className:"h-6 w-6 animate-spin text-muted-foreground"}),e.jsx("span",{className:"ml-2 text-sm text-muted-foreground",children:"Loading workspaces..."})]}):0===S.length?e.jsxs("div",{className:"text-center py-8",children:[e.jsx(ls,{className:"mx-auto h-12 w-12 text-muted-foreground"}),e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:m?"No workspaces found":"No workspaces available"})]}):e.jsx(wh,{className:"h-64",children:e.jsx("div",{className:"flex flex-col gap-2 my-2.5",children:S.map(t=>{const n=t._id===a?._id;return e.jsx($x,{workspace:t,isCurrentWorkspace:n,onWorkspaceChange:r.onWorkspaceChange,onClose:()=>d(!1),setCurrentWorkspace:b,setOpen:d,workspacesToUse:x},t._id)})})})]}),E&&e.jsxs(e.Fragment,{children:[e.jsx(Ch,{}),e.jsx(Gx,{onCreated:()=>{h()}})]})]})]})]})}function $x(t){const{workspace:r,setCurrentWorkspace:n,setOpen:a,workspacesToUse:o}=t,s=t.isCurrentWorkspace??!1;return e.jsxs("div",{className:Wo("flex items-center gap-3 rounded-lg border-2 p-3 border-border",{"bg-muted text-muted-foreground":s}),children:[e.jsxs(lu,{className:"h-8 w-8 flex items-center justify-center",children:[e.jsx("div",{children:e.jsx(cu,{src:r.image})}),e.jsx(du,{children:(i=r.name,i.split(" ").map(e=>e[0]).join("").toUpperCase().slice(0,2))})]}),e.jsxs("div",{className:"flex-1 min-w-0 max-w-full",children:[e.jsx("div",{className:"flex items-center gap-2",children:e.jsx("span",{className:"font-medium line-clamp-1 text-ellipsis overflow-hidden max-w-full",children:r.name})}),e.jsxs("div",{className:"flex items-center gap-1 text-sm text-muted-foreground",children:[e.jsx(ks,{className:"h-3 w-3"}),e.jsxs("span",{children:[r.users?.length||0," members"]})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[s?null:e.jsx(Es,{size:"sm",onClick:()=>{t.onWorkspaceChange(r).then(()=>{n(r),a(!1)})},children:"Switch to"}),e.jsx(Vx,{workspace:r,onClose:()=>{if(s){const e=o.findIndex(e=>e._id?.toString()===r._id?.toString());-1!==e&&n(o[e])}}})]})]});var i}function Gx(r){const[n,a]=t.useState(!1),[o,s]=t.useState("emoji"),[i,l]=t.useState("🏢"),[c,d]=t.useState(!1),{createWorkspace:u}=qx(),f=Ot({resolver:Oa(Bi({name:pi().min(2,{message:"Workspace name must be at least 2 characters."}),image:pi().optional()})),defaultValues:{name:"",image:""}});return e.jsxs(Pm,{open:n,onOpenChange:a,children:[e.jsx(Om,{asChild:!0,children:e.jsxs(Es,{className:"w-full rounded-none",children:[e.jsx(ms,{className:"h-4 w-4 mr-2"}),"Create New Workspace"]})}),e.jsxs(Mm,{className:"max-w-xl min-w-full sm:min-w-[600px]",children:[e.jsxs(Um,{children:[e.jsx(Lm,{children:"Create New Workspace"}),e.jsx(Fm,{children:"Create a new workspace to get started."})]}),e.jsx(Rs,{...f,children:e.jsxs("form",{onSubmit:f.handleSubmit(async function(e){let t="";if("emoji"===o)t=Tg(i);else if("url"===o&&e.image)try{new URL(e.image),t=e.image}catch{return void f.setError("image",{message:"Please enter a valid URL"})}d(!0);try{await u(e.name,t),a(!1),f.reset(),l("🏢"),s("emoji"),r?.onCreated?.()}catch(e){console.error("Failed to create workspace:",e)}finally{d(!1)}}),children:[e.jsx(Os,{control:f.control,name:"name",render:({field:t})=>e.jsxs(Ms,{children:[e.jsx(Us,{children:"Workspace Name"}),e.jsx(Ls,{children:e.jsx(Bs,{placeholder:"My Awesome Workspace",...t})}),e.jsx(zs,{})]})}),e.jsxs("div",{className:"flex flex-col gap-y-2 my-2",children:[e.jsxs("div",{children:[e.jsx(_s,{className:"text-sm font-medium",children:"Workspace Icon"}),e.jsx(Fs,{children:"Choose an emoji or upload a custom image for your workspace."})]}),e.jsxs(Dp,{value:o,onValueChange:e=>s(e),className:"flex flex-col gap-y-2",children:[e.jsxs("div",{className:"flex items-center gap-x-2 my-1",children:[e.jsx(Ip,{value:"emoji",id:"emoji"}),e.jsxs(_s,{htmlFor:"emoji",className:"flex items-center gap-2",children:[e.jsx(vs,{className:"h-4 w-4"}),"Choose Emoji"]})]}),e.jsxs("div",{className:"flex items-center gap-x-2 my-1",children:[e.jsx(Ip,{value:"url",id:"url"}),e.jsxs(_s,{htmlFor:"url",className:"flex items-center gap-2",children:[e.jsx(us,{className:"h-4 w-4"}),"Custom Image URL"]})]})]}),"emoji"===o&&e.jsxs("div",{className:"flex flex-col gap-y-2",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm font-medium",children:"Preview:"}),e.jsx("div",{className:"w-12 h-12 rounded-lg border-2 border-border flex items-center justify-center text-2xl bg-muted",children:i})]}),e.jsx(wh,{className:"h-32 w-full rounded-md border",children:e.jsx("div",{className:"p-4 grid grid-cols-8 gap-2",children:Ng.map((t,r)=>e.jsx("button",{type:"button",onClick:()=>(e=>{l(e),f.setValue("image",Tg(e))})(t),className:"w-8 h-8 rounded flex items-center justify-center text-lg hover:bg-muted transition-colors "+(i===t?"bg-primary text-primary-foreground":""),children:t},r))})})]}),"url"===o&&e.jsxs("div",{className:"flex flex-col gap-y-2",children:[e.jsx(Os,{control:f.control,name:"image",render:({field:t})=>e.jsxs(Ms,{children:[e.jsx(Us,{children:"Image URL"}),e.jsx(Ls,{children:e.jsx(Bs,{placeholder:"https://example.com/image.png",...t})}),e.jsx(Fs,{children:"Enter a valid URL for your workspace image. Supports PNG, JPG, and SVG formats."}),e.jsx(zs,{})]})}),f.watch("image")&&e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm font-medium",children:"Preview:"}),e.jsx("div",{className:"w-12 h-12 rounded-lg border-2 border-border overflow-hidden bg-muted",children:e.jsx("img",{src:f.watch("image"),alt:"Workspace preview",className:"w-full h-full object-cover",onError:e=>{e.currentTarget.style.display="none"}})})]})]})]}),e.jsxs("div",{className:"flex justify-end gap-3 pt-4",children:[e.jsx(Es,{type:"button",variant:"outline",onClick:()=>{a(!1),f.reset(),l("🏢"),s("emoji")},disabled:c,children:"Cancel"}),e.jsx(Es,{type:"submit",disabled:c,children:c?e.jsxs(e.Fragment,{children:[e.jsx(fs,{className:"mr-2 h-4 w-4 animate-spin"}),"Creating..."]}):"Create Workspace"})]})]})})]})]})}const Kx="saas-workspace-current",Hx=()=>f(Kx),Zx=(e,t)=>!!e&&t.some(t=>t._id===e),qx=()=>{const e=ee(),r=Q(e=>e.os),n=t.useMemo(()=>new Pd(r),[r]),a=Q(e=>e.workspaces),o=Q(e=>e.auth.session?.user),s=t.useCallback(t=>{if(t._id!==a.currentWorkspace?._id&&t){const r=a.currentWorkspace;e.workspaces(F(t)),ne.emitWorkspaceChanged(t,r).catch(e=>{console.error("Error emitting workspace changed event:",e)})}},[a.currentWorkspace,e]);t.useEffect(()=>{if(!a.isInitialized){const t=Hx();if(e.workspaces(B(!0)),t){const e=a.workspaces.find(e=>e._id===t);if(e){if(e._id===a.currentWorkspace?._id)return;s(e)}}}},[a.isInitialized,a.workspaces,a.currentWorkspace,e,s]);const i=t.useCallback(()=>{e.workspaces(z())},[e]),l=t.useRef(!1),c=t.useRef(!1),d=t.useCallback(async()=>{if(!a.loading&&!l.current){l.current=!0,e.workspaces(V(!0)),e.workspaces(W(null));try{const t=await n.getWorkspaces();if(e.workspaces(U(t)),t.length>0){const e=Hx();if(e&&Zx(e,t)){const r=t.find(t=>t._id===e);r&&s(r)}else t.length>0&&(a.currentWorkspace||s(t[0]))}}catch(t){e.workspaces(W(t instanceof Error?t.message:"Failed to fetch workspaces"))}finally{e.workspaces(V(!1)),l.current=!1}}},[n,a.loading,a.currentWorkspace,e,s]),u=t.useCallback(async()=>{if(!a.refreshing&&!l.current){l.current=!0,e.workspaces($(!0));try{const t=await n.getWorkspaces();e.workspaces(U(t))}catch(e){}finally{e.workspaces($(!1)),l.current=!1}}},[n,a.refreshing,e]),f=t.useCallback(async(t,r)=>{const o=await n.createWorkspace({name:t,image:r});e.workspaces(U([...a.workspaces,o])),ne.emitWorkspaceCreated(o).catch(e=>{console.error("Error emitting workspace created event:",e)})},[n,a.workspaces,e]),m=t.useCallback(async(t,r)=>{const o=await n.updateWorkspace(t._id,r);e.workspaces(U(a.workspaces.map(e=>e._id===t._id?o:e))),ne.emitWorkspaceUpdated(o).catch(e=>{console.error("Error emitting workspace updated event:",e)})},[n,a.workspaces,e]),p=t.useCallback(async()=>{if(c.current)return a.allFeatures.length>0?a.allFeatures:null;if(a.allFeatures.length>0)return a.allFeatures;c.current=!0;try{const t=await n.getFeatures();return e.workspaces(L(t)),t}catch(e){return console.error("Failed to fetch features:",e),null}finally{c.current=!1}},[n,e,a.allFeatures]),h=t.useCallback(async(e,t,r)=>await n.updateFeature(e,t,r),[n]);t.useEffect(()=>{if(a.currentWorkspace?._id){const e=a.workspaces.find(e=>e._id===a.currentWorkspace?._id);if(e){if(e._id===a.currentWorkspace._id)return;s(e)}else if(a.workspaces.length>0){if(a.workspaces[0]._id===a.currentWorkspace._id)return;s(a.workspaces[0])}}},[a.currentWorkspace?._id,a.workspaces,s]);const g=t.useCallback(async e=>await n.getWorkspaceUsers(e),[n]),v=t.useCallback(async(e,t,r)=>{const o=await n.addUser(e,{email:t,role:r}),s=a.workspaces.find(t=>t._id===e);return s&&ne.emitWorkspaceUserAdded(o.userId,s,r).catch(e=>{console.error("Error emitting workspace user added event:",e)}),o},[n,a.workspaces]),b=t.useCallback(async(e,t)=>{const r=a.workspaces.find(t=>t._id===e);if(r){if(("object"==typeof r.createdBy&&null!==r.createdBy?r.createdBy._id:r.createdBy)===t)throw new Error("Cannot remove the workspace owner")}const o=(await n.getWorkspaceUsers(e).catch(()=>[])).find(e=>("string"==typeof e.user?e.user:e.user._id)===t),s=await n.removeUser(e,t);if(r&&o){const e=o.role;ne.emitWorkspaceUserRemoved(s.userId,r,e).catch(e=>{console.error("Error emitting workspace user removed event:",e)})}return s},[n,a.workspaces]),y=t.useCallback(async(e,t,r)=>{if(r.role){const r=a.workspaces.find(t=>t._id===e);if(r){if(("object"==typeof r.createdBy&&null!==r.createdBy?r.createdBy._id:r.createdBy)===t)throw new Error("Cannot change the role of the workspace owner")}}let o;if(r.role){const r=(await n.getWorkspaceUsers(e).catch(()=>[])).find(e=>("string"==typeof e.user?e.user:e.user._id)===t);o=r?.role}const s=await n.updateUser(e,t,r);return r.role&&o&&o!==r.role&&ne.emitWorkspaceUserRoleChanged(s.userId,s.workspace,o,r.role).catch(e=>{console.error("Error emitting workspace user role changed event:",e)}),s},[n,a.workspaces]),w=t.useCallback(async e=>{const t=await n.getProfile().catch(()=>null),r=await n.updateUserProfile(e);return ne.emitUserUpdated(r,t||void 0).catch(e=>{console.error("Error emitting user updated event:",e)}),r},[n]),x=t.useCallback(async()=>await n.getProfile(),[n]),S=t.useCallback(async e=>await n.getWorkspace(e),[n]),k=t.useCallback(async t=>{if(!o)throw new Error("User must be authenticated to delete a workspace");const r=a.workspaces.find(e=>e._id===t);if(!r)throw new Error("Workspace not found");if(!(("object"==typeof r.createdBy&&null!==r.createdBy?r.createdBy._id:r.createdBy)===o.id))throw new Error("Only the workspace creator can delete the workspace");const s=await n.deleteWorkspace(t);return e.workspaces(U(a.workspaces.filter(e=>e._id!==t))),a.currentWorkspace?._id===t&&e.workspaces(z()),r&&ne.emitWorkspaceDeleted(r).catch(e=>{console.error("Error emitting workspace deleted event:",e)}),s},[n,a.workspaces,a.currentWorkspace,e,o]);return{workspaces:a.workspaces,loading:a.loading,error:a.error,fetchWorkspaces:d,refreshWorkspaces:u,refreshing:a.refreshing,WorkspaceSwitcher:Wx,currentWorkspace:a.currentWorkspace,setCurrentWorkspace:s,resetCurrentWorkspace:i,createWorkspace:f,allFeatures:a.allFeatures,getFeatures:p,updateFeature:h,getWorkspace:S,switching:a.switching,updateWorkspace:m,getUsers:g,addUser:v,removeUser:b,updateUser:y,getProfile:x,updateUserProfile:w,deleteWorkspace:k}};function Jx(){const e=ee(),r=Q(e=>e.auth),n=Q(e=>e.os),{serverUrl:a,orgId:o,auth:l}=n,{resetCurrentWorkspace:d}=qx(),u=t.useCallback(async()=>{e.auth(s());try{const t=await Rd.post(`${a}/api/v1/auth/request`,{orgId:o,clientId:l?.clientId,redirect:{success:l?.redirectUrl||window.location.href,error:l?.redirectUrl||window.location.href}});if(!t.data.success)throw e.auth(i()),new Error(t.data.message||"Authentication failed");window.location.href=t.data.data.redirectUrl}catch(t){throw e.auth(i()),console.error("Sign in error:",t),t}},[a,o,l,e]),f=t.useCallback(async()=>{try{l?.callbacks?.onSignOut&&"function"==typeof l.callbacks.onSignOut&&await l.callbacks.onSignOut(),e.auth(c()),d(),v()}catch(e){console.error("Logout error:",e),v()}},[e,d,l?.callbacks?.onSignOut]);return t.useMemo(()=>({user:r.session?.user,session:r.session,isLoading:r.isLoading,isAuthenticated:r.isAuthenticated,isRedirecting:r.isRedirecting,status:r.status,signIn:u,signOut:f}),[r,u,f])}exports.BetaForm=({onSuccess:r,onError:n,className:a="w-full",fieldClassName:o="flex flex-col gap-1.5 w-full",language:s,customTexts:i={},autoFocus:l=!0,showSuccessMessage:c=!0,hideLogo:d=!1,hideTitles:u=!1})=>{const[f,m]=t.useState("en"),[p,h]=t.useState(!1),[g,v]=t.useState(!1),{submitBetaForm:b,isLoading:y,isSubmitting:w,error:x,config:S,success:k,message:A}=(()=>{const e=Q(e=>e.os),[r,n]=t.useState(null),[a,o]=t.useState(!0),[s,i]=t.useState(!1),[l,c]=t.useState(null),[d,u]=t.useState(!1),[f,m]=t.useState(null);return t.useEffect(()=>{(async()=>{o(!0);const t=new Ws(e),r=await t.fetchConfig();n(r),o(!1)})()},[e]),{isLoading:a,isSubmitting:s,config:r,error:l,success:d,message:f,submitBetaForm:t.useCallback(async t=>{if(!e){const e="SaaS OS context is not initialized";return c(e),{success:!1,message:e}}try{i(!0),c(null),u(!1),m(null);const r=new Ws(e),n=await r.submitBetaUser({name:t.name||"",email:t.email}),a="success"===n.status;return u(a),m(n.message),{success:a,message:n.message}}catch(e){const t=e instanceof Error?e.message:"Failed to submit beta form";return c(t),u(!1),m(t),{success:!1,message:t}}finally{i(!1)}},[e])}})();t.useEffect(()=>{m((()=>{if("undefined"==typeof window)return"en";const e=window.navigator.language.split("-")[0];return-1!==Object.keys(ol).indexOf(e)?e:"en"})())},[]),t.useEffect(()=>{k&&c&&(h(!0),v(!0)),x&&v(!0)},[k,c,x]);const E={...ol[s||f],...i},C=Ot({resolver:Oa(al),defaultValues:{email:"",name:""},mode:"onChange",reValidateMode:"onChange"});t.useEffect(()=>{l&&C.setFocus("name")},[l,C]);const j=C.formState.isValid&&!w;return e.jsx("div",{className:"saas-os-ui",style:{width:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:y?e.jsxs("div",{className:Wo("flex flex-col items-center justify-center w-full px-2.5 sm:px-6 py-2.5 sm:py-6 gap-y-2.5 sm:gap-y-4",a),children:[e.jsx(Vs,{className:"h-24 w-24 rounded-lg"}),e.jsx(Vs,{className:"h-6 w-32"}),e.jsxs("div",{className:"w-full space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(Vs,{className:"h-4 w-16"}),e.jsx(Vs,{className:"h-10 w-full"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Vs,{className:"h-4 w-16"}),e.jsx(Vs,{className:"h-10 w-full"})]}),e.jsx(Vs,{className:"h-10 w-full"})]})]}):e.jsxs("div",{className:"flex flex-col items-center justify-center w-full px-2.5 sm:px-6 py-2.5 sm:py-6 gap-y-2.5 sm:gap-y-4",children:[!d&&e.jsxs("div",{className:"flex flex-col items-center justify-center w-full",children:[S?.logo&&e.jsx(il,{logo:S?.logo}),S?.name&&e.jsx("div",{children:S?.name})]}),e.jsx(Be,{...C,children:e.jsxs("form",{onSubmit:C.handleSubmit(async e=>{try{const t=await b(e);t.success?(r?.(),C.reset(),c&&h(!0),v(!0)):(n?.(t.message),v(!0))}catch(e){n?.(e instanceof Error?e.message:E.errorMessage),v(!0)}}),className:a,noValidate:!0,"aria-busy":w,children:[!g&&e.jsxs(e.Fragment,{children:[!u&&S?.screen?.register&&e.jsx(sl,{screen:S?.screen?.register}),e.jsx(Os,{control:C.control,name:"name",render:({field:t})=>e.jsxs(Ms,{className:o,children:[e.jsx(Us,{children:E.nameLabel}),e.jsx(Ls,{children:e.jsx(Bs,{...t})}),e.jsx(Fs,{}),e.jsx(zs,{})]})}),e.jsx(Os,{control:C.control,name:"email",render:({field:t})=>e.jsxs(Ms,{className:o,children:[e.jsx(Us,{children:E.emailLabel}),e.jsx(Ls,{children:e.jsx(Bs,{...t})}),e.jsx(Fs,{}),e.jsx(zs,{})]})}),e.jsx(Es,{type:"submit",disabled:!j,className:o,children:w?E.submittingText:E.submitText})]}),g&&x&&e.jsxs("div",{className:"flex flex-col items-center justify-center w-full",children:[e.jsxs("div",{className:"border-red-300 text-red-700",role:"alert","aria-live":"assertive","aria-atomic":!0,children:[e.jsx("span",{className:"text-4xl mb-2",role:"img","aria-label":"Error",children:"❗"}),x]}),e.jsx("div",{className:"mt-4 flex justify-center",children:e.jsx(Es,{type:"button",onClick:()=>{v(!1),C.reset()},className:o,children:"Try Again"})})]}),g&&p&&A&&e.jsx("div",{className:"flex flex-col items-center justify-center w-full text-green-700 border-green-300 text-center",children:S?.screen?.thankYou&&e.jsx(sl,{screen:S?.screen?.thankYou})})]})}),!g&&e.jsx("div",{children:e.jsxs("div",{children:["By submitting this form, you consent to our"," ",e.jsx("a",{href:S?.privacyPolicy,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-700",children:"Privacy Policy"})," ","and"," ",e.jsx("a",{href:S?.termsOfService,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-700",children:"Terms of Service"}),"."]})})]})})},exports.SaaSOSProvider=ie,exports.WhenAuthenticated=e=>{const{children:t}=e,{status:r}=Jx();return r!==u.authenticated?null:t},exports.WhenRoles=e=>{const{children:t,fallback:r,roles:n}=e,{user:a}=Jx();return n.includes(a?.role??"")?t:r||null},exports.WhenUnauthenticated=e=>{const{children:t}=e,{status:r}=Jx();return r===u.authenticated?null:t},exports.WhenWorkspaceFeatureDisabled=e=>{const{children:t,slug:r}=e,{currentWorkspace:n}=qx(),a=n?.features?.[r];return a?null:t},exports.WhenWorkspaceFeatureEnabled=e=>{const{children:t,slug:r}=e,{currentWorkspace:n}=qx(),a=n?.features?.[r];return a?t:null},exports.WhenWorkspaceRoles=e=>{const{children:t,fallback:r,roles:n}=e,{user:a}=Jx(),{currentWorkspace:o}=qx(),s=o?.users.find(e=>e._id===a?.id);return s&&n.includes(s?.role??"")?t:r||null},exports.WorkspaceSwitcher=Wx,exports.eventEmitter=ne,exports.useSaaSAuth=Jx,exports.useSaaSSettings=jh,exports.useSaaSWorkspaces=qx;
30
30
  //# sourceMappingURL=index.js.map