@buildbase/sdk 0.0.2 → 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.d.ts +238 -55
- package/dist/index.esm.js +5 -5
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/saas-os.css +1 -1
- package/dist/types/contexts/AuthContext/index.d.ts +2 -2
- package/dist/types/contexts/AuthContext/reducer.d.ts +0 -1
- package/dist/types/contexts/OSContext/actions.d.ts +2 -0
- package/dist/types/contexts/OSContext/index.d.ts +2 -2
- package/dist/types/contexts/OSContext/reducer.d.ts +1 -1
- package/dist/types/contexts/OSContext/types.d.ts +4 -0
- package/dist/types/contexts/WorkspaceContext/index.d.ts +2 -2
- package/dist/types/contexts/index.d.ts +3 -3
- package/dist/types/contexts/shared/useAppSelector.d.ts +1 -1
- package/dist/types/index.d.ts +4 -0
- package/dist/types/lib/api-client.d.ts +7 -11
- package/dist/types/providers/auth/hooks.d.ts +1 -1
- package/dist/types/providers/auth/types.d.ts +12 -4
- package/dist/types/providers/auth/utils.d.ts +32 -7
- package/dist/types/providers/constants.d.ts +2 -0
- package/dist/types/providers/events/EventEmitter.d.ts +81 -0
- package/dist/types/providers/events/index.d.ts +2 -0
- package/dist/types/providers/events/types.d.ts +61 -0
- package/dist/types/providers/os/hooks.d.ts +5 -0
- package/dist/types/providers/os/types.d.ts +9 -1
- package/dist/types/providers/types.d.ts +9 -0
- package/dist/types/providers/workspace/api.d.ts +13 -3
- package/dist/types/providers/workspace/hooks.d.ts +16 -3
- package/dist/types/providers/workspace/ui/SettingsDanger.d.ts +6 -0
- package/dist/types/providers/workspace/ui/SettingsDialog.d.ts +1 -1
- package/dist/types/providers/workspace/ui/Skeleton.d.ts +1 -0
- package/package.json +12 -5
package/dist/index.esm.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import{jsx as e,Fragment as t,jsxs as r}from"react/jsx-runtime";import*as n from"react";import a,{createContext as o,useReducer as i,useMemo as s,useCallback as l,useEffect as c,forwardRef as u,createElement as d,useState as f,useLayoutEffect as m}from"react";import*as h from"react-dom";import p from"react-dom";function g({name:t,initialState:r,reducer:n,initializer:l}){const c=o(null),u=o(null),d=o(null),f=a.memo(({children:t})=>{const[a,o]=i(n,r,l||(e=>e)),f=s(()=>({state:a,dispatch:o}),[a,o]),m=s(()=>t,[t]);return e(d.Provider,{value:f,children:e(c.Provider,{value:a,children:e(u.Provider,{value:o,children:m})})})});f.displayName=`${t}Provider`;const m=()=>{const e=a.useContext(c);if(null===e)throw new Error(`use${t}State must be used within a ${t}Provider. Make sure SaaSOSProvider is wrapping your application.`);return e};return{Provider:f,useContext:()=>{const e=a.useContext(d);if(!e)throw new Error(`use${t}Context must be used within a ${t}Provider. Make sure SaaSOSProvider is wrapping your application.`);return e},useState:m,useDispatch:()=>{const e=a.useContext(u);if(null===e)throw new Error(`use${t}Dispatch must be used within a ${t}Provider. Make sure SaaSOSProvider is wrapping your application.`);return e},useSelector:(e,t)=>{const r=m(),n=e||(e=>e),o=a.useRef(n),i=a.useRef(void 0),l=a.useRef(r);e&&(o.current=n);return s(()=>{const e=o.current(r);if(void 0!==i.current){if((t?t(i.current,e):Object.is(i.current,e))&&l.current===r)return i.current}return i.current=e,l.current=r,e},[r,t])}}}var y;function v(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 b(e,t){if("undefined"!=typeof window)try{localStorage.setItem(e,t)}catch(t){console.warn(`Failed to save ${e} to localStorage:`,t)}}function w(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"}(y||(y={}));const S="saas_os_auth_token";function x(e){!function(e,t){try{b(e,JSON.stringify(t))}catch(t){console.warn(`Failed to save ${e} to localStorage:`,t)}}(S,e)}const k=()=>({user:null,session:null,isLoading:!1,isAuthenticated:!1,isRedirecting:!1,status:y.unauthenticated}),{Provider:T,useState:A,useDispatch:E}=g({name:"Auth",initialState:k(),reducer:(e,t)=>{switch(t.type){case"AUTHENTICATION_STARTED":return{...e,isLoading:!0,isAuthenticated:!1,isRedirecting:!0,status:y.authenticating};case"AUTHENTICATION_FAILED":return{...e,isLoading:!1,isAuthenticated:!1,isRedirecting:!1,status:y.unauthenticated};case"SET_SESSION":{const r=t.payload;return x(r),{...e,session:r,user:r.user,isAuthenticated:!0,isRedirecting:!1,isLoading:!1,status:y.authenticated}}case"REMOVE_SESSION":return w(S),{...e,user:null,session:null,isLoading:!1,isAuthenticated:!1,isRedirecting:!1,status:y.unauthenticated};default:return e}},initializer:k}),C=T,N=A,_=E,R=()=>({type:"AUTHENTICATION_STARTED"}),O=()=>({type:"AUTHENTICATION_FAILED"}),D=e=>({type:"SET_SESSION",payload:e}),M=()=>({type:"REMOVE_SESSION"}),{Provider:P,useState:I,useDispatch:L}=g({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}}}),F=P,z=I,U=L,V=e=>({type:"SET_SAAS_OS_CONFIG",payload:e}),j="saas-workspace-current";const{Provider:$,useState:W,useDispatch:B}=g({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)?b(j,r):w(j),{...e,currentWorkspace:t.payload};case"RESET_CURRENT_WORKSPACE":return w(j),{...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}}),Z=$,H=W,G=B,K=e=>({type:"SET_WORKSPACES",payload:e}),q=e=>({type:"SET_ALL_FEATURES",payload:e}),J=e=>({type:"SET_CURRENT_WORKSPACE",payload:e}),Y=()=>({type:"RESET_CURRENT_WORKSPACE"}),X=e=>({type:"SET_IS_INITIALIZED",payload:e}),Q=e=>({type:"SET_LOADING",payload:e}),ee=e=>({type:"SET_ERROR",payload:e}),te=e=>({type:"SET_REFRESHING",payload:e}),re=a.memo(({children:t})=>{const r=s(()=>t,[t]);return e(F,{children:e(C,{children:e(Z,{children:r})})})});function ne(e,t){const r=z(),n=N(),o=H(),i=s(()=>({os:r,auth:n,workspaces:o}),[r,n,o]),l=e||(e=>e),c=a.useRef(l),u=a.useRef(void 0),d=a.useRef(i);e&&(c.current=l);return s(()=>{const e=c.current(i);if(void 0!==u.current){if(Object.is(u.current,e)&&d.current===i)return u.current}return u.current=e,d.current=i,e},[i,t])}function ae(){const e=_(),t=U(),r=G();return s(()=>({auth:e,os:t,workspaces:r}),[e,t,r])}re.displayName="SDKContextProvider";class oe extends Error{}function ie(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)}}oe.prototype.name="InvalidTokenError";const se="token";const le=a.memo(({children:r,callbacks:n})=>{const a=ae(),o=ne(e=>e.auth),i=ne(e=>e.os.serverUrl),u=s(()=>n,[n]),d=l(async e=>{try{const t=function(e,t){if("string"!=typeof e)throw new oe("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 oe(`Invalid token specified: missing part #${r+1}`);let a;try{a=ie(n)}catch(e){throw new oe(`Invalid token specified: invalid base64 for part #${r+1} (${e.message})`)}try{return JSON.parse(a)}catch(e){throw new oe(`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(D(r)),u?.verifyToken){if(!await u.verifyToken(e))return void a.auth(O());u?.handleAuthentication&&await u.handleAuthentication(e)}!function(){try{const e=new URL(window.location.href);e.searchParams.delete(se),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(O()),e}},[i,a,u]);c(()=>{if("undefined"!=typeof window&&!o.isAuthenticated)try{const e=function(e){const t=v(e);if(!t)return null;try{return JSON.parse(t)}catch(t){return console.warn(`Failed to parse ${e} from localStorage:`,t),w(e),null}}(S);e&&new Date(e.expires)>new Date&&a.auth(D(e))}catch(e){console.error("Failed to hydrate session from localStorage:",e)}},[]),c(()=>{const e=function(){try{return new URL(window.location.href).searchParams.get(se)}catch(e){return null}}();e&&d(e).catch(e=>{console.error("Failed to handle auth redirect:",e)})},[d]);const f=s(()=>r,[r]);return e(t,{children:f})});le.displayName="AuthProviderWrapper";const ce=a.memo(({config:r,auth:n,children:o})=>{const i=ae(),s=a.useMemo(()=>({clientId:n?.clientId||"",redirectUrl:n?.redirectUrl||""}),[n?.clientId,n?.redirectUrl]);c(()=>{i.os(V({...r,auth:s}))},[r,s,i]);const l=a.useMemo(()=>o,[o]);return e(t,{children:l})});ce.displayName="ContextConfigProvider";const ue=o({container:null,setContainer:()=>{}}),de=a.memo(({children:t})=>{const[n,o]=a.useState(null),i=a.useMemo(()=>({container:n,setContainer:o}),[n]),s=a.useMemo(()=>t,[t]);return r(ue.Provider,{value:i,children:[s,e("div",{ref:o,id:"saas-os-portal",className:"saas-os-ui",style:{width:"100%",height:"100%"}})]})});de.displayName="PortalProvider";const fe=a.memo(({serverUrl:t,version:r,orgId:n,auth:o,children:i})=>{const s=a.useMemo(()=>({serverUrl:t,version:r,orgId:n}),[t,r,n]),l=a.useMemo(()=>o?.callbacks,[o?.callbacks]),c=a.useMemo(()=>i,[i]);return e(re,{children:e(le,{callbacks:l,children:e(de,{children:e(ce,{config:s,auth:o,children:c})})})})});fe.displayName="SaaSOSProvider";var me=e=>"checkbox"===e.type,he=e=>e instanceof Date,pe=e=>null==e;const ge=e=>"object"==typeof e;var ye=e=>!pe(e)&&!Array.isArray(e)&&ge(e)&&!he(e),ve=e=>ye(e)&&e.target?me(e.target)?e.target.checked:e.target.value:e,be=(e,t)=>e.has((e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e)(t)),we="undefined"!=typeof window&&void 0!==window.HTMLElement&&"undefined"!=typeof document;function Se(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(we&&(e instanceof Blob||n)||!r&&!ye(e))return e;if(t=r?[]:Object.create(Object.getPrototypeOf(e)),r||(e=>{const t=e.constructor&&e.constructor.prototype;return ye(t)&&t.hasOwnProperty("isPrototypeOf")})(e))for(const r in e)e.hasOwnProperty(r)&&(t[r]=Se(e[r]));else t=e}return t}var xe=e=>/^\w*$/.test(e),ke=e=>void 0===e,Te=e=>Array.isArray(e)?e.filter(Boolean):[],Ae=e=>Te(e.replace(/["|']|\]/g,"").split(/\.|\[/)),Ee=(e,t,r)=>{if(!t||!ye(e))return r;const n=(xe(t)?[t]:Ae(t)).reduce((e,t)=>pe(e)?e:e[t],e);return ke(n)||n===e?ke(e[t])?r:e[t]:n},Ce=e=>"boolean"==typeof e,Ne=(e,t,r)=>{let n=-1;const a=xe(t)?[t]:Ae(t),o=a.length,i=o-1;for(;++n<o;){const t=a[n];let o=r;if(n!==i){const r=e[t];o=ye(r)||Array.isArray(r)?r:isNaN(+a[n+1])?{}:[]}if("__proto__"===t||"constructor"===t||"prototype"===t)return;e[t]=o,e=e[t]}};const _e="blur",Re="focusout",Oe="change",De="onBlur",Me="onChange",Pe="onSubmit",Ie="onTouched",Le="all",Fe="max",ze="min",Ue="maxLength",Ve="minLength",je="pattern",$e="required",We="validate",Be=a.createContext(null);Be.displayName="HookFormContext";const Ze=()=>a.useContext(Be),He=e=>{const{children:t,...r}=e;return a.createElement(Be.Provider,{value:r},t)};var Ge=(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]!==Le&&(t._proxyFormState[a]=!n||Le),r&&(r[a]=!0),e[a]}});return a};const Ke="undefined"!=typeof window?a.useLayoutEffect:a.useEffect;var qe=e=>"string"==typeof e,Je=(e,t,r,n,a)=>qe(e)?(n&&t.watch.add(e),Ee(r,e,a)):Array.isArray(e)?e.map(e=>(n&&t.watch.add(e),Ee(r,e))):(n&&(t.watchAll=!0),r),Ye=e=>pe(e)||!ge(e);function Xe(e,t,r=new WeakSet){if(Ye(e)||Ye(t))return e===t;if(he(e)&&he(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(he(n)&&he(e)||ye(n)&&ye(e)||Array.isArray(n)&&Array.isArray(e)?!Xe(n,e,r):n!==e)return!1}}return!0}function Qe(e){const t=Ze(),{name:r,disabled:n,control:o=t.control,shouldUnregister:i,defaultValue:s}=e,l=be(o._names.array,r),c=a.useMemo(()=>Ee(o._formValues,r,Ee(o._defaultValues,r,s)),[o,r,s]),u=function(e){const t=Ze(),{control:r=t.control,name:n,defaultValue:o,disabled:i,exact:s,compute:l}=e||{},c=a.useRef(o),u=a.useRef(l),d=a.useRef(void 0);u.current=l;const f=a.useMemo(()=>r._getWatch(n,c.current),[r,n]),[m,h]=a.useState(u.current?u.current(f):f);return Ke(()=>r._subscribe({name:n,formState:{values:!0},exact:s,callback:e=>{if(!i){const t=Je(n,r._names,e.values||r._formValues,!1,c.current);if(u.current){const e=u.current(t);Xe(e,d.current)||(h(e),d.current=e)}else h(t)}}}),[r,i,n,s]),a.useEffect(()=>r._removeUnmounted()),m}({control:o,name:r,defaultValue:c,exact:!0}),d=function(e){const t=Ze(),{control:r=t.control,disabled:n,name:o,exact:i}=e||{},[s,l]=a.useState(r._formState),c=a.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return Ke(()=>r._subscribe({name:o,formState:c.current,exact:i,callback:e=>{!n&&l({...r._formState,...e})}}),[o,n,i]),a.useEffect(()=>{c.current.isValid&&r._setValid(!0)},[r]),a.useMemo(()=>Ge(s,r,c.current,!1),[s,r])}({control:o,name:r,exact:!0}),f=a.useRef(e),m=a.useRef(o.register(r,{...e.rules,value:u,...Ce(e.disabled)?{disabled:e.disabled}:{}}));f.current=e;const h=a.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Ee(d.errors,r)},isDirty:{enumerable:!0,get:()=>!!Ee(d.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!Ee(d.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!Ee(d.validatingFields,r)},error:{enumerable:!0,get:()=>Ee(d.errors,r)}}),[d,r]),p=a.useCallback(e=>m.current.onChange({target:{value:ve(e),name:r},type:Oe}),[r]),g=a.useCallback(()=>m.current.onBlur({target:{value:Ee(o._formValues,r),name:r},type:_e}),[r,o._formValues]),y=a.useCallback(e=>{const t=Ee(o._fields,r);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,r]),v=a.useMemo(()=>({name:r,value:u,...Ce(n)||d.disabled?{disabled:d.disabled||n}:{},onChange:p,onBlur:g,ref:y}),[r,n,d.disabled,p,g,y,u]);return a.useEffect(()=>{const e=o._options.shouldUnregister||i;o.register(r,{...f.current.rules,...Ce(f.current.disabled)?{disabled:f.current.disabled}:{}});const t=(e,t)=>{const r=Ee(o._fields,e);r&&r._f&&(r._f.mount=t)};if(t(r,!0),e){const e=Se(Ee(o._options.defaultValues,r));Ne(o._defaultValues,r,e),ke(Ee(o._formValues,r))&&Ne(o._formValues,r,e)}return!l&&o.register(r),()=>{(l?e&&!o._state.action:e)?o.unregister(r):t(r,!1)}},[r,o,l,i]),a.useEffect(()=>{o._setDisabledField({disabled:n,name:r})},[n,r,o]),a.useMemo(()=>({field:v,formState:d,fieldState:h}),[v,d,h])}const et=e=>e.render(Qe(e));var tt=(e,t,r,n,a)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:a||!0}}:{},rt=e=>Array.isArray(e)?e:[e],nt=()=>{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=[]}}},at=e=>ye(e)&&!Object.keys(e).length,ot=e=>"file"===e.type,it=e=>"function"==typeof e,st=e=>{if(!we)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},lt=e=>"select-multiple"===e.type,ct=e=>"radio"===e.type,ut=e=>st(e)&&e.isConnected;function dt(e,t){const r=Array.isArray(t)?t:xe(t)?[t]:Ae(t),n=1===r.length?e:function(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;)e=ke(e)?n++:e[t[n++]];return e}(e,r),a=r.length-1,o=r[a];return n&&delete n[o],0!==a&&(ye(n)&&at(n)||Array.isArray(n)&&function(e){for(const t in e)if(e.hasOwnProperty(t)&&!ke(e[t]))return!1;return!0}(n))&&dt(e,r.slice(0,-1)),e}var ft=e=>{for(const t in e)if(it(e[t]))return!0;return!1};function mt(e,t={}){const r=Array.isArray(e);if(ye(e)||r)for(const r in e)Array.isArray(e[r])||ye(e[r])&&!ft(e[r])?(t[r]=Array.isArray(e[r])?[]:{},mt(e[r],t[r])):pe(e[r])||(t[r]=!0);return t}function ht(e,t,r){const n=Array.isArray(e);if(ye(e)||n)for(const n in e)Array.isArray(e[n])||ye(e[n])&&!ft(e[n])?ke(t)||Ye(r[n])?r[n]=Array.isArray(e[n])?mt(e[n],[]):{...mt(e[n])}:ht(e[n],pe(t)?{}:t[n],r[n]):r[n]=!Xe(e[n],t[n]);return r}var pt=(e,t)=>ht(e,t,mt(t));const gt={value:!1,isValid:!1},yt={value:!0,isValid:!0};var vt=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&&!ke(e[0].attributes.value)?ke(e[0].value)||""===e[0].value?yt:{value:e[0].value,isValid:!0}:yt:gt}return gt},bt=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>ke(e)?e:t?""===e?NaN:e?+e:e:r&&qe(e)?new Date(e):n?n(e):e;const wt={isValid:!1,value:null};var St=e=>Array.isArray(e)?e.reduce((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e,wt):wt;function xt(e){const t=e.ref;return ot(t)?t.files:ct(t)?St(e.refs).value:lt(t)?[...t.selectedOptions].map(({value:e})=>e):me(t)?vt(e.refs).value:bt(ke(t.value)?e.ref.value:t.value,e)}var kt=e=>e instanceof RegExp,Tt=e=>ke(e)?e:kt(e)?e.source:ye(e)?kt(e.value)?e.value.source:e.value:e,At=e=>({isOnSubmit:!e||e===Pe,isOnBlur:e===De,isOnChange:e===Me,isOnAll:e===Le,isOnTouch:e===Ie});const Et="AsyncFunction";var Ct=e=>!!e&&!!e.validate&&!!(it(e.validate)&&e.validate.constructor.name===Et||ye(e.validate)&&Object.values(e.validate).find(e=>e.constructor.name===Et)),Nt=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(t=>e.startsWith(t)&&/^\.\w+/.test(e.slice(t.length))));const _t=(e,t,r,n)=>{for(const a of r||Object.keys(e)){const r=Ee(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(_t(o,t))break}else if(ye(o)&&_t(o,t))break}}};function Rt(e,t,r){const n=Ee(e,r);if(n||xe(r))return{error:n,name:r};const a=r.split(".");for(;a.length;){const n=a.join("."),o=Ee(t,n),i=Ee(e,n);if(o&&!Array.isArray(o)&&r!==n)return{name:r};if(i&&i.type)return{name:n,error:i};if(i&&i.root&&i.root.type)return{name:`${n}.root`,error:i.root};a.pop()}return{name:r}}var Ot=(e,t,r)=>{const n=rt(Ee(e,r));return Ne(n,"root",t[r]),Ne(e,r,n),e},Dt=e=>qe(e);function Mt(e,t,r="validate"){if(Dt(e)||Array.isArray(e)&&e.every(Dt)||Ce(e)&&!e)return{type:r,message:Dt(e)?e:"",ref:t}}var Pt=e=>ye(e)&&!kt(e)?e:{value:e,message:""},It=async(e,t,r,n,a,o)=>{const{ref:i,refs:s,required:l,maxLength:c,minLength:u,min:d,max:f,pattern:m,validate:h,name:p,valueAsNumber:g,mount:y}=e._f,v=Ee(r,p);if(!y||t.has(p))return{};const b=s?s[0]:i,w=e=>{a&&b.reportValidity&&(b.setCustomValidity(Ce(e)?"":e||""),b.reportValidity())},S={},x=ct(i),k=me(i),T=x||k,A=(g||ot(i))&&ke(i.value)&&ke(v)||st(i)&&""===i.value||""===v||Array.isArray(v)&&!v.length,E=tt.bind(null,p,n,S),C=(e,t,r,n=Ue,a=Ve)=>{const o=e?t:r;S[p]={type:e?n:a,message:o,ref:i,...E(e?n:a,o)}};if(o?!Array.isArray(v)||!v.length:l&&(!T&&(A||pe(v))||Ce(v)&&!v||k&&!vt(s).isValid||x&&!St(s).isValid)){const{value:e,message:t}=Dt(l)?{value:!!l,message:l}:Pt(l);if(e&&(S[p]={type:$e,message:t,ref:b,...E($e,t)},!n))return w(t),S}if(!(A||pe(d)&&pe(f))){let e,t;const r=Pt(f),a=Pt(d);if(pe(v)||isNaN(v)){const n=i.valueAsDate||new Date(v),o=e=>new Date((new Date).toDateString()+" "+e),s="time"==i.type,l="week"==i.type;qe(r.value)&&v&&(e=s?o(v)>o(r.value):l?v>r.value:n>new Date(r.value)),qe(a.value)&&v&&(t=s?o(v)<o(a.value):l?v<a.value:n<new Date(a.value))}else{const n=i.valueAsNumber||(v?+v:v);pe(r.value)||(e=n>r.value),pe(a.value)||(t=n<a.value)}if((e||t)&&(C(!!e,r.message,a.message,Fe,ze),!n))return w(S[p].message),S}if((c||u)&&!A&&(qe(v)||o&&Array.isArray(v))){const e=Pt(c),t=Pt(u),r=!pe(e.value)&&v.length>+e.value,a=!pe(t.value)&&v.length<+t.value;if((r||a)&&(C(r,e.message,t.message),!n))return w(S[p].message),S}if(m&&!A&&qe(v)){const{value:e,message:t}=Pt(m);if(kt(e)&&!v.match(e)&&(S[p]={type:je,message:t,ref:i,...E(je,t)},!n))return w(t),S}if(h)if(it(h)){const e=Mt(await h(v,r),b);if(e&&(S[p]={...e,...E(We,e.message)},!n))return w(e.message),S}else if(ye(h)){let e={};for(const t in h){if(!at(e)&&!n)break;const a=Mt(await h[t](v,r),b,t);a&&(e={...a,...E(t,a.message)},w(a.message),n&&(S[p]=e))}if(!at(e)&&(S[p]={ref:b,...e},!n))return S}return w(!0),S};const Lt={mode:Pe,reValidateMode:Me,shouldFocusError:!0};function Ft(e={}){let t,r={...Lt,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:it(r.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:r.errors||{},disabled:r.disabled||!1},a={},o=(ye(r.defaultValues)||ye(r.values))&&Se(r.defaultValues||r.values)||{},i=r.shouldUnregister?{}:Se(o),s={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:nt(),state:nt()},m=r.criteriaMode===Le,h=async e=>{if(!r.disabled&&(u.isValid||d.isValid||e)){const e=r.resolver?at((await b()).errors):await w(a,!0);e!==n.isValid&&f.state.next({isValid:e})}},p=(e,t)=>{!r.disabled&&(u.isValidating||u.validatingFields||d.isValidating||d.validatingFields)&&((e||Array.from(l.mount)).forEach(e=>{e&&(t?Ne(n.validatingFields,e,t):dt(n.validatingFields,e))}),f.state.next({validatingFields:n.validatingFields,isValidating:!at(n.validatingFields)}))},g=(e,t,r,n)=>{const l=Ee(a,e);if(l){const a=Ee(i,e,ke(r)?Ee(o,e):r);ke(a)||n&&n.defaultChecked||t?Ne(i,e,t?a:xt(l._f)):k(e,a),s.mount&&h()}},y=(e,t,a,i,s)=>{let l=!1,c=!1;const m={name:e};if(!r.disabled){if(!a||i){(u.isDirty||d.isDirty)&&(c=n.isDirty,n.isDirty=m.isDirty=S(),l=c!==m.isDirty);const r=Xe(Ee(o,e),t);c=!!Ee(n.dirtyFields,e),r?dt(n.dirtyFields,e):Ne(n.dirtyFields,e,!0),m.dirtyFields=n.dirtyFields,l=l||(u.dirtyFields||d.dirtyFields)&&c!==!r}if(a){const t=Ee(n.touchedFields,e);t||(Ne(n.touchedFields,e,a),m.touchedFields=n.touchedFields,l=l||(u.touchedFields||d.touchedFields)&&t!==a)}l&&s&&f.state.next(m)}return l?m:{}},v=(e,a,o,i)=>{const s=Ee(n.errors,e),l=(u.isValid||d.isValid)&&Ce(a)&&n.isValid!==a;var m;if(r.delayError&&o?(m=()=>((e,t)=>{Ne(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?Ne(n.errors,e,o):dt(n.errors,e)),(o?!Xe(s,o):s)||!at(i)||l){const t={...i,...l&&Ce(a)?{isValid:a}:{},errors:n.errors,name:e};n={...n,...t},f.state.next(t)}},b=async e=>{p(e,!0);const t=await r.resolver(i,r.context,((e,t,r,n)=>{const a={};for(const r of e){const e=Ee(t,r);e&&Ne(a,r,e._f)}return{criteriaMode:r,names:[...e],fields:a,shouldUseNativeValidation:n}})(e||l.mount,a,r.criteriaMode,r.shouldUseNativeValidation));return p(e),t},w=async(e,t,a={valid:!0})=>{for(const o in e){const s=e[o];if(s){const{_f:e,...c}=s;if(e){const c=l.array.has(e.name),d=s._f&&Ct(s._f);d&&u.validatingFields&&p([o],!0);const f=await It(s,l.disabled,i,m,r.shouldUseNativeValidation&&!t,c);if(d&&u.validatingFields&&p([o]),f[e.name]&&(a.valid=!1,t))break;!t&&(Ee(f,e.name)?c?Ot(n.errors,f,e.name):Ne(n.errors,e.name,f[e.name]):dt(n.errors,e.name))}!at(c)&&await w(c,t,a)}}return a.valid},S=(e,t)=>!r.disabled&&(e&&t&&Ne(i,e,t),!Xe(_(),o)),x=(e,t,r)=>Je(e,l,{...s.mount?i:ke(t)?o:qe(e)?{[e]:t}:t},r,t),k=(e,t,r={})=>{const n=Ee(a,e);let o=t;if(n){const r=n._f;r&&(!r.disabled&&Ne(i,e,bt(t,r)),o=st(r.ref)&&pe(t)?"":t,lt(r.ref)?[...r.ref.options].forEach(e=>e.selected=o.includes(e.value)):r.refs?me(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):ot(r.ref)?r.ref.value="":(r.ref.value=o,r.ref.type||f.state.next({name:e,values:Se(i)})))}(r.shouldDirty||r.shouldTouch)&&y(e,o,r.shouldTouch,r.shouldDirty,!0),r.shouldValidate&&N(e)},T=(e,t,r)=>{for(const n in t){if(!t.hasOwnProperty(n))return;const o=t[n],i=e+"."+n,s=Ee(a,i);(l.array.has(e)||ye(o)||s&&!s._f)&&!he(o)?T(i,o,r):k(i,o,r)}},A=(e,t,r={})=>{const c=Ee(a,e),m=l.array.has(e),h=Se(t);Ne(i,e,h),m?(f.array.next({name:e,values:Se(i)}),(u.isDirty||u.dirtyFields||d.isDirty||d.dirtyFields)&&r.shouldDirty&&f.state.next({name:e,dirtyFields:pt(o,i),isDirty:S(e,h)})):!c||c._f||pe(h)?k(e,h,r):T(e,h,r),Nt(e,l)&&f.state.next({...n,name:e}),f.state.next({name:s.mount?e:void 0,values:Se(i)})},E=async e=>{s.mount=!0;const o=e.target;let c=o.name,g=!0;const S=Ee(a,c),x=e=>{g=Number.isNaN(e)||he(e)&&isNaN(e.getTime())||Xe(e,Ee(i,c,e))},k=At(r.mode),T=At(r.reValidateMode);if(S){let s,A;const E=o.type?xt(S._f):ve(e),C=e.type===_e||e.type===Re,_=!(e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate))(S._f)&&!r.resolver&&!Ee(n.errors,c)&&!S._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))(C,Ee(n.touchedFields,c),n.isSubmitted,T,k),R=Nt(c,l,C);Ne(i,c,E),C?o&&o.readOnly||(S._f.onBlur&&S._f.onBlur(e),t&&t(0)):S._f.onChange&&S._f.onChange(e);const O=y(c,E,C),D=!at(O)||R;if(!C&&f.state.next({name:c,type:e.type,values:Se(i)}),_)return(u.isValid||d.isValid)&&("onBlur"===r.mode?C&&h():C||h()),D&&f.state.next({name:c,...R?{}:O});if(!C&&R&&f.state.next({...n}),r.resolver){const{errors:e}=await b([c]);if(x(E),g){const t=Rt(n.errors,a,c),r=Rt(e,a,t.name||c);s=r.error,c=r.name,A=at(e)}}else p([c],!0),s=(await It(S,l.disabled,i,m,r.shouldUseNativeValidation))[c],p([c]),x(E),g&&(s?A=!1:(u.isValid||d.isValid)&&(A=await w(a,!0)));g&&(S._f.deps&&N(S._f.deps),v(c,A,s,O))}},C=(e,t)=>{if(Ee(n.errors,t)&&e.focus)return e.focus(),1},N=async(e,t={})=>{let o,i;const s=rt(e);if(r.resolver){const t=await(async e=>{const{errors:t}=await b(e);if(e)for(const r of e){const e=Ee(t,r);e?Ne(n.errors,r,e):dt(n.errors,r)}else n.errors=t;return t})(ke(e)?e:s);o=at(t),i=e?!s.some(e=>Ee(t,e)):o}else e?(i=(await Promise.all(s.map(async e=>{const t=Ee(a,e);return await w(t&&t._f?{[e]:t}:t)}))).every(Boolean),(i||n.isValid)&&h()):i=o=await w(a);return f.state.next({...!qe(e)||(u.isValid||d.isValid)&&o!==n.isValid?{}:{name:e},...r.resolver||!e?{isValid:o}:{},errors:n.errors}),t.shouldFocus&&!i&&_t(a,C,e?s:l.mount),i},_=e=>{const t={...s.mount?i:o};return ke(e)?t:qe(e)?Ee(t,e):e.map(e=>Ee(t,e))},R=(e,t)=>({invalid:!!Ee((t||n).errors,e),isDirty:!!Ee((t||n).dirtyFields,e),error:Ee((t||n).errors,e),isValidating:!!Ee(n.validatingFields,e),isTouched:!!Ee((t||n).touchedFields,e)}),O=(e,t,r)=>{const o=(Ee(a,e,{_f:{}})._f||{}).ref,i=Ee(n.errors,e)||{},{ref:s,message:l,type:c,...u}=i;Ne(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()},D=e=>f.state.subscribe({next:t=>{var r,a,s;r=e.name,a=t.name,s=e.exact,r&&a&&r!==a&&!rt(r).some(e=>e&&(s?e===a:e.startsWith(a)||a.startsWith(e)))||!((e,t,r,n)=>{r(e);const{name:a,...o}=e;return at(o)||Object.keys(o).length>=Object.keys(t).length||Object.keys(o).find(e=>t[e]===(!n||Le))})(t,e.formState||u,V,e.reRenderRoot)||e.callback({values:{...i},...n,...t,defaultValues:o})}}).unsubscribe,M=(e,t={})=>{for(const s of e?rt(e):l.mount)l.mount.delete(s),l.array.delete(s),t.keepValue||(dt(a,s),dt(i,s)),!t.keepError&&dt(n.errors,s),!t.keepDirty&&dt(n.dirtyFields,s),!t.keepTouched&&dt(n.touchedFields,s),!t.keepIsValidating&&dt(n.validatingFields,s),!r.shouldUnregister&&!t.keepDefaultValue&&dt(o,s);f.state.next({values:Se(i)}),f.state.next({...n,...t.keepDirty?{isDirty:S()}:{}}),!t.keepIsValid&&h()},P=({disabled:e,name:t})=>{(Ce(e)&&s.mount||e||l.disabled.has(t))&&(e?l.disabled.add(t):l.disabled.delete(t))},I=(e,t={})=>{let n=Ee(a,e);const i=Ce(t.disabled)||Ce(r.disabled);return Ne(a,e,{...n||{},_f:{...n&&n._f?n._f:{ref:{name:e}},name:e,mount:!0,...t}}),l.mount.add(e),n?P({disabled:Ce(t.disabled)?t.disabled:r.disabled,name:e}):g(e,!0,t.value),{...i?{disabled:t.disabled||r.disabled}:{},...r.progressive?{required:!!t.required,min:Tt(t.min),max:Tt(t.max),minLength:Tt(t.minLength),maxLength:Tt(t.maxLength),pattern:Tt(t.pattern)}:{},name:e,onChange:E,onBlur:E,ref:i=>{if(i){I(e,t),n=Ee(a,e);const r=ke(i.value)&&i.querySelectorAll&&i.querySelectorAll("input,select,textarea")[0]||i,s=(e=>ct(e)||me(e))(r),l=n._f.refs||[];if(s?l.find(e=>e===r):r===n._f.ref)return;Ne(a,e,{_f:{...n._f,...s?{refs:[...l.filter(ut),r,...Array.isArray(Ee(o,e))?[{}]:[]],ref:{type:r.type,name:e}}:{ref:r}}}),g(e,!1,void 0,r)}else n=Ee(a,e,{}),n._f&&(n._f.mount=!1),(r.shouldUnregister||t.shouldUnregister)&&(!be(l.array,e)||!s.action)&&l.unMount.add(e)}}},L=()=>r.shouldFocusError&&_t(a,C,l.mount),F=(e,t)=>async o=>{let s;o&&(o.preventDefault&&o.preventDefault(),o.persist&&o.persist());let c=Se(i);if(f.state.next({isSubmitting:!0}),r.resolver){const{errors:e,values:t}=await b();n.errors=e,c=Se(t)}else await w(a);if(l.disabled.size)for(const e of l.disabled)dt(c,e);if(dt(n.errors,"root"),at(n.errors)){f.state.next({errors:{}});try{await e(c,o)}catch(e){s=e}}else t&&await t({...n.errors},o),L(),setTimeout(L);if(f.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:at(n.errors)&&!s,submitCount:n.submitCount+1,errors:n.errors}),s)throw s},z=(e,t={})=>{const c=e?Se(e):o,d=Se(c),m=at(e),h=m?o:d;if(t.keepDefaultValues||(o=c),!t.keepValues){if(t.keepDirtyValues){const e=new Set([...l.mount,...Object.keys(pt(o,i))]);for(const t of Array.from(e))Ee(n.dirtyFields,t)?Ne(h,t,Ee(i,t)):A(t,Ee(h,t))}else{if(we&&ke(e))for(const e of l.mount){const t=Ee(a,e);if(t&&t._f){const e=Array.isArray(t._f.refs)?t._f.refs[0]:t._f.ref;if(st(e)){const t=e.closest("form");if(t){t.reset();break}}}}if(t.keepFieldsRef)for(const e of l.mount)A(e,Ee(h,e));else a={}}i=r.shouldUnregister?t.keepDefaultValues?Se(o):{}:Se(h),f.array.next({values:{...h}}),f.state.next({values:{...h}})}l={mount:t.keepDirtyValues?l.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},s.mount=!u.isValid||!!t.keepIsValid||!!t.keepDirtyValues,s.watch=!!r.shouldUnregister,f.state.next({submitCount:t.keepSubmitCount?n.submitCount:0,isDirty:!m&&(t.keepDirty?n.isDirty:!(!t.keepDefaultValues||Xe(e,o))),isSubmitted:!!t.keepIsSubmitted&&n.isSubmitted,dirtyFields:m?{}:t.keepDirtyValues?t.keepDefaultValues&&i?pt(o,i):n.dirtyFields:t.keepDefaultValues&&e?pt(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})},U=(e,t)=>z(it(e)?e(i):e,t),V=e=>{n={...n,...e}},j={control:{register:I,unregister:M,getFieldState:R,handleSubmit:F,setError:O,_subscribe:D,_runSchema:b,_focusError:L,_getWatch:x,_getDirty:S,_setValid:h,_setFieldArray:(e,t=[],l,c,m=!0,h=!0)=>{if(c&&l&&!r.disabled){if(s.action=!0,h&&Array.isArray(Ee(a,e))){const t=l(Ee(a,e),c.argA,c.argB);m&&Ne(a,e,t)}if(h&&Array.isArray(Ee(n.errors,e))){const t=l(Ee(n.errors,e),c.argA,c.argB);m&&Ne(n.errors,e,t),((e,t)=>{!Te(Ee(e,t)).length&&dt(e,t)})(n.errors,e)}if((u.touchedFields||d.touchedFields)&&h&&Array.isArray(Ee(n.touchedFields,e))){const t=l(Ee(n.touchedFields,e),c.argA,c.argB);m&&Ne(n.touchedFields,e,t)}(u.dirtyFields||d.dirtyFields)&&(n.dirtyFields=pt(o,i)),f.state.next({name:e,isDirty:S(e,t),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else Ne(i,e,t)},_setDisabledField:P,_setErrors:e=>{n.errors=e,f.state.next({errors:n.errors,isValid:!1})},_getFieldArray:e=>Te(Ee(s.mount?i:o,e,r.shouldUnregister?Ee(o,e,[]):[])),_reset:z,_resetDefaultValues:()=>it(r.defaultValues)&&r.defaultValues().then(e=>{U(e,r.resetOptions),f.state.next({isLoading:!1})}),_removeUnmounted:()=>{for(const e of l.unMount){const t=Ee(a,e);t&&(t._f.refs?t._f.refs.every(e=>!ut(e)):!ut(t._f.ref))&&M(e)}l.unMount=new Set},_disableForm:e=>{Ce(e)&&(f.state.next({disabled:e}),_t(a,(t,r)=>{const n=Ee(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 i},get _state(){return s},set _state(e){s=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=>(s.mount=!0,d={...d,...e.formState},D({...e,formState:d})),trigger:N,register:I,handleSubmit:F,watch:(e,t)=>it(e)?f.state.subscribe({next:r=>"values"in r&&e(x(void 0,t),r)}):x(e,t,!0),setValue:A,getValues:_,reset:U,resetField:(e,t={})=>{Ee(a,e)&&(ke(t.defaultValue)?A(e,Se(Ee(o,e))):(A(e,t.defaultValue),Ne(o,e,Se(t.defaultValue))),t.keepTouched||dt(n.touchedFields,e),t.keepDirty||(dt(n.dirtyFields,e),n.isDirty=t.defaultValue?S(e,Se(Ee(o,e))):S()),t.keepError||(dt(n.errors,e),u.isValid&&h()),f.state.next({...n}))},clearErrors:e=>{e&&rt(e).forEach(e=>dt(n.errors,e)),f.state.next({errors:e?n.errors:{}})},unregister:M,setError:O,setFocus:(e,t={})=>{const r=Ee(a,e),n=r&&r._f;if(n){const e=n.refs?n.refs[0]:n.ref;e.focus&&(e.focus(),t.shouldSelect&&it(e.select)&&e.select())}},getFieldState:R};return{...j,formControl:j}}function zt(e={}){const t=a.useRef(void 0),r=a.useRef(void 0),[n,o]=a.useState({isDirty:!1,isValidating:!1,isLoading:it(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:it(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:n},e.defaultValues&&!it(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:r,...a}=Ft(e);t.current={...a,formState:n}}const i=t.current.control;return i._options=e,Ke(()=>{const e=i._subscribe({formState:i._proxyFormState,callback:()=>o({...i._formState}),reRenderRoot:!0});return o(e=>({...e,isReady:!0})),i._formState.isReady=!0,e},[i]),a.useEffect(()=>i._disableForm(e.disabled),[i,e.disabled]),a.useEffect(()=>{e.mode&&(i._options.mode=e.mode),e.reValidateMode&&(i._options.reValidateMode=e.reValidateMode)},[i,e.mode,e.reValidateMode]),a.useEffect(()=>{e.errors&&(i._setErrors(e.errors),i._focusError())},[i,e.errors]),a.useEffect(()=>{e.shouldUnregister&&i._subjects.state.next({values:i._getWatch()})},[i,e.shouldUnregister]),a.useEffect(()=>{if(i._proxyFormState.isDirty){const e=i._getDirty();e!==n.isDirty&&i._subjects.state.next({isDirty:e})}},[i,n.isDirty]),a.useEffect(()=>{e.values&&!Xe(e.values,r.current)?(i._reset(e.values,{keepFieldsRef:!0,...i._options.resetOptions}),r.current=e.values,o(e=>({...e}))):i._resetDefaultValues()},[i,e.values]),a.useEffect(()=>{i._state.mount||(i._setValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()}),t.current.formState=Ge(n,i),t.current}const Ut=(e,t,r)=>{if(e&&"reportValidity"in e){const n=Ee(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},Vt=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?Ut(n.ref,r,e):n&&n.refs&&n.refs.forEach(t=>Ut(t,r,e))}},jt=(e,t)=>{t.shouldUseNativeValidation&&Vt(e,t);const r={};for(const n in e){const a=Ee(t.fields,n),o=Object.assign(e[n]||{},{ref:a&&a.ref});if($t(t.names||Object.keys(e),n)){const e=Object.assign({},Ee(r,n));Ne(e,"root",o),Ne(r,n,e)}else Ne(r,n,o)}return r},$t=(e,t)=>{const r=Wt(t);return e.some(e=>Wt(e).match(`^${r}\\.\\d+`))};function Wt(e){return e.replace(/\]|\[/g,"")}function Bt(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 i.prototype)e in r||Object.defineProperty(r,e,{value:i.prototype[e].bind(r)});r._zod.constr=i,r._zod.def=n}const a=r?.Parent??Object;class o extends a{}function i(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(i,"init",{value:n}),Object.defineProperty(i,Symbol.hasInstance,{value:t=>!!(r?.Parent&&t instanceof r.Parent)||t?._zod?.traits?.has(e)}),Object.defineProperty(i,"name",{value:e}),i}class Zt extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Ht extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}const Gt={};function Kt(e){return Gt}function qt(e,t){return"bigint"==typeof t?t.toString():t}function Jt(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Yt(e){return null==e}function Xt(e){const t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}const Qt=Symbol("evaluating");function er(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==Qt)return void 0===n&&(n=Qt,n=r()),n},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function tr(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function rr(...e){const t={};for(const r of e){const e=Object.getOwnPropertyDescriptors(r);Object.assign(t,e)}return Object.defineProperties({},t)}function nr(e){return JSON.stringify(e)}const ar="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function or(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const ir=Jt(()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function sr(e){if(!1===or(e))return!1;const t=e.constructor;if(void 0===t)return!0;const r=t.prototype;return!1!==or(r)&&!1!==Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")}function lr(e){return sr(e)?{...e}:Array.isArray(e)?[...e]:e}const cr=new Set(["string","number","symbol"]);function ur(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function dr(e,t,r){const n=new e._zod.constr(t??e._zod.def);return t&&!r?.parent||(n._zod.parent=e),n}function fr(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 mr(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 hr(e,t){return t.map(t=>{var r;return(r=t).path??(r.path=[]),t.path.unshift(e),t})}function pr(e){return"string"==typeof e?e:e?.message}function gr(e,t,r){const n={...e,path:e.path??[]};if(!e.message){const a=pr(e.inst?._zod.def?.error?.(e))??pr(t?.error?.(e))??pr(r.customError?.(e))??pr(r.localeError?.(e))??"Invalid input";n.message=a}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}function yr(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function vr(...e){const[t,r,n]=e;return"string"==typeof t?{message:t,code:"custom",input:r,inst:n}:{...t}}const br=(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,qt,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},wr=Bt("$ZodError",br),Sr=Bt("$ZodError",br,{Parent:Error});const xr=e=>(t,r,n,a)=>{const o=n?Object.assign(n,{async:!1}):{async:!1},i=t._zod.run({value:r,issues:[]},o);if(i instanceof Promise)throw new Zt;if(i.issues.length){const t=new(a?.Err??e)(i.issues.map(e=>gr(e,o,Kt())));throw ar(t,a?.callee),t}return i.value},kr=xr(Sr),Tr=e=>async(t,r,n,a)=>{const o=n?Object.assign(n,{async:!0}):{async:!0};let i=t._zod.run({value:r,issues:[]},o);if(i instanceof Promise&&(i=await i),i.issues.length){const t=new(a?.Err??e)(i.issues.map(e=>gr(e,o,Kt())));throw ar(t,a?.callee),t}return i.value},Ar=Tr(Sr),Er=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??wr)(o.issues.map(e=>gr(e,a,Kt())))}:{success:!0,data:o.value}},Cr=Er(Sr),Nr=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=>gr(e,a,Kt())))}:{success:!0,data:o.value}},_r=Nr(Sr),Rr=e=>(t,r,n)=>{const a=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return xr(e)(t,r,a)},Or=e=>(t,r,n)=>xr(e)(t,r,n),Dr=e=>async(t,r,n)=>{const a=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Tr(e)(t,r,a)},Mr=e=>async(t,r,n)=>Tr(e)(t,r,n),Pr=e=>(t,r,n)=>{const a=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Er(e)(t,r,a)},Ir=e=>(t,r,n)=>Er(e)(t,r,n),Lr=e=>async(t,r,n)=>{const a=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Nr(e)(t,r,a)},Fr=e=>async(t,r,n)=>Nr(e)(t,r,n),zr=/^[cC][^\s-]{8,}$/,Ur=/^[0-9a-z]+$/,Vr=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,jr=/^[0-9a-vA-V]{20}$/,$r=/^[A-Za-z0-9]{27}$/,Wr=/^[a-zA-Z0-9_-]{21}$/,Br=/^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})$/,Hr=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)$/,Gr=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;const Kr=/^(?:(?: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])$/,qr=/^(([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}|:))$/,Jr=/^((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])$/,Yr=/^(([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])$/,Xr=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Qr=/^[A-Za-z0-9_-]*$/,en=/^(?=.{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])?)*\.?$/,tn=/^\+(?:[0-9]){6,14}[0-9]$/,rn="(?:(?:\\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])))",nn=new RegExp(`^${rn}$`);function an(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 on=/^[^A-Z]*$/,sn=/^[^a-z]*$/,ln=Bt("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),cn=Bt("$ZodCheckMaxLength",(e,t)=>{var r;ln.init(e,t),(r=e._zod.def).when??(r.when=e=>{const t=e.value;return!Yt(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=yr(n);r.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),un=Bt("$ZodCheckMinLength",(e,t)=>{var r;ln.init(e,t),(r=e._zod.def).when??(r.when=e=>{const t=e.value;return!Yt(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=yr(n);r.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),dn=Bt("$ZodCheckLengthEquals",(e,t)=>{var r;ln.init(e,t),(r=e._zod.def).when??(r.when=e=>{const t=e.value;return!Yt(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=yr(n),i=a>t.length;r.issues.push({origin:o,...i?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),fn=Bt("$ZodCheckStringFormat",(e,t)=>{var r,n;ln.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=()=>{})}),mn=Bt("$ZodCheckRegex",(e,t)=>{fn.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})}}),hn=Bt("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=on),fn.init(e,t)}),pn=Bt("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=sn),fn.init(e,t)}),gn=Bt("$ZodCheckIncludes",(e,t)=>{ln.init(e,t);const r=ur(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})}}),yn=Bt("$ZodCheckStartsWith",(e,t)=>{ln.init(e,t);const r=new RegExp(`^${ur(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})}}),vn=Bt("$ZodCheckEndsWith",(e,t)=>{ln.init(e,t);const r=new RegExp(`.*${ur(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})}}),bn=Bt("$ZodCheckOverwrite",(e,t)=>{ln.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});class wn{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 Sn={major:4,minor:1,patch:8},xn=Bt("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Sn;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=mr(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,i=o._zod.check(e);if(i instanceof Promise&&!1===r?.async)throw new Zt;if(n||i instanceof Promise)n=(n??Promise.resolve()).then(async()=>{await i;e.issues.length!==t&&(a||(a=mr(e,t)))});else{if(e.issues.length===t)continue;a||(a=mr(e,t))}}return n?n.then(()=>e):e},r=(r,a,o)=>{if(mr(r))return r.aborted=!0,r;const i=t(a,n,o);if(i instanceof Promise){if(!1===o.async)throw new Zt;return i.then(t=>e._zod.parse(t,o))}return e._zod.parse(i,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 i=e._zod.parse(a,o);if(i instanceof Promise){if(!1===o.async)throw new Zt;return i.then(e=>t(e,n,o))}return t(i,n,o)}}e["~standard"]={validate:t=>{try{const r=Cr(e,t);return r.success?{value:r.data}:{issues:r.error?.issues}}catch(r){return _r(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1}}),kn=Bt("$ZodString",(e,t)=>{var r;xn.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}}),Tn=Bt("$ZodStringFormat",(e,t)=>{fn.init(e,t),kn.init(e,t)}),An=Bt("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Zr),Tn.init(e,t)}),En=Bt("$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=Hr(e))}else t.pattern??(t.pattern=Hr());Tn.init(e,t)}),Cn=Bt("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Gr),Tn.init(e,t)}),Nn=Bt("$ZodURL",(e,t)=>{Tn.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:en.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})}}}),_n=Bt("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Tn.init(e,t)}),Rn=Bt("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Wr),Tn.init(e,t)}),On=Bt("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=zr),Tn.init(e,t)}),Dn=Bt("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Ur),Tn.init(e,t)}),Mn=Bt("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Vr),Tn.init(e,t)}),Pn=Bt("$ZodXID",(e,t)=>{t.pattern??(t.pattern=jr),Tn.init(e,t)}),In=Bt("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=$r),Tn.init(e,t)}),Ln=Bt("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=function(e){const t=an({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(`^${rn}T(?:${n})$`)}(t)),Tn.init(e,t)}),Fn=Bt("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=nn),Tn.init(e,t)}),zn=Bt("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=new RegExp(`^${an(t)}$`)),Tn.init(e,t)}),Un=Bt("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Br),Tn.init(e,t)}),Vn=Bt("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Kr),Tn.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.format="ipv4"})}),jn=Bt("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=qr),Tn.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})}}}),$n=Bt("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Jr),Tn.init(e,t)}),Wn=Bt("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Yr),Tn.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 Bn(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const Zn=Bt("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Xr),Tn.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding="base64"}),e._zod.check=r=>{Bn(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});const Hn=Bt("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Qr),Tn.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding="base64url"}),e._zod.check=r=>{(function(e){if(!Qr.test(e))return!1;const t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return Bn(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})}}),Gn=Bt("$ZodE164",(e,t)=>{t.pattern??(t.pattern=tn),Tn.init(e,t)});const Kn=Bt("$ZodJWT",(e,t)=>{Tn.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})}}),qn=Bt("$ZodUnknown",(e,t)=>{xn.init(e,t),e._zod.parse=e=>e}),Jn=Bt("$ZodNever",(e,t)=>{xn.init(e,t),e._zod.parse=(t,r)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)});function Yn(e,t,r){e.issues.length&&t.issues.push(...hr(r,e.issues)),t.value[r]=e.value}const Xn=Bt("$ZodArray",(e,t)=>{xn.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 i=a[e],s=t.element._zod.run({value:i,issues:[]},n);s instanceof Promise?o.push(s.then(t=>Yn(t,r,e))):Yn(s,r,e)}return o.length?Promise.all(o).then(()=>r):r}});function Qn(e,t,r,n){e.issues.length&&t.issues.push(...hr(r,e.issues)),void 0===e.value?r in n&&(t.value[r]=void 0):t.value[r]=e.value}function ea(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 ta(e,t,r,n,a,o){const i=[],s=a.keySet,l=a.catchall._zod,c=l.def.type;for(const a of Object.keys(t)){if(s.has(a))continue;if("never"===c){i.push(a);continue}const o=l.run({value:t[a],issues:[]},n);o instanceof Promise?e.push(o.then(e=>Qn(e,r,a,t))):Qn(o,r,a,t)}return i.length&&r.issues.push({code:"unrecognized_keys",keys:i,input:t,inst:o}),e.length?Promise.all(e).then(()=>r):r}const ra=Bt("$ZodObject",(e,t)=>{xn.init(e,t);const r=Jt(()=>ea(t));er(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=or,a=t.catchall;let o;e._zod.parse=(t,i)=>{o??(o=r.value);const s=t.value;if(!n(s))return t.issues.push({expected:"object",code:"invalid_type",input:s,inst:e}),t;t.value={};const l=[],c=o.shape;for(const e of o.keys){const r=c[e]._zod.run({value:s[e],issues:[]},i);r instanceof Promise?l.push(r.then(r=>Qn(r,t,e,s))):Qn(r,t,e,s)}return a?ta(l,s,t,i,r.value,e):l.length?Promise.all(l).then(()=>t):t}}),na=Bt("$ZodObjectJIT",(e,t)=>{ra.init(e,t);const r=e._zod.parse,n=Jt(()=>ea(t));let a;const o=or,i=!Gt.jitless,s=i&&ir.value,l=t.catchall;let c;e._zod.parse=(u,d)=>{c??(c=n.value);const f=u.value;return o(f)?i&&s&&!1===d?.async&&!0!==d.jitless?(a||(a=(e=>{const t=new wn(["shape","payload","ctx"]),r=n.value,a=e=>{const t=nr(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");const o=Object.create(null);let i=0;for(const e of r.keys)o[e]="key_"+i++;t.write("const newResult = {};");for(const e of r.keys){const r=o[e],n=nr(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 s=t.compile();return(t,r)=>s(e,t,r)})(t.shape)),u=a(u,d),l?ta([],f,u,d,c,e):u):r(u,d):(u.issues.push({expected:"object",code:"invalid_type",input:f,inst:e}),u)}});function aa(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=>!mr(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=>gr(e,n,Kt())))}),t)}const oa=Bt("$ZodUnion",(e,t)=>{xn.init(e,t),er(e._zod,"optin",()=>t.options.some(e=>"optional"===e._zod.optin)?"optional":void 0),er(e._zod,"optout",()=>t.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),er(e._zod,"values",()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),er(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=>Xt(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 i=!1;const s=[];for(const e of t.options){const t=e._zod.run({value:a.value,issues:[]},o);if(t instanceof Promise)s.push(t),i=!0;else{if(0===t.issues.length)return t;s.push(t)}}return i?Promise.all(s).then(t=>aa(t,a,e,o)):aa(s,a,e,o)}}),ia=Bt("$ZodIntersection",(e,t)=>{xn.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])=>la(e,t,r)):la(e,a,o)}});function sa(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(sr(e)&&sr(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=sa(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=sa(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 la(e,t,r){if(t.issues.length&&e.issues.push(...t.issues),r.issues.length&&e.issues.push(...r.issues),mr(e))return e;const n=sa(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 ca=Bt("$ZodEnum",(e,t)=>{xn.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=>cr.has(typeof e)).map(e=>"string"==typeof e?ur(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}}),ua=Bt("$ZodTransform",(e,t)=>{xn.init(e,t),e._zod.parse=(r,n)=>{if("backward"===n.direction)throw new Ht(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 da(e,t){return e.issues.length&&void 0===t?{issues:[],value:void 0}:e}const fa=Bt("$ZodOptional",(e,t)=>{xn.init(e,t),e._zod.optin="optional",e._zod.optout="optional",er(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),er(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${Xt(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=>da(t,e.value)):da(n,e.value)}return void 0===e.value?e:t.innerType._zod.run(e,r)}}),ma=Bt("$ZodNullable",(e,t)=>{xn.init(e,t),er(e._zod,"optin",()=>t.innerType._zod.optin),er(e._zod,"optout",()=>t.innerType._zod.optout),er(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${Xt(e.source)}|null)$`):void 0}),er(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)}),ha=Bt("$ZodDefault",(e,t)=>{xn.init(e,t),e._zod.optin="optional",er(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=>pa(e,t)):pa(n,t)}});function pa(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const ga=Bt("$ZodPrefault",(e,t)=>{xn.init(e,t),e._zod.optin="optional",er(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))}),ya=Bt("$ZodNonOptional",(e,t)=>{xn.init(e,t),er(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=>va(t,e)):va(a,e)}});function va(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 ba=Bt("$ZodCatch",(e,t)=>{xn.init(e,t),er(e._zod,"optin",()=>t.innerType._zod.optin),er(e._zod,"optout",()=>t.innerType._zod.optout),er(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=>gr(e,r,Kt()))},input:e.value}),e.issues=[]),e)):(e.value=n.value,n.issues.length&&(e.value=t.catchValue({...e,error:{issues:n.issues.map(e=>gr(e,r,Kt()))},input:e.value}),e.issues=[]),e)}}),wa=Bt("$ZodPipe",(e,t)=>{xn.init(e,t),er(e._zod,"values",()=>t.in._zod.values),er(e._zod,"optin",()=>t.in._zod.optin),er(e._zod,"optout",()=>t.out._zod.optout),er(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=>Sa(e,t.in,r)):Sa(n,t.in,r)}const n=t.in._zod.run(e,r);return n instanceof Promise?n.then(e=>Sa(e,t.out,r)):Sa(n,t.out,r)}});function Sa(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}const xa=Bt("$ZodReadonly",(e,t)=>{xn.init(e,t),er(e._zod,"propValues",()=>t.innerType._zod.propValues),er(e._zod,"values",()=>t.innerType._zod.values),er(e._zod,"optin",()=>t.innerType._zod.optin),er(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(ka):ka(n)}});function ka(e){return e.value=Object.freeze(e.value),e}const Ta=Bt("$ZodCustom",(e,t)=>{ln.init(e,t),xn.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=>Aa(t,r,n,e));Aa(a,r,n,e)}});function Aa(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(vr(e))}}class Ea{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 Ca(){return new Ea}const Na=Ca();function _a(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...fr(t)})}function Ra(e,t){return new cn({check:"max_length",...fr(t),maximum:e})}function Oa(e,t){return new un({check:"min_length",...fr(t),minimum:e})}function Da(e,t){return new dn({check:"length_equals",...fr(t),length:e})}function Ma(e){return new bn({check:"overwrite",tx:e})}function Pa(e){const t=function(e,t){const r=new ln({check:"custom",...fr(t)});return r._zod.check=e,r}(r=>(r.addIssue=e=>{if("string"==typeof e)r.issues.push(vr(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(vr(n))}},e(r.value,r)));return t}function Ia(e,t){try{var r=e()}catch(e){return t(e)}return r&&r.then?r.then(void 0,t):r}function La(e,t){for(var r={};e.length;){var n=e[0],a=n.code,o=n.message,i=n.path.join(".");if(!r[i])if("unionErrors"in n){var s=n.unionErrors[0].errors[0];r[i]={message:s.message,type:s.code}}else r[i]={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[i].types,c=l&&l[n.code];r[i]=tt(i,t,r,a,c?[].concat(c,n.message):n.message)}e.shift()}return r}function Fa(e,t){for(var r={};e.length;){var n=e[0],a=n.code,o=n.message,i=n.path.join(".");if(!r[i])if("invalid_union"===n.code&&n.errors.length>0){var s=n.errors[0][0];r[i]={message:s.message,type:s.code}}else r[i]={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[i].types,c=l&&l[n.code];r[i]=tt(i,t,r,a,c?[].concat(c,n.message):n.message)}e.shift()}return r}function za(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(Ia(function(){return Promise.resolve(e["sync"===r.mode?"parse":"parseAsync"](n,t)).then(function(e){return o.shouldUseNativeValidation&&Vt({},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:jt(La(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(Ia(function(){return Promise.resolve(("sync"===r.mode?kr:Ar)(e,n,t)).then(function(e){return o.shouldUseNativeValidation&&Vt({},o),{errors:{},values:r.raw?Object.assign({},n):e}})},function(e){if(function(e){return e instanceof wr}(e))return{values:{},errors:jt(Fa(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 Ua(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=Ua(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function Va(){for(var e,t,r=0,n="",a=arguments.length;r<a;r++)(e=arguments[r])&&(t=Ua(e))&&(n&&(n+=" "),n+=t);return n}const ja=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(),$a(r,t)||Ba(e)},getConflictingClassGroupIds:(e,t)=>{const a=r[e]||[];return t&&n[e]?[...a,...n[e]]:a}}},$a=(e,t)=>{if(0===e.length)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),a=n?$a(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},Wa=/^\[(.+)\]$/,Ba=e=>{if(Wa.test(e)){const t=Wa.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)Ha(r[e],n,e,t);return n},Ha=(e,t,r,n)=>{e.forEach(e=>{if("string"==typeof e){return void((""===e?t:Ga(t,e)).classGroupId=r)}if("function"==typeof e)return Ka(e)?void Ha(e(n),t,r,n):void t.validators.push({validator:e,classGroupId:r});Object.entries(e).forEach(([e,a])=>{Ha(a,Ga(t,e),r,n)})})},Ga=(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},Ka=e=>e.isThemeGetter,qa=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)}}},Ja=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=e=>{const t=[];let r,n=0,a=0,o=0;for(let i=0;i<e.length;i++){let s=e[i];if(0===n&&0===a){if(":"===s){t.push(e.slice(o,i)),o=i+1;continue}if("/"===s){r=i;continue}}"["===s?n++:"]"===s?n--:"("===s?a++:")"===s&&a--}const i=0===t.length?e:e.substring(o),s=Ya(i);return{modifiers:t,hasImportantModifier:s!==i,baseClassName:s,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},Ya=e=>e.endsWith("!")?e.substring(0,e.length-1):e.startsWith("!")?e.substring(1):e,Xa=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}},Qa=/\s+/;function eo(){let e,t,r=0,n="";for(;r<arguments.length;)(e=arguments[r++])&&(t=to(e))&&(n&&(n+=" "),n+=t);return n}const to=e=>{if("string"==typeof e)return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=to(e[n]))&&(r&&(r+=" "),r+=t);return r};function ro(e,...t){let r,n,a,o=function(s){const l=t.reduce((e,t)=>t(e),e());return r=(e=>({cache:qa(e.cacheSize),parseClassName:Ja(e),sortModifiers:Xa(e),...ja(e)}))(l),n=r.cache.get,a=r.cache.set,o=i,i(s)};function i(e){const t=n(e);if(t)return t;const o=((e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:a,sortModifiers:o}=t,i=[],s=e.trim().split(Qa);let l="";for(let e=s.length-1;e>=0;e-=1){const t=s[e],{isExternal:c,modifiers:u,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:m}=r(t);if(c){l=t+(l.length>0?" "+l:l);continue}let h=!!m,p=n(h?f.substring(0,m):f);if(!p){if(!h){l=t+(l.length>0?" "+l:l);continue}if(p=n(f),!p){l=t+(l.length>0?" "+l:l);continue}h=!1}const g=o(u).join(":"),y=d?g+"!":g,v=y+p;if(i.includes(v))continue;i.push(v);const b=a(p,h);for(let e=0;e<b.length;++e){const t=b[e];i.push(y+t)}l=t+(l.length>0?" "+l:l)}return l})(e,r);return a(e,o),o}return function(){return o(eo.apply(null,arguments))}}const no=e=>{const t=t=>t[e]||[];return t.isThemeGetter=!0,t},ao=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,oo=/^\((?:(\w[\w-]*):)?(.+)\)$/i,io=/^\d+\/\d+$/,so=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,lo=/\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$/,co=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,uo=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,fo=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,mo=e=>io.test(e),ho=e=>!!e&&!Number.isNaN(Number(e)),po=e=>!!e&&Number.isInteger(Number(e)),go=e=>e.endsWith("%")&&ho(e.slice(0,-1)),yo=e=>so.test(e),vo=()=>!0,bo=e=>lo.test(e)&&!co.test(e),wo=()=>!1,So=e=>uo.test(e),xo=e=>fo.test(e),ko=e=>!Ao(e)&&!Oo(e),To=e=>zo(e,$o,wo),Ao=e=>ao.test(e),Eo=e=>zo(e,Wo,bo),Co=e=>zo(e,Bo,ho),No=e=>zo(e,Vo,wo),_o=e=>zo(e,jo,xo),Ro=e=>zo(e,Ho,So),Oo=e=>oo.test(e),Do=e=>Uo(e,Wo),Mo=e=>Uo(e,Zo),Po=e=>Uo(e,Vo),Io=e=>Uo(e,$o),Lo=e=>Uo(e,jo),Fo=e=>Uo(e,Ho,!0),zo=(e,t,r)=>{const n=ao.exec(e);return!!n&&(n[1]?t(n[1]):r(n[2]))},Uo=(e,t,r=!1)=>{const n=oo.exec(e);return!!n&&(n[1]?t(n[1]):r)},Vo=e=>"position"===e||"percentage"===e,jo=e=>"image"===e||"url"===e,$o=e=>"length"===e||"size"===e||"bg-size"===e,Wo=e=>"length"===e,Bo=e=>"number"===e,Zo=e=>"family-name"===e,Ho=e=>"shadow"===e,Go=ro(()=>{const e=no("color"),t=no("font"),r=no("text"),n=no("font-weight"),a=no("tracking"),o=no("leading"),i=no("breakpoint"),s=no("container"),l=no("spacing"),c=no("radius"),u=no("shadow"),d=no("inset-shadow"),f=no("text-shadow"),m=no("drop-shadow"),h=no("blur"),p=no("perspective"),g=no("aspect"),y=no("ease"),v=no("animate"),b=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",Oo,Ao],w=()=>[Oo,Ao,l],S=()=>[mo,"full","auto",...w()],x=()=>[po,"none","subgrid",Oo,Ao],k=()=>["auto",{span:["full",po,Oo,Ao]},po,Oo,Ao],T=()=>[po,"auto",Oo,Ao],A=()=>["auto","min","max","fr",Oo,Ao],E=()=>["auto",...w()],C=()=>[mo,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...w()],N=()=>[e,Oo,Ao],_=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",Po,No,{position:[Oo,Ao]}],R=()=>["auto","cover","contain",Io,To,{size:[Oo,Ao]}],O=()=>[go,Do,Eo],D=()=>["","none","full",c,Oo,Ao],M=()=>["",ho,Do,Eo],P=()=>[ho,go,Po,No],I=()=>["","none",h,Oo,Ao],L=()=>["none",ho,Oo,Ao],F=()=>["none",ho,Oo,Ao],z=()=>[ho,Oo,Ao],U=()=>[mo,"full",...w()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[yo],breakpoint:[yo],color:[vo],container:[yo],"drop-shadow":[yo],ease:["in","out","in-out"],font:[ko],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[yo],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[yo],shadow:[yo],spacing:["px",ho],text:[yo],"text-shadow":[yo],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",mo,Ao,Oo,g]}],container:["container"],columns:[{columns:[ho,Ao,Oo,s]}],"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:b()}],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:S()}],"inset-x":[{"inset-x":S()}],"inset-y":[{"inset-y":S()}],start:[{start:S()}],end:[{end:S()}],top:[{top:S()}],right:[{right:S()}],bottom:[{bottom:S()}],left:[{left:S()}],visibility:["visible","invisible","collapse"],z:[{z:[po,"auto",Oo,Ao]}],basis:[{basis:[mo,"full","auto",s,...w()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ho,mo,"auto","initial","none",Ao]}],grow:[{grow:["",ho,Oo,Ao]}],shrink:[{shrink:["",ho,Oo,Ao]}],order:[{order:[po,"first","last","none",Oo,Ao]}],"grid-cols":[{"grid-cols":x()}],"col-start-end":[{col:k()}],"col-start":[{"col-start":T()}],"col-end":[{"col-end":T()}],"grid-rows":[{"grid-rows":x()}],"row-start-end":[{row:k()}],"row-start":[{"row-start":T()}],"row-end":[{"row-end":T()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":A()}],"auto-rows":[{"auto-rows":A()}],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:E()}],mx:[{mx:E()}],my:[{my:E()}],ms:[{ms:E()}],me:[{me:E()}],mt:[{mt:E()}],mr:[{mr:E()}],mb:[{mb:E()}],ml:[{ml:E()}],"space-x":[{"space-x":w()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":w()}],"space-y-reverse":["space-y-reverse"],size:[{size:C()}],w:[{w:[s,"screen",...C()]}],"min-w":[{"min-w":[s,"screen","none",...C()]}],"max-w":[{"max-w":[s,"screen","none","prose",{screen:[i]},...C()]}],h:[{h:["screen","lh",...C()]}],"min-h":[{"min-h":["screen","lh","none",...C()]}],"max-h":[{"max-h":["screen","lh",...C()]}],"font-size":[{text:["base",r,Do,Eo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,Oo,Co]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",go,Ao]}],"font-family":[{font:[Mo,Ao,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,Oo,Ao]}],"line-clamp":[{"line-clamp":[ho,"none",Oo,Co]}],leading:[{leading:[o,...w()]}],"list-image":[{"list-image":["none",Oo,Ao]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Oo,Ao]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:N()}],"text-color":[{text:N()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","wavy"]}],"text-decoration-thickness":[{decoration:[ho,"from-font","auto",Oo,Eo]}],"text-decoration-color":[{decoration:N()}],"underline-offset":[{"underline-offset":[ho,"auto",Oo,Ao]}],"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",Oo,Ao]}],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",Oo,Ao]}],"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:R()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},po,Oo,Ao],radial:["",Oo,Ao],conic:[po,Oo,Ao]},Lo,_o]}],"bg-color":[{bg:N()}],"gradient-from-pos":[{from:O()}],"gradient-via-pos":[{via:O()}],"gradient-to-pos":[{to:O()}],"gradient-from":[{from:N()}],"gradient-via":[{via:N()}],"gradient-to":[{to:N()}],rounded:[{rounded:D()}],"rounded-s":[{"rounded-s":D()}],"rounded-e":[{"rounded-e":D()}],"rounded-t":[{"rounded-t":D()}],"rounded-r":[{"rounded-r":D()}],"rounded-b":[{"rounded-b":D()}],"rounded-l":[{"rounded-l":D()}],"rounded-ss":[{"rounded-ss":D()}],"rounded-se":[{"rounded-se":D()}],"rounded-ee":[{"rounded-ee":D()}],"rounded-es":[{"rounded-es":D()}],"rounded-tl":[{"rounded-tl":D()}],"rounded-tr":[{"rounded-tr":D()}],"rounded-br":[{"rounded-br":D()}],"rounded-bl":[{"rounded-bl":D()}],"border-w":[{border:M()}],"border-w-x":[{"border-x":M()}],"border-w-y":[{"border-y":M()}],"border-w-s":[{"border-s":M()}],"border-w-e":[{"border-e":M()}],"border-w-t":[{"border-t":M()}],"border-w-r":[{"border-r":M()}],"border-w-b":[{"border-b":M()}],"border-w-l":[{"border-l":M()}],"divide-x":[{"divide-x":M()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":M()}],"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:N()}],"border-color-x":[{"border-x":N()}],"border-color-y":[{"border-y":N()}],"border-color-s":[{"border-s":N()}],"border-color-e":[{"border-e":N()}],"border-color-t":[{"border-t":N()}],"border-color-r":[{"border-r":N()}],"border-color-b":[{"border-b":N()}],"border-color-l":[{"border-l":N()}],"divide-color":[{divide:N()}],"outline-style":[{outline:["solid","dashed","dotted","double","none","hidden"]}],"outline-offset":[{"outline-offset":[ho,Oo,Ao]}],"outline-w":[{outline:["",ho,Do,Eo]}],"outline-color":[{outline:N()}],shadow:[{shadow:["","none",u,Fo,Ro]}],"shadow-color":[{shadow:N()}],"inset-shadow":[{"inset-shadow":["none",d,Fo,Ro]}],"inset-shadow-color":[{"inset-shadow":N()}],"ring-w":[{ring:M()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:N()}],"ring-offset-w":[{"ring-offset":[ho,Eo]}],"ring-offset-color":[{"ring-offset":N()}],"inset-ring-w":[{"inset-ring":M()}],"inset-ring-color":[{"inset-ring":N()}],"text-shadow":[{"text-shadow":["none",f,Fo,Ro]}],"text-shadow-color":[{"text-shadow":N()}],opacity:[{opacity:[ho,Oo,Ao]}],"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":[ho]}],"mask-image-linear-from-pos":[{"mask-linear-from":P()}],"mask-image-linear-to-pos":[{"mask-linear-to":P()}],"mask-image-linear-from-color":[{"mask-linear-from":N()}],"mask-image-linear-to-color":[{"mask-linear-to":N()}],"mask-image-t-from-pos":[{"mask-t-from":P()}],"mask-image-t-to-pos":[{"mask-t-to":P()}],"mask-image-t-from-color":[{"mask-t-from":N()}],"mask-image-t-to-color":[{"mask-t-to":N()}],"mask-image-r-from-pos":[{"mask-r-from":P()}],"mask-image-r-to-pos":[{"mask-r-to":P()}],"mask-image-r-from-color":[{"mask-r-from":N()}],"mask-image-r-to-color":[{"mask-r-to":N()}],"mask-image-b-from-pos":[{"mask-b-from":P()}],"mask-image-b-to-pos":[{"mask-b-to":P()}],"mask-image-b-from-color":[{"mask-b-from":N()}],"mask-image-b-to-color":[{"mask-b-to":N()}],"mask-image-l-from-pos":[{"mask-l-from":P()}],"mask-image-l-to-pos":[{"mask-l-to":P()}],"mask-image-l-from-color":[{"mask-l-from":N()}],"mask-image-l-to-color":[{"mask-l-to":N()}],"mask-image-x-from-pos":[{"mask-x-from":P()}],"mask-image-x-to-pos":[{"mask-x-to":P()}],"mask-image-x-from-color":[{"mask-x-from":N()}],"mask-image-x-to-color":[{"mask-x-to":N()}],"mask-image-y-from-pos":[{"mask-y-from":P()}],"mask-image-y-to-pos":[{"mask-y-to":P()}],"mask-image-y-from-color":[{"mask-y-from":N()}],"mask-image-y-to-color":[{"mask-y-to":N()}],"mask-image-radial":[{"mask-radial":[Oo,Ao]}],"mask-image-radial-from-pos":[{"mask-radial-from":P()}],"mask-image-radial-to-pos":[{"mask-radial-to":P()}],"mask-image-radial-from-color":[{"mask-radial-from":N()}],"mask-image-radial-to-color":[{"mask-radial-to":N()}],"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":[ho]}],"mask-image-conic-from-pos":[{"mask-conic-from":P()}],"mask-image-conic-to-pos":[{"mask-conic-to":P()}],"mask-image-conic-from-color":[{"mask-conic-from":N()}],"mask-image-conic-to-color":[{"mask-conic-to":N()}],"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:R()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Oo,Ao]}],filter:[{filter:["","none",Oo,Ao]}],blur:[{blur:I()}],brightness:[{brightness:[ho,Oo,Ao]}],contrast:[{contrast:[ho,Oo,Ao]}],"drop-shadow":[{"drop-shadow":["","none",m,Fo,Ro]}],"drop-shadow-color":[{"drop-shadow":N()}],grayscale:[{grayscale:["",ho,Oo,Ao]}],"hue-rotate":[{"hue-rotate":[ho,Oo,Ao]}],invert:[{invert:["",ho,Oo,Ao]}],saturate:[{saturate:[ho,Oo,Ao]}],sepia:[{sepia:["",ho,Oo,Ao]}],"backdrop-filter":[{"backdrop-filter":["","none",Oo,Ao]}],"backdrop-blur":[{"backdrop-blur":I()}],"backdrop-brightness":[{"backdrop-brightness":[ho,Oo,Ao]}],"backdrop-contrast":[{"backdrop-contrast":[ho,Oo,Ao]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ho,Oo,Ao]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ho,Oo,Ao]}],"backdrop-invert":[{"backdrop-invert":["",ho,Oo,Ao]}],"backdrop-opacity":[{"backdrop-opacity":[ho,Oo,Ao]}],"backdrop-saturate":[{"backdrop-saturate":[ho,Oo,Ao]}],"backdrop-sepia":[{"backdrop-sepia":["",ho,Oo,Ao]}],"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",Oo,Ao]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ho,"initial",Oo,Ao]}],ease:[{ease:["linear","initial",y,Oo,Ao]}],delay:[{delay:[ho,Oo,Ao]}],animate:[{animate:["none",v,Oo,Ao]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[p,Oo,Ao]}],"perspective-origin":[{"perspective-origin":b()}],rotate:[{rotate:L()}],"rotate-x":[{"rotate-x":L()}],"rotate-y":[{"rotate-y":L()}],"rotate-z":[{"rotate-z":L()}],scale:[{scale:F()}],"scale-x":[{"scale-x":F()}],"scale-y":[{"scale-y":F()}],"scale-z":[{"scale-z":F()}],"scale-3d":["scale-3d"],skew:[{skew:z()}],"skew-x":[{"skew-x":z()}],"skew-y":[{"skew-y":z()}],transform:[{transform:[Oo,Ao,"","none","gpu","cpu"]}],"transform-origin":[{origin:b()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:U()}],"translate-x":[{"translate-x":U()}],"translate-y":[{"translate-y":U()}],"translate-z":[{"translate-z":U()}],"translate-none":["translate-none"],accent:[{accent:N()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:N()}],"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",Oo,Ao]}],"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",Oo,Ao]}],fill:[{fill:["none",...N()]}],"stroke-w":[{stroke:[ho,Do,Eo,Co]}],stroke:[{stroke:["none",...N()]}],"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 Ko(...e){return Go(Va(e))}function qo(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function Jo(...e){return t=>{let r=!1;const n=e.map(e=>{const n=qo(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():qo(e[t],null)}}}}function Yo(...e){return n.useCallback(Jo(...e),e)}function Xo(t){const r=ei(t),a=n.forwardRef((t,a)=>{const{children:o,...i}=t,s=n.Children.toArray(o),l=s.find(ri);if(l){const t=l.props.children,o=s.map(e=>e===l?n.Children.count(t)>1?n.Children.only(null):n.isValidElement(t)?t.props.children:null:e);return e(r,{...i,ref:a,children:n.isValidElement(t)?n.cloneElement(t,void 0,o):null})}return e(r,{...i,ref:a,children:o})});return a.displayName=`${t}.Slot`,a}var Qo=Xo("Slot");function ei(e){const t=n.forwardRef((e,t)=>{const{children:r,...a}=e;if(n.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}}(a,r.props);return r.type!==n.Fragment&&(o.ref=t?Jo(t,e):e),n.cloneElement(r,o)}return n.Children.count(r)>1?n.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ti=Symbol("radix.slottable");function ri(e){return n.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===ti}const ni=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,ai=Va,oi=(e,t)=>r=>{var n;if(null==(null==t?void 0:t.variants))return ai(e,null==r?void 0:r.class,null==r?void 0:r.className);const{variants:a,defaultVariants:o}=t,i=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 i=ni(t)||ni(n);return a[e][i]}),s=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,...s}[t]):{...o,...s}[t]===r})?[...e,r,n]:e},[]);return ai(e,i,l,null==r?void 0:r.class,null==r?void 0:r.className)},ii=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),si=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)},li=(...e)=>e.filter((e,t,r)=>Boolean(e)&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim(),ci=e=>{for(const t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0};
|
|
1
|
+
import{jsx as e,Fragment as t,jsxs as r}from"react/jsx-runtime";import*as n from"react";import a,{createContext as o,useReducer as i,useMemo as s,useCallback as l,useEffect as c,forwardRef as d,createElement as u,useState as f,useRef as m,useLayoutEffect as p}from"react";import*as h from"react-dom";import g from"react-dom";var v;!function(e){e.V1="v1"}(v||(v={}));const b=()=>({type:"AUTHENTICATION_STARTED"}),y=()=>({type:"AUTHENTICATION_FAILED"}),w=e=>({type:"SET_SESSION",payload:e}),x=()=>({type:"REMOVE_SESSION"});function S({name:t,initialState:r,reducer:n,initializer:l}){const c=o(null),d=o(null),u=o(null),f=a.memo(({children:t})=>{const[a,o]=i(n,r,l||(e=>e)),f=s(()=>({state:a,dispatch:o}),[a,o]);return e(u.Provider,{value:f,children:e(c.Provider,{value:a,children:e(d.Provider,{value:o,children:t})})})});f.displayName=`${t}Provider`;const m=()=>{const e=a.useContext(c);if(null===e)throw new Error(`use${t}State must be used within a ${t}Provider. Make sure SaaSOSProvider is wrapping your application.`);return e};return{Provider:f,useContext:()=>{const e=a.useContext(u);if(!e)throw new Error(`use${t}Context must be used within a ${t}Provider. Make sure SaaSOSProvider is wrapping your application.`);return e},useState:m,useDispatch:()=>{const e=a.useContext(d);if(null===e)throw new Error(`use${t}Dispatch must be used within a ${t}Provider. Make sure SaaSOSProvider is wrapping your application.`);return e},useSelector:(e,t)=>{const r=m(),n=e||(e=>e),o=a.useRef(n),i=a.useRef(t),l=a.useRef(void 0),c=a.useRef(r);e&&(o.current=n),t&&(i.current=t);return s(()=>{const e=o.current(r);if(void 0!==l.current){if((i.current?i.current(l.current,e):Object.is(l.current,e))&&c.current===r)return l.current}return l.current=e,c.current=r,e},[r])}}}var k;function A(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 E(e,t){if("undefined"!=typeof window)try{localStorage.setItem(e,t)}catch(t){console.warn(`Failed to save ${e} to localStorage:`,t)}}function C(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"}(k||(k={}));const T="code",N="saas-session-id";function _(){C(N)}function R(){if("undefined"==typeof window)return null;try{return A(N)}catch(e){return console.warn("Failed to get sessionId from localStorage:",e),null}}function P(){const e=R(),t={};return e&&(t["x-session-id"]=e),t}function O(e,t){return{user:e,sessionId:t,expires:new Date(Date.now()+864e5).toISOString()}}const D=()=>({session:null,isLoading:!1,isAuthenticated:!1,isRedirecting:!1,status:k.unauthenticated}),{Provider:I,useState:M,useDispatch:U}=S({name:"Auth",initialState:D(),reducer:(e,t)=>{switch(t.type){case"AUTHENTICATION_STARTED":return{...e,isLoading:!0,isAuthenticated:!1,isRedirecting:!0,status:k.authenticating};case"AUTHENTICATION_FAILED":return{...e,isLoading:!1,isAuthenticated:!1,isRedirecting:!1,status:k.unauthenticated};case"SET_SESSION":{const n=t.payload;return r=n.sessionId,E(N,r),{...e,session:n,isAuthenticated:!0,isRedirecting:!1,isLoading:!1,status:k.authenticated}}case"REMOVE_SESSION":return _(),{...e,session:null,isLoading:!1,isAuthenticated:!1,isRedirecting:!1,status:k.unauthenticated};default:return e}var r},initializer:D}),L=I,z=M,F=U,j=e=>({type:"SET_SAAS_OS_CONFIG",payload:e}),B=e=>({type:"SET_SETTINGS",payload:e}),V=()=>({serverUrl:"",version:v.V1,orgId:"",settings:null}),{Provider:$,useState:W,useDispatch:G}=S({name:"OS",initialState:V(),reducer:(e,t)=>{switch(t.type){case"SET_SAAS_OS_CONFIG":return{...e,...t.payload};case"REMOVE_SAAS_OS_CONFIG":return V();case"SET_SETTINGS":return{...e,settings:t.payload};default:return e}}}),K=$,H=W,Z=G,q=e=>({type:"SET_WORKSPACES",payload:e}),J=e=>({type:"SET_ALL_FEATURES",payload:e}),Y=e=>({type:"SET_CURRENT_WORKSPACE",payload:e}),X=()=>({type:"RESET_CURRENT_WORKSPACE"}),Q=e=>({type:"SET_IS_INITIALIZED",payload:e}),ee=e=>({type:"SET_LOADING",payload:e}),te=e=>({type:"SET_ERROR",payload:e}),re=e=>({type:"SET_REFRESHING",payload:e}),ne="saas-workspace-current";const{Provider:ae,useState:oe,useDispatch:ie}=S({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)?E(ne,r):C(ne),{...e,currentWorkspace:t.payload};case"RESET_CURRENT_WORKSPACE":return C(ne),{...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}}),se=ae,le=oe,ce=ie,de=a.memo(({children:t})=>e(K,{children:e(L,{children:e(se,{children:t})})}));function ue(e,t){const r=H(),n=z(),o=le(),i=s(()=>({os:r,auth:n,workspaces:o}),[r,n,o]),l=e||(e=>e),c=a.useRef(l),d=a.useRef(t),u=a.useRef(void 0),f=a.useRef(i);e&&(c.current=l);return s(()=>{const e=c.current(i);if(void 0!==u.current){if((d.current?d.current(u.current,e):Object.is(u.current,e))&&f.current===i)return u.current}return u.current=e,f.current=i,e},[i])}function fe(){const e=F(),t=Z(),r=ce();return s(()=>({auth:e,os:t,workspaces:r}),[e,t,r])}de.displayName="SDKContextProvider";const me=a.memo(({children:r,callbacks:n})=>{const o=fe(),i=ue(e=>e.auth),d=ue(e=>e.os),u=a.useRef(!1),f=a.useRef(null),m=s(()=>n,[n]),p=l(async e=>{try{if(m?.handleAuthentication){const{sessionId:t}=await m.handleAuthentication(e);if(!t||"string"!=typeof t||""===t.trim())throw new Error("Invalid sessionId received from authentication callback");const r=d,{serverUrl:n,version:a,orgId:i}=r;if(!n||!a||!i)throw new Error("OS configuration is not available");const s=await fetch(`${n}/api/${a}/public/profile`,{headers:{"x-session-id":t,"Content-Type":"application/json"}});if(!s.ok)throw new Error("Failed to fetch user profile");let l;try{l=await s.json()}catch(e){throw new Error("Failed to parse user profile response")}const c=O({id:l._id||l.id,name:l.name||"",org:i,email:l.email||"",emailVerified:!0,clientId:r.auth?.clientId||"",role:l.role||"",image:l.image},t);o.auth(w(c)),function(){try{const e=new URL(window.location.href);e.searchParams.delete(T),window.history.replaceState({},"",e.toString())}catch(e){console.error("Error removing token from URL:",e)}}()}}catch(e){throw console.error("Auth redirect error:",e),o.auth(y()),e}},[o,m,d]);return c(()=>{if("undefined"==typeof window)return;if(i.isAuthenticated)return;const e=R();if(!e)return;(async()=>{try{const{serverUrl:t,version:r,orgId:n}=d;if(!t||!r||!n)return void console.warn("OS configuration not available, cannot fetch user profile");const a=await fetch(`${t}/api/${r}/public/profile`,{headers:{"x-session-id":e,"Content-Type":"application/json"}});if(!a.ok)return console.warn("Session invalid, removing from localStorage"),void _();let i;try{i=await a.json()}catch(e){return console.error("Failed to parse user profile response:",e),void _()}const s=O({id:i._id||i.id,name:i.name||"",org:n,email:i.email||"",emailVerified:!0,clientId:d.auth?.clientId||"",role:i.role||"",image:i.image},e);o.auth(w(s))}catch(e){console.error("Failed to fetch user profile on page load:",e),_()}})()},[i.isAuthenticated,o,d]),c(()=>{const e=function(){if("undefined"==typeof window)return null;try{return new URLSearchParams(window.location.search).get(T)}catch(e){return console.error("Error getting token from URL:",e),null}}();if(!e)return;if(u.current||f.current===e)return;const{serverUrl:t,version:r,orgId:n}=d;t&&r&&n&&(u.current=!0,f.current=e,p(e).then(()=>{f.current=null}).catch(e=>{console.error("Failed to handle auth redirect:",e),f.current=null}).finally(()=>{u.current=!1}))},[p,d.serverUrl,d.version,d.orgId]),e(t,{children:r})});me.displayName="AuthProviderWrapper";const pe=a.memo(({config:r,auth:n,children:o})=>{const i=fe(),s=ue(e=>e.os),l=a.useMemo(()=>({clientId:n?.clientId||"",redirectUrl:n?.redirectUrl||"",callbacks:n?.callbacks}),[n?.clientId,n?.redirectUrl,n?.callbacks]);c(()=>{i.os(j({...r,auth:l}))},[r,l,i]),c(()=>{const{serverUrl:e,version:t,orgId:r,settings:n}=s;if(e&&t&&r&&!n){(async()=>{try{const n=P(),a=await fetch(`${e}/api/${t}/public/${r}/settings`,{headers:n});if(a.ok){const e=await a.json();i.os(B(e))}}catch(e){console.error("Failed to fetch settings:",e)}})()}},[s.serverUrl,s.version,s.orgId,s.settings,i]);const d=a.useMemo(()=>o,[o]);return e(t,{children:d})});pe.displayName="ContextConfigProvider";const he=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})}},ge=o({container:null,setContainer:()=>{}}),ve=a.memo(({children:t})=>{const[n,o]=a.useState(null),i=a.useMemo(()=>({container:n,setContainer:o}),[n]),s=a.useMemo(()=>t,[t]);return r(ge.Provider,{value:i,children:[s,e("div",{ref:o,id:"saas-os-portal",className:"saas-os-ui",style:{width:"100%",height:"100%"}})]})});ve.displayName="PortalProvider";const be=(e,t,r)=>{if(t!==v.V1)throw new Error(`Invalid version: "${t}". Only "${v.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).`)},ye=a.memo(({serverUrl:t,version:r,orgId:n,auth:o,children:i})=>{be(t,r,n);const s=a.useMemo(()=>({serverUrl:t,version:r,orgId:n}),[t,r,n]),l=a.useMemo(()=>o?.callbacks,[o?.callbacks]),d=a.useMemo(()=>o?.callbacks?.handleEvent,[o?.callbacks]);return c(()=>(he.setCallbacks(d?{handleEvent:d}:null),()=>{he.setCallbacks(null)}),[d]),e(de,{children:e(me,{callbacks:l,children:e(ve,{children:e(pe,{config:s,auth:o,children:i})})})})});ye.displayName="SaaSOSProvider";var we=e=>"checkbox"===e.type,xe=e=>e instanceof Date,Se=e=>null==e;const ke=e=>"object"==typeof e;var Ae=e=>!Se(e)&&!Array.isArray(e)&&ke(e)&&!xe(e),Ee=e=>Ae(e)&&e.target?we(e.target)?e.target.checked:e.target.value:e,Ce=(e,t)=>e.has((e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e)(t)),Te="undefined"!=typeof window&&void 0!==window.HTMLElement&&"undefined"!=typeof document;function Ne(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(Te&&(e instanceof Blob||n)||!r&&!Ae(e))return e;if(t=r?[]:Object.create(Object.getPrototypeOf(e)),r||(e=>{const t=e.constructor&&e.constructor.prototype;return Ae(t)&&t.hasOwnProperty("isPrototypeOf")})(e))for(const r in e)e.hasOwnProperty(r)&&(t[r]=Ne(e[r]));else t=e}return t}var _e=e=>/^\w*$/.test(e),Re=e=>void 0===e,Pe=e=>Array.isArray(e)?e.filter(Boolean):[],Oe=e=>Pe(e.replace(/["|']|\]/g,"").split(/\.|\[/)),De=(e,t,r)=>{if(!t||!Ae(e))return r;const n=(_e(t)?[t]:Oe(t)).reduce((e,t)=>Se(e)?e:e[t],e);return Re(n)||n===e?Re(e[t])?r:e[t]:n},Ie=e=>"boolean"==typeof e,Me=(e,t,r)=>{let n=-1;const a=_e(t)?[t]:Oe(t),o=a.length,i=o-1;for(;++n<o;){const t=a[n];let o=r;if(n!==i){const r=e[t];o=Ae(r)||Array.isArray(r)?r:isNaN(+a[n+1])?{}:[]}if("__proto__"===t||"constructor"===t||"prototype"===t)return;e[t]=o,e=e[t]}};const Ue="blur",Le="focusout",ze="change",Fe="onBlur",je="onChange",Be="onSubmit",Ve="onTouched",$e="all",We="max",Ge="min",Ke="maxLength",He="minLength",Ze="pattern",qe="required",Je="validate",Ye=a.createContext(null);Ye.displayName="HookFormContext";const Xe=()=>a.useContext(Ye),Qe=e=>{const{children:t,...r}=e;return a.createElement(Ye.Provider,{value:r},t)};var et=(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]!==$e&&(t._proxyFormState[a]=!n||$e),r&&(r[a]=!0),e[a]}});return a};const tt="undefined"!=typeof window?a.useLayoutEffect:a.useEffect;var rt=e=>"string"==typeof e,nt=(e,t,r,n,a)=>rt(e)?(n&&t.watch.add(e),De(r,e,a)):Array.isArray(e)?e.map(e=>(n&&t.watch.add(e),De(r,e))):(n&&(t.watchAll=!0),r),at=e=>Se(e)||!ke(e);function ot(e,t,r=new WeakSet){if(at(e)||at(t))return e===t;if(xe(e)&&xe(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(xe(n)&&xe(e)||Ae(n)&&Ae(e)||Array.isArray(n)&&Array.isArray(e)?!ot(n,e,r):n!==e)return!1}}return!0}function it(e){const t=Xe(),{name:r,disabled:n,control:o=t.control,shouldUnregister:i,defaultValue:s}=e,l=Ce(o._names.array,r),c=a.useMemo(()=>De(o._formValues,r,De(o._defaultValues,r,s)),[o,r,s]),d=function(e){const t=Xe(),{control:r=t.control,name:n,defaultValue:o,disabled:i,exact:s,compute:l}=e||{},c=a.useRef(o),d=a.useRef(l),u=a.useRef(void 0);d.current=l;const f=a.useMemo(()=>r._getWatch(n,c.current),[r,n]),[m,p]=a.useState(d.current?d.current(f):f);return tt(()=>r._subscribe({name:n,formState:{values:!0},exact:s,callback:e=>{if(!i){const t=nt(n,r._names,e.values||r._formValues,!1,c.current);if(d.current){const e=d.current(t);ot(e,u.current)||(p(e),u.current=e)}else p(t)}}}),[r,i,n,s]),a.useEffect(()=>r._removeUnmounted()),m}({control:o,name:r,defaultValue:c,exact:!0}),u=function(e){const t=Xe(),{control:r=t.control,disabled:n,name:o,exact:i}=e||{},[s,l]=a.useState(r._formState),c=a.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return tt(()=>r._subscribe({name:o,formState:c.current,exact:i,callback:e=>{!n&&l({...r._formState,...e})}}),[o,n,i]),a.useEffect(()=>{c.current.isValid&&r._setValid(!0)},[r]),a.useMemo(()=>et(s,r,c.current,!1),[s,r])}({control:o,name:r,exact:!0}),f=a.useRef(e),m=a.useRef(o.register(r,{...e.rules,value:d,...Ie(e.disabled)?{disabled:e.disabled}:{}}));f.current=e;const p=a.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!De(u.errors,r)},isDirty:{enumerable:!0,get:()=>!!De(u.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!De(u.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!De(u.validatingFields,r)},error:{enumerable:!0,get:()=>De(u.errors,r)}}),[u,r]),h=a.useCallback(e=>m.current.onChange({target:{value:Ee(e),name:r},type:ze}),[r]),g=a.useCallback(()=>m.current.onBlur({target:{value:De(o._formValues,r),name:r},type:Ue}),[r,o._formValues]),v=a.useCallback(e=>{const t=De(o._fields,r);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,r]),b=a.useMemo(()=>({name:r,value:d,...Ie(n)||u.disabled?{disabled:u.disabled||n}:{},onChange:h,onBlur:g,ref:v}),[r,n,u.disabled,h,g,v,d]);return a.useEffect(()=>{const e=o._options.shouldUnregister||i;o.register(r,{...f.current.rules,...Ie(f.current.disabled)?{disabled:f.current.disabled}:{}});const t=(e,t)=>{const r=De(o._fields,e);r&&r._f&&(r._f.mount=t)};if(t(r,!0),e){const e=Ne(De(o._options.defaultValues,r));Me(o._defaultValues,r,e),Re(De(o._formValues,r))&&Me(o._formValues,r,e)}return!l&&o.register(r),()=>{(l?e&&!o._state.action:e)?o.unregister(r):t(r,!1)}},[r,o,l,i]),a.useEffect(()=>{o._setDisabledField({disabled:n,name:r})},[n,r,o]),a.useMemo(()=>({field:b,formState:u,fieldState:p}),[b,u,p])}const st=e=>e.render(it(e));var lt=(e,t,r,n,a)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:a||!0}}:{},ct=e=>Array.isArray(e)?e:[e],dt=()=>{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=[]}}},ut=e=>Ae(e)&&!Object.keys(e).length,ft=e=>"file"===e.type,mt=e=>"function"==typeof e,pt=e=>{if(!Te)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},ht=e=>"select-multiple"===e.type,gt=e=>"radio"===e.type,vt=e=>pt(e)&&e.isConnected;function bt(e,t){const r=Array.isArray(t)?t:_e(t)?[t]:Oe(t),n=1===r.length?e:function(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;)e=Re(e)?n++:e[t[n++]];return e}(e,r),a=r.length-1,o=r[a];return n&&delete n[o],0!==a&&(Ae(n)&&ut(n)||Array.isArray(n)&&function(e){for(const t in e)if(e.hasOwnProperty(t)&&!Re(e[t]))return!1;return!0}(n))&&bt(e,r.slice(0,-1)),e}var yt=e=>{for(const t in e)if(mt(e[t]))return!0;return!1};function wt(e,t={}){const r=Array.isArray(e);if(Ae(e)||r)for(const r in e)Array.isArray(e[r])||Ae(e[r])&&!yt(e[r])?(t[r]=Array.isArray(e[r])?[]:{},wt(e[r],t[r])):Se(e[r])||(t[r]=!0);return t}function xt(e,t,r){const n=Array.isArray(e);if(Ae(e)||n)for(const n in e)Array.isArray(e[n])||Ae(e[n])&&!yt(e[n])?Re(t)||at(r[n])?r[n]=Array.isArray(e[n])?wt(e[n],[]):{...wt(e[n])}:xt(e[n],Se(t)?{}:t[n],r[n]):r[n]=!ot(e[n],t[n]);return r}var St=(e,t)=>xt(e,t,wt(t));const kt={value:!1,isValid:!1},At={value:!0,isValid:!0};var Et=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&&!Re(e[0].attributes.value)?Re(e[0].value)||""===e[0].value?At:{value:e[0].value,isValid:!0}:At:kt}return kt},Ct=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>Re(e)?e:t?""===e?NaN:e?+e:e:r&&rt(e)?new Date(e):n?n(e):e;const Tt={isValid:!1,value:null};var Nt=e=>Array.isArray(e)?e.reduce((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e,Tt):Tt;function _t(e){const t=e.ref;return ft(t)?t.files:gt(t)?Nt(e.refs).value:ht(t)?[...t.selectedOptions].map(({value:e})=>e):we(t)?Et(e.refs).value:Ct(Re(t.value)?e.ref.value:t.value,e)}var Rt=e=>e instanceof RegExp,Pt=e=>Re(e)?e:Rt(e)?e.source:Ae(e)?Rt(e.value)?e.value.source:e.value:e,Ot=e=>({isOnSubmit:!e||e===Be,isOnBlur:e===Fe,isOnChange:e===je,isOnAll:e===$e,isOnTouch:e===Ve});const Dt="AsyncFunction";var It=e=>!!e&&!!e.validate&&!!(mt(e.validate)&&e.validate.constructor.name===Dt||Ae(e.validate)&&Object.values(e.validate).find(e=>e.constructor.name===Dt)),Mt=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(t=>e.startsWith(t)&&/^\.\w+/.test(e.slice(t.length))));const Ut=(e,t,r,n)=>{for(const a of r||Object.keys(e)){const r=De(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(Ut(o,t))break}else if(Ae(o)&&Ut(o,t))break}}};function Lt(e,t,r){const n=De(e,r);if(n||_e(r))return{error:n,name:r};const a=r.split(".");for(;a.length;){const n=a.join("."),o=De(t,n),i=De(e,n);if(o&&!Array.isArray(o)&&r!==n)return{name:r};if(i&&i.type)return{name:n,error:i};if(i&&i.root&&i.root.type)return{name:`${n}.root`,error:i.root};a.pop()}return{name:r}}var zt=(e,t,r)=>{const n=ct(De(e,r));return Me(n,"root",t[r]),Me(e,r,n),e},Ft=e=>rt(e);function jt(e,t,r="validate"){if(Ft(e)||Array.isArray(e)&&e.every(Ft)||Ie(e)&&!e)return{type:r,message:Ft(e)?e:"",ref:t}}var Bt=e=>Ae(e)&&!Rt(e)?e:{value:e,message:""},Vt=async(e,t,r,n,a,o)=>{const{ref:i,refs:s,required:l,maxLength:c,minLength:d,min:u,max:f,pattern:m,validate:p,name:h,valueAsNumber:g,mount:v}=e._f,b=De(r,h);if(!v||t.has(h))return{};const y=s?s[0]:i,w=e=>{a&&y.reportValidity&&(y.setCustomValidity(Ie(e)?"":e||""),y.reportValidity())},x={},S=gt(i),k=we(i),A=S||k,E=(g||ft(i))&&Re(i.value)&&Re(b)||pt(i)&&""===i.value||""===b||Array.isArray(b)&&!b.length,C=lt.bind(null,h,n,x),T=(e,t,r,n=Ke,a=He)=>{const o=e?t:r;x[h]={type:e?n:a,message:o,ref:i,...C(e?n:a,o)}};if(o?!Array.isArray(b)||!b.length:l&&(!A&&(E||Se(b))||Ie(b)&&!b||k&&!Et(s).isValid||S&&!Nt(s).isValid)){const{value:e,message:t}=Ft(l)?{value:!!l,message:l}:Bt(l);if(e&&(x[h]={type:qe,message:t,ref:y,...C(qe,t)},!n))return w(t),x}if(!(E||Se(u)&&Se(f))){let e,t;const r=Bt(f),a=Bt(u);if(Se(b)||isNaN(b)){const n=i.valueAsDate||new Date(b),o=e=>new Date((new Date).toDateString()+" "+e),s="time"==i.type,l="week"==i.type;rt(r.value)&&b&&(e=s?o(b)>o(r.value):l?b>r.value:n>new Date(r.value)),rt(a.value)&&b&&(t=s?o(b)<o(a.value):l?b<a.value:n<new Date(a.value))}else{const n=i.valueAsNumber||(b?+b:b);Se(r.value)||(e=n>r.value),Se(a.value)||(t=n<a.value)}if((e||t)&&(T(!!e,r.message,a.message,We,Ge),!n))return w(x[h].message),x}if((c||d)&&!E&&(rt(b)||o&&Array.isArray(b))){const e=Bt(c),t=Bt(d),r=!Se(e.value)&&b.length>+e.value,a=!Se(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&&rt(b)){const{value:e,message:t}=Bt(m);if(Rt(e)&&!b.match(e)&&(x[h]={type:Ze,message:t,ref:i,...C(Ze,t)},!n))return w(t),x}if(p)if(mt(p)){const e=jt(await p(b,r),y);if(e&&(x[h]={...e,...C(Je,e.message)},!n))return w(e.message),x}else if(Ae(p)){let e={};for(const t in p){if(!ut(e)&&!n)break;const a=jt(await p[t](b,r),y,t);a&&(e={...a,...C(t,a.message)},w(a.message),n&&(x[h]=e))}if(!ut(e)&&(x[h]={ref:y,...e},!n))return x}return w(!0),x};const $t={mode:Be,reValidateMode:je,shouldFocusError:!0};function Wt(e={}){let t,r={...$t,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:mt(r.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:r.errors||{},disabled:r.disabled||!1},a={},o=(Ae(r.defaultValues)||Ae(r.values))&&Ne(r.defaultValues||r.values)||{},i=r.shouldUnregister?{}:Ne(o),s={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:dt(),state:dt()},m=r.criteriaMode===$e,p=async e=>{if(!r.disabled&&(d.isValid||u.isValid||e)){const e=r.resolver?ut((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?Me(n.validatingFields,e,t):bt(n.validatingFields,e))}),f.state.next({validatingFields:n.validatingFields,isValidating:!ut(n.validatingFields)}))},g=(e,t,r,n)=>{const l=De(a,e);if(l){const a=De(i,e,Re(r)?De(o,e):r);Re(a)||n&&n.defaultChecked||t?Me(i,e,t?a:_t(l._f)):k(e,a),s.mount&&p()}},v=(e,t,a,i,s)=>{let l=!1,c=!1;const m={name:e};if(!r.disabled){if(!a||i){(d.isDirty||u.isDirty)&&(c=n.isDirty,n.isDirty=m.isDirty=x(),l=c!==m.isDirty);const r=ot(De(o,e),t);c=!!De(n.dirtyFields,e),r?bt(n.dirtyFields,e):Me(n.dirtyFields,e,!0),m.dirtyFields=n.dirtyFields,l=l||(d.dirtyFields||u.dirtyFields)&&c!==!r}if(a){const t=De(n.touchedFields,e);t||(Me(n.touchedFields,e,a),m.touchedFields=n.touchedFields,l=l||(d.touchedFields||u.touchedFields)&&t!==a)}l&&s&&f.state.next(m)}return l?m:{}},b=(e,a,o,i)=>{const s=De(n.errors,e),l=(d.isValid||u.isValid)&&Ie(a)&&n.isValid!==a;var m;if(r.delayError&&o?(m=()=>((e,t)=>{Me(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?Me(n.errors,e,o):bt(n.errors,e)),(o?!ot(s,o):s)||!ut(i)||l){const t={...i,...l&&Ie(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(i,r.context,((e,t,r,n)=>{const a={};for(const r of e){const e=De(t,r);e&&Me(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 s=e[o];if(s){const{_f:e,...c}=s;if(e){const c=l.array.has(e.name),u=s._f&&It(s._f);u&&d.validatingFields&&h([o],!0);const f=await Vt(s,l.disabled,i,m,r.shouldUseNativeValidation&&!t,c);if(u&&d.validatingFields&&h([o]),f[e.name]&&(a.valid=!1,t))break;!t&&(De(f,e.name)?c?zt(n.errors,f,e.name):Me(n.errors,e.name,f[e.name]):bt(n.errors,e.name))}!ut(c)&&await w(c,t,a)}}return a.valid},x=(e,t)=>!r.disabled&&(e&&t&&Me(i,e,t),!ot(_(),o)),S=(e,t,r)=>nt(e,l,{...s.mount?i:Re(t)?o:rt(e)?{[e]:t}:t},r,t),k=(e,t,r={})=>{const n=De(a,e);let o=t;if(n){const r=n._f;r&&(!r.disabled&&Me(i,e,Ct(t,r)),o=pt(r.ref)&&Se(t)?"":t,ht(r.ref)?[...r.ref.options].forEach(e=>e.selected=o.includes(e.value)):r.refs?we(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):ft(r.ref)?r.ref.value="":(r.ref.value=o,r.ref.type||f.state.next({name:e,values:Ne(i)})))}(r.shouldDirty||r.shouldTouch)&&v(e,o,r.shouldTouch,r.shouldDirty,!0),r.shouldValidate&&N(e)},A=(e,t,r)=>{for(const n in t){if(!t.hasOwnProperty(n))return;const o=t[n],i=e+"."+n,s=De(a,i);(l.array.has(e)||Ae(o)||s&&!s._f)&&!xe(o)?A(i,o,r):k(i,o,r)}},E=(e,t,r={})=>{const c=De(a,e),m=l.array.has(e),p=Ne(t);Me(i,e,p),m?(f.array.next({name:e,values:Ne(i)}),(d.isDirty||d.dirtyFields||u.isDirty||u.dirtyFields)&&r.shouldDirty&&f.state.next({name:e,dirtyFields:St(o,i),isDirty:x(e,p)})):!c||c._f||Se(p)?k(e,p,r):A(e,p,r),Mt(e,l)&&f.state.next({...n,name:e}),f.state.next({name:s.mount?e:void 0,values:Ne(i)})},C=async e=>{s.mount=!0;const o=e.target;let c=o.name,g=!0;const x=De(a,c),S=e=>{g=Number.isNaN(e)||xe(e)&&isNaN(e.getTime())||ot(e,De(i,c,e))},k=Ot(r.mode),A=Ot(r.reValidateMode);if(x){let s,E;const C=o.type?_t(x._f):Ee(e),T=e.type===Ue||e.type===Le,_=!(e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate))(x._f)&&!r.resolver&&!De(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,De(n.touchedFields,c),n.isSubmitted,A,k),R=Mt(c,l,T);Me(i,c,C),T?o&&o.readOnly||(x._f.onBlur&&x._f.onBlur(e),t&&t(0)):x._f.onChange&&x._f.onChange(e);const P=v(c,C,T),O=!ut(P)||R;if(!T&&f.state.next({name:c,type:e.type,values:Ne(i)}),_)return(d.isValid||u.isValid)&&("onBlur"===r.mode?T&&p():T||p()),O&&f.state.next({name:c,...R?{}:P});if(!T&&R&&f.state.next({...n}),r.resolver){const{errors:e}=await y([c]);if(S(C),g){const t=Lt(n.errors,a,c),r=Lt(e,a,t.name||c);s=r.error,c=r.name,E=ut(e)}}else h([c],!0),s=(await Vt(x,l.disabled,i,m,r.shouldUseNativeValidation))[c],h([c]),S(C),g&&(s?E=!1:(d.isValid||u.isValid)&&(E=await w(a,!0)));g&&(x._f.deps&&N(x._f.deps),b(c,E,s,P))}},T=(e,t)=>{if(De(n.errors,t)&&e.focus)return e.focus(),1},N=async(e,t={})=>{let o,i;const s=ct(e);if(r.resolver){const t=await(async e=>{const{errors:t}=await y(e);if(e)for(const r of e){const e=De(t,r);e?Me(n.errors,r,e):bt(n.errors,r)}else n.errors=t;return t})(Re(e)?e:s);o=ut(t),i=e?!s.some(e=>De(t,e)):o}else e?(i=(await Promise.all(s.map(async e=>{const t=De(a,e);return await w(t&&t._f?{[e]:t}:t)}))).every(Boolean),(i||n.isValid)&&p()):i=o=await w(a);return f.state.next({...!rt(e)||(d.isValid||u.isValid)&&o!==n.isValid?{}:{name:e},...r.resolver||!e?{isValid:o}:{},errors:n.errors}),t.shouldFocus&&!i&&Ut(a,T,e?s:l.mount),i},_=e=>{const t={...s.mount?i:o};return Re(e)?t:rt(e)?De(t,e):e.map(e=>De(t,e))},R=(e,t)=>({invalid:!!De((t||n).errors,e),isDirty:!!De((t||n).dirtyFields,e),error:De((t||n).errors,e),isValidating:!!De(n.validatingFields,e),isTouched:!!De((t||n).touchedFields,e)}),P=(e,t,r)=>{const o=(De(a,e,{_f:{}})._f||{}).ref,i=De(n.errors,e)||{},{ref:s,message:l,type:c,...d}=i;Me(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()},O=e=>f.state.subscribe({next:t=>{var r,a,s;r=e.name,a=t.name,s=e.exact,r&&a&&r!==a&&!ct(r).some(e=>e&&(s?e===a:e.startsWith(a)||a.startsWith(e)))||!((e,t,r,n)=>{r(e);const{name:a,...o}=e;return ut(o)||Object.keys(o).length>=Object.keys(t).length||Object.keys(o).find(e=>t[e]===(!n||$e))})(t,e.formState||d,j,e.reRenderRoot)||e.callback({values:{...i},...n,...t,defaultValues:o})}}).unsubscribe,D=(e,t={})=>{for(const s of e?ct(e):l.mount)l.mount.delete(s),l.array.delete(s),t.keepValue||(bt(a,s),bt(i,s)),!t.keepError&&bt(n.errors,s),!t.keepDirty&&bt(n.dirtyFields,s),!t.keepTouched&&bt(n.touchedFields,s),!t.keepIsValidating&&bt(n.validatingFields,s),!r.shouldUnregister&&!t.keepDefaultValue&&bt(o,s);f.state.next({values:Ne(i)}),f.state.next({...n,...t.keepDirty?{isDirty:x()}:{}}),!t.keepIsValid&&p()},I=({disabled:e,name:t})=>{(Ie(e)&&s.mount||e||l.disabled.has(t))&&(e?l.disabled.add(t):l.disabled.delete(t))},M=(e,t={})=>{let n=De(a,e);const i=Ie(t.disabled)||Ie(r.disabled);return Me(a,e,{...n||{},_f:{...n&&n._f?n._f:{ref:{name:e}},name:e,mount:!0,...t}}),l.mount.add(e),n?I({disabled:Ie(t.disabled)?t.disabled:r.disabled,name:e}):g(e,!0,t.value),{...i?{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:i=>{if(i){M(e,t),n=De(a,e);const r=Re(i.value)&&i.querySelectorAll&&i.querySelectorAll("input,select,textarea")[0]||i,s=(e=>gt(e)||we(e))(r),l=n._f.refs||[];if(s?l.find(e=>e===r):r===n._f.ref)return;Me(a,e,{_f:{...n._f,...s?{refs:[...l.filter(vt),r,...Array.isArray(De(o,e))?[{}]:[]],ref:{type:r.type,name:e}}:{ref:r}}}),g(e,!1,void 0,r)}else n=De(a,e,{}),n._f&&(n._f.mount=!1),(r.shouldUnregister||t.shouldUnregister)&&(!Ce(l.array,e)||!s.action)&&l.unMount.add(e)}}},U=()=>r.shouldFocusError&&Ut(a,T,l.mount),L=(e,t)=>async o=>{let s;o&&(o.preventDefault&&o.preventDefault(),o.persist&&o.persist());let c=Ne(i);if(f.state.next({isSubmitting:!0}),r.resolver){const{errors:e,values:t}=await y();n.errors=e,c=Ne(t)}else await w(a);if(l.disabled.size)for(const e of l.disabled)bt(c,e);if(bt(n.errors,"root"),ut(n.errors)){f.state.next({errors:{}});try{await e(c,o)}catch(e){s=e}}else t&&await t({...n.errors},o),U(),setTimeout(U);if(f.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:ut(n.errors)&&!s,submitCount:n.submitCount+1,errors:n.errors}),s)throw s},z=(e,t={})=>{const c=e?Ne(e):o,u=Ne(c),m=ut(e),p=m?o:u;if(t.keepDefaultValues||(o=c),!t.keepValues){if(t.keepDirtyValues){const e=new Set([...l.mount,...Object.keys(St(o,i))]);for(const t of Array.from(e))De(n.dirtyFields,t)?Me(p,t,De(i,t)):E(t,De(p,t))}else{if(Te&&Re(e))for(const e of l.mount){const t=De(a,e);if(t&&t._f){const e=Array.isArray(t._f.refs)?t._f.refs[0]:t._f.ref;if(pt(e)){const t=e.closest("form");if(t){t.reset();break}}}}if(t.keepFieldsRef)for(const e of l.mount)E(e,De(p,e));else a={}}i=r.shouldUnregister?t.keepDefaultValues?Ne(o):{}:Ne(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:""},s.mount=!d.isValid||!!t.keepIsValid||!!t.keepDirtyValues,s.watch=!!r.shouldUnregister,f.state.next({submitCount:t.keepSubmitCount?n.submitCount:0,isDirty:!m&&(t.keepDirty?n.isDirty:!(!t.keepDefaultValues||ot(e,o))),isSubmitted:!!t.keepIsSubmitted&&n.isSubmitted,dirtyFields:m?{}:t.keepDirtyValues?t.keepDefaultValues&&i?St(o,i):n.dirtyFields:t.keepDefaultValues&&e?St(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)=>z(mt(e)?e(i):e,t),j=e=>{n={...n,...e}},B={control:{register:M,unregister:D,getFieldState:R,handleSubmit:L,setError:P,_subscribe:O,_runSchema:y,_focusError:U,_getWatch:S,_getDirty:x,_setValid:p,_setFieldArray:(e,t=[],l,c,m=!0,p=!0)=>{if(c&&l&&!r.disabled){if(s.action=!0,p&&Array.isArray(De(a,e))){const t=l(De(a,e),c.argA,c.argB);m&&Me(a,e,t)}if(p&&Array.isArray(De(n.errors,e))){const t=l(De(n.errors,e),c.argA,c.argB);m&&Me(n.errors,e,t),((e,t)=>{!Pe(De(e,t)).length&&bt(e,t)})(n.errors,e)}if((d.touchedFields||u.touchedFields)&&p&&Array.isArray(De(n.touchedFields,e))){const t=l(De(n.touchedFields,e),c.argA,c.argB);m&&Me(n.touchedFields,e,t)}(d.dirtyFields||u.dirtyFields)&&(n.dirtyFields=St(o,i)),f.state.next({name:e,isDirty:x(e,t),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else Me(i,e,t)},_setDisabledField:I,_setErrors:e=>{n.errors=e,f.state.next({errors:n.errors,isValid:!1})},_getFieldArray:e=>Pe(De(s.mount?i:o,e,r.shouldUnregister?De(o,e,[]):[])),_reset:z,_resetDefaultValues:()=>mt(r.defaultValues)&&r.defaultValues().then(e=>{F(e,r.resetOptions),f.state.next({isLoading:!1})}),_removeUnmounted:()=>{for(const e of l.unMount){const t=De(a,e);t&&(t._f.refs?t._f.refs.every(e=>!vt(e)):!vt(t._f.ref))&&D(e)}l.unMount=new Set},_disableForm:e=>{Ie(e)&&(f.state.next({disabled:e}),Ut(a,(t,r)=>{const n=De(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 i},get _state(){return s},set _state(e){s=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=>(s.mount=!0,u={...u,...e.formState},O({...e,formState:u})),trigger:N,register:M,handleSubmit:L,watch:(e,t)=>mt(e)?f.state.subscribe({next:r=>"values"in r&&e(S(void 0,t),r)}):S(e,t,!0),setValue:E,getValues:_,reset:F,resetField:(e,t={})=>{De(a,e)&&(Re(t.defaultValue)?E(e,Ne(De(o,e))):(E(e,t.defaultValue),Me(o,e,Ne(t.defaultValue))),t.keepTouched||bt(n.touchedFields,e),t.keepDirty||(bt(n.dirtyFields,e),n.isDirty=t.defaultValue?x(e,Ne(De(o,e))):x()),t.keepError||(bt(n.errors,e),d.isValid&&p()),f.state.next({...n}))},clearErrors:e=>{e&&ct(e).forEach(e=>bt(n.errors,e)),f.state.next({errors:e?n.errors:{}})},unregister:D,setError:P,setFocus:(e,t={})=>{const r=De(a,e),n=r&&r._f;if(n){const e=n.refs?n.refs[0]:n.ref;e.focus&&(e.focus(),t.shouldSelect&&mt(e.select)&&e.select())}},getFieldState:R};return{...B,formControl:B}}function Gt(e={}){const t=a.useRef(void 0),r=a.useRef(void 0),[n,o]=a.useState({isDirty:!1,isValidating:!1,isLoading:mt(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:mt(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:n},e.defaultValues&&!mt(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:r,...a}=Wt(e);t.current={...a,formState:n}}const i=t.current.control;return i._options=e,tt(()=>{const e=i._subscribe({formState:i._proxyFormState,callback:()=>o({...i._formState}),reRenderRoot:!0});return o(e=>({...e,isReady:!0})),i._formState.isReady=!0,e},[i]),a.useEffect(()=>i._disableForm(e.disabled),[i,e.disabled]),a.useEffect(()=>{e.mode&&(i._options.mode=e.mode),e.reValidateMode&&(i._options.reValidateMode=e.reValidateMode)},[i,e.mode,e.reValidateMode]),a.useEffect(()=>{e.errors&&(i._setErrors(e.errors),i._focusError())},[i,e.errors]),a.useEffect(()=>{e.shouldUnregister&&i._subjects.state.next({values:i._getWatch()})},[i,e.shouldUnregister]),a.useEffect(()=>{if(i._proxyFormState.isDirty){const e=i._getDirty();e!==n.isDirty&&i._subjects.state.next({isDirty:e})}},[i,n.isDirty]),a.useEffect(()=>{e.values&&!ot(e.values,r.current)?(i._reset(e.values,{keepFieldsRef:!0,...i._options.resetOptions}),r.current=e.values,o(e=>({...e}))):i._resetDefaultValues()},[i,e.values]),a.useEffect(()=>{i._state.mount||(i._setValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()}),t.current.formState=et(n,i),t.current}const Kt=(e,t,r)=>{if(e&&"reportValidity"in e){const n=De(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},Ht=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?Kt(n.ref,r,e):n&&n.refs&&n.refs.forEach(t=>Kt(t,r,e))}},Zt=(e,t)=>{t.shouldUseNativeValidation&&Ht(e,t);const r={};for(const n in e){const a=De(t.fields,n),o=Object.assign(e[n]||{},{ref:a&&a.ref});if(qt(t.names||Object.keys(e),n)){const e=Object.assign({},De(r,n));Me(e,"root",o),Me(r,n,e)}else Me(r,n,o)}return r},qt=(e,t)=>{const r=Jt(t);return e.some(e=>Jt(e).match(`^${r}\\.\\d+`))};function Jt(e){return e.replace(/\]|\[/g,"")}function Yt(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 i.prototype)e in r||Object.defineProperty(r,e,{value:i.prototype[e].bind(r)});r._zod.constr=i,r._zod.def=n}const a=r?.Parent??Object;class o extends a{}function i(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(i,"init",{value:n}),Object.defineProperty(i,Symbol.hasInstance,{value:t=>!!(r?.Parent&&t instanceof r.Parent)||t?._zod?.traits?.has(e)}),Object.defineProperty(i,"name",{value:e}),i}class Xt extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Qt extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}const er={};function tr(e){return er}function rr(e,t){return"bigint"==typeof t?t.toString():t}function nr(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function ar(e){return null==e}function or(e){const t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}const ir=Symbol("evaluating");function sr(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==ir)return void 0===n&&(n=ir,n=r()),n},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function lr(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function cr(...e){const t={};for(const r of e){const e=Object.getOwnPropertyDescriptors(r);Object.assign(t,e)}return Object.defineProperties({},t)}function dr(e){return JSON.stringify(e)}const ur="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function fr(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const mr=nr(()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function pr(e){if(!1===fr(e))return!1;const t=e.constructor;if(void 0===t)return!0;const r=t.prototype;return!1!==fr(r)&&!1!==Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")}function hr(e){return pr(e)?{...e}:Array.isArray(e)?[...e]:e}const gr=new Set(["string","number","symbol"]);function vr(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function br(e,t,r){const n=new e._zod.constr(t??e._zod.def);return t&&!r?.parent||(n._zod.parent=e),n}function yr(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 wr(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 xr(e,t){return t.map(t=>{var r;return(r=t).path??(r.path=[]),t.path.unshift(e),t})}function Sr(e){return"string"==typeof e?e:e?.message}function kr(e,t,r){const n={...e,path:e.path??[]};if(!e.message){const a=Sr(e.inst?._zod.def?.error?.(e))??Sr(t?.error?.(e))??Sr(r.customError?.(e))??Sr(r.localeError?.(e))??"Invalid input";n.message=a}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}function Ar(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function Er(...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,rr,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Tr=Yt("$ZodError",Cr),Nr=Yt("$ZodError",Cr,{Parent:Error});const _r=e=>(t,r,n,a)=>{const o=n?Object.assign(n,{async:!1}):{async:!1},i=t._zod.run({value:r,issues:[]},o);if(i instanceof Promise)throw new Xt;if(i.issues.length){const t=new(a?.Err??e)(i.issues.map(e=>kr(e,o,tr())));throw ur(t,a?.callee),t}return i.value},Rr=_r(Nr),Pr=e=>async(t,r,n,a)=>{const o=n?Object.assign(n,{async:!0}):{async:!0};let i=t._zod.run({value:r,issues:[]},o);if(i instanceof Promise&&(i=await i),i.issues.length){const t=new(a?.Err??e)(i.issues.map(e=>kr(e,o,tr())));throw ur(t,a?.callee),t}return i.value},Or=Pr(Nr),Dr=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 Xt;return o.issues.length?{success:!1,error:new(e??Tr)(o.issues.map(e=>kr(e,a,tr())))}:{success:!0,data:o.value}},Ir=Dr(Nr),Mr=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=>kr(e,a,tr())))}:{success:!0,data:o.value}},Ur=Mr(Nr),Lr=e=>(t,r,n)=>{const a=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return _r(e)(t,r,a)},zr=e=>(t,r,n)=>_r(e)(t,r,n),Fr=e=>async(t,r,n)=>{const a=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Pr(e)(t,r,a)},jr=e=>async(t,r,n)=>Pr(e)(t,r,n),Br=e=>(t,r,n)=>{const a=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Dr(e)(t,r,a)},Vr=e=>(t,r,n)=>Dr(e)(t,r,n),$r=e=>async(t,r,n)=>{const a=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Mr(e)(t,r,a)},Wr=e=>async(t,r,n)=>Mr(e)(t,r,n),Gr=/^[cC][^\s-]{8,}$/,Kr=/^[0-9a-z]+$/,Hr=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Zr=/^[0-9a-vA-V]{20}$/,qr=/^[A-Za-z0-9]{27}$/,Jr=/^[a-zA-Z0-9_-]{21}$/,Yr=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Xr=/^([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})$/,Qr=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)$/,en=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;const tn=/^(?:(?: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])$/,rn=/^(([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}|:))$/,nn=/^((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])$/,an=/^(([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])$/,on=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,sn=/^[A-Za-z0-9_-]*$/,ln=/^(?=.{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])?)*\.?$/,cn=/^\+(?:[0-9]){6,14}[0-9]$/,dn="(?:(?:\\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])))",un=new RegExp(`^${dn}$`);function fn(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 mn=/^[^A-Z]*$/,pn=/^[^a-z]*$/,hn=Yt("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),gn=Yt("$ZodCheckMaxLength",(e,t)=>{var r;hn.init(e,t),(r=e._zod.def).when??(r.when=e=>{const t=e.value;return!ar(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=Ar(n);r.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),vn=Yt("$ZodCheckMinLength",(e,t)=>{var r;hn.init(e,t),(r=e._zod.def).when??(r.when=e=>{const t=e.value;return!ar(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=Ar(n);r.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),bn=Yt("$ZodCheckLengthEquals",(e,t)=>{var r;hn.init(e,t),(r=e._zod.def).when??(r.when=e=>{const t=e.value;return!ar(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=Ar(n),i=a>t.length;r.issues.push({origin:o,...i?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),yn=Yt("$ZodCheckStringFormat",(e,t)=>{var r,n;hn.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=()=>{})}),wn=Yt("$ZodCheckRegex",(e,t)=>{yn.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})}}),xn=Yt("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=mn),yn.init(e,t)}),Sn=Yt("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=pn),yn.init(e,t)}),kn=Yt("$ZodCheckIncludes",(e,t)=>{hn.init(e,t);const r=vr(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})}}),An=Yt("$ZodCheckStartsWith",(e,t)=>{hn.init(e,t);const r=new RegExp(`^${vr(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})}}),En=Yt("$ZodCheckEndsWith",(e,t)=>{hn.init(e,t);const r=new RegExp(`.*${vr(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=Yt("$ZodCheckOverwrite",(e,t)=>{hn.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});class Tn{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 Nn={major:4,minor:1,patch:8},_n=Yt("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Nn;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=wr(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,i=o._zod.check(e);if(i instanceof Promise&&!1===r?.async)throw new Xt;if(n||i instanceof Promise)n=(n??Promise.resolve()).then(async()=>{await i;e.issues.length!==t&&(a||(a=wr(e,t)))});else{if(e.issues.length===t)continue;a||(a=wr(e,t))}}return n?n.then(()=>e):e},r=(r,a,o)=>{if(wr(r))return r.aborted=!0,r;const i=t(a,n,o);if(i instanceof Promise){if(!1===o.async)throw new Xt;return i.then(t=>e._zod.parse(t,o))}return e._zod.parse(i,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 i=e._zod.parse(a,o);if(i instanceof Promise){if(!1===o.async)throw new Xt;return i.then(e=>t(e,n,o))}return t(i,n,o)}}e["~standard"]={validate:t=>{try{const r=Ir(e,t);return r.success?{value:r.data}:{issues:r.error?.issues}}catch(r){return Ur(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1}}),Rn=Yt("$ZodString",(e,t)=>{var r;_n.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=Yt("$ZodStringFormat",(e,t)=>{yn.init(e,t),Rn.init(e,t)}),On=Yt("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Xr),Pn.init(e,t)}),Dn=Yt("$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=Qr(e))}else t.pattern??(t.pattern=Qr());Pn.init(e,t)}),In=Yt("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=en),Pn.init(e,t)}),Mn=Yt("$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:ln.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})}}}),Un=Yt("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Pn.init(e,t)}),Ln=Yt("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Jr),Pn.init(e,t)}),zn=Yt("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Gr),Pn.init(e,t)}),Fn=Yt("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Kr),Pn.init(e,t)}),jn=Yt("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Hr),Pn.init(e,t)}),Bn=Yt("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Zr),Pn.init(e,t)}),Vn=Yt("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=qr),Pn.init(e,t)}),$n=Yt("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=function(e){const t=fn({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(`^${dn}T(?:${n})$`)}(t)),Pn.init(e,t)}),Wn=Yt("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=un),Pn.init(e,t)}),Gn=Yt("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=new RegExp(`^${fn(t)}$`)),Pn.init(e,t)}),Kn=Yt("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Yr),Pn.init(e,t)}),Hn=Yt("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=tn),Pn.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.format="ipv4"})}),Zn=Yt("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=rn),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})}}}),qn=Yt("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=nn),Pn.init(e,t)}),Jn=Yt("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=an),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 Yn(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const Xn=Yt("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=on),Pn.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding="base64"}),e._zod.check=r=>{Yn(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});const Qn=Yt("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=sn),Pn.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding="base64url"}),e._zod.check=r=>{(function(e){if(!sn.test(e))return!1;const t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return Yn(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})}}),ea=Yt("$ZodE164",(e,t)=>{t.pattern??(t.pattern=cn),Pn.init(e,t)});const ta=Yt("$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})}}),ra=Yt("$ZodUnknown",(e,t)=>{_n.init(e,t),e._zod.parse=e=>e}),na=Yt("$ZodNever",(e,t)=>{_n.init(e,t),e._zod.parse=(t,r)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)});function aa(e,t,r){e.issues.length&&t.issues.push(...xr(r,e.issues)),t.value[r]=e.value}const oa=Yt("$ZodArray",(e,t)=>{_n.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 i=a[e],s=t.element._zod.run({value:i,issues:[]},n);s instanceof Promise?o.push(s.then(t=>aa(t,r,e))):aa(s,r,e)}return o.length?Promise.all(o).then(()=>r):r}});function ia(e,t,r,n){e.issues.length&&t.issues.push(...xr(r,e.issues)),void 0===e.value?r in n&&(t.value[r]=void 0):t.value[r]=e.value}function sa(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 la(e,t,r,n,a,o){const i=[],s=a.keySet,l=a.catchall._zod,c=l.def.type;for(const a of Object.keys(t)){if(s.has(a))continue;if("never"===c){i.push(a);continue}const o=l.run({value:t[a],issues:[]},n);o instanceof Promise?e.push(o.then(e=>ia(e,r,a,t))):ia(o,r,a,t)}return i.length&&r.issues.push({code:"unrecognized_keys",keys:i,input:t,inst:o}),e.length?Promise.all(e).then(()=>r):r}const ca=Yt("$ZodObject",(e,t)=>{_n.init(e,t);const r=nr(()=>sa(t));sr(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=fr,a=t.catchall;let o;e._zod.parse=(t,i)=>{o??(o=r.value);const s=t.value;if(!n(s))return t.issues.push({expected:"object",code:"invalid_type",input:s,inst:e}),t;t.value={};const l=[],c=o.shape;for(const e of o.keys){const r=c[e]._zod.run({value:s[e],issues:[]},i);r instanceof Promise?l.push(r.then(r=>ia(r,t,e,s))):ia(r,t,e,s)}return a?la(l,s,t,i,r.value,e):l.length?Promise.all(l).then(()=>t):t}}),da=Yt("$ZodObjectJIT",(e,t)=>{ca.init(e,t);const r=e._zod.parse,n=nr(()=>sa(t));let a;const o=fr,i=!er.jitless,s=i&&mr.value,l=t.catchall;let c;e._zod.parse=(d,u)=>{c??(c=n.value);const f=d.value;return o(f)?i&&s&&!1===u?.async&&!0!==u.jitless?(a||(a=(e=>{const t=new Tn(["shape","payload","ctx"]),r=n.value,a=e=>{const t=dr(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");const o=Object.create(null);let i=0;for(const e of r.keys)o[e]="key_"+i++;t.write("const newResult = {};");for(const e of r.keys){const r=o[e],n=dr(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 s=t.compile();return(t,r)=>s(e,t,r)})(t.shape)),d=a(d,u),l?la([],f,d,u,c,e):d):r(d,u):(d.issues.push({expected:"object",code:"invalid_type",input:f,inst:e}),d)}});function ua(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=>!wr(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=>kr(e,n,tr())))}),t)}const fa=Yt("$ZodUnion",(e,t)=>{_n.init(e,t),sr(e._zod,"optin",()=>t.options.some(e=>"optional"===e._zod.optin)?"optional":void 0),sr(e._zod,"optout",()=>t.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),sr(e._zod,"values",()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),sr(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=>or(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 i=!1;const s=[];for(const e of t.options){const t=e._zod.run({value:a.value,issues:[]},o);if(t instanceof Promise)s.push(t),i=!0;else{if(0===t.issues.length)return t;s.push(t)}}return i?Promise.all(s).then(t=>ua(t,a,e,o)):ua(s,a,e,o)}}),ma=Yt("$ZodIntersection",(e,t)=>{_n.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])=>ha(e,t,r)):ha(e,a,o)}});function pa(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(pr(e)&&pr(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=pa(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=pa(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 ha(e,t,r){if(t.issues.length&&e.issues.push(...t.issues),r.issues.length&&e.issues.push(...r.issues),wr(e))return e;const n=pa(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 ga=Yt("$ZodEnum",(e,t)=>{_n.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=>gr.has(typeof e)).map(e=>"string"==typeof e?vr(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}}),va=Yt("$ZodTransform",(e,t)=>{_n.init(e,t),e._zod.parse=(r,n)=>{if("backward"===n.direction)throw new Qt(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 Xt;return r.value=a,r}});function ba(e,t){return e.issues.length&&void 0===t?{issues:[],value:void 0}:e}const ya=Yt("$ZodOptional",(e,t)=>{_n.init(e,t),e._zod.optin="optional",e._zod.optout="optional",sr(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),sr(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${or(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=>ba(t,e.value)):ba(n,e.value)}return void 0===e.value?e:t.innerType._zod.run(e,r)}}),wa=Yt("$ZodNullable",(e,t)=>{_n.init(e,t),sr(e._zod,"optin",()=>t.innerType._zod.optin),sr(e._zod,"optout",()=>t.innerType._zod.optout),sr(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${or(e.source)}|null)$`):void 0}),sr(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)}),xa=Yt("$ZodDefault",(e,t)=>{_n.init(e,t),e._zod.optin="optional",sr(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=>Sa(e,t)):Sa(n,t)}});function Sa(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const ka=Yt("$ZodPrefault",(e,t)=>{_n.init(e,t),e._zod.optin="optional",sr(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))}),Aa=Yt("$ZodNonOptional",(e,t)=>{_n.init(e,t),sr(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=>Ea(t,e)):Ea(a,e)}});function Ea(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=Yt("$ZodCatch",(e,t)=>{_n.init(e,t),sr(e._zod,"optin",()=>t.innerType._zod.optin),sr(e._zod,"optout",()=>t.innerType._zod.optout),sr(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=>kr(e,r,tr()))},input:e.value}),e.issues=[]),e)):(e.value=n.value,n.issues.length&&(e.value=t.catchValue({...e,error:{issues:n.issues.map(e=>kr(e,r,tr()))},input:e.value}),e.issues=[]),e)}}),Ta=Yt("$ZodPipe",(e,t)=>{_n.init(e,t),sr(e._zod,"values",()=>t.in._zod.values),sr(e._zod,"optin",()=>t.in._zod.optin),sr(e._zod,"optout",()=>t.out._zod.optout),sr(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=>Na(e,t.in,r)):Na(n,t.in,r)}const n=t.in._zod.run(e,r);return n instanceof Promise?n.then(e=>Na(e,t.out,r)):Na(n,t.out,r)}});function Na(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}const _a=Yt("$ZodReadonly",(e,t)=>{_n.init(e,t),sr(e._zod,"propValues",()=>t.innerType._zod.propValues),sr(e._zod,"values",()=>t.innerType._zod.values),sr(e._zod,"optin",()=>t.innerType._zod.optin),sr(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(Ra):Ra(n)}});function Ra(e){return e.value=Object.freeze(e.value),e}const Pa=Yt("$ZodCustom",(e,t)=>{hn.init(e,t),_n.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=>Oa(t,r,n,e));Oa(a,r,n,e)}});function Oa(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(Er(e))}}class Da{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 Ia(){return new Da}const Ma=Ia();function Ua(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...yr(t)})}function La(e,t){return new gn({check:"max_length",...yr(t),maximum:e})}function za(e,t){return new vn({check:"min_length",...yr(t),minimum:e})}function Fa(e,t){return new bn({check:"length_equals",...yr(t),length:e})}function ja(e){return new Cn({check:"overwrite",tx:e})}function Ba(e){const t=function(e,t){const r=new hn({check:"custom",...yr(t)});return r._zod.check=e,r}(r=>(r.addIssue=e=>{if("string"==typeof e)r.issues.push(Er(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(Er(n))}},e(r.value,r)));return t}function Va(e,t){try{var r=e()}catch(e){return t(e)}return r&&r.then?r.then(void 0,t):r}function $a(e,t){for(var r={};e.length;){var n=e[0],a=n.code,o=n.message,i=n.path.join(".");if(!r[i])if("unionErrors"in n){var s=n.unionErrors[0].errors[0];r[i]={message:s.message,type:s.code}}else r[i]={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[i].types,c=l&&l[n.code];r[i]=lt(i,t,r,a,c?[].concat(c,n.message):n.message)}e.shift()}return r}function Wa(e,t){for(var r={};e.length;){var n=e[0],a=n.code,o=n.message,i=n.path.join(".");if(!r[i])if("invalid_union"===n.code&&n.errors.length>0){var s=n.errors[0][0];r[i]={message:s.message,type:s.code}}else r[i]={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[i].types,c=l&&l[n.code];r[i]=lt(i,t,r,a,c?[].concat(c,n.message):n.message)}e.shift()}return r}function Ga(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(Va(function(){return Promise.resolve(e["sync"===r.mode?"parse":"parseAsync"](n,t)).then(function(e){return o.shouldUseNativeValidation&&Ht({},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:Zt($a(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(Va(function(){return Promise.resolve(("sync"===r.mode?Rr:Or)(e,n,t)).then(function(e){return o.shouldUseNativeValidation&&Ht({},o),{errors:{},values:r.raw?Object.assign({},n):e}})},function(e){if(function(e){return e instanceof Tr}(e))return{values:{},errors:Zt(Wa(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 Ka(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=Ka(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function Ha(){for(var e,t,r=0,n="",a=arguments.length;r<a;r++)(e=arguments[r])&&(t=Ka(e))&&(n&&(n+=" "),n+=t);return n}const Za=e=>{const t=Xa(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:e=>{const r=e.split("-");return""===r[0]&&1!==r.length&&r.shift(),qa(r,t)||Ya(e)},getConflictingClassGroupIds:(e,t)=>{const a=r[e]||[];return t&&n[e]?[...a,...n[e]]:a}}},qa=(e,t)=>{if(0===e.length)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),a=n?qa(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},Ja=/^\[(.+)\]$/,Ya=e=>{if(Ja.test(e)){const t=Ja.exec(e)[1],r=t?.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},Xa=e=>{const{theme:t,classGroups:r}=e,n={nextPart:new Map,validators:[]};for(const e in r)Qa(r[e],n,e,t);return n},Qa=(e,t,r,n)=>{e.forEach(e=>{if("string"==typeof e){return void((""===e?t:eo(t,e)).classGroupId=r)}if("function"==typeof e)return to(e)?void Qa(e(n),t,r,n):void t.validators.push({validator:e,classGroupId:r});Object.entries(e).forEach(([e,a])=>{Qa(a,eo(t,e),r,n)})})},eo=(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},to=e=>e.isThemeGetter,ro=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)}}},no=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=e=>{const t=[];let r,n=0,a=0,o=0;for(let i=0;i<e.length;i++){let s=e[i];if(0===n&&0===a){if(":"===s){t.push(e.slice(o,i)),o=i+1;continue}if("/"===s){r=i;continue}}"["===s?n++:"]"===s?n--:"("===s?a++:")"===s&&a--}const i=0===t.length?e:e.substring(o),s=ao(i);return{modifiers:t,hasImportantModifier:s!==i,baseClassName:s,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},ao=e=>e.endsWith("!")?e.substring(0,e.length-1):e.startsWith("!")?e.substring(1):e,oo=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}},io=/\s+/;function so(){let e,t,r=0,n="";for(;r<arguments.length;)(e=arguments[r++])&&(t=lo(e))&&(n&&(n+=" "),n+=t);return n}const lo=e=>{if("string"==typeof e)return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=lo(e[n]))&&(r&&(r+=" "),r+=t);return r};function co(e,...t){let r,n,a,o=function(s){const l=t.reduce((e,t)=>t(e),e());return r=(e=>({cache:ro(e.cacheSize),parseClassName:no(e),sortModifiers:oo(e),...Za(e)}))(l),n=r.cache.get,a=r.cache.set,o=i,i(s)};function i(e){const t=n(e);if(t)return t;const o=((e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:a,sortModifiers:o}=t,i=[],s=e.trim().split(io);let l="";for(let e=s.length-1;e>=0;e-=1){const t=s[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(i.includes(b))continue;i.push(b);const y=a(h,p);for(let e=0;e<y.length;++e){const t=y[e];i.push(v+t)}l=t+(l.length>0?" "+l:l)}return l})(e,r);return a(e,o),o}return function(){return o(so.apply(null,arguments))}}const uo=e=>{const t=t=>t[e]||[];return t.isThemeGetter=!0,t},fo=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,mo=/^\((?:(\w[\w-]*):)?(.+)\)$/i,po=/^\d+\/\d+$/,ho=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,go=/\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$/,vo=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,bo=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,yo=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,wo=e=>po.test(e),xo=e=>!!e&&!Number.isNaN(Number(e)),So=e=>!!e&&Number.isInteger(Number(e)),ko=e=>e.endsWith("%")&&xo(e.slice(0,-1)),Ao=e=>ho.test(e),Eo=()=>!0,Co=e=>go.test(e)&&!vo.test(e),To=()=>!1,No=e=>bo.test(e),_o=e=>yo.test(e),Ro=e=>!Oo(e)&&!zo(e),Po=e=>Go(e,qo,To),Oo=e=>fo.test(e),Do=e=>Go(e,Jo,Co),Io=e=>Go(e,Yo,xo),Mo=e=>Go(e,Ho,To),Uo=e=>Go(e,Zo,_o),Lo=e=>Go(e,Qo,No),zo=e=>mo.test(e),Fo=e=>Ko(e,Jo),jo=e=>Ko(e,Xo),Bo=e=>Ko(e,Ho),Vo=e=>Ko(e,qo),$o=e=>Ko(e,Zo),Wo=e=>Ko(e,Qo,!0),Go=(e,t,r)=>{const n=fo.exec(e);return!!n&&(n[1]?t(n[1]):r(n[2]))},Ko=(e,t,r=!1)=>{const n=mo.exec(e);return!!n&&(n[1]?t(n[1]):r)},Ho=e=>"position"===e||"percentage"===e,Zo=e=>"image"===e||"url"===e,qo=e=>"length"===e||"size"===e||"bg-size"===e,Jo=e=>"length"===e,Yo=e=>"number"===e,Xo=e=>"family-name"===e,Qo=e=>"shadow"===e,ei=co(()=>{const e=uo("color"),t=uo("font"),r=uo("text"),n=uo("font-weight"),a=uo("tracking"),o=uo("leading"),i=uo("breakpoint"),s=uo("container"),l=uo("spacing"),c=uo("radius"),d=uo("shadow"),u=uo("inset-shadow"),f=uo("text-shadow"),m=uo("drop-shadow"),p=uo("blur"),h=uo("perspective"),g=uo("aspect"),v=uo("ease"),b=uo("animate"),y=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",zo,Oo],w=()=>[zo,Oo,l],x=()=>[wo,"full","auto",...w()],S=()=>[So,"none","subgrid",zo,Oo],k=()=>["auto",{span:["full",So,zo,Oo]},So,zo,Oo],A=()=>[So,"auto",zo,Oo],E=()=>["auto","min","max","fr",zo,Oo],C=()=>["auto",...w()],T=()=>[wo,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...w()],N=()=>[e,zo,Oo],_=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",Bo,Mo,{position:[zo,Oo]}],R=()=>["auto","cover","contain",Vo,Po,{size:[zo,Oo]}],P=()=>[ko,Fo,Do],O=()=>["","none","full",c,zo,Oo],D=()=>["",xo,Fo,Do],I=()=>[xo,ko,Bo,Mo],M=()=>["","none",p,zo,Oo],U=()=>["none",xo,zo,Oo],L=()=>["none",xo,zo,Oo],z=()=>[xo,zo,Oo],F=()=>[wo,"full",...w()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ao],breakpoint:[Ao],color:[Eo],container:[Ao],"drop-shadow":[Ao],ease:["in","out","in-out"],font:[Ro],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ao],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ao],shadow:[Ao],spacing:["px",xo],text:[Ao],"text-shadow":[Ao],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",wo,Oo,zo,g]}],container:["container"],columns:[{columns:[xo,Oo,zo,s]}],"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:[So,"auto",zo,Oo]}],basis:[{basis:[wo,"full","auto",s,...w()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[xo,wo,"auto","initial","none",Oo]}],grow:[{grow:["",xo,zo,Oo]}],shrink:[{shrink:["",xo,zo,Oo]}],order:[{order:[So,"first","last","none",zo,Oo]}],"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:[s,"screen",...T()]}],"min-w":[{"min-w":[s,"screen","none",...T()]}],"max-w":[{"max-w":[s,"screen","none","prose",{screen:[i]},...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,Fo,Do]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,zo,Io]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",ko,Oo]}],"font-family":[{font:[jo,Oo,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,zo,Oo]}],"line-clamp":[{"line-clamp":[xo,"none",zo,Io]}],leading:[{leading:[o,...w()]}],"list-image":[{"list-image":["none",zo,Oo]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",zo,Oo]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:N()}],"text-color":[{text:N()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","wavy"]}],"text-decoration-thickness":[{decoration:[xo,"from-font","auto",zo,Do]}],"text-decoration-color":[{decoration:N()}],"underline-offset":[{"underline-offset":[xo,"auto",zo,Oo]}],"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",zo,Oo]}],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",zo,Oo]}],"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:R()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},So,zo,Oo],radial:["",zo,Oo],conic:[So,zo,Oo]},$o,Uo]}],"bg-color":[{bg:N()}],"gradient-from-pos":[{from:P()}],"gradient-via-pos":[{via:P()}],"gradient-to-pos":[{to:P()}],"gradient-from":[{from:N()}],"gradient-via":[{via:N()}],"gradient-to":[{to:N()}],rounded:[{rounded:O()}],"rounded-s":[{"rounded-s":O()}],"rounded-e":[{"rounded-e":O()}],"rounded-t":[{"rounded-t":O()}],"rounded-r":[{"rounded-r":O()}],"rounded-b":[{"rounded-b":O()}],"rounded-l":[{"rounded-l":O()}],"rounded-ss":[{"rounded-ss":O()}],"rounded-se":[{"rounded-se":O()}],"rounded-ee":[{"rounded-ee":O()}],"rounded-es":[{"rounded-es":O()}],"rounded-tl":[{"rounded-tl":O()}],"rounded-tr":[{"rounded-tr":O()}],"rounded-br":[{"rounded-br":O()}],"rounded-bl":[{"rounded-bl":O()}],"border-w":[{border:D()}],"border-w-x":[{"border-x":D()}],"border-w-y":[{"border-y":D()}],"border-w-s":[{"border-s":D()}],"border-w-e":[{"border-e":D()}],"border-w-t":[{"border-t":D()}],"border-w-r":[{"border-r":D()}],"border-w-b":[{"border-b":D()}],"border-w-l":[{"border-l":D()}],"divide-x":[{"divide-x":D()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":D()}],"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:N()}],"border-color-x":[{"border-x":N()}],"border-color-y":[{"border-y":N()}],"border-color-s":[{"border-s":N()}],"border-color-e":[{"border-e":N()}],"border-color-t":[{"border-t":N()}],"border-color-r":[{"border-r":N()}],"border-color-b":[{"border-b":N()}],"border-color-l":[{"border-l":N()}],"divide-color":[{divide:N()}],"outline-style":[{outline:["solid","dashed","dotted","double","none","hidden"]}],"outline-offset":[{"outline-offset":[xo,zo,Oo]}],"outline-w":[{outline:["",xo,Fo,Do]}],"outline-color":[{outline:N()}],shadow:[{shadow:["","none",d,Wo,Lo]}],"shadow-color":[{shadow:N()}],"inset-shadow":[{"inset-shadow":["none",u,Wo,Lo]}],"inset-shadow-color":[{"inset-shadow":N()}],"ring-w":[{ring:D()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:N()}],"ring-offset-w":[{"ring-offset":[xo,Do]}],"ring-offset-color":[{"ring-offset":N()}],"inset-ring-w":[{"inset-ring":D()}],"inset-ring-color":[{"inset-ring":N()}],"text-shadow":[{"text-shadow":["none",f,Wo,Lo]}],"text-shadow-color":[{"text-shadow":N()}],opacity:[{opacity:[xo,zo,Oo]}],"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":[xo]}],"mask-image-linear-from-pos":[{"mask-linear-from":I()}],"mask-image-linear-to-pos":[{"mask-linear-to":I()}],"mask-image-linear-from-color":[{"mask-linear-from":N()}],"mask-image-linear-to-color":[{"mask-linear-to":N()}],"mask-image-t-from-pos":[{"mask-t-from":I()}],"mask-image-t-to-pos":[{"mask-t-to":I()}],"mask-image-t-from-color":[{"mask-t-from":N()}],"mask-image-t-to-color":[{"mask-t-to":N()}],"mask-image-r-from-pos":[{"mask-r-from":I()}],"mask-image-r-to-pos":[{"mask-r-to":I()}],"mask-image-r-from-color":[{"mask-r-from":N()}],"mask-image-r-to-color":[{"mask-r-to":N()}],"mask-image-b-from-pos":[{"mask-b-from":I()}],"mask-image-b-to-pos":[{"mask-b-to":I()}],"mask-image-b-from-color":[{"mask-b-from":N()}],"mask-image-b-to-color":[{"mask-b-to":N()}],"mask-image-l-from-pos":[{"mask-l-from":I()}],"mask-image-l-to-pos":[{"mask-l-to":I()}],"mask-image-l-from-color":[{"mask-l-from":N()}],"mask-image-l-to-color":[{"mask-l-to":N()}],"mask-image-x-from-pos":[{"mask-x-from":I()}],"mask-image-x-to-pos":[{"mask-x-to":I()}],"mask-image-x-from-color":[{"mask-x-from":N()}],"mask-image-x-to-color":[{"mask-x-to":N()}],"mask-image-y-from-pos":[{"mask-y-from":I()}],"mask-image-y-to-pos":[{"mask-y-to":I()}],"mask-image-y-from-color":[{"mask-y-from":N()}],"mask-image-y-to-color":[{"mask-y-to":N()}],"mask-image-radial":[{"mask-radial":[zo,Oo]}],"mask-image-radial-from-pos":[{"mask-radial-from":I()}],"mask-image-radial-to-pos":[{"mask-radial-to":I()}],"mask-image-radial-from-color":[{"mask-radial-from":N()}],"mask-image-radial-to-color":[{"mask-radial-to":N()}],"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":[xo]}],"mask-image-conic-from-pos":[{"mask-conic-from":I()}],"mask-image-conic-to-pos":[{"mask-conic-to":I()}],"mask-image-conic-from-color":[{"mask-conic-from":N()}],"mask-image-conic-to-color":[{"mask-conic-to":N()}],"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:R()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",zo,Oo]}],filter:[{filter:["","none",zo,Oo]}],blur:[{blur:M()}],brightness:[{brightness:[xo,zo,Oo]}],contrast:[{contrast:[xo,zo,Oo]}],"drop-shadow":[{"drop-shadow":["","none",m,Wo,Lo]}],"drop-shadow-color":[{"drop-shadow":N()}],grayscale:[{grayscale:["",xo,zo,Oo]}],"hue-rotate":[{"hue-rotate":[xo,zo,Oo]}],invert:[{invert:["",xo,zo,Oo]}],saturate:[{saturate:[xo,zo,Oo]}],sepia:[{sepia:["",xo,zo,Oo]}],"backdrop-filter":[{"backdrop-filter":["","none",zo,Oo]}],"backdrop-blur":[{"backdrop-blur":M()}],"backdrop-brightness":[{"backdrop-brightness":[xo,zo,Oo]}],"backdrop-contrast":[{"backdrop-contrast":[xo,zo,Oo]}],"backdrop-grayscale":[{"backdrop-grayscale":["",xo,zo,Oo]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[xo,zo,Oo]}],"backdrop-invert":[{"backdrop-invert":["",xo,zo,Oo]}],"backdrop-opacity":[{"backdrop-opacity":[xo,zo,Oo]}],"backdrop-saturate":[{"backdrop-saturate":[xo,zo,Oo]}],"backdrop-sepia":[{"backdrop-sepia":["",xo,zo,Oo]}],"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",zo,Oo]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[xo,"initial",zo,Oo]}],ease:[{ease:["linear","initial",v,zo,Oo]}],delay:[{delay:[xo,zo,Oo]}],animate:[{animate:["none",b,zo,Oo]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[h,zo,Oo]}],"perspective-origin":[{"perspective-origin":y()}],rotate:[{rotate:U()}],"rotate-x":[{"rotate-x":U()}],"rotate-y":[{"rotate-y":U()}],"rotate-z":[{"rotate-z":U()}],scale:[{scale:L()}],"scale-x":[{"scale-x":L()}],"scale-y":[{"scale-y":L()}],"scale-z":[{"scale-z":L()}],"scale-3d":["scale-3d"],skew:[{skew:z()}],"skew-x":[{"skew-x":z()}],"skew-y":[{"skew-y":z()}],transform:[{transform:[zo,Oo,"","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:N()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:N()}],"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",zo,Oo]}],"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",zo,Oo]}],fill:[{fill:["none",...N()]}],"stroke-w":[{stroke:[xo,Fo,Do,Io]}],stroke:[{stroke:["none",...N()]}],"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 ti(...e){return ei(Ha(e))}function ri(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function ni(...e){return t=>{let r=!1;const n=e.map(e=>{const n=ri(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():ri(e[t],null)}}}}function ai(...e){return n.useCallback(ni(...e),e)}function oi(t){const r=si(t),a=n.forwardRef((t,a)=>{const{children:o,...i}=t,s=n.Children.toArray(o),l=s.find(ci);if(l){const t=l.props.children,o=s.map(e=>e===l?n.Children.count(t)>1?n.Children.only(null):n.isValidElement(t)?t.props.children:null:e);return e(r,{...i,ref:a,children:n.isValidElement(t)?n.cloneElement(t,void 0,o):null})}return e(r,{...i,ref:a,children:o})});return a.displayName=`${t}.Slot`,a}var ii=oi("Slot");function si(e){const t=n.forwardRef((e,t)=>{const{children:r,...a}=e;if(n.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}}(a,r.props);return r.type!==n.Fragment&&(o.ref=t?ni(t,e):e),n.cloneElement(r,o)}return n.Children.count(r)>1?n.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var li=Symbol("radix.slottable");function ci(e){return n.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===li}const di=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,ui=Ha,fi=(e,t)=>r=>{var n;if(null==(null==t?void 0:t.variants))return ui(e,null==r?void 0:r.class,null==r?void 0:r.className);const{variants:a,defaultVariants:o}=t,i=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 i=di(t)||di(n);return a[e][i]}),s=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,...s}[t]):{...o,...s}[t]===r})?[...e,r,n]:e},[]);return ui(e,i,l,null==r?void 0:r.class,null==r?void 0:r.className)},mi=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),pi=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)},hi=(...e)=>e.filter((e,t,r)=>Boolean(e)&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim(),gi=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
|
|
8
|
+
var vi={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
|
|
14
|
+
*/const bi=d(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:a="",children:o,iconNode:i,...s},l)=>u("svg",{ref:l,...vi,width:t,height:t,stroke:e,strokeWidth:n?24*Number(r)/Number(t):r,className:hi("lucide",a),...!o&&!gi(s)&&{"aria-hidden":"true"},...s},[...i.map(([e,t])=>u(e,t)),...Array.isArray(o)?o:[o]])),yi=(e,t)=>{const r=d(({className:r,...n},a)=>u(bi,{ref:a,iconNode:t,className:hi(`lucide-${mi(pi(e))}`,`lucide-${e}`,r),...n}));return r.displayName=pi(e),r},wi=yi("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"}]]),xi=yi("check-check",[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]]),Si=yi("chevrons-up-down",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]),ki=yi("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"}]]),Ai=yi("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),Ei=yi("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),Ci=yi("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"}]]),Ti=yi("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]),Ni=yi("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"}]]),_i=yi("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"}]]),Ri=yi("toggle-right",[["circle",{cx:"15",cy:"12",r:"3",key:"1afu0r"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]]),Pi=yi("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"}]]),Oi=yi("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"}]]),Di=yi("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"}]]),Ii=yi("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"}]]),Mi=yi("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"}]]),Ui=fi("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"}}),Li=n.forwardRef(({className:t,variant:a,progress:o,size:i,startIcon:s,endIcon:l,asChild:c=!1,...d},u)=>{const f=c?ii:"button",m=function(e){switch(e){case"lg":return 20;case"sm":return 14;default:return 16}}(i);return r(f,{disabled:o||d.disabled,className:ti(Ui({variant:a,size:i,withIcon:null!=o||null!=s||null!=l,className:t})),ref:u,...d,children:[o&&e(Ai,{size:m,className:"animate-spin"}),s&&n.cloneElement(s,{size:m}),d.children,l&&n.cloneElement(l,{size:m})]})});
|
|
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
|
-
*/_i.displayName="Button";var Ri=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((t,r)=>{const a=Xo(`Primitive.${r}`),o=n.forwardRef((t,n)=>{const{asChild:o,...i}=t,s=o?a:r;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),e(s,{...i,ref:n})});return o.displayName=`Primitive.${r}`,{...t,[r]:o}},{});var Oi=n.forwardRef((t,r)=>e(Ri.label,{...t,ref:r,onMouseDown:e=>{e.target.closest("button, input, select, textarea")||(t.onMouseDown?.(e),!e.defaultPrevented&&e.detail>1&&e.preventDefault())}}));Oi.displayName="Label";var Di=Oi;const Mi=oi("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Pi=n.forwardRef(({className:t,...r},n)=>e(Di,{ref:n,className:Ko(Mi(),t),...r}));Pi.displayName=Di.displayName;const Ii=He,Li=n.createContext({}),Fi=({...t})=>e(Li.Provider,{value:{name:t.name},children:e(et,{...t})}),zi=()=>{const e=n.useContext(Li),t=n.useContext(Ui),{getFieldState:r,formState:a}=Ze(),o=r(e.name,a);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:i}=t;return{id:i,name:e.name,formItemId:`${i}-form-item`,formDescriptionId:`${i}-form-item-description`,formMessageId:`${i}-form-item-message`,...o}},Ui=n.createContext({}),Vi=n.forwardRef(({className:t,...r},a)=>{const o=n.useId();return e(Ui.Provider,{value:{id:o},children:e("div",{ref:a,className:Ko("space-y-2",t),...r})})});Vi.displayName="FormItem";const ji=n.forwardRef(({className:t,...r},n)=>{const{error:a,formItemId:o}=zi();return e(Pi,{ref:n,className:Ko(a&&"text-destructive",t),htmlFor:o,...r})});ji.displayName="FormLabel";const $i=n.forwardRef(({...t},r)=>{const{error:n,formItemId:a,formDescriptionId:o,formMessageId:i}=zi();return e(Qo,{ref:r,id:a,"aria-describedby":n?`${o} ${i}`:`${o}`,"aria-invalid":!!n,...t})});$i.displayName="FormControl";const Wi=n.forwardRef(({className:t,...r},n)=>{const{formDescriptionId:a}=zi();return e("p",{ref:n,id:a,className:Ko("text-sm text-muted-foreground",t),...r})});Wi.displayName="FormDescription";const Bi=n.forwardRef(({className:t,children:r,...n},a)=>{const{error:o,formMessageId:i}=zi(),s=o?String(o?.message):r;return s?e("p",{ref:a,id:i,className:Ko("text-sm font-medium text-destructive",t),...n,children:s}):null});Bi.displayName="FormMessage";const Zi=n.forwardRef(({className:t,type:r,...n},a)=>e("input",{type:r,className:Ko("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 Hi({className:t,...r}){return e("div",{className:Ko("animate-pulse rounded-md bg-primary/10",t),...r})}Zi.displayName="Input";let Gi=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),i=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(!i.ok)throw new Error(`Failed to submit beta user request: ${i.statusText}`);return i.json()}};const Ki=Bt("ZodISODateTime",(e,t)=>{Ln.init(e,t),bs.init(e,t)});function qi(e){return function(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...fr(t)})}(Ki,e)}const Ji=Bt("ZodISODate",(e,t)=>{Fn.init(e,t),bs.init(e,t)});function Yi(e){return function(e,t){return new e({type:"string",format:"date",check:"string_format",...fr(t)})}(Ji,e)}const Xi=Bt("ZodISOTime",(e,t)=>{zn.init(e,t),bs.init(e,t)});function Qi(e){return function(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...fr(t)})}(Xi,e)}const es=Bt("ZodISODuration",(e,t)=>{Un.init(e,t),bs.init(e,t)});function ts(e){return function(e,t){return new e({type:"string",format:"duration",check:"string_format",...fr(t)})}(es,e)}const rs=Bt("ZodError",(e,t)=>{wr.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,qt,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,qt,2)}},isEmpty:{get:()=>0===e.issues.length}})},{Parent:Error}),ns=xr(rs),as=Tr(rs),os=Er(rs),is=Nr(rs),ss=Rr(rs),ls=Or(rs),cs=Dr(rs),us=Mr(rs),ds=Pr(rs),fs=Ir(rs),ms=Lr(rs),hs=Fr(rs),ps=Bt("ZodType",(e,t)=>(xn.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)=>dr(e,t,r),e.brand=()=>e,e.register=(t,r)=>(t.add(e,r),e),e.parse=(t,r)=>ns(e,t,r,{callee:e.parse}),e.safeParse=(t,r)=>os(e,t,r),e.parseAsync=async(t,r)=>as(e,t,r,{callee:e.parseAsync}),e.safeParseAsync=async(t,r)=>is(e,t,r),e.spa=e.safeParseAsync,e.encode=(t,r)=>ss(e,t,r),e.decode=(t,r)=>ls(e,t,r),e.encodeAsync=async(t,r)=>cs(e,t,r),e.decodeAsync=async(t,r)=>us(e,t,r),e.safeEncode=(t,r)=>ds(e,t,r),e.safeDecode=(t,r)=>fs(e,t,r),e.safeEncodeAsync=async(t,r)=>ms(e,t,r),e.safeDecodeAsync=async(t,r)=>hs(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,...fr(r)})}(sl,e,t)}(t,r)),e.superRefine=t=>e.check(Pa(t)),e.overwrite=t=>e.check(Ma(t)),e.optional=()=>Ys(e),e.nullable=()=>Qs(e),e.nullish=()=>Ys(Qs(e)),e.nonoptional=t=>function(e,t){return new rl({type:"nonoptional",innerType:e,...fr(t)})}(e,t),e.array=()=>{return function(e,t,r){return new e({type:"array",element:t,...fr(r)})}(Ws,e,t);var t},e.or=t=>function(e,t){return new Hs({type:"union",options:e,...fr(t)})}([e,t]),e.and=t=>new Gs({type:"intersection",left:e,right:t}),e.transform=t=>ol(e,new qs({type:"transform",transform:t})),e.default=t=>{return r=t,new el({type:"default",innerType:e,get defaultValue(){return"function"==typeof r?r():lr(r)}});var r},e.prefault=t=>{return r=t,new tl({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof r?r():lr(r)}});var r},e.catch=t=>{return new nl({type:"catch",innerType:e,catchValue:"function"==typeof(r=t)?r:()=>r});var r},e.pipe=t=>ol(e,t),e.readonly=()=>new il({type:"readonly",innerType:e}),e.describe=t=>{const r=e.clone();return Na.add(r,{description:t}),r},Object.defineProperty(e,"description",{get:()=>Na.get(e)?.description,configurable:!0}),e.meta=(...t)=>{if(0===t.length)return Na.get(e);const r=e.clone();return Na.add(r,t[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),gs=Bt("_ZodString",(e,t)=>{kn.init(e,t),ps.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 mn({check:"string_format",format:"regex",...fr(t),pattern:e})}(...t)),e.includes=(...t)=>e.check(function(e,t){return new gn({check:"string_format",format:"includes",...fr(t),includes:e})}(...t)),e.startsWith=(...t)=>e.check(function(e,t){return new yn({check:"string_format",format:"starts_with",...fr(t),prefix:e})}(...t)),e.endsWith=(...t)=>e.check(function(e,t){return new vn({check:"string_format",format:"ends_with",...fr(t),suffix:e})}(...t)),e.min=(...t)=>e.check(Oa(...t)),e.max=(...t)=>e.check(Ra(...t)),e.length=(...t)=>e.check(Da(...t)),e.nonempty=(...t)=>e.check(Oa(1,...t)),e.lowercase=t=>e.check(function(e){return new hn({check:"string_format",format:"lowercase",...fr(e)})}(t)),e.uppercase=t=>e.check(function(e){return new pn({check:"string_format",format:"uppercase",...fr(e)})}(t)),e.trim=()=>e.check(Ma(e=>e.trim())),e.normalize=(...t)=>e.check(function(e){return Ma(t=>t.normalize(e))}(...t)),e.toLowerCase=()=>e.check(Ma(e=>e.toLowerCase())),e.toUpperCase=()=>e.check(Ma(e=>e.toUpperCase()))}),ys=Bt("ZodString",(e,t)=>{kn.init(e,t),gs.init(e,t),e.email=t=>e.check(function(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...fr(t)})}(ws,t)),e.url=t=>e.check(function(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...fr(t)})}(ks,t)),e.jwt=t=>e.check(function(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...fr(t)})}(zs,t)),e.emoji=t=>e.check(function(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...fr(t)})}(Ts,t)),e.guid=t=>e.check(_a(Ss,t)),e.uuid=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...fr(t)})}(xs,t)),e.uuidv4=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...fr(t)})}(xs,t)),e.uuidv6=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...fr(t)})}(xs,t)),e.uuidv7=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...fr(t)})}(xs,t)),e.nanoid=t=>e.check(function(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...fr(t)})}(As,t)),e.guid=t=>e.check(_a(Ss,t)),e.cuid=t=>e.check(function(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...fr(t)})}(Es,t)),e.cuid2=t=>e.check(function(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...fr(t)})}(Cs,t)),e.ulid=t=>e.check(function(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...fr(t)})}(Ns,t)),e.base64=t=>e.check(function(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...fr(t)})}(Is,t)),e.base64url=t=>e.check(function(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...fr(t)})}(Ls,t)),e.xid=t=>e.check(function(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...fr(t)})}(_s,t)),e.ksuid=t=>e.check(function(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...fr(t)})}(Rs,t)),e.ipv4=t=>e.check(function(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...fr(t)})}(Os,t)),e.ipv6=t=>e.check(function(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...fr(t)})}(Ds,t)),e.cidrv4=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...fr(t)})}(Ms,t)),e.cidrv6=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...fr(t)})}(Ps,t)),e.e164=t=>e.check(function(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...fr(t)})}(Fs,t)),e.datetime=t=>e.check(qi(t)),e.date=t=>e.check(Yi(t)),e.time=t=>e.check(Qi(t)),e.duration=t=>e.check(ts(t))});function vs(e){return function(e,t){return new e({type:"string",...fr(t)})}(ys,e)}const bs=Bt("ZodStringFormat",(e,t)=>{Tn.init(e,t),gs.init(e,t)}),ws=Bt("ZodEmail",(e,t)=>{Cn.init(e,t),bs.init(e,t)}),Ss=Bt("ZodGUID",(e,t)=>{An.init(e,t),bs.init(e,t)}),xs=Bt("ZodUUID",(e,t)=>{En.init(e,t),bs.init(e,t)}),ks=Bt("ZodURL",(e,t)=>{Nn.init(e,t),bs.init(e,t)}),Ts=Bt("ZodEmoji",(e,t)=>{_n.init(e,t),bs.init(e,t)}),As=Bt("ZodNanoID",(e,t)=>{Rn.init(e,t),bs.init(e,t)}),Es=Bt("ZodCUID",(e,t)=>{On.init(e,t),bs.init(e,t)}),Cs=Bt("ZodCUID2",(e,t)=>{Dn.init(e,t),bs.init(e,t)}),Ns=Bt("ZodULID",(e,t)=>{Mn.init(e,t),bs.init(e,t)}),_s=Bt("ZodXID",(e,t)=>{Pn.init(e,t),bs.init(e,t)}),Rs=Bt("ZodKSUID",(e,t)=>{In.init(e,t),bs.init(e,t)}),Os=Bt("ZodIPv4",(e,t)=>{Vn.init(e,t),bs.init(e,t)}),Ds=Bt("ZodIPv6",(e,t)=>{jn.init(e,t),bs.init(e,t)}),Ms=Bt("ZodCIDRv4",(e,t)=>{$n.init(e,t),bs.init(e,t)}),Ps=Bt("ZodCIDRv6",(e,t)=>{Wn.init(e,t),bs.init(e,t)}),Is=Bt("ZodBase64",(e,t)=>{Zn.init(e,t),bs.init(e,t)}),Ls=Bt("ZodBase64URL",(e,t)=>{Hn.init(e,t),bs.init(e,t)}),Fs=Bt("ZodE164",(e,t)=>{Gn.init(e,t),bs.init(e,t)}),zs=Bt("ZodJWT",(e,t)=>{Kn.init(e,t),bs.init(e,t)}),Us=Bt("ZodUnknown",(e,t)=>{qn.init(e,t),ps.init(e,t)});function Vs(){return new Us({type:"unknown"})}const js=Bt("ZodNever",(e,t)=>{Jn.init(e,t),ps.init(e,t)});function $s(e){return function(e,t){return new e({type:"never",...fr(t)})}(js,e)}const Ws=Bt("ZodArray",(e,t)=>{Xn.init(e,t),ps.init(e,t),e.element=t.element,e.min=(t,r)=>e.check(Oa(t,r)),e.nonempty=t=>e.check(Oa(1,t)),e.max=(t,r)=>e.check(Ra(t,r)),e.length=(t,r)=>e.check(Da(t,r)),e.unwrap=()=>e.element});const Bs=Bt("ZodObject",(e,t)=>{na.init(e,t),ps.init(e,t),er(e,"shape",()=>t.shape),e.keyof=()=>function(e,t){const r=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new Ks({type:"enum",entries:r,...fr(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:Vs()}),e.loose=()=>e.clone({...e._zod.def,catchall:Vs()}),e.strict=()=>e.clone({...e._zod.def,catchall:$s()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>function(e,t){if(!sr(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=rr(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return tr(this,"shape",r),r},checks:[]});return dr(e,n)}(e,t),e.safeExtend=t=>function(e,t){if(!sr(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 tr(this,"shape",r),r},checks:e._zod.def.checks};return dr(e,r)}(e,t),e.merge=t=>function(e,t){const r=rr(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return tr(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return dr(e,r)}(e,t),e.pick=t=>function(e,t){const r=e._zod.def;return dr(e,rr(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 tr(this,"shape",e),e},checks:[]}))}(e,t),e.omit=t=>function(e,t){const r=e._zod.def,n=rr(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 tr(this,"shape",n),n},checks:[]});return dr(e,n)}(e,t),e.partial=(...t)=>function(e,t,r){const n=rr(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 tr(this,"shape",a),a},checks:[]});return dr(t,n)}(Js,e,t[0]),e.required=(...t)=>function(e,t,r){const n=rr(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 tr(this,"shape",a),a},checks:[]});return dr(t,n)}(rl,e,t[0])});function Zs(e,t){const r={type:"object",get shape(){var t;return tr(this,"shape",e?(t=e,Object.create(Object.getPrototypeOf(t),Object.getOwnPropertyDescriptors(t))):{}),this.shape},...fr(t)};return new Bs(r)}const Hs=Bt("ZodUnion",(e,t)=>{oa.init(e,t),ps.init(e,t),e.options=t.options});const Gs=Bt("ZodIntersection",(e,t)=>{ia.init(e,t),ps.init(e,t)});const Ks=Bt("ZodEnum",(e,t)=>{ca.init(e,t),ps.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 Ks({...t,checks:[],...fr(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 Ks({...t,checks:[],...fr(n),entries:a})}});const qs=Bt("ZodTransform",(e,t)=>{ua.init(e,t),ps.init(e,t),e._zod.parse=(r,n)=>{if("backward"===n.direction)throw new Ht(e.constructor.name);r.addIssue=n=>{if("string"==typeof n)r.issues.push(vr(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(vr(t))}};const a=t.transform(r.value,r);return a instanceof Promise?a.then(e=>(r.value=e,r)):(r.value=a,r)}});const Js=Bt("ZodOptional",(e,t)=>{fa.init(e,t),ps.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Ys(e){return new Js({type:"optional",innerType:e})}const Xs=Bt("ZodNullable",(e,t)=>{ma.init(e,t),ps.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Qs(e){return new Xs({type:"nullable",innerType:e})}const el=Bt("ZodDefault",(e,t)=>{ha.init(e,t),ps.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});const tl=Bt("ZodPrefault",(e,t)=>{ga.init(e,t),ps.init(e,t),e.unwrap=()=>e._zod.def.innerType});const rl=Bt("ZodNonOptional",(e,t)=>{ya.init(e,t),ps.init(e,t),e.unwrap=()=>e._zod.def.innerType});const nl=Bt("ZodCatch",(e,t)=>{ba.init(e,t),ps.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});const al=Bt("ZodPipe",(e,t)=>{wa.init(e,t),ps.init(e,t),e.in=t.in,e.out=t.out});function ol(e,t){return new al({type:"pipe",in:e,out:t})}const il=Bt("ZodReadonly",(e,t)=>{xa.init(e,t),ps.init(e,t),e.unwrap=()=>e._zod.def.innerType});const sl=Bt("ZodCustom",(e,t)=>{Ta.init(e,t),ps.init(e,t)});const ll=Zs({name:vs().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:vs().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)")}),cl={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:"오류가 발생했습니다"}},ul=({onSuccess:n,onError:a,className:o="w-full",fieldClassName:i="flex flex-col gap-1.5 w-full",language:s,customTexts:u={},autoFocus:d=!0,showSuccessMessage:m=!0,hideLogo:h=!1,hideTitles:p=!1})=>{const[g,y]=f("en"),[v,b]=f(!1),[w,S]=f(!1),{submitBetaForm:x,isLoading:k,isSubmitting:T,error:A,config:E,success:C,message:N}=(()=>{const e=ne(e=>e.os),[t,r]=f(null),[n,a]=f(!0),[o,i]=f(!1),[s,u]=f(null),[d,m]=f(!1),[h,p]=f(null);return c(()=>{(async()=>{a(!0);const t=new Gi(e),n=await t.fetchConfig();r(n),a(!1)})()},[e]),{isLoading:n,isSubmitting:o,config:t,error:s,success:d,message:h,submitBetaForm:l(async t=>{if(!e){const e="SaaS OS context is not initialized";return u(e),{success:!1,message:e}}try{i(!0),u(null),m(!1),p(null);const r=new Gi(e),n=await r.submitBetaUser({name:t.name||"",email:t.email}),a="success"===n.status;return m(a),p(n.message),{success:a,message:n.message}}catch(e){const t=e instanceof Error?e.message:"Failed to submit beta form";return u(t),m(!1),p(t),{success:!1,message:t}}finally{i(!1)}},[e])}})();c(()=>{y((()=>{if("undefined"==typeof window)return"en";const e=window.navigator.language.split("-")[0];return-1!==Object.keys(cl).indexOf(e)?e:"en"})())},[]),c(()=>{C&&m&&(b(!0),S(!0)),A&&S(!0)},[C,m,A]);const _={...cl[s||g],...u},R=zt({resolver:za(ll),defaultValues:{email:"",name:""},mode:"onChange",reValidateMode:"onChange"});c(()=>{d&&R.setFocus("name")},[d,R]);const O=R.formState.isValid&&!T;return e("div",{className:"saas-os-ui",style:{width:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:r("div",k?{className:Ko("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",o),children:[e(Hi,{className:"h-24 w-24 rounded-lg"}),e(Hi,{className:"h-6 w-32"}),r("div",{className:"w-full space-y-4",children:[r("div",{className:"space-y-2",children:[e(Hi,{className:"h-4 w-16"}),e(Hi,{className:"h-10 w-full"})]}),r("div",{className:"space-y-2",children:[e(Hi,{className:"h-4 w-16"}),e(Hi,{className:"h-10 w-full"})]}),e(Hi,{className:"h-10 w-full"})]})]}:{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:[!h&&r("div",{className:"flex flex-col items-center justify-center w-full",children:[E?.logo&&e(fl,{logo:E?.logo}),E?.name&&e("div",{children:E?.name})]}),e(He,{...R,children:r("form",{onSubmit:R.handleSubmit(async e=>{try{const t=await x(e);t.success?(n?.(),R.reset(),m&&b(!0),S(!0)):(a?.(t.message),S(!0))}catch(e){a?.(e instanceof Error?e.message:_.errorMessage),S(!0)}}),className:o,noValidate:!0,"aria-busy":T,children:[!w&&r(t,{children:[!p&&E?.screen?.register&&e(dl,{screen:E?.screen?.register}),e(Fi,{control:R.control,name:"name",render:({field:t})=>r(Vi,{className:i,children:[e(ji,{children:_.nameLabel}),e($i,{children:e(Zi,{...t})}),e(Wi,{}),e(Bi,{})]})}),e(Fi,{control:R.control,name:"email",render:({field:t})=>r(Vi,{className:i,children:[e(ji,{children:_.emailLabel}),e($i,{children:e(Zi,{...t})}),e(Wi,{}),e(Bi,{})]})}),e(_i,{type:"submit",disabled:!O,className:i,children:T?_.submittingText:_.submitText})]}),w&&A&&r("div",{className:"flex flex-col items-center justify-center w-full",children:[r("div",{className:"border-red-300 text-red-700",role:"alert","aria-live":"assertive","aria-atomic":!0,children:[e("span",{className:"text-4xl mb-2",role:"img","aria-label":"Error",children:"❗"}),A]}),e("div",{className:"mt-4 flex justify-center",children:e(_i,{type:"button",onClick:()=>{S(!1),R.reset()},className:i,children:"Try Again"})})]}),w&&v&&N&&e("div",{className:"flex flex-col items-center justify-center w-full text-green-700 border-green-300 text-center",children:E?.screen?.thankYou&&e(dl,{screen:E?.screen?.thankYou})})]})}),!w&&e("div",{children:r("div",{children:["By submitting this form, you consent to our"," ",e("a",{href:E?.privacyPolicy,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-700",children:"Privacy Policy"})," ","and"," ",e("a",{href:E?.termsOfService,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-700",children:"Terms of Service"}),"."]})})]})})};function dl({screen:t}){return r("div",{className:"flex flex-col items-center justify-center w-full",children:[e("p",{className:"text-2xl font-bold",children:t?.title}),e("p",{className:"text-sm text-muted-foreground",children:t?.description})]})}function fl({logo:t}){return e("img","string"==typeof t?{src:t,alt:"Logo",className:"max-h-24"}:{src:t.bucket?.url,alt:"Logo",className:"max-h-24"})}function ml(e,t){return function(){return e.apply(t,arguments)}}const{toString:hl}=Object.prototype,{getPrototypeOf:pl}=Object,{iterator:gl,toStringTag:yl}=Symbol,vl=(bl=Object.create(null),e=>{const t=hl.call(e);return bl[t]||(bl[t]=t.slice(8,-1).toLowerCase())});var bl;const wl=e=>(e=e.toLowerCase(),t=>vl(t)===e),Sl=e=>t=>typeof t===e,{isArray:xl}=Array,kl=Sl("undefined");function Tl(e){return null!==e&&!kl(e)&&null!==e.constructor&&!kl(e.constructor)&&Cl(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Al=wl("ArrayBuffer");const El=Sl("string"),Cl=Sl("function"),Nl=Sl("number"),_l=e=>null!==e&&"object"==typeof e,Rl=e=>{if("object"!==vl(e))return!1;const t=pl(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||yl in e||gl in e)},Ol=wl("Date"),Dl=wl("File"),Ml=wl("Blob"),Pl=wl("FileList"),Il=wl("URLSearchParams"),[Ll,Fl,zl,Ul]=["ReadableStream","Request","Response","Headers"].map(wl);function Vl(e,t,{allOwnKeys:r=!1}={}){if(null==e)return;let n,a;if("object"!=typeof e&&(e=[e]),xl(e))for(n=0,a=e.length;n<a;n++)t.call(null,e[n],n,e);else{if(Tl(e))return;const a=r?Object.getOwnPropertyNames(e):Object.keys(e),o=a.length;let i;for(n=0;n<o;n++)i=a[n],t.call(null,e[i],i,e)}}function jl(e,t){if(Tl(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 $l="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,Wl=e=>!kl(e)&&e!==$l;const Bl=(Zl="undefined"!=typeof Uint8Array&&pl(Uint8Array),e=>Zl&&e instanceof Zl);var Zl;const Hl=wl("HTMLFormElement"),Gl=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),Kl=wl("RegExp"),ql=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};Vl(r,(r,a)=>{let o;!1!==(o=t(r,a,e))&&(n[a]=o||r)}),Object.defineProperties(e,n)};const Jl=wl("AsyncFunction"),Yl=(Xl="function"==typeof setImmediate,Ql=Cl($l.postMessage),Xl?setImmediate:Ql?(ec=`axios@${Math.random()}`,tc=[],$l.addEventListener("message",({source:e,data:t})=>{e===$l&&t===ec&&tc.length&&tc.shift()()},!1),e=>{tc.push(e),$l.postMessage(ec,"*")}):e=>setTimeout(e));var Xl,Ql,ec,tc;const rc="undefined"!=typeof queueMicrotask?queueMicrotask.bind($l):"undefined"!=typeof process&&process.nextTick||Yl;var nc={isArray:xl,isArrayBuffer:Al,isBuffer:Tl,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||Cl(e.append)&&("formdata"===(t=vl(e))||"object"===t&&Cl(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&Al(e.buffer),t},isString:El,isNumber:Nl,isBoolean:e=>!0===e||!1===e,isObject:_l,isPlainObject:Rl,isEmptyObject:e=>{if(!_l(e)||Tl(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:Ll,isRequest:Fl,isResponse:zl,isHeaders:Ul,isUndefined:kl,isDate:Ol,isFile:Dl,isBlob:Ml,isRegExp:Kl,isFunction:Cl,isStream:e=>_l(e)&&Cl(e.pipe),isURLSearchParams:Il,isTypedArray:Bl,isFileList:Pl,forEach:Vl,merge:function e(){const{caseless:t,skipUndefined:r}=Wl(this)&&this||{},n={},a=(a,o)=>{const i=t&&jl(n,o)||o;Rl(n[i])&&Rl(a)?n[i]=e(n[i],a):Rl(a)?n[i]=e({},a):xl(a)?n[i]=a.slice():r&&kl(a)||(n[i]=a)};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&Vl(arguments[e],a);return n},extend:(e,t,r,{allOwnKeys:n}={})=>(Vl(t,(t,n)=>{r&&Cl(t)?e[n]=ml(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,i;const s={};if(t=t||{},null==e)return t;do{for(a=Object.getOwnPropertyNames(e),o=a.length;o-- >0;)i=a[o],n&&!n(i,e,t)||s[i]||(t[i]=e[i],s[i]=!0);e=!1!==r&&pl(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:vl,kindOfTest:wl,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(xl(e))return e;let t=e.length;if(!Nl(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},forEachEntry:(e,t)=>{const r=(e&&e[gl]).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:Hl,hasOwnProperty:Gl,hasOwnProp:Gl,reduceDescriptors:ql,freezeMethods:e=>{ql(e,(t,r)=>{if(Cl(e)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;const n=e[r];Cl(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 xl(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:jl,global:$l,isContextDefined:Wl,isSpecCompliantForm:function(e){return!!(e&&Cl(e.append)&&"FormData"===e[yl]&&e[gl])},toJSONObject:e=>{const t=new Array(10),r=(e,n)=>{if(_l(e)){if(t.indexOf(e)>=0)return;if(Tl(e))return e;if(!("toJSON"in e)){t[n]=e;const a=xl(e)?[]:{};return Vl(e,(e,t)=>{const o=r(e,n+1);!kl(o)&&(a[t]=o)}),t[n]=void 0,a}}return e};return r(e,0)},isAsyncFn:Jl,isThenable:e=>e&&(_l(e)||Cl(e))&&Cl(e.then)&&Cl(e.catch),setImmediate:Yl,asap:rc,isIterable:e=>null!=e&&Cl(e[gl])};function ac(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)}nc.inherits(ac,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:nc.toJSONObject(this.config),code:this.code,status:this.status}}});const oc=ac.prototype,ic={};["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=>{ic[e]={value:e}}),Object.defineProperties(ac,ic),Object.defineProperty(oc,"isAxiosError",{value:!0}),ac.from=(e,t,r,n,a,o)=>{const i=Object.create(oc);nc.toFlatObject(e,i,function(e){return e!==Error.prototype},e=>"isAxiosError"!==e);const s=e&&e.message?e.message:"Error",l=null==t&&e?e.code:t;return ac.call(i,s,l,r,n,a),e&&null==i.cause&&Object.defineProperty(i,"cause",{value:e,configurable:!0}),i.name=e&&e.name||"Error",o&&Object.assign(i,o),i};function sc(e){return nc.isPlainObject(e)||nc.isArray(e)}function lc(e){return nc.endsWith(e,"[]")?e.slice(0,-2):e}function cc(e,t,r){return e?e.concat(t).map(function(e,t){return e=lc(e),!r&&t?"["+e+"]":e}).join(r?".":""):t}const uc=nc.toFlatObject(nc,{},null,function(e){return/^is[A-Z]/.test(e)});function dc(e,t,r){if(!nc.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const n=(r=nc.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!nc.isUndefined(t[e])})).metaTokens,a=r.visitor||c,o=r.dots,i=r.indexes,s=(r.Blob||"undefined"!=typeof Blob&&Blob)&&nc.isSpecCompliantForm(t);if(!nc.isFunction(a))throw new TypeError("visitor must be a function");function l(e){if(null===e)return"";if(nc.isDate(e))return e.toISOString();if(nc.isBoolean(e))return e.toString();if(!s&&nc.isBlob(e))throw new ac("Blob is not supported. Use a Buffer instead.");return nc.isArrayBuffer(e)||nc.isTypedArray(e)?s&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function c(e,r,a){let s=e;if(e&&!a&&"object"==typeof e)if(nc.endsWith(r,"{}"))r=n?r:r.slice(0,-2),e=JSON.stringify(e);else if(nc.isArray(e)&&function(e){return nc.isArray(e)&&!e.some(sc)}(e)||(nc.isFileList(e)||nc.endsWith(r,"[]"))&&(s=nc.toArray(e)))return r=lc(r),s.forEach(function(e,n){!nc.isUndefined(e)&&null!==e&&t.append(!0===i?cc([r],n,o):null===i?r:r+"[]",l(e))}),!1;return!!sc(e)||(t.append(cc(a,r,o),l(e)),!1)}const u=[],d=Object.assign(uc,{defaultVisitor:c,convertValue:l,isVisitable:sc});if(!nc.isObject(e))throw new TypeError("data must be an object");return function e(r,n){if(!nc.isUndefined(r)){if(-1!==u.indexOf(r))throw Error("Circular reference detected in "+n.join("."));u.push(r),nc.forEach(r,function(r,o){!0===(!(nc.isUndefined(r)||null===r)&&a.call(t,r,nc.isString(o)?o.trim():o,n,d))&&e(r,n?n.concat(o):[o])}),u.pop()}}(e),t}function fc(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function mc(e,t){this._pairs=[],e&&dc(e,this,t)}const hc=mc.prototype;function pc(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function gc(e,t,r){if(!t)return e;const n=r&&r.encode||pc;nc.isFunction(r)&&(r={serialize:r});const a=r&&r.serialize;let o;if(o=a?a(t,r):nc.isURLSearchParams(t)?t.toString():new mc(t,r).toString(n),o){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}hc.append=function(e,t){this._pairs.push([e,t])},hc.toString=function(e){const t=e?function(t){return e.call(this,t,fc)}:fc;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};class yc{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){nc.forEach(this.handlers,function(t){null!==t&&e(t)})}}var vc={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},bc={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:mc,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const wc="undefined"!=typeof window&&"undefined"!=typeof document,Sc="object"==typeof navigator&&navigator||void 0,xc=wc&&(!Sc||["ReactNative","NativeScript","NS"].indexOf(Sc.product)<0),kc="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,Tc=wc&&window.location.href||"http://localhost";var Ac={...Object.freeze({__proto__:null,hasBrowserEnv:wc,hasStandardBrowserEnv:xc,hasStandardBrowserWebWorkerEnv:kc,navigator:Sc,origin:Tc}),...bc};function Ec(e){function t(e,r,n,a){let o=e[a++];if("__proto__"===o)return!0;const i=Number.isFinite(+o),s=a>=e.length;if(o=!o&&nc.isArray(n)?n.length:o,s)return nc.hasOwnProp(n,o)?n[o]=[n[o],r]:n[o]=r,!i;n[o]&&nc.isObject(n[o])||(n[o]=[]);return t(e,r,n[o],a)&&nc.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])),!i}if(nc.isFormData(e)&&nc.isFunction(e.entries)){const r={};return nc.forEachEntry(e,(e,n)=>{t(function(e){return nc.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),n,r,0)}),r}return null}const Cc={transitional:vc,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const r=t.getContentType()||"",n=r.indexOf("application/json")>-1,a=nc.isObject(e);a&&nc.isHTMLForm(e)&&(e=new FormData(e));if(nc.isFormData(e))return n?JSON.stringify(Ec(e)):e;if(nc.isArrayBuffer(e)||nc.isBuffer(e)||nc.isStream(e)||nc.isFile(e)||nc.isBlob(e)||nc.isReadableStream(e))return e;if(nc.isArrayBufferView(e))return e.buffer;if(nc.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 dc(e,new Ac.classes.URLSearchParams,{visitor:function(e,t,r,n){return Ac.isNode&&nc.isBuffer(e)?(this.append(t,e.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((o=nc.isFileList(e))||r.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return dc(o?{"files[]":e}:e,t&&new t,this.formSerializer)}}return a||n?(t.setContentType("application/json",!1),function(e,t,r){if(nc.isString(e))try{return(t||JSON.parse)(e),nc.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(r||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||Cc.transitional,r=t&&t.forcedJSONParsing,n="json"===this.responseType;if(nc.isResponse(e)||nc.isReadableStream(e))return e;if(e&&nc.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 ac.from(e,ac.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:Ac.classes.FormData,Blob:Ac.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};nc.forEach(["delete","get","head","post","put","patch"],e=>{Cc.headers[e]={}});const Nc=nc.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 _c=Symbol("internals");function Rc(e){return e&&String(e).trim().toLowerCase()}function Oc(e){return!1===e||null==e?e:nc.isArray(e)?e.map(Oc):String(e)}function Dc(e,t,r,n,a){return nc.isFunction(n)?n.call(this,t,r):(a&&(t=r),nc.isString(t)?nc.isString(n)?-1!==t.indexOf(n):nc.isRegExp(n)?n.test(t):void 0:void 0)}let Mc=class{constructor(e){e&&this.set(e)}set(e,t,r){const n=this;function a(e,t,r){const a=Rc(t);if(!a)throw new Error("header name must be a non-empty string");const o=nc.findKey(n,a);(!o||void 0===n[o]||!0===r||void 0===r&&!1!==n[o])&&(n[o||t]=Oc(e))}const o=(e,t)=>nc.forEach(e,(e,r)=>a(e,r,t));if(nc.isPlainObject(e)||e instanceof this.constructor)o(e,t);else if(nc.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]&&Nc[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(nc.isObject(e)&&nc.isIterable(e)){let r,n,a={};for(const t of e){if(!nc.isArray(t))throw TypeError("Object iterator must return a key-value pair");a[n=t[0]]=(r=a[n])?nc.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=Rc(e)){const r=nc.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(nc.isFunction(t))return t.call(this,e,r);if(nc.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Rc(e)){const r=nc.findKey(this,e);return!(!r||void 0===this[r]||t&&!Dc(0,this[r],r,t))}return!1}delete(e,t){const r=this;let n=!1;function a(e){if(e=Rc(e)){const a=nc.findKey(r,e);!a||t&&!Dc(0,r[a],a,t)||(delete r[a],n=!0)}}return nc.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&&!Dc(0,this[a],a,e,!0)||(delete this[a],n=!0)}return n}normalize(e){const t=this,r={};return nc.forEach(this,(n,a)=>{const o=nc.findKey(r,a);if(o)return t[o]=Oc(n),void delete t[a];const i=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,r)=>t.toUpperCase()+r)}(a):String(a).trim();i!==a&&delete t[a],t[i]=Oc(n),r[i]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return nc.forEach(this,(r,n)=>{null!=r&&!1!==r&&(t[n]=e&&nc.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[_c]=this[_c]={accessors:{}}).accessors,r=this.prototype;function n(e){const n=Rc(e);t[n]||(!function(e,t){const r=nc.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 nc.isArray(e)?e.forEach(n):n(e),this}};function Pc(e,t){const r=this||Cc,n=t||r,a=Mc.from(n.headers);let o=n.data;return nc.forEach(e,function(e){o=e.call(r,o,a.normalize(),t?t.status:void 0)}),a.normalize(),o}function Ic(e){return!(!e||!e.__CANCEL__)}function Lc(e,t,r){ac.call(this,null==e?"canceled":e,ac.ERR_CANCELED,t,r),this.name="CanceledError"}function Fc(e,t,r){const n=r.config.validateStatus;r.status&&n&&!n(r.status)?t(new ac("Request failed with status code "+r.status,[ac.ERR_BAD_REQUEST,ac.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):e(r)}Mc.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),nc.reduceDescriptors(Mc.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[r]=e}}}),nc.freezeMethods(Mc),nc.inherits(Lc,ac,{__CANCEL__:!0});const zc=(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,i=0;return t=void 0!==t?t:1e3,function(s){const l=Date.now(),c=n[i];a||(a=l),r[o]=s,n[o]=l;let u=i,d=0;for(;u!==o;)d+=r[u++],u%=e;if(o=(o+1)%e,o===i&&(i=(i+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 i=(t,o=Date.now())=>{a=o,r=null,n&&(clearTimeout(n),n=null),e(...t)};return[(...e)=>{const t=Date.now(),s=t-a;s>=o?i(e,t):(r=e,n||(n=setTimeout(()=>{n=null,i(r)},o-s)))},()=>r&&i(r)]}(r=>{const o=r.loaded,i=r.lengthComputable?r.total:void 0,s=o-n,l=a(s);n=o;e({loaded:o,total:i,progress:i?o/i:void 0,bytes:s,rate:l||void 0,estimated:l&&i&&o<=i?(i-o)/l:void 0,event:r,lengthComputable:null!=i,[t?"download":"upload"]:!0})},r)},Uc=(e,t)=>{const r=null!=e;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},Vc=e=>(...t)=>nc.asap(()=>e(...t));var jc=Ac.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,Ac.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(Ac.origin),Ac.navigator&&/(msie|trident)/i.test(Ac.navigator.userAgent)):()=>!0,$c=Ac.hasStandardBrowserEnv?{write(e,t,r,n,a,o){const i=[e+"="+encodeURIComponent(t)];nc.isNumber(r)&&i.push("expires="+new Date(r).toGMTString()),nc.isString(n)&&i.push("path="+n),nc.isString(a)&&i.push("domain="+a),!0===o&&i.push("secure"),document.cookie=i.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 Wc(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 Bc=e=>e instanceof Mc?{...e}:e;function Zc(e,t){t=t||{};const r={};function n(e,t,r,n){return nc.isPlainObject(e)&&nc.isPlainObject(t)?nc.merge.call({caseless:n},e,t):nc.isPlainObject(t)?nc.merge({},t):nc.isArray(t)?t.slice():t}function a(e,t,r,a){return nc.isUndefined(t)?nc.isUndefined(e)?void 0:n(void 0,e,0,a):n(e,t,0,a)}function o(e,t){if(!nc.isUndefined(t))return n(void 0,t)}function i(e,t){return nc.isUndefined(t)?nc.isUndefined(e)?void 0:n(void 0,e):n(void 0,t)}function s(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:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:s,headers:(e,t,r)=>a(Bc(e),Bc(t),0,!0)};return nc.forEach(Object.keys({...e,...t}),function(n){const o=l[n]||a,i=o(e[n],t[n],n);nc.isUndefined(i)&&o!==s||(r[n]=i)}),r}var Hc=e=>{const t=Zc({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:a,xsrfCookieName:o,headers:i,auth:s}=t;if(t.headers=i=Mc.from(i),t.url=gc(Wc(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),s&&i.set("Authorization","Basic "+btoa((s.username||"")+":"+(s.password?unescape(encodeURIComponent(s.password)):""))),nc.isFormData(r))if(Ac.hasStandardBrowserEnv||Ac.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(nc.isFunction(r.getHeaders)){const e=r.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach(([e,r])=>{t.includes(e.toLowerCase())&&i.set(e,r)})}if(Ac.hasStandardBrowserEnv&&(n&&nc.isFunction(n)&&(n=n(t)),n||!1!==n&&jc(t.url))){const e=a&&o&&$c.read(o);e&&i.set(a,e)}return t};var Gc="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,r){const n=Hc(e);let a=n.data;const o=Mc.from(n.headers).normalize();let i,s,l,c,u,{responseType:d,onUploadProgress:f,onDownloadProgress:m}=n;function h(){c&&c(),u&&u(),n.cancelToken&&n.cancelToken.unsubscribe(i),n.signal&&n.signal.removeEventListener("abort",i)}let p=new XMLHttpRequest;function g(){if(!p)return;const n=Mc.from("getAllResponseHeaders"in p&&p.getAllResponseHeaders());Fc(function(e){t(e),h()},function(e){r(e),h()},{data:d&&"text"!==d&&"json"!==d?p.response:p.responseText,status:p.status,statusText:p.statusText,headers:n,config:e,request:p}),p=null}p.open(n.method.toUpperCase(),n.url,!0),p.timeout=n.timeout,"onloadend"in p?p.onloadend=g:p.onreadystatechange=function(){p&&4===p.readyState&&(0!==p.status||p.responseURL&&0===p.responseURL.indexOf("file:"))&&setTimeout(g)},p.onabort=function(){p&&(r(new ac("Request aborted",ac.ECONNABORTED,e,p)),p=null)},p.onerror=function(t){const n=new ac(t&&t.message?t.message:"Network Error",ac.ERR_NETWORK,e,p);n.event=t||null,r(n),p=null},p.ontimeout=function(){let t=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded";const a=n.transitional||vc;n.timeoutErrorMessage&&(t=n.timeoutErrorMessage),r(new ac(t,a.clarifyTimeoutError?ac.ETIMEDOUT:ac.ECONNABORTED,e,p)),p=null},void 0===a&&o.setContentType(null),"setRequestHeader"in p&&nc.forEach(o.toJSON(),function(e,t){p.setRequestHeader(t,e)}),nc.isUndefined(n.withCredentials)||(p.withCredentials=!!n.withCredentials),d&&"json"!==d&&(p.responseType=n.responseType),m&&([l,u]=zc(m,!0),p.addEventListener("progress",l)),f&&p.upload&&([s,c]=zc(f),p.upload.addEventListener("progress",s),p.upload.addEventListener("loadend",c)),(n.cancelToken||n.signal)&&(i=t=>{p&&(r(!t||t.type?new Lc(null,e,p):t),p.abort(),p=null)},n.cancelToken&&n.cancelToken.subscribe(i),n.signal&&(n.signal.aborted?i():n.signal.addEventListener("abort",i)));const y=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(n.url);y&&-1===Ac.protocols.indexOf(y)?r(new ac("Unsupported protocol "+y+":",ac.ERR_BAD_REQUEST,e)):p.send(a||null)})};const Kc=(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,i();const t=e instanceof Error?e:this.reason;n.abort(t instanceof ac?t:new Lc(t instanceof Error?t.message:t))}};let o=t&&setTimeout(()=>{o=null,a(new ac(`timeout ${t} of ms exceeded`,ac.ETIMEDOUT))},t);const i=()=>{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:s}=n;return s.unsubscribe=()=>nc.asap(i),s}},qc=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},Jc=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()}},Yc=(e,t,r,n)=>{const a=async function*(e,t){for await(const r of Jc(e))yield*qc(r,t)}(e,t);let o,i=0,s=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 s(),void e.close();let o=n.byteLength;if(r){let e=i+=o;r(e)}e.enqueue(new Uint8Array(n))}catch(e){throw s(e),e}},cancel:e=>(s(e),a.return())},{highWaterMark:2})},{isFunction:Xc}=nc,Qc=(({Request:e,Response:t})=>({Request:e,Response:t}))(nc.global),{ReadableStream:eu,TextEncoder:tu}=nc.global,ru=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},nu=e=>{e=nc.merge.call({skipUndefined:!0},Qc,e);const{fetch:t,Request:r,Response:n}=e,a=t?Xc(t):"function"==typeof fetch,o=Xc(r),i=Xc(n);if(!a)return!1;const s=a&&Xc(eu),l=a&&("function"==typeof tu?(c=new tu,e=>c.encode(e)):async e=>new Uint8Array(await new r(e).arrayBuffer()));var c;const u=o&&s&&ru(()=>{let e=!1;const t=new r(Ac.origin,{body:new eu,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),d=i&&s&&ru(()=>nc.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 ac(`Response type '${e}' is not supported`,ac.ERR_NOT_SUPPORT,r)})});const m=async(e,t)=>{const n=nc.toFiniteNumber(e.getContentLength());return null==n?(async e=>{if(null==e)return 0;if(nc.isBlob(e))return e.size;if(nc.isSpecCompliantForm(e)){const t=new r(Ac.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return nc.isArrayBufferView(e)||nc.isArrayBuffer(e)?e.byteLength:(nc.isURLSearchParams(e)&&(e+=""),nc.isString(e)?(await l(e)).byteLength:void 0)})(t):n};return async e=>{let{url:a,method:i,data:s,signal:l,cancelToken:c,timeout:h,onDownloadProgress:p,onUploadProgress:g,responseType:y,headers:v,withCredentials:b="same-origin",fetchOptions:w}=Hc(e),S=t||fetch;y=y?(y+"").toLowerCase():"text";let x=Kc([l,c&&c.toAbortSignal()],h),k=null;const T=x&&x.unsubscribe&&(()=>{x.unsubscribe()});let A;try{if(g&&u&&"get"!==i&&"head"!==i&&0!==(A=await m(v,s))){let e,t=new r(a,{method:"POST",body:s,duplex:"half"});if(nc.isFormData(s)&&(e=t.headers.get("content-type"))&&v.setContentType(e),t.body){const[e,r]=Uc(A,zc(Vc(g)));s=Yc(t.body,65536,e,r)}}nc.isString(b)||(b=b?"include":"omit");const t=o&&"credentials"in r.prototype,l={...w,signal:x,method:i.toUpperCase(),headers:v.normalize().toJSON(),body:s,duplex:"half",credentials:t?b:void 0};k=o&&new r(a,l);let c=await(o?S(k,w):S(a,l));const h=d&&("stream"===y||"response"===y);if(d&&(p||h&&T)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=c[t]});const t=nc.toFiniteNumber(c.headers.get("content-length")),[r,a]=p&&Uc(t,zc(Vc(p),!0))||[];c=new n(Yc(c.body,65536,r,()=>{a&&a(),T&&T()}),e)}y=y||"text";let E=await f[nc.findKey(f,y)||"text"](c,e);return!h&&T&&T(),await new Promise((t,r)=>{Fc(t,r,{data:E,headers:Mc.from(c.headers),status:c.status,statusText:c.statusText,config:e,request:k})})}catch(t){if(T&&T(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new ac("Network Error",ac.ERR_NETWORK,e,k),{cause:t.cause||t});throw ac.from(t,t&&t.code,e,k)}}},au=new Map,ou=e=>{let t=e?e.env:{};const{fetch:r,Request:n,Response:a}=t,o=[n,a,r];let i,s,l=o.length,c=au;for(;l--;)i=o[l],s=c.get(i),void 0===s&&c.set(i,s=l?new Map:nu(t)),c=s;return s};ou();const iu={http:null,xhr:Gc,fetch:{get:ou}};nc.forEach(iu,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});const su=e=>`- ${e}`,lu=e=>nc.isFunction(e)||null===e||!1===e;var cu=(e,t)=>{e=nc.isArray(e)?e:[e];const{length:r}=e;let n,a;const o={};for(let i=0;i<r;i++){let r;if(n=e[i],a=n,!lu(n)&&(a=iu[(r=String(n)).toLowerCase()],void 0===a))throw new ac(`Unknown adapter '${r}'`);if(a&&(nc.isFunction(a)||(a=a.get(t))))break;o[r||"#"+i]=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 ac("There is no suitable adapter to dispatch the request "+(r?e.length>1?"since :\n"+e.map(su).join("\n"):" "+su(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return a};function uu(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Lc(null,e)}function du(e){uu(e),e.headers=Mc.from(e.headers),e.data=Pc.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return cu(e.adapter||Cc.adapter,e)(e).then(function(t){return uu(e),t.data=Pc.call(e,e.transformResponse,t),t.headers=Mc.from(t.headers),t},function(t){return Ic(t)||(uu(e),t&&t.response&&(t.response.data=Pc.call(e,e.transformResponse,t.response),t.response.headers=Mc.from(t.response.headers))),Promise.reject(t)})}const fu="1.12.2",mu={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{mu[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const hu={};mu.transitional=function(e,t,r){function n(e,t){return"[Axios v"+fu+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}return(r,a,o)=>{if(!1===e)throw new ac(n(a," has been removed"+(t?" in "+t:"")),ac.ERR_DEPRECATED);return t&&!hu[a]&&(hu[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)}},mu.spelling=function(e){return(t,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};var pu={assertOptions:function(e,t,r){if("object"!=typeof e)throw new ac("options must be an object",ac.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let a=n.length;for(;a-- >0;){const o=n[a],i=t[o];if(i){const t=e[o],r=void 0===t||i(t,o,e);if(!0!==r)throw new ac("option "+o+" must be "+r,ac.ERR_BAD_OPTION_VALUE);continue}if(!0!==r)throw new ac("Unknown option "+o,ac.ERR_BAD_OPTION)}},validators:mu};const gu=pu.validators;let yu=class{constructor(e){this.defaults=e||{},this.interceptors={request:new yc,response:new yc}}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&&pu.assertOptions(r,{silentJSONParsing:gu.transitional(gu.boolean),forcedJSONParsing:gu.transitional(gu.boolean),clarifyTimeoutError:gu.transitional(gu.boolean)},!1),null!=n&&(nc.isFunction(n)?t.paramsSerializer={serialize:n}:pu.assertOptions(n,{encode:gu.function,serialize:gu.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),pu.assertOptions(t,{baseUrl:gu.spelling("baseURL"),withXsrfToken:gu.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=a&&nc.merge(a.common,a[t.method]);a&&nc.forEach(["delete","get","head","post","put","patch","common"],e=>{delete a[e]}),t.headers=Mc.concat(o,a);const i=[];let s=!0;this.interceptors.request.forEach(function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(s=s&&e.synchronous,i.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(!s){const e=[du.bind(this),void 0];for(e.unshift(...i),e.push(...l),u=e.length,c=Promise.resolve(t);d<u;)c=c.then(e[d++],e[d++]);return c}u=i.length;let f=t;for(;d<u;){const e=i[d++],t=i[d++];try{f=e(f)}catch(e){t.call(this,e);break}}try{c=du.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 gc(Wc((e=Zc(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}};nc.forEach(["delete","get","head","options"],function(e){yu.prototype[e]=function(t,r){return this.request(Zc(r||{},{method:e,url:t,data:(r||{}).data}))}}),nc.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}))}}yu.prototype[e]=t(),yu.prototype[e+"Form"]=t(!0)});const vu={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(vu).forEach(([e,t])=>{vu[t]=e});const bu=function e(t){const r=new yu(t),n=ml(yu.prototype.request,r);return nc.extend(n,yu.prototype,r,{allOwnKeys:!0}),nc.extend(n,r,null,{allOwnKeys:!0}),n.create=function(r){return e(Zc(t,r))},n}(Cc);bu.Axios=yu,bu.CanceledError=Lc,bu.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 Lc(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}}},bu.isCancel=Ic,bu.VERSION=fu,bu.toFormData=dc,bu.AxiosError=ac,bu.Cancel=bu.CanceledError,bu.all=function(e){return Promise.all(e)},bu.spread=function(e){return function(t){return e.apply(null,t)}},bu.isAxiosError=function(e){return nc.isObject(e)&&!0===e.isAxiosError},bu.mergeConfig=Zc,bu.AxiosHeaders=Mc,bu.formToJSON=e=>Ec(nc.isHTMLForm(e)?new FormData(e):e),bu.getAdapter=cu,bu.HttpStatusCode=vu,bu.default=bu;const{Axios:wu,AxiosError:Su,CanceledError:xu,isCancel:ku,CancelToken:Tu,VERSION:Au,all:Eu,Cancel:Cu,isAxiosError:Nu,spread:_u,toFormData:Ru,AxiosHeaders:Ou,HttpStatusCode:Du,formToJSON:Mu,getAdapter:Pu,mergeConfig:Iu}=bu,Lu="undefined"!=typeof window;const Fu=new class{constructor(e={}){this.client=bu.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 Lu?localStorage.getItem("auth_token"):null}handleUnauthorized(){Lu&&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){Lu&&localStorage.setItem("auth_token",e)}removeAuthToken(){Lu&&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 zu{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 Uu(t,r=[]){let a=[];const o=()=>{const e=a.map(e=>n.createContext(e));return function(r){const a=r?.[t]||e;return n.useMemo(()=>({[`__scope${t}`]:{...r,[t]:a}}),[r,a])}};return o.scopeName=t,[function(r,o){const i=n.createContext(o),s=a.length;a=[...a,o];const l=r=>{const{scope:a,children:o,...l}=r,c=a?.[t]?.[s]||i,u=n.useMemo(()=>l,Object.values(l));return e(c.Provider,{value:u,children:o})};return l.displayName=r+"Provider",[l,function(e,a){const l=a?.[t]?.[s]||i,c=n.useContext(l);if(c)return c;if(void 0!==o)return o;throw new Error(`\`${e}\` must be used within \`${r}\``)}]},Vu(o,...r)]}function Vu(...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 a=r.reduce((t,{useScope:r,scopeName:n})=>({...t,...r(e)[`__scope${n}`]}),{});return n.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return r.scopeName=t.scopeName,r}function ju(e){const t=n.useRef(e);return n.useEffect(()=>{t.current=e}),n.useMemo(()=>(...e)=>t.current?.(...e),[])}var $u,Wu=globalThis?.document?n.useLayoutEffect:()=>{},Bu={exports:{}},Zu={};var Hu,Gu,Ku={};
|
|
20
|
+
*/Li.displayName="Button";var zi=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((t,r)=>{const a=oi(`Primitive.${r}`),o=n.forwardRef((t,n)=>{const{asChild:o,...i}=t,s=o?a:r;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),e(s,{...i,ref:n})});return o.displayName=`Primitive.${r}`,{...t,[r]:o}},{});var Fi=n.forwardRef((t,r)=>e(zi.label,{...t,ref:r,onMouseDown:e=>{e.target.closest("button, input, select, textarea")||(t.onMouseDown?.(e),!e.defaultPrevented&&e.detail>1&&e.preventDefault())}}));Fi.displayName="Label";var ji=Fi;const Bi=fi("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Vi=n.forwardRef(({className:t,...r},n)=>e(ji,{ref:n,className:ti(Bi(),t),...r}));Vi.displayName=ji.displayName;const $i=Qe,Wi=n.createContext({}),Gi=({...t})=>e(Wi.Provider,{value:{name:t.name},children:e(st,{...t})}),Ki=()=>{const e=n.useContext(Wi),t=n.useContext(Hi),{getFieldState:r,formState:a}=Xe(),o=r(e.name,a);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:i}=t;return{id:i,name:e.name,formItemId:`${i}-form-item`,formDescriptionId:`${i}-form-item-description`,formMessageId:`${i}-form-item-message`,...o}},Hi=n.createContext({}),Zi=n.forwardRef(({className:t,...r},a)=>{const o=n.useId();return e(Hi.Provider,{value:{id:o},children:e("div",{ref:a,className:ti("space-y-2",t),...r})})});Zi.displayName="FormItem";const qi=n.forwardRef(({className:t,...r},n)=>{const{error:a,formItemId:o}=Ki();return e(Vi,{ref:n,className:ti(a&&"text-destructive",t),htmlFor:o,...r})});qi.displayName="FormLabel";const Ji=n.forwardRef(({...t},r)=>{const{error:n,formItemId:a,formDescriptionId:o,formMessageId:i}=Ki();return e(ii,{ref:r,id:a,"aria-describedby":n?`${o} ${i}`:`${o}`,"aria-invalid":!!n,...t})});Ji.displayName="FormControl";const Yi=n.forwardRef(({className:t,...r},n)=>{const{formDescriptionId:a}=Ki();return e("p",{ref:n,id:a,className:ti("text-sm text-muted-foreground",t),...r})});Yi.displayName="FormDescription";const Xi=n.forwardRef(({className:t,children:r,...n},a)=>{const{error:o,formMessageId:i}=Ki(),s=o?String(o?.message):r;return s?e("p",{ref:a,id:i,className:ti("text-sm font-medium text-destructive",t),...n,children:s}):null});Xi.displayName="FormMessage";const Qi=n.forwardRef(({className:t,type:r,...n},a)=>e("input",{type:r,className:ti("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 es({className:t,...r}){return e("div",{className:ti("animate-pulse rounded-md bg-primary/10",t),...r})}Qi.displayName="Input";let ts=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),i=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(!i.ok)throw new Error(`Failed to submit beta user request: ${i.statusText}`);return i.json()}};const rs=Yt("ZodISODateTime",(e,t)=>{$n.init(e,t),Ts.init(e,t)});function ns(e){return function(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...yr(t)})}(rs,e)}const as=Yt("ZodISODate",(e,t)=>{Wn.init(e,t),Ts.init(e,t)});function os(e){return function(e,t){return new e({type:"string",format:"date",check:"string_format",...yr(t)})}(as,e)}const is=Yt("ZodISOTime",(e,t)=>{Gn.init(e,t),Ts.init(e,t)});function ss(e){return function(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...yr(t)})}(is,e)}const ls=Yt("ZodISODuration",(e,t)=>{Kn.init(e,t),Ts.init(e,t)});function cs(e){return function(e,t){return new e({type:"string",format:"duration",check:"string_format",...yr(t)})}(ls,e)}const ds=Yt("ZodError",(e,t)=>{Tr.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,rr,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,rr,2)}},isEmpty:{get:()=>0===e.issues.length}})},{Parent:Error}),us=_r(ds),fs=Pr(ds),ms=Dr(ds),ps=Mr(ds),hs=Lr(ds),gs=zr(ds),vs=Fr(ds),bs=jr(ds),ys=Br(ds),ws=Vr(ds),xs=$r(ds),Ss=Wr(ds),ks=Yt("ZodType",(e,t)=>(_n.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)=>br(e,t,r),e.brand=()=>e,e.register=(t,r)=>(t.add(e,r),e),e.parse=(t,r)=>us(e,t,r,{callee:e.parse}),e.safeParse=(t,r)=>ms(e,t,r),e.parseAsync=async(t,r)=>fs(e,t,r,{callee:e.parseAsync}),e.safeParseAsync=async(t,r)=>ps(e,t,r),e.spa=e.safeParseAsync,e.encode=(t,r)=>hs(e,t,r),e.decode=(t,r)=>gs(e,t,r),e.encodeAsync=async(t,r)=>vs(e,t,r),e.decodeAsync=async(t,r)=>bs(e,t,r),e.safeEncode=(t,r)=>ys(e,t,r),e.safeDecode=(t,r)=>ws(e,t,r),e.safeEncodeAsync=async(t,r)=>xs(e,t,r),e.safeDecodeAsync=async(t,r)=>Ss(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,...yr(r)})}(hl,e,t)}(t,r)),e.superRefine=t=>e.check(Ba(t)),e.overwrite=t=>e.check(ja(t)),e.optional=()=>ol(e),e.nullable=()=>sl(e),e.nullish=()=>ol(sl(e)),e.nonoptional=t=>function(e,t){return new dl({type:"nonoptional",innerType:e,...yr(t)})}(e,t),e.array=()=>{return function(e,t,r){return new e({type:"array",element:t,...yr(r)})}(Ys,e,t);var t},e.or=t=>function(e,t){return new el({type:"union",options:e,...yr(t)})}([e,t]),e.and=t=>new tl({type:"intersection",left:e,right:t}),e.transform=t=>ml(e,new nl({type:"transform",transform:t})),e.default=t=>{return r=t,new ll({type:"default",innerType:e,get defaultValue(){return"function"==typeof r?r():hr(r)}});var r},e.prefault=t=>{return r=t,new cl({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof r?r():hr(r)}});var r},e.catch=t=>{return new ul({type:"catch",innerType:e,catchValue:"function"==typeof(r=t)?r:()=>r});var r},e.pipe=t=>ml(e,t),e.readonly=()=>new pl({type:"readonly",innerType:e}),e.describe=t=>{const r=e.clone();return Ma.add(r,{description:t}),r},Object.defineProperty(e,"description",{get:()=>Ma.get(e)?.description,configurable:!0}),e.meta=(...t)=>{if(0===t.length)return Ma.get(e);const r=e.clone();return Ma.add(r,t[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),As=Yt("_ZodString",(e,t)=>{Rn.init(e,t),ks.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 wn({check:"string_format",format:"regex",...yr(t),pattern:e})}(...t)),e.includes=(...t)=>e.check(function(e,t){return new kn({check:"string_format",format:"includes",...yr(t),includes:e})}(...t)),e.startsWith=(...t)=>e.check(function(e,t){return new An({check:"string_format",format:"starts_with",...yr(t),prefix:e})}(...t)),e.endsWith=(...t)=>e.check(function(e,t){return new En({check:"string_format",format:"ends_with",...yr(t),suffix:e})}(...t)),e.min=(...t)=>e.check(za(...t)),e.max=(...t)=>e.check(La(...t)),e.length=(...t)=>e.check(Fa(...t)),e.nonempty=(...t)=>e.check(za(1,...t)),e.lowercase=t=>e.check(function(e){return new xn({check:"string_format",format:"lowercase",...yr(e)})}(t)),e.uppercase=t=>e.check(function(e){return new Sn({check:"string_format",format:"uppercase",...yr(e)})}(t)),e.trim=()=>e.check(ja(e=>e.trim())),e.normalize=(...t)=>e.check(function(e){return ja(t=>t.normalize(e))}(...t)),e.toLowerCase=()=>e.check(ja(e=>e.toLowerCase())),e.toUpperCase=()=>e.check(ja(e=>e.toUpperCase()))}),Es=Yt("ZodString",(e,t)=>{Rn.init(e,t),As.init(e,t),e.email=t=>e.check(function(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...yr(t)})}(Ns,t)),e.url=t=>e.check(function(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...yr(t)})}(Ps,t)),e.jwt=t=>e.check(function(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...yr(t)})}(Ks,t)),e.emoji=t=>e.check(function(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...yr(t)})}(Os,t)),e.guid=t=>e.check(Ua(_s,t)),e.uuid=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...yr(t)})}(Rs,t)),e.uuidv4=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...yr(t)})}(Rs,t)),e.uuidv6=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...yr(t)})}(Rs,t)),e.uuidv7=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...yr(t)})}(Rs,t)),e.nanoid=t=>e.check(function(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...yr(t)})}(Ds,t)),e.guid=t=>e.check(Ua(_s,t)),e.cuid=t=>e.check(function(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...yr(t)})}(Is,t)),e.cuid2=t=>e.check(function(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...yr(t)})}(Ms,t)),e.ulid=t=>e.check(function(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...yr(t)})}(Us,t)),e.base64=t=>e.check(function(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...yr(t)})}($s,t)),e.base64url=t=>e.check(function(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...yr(t)})}(Ws,t)),e.xid=t=>e.check(function(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...yr(t)})}(Ls,t)),e.ksuid=t=>e.check(function(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...yr(t)})}(zs,t)),e.ipv4=t=>e.check(function(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...yr(t)})}(Fs,t)),e.ipv6=t=>e.check(function(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...yr(t)})}(js,t)),e.cidrv4=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...yr(t)})}(Bs,t)),e.cidrv6=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...yr(t)})}(Vs,t)),e.e164=t=>e.check(function(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...yr(t)})}(Gs,t)),e.datetime=t=>e.check(ns(t)),e.date=t=>e.check(os(t)),e.time=t=>e.check(ss(t)),e.duration=t=>e.check(cs(t))});function Cs(e){return function(e,t){return new e({type:"string",...yr(t)})}(Es,e)}const Ts=Yt("ZodStringFormat",(e,t)=>{Pn.init(e,t),As.init(e,t)}),Ns=Yt("ZodEmail",(e,t)=>{In.init(e,t),Ts.init(e,t)}),_s=Yt("ZodGUID",(e,t)=>{On.init(e,t),Ts.init(e,t)}),Rs=Yt("ZodUUID",(e,t)=>{Dn.init(e,t),Ts.init(e,t)}),Ps=Yt("ZodURL",(e,t)=>{Mn.init(e,t),Ts.init(e,t)}),Os=Yt("ZodEmoji",(e,t)=>{Un.init(e,t),Ts.init(e,t)}),Ds=Yt("ZodNanoID",(e,t)=>{Ln.init(e,t),Ts.init(e,t)}),Is=Yt("ZodCUID",(e,t)=>{zn.init(e,t),Ts.init(e,t)}),Ms=Yt("ZodCUID2",(e,t)=>{Fn.init(e,t),Ts.init(e,t)}),Us=Yt("ZodULID",(e,t)=>{jn.init(e,t),Ts.init(e,t)}),Ls=Yt("ZodXID",(e,t)=>{Bn.init(e,t),Ts.init(e,t)}),zs=Yt("ZodKSUID",(e,t)=>{Vn.init(e,t),Ts.init(e,t)}),Fs=Yt("ZodIPv4",(e,t)=>{Hn.init(e,t),Ts.init(e,t)}),js=Yt("ZodIPv6",(e,t)=>{Zn.init(e,t),Ts.init(e,t)}),Bs=Yt("ZodCIDRv4",(e,t)=>{qn.init(e,t),Ts.init(e,t)}),Vs=Yt("ZodCIDRv6",(e,t)=>{Jn.init(e,t),Ts.init(e,t)}),$s=Yt("ZodBase64",(e,t)=>{Xn.init(e,t),Ts.init(e,t)}),Ws=Yt("ZodBase64URL",(e,t)=>{Qn.init(e,t),Ts.init(e,t)}),Gs=Yt("ZodE164",(e,t)=>{ea.init(e,t),Ts.init(e,t)}),Ks=Yt("ZodJWT",(e,t)=>{ta.init(e,t),Ts.init(e,t)}),Hs=Yt("ZodUnknown",(e,t)=>{ra.init(e,t),ks.init(e,t)});function Zs(){return new Hs({type:"unknown"})}const qs=Yt("ZodNever",(e,t)=>{na.init(e,t),ks.init(e,t)});function Js(e){return function(e,t){return new e({type:"never",...yr(t)})}(qs,e)}const Ys=Yt("ZodArray",(e,t)=>{oa.init(e,t),ks.init(e,t),e.element=t.element,e.min=(t,r)=>e.check(za(t,r)),e.nonempty=t=>e.check(za(1,t)),e.max=(t,r)=>e.check(La(t,r)),e.length=(t,r)=>e.check(Fa(t,r)),e.unwrap=()=>e.element});const Xs=Yt("ZodObject",(e,t)=>{da.init(e,t),ks.init(e,t),sr(e,"shape",()=>t.shape),e.keyof=()=>function(e,t){const r=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new rl({type:"enum",entries:r,...yr(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:Zs()}),e.loose=()=>e.clone({...e._zod.def,catchall:Zs()}),e.strict=()=>e.clone({...e._zod.def,catchall:Js()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>function(e,t){if(!pr(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=cr(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return lr(this,"shape",r),r},checks:[]});return br(e,n)}(e,t),e.safeExtend=t=>function(e,t){if(!pr(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 lr(this,"shape",r),r},checks:e._zod.def.checks};return br(e,r)}(e,t),e.merge=t=>function(e,t){const r=cr(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return lr(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return br(e,r)}(e,t),e.pick=t=>function(e,t){const r=e._zod.def;return br(e,cr(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 lr(this,"shape",e),e},checks:[]}))}(e,t),e.omit=t=>function(e,t){const r=e._zod.def,n=cr(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 lr(this,"shape",n),n},checks:[]});return br(e,n)}(e,t),e.partial=(...t)=>function(e,t,r){const n=cr(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 lr(this,"shape",a),a},checks:[]});return br(t,n)}(al,e,t[0]),e.required=(...t)=>function(e,t,r){const n=cr(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 lr(this,"shape",a),a},checks:[]});return br(t,n)}(dl,e,t[0])});function Qs(e,t){const r={type:"object",get shape(){var t;return lr(this,"shape",e?(t=e,Object.create(Object.getPrototypeOf(t),Object.getOwnPropertyDescriptors(t))):{}),this.shape},...yr(t)};return new Xs(r)}const el=Yt("ZodUnion",(e,t)=>{fa.init(e,t),ks.init(e,t),e.options=t.options});const tl=Yt("ZodIntersection",(e,t)=>{ma.init(e,t),ks.init(e,t)});const rl=Yt("ZodEnum",(e,t)=>{ga.init(e,t),ks.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 rl({...t,checks:[],...yr(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 rl({...t,checks:[],...yr(n),entries:a})}});const nl=Yt("ZodTransform",(e,t)=>{va.init(e,t),ks.init(e,t),e._zod.parse=(r,n)=>{if("backward"===n.direction)throw new Qt(e.constructor.name);r.addIssue=n=>{if("string"==typeof n)r.issues.push(Er(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(Er(t))}};const a=t.transform(r.value,r);return a instanceof Promise?a.then(e=>(r.value=e,r)):(r.value=a,r)}});const al=Yt("ZodOptional",(e,t)=>{ya.init(e,t),ks.init(e,t),e.unwrap=()=>e._zod.def.innerType});function ol(e){return new al({type:"optional",innerType:e})}const il=Yt("ZodNullable",(e,t)=>{wa.init(e,t),ks.init(e,t),e.unwrap=()=>e._zod.def.innerType});function sl(e){return new il({type:"nullable",innerType:e})}const ll=Yt("ZodDefault",(e,t)=>{xa.init(e,t),ks.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});const cl=Yt("ZodPrefault",(e,t)=>{ka.init(e,t),ks.init(e,t),e.unwrap=()=>e._zod.def.innerType});const dl=Yt("ZodNonOptional",(e,t)=>{Aa.init(e,t),ks.init(e,t),e.unwrap=()=>e._zod.def.innerType});const ul=Yt("ZodCatch",(e,t)=>{Ca.init(e,t),ks.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});const fl=Yt("ZodPipe",(e,t)=>{Ta.init(e,t),ks.init(e,t),e.in=t.in,e.out=t.out});function ml(e,t){return new fl({type:"pipe",in:e,out:t})}const pl=Yt("ZodReadonly",(e,t)=>{_a.init(e,t),ks.init(e,t),e.unwrap=()=>e._zod.def.innerType});const hl=Yt("ZodCustom",(e,t)=>{Pa.init(e,t),ks.init(e,t)});const gl=Qs({name:Cs().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:Cs().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)")}),vl={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:"오류가 발생했습니다"}},bl=({onSuccess:n,onError:a,className:o="w-full",fieldClassName:i="flex flex-col gap-1.5 w-full",language:s,customTexts:d={},autoFocus:u=!0,showSuccessMessage:m=!0,hideLogo:p=!1,hideTitles:h=!1})=>{const[g,v]=f("en"),[b,y]=f(!1),[w,x]=f(!1),{submitBetaForm:S,isLoading:k,isSubmitting:A,error:E,config:C,success:T,message:N}=(()=>{const e=ue(e=>e.os),[t,r]=f(null),[n,a]=f(!0),[o,i]=f(!1),[s,d]=f(null),[u,m]=f(!1),[p,h]=f(null);return c(()=>{(async()=>{a(!0);const t=new ts(e),n=await t.fetchConfig();r(n),a(!1)})()},[e]),{isLoading:n,isSubmitting:o,config:t,error:s,success:u,message:p,submitBetaForm:l(async t=>{if(!e){const e="SaaS OS context is not initialized";return d(e),{success:!1,message:e}}try{i(!0),d(null),m(!1),h(null);const r=new ts(e),n=await r.submitBetaUser({name:t.name||"",email:t.email}),a="success"===n.status;return m(a),h(n.message),{success:a,message:n.message}}catch(e){const t=e instanceof Error?e.message:"Failed to submit beta form";return d(t),m(!1),h(t),{success:!1,message:t}}finally{i(!1)}},[e])}})();c(()=>{v((()=>{if("undefined"==typeof window)return"en";const e=window.navigator.language.split("-")[0];return-1!==Object.keys(vl).indexOf(e)?e:"en"})())},[]),c(()=>{T&&m&&(y(!0),x(!0)),E&&x(!0)},[T,m,E]);const _={...vl[s||g],...d},R=Gt({resolver:Ga(gl),defaultValues:{email:"",name:""},mode:"onChange",reValidateMode:"onChange"});c(()=>{u&&R.setFocus("name")},[u,R]);const P=R.formState.isValid&&!A;return e("div",{className:"saas-os-ui",style:{width:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:r("div",k?{className:ti("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",o),children:[e(es,{className:"h-24 w-24 rounded-lg"}),e(es,{className:"h-6 w-32"}),r("div",{className:"w-full space-y-4",children:[r("div",{className:"space-y-2",children:[e(es,{className:"h-4 w-16"}),e(es,{className:"h-10 w-full"})]}),r("div",{className:"space-y-2",children:[e(es,{className:"h-4 w-16"}),e(es,{className:"h-10 w-full"})]}),e(es,{className:"h-10 w-full"})]})]}:{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:[!p&&r("div",{className:"flex flex-col items-center justify-center w-full",children:[C?.logo&&e(wl,{logo:C?.logo}),C?.name&&e("div",{children:C?.name})]}),e(Qe,{...R,children:r("form",{onSubmit:R.handleSubmit(async e=>{try{const t=await S(e);t.success?(n?.(),R.reset(),m&&y(!0),x(!0)):(a?.(t.message),x(!0))}catch(e){a?.(e instanceof Error?e.message:_.errorMessage),x(!0)}}),className:o,noValidate:!0,"aria-busy":A,children:[!w&&r(t,{children:[!h&&C?.screen?.register&&e(yl,{screen:C?.screen?.register}),e(Gi,{control:R.control,name:"name",render:({field:t})=>r(Zi,{className:i,children:[e(qi,{children:_.nameLabel}),e(Ji,{children:e(Qi,{...t})}),e(Yi,{}),e(Xi,{})]})}),e(Gi,{control:R.control,name:"email",render:({field:t})=>r(Zi,{className:i,children:[e(qi,{children:_.emailLabel}),e(Ji,{children:e(Qi,{...t})}),e(Yi,{}),e(Xi,{})]})}),e(Li,{type:"submit",disabled:!P,className:i,children:A?_.submittingText:_.submitText})]}),w&&E&&r("div",{className:"flex flex-col items-center justify-center w-full",children:[r("div",{className:"border-red-300 text-red-700",role:"alert","aria-live":"assertive","aria-atomic":!0,children:[e("span",{className:"text-4xl mb-2",role:"img","aria-label":"Error",children:"❗"}),E]}),e("div",{className:"mt-4 flex justify-center",children:e(Li,{type:"button",onClick:()=>{x(!1),R.reset()},className:i,children:"Try Again"})})]}),w&&b&&N&&e("div",{className:"flex flex-col items-center justify-center w-full text-green-700 border-green-300 text-center",children:C?.screen?.thankYou&&e(yl,{screen:C?.screen?.thankYou})})]})}),!w&&e("div",{children:r("div",{children:["By submitting this form, you consent to our"," ",e("a",{href:C?.privacyPolicy,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-700",children:"Privacy Policy"})," ","and"," ",e("a",{href:C?.termsOfService,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-700",children:"Terms of Service"}),"."]})})]})})};function yl({screen:t}){return r("div",{className:"flex flex-col items-center justify-center w-full",children:[e("p",{className:"text-2xl font-bold",children:t?.title}),e("p",{className:"text-sm text-muted-foreground",children:t?.description})]})}function wl({logo:t}){return e("img","string"==typeof t?{src:t,alt:"Logo",className:"max-h-24"}:{src:t.bucket?.url,alt:"Logo",className:"max-h-24"})}function xl(e,t){return function(){return e.apply(t,arguments)}}const{toString:Sl}=Object.prototype,{getPrototypeOf:kl}=Object,{iterator:Al,toStringTag:El}=Symbol,Cl=(Tl=Object.create(null),e=>{const t=Sl.call(e);return Tl[t]||(Tl[t]=t.slice(8,-1).toLowerCase())});var Tl;const Nl=e=>(e=e.toLowerCase(),t=>Cl(t)===e),_l=e=>t=>typeof t===e,{isArray:Rl}=Array,Pl=_l("undefined");function Ol(e){return null!==e&&!Pl(e)&&null!==e.constructor&&!Pl(e.constructor)&&Ml(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Dl=Nl("ArrayBuffer");const Il=_l("string"),Ml=_l("function"),Ul=_l("number"),Ll=e=>null!==e&&"object"==typeof e,zl=e=>{if("object"!==Cl(e))return!1;const t=kl(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||El in e||Al in e)},Fl=Nl("Date"),jl=Nl("File"),Bl=Nl("Blob"),Vl=Nl("FileList"),$l=Nl("URLSearchParams"),[Wl,Gl,Kl,Hl]=["ReadableStream","Request","Response","Headers"].map(Nl);function Zl(e,t,{allOwnKeys:r=!1}={}){if(null==e)return;let n,a;if("object"!=typeof e&&(e=[e]),Rl(e))for(n=0,a=e.length;n<a;n++)t.call(null,e[n],n,e);else{if(Ol(e))return;const a=r?Object.getOwnPropertyNames(e):Object.keys(e),o=a.length;let i;for(n=0;n<o;n++)i=a[n],t.call(null,e[i],i,e)}}function ql(e,t){if(Ol(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 Jl="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,Yl=e=>!Pl(e)&&e!==Jl;const Xl=(Ql="undefined"!=typeof Uint8Array&&kl(Uint8Array),e=>Ql&&e instanceof Ql);var Ql;const ec=Nl("HTMLFormElement"),tc=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),rc=Nl("RegExp"),nc=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};Zl(r,(r,a)=>{let o;!1!==(o=t(r,a,e))&&(n[a]=o||r)}),Object.defineProperties(e,n)};const ac=Nl("AsyncFunction"),oc=(ic="function"==typeof setImmediate,sc=Ml(Jl.postMessage),ic?setImmediate:sc?(lc=`axios@${Math.random()}`,cc=[],Jl.addEventListener("message",({source:e,data:t})=>{e===Jl&&t===lc&&cc.length&&cc.shift()()},!1),e=>{cc.push(e),Jl.postMessage(lc,"*")}):e=>setTimeout(e));var ic,sc,lc,cc;const dc="undefined"!=typeof queueMicrotask?queueMicrotask.bind(Jl):"undefined"!=typeof process&&process.nextTick||oc;var uc={isArray:Rl,isArrayBuffer:Dl,isBuffer:Ol,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||Ml(e.append)&&("formdata"===(t=Cl(e))||"object"===t&&Ml(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&Dl(e.buffer),t},isString:Il,isNumber:Ul,isBoolean:e=>!0===e||!1===e,isObject:Ll,isPlainObject:zl,isEmptyObject:e=>{if(!Ll(e)||Ol(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:Wl,isRequest:Gl,isResponse:Kl,isHeaders:Hl,isUndefined:Pl,isDate:Fl,isFile:jl,isBlob:Bl,isRegExp:rc,isFunction:Ml,isStream:e=>Ll(e)&&Ml(e.pipe),isURLSearchParams:$l,isTypedArray:Xl,isFileList:Vl,forEach:Zl,merge:function e(){const{caseless:t,skipUndefined:r}=Yl(this)&&this||{},n={},a=(a,o)=>{const i=t&&ql(n,o)||o;zl(n[i])&&zl(a)?n[i]=e(n[i],a):zl(a)?n[i]=e({},a):Rl(a)?n[i]=a.slice():r&&Pl(a)||(n[i]=a)};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&Zl(arguments[e],a);return n},extend:(e,t,r,{allOwnKeys:n}={})=>(Zl(t,(t,n)=>{r&&Ml(t)?e[n]=xl(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,i;const s={};if(t=t||{},null==e)return t;do{for(a=Object.getOwnPropertyNames(e),o=a.length;o-- >0;)i=a[o],n&&!n(i,e,t)||s[i]||(t[i]=e[i],s[i]=!0);e=!1!==r&&kl(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:Cl,kindOfTest:Nl,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(Rl(e))return e;let t=e.length;if(!Ul(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:ec,hasOwnProperty:tc,hasOwnProp:tc,reduceDescriptors:nc,freezeMethods:e=>{nc(e,(t,r)=>{if(Ml(e)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;const n=e[r];Ml(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 Rl(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:ql,global:Jl,isContextDefined:Yl,isSpecCompliantForm:function(e){return!!(e&&Ml(e.append)&&"FormData"===e[El]&&e[Al])},toJSONObject:e=>{const t=new Array(10),r=(e,n)=>{if(Ll(e)){if(t.indexOf(e)>=0)return;if(Ol(e))return e;if(!("toJSON"in e)){t[n]=e;const a=Rl(e)?[]:{};return Zl(e,(e,t)=>{const o=r(e,n+1);!Pl(o)&&(a[t]=o)}),t[n]=void 0,a}}return e};return r(e,0)},isAsyncFn:ac,isThenable:e=>e&&(Ll(e)||Ml(e))&&Ml(e.then)&&Ml(e.catch),setImmediate:oc,asap:dc,isIterable:e=>null!=e&&Ml(e[Al])};function fc(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)}uc.inherits(fc,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:uc.toJSONObject(this.config),code:this.code,status:this.status}}});const mc=fc.prototype,pc={};["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=>{pc[e]={value:e}}),Object.defineProperties(fc,pc),Object.defineProperty(mc,"isAxiosError",{value:!0}),fc.from=(e,t,r,n,a,o)=>{const i=Object.create(mc);uc.toFlatObject(e,i,function(e){return e!==Error.prototype},e=>"isAxiosError"!==e);const s=e&&e.message?e.message:"Error",l=null==t&&e?e.code:t;return fc.call(i,s,l,r,n,a),e&&null==i.cause&&Object.defineProperty(i,"cause",{value:e,configurable:!0}),i.name=e&&e.name||"Error",o&&Object.assign(i,o),i};function hc(e){return uc.isPlainObject(e)||uc.isArray(e)}function gc(e){return uc.endsWith(e,"[]")?e.slice(0,-2):e}function vc(e,t,r){return e?e.concat(t).map(function(e,t){return e=gc(e),!r&&t?"["+e+"]":e}).join(r?".":""):t}const bc=uc.toFlatObject(uc,{},null,function(e){return/^is[A-Z]/.test(e)});function yc(e,t,r){if(!uc.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const n=(r=uc.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!uc.isUndefined(t[e])})).metaTokens,a=r.visitor||c,o=r.dots,i=r.indexes,s=(r.Blob||"undefined"!=typeof Blob&&Blob)&&uc.isSpecCompliantForm(t);if(!uc.isFunction(a))throw new TypeError("visitor must be a function");function l(e){if(null===e)return"";if(uc.isDate(e))return e.toISOString();if(uc.isBoolean(e))return e.toString();if(!s&&uc.isBlob(e))throw new fc("Blob is not supported. Use a Buffer instead.");return uc.isArrayBuffer(e)||uc.isTypedArray(e)?s&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function c(e,r,a){let s=e;if(e&&!a&&"object"==typeof e)if(uc.endsWith(r,"{}"))r=n?r:r.slice(0,-2),e=JSON.stringify(e);else if(uc.isArray(e)&&function(e){return uc.isArray(e)&&!e.some(hc)}(e)||(uc.isFileList(e)||uc.endsWith(r,"[]"))&&(s=uc.toArray(e)))return r=gc(r),s.forEach(function(e,n){!uc.isUndefined(e)&&null!==e&&t.append(!0===i?vc([r],n,o):null===i?r:r+"[]",l(e))}),!1;return!!hc(e)||(t.append(vc(a,r,o),l(e)),!1)}const d=[],u=Object.assign(bc,{defaultVisitor:c,convertValue:l,isVisitable:hc});if(!uc.isObject(e))throw new TypeError("data must be an object");return function e(r,n){if(!uc.isUndefined(r)){if(-1!==d.indexOf(r))throw Error("Circular reference detected in "+n.join("."));d.push(r),uc.forEach(r,function(r,o){!0===(!(uc.isUndefined(r)||null===r)&&a.call(t,r,uc.isString(o)?o.trim():o,n,u))&&e(r,n?n.concat(o):[o])}),d.pop()}}(e),t}function wc(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function xc(e,t){this._pairs=[],e&&yc(e,this,t)}const Sc=xc.prototype;function kc(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||kc;uc.isFunction(r)&&(r={serialize:r});const a=r&&r.serialize;let o;if(o=a?a(t,r):uc.isURLSearchParams(t)?t.toString():new xc(t,r).toString(n),o){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}Sc.append=function(e,t){this._pairs.push([e,t])},Sc.toString=function(e){const t=e?function(t){return e.call(this,t,wc)}:wc;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};class Ec{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){uc.forEach(this.handlers,function(t){null!==t&&e(t)})}}var Cc={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Tc={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:xc,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const Nc="undefined"!=typeof window&&"undefined"!=typeof document,_c="object"==typeof navigator&&navigator||void 0,Rc=Nc&&(!_c||["ReactNative","NativeScript","NS"].indexOf(_c.product)<0),Pc="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,Oc=Nc&&window.location.href||"http://localhost";var Dc={...Object.freeze({__proto__:null,hasBrowserEnv:Nc,hasStandardBrowserEnv:Rc,hasStandardBrowserWebWorkerEnv:Pc,navigator:_c,origin:Oc}),...Tc};function Ic(e){function t(e,r,n,a){let o=e[a++];if("__proto__"===o)return!0;const i=Number.isFinite(+o),s=a>=e.length;if(o=!o&&uc.isArray(n)?n.length:o,s)return uc.hasOwnProp(n,o)?n[o]=[n[o],r]:n[o]=r,!i;n[o]&&uc.isObject(n[o])||(n[o]=[]);return t(e,r,n[o],a)&&uc.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])),!i}if(uc.isFormData(e)&&uc.isFunction(e.entries)){const r={};return uc.forEachEntry(e,(e,n)=>{t(function(e){return uc.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),n,r,0)}),r}return null}const Mc={transitional:Cc,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const r=t.getContentType()||"",n=r.indexOf("application/json")>-1,a=uc.isObject(e);a&&uc.isHTMLForm(e)&&(e=new FormData(e));if(uc.isFormData(e))return n?JSON.stringify(Ic(e)):e;if(uc.isArrayBuffer(e)||uc.isBuffer(e)||uc.isStream(e)||uc.isFile(e)||uc.isBlob(e)||uc.isReadableStream(e))return e;if(uc.isArrayBufferView(e))return e.buffer;if(uc.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 yc(e,new Dc.classes.URLSearchParams,{visitor:function(e,t,r,n){return Dc.isNode&&uc.isBuffer(e)?(this.append(t,e.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((o=uc.isFileList(e))||r.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return yc(o?{"files[]":e}:e,t&&new t,this.formSerializer)}}return a||n?(t.setContentType("application/json",!1),function(e,t,r){if(uc.isString(e))try{return(t||JSON.parse)(e),uc.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(r||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||Mc.transitional,r=t&&t.forcedJSONParsing,n="json"===this.responseType;if(uc.isResponse(e)||uc.isReadableStream(e))return e;if(e&&uc.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 fc.from(e,fc.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:Dc.classes.FormData,Blob:Dc.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};uc.forEach(["delete","get","head","post","put","patch"],e=>{Mc.headers[e]={}});const Uc=uc.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 Lc=Symbol("internals");function zc(e){return e&&String(e).trim().toLowerCase()}function Fc(e){return!1===e||null==e?e:uc.isArray(e)?e.map(Fc):String(e)}function jc(e,t,r,n,a){return uc.isFunction(n)?n.call(this,t,r):(a&&(t=r),uc.isString(t)?uc.isString(n)?-1!==t.indexOf(n):uc.isRegExp(n)?n.test(t):void 0:void 0)}let Bc=class{constructor(e){e&&this.set(e)}set(e,t,r){const n=this;function a(e,t,r){const a=zc(t);if(!a)throw new Error("header name must be a non-empty string");const o=uc.findKey(n,a);(!o||void 0===n[o]||!0===r||void 0===r&&!1!==n[o])&&(n[o||t]=Fc(e))}const o=(e,t)=>uc.forEach(e,(e,r)=>a(e,r,t));if(uc.isPlainObject(e)||e instanceof this.constructor)o(e,t);else if(uc.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]&&Uc[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(uc.isObject(e)&&uc.isIterable(e)){let r,n,a={};for(const t of e){if(!uc.isArray(t))throw TypeError("Object iterator must return a key-value pair");a[n=t[0]]=(r=a[n])?uc.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=zc(e)){const r=uc.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(uc.isFunction(t))return t.call(this,e,r);if(uc.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=zc(e)){const r=uc.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=zc(e)){const a=uc.findKey(r,e);!a||t&&!jc(0,r[a],a,t)||(delete r[a],n=!0)}}return uc.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 uc.forEach(this,(n,a)=>{const o=uc.findKey(r,a);if(o)return t[o]=Fc(n),void delete t[a];const i=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,r)=>t.toUpperCase()+r)}(a):String(a).trim();i!==a&&delete t[a],t[i]=Fc(n),r[i]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return uc.forEach(this,(r,n)=>{null!=r&&!1!==r&&(t[n]=e&&uc.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[Lc]=this[Lc]={accessors:{}}).accessors,r=this.prototype;function n(e){const n=zc(e);t[n]||(!function(e,t){const r=uc.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 uc.isArray(e)?e.forEach(n):n(e),this}};function Vc(e,t){const r=this||Mc,n=t||r,a=Bc.from(n.headers);let o=n.data;return uc.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 Wc(e,t,r){fc.call(this,null==e?"canceled":e,fc.ERR_CANCELED,t,r),this.name="CanceledError"}function Gc(e,t,r){const n=r.config.validateStatus;r.status&&n&&!n(r.status)?t(new fc("Request failed with status code "+r.status,[fc.ERR_BAD_REQUEST,fc.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):e(r)}Bc.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),uc.reduceDescriptors(Bc.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[r]=e}}}),uc.freezeMethods(Bc),uc.inherits(Wc,fc,{__CANCEL__:!0});const Kc=(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,i=0;return t=void 0!==t?t:1e3,function(s){const l=Date.now(),c=n[i];a||(a=l),r[o]=s,n[o]=l;let d=i,u=0;for(;d!==o;)u+=r[d++],d%=e;if(o=(o+1)%e,o===i&&(i=(i+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 i=(t,o=Date.now())=>{a=o,r=null,n&&(clearTimeout(n),n=null),e(...t)};return[(...e)=>{const t=Date.now(),s=t-a;s>=o?i(e,t):(r=e,n||(n=setTimeout(()=>{n=null,i(r)},o-s)))},()=>r&&i(r)]}(r=>{const o=r.loaded,i=r.lengthComputable?r.total:void 0,s=o-n,l=a(s);n=o;e({loaded:o,total:i,progress:i?o/i:void 0,bytes:s,rate:l||void 0,estimated:l&&i&&o<=i?(i-o)/l:void 0,event:r,lengthComputable:null!=i,[t?"download":"upload"]:!0})},r)},Hc=(e,t)=>{const r=null!=e;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},Zc=e=>(...t)=>uc.asap(()=>e(...t));var qc=Dc.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,Dc.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(Dc.origin),Dc.navigator&&/(msie|trident)/i.test(Dc.navigator.userAgent)):()=>!0,Jc=Dc.hasStandardBrowserEnv?{write(e,t,r,n,a,o){const i=[e+"="+encodeURIComponent(t)];uc.isNumber(r)&&i.push("expires="+new Date(r).toGMTString()),uc.isString(n)&&i.push("path="+n),uc.isString(a)&&i.push("domain="+a),!0===o&&i.push("secure"),document.cookie=i.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 Yc(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 Xc=e=>e instanceof Bc?{...e}:e;function Qc(e,t){t=t||{};const r={};function n(e,t,r,n){return uc.isPlainObject(e)&&uc.isPlainObject(t)?uc.merge.call({caseless:n},e,t):uc.isPlainObject(t)?uc.merge({},t):uc.isArray(t)?t.slice():t}function a(e,t,r,a){return uc.isUndefined(t)?uc.isUndefined(e)?void 0:n(void 0,e,0,a):n(e,t,0,a)}function o(e,t){if(!uc.isUndefined(t))return n(void 0,t)}function i(e,t){return uc.isUndefined(t)?uc.isUndefined(e)?void 0:n(void 0,e):n(void 0,t)}function s(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:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:s,headers:(e,t,r)=>a(Xc(e),Xc(t),0,!0)};return uc.forEach(Object.keys({...e,...t}),function(n){const o=l[n]||a,i=o(e[n],t[n],n);uc.isUndefined(i)&&o!==s||(r[n]=i)}),r}var ed=e=>{const t=Qc({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:a,xsrfCookieName:o,headers:i,auth:s}=t;if(t.headers=i=Bc.from(i),t.url=Ac(Yc(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),s&&i.set("Authorization","Basic "+btoa((s.username||"")+":"+(s.password?unescape(encodeURIComponent(s.password)):""))),uc.isFormData(r))if(Dc.hasStandardBrowserEnv||Dc.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(uc.isFunction(r.getHeaders)){const e=r.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach(([e,r])=>{t.includes(e.toLowerCase())&&i.set(e,r)})}if(Dc.hasStandardBrowserEnv&&(n&&uc.isFunction(n)&&(n=n(t)),n||!1!==n&&qc(t.url))){const e=a&&o&&Jc.read(o);e&&i.set(a,e)}return t};var td="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,r){const n=ed(e);let a=n.data;const o=Bc.from(n.headers).normalize();let i,s,l,c,d,{responseType:u,onUploadProgress:f,onDownloadProgress:m}=n;function p(){c&&c(),d&&d(),n.cancelToken&&n.cancelToken.unsubscribe(i),n.signal&&n.signal.removeEventListener("abort",i)}let h=new XMLHttpRequest;function g(){if(!h)return;const n=Bc.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders());Gc(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 fc("Request aborted",fc.ECONNABORTED,e,h)),h=null)},h.onerror=function(t){const n=new fc(t&&t.message?t.message:"Network Error",fc.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||Cc;n.timeoutErrorMessage&&(t=n.timeoutErrorMessage),r(new fc(t,a.clarifyTimeoutError?fc.ETIMEDOUT:fc.ECONNABORTED,e,h)),h=null},void 0===a&&o.setContentType(null),"setRequestHeader"in h&&uc.forEach(o.toJSON(),function(e,t){h.setRequestHeader(t,e)}),uc.isUndefined(n.withCredentials)||(h.withCredentials=!!n.withCredentials),u&&"json"!==u&&(h.responseType=n.responseType),m&&([l,d]=Kc(m,!0),h.addEventListener("progress",l)),f&&h.upload&&([s,c]=Kc(f),h.upload.addEventListener("progress",s),h.upload.addEventListener("loadend",c)),(n.cancelToken||n.signal)&&(i=t=>{h&&(r(!t||t.type?new Wc(null,e,h):t),h.abort(),h=null)},n.cancelToken&&n.cancelToken.subscribe(i),n.signal&&(n.signal.aborted?i():n.signal.addEventListener("abort",i)));const v=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(n.url);v&&-1===Dc.protocols.indexOf(v)?r(new fc("Unsupported protocol "+v+":",fc.ERR_BAD_REQUEST,e)):h.send(a||null)})};const rd=(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,i();const t=e instanceof Error?e:this.reason;n.abort(t instanceof fc?t:new Wc(t instanceof Error?t.message:t))}};let o=t&&setTimeout(()=>{o=null,a(new fc(`timeout ${t} of ms exceeded`,fc.ETIMEDOUT))},t);const i=()=>{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:s}=n;return s.unsubscribe=()=>uc.asap(i),s}},nd=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},ad=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()}},od=(e,t,r,n)=>{const a=async function*(e,t){for await(const r of ad(e))yield*nd(r,t)}(e,t);let o,i=0,s=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 s(),void e.close();let o=n.byteLength;if(r){let e=i+=o;r(e)}e.enqueue(new Uint8Array(n))}catch(e){throw s(e),e}},cancel:e=>(s(e),a.return())},{highWaterMark:2})},{isFunction:id}=uc,sd=(({Request:e,Response:t})=>({Request:e,Response:t}))(uc.global),{ReadableStream:ld,TextEncoder:cd}=uc.global,dd=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},ud=e=>{e=uc.merge.call({skipUndefined:!0},sd,e);const{fetch:t,Request:r,Response:n}=e,a=t?id(t):"function"==typeof fetch,o=id(r),i=id(n);if(!a)return!1;const s=a&&id(ld),l=a&&("function"==typeof cd?(c=new cd,e=>c.encode(e)):async e=>new Uint8Array(await new r(e).arrayBuffer()));var c;const d=o&&s&&dd(()=>{let e=!1;const t=new r(Dc.origin,{body:new ld,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),u=i&&s&&dd(()=>uc.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 fc(`Response type '${e}' is not supported`,fc.ERR_NOT_SUPPORT,r)})});const m=async(e,t)=>{const n=uc.toFiniteNumber(e.getContentLength());return null==n?(async e=>{if(null==e)return 0;if(uc.isBlob(e))return e.size;if(uc.isSpecCompliantForm(e)){const t=new r(Dc.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return uc.isArrayBufferView(e)||uc.isArrayBuffer(e)?e.byteLength:(uc.isURLSearchParams(e)&&(e+=""),uc.isString(e)?(await l(e)).byteLength:void 0)})(t):n};return async e=>{let{url:a,method:i,data:s,signal:l,cancelToken:c,timeout:p,onDownloadProgress:h,onUploadProgress:g,responseType:v,headers:b,withCredentials:y="same-origin",fetchOptions:w}=ed(e),x=t||fetch;v=v?(v+"").toLowerCase():"text";let S=rd([l,c&&c.toAbortSignal()],p),k=null;const A=S&&S.unsubscribe&&(()=>{S.unsubscribe()});let E;try{if(g&&d&&"get"!==i&&"head"!==i&&0!==(E=await m(b,s))){let e,t=new r(a,{method:"POST",body:s,duplex:"half"});if(uc.isFormData(s)&&(e=t.headers.get("content-type"))&&b.setContentType(e),t.body){const[e,r]=Hc(E,Kc(Zc(g)));s=od(t.body,65536,e,r)}}uc.isString(y)||(y=y?"include":"omit");const t=o&&"credentials"in r.prototype,l={...w,signal:S,method:i.toUpperCase(),headers:b.normalize().toJSON(),body:s,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=uc.toFiniteNumber(c.headers.get("content-length")),[r,a]=h&&Hc(t,Kc(Zc(h),!0))||[];c=new n(od(c.body,65536,r,()=>{a&&a(),A&&A()}),e)}v=v||"text";let C=await f[uc.findKey(f,v)||"text"](c,e);return!p&&A&&A(),await new Promise((t,r)=>{Gc(t,r,{data:C,headers:Bc.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 fc("Network Error",fc.ERR_NETWORK,e,k),{cause:t.cause||t});throw fc.from(t,t&&t.code,e,k)}}},fd=new Map,md=e=>{let t=e?e.env:{};const{fetch:r,Request:n,Response:a}=t,o=[n,a,r];let i,s,l=o.length,c=fd;for(;l--;)i=o[l],s=c.get(i),void 0===s&&c.set(i,s=l?new Map:ud(t)),c=s;return s};md();const pd={http:null,xhr:td,fetch:{get:md}};uc.forEach(pd,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});const hd=e=>`- ${e}`,gd=e=>uc.isFunction(e)||null===e||!1===e;var vd=(e,t)=>{e=uc.isArray(e)?e:[e];const{length:r}=e;let n,a;const o={};for(let i=0;i<r;i++){let r;if(n=e[i],a=n,!gd(n)&&(a=pd[(r=String(n)).toLowerCase()],void 0===a))throw new fc(`Unknown adapter '${r}'`);if(a&&(uc.isFunction(a)||(a=a.get(t))))break;o[r||"#"+i]=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 fc("There is no suitable adapter to dispatch the request "+(r?e.length>1?"since :\n"+e.map(hd).join("\n"):" "+hd(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return a};function bd(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Wc(null,e)}function yd(e){bd(e),e.headers=Bc.from(e.headers),e.data=Vc.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return vd(e.adapter||Mc.adapter,e)(e).then(function(t){return bd(e),t.data=Vc.call(e,e.transformResponse,t),t.headers=Bc.from(t.headers),t},function(t){return $c(t)||(bd(e),t&&t.response&&(t.response.data=Vc.call(e,e.transformResponse,t.response),t.response.headers=Bc.from(t.response.headers))),Promise.reject(t)})}const wd="1.12.2",xd={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{xd[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const Sd={};xd.transitional=function(e,t,r){function n(e,t){return"[Axios v"+wd+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}return(r,a,o)=>{if(!1===e)throw new fc(n(a," has been removed"+(t?" in "+t:"")),fc.ERR_DEPRECATED);return t&&!Sd[a]&&(Sd[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)}},xd.spelling=function(e){return(t,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};var kd={assertOptions:function(e,t,r){if("object"!=typeof e)throw new fc("options must be an object",fc.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let a=n.length;for(;a-- >0;){const o=n[a],i=t[o];if(i){const t=e[o],r=void 0===t||i(t,o,e);if(!0!==r)throw new fc("option "+o+" must be "+r,fc.ERR_BAD_OPTION_VALUE);continue}if(!0!==r)throw new fc("Unknown option "+o,fc.ERR_BAD_OPTION)}},validators:xd};const Ad=kd.validators;let Ed=class{constructor(e){this.defaults=e||{},this.interceptors={request:new Ec,response:new Ec}}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=Qc(this.defaults,t);const{transitional:r,paramsSerializer:n,headers:a}=t;void 0!==r&&kd.assertOptions(r,{silentJSONParsing:Ad.transitional(Ad.boolean),forcedJSONParsing:Ad.transitional(Ad.boolean),clarifyTimeoutError:Ad.transitional(Ad.boolean)},!1),null!=n&&(uc.isFunction(n)?t.paramsSerializer={serialize:n}:kd.assertOptions(n,{encode:Ad.function,serialize:Ad.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),kd.assertOptions(t,{baseUrl:Ad.spelling("baseURL"),withXsrfToken:Ad.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=a&&uc.merge(a.common,a[t.method]);a&&uc.forEach(["delete","get","head","post","put","patch","common"],e=>{delete a[e]}),t.headers=Bc.concat(o,a);const i=[];let s=!0;this.interceptors.request.forEach(function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(s=s&&e.synchronous,i.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(!s){const e=[yd.bind(this),void 0];for(e.unshift(...i),e.push(...l),d=e.length,c=Promise.resolve(t);u<d;)c=c.then(e[u++],e[u++]);return c}d=i.length;let f=t;for(;u<d;){const e=i[u++],t=i[u++];try{f=e(f)}catch(e){t.call(this,e);break}}try{c=yd.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 Ac(Yc((e=Qc(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}};uc.forEach(["delete","get","head","options"],function(e){Ed.prototype[e]=function(t,r){return this.request(Qc(r||{},{method:e,url:t,data:(r||{}).data}))}}),uc.forEach(["post","put","patch"],function(e){function t(t){return function(r,n,a){return this.request(Qc(a||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}Ed.prototype[e]=t(),Ed.prototype[e+"Form"]=t(!0)});const Cd={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(Cd).forEach(([e,t])=>{Cd[t]=e});const Td=function e(t){const r=new Ed(t),n=xl(Ed.prototype.request,r);return uc.extend(n,Ed.prototype,r,{allOwnKeys:!0}),uc.extend(n,r,null,{allOwnKeys:!0}),n.create=function(r){return e(Qc(t,r))},n}(Mc);Td.Axios=Ed,Td.CanceledError=Wc,Td.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 Wc(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}}},Td.isCancel=$c,Td.VERSION=wd,Td.toFormData=yc,Td.AxiosError=fc,Td.Cancel=Td.CanceledError,Td.all=function(e){return Promise.all(e)},Td.spread=function(e){return function(t){return e.apply(null,t)}},Td.isAxiosError=function(e){return uc.isObject(e)&&!0===e.isAxiosError},Td.mergeConfig=Qc,Td.AxiosHeaders=Bc,Td.formToJSON=e=>Ic(uc.isHTMLForm(e)?new FormData(e):e),Td.getAdapter=vd,Td.HttpStatusCode=Cd,Td.default=Td;const{Axios:Nd,AxiosError:_d,CanceledError:Rd,isCancel:Pd,CancelToken:Od,VERSION:Dd,all:Id,Cancel:Md,isAxiosError:Ud,spread:Ld,toFormData:zd,AxiosHeaders:Fd,HttpStatusCode:jd,formToJSON:Bd,getAdapter:Vd,mergeConfig:$d}=Td;const Wd=new class{constructor(e={}){this.client=Td.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=R();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 Gd{constructor(e){this.version=e.version,this.orgId=e.orgId,this.serverUrl=e.serverUrl}getAuthHeader(){return P()}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 Kd(t,r=[]){let a=[];const o=()=>{const e=a.map(e=>n.createContext(e));return function(r){const a=r?.[t]||e;return n.useMemo(()=>({[`__scope${t}`]:{...r,[t]:a}}),[r,a])}};return o.scopeName=t,[function(r,o){const i=n.createContext(o),s=a.length;a=[...a,o];const l=r=>{const{scope:a,children:o,...l}=r,c=a?.[t]?.[s]||i,d=n.useMemo(()=>l,Object.values(l));return e(c.Provider,{value:d,children:o})};return l.displayName=r+"Provider",[l,function(e,a){const l=a?.[t]?.[s]||i,c=n.useContext(l);if(c)return c;if(void 0!==o)return o;throw new Error(`\`${e}\` must be used within \`${r}\``)}]},Hd(o,...r)]}function Hd(...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 a=r.reduce((t,{useScope:r,scopeName:n})=>({...t,...r(e)[`__scope${n}`]}),{});return n.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return r.scopeName=t.scopeName,r}function Zd(e){const t=n.useRef(e);return n.useEffect(()=>{t.current=e}),n.useMemo(()=>(...e)=>t.current?.(...e),[])}var qd,Jd=globalThis?.document?n.useLayoutEffect:()=>{},Yd={exports:{}},Xd={};function Qd(){if(qd)return Xd;qd=1;var e=a;var t="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},r=e.useState,n=e.useEffect,o=e.useLayoutEffect,i=e.useDebugValue;function s(e){var r=e.getSnapshot;e=e.value;try{var n=r();return!t(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 a=t(),l=r({inst:{value:a,getSnapshot:t}}),c=l[0].inst,d=l[1];return o(function(){c.value=a,c.getSnapshot=t,s(c)&&d({inst:c})},[e,a,t]),n(function(){return s(c)&&d({inst:c}),e(function(){s(c)&&d({inst:c})})},[e]),i(a),a};return Xd.useSyncExternalStore=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:l,Xd}var eu,tu,ru={};
|
|
21
21
|
/**
|
|
22
22
|
* @license React
|
|
23
23
|
* use-sync-external-store-shim.development.js
|
|
@@ -26,5 +26,5 @@ var ui={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
|
-
*/var qu=(Gu||(Gu=1,"production"===process.env.NODE_ENV?Bu.exports=function(){if($u)return Zu;$u=1;var e=a,t="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},r=e.useState,n=e.useEffect,o=e.useLayoutEffect,i=e.useDebugValue;function s(e){var r=e.getSnapshot;e=e.value;try{var n=r();return!t(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 a=t(),l=r({inst:{value:a,getSnapshot:t}}),c=l[0].inst,u=l[1];return o(function(){c.value=a,c.getSnapshot=t,s(c)&&u({inst:c})},[e,a,t]),n(function(){return s(c)&&u({inst:c}),e(function(){s(c)&&u({inst:c})})},[e]),i(a),a};return Zu.useSyncExternalStore=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:l,Zu}():Bu.exports=(Hu||(Hu=1,"production"!==process.env.NODE_ENV&&function(){function e(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch(e){return!0}}"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=a,r="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},n=t.useState,o=t.useEffect,i=t.useLayoutEffect,s=t.useDebugValue,l=!1,c=!1,u="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(a,u){l||void 0===t.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();r(d,f)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),c=!0)}var m=(f=n({inst:{value:d,getSnapshot:u}}))[0].inst,h=f[1];return i(function(){m.value=d,m.getSnapshot=u,e(m)&&h({inst:m})},[a,d,u]),o(function(){return e(m)&&h({inst:m}),a(function(){e(m)&&h({inst:m})})},[a]),s(d),d};Ku.useSyncExternalStore=void 0!==t.useSyncExternalStore?t.useSyncExternalStore:u,"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),Ku)),Bu.exports);function Ju(){return()=>{}}var Yu="Avatar",[Xu,Qu]=Uu(Yu),[ed,td]=Xu(Yu),rd=n.forwardRef((t,r)=>{const{__scopeAvatar:a,...o}=t,[i,s]=n.useState("idle");return e(ed,{scope:a,imageLoadingStatus:i,onImageLoadingStatusChange:s,children:e(Ri.span,{...o,ref:r})})});rd.displayName=Yu;var nd="AvatarImage",ad=n.forwardRef((t,r)=>{const{__scopeAvatar:a,src:o,onLoadingStatusChange:i=()=>{},...s}=t,l=td(nd,a),c=function(e,{referrerPolicy:t,crossOrigin:r}){const a=qu.useSyncExternalStore(Ju,()=>!0,()=>!1),o=n.useRef(null),i=a?(o.current||(o.current=new window.Image),o.current):null,[s,l]=n.useState(()=>sd(i,e));return Wu(()=>{l(sd(i,e))},[i,e]),Wu(()=>{const e=e=>()=>{l(e)};if(!i)return;const n=e("loaded"),a=e("error");return i.addEventListener("load",n),i.addEventListener("error",a),t&&(i.referrerPolicy=t),"string"==typeof r&&(i.crossOrigin=r),()=>{i.removeEventListener("load",n),i.removeEventListener("error",a)}},[i,r,t]),s}(o,s),u=ju(e=>{i(e),l.onImageLoadingStatusChange(e)});return Wu(()=>{"idle"!==c&&u(c)},[c,u]),"loaded"===c?e(Ri.img,{...s,ref:r,src:o}):null});ad.displayName=nd;var od="AvatarFallback",id=n.forwardRef((t,r)=>{const{__scopeAvatar:a,delayMs:o,...i}=t,s=td(od,a),[l,c]=n.useState(void 0===o);return n.useEffect(()=>{if(void 0!==o){const e=window.setTimeout(()=>c(!0),o);return()=>window.clearTimeout(e)}},[o]),l&&"loaded"!==s.imageLoadingStatus?e(Ri.span,{...i,ref:r}):null});function sd(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}id.displayName=od;var ld=rd,cd=ad,ud=id;const dd=n.forwardRef(({className:t,...r},n)=>e(ld,{ref:n,className:Ko("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",t),...r}));dd.displayName=ld.displayName;const fd=n.forwardRef(({className:t,...r},n)=>e(cd,{ref:n,className:Ko("aspect-square h-full w-full",t),...r}));fd.displayName=cd.displayName;const md=n.forwardRef(({className:t,...r},n)=>e(ud,{ref:n,className:Ko("flex h-full w-full items-center justify-center rounded-full bg-muted",t),...r}));function hd(e,t,{checkForDefaultPrevented:r=!0}={}){return function(n){if(e?.(n),!1===r||!n.defaultPrevented)return t?.(n)}}md.displayName=ud.displayName;var pd=n[" useId ".trim().toString()]||(()=>{}),gd=0;function yd(e){const[t,r]=n.useState(pd());return Wu(()=>{r(e=>e??String(gd++))},[e]),t?`radix-${t}`:""}var vd=n[" useInsertionEffect ".trim().toString()]||Wu;function bd({prop:e,defaultProp:t,onChange:r=()=>{},caller:a}){const[o,i,s]=function({defaultProp:e,onChange:t}){const[r,a]=n.useState(e),o=n.useRef(r),i=n.useRef(t);return vd(()=>{i.current=t},[t]),n.useEffect(()=>{o.current!==r&&(i.current?.(r),o.current=r)},[r,o]),[r,a,i]}({defaultProp:t,onChange:r}),l=void 0!==e,c=l?e:o;{const t=n.useRef(void 0!==e);n.useEffect(()=>{const e=t.current;if(e!==l){const t=e?"controlled":"uncontrolled",r=l?"controlled":"uncontrolled";console.warn(`${a} 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,a])}const u=n.useCallback(t=>{if(l){const r=function(e){return"function"==typeof e}(t)?t(e):t;r!==e&&s.current?.(r)}else i(t)},[l,e,i,s]);return[c,u]}var wd,Sd="dismissableLayer.update",xd="dismissableLayer.pointerDownOutside",kd="dismissableLayer.focusOutside",Td=n.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ad=n.forwardRef((t,r)=>{const{disableOutsidePointerEvents:a=!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:l,onDismiss:c,...u}=t,d=n.useContext(Td),[f,m]=n.useState(null),h=f?.ownerDocument??globalThis?.document,[,p]=n.useState({}),g=Yo(r,e=>m(e)),y=Array.from(d.layers),[v]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),b=y.indexOf(v),w=f?y.indexOf(f):-1,S=d.layersWithOutsidePointerEventsDisabled.size>0,x=w>=b,k=function(e,t=globalThis?.document){const r=ju(e),a=n.useRef(!1),o=n.useRef(()=>{});return n.useEffect(()=>{const e=e=>{if(e.target&&!a.current){let n=function(){Cd(xd,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);a.current=!1},n=window.setTimeout(()=>{t.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(n),t.removeEventListener("pointerdown",e),t.removeEventListener("click",o.current)}},[t,r]),{onPointerDownCapture:()=>a.current=!0}}(e=>{const t=e.target,r=[...d.branches].some(e=>e.contains(t));x&&!r&&(i?.(e),l?.(e),e.defaultPrevented||c?.())},h),T=function(e,t=globalThis?.document){const r=ju(e),a=n.useRef(!1);return n.useEffect(()=>{const e=e=>{if(e.target&&!a.current){Cd(kd,r,{originalEvent:e},{discrete:!1})}};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)},[t,r]),{onFocusCapture:()=>a.current=!0,onBlurCapture:()=>a.current=!1}}(e=>{const t=e.target;[...d.branches].some(e=>e.contains(t))||(s?.(e),l?.(e),e.defaultPrevented||c?.())},h);return function(e,t=globalThis?.document){const r=ju(e);n.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()))},h),n.useEffect(()=>{if(f)return a&&(0===d.layersWithOutsidePointerEventsDisabled.size&&(wd=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),Ed(),()=>{a&&1===d.layersWithOutsidePointerEventsDisabled.size&&(h.body.style.pointerEvents=wd)}},[f,h,a,d]),n.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),Ed())},[f,d]),n.useEffect(()=>{const e=()=>p({});return document.addEventListener(Sd,e),()=>document.removeEventListener(Sd,e)},[]),e(Ri.div,{...u,ref:g,style:{pointerEvents:S?x?"auto":"none":void 0,...t.style},onFocusCapture:hd(t.onFocusCapture,T.onFocusCapture),onBlurCapture:hd(t.onBlurCapture,T.onBlurCapture),onPointerDownCapture:hd(t.onPointerDownCapture,k.onPointerDownCapture)})});Ad.displayName="DismissableLayer";function Ed(){const e=new CustomEvent(Sd);document.dispatchEvent(e)}function Cd(e,t,r,{discrete:n}){const a=r.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&a.addEventListener(e,t,{once:!0}),n?function(e,t){e&&h.flushSync(()=>e.dispatchEvent(t))}(a,o):a.dispatchEvent(o)}n.forwardRef((t,r)=>{const a=n.useContext(Td),o=n.useRef(null),i=Yo(r,o);return n.useEffect(()=>{const e=o.current;if(e)return a.branches.add(e),()=>{a.branches.delete(e)}},[a.branches]),e(Ri.div,{...t,ref:i})}).displayName="DismissableLayerBranch";var Nd="focusScope.autoFocusOnMount",_d="focusScope.autoFocusOnUnmount",Rd={bubbles:!1,cancelable:!0},Od=n.forwardRef((t,r)=>{const{loop:a=!1,trapped:o=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...l}=t,[c,u]=n.useState(null),d=ju(i),f=ju(s),m=n.useRef(null),h=Yo(r,e=>u(e)),p=n.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;n.useEffect(()=>{if(o){let e=function(e){if(p.paused||!c)return;const t=e.target;c.contains(t)?m.current=t:Id(m.current,{select:!0})},t=function(e){if(p.paused||!c)return;const t=e.relatedTarget;null!==t&&(c.contains(t)||Id(m.current,{select:!0}))},r=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&Id(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,p.paused]),n.useEffect(()=>{if(c){Ld.add(p);const t=document.activeElement;if(!c.contains(t)){const r=new CustomEvent(Nd,Rd);c.addEventListener(Nd,d),c.dispatchEvent(r),r.defaultPrevented||(!function(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(Id(n,{select:t}),document.activeElement!==r)return}((e=Dd(c),e.filter(e=>"A"!==e.tagName)),{select:!0}),document.activeElement===t&&Id(c))}return()=>{c.removeEventListener(Nd,d),setTimeout(()=>{const e=new CustomEvent(_d,Rd);c.addEventListener(_d,f),c.dispatchEvent(e),e.defaultPrevented||Id(t??document.body,{select:!0}),c.removeEventListener(_d,f),Ld.remove(p)},0)}}var e},[c,d,f,p]);const g=n.useCallback(e=>{if(!a&&!o)return;if(p.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,r=document.activeElement;if(t&&r){const t=e.currentTarget,[n,o]=function(e){const t=Dd(e),r=Md(t,e),n=Md(t.reverse(),e);return[r,n]}(t);n&&o?e.shiftKey||r!==o?e.shiftKey&&r===n&&(e.preventDefault(),a&&Id(o,{select:!0})):(e.preventDefault(),a&&Id(n,{select:!0})):r===t&&e.preventDefault()}},[a,o,p.paused]);return e(Ri.div,{tabIndex:-1,...l,ref:h,onKeyDown:g})});function Dd(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 Md(e,t){for(const r of e)if(!Pd(r,{upTo:t}))return r}function Pd(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 Id(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()}}Od.displayName="FocusScope";var Ld=function(){let e=[];return{add(t){const r=e[0];t!==r&&r?.pause(),e=Fd(e,t),e.unshift(t)},remove(t){e=Fd(e,t),e[0]?.resume()}}}();function Fd(e,t){const r=[...e],n=r.indexOf(t);return-1!==n&&r.splice(n,1),r}var zd=n.forwardRef((t,r)=>{const{container:a,...o}=t,[i,s]=n.useState(!1);Wu(()=>s(!0),[]);const l=a||i&&globalThis?.document?.body;return l?p.createPortal(e(Ri.div,{...o,ref:r}),l):null});zd.displayName="Portal";var Ud=e=>{const{present:t,children:r}=e,a=function(e){const[t,r]=n.useState(),a=n.useRef(null),o=n.useRef(e),i=n.useRef("none"),s=e?"mounted":"unmounted",[l,c]=function(e,t){return n.useReducer((e,r)=>t[e][r]??e,e)}(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return n.useEffect(()=>{const e=Vd(a.current);i.current="mounted"===l?e:"none"},[l]),Wu(()=>{const t=a.current,r=o.current;if(r!==e){const n=i.current,a=Vd(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]),Wu(()=>{if(t){let e;const r=t.ownerDocument.defaultView??window,n=n=>{const i=Vd(a.current).includes(CSS.escape(n.animationName));if(n.target===t&&i&&(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)})}},s=e=>{e.target===t&&(i.current=Vd(a.current))};return t.addEventListener("animationstart",s),t.addEventListener("animationcancel",n),t.addEventListener("animationend",n),()=>{r.clearTimeout(e),t.removeEventListener("animationstart",s),t.removeEventListener("animationcancel",n),t.removeEventListener("animationend",n)}}c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:n.useCallback(e=>{a.current=e?getComputedStyle(e):null,r(e)},[])}}(t),o="function"==typeof r?r({present:a.isPresent}):n.Children.only(r),i=Yo(a.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||a.isPresent?n.cloneElement(o,{ref:i}):null};function Vd(e){return e?.animationName||"none"}Ud.displayName="Presence";var jd=0;function $d(){n.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Wd()),document.body.insertAdjacentElement("beforeend",e[1]??Wd()),jd++,()=>{1===jd&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),jd--}},[])}function Wd(){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 Bd=function(){return Bd=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},Bd.apply(this,arguments)};function Zd(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 Hd="right-scroll-bar-position",Gd="width-before-scroll-bar";function Kd(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var qd="undefined"!=typeof window?n.useLayoutEffect:n.useEffect,Jd=new WeakMap;function Yd(e,t){var r,n,a,o=(r=null,n=function(t){return e.forEach(function(e){return Kd(e,t)})},(a=f(function(){return{value:r,callback:n,facade:{get current(){return a.value},set current(e){var t=a.value;t!==e&&(a.value=e,a.callback(e,t))}}}})[0]).callback=n,a.facade);return qd(function(){var t=Jd.get(o);if(t){var r=new Set(t),n=new Set(e),a=o.current;r.forEach(function(e){n.has(e)||Kd(e,null)}),n.forEach(function(e){r.has(e)||Kd(e,a)})}Jd.set(o,e)},[e]),o}function Xd(e){return e}var Qd=function(e){var t=e.sideCar,r=Zd(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var a=t.read();if(!a)throw new Error("Sidecar medium not found");return n.createElement(a,Bd({},r))};Qd.isSideCarExport=!0;var ef=function(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=Xd);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)},i=function(){return Promise.resolve().then(o)};i(),r={push:function(e){t.push(e),i()},filter:function(e){return t=t.filter(e),r}}}}}(null);return t.options=Bd({async:!0,ssr:!1},e),t}(),tf=function(){},rf=n.forwardRef(function(e,t){var r=n.useRef(null),a=n.useState({onScrollCapture:tf,onWheelCapture:tf,onTouchMoveCapture:tf}),o=a[0],i=a[1],s=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,m=e.sideCar,h=e.noRelative,p=e.noIsolation,g=e.inert,y=e.allowPinchZoom,v=e.as,b=void 0===v?"div":v,w=e.gapMode,S=Zd(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),x=m,k=Yd([r,t]),T=Bd(Bd({},S),o);return n.createElement(n.Fragment,null,d&&n.createElement(x,{sideCar:ef,removeScrollBar:u,shards:f,noRelative:h,noIsolation:p,inert:g,setCallbacks:i,allowPinchZoom:!!y,lockRef:r,gapMode:w}),s?n.cloneElement(n.Children.only(l),Bd(Bd({},T),{ref:k})):n.createElement(b,Bd({},T,{className:c,ref:k}),l))});rf.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},rf.classNames={fullWidth:Gd,zeroRight:Hd};function nf(){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 af=function(){var e=0,t=null;return{add:function(r){var n,a;0==e&&(t=nf())&&(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)}}},of=function(){var e,t=(e=af(),function(t,r){n.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}},sf={left:0,top:0,right:0,gap:0},lf=function(e){return parseInt(e||"",10)||0},cf=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return sf;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[lf(r),lf(n),lf(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])}},uf=of(),df="data-scroll-locked",ff=function(e,t,r,n){var a=e.left,o=e.top,i=e.right,s=e.gap;return void 0===r&&(r="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(n,";\n padding-right: ").concat(s,"px ").concat(n,";\n }\n body[").concat(df,"] {\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(i,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(s,"px ").concat(n,";\n "),"padding"===r&&"padding-right: ".concat(s,"px ").concat(n,";")].filter(Boolean).join(""),"\n }\n \n .").concat(Hd," {\n right: ").concat(s,"px ").concat(n,";\n }\n \n .").concat(Gd," {\n margin-right: ").concat(s,"px ").concat(n,";\n }\n \n .").concat(Hd," .").concat(Hd," {\n right: 0 ").concat(n,";\n }\n \n .").concat(Gd," .").concat(Gd," {\n margin-right: 0 ").concat(n,";\n }\n \n body[").concat(df,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(s,"px;\n }\n")},mf=function(){var e=parseInt(document.body.getAttribute(df)||"0",10);return isFinite(e)?e:0},hf=function(e){var t=e.noRelative,r=e.noImportant,a=e.gapMode,o=void 0===a?"margin":a;n.useEffect(function(){return document.body.setAttribute(df,(mf()+1).toString()),function(){var e=mf()-1;e<=0?document.body.removeAttribute(df):document.body.setAttribute(df,e.toString())}},[]);var i=n.useMemo(function(){return cf(o)},[o]);return n.createElement(uf,{styles:ff(i,!t,o,r?"":"!important")})},pf=!1;if("undefined"!=typeof window)try{var gf=Object.defineProperty({},"passive",{get:function(){return pf=!0,!0}});window.addEventListener("test",gf,gf),window.removeEventListener("test",gf,gf)}catch(e){pf=!1}var yf=!!pf&&{passive:!1},vf=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])},bf=function(e,t){var r=t.ownerDocument,n=t;do{if("undefined"!=typeof ShadowRoot&&n instanceof ShadowRoot&&(n=n.host),wf(e,n)){var a=Sf(e,n);if(a[1]>a[2])return!0}n=n.parentNode}while(n&&n!==r.body);return!1},wf=function(e,t){return"v"===e?function(e){return vf(e,"overflowY")}(t):function(e){return vf(e,"overflowX")}(t)},Sf=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},xf=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},kf=function(e){return[e.deltaX,e.deltaY]},Tf=function(e){return e&&"current"in e?e.current:e},Af=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},Ef=0,Cf=[];function Nf(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var _f,Rf=(_f=function(e){var t=n.useRef([]),r=n.useRef([0,0]),a=n.useRef(),o=n.useState(Ef++)[0],i=n.useState(of)[0],s=n.useRef(e);n.useEffect(function(){s.current=e},[e]),n.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(Tf),!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=n.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!s.current.allowPinchZoom;var n,o=xf(e),i=r.current,l="deltaX"in e?e.deltaX:i[0]-o[0],c="deltaY"in e?e.deltaY:i[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=bf(d,u);if(!f)return!0;if(f?n=d:(n="v"===d?"h":"v",f=bf(d,u)),!f)return!1;if(!a.current&&"changedTouches"in e&&(l||c)&&(a.current=n),!n)return!0;var m=a.current||n;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,i=r.target,s=t.contains(i),l=!1,c=o>0,u=0,d=0;do{if(!i)break;var f=Sf(e,i),m=f[0],h=f[1]-f[2]-a*m;(m||h)&&wf(e,i)&&(u+=h,d+=m);var p=i.parentNode;i=p&&p.nodeType===Node.DOCUMENT_FRAGMENT_NODE?p.host:p}while(!s&&i!==document.body||s&&(t.contains(i)||t===i));return(c&&Math.abs(u)<1||!c&&Math.abs(d)<1)&&(l=!0),l}(m,t,e,"h"===m?l:c)},[]),c=n.useCallback(function(e){var r=e;if(Cf.length&&Cf[Cf.length-1]===i){var n="deltaY"in r?kf(r):xf(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=(s.current.shards||[]).map(Tf).filter(Boolean).filter(function(e){return e.contains(r.target)});(o.length>0?l(r,o[0]):!s.current.noIsolation)&&r.cancelable&&r.preventDefault()}}},[]),u=n.useCallback(function(e,r,n,a){var o={name:e,delta:r,target:n,should:a,shadowParent:Nf(n)};t.current.push(o),setTimeout(function(){t.current=t.current.filter(function(e){return e!==o})},1)},[]),d=n.useCallback(function(e){r.current=xf(e),a.current=void 0},[]),f=n.useCallback(function(t){u(t.type,kf(t),t.target,l(t,e.lockRef.current))},[]),m=n.useCallback(function(t){u(t.type,xf(t),t.target,l(t,e.lockRef.current))},[]);n.useEffect(function(){return Cf.push(i),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:m}),document.addEventListener("wheel",c,yf),document.addEventListener("touchmove",c,yf),document.addEventListener("touchstart",d,yf),function(){Cf=Cf.filter(function(e){return e!==i}),document.removeEventListener("wheel",c,yf),document.removeEventListener("touchmove",c,yf),document.removeEventListener("touchstart",d,yf)}},[]);var h=e.removeScrollBar,p=e.inert;return n.createElement(n.Fragment,null,p?n.createElement(i,{styles:Af(o)}):null,h?n.createElement(hf,{noRelative:e.noRelative,gapMode:e.gapMode}):null)},ef.useMedium(_f),Qd),Of=n.forwardRef(function(e,t){return n.createElement(rf,Bd({},e,{ref:t,sideCar:Rf}))});Of.classNames=rf.classNames;var Df=new WeakMap,Mf=new WeakMap,Pf={},If=0,Lf=function(e){return e&&(e.host||Lf(e.parentNode))},Ff=function(e,t,r,n){var a=function(e,t){return t.map(function(t){if(e.contains(t))return t;var r=Lf(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]);Pf[r]||(Pf[r]=new WeakMap);var o=Pf[r],i=[],s=new Set,l=new Set(a),c=function(e){e&&!s.has(e)&&(s.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(s.has(e))u(e);else try{var t=e.getAttribute(n),a=null!==t&&"false"!==t,l=(Df.get(e)||0)+1,c=(o.get(e)||0)+1;Df.set(e,l),o.set(e,c),i.push(e),1===l&&a&&Mf.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),s.clear(),If++,function(){i.forEach(function(e){var t=Df.get(e)-1,a=o.get(e)-1;Df.set(e,t),o.set(e,a),t||(Mf.has(e)||e.removeAttribute(n),Mf.delete(e)),a||e.removeAttribute(r)}),--If||(Df=new WeakMap,Df=new WeakMap,Mf=new WeakMap,Pf={})}},zf=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"))),Ff(n,a,r,"aria-hidden")):function(){return null}},Uf="Dialog",[Vf,jf]=Uu(Uf),[$f,Wf]=Vf(Uf),Bf=t=>{const{__scopeDialog:r,children:a,open:o,defaultOpen:i,onOpenChange:s,modal:l=!0}=t,c=n.useRef(null),u=n.useRef(null),[d,f]=bd({prop:o,defaultProp:i??!1,onChange:s,caller:Uf});return e($f,{scope:r,triggerRef:c,contentRef:u,contentId:yd(),titleId:yd(),descriptionId:yd(),open:d,onOpenChange:f,onOpenToggle:n.useCallback(()=>f(e=>!e),[f]),modal:l,children:a})};Bf.displayName=Uf;var Zf="DialogTrigger",Hf=n.forwardRef((t,r)=>{const{__scopeDialog:n,...a}=t,o=Wf(Zf,n),i=Yo(r,o.triggerRef);return e(Ri.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":fm(o.open),...a,ref:i,onClick:hd(t.onClick,o.onOpenToggle)})});Hf.displayName=Zf;var Gf="DialogPortal",[Kf,qf]=Vf(Gf,{forceMount:void 0}),Jf=t=>{const{__scopeDialog:r,forceMount:a,children:o,container:i}=t,s=Wf(Gf,r);return e(Kf,{scope:r,forceMount:a,children:n.Children.map(o,t=>e(Ud,{present:a||s.open,children:e(zd,{asChild:!0,container:i,children:t})}))})};Jf.displayName=Gf;var Yf="DialogOverlay",Xf=n.forwardRef((t,r)=>{const n=qf(Yf,t.__scopeDialog),{forceMount:a=n.forceMount,...o}=t,i=Wf(Yf,t.__scopeDialog);return i.modal?e(Ud,{present:a||i.open,children:e(em,{...o,ref:r})}):null});Xf.displayName=Yf;var Qf=Xo("DialogOverlay.RemoveScroll"),em=n.forwardRef((t,r)=>{const{__scopeDialog:n,...a}=t,o=Wf(Yf,n);return e(Of,{as:Qf,allowPinchZoom:!0,shards:[o.contentRef],children:e(Ri.div,{"data-state":fm(o.open),...a,ref:r,style:{pointerEvents:"auto",...a.style}})})}),tm="DialogContent",rm=n.forwardRef((t,r)=>{const n=qf(tm,t.__scopeDialog),{forceMount:a=n.forceMount,...o}=t,i=Wf(tm,t.__scopeDialog);return e(Ud,{present:a||i.open,children:i.modal?e(nm,{...o,ref:r}):e(am,{...o,ref:r})})});rm.displayName=tm;var nm=n.forwardRef((t,r)=>{const a=Wf(tm,t.__scopeDialog),o=n.useRef(null),i=Yo(r,a.contentRef,o);return n.useEffect(()=>{const e=o.current;if(e)return zf(e)},[]),e(om,{...t,ref:i,trapFocus:a.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:hd(t.onCloseAutoFocus,e=>{e.preventDefault(),a.triggerRef.current?.focus()}),onPointerDownOutside:hd(t.onPointerDownOutside,e=>{const t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;(2===t.button||r)&&e.preventDefault()}),onFocusOutside:hd(t.onFocusOutside,e=>e.preventDefault())})}),am=n.forwardRef((t,r)=>{const a=Wf(tm,t.__scopeDialog),o=n.useRef(!1),i=n.useRef(!1);return e(om,{...t,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:e=>{t.onCloseAutoFocus?.(e),e.defaultPrevented||(o.current||a.triggerRef.current?.focus(),e.preventDefault()),o.current=!1,i.current=!1},onInteractOutside:e=>{t.onInteractOutside?.(e),e.defaultPrevented||(o.current=!0,"pointerdown"===e.detail.originalEvent.type&&(i.current=!0));const r=e.target,n=a.triggerRef.current?.contains(r);n&&e.preventDefault(),"focusin"===e.detail.originalEvent.type&&i.current&&e.preventDefault()}})}),om=n.forwardRef((a,o)=>{const{__scopeDialog:i,trapFocus:s,onOpenAutoFocus:l,onCloseAutoFocus:c,...u}=a,d=Wf(tm,i),f=n.useRef(null),m=Yo(o,f);return $d(),r(t,{children:[e(Od,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:l,onUnmountAutoFocus:c,children:e(Ad,{role:"dialog",id:d.contentId,"aria-describedby":d.descriptionId,"aria-labelledby":d.titleId,"data-state":fm(d.open),...u,ref:m,onDismiss:()=>d.onOpenChange(!1)})}),r(t,{children:[e(gm,{titleId:d.titleId}),e(ym,{contentRef:f,descriptionId:d.descriptionId})]})]})}),im="DialogTitle",sm=n.forwardRef((t,r)=>{const{__scopeDialog:n,...a}=t,o=Wf(im,n);return e(Ri.h2,{id:o.titleId,...a,ref:r})});sm.displayName=im;var lm="DialogDescription",cm=n.forwardRef((t,r)=>{const{__scopeDialog:n,...a}=t,o=Wf(lm,n);return e(Ri.p,{id:o.descriptionId,...a,ref:r})});cm.displayName=lm;var um="DialogClose",dm=n.forwardRef((t,r)=>{const{__scopeDialog:n,...a}=t,o=Wf(um,n);return e(Ri.button,{type:"button",...a,ref:r,onClick:hd(t.onClick,()=>o.onOpenChange(!1))})});function fm(e){return e?"open":"closed"}dm.displayName=um;var mm="DialogTitleWarning",[hm,pm]=function(t,r){const a=n.createContext(r),o=t=>{const{children:r,...o}=t,i=n.useMemo(()=>o,Object.values(o));return e(a.Provider,{value:i,children:r})};return o.displayName=t+"Provider",[o,function(e){const o=n.useContext(a);if(o)return o;if(void 0!==r)return r;throw new Error(`\`${e}\` must be used within \`${t}\``)}]}(mm,{contentName:tm,titleName:im,docsSlug:"dialog"}),gm=({titleId:e})=>{const t=pm(mm),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 n.useEffect(()=>{if(e){document.getElementById(e)||console.error(r)}},[r,e]),null},ym=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${pm("DialogDescriptionWarning").contentName}}.`;return n.useEffect(()=>{const n=e.current?.getAttribute("aria-describedby");if(t&&n){document.getElementById(t)||console.warn(r)}},[r,e,t]),null},vm=Bf,bm=Hf,wm=Jf,Sm=Xf,xm=rm,km=sm,Tm=cm,Am=dm;function Em(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 Cm=["color"],Nm=u(function(e,t){var r=e.color,n=void 0===r?"currentColor":r,a=Em(e,Cm);return d("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),d("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:n,fillRule:"evenodd",clipRule:"evenodd"}))}),_m=["color"],Rm=u(function(e,t){var r=e.color,n=void 0===r?"currentColor":r,a=Em(e,_m);return d("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),d("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:n,fillRule:"evenodd",clipRule:"evenodd"}))}),Om=["color"],Dm=u(function(e,t){var r=e.color,n=void 0===r?"currentColor":r,a=Em(e,Om);return d("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),d("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:n,fillRule:"evenodd",clipRule:"evenodd"}))}),Mm=["color"],Pm=u(function(e,t){var r=e.color,n=void 0===r?"currentColor":r,a=Em(e,Mm);return d("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),d("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:n,fillRule:"evenodd",clipRule:"evenodd"}))});const Im=vm,Lm=bm,Fm=wm,zm=n.forwardRef(({className:t,...r},n)=>e(Sm,{ref:n,className:Ko("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}));zm.displayName=Sm.displayName;const Um=n.forwardRef(({className:t,children:a,...o},i)=>{const{container:s}=n.useContext(ue);return r(Fm,{container:s,children:[e(zm,{}),r(xm,{ref:i,className:Ko("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),...o,children:[a,r(Am,{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(Dm,{className:"h-4 w-4"}),e("span",{className:"sr-only",children:"Close"})]})]})]})});Um.displayName=xm.displayName;const Vm=({className:t,...r})=>e("div",{className:Ko("flex flex-col space-y-1.5 text-center sm:text-left",t),...r});Vm.displayName="DialogHeader";const jm=n.forwardRef(({className:t,...r},n)=>e(km,{ref:n,className:Ko("text-lg font-semibold leading-none tracking-tight",t),...r}));jm.displayName=km.displayName;const $m=n.forwardRef(({className:t,...r},n)=>e(Tm,{ref:n,className:Ko("text-sm text-muted-foreground",t),...r}));function Wm(t){const r=t+"CollectionProvider",[n,o]=Uu(r),[i,s]=n(r,{collectionRef:{current:null},itemMap:new Map}),l=t=>{const{scope:r,children:n}=t,o=a.useRef(null),s=a.useRef(new Map).current;return e(i,{scope:r,itemMap:s,collectionRef:o,children:n})};l.displayName=r;const c=t+"CollectionSlot",u=Xo(c),d=a.forwardRef((t,r)=>{const{scope:n,children:a}=t,o=Yo(r,s(c,n).collectionRef);return e(u,{ref:o,children:a})});d.displayName=c;const f=t+"CollectionItemSlot",m="data-radix-collection-item",h=Xo(f),p=a.forwardRef((t,r)=>{const{scope:n,children:o,...i}=t,l=a.useRef(null),c=Yo(r,l),u=s(f,n);return a.useEffect(()=>(u.itemMap.set(l,{ref:l,...i}),()=>{u.itemMap.delete(l)})),e(h,{[m]:"",ref:c,children:o})});return p.displayName=f,[{Provider:l,Slot:d,ItemSlot:p},function(e){const r=s(t+"CollectionConsumer",e),n=a.useCallback(()=>{const e=r.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${m}]`)),n=Array.from(r.itemMap.values()).sort((e,r)=>t.indexOf(e.ref.current)-t.indexOf(r.ref.current));return n},[r.collectionRef,r.itemMap]);return n},o]}$m.displayName=Tm.displayName;var Bm=n.createContext(void 0);function Zm(e){const t=n.useContext(Bm);return e||t||"ltr"}var Hm="rovingFocusGroup.onEntryFocus",Gm={bubbles:!1,cancelable:!0},Km="RovingFocusGroup",[qm,Jm,Ym]=Wm(Km),[Xm,Qm]=Uu(Km,[Ym]),[eh,th]=Xm(Km),rh=n.forwardRef((t,r)=>e(qm.Provider,{scope:t.__scopeRovingFocusGroup,children:e(qm.Slot,{scope:t.__scopeRovingFocusGroup,children:e(nh,{...t,ref:r})})}));rh.displayName=Km;var nh=n.forwardRef((t,r)=>{const{__scopeRovingFocusGroup:a,orientation:o,loop:i=!1,dir:s,currentTabStopId:l,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:f=!1,...m}=t,h=n.useRef(null),p=Yo(r,h),g=Zm(s),[y,v]=bd({prop:l,defaultProp:c??null,onChange:u,caller:Km}),[b,w]=n.useState(!1),S=ju(d),x=Jm(a),k=n.useRef(!1),[T,A]=n.useState(0);return n.useEffect(()=>{const e=h.current;if(e)return e.addEventListener(Hm,S),()=>e.removeEventListener(Hm,S)},[S]),e(eh,{scope:a,orientation:o,dir:g,loop:i,currentTabStopId:y,onItemFocus:n.useCallback(e=>v(e),[v]),onItemShiftTab:n.useCallback(()=>w(!0),[]),onFocusableItemAdd:n.useCallback(()=>A(e=>e+1),[]),onFocusableItemRemove:n.useCallback(()=>A(e=>e-1),[]),children:e(Ri.div,{tabIndex:b||0===T?-1:0,"data-orientation":o,...m,ref:p,style:{outline:"none",...t.style},onMouseDown:hd(t.onMouseDown,()=>{k.current=!0}),onFocus:hd(t.onFocus,e=>{const t=!k.current;if(e.target===e.currentTarget&&t&&!b){const t=new CustomEvent(Hm,Gm);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=x().filter(e=>e.focusable);sh([e.find(e=>e.active),e.find(e=>e.id===y),...e].filter(Boolean).map(e=>e.ref.current),f)}}k.current=!1}),onBlur:hd(t.onBlur,()=>w(!1))})})}),ah="RovingFocusGroupItem",oh=n.forwardRef((t,r)=>{const{__scopeRovingFocusGroup:a,focusable:o=!0,active:i=!1,tabStopId:s,children:l,...c}=t,u=yd(),d=s||u,f=th(ah,a),m=f.currentTabStopId===d,h=Jm(a),{onFocusableItemAdd:p,onFocusableItemRemove:g,currentTabStopId:y}=f;return n.useEffect(()=>{if(o)return p(),()=>g()},[o,p,g]),e(qm.ItemSlot,{scope:a,id:d,focusable:o,active:i,children:e(Ri.span,{tabIndex:m?0:-1,"data-orientation":f.orientation,...c,ref:r,onMouseDown:hd(t.onMouseDown,e=>{o?f.onItemFocus(d):e.preventDefault()}),onFocus:hd(t.onFocus,()=>f.onItemFocus(d)),onKeyDown:hd(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:ih[n]}(e,f.orientation,f.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let r=h().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(()=>sh(r))}}),children:"function"==typeof l?l({isCurrentTabStop:m,hasTabStop:null!=y}):l})})});oh.displayName=ah;var ih={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function sh(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 lh=rh,ch=oh;function uh(e){const[t,r]=n.useState(void 0);return Wu(()=>{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 dh(e){const t=n.useRef({value:e,previous:e});return n.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var fh="Radio",[mh,hh]=Uu(fh),[ph,gh]=mh(fh),yh=n.forwardRef((t,a)=>{const{__scopeRadio:o,name:i,checked:s=!1,required:l,disabled:c,value:u="on",onCheck:d,form:f,...m}=t,[h,p]=n.useState(null),g=Yo(a,e=>p(e)),y=n.useRef(!1),v=!h||(f||!!h.closest("form"));return r(ph,{scope:o,checked:s,disabled:c,children:[e(Ri.button,{type:"button",role:"radio","aria-checked":s,"data-state":Sh(s),"data-disabled":c?"":void 0,disabled:c,value:u,...m,ref:g,onClick:hd(t.onClick,e=>{s||d?.(),v&&(y.current=e.isPropagationStopped(),y.current||e.stopPropagation())})}),v&&e(wh,{control:h,bubbles:!y.current,name:i,value:u,checked:s,required:l,disabled:c,form:f,style:{transform:"translateX(-100%)"}})]})});yh.displayName=fh;var vh="RadioIndicator",bh=n.forwardRef((t,r)=>{const{__scopeRadio:n,forceMount:a,...o}=t,i=gh(vh,n);return e(Ud,{present:a||i.checked,children:e(Ri.span,{"data-state":Sh(i.checked),"data-disabled":i.disabled?"":void 0,...o,ref:r})})});bh.displayName=vh;var wh=n.forwardRef(({__scopeRadio:t,control:r,checked:a,bubbles:o=!0,...i},s)=>{const l=n.useRef(null),c=Yo(l,s),u=dh(a),d=uh(r);return n.useEffect(()=>{const e=l.current;if(!e)return;const t=window.HTMLInputElement.prototype,r=Object.getOwnPropertyDescriptor(t,"checked").set;if(u!==a&&r){const t=new Event("click",{bubbles:o});r.call(e,a),e.dispatchEvent(t)}},[u,a,o]),e(Ri.input,{type:"radio","aria-hidden":!0,defaultChecked:a,...i,tabIndex:-1,ref:c,style:{...i.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function Sh(e){return e?"checked":"unchecked"}wh.displayName="RadioBubbleInput";var xh=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],kh="RadioGroup",[Th,Ah]=Uu(kh,[Qm,hh]),Eh=Qm(),Ch=hh(),[Nh,_h]=Th(kh),Rh=n.forwardRef((t,r)=>{const{__scopeRadioGroup:n,name:a,defaultValue:o,value:i,required:s=!1,disabled:l=!1,orientation:c,dir:u,loop:d=!0,onValueChange:f,...m}=t,h=Eh(n),p=Zm(u),[g,y]=bd({prop:i,defaultProp:o??null,onChange:f,caller:kh});return e(Nh,{scope:n,name:a,required:s,disabled:l,value:g,onValueChange:y,children:e(lh,{asChild:!0,...h,orientation:c,dir:p,loop:d,children:e(Ri.div,{role:"radiogroup","aria-required":s,"aria-orientation":c,"data-disabled":l?"":void 0,dir:p,...m,ref:r})})})});Rh.displayName=kh;var Oh="RadioGroupItem",Dh=n.forwardRef((t,r)=>{const{__scopeRadioGroup:a,disabled:o,...i}=t,s=_h(Oh,a),l=s.disabled||o,c=Eh(a),u=Ch(a),d=n.useRef(null),f=Yo(r,d),m=s.value===i.value,h=n.useRef(!1);return n.useEffect(()=>{const e=e=>{xh.includes(e.key)&&(h.current=!0)},t=()=>h.current=!1;return document.addEventListener("keydown",e),document.addEventListener("keyup",t),()=>{document.removeEventListener("keydown",e),document.removeEventListener("keyup",t)}},[]),e(ch,{asChild:!0,...c,focusable:!l,active:m,children:e(yh,{disabled:l,required:s.required,checked:m,...u,...i,name:s.name,ref:f,onCheck:()=>s.onValueChange(i.value),onKeyDown:hd(e=>{"Enter"===e.key&&e.preventDefault()}),onFocus:hd(i.onFocus,()=>{h.current&&d.current?.click()})})})});Dh.displayName=Oh;var Mh=n.forwardRef((t,r)=>{const{__scopeRadioGroup:n,...a}=t,o=Ch(n);return e(bh,{...o,...a,ref:r})});Mh.displayName="RadioGroupIndicator";var Ph=Rh,Ih=Dh,Lh=Mh;const Fh=n.forwardRef(({className:t,...r},n)=>e(Ph,{className:Ko("grid gap-2",t),...r,ref:n}));Fh.displayName=Ph.displayName;const zh=n.forwardRef(({className:t,...r},n)=>e(Ih,{ref:n,className:Ko("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(Lh,{className:"flex items-center justify-center",children:e(Rm,{className:"h-3.5 w-3.5 fill-primary"})})}));function Uh(e,[t,r]){return Math.min(r,Math.max(t,e))}zh.displayName=Ih.displayName;var Vh="ScrollArea",[jh,$h]=Uu(Vh),[Wh,Bh]=jh(Vh),Zh=n.forwardRef((t,r)=>{const{__scopeScrollArea:a,type:o="hover",dir:i,scrollHideDelay:s=600,...l}=t,[c,u]=n.useState(null),[d,f]=n.useState(null),[m,h]=n.useState(null),[p,g]=n.useState(null),[y,v]=n.useState(null),[b,w]=n.useState(0),[S,x]=n.useState(0),[k,T]=n.useState(!1),[A,E]=n.useState(!1),C=Yo(r,e=>u(e)),N=Zm(i);return e(Wh,{scope:a,type:o,dir:N,scrollHideDelay:s,scrollArea:c,viewport:d,onViewportChange:f,content:m,onContentChange:h,scrollbarX:p,onScrollbarXChange:g,scrollbarXEnabled:k,onScrollbarXEnabledChange:T,scrollbarY:y,onScrollbarYChange:v,scrollbarYEnabled:A,onScrollbarYEnabledChange:E,onCornerWidthChange:w,onCornerHeightChange:x,children:e(Ri.div,{dir:N,...l,ref:C,style:{position:"relative","--radix-scroll-area-corner-width":b+"px","--radix-scroll-area-corner-height":S+"px",...t.style}})})});Zh.displayName=Vh;var Hh="ScrollAreaViewport",Gh=n.forwardRef((a,o)=>{const{__scopeScrollArea:i,children:s,nonce:l,...c}=a,u=Bh(Hh,i),d=Yo(o,n.useRef(null),u.onViewportChange);return r(t,{children:[e("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:l}),e(Ri.div,{"data-radix-scroll-area-viewport":"",...c,ref:d,style:{overflowX:u.scrollbarXEnabled?"scroll":"hidden",overflowY:u.scrollbarYEnabled?"scroll":"hidden",...a.style},children:e("div",{ref:u.onContentChange,style:{minWidth:"100%",display:"table"},children:s})})]})});Gh.displayName=Hh;var Kh="ScrollAreaScrollbar",qh=n.forwardRef((t,r)=>{const{forceMount:a,...o}=t,i=Bh(Kh,t.__scopeScrollArea),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:l}=i,c="horizontal"===t.orientation;return n.useEffect(()=>(c?s(!0):l(!0),()=>{c?s(!1):l(!1)}),[c,s,l]),"hover"===i.type?e(Jh,{...o,ref:r,forceMount:a}):"scroll"===i.type?e(Yh,{...o,ref:r,forceMount:a}):"auto"===i.type?e(Xh,{...o,ref:r,forceMount:a}):"always"===i.type?e(Qh,{...o,ref:r}):null});qh.displayName=Kh;var Jh=n.forwardRef((t,r)=>{const{forceMount:a,...o}=t,i=Bh(Kh,t.__scopeScrollArea),[s,l]=n.useState(!1);return n.useEffect(()=>{const e=i.scrollArea;let t=0;if(e){const r=()=>{window.clearTimeout(t),l(!0)},n=()=>{t=window.setTimeout(()=>l(!1),i.scrollHideDelay)};return e.addEventListener("pointerenter",r),e.addEventListener("pointerleave",n),()=>{window.clearTimeout(t),e.removeEventListener("pointerenter",r),e.removeEventListener("pointerleave",n)}}},[i.scrollArea,i.scrollHideDelay]),e(Ud,{present:a||s,children:e(Xh,{"data-state":s?"visible":"hidden",...o,ref:r})})}),Yh=n.forwardRef((t,r)=>{const{forceMount:a,...o}=t,i=Bh(Kh,t.__scopeScrollArea),s="horizontal"===t.orientation,l=vp(()=>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"}},n.useReducer((e,t)=>f[e][t]??e,d));var d,f;return n.useEffect(()=>{if("idle"===c){const e=window.setTimeout(()=>u("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(e)}},[c,i.scrollHideDelay,u]),n.useEffect(()=>{const e=i.viewport,t=s?"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)}},[i.viewport,s,u,l]),e(Ud,{present:a||"hidden"!==c,children:e(Qh,{"data-state":"hidden"===c?"hidden":"visible",...o,ref:r,onPointerEnter:hd(t.onPointerEnter,()=>u("POINTER_ENTER")),onPointerLeave:hd(t.onPointerLeave,()=>u("POINTER_LEAVE"))})})}),Xh=n.forwardRef((t,r)=>{const a=Bh(Kh,t.__scopeScrollArea),{forceMount:o,...i}=t,[s,l]=n.useState(!1),c="horizontal"===t.orientation,u=vp(()=>{if(a.viewport){const e=a.viewport.offsetWidth<a.viewport.scrollWidth,t=a.viewport.offsetHeight<a.viewport.scrollHeight;l(c?e:t)}},10);return bp(a.viewport,u),bp(a.content,u),e(Ud,{present:o||s,children:e(Qh,{"data-state":s?"visible":"hidden",...i,ref:r})})}),Qh=n.forwardRef((t,r)=>{const{orientation:a="vertical",...o}=t,i=Bh(Kh,t.__scopeScrollArea),s=n.useRef(null),l=n.useRef(0),[c,u]=n.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=fp(c.viewport,c.content),f={...o,sizes:c,onSizesChange:u,hasThumb:Boolean(d>0&&d<1),onThumbChange:e=>s.current=e,onThumbPointerUp:()=>l.current=0,onThumbPointerDown:e=>l.current=e};function m(e,t){return function(e,t,r,n="ltr"){const a=mp(r),o=a/2,i=t||o,s=a-i,l=r.scrollbar.paddingStart+i,c=r.scrollbar.size-r.scrollbar.paddingEnd-s,u=r.content-r.viewport,d="ltr"===n?[0,u]:[-1*u,0];return pp([l,c],d)(e)}(e,l.current,c,t)}return"horizontal"===a?e(ep,{...f,ref:r,onThumbPositionChange:()=>{if(i.viewport&&s.current){const e=hp(i.viewport.scrollLeft,c,i.dir);s.current.style.transform=`translate3d(${e}px, 0, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollLeft=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollLeft=m(e,i.dir))}}):"vertical"===a?e(tp,{...f,ref:r,onThumbPositionChange:()=>{if(i.viewport&&s.current){const e=hp(i.viewport.scrollTop,c);s.current.style.transform=`translate3d(0, ${e}px, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollTop=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollTop=m(e))}}):null}),ep=n.forwardRef((t,r)=>{const{sizes:a,onSizesChange:o,...i}=t,s=Bh(Kh,t.__scopeScrollArea),[l,c]=n.useState(),u=n.useRef(null),d=Yo(r,u,s.onScrollbarXChange);return n.useEffect(()=>{u.current&&c(getComputedStyle(u.current))},[u]),e(ap,{"data-orientation":"horizontal",...i,ref:d,sizes:a,style:{bottom:0,left:"rtl"===s.dir?"var(--radix-scroll-area-corner-width)":0,right:"ltr"===s.dir?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":mp(a)+"px",...t.style},onThumbPointerDown:e=>t.onThumbPointerDown(e.x),onDragScroll:e=>t.onDragScroll(e.x),onWheelScroll:(e,r)=>{if(s.viewport){const n=s.viewport.scrollLeft+e.deltaX;t.onWheelScroll(n),gp(n,r)&&e.preventDefault()}},onResize:()=>{u.current&&s.viewport&&l&&o({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:u.current.clientWidth,paddingStart:dp(l.paddingLeft),paddingEnd:dp(l.paddingRight)}})}})}),tp=n.forwardRef((t,r)=>{const{sizes:a,onSizesChange:o,...i}=t,s=Bh(Kh,t.__scopeScrollArea),[l,c]=n.useState(),u=n.useRef(null),d=Yo(r,u,s.onScrollbarYChange);return n.useEffect(()=>{u.current&&c(getComputedStyle(u.current))},[u]),e(ap,{"data-orientation":"vertical",...i,ref:d,sizes:a,style:{top:0,right:"ltr"===s.dir?0:void 0,left:"rtl"===s.dir?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":mp(a)+"px",...t.style},onThumbPointerDown:e=>t.onThumbPointerDown(e.y),onDragScroll:e=>t.onDragScroll(e.y),onWheelScroll:(e,r)=>{if(s.viewport){const n=s.viewport.scrollTop+e.deltaY;t.onWheelScroll(n),gp(n,r)&&e.preventDefault()}},onResize:()=>{u.current&&s.viewport&&l&&o({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:u.current.clientHeight,paddingStart:dp(l.paddingTop),paddingEnd:dp(l.paddingBottom)}})}})}),[rp,np]=jh(Kh),ap=n.forwardRef((t,r)=>{const{__scopeScrollArea:a,sizes:o,hasThumb:i,onThumbChange:s,onThumbPointerUp:l,onThumbPointerDown:c,onThumbPositionChange:u,onDragScroll:d,onWheelScroll:f,onResize:m,...h}=t,p=Bh(Kh,a),[g,y]=n.useState(null),v=Yo(r,e=>y(e)),b=n.useRef(null),w=n.useRef(""),S=p.viewport,x=o.content-o.viewport,k=ju(f),T=ju(u),A=vp(m,10);function E(e){if(b.current){const t=e.clientX-b.current.left,r=e.clientY-b.current.top;d({x:t,y:r})}}return n.useEffect(()=>{const e=e=>{const t=e.target,r=g?.contains(t);r&&k(e,x)};return document.addEventListener("wheel",e,{passive:!1}),()=>document.removeEventListener("wheel",e,{passive:!1})},[S,g,x,k]),n.useEffect(T,[o,T]),bp(g,A),bp(p.content,A),e(rp,{scope:a,scrollbar:g,hasThumb:i,onThumbChange:ju(s),onThumbPointerUp:ju(l),onThumbPositionChange:T,onThumbPointerDown:ju(c),children:e(Ri.div,{...h,ref:v,style:{position:"absolute",...h.style},onPointerDown:hd(t.onPointerDown,e=>{if(0===e.button){e.target.setPointerCapture(e.pointerId),b.current=g.getBoundingClientRect(),w.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",p.viewport&&(p.viewport.style.scrollBehavior="auto"),E(e)}}),onPointerMove:hd(t.onPointerMove,E),onPointerUp:hd(t.onPointerUp,e=>{const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=w.current,p.viewport&&(p.viewport.style.scrollBehavior=""),b.current=null})})})}),op="ScrollAreaThumb",ip=n.forwardRef((t,r)=>{const{forceMount:n,...a}=t,o=np(op,t.__scopeScrollArea);return e(Ud,{present:n||o.hasThumb,children:e(sp,{ref:r,...a})})}),sp=n.forwardRef((t,r)=>{const{__scopeScrollArea:a,style:o,...i}=t,s=Bh(op,a),l=np(op,a),{onThumbPositionChange:c}=l,u=Yo(r,e=>l.onThumbChange(e)),d=n.useRef(void 0),f=vp(()=>{d.current&&(d.current(),d.current=void 0)},100);return n.useEffect(()=>{const e=s.viewport;if(e){const t=()=>{if(f(),!d.current){const t=yp(e,c);d.current=t,c()}};return c(),e.addEventListener("scroll",t),()=>e.removeEventListener("scroll",t)}},[s.viewport,f,c]),e(Ri.div,{"data-state":l.hasThumb?"visible":"hidden",...i,ref:u,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...o},onPointerDownCapture:hd(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:hd(t.onPointerUp,l.onThumbPointerUp)})});ip.displayName=op;var lp="ScrollAreaCorner",cp=n.forwardRef((t,r)=>{const n=Bh(lp,t.__scopeScrollArea),a=Boolean(n.scrollbarX&&n.scrollbarY);return"scroll"!==n.type&&a?e(up,{...t,ref:r}):null});cp.displayName=lp;var up=n.forwardRef((t,r)=>{const{__scopeScrollArea:a,...o}=t,i=Bh(lp,a),[s,l]=n.useState(0),[c,u]=n.useState(0),d=Boolean(s&&c);return bp(i.scrollbarX,()=>{const e=i.scrollbarX?.offsetHeight||0;i.onCornerHeightChange(e),u(e)}),bp(i.scrollbarY,()=>{const e=i.scrollbarY?.offsetWidth||0;i.onCornerWidthChange(e),l(e)}),d?e(Ri.div,{...o,ref:r,style:{width:s,height:c,position:"absolute",right:"ltr"===i.dir?0:void 0,left:"rtl"===i.dir?0:void 0,bottom:0,...t.style}}):null});function dp(e){return e?parseInt(e,10):0}function fp(e,t){const r=e/t;return isNaN(r)?0:r}function mp(e){const t=fp(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*t;return Math.max(n,18)}function hp(e,t,r="ltr"){const n=mp(t),a=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-a,i=t.content-t.viewport,s=o-n,l=Uh(e,"ltr"===r?[0,i]:[-1*i,0]);return pp([0,i],[0,s])(l)}function pp(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 gp(e,t){return e>0&&e<t}var yp=(e,t=()=>{})=>{let r={left:e.scrollLeft,top:e.scrollTop},n=0;return function a(){const o={left:e.scrollLeft,top:e.scrollTop},i=r.left!==o.left,s=r.top!==o.top;(i||s)&&t(),r=o,n=window.requestAnimationFrame(a)}(),()=>window.cancelAnimationFrame(n)};function vp(e,t){const r=ju(e),a=n.useRef(0);return n.useEffect(()=>()=>window.clearTimeout(a.current),[]),n.useCallback(()=>{window.clearTimeout(a.current),a.current=window.setTimeout(r,t)},[r,t])}function bp(e,t){const r=ju(t);Wu(()=>{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 wp=Zh,Sp=Gh,xp=cp;const kp=n.forwardRef(({className:t,children:n,...a},o)=>r(wp,{ref:o,className:Ko("relative overflow-hidden",t),...a,children:[e(Sp,{className:"h-full w-full rounded-[inherit]",children:n}),e(Tp,{}),e(xp,{})]}));kp.displayName=wp.displayName;const Tp=n.forwardRef(({className:t,orientation:r="vertical",...n},a)=>e(qh,{ref:a,orientation:r,className:Ko("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(ip,{className:Ko("relative rounded-full bg-border","vertical"===r&&"flex-1")})}));Tp.displayName=qh.displayName;var Ap="horizontal",Ep=["horizontal","vertical"],Cp=n.forwardRef((t,r)=>{const{decorative:n,orientation:a=Ap,...o}=t,i=function(e){return Ep.includes(e)}(a)?a:Ap,s=n?{role:"none"}:{"aria-orientation":"vertical"===i?i:void 0,role:"separator"};return e(Ri.div,{"data-orientation":i,...s,...o,ref:r})});Cp.displayName="Separator";var Np=Cp;const _p=n.forwardRef(({className:t,orientation:r="horizontal",decorative:n=!0,...a},o)=>e(Np,{ref:o,decorative:n,orientation:r,className:Ko("shrink-0 bg-border","horizontal"===r?"h-[1px] w-full":"h-full w-[1px]",t),...a}));_p.displayName=Np.displayName;var Rp="Switch",[Op,Dp]=Uu(Rp),[Mp,Pp]=Op(Rp),Ip=n.forwardRef((t,a)=>{const{__scopeSwitch:o,name:i,checked:s,defaultChecked:l,required:c,disabled:u,value:d="on",onCheckedChange:f,form:m,...h}=t,[p,g]=n.useState(null),y=Yo(a,e=>g(e)),v=n.useRef(!1),b=!p||(m||!!p.closest("form")),[w,S]=bd({prop:s,defaultProp:l??!1,onChange:f,caller:Rp});return r(Mp,{scope:o,checked:w,disabled:u,children:[e(Ri.button,{type:"button",role:"switch","aria-checked":w,"aria-required":c,"data-state":Up(w),"data-disabled":u?"":void 0,disabled:u,value:d,...h,ref:y,onClick:hd(t.onClick,e=>{S(e=>!e),b&&(v.current=e.isPropagationStopped(),v.current||e.stopPropagation())})}),b&&e(zp,{control:p,bubbles:!v.current,name:i,value:d,checked:w,required:c,disabled:u,form:m,style:{transform:"translateX(-100%)"}})]})});Ip.displayName=Rp;var Lp="SwitchThumb",Fp=n.forwardRef((t,r)=>{const{__scopeSwitch:n,...a}=t,o=Pp(Lp,n);return e(Ri.span,{"data-state":Up(o.checked),"data-disabled":o.disabled?"":void 0,...a,ref:r})});Fp.displayName=Lp;var zp=n.forwardRef(({__scopeSwitch:t,control:r,checked:a,bubbles:o=!0,...i},s)=>{const l=n.useRef(null),c=Yo(l,s),u=dh(a),d=uh(r);return n.useEffect(()=>{const e=l.current;if(!e)return;const t=window.HTMLInputElement.prototype,r=Object.getOwnPropertyDescriptor(t,"checked").set;if(u!==a&&r){const t=new Event("click",{bubbles:o});r.call(e,a),e.dispatchEvent(t)}},[u,a,o]),e("input",{type:"checkbox","aria-hidden":!0,defaultChecked:a,...i,tabIndex:-1,ref:c,style:{...i.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function Up(e){return e?"checked":"unchecked"}zp.displayName="SwitchBubbleInput";var Vp=Ip,jp=Fp;const $p=n.forwardRef(({className:t,...r},n)=>e(Vp,{className:Ko("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(jp,{className:Ko("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")})}));$p.displayName=Vp.displayName;const Wp=({workspaceId:t})=>{const[n,a]=f({}),{allFeatures:o,updateFeature:i,getWorkspace:s}=AA(),[l,u]=f(null),d=ne(e=>e.auth.user);if(c(()=>{s(t).then(u)},[t]),!l)return r("div",{className:"space-y-3.5",children:[e(Hi,{className:"h-10 w-full"}),e(Hi,{className:"h-10 w-full"}),e(Hi,{className:"h-10 w-full"})]});const m=l?.users.find(e=>("string"==typeof e?e:e._id)===d?.id)?.role,h="admin"===m?.toLowerCase();return e("div",{children:r("div",{className:"flex flex-col gap-y-3.5 pr-4",children:[!h&&e("div",{className:"text-red-500",children:"Only workspace admin can change the features."}),!o.length&&e("div",{className:"text-muted-foreground",children:"Workspace has no features to manage."}),o.length>0&&e("div",{className:"flex flex-col gap-y-3.5",children:o.map(t=>{const o=l?.features?.[t.slug];return r("div",{className:"flex items-center gap-x-2 justify-between w-full",children:[r("div",{className:"flex gap-x-2 flex-col",children:[e("h3",{className:"font-medium text-ellipsis",children:t.name}),e("p",{className:"text-muted-foreground",children:t.description})]}),e($p,{disabled:n[t.slug]||!h,checked:o??t.defaultValue,onCheckedChange:e=>async function(e,t){if(!l)return;a(r=>({...r,[e]:t}));const r=await i(l._id,e,t);u(r),a(t=>({...t,[e]:!1}))}(t.slug,e)})]},t._id)})})]})})};function Bp(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 Zp=["🏢","🏬","🏣","🏤","🏦","🏛️","🏠","🏡","🏭","🏗️","🏪","🏨","🏫","🏥","💼","📊","📈","📉","📋","📁","📂","🗂️","🗃️","🗄️","📅","🗓️","📝","🖋️","✏️","🖊️","🖌️","🖍️","📇","📌","📍","📎","🖇️","💻","🖥️","🖨️","🖱️","⌨️","📱","📲","📡","🌐","🔗","🔒","🔓","⚙️","🔧","🛠️","🧑💻","👨💻","👩💻","🕹️","💾","📟","🖥️","🖲️","🚀","💡","🎨","🖼️","🧪","🔬","🧬","🎯","⚡","🎲","🎮","🧩","📷","🎥","✉️","📨","📩","📧","📞","☎️","📠","🗣️","💬","🗨️","📢","📣","🔔","🛎️","💰","💸","💳","🏦","📈","📉","⚖️","🧾","🪙","🏛️","⚗️","🧪","🔭","🔬","🩺","🧬","🩻","🏥","🌱","🌍","🌏","🌎","🌡️","👨💼","👩💼","👨🏫","👩🏫","👨🔬","👩🔬","👨🎨","👩🎨","👨🔧","👩🔧","👨🚀","👩🚀","👨⚖️","👩⚖️","🏅","🎖️","🥇","🥈","🥉","🏆","🎗️","🔑","🗝️","🧭","🛡️","🚩","🏳️🌈","🎟️","🎫"],Hp=({workspace:t})=>{const[n,a]=f(!1),[o,i]=f("emoji"),[s,l]=f(),{updateWorkspace:c}=AA(),u=ne(e=>e.auth.user),d=zt({resolver:za(Zs({name:vs().min(2,{message:"Workspace name must be at least 2 characters."}),image:vs().optional()})),defaultValues:{name:t.name||"",image:t.image||""}});if(!t)return e("div",{children:e("div",{className:"text-gray-500",children:"Loading workspace settings..."})});const m=t?.users.find(e=>("object"==typeof e&&null!==e?e._id:e)===u?.id)?.role;console.log("myRole",m),console.log("workspace",t),console.log("currentUser",u);const h="admin"===m?.toLowerCase();return r("div",{children:[!h&&e("div",{className:"text-red-500",children:"Only workspace admin can change the workspace settings."}),e(Ii,{...d,children:r("form",{onSubmit:d.handleSubmit(async function(e){a(!0);try{await c(t,e)}catch(e){console.error("Failed to update workspace:",e)}finally{a(!1)}}),className:"space-y-6",children:[e(Fi,{control:d.control,name:"name",render:({field:t})=>r(Vi,{children:[e(ji,{children:"Name"}),e($i,{children:e(Zi,{placeholder:"My Awesome Workspace",...t,disabled:!h})}),e(Bi,{})]})}),r("div",{className:"space-y-4",children:[r("div",{children:[e(Pi,{className:"text-sm font-medium",children:"Icon"}),e(Wi,{children:"Choose an emoji or upload a custom image for your workspace."})]}),r(Fh,{value:o,disabled:!h,onValueChange:e=>i(e),className:"flex flex-col space-y-3",children:[r("div",{className:"flex items-center space-x-2",children:[e(zh,{value:"emoji",id:"emoji"}),r(Pi,{htmlFor:"emoji",className:"flex items-center gap-2",children:[e(ki,{className:"h-4 w-4"}),"Choose Emoji"]})]}),r("div",{className:"flex items-center space-x-2",children:[e(zh,{value:"url",id:"url"}),r(Pi,{htmlFor:"url",className:"flex items-center gap-2",children:[e(yi,{className:"h-4 w-4"}),"Custom Image URL"]})]})]}),"emoji"===o&&r("div",{className:"space-y-3",children:[r("div",{className:"flex items-center gap-3",children:[e("span",{className:"text-sm font-medium",children:"Preview:"}),r("div",{className:"w-12 h-12 rounded-lg border-2 border-border flex items-center justify-center text-2xl bg-muted",children:[s&&e("span",{className:"text-2xl",children:s}),!s&&e("img",{src:d.watch("image")})]})]}),e(kp,{className:"h-32 w-full rounded-md border",children:e("div",{className:"p-4 grid grid-cols-8 gap-2",children:Zp.map((t,r)=>e("button",{type:"button",onClick:()=>(e=>{l(e),d.setValue("image",Bp(e))})(t),disabled:!h,className:"w-8 h-8 rounded flex items-center justify-center text-lg hover:bg-muted transition-colors "+(s===t?"bg-primary text-primary-foreground":""),children:t},r))})})]}),"url"===o&&r("div",{className:"space-y-3",children:[e(Fi,{control:d.control,name:"image",render:({field:t})=>r(Vi,{children:[e(ji,{children:"Image URL"}),e($i,{children:e(Zi,{placeholder:"https://example.com/image.png",...t,disabled:!h})}),e(Wi,{children:"Enter a valid URL for your workspace image. Supports PNG, JPG, and SVG formats."}),e(Bi,{})]})}),d.watch("image")&&r("div",{className:"flex items-center gap-3",children:[e("span",{className:"text-sm font-medium",children:"Preview:"}),e("div",{className:"w-12 h-12 rounded-lg border-2 border-border overflow-hidden bg-muted",children:e("img",{src:d.watch("image"),className:"w-full h-full object-cover"})})]})]})]}),e("div",{className:"flex justify-end gap-3 pt-4",children:h&&e(_i,{type:"submit",disabled:n,progress:n,children:"Update Workspace"})})]})})]})};var Gp=.999,Kp=/[\\\/_+.#"@\[\(\{&]/,qp=/[\\\/_+.#"@\[\(\{&]/g,Jp=/[\s-]/,Yp=/[\s-]/g;function Xp(e,t,r,n,a,o,i){if(o===t.length)return a===e.length?1:.99;var s=`${a},${o}`;if(void 0!==i[s])return i[s];for(var l,c,u,d,f=n.charAt(o),m=r.indexOf(f,a),h=0;m>=0;)(l=Xp(e,t,r,n,m+1,o+1,i))>h&&(m===a?l*=1:Kp.test(e.charAt(m-1))?(l*=.8,(u=e.slice(a,m-1).match(qp))&&a>0&&(l*=Math.pow(Gp,u.length))):Jp.test(e.charAt(m-1))?(l*=.9,(d=e.slice(a,m-1).match(Yp))&&a>0&&(l*=Math.pow(Gp,d.length))):(l*=.17,a>0&&(l*=Math.pow(Gp,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=Xp(e,t,r,n,m+1,o+2,i))>l&&(l=.1*c)),l>h&&(h=l),m=r.indexOf(f,m+1);return i[s]=h,h}function Qp(e){return e.toLowerCase().replace(Yp," ")}function eg(e,t,r){return Xp(e=r&&r.length>0?""+(e+" "+r.join(" ")):e,t,Qp(e),Qp(t),0,0,{})}var tg='[cmdk-group=""]',rg='[cmdk-group-items=""]',ng='[cmdk-item=""]',ag=`${ng}:not([aria-disabled="true"])`,og="cmdk-item-select",ig="data-value",sg=(e,t,r)=>eg(e,t,r),lg=n.createContext(void 0),cg=()=>n.useContext(lg),ug=n.createContext(void 0),dg=()=>n.useContext(ug),fg=n.createContext(void 0),mg=n.forwardRef((e,t)=>{let r=Cg(()=>{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}}}),a=Cg(()=>new Set),o=Cg(()=>new Map),i=Cg(()=>new Map),s=Cg(()=>new Set),l=Ag(e),{label:c,children:u,value:d,onValueChange:f,filter:m,shouldFilter:h,loop:p,disablePointerSelection:g=!1,vimBindings:y=!0,...v}=e,b=yd(),w=yd(),S=yd(),x=n.useRef(null),k=Rg();Eg(()=>{if(void 0!==d){let e=d.trim();r.current.value=e,T.emit()}},[d]),Eg(()=>{k(6,R)},[]);let T=n.useMemo(()=>({subscribe:e=>(s.current.add(e),()=>s.current.delete(e)),snapshot:()=>r.current,setState:(e,t,n)=>{var a,o,i,s;if(!Object.is(r.current[e],t)){if(r.current[e]=t,"search"===e)_(),C(),k(1,N);else if("value"===e){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let e=document.getElementById(S);e?e.focus():null==(a=document.getElementById(b))||a.focus()}if(k(7,()=>{var e;r.current.selectedItemId=null==(e=O())?void 0:e.id,T.emit()}),n||k(5,R),void 0!==(null==(o=l.current)?void 0:o.value)){let e=null!=t?t:"";return void(null==(s=(i=l.current).onValueChange)||s.call(i,e))}}T.emit()}},emit:()=>{s.current.forEach(e=>e())}}),[]),A=n.useMemo(()=>({value:(e,t,n)=>{var a;t!==(null==(a=i.current.get(e))?void 0:a.value)&&(i.current.set(e,{value:t,keywords:n}),r.current.filtered.items.set(e,E(t,n)),k(2,()=>{C(),T.emit()}))},item:(e,t)=>(a.current.add(e),t&&(o.current.has(t)?o.current.get(t).add(e):o.current.set(t,new Set([e]))),k(3,()=>{_(),C(),r.current.value||N(),T.emit()}),()=>{i.current.delete(e),a.current.delete(e),r.current.filtered.items.delete(e);let t=O();k(4,()=>{_(),(null==t?void 0:t.getAttribute("id"))===e&&N(),T.emit()})}),group:e=>(o.current.has(e)||o.current.set(e,new Set),()=>{i.current.delete(e),o.current.delete(e)}),filter:()=>l.current.shouldFilter,label:c||e["aria-label"],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:b,inputId:S,labelId:w,listInnerRef:x}),[]);function E(e,t){var n,a;let o=null!=(a=null==(n=l.current)?void 0:n.filter)?a:sg;return e?o(e,r.current.search,t):0}function C(){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=x.current;D().sort((t,r)=>{var n,a;let o=t.getAttribute("id"),i=r.getAttribute("id");return(null!=(n=e.get(i))?n:0)-(null!=(a=e.get(o))?a:0)}).forEach(e=>{let t=e.closest(rg);t?t.appendChild(e.parentElement===t?e:e.closest(`${rg} > *`)):n.appendChild(e.parentElement===n?e:e.closest(`${rg} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{var t;let r=null==(t=x.current)?void 0:t.querySelector(`${tg}[${ig}="${encodeURIComponent(e[0])}"]`);null==r||r.parentElement.appendChild(r)})}function N(){let e=D().find(e=>"true"!==e.getAttribute("aria-disabled")),t=null==e?void 0:e.getAttribute(ig);T.setState("value",t||void 0)}function _(){var e,t,n,s;if(!r.current.search||!1===l.current.shouldFilter)return void(r.current.filtered.count=a.current.size);r.current.filtered.groups=new Set;let c=0;for(let o of a.current){let a=E(null!=(t=null==(e=i.current.get(o))?void 0:e.value)?t:"",null!=(s=null==(n=i.current.get(o))?void 0:n.keywords)?s:[]);r.current.filtered.items.set(o,a),a>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 R(){var e,t,r;let n=O();n&&((null==(e=n.parentElement)?void 0:e.firstChild)===n&&(null==(r=null==(t=n.closest(tg))?void 0:t.querySelector('[cmdk-group-heading=""]'))||r.scrollIntoView({block:"nearest"})),n.scrollIntoView({block:"nearest"}))}function O(){var e;return null==(e=x.current)?void 0:e.querySelector(`${ng}[aria-selected="true"]`)}function D(){var e;return Array.from((null==(e=x.current)?void 0:e.querySelectorAll(ag))||[])}function M(e){let t=D()[e];t&&T.setState("value",t.getAttribute(ig))}function P(e){var t;let r=O(),n=D(),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&&T.setState("value",o.getAttribute(ig))}function I(e){let t,r=O(),n=null==r?void 0:r.closest(tg);for(;n&&!t;)n=e>0?kg(n,tg):Tg(n,tg),t=null==n?void 0:n.querySelector(ag);t?T.setState("value",t.getAttribute(ig)):P(e)}let L=()=>M(D().length-1),F=e=>{e.preventDefault(),e.metaKey?L():e.altKey?I(1):P(1)},z=e=>{e.preventDefault(),e.metaKey?M(0):e.altKey?I(-1):P(-1)};return n.createElement(Ri.div,{ref:t,tabIndex:-1,...v,"cmdk-root":"",onKeyDown:e=>{var t;null==(t=v.onKeyDown)||t.call(v,e);let r=e.nativeEvent.isComposing||229===e.keyCode;if(!e.defaultPrevented&&!r)switch(e.key){case"n":case"j":y&&e.ctrlKey&&F(e);break;case"ArrowDown":F(e);break;case"p":case"k":y&&e.ctrlKey&&z(e);break;case"ArrowUp":z(e);break;case"Home":e.preventDefault(),M(0);break;case"End":e.preventDefault(),L();break;case"Enter":{e.preventDefault();let t=O();if(t){let e=new Event(og);t.dispatchEvent(e)}}}}},n.createElement("label",{"cmdk-label":"",htmlFor:A.inputId,id:A.labelId,style:Dg},c),Og(e,e=>n.createElement(ug.Provider,{value:T},n.createElement(lg.Provider,{value:A},e))))}),hg=n.forwardRef((e,t)=>{var r,a;let o=yd(),i=n.useRef(null),s=n.useContext(fg),l=cg(),c=Ag(e),u=null!=(a=null==(r=c.current)?void 0:r.forceMount)?a:null==s?void 0:s.forceMount;Eg(()=>{if(!u)return l.item(o,null==s?void 0:s.id)},[u]);let d=_g(o,i,[e.value,e.children,i],e.keywords),f=dg(),m=Ng(e=>e.value&&e.value===d.current),h=Ng(e=>!(!u&&!1!==l.filter())||(!e.search||e.filtered.items.get(o)>0));function p(){var e,t;g(),null==(t=(e=c.current).onSelect)||t.call(e,d.current)}function g(){f.setState("value",d.current,!0)}if(n.useEffect(()=>{let t=i.current;if(t&&!e.disabled)return t.addEventListener(og,p),()=>t.removeEventListener(og,p)},[h,e.onSelect,e.disabled]),!h)return null;let{disabled:y,value:v,onSelect:b,forceMount:w,keywords:S,...x}=e;return n.createElement(Ri.div,{ref:Jo(i,t),...x,id:o,"cmdk-item":"",role:"option","aria-disabled":!!y,"aria-selected":!!m,"data-disabled":!!y,"data-selected":!!m,onPointerMove:y||l.getDisablePointerSelection()?void 0:g,onClick:y?void 0:p},e.children)}),pg=n.forwardRef((e,t)=>{let{heading:r,children:a,forceMount:o,...i}=e,s=yd(),l=n.useRef(null),c=n.useRef(null),u=yd(),d=cg(),f=Ng(e=>!(!o&&!1!==d.filter())||(!e.search||e.filtered.groups.has(s)));Eg(()=>d.group(s),[]),_g(s,l,[e.value,e.heading,c]);let m=n.useMemo(()=>({id:s,forceMount:o}),[o]);return n.createElement(Ri.div,{ref:Jo(l,t),...i,"cmdk-group":"",role:"presentation",hidden:!f||void 0},r&&n.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:u},r),Og(e,e=>n.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?u:void 0},n.createElement(fg.Provider,{value:m},e))))}),gg=n.forwardRef((e,t)=>{let{alwaysRender:r,...a}=e,o=n.useRef(null),i=Ng(e=>!e.search);return r||i?n.createElement(Ri.div,{ref:Jo(o,t),...a,"cmdk-separator":"",role:"separator"}):null}),yg=n.forwardRef((e,t)=>{let{onValueChange:r,...a}=e,o=null!=e.value,i=dg(),s=Ng(e=>e.search),l=Ng(e=>e.selectedItemId),c=cg();return n.useEffect(()=>{null!=e.value&&i.setState("search",e.value)},[e.value]),n.createElement(Ri.input,{ref:t,...a,"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:s,onChange:e=>{o||i.setState("search",e.target.value),null==r||r(e.target.value)}})}),vg=n.forwardRef((e,t)=>{let{children:r,label:a="Suggestions",...o}=e,i=n.useRef(null),s=n.useRef(null),l=Ng(e=>e.selectedItemId),c=cg();return n.useEffect(()=>{if(s.current&&i.current){let e,t=s.current,r=i.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)}}},[]),n.createElement(Ri.div,{ref:Jo(i,t),...o,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":l,"aria-label":a,id:c.listId},Og(e,e=>n.createElement("div",{ref:Jo(s,c.listInnerRef),"cmdk-list-sizer":""},e)))}),bg=n.forwardRef((e,t)=>{let{open:r,onOpenChange:a,overlayClassName:o,contentClassName:i,container:s,...l}=e;return n.createElement(vm,{open:r,onOpenChange:a},n.createElement(wm,{container:s},n.createElement(Sm,{"cmdk-overlay":"",className:o}),n.createElement(xm,{"aria-label":e.label,"cmdk-dialog":"",className:i},n.createElement(mg,{ref:t,...l}))))}),wg=n.forwardRef((e,t)=>Ng(e=>0===e.filtered.count)?n.createElement(Ri.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),Sg=n.forwardRef((e,t)=>{let{progress:r,children:a,label:o="Loading...",...i}=e;return n.createElement(Ri.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},Og(e,e=>n.createElement("div",{"aria-hidden":!0},e)))}),xg=Object.assign(mg,{List:vg,Item:hg,Input:yg,Group:pg,Separator:gg,Dialog:bg,Empty:wg,Loading:Sg});function kg(e,t){let r=e.nextElementSibling;for(;r;){if(r.matches(t))return r;r=r.nextElementSibling}}function Tg(e,t){let r=e.previousElementSibling;for(;r;){if(r.matches(t))return r;r=r.previousElementSibling}}function Ag(e){let t=n.useRef(e);return Eg(()=>{t.current=e}),t}var Eg="undefined"==typeof window?n.useEffect:n.useLayoutEffect;function Cg(e){let t=n.useRef();return void 0===t.current&&(t.current=e()),t}function Ng(e){let t=dg(),r=()=>e(t.snapshot());return n.useSyncExternalStore(t.subscribe,r,r)}function _g(e,t,r,a=[]){let o=n.useRef(),i=cg();return Eg(()=>{var n;let s=(()=>{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=a.map(e=>e.trim());i.value(e,s,l),null==(n=t.current)||n.setAttribute(ig,s),o.current=s}),o}var Rg=()=>{let[e,t]=n.useState(),r=Cg(()=>new Map);return Eg(()=>{r.current.forEach(e=>e()),r.current=new Map},[e]),(e,n)=>{r.current.set(e,n),t({})}};function Og({asChild:e,children:t},r){return e&&n.isValidElement(t)?n.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 Dg={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const Mg=n.forwardRef(({className:t,...r},n)=>e(xg,{ref:n,className:Ko("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",t),...r}));Mg.displayName=xg.displayName;const Pg=n.forwardRef(({className:t,...n},a)=>r("div",{className:"flex items-center border-b px-3","data-cmdk-input-wrapper":"",children:[e(Pm,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),e(xg.Input,{ref:a,className:Ko("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),...n})]}));Pg.displayName=xg.Input.displayName;const Ig=n.forwardRef(({className:t,...r},n)=>e(xg.List,{ref:n,className:Ko("max-h-[300px] overflow-y-auto overflow-x-hidden",t),...r}));Ig.displayName=xg.List.displayName;n.forwardRef((t,r)=>e(xg.Empty,{ref:r,className:"py-6 text-center text-sm",...t})).displayName=xg.Empty.displayName;const Lg=n.forwardRef(({className:t,...r},n)=>e(xg.Group,{ref:n,className:Ko("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}));Lg.displayName=xg.Group.displayName;n.forwardRef(({className:t,...r},n)=>e(xg.Separator,{ref:n,className:Ko("-mx-1 h-px bg-border",t),...r})).displayName=xg.Separator.displayName;const Fg=n.forwardRef(({className:t,...r},n)=>e(xg.Item,{ref:n,className:Ko("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}));Fg.displayName=xg.Item.displayName;const zg=["top","right","bottom","left"],Ug=Math.min,Vg=Math.max,jg=Math.round,$g=Math.floor,Wg=e=>({x:e,y:e}),Bg={left:"right",right:"left",bottom:"top",top:"bottom"},Zg={start:"end",end:"start"};function Hg(e,t,r){return Vg(e,Ug(t,r))}function Gg(e,t){return"function"==typeof e?e(t):e}function Kg(e){return e.split("-")[0]}function qg(e){return e.split("-")[1]}function Jg(e){return"x"===e?"y":"x"}function Yg(e){return"y"===e?"height":"width"}const Xg=new Set(["top","bottom"]);function Qg(e){return Xg.has(Kg(e))?"y":"x"}function ey(e){return Jg(Qg(e))}function ty(e){return e.replace(/start|end/g,e=>Zg[e])}const ry=["left","right"],ny=["right","left"],ay=["top","bottom"],oy=["bottom","top"];function iy(e,t,r,n){const a=qg(e);let o=function(e,t,r){switch(e){case"top":case"bottom":return r?t?ny:ry:t?ry:ny;case"left":case"right":return t?ay:oy;default:return[]}}(Kg(e),"start"===r,n);return a&&(o=o.map(e=>e+"-"+a),t&&(o=o.concat(o.map(ty)))),o}function sy(e){return e.replace(/left|right|bottom|top/g,e=>Bg[e])}function ly(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 cy(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 uy(e,t,r){let{reference:n,floating:a}=e;const o=Qg(t),i=ey(t),s=Yg(i),l=Kg(t),c="y"===o,u=n.x+n.width/2-a.width/2,d=n.y+n.height/2-a.height/2,f=n[s]/2-a[s]/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(qg(t)){case"start":m[i]-=f*(r&&c?-1:1);break;case"end":m[i]+=f*(r&&c?-1:1)}return m}async function dy(e,t){var r;void 0===t&&(t={});const{x:n,y:a,platform:o,rects:i,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:m=0}=Gg(t,e),h=ly(m),p=s[f?"floating"===d?"reference":"floating":d],g=cy(await o.getClippingRect({element:null==(r=await(null==o.isElement?void 0:o.isElement(p)))||r?p:p.contextElement||await(null==o.getDocumentElement?void 0:o.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),y="floating"===d?{x:n,y:a,width:i.floating.width,height:i.floating.height}:i.reference,v=await(null==o.getOffsetParent?void 0:o.getOffsetParent(s.floating)),b=await(null==o.isElement?void 0:o.isElement(v))&&await(null==o.getScale?void 0:o.getScale(v))||{x:1,y:1},w=cy(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:y,offsetParent:v,strategy:l}):y);return{top:(g.top-w.top+h.top)/b.y,bottom:(w.bottom-g.bottom+h.bottom)/b.y,left:(g.left-w.left+h.left)/b.x,right:(w.right-g.right+h.right)/b.x}}function fy(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function my(e){return zg.some(t=>e[t]>=0)}const hy=new Set(["left","top"]);function py(){return"undefined"!=typeof window}function gy(e){return by(e)?(e.nodeName||"").toLowerCase():"#document"}function yy(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function vy(e){var t;return null==(t=(by(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function by(e){return!!py()&&(e instanceof Node||e instanceof yy(e).Node)}function wy(e){return!!py()&&(e instanceof Element||e instanceof yy(e).Element)}function Sy(e){return!!py()&&(e instanceof HTMLElement||e instanceof yy(e).HTMLElement)}function xy(e){return!(!py()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof yy(e).ShadowRoot)}const ky=new Set(["inline","contents"]);function Ty(e){const{overflow:t,overflowX:r,overflowY:n,display:a}=Ly(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!ky.has(a)}const Ay=new Set(["table","td","th"]);function Ey(e){return Ay.has(gy(e))}const Cy=[":popover-open",":modal"];function Ny(e){return Cy.some(t=>{try{return e.matches(t)}catch(e){return!1}})}const _y=["transform","translate","scale","rotate","perspective"],Ry=["transform","translate","scale","rotate","perspective","filter"],Oy=["paint","layout","strict","content"];function Dy(e){const t=My(),r=wy(e)?Ly(e):e;return _y.some(e=>!!r[e]&&"none"!==r[e])||!!r.containerType&&"normal"!==r.containerType||!t&&!!r.backdropFilter&&"none"!==r.backdropFilter||!t&&!!r.filter&&"none"!==r.filter||Ry.some(e=>(r.willChange||"").includes(e))||Oy.some(e=>(r.contain||"").includes(e))}function My(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const Py=new Set(["html","body","#document"]);function Iy(e){return Py.has(gy(e))}function Ly(e){return yy(e).getComputedStyle(e)}function Fy(e){return wy(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function zy(e){if("html"===gy(e))return e;const t=e.assignedSlot||e.parentNode||xy(e)&&e.host||vy(e);return xy(t)?t.host:t}function Uy(e){const t=zy(e);return Iy(t)?e.ownerDocument?e.ownerDocument.body:e.body:Sy(t)&&Ty(t)?t:Uy(t)}function Vy(e,t,r){var n;void 0===t&&(t=[]),void 0===r&&(r=!0);const a=Uy(e),o=a===(null==(n=e.ownerDocument)?void 0:n.body),i=yy(a);if(o){const e=jy(i);return t.concat(i,i.visualViewport||[],Ty(a)?a:[],e&&r?Vy(e):[])}return t.concat(a,Vy(a,[],r))}function jy(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function $y(e){const t=Ly(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const a=Sy(e),o=a?e.offsetWidth:r,i=a?e.offsetHeight:n,s=jg(r)!==o||jg(n)!==i;return s&&(r=o,n=i),{width:r,height:n,$:s}}function Wy(e){return wy(e)?e:e.contextElement}function By(e){const t=Wy(e);if(!Sy(t))return Wg(1);const r=t.getBoundingClientRect(),{width:n,height:a,$:o}=$y(t);let i=(o?jg(r.width):r.width)/n,s=(o?jg(r.height):r.height)/a;return i&&Number.isFinite(i)||(i=1),s&&Number.isFinite(s)||(s=1),{x:i,y:s}}const Zy=Wg(0);function Hy(e){const t=yy(e);return My()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Zy}function Gy(e,t,r,n){void 0===t&&(t=!1),void 0===r&&(r=!1);const a=e.getBoundingClientRect(),o=Wy(e);let i=Wg(1);t&&(n?wy(n)&&(i=By(n)):i=By(e));const s=function(e,t,r){return void 0===t&&(t=!1),!(!r||t&&r!==yy(e))&&t}(o,r,n)?Hy(o):Wg(0);let l=(a.left+s.x)/i.x,c=(a.top+s.y)/i.y,u=a.width/i.x,d=a.height/i.y;if(o){const e=yy(o),t=n&&wy(n)?yy(n):n;let r=e,a=jy(r);for(;a&&n&&t!==r;){const e=By(a),t=a.getBoundingClientRect(),n=Ly(a),o=t.left+(a.clientLeft+parseFloat(n.paddingLeft))*e.x,i=t.top+(a.clientTop+parseFloat(n.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=o,c+=i,r=yy(a),a=jy(r)}}return cy({width:u,height:d,x:l,y:c})}function Ky(e,t){const r=Fy(e).scrollLeft;return t?t.left+r:Gy(vy(e)).left+r}function qy(e,t){const r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-Ky(e,r),y:r.top+t.scrollTop}}const Jy=new Set(["absolute","fixed"]);function Yy(e,t,r){let n;if("viewport"===t)n=function(e,t){const r=yy(e),n=vy(e),a=r.visualViewport;let o=n.clientWidth,i=n.clientHeight,s=0,l=0;if(a){o=a.width,i=a.height;const e=My();(!e||e&&"fixed"===t)&&(s=a.offsetLeft,l=a.offsetTop)}const c=Ky(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,i=Math.abs(n.clientWidth-t.clientWidth-a);i<=25&&(o-=i)}else c<=25&&(o+=c);return{width:o,height:i,x:s,y:l}}(e,r);else if("document"===t)n=function(e){const t=vy(e),r=Fy(e),n=e.ownerDocument.body,a=Vg(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),o=Vg(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-r.scrollLeft+Ky(e);const s=-r.scrollTop;return"rtl"===Ly(n).direction&&(i+=Vg(t.clientWidth,n.clientWidth)-a),{width:a,height:o,x:i,y:s}}(vy(e));else if(wy(t))n=function(e,t){const r=Gy(e,!0,"fixed"===t),n=r.top+e.clientTop,a=r.left+e.clientLeft,o=Sy(e)?By(e):Wg(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=Hy(e);n={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return cy(n)}function Xy(e,t){const r=zy(e);return!(r===t||!wy(r)||Iy(r))&&("fixed"===Ly(r).position||Xy(r,t))}function Qy(e,t,r){const n=Sy(t),a=vy(t),o="fixed"===r,i=Gy(e,!0,o,t);let s={scrollLeft:0,scrollTop:0};const l=Wg(0);function c(){l.x=Ky(a)}if(n||!n&&!o)if(("body"!==gy(t)||Ty(a))&&(s=Fy(t)),n){const e=Gy(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?Wg(0):qy(a,s);return{x:i.left+s.scrollLeft-l.x-u.x,y:i.top+s.scrollTop-l.y-u.y,width:i.width,height:i.height}}function ev(e){return"static"===Ly(e).position}function tv(e,t){if(!Sy(e)||"fixed"===Ly(e).position)return null;if(t)return t(e);let r=e.offsetParent;return vy(e)===r&&(r=r.ownerDocument.body),r}function rv(e,t){const r=yy(e);if(Ny(e))return r;if(!Sy(e)){let t=zy(e);for(;t&&!Iy(t);){if(wy(t)&&!ev(t))return t;t=zy(t)}return r}let n=tv(e,t);for(;n&&Ey(n)&&ev(n);)n=tv(n,t);return n&&Iy(n)&&ev(n)&&!Dy(n)?r:n||function(e){let t=zy(e);for(;Sy(t)&&!Iy(t);){if(Dy(t))return t;if(Ny(t))return null;t=zy(t)}return null}(e)||r}const nv={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:r,offsetParent:n,strategy:a}=e;const o="fixed"===a,i=vy(n),s=!!t&&Ny(t.floating);if(n===i||s&&o)return r;let l={scrollLeft:0,scrollTop:0},c=Wg(1);const u=Wg(0),d=Sy(n);if((d||!d&&!o)&&(("body"!==gy(n)||Ty(i))&&(l=Fy(n)),Sy(n))){const e=Gy(n);c=By(n),u.x=e.x+n.clientLeft,u.y=e.y+n.clientTop}const f=!i||d||o?Wg(0):qy(i,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:vy,getClippingRect:function(e){let{element:t,boundary:r,rootBoundary:n,strategy:a}=e;const o="clippingAncestors"===r?Ny(t)?[]:function(e,t){const r=t.get(e);if(r)return r;let n=Vy(e,[],!1).filter(e=>wy(e)&&"body"!==gy(e)),a=null;const o="fixed"===Ly(e).position;let i=o?zy(e):e;for(;wy(i)&&!Iy(i);){const t=Ly(i),r=Dy(i);r||"fixed"!==t.position||(a=null),(o?!r&&!a:!r&&"static"===t.position&&a&&Jy.has(a.position)||Ty(i)&&!r&&Xy(e,i))?n=n.filter(e=>e!==i):a=t,i=zy(i)}return t.set(e,n),n}(t,this._c):[].concat(r),i=[...o,n],s=i[0],l=i.reduce((e,r)=>{const n=Yy(t,r,a);return e.top=Vg(n.top,e.top),e.right=Ug(n.right,e.right),e.bottom=Ug(n.bottom,e.bottom),e.left=Vg(n.left,e.left),e},Yy(t,s,a));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:rv,getElementRects:async function(e){const t=this.getOffsetParent||rv,r=this.getDimensions,n=await r(e.floating);return{reference:Qy(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}=$y(e);return{width:t,height:r}},getScale:By,isElement:wy,isRTL:function(e){return"rtl"===Ly(e).direction}};function av(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ov(e,t,r,n){void 0===n&&(n={});const{ancestorScroll:a=!0,ancestorResize:o=!0,elementResize:i="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:l=!1}=n,c=Wy(e),u=a||o?[...c?Vy(c):[],...Vy(t)]:[];u.forEach(e=>{a&&e.addEventListener("scroll",r,{passive:!0}),o&&e.addEventListener("resize",r)});const d=c&&s?function(e,t){let r,n=null;const a=vy(e);function o(){var e;clearTimeout(r),null==(e=n)||e.disconnect(),n=null}return function i(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),o();const c=e.getBoundingClientRect(),{left:u,top:d,width:f,height:m}=c;if(s||t(),!f||!m)return;const h={rootMargin:-$g(d)+"px "+-$g(a.clientWidth-(u+f))+"px "+-$g(a.clientHeight-(d+m))+"px "+-$g(u)+"px",threshold:Vg(0,Ug(1,l))||1};let p=!0;function g(t){const n=t[0].intersectionRatio;if(n!==l){if(!p)return i();n?i(!1,n):r=setTimeout(()=>{i(!1,1e-7)},1e3)}1!==n||av(c,e.getBoundingClientRect())||i(),p=!1}try{n=new IntersectionObserver(g,{...h,root:a.ownerDocument})}catch(e){n=new IntersectionObserver(g,h)}n.observe(e)}(!0),o}(c,r):null;let f,m=-1,h=null;i&&(h=new ResizeObserver(e=>{let[n]=e;n&&n.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var e;null==(e=h)||e.observe(t)})),r()}),c&&!l&&h.observe(c),h.observe(t));let p=l?Gy(e):null;return l&&function t(){const n=Gy(e);p&&!av(p,n)&&r();p=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=h)||e.disconnect(),h=null,l&&cancelAnimationFrame(f)}}const iv=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:a,y:o,placement:i,middlewareData:s}=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)),i=Kg(r),s=qg(r),l="y"===Qg(r),c=hy.has(i)?-1:1,u=o&&l?-1:1,d=Gg(t,e);let{mainAxis:f,crossAxis:m,alignmentAxis:h}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&"number"==typeof h&&(m="end"===s?-1*h:h),l?{x:m*u,y:f*c}:{x:f*c,y:m*u}}(t,e);return i===(null==(r=s.offset)?void 0:r.placement)&&null!=(n=s.arrow)&&n.alignmentOffset?{}:{x:a+l.x,y:o+l.y,data:{...l,placement:i}}}}},sv=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:i=!1,limiter:s={fn:e=>{let{x:t,y:r}=e;return{x:t,y:r}}},...l}=Gg(e,t),c={x:r,y:n},u=await dy(t,l),d=Qg(Kg(a)),f=Jg(d);let m=c[f],h=c[d];if(o){const e="y"===f?"bottom":"right";m=Hg(m+u["y"===f?"top":"left"],m,m-u[e])}if(i){const e="y"===d?"bottom":"right";h=Hg(h+u["y"===d?"top":"left"],h,h-u[e])}const p=s.fn({...t,[f]:m,[d]:h});return{...p,data:{x:p.x-r,y:p.y-n,enabled:{[f]:o,[d]:i}}}}}},lv=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:a,middlewareData:o,rects:i,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:p=!0,...g}=Gg(e,t);if(null!=(r=o.arrow)&&r.alignmentOffset)return{};const y=Kg(a),v=Qg(s),b=Kg(s)===s,w=await(null==l.isRTL?void 0:l.isRTL(c.floating)),S=f||(b||!p?[sy(s)]:function(e){const t=sy(e);return[ty(e),t,ty(t)]}(s)),x="none"!==h;!f&&x&&S.push(...iy(s,p,h,w));const k=[s,...S],T=await dy(t,g),A=[];let E=(null==(n=o.flip)?void 0:n.overflows)||[];if(u&&A.push(T[y]),d){const e=function(e,t,r){void 0===r&&(r=!1);const n=qg(e),a=ey(e),o=Yg(a);let i="x"===a?n===(r?"end":"start")?"right":"left":"start"===n?"bottom":"top";return t.reference[o]>t.floating[o]&&(i=sy(i)),[i,sy(i)]}(a,i,w);A.push(T[e[0]],T[e[1]])}if(E=[...E,{placement:a,overflows:A}],!A.every(e=>e<=0)){var C,N;const e=((null==(C=o.flip)?void 0:C.index)||0)+1,t=k[e];if(t){if(!("alignment"===d&&v!==Qg(t))||E.every(e=>Qg(e.placement)!==v||e.overflows[0]>0))return{data:{index:e,overflows:E},reset:{placement:t}}}let r=null==(N=E.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:N.placement;if(!r)switch(m){case"bestFit":{var _;const e=null==(_=E.filter(e=>{if(x){const t=Qg(e.placement);return t===v||"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=s}if(a!==r)return{reset:{placement:r}}}return{}}}},cv=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:a,rects:o,platform:i,elements:s}=t,{apply:l=()=>{},...c}=Gg(e,t),u=await dy(t,c),d=Kg(a),f=qg(a),m="y"===Qg(a),{width:h,height:p}=o.floating;let g,y;"top"===d||"bottom"===d?(g=d,y=f===(await(null==i.isRTL?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(y=d,g="end"===f?"top":"bottom");const v=p-u.top-u.bottom,b=h-u.left-u.right,w=Ug(p-u[g],v),S=Ug(h-u[y],b),x=!t.middlewareData.shift;let k=w,T=S;if(null!=(r=t.middlewareData.shift)&&r.enabled.x&&(T=b),null!=(n=t.middlewareData.shift)&&n.enabled.y&&(k=v),x&&!f){const e=Vg(u.left,0),t=Vg(u.right,0),r=Vg(u.top,0),n=Vg(u.bottom,0);m?T=h-2*(0!==e||0!==t?e+t:Vg(u.left,u.right)):k=p-2*(0!==r||0!==n?r+n:Vg(u.top,u.bottom))}await l({...t,availableWidth:T,availableHeight:k});const A=await i.getDimensions(s.floating);return h!==A.width||p!==A.height?{reset:{rects:!0}}:{}}}},uv=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...a}=Gg(e,t);switch(n){case"referenceHidden":{const e=fy(await dy(t,{...a,elementContext:"reference"}),r.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:my(e)}}}case"escaped":{const e=fy(await dy(t,{...a,altBoundary:!0}),r.floating);return{data:{escapedOffsets:e,escaped:my(e)}}}default:return{}}}}},dv=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:a,rects:o,platform:i,elements:s,middlewareData:l}=t,{element:c,padding:u=0}=Gg(e,t)||{};if(null==c)return{};const d=ly(u),f={x:r,y:n},m=ey(a),h=Yg(m),p=await i.getDimensions(c),g="y"===m,y=g?"top":"left",v=g?"bottom":"right",b=g?"clientHeight":"clientWidth",w=o.reference[h]+o.reference[m]-f[m]-o.floating[h],S=f[m]-o.reference[m],x=await(null==i.getOffsetParent?void 0:i.getOffsetParent(c));let k=x?x[b]:0;k&&await(null==i.isElement?void 0:i.isElement(x))||(k=s.floating[b]||o.floating[h]);const T=w/2-S/2,A=k/2-p[h]/2-1,E=Ug(d[y],A),C=Ug(d[v],A),N=E,_=k-p[h]-C,R=k/2-p[h]/2+T,O=Hg(N,R,_),D=!l.arrow&&null!=qg(a)&&R!==O&&o.reference[h]/2-(R<N?E:C)-p[h]/2<0,M=D?R<N?R-N:R-_:0;return{[m]:f[m]+M,data:{[m]:O,centerOffset:R-O-M,...D&&{alignmentOffset:M}},reset:D}}}),fv=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:a,rects:o,middlewareData:i}=t,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=Gg(e,t),u={x:r,y:n},d=Qg(a),f=Jg(d);let m=u[f],h=u[d];const p=Gg(s,t),g="number"==typeof p?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};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 y,v;const e="y"===f?"width":"height",t=hy.has(Kg(a)),r=o.reference[d]-o.floating[e]+(t&&(null==(y=i.offset)?void 0:y[d])||0)+(t?0:g.crossAxis),n=o.reference[d]+o.reference[e]+(t?0:(null==(v=i.offset)?void 0:v[d])||0)-(t?g.crossAxis:0);h<r?h=r:h>n&&(h=n)}return{[f]:m,[d]:h}}}},mv=(e,t,r)=>{const n=new Map,a={platform:nv,...r},o={...a.platform,_c:n};return(async(e,t,r)=>{const{placement:n="bottom",strategy:a="absolute",middleware:o=[],platform:i}=r,s=o.filter(Boolean),l=await(null==i.isRTL?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:a}),{x:u,y:d}=uy(c,n,l),f=n,m={},h=0;for(let r=0;r<s.length;r++){const{name:o,fn:p}=s[r],{x:g,y:y,data:v,reset:b}=await p({x:u,y:d,initialPlacement:n,placement:f,strategy:a,middlewareData:m,rects:c,platform:i,elements:{reference:e,floating:t}});u=null!=g?g:u,d=null!=y?y:d,m={...m,[o]:{...m[o],...v}},b&&h<=50&&(h++,"object"==typeof b&&(b.placement&&(f=b.placement),b.rects&&(c=!0===b.rects?await i.getElementRects({reference:e,floating:t,strategy:a}):b.rects),({x:u,y:d}=uy(c,f,l))),r=-1)}return{x:u,y:d,placement:f,strategy:a,middlewareData:m}})(e,t,{...a,platform:o})};var hv="undefined"!=typeof document?m:function(){};function pv(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(!pv(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)&&!pv(e[r],t[r]))return!1}return!0}return e!=e&&t!=t}function gv(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function yv(e,t){const r=gv(e);return Math.round(t*r)/r}function vv(e){const t=n.useRef(e);return hv(()=>{t.current=e}),t}const bv=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?dv({element:r.current,padding:n}).fn(t):{}:r?dv({element:r,padding:n}).fn(t):{};var a}}),wv=(e,t)=>({...iv(e),options:[e,t]}),Sv=(e,t)=>({...sv(e),options:[e,t]}),xv=(e,t)=>({...fv(e),options:[e,t]}),kv=(e,t)=>({...lv(e),options:[e,t]}),Tv=(e,t)=>({...cv(e),options:[e,t]}),Av=(e,t)=>({...uv(e),options:[e,t]}),Ev=(e,t)=>({...bv(e),options:[e,t]});var Cv=n.forwardRef((t,r)=>{const{children:n,width:a=10,height:o=5,...i}=t;return e(Ri.svg,{...i,ref:r,width:a,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:e("polygon",{points:"0,0 30,0 15,10"})})});Cv.displayName="Arrow";var Nv=Cv,_v="Popper",[Rv,Ov]=Uu(_v),[Dv,Mv]=Rv(_v),Pv=t=>{const{__scopePopper:r,children:a}=t,[o,i]=n.useState(null);return e(Dv,{scope:r,anchor:o,onAnchorChange:i,children:a})};Pv.displayName=_v;var Iv="PopperAnchor",Lv=n.forwardRef((t,r)=>{const{__scopePopper:a,virtualRef:o,...i}=t,s=Mv(Iv,a),l=n.useRef(null),c=Yo(r,l),u=n.useRef(null);return n.useEffect(()=>{const e=u.current;u.current=o?.current||l.current,e!==u.current&&s.onAnchorChange(u.current)}),o?null:e(Ri.div,{...i,ref:c})});Lv.displayName=Iv;var Fv="PopperContent",[zv,Uv]=Rv(Fv),Vv=n.forwardRef((t,r)=>{const{__scopePopper:a,side:o="bottom",sideOffset:i=0,align:s="center",alignOffset:l=0,arrowPadding:c=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:f=0,sticky:m="partial",hideWhenDetached:p=!1,updatePositionStrategy:g="optimized",onPlaced:y,...v}=t,b=Mv(Fv,a),[w,S]=n.useState(null),x=Yo(r,e=>S(e)),[k,T]=n.useState(null),A=uh(k),E=A?.width??0,C=A?.height??0,N=o+("center"!==s?"-"+s:""),_="number"==typeof f?f:{top:0,right:0,bottom:0,left:0,...f},R=Array.isArray(d)?d:[d],O=R.length>0,D={padding:_,boundary:R.filter(Bv),altBoundary:O},{refs:M,floatingStyles:P,placement:I,isPositioned:L,middlewareData:F}=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:a=[],platform:o,elements:{reference:i,floating:s}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[d,f]=n.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[m,p]=n.useState(a);pv(m,a)||p(a);const[g,y]=n.useState(null),[v,b]=n.useState(null),w=n.useCallback(e=>{e!==T.current&&(T.current=e,y(e))},[]),S=n.useCallback(e=>{e!==A.current&&(A.current=e,b(e))},[]),x=i||g,k=s||v,T=n.useRef(null),A=n.useRef(null),E=n.useRef(d),C=null!=c,N=vv(c),_=vv(o),R=vv(u),O=n.useCallback(()=>{if(!T.current||!A.current)return;const e={placement:t,strategy:r,middleware:m};_.current&&(e.platform=_.current),mv(T.current,A.current,e).then(e=>{const t={...e,isPositioned:!1!==R.current};D.current&&!pv(E.current,t)&&(E.current=t,h.flushSync(()=>{f(t)}))})},[m,t,r,_,R]);hv(()=>{!1===u&&E.current.isPositioned&&(E.current.isPositioned=!1,f(e=>({...e,isPositioned:!1})))},[u]);const D=n.useRef(!1);hv(()=>(D.current=!0,()=>{D.current=!1}),[]),hv(()=>{if(x&&(T.current=x),k&&(A.current=k),x&&k){if(N.current)return N.current(x,k,O);O()}},[x,k,O,N,C]);const M=n.useMemo(()=>({reference:T,floating:A,setReference:w,setFloating:S}),[w,S]),P=n.useMemo(()=>({reference:x,floating:k}),[x,k]),I=n.useMemo(()=>{const e={position:r,left:0,top:0};if(!P.floating)return e;const t=yv(P.floating,d.x),n=yv(P.floating,d.y);return l?{...e,transform:"translate("+t+"px, "+n+"px)",...gv(P.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}},[r,l,P.floating,d.x,d.y]);return n.useMemo(()=>({...d,update:O,refs:M,elements:P,floatingStyles:I}),[d,O,M,P,I])}({strategy:"fixed",placement:N,whileElementsMounted:(...e)=>ov(...e,{animationFrame:"always"===g}),elements:{reference:b.anchor},middleware:[wv({mainAxis:i+C,alignmentAxis:l}),u&&Sv({mainAxis:!0,crossAxis:!1,limiter:"partial"===m?xv():void 0,...D}),u&&kv({...D}),Tv({...D,apply:({elements:e,rects:t,availableWidth:r,availableHeight:n})=>{const{width:a,height:o}=t.reference,i=e.floating.style;i.setProperty("--radix-popper-available-width",`${r}px`),i.setProperty("--radix-popper-available-height",`${n}px`),i.setProperty("--radix-popper-anchor-width",`${a}px`),i.setProperty("--radix-popper-anchor-height",`${o}px`)}}),k&&Ev({element:k,padding:c}),Zv({arrowWidth:E,arrowHeight:C}),p&&Av({strategy:"referenceHidden",...D})]}),[z,U]=Hv(I),V=ju(y);Wu(()=>{L&&V?.()},[L,V]);const j=F.arrow?.x,$=F.arrow?.y,W=0!==F.arrow?.centerOffset,[B,Z]=n.useState();return Wu(()=>{w&&Z(window.getComputedStyle(w).zIndex)},[w]),e("div",{ref:M.setFloating,"data-radix-popper-content-wrapper":"",style:{...P,transform:L?P.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:B,"--radix-popper-transform-origin":[F.transformOrigin?.x,F.transformOrigin?.y].join(" "),...F.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:e(zv,{scope:a,placedSide:z,onArrowChange:T,arrowX:j,arrowY:$,shouldHideArrow:W,children:e(Ri.div,{"data-side":z,"data-align":U,...v,ref:x,style:{...v.style,animation:L?void 0:"none"}})})})});Vv.displayName=Fv;var jv="PopperArrow",$v={top:"bottom",right:"left",bottom:"top",left:"right"},Wv=n.forwardRef(function(t,r){const{__scopePopper:n,...a}=t,o=Uv(jv,n),i=$v[o.placedSide];return e("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[i]: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(Nv,{...a,ref:r,style:{...a.style,display:"block"}})})});function Bv(e){return null!==e}Wv.displayName=jv;var Zv=e=>({name:"transformOrigin",options:e,fn(t){const{placement:r,rects:n,middlewareData:a}=t,o=0!==a.arrow?.centerOffset,i=o?0:e.arrowWidth,s=o?0:e.arrowHeight,[l,c]=Hv(r),u={start:"0%",center:"50%",end:"100%"}[c],d=(a.arrow?.x??0)+i/2,f=(a.arrow?.y??0)+s/2;let m="",h="";return"bottom"===l?(m=o?u:`${d}px`,h=-s+"px"):"top"===l?(m=o?u:`${d}px`,h=`${n.floating.height+s}px`):"right"===l?(m=-s+"px",h=o?u:`${f}px`):"left"===l&&(m=`${n.floating.width+s}px`,h=o?u:`${f}px`),{data:{x:m,y:h}}}});function Hv(e){const[t,r="center"]=e.split("-");return[t,r]}var Gv=Pv,Kv=Lv,qv=Vv,Jv=Wv,Yv="Popover",[Xv,Qv]=Uu(Yv,[Ov]),eb=Ov(),[tb,rb]=Xv(Yv),nb=t=>{const{__scopePopover:r,children:a,open:o,defaultOpen:i,onOpenChange:s,modal:l=!1}=t,c=eb(r),u=n.useRef(null),[d,f]=n.useState(!1),[m,h]=bd({prop:o,defaultProp:i??!1,onChange:s,caller:Yv});return e(Gv,{...c,children:e(tb,{scope:r,contentId:yd(),triggerRef:u,open:m,onOpenChange:h,onOpenToggle:n.useCallback(()=>h(e=>!e),[h]),hasCustomAnchor:d,onCustomAnchorAdd:n.useCallback(()=>f(!0),[]),onCustomAnchorRemove:n.useCallback(()=>f(!1),[]),modal:l,children:a})})};nb.displayName=Yv;var ab="PopoverAnchor";n.forwardRef((t,r)=>{const{__scopePopover:a,...o}=t,i=rb(ab,a),s=eb(a),{onCustomAnchorAdd:l,onCustomAnchorRemove:c}=i;return n.useEffect(()=>(l(),()=>c()),[l,c]),e(Kv,{...s,...o,ref:r})}).displayName=ab;var ob="PopoverTrigger",ib=n.forwardRef((t,r)=>{const{__scopePopover:n,...a}=t,o=rb(ob,n),i=eb(n),s=Yo(r,o.triggerRef),l=e(Ri.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":vb(o.open),...a,ref:s,onClick:hd(t.onClick,o.onOpenToggle)});return o.hasCustomAnchor?l:e(Kv,{asChild:!0,...i,children:l})});ib.displayName=ob;var sb="PopoverPortal",[lb,cb]=Xv(sb,{forceMount:void 0}),ub=t=>{const{__scopePopover:r,forceMount:n,children:a,container:o}=t,i=rb(sb,r);return e(lb,{scope:r,forceMount:n,children:e(Ud,{present:n||i.open,children:e(zd,{asChild:!0,container:o,children:a})})})};ub.displayName=sb;var db="PopoverContent",fb=n.forwardRef((t,r)=>{const n=cb(db,t.__scopePopover),{forceMount:a=n.forceMount,...o}=t,i=rb(db,t.__scopePopover);return e(Ud,{present:a||i.open,children:i.modal?e(hb,{...o,ref:r}):e(pb,{...o,ref:r})})});fb.displayName=db;var mb=Xo("PopoverContent.RemoveScroll"),hb=n.forwardRef((t,r)=>{const a=rb(db,t.__scopePopover),o=n.useRef(null),i=Yo(r,o),s=n.useRef(!1);return n.useEffect(()=>{const e=o.current;if(e)return zf(e)},[]),e(Of,{as:mb,allowPinchZoom:!0,children:e(gb,{...t,ref:i,trapFocus:a.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:hd(t.onCloseAutoFocus,e=>{e.preventDefault(),s.current||a.triggerRef.current?.focus()}),onPointerDownOutside:hd(t.onPointerDownOutside,e=>{const t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey,n=2===t.button||r;s.current=n},{checkForDefaultPrevented:!1}),onFocusOutside:hd(t.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),pb=n.forwardRef((t,r)=>{const a=rb(db,t.__scopePopover),o=n.useRef(!1),i=n.useRef(!1);return e(gb,{...t,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:e=>{t.onCloseAutoFocus?.(e),e.defaultPrevented||(o.current||a.triggerRef.current?.focus(),e.preventDefault()),o.current=!1,i.current=!1},onInteractOutside:e=>{t.onInteractOutside?.(e),e.defaultPrevented||(o.current=!0,"pointerdown"===e.detail.originalEvent.type&&(i.current=!0));const r=e.target,n=a.triggerRef.current?.contains(r);n&&e.preventDefault(),"focusin"===e.detail.originalEvent.type&&i.current&&e.preventDefault()}})}),gb=n.forwardRef((t,r)=>{const{__scopePopover:n,trapFocus:a,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onInteractOutside:d,...f}=t,m=rb(db,n),h=eb(n);return $d(),e(Od,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:o,onUnmountAutoFocus:i,children:e(Ad,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:d,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onDismiss:()=>m.onOpenChange(!1),children:e(qv,{"data-state":vb(m.open),role:"dialog",id:m.contentId,...h,...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)"}})})})}),yb="PopoverClose";n.forwardRef((t,r)=>{const{__scopePopover:n,...a}=t,o=rb(yb,n);return e(Ri.button,{type:"button",...a,ref:r,onClick:hd(t.onClick,()=>o.onOpenChange(!1))})}).displayName=yb;function vb(e){return e?"open":"closed"}n.forwardRef((t,r)=>{const{__scopePopover:n,...a}=t,o=eb(n);return e(Jv,{...o,...a,ref:r})}).displayName="PopoverArrow";var bb=ub,wb=fb;const Sb=nb,xb=ib,kb=n.forwardRef(({className:t,align:r="center",sideOffset:a=4,...o},i)=>{const{container:s}=n.useContext(ue);return e(bb,{container:s,children:e(wb,{ref:i,align:r,sideOffset:a,className:Ko("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})})});kb.displayName=wb.displayName;const Tb={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"},Ab={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"},Eb=[{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=Ab[e.code]||"USD",r=Tb[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 Cb(t){const[n,a]=f(t.value||""),[o,i]=f(!1),s=Eb.find(e=>e.value==n);return r(Sb,{open:o,onOpenChange:i,children:[e(xb,{asChild:!0,children:r(_i,{variant:"outline",role:"combobox","aria-expanded":o,className:"justify-between overflow-hidden text-ellipsis",children:[s?.text&&r("div",{children:[String(s.text).trim(),e("span",{className:"ml-2 text-xs text-muted-foreground",children:s.flag})]}),!s&&e("span",{className:"text-muted-foreground",children:"Choose country"}),e(pi,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),e(kb,{className:"p-0 overflow-hidden text-ellipsis",children:r(Mg,{children:[e(Pg,{placeholder:"Choose country..."}),e(Ig,{children:e(Lg,{children:Eb.map(o=>r(Fg,{className:Ko("whitespace-nowrap text-left",{"text-green-500":n===o.value}),value:o.value,defaultValue:o.value,onSelect:e=>{const r=o.value;a(r),t.onChange&&"function"==typeof t.onChange&&t.onChange(r),i(!1)},children:[n===o.value&&e(hi,{className:Ko("mr-2 h-4 w-4 text-green-400",n===o.value?"opacity-100":"opacity-0")}),String(o.text).trim(),e("span",{className:"ml-2 text-xs text-muted-foreground",children:o.flag})]},o.value))})})]})})]})}const Nb=Eb.map(e=>({value:e.currencyCode,text:e.currencyCode,icon:e.currencyIcon??null})),_b=Array.from(new Set(Nb.map(e=>e.value))).map(e=>Nb.find(t=>t.value===e)).filter(e=>void 0!==e);function Rb(t){const[n,a]=f(t.value||""),[o,i]=f(!1),s=_b.find(e=>e.value==n);return r(Sb,{open:o,onOpenChange:i,children:[e(xb,{asChild:!0,children:r(_i,{variant:"outline",role:"combobox","aria-expanded":o,className:"justify-between overflow-hidden text-ellipsis",children:[s?.text&&r("div",{children:[String(s.text).trim(),e("span",{className:"ml-2 text-xs text-muted-foreground",children:s.icon})]}),!s&&e("span",{className:"text-muted-foreground",children:"Choose Currency"}),e(pi,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),e(kb,{className:"p-0 overflow-hidden text-ellipsis",children:r(Mg,{children:[e(Pg,{placeholder:"Choose currency..."}),e(Ig,{children:e(Lg,{children:_b.map(o=>r(Fg,{className:Ko("whitespace-nowrap text-left",{"text-green-500":n===o.value}),value:o.value,defaultValue:o.value,onSelect:e=>{const r=o.value;a(r),t.onChange&&"function"==typeof t.onChange&&t.onChange(r),i(!1)},children:[n===o.value&&e(hi,{className:Ko("mr-2 h-4 w-4 text-green-400",n===o.value?"opacity-100":"opacity-0")}),String(o.text).trim(),e("span",{className:"ml-2 text-xs text-muted-foreground",children:o.icon})]},o.value))})})]})})]})}class Ob extends Error{}class Db extends Ob{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class Mb extends Ob{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class Pb extends Ob{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class Ib extends Ob{}class Lb extends Ob{constructor(e){super(`Invalid unit ${e}`)}}class Fb extends Ob{}class zb extends Ob{constructor(){super("Zone is an abstract class")}}const Ub="numeric",Vb="short",jb="long",$b={year:Ub,month:Ub,day:Ub},Wb={year:Ub,month:Vb,day:Ub},Bb={year:Ub,month:Vb,day:Ub,weekday:Vb},Zb={year:Ub,month:jb,day:Ub},Hb={year:Ub,month:jb,day:Ub,weekday:jb},Gb={hour:Ub,minute:Ub},Kb={hour:Ub,minute:Ub,second:Ub},qb={hour:Ub,minute:Ub,second:Ub,timeZoneName:Vb},Jb={hour:Ub,minute:Ub,second:Ub,timeZoneName:jb},Yb={hour:Ub,minute:Ub,hourCycle:"h23"},Xb={hour:Ub,minute:Ub,second:Ub,hourCycle:"h23"},Qb={hour:Ub,minute:Ub,second:Ub,hourCycle:"h23",timeZoneName:Vb},ew={hour:Ub,minute:Ub,second:Ub,hourCycle:"h23",timeZoneName:jb},tw={year:Ub,month:Ub,day:Ub,hour:Ub,minute:Ub},rw={year:Ub,month:Ub,day:Ub,hour:Ub,minute:Ub,second:Ub},nw={year:Ub,month:Vb,day:Ub,hour:Ub,minute:Ub},aw={year:Ub,month:Vb,day:Ub,hour:Ub,minute:Ub,second:Ub},ow={year:Ub,month:Vb,day:Ub,weekday:Vb,hour:Ub,minute:Ub},iw={year:Ub,month:jb,day:Ub,hour:Ub,minute:Ub,timeZoneName:Vb},sw={year:Ub,month:jb,day:Ub,hour:Ub,minute:Ub,second:Ub,timeZoneName:Vb},lw={year:Ub,month:jb,day:Ub,weekday:jb,hour:Ub,minute:Ub,timeZoneName:jb},cw={year:Ub,month:jb,day:Ub,weekday:jb,hour:Ub,minute:Ub,second:Ub,timeZoneName:jb};class uw{get type(){throw new zb}get name(){throw new zb}get ianaName(){return this.name}get isUniversal(){throw new zb}offsetName(e,t){throw new zb}formatOffset(e,t){throw new zb}offset(e){throw new zb}equals(e){throw new zb}get isValid(){throw new zb}}let dw=null;class fw extends uw{static get instance(){return null===dw&&(dw=new fw),dw}get type(){return"system"}get name(){return(new Intl.DateTimeFormat).resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:r}){return DS(e,t,r)}formatOffset(e,t){return LS(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return"system"===e.type}get isValid(){return!0}}const mw=new Map;const hw={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};const pw=new Map;class gw extends uw{static create(e){let t=pw.get(e);return void 0===t&&pw.set(e,t=new gw(e)),t}static resetCache(){pw.clear(),mw.clear()}static isValidSpecifier(e){return this.isValidZone(e)}static isValidZone(e){if(!e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}).format(),!0}catch(e){return!1}}constructor(e){super(),this.zoneName=e,this.valid=gw.isValidZone(e)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(e,{format:t,locale:r}){return DS(e,t,r,this.name)}formatOffset(e,t){return LS(this.offset(e),t)}offset(e){if(!this.valid)return NaN;const t=new Date(e);if(isNaN(t))return NaN;const r=function(e){let t=mw.get(e);return void 0===t&&(t=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"}),mw.set(e,t)),t}(this.name);let[n,a,o,i,s,l,c]=r.formatToParts?function(e,t){const r=e.formatToParts(t),n=[];for(let e=0;e<r.length;e++){const{type:t,value:a}=r[e],o=hw[t];"era"===t?n[o]=a:dS(o)||(n[o]=parseInt(a,10))}return n}(r,t):function(e,t){const r=e.format(t).replace(/\u200E/g,""),n=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(r),[,a,o,i,s,l,c,u]=n;return[i,a,o,s,l,c,u]}(r,t);"BC"===i&&(n=1-Math.abs(n));let u=+t;const d=u%1e3;return u-=d>=0?d:1e3+d,(NS({year:n,month:a,day:o,hour:24===s?0:s,minute:l,second:c,millisecond:0})-u)/6e4}equals(e){return"iana"===e.type&&e.name===this.name}get isValid(){return this.valid}}let yw={};const vw=new Map;function bw(e,t={}){const r=JSON.stringify([e,t]);let n=vw.get(r);return void 0===n&&(n=new Intl.DateTimeFormat(e,t),vw.set(r,n)),n}const ww=new Map;const Sw=new Map;let xw=null;const kw=new Map;function Tw(e){let t=kw.get(e);return void 0===t&&(t=new Intl.DateTimeFormat(e).resolvedOptions(),kw.set(e,t)),t}const Aw=new Map;function Ew(e,t,r,n){const a=e.listingMode();return"error"===a?null:"en"===a?r(t):n(t)}class Cw{constructor(e,t,r){this.padTo=r.padTo||0,this.floor=r.floor||!1;const{padTo:n,floor:a,...o}=r;if(!t||Object.keys(o).length>0){const t={useGrouping:!1,...r};r.padTo>0&&(t.minimumIntegerDigits=r.padTo),this.inf=function(e,t={}){const r=JSON.stringify([e,t]);let n=ww.get(r);return void 0===n&&(n=new Intl.NumberFormat(e,t),ww.set(r,n)),n}(e,t)}}format(e){if(this.inf){const t=this.floor?Math.floor(e):e;return this.inf.format(t)}return wS(this.floor?Math.floor(e):TS(e,3),this.padTo)}}class Nw{constructor(e,t,r){let n;if(this.opts=r,this.originalZone=void 0,this.opts.timeZone)this.dt=e;else if("fixed"===e.zone.type){const t=e.offset/60*-1,r=t>=0?`Etc/GMT+${t}`:`Etc/GMT${t}`;0!==e.offset&&gw.create(r).valid?(n=r,this.dt=e):(n="UTC",this.dt=0===e.offset?e:e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone)}else"system"===e.zone.type?this.dt=e:"iana"===e.zone.type?(this.dt=e,n=e.zone.name):(n="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);const a={...this.opts};a.timeZone=a.timeZone||n,this.dtf=bw(t,a)}format(){return this.originalZone?this.formatToParts().map(({value:e})=>e).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const e=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?e.map(e=>{if("timeZoneName"===e.type){const t=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...e,value:t}}return e}):e}resolvedOptions(){return this.dtf.resolvedOptions()}}class _w{constructor(e,t,r){this.opts={style:"long",...r},!t&&hS()&&(this.rtf=function(e,t={}){const{base:r,...n}=t,a=JSON.stringify([e,n]);let o=Sw.get(a);return void 0===o&&(o=new Intl.RelativeTimeFormat(e,t),Sw.set(a,o)),o}(e,r))}format(e,t){return this.rtf?this.rtf.format(e,t):function(e,t,r="always",n=!1){const a={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},o=-1===["hours","minutes","seconds"].indexOf(e);if("auto"===r&&o){const r="days"===e;switch(t){case 1:return r?"tomorrow":`next ${a[e][0]}`;case-1:return r?"yesterday":`last ${a[e][0]}`;case 0:return r?"today":`this ${a[e][0]}`}}const i=Object.is(t,-0)||t<0,s=Math.abs(t),l=1===s,c=a[e],u=n?l?c[1]:c[2]||c[1]:l?a[e][0]:e;return i?`${s} ${u} ago`:`in ${s} ${u}`}(t,e,this.opts.numeric,"long"!==this.opts.style)}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}const Rw={firstDay:1,minimalDays:4,weekend:[6,7]};class Ow{static fromOpts(e){return Ow.create(e.locale,e.numberingSystem,e.outputCalendar,e.weekSettings,e.defaultToEN)}static create(e,t,r,n,a=!1){const o=e||qw.defaultLocale,i=o||(a?"en-US":xw||(xw=(new Intl.DateTimeFormat).resolvedOptions().locale,xw)),s=t||qw.defaultNumberingSystem,l=r||qw.defaultOutputCalendar,c=vS(n)||qw.defaultWeekSettings;return new Ow(i,s,l,c,o)}static resetCache(){xw=null,vw.clear(),ww.clear(),Sw.clear(),kw.clear(),Aw.clear()}static fromObject({locale:e,numberingSystem:t,outputCalendar:r,weekSettings:n}={}){return Ow.create(e,t,r,n)}constructor(e,t,r,n,a){const[o,i,s]=function(e){const t=e.indexOf("-x-");-1!==t&&(e=e.substring(0,t));const r=e.indexOf("-u-");if(-1===r)return[e];{let t,n;try{t=bw(e).resolvedOptions(),n=e}catch(a){const o=e.substring(0,r);t=bw(o).resolvedOptions(),n=o}const{numberingSystem:a,calendar:o}=t;return[n,a,o]}}(e);this.locale=o,this.numberingSystem=t||i||null,this.outputCalendar=r||s||null,this.weekSettings=n,this.intl=function(e,t,r){return r||t?(e.includes("-u-")||(e+="-u"),r&&(e+=`-ca-${r}`),t&&(e+=`-nu-${t}`),e):e}(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=a,this.fastNumbersCached=null}get fastNumbers(){var e;return null==this.fastNumbersCached&&(this.fastNumbersCached=(!(e=this).numberingSystem||"latn"===e.numberingSystem)&&("latn"===e.numberingSystem||!e.locale||e.locale.startsWith("en")||"latn"===Tw(e.locale).numberingSystem)),this.fastNumbersCached}listingMode(){const e=this.isEnglish(),t=!(null!==this.numberingSystem&&"latn"!==this.numberingSystem||null!==this.outputCalendar&&"gregory"!==this.outputCalendar);return e&&t?"en":"intl"}clone(e){return e&&0!==Object.getOwnPropertyNames(e).length?Ow.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,vS(e.weekSettings)||this.weekSettings,e.defaultToEN||!1):this}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,t=!1){return Ew(this,e,jS,()=>{const r="ja"===this.intl||this.intl.startsWith("ja-"),n=(t&=!r)?{month:e,day:"numeric"}:{month:e},a=t?"format":"standalone";if(!this.monthsCache[a][e]){const t=r?e=>this.dtFormatter(e,n).format():e=>this.extract(e,n,"month");this.monthsCache[a][e]=function(e){const t=[];for(let r=1;r<=12;r++){const n=Hk.utc(2009,r,1);t.push(e(n))}return t}(t)}return this.monthsCache[a][e]})}weekdays(e,t=!1){return Ew(this,e,ZS,()=>{const r=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},n=t?"format":"standalone";return this.weekdaysCache[n][e]||(this.weekdaysCache[n][e]=function(e){const t=[];for(let r=1;r<=7;r++){const n=Hk.utc(2016,11,13+r);t.push(e(n))}return t}(e=>this.extract(e,r,"weekday"))),this.weekdaysCache[n][e]})}meridiems(){return Ew(this,void 0,()=>HS,()=>{if(!this.meridiemCache){const e={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[Hk.utc(2016,11,13,9),Hk.utc(2016,11,13,19)].map(t=>this.extract(t,e,"dayperiod"))}return this.meridiemCache})}eras(e){return Ew(this,e,JS,()=>{const t={era:e};return this.eraCache[e]||(this.eraCache[e]=[Hk.utc(-40,1,1),Hk.utc(2017,1,1)].map(e=>this.extract(e,t,"era"))),this.eraCache[e]})}extract(e,t,r){const n=this.dtFormatter(e,t).formatToParts().find(e=>e.type.toLowerCase()===r);return n?n.value:null}numberFormatter(e={}){return new Cw(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new Nw(e,this.intl,t)}relFormatter(e={}){return new _w(this.intl,this.isEnglish(),e)}listFormatter(e={}){return function(e,t={}){const r=JSON.stringify([e,t]);let n=yw[r];return n||(n=new Intl.ListFormat(e,t),yw[r]=n),n}(this.intl,e)}isEnglish(){return"en"===this.locale||"en-us"===this.locale.toLowerCase()||Tw(this.intl).locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:pS()?function(e){let t=Aw.get(e);if(!t){const r=new Intl.Locale(e);t="getWeekInfo"in r?r.getWeekInfo():r.weekInfo,"minimalDays"in t||(t={...Rw,...t}),Aw.set(e,t)}return t}(this.locale):Rw}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}}let Dw=null;class Mw extends uw{static get utcInstance(){return null===Dw&&(Dw=new Mw(0)),Dw}static instance(e){return 0===e?Mw.utcInstance:new Mw(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new Mw(MS(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return 0===this.fixed?"UTC":`UTC${LS(this.fixed,"narrow")}`}get ianaName(){return 0===this.fixed?"Etc/UTC":`Etc/GMT${LS(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return LS(this.fixed,t)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return"fixed"===e.type&&e.fixed===this.fixed}get isValid(){return!0}}class Pw extends uw{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function Iw(e,t){if(dS(e)||null===e)return t;if(e instanceof uw)return e;if(function(e){return"string"==typeof e}(e)){const r=e.toLowerCase();return"default"===r?t:"local"===r||"system"===r?fw.instance:"utc"===r||"gmt"===r?Mw.utcInstance:Mw.parseSpecifier(r)||gw.create(e)}return fS(e)?Mw.instance(e):"object"==typeof e&&"offset"in e&&"function"==typeof e.offset?e:new Pw(e)}const Lw={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},Fw={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},zw=Lw.hanidec.replace(/[\[|\]]/g,"").split("");const Uw=new Map;function Vw({numberingSystem:e},t=""){const r=e||"latn";let n=Uw.get(r);void 0===n&&(n=new Map,Uw.set(r,n));let a=n.get(t);return void 0===a&&(a=new RegExp(`${Lw[r]}${t}`),n.set(t,a)),a}let jw,$w=()=>Date.now(),Ww="system",Bw=null,Zw=null,Hw=null,Gw=60,Kw=null;class qw{static get now(){return $w}static set now(e){$w=e}static set defaultZone(e){Ww=e}static get defaultZone(){return Iw(Ww,fw.instance)}static get defaultLocale(){return Bw}static set defaultLocale(e){Bw=e}static get defaultNumberingSystem(){return Zw}static set defaultNumberingSystem(e){Zw=e}static get defaultOutputCalendar(){return Hw}static set defaultOutputCalendar(e){Hw=e}static get defaultWeekSettings(){return Kw}static set defaultWeekSettings(e){Kw=vS(e)}static get twoDigitCutoffYear(){return Gw}static set twoDigitCutoffYear(e){Gw=e%100}static get throwOnInvalid(){return jw}static set throwOnInvalid(e){jw=e}static resetCaches(){Ow.resetCache(),gw.resetCache(),Hk.resetCache(),Uw.clear()}}class Jw{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const Yw=[0,31,59,90,120,151,181,212,243,273,304,334],Xw=[0,31,60,91,121,152,182,213,244,274,305,335];function Qw(e,t){return new Jw("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function eS(e,t,r){const n=new Date(Date.UTC(e,t-1,r));e<100&&e>=0&&n.setUTCFullYear(n.getUTCFullYear()-1900);const a=n.getUTCDay();return 0===a?7:a}function tS(e,t,r){return r+(AS(e)?Xw:Yw)[t-1]}function rS(e,t){const r=AS(e)?Xw:Yw,n=r.findIndex(e=>e<t);return{month:n+1,day:t-r[n]}}function nS(e,t){return(e-t+7)%7+1}function aS(e,t=4,r=1){const{year:n,month:a,day:o}=e,i=tS(n,a,o),s=nS(eS(n,a,o),r);let l,c=Math.floor((i-s+14-t)/7);return c<1?(l=n-1,c=RS(l,t,r)):c>RS(n,t,r)?(l=n+1,c=1):l=n,{weekYear:l,weekNumber:c,weekday:s,...FS(e)}}function oS(e,t=4,r=1){const{weekYear:n,weekNumber:a,weekday:o}=e,i=nS(eS(n,1,t),r),s=ES(n);let l,c=7*a+o-i-7+t;c<1?(l=n-1,c+=ES(l)):c>s?(l=n+1,c-=ES(n)):l=n;const{month:u,day:d}=rS(l,c);return{year:l,month:u,day:d,...FS(e)}}function iS(e){const{year:t,month:r,day:n}=e;return{year:t,ordinal:tS(t,r,n),...FS(e)}}function sS(e){const{year:t,ordinal:r}=e,{month:n,day:a}=rS(t,r);return{year:t,month:n,day:a,...FS(e)}}function lS(e,t){if(!dS(e.localWeekday)||!dS(e.localWeekNumber)||!dS(e.localWeekYear)){if(!dS(e.weekday)||!dS(e.weekNumber)||!dS(e.weekYear))throw new Ib("Cannot mix locale-based week fields with ISO-based week fields");return dS(e.localWeekday)||(e.weekday=e.localWeekday),dS(e.localWeekNumber)||(e.weekNumber=e.localWeekNumber),dS(e.localWeekYear)||(e.weekYear=e.localWeekYear),delete e.localWeekday,delete e.localWeekNumber,delete e.localWeekYear,{minDaysInFirstWeek:t.getMinDaysInFirstWeek(),startOfWeek:t.getStartOfWeek()}}return{minDaysInFirstWeek:4,startOfWeek:1}}function cS(e){const t=mS(e.year),r=bS(e.month,1,12),n=bS(e.day,1,CS(e.year,e.month));return t?r?!n&&Qw("day",e.day):Qw("month",e.month):Qw("year",e.year)}function uS(e){const{hour:t,minute:r,second:n,millisecond:a}=e,o=bS(t,0,23)||24===t&&0===r&&0===n&&0===a,i=bS(r,0,59),s=bS(n,0,59),l=bS(a,0,999);return o?i?s?!l&&Qw("millisecond",a):Qw("second",n):Qw("minute",r):Qw("hour",t)}function dS(e){return void 0===e}function fS(e){return"number"==typeof e}function mS(e){return"number"==typeof e&&e%1==0}function hS(){try{return"undefined"!=typeof Intl&&!!Intl.RelativeTimeFormat}catch(e){return!1}}function pS(){try{return"undefined"!=typeof Intl&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch(e){return!1}}function gS(e,t,r){if(0!==e.length)return e.reduce((e,n)=>{const a=[t(n),n];return e&&r(e[0],a[0])===e[0]?e:a},null)[1]}function yS(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function vS(e){if(null==e)return null;if("object"!=typeof e)throw new Fb("Week settings must be an object");if(!bS(e.firstDay,1,7)||!bS(e.minimalDays,1,7)||!Array.isArray(e.weekend)||e.weekend.some(e=>!bS(e,1,7)))throw new Fb("Invalid week settings");return{firstDay:e.firstDay,minimalDays:e.minimalDays,weekend:Array.from(e.weekend)}}function bS(e,t,r){return mS(e)&&e>=t&&e<=r}function wS(e,t=2){let r;return r=e<0?"-"+(""+-e).padStart(t,"0"):(""+e).padStart(t,"0"),r}function SS(e){return dS(e)||null===e||""===e?void 0:parseInt(e,10)}function xS(e){return dS(e)||null===e||""===e?void 0:parseFloat(e)}function kS(e){if(!dS(e)&&null!==e&&""!==e){const t=1e3*parseFloat("0."+e);return Math.floor(t)}}function TS(e,t,r="round"){const n=10**t;switch(r){case"expand":return e>0?Math.ceil(e*n)/n:Math.floor(e*n)/n;case"trunc":return Math.trunc(e*n)/n;case"round":return Math.round(e*n)/n;case"floor":return Math.floor(e*n)/n;case"ceil":return Math.ceil(e*n)/n;default:throw new RangeError(`Value rounding ${r} is out of range`)}}function AS(e){return e%4==0&&(e%100!=0||e%400==0)}function ES(e){return AS(e)?366:365}function CS(e,t){const r=function(e,t){return e-t*Math.floor(e/t)}(t-1,12)+1;return 2===r?AS(e+(t-r)/12)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][r-1]}function NS(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(e.year,e.month-1,e.day)),+t}function _S(e,t,r){return-nS(eS(e,1,t),r)+t-1}function RS(e,t=4,r=1){const n=_S(e,t,r),a=_S(e+1,t,r);return(ES(e)-n+a)/7}function OS(e){return e>99?e:e>qw.twoDigitCutoffYear?1900+e:2e3+e}function DS(e,t,r,n=null){const a=new Date(e),o={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};n&&(o.timeZone=n);const i={timeZoneName:t,...o},s=new Intl.DateTimeFormat(r,i).formatToParts(a).find(e=>"timezonename"===e.type.toLowerCase());return s?s.value:null}function MS(e,t){let r=parseInt(e,10);Number.isNaN(r)&&(r=0);const n=parseInt(t,10)||0;return 60*r+(r<0||Object.is(r,-0)?-n:n)}function PS(e){const t=Number(e);if("boolean"==typeof e||""===e||!Number.isFinite(t))throw new Fb(`Invalid unit value ${e}`);return t}function IS(e,t){const r={};for(const n in e)if(yS(e,n)){const a=e[n];if(null==a)continue;r[t(n)]=PS(a)}return r}function LS(e,t){const r=Math.trunc(Math.abs(e/60)),n=Math.trunc(Math.abs(e%60)),a=e>=0?"+":"-";switch(t){case"short":return`${a}${wS(r,2)}:${wS(n,2)}`;case"narrow":return`${a}${r}${n>0?`:${n}`:""}`;case"techie":return`${a}${wS(r,2)}${wS(n,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function FS(e){return function(e,t){return t.reduce((t,r)=>(t[r]=e[r],t),{})}(e,["hour","minute","second","millisecond"])}const zS=["January","February","March","April","May","June","July","August","September","October","November","December"],US=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],VS=["J","F","M","A","M","J","J","A","S","O","N","D"];function jS(e){switch(e){case"narrow":return[...VS];case"short":return[...US];case"long":return[...zS];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const $S=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],WS=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],BS=["M","T","W","T","F","S","S"];function ZS(e){switch(e){case"narrow":return[...BS];case"short":return[...WS];case"long":return[...$S];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const HS=["AM","PM"],GS=["Before Christ","Anno Domini"],KS=["BC","AD"],qS=["B","A"];function JS(e){switch(e){case"narrow":return[...qS];case"short":return[...KS];case"long":return[...GS];default:return null}}function YS(e,t){let r="";for(const n of e)n.literal?r+=n.val:r+=t(n.val);return r}const XS={D:$b,DD:Wb,DDD:Zb,DDDD:Hb,t:Gb,tt:Kb,ttt:qb,tttt:Jb,T:Yb,TT:Xb,TTT:Qb,TTTT:ew,f:tw,ff:nw,fff:iw,ffff:lw,F:rw,FF:aw,FFF:sw,FFFF:cw};class QS{static create(e,t={}){return new QS(e,t)}static parseFormat(e){let t=null,r="",n=!1;const a=[];for(let o=0;o<e.length;o++){const i=e.charAt(o);"'"===i?((r.length>0||n)&&a.push({literal:n||/^\s+$/.test(r),val:""===r?"'":r}),t=null,r="",n=!n):n||i===t?r+=i:(r.length>0&&a.push({literal:/^\s+$/.test(r),val:r}),r=i,t=i)}return r.length>0&&a.push({literal:n||/^\s+$/.test(r),val:r}),a}static macroTokenToFormatOpts(e){return XS[e]}constructor(e,t){this.opts=t,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,t){null===this.systemLoc&&(this.systemLoc=this.loc.redefaultToSystem());return this.systemLoc.dtFormatter(e,{...this.opts,...t}).format()}dtFormatter(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t})}formatDateTime(e,t){return this.dtFormatter(e,t).format()}formatDateTimeParts(e,t){return this.dtFormatter(e,t).formatToParts()}formatInterval(e,t){return this.dtFormatter(e.start,t).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())}resolvedOptions(e,t){return this.dtFormatter(e,t).resolvedOptions()}num(e,t=0,r=void 0){if(this.opts.forceSimple)return wS(e,t);const n={...this.opts};return t>0&&(n.padTo=t),r&&(n.signDisplay=r),this.loc.numberFormatter(n).format(e)}formatDateTimeFromString(e,t){const r="en"===this.loc.listingMode(),n=this.loc.outputCalendar&&"gregory"!==this.loc.outputCalendar,a=(t,r)=>this.loc.extract(e,t,r),o=t=>e.isOffsetFixed&&0===e.offset&&t.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,t.format):"",i=()=>r?function(e){return HS[e.hour<12?0:1]}(e):a({hour:"numeric",hourCycle:"h12"},"dayperiod"),s=(t,n)=>r?function(e,t){return jS(t)[e.month-1]}(e,t):a(n?{month:t}:{month:t,day:"numeric"},"month"),l=(t,n)=>r?function(e,t){return ZS(t)[e.weekday-1]}(e,t):a(n?{weekday:t}:{weekday:t,month:"long",day:"numeric"},"weekday"),c=t=>{const r=QS.macroTokenToFormatOpts(t);return r?this.formatWithSystemDefault(e,r):t},u=t=>r?function(e,t){return JS(t)[e.year<0?0:1]}(e,t):a({era:t},"era");return YS(QS.parseFormat(t),t=>{switch(t){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12==0?12:e.hour%12);case"hh":return this.num(e.hour%12==0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return o({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return o({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return o({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return i();case"d":return n?a({day:"numeric"},"day"):this.num(e.day);case"dd":return n?a({day:"2-digit"},"day"):this.num(e.day,2);case"c":case"E":return this.num(e.weekday);case"ccc":return l("short",!0);case"cccc":return l("long",!0);case"ccccc":return l("narrow",!0);case"EEE":return l("short",!1);case"EEEE":return l("long",!1);case"EEEEE":return l("narrow",!1);case"L":return n?a({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return n?a({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return s("short",!0);case"LLLL":return s("long",!0);case"LLLLL":return s("narrow",!0);case"M":return n?a({month:"numeric"},"month"):this.num(e.month);case"MM":return n?a({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return s("short",!1);case"MMMM":return s("long",!1);case"MMMMM":return s("narrow",!1);case"y":return n?a({year:"numeric"},"year"):this.num(e.year);case"yy":return n?a({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return n?a({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return n?a({year:"numeric"},"year"):this.num(e.year,6);case"G":return u("short");case"GG":return u("long");case"GGGGG":return u("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"n":return this.num(e.localWeekNumber);case"nn":return this.num(e.localWeekNumber,2);case"ii":return this.num(e.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(e.localWeekYear,4);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return c(t)}})}formatDurationFromString(e,t){const r="negativeLargestOnly"===this.opts.signMode?-1:1,n=e=>{switch(e[0]){case"S":return"milliseconds";case"s":return"seconds";case"m":return"minutes";case"h":return"hours";case"d":return"days";case"w":return"weeks";case"M":return"months";case"y":return"years";default:return null}},a=QS.parseFormat(t),o=a.reduce((e,{literal:t,val:r})=>t?e:e.concat(r),[]),i=e.shiftTo(...o.map(n).filter(e=>e));return YS(a,((e,t)=>a=>{const o=n(a);if(o){const n=t.isNegativeDuration&&o!==t.largestUnit?r:1;let i;return i="negativeLargestOnly"===this.opts.signMode&&o!==t.largestUnit?"never":"all"===this.opts.signMode?"always":"auto",this.num(e.get(o)*n,a.length,i)}return a})(i,{isNegativeDuration:i<0,largestUnit:Object.keys(i.values)[0]}))}}const ex=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function tx(...e){const t=e.reduce((e,t)=>e+t.source,"");return RegExp(`^${t}$`)}function rx(...e){return t=>e.reduce(([e,r,n],a)=>{const[o,i,s]=a(t,n);return[{...e,...o},i||r,s]},[{},null,1]).slice(0,2)}function nx(e,...t){if(null==e)return[null,null];for(const[r,n]of t){const t=r.exec(e);if(t)return n(t)}return[null,null]}function ax(...e){return(t,r)=>{const n={};let a;for(a=0;a<e.length;a++)n[e[a]]=SS(t[r+a]);return[n,null,r+a]}}const ox=/(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/,ix=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,sx=RegExp(`${ix.source}${`(?:${ox.source}?(?:\\[(${ex.source})\\])?)?`}`),lx=RegExp(`(?:[Tt]${sx.source})?`),cx=ax("weekYear","weekNumber","weekDay"),ux=ax("year","ordinal"),dx=RegExp(`${ix.source} ?(?:${ox.source}|(${ex.source}))?`),fx=RegExp(`(?: ${dx.source})?`);function mx(e,t,r){const n=e[t];return dS(n)?r:SS(n)}function hx(e,t){return[{hours:mx(e,t,0),minutes:mx(e,t+1,0),seconds:mx(e,t+2,0),milliseconds:kS(e[t+3])},null,t+4]}function px(e,t){const r=!e[t]&&!e[t+1],n=MS(e[t+1],e[t+2]);return[{},r?null:Mw.instance(n),t+3]}function gx(e,t){return[{},e[t]?gw.create(e[t]):null,t+1]}const yx=RegExp(`^T?${ix.source}$`),vx=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function bx(e){const[t,r,n,a,o,i,s,l,c]=e,u="-"===t[0],d=l&&"-"===l[0],f=(e,t=!1)=>void 0!==e&&(t||e&&u)?-e:e;return[{years:f(xS(r)),months:f(xS(n)),weeks:f(xS(a)),days:f(xS(o)),hours:f(xS(i)),minutes:f(xS(s)),seconds:f(xS(l),"-0"===l),milliseconds:f(kS(c),d)}]}const wx={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Sx(e,t,r,n,a,o,i){const s={year:2===t.length?OS(SS(t)):SS(t),month:US.indexOf(r)+1,day:SS(n),hour:SS(a),minute:SS(o)};return i&&(s.second=SS(i)),e&&(s.weekday=e.length>3?$S.indexOf(e)+1:WS.indexOf(e)+1),s}const xx=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function kx(e){const[,t,r,n,a,o,i,s,l,c,u,d]=e,f=Sx(t,a,n,r,o,i,s);let m;return m=l?wx[l]:c?0:MS(u,d),[f,new Mw(m)]}const Tx=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,Ax=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,Ex=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function Cx(e){const[,t,r,n,a,o,i,s]=e;return[Sx(t,a,n,r,o,i,s),Mw.utcInstance]}function Nx(e){const[,t,r,n,a,o,i,s]=e;return[Sx(t,s,r,n,a,o,i),Mw.utcInstance]}const _x=tx(/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,lx),Rx=tx(/(\d{4})-?W(\d\d)(?:-?(\d))?/,lx),Ox=tx(/(\d{4})-?(\d{3})/,lx),Dx=tx(sx),Mx=rx(function(e,t){return[{year:mx(e,t),month:mx(e,t+1,1),day:mx(e,t+2,1)},null,t+3]},hx,px,gx),Px=rx(cx,hx,px,gx),Ix=rx(ux,hx,px,gx),Lx=rx(hx,px,gx);const Fx=rx(hx);const zx=tx(/(\d{4})-(\d\d)-(\d\d)/,fx),Ux=tx(dx),Vx=rx(hx,px,gx);const jx="Invalid Duration",$x={weeks:{days:7,hours:168,minutes:10080,seconds:604800,milliseconds:6048e5},days:{hours:24,minutes:1440,seconds:86400,milliseconds:864e5},hours:{minutes:60,seconds:3600,milliseconds:36e5},minutes:{seconds:60,milliseconds:6e4},seconds:{milliseconds:1e3}},Wx={years:{quarters:4,months:12,weeks:52,days:365,hours:8760,minutes:525600,seconds:31536e3,milliseconds:31536e6},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:131040,seconds:7862400,milliseconds:78624e5},months:{weeks:4,days:30,hours:720,minutes:43200,seconds:2592e3,milliseconds:2592e6},...$x},Bx=365.2425,Zx=30.436875,Hx={years:{quarters:4,months:12,weeks:52.1775,days:Bx,hours:8765.82,minutes:525949.2,seconds:525949.2*60,milliseconds:525949.2*60*1e3},quarters:{months:3,weeks:13.044375,days:91.310625,hours:2191.455,minutes:131487.3,seconds:525949.2*60/4,milliseconds:7889237999.999999},months:{weeks:4.3481250000000005,days:Zx,hours:730.485,minutes:43829.1,seconds:2629746,milliseconds:2629746e3},...$x},Gx=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],Kx=Gx.slice(0).reverse();function qx(e,t,r=!1){const n={values:r?t.values:{...e.values,...t.values||{}},loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy,matrix:t.matrix||e.matrix};return new Qx(n)}function Jx(e,t){let r=t.milliseconds??0;for(const n of Kx.slice(1))t[n]&&(r+=t[n]*e[n].milliseconds);return r}function Yx(e,t){const r=Jx(e,t)<0?-1:1;Gx.reduceRight((n,a)=>{if(dS(t[a]))return n;if(n){const o=t[n]*r,i=e[a][n],s=Math.floor(o/i);t[a]+=s*r,t[n]-=s*i*r}return a},null),Gx.reduce((r,n)=>{if(dS(t[n]))return r;if(r){const a=t[r]%1;t[r]-=a,t[n]+=a*e[r][n]}return n},null)}function Xx(e){const t={};for(const[r,n]of Object.entries(e))0!==n&&(t[r]=n);return t}class Qx{constructor(e){const t="longterm"===e.conversionAccuracy||!1;let r=t?Hx:Wx;e.matrix&&(r=e.matrix),this.values=e.values,this.loc=e.loc||Ow.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=r,this.isLuxonDuration=!0}static fromMillis(e,t){return Qx.fromObject({milliseconds:e},t)}static fromObject(e,t={}){if(null==e||"object"!=typeof e)throw new Fb("Duration.fromObject: argument expected to be an object, got "+(null===e?"null":typeof e));return new Qx({values:IS(e,Qx.normalizeUnit),loc:Ow.fromObject(t),conversionAccuracy:t.conversionAccuracy,matrix:t.matrix})}static fromDurationLike(e){if(fS(e))return Qx.fromMillis(e);if(Qx.isDuration(e))return e;if("object"==typeof e)return Qx.fromObject(e);throw new Fb(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,t){const[r]=function(e){return nx(e,[vx,bx])}(e);return r?Qx.fromObject(r,t):Qx.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,t){const[r]=function(e){return nx(e,[yx,Fx])}(e);return r?Qx.fromObject(r,t):Qx.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,t=null){if(!e)throw new Fb("need to specify a reason the Duration is invalid");const r=e instanceof Jw?e:new Jw(e,t);if(qw.throwOnInvalid)throw new Pb(r);return new Qx({invalid:r})}static normalizeUnit(e){const t={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e?e.toLowerCase():e];if(!t)throw new Lb(e);return t}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,t={}){const r={...t,floor:!1!==t.round&&!1!==t.floor};return this.isValid?QS.create(this.loc,r).formatDurationFromString(this,e):jx}toHuman(e={}){if(!this.isValid)return jx;const t=!1!==e.showZeros,r=Gx.map(r=>{const n=this.values[r];return dS(n)||0===n&&!t?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:r.slice(0,-1)}).format(n)}).filter(e=>e);return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(r)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return 0!==this.years&&(e+=this.years+"Y"),0===this.months&&0===this.quarters||(e+=this.months+3*this.quarters+"M"),0!==this.weeks&&(e+=this.weeks+"W"),0!==this.days&&(e+=this.days+"D"),0===this.hours&&0===this.minutes&&0===this.seconds&&0===this.milliseconds||(e+="T"),0!==this.hours&&(e+=this.hours+"H"),0!==this.minutes&&(e+=this.minutes+"M"),0===this.seconds&&0===this.milliseconds||(e+=TS(this.seconds+this.milliseconds/1e3,3)+"S"),"P"===e&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;const t=this.toMillis();if(t<0||t>=864e5)return null;e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e,includeOffset:!1};return Hk.fromMillis(t,{zone:"UTC"}).toISOTime(e)}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?Jx(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const t=Qx.fromDurationLike(e),r={};for(const e of Gx)(yS(t.values,e)||yS(this.values,e))&&(r[e]=t.get(e)+this.get(e));return qx(this,{values:r},!0)}minus(e){if(!this.isValid)return this;const t=Qx.fromDurationLike(e);return this.plus(t.negate())}mapUnits(e){if(!this.isValid)return this;const t={};for(const r of Object.keys(this.values))t[r]=PS(e(this.values[r],r));return qx(this,{values:t},!0)}get(e){return this[Qx.normalizeUnit(e)]}set(e){if(!this.isValid)return this;return qx(this,{values:{...this.values,...IS(e,Qx.normalizeUnit)}})}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:r,matrix:n}={}){return qx(this,{loc:this.loc.clone({locale:e,numberingSystem:t}),matrix:n,conversionAccuracy:r})}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return Yx(this.matrix,e),qx(this,{values:e},!0)}rescale(){if(!this.isValid)return this;return qx(this,{values:Xx(this.normalize().shiftToAll().toObject())},!0)}shiftTo(...e){if(!this.isValid)return this;if(0===e.length)return this;e=e.map(e=>Qx.normalizeUnit(e));const t={},r={},n=this.toObject();let a;for(const o of Gx)if(e.indexOf(o)>=0){a=o;let e=0;for(const t in r)e+=this.matrix[t][o]*r[t],r[t]=0;fS(n[o])&&(e+=n[o]);const i=Math.trunc(e);t[o]=i,r[o]=(1e3*e-1e3*i)/1e3}else fS(n[o])&&(r[o]=n[o]);for(const e in r)0!==r[e]&&(t[a]+=e===a?r[e]:r[e]/this.matrix[a][e]);return Yx(this.matrix,t),qx(this,{values:t},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const e={};for(const t of Object.keys(this.values))e[t]=0===this.values[t]?0:-this.values[t];return qx(this,{values:e},!0)}removeZeros(){if(!this.isValid)return this;return qx(this,{values:Xx(this.values)},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return null===this.invalid}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid)return!1;if(!this.loc.equals(e.loc))return!1;function t(e,t){return void 0===e||0===e?void 0===t||0===t:e===t}for(const r of Gx)if(!t(this.values[r],e.values[r]))return!1;return!0}}const ek="Invalid Interval";class tk{constructor(e){this.s=e.start,this.e=e.end,this.invalid=e.invalid||null,this.isLuxonInterval=!0}static invalid(e,t=null){if(!e)throw new Fb("need to specify a reason the Interval is invalid");const r=e instanceof Jw?e:new Jw(e,t);if(qw.throwOnInvalid)throw new Mb(r);return new tk({invalid:r})}static fromDateTimes(e,t){const r=Gk(e),n=Gk(t),a=function(e,t){return e&&e.isValid?t&&t.isValid?t<e?tk.invalid("end before start",`The end of an interval must be after its start, but you had start=${e.toISO()} and end=${t.toISO()}`):null:tk.invalid("missing or invalid end"):tk.invalid("missing or invalid start")}(r,n);return null==a?new tk({start:r,end:n}):a}static after(e,t){const r=Qx.fromDurationLike(t),n=Gk(e);return tk.fromDateTimes(n,n.plus(r))}static before(e,t){const r=Qx.fromDurationLike(t),n=Gk(e);return tk.fromDateTimes(n.minus(r),n)}static fromISO(e,t){const[r,n]=(e||"").split("/",2);if(r&&n){let e,a,o,i;try{e=Hk.fromISO(r,t),a=e.isValid}catch(n){a=!1}try{o=Hk.fromISO(n,t),i=o.isValid}catch(n){i=!1}if(a&&i)return tk.fromDateTimes(e,o);if(a){const r=Qx.fromISO(n,t);if(r.isValid)return tk.after(e,r)}else if(i){const e=Qx.fromISO(r,t);if(e.isValid)return tk.before(o,e)}}return tk.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static isInterval(e){return e&&e.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get lastDateTime(){return this.isValid&&this.e?this.e.minus(1):null}get isValid(){return null===this.invalidReason}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(e="milliseconds"){return this.isValid?this.toDuration(e).get(e):NaN}count(e="milliseconds",t){if(!this.isValid)return NaN;const r=this.start.startOf(e,t);let n;return n=t?.useLocaleWeeks?this.end.reconfigure({locale:r.locale}):this.end,n=n.startOf(e,t),Math.floor(n.diff(r,e).get(e))+(n.valueOf()!==this.end.valueOf())}hasSame(e){return!!this.isValid&&(this.isEmpty()||this.e.minus(1).hasSame(this.s,e))}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(e){return!!this.isValid&&this.s>e}isBefore(e){return!!this.isValid&&this.e<=e}contains(e){return!!this.isValid&&(this.s<=e&&this.e>e)}set({start:e,end:t}={}){return this.isValid?tk.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];const t=e.map(Gk).filter(e=>this.contains(e)).sort((e,t)=>e.toMillis()-t.toMillis()),r=[];let{s:n}=this,a=0;for(;n<this.e;){const e=t[a]||this.e,o=+e>+this.e?this.e:e;r.push(tk.fromDateTimes(n,o)),n=o,a+=1}return r}splitBy(e){const t=Qx.fromDurationLike(e);if(!this.isValid||!t.isValid||0===t.as("milliseconds"))return[];let r,{s:n}=this,a=1;const o=[];for(;n<this.e;){const e=this.start.plus(t.mapUnits(e=>e*a));r=+e>+this.e?this.e:e,o.push(tk.fromDateTimes(n,r)),n=r,a+=1}return o}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s<e.e}abutsStart(e){return!!this.isValid&&+this.e===+e.s}abutsEnd(e){return!!this.isValid&&+e.e===+this.s}engulfs(e){return!!this.isValid&&(this.s<=e.s&&this.e>=e.e)}equals(e){return!(!this.isValid||!e.isValid)&&(this.s.equals(e.s)&&this.e.equals(e.e))}intersection(e){if(!this.isValid)return this;const t=this.s>e.s?this.s:e.s,r=this.e<e.e?this.e:e.e;return t>=r?null:tk.fromDateTimes(t,r)}union(e){if(!this.isValid)return this;const t=this.s<e.s?this.s:e.s,r=this.e>e.e?this.e:e.e;return tk.fromDateTimes(t,r)}static merge(e){const[t,r]=e.sort((e,t)=>e.s-t.s).reduce(([e,t],r)=>t?t.overlaps(r)||t.abutsStart(r)?[e,t.union(r)]:[e.concat([t]),r]:[e,r],[[],null]);return r&&t.push(r),t}static xor(e){let t=null,r=0;const n=[],a=e.map(e=>[{time:e.s,type:"s"},{time:e.e,type:"e"}]),o=Array.prototype.concat(...a).sort((e,t)=>e.time-t.time);for(const e of o)r+="s"===e.type?1:-1,1===r?t=e.time:(t&&+t!==+e.time&&n.push(tk.fromDateTimes(t,e.time)),t=null);return tk.merge(n)}difference(...e){return tk.xor([this].concat(e)).map(e=>this.intersection(e)).filter(e=>e&&!e.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:ek}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(e=$b,t={}){return this.isValid?QS.create(this.s.loc.clone(t),e).formatInterval(this):ek}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:ek}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:ek}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:ek}toFormat(e,{separator:t=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:ek}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):Qx.invalid(this.invalidReason)}mapEndpoints(e){return tk.fromDateTimes(e(this.s),e(this.e))}}class rk{static hasDST(e=qw.defaultZone){const t=Hk.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return gw.isValidZone(e)}static normalizeZone(e){return Iw(e,qw.defaultZone)}static getStartOfWeek({locale:e=null,locObj:t=null}={}){return(t||Ow.create(e)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:e=null,locObj:t=null}={}){return(t||Ow.create(e)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:e=null,locObj:t=null}={}){return(t||Ow.create(e)).getWeekendDays().slice()}static months(e="long",{locale:t=null,numberingSystem:r=null,locObj:n=null,outputCalendar:a="gregory"}={}){return(n||Ow.create(t,r,a)).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:r=null,locObj:n=null,outputCalendar:a="gregory"}={}){return(n||Ow.create(t,r,a)).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:r=null,locObj:n=null}={}){return(n||Ow.create(t,r,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:r=null,locObj:n=null}={}){return(n||Ow.create(t,r,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return Ow.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return Ow.create(t,null,"gregory").eras(e)}static features(){return{relative:hS(),localeWeek:pS()}}}function nk(e,t){const r=e=>e.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),n=r(t)-r(e);return Math.floor(Qx.fromMillis(n).as("days"))}function ak(e,t,r,n){let[a,o,i,s]=function(e,t,r){const n=[["years",(e,t)=>t.year-e.year],["quarters",(e,t)=>t.quarter-e.quarter+4*(t.year-e.year)],["months",(e,t)=>t.month-e.month+12*(t.year-e.year)],["weeks",(e,t)=>{const r=nk(e,t);return(r-r%7)/7}],["days",nk]],a={},o=e;let i,s;for(const[l,c]of n)r.indexOf(l)>=0&&(i=l,a[l]=c(e,t),s=o.plus(a),s>t?(a[l]--,(e=o.plus(a))>t&&(s=e,a[l]--,e=o.plus(a))):e=s);return[e,a,s,i]}(e,t,r);const l=t-a,c=r.filter(e=>["hours","minutes","seconds","milliseconds"].indexOf(e)>=0);0===c.length&&(i<t&&(i=a.plus({[s]:1})),i!==a&&(o[s]=(o[s]||0)+l/(i-a)));const u=Qx.fromObject(o,n);return c.length>0?Qx.fromMillis(l,n).shiftTo(...c).plus(u):u}function ok(e,t=e=>e){return{regex:e,deser:([e])=>t(function(e){let t=parseInt(e,10);if(isNaN(t)){t="";for(let r=0;r<e.length;r++){const n=e.charCodeAt(r);if(-1!==e[r].search(Lw.hanidec))t+=zw.indexOf(e[r]);else for(const e in Fw){const[r,a]=Fw[e];n>=r&&n<=a&&(t+=n-r)}}return parseInt(t,10)}return t}(e))}}const ik=`[ ${String.fromCharCode(160)}]`,sk=new RegExp(ik,"g");function lk(e){return e.replace(/\./g,"\\.?").replace(sk,ik)}function ck(e){return e.replace(/\./g,"").replace(sk," ").toLowerCase()}function uk(e,t){return null===e?null:{regex:RegExp(e.map(lk).join("|")),deser:([r])=>e.findIndex(e=>ck(r)===ck(e))+t}}function dk(e,t){return{regex:e,deser:([,e,t])=>MS(e,t),groups:t}}function fk(e){return{regex:e,deser:([e])=>e}}const mk={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};let hk=null;function pk(e,t){return Array.prototype.concat(...e.map(e=>function(e,t){if(e.literal)return e;const r=vk(QS.macroTokenToFormatOpts(e.val),t);return null==r||r.includes(void 0)?e:r}(e,t)))}class gk{constructor(e,t){if(this.locale=e,this.format=t,this.tokens=pk(QS.parseFormat(t),e),this.units=this.tokens.map(t=>function(e,t){const r=Vw(t),n=Vw(t,"{2}"),a=Vw(t,"{3}"),o=Vw(t,"{4}"),i=Vw(t,"{6}"),s=Vw(t,"{1,2}"),l=Vw(t,"{1,3}"),c=Vw(t,"{1,6}"),u=Vw(t,"{1,9}"),d=Vw(t,"{2,4}"),f=Vw(t,"{4,6}"),m=e=>{return{regex:RegExp((t=e.val,t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"))),deser:([e])=>e,literal:!0};var t},h=(h=>{if(e.literal)return m(h);switch(h.val){case"G":return uk(t.eras("short"),0);case"GG":return uk(t.eras("long"),0);case"y":return ok(c);case"yy":case"kk":return ok(d,OS);case"yyyy":case"kkkk":return ok(o);case"yyyyy":return ok(f);case"yyyyyy":return ok(i);case"M":case"L":case"d":case"H":case"h":case"m":case"q":case"s":case"W":return ok(s);case"MM":case"LL":case"dd":case"HH":case"hh":case"mm":case"qq":case"ss":case"WW":return ok(n);case"MMM":return uk(t.months("short",!0),1);case"MMMM":return uk(t.months("long",!0),1);case"LLL":return uk(t.months("short",!1),1);case"LLLL":return uk(t.months("long",!1),1);case"o":case"S":return ok(l);case"ooo":case"SSS":return ok(a);case"u":return fk(u);case"uu":return fk(s);case"uuu":case"E":case"c":return ok(r);case"a":return uk(t.meridiems(),0);case"EEE":return uk(t.weekdays("short",!1),1);case"EEEE":return uk(t.weekdays("long",!1),1);case"ccc":return uk(t.weekdays("short",!0),1);case"cccc":return uk(t.weekdays("long",!0),1);case"Z":case"ZZ":return dk(new RegExp(`([+-]${s.source})(?::(${n.source}))?`),2);case"ZZZ":return dk(new RegExp(`([+-]${s.source})(${n.source})?`),2);case"z":return fk(/[a-z_+-/]{1,256}?/i);case" ":return fk(/[^\S\n\r]/);default:return m(h)}})(e)||{invalidReason:"missing Intl.DateTimeFormat.formatToParts support"};return h.token=e,h}(t,e)),this.disqualifyingUnit=this.units.find(e=>e.invalidReason),!this.disqualifyingUnit){const[e,t]=function(e){const t=e.map(e=>e.regex).reduce((e,t)=>`${e}(${t.source})`,"");return[`^${t}$`,e]}(this.units);this.regex=RegExp(e,"i"),this.handlers=t}}explainFromTokens(e){if(this.isValid){const[t,r]=function(e,t,r){const n=e.match(t);if(n){const e={};let t=1;for(const a in r)if(yS(r,a)){const o=r[a],i=o.groups?o.groups+1:1;!o.literal&&o.token&&(e[o.token.val[0]]=o.deser(n.slice(t,t+i))),t+=i}return[n,e]}return[n,{}]}(e,this.regex,this.handlers),[n,a,o]=r?function(e){let t,r=null;dS(e.z)||(r=gw.create(e.z)),dS(e.Z)||(r||(r=new Mw(e.Z)),t=e.Z),dS(e.q)||(e.M=3*(e.q-1)+1),dS(e.h)||(e.h<12&&1===e.a?e.h+=12:12===e.h&&0===e.a&&(e.h=0)),0===e.G&&e.y&&(e.y=-e.y),dS(e.u)||(e.S=kS(e.u));const n=Object.keys(e).reduce((t,r)=>{const n=(e=>{switch(e){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}})(r);return n&&(t[n]=e[r]),t},{});return[n,r,t]}(r):[null,null,void 0];if(yS(r,"a")&&yS(r,"H"))throw new Ib("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:this.tokens,regex:this.regex,rawMatches:t,matches:r,result:n,zone:a,specificOffset:o}}return{input:e,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function yk(e,t,r){return new gk(e,r).explainFromTokens(t)}function vk(e,t){if(!e)return null;const r=QS.create(t,e).dtFormatter((hk||(hk=Hk.fromMillis(1555555555555)),hk)),n=r.formatToParts(),a=r.resolvedOptions();return n.map(t=>function(e,t,r){const{type:n,value:a}=e;if("literal"===n){const e=/^\s+$/.test(a);return{literal:!e,val:e?" ":a}}const o=t[n];let i=n;"hour"===n&&(i=null!=t.hour12?t.hour12?"hour12":"hour24":null!=t.hourCycle?"h11"===t.hourCycle||"h12"===t.hourCycle?"hour12":"hour24":r.hour12?"hour12":"hour24");let s=mk[i];if("object"==typeof s&&(s=s[o]),s)return{literal:!1,val:s}}(t,e,a))}const bk="Invalid DateTime",wk=864e13;function Sk(e){return new Jw("unsupported zone",`the zone "${e.name}" is not supported`)}function xk(e){return null===e.weekData&&(e.weekData=aS(e.c)),e.weekData}function kk(e){return null===e.localWeekData&&(e.localWeekData=aS(e.c,e.loc.getMinDaysInFirstWeek(),e.loc.getStartOfWeek())),e.localWeekData}function Tk(e,t){const r={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new Hk({...r,...t,old:r})}function Ak(e,t,r){let n=e-60*t*1e3;const a=r.offset(n);if(t===a)return[n,t];n-=60*(a-t)*1e3;const o=r.offset(n);return a===o?[n,a]:[e-60*Math.min(a,o)*1e3,Math.max(a,o)]}function Ek(e,t){const r=new Date(e+=60*t*1e3);return{year:r.getUTCFullYear(),month:r.getUTCMonth()+1,day:r.getUTCDate(),hour:r.getUTCHours(),minute:r.getUTCMinutes(),second:r.getUTCSeconds(),millisecond:r.getUTCMilliseconds()}}function Ck(e,t,r){return Ak(NS(e),t,r)}function Nk(e,t){const r=e.o,n=e.c.year+Math.trunc(t.years),a=e.c.month+Math.trunc(t.months)+3*Math.trunc(t.quarters),o={...e.c,year:n,month:a,day:Math.min(e.c.day,CS(n,a))+Math.trunc(t.days)+7*Math.trunc(t.weeks)},i=Qx.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),s=NS(o);let[l,c]=Ak(s,r,e.zone);return 0!==i&&(l+=i,c=e.zone.offset(l)),{ts:l,o:c}}function _k(e,t,r,n,a,o){const{setZone:i,zone:s}=r;if(e&&0!==Object.keys(e).length||t){const n=t||s,a=Hk.fromObject(e,{...r,zone:n,specificOffset:o});return i?a:a.setZone(s)}return Hk.invalid(new Jw("unparsable",`the input "${a}" can't be parsed as ${n}`))}function Rk(e,t,r=!0){return e.isValid?QS.create(Ow.create("en-US"),{allowZ:r,forceSimple:!0}).formatDateTimeFromString(e,t):null}function Ok(e,t,r){const n=e.c.year>9999||e.c.year<0;let a="";if(n&&e.c.year>=0&&(a+="+"),a+=wS(e.c.year,n?6:4),"year"===r)return a;if(t){if(a+="-",a+=wS(e.c.month),"month"===r)return a;a+="-"}else if(a+=wS(e.c.month),"month"===r)return a;return a+=wS(e.c.day),a}function Dk(e,t,r,n,a,o,i){let s=!r||0!==e.c.millisecond||0!==e.c.second,l="";switch(i){case"day":case"month":case"year":break;default:if(l+=wS(e.c.hour),"hour"===i)break;if(t){if(l+=":",l+=wS(e.c.minute),"minute"===i)break;s&&(l+=":",l+=wS(e.c.second))}else{if(l+=wS(e.c.minute),"minute"===i)break;s&&(l+=wS(e.c.second))}if("second"===i)break;!s||n&&0===e.c.millisecond||(l+=".",l+=wS(e.c.millisecond,3))}return a&&(e.isOffsetFixed&&0===e.offset&&!o?l+="Z":e.o<0?(l+="-",l+=wS(Math.trunc(-e.o/60)),l+=":",l+=wS(Math.trunc(-e.o%60))):(l+="+",l+=wS(Math.trunc(e.o/60)),l+=":",l+=wS(Math.trunc(e.o%60)))),o&&(l+="["+e.zone.ianaName+"]"),l}const Mk={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},Pk={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},Ik={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Lk=["year","month","day","hour","minute","second","millisecond"],Fk=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],zk=["year","ordinal","hour","minute","second","millisecond"];function Uk(e){const t={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[e.toLowerCase()];if(!t)throw new Lb(e);return t}function Vk(e){switch(e.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return Uk(e)}}function jk(e,t){const r=Iw(t.zone,qw.defaultZone);if(!r.isValid)return Hk.invalid(Sk(r));const n=Ow.fromObject(t);let a,o;if(dS(e.year))a=qw.now();else{for(const t of Lk)dS(e[t])&&(e[t]=Mk[t]);const t=cS(e)||uS(e);if(t)return Hk.invalid(t);const n=function(e){if(void 0===Bk&&(Bk=qw.now()),"iana"!==e.type)return e.offset(Bk);const t=e.name;let r=Zk.get(t);return void 0===r&&(r=e.offset(Bk),Zk.set(t,r)),r}(r);[a,o]=Ck(e,n,r)}return new Hk({ts:a,zone:r,loc:n,o:o})}function $k(e,t,r){const n=!!dS(r.round)||r.round,a=dS(r.rounding)?"trunc":r.rounding,o=(e,o)=>{e=TS(e,n||r.calendary?0:2,r.calendary?"round":a);return t.loc.clone(r).relFormatter(r).format(e,o)},i=n=>r.calendary?t.hasSame(e,n)?0:t.startOf(n).diff(e.startOf(n),n).get(n):t.diff(e,n).get(n);if(r.unit)return o(i(r.unit),r.unit);for(const e of r.units){const t=i(e);if(Math.abs(t)>=1)return o(t,e)}return o(e>t?-0:0,r.units[r.units.length-1])}function Wk(e){let t,r={};return e.length>0&&"object"==typeof e[e.length-1]?(r=e[e.length-1],t=Array.from(e).slice(0,e.length-1)):t=Array.from(e),[r,t]}let Bk;const Zk=new Map;class Hk{constructor(e){const t=e.zone||qw.defaultZone;let r=e.invalid||(Number.isNaN(e.ts)?new Jw("invalid input"):null)||(t.isValid?null:Sk(t));this.ts=dS(e.ts)?qw.now():e.ts;let n=null,a=null;if(!r){if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t))[n,a]=[e.old.c,e.old.o];else{const o=fS(e.o)&&!e.old?e.o:t.offset(this.ts);n=Ek(this.ts,o),r=Number.isNaN(n.year)?new Jw("invalid input"):null,n=r?null:n,a=r?null:o}}this._zone=t,this.loc=e.loc||Ow.create(),this.invalid=r,this.weekData=null,this.localWeekData=null,this.c=n,this.o=a,this.isLuxonDateTime=!0}static now(){return new Hk({})}static local(){const[e,t]=Wk(arguments),[r,n,a,o,i,s,l]=t;return jk({year:r,month:n,day:a,hour:o,minute:i,second:s,millisecond:l},e)}static utc(){const[e,t]=Wk(arguments),[r,n,a,o,i,s,l]=t;return e.zone=Mw.utcInstance,jk({year:r,month:n,day:a,hour:o,minute:i,second:s,millisecond:l},e)}static fromJSDate(e,t={}){const r=function(e){return"[object Date]"===Object.prototype.toString.call(e)}(e)?e.valueOf():NaN;if(Number.isNaN(r))return Hk.invalid("invalid input");const n=Iw(t.zone,qw.defaultZone);return n.isValid?new Hk({ts:r,zone:n,loc:Ow.fromObject(t)}):Hk.invalid(Sk(n))}static fromMillis(e,t={}){if(fS(e))return e<-wk||e>wk?Hk.invalid("Timestamp out of range"):new Hk({ts:e,zone:Iw(t.zone,qw.defaultZone),loc:Ow.fromObject(t)});throw new Fb(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(fS(e))return new Hk({ts:1e3*e,zone:Iw(t.zone,qw.defaultZone),loc:Ow.fromObject(t)});throw new Fb("fromSeconds requires a numerical input")}static fromObject(e,t={}){e=e||{};const r=Iw(t.zone,qw.defaultZone);if(!r.isValid)return Hk.invalid(Sk(r));const n=Ow.fromObject(t),a=IS(e,Vk),{minDaysInFirstWeek:o,startOfWeek:i}=lS(a,n),s=qw.now(),l=dS(t.specificOffset)?r.offset(s):t.specificOffset,c=!dS(a.ordinal),u=!dS(a.year),d=!dS(a.month)||!dS(a.day),f=u||d,m=a.weekYear||a.weekNumber;if((f||c)&&m)throw new Ib("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(d&&c)throw new Ib("Can't mix ordinal dates with month/day");const h=m||a.weekday&&!f;let p,g,y=Ek(s,l);h?(p=Fk,g=Pk,y=aS(y,o,i)):c?(p=zk,g=Ik,y=iS(y)):(p=Lk,g=Mk);let v=!1;for(const e of p){dS(a[e])?a[e]=v?g[e]:y[e]:v=!0}const b=h?function(e,t=4,r=1){const n=mS(e.weekYear),a=bS(e.weekNumber,1,RS(e.weekYear,t,r)),o=bS(e.weekday,1,7);return n?a?!o&&Qw("weekday",e.weekday):Qw("week",e.weekNumber):Qw("weekYear",e.weekYear)}(a,o,i):c?function(e){const t=mS(e.year),r=bS(e.ordinal,1,ES(e.year));return t?!r&&Qw("ordinal",e.ordinal):Qw("year",e.year)}(a):cS(a),w=b||uS(a);if(w)return Hk.invalid(w);const S=h?oS(a,o,i):c?sS(a):a,[x,k]=Ck(S,l,r),T=new Hk({ts:x,zone:r,o:k,loc:n});return a.weekday&&f&&e.weekday!==T.weekday?Hk.invalid("mismatched weekday",`you can't specify both a weekday of ${a.weekday} and a date of ${T.toISO()}`):T.isValid?T:Hk.invalid(T.invalid)}static fromISO(e,t={}){const[r,n]=function(e){return nx(e,[_x,Mx],[Rx,Px],[Ox,Ix],[Dx,Lx])}(e);return _k(r,n,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[r,n]=function(e){return nx(function(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}(e),[xx,kx])}(e);return _k(r,n,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[r,n]=function(e){return nx(e,[Tx,Cx],[Ax,Cx],[Ex,Nx])}(e);return _k(r,n,t,"HTTP",t)}static fromFormat(e,t,r={}){if(dS(e)||dS(t))throw new Fb("fromFormat requires an input string and a format");const{locale:n=null,numberingSystem:a=null}=r,o=Ow.fromOpts({locale:n,numberingSystem:a,defaultToEN:!0}),[i,s,l,c]=function(e,t,r){const{result:n,zone:a,specificOffset:o,invalidReason:i}=yk(e,t,r);return[n,a,o,i]}(o,e,t);return c?Hk.invalid(c):_k(i,s,r,`format ${t}`,e,l)}static fromString(e,t,r={}){return Hk.fromFormat(e,t,r)}static fromSQL(e,t={}){const[r,n]=function(e){return nx(e,[zx,Mx],[Ux,Vx])}(e);return _k(r,n,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new Fb("need to specify a reason the DateTime is invalid");const r=e instanceof Jw?e:new Jw(e,t);if(qw.throwOnInvalid)throw new Db(r);return new Hk({invalid:r})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,t={}){const r=vk(e,Ow.fromObject(t));return r?r.map(e=>e?e.val:null).join(""):null}static expandFormat(e,t={}){return pk(QS.parseFormat(e),Ow.fromObject(t)).map(e=>e.val).join("")}static resetCache(){Bk=void 0,Zk.clear()}get(e){return this[e]}get isValid(){return null===this.invalid}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?xk(this).weekYear:NaN}get weekNumber(){return this.isValid?xk(this).weekNumber:NaN}get weekday(){return this.isValid?xk(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?kk(this).weekday:NaN}get localWeekNumber(){return this.isValid?kk(this).weekNumber:NaN}get localWeekYear(){return this.isValid?kk(this).weekYear:NaN}get ordinal(){return this.isValid?iS(this.c).ordinal:NaN}get monthShort(){return this.isValid?rk.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?rk.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?rk.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?rk.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return!this.isOffsetFixed&&(this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset)}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const e=864e5,t=6e4,r=NS(this.c),n=this.zone.offset(r-e),a=this.zone.offset(r+e),o=this.zone.offset(r-n*t),i=this.zone.offset(r-a*t);if(o===i)return[this];const s=r-o*t,l=r-i*t,c=Ek(s,o),u=Ek(l,i);return c.hour===u.hour&&c.minute===u.minute&&c.second===u.second&&c.millisecond===u.millisecond?[Tk(this,{ts:s}),Tk(this,{ts:l})]:[this]}get isInLeapYear(){return AS(this.year)}get daysInMonth(){return CS(this.year,this.month)}get daysInYear(){return this.isValid?ES(this.year):NaN}get weeksInWeekYear(){return this.isValid?RS(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?RS(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(e={}){const{locale:t,numberingSystem:r,calendar:n}=QS.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:r,outputCalendar:n}}toUTC(e=0,t={}){return this.setZone(Mw.instance(e),t)}toLocal(){return this.setZone(qw.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:r=!1}={}){if((e=Iw(e,qw.defaultZone)).equals(this.zone))return this;if(e.isValid){let n=this.ts;if(t||r){const t=e.offset(this.ts),r=this.toObject();[n]=Ck(r,t,e)}return Tk(this,{ts:n,zone:e})}return Hk.invalid(Sk(e))}reconfigure({locale:e,numberingSystem:t,outputCalendar:r}={}){return Tk(this,{loc:this.loc.clone({locale:e,numberingSystem:t,outputCalendar:r})})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const t=IS(e,Vk),{minDaysInFirstWeek:r,startOfWeek:n}=lS(t,this.loc),a=!dS(t.weekYear)||!dS(t.weekNumber)||!dS(t.weekday),o=!dS(t.ordinal),i=!dS(t.year),s=!dS(t.month)||!dS(t.day),l=i||s,c=t.weekYear||t.weekNumber;if((l||o)&&c)throw new Ib("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(s&&o)throw new Ib("Can't mix ordinal dates with month/day");let u;a?u=oS({...aS(this.c,r,n),...t},r,n):dS(t.ordinal)?(u={...this.toObject(),...t},dS(t.day)&&(u.day=Math.min(CS(u.year,u.month),u.day))):u=sS({...iS(this.c),...t});const[d,f]=Ck(u,this.o,this.zone);return Tk(this,{ts:d,o:f})}plus(e){if(!this.isValid)return this;return Tk(this,Nk(this,Qx.fromDurationLike(e)))}minus(e){if(!this.isValid)return this;return Tk(this,Nk(this,Qx.fromDurationLike(e).negate()))}startOf(e,{useLocaleWeeks:t=!1}={}){if(!this.isValid)return this;const r={},n=Qx.normalizeUnit(e);switch(n){case"years":r.month=1;case"quarters":case"months":r.day=1;case"weeks":case"days":r.hour=0;case"hours":r.minute=0;case"minutes":r.second=0;case"seconds":r.millisecond=0}if("weeks"===n)if(t){const e=this.loc.getStartOfWeek(),{weekday:t}=this;t<e&&(r.weekNumber=this.weekNumber-1),r.weekday=e}else r.weekday=1;if("quarters"===n){const e=Math.ceil(this.month/3);r.month=3*(e-1)+1}return this.set(r)}endOf(e,t){return this.isValid?this.plus({[e]:1}).startOf(e,t).minus(1):this}toFormat(e,t={}){return this.isValid?QS.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):bk}toLocaleString(e=$b,t={}){return this.isValid?QS.create(this.loc.clone(t),e).formatDateTime(this):bk}toLocaleParts(e={}){return this.isValid?QS.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e="extended",suppressSeconds:t=!1,suppressMilliseconds:r=!1,includeOffset:n=!0,extendedZone:a=!1,precision:o="milliseconds"}={}){if(!this.isValid)return null;const i="extended"===e;let s=Ok(this,i,o=Uk(o));return Lk.indexOf(o)>=3&&(s+="T"),s+=Dk(this,i,t,r,n,a,o),s}toISODate({format:e="extended",precision:t="day"}={}){return this.isValid?Ok(this,"extended"===e,Uk(t)):null}toISOWeekDate(){return Rk(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:t=!1,includeOffset:r=!0,includePrefix:n=!1,extendedZone:a=!1,format:o="extended",precision:i="milliseconds"}={}){if(!this.isValid)return null;return i=Uk(i),(n&&Lk.indexOf(i)>=3?"T":"")+Dk(this,"extended"===o,t,e,r,a,i)}toRFC2822(){return Rk(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return Rk(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?Ok(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:t=!1,includeOffsetSpace:r=!0}={}){let n="HH:mm:ss.SSS";return(t||e)&&(r&&(n+=" "),t?n+="z":e&&(n+="ZZ")),Rk(this,n,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():bk}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(e={}){if(!this.isValid)return{};const t={...this.c};return e.includeConfig&&(t.outputCalendar=this.outputCalendar,t.numberingSystem=this.loc.numberingSystem,t.locale=this.loc.locale),t}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(e,t="milliseconds",r={}){if(!this.isValid||!e.isValid)return Qx.invalid("created by diffing an invalid DateTime");const n={locale:this.locale,numberingSystem:this.numberingSystem,...r},a=(s=t,Array.isArray(s)?s:[s]).map(Qx.normalizeUnit),o=e.valueOf()>this.valueOf(),i=ak(o?this:e,o?e:this,a,n);var s;return o?i.negate():i}diffNow(e="milliseconds",t={}){return this.diff(Hk.now(),e,t)}until(e){return this.isValid?tk.fromDateTimes(this,e):this}hasSame(e,t,r){if(!this.isValid)return!1;const n=e.valueOf(),a=this.setZone(e.zone,{keepLocalTime:!0});return a.startOf(t,r)<=n&&n<=a.endOf(t,r)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;const t=e.base||Hk.fromObject({},{zone:this.zone}),r=e.padding?this<t?-e.padding:e.padding:0;let n=["years","months","days","hours","minutes","seconds"],a=e.unit;return Array.isArray(e.unit)&&(n=e.unit,a=void 0),$k(t,this.plus(r),{...e,numeric:"always",units:n,unit:a})}toRelativeCalendar(e={}){return this.isValid?$k(e.base||Hk.fromObject({},{zone:this.zone}),this,{...e,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...e){if(!e.every(Hk.isDateTime))throw new Fb("min requires all arguments be DateTimes");return gS(e,e=>e.valueOf(),Math.min)}static max(...e){if(!e.every(Hk.isDateTime))throw new Fb("max requires all arguments be DateTimes");return gS(e,e=>e.valueOf(),Math.max)}static fromFormatExplain(e,t,r={}){const{locale:n=null,numberingSystem:a=null}=r;return yk(Ow.fromOpts({locale:n,numberingSystem:a,defaultToEN:!0}),e,t)}static fromStringExplain(e,t,r={}){return Hk.fromFormatExplain(e,t,r)}static buildFormatParser(e,t={}){const{locale:r=null,numberingSystem:n=null}=t,a=Ow.fromOpts({locale:r,numberingSystem:n,defaultToEN:!0});return new gk(a,e)}static fromFormatParser(e,t,r={}){if(dS(e)||dS(t))throw new Fb("fromFormatParser requires an input string and a format parser");const{locale:n=null,numberingSystem:a=null}=r,o=Ow.fromOpts({locale:n,numberingSystem:a,defaultToEN:!0});if(!o.equals(t.locale))throw new Fb(`fromFormatParser called with a locale of ${o}, but the format parser was created for ${t.locale}`);const{result:i,zone:s,specificOffset:l,invalidReason:c}=t.explainFromTokens(e);return c?Hk.invalid(c):_k(i,s,r,`format ${t.format}`,e,l)}static get DATE_SHORT(){return $b}static get DATE_MED(){return Wb}static get DATE_MED_WITH_WEEKDAY(){return Bb}static get DATE_FULL(){return Zb}static get DATE_HUGE(){return Hb}static get TIME_SIMPLE(){return Gb}static get TIME_WITH_SECONDS(){return Kb}static get TIME_WITH_SHORT_OFFSET(){return qb}static get TIME_WITH_LONG_OFFSET(){return Jb}static get TIME_24_SIMPLE(){return Yb}static get TIME_24_WITH_SECONDS(){return Xb}static get TIME_24_WITH_SHORT_OFFSET(){return Qb}static get TIME_24_WITH_LONG_OFFSET(){return ew}static get DATETIME_SHORT(){return tw}static get DATETIME_SHORT_WITH_SECONDS(){return rw}static get DATETIME_MED(){return nw}static get DATETIME_MED_WITH_SECONDS(){return aw}static get DATETIME_MED_WITH_WEEKDAY(){return ow}static get DATETIME_FULL(){return iw}static get DATETIME_FULL_WITH_SECONDS(){return sw}static get DATETIME_HUGE(){return lw}static get DATETIME_HUGE_WITH_SECONDS(){return cw}}function Gk(e){if(Hk.isDateTime(e))return e;if(e&&e.valueOf&&fS(e.valueOf()))return Hk.fromJSDate(e);if(e&&"object"==typeof e)return Hk.fromObject(e);throw new Fb(`Unknown datetime argument: ${e}, of type ${typeof e}`)}let Kk=[{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:"🇮🇱"},{code:"th-TH",label:"Thai (Thailand)",flag:"🇹🇭"}];Kk=Kk.filter((e,t,r)=>t===r.findIndex(t=>t.code===e.code&&t.label===e.label)),Kk.sort((e,t)=>e.label<t.label?-1:e.label>t.label?1:0);const qk=Kk.filter(e=>Hk.local().setLocale(e.code).isValid).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 Jk(t){const[n,a]=f(t.value||""),[o,i]=f(!1),s=qk.find(e=>e.value==n);return r(Sb,{open:o,onOpenChange:i,children:[e(xb,{asChild:!0,children:r(_i,{variant:"outline",role:"combobox","aria-expanded":o,className:"justify-between overflow-hidden text-ellipsis",children:[s&&r("div",{children:[String(s.label).trim(),e("span",{className:"ml-2 text-xs text-muted-foreground",children:s.flag})]}),!s&&"Choose language",e(pi,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),e(kb,{className:"p-0 overflow-hidden text-ellipsis",children:r(Mg,{children:[e(Pg,{placeholder:"Choose timezone..."}),e(Ig,{children:e(Lg,{children:qk.map(o=>r(Fg,{className:Ko("whitespace-nowrap text-left",{"text-green-500":n===o.value}),value:o.value,defaultValue:o.value,onSelect:e=>{const r=o.value;a(r),t.onChange&&"function"==typeof t.onChange&&t.onChange(r),i(!1)},children:[n===o.value&&e(hi,{className:Ko("mr-2 h-4 w-4 text-green-400",n===o.value?"opacity-100":"opacity-0")}),String(o.label).trim(),e("span",{className:"ml-2 text-xs text-muted-foreground",children:o.flag})]},o.value))})})]})})]})}const Yk=[{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 i=o.substring(o.indexOf("(")+1,o.indexOf(")"));-1!==i.indexOf("UTC")&&e.push({value:a,abbr:t.abbr,offset:t.offset,isdst:t.isdst,text:`(${i}) ${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 Xk(t){const[n,a]=f(t.value||""),[o,i]=f(!1),s=Yk.find(e=>e.value==n);return r(Sb,{open:o,onOpenChange:i,children:[e(xb,{asChild:!0,children:r(_i,{variant:"outline",role:"combobox","aria-expanded":o,className:"justify-between overflow-hidden text-ellipsis",children:[s?.text||"Choose timezone",e(pi,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),e(kb,{className:"p-0 overflow-hidden text-ellipsis",children:r(Mg,{children:[e(Pg,{placeholder:"Choose timezone..."}),e(Ig,{children:e(Lg,{children:Yk.map(o=>r(Fg,{className:Ko("whitespace-nowrap text-left",{"text-green-500":n===o.value}),value:o.value,defaultValue:o.value,onSelect:e=>{const r=o.value;a(r),t.onChange&&"function"==typeof t.onChange&&t.onChange(r),i(!1)},children:[n===o.value&&e(hi,{className:Ko("mr-2 h-4 w-4 text-green-400",n===o.value?"opacity-100":"opacity-0")}),String(o.text).trim()]},o.value))})})]})})]})}const Qk=({workspace:t})=>{const{updateUserProfile:n,getProfile:a}=AA(),[o,i]=f(!1),[s,l]=f(),[u,d]=f(0),m=zt({resolver:za(Zs({name:vs().min(2,{message:"Name must be at least 2 characters."}),country:vs().optional(),timezone:vs().optional(),language:vs().optional(),currency:vs().optional()})),defaultValues:{name:s?.name||"",country:s?.country||"",timezone:s?.timezone||"",language:s?.language||"",currency:s?.currency||""}});return c(()=>{a().then(e=>{l(e),m.setValue("name",e.name),m.setValue("country",e.country),m.setValue("timezone",e.timezone),m.setValue("language",e.language),m.setValue("currency",e.currency)})},[u]),s?r("div",{children:[e("div",{className:"space-y-4",children:e(Ii,{...m,children:r("form",{onSubmit:m.handleSubmit(async function(e){i(!0),await n({name:e.name,country:e.country,timezone:e.timezone,language:e.language,currency:e.currency}),i(!1)}),className:"space-y-4",children:[r("div",{children:[e("label",{className:"block text-sm font-medium mb-1",children:"Email"}),e(Zi,{disabled:!0,className:"w-full border rounded px-3 py-2 bg-gray-100",value:s?.email})]}),e(Fi,{disabled:o,control:m.control,name:"name",render:({field:t})=>r(Vi,{children:[e(ji,{children:"Name"}),e($i,{children:e(Zi,{...t})}),e(Bi,{})]})}),r("div",{className:"flex gap-y-2 my-4 flex-col",children:[r("div",{className:"flex flex-col gap-0.5",children:[e("div",{className:"text-sm font-medium",children:"Language"}),e(Jk,{value:m.getValues("language"),onChange:e=>{m.setValue("language",e)}})]}),r("div",{className:"flex flex-col gap-0.5",children:[e("div",{className:"text-sm font-medium",children:"Country"}),e(Cb,{value:m.getValues("country"),onChange:e=>{m.setValue("country",e)}})]}),r("div",{className:"flex flex-col gap-0.5",children:[e("div",{className:"text-sm font-medium",children:"Currency"}),e(Rb,{value:m.getValues("currency"),onChange:e=>{m.setValue("currency",e)}})]}),r("div",{className:"flex flex-col gap-0.5",children:[e("div",{className:"text-sm font-medium",children:"Timezone"}),e(Xk,{value:m.getValues("timezone"),onChange:e=>{m.setValue("timezone",e)}})]})]}),r("div",{className:"flex justify-end gap-x-2",children:[e(_i,{type:"submit",progress:o,disabled:o,children:"Save"}),e(_i,{type:"button",variant:"outline",onClick:()=>{d(e=>e+1)},disabled:o,children:"Reset"})]})]})})}),s?.image&&r("div",{children:[e("label",{className:"block text-sm font-medium mb-1",children:"Profile Image"}),e("div",{className:"w-16 h-16 rounded-full overflow-hidden",children:e("img",{src:s.image,alt:s.name,className:"w-full h-full object-cover"})})]})]}):e("div",{children:"Loading..."})};var eT=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"});n.forwardRef((t,r)=>e(Ri.span,{...t,ref:r,style:{...eT,...t.style}})).displayName="VisuallyHidden";var tT=[" ","Enter","ArrowUp","ArrowDown"],rT=[" ","Enter"],nT="Select",[aT,oT,iT]=Wm(nT),[sT,lT]=Uu(nT,[iT,Ov]),cT=Ov(),[uT,dT]=sT(nT),[fT,mT]=sT(nT),hT=t=>{const{__scopeSelect:a,children:o,open:i,defaultOpen:s,onOpenChange:l,value:c,defaultValue:u,onValueChange:d,dir:f,name:m,autoComplete:h,disabled:p,required:g,form:y}=t,v=cT(a),[b,w]=n.useState(null),[S,x]=n.useState(null),[k,T]=n.useState(!1),A=Zm(f),[E,C]=bd({prop:i,defaultProp:s??!1,onChange:l,caller:nT}),[N,_]=bd({prop:c,defaultProp:u,onChange:d,caller:nT}),R=n.useRef(null),O=!b||(y||!!b.closest("form")),[D,M]=n.useState(new Set),P=Array.from(D).map(e=>e.props.value).join(";");return e(Gv,{...v,children:r(uT,{required:g,scope:a,trigger:b,onTriggerChange:w,valueNode:S,onValueNodeChange:x,valueNodeHasChildren:k,onValueNodeHasChildrenChange:T,contentId:yd(),value:N,onValueChange:_,open:E,onOpenChange:C,dir:A,triggerPointerDownPosRef:R,disabled:p,children:[e(aT.Provider,{scope:a,children:e(fT,{scope:t.__scopeSelect,onNativeOptionAdd:n.useCallback(e=>{M(t=>new Set(t).add(e))},[]),onNativeOptionRemove:n.useCallback(e=>{M(t=>{const r=new Set(t);return r.delete(e),r})},[]),children:o})}),O?r(XT,{"aria-hidden":!0,required:g,tabIndex:-1,name:m,autoComplete:h,value:N,onChange:e=>_(e.target.value),disabled:p,form:y,children:[void 0===N?e("option",{value:""}):null,Array.from(D)]},P):null]})})};hT.displayName=nT;var pT="SelectTrigger",gT=n.forwardRef((t,r)=>{const{__scopeSelect:a,disabled:o=!1,...i}=t,s=cT(a),l=dT(pT,a),c=l.disabled||o,u=Yo(r,l.onTriggerChange),d=oT(a),f=n.useRef("touch"),[m,h,p]=eA(e=>{const t=d().filter(e=>!e.disabled),r=t.find(e=>e.value===l.value),n=tA(t,e,r);void 0!==n&&l.onValueChange(n.value)}),g=e=>{c||(l.onOpenChange(!0),p()),e&&(l.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return e(Kv,{asChild:!0,...s,children:e(Ri.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":QT(l.value)?"":void 0,...i,ref:u,onClick:hd(i.onClick,e=>{e.currentTarget.focus(),"mouse"!==f.current&&g(e)}),onPointerDown:hd(i.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:hd(i.onKeyDown,e=>{const t=""!==m.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||h(e.key),t&&" "===e.key||tT.includes(e.key)&&(g(),e.preventDefault())})})})});gT.displayName=pT;var yT="SelectValue",vT=n.forwardRef((r,n)=>{const{__scopeSelect:a,className:o,style:i,children:s,placeholder:l="",...c}=r,u=dT(yT,a),{onValueNodeHasChildrenChange:d}=u,f=void 0!==s,m=Yo(n,u.onValueNodeChange);return Wu(()=>{d(f)},[d,f]),e(Ri.span,{...c,ref:m,style:{pointerEvents:"none"},children:QT(u.value)?e(t,{children:l}):s})});vT.displayName=yT;var bT=n.forwardRef((t,r)=>{const{__scopeSelect:n,children:a,...o}=t;return e(Ri.span,{"aria-hidden":!0,...o,ref:r,children:a||"▼"})});bT.displayName="SelectIcon";var wT=t=>e(zd,{asChild:!0,...t});wT.displayName="SelectPortal";var ST="SelectContent",xT=n.forwardRef((t,r)=>{const a=dT(ST,t.__scopeSelect),[o,i]=n.useState();if(Wu(()=>{i(new DocumentFragment)},[]),!a.open){const r=o;return r?h.createPortal(e(TT,{scope:t.__scopeSelect,children:e(aT.Slot,{scope:t.__scopeSelect,children:e("div",{children:t.children})})}),r):null}return e(CT,{...t,ref:r})});xT.displayName=ST;var kT=10,[TT,AT]=sT(ST),ET=Xo("SelectContent.RemoveScroll"),CT=n.forwardRef((t,r)=>{const{__scopeSelect:a,position:o="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:s,onPointerDownOutside:l,side:c,sideOffset:u,align:d,alignOffset:f,arrowPadding:m,collisionBoundary:h,collisionPadding:p,sticky:g,hideWhenDetached:y,avoidCollisions:v,...b}=t,w=dT(ST,a),[S,x]=n.useState(null),[k,T]=n.useState(null),A=Yo(r,e=>x(e)),[E,C]=n.useState(null),[N,_]=n.useState(null),R=oT(a),[O,D]=n.useState(!1),M=n.useRef(!1);n.useEffect(()=>{if(S)return zf(S)},[S]),$d();const P=n.useCallback(e=>{const[t,...r]=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}},[R,k]),I=n.useCallback(()=>P([E,S]),[P,E,S]);n.useEffect(()=>{O&&I()},[O,I]);const{onOpenChange:L,triggerPointerDownPosRef:F}=w;n.useEffect(()=>{if(S){let e={x:0,y:0};const t=t=>{e={x:Math.abs(Math.round(t.pageX)-(F.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(F.current?.y??0))}},r=r=>{e.x<=10&&e.y<=10?r.preventDefault():S.contains(r.target)||L(!1),document.removeEventListener("pointermove",t),F.current=null};return null!==F.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",r,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",r,{capture:!0})}}},[S,L,F]),n.useEffect(()=>{const e=()=>L(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[L]);const[z,U]=eA(e=>{const t=R().filter(e=>!e.disabled),r=t.find(e=>e.ref.current===document.activeElement),n=tA(t,e,r);n&&setTimeout(()=>n.ref.current.focus())}),V=n.useCallback((e,t,r)=>{const n=!M.current&&!r;(void 0!==w.value&&w.value===t||n)&&(C(e),n&&(M.current=!0))},[w.value]),j=n.useCallback(()=>S?.focus(),[S]),$=n.useCallback((e,t,r)=>{const n=!M.current&&!r;(void 0!==w.value&&w.value===t||n)&&_(e)},[w.value]),W="popper"===o?_T:NT,B=W===_T?{side:c,sideOffset:u,align:d,alignOffset:f,arrowPadding:m,collisionBoundary:h,collisionPadding:p,sticky:g,hideWhenDetached:y,avoidCollisions:v}:{};return e(TT,{scope:a,content:S,viewport:k,onViewportChange:T,itemRefCallback:V,selectedItem:E,onItemLeave:j,itemTextRefCallback:$,focusSelectedItem:I,selectedItemText:N,position:o,isPositioned:O,searchRef:z,children:e(Of,{as:ET,allowPinchZoom:!0,children:e(Od,{asChild:!0,trapped:w.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:hd(i,e=>{w.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:e(Ad,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>w.onOpenChange(!1),children:e(W,{role:"listbox",id:w.contentId,"data-state":w.open?"open":"closed",dir:w.dir,onContextMenu:e=>e.preventDefault(),...b,...B,onPlaced:()=>D(!0),ref:A,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:hd(b.onKeyDown,e=>{const t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||U(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=R().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(()=>P(t)),e.preventDefault()}})})})})})})});CT.displayName="SelectContentImpl";var NT=n.forwardRef((t,r)=>{const{__scopeSelect:a,onPlaced:o,...i}=t,s=dT(ST,a),l=AT(ST,a),[c,u]=n.useState(null),[d,f]=n.useState(null),m=Yo(r,e=>f(e)),h=oT(a),p=n.useRef(!1),g=n.useRef(!0),{viewport:y,selectedItem:v,selectedItemText:b,focusSelectedItem:w}=l,S=n.useCallback(()=>{if(s.trigger&&s.valueNode&&c&&d&&y&&v&&b){const e=s.trigger.getBoundingClientRect(),t=d.getBoundingClientRect(),r=s.valueNode.getBoundingClientRect(),n=b.getBoundingClientRect();if("rtl"!==s.dir){const a=n.left-t.left,o=r.left-a,i=e.left-o,s=e.width+i,l=Math.max(s,t.width),u=window.innerWidth-kT,d=Uh(o,[kT,Math.max(kT,u-l)]);c.style.minWidth=s+"px",c.style.left=d+"px"}else{const a=t.right-n.right,o=window.innerWidth-r.right-a,i=window.innerWidth-e.right-o,s=e.width+i,l=Math.max(s,t.width),u=window.innerWidth-kT,d=Uh(o,[kT,Math.max(kT,u-l)]);c.style.minWidth=s+"px",c.style.right=d+"px"}const a=h(),i=window.innerHeight-2*kT,l=y.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,S=Math.min(5*v.offsetHeight,w),x=window.getComputedStyle(y),k=parseInt(x.paddingTop,10),T=parseInt(x.paddingBottom,10),A=e.top+e.height/2-kT,E=i-A,C=v.offsetHeight/2,N=f+m+(v.offsetTop+C),_=w-N;if(N<=A){const e=a.length>0&&v===a[a.length-1].ref.current;c.style.bottom="0px";const t=d.clientHeight-y.offsetTop-y.offsetHeight,r=N+Math.max(E,C+(e?T:0)+t+g);c.style.height=r+"px"}else{const e=a.length>0&&v===a[0].ref.current;c.style.top="0px";const t=Math.max(A,f+y.offsetTop+(e?k:0)+C)+_;c.style.height=t+"px",y.scrollTop=N-A+y.offsetTop}c.style.margin=`${kT}px 0`,c.style.minHeight=S+"px",c.style.maxHeight=i+"px",o?.(),requestAnimationFrame(()=>p.current=!0)}},[h,s.trigger,s.valueNode,c,d,y,v,b,s.dir,o]);Wu(()=>S(),[S]);const[x,k]=n.useState();Wu(()=>{d&&k(window.getComputedStyle(d).zIndex)},[d]);const T=n.useCallback(e=>{e&&!0===g.current&&(S(),w?.(),g.current=!1)},[S,w]);return e(RT,{scope:a,contentWrapper:c,shouldExpandOnScrollRef:p,onScrollButtonChange:T,children:e("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:x},children:e(Ri.div,{...i,ref:m,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});NT.displayName="SelectItemAlignedPosition";var _T=n.forwardRef((t,r)=>{const{__scopeSelect:n,align:a="start",collisionPadding:o=kT,...i}=t,s=cT(n);return e(qv,{...s,...i,ref:r,align:a,collisionPadding:o,style:{boxSizing:"border-box",...i.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)"}})});_T.displayName="SelectPopperPosition";var[RT,OT]=sT(ST,{}),DT="SelectViewport",MT=n.forwardRef((a,o)=>{const{__scopeSelect:i,nonce:s,...l}=a,c=AT(DT,i),u=OT(DT,i),d=Yo(o,c.onViewportChange),f=n.useRef(0);return r(t,{children:[e("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:s}),e(aT.Slot,{scope:i,children:e(Ri.div,{"data-radix-select-viewport":"",role:"presentation",...l,ref:d,style:{position:"relative",flex:1,overflow:"hidden auto",...l.style},onScroll:hd(l.onScroll,e=>{const t=e.currentTarget,{contentWrapper:r,shouldExpandOnScrollRef:n}=u;if(n?.current&&r){const e=Math.abs(f.current-t.scrollTop);if(e>0){const n=window.innerHeight-2*kT,a=parseFloat(r.style.minHeight),o=parseFloat(r.style.height),i=Math.max(a,o);if(i<n){const a=i+e,o=Math.min(n,a),s=a-o;r.style.height=o+"px","0px"===r.style.bottom&&(t.scrollTop=s>0?s:0,r.style.justifyContent="flex-end")}}}f.current=t.scrollTop})})})]})});MT.displayName=DT;var PT="SelectGroup",[IT,LT]=sT(PT);n.forwardRef((t,r)=>{const{__scopeSelect:n,...a}=t,o=yd();return e(IT,{scope:n,id:o,children:e(Ri.div,{role:"group","aria-labelledby":o,...a,ref:r})})}).displayName=PT;var FT="SelectLabel",zT=n.forwardRef((t,r)=>{const{__scopeSelect:n,...a}=t,o=LT(FT,n);return e(Ri.div,{id:o.id,...a,ref:r})});zT.displayName=FT;var UT="SelectItem",[VT,jT]=sT(UT),$T=n.forwardRef((t,r)=>{const{__scopeSelect:a,value:o,disabled:i=!1,textValue:s,...l}=t,c=dT(UT,a),u=AT(UT,a),d=c.value===o,[f,m]=n.useState(s??""),[h,p]=n.useState(!1),g=Yo(r,e=>u.itemRefCallback?.(e,o,i)),y=yd(),v=n.useRef("touch"),b=()=>{i||(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(VT,{scope:a,value:o,disabled:i,textId:y,isSelected:d,onItemTextChange:n.useCallback(e=>{m(t=>t||(e?.textContent??"").trim())},[]),children:e(aT.ItemSlot,{scope:a,value:o,disabled:i,textValue:f,children:e(Ri.div,{role:"option","aria-labelledby":y,"data-highlighted":h?"":void 0,"aria-selected":d&&h,"data-state":d?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...l,ref:g,onFocus:hd(l.onFocus,()=>p(!0)),onBlur:hd(l.onBlur,()=>p(!1)),onClick:hd(l.onClick,()=>{"mouse"!==v.current&&b()}),onPointerUp:hd(l.onPointerUp,()=>{"mouse"===v.current&&b()}),onPointerDown:hd(l.onPointerDown,e=>{v.current=e.pointerType}),onPointerMove:hd(l.onPointerMove,e=>{v.current=e.pointerType,i?u.onItemLeave?.():"mouse"===v.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:hd(l.onPointerLeave,e=>{e.currentTarget===document.activeElement&&u.onItemLeave?.()}),onKeyDown:hd(l.onKeyDown,e=>{""!==u.searchRef?.current&&" "===e.key||(rT.includes(e.key)&&b()," "===e.key&&e.preventDefault())})})})})});$T.displayName=UT;var WT="SelectItemText",BT=n.forwardRef((a,o)=>{const{__scopeSelect:i,className:s,style:l,...c}=a,u=dT(WT,i),d=AT(WT,i),f=jT(WT,i),m=mT(WT,i),[p,g]=n.useState(null),y=Yo(o,e=>g(e),f.onItemTextChange,e=>d.itemTextRefCallback?.(e,f.value,f.disabled)),v=p?.textContent,b=n.useMemo(()=>e("option",{value:f.value,disabled:f.disabled,children:v},f.value),[f.disabled,f.value,v]),{onNativeOptionAdd:w,onNativeOptionRemove:S}=m;return Wu(()=>(w(b),()=>S(b)),[w,S,b]),r(t,{children:[e(Ri.span,{id:f.textId,...c,ref:y}),f.isSelected&&u.valueNode&&!u.valueNodeHasChildren?h.createPortal(c.children,u.valueNode):null]})});BT.displayName=WT;var ZT="SelectItemIndicator",HT=n.forwardRef((t,r)=>{const{__scopeSelect:n,...a}=t;return jT(ZT,n).isSelected?e(Ri.span,{"aria-hidden":!0,...a,ref:r}):null});HT.displayName=ZT;var GT="SelectScrollUpButton";n.forwardRef((t,r)=>{const a=AT(GT,t.__scopeSelect),o=OT(GT,t.__scopeSelect),[i,s]=n.useState(!1),l=Yo(r,o.onScrollButtonChange);return Wu(()=>{if(a.viewport&&a.isPositioned){let e=function(){const e=t.scrollTop>0;s(e)};const t=a.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[a.viewport,a.isPositioned]),i?e(qT,{...t,ref:l,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=a;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null}).displayName=GT;var KT="SelectScrollDownButton";n.forwardRef((t,r)=>{const a=AT(KT,t.__scopeSelect),o=OT(KT,t.__scopeSelect),[i,s]=n.useState(!1),l=Yo(r,o.onScrollButtonChange);return Wu(()=>{if(a.viewport&&a.isPositioned){let e=function(){const e=t.scrollHeight-t.clientHeight,r=Math.ceil(t.scrollTop)<e;s(r)};const t=a.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[a.viewport,a.isPositioned]),i?e(qT,{...t,ref:l,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=a;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null}).displayName=KT;var qT=n.forwardRef((t,r)=>{const{__scopeSelect:a,onAutoScroll:o,...i}=t,s=AT("SelectScrollButton",a),l=n.useRef(null),c=oT(a),u=n.useCallback(()=>{null!==l.current&&(window.clearInterval(l.current),l.current=null)},[]);return n.useEffect(()=>()=>u(),[u]),Wu(()=>{const e=c().find(e=>e.ref.current===document.activeElement);e?.ref.current?.scrollIntoView({block:"nearest"})},[c]),e(Ri.div,{"aria-hidden":!0,...i,ref:r,style:{flexShrink:0,...i.style},onPointerDown:hd(i.onPointerDown,()=>{null===l.current&&(l.current=window.setInterval(o,50))}),onPointerMove:hd(i.onPointerMove,()=>{s.onItemLeave?.(),null===l.current&&(l.current=window.setInterval(o,50))}),onPointerLeave:hd(i.onPointerLeave,()=>{u()})})}),JT=n.forwardRef((t,r)=>{const{__scopeSelect:n,...a}=t;return e(Ri.div,{"aria-hidden":!0,...a,ref:r})});JT.displayName="SelectSeparator";var YT="SelectArrow";n.forwardRef((t,r)=>{const{__scopeSelect:n,...a}=t,o=cT(n),i=dT(YT,n),s=AT(YT,n);return i.open&&"popper"===s.position?e(Jv,{...o,...a,ref:r}):null}).displayName=YT;var XT=n.forwardRef(({__scopeSelect:t,value:r,...a},o)=>{const i=n.useRef(null),s=Yo(o,i),l=dh(r);return n.useEffect(()=>{const e=i.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(Ri.select,{...a,style:{...eT,...a.style},ref:s,defaultValue:r})});function QT(e){return""===e||void 0===e}function eA(e){const t=ju(e),r=n.useRef(""),a=n.useRef(0),o=n.useCallback(e=>{const n=r.current+e;t(n),function e(t){r.current=t,window.clearTimeout(a.current),""!==t&&(a.current=window.setTimeout(()=>e(""),1e3))}(n)},[t]),i=n.useCallback(()=>{r.current="",window.clearTimeout(a.current)},[]);return n.useEffect(()=>()=>window.clearTimeout(a.current),[]),[r,o,i]}function tA(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 i=o.find(e=>e.textValue.toLowerCase().startsWith(n.toLowerCase()));return i!==r?i:void 0}XT.displayName="SelectBubbleInput";var rA=gT,nA=bT,aA=wT,oA=xT,iA=MT,sA=zT,lA=$T,cA=BT,uA=HT,dA=JT;const fA=hT,mA=n.forwardRef(({className:t,children:n,...a},o)=>r(rA,{ref:o,className:Ko("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),...a,children:[n,e(nA,{asChild:!0,children:e(Nm,{className:"h-4 w-4 opacity-50"})})]}));mA.displayName=rA.displayName;const hA=n.forwardRef(({className:t,children:r,position:a="popper",...o},i)=>{const{container:s}=n.useContext(ue);return e(aA,{container:s,children:e(oA,{ref:i,className:Ko("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"===a&&"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:a,...o,children:e(iA,{className:Ko("p-1","popper"===a&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:r})})})});hA.displayName=oA.displayName;n.forwardRef(({className:t,...r},n)=>e(sA,{ref:n,className:Ko("px-2 py-1.5 text-sm font-semibold",t),...r})).displayName=sA.displayName;const pA=n.forwardRef(({className:t,children:n,...a},o)=>r(lA,{ref:o,className:Ko("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),...a,children:[e("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:e(uA,{children:e(Rm,{className:"h-4 w-4"})})}),e(cA,{children:n})]}));pA.displayName=lA.displayName;n.forwardRef(({className:t,...r},n)=>e(dA,{ref:n,className:Ko("-mx-1 my-1 h-px bg-muted",t),...r})).displayName=dA.displayName;const gA=({workspace:t})=>{const n=ne(e=>e.auth.user),[a,o]=f(0),[i,s]=f(!1),[l,u]=f([]),{getUsers:d,removeUser:m,updateUser:h}=AA();c(()=>{t&&(s(!0),d(t._id).then(e=>{u(e)}).catch(e=>{console.error(e)}).finally(()=>{s(!1)}))},[t,a]);const p=()=>{o(e=>e+1)};if(!t)return e("div",{children:e("div",{className:"text-gray-500",children:"Loading workspace members..."})});const g=e=>"string"==typeof e?{name:"Unknown User",email:e,id:e,role:"-"}:{name:e.name,email:e.email,id:e._id},y=l.map(e=>({...e,...g(e.user)})),v=l.find(e=>("string"==typeof e.user?e.user:e.user._id)===n?.id)?.role,b="admin"===v;return r("div",{children:[!b&&e("div",{className:"text-red-500",children:"Only workspace admin can manage users and roles."}),b&&e("div",{className:"mb-4",children:e(yA,{onInvite:p,workspaceId:t._id})}),r("div",{className:"mb-4 flex items-center justify-between",children:[e("div",{children:r("div",{className:"text-sm text-gray-600 mb-2",children:[l.length," member",1!==l.length?"s":""]})}),e("div",{children:e(_i,{variant:"ghost",size:"sm",onClick:p,progress:i,startIcon:e(wi,{}),children:"Refresh"})})]}),e("ul",{className:"space-y-2",children:y.map((a,o)=>{const i=a.id===n?.id;return r("li",{className:"flex items-center justify-between border rounded-lg p-3",children:[r("div",{className:"flex items-center space-x-3",children:[e("div",{className:"w-8 h-8 bg-gray-200 rounded-full flex items-center justify-center text-sm font-medium",children:a.name.charAt(0).toUpperCase()}),r("div",{children:[e("div",{className:"font-medium",children:a.name}),e("div",{className:"text-xs text-gray-500",children:a.email})]})]}),r("div",{className:"flex items-center gap-x-1",children:[e("div",{children:r(fA,{disabled:i||!b,value:a.role,onValueChange:e=>{return r=t._id,n=a.id,void h(r,n,{role:e}).then(()=>{p()});var r,n},children:[e(mA,{children:e(vT,{placeholder:"Select a role"})}),e(hA,{children:t?.roles.map(t=>e(pA,{value:t,children:t},t))})]})}),i&&e("span",{className:"text-xs bg-blue-100 text-blue-800 px-2 py-1 rounded",children:"You"}),!i&&b&&e(_i,{variant:"destructive",size:"sm",startIcon:e(Ai,{}),onClick:()=>{var e;e=a.id,m(t._id,e).then(()=>{p()})}})]})]},o)})}),0===l.length&&e("div",{className:"text-center py-8 text-gray-500",children:"No members found in this workspace."})]})};function yA({onInvite:t,workspaceId:n}){const[a,o]=f(""),[i,s]=f("admin"),[l,u]=f(!1),[d,m]=f(null),[h,p]=f(null),{addUser:g,getWorkspace:y}=AA(),[v,b]=f(null);c(()=>{n&&y(n).then(b)},[n]);const w=()=>{m(null),p(null),o(""),s("admin")};return r("div",{className:"flex gap-2 flex-col gap-y-2",children:[d&&e("div",{className:"text-red-500 capitalize",children:d}),h&&e("div",{className:"text-green-500 capitalize",children:h}),r("div",{children:[e(Pi,{children:"Invite member by email"}),e(Zi,{type:"email",value:a,onChange:e=>o(e.target.value),placeholder:"example@example.com"})]}),r("div",{children:[e(Pi,{children:"Role"}),r(fA,{value:i,onValueChange:s,children:[e(mA,{children:e(vT,{placeholder:"Select a role"})}),e(hA,{children:v?.roles.map(t=>e(pA,{value:t,children:t},t))})]})]}),e("div",{children:e(_i,{progress:l,onClick:async()=>{const e=a.trim();if(!e)return void m("Email is required");/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)?(u(!0),await g(n,e,i).then(()=>{p("User invited successfully"),t?.()}).catch(e=>{console.error(e),m(e.message||"Failed to invite member")}).finally(()=>{u(!1),setTimeout(()=>{w()},6e3)})):m("Invalid email address format")},disabled:l||!a||!i,children:l?"Inviting...":`Invite as ${i}`})})]})}const vA=({workspace:t,section:n,setSection:a})=>r("div",{className:"w-56 h-full flex flex-col px-2 py-2",children:[t&&e("div",{className:"mb-6 pb-4 border-b",children:r("div",{className:"flex items-center space-x-2 mb-2",children:[e("div",{className:"w-12 h-12 bg-blue-100 rounded flex items-center justify-center text-blue-600 font-medium px-0.5 py-0.5",children:e("img",{src:t.image,className:"w-full h-full object-contain"})}),r("div",{children:[e("div",{className:"font-medium text-sm",children:t.name}),e("div",{className:"text-xs text-gray-500",children:t.workspaceId})]})]})}),r("div",{className:"mb-6",children:[e("div",{className:"text-xs font-bold mb-2 text-gray-500 uppercase tracking-wide px-2",children:"Account"}),r("button",{className:Ko("flex w-full text-left px-2 py-1 rounded text-sm items-center gap-x-2","profile"===n?"bg-blue-100 text-blue-700 font-medium":"hover:bg-gray-100"),onClick:()=>a("profile"),children:[e(Ei,{className:"h-4 w-4"})," Profile"]})]}),r("div",{children:[e("div",{className:"text-xs font-bold mb-2 text-gray-500 uppercase tracking-wide px-2",children:"Workspace"}),r("button",{className:Ko("flex w-full text-left px-2 py-1 rounded text-sm items-center gap-x-2","general"===n?"bg-blue-100 text-blue-700 font-medium":"hover:bg-gray-100"),onClick:()=>a("general"),children:[e(xi,{className:"h-4 w-4"})," General"]}),r("button",{className:Ko("flex w-full text-left px-2 py-1 rounded text-sm items-center gap-x-2","users"===n?"bg-blue-100 text-blue-700 font-medium":"hover:bg-gray-100"),onClick:()=>a("users"),children:[e(Ci,{className:"h-4 w-4"})," Users"]}),r("button",{className:Ko("flex w-full text-left px-2 py-1 rounded text-sm items-center gap-x-2","features"===n?"bg-blue-100 text-blue-700 font-medium":"hover:bg-gray-100"),onClick:()=>a("features"),children:[e(Ti,{className:"h-4 w-4"})," Features"]})]})]}),bA=({workspace:t,onClose:n})=>{const[a,o]=f(!1),[i,s]=f("profile");return t?r(Im,{open:a,onOpenChange:e=>{o(e),e||n()},children:[e(Lm,{children:e(_i,{variant:"outline",size:"icon",children:e(xi,{className:"h-4 w-4"})})}),r(Um,{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",children:[e(vA,{workspace:t,section:i,setSection:s}),r("div",{className:"flex-1 p-6 overflow-auto flex flex-col bg-background",children:[r("h2",{className:"text-xl font-bold mb-4 capitalize",children:["profile"===i&&"Account","general"===i&&"Workspace Settings","users"===i&&"Workspace Members","features"===i&&"Workspace Features"]}),r("div",{className:"max-h-[500px] overflow-y-auto",children:["profile"===i&&e(Qk,{workspace:t}),"general"===i&&e(Hp,{workspace:t}),"users"===i&&e(gA,{workspace:t}),"features"===i&&e(Wp,{workspaceId:t._id?.toString()})]})]})]})]}):null};function wA(t){const{workspaces:n,currentWorkspace:a,loading:o,refreshing:i}=ne(e=>e.workspaces),s=ne(e=>e.auth.user),[l,u]=f(!1),[d,m]=f(0),[h,p]=f(""),{fetchWorkspaces:g,getFeatures:y,refreshWorkspaces:v,setCurrentWorkspace:b,workspaces:w}=AA(),S=o||i;c(()=>{0===w.length?(g(),y()):y()},[]),c(()=>{d>0&&v()},[d]);const x=w.length>0?w:n,k=x.filter(e=>e.name.toLowerCase().includes(h.toLowerCase())),T=e=>e.split(" ").map(e=>e[0]).join("").toUpperCase().slice(0,2);return r(Im,{open:l,onOpenChange:u,children:[e(Lm,{children:t.trigger?.(S,a)}),r(Um,{className:"max-w-2xl min-w-full sm:min-w-[800px]",children:[e(Vm,{children:r(jm,{className:"flex items-center gap-2",children:[e(mi,{className:"h-5 w-5"}),"Switch Workspace"]})}),!s&&e("div",{className:"flex flex-col items-center justify-center h-full py-4 sm:py-8",children:e("div",{className:"text-sm font-medium text-muted-foreground",children:"Looks like you are not logged in. Please login to continue."})}),s&&r("div",{className:"flex flex-col gap-4",children:[r("div",{className:"relative",children:[e(Si,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground pointer-events-none"}),e(Zi,{placeholder:"Search workspaces...",value:h,onChange:e=>p(e.target.value),className:"pl-10"})]}),a&&r("div",{children:[e("div",{className:"text-sm font-medium text-muted-foreground",children:"Current Workspace"}),r("div",{className:"flex items-center gap-3 rounded-lg border-2 p-3 border-border bg-muted text-muted-foreground",children:[r(dd,{className:"h-8 w-8 flex items-center justify-center",children:[e("div",{children:e(fd,{src:a.image})}),e(md,{children:T(a.name)})]}),r("div",{className:"flex-1 min-w-0",children:[e("div",{className:"flex items-center gap-2",children:e("span",{className:"font-medium truncate",children:a.name})}),r("div",{className:"flex items-center gap-1 text-sm text-muted-foreground",children:[e(Ci,{className:"h-3 w-3"}),r("span",{children:[a.users?.length||0," members"]})]})]})]})]}),e(_p,{}),r("div",{children:[r("div",{className:"flex items-center justify-between",children:[r("div",{className:"text-sm font-medium text-muted-foreground",children:["Available Workspaces (",k.length,")"]}),e("div",{children:e(_i,{progress:i,disabled:i,variant:"outline",onClick:function(){m(e=>e+1)},startIcon:e(wi,{}),children:i?"Refreshing...":"Refresh"})})]}),o?r("div",{className:"flex items-center justify-center py-8",children:[e(vi,{className:"h-6 w-6 animate-spin text-muted-foreground"}),e("span",{className:"ml-2 text-sm text-muted-foreground",children:"Loading workspaces..."})]}):0===k.length?r("div",{className:"text-center py-8",children:[e(mi,{className:"mx-auto h-12 w-12 text-muted-foreground"}),e("p",{className:"mt-2 text-sm text-muted-foreground",children:h?"No workspaces found":"No workspaces available"})]}):e(kp,{className:"h-64",children:e("div",{className:"flex flex-col gap-2 my-2.5",children:k.map(n=>{const o=n?.users?.length||0,i=n.createdBy===s?.id,l=n._id===a?._id;return r("div",{className:Ko("w-full justify-start h-auto p-3 rounded-none flex border border-border ",l&&"bg-muted"),children:[r(dd,{className:"h-8 w-8 mr-3",children:[e(fd,{src:n.image}),e(md,{children:T(n.name)})]}),r("div",{className:"flex-1 min-w-0 text-left",children:[r("div",{className:"flex items-center gap-2",children:[e("span",{className:"font-medium truncate",children:n.name}),i&&e(gi,{className:"h-3 w-3 text-amber-500"})]}),r("div",{className:"flex items-center gap-1 text-sm text-muted-foreground",children:[e(Ci,{className:"h-3 w-3"}),r("span",{children:[o," member",1!==o?"s":""]})]})]}),r("div",{className:"flex items-center gap-2",children:[e(_i,{size:"sm",disabled:l,onClick:async()=>{await t.onWorkspaceChange(n),b(n),u(!1)},children:l?"Current":"Switch to"}),e(bA,{workspace:n,onClose:()=>{if(a){const e=x.findIndex(e=>e._id?.toString()===a._id?.toString());-1!==e&&b(x[e])}}})]})]},n._id)})})})]}),e(_p,{}),e(SA,{onCreated:()=>{g()}})]})]})]})}function SA(n){const[a,o]=f(!1),[i,s]=f("emoji"),[l,c]=f("🏢"),[u,d]=f(!1),{createWorkspace:m}=AA(),h=zt({resolver:za(Zs({name:vs().min(2,{message:"Workspace name must be at least 2 characters."}),image:vs().optional()})),defaultValues:{name:"",image:""}});return r(Im,{open:a,onOpenChange:o,children:[e(Lm,{children:r(_i,{className:"w-full rounded-none",children:[e(bi,{className:"h-4 w-4 mr-2"}),"Create New Workspace"]})}),r(Um,{className:"max-w-xl min-w-full sm:min-w-[600px]",children:[r(Vm,{children:[e(jm,{children:"Create New Workspace"}),e($m,{children:"Create a new workspace to get started."})]}),e(Ii,{...h,children:r("form",{onSubmit:h.handleSubmit(async function(e){let t="";if("emoji"===i)t=Bp(l);else if("url"===i&&e.image)try{new URL(e.image),t=e.image}catch{return void h.setError("image",{message:"Please enter a valid URL"})}d(!0);try{await m(e.name,t),o(!1),h.reset(),c("🏢"),s("emoji"),n?.onCreated?.()}catch(e){console.error("Failed to create workspace:",e)}finally{d(!1)}}),children:[e(Fi,{control:h.control,name:"name",render:({field:t})=>r(Vi,{children:[e(ji,{children:"Workspace Name"}),e($i,{children:e(Zi,{placeholder:"My Awesome Workspace",...t})}),e(Bi,{})]})}),r("div",{className:"flex flex-col gap-y-2 my-2",children:[r("div",{children:[e(Pi,{className:"text-sm font-medium",children:"Workspace Icon"}),e(Wi,{children:"Choose an emoji or upload a custom image for your workspace."})]}),r(Fh,{value:i,onValueChange:e=>s(e),className:"flex flex-col gap-y-2",children:[r("div",{className:"flex items-center gap-x-2 my-1",children:[e(zh,{value:"emoji",id:"emoji"}),r(Pi,{htmlFor:"emoji",className:"flex items-center gap-2",children:[e(ki,{className:"h-4 w-4"}),"Choose Emoji"]})]}),r("div",{className:"flex items-center gap-x-2 my-1",children:[e(zh,{value:"url",id:"url"}),r(Pi,{htmlFor:"url",className:"flex items-center gap-2",children:[e(yi,{className:"h-4 w-4"}),"Custom Image URL"]})]})]}),"emoji"===i&&r("div",{className:"flex flex-col gap-y-2",children:[r("div",{className:"flex items-center gap-3",children:[e("span",{className:"text-sm font-medium",children:"Preview:"}),e("div",{className:"w-12 h-12 rounded-lg border-2 border-border flex items-center justify-center text-2xl bg-muted",children:l})]}),e(kp,{className:"h-32 w-full rounded-md border",children:e("div",{className:"p-4 grid grid-cols-8 gap-2",children:Zp.map((t,r)=>e("button",{type:"button",onClick:()=>(e=>{c(e),h.setValue("image",Bp(e))})(t),className:"w-8 h-8 rounded flex items-center justify-center text-lg hover:bg-muted transition-colors "+(l===t?"bg-primary text-primary-foreground":""),children:t},r))})})]}),"url"===i&&r("div",{className:"flex flex-col gap-y-2",children:[e(Fi,{control:h.control,name:"image",render:({field:t})=>r(Vi,{children:[e(ji,{children:"Image URL"}),e($i,{children:e(Zi,{placeholder:"https://example.com/image.png",...t})}),e(Wi,{children:"Enter a valid URL for your workspace image. Supports PNG, JPG, and SVG formats."}),e(Bi,{})]})}),h.watch("image")&&r("div",{className:"flex items-center gap-3",children:[e("span",{className:"text-sm font-medium",children:"Preview:"}),e("div",{className:"w-12 h-12 rounded-lg border-2 border-border overflow-hidden bg-muted",children:e("img",{src:h.watch("image"),alt:"Workspace preview",className:"w-full h-full object-cover",onError:e=>{e.currentTarget.style.display="none"}})})]})]})]}),r("div",{className:"flex justify-end gap-3 pt-4",children:[e(_i,{type:"button",variant:"outline",onClick:()=>{o(!1),h.reset(),c("🏢"),s("emoji")},disabled:u,children:"Cancel"}),e(_i,{type:"submit",disabled:u,children:u?r(t,{children:[e(vi,{className:"mr-2 h-4 w-4 animate-spin"}),"Creating..."]}):"Create Workspace"})]})]})})]})]})}const xA="saas-workspace-current",kA=()=>v(xA),TA=(e,t)=>!!e&&t.some(t=>t._id===e),AA=()=>{const e=ae(),t=ne(e=>e.os),r=s(()=>new zu(t),[t]),n=ne(e=>e.workspaces),o=l(t=>{t._id!==n.currentWorkspace?._id&&t&&e.workspaces(J(t))},[n.currentWorkspace,e]);c(()=>{if(!n.isInitialized){const t=kA();if(e.workspaces(X(!0)),t){const e=n.workspaces.find(e=>e._id===t);if(e){if(e._id===n.currentWorkspace?._id)return;o(e)}}}},[n.isInitialized,n.workspaces,n.currentWorkspace,e,o]);const i=l(()=>{e.workspaces(Y())},[e]),u=a.useRef(!1),d=a.useRef(!1),f=l(async()=>{if(!n.loading&&!u.current){u.current=!0,e.workspaces(Q(!0)),e.workspaces(ee(null));try{const t=await r.getWorkspaces();if(e.workspaces(K(t)),t.length>0){const e=kA();if(e&&TA(e,t)){const r=t.find(t=>t._id===e);r&&o(r)}else t.length>0&&(n.currentWorkspace||o(t[0]))}}catch(t){e.workspaces(ee(t instanceof Error?t.message:"Failed to fetch workspaces"))}finally{e.workspaces(Q(!1)),u.current=!1}}},[r,n.loading,n.currentWorkspace,e,o]),m=l(async()=>{if(!n.refreshing&&!u.current){u.current=!0,e.workspaces(te(!0));try{const t=await r.getWorkspaces();e.workspaces(K(t))}catch(e){}finally{e.workspaces(te(!1)),u.current=!1}}},[r,n.refreshing,e]),h=l(async(t,a)=>{const o=await r.createWorkspace({name:t,image:a});e.workspaces(K([...n.workspaces,o]))},[r,n.workspaces,e]),p=l(async(t,a)=>{const o=await r.updateWorkspace(t._id,a);e.workspaces(K(n.workspaces.map(e=>e._id===t._id?o:e)))},[r,n.workspaces,e]),g=l(async()=>{if(d.current)return n.allFeatures.length>0?n.allFeatures:null;if(n.allFeatures.length>0)return n.allFeatures;d.current=!0;try{const t=await r.getFeatures();return e.workspaces(q(t)),t}catch(e){return console.error("Failed to fetch features:",e),null}finally{d.current=!1}},[r,e,n.allFeatures]),y=l(async(e,t,n)=>await r.updateFeature(e,t,n),[r]);c(()=>{if(n.currentWorkspace?._id){const e=n.workspaces.find(e=>e._id===n.currentWorkspace?._id);if(e){if(e._id===n.currentWorkspace._id)return;o(e)}else if(n.workspaces.length>0){if(n.workspaces[0]._id===n.currentWorkspace._id)return;o(n.workspaces[0])}}},[n.currentWorkspace?._id,n.workspaces,o]);const v=l(async e=>await r.getWorkspaceUsers(e),[r]),b=l(async(e,t,n)=>await r.addUser(e,{email:t,role:n}),[r]),w=l(async(e,t)=>await r.removeUser(e,t),[r]),S=l(async(e,t,n)=>await r.updateUser(e,t,n),[r]),x=l(async e=>await r.updateUserProfile(e),[r]),k=l(async()=>await r.getProfile(),[r]),T=l(async e=>await r.getWorkspace(e),[r]);return{workspaces:n.workspaces,loading:n.loading,error:n.error,fetchWorkspaces:f,refreshWorkspaces:m,refreshing:n.refreshing,WorkspaceSwitcher:wA,currentWorkspace:n.currentWorkspace,setCurrentWorkspace:o,resetCurrentWorkspace:i,createWorkspace:h,allFeatures:n.allFeatures,getFeatures:g,updateFeature:y,getWorkspace:T,switching:n.switching,updateWorkspace:p,getUsers:v,addUser:b,removeUser:w,updateUser:S,getProfile:k,updateUserProfile:x}};function EA(){const e=ae(),t=ne(e=>e.auth),r=ne(e=>e.os),{serverUrl:n,orgId:a,auth:o}=r,{resetCurrentWorkspace:i}=AA(),c=l(async()=>{e.auth(R());try{const t=await Fu.post(`${n}/api/v1/auth/request`,{orgId:a,clientId:o?.clientId,redirect:{success:o?.redirectUrl||window.location.href,error:o?.redirectUrl||window.location.href}});if(!t.data.success)throw e.auth(O()),new Error(t.data.message||"Authentication failed");window.location.href=t.data.data.redirectUrl}catch(t){throw e.auth(O()),console.error("Sign in error:",t),t}},[n,a,o,e]),u=l(async()=>{try{e.auth(M()),i()}catch(e){console.error("Logout error:",e)}},[e,i]);return s(()=>({user:t.user,session:t.session,isLoading:t.isLoading,isAuthenticated:t.isAuthenticated,isRedirecting:t.isRedirecting,status:t.status,signIn:c,signOut:u}),[t,c,u])}const CA=e=>{const{children:t}=e,{status:r}=EA();return r!==y.authenticated?null:t},NA=e=>{const{children:t}=e,{status:r}=EA();return r===y.authenticated?null:t},_A=e=>{const{children:t,fallback:r,roles:n}=e,{user:a}=EA();return n.includes(a?.role??"")?t:r||null},RA=e=>{const{children:t,fallback:r,roles:n}=e,{user:a}=EA(),{currentWorkspace:o}=AA(),i=o?.users.find(e=>e._id===a?.id);return i&&n.includes(i?.role??"")?t:r||null},OA=e=>{const{children:t,slug:r}=e,{currentWorkspace:n}=AA(),a=n?.features?.[r];return a?t:null},DA=e=>{const{children:t,slug:r}=e,{currentWorkspace:n}=AA(),a=n?.features?.[r];return a?null:t};export{ul as BetaForm,fe as SaaSOSProvider,CA as WhenAuthenticated,_A as WhenRoles,NA as WhenUnauthenticated,DA as WhenWorkspaceFeatureDisabled,OA as WhenWorkspaceFeatureEnabled,RA as WhenWorkspaceRoles,wA as WorkspaceSwitcher,EA as useSaaSAuth,AA as useSaaSWorkspaces};
|
|
29
|
+
*/function nu(){return eu||(eu=1,"production"!==process.env.NODE_ENV&&function(){function e(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch(e){return!0}}"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=a,r="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},n=t.useState,o=t.useEffect,i=t.useLayoutEffect,s=t.useDebugValue,l=!1,c=!1,d="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(a,d){l||void 0===t.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();r(u,f)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),c=!0)}var m=(f=n({inst:{value:u,getSnapshot:d}}))[0].inst,p=f[1];return i(function(){m.value=u,m.getSnapshot=d,e(m)&&p({inst:m})},[a,u,d]),o(function(){return e(m)&&p({inst:m}),a(function(){e(m)&&p({inst:m})})},[a]),s(u),u};ru.useSyncExternalStore=void 0!==t.useSyncExternalStore?t.useSyncExternalStore:d,"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),ru}function au(){return tu||(tu=1,"production"===process.env.NODE_ENV?Yd.exports=Qd():Yd.exports=nu()),Yd.exports}var ou=au();function iu(){return()=>{}}var su="Avatar",[lu,cu]=Kd(su),[du,uu]=lu(su),fu=n.forwardRef((t,r)=>{const{__scopeAvatar:a,...o}=t,[i,s]=n.useState("idle");return e(du,{scope:a,imageLoadingStatus:i,onImageLoadingStatusChange:s,children:e(zi.span,{...o,ref:r})})});fu.displayName=su;var mu="AvatarImage",pu=n.forwardRef((t,r)=>{const{__scopeAvatar:a,src:o,onLoadingStatusChange:i=()=>{},...s}=t,l=uu(mu,a),c=function(e,{referrerPolicy:t,crossOrigin:r}){const a=ou.useSyncExternalStore(iu,()=>!0,()=>!1),o=n.useRef(null),i=a?(o.current||(o.current=new window.Image),o.current):null,[s,l]=n.useState(()=>vu(i,e));return Jd(()=>{l(vu(i,e))},[i,e]),Jd(()=>{const e=e=>()=>{l(e)};if(!i)return;const n=e("loaded"),a=e("error");return i.addEventListener("load",n),i.addEventListener("error",a),t&&(i.referrerPolicy=t),"string"==typeof r&&(i.crossOrigin=r),()=>{i.removeEventListener("load",n),i.removeEventListener("error",a)}},[i,r,t]),s}(o,s),d=Zd(e=>{i(e),l.onImageLoadingStatusChange(e)});return Jd(()=>{"idle"!==c&&d(c)},[c,d]),"loaded"===c?e(zi.img,{...s,ref:r,src:o}):null});pu.displayName=mu;var hu="AvatarFallback",gu=n.forwardRef((t,r)=>{const{__scopeAvatar:a,delayMs:o,...i}=t,s=uu(hu,a),[l,c]=n.useState(void 0===o);return n.useEffect(()=>{if(void 0!==o){const e=window.setTimeout(()=>c(!0),o);return()=>window.clearTimeout(e)}},[o]),l&&"loaded"!==s.imageLoadingStatus?e(zi.span,{...i,ref:r}):null});function vu(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}gu.displayName=hu;var bu=fu,yu=pu,wu=gu;const xu=n.forwardRef(({className:t,...r},n)=>e(bu,{ref:n,className:ti("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",t),...r}));xu.displayName=bu.displayName;const Su=n.forwardRef(({className:t,...r},n)=>e(yu,{ref:n,className:ti("aspect-square h-full w-full",t),...r}));Su.displayName=yu.displayName;const ku=n.forwardRef(({className:t,...r},n)=>e(wu,{ref:n,className:ti("flex h-full w-full items-center justify-center rounded-full bg-muted",t),...r}));function Au(e,t,{checkForDefaultPrevented:r=!0}={}){return function(n){if(e?.(n),!1===r||!n.defaultPrevented)return t?.(n)}}ku.displayName=wu.displayName;var Eu=n[" useId ".trim().toString()]||(()=>{}),Cu=0;function Tu(e){const[t,r]=n.useState(Eu());return Jd(()=>{r(e=>e??String(Cu++))},[e]),e||(t?`radix-${t}`:"")}var Nu=n[" useInsertionEffect ".trim().toString()]||Jd;function _u({prop:e,defaultProp:t,onChange:r=()=>{},caller:a}){const[o,i,s]=function({defaultProp:e,onChange:t}){const[r,a]=n.useState(e),o=n.useRef(r),i=n.useRef(t);return Nu(()=>{i.current=t},[t]),n.useEffect(()=>{o.current!==r&&(i.current?.(r),o.current=r)},[r,o]),[r,a,i]}({defaultProp:t,onChange:r}),l=void 0!==e,c=l?e:o;{const t=n.useRef(void 0!==e);n.useEffect(()=>{const e=t.current;if(e!==l){const t=e?"controlled":"uncontrolled",r=l?"controlled":"uncontrolled";console.warn(`${a} 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,a])}const d=n.useCallback(t=>{if(l){const r=function(e){return"function"==typeof e}(t)?t(e):t;r!==e&&s.current?.(r)}else i(t)},[l,e,i,s]);return[c,d]}var Ru,Pu="dismissableLayer.update",Ou="dismissableLayer.pointerDownOutside",Du="dismissableLayer.focusOutside",Iu=n.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Mu=n.forwardRef((t,r)=>{const{disableOutsidePointerEvents:a=!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:l,onDismiss:c,...d}=t,u=n.useContext(Iu),[f,m]=n.useState(null),p=f?.ownerDocument??globalThis?.document,[,h]=n.useState({}),g=ai(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=Zd(e),a=n.useRef(!1),o=n.useRef(()=>{});return n.useEffect(()=>{const e=e=>{if(e.target&&!a.current){let n=function(){Lu(Ou,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);a.current=!1},n=window.setTimeout(()=>{t.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(n),t.removeEventListener("pointerdown",e),t.removeEventListener("click",o.current)}},[t,r]),{onPointerDownCapture:()=>a.current=!0}}(e=>{const t=e.target,r=[...u.branches].some(e=>e.contains(t));S&&!r&&(i?.(e),l?.(e),e.defaultPrevented||c?.())},p),A=function(e,t=globalThis?.document){const r=Zd(e),a=n.useRef(!1);return n.useEffect(()=>{const e=e=>{if(e.target&&!a.current){Lu(Du,r,{originalEvent:e},{discrete:!1})}};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)},[t,r]),{onFocusCapture:()=>a.current=!0,onBlurCapture:()=>a.current=!1}}(e=>{const t=e.target;[...u.branches].some(e=>e.contains(t))||(s?.(e),l?.(e),e.defaultPrevented||c?.())},p);return function(e,t=globalThis?.document){const r=Zd(e);n.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),n.useEffect(()=>{if(f)return a&&(0===u.layersWithOutsidePointerEventsDisabled.size&&(Ru=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),Uu(),()=>{a&&1===u.layersWithOutsidePointerEventsDisabled.size&&(p.body.style.pointerEvents=Ru)}},[f,p,a,u]),n.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),Uu())},[f,u]),n.useEffect(()=>{const e=()=>h({});return document.addEventListener(Pu,e),()=>document.removeEventListener(Pu,e)},[]),e(zi.div,{...d,ref:g,style:{pointerEvents:x?S?"auto":"none":void 0,...t.style},onFocusCapture:Au(t.onFocusCapture,A.onFocusCapture),onBlurCapture:Au(t.onBlurCapture,A.onBlurCapture),onPointerDownCapture:Au(t.onPointerDownCapture,k.onPointerDownCapture)})});Mu.displayName="DismissableLayer";function Uu(){const e=new CustomEvent(Pu);document.dispatchEvent(e)}function Lu(e,t,r,{discrete:n}){const a=r.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&a.addEventListener(e,t,{once:!0}),n?function(e,t){e&&h.flushSync(()=>e.dispatchEvent(t))}(a,o):a.dispatchEvent(o)}n.forwardRef((t,r)=>{const a=n.useContext(Iu),o=n.useRef(null),i=ai(r,o);return n.useEffect(()=>{const e=o.current;if(e)return a.branches.add(e),()=>{a.branches.delete(e)}},[a.branches]),e(zi.div,{...t,ref:i})}).displayName="DismissableLayerBranch";var zu="focusScope.autoFocusOnMount",Fu="focusScope.autoFocusOnUnmount",ju={bubbles:!1,cancelable:!0},Bu=n.forwardRef((t,r)=>{const{loop:a=!1,trapped:o=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...l}=t,[c,d]=n.useState(null),u=Zd(i),f=Zd(s),m=n.useRef(null),p=ai(r,e=>d(e)),h=n.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;n.useEffect(()=>{if(o){let e=function(e){if(h.paused||!c)return;const t=e.target;c.contains(t)?m.current=t:Gu(m.current,{select:!0})},t=function(e){if(h.paused||!c)return;const t=e.relatedTarget;null!==t&&(c.contains(t)||Gu(m.current,{select:!0}))},r=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&Gu(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]),n.useEffect(()=>{if(c){Ku.add(h);const t=document.activeElement;if(!c.contains(t)){const r=new CustomEvent(zu,ju);c.addEventListener(zu,u),c.dispatchEvent(r),r.defaultPrevented||(!function(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(Gu(n,{select:t}),document.activeElement!==r)return}((e=Vu(c),e.filter(e=>"A"!==e.tagName)),{select:!0}),document.activeElement===t&&Gu(c))}return()=>{c.removeEventListener(zu,u),setTimeout(()=>{const e=new CustomEvent(Fu,ju);c.addEventListener(Fu,f),c.dispatchEvent(e),e.defaultPrevented||Gu(t??document.body,{select:!0}),c.removeEventListener(Fu,f),Ku.remove(h)},0)}}var e},[c,u,f,h]);const g=n.useCallback(e=>{if(!a&&!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,[n,o]=function(e){const t=Vu(e),r=$u(t,e),n=$u(t.reverse(),e);return[r,n]}(t);n&&o?e.shiftKey||r!==o?e.shiftKey&&r===n&&(e.preventDefault(),a&&Gu(o,{select:!0})):(e.preventDefault(),a&&Gu(n,{select:!0})):r===t&&e.preventDefault()}},[a,o,h.paused]);return e(zi.div,{tabIndex:-1,...l,ref:p,onKeyDown:g})});function Vu(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(!Wu(r,{upTo:t}))return r}function Wu(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 Gu(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()}}Bu.displayName="FocusScope";var Ku=function(){let e=[];return{add(t){const r=e[0];t!==r&&r?.pause(),e=Hu(e,t),e.unshift(t)},remove(t){e=Hu(e,t),e[0]?.resume()}}}();function Hu(e,t){const r=[...e],n=r.indexOf(t);return-1!==n&&r.splice(n,1),r}var Zu=n.forwardRef((t,r)=>{const{container:a,...o}=t,[i,s]=n.useState(!1);Jd(()=>s(!0),[]);const l=a||i&&globalThis?.document?.body;return l?g.createPortal(e(zi.div,{...o,ref:r}),l):null});Zu.displayName="Portal";var qu=e=>{const{present:t,children:r}=e,a=function(e){const[t,r]=n.useState(),a=n.useRef(null),o=n.useRef(e),i=n.useRef("none"),s=e?"mounted":"unmounted",[l,c]=function(e,t){return n.useReducer((e,r)=>t[e][r]??e,e)}(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return n.useEffect(()=>{const e=Ju(a.current);i.current="mounted"===l?e:"none"},[l]),Jd(()=>{const t=a.current,r=o.current;if(r!==e){const n=i.current,a=Ju(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]),Jd(()=>{if(t){let e;const r=t.ownerDocument.defaultView??window,n=n=>{const i=Ju(a.current).includes(CSS.escape(n.animationName));if(n.target===t&&i&&(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)})}},s=e=>{e.target===t&&(i.current=Ju(a.current))};return t.addEventListener("animationstart",s),t.addEventListener("animationcancel",n),t.addEventListener("animationend",n),()=>{r.clearTimeout(e),t.removeEventListener("animationstart",s),t.removeEventListener("animationcancel",n),t.removeEventListener("animationend",n)}}c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:n.useCallback(e=>{a.current=e?getComputedStyle(e):null,r(e)},[])}}(t),o="function"==typeof r?r({present:a.isPresent}):n.Children.only(r),i=ai(a.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||a.isPresent?n.cloneElement(o,{ref:i}):null};function Ju(e){return e?.animationName||"none"}qu.displayName="Presence";var Yu=0;function Xu(){n.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Qu()),document.body.insertAdjacentElement("beforeend",e[1]??Qu()),Yu++,()=>{1===Yu&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),Yu--}},[])}function Qu(){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 ef=function(){return ef=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},ef.apply(this,arguments)};function tf(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 rf="right-scroll-bar-position",nf="width-before-scroll-bar";function af(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var of="undefined"!=typeof window?n.useLayoutEffect:n.useEffect,sf=new WeakMap;function lf(e,t){var r,n,a,o=(r=null,n=function(t){return e.forEach(function(e){return af(e,t)})},(a=f(function(){return{value:r,callback:n,facade:{get current(){return a.value},set current(e){var t=a.value;t!==e&&(a.value=e,a.callback(e,t))}}}})[0]).callback=n,a.facade);return of(function(){var t=sf.get(o);if(t){var r=new Set(t),n=new Set(e),a=o.current;r.forEach(function(e){n.has(e)||af(e,null)}),n.forEach(function(e){r.has(e)||af(e,a)})}sf.set(o,e)},[e]),o}function cf(e){return e}var df=function(e){var t=e.sideCar,r=tf(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var a=t.read();if(!a)throw new Error("Sidecar medium not found");return n.createElement(a,ef({},r))};df.isSideCarExport=!0;var uf=function(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=cf);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)},i=function(){return Promise.resolve().then(o)};i(),r={push:function(e){t.push(e),i()},filter:function(e){return t=t.filter(e),r}}}}}(null);return t.options=ef({async:!0,ssr:!1},e),t}(),ff=function(){},mf=n.forwardRef(function(e,t){var r=n.useRef(null),a=n.useState({onScrollCapture:ff,onWheelCapture:ff,onTouchMoveCapture:ff}),o=a[0],i=a[1],s=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=tf(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=m,k=lf([r,t]),A=ef(ef({},x),o);return n.createElement(n.Fragment,null,u&&n.createElement(S,{sideCar:uf,removeScrollBar:d,shards:f,noRelative:p,noIsolation:h,inert:g,setCallbacks:i,allowPinchZoom:!!v,lockRef:r,gapMode:w}),s?n.cloneElement(n.Children.only(l),ef(ef({},A),{ref:k})):n.createElement(y,ef({},A,{className:c,ref:k}),l))});mf.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},mf.classNames={fullWidth:nf,zeroRight:rf};function pf(){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 hf=function(){var e=0,t=null;return{add:function(r){var n,a;0==e&&(t=pf())&&(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)}}},gf=function(){var e,t=(e=hf(),function(t,r){n.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}},vf={left:0,top:0,right:0,gap:0},bf=function(e){return parseInt(e||"",10)||0},yf=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return vf;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[bf(r),bf(n),bf(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])}},wf=gf(),xf="data-scroll-locked",Sf=function(e,t,r,n){var a=e.left,o=e.top,i=e.right,s=e.gap;return void 0===r&&(r="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(n,";\n padding-right: ").concat(s,"px ").concat(n,";\n }\n body[").concat(xf,"] {\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(i,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(s,"px ").concat(n,";\n "),"padding"===r&&"padding-right: ".concat(s,"px ").concat(n,";")].filter(Boolean).join(""),"\n }\n \n .").concat(rf," {\n right: ").concat(s,"px ").concat(n,";\n }\n \n .").concat(nf," {\n margin-right: ").concat(s,"px ").concat(n,";\n }\n \n .").concat(rf," .").concat(rf," {\n right: 0 ").concat(n,";\n }\n \n .").concat(nf," .").concat(nf," {\n margin-right: 0 ").concat(n,";\n }\n \n body[").concat(xf,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(s,"px;\n }\n")},kf=function(){var e=parseInt(document.body.getAttribute(xf)||"0",10);return isFinite(e)?e:0},Af=function(e){var t=e.noRelative,r=e.noImportant,a=e.gapMode,o=void 0===a?"margin":a;n.useEffect(function(){return document.body.setAttribute(xf,(kf()+1).toString()),function(){var e=kf()-1;e<=0?document.body.removeAttribute(xf):document.body.setAttribute(xf,e.toString())}},[]);var i=n.useMemo(function(){return yf(o)},[o]);return n.createElement(wf,{styles:Sf(i,!t,o,r?"":"!important")})},Ef=!1;if("undefined"!=typeof window)try{var Cf=Object.defineProperty({},"passive",{get:function(){return Ef=!0,!0}});window.addEventListener("test",Cf,Cf),window.removeEventListener("test",Cf,Cf)}catch(e){Ef=!1}var Tf=!!Ef&&{passive:!1},Nf=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])},_f=function(e,t){var r=t.ownerDocument,n=t;do{if("undefined"!=typeof ShadowRoot&&n instanceof ShadowRoot&&(n=n.host),Rf(e,n)){var a=Pf(e,n);if(a[1]>a[2])return!0}n=n.parentNode}while(n&&n!==r.body);return!1},Rf=function(e,t){return"v"===e?function(e){return Nf(e,"overflowY")}(t):function(e){return Nf(e,"overflowX")}(t)},Pf=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},Of=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Df=function(e){return[e.deltaX,e.deltaY]},If=function(e){return e&&"current"in e?e.current:e},Mf=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},Uf=0,Lf=[];function zf(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Ff,jf=(Ff=function(e){var t=n.useRef([]),r=n.useRef([0,0]),a=n.useRef(),o=n.useState(Uf++)[0],i=n.useState(gf)[0],s=n.useRef(e);n.useEffect(function(){s.current=e},[e]),n.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(If),!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=n.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!s.current.allowPinchZoom;var n,o=Of(e),i=r.current,l="deltaX"in e?e.deltaX:i[0]-o[0],c="deltaY"in e?e.deltaY:i[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=_f(u,d);if(!f)return!0;if(f?n=u:(n="v"===u?"h":"v",f=_f(u,d)),!f)return!1;if(!a.current&&"changedTouches"in e&&(l||c)&&(a.current=n),!n)return!0;var m=a.current||n;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,i=r.target,s=t.contains(i),l=!1,c=o>0,d=0,u=0;do{if(!i)break;var f=Pf(e,i),m=f[0],p=f[1]-f[2]-a*m;(m||p)&&Rf(e,i)&&(d+=p,u+=m);var h=i.parentNode;i=h&&h.nodeType===Node.DOCUMENT_FRAGMENT_NODE?h.host:h}while(!s&&i!==document.body||s&&(t.contains(i)||t===i));return(c&&Math.abs(d)<1||!c&&Math.abs(u)<1)&&(l=!0),l}(m,t,e,"h"===m?l:c)},[]),c=n.useCallback(function(e){var r=e;if(Lf.length&&Lf[Lf.length-1]===i){var n="deltaY"in r?Df(r):Of(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=(s.current.shards||[]).map(If).filter(Boolean).filter(function(e){return e.contains(r.target)});(o.length>0?l(r,o[0]):!s.current.noIsolation)&&r.cancelable&&r.preventDefault()}}},[]),d=n.useCallback(function(e,r,n,a){var o={name:e,delta:r,target:n,should:a,shadowParent:zf(n)};t.current.push(o),setTimeout(function(){t.current=t.current.filter(function(e){return e!==o})},1)},[]),u=n.useCallback(function(e){r.current=Of(e),a.current=void 0},[]),f=n.useCallback(function(t){d(t.type,Df(t),t.target,l(t,e.lockRef.current))},[]),m=n.useCallback(function(t){d(t.type,Of(t),t.target,l(t,e.lockRef.current))},[]);n.useEffect(function(){return Lf.push(i),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:m}),document.addEventListener("wheel",c,Tf),document.addEventListener("touchmove",c,Tf),document.addEventListener("touchstart",u,Tf),function(){Lf=Lf.filter(function(e){return e!==i}),document.removeEventListener("wheel",c,Tf),document.removeEventListener("touchmove",c,Tf),document.removeEventListener("touchstart",u,Tf)}},[]);var p=e.removeScrollBar,h=e.inert;return n.createElement(n.Fragment,null,h?n.createElement(i,{styles:Mf(o)}):null,p?n.createElement(Af,{noRelative:e.noRelative,gapMode:e.gapMode}):null)},uf.useMedium(Ff),df),Bf=n.forwardRef(function(e,t){return n.createElement(mf,ef({},e,{ref:t,sideCar:jf}))});Bf.classNames=mf.classNames;var Vf=new WeakMap,$f=new WeakMap,Wf={},Gf=0,Kf=function(e){return e&&(e.host||Kf(e.parentNode))},Hf=function(e,t,r,n){var a=function(e,t){return t.map(function(t){if(e.contains(t))return t;var r=Kf(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]);Wf[r]||(Wf[r]=new WeakMap);var o=Wf[r],i=[],s=new Set,l=new Set(a),c=function(e){e&&!s.has(e)&&(s.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(s.has(e))d(e);else try{var t=e.getAttribute(n),a=null!==t&&"false"!==t,l=(Vf.get(e)||0)+1,c=(o.get(e)||0)+1;Vf.set(e,l),o.set(e,c),i.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),s.clear(),Gf++,function(){i.forEach(function(e){var t=Vf.get(e)-1,a=o.get(e)-1;Vf.set(e,t),o.set(e,a),t||($f.has(e)||e.removeAttribute(n),$f.delete(e)),a||e.removeAttribute(r)}),--Gf||(Vf=new WeakMap,Vf=new WeakMap,$f=new WeakMap,Wf={})}},Zf=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"))),Hf(n,a,r,"aria-hidden")):function(){return null}},qf="Dialog",[Jf,Yf]=Kd(qf),[Xf,Qf]=Jf(qf),em=t=>{const{__scopeDialog:r,children:a,open:o,defaultOpen:i,onOpenChange:s,modal:l=!0}=t,c=n.useRef(null),d=n.useRef(null),[u,f]=_u({prop:o,defaultProp:i??!1,onChange:s,caller:qf});return e(Xf,{scope:r,triggerRef:c,contentRef:d,contentId:Tu(),titleId:Tu(),descriptionId:Tu(),open:u,onOpenChange:f,onOpenToggle:n.useCallback(()=>f(e=>!e),[f]),modal:l,children:a})};em.displayName=qf;var tm="DialogTrigger",rm=n.forwardRef((t,r)=>{const{__scopeDialog:n,...a}=t,o=Qf(tm,n),i=ai(r,o.triggerRef);return e(zi.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Sm(o.open),...a,ref:i,onClick:Au(t.onClick,o.onOpenToggle)})});rm.displayName=tm;var nm="DialogPortal",[am,om]=Jf(nm,{forceMount:void 0}),im=t=>{const{__scopeDialog:r,forceMount:a,children:o,container:i}=t,s=Qf(nm,r);return e(am,{scope:r,forceMount:a,children:n.Children.map(o,t=>e(qu,{present:a||s.open,children:e(Zu,{asChild:!0,container:i,children:t})}))})};im.displayName=nm;var sm="DialogOverlay",lm=n.forwardRef((t,r)=>{const n=om(sm,t.__scopeDialog),{forceMount:a=n.forceMount,...o}=t,i=Qf(sm,t.__scopeDialog);return i.modal?e(qu,{present:a||i.open,children:e(dm,{...o,ref:r})}):null});lm.displayName=sm;var cm=oi("DialogOverlay.RemoveScroll"),dm=n.forwardRef((t,r)=>{const{__scopeDialog:n,...a}=t,o=Qf(sm,n);return e(Bf,{as:cm,allowPinchZoom:!0,shards:[o.contentRef],children:e(zi.div,{"data-state":Sm(o.open),...a,ref:r,style:{pointerEvents:"auto",...a.style}})})}),um="DialogContent",fm=n.forwardRef((t,r)=>{const n=om(um,t.__scopeDialog),{forceMount:a=n.forceMount,...o}=t,i=Qf(um,t.__scopeDialog);return e(qu,{present:a||i.open,children:i.modal?e(mm,{...o,ref:r}):e(pm,{...o,ref:r})})});fm.displayName=um;var mm=n.forwardRef((t,r)=>{const a=Qf(um,t.__scopeDialog),o=n.useRef(null),i=ai(r,a.contentRef,o);return n.useEffect(()=>{const e=o.current;if(e)return Zf(e)},[]),e(hm,{...t,ref:i,trapFocus:a.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Au(t.onCloseAutoFocus,e=>{e.preventDefault(),a.triggerRef.current?.focus()}),onPointerDownOutside:Au(t.onPointerDownOutside,e=>{const t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;(2===t.button||r)&&e.preventDefault()}),onFocusOutside:Au(t.onFocusOutside,e=>e.preventDefault())})}),pm=n.forwardRef((t,r)=>{const a=Qf(um,t.__scopeDialog),o=n.useRef(!1),i=n.useRef(!1);return e(hm,{...t,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:e=>{t.onCloseAutoFocus?.(e),e.defaultPrevented||(o.current||a.triggerRef.current?.focus(),e.preventDefault()),o.current=!1,i.current=!1},onInteractOutside:e=>{t.onInteractOutside?.(e),e.defaultPrevented||(o.current=!0,"pointerdown"===e.detail.originalEvent.type&&(i.current=!0));const r=e.target,n=a.triggerRef.current?.contains(r);n&&e.preventDefault(),"focusin"===e.detail.originalEvent.type&&i.current&&e.preventDefault()}})}),hm=n.forwardRef((a,o)=>{const{__scopeDialog:i,trapFocus:s,onOpenAutoFocus:l,onCloseAutoFocus:c,...d}=a,u=Qf(um,i),f=n.useRef(null),m=ai(o,f);return Xu(),r(t,{children:[e(Bu,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:l,onUnmountAutoFocus:c,children:e(Mu,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":Sm(u.open),...d,ref:m,onDismiss:()=>u.onOpenChange(!1)})}),r(t,{children:[e(Cm,{titleId:u.titleId}),e(Tm,{contentRef:f,descriptionId:u.descriptionId})]})]})}),gm="DialogTitle",vm=n.forwardRef((t,r)=>{const{__scopeDialog:n,...a}=t,o=Qf(gm,n);return e(zi.h2,{id:o.titleId,...a,ref:r})});vm.displayName=gm;var bm="DialogDescription",ym=n.forwardRef((t,r)=>{const{__scopeDialog:n,...a}=t,o=Qf(bm,n);return e(zi.p,{id:o.descriptionId,...a,ref:r})});ym.displayName=bm;var wm="DialogClose",xm=n.forwardRef((t,r)=>{const{__scopeDialog:n,...a}=t,o=Qf(wm,n);return e(zi.button,{type:"button",...a,ref:r,onClick:Au(t.onClick,()=>o.onOpenChange(!1))})});function Sm(e){return e?"open":"closed"}xm.displayName=wm;var km="DialogTitleWarning",[Am,Em]=function(t,r){const a=n.createContext(r),o=t=>{const{children:r,...o}=t,i=n.useMemo(()=>o,Object.values(o));return e(a.Provider,{value:i,children:r})};return o.displayName=t+"Provider",[o,function(e){const o=n.useContext(a);if(o)return o;if(void 0!==r)return r;throw new Error(`\`${e}\` must be used within \`${t}\``)}]}(km,{contentName:um,titleName:gm,docsSlug:"dialog"}),Cm=({titleId:e})=>{const t=Em(km),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 n.useEffect(()=>{if(e){document.getElementById(e)||console.error(r)}},[r,e]),null},Tm=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Em("DialogDescriptionWarning").contentName}}.`;return n.useEffect(()=>{const n=e.current?.getAttribute("aria-describedby");if(t&&n){document.getElementById(t)||console.warn(r)}},[r,e,t]),null},Nm=em,_m=rm,Rm=im,Pm=lm,Om=fm,Dm=vm,Im=ym,Mm=xm;function Um(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 Lm=["color"],zm=d(function(e,t){var r=e.color,n=void 0===r?"currentColor":r,a=Um(e,Lm);return u("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),u("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:n,fillRule:"evenodd",clipRule:"evenodd"}))}),Fm=["color"],jm=d(function(e,t){var r=e.color,n=void 0===r?"currentColor":r,a=Um(e,Fm);return u("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),u("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:n,fillRule:"evenodd",clipRule:"evenodd"}))}),Bm=["color"],Vm=d(function(e,t){var r=e.color,n=void 0===r?"currentColor":r,a=Um(e,Bm);return u("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),u("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:n,fillRule:"evenodd",clipRule:"evenodd"}))}),$m=["color"],Wm=d(function(e,t){var r=e.color,n=void 0===r?"currentColor":r,a=Um(e,$m);return u("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),u("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:n,fillRule:"evenodd",clipRule:"evenodd"}))});const Gm=Nm,Km=_m,Hm=Rm,Zm=n.forwardRef(({className:t,...r},n)=>e(Pm,{ref:n,className:ti("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}));Zm.displayName=Pm.displayName;const qm=n.forwardRef(({className:t,children:a,...o},i)=>{const{container:s}=n.useContext(ge);return r(Hm,{container:s,children:[e(Zm,{}),r(Om,{ref:i,className:ti("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),...o,children:[a,r(Mm,{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(Vm,{className:"h-4 w-4"}),e("span",{className:"sr-only",children:"Close"})]})]})]})});qm.displayName=Om.displayName;const Jm=({className:t,...r})=>e("div",{className:ti("flex flex-col space-y-1.5 text-center sm:text-left",t),...r});Jm.displayName="DialogHeader";const Ym=n.forwardRef(({className:t,...r},n)=>e(Dm,{ref:n,className:ti("text-lg font-semibold leading-none tracking-tight",t),...r}));Ym.displayName=Dm.displayName;const Xm=n.forwardRef(({className:t,...r},n)=>e(Im,{ref:n,className:ti("text-sm text-muted-foreground",t),...r}));function Qm(t){const r=t+"CollectionProvider",[n,o]=Kd(r),[i,s]=n(r,{collectionRef:{current:null},itemMap:new Map}),l=t=>{const{scope:r,children:n}=t,o=a.useRef(null),s=a.useRef(new Map).current;return e(i,{scope:r,itemMap:s,collectionRef:o,children:n})};l.displayName=r;const c=t+"CollectionSlot",d=oi(c),u=a.forwardRef((t,r)=>{const{scope:n,children:a}=t,o=ai(r,s(c,n).collectionRef);return e(d,{ref:o,children:a})});u.displayName=c;const f=t+"CollectionItemSlot",m="data-radix-collection-item",p=oi(f),h=a.forwardRef((t,r)=>{const{scope:n,children:o,...i}=t,l=a.useRef(null),c=ai(r,l),d=s(f,n);return a.useEffect(()=>(d.itemMap.set(l,{ref:l,...i}),()=>{d.itemMap.delete(l)})),e(p,{[m]:"",ref:c,children:o})});return h.displayName=f,[{Provider:l,Slot:u,ItemSlot:h},function(e){const r=s(t+"CollectionConsumer",e),n=a.useCallback(()=>{const e=r.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${m}]`)),n=Array.from(r.itemMap.values()).sort((e,r)=>t.indexOf(e.ref.current)-t.indexOf(r.ref.current));return n},[r.collectionRef,r.itemMap]);return n},o]}Xm.displayName=Im.displayName;var ep=n.createContext(void 0);function tp(e){const t=n.useContext(ep);return e||t||"ltr"}var rp="rovingFocusGroup.onEntryFocus",np={bubbles:!1,cancelable:!0},ap="RovingFocusGroup",[op,ip,sp]=Qm(ap),[lp,cp]=Kd(ap,[sp]),[dp,up]=lp(ap),fp=n.forwardRef((t,r)=>e(op.Provider,{scope:t.__scopeRovingFocusGroup,children:e(op.Slot,{scope:t.__scopeRovingFocusGroup,children:e(mp,{...t,ref:r})})}));fp.displayName=ap;var mp=n.forwardRef((t,r)=>{const{__scopeRovingFocusGroup:a,orientation:o,loop:i=!1,dir:s,currentTabStopId:l,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:d,onEntryFocus:u,preventScrollOnEntryFocus:f=!1,...m}=t,p=n.useRef(null),h=ai(r,p),g=tp(s),[v,b]=_u({prop:l,defaultProp:c??null,onChange:d,caller:ap}),[y,w]=n.useState(!1),x=Zd(u),S=ip(a),k=n.useRef(!1),[A,E]=n.useState(0);return n.useEffect(()=>{const e=p.current;if(e)return e.addEventListener(rp,x),()=>e.removeEventListener(rp,x)},[x]),e(dp,{scope:a,orientation:o,dir:g,loop:i,currentTabStopId:v,onItemFocus:n.useCallback(e=>b(e),[b]),onItemShiftTab:n.useCallback(()=>w(!0),[]),onFocusableItemAdd:n.useCallback(()=>E(e=>e+1),[]),onFocusableItemRemove:n.useCallback(()=>E(e=>e-1),[]),children:e(zi.div,{tabIndex:y||0===A?-1:0,"data-orientation":o,...m,ref:h,style:{outline:"none",...t.style},onMouseDown:Au(t.onMouseDown,()=>{k.current=!0}),onFocus:Au(t.onFocus,e=>{const t=!k.current;if(e.target===e.currentTarget&&t&&!y){const t=new CustomEvent(rp,np);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=S().filter(e=>e.focusable);vp([e.find(e=>e.active),e.find(e=>e.id===v),...e].filter(Boolean).map(e=>e.ref.current),f)}}k.current=!1}),onBlur:Au(t.onBlur,()=>w(!1))})})}),pp="RovingFocusGroupItem",hp=n.forwardRef((t,r)=>{const{__scopeRovingFocusGroup:a,focusable:o=!0,active:i=!1,tabStopId:s,children:l,...c}=t,d=Tu(),u=s||d,f=up(pp,a),m=f.currentTabStopId===u,p=ip(a),{onFocusableItemAdd:h,onFocusableItemRemove:g,currentTabStopId:v}=f;return n.useEffect(()=>{if(o)return h(),()=>g()},[o,h,g]),e(op.ItemSlot,{scope:a,id:u,focusable:o,active:i,children:e(zi.span,{tabIndex:m?0:-1,"data-orientation":f.orientation,...c,ref:r,onMouseDown:Au(t.onMouseDown,e=>{o?f.onItemFocus(u):e.preventDefault()}),onFocus:Au(t.onFocus,()=>f.onItemFocus(u)),onKeyDown:Au(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:gp[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(()=>vp(r))}}),children:"function"==typeof l?l({isCurrentTabStop:m,hasTabStop:null!=v}):l})})});hp.displayName=pp;var gp={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function vp(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 bp=fp,yp=hp;function wp(e){const[t,r]=n.useState(void 0);return Jd(()=>{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 xp(e){const t=n.useRef({value:e,previous:e});return n.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Sp="Radio",[kp,Ap]=Kd(Sp),[Ep,Cp]=kp(Sp),Tp=n.forwardRef((t,a)=>{const{__scopeRadio:o,name:i,checked:s=!1,required:l,disabled:c,value:d="on",onCheck:u,form:f,...m}=t,[p,h]=n.useState(null),g=ai(a,e=>h(e)),v=n.useRef(!1),b=!p||(f||!!p.closest("form"));return r(Ep,{scope:o,checked:s,disabled:c,children:[e(zi.button,{type:"button",role:"radio","aria-checked":s,"data-state":Pp(s),"data-disabled":c?"":void 0,disabled:c,value:d,...m,ref:g,onClick:Au(t.onClick,e=>{s||u?.(),b&&(v.current=e.isPropagationStopped(),v.current||e.stopPropagation())})}),b&&e(Rp,{control:p,bubbles:!v.current,name:i,value:d,checked:s,required:l,disabled:c,form:f,style:{transform:"translateX(-100%)"}})]})});Tp.displayName=Sp;var Np="RadioIndicator",_p=n.forwardRef((t,r)=>{const{__scopeRadio:n,forceMount:a,...o}=t,i=Cp(Np,n);return e(qu,{present:a||i.checked,children:e(zi.span,{"data-state":Pp(i.checked),"data-disabled":i.disabled?"":void 0,...o,ref:r})})});_p.displayName=Np;var Rp=n.forwardRef(({__scopeRadio:t,control:r,checked:a,bubbles:o=!0,...i},s)=>{const l=n.useRef(null),c=ai(l,s),d=xp(a),u=wp(r);return n.useEffect(()=>{const e=l.current;if(!e)return;const t=window.HTMLInputElement.prototype,r=Object.getOwnPropertyDescriptor(t,"checked").set;if(d!==a&&r){const t=new Event("click",{bubbles:o});r.call(e,a),e.dispatchEvent(t)}},[d,a,o]),e(zi.input,{type:"radio","aria-hidden":!0,defaultChecked:a,...i,tabIndex:-1,ref:c,style:{...i.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function Pp(e){return e?"checked":"unchecked"}Rp.displayName="RadioBubbleInput";var Op=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Dp="RadioGroup",[Ip,Mp]=Kd(Dp,[cp,Ap]),Up=cp(),Lp=Ap(),[zp,Fp]=Ip(Dp),jp=n.forwardRef((t,r)=>{const{__scopeRadioGroup:n,name:a,defaultValue:o,value:i,required:s=!1,disabled:l=!1,orientation:c,dir:d,loop:u=!0,onValueChange:f,...m}=t,p=Up(n),h=tp(d),[g,v]=_u({prop:i,defaultProp:o??null,onChange:f,caller:Dp});return e(zp,{scope:n,name:a,required:s,disabled:l,value:g,onValueChange:v,children:e(bp,{asChild:!0,...p,orientation:c,dir:h,loop:u,children:e(zi.div,{role:"radiogroup","aria-required":s,"aria-orientation":c,"data-disabled":l?"":void 0,dir:h,...m,ref:r})})})});jp.displayName=Dp;var Bp="RadioGroupItem",Vp=n.forwardRef((t,r)=>{const{__scopeRadioGroup:a,disabled:o,...i}=t,s=Fp(Bp,a),l=s.disabled||o,c=Up(a),d=Lp(a),u=n.useRef(null),f=ai(r,u),m=s.value===i.value,p=n.useRef(!1);return n.useEffect(()=>{const e=e=>{Op.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(yp,{asChild:!0,...c,focusable:!l,active:m,children:e(Tp,{disabled:l,required:s.required,checked:m,...d,...i,name:s.name,ref:f,onCheck:()=>s.onValueChange(i.value),onKeyDown:Au(e=>{"Enter"===e.key&&e.preventDefault()}),onFocus:Au(i.onFocus,()=>{p.current&&u.current?.click()})})})});Vp.displayName=Bp;var $p=n.forwardRef((t,r)=>{const{__scopeRadioGroup:n,...a}=t,o=Lp(n);return e(_p,{...o,...a,ref:r})});$p.displayName="RadioGroupIndicator";var Wp=jp,Gp=Vp,Kp=$p;const Hp=n.forwardRef(({className:t,...r},n)=>e(Wp,{className:ti("grid gap-2",t),...r,ref:n}));Hp.displayName=Wp.displayName;const Zp=n.forwardRef(({className:t,...r},n)=>e(Gp,{ref:n,className:ti("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(Kp,{className:"flex items-center justify-center",children:e(jm,{className:"h-3.5 w-3.5 fill-primary"})})}));function qp(e,[t,r]){return Math.min(r,Math.max(t,e))}Zp.displayName=Gp.displayName;var Jp="ScrollArea",[Yp,Xp]=Kd(Jp),[Qp,eh]=Yp(Jp),th=n.forwardRef((t,r)=>{const{__scopeScrollArea:a,type:o="hover",dir:i,scrollHideDelay:s=600,...l}=t,[c,d]=n.useState(null),[u,f]=n.useState(null),[m,p]=n.useState(null),[h,g]=n.useState(null),[v,b]=n.useState(null),[y,w]=n.useState(0),[x,S]=n.useState(0),[k,A]=n.useState(!1),[E,C]=n.useState(!1),T=ai(r,e=>d(e)),N=tp(i);return e(Qp,{scope:a,type:o,dir:N,scrollHideDelay:s,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(zi.div,{dir:N,...l,ref:T,style:{position:"relative","--radix-scroll-area-corner-width":y+"px","--radix-scroll-area-corner-height":x+"px",...t.style}})})});th.displayName=Jp;var rh="ScrollAreaViewport",nh=n.forwardRef((a,o)=>{const{__scopeScrollArea:i,children:s,nonce:l,...c}=a,d=eh(rh,i),u=ai(o,n.useRef(null),d.onViewportChange);return r(t,{children:[e("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:l}),e(zi.div,{"data-radix-scroll-area-viewport":"",...c,ref:u,style:{overflowX:d.scrollbarXEnabled?"scroll":"hidden",overflowY:d.scrollbarYEnabled?"scroll":"hidden",...a.style},children:e("div",{ref:d.onContentChange,style:{minWidth:"100%",display:"table"},children:s})})]})});nh.displayName=rh;var ah="ScrollAreaScrollbar",oh=n.forwardRef((t,r)=>{const{forceMount:a,...o}=t,i=eh(ah,t.__scopeScrollArea),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:l}=i,c="horizontal"===t.orientation;return n.useEffect(()=>(c?s(!0):l(!0),()=>{c?s(!1):l(!1)}),[c,s,l]),"hover"===i.type?e(ih,{...o,ref:r,forceMount:a}):"scroll"===i.type?e(sh,{...o,ref:r,forceMount:a}):"auto"===i.type?e(lh,{...o,ref:r,forceMount:a}):"always"===i.type?e(ch,{...o,ref:r}):null});oh.displayName=ah;var ih=n.forwardRef((t,r)=>{const{forceMount:a,...o}=t,i=eh(ah,t.__scopeScrollArea),[s,l]=n.useState(!1);return n.useEffect(()=>{const e=i.scrollArea;let t=0;if(e){const r=()=>{window.clearTimeout(t),l(!0)},n=()=>{t=window.setTimeout(()=>l(!1),i.scrollHideDelay)};return e.addEventListener("pointerenter",r),e.addEventListener("pointerleave",n),()=>{window.clearTimeout(t),e.removeEventListener("pointerenter",r),e.removeEventListener("pointerleave",n)}}},[i.scrollArea,i.scrollHideDelay]),e(qu,{present:a||s,children:e(lh,{"data-state":s?"visible":"hidden",...o,ref:r})})}),sh=n.forwardRef((t,r)=>{const{forceMount:a,...o}=t,i=eh(ah,t.__scopeScrollArea),s="horizontal"===t.orientation,l=Nh(()=>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"}},n.useReducer((e,t)=>f[e][t]??e,u));var u,f;return n.useEffect(()=>{if("idle"===c){const e=window.setTimeout(()=>d("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(e)}},[c,i.scrollHideDelay,d]),n.useEffect(()=>{const e=i.viewport,t=s?"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)}},[i.viewport,s,d,l]),e(qu,{present:a||"hidden"!==c,children:e(ch,{"data-state":"hidden"===c?"hidden":"visible",...o,ref:r,onPointerEnter:Au(t.onPointerEnter,()=>d("POINTER_ENTER")),onPointerLeave:Au(t.onPointerLeave,()=>d("POINTER_LEAVE"))})})}),lh=n.forwardRef((t,r)=>{const a=eh(ah,t.__scopeScrollArea),{forceMount:o,...i}=t,[s,l]=n.useState(!1),c="horizontal"===t.orientation,d=Nh(()=>{if(a.viewport){const e=a.viewport.offsetWidth<a.viewport.scrollWidth,t=a.viewport.offsetHeight<a.viewport.scrollHeight;l(c?e:t)}},10);return _h(a.viewport,d),_h(a.content,d),e(qu,{present:o||s,children:e(ch,{"data-state":s?"visible":"hidden",...i,ref:r})})}),ch=n.forwardRef((t,r)=>{const{orientation:a="vertical",...o}=t,i=eh(ah,t.__scopeScrollArea),s=n.useRef(null),l=n.useRef(0),[c,d]=n.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=Sh(c.viewport,c.content),f={...o,sizes:c,onSizesChange:d,hasThumb:Boolean(u>0&&u<1),onThumbChange:e=>s.current=e,onThumbPointerUp:()=>l.current=0,onThumbPointerDown:e=>l.current=e};function m(e,t){return function(e,t,r,n="ltr"){const a=kh(r),o=a/2,i=t||o,s=a-i,l=r.scrollbar.paddingStart+i,c=r.scrollbar.size-r.scrollbar.paddingEnd-s,d=r.content-r.viewport,u="ltr"===n?[0,d]:[-1*d,0];return Eh([l,c],u)(e)}(e,l.current,c,t)}return"horizontal"===a?e(dh,{...f,ref:r,onThumbPositionChange:()=>{if(i.viewport&&s.current){const e=Ah(i.viewport.scrollLeft,c,i.dir);s.current.style.transform=`translate3d(${e}px, 0, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollLeft=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollLeft=m(e,i.dir))}}):"vertical"===a?e(uh,{...f,ref:r,onThumbPositionChange:()=>{if(i.viewport&&s.current){const e=Ah(i.viewport.scrollTop,c);s.current.style.transform=`translate3d(0, ${e}px, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollTop=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollTop=m(e))}}):null}),dh=n.forwardRef((t,r)=>{const{sizes:a,onSizesChange:o,...i}=t,s=eh(ah,t.__scopeScrollArea),[l,c]=n.useState(),d=n.useRef(null),u=ai(r,d,s.onScrollbarXChange);return n.useEffect(()=>{d.current&&c(getComputedStyle(d.current))},[d]),e(ph,{"data-orientation":"horizontal",...i,ref:u,sizes:a,style:{bottom:0,left:"rtl"===s.dir?"var(--radix-scroll-area-corner-width)":0,right:"ltr"===s.dir?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":kh(a)+"px",...t.style},onThumbPointerDown:e=>t.onThumbPointerDown(e.x),onDragScroll:e=>t.onDragScroll(e.x),onWheelScroll:(e,r)=>{if(s.viewport){const n=s.viewport.scrollLeft+e.deltaX;t.onWheelScroll(n),Ch(n,r)&&e.preventDefault()}},onResize:()=>{d.current&&s.viewport&&l&&o({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:d.current.clientWidth,paddingStart:xh(l.paddingLeft),paddingEnd:xh(l.paddingRight)}})}})}),uh=n.forwardRef((t,r)=>{const{sizes:a,onSizesChange:o,...i}=t,s=eh(ah,t.__scopeScrollArea),[l,c]=n.useState(),d=n.useRef(null),u=ai(r,d,s.onScrollbarYChange);return n.useEffect(()=>{d.current&&c(getComputedStyle(d.current))},[d]),e(ph,{"data-orientation":"vertical",...i,ref:u,sizes:a,style:{top:0,right:"ltr"===s.dir?0:void 0,left:"rtl"===s.dir?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":kh(a)+"px",...t.style},onThumbPointerDown:e=>t.onThumbPointerDown(e.y),onDragScroll:e=>t.onDragScroll(e.y),onWheelScroll:(e,r)=>{if(s.viewport){const n=s.viewport.scrollTop+e.deltaY;t.onWheelScroll(n),Ch(n,r)&&e.preventDefault()}},onResize:()=>{d.current&&s.viewport&&l&&o({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:d.current.clientHeight,paddingStart:xh(l.paddingTop),paddingEnd:xh(l.paddingBottom)}})}})}),[fh,mh]=Yp(ah),ph=n.forwardRef((t,r)=>{const{__scopeScrollArea:a,sizes:o,hasThumb:i,onThumbChange:s,onThumbPointerUp:l,onThumbPointerDown:c,onThumbPositionChange:d,onDragScroll:u,onWheelScroll:f,onResize:m,...p}=t,h=eh(ah,a),[g,v]=n.useState(null),b=ai(r,e=>v(e)),y=n.useRef(null),w=n.useRef(""),x=h.viewport,S=o.content-o.viewport,k=Zd(f),A=Zd(d),E=Nh(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 n.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]),n.useEffect(A,[o,A]),_h(g,E),_h(h.content,E),e(fh,{scope:a,scrollbar:g,hasThumb:i,onThumbChange:Zd(s),onThumbPointerUp:Zd(l),onThumbPositionChange:A,onThumbPointerDown:Zd(c),children:e(zi.div,{...p,ref:b,style:{position:"absolute",...p.style},onPointerDown:Au(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:Au(t.onPointerMove,C),onPointerUp:Au(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})})})}),hh="ScrollAreaThumb",gh=n.forwardRef((t,r)=>{const{forceMount:n,...a}=t,o=mh(hh,t.__scopeScrollArea);return e(qu,{present:n||o.hasThumb,children:e(vh,{ref:r,...a})})}),vh=n.forwardRef((t,r)=>{const{__scopeScrollArea:a,style:o,...i}=t,s=eh(hh,a),l=mh(hh,a),{onThumbPositionChange:c}=l,d=ai(r,e=>l.onThumbChange(e)),u=n.useRef(void 0),f=Nh(()=>{u.current&&(u.current(),u.current=void 0)},100);return n.useEffect(()=>{const e=s.viewport;if(e){const t=()=>{if(f(),!u.current){const t=Th(e,c);u.current=t,c()}};return c(),e.addEventListener("scroll",t),()=>e.removeEventListener("scroll",t)}},[s.viewport,f,c]),e(zi.div,{"data-state":l.hasThumb?"visible":"hidden",...i,ref:d,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...o},onPointerDownCapture:Au(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:Au(t.onPointerUp,l.onThumbPointerUp)})});gh.displayName=hh;var bh="ScrollAreaCorner",yh=n.forwardRef((t,r)=>{const n=eh(bh,t.__scopeScrollArea),a=Boolean(n.scrollbarX&&n.scrollbarY);return"scroll"!==n.type&&a?e(wh,{...t,ref:r}):null});yh.displayName=bh;var wh=n.forwardRef((t,r)=>{const{__scopeScrollArea:a,...o}=t,i=eh(bh,a),[s,l]=n.useState(0),[c,d]=n.useState(0),u=Boolean(s&&c);return _h(i.scrollbarX,()=>{const e=i.scrollbarX?.offsetHeight||0;i.onCornerHeightChange(e),d(e)}),_h(i.scrollbarY,()=>{const e=i.scrollbarY?.offsetWidth||0;i.onCornerWidthChange(e),l(e)}),u?e(zi.div,{...o,ref:r,style:{width:s,height:c,position:"absolute",right:"ltr"===i.dir?0:void 0,left:"rtl"===i.dir?0:void 0,bottom:0,...t.style}}):null});function xh(e){return e?parseInt(e,10):0}function Sh(e,t){const r=e/t;return isNaN(r)?0:r}function kh(e){const t=Sh(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*t;return Math.max(n,18)}function Ah(e,t,r="ltr"){const n=kh(t),a=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-a,i=t.content-t.viewport,s=o-n,l=qp(e,"ltr"===r?[0,i]:[-1*i,0]);return Eh([0,i],[0,s])(l)}function Eh(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 Ch(e,t){return e>0&&e<t}var Th=(e,t=()=>{})=>{let r={left:e.scrollLeft,top:e.scrollTop},n=0;return function a(){const o={left:e.scrollLeft,top:e.scrollTop},i=r.left!==o.left,s=r.top!==o.top;(i||s)&&t(),r=o,n=window.requestAnimationFrame(a)}(),()=>window.cancelAnimationFrame(n)};function Nh(e,t){const r=Zd(e),a=n.useRef(0);return n.useEffect(()=>()=>window.clearTimeout(a.current),[]),n.useCallback(()=>{window.clearTimeout(a.current),a.current=window.setTimeout(r,t)},[r,t])}function _h(e,t){const r=Zd(t);Jd(()=>{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 Rh=th,Ph=nh,Oh=yh;const Dh=n.forwardRef(({className:t,children:n,...a},o)=>r(Rh,{ref:o,className:ti("relative overflow-hidden",t),...a,children:[e(Ph,{className:"h-full w-full rounded-[inherit]",children:n}),e(Ih,{}),e(Oh,{})]}));Dh.displayName=Rh.displayName;const Ih=n.forwardRef(({className:t,orientation:r="vertical",...n},a)=>e(oh,{ref:a,orientation:r,className:ti("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(gh,{className:ti("relative rounded-full bg-border","vertical"===r&&"flex-1")})}));Ih.displayName=oh.displayName;var Mh="horizontal",Uh=["horizontal","vertical"],Lh=n.forwardRef((t,r)=>{const{decorative:n,orientation:a=Mh,...o}=t,i=function(e){return Uh.includes(e)}(a)?a:Mh,s=n?{role:"none"}:{"aria-orientation":"vertical"===i?i:void 0,role:"separator"};return e(zi.div,{"data-orientation":i,...s,...o,ref:r})});Lh.displayName="Separator";var zh=Lh;const Fh=n.forwardRef(({className:t,orientation:r="horizontal",decorative:n=!0,...a},o)=>e(zh,{ref:o,decorative:n,orientation:r,className:ti("shrink-0 bg-border","horizontal"===r?"h-[1px] w-full":"h-full w-[1px]",t),...a}));function jh(){const e=fe(),t=ue(e=>e.os),{serverUrl:r,version:n,orgId:a,settings:o}=t,i=m(!1),d=l(async()=>{if(i.current)return o||null;if(o)return o;if(!r||!n||!a)return null;i.current=!0;try{const t=P(),o=await fetch(`${r}/api/${n}/public/${a}/settings`,{headers:t});if(!o.ok)throw new Error("Failed to fetch settings");const i=await o.json();return e.os(B(i)),i}catch(e){return console.error("Failed to fetch settings:",e),null}finally{i.current=!1}},[r,n,a,o,e]);return c(()=>{r&&n&&a&&!o&&!i.current&&d()},[r,n,a]),s(()=>({settings:o,getSettings:d}),[o,d])}Fh.displayName=zh.displayName;var Bh="AlertDialog",[Vh,$h]=Kd(Bh,[Yf]),Wh=Yf(),Gh=t=>{const{__scopeAlertDialog:r,...n}=t,a=Wh(r);return e(Nm,{...a,...n,modal:!0})};Gh.displayName=Bh;var Kh=n.forwardRef((t,r)=>{const{__scopeAlertDialog:n,...a}=t,o=Wh(n);return e(_m,{...o,...a,ref:r})});Kh.displayName="AlertDialogTrigger";var Hh=t=>{const{__scopeAlertDialog:r,...n}=t,a=Wh(r);return e(Rm,{...a,...n})};Hh.displayName="AlertDialogPortal";var Zh=n.forwardRef((t,r)=>{const{__scopeAlertDialog:n,...a}=t,o=Wh(n);return e(Pm,{...o,...a,ref:r})});Zh.displayName="AlertDialogOverlay";var qh="AlertDialogContent",[Jh,Yh]=Vh(qh),Xh=function(r){const n=({children:r})=>e(t,{children:r});return n.displayName=`${r}.Slottable`,n.__radixId=li,n}("AlertDialogContent"),Qh=n.forwardRef((t,a)=>{const{__scopeAlertDialog:o,children:i,...s}=t,l=Wh(o),c=n.useRef(null),d=ai(a,c),u=n.useRef(null);return e(Am,{contentName:qh,titleName:eg,docsSlug:"alert-dialog",children:e(Jh,{scope:o,cancelRef:u,children:r(Om,{role:"alertdialog",...l,...s,ref:d,onOpenAutoFocus:Au(s.onOpenAutoFocus,e=>{e.preventDefault(),u.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:[e(Xh,{children:i}),e(sg,{contentRef:c})]})})})});Qh.displayName=qh;var eg="AlertDialogTitle",tg=n.forwardRef((t,r)=>{const{__scopeAlertDialog:n,...a}=t,o=Wh(n);return e(Dm,{...o,...a,ref:r})});tg.displayName=eg;var rg="AlertDialogDescription",ng=n.forwardRef((t,r)=>{const{__scopeAlertDialog:n,...a}=t,o=Wh(n);return e(Im,{...o,...a,ref:r})});ng.displayName=rg;var ag=n.forwardRef((t,r)=>{const{__scopeAlertDialog:n,...a}=t,o=Wh(n);return e(Mm,{...o,...a,ref:r})});ag.displayName="AlertDialogAction";var og="AlertDialogCancel",ig=n.forwardRef((t,r)=>{const{__scopeAlertDialog:n,...a}=t,{cancelRef:o}=Yh(og,n),i=Wh(n),s=ai(r,o);return e(Mm,{...i,...a,ref:s})});ig.displayName=og;var sg=({contentRef:e})=>{const t=`\`${qh}\` requires a description for the component to be accessible for screen reader users.\n\nYou can add a description to the \`${qh}\` by passing a \`${rg}\` 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 \`${qh}\`. 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 n.useEffect(()=>{document.getElementById(e.current?.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},lg=Zh,cg=Qh,dg=ag,ug=ig,fg=tg,mg=ng;const pg=Gh,hg=Kh,gg=Hh,vg=n.forwardRef(({className:t,...r},n)=>e(lg,{className:ti("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}));vg.displayName=lg.displayName;const bg=n.forwardRef(({className:t,...a},o)=>{const{container:i}=n.useContext(ge);return r(gg,{container:i,children:[e(vg,{}),e(cg,{ref:o,className:ti("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),...a})]})});bg.displayName=cg.displayName;const yg=({className:t,...r})=>e("div",{className:ti("flex flex-col space-y-2 text-center sm:text-left",t),...r});yg.displayName="AlertDialogHeader";const wg=({className:t,...r})=>e("div",{className:ti("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...r});wg.displayName="AlertDialogFooter";const xg=n.forwardRef(({className:t,...r},n)=>e(fg,{ref:n,className:ti("text-lg font-semibold",t),...r}));xg.displayName=fg.displayName;const Sg=n.forwardRef(({className:t,...r},n)=>e(mg,{ref:n,className:ti("text-sm text-muted-foreground",t),...r}));Sg.displayName=mg.displayName;const kg=n.forwardRef(({className:t,...r},n)=>e(dg,{ref:n,className:ti(Ui(),t),...r}));kg.displayName=dg.displayName;const Ag=n.forwardRef(({className:t,...r},n)=>e(ug,{ref:n,className:ti(Ui({variant:"outline"}),"mt-2 sm:mt-0",t),...r}));function Eg(){return r("div",{className:"space-y-3.5",children:[e(es,{className:"h-10 w-full"}),e(es,{className:"h-10 w-full"}),e(es,{className:"h-10 w-full"})]})}Ag.displayName=ug.displayName;const Cg=({workspace:t})=>{const[n,a]=f(!1),{deleteWorkspace:o}=lS(),i=ue(e=>e.auth.session?.user||null);if(!t)return e(Eg,{});const s=t?.users.find(e=>("object"==typeof e&&null!==e?e._id:e)===i?.id)?.role;return"admin"===s?.toLowerCase()?r("div",{className:"space-y-4",children:[r("div",{children:[e("h3",{className:"text-lg font-semibold text-destructive",children:"Delete Workspace"}),r("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("strong",{children:t.name})," and all of its data, including members, settings, and features."]})]}),r(pg,{children:[e(hg,{asChild:!0,children:r(Li,{variant:"destructive",disabled:n,children:[e(Pi,{className:"h-4 w-4 mr-2"}),"Delete Workspace"]})}),r(bg,{children:[r(yg,{children:[e(xg,{children:"Are you absolutely sure?"}),r(Sg,{children:["This action cannot be undone. This will permanently delete the workspace"," ",e("strong",{children:t.name})," and all of its data."]})]}),r(wg,{children:[e(Ag,{children:"Cancel"}),e(kg,{onClick:async()=>{a(!0);try{await o(t._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("div",{className:"space-y-4",children:e("div",{className:"text-red-500",children:"Only workspace admins can delete workspaces."})})};var Tg="Switch",[Ng,_g]=Kd(Tg),[Rg,Pg]=Ng(Tg),Og=n.forwardRef((t,a)=>{const{__scopeSwitch:o,name:i,checked:s,defaultChecked:l,required:c,disabled:d,value:u="on",onCheckedChange:f,form:m,...p}=t,[h,g]=n.useState(null),v=ai(a,e=>g(e)),b=n.useRef(!1),y=!h||(m||!!h.closest("form")),[w,x]=_u({prop:s,defaultProp:l??!1,onChange:f,caller:Tg});return r(Rg,{scope:o,checked:w,disabled:d,children:[e(zi.button,{type:"button",role:"switch","aria-checked":w,"aria-required":c,"data-state":Ug(w),"data-disabled":d?"":void 0,disabled:d,value:u,...p,ref:v,onClick:Au(t.onClick,e=>{x(e=>!e),y&&(b.current=e.isPropagationStopped(),b.current||e.stopPropagation())})}),y&&e(Mg,{control:h,bubbles:!b.current,name:i,value:u,checked:w,required:c,disabled:d,form:m,style:{transform:"translateX(-100%)"}})]})});Og.displayName=Tg;var Dg="SwitchThumb",Ig=n.forwardRef((t,r)=>{const{__scopeSwitch:n,...a}=t,o=Pg(Dg,n);return e(zi.span,{"data-state":Ug(o.checked),"data-disabled":o.disabled?"":void 0,...a,ref:r})});Ig.displayName=Dg;var Mg=n.forwardRef(({__scopeSwitch:t,control:r,checked:a,bubbles:o=!0,...i},s)=>{const l=n.useRef(null),c=ai(l,s),d=xp(a),u=wp(r);return n.useEffect(()=>{const e=l.current;if(!e)return;const t=window.HTMLInputElement.prototype,r=Object.getOwnPropertyDescriptor(t,"checked").set;if(d!==a&&r){const t=new Event("click",{bubbles:o});r.call(e,a),e.dispatchEvent(t)}},[d,a,o]),e("input",{type:"checkbox","aria-hidden":!0,defaultChecked:a,...i,tabIndex:-1,ref:c,style:{...i.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function Ug(e){return e?"checked":"unchecked"}Mg.displayName="SwitchBubbleInput";var Lg=Og,zg=Ig;const Fg=n.forwardRef(({className:t,...r},n)=>e(Lg,{className:ti("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(zg,{className:ti("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")})}));Fg.displayName=Lg.displayName;const jg=({workspaceId:t})=>{const[n,a]=f({}),{allFeatures:o,updateFeature:i,getWorkspace:s}=lS(),[l,d]=f(null),u=ue(e=>e.auth.session?.user||null);if(c(()=>{s(t).then(d)},[t]),!l)return e(Eg,{});const m=l?.users.find(e=>("string"==typeof e?e:e._id)===u?.id)?.role,p="admin"===m?.toLowerCase();return e("div",{children:r("div",{className:"flex flex-col gap-y-3.5 pr-4",children:[!p&&e("div",{className:"text-red-500",children:"Only workspace admin can change the features."}),!o.length&&e("div",{className:"text-muted-foreground",children:"Workspace has no features to manage."}),o.length>0&&e("div",{className:"flex flex-col gap-y-3.5",children:o.map(t=>{const o=l?.features?.[t.slug];return r("div",{className:"flex items-center gap-x-2 justify-between w-full",children:[r("div",{className:"flex gap-x-2 flex-col",children:[e("h3",{className:"font-medium text-ellipsis",children:t.name}),e("p",{className:"text-muted-foreground",children:t.description})]}),e(Fg,{disabled:n[t.slug]||!p,checked:o??t.defaultValue,onCheckedChange:e=>async function(e,t){if(!l)return;a(r=>({...r,[e]:t}));const r=await i(l._id,e,t);d(r),a(t=>({...t,[e]:!1}))}(t.slug,e)})]},t._id)})})]})})};function Bg(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 Vg=["🏢","🏬","🏣","🏤","🏦","🏛️","🏠","🏡","🏭","🏗️","🏪","🏨","🏫","🏥","💼","📊","📈","📉","📋","📁","📂","🗂️","🗃️","🗄️","📅","🗓️","📝","🖋️","✏️","🖊️","🖌️","🖍️","📇","📌","📍","📎","🖇️","💻","🖥️","🖨️","🖱️","⌨️","📱","📲","📡","🌐","🔗","🔒","🔓","⚙️","🔧","🛠️","🧑💻","👨💻","👩💻","🕹️","💾","📟","🖥️","🖲️","🚀","💡","🎨","🖼️","🧪","🔬","🧬","🎯","⚡","🎲","🎮","🧩","📷","🎥","✉️","📨","📩","📧","📞","☎️","📠","🗣️","💬","🗨️","📢","📣","🔔","🛎️","💰","💸","💳","🏦","📈","📉","⚖️","🧾","🪙","🏛️","⚗️","🧪","🔭","🔬","🩺","🧬","🩻","🏥","🌱","🌍","🌏","🌎","🌡️","👨💼","👩💼","👨🏫","👩🏫","👨🔬","👩🔬","👨🎨","👩🎨","👨🔧","👩🔧","👨🚀","👩🚀","👨⚖️","👩⚖️","🏅","🎖️","🥇","🥈","🥉","🏆","🎗️","🔑","🗝️","🧭","🛡️","🚩","🏳️🌈","🎟️","🎫"],$g=({workspace:t})=>{const[n,a]=f(!1),[o,i]=f("emoji"),[s,l]=f(),{updateWorkspace:c}=lS(),d=ue(e=>e.auth.session?.user||null),u=Gt({resolver:Ga(Qs({name:Cs().min(2,{message:"Workspace name must be at least 2 characters."}),image:Cs().optional()})),defaultValues:{name:t.name||"",image:t.image||""}});if(!t)return e(Eg,{});const m=t?.users.find(e=>("object"==typeof e&&null!==e?e._id:e)===d?.id)?.role,p="admin"===m?.toLowerCase();return r("div",{children:[!p&&e("div",{className:"text-red-500",children:"Only workspace admin can change the workspace settings."}),e($i,{...u,children:r("form",{onSubmit:u.handleSubmit(async function(e){a(!0);try{await c(t,e)}catch(e){console.error("Failed to update workspace:",e)}finally{a(!1)}}),className:"space-y-6",children:[e(Gi,{control:u.control,name:"name",render:({field:t})=>r(Zi,{children:[e(qi,{children:"Name"}),e(Ji,{children:e(Qi,{placeholder:"My Awesome Workspace",...t,disabled:!p})}),e(Xi,{})]})}),r("div",{className:"space-y-4",children:[r("div",{children:[e(Vi,{className:"text-sm font-medium",children:"Icon"}),e(Yi,{children:"Choose an emoji or upload a custom image for your workspace."})]}),r(Hp,{value:o,disabled:!p,onValueChange:e=>i(e),className:"flex flex-col space-y-3",children:[r("div",{className:"flex items-center space-x-2",children:[e(Zp,{value:"emoji",id:"emoji"}),r(Vi,{htmlFor:"emoji",className:"flex items-center gap-2",children:[e(_i,{className:"h-4 w-4"}),"Choose Emoji"]})]}),r("div",{className:"flex items-center space-x-2",children:[e(Zp,{value:"url",id:"url"}),r(Vi,{htmlFor:"url",className:"flex items-center gap-2",children:[e(ki,{className:"h-4 w-4"}),"Custom Image URL"]})]})]}),"emoji"===o&&r("div",{className:"space-y-3",children:[r("div",{className:"flex items-center gap-3",children:[e("span",{className:"text-sm font-medium",children:"Preview:"}),r("div",{className:"w-12 h-12 rounded-lg border-2 border-border flex items-center justify-center text-2xl bg-muted",children:[s&&e("span",{className:"text-2xl",children:s}),!s&&e("img",{src:u.watch("image")})]})]}),e(Dh,{className:"h-32 w-full rounded-md border",children:e("div",{className:"p-4 grid grid-cols-8 gap-2",children:Vg.map((t,r)=>e("button",{type:"button",onClick:()=>(e=>{l(e),u.setValue("image",Bg(e))})(t),disabled:!p,className:"w-8 h-8 rounded flex items-center justify-center text-lg hover:bg-muted transition-colors "+(s===t?"bg-primary text-primary-foreground":""),children:t},r))})})]}),"url"===o&&r("div",{className:"space-y-3",children:[e(Gi,{control:u.control,name:"image",render:({field:t})=>r(Zi,{children:[e(qi,{children:"Image URL"}),e(Ji,{children:e(Qi,{placeholder:"https://example.com/image.png",...t,disabled:!p})}),e(Yi,{children:"Enter a valid URL for your workspace image. Supports PNG, JPG, and SVG formats."}),e(Xi,{})]})}),u.watch("image")&&r("div",{className:"flex items-center gap-3",children:[e("span",{className:"text-sm font-medium",children:"Preview:"}),e("div",{className:"w-12 h-12 rounded-lg border-2 border-border overflow-hidden bg-muted",children:e("img",{src:u.watch("image"),className:"w-full h-full object-cover"})})]})]})]}),e("div",{className:"flex justify-end gap-3 pt-4",children:p&&e(Li,{type:"submit",disabled:n,progress:n,children:"Update Workspace"})})]})})]})};var Wg=.999,Gg=/[\\\/_+.#"@\[\(\{&]/,Kg=/[\\\/_+.#"@\[\(\{&]/g,Hg=/[\s-]/,Zg=/[\s-]/g;function qg(e,t,r,n,a,o,i){if(o===t.length)return a===e.length?1:.99;var s=`${a},${o}`;if(void 0!==i[s])return i[s];for(var l,c,d,u,f=n.charAt(o),m=r.indexOf(f,a),p=0;m>=0;)(l=qg(e,t,r,n,m+1,o+1,i))>p&&(m===a?l*=1:Gg.test(e.charAt(m-1))?(l*=.8,(d=e.slice(a,m-1).match(Kg))&&a>0&&(l*=Math.pow(Wg,d.length))):Hg.test(e.charAt(m-1))?(l*=.9,(u=e.slice(a,m-1).match(Zg))&&a>0&&(l*=Math.pow(Wg,u.length))):(l*=.17,a>0&&(l*=Math.pow(Wg,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=qg(e,t,r,n,m+1,o+2,i))>l&&(l=.1*c)),l>p&&(p=l),m=r.indexOf(f,m+1);return i[s]=p,p}function Jg(e){return e.toLowerCase().replace(Zg," ")}function Yg(e,t,r){return qg(e=r&&r.length>0?""+(e+" "+r.join(" ")):e,t,Jg(e),Jg(t),0,0,{})}var Xg='[cmdk-group=""]',Qg='[cmdk-group-items=""]',ev='[cmdk-item=""]',tv=`${ev}:not([aria-disabled="true"])`,rv="cmdk-item-select",nv="data-value",av=(e,t,r)=>Yg(e,t,r),ov=n.createContext(void 0),iv=()=>n.useContext(ov),sv=n.createContext(void 0),lv=()=>n.useContext(sv),cv=n.createContext(void 0),dv=n.forwardRef((e,t)=>{let r=Av(()=>{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}}}),a=Av(()=>new Set),o=Av(()=>new Map),i=Av(()=>new Map),s=Av(()=>new Set),l=Sv(e),{label:c,children:d,value:u,onValueChange:f,filter:m,shouldFilter:p,loop:h,disablePointerSelection:g=!1,vimBindings:v=!0,...b}=e,y=Tu(),w=Tu(),x=Tu(),S=n.useRef(null),k=Tv();kv(()=>{if(void 0!==u){let e=u.trim();r.current.value=e,A.emit()}},[u]),kv(()=>{k(6,R)},[]);let A=n.useMemo(()=>({subscribe:e=>(s.current.add(e),()=>s.current.delete(e)),snapshot:()=>r.current,setState:(e,t,n)=>{var a,o,i,s;if(!Object.is(r.current[e],t)){if(r.current[e]=t,"search"===e)_(),T(),k(1,N);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=P())?void 0:e.id,A.emit()}),n||k(5,R),void 0!==(null==(o=l.current)?void 0:o.value)){let e=null!=t?t:"";return void(null==(s=(i=l.current).onValueChange)||s.call(i,e))}}A.emit()}},emit:()=>{s.current.forEach(e=>e())}}),[]),E=n.useMemo(()=>({value:(e,t,n)=>{var a;t!==(null==(a=i.current.get(e))?void 0:a.value)&&(i.current.set(e,{value:t,keywords:n}),r.current.filtered.items.set(e,C(t,n)),k(2,()=>{T(),A.emit()}))},item:(e,t)=>(a.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||N(),A.emit()}),()=>{i.current.delete(e),a.current.delete(e),r.current.filtered.items.delete(e);let t=P();k(4,()=>{_(),(null==t?void 0:t.getAttribute("id"))===e&&N(),A.emit()})}),group:e=>(o.current.has(e)||o.current.set(e,new Set),()=>{i.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:av;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;O().sort((t,r)=>{var n,a;let o=t.getAttribute("id"),i=r.getAttribute("id");return(null!=(n=e.get(i))?n:0)-(null!=(a=e.get(o))?a:0)}).forEach(e=>{let t=e.closest(Qg);t?t.appendChild(e.parentElement===t?e:e.closest(`${Qg} > *`)):n.appendChild(e.parentElement===n?e:e.closest(`${Qg} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{var t;let r=null==(t=S.current)?void 0:t.querySelector(`${Xg}[${nv}="${encodeURIComponent(e[0])}"]`);null==r||r.parentElement.appendChild(r)})}function N(){let e=O().find(e=>"true"!==e.getAttribute("aria-disabled")),t=null==e?void 0:e.getAttribute(nv);A.setState("value",t||void 0)}function _(){var e,t,n,s;if(!r.current.search||!1===l.current.shouldFilter)return void(r.current.filtered.count=a.current.size);r.current.filtered.groups=new Set;let c=0;for(let o of a.current){let a=C(null!=(t=null==(e=i.current.get(o))?void 0:e.value)?t:"",null!=(s=null==(n=i.current.get(o))?void 0:n.keywords)?s:[]);r.current.filtered.items.set(o,a),a>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 R(){var e,t,r;let n=P();n&&((null==(e=n.parentElement)?void 0:e.firstChild)===n&&(null==(r=null==(t=n.closest(Xg))?void 0:t.querySelector('[cmdk-group-heading=""]'))||r.scrollIntoView({block:"nearest"})),n.scrollIntoView({block:"nearest"}))}function P(){var e;return null==(e=S.current)?void 0:e.querySelector(`${ev}[aria-selected="true"]`)}function O(){var e;return Array.from((null==(e=S.current)?void 0:e.querySelectorAll(tv))||[])}function D(e){let t=O()[e];t&&A.setState("value",t.getAttribute(nv))}function I(e){var t;let r=P(),n=O(),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(nv))}function M(e){let t,r=P(),n=null==r?void 0:r.closest(Xg);for(;n&&!t;)n=e>0?wv(n,Xg):xv(n,Xg),t=null==n?void 0:n.querySelector(tv);t?A.setState("value",t.getAttribute(nv)):I(e)}let U=()=>D(O().length-1),L=e=>{e.preventDefault(),e.metaKey?U():e.altKey?M(1):I(1)},z=e=>{e.preventDefault(),e.metaKey?D(0):e.altKey?M(-1):I(-1)};return n.createElement(zi.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&&z(e);break;case"ArrowUp":z(e);break;case"Home":e.preventDefault(),D(0);break;case"End":e.preventDefault(),U();break;case"Enter":{e.preventDefault();let t=P();if(t){let e=new Event(rv);t.dispatchEvent(e)}}}}},n.createElement("label",{"cmdk-label":"",htmlFor:E.inputId,id:E.labelId,style:_v},c),Nv(e,e=>n.createElement(sv.Provider,{value:A},n.createElement(ov.Provider,{value:E},e))))}),uv=n.forwardRef((e,t)=>{var r,a;let o=Tu(),i=n.useRef(null),s=n.useContext(cv),l=iv(),c=Sv(e),d=null!=(a=null==(r=c.current)?void 0:r.forceMount)?a:null==s?void 0:s.forceMount;kv(()=>{if(!d)return l.item(o,null==s?void 0:s.id)},[d]);let u=Cv(o,i,[e.value,e.children,i],e.keywords),f=lv(),m=Ev(e=>e.value&&e.value===u.current),p=Ev(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(n.useEffect(()=>{let t=i.current;if(t&&!e.disabled)return t.addEventListener(rv,h),()=>t.removeEventListener(rv,h)},[p,e.onSelect,e.disabled]),!p)return null;let{disabled:v,value:b,onSelect:y,forceMount:w,keywords:x,...S}=e;return n.createElement(zi.div,{ref:ni(i,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)}),fv=n.forwardRef((e,t)=>{let{heading:r,children:a,forceMount:o,...i}=e,s=Tu(),l=n.useRef(null),c=n.useRef(null),d=Tu(),u=iv(),f=Ev(e=>!(!o&&!1!==u.filter())||(!e.search||e.filtered.groups.has(s)));kv(()=>u.group(s),[]),Cv(s,l,[e.value,e.heading,c]);let m=n.useMemo(()=>({id:s,forceMount:o}),[o]);return n.createElement(zi.div,{ref:ni(l,t),...i,"cmdk-group":"",role:"presentation",hidden:!f||void 0},r&&n.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:d},r),Nv(e,e=>n.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?d:void 0},n.createElement(cv.Provider,{value:m},e))))}),mv=n.forwardRef((e,t)=>{let{alwaysRender:r,...a}=e,o=n.useRef(null),i=Ev(e=>!e.search);return r||i?n.createElement(zi.div,{ref:ni(o,t),...a,"cmdk-separator":"",role:"separator"}):null}),pv=n.forwardRef((e,t)=>{let{onValueChange:r,...a}=e,o=null!=e.value,i=lv(),s=Ev(e=>e.search),l=Ev(e=>e.selectedItemId),c=iv();return n.useEffect(()=>{null!=e.value&&i.setState("search",e.value)},[e.value]),n.createElement(zi.input,{ref:t,...a,"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:s,onChange:e=>{o||i.setState("search",e.target.value),null==r||r(e.target.value)}})}),hv=n.forwardRef((e,t)=>{let{children:r,label:a="Suggestions",...o}=e,i=n.useRef(null),s=n.useRef(null),l=Ev(e=>e.selectedItemId),c=iv();return n.useEffect(()=>{if(s.current&&i.current){let e,t=s.current,r=i.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)}}},[]),n.createElement(zi.div,{ref:ni(i,t),...o,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":l,"aria-label":a,id:c.listId},Nv(e,e=>n.createElement("div",{ref:ni(s,c.listInnerRef),"cmdk-list-sizer":""},e)))}),gv=n.forwardRef((e,t)=>{let{open:r,onOpenChange:a,overlayClassName:o,contentClassName:i,container:s,...l}=e;return n.createElement(Nm,{open:r,onOpenChange:a},n.createElement(Rm,{container:s},n.createElement(Pm,{"cmdk-overlay":"",className:o}),n.createElement(Om,{"aria-label":e.label,"cmdk-dialog":"",className:i},n.createElement(dv,{ref:t,...l}))))}),vv=n.forwardRef((e,t)=>Ev(e=>0===e.filtered.count)?n.createElement(zi.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),bv=n.forwardRef((e,t)=>{let{progress:r,children:a,label:o="Loading...",...i}=e;return n.createElement(zi.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},Nv(e,e=>n.createElement("div",{"aria-hidden":!0},e)))}),yv=Object.assign(dv,{List:hv,Item:uv,Input:pv,Group:fv,Separator:mv,Dialog:gv,Empty:vv,Loading:bv});function wv(e,t){let r=e.nextElementSibling;for(;r;){if(r.matches(t))return r;r=r.nextElementSibling}}function xv(e,t){let r=e.previousElementSibling;for(;r;){if(r.matches(t))return r;r=r.previousElementSibling}}function Sv(e){let t=n.useRef(e);return kv(()=>{t.current=e}),t}var kv="undefined"==typeof window?n.useEffect:n.useLayoutEffect;function Av(e){let t=n.useRef();return void 0===t.current&&(t.current=e()),t}function Ev(e){let t=lv(),r=()=>e(t.snapshot());return n.useSyncExternalStore(t.subscribe,r,r)}function Cv(e,t,r,a=[]){let o=n.useRef(),i=iv();return kv(()=>{var n;let s=(()=>{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=a.map(e=>e.trim());i.value(e,s,l),null==(n=t.current)||n.setAttribute(nv,s),o.current=s}),o}var Tv=()=>{let[e,t]=n.useState(),r=Av(()=>new Map);return kv(()=>{r.current.forEach(e=>e()),r.current=new Map},[e]),(e,n)=>{r.current.set(e,n),t({})}};function Nv({asChild:e,children:t},r){return e&&n.isValidElement(t)?n.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 _v={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const Rv=n.forwardRef(({className:t,...r},n)=>e(yv,{ref:n,className:ti("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",t),...r}));Rv.displayName=yv.displayName;const Pv=n.forwardRef(({className:t,...n},a)=>r("div",{className:"flex items-center border-b px-3","data-cmdk-input-wrapper":"",children:[e(Wm,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),e(yv.Input,{ref:a,className:ti("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),...n})]}));Pv.displayName=yv.Input.displayName;const Ov=n.forwardRef(({className:t,...r},n)=>e(yv.List,{ref:n,className:ti("max-h-[300px] overflow-y-auto overflow-x-hidden",t),...r}));Ov.displayName=yv.List.displayName;n.forwardRef((t,r)=>e(yv.Empty,{ref:r,className:"py-6 text-center text-sm",...t})).displayName=yv.Empty.displayName;const Dv=n.forwardRef(({className:t,...r},n)=>e(yv.Group,{ref:n,className:ti("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}));Dv.displayName=yv.Group.displayName;n.forwardRef(({className:t,...r},n)=>e(yv.Separator,{ref:n,className:ti("-mx-1 h-px bg-border",t),...r})).displayName=yv.Separator.displayName;const Iv=n.forwardRef(({className:t,...r},n)=>e(yv.Item,{ref:n,className:ti("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}));Iv.displayName=yv.Item.displayName;const Mv=["top","right","bottom","left"],Uv=Math.min,Lv=Math.max,zv=Math.round,Fv=Math.floor,jv=e=>({x:e,y:e}),Bv={left:"right",right:"left",bottom:"top",top:"bottom"},Vv={start:"end",end:"start"};function $v(e,t,r){return Lv(e,Uv(t,r))}function Wv(e,t){return"function"==typeof e?e(t):e}function Gv(e){return e.split("-")[0]}function Kv(e){return e.split("-")[1]}function Hv(e){return"x"===e?"y":"x"}function Zv(e){return"y"===e?"height":"width"}const qv=new Set(["top","bottom"]);function Jv(e){return qv.has(Gv(e))?"y":"x"}function Yv(e){return Hv(Jv(e))}function Xv(e){return e.replace(/start|end/g,e=>Vv[e])}const Qv=["left","right"],eb=["right","left"],tb=["top","bottom"],rb=["bottom","top"];function nb(e,t,r,n){const a=Kv(e);let o=function(e,t,r){switch(e){case"top":case"bottom":return r?t?eb:Qv:t?Qv:eb;case"left":case"right":return t?tb:rb;default:return[]}}(Gv(e),"start"===r,n);return a&&(o=o.map(e=>e+"-"+a),t&&(o=o.concat(o.map(Xv)))),o}function ab(e){return e.replace(/left|right|bottom|top/g,e=>Bv[e])}function ob(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 ib(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 sb(e,t,r){let{reference:n,floating:a}=e;const o=Jv(t),i=Yv(t),s=Zv(i),l=Gv(t),c="y"===o,d=n.x+n.width/2-a.width/2,u=n.y+n.height/2-a.height/2,f=n[s]/2-a[s]/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(Kv(t)){case"start":m[i]-=f*(r&&c?-1:1);break;case"end":m[i]+=f*(r&&c?-1:1)}return m}async function lb(e,t){var r;void 0===t&&(t={});const{x:n,y:a,platform:o,rects:i,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:f=!1,padding:m=0}=Wv(t,e),p=ob(m),h=s[f?"floating"===u?"reference":"floating":u],g=ib(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(s.floating)),boundary:c,rootBoundary:d,strategy:l})),v="floating"===u?{x:n,y:a,width:i.floating.width,height:i.floating.height}:i.reference,b=await(null==o.getOffsetParent?void 0:o.getOffsetParent(s.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=ib(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,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 cb(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function db(e){return Mv.some(t=>e[t]>=0)}const ub=new Set(["left","top"]);function fb(){return"undefined"!=typeof window}function mb(e){return gb(e)?(e.nodeName||"").toLowerCase():"#document"}function pb(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function hb(e){var t;return null==(t=(gb(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function gb(e){return!!fb()&&(e instanceof Node||e instanceof pb(e).Node)}function vb(e){return!!fb()&&(e instanceof Element||e instanceof pb(e).Element)}function bb(e){return!!fb()&&(e instanceof HTMLElement||e instanceof pb(e).HTMLElement)}function yb(e){return!(!fb()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof pb(e).ShadowRoot)}const wb=new Set(["inline","contents"]);function xb(e){const{overflow:t,overflowX:r,overflowY:n,display:a}=Db(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!wb.has(a)}const Sb=new Set(["table","td","th"]);function kb(e){return Sb.has(mb(e))}const Ab=[":popover-open",":modal"];function Eb(e){return Ab.some(t=>{try{return e.matches(t)}catch(e){return!1}})}const Cb=["transform","translate","scale","rotate","perspective"],Tb=["transform","translate","scale","rotate","perspective","filter"],Nb=["paint","layout","strict","content"];function _b(e){const t=Rb(),r=vb(e)?Db(e):e;return Cb.some(e=>!!r[e]&&"none"!==r[e])||!!r.containerType&&"normal"!==r.containerType||!t&&!!r.backdropFilter&&"none"!==r.backdropFilter||!t&&!!r.filter&&"none"!==r.filter||Tb.some(e=>(r.willChange||"").includes(e))||Nb.some(e=>(r.contain||"").includes(e))}function Rb(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const Pb=new Set(["html","body","#document"]);function Ob(e){return Pb.has(mb(e))}function Db(e){return pb(e).getComputedStyle(e)}function Ib(e){return vb(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Mb(e){if("html"===mb(e))return e;const t=e.assignedSlot||e.parentNode||yb(e)&&e.host||hb(e);return yb(t)?t.host:t}function Ub(e){const t=Mb(e);return Ob(t)?e.ownerDocument?e.ownerDocument.body:e.body:bb(t)&&xb(t)?t:Ub(t)}function Lb(e,t,r){var n;void 0===t&&(t=[]),void 0===r&&(r=!0);const a=Ub(e),o=a===(null==(n=e.ownerDocument)?void 0:n.body),i=pb(a);if(o){const e=zb(i);return t.concat(i,i.visualViewport||[],xb(a)?a:[],e&&r?Lb(e):[])}return t.concat(a,Lb(a,[],r))}function zb(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Fb(e){const t=Db(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const a=bb(e),o=a?e.offsetWidth:r,i=a?e.offsetHeight:n,s=zv(r)!==o||zv(n)!==i;return s&&(r=o,n=i),{width:r,height:n,$:s}}function jb(e){return vb(e)?e:e.contextElement}function Bb(e){const t=jb(e);if(!bb(t))return jv(1);const r=t.getBoundingClientRect(),{width:n,height:a,$:o}=Fb(t);let i=(o?zv(r.width):r.width)/n,s=(o?zv(r.height):r.height)/a;return i&&Number.isFinite(i)||(i=1),s&&Number.isFinite(s)||(s=1),{x:i,y:s}}const Vb=jv(0);function $b(e){const t=pb(e);return Rb()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Vb}function Wb(e,t,r,n){void 0===t&&(t=!1),void 0===r&&(r=!1);const a=e.getBoundingClientRect(),o=jb(e);let i=jv(1);t&&(n?vb(n)&&(i=Bb(n)):i=Bb(e));const s=function(e,t,r){return void 0===t&&(t=!1),!(!r||t&&r!==pb(e))&&t}(o,r,n)?$b(o):jv(0);let l=(a.left+s.x)/i.x,c=(a.top+s.y)/i.y,d=a.width/i.x,u=a.height/i.y;if(o){const e=pb(o),t=n&&vb(n)?pb(n):n;let r=e,a=zb(r);for(;a&&n&&t!==r;){const e=Bb(a),t=a.getBoundingClientRect(),n=Db(a),o=t.left+(a.clientLeft+parseFloat(n.paddingLeft))*e.x,i=t.top+(a.clientTop+parseFloat(n.paddingTop))*e.y;l*=e.x,c*=e.y,d*=e.x,u*=e.y,l+=o,c+=i,r=pb(a),a=zb(r)}}return ib({width:d,height:u,x:l,y:c})}function Gb(e,t){const r=Ib(e).scrollLeft;return t?t.left+r:Wb(hb(e)).left+r}function Kb(e,t){const r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-Gb(e,r),y:r.top+t.scrollTop}}const Hb=new Set(["absolute","fixed"]);function Zb(e,t,r){let n;if("viewport"===t)n=function(e,t){const r=pb(e),n=hb(e),a=r.visualViewport;let o=n.clientWidth,i=n.clientHeight,s=0,l=0;if(a){o=a.width,i=a.height;const e=Rb();(!e||e&&"fixed"===t)&&(s=a.offsetLeft,l=a.offsetTop)}const c=Gb(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,i=Math.abs(n.clientWidth-t.clientWidth-a);i<=25&&(o-=i)}else c<=25&&(o+=c);return{width:o,height:i,x:s,y:l}}(e,r);else if("document"===t)n=function(e){const t=hb(e),r=Ib(e),n=e.ownerDocument.body,a=Lv(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),o=Lv(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-r.scrollLeft+Gb(e);const s=-r.scrollTop;return"rtl"===Db(n).direction&&(i+=Lv(t.clientWidth,n.clientWidth)-a),{width:a,height:o,x:i,y:s}}(hb(e));else if(vb(t))n=function(e,t){const r=Wb(e,!0,"fixed"===t),n=r.top+e.clientTop,a=r.left+e.clientLeft,o=bb(e)?Bb(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 ib(n)}function qb(e,t){const r=Mb(e);return!(r===t||!vb(r)||Ob(r))&&("fixed"===Db(r).position||qb(r,t))}function Jb(e,t,r){const n=bb(t),a=hb(t),o="fixed"===r,i=Wb(e,!0,o,t);let s={scrollLeft:0,scrollTop:0};const l=jv(0);function c(){l.x=Gb(a)}if(n||!n&&!o)if(("body"!==mb(t)||xb(a))&&(s=Ib(t)),n){const e=Wb(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):Kb(a,s);return{x:i.left+s.scrollLeft-l.x-d.x,y:i.top+s.scrollTop-l.y-d.y,width:i.width,height:i.height}}function Yb(e){return"static"===Db(e).position}function Xb(e,t){if(!bb(e)||"fixed"===Db(e).position)return null;if(t)return t(e);let r=e.offsetParent;return hb(e)===r&&(r=r.ownerDocument.body),r}function Qb(e,t){const r=pb(e);if(Eb(e))return r;if(!bb(e)){let t=Mb(e);for(;t&&!Ob(t);){if(vb(t)&&!Yb(t))return t;t=Mb(t)}return r}let n=Xb(e,t);for(;n&&kb(n)&&Yb(n);)n=Xb(n,t);return n&&Ob(n)&&Yb(n)&&!_b(n)?r:n||function(e){let t=Mb(e);for(;bb(t)&&!Ob(t);){if(_b(t))return t;if(Eb(t))return null;t=Mb(t)}return null}(e)||r}const ey={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:r,offsetParent:n,strategy:a}=e;const o="fixed"===a,i=hb(n),s=!!t&&Eb(t.floating);if(n===i||s&&o)return r;let l={scrollLeft:0,scrollTop:0},c=jv(1);const d=jv(0),u=bb(n);if((u||!u&&!o)&&(("body"!==mb(n)||xb(i))&&(l=Ib(n)),bb(n))){const e=Wb(n);c=Bb(n),d.x=e.x+n.clientLeft,d.y=e.y+n.clientTop}const f=!i||u||o?jv(0):Kb(i,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:hb,getClippingRect:function(e){let{element:t,boundary:r,rootBoundary:n,strategy:a}=e;const o="clippingAncestors"===r?Eb(t)?[]:function(e,t){const r=t.get(e);if(r)return r;let n=Lb(e,[],!1).filter(e=>vb(e)&&"body"!==mb(e)),a=null;const o="fixed"===Db(e).position;let i=o?Mb(e):e;for(;vb(i)&&!Ob(i);){const t=Db(i),r=_b(i);r||"fixed"!==t.position||(a=null),(o?!r&&!a:!r&&"static"===t.position&&a&&Hb.has(a.position)||xb(i)&&!r&&qb(e,i))?n=n.filter(e=>e!==i):a=t,i=Mb(i)}return t.set(e,n),n}(t,this._c):[].concat(r),i=[...o,n],s=i[0],l=i.reduce((e,r)=>{const n=Zb(t,r,a);return e.top=Lv(n.top,e.top),e.right=Uv(n.right,e.right),e.bottom=Uv(n.bottom,e.bottom),e.left=Lv(n.left,e.left),e},Zb(t,s,a));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:Qb,getElementRects:async function(e){const t=this.getOffsetParent||Qb,r=this.getDimensions,n=await r(e.floating);return{reference:Jb(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}=Fb(e);return{width:t,height:r}},getScale:Bb,isElement:vb,isRTL:function(e){return"rtl"===Db(e).direction}};function ty(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ry(e,t,r,n){void 0===n&&(n={});const{ancestorScroll:a=!0,ancestorResize:o=!0,elementResize:i="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:l=!1}=n,c=jb(e),d=a||o?[...c?Lb(c):[],...Lb(t)]:[];d.forEach(e=>{a&&e.addEventListener("scroll",r,{passive:!0}),o&&e.addEventListener("resize",r)});const u=c&&s?function(e,t){let r,n=null;const a=hb(e);function o(){var e;clearTimeout(r),null==(e=n)||e.disconnect(),n=null}return function i(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),o();const c=e.getBoundingClientRect(),{left:d,top:u,width:f,height:m}=c;if(s||t(),!f||!m)return;const p={rootMargin:-Fv(u)+"px "+-Fv(a.clientWidth-(d+f))+"px "+-Fv(a.clientHeight-(u+m))+"px "+-Fv(d)+"px",threshold:Lv(0,Uv(1,l))||1};let h=!0;function g(t){const n=t[0].intersectionRatio;if(n!==l){if(!h)return i();n?i(!1,n):r=setTimeout(()=>{i(!1,1e-7)},1e3)}1!==n||ty(c,e.getBoundingClientRect())||i(),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;i&&(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?Wb(e):null;return l&&function t(){const n=Wb(e);h&&!ty(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 ny=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:a,y:o,placement:i,middlewareData:s}=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)),i=Gv(r),s=Kv(r),l="y"===Jv(r),c=ub.has(i)?-1:1,d=o&&l?-1:1,u=Wv(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 s&&"number"==typeof p&&(m="end"===s?-1*p:p),l?{x:m*d,y:f*c}:{x:f*c,y:m*d}}(t,e);return i===(null==(r=s.offset)?void 0:r.placement)&&null!=(n=s.arrow)&&n.alignmentOffset?{}:{x:a+l.x,y:o+l.y,data:{...l,placement:i}}}}},ay=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:i=!1,limiter:s={fn:e=>{let{x:t,y:r}=e;return{x:t,y:r}}},...l}=Wv(e,t),c={x:r,y:n},d=await lb(t,l),u=Jv(Gv(a)),f=Hv(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(i){const e="y"===u?"bottom":"right";p=$v(p+d["y"===u?"top":"left"],p,p-d[e])}const h=s.fn({...t,[f]:m,[u]:p});return{...h,data:{x:h.x-r,y:h.y-n,enabled:{[f]:o,[u]:i}}}}}},oy=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:a,middlewareData:o,rects:i,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:f,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:h=!0,...g}=Wv(e,t);if(null!=(r=o.arrow)&&r.alignmentOffset)return{};const v=Gv(a),b=Jv(s),y=Gv(s)===s,w=await(null==l.isRTL?void 0:l.isRTL(c.floating)),x=f||(y||!h?[ab(s)]:function(e){const t=ab(e);return[Xv(e),t,Xv(t)]}(s)),S="none"!==p;!f&&S&&x.push(...nb(s,h,p,w));const k=[s,...x],A=await lb(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=Kv(e),a=Yv(e),o=Zv(a);let i="x"===a?n===(r?"end":"start")?"right":"left":"start"===n?"bottom":"top";return t.reference[o]>t.floating[o]&&(i=ab(i)),[i,ab(i)]}(a,i,w);E.push(A[e[0]],A[e[1]])}if(C=[...C,{placement:a,overflows:E}],!E.every(e=>e<=0)){var T,N;const e=((null==(T=o.flip)?void 0:T.index)||0)+1,t=k[e];if(t){if(!("alignment"===u&&b!==Jv(t))||C.every(e=>Jv(e.placement)!==b||e.overflows[0]>0))return{data:{index:e,overflows:C},reset:{placement:t}}}let r=null==(N=C.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:N.placement;if(!r)switch(m){case"bestFit":{var _;const e=null==(_=C.filter(e=>{if(S){const t=Jv(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=s}if(a!==r)return{reset:{placement:r}}}return{}}}},iy=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:a,rects:o,platform:i,elements:s}=t,{apply:l=()=>{},...c}=Wv(e,t),d=await lb(t,c),u=Gv(a),f=Kv(a),m="y"===Jv(a),{width:p,height:h}=o.floating;let g,v;"top"===u||"bottom"===u?(g=u,v=f===(await(null==i.isRTL?void 0:i.isRTL(s.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=Uv(h-d[g],b),x=Uv(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=Lv(d.left,0),t=Lv(d.right,0),r=Lv(d.top,0),n=Lv(d.bottom,0);m?A=p-2*(0!==e||0!==t?e+t:Lv(d.left,d.right)):k=h-2*(0!==r||0!==n?r+n:Lv(d.top,d.bottom))}await l({...t,availableWidth:A,availableHeight:k});const E=await i.getDimensions(s.floating);return p!==E.width||h!==E.height?{reset:{rects:!0}}:{}}}},sy=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...a}=Wv(e,t);switch(n){case"referenceHidden":{const e=cb(await lb(t,{...a,elementContext:"reference"}),r.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:db(e)}}}case"escaped":{const e=cb(await lb(t,{...a,altBoundary:!0}),r.floating);return{data:{escapedOffsets:e,escaped:db(e)}}}default:return{}}}}},ly=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:a,rects:o,platform:i,elements:s,middlewareData:l}=t,{element:c,padding:d=0}=Wv(e,t)||{};if(null==c)return{};const u=ob(d),f={x:r,y:n},m=Yv(a),p=Zv(m),h=await i.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==i.getOffsetParent?void 0:i.getOffsetParent(c));let k=S?S[y]:0;k&&await(null==i.isElement?void 0:i.isElement(S))||(k=s.floating[y]||o.floating[p]);const A=w/2-x/2,E=k/2-h[p]/2-1,C=Uv(u[v],E),T=Uv(u[b],E),N=C,_=k-h[p]-T,R=k/2-h[p]/2+A,P=$v(N,R,_),O=!l.arrow&&null!=Kv(a)&&R!==P&&o.reference[p]/2-(R<N?C:T)-h[p]/2<0,D=O?R<N?R-N:R-_:0;return{[m]:f[m]+D,data:{[m]:P,centerOffset:R-P-D,...O&&{alignmentOffset:D}},reset:O}}}),cy=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:a,rects:o,middlewareData:i}=t,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=Wv(e,t),d={x:r,y:n},u=Jv(a),f=Hv(u);let m=d[f],p=d[u];const h=Wv(s,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=ub.has(Gv(a)),r=o.reference[u]-o.floating[e]+(t&&(null==(v=i.offset)?void 0:v[u])||0)+(t?0:g.crossAxis),n=o.reference[u]+o.reference[e]+(t?0:(null==(b=i.offset)?void 0:b[u])||0)-(t?g.crossAxis:0);p<r?p=r:p>n&&(p=n)}return{[f]:m,[u]:p}}}},dy=(e,t,r)=>{const n=new Map,a={platform:ey,...r},o={...a.platform,_c:n};return(async(e,t,r)=>{const{placement:n="bottom",strategy:a="absolute",middleware:o=[],platform:i}=r,s=o.filter(Boolean),l=await(null==i.isRTL?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:a}),{x:d,y:u}=sb(c,n,l),f=n,m={},p=0;for(let r=0;r<s.length;r++){const{name:o,fn:h}=s[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:i,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 i.getElementRects({reference:e,floating:t,strategy:a}):y.rects),({x:d,y:u}=sb(c,f,l))),r=-1)}return{x:d,y:u,placement:f,strategy:a,middlewareData:m}})(e,t,{...a,platform:o})};var uy="undefined"!=typeof document?p:function(){};function fy(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(!fy(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)&&!fy(e[r],t[r]))return!1}return!0}return e!=e&&t!=t}function my(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function py(e,t){const r=my(e);return Math.round(t*r)/r}function hy(e){const t=n.useRef(e);return uy(()=>{t.current=e}),t}const gy=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?ly({element:r.current,padding:n}).fn(t):{}:r?ly({element:r,padding:n}).fn(t):{};var a}}),vy=(e,t)=>({...ny(e),options:[e,t]}),by=(e,t)=>({...ay(e),options:[e,t]}),yy=(e,t)=>({...cy(e),options:[e,t]}),wy=(e,t)=>({...oy(e),options:[e,t]}),xy=(e,t)=>({...iy(e),options:[e,t]}),Sy=(e,t)=>({...sy(e),options:[e,t]}),ky=(e,t)=>({...gy(e),options:[e,t]});var Ay=n.forwardRef((t,r)=>{const{children:n,width:a=10,height:o=5,...i}=t;return e(zi.svg,{...i,ref:r,width:a,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:e("polygon",{points:"0,0 30,0 15,10"})})});Ay.displayName="Arrow";var Ey=Ay,Cy="Popper",[Ty,Ny]=Kd(Cy),[_y,Ry]=Ty(Cy),Py=t=>{const{__scopePopper:r,children:a}=t,[o,i]=n.useState(null);return e(_y,{scope:r,anchor:o,onAnchorChange:i,children:a})};Py.displayName=Cy;var Oy="PopperAnchor",Dy=n.forwardRef((t,r)=>{const{__scopePopper:a,virtualRef:o,...i}=t,s=Ry(Oy,a),l=n.useRef(null),c=ai(r,l),d=n.useRef(null);return n.useEffect(()=>{const e=d.current;d.current=o?.current||l.current,e!==d.current&&s.onAnchorChange(d.current)}),o?null:e(zi.div,{...i,ref:c})});Dy.displayName=Oy;var Iy="PopperContent",[My,Uy]=Ty(Iy),Ly=n.forwardRef((t,r)=>{const{__scopePopper:a,side:o="bottom",sideOffset:i=0,align:s="center",alignOffset:l=0,arrowPadding:c=0,avoidCollisions:d=!0,collisionBoundary:u=[],collisionPadding:f=0,sticky:m="partial",hideWhenDetached:p=!1,updatePositionStrategy:g="optimized",onPlaced:v,...b}=t,y=Ry(Iy,a),[w,x]=n.useState(null),S=ai(r,e=>x(e)),[k,A]=n.useState(null),E=wp(k),C=E?.width??0,T=E?.height??0,N=o+("center"!==s?"-"+s:""),_="number"==typeof f?f:{top:0,right:0,bottom:0,left:0,...f},R=Array.isArray(u)?u:[u],P=R.length>0,O={padding:_,boundary:R.filter(By),altBoundary:P},{refs:D,floatingStyles:I,placement:M,isPositioned:U,middlewareData:L}=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:a=[],platform:o,elements:{reference:i,floating:s}={},transform:l=!0,whileElementsMounted:c,open:d}=e,[u,f]=n.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[m,p]=n.useState(a);fy(m,a)||p(a);const[g,v]=n.useState(null),[b,y]=n.useState(null),w=n.useCallback(e=>{e!==A.current&&(A.current=e,v(e))},[]),x=n.useCallback(e=>{e!==E.current&&(E.current=e,y(e))},[]),S=i||g,k=s||b,A=n.useRef(null),E=n.useRef(null),C=n.useRef(u),T=null!=c,N=hy(c),_=hy(o),R=hy(d),P=n.useCallback(()=>{if(!A.current||!E.current)return;const e={placement:t,strategy:r,middleware:m};_.current&&(e.platform=_.current),dy(A.current,E.current,e).then(e=>{const t={...e,isPositioned:!1!==R.current};O.current&&!fy(C.current,t)&&(C.current=t,h.flushSync(()=>{f(t)}))})},[m,t,r,_,R]);uy(()=>{!1===d&&C.current.isPositioned&&(C.current.isPositioned=!1,f(e=>({...e,isPositioned:!1})))},[d]);const O=n.useRef(!1);uy(()=>(O.current=!0,()=>{O.current=!1}),[]),uy(()=>{if(S&&(A.current=S),k&&(E.current=k),S&&k){if(N.current)return N.current(S,k,P);P()}},[S,k,P,N,T]);const D=n.useMemo(()=>({reference:A,floating:E,setReference:w,setFloating:x}),[w,x]),I=n.useMemo(()=>({reference:S,floating:k}),[S,k]),M=n.useMemo(()=>{const e={position:r,left:0,top:0};if(!I.floating)return e;const t=py(I.floating,u.x),n=py(I.floating,u.y);return l?{...e,transform:"translate("+t+"px, "+n+"px)",...my(I.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}},[r,l,I.floating,u.x,u.y]);return n.useMemo(()=>({...u,update:P,refs:D,elements:I,floatingStyles:M}),[u,P,D,I,M])}({strategy:"fixed",placement:N,whileElementsMounted:(...e)=>ry(...e,{animationFrame:"always"===g}),elements:{reference:y.anchor},middleware:[vy({mainAxis:i+T,alignmentAxis:l}),d&&by({mainAxis:!0,crossAxis:!1,limiter:"partial"===m?yy():void 0,...O}),d&&wy({...O}),xy({...O,apply:({elements:e,rects:t,availableWidth:r,availableHeight:n})=>{const{width:a,height:o}=t.reference,i=e.floating.style;i.setProperty("--radix-popper-available-width",`${r}px`),i.setProperty("--radix-popper-available-height",`${n}px`),i.setProperty("--radix-popper-anchor-width",`${a}px`),i.setProperty("--radix-popper-anchor-height",`${o}px`)}}),k&&ky({element:k,padding:c}),Vy({arrowWidth:C,arrowHeight:T}),p&&Sy({strategy:"referenceHidden",...O})]}),[z,F]=$y(M),j=Zd(v);Jd(()=>{U&&j?.()},[U,j]);const B=L.arrow?.x,V=L.arrow?.y,$=0!==L.arrow?.centerOffset,[W,G]=n.useState();return Jd(()=>{w&&G(window.getComputedStyle(w).zIndex)},[w]),e("div",{ref:D.setFloating,"data-radix-popper-content-wrapper":"",style:{...I,transform:U?I.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(My,{scope:a,placedSide:z,onArrowChange:A,arrowX:B,arrowY:V,shouldHideArrow:$,children:e(zi.div,{"data-side":z,"data-align":F,...b,ref:S,style:{...b.style,animation:U?void 0:"none"}})})})});Ly.displayName=Iy;var zy="PopperArrow",Fy={top:"bottom",right:"left",bottom:"top",left:"right"},jy=n.forwardRef(function(t,r){const{__scopePopper:n,...a}=t,o=Uy(zy,n),i=Fy[o.placedSide];return e("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[i]: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(Ey,{...a,ref:r,style:{...a.style,display:"block"}})})});function By(e){return null!==e}jy.displayName=zy;var Vy=e=>({name:"transformOrigin",options:e,fn(t){const{placement:r,rects:n,middlewareData:a}=t,o=0!==a.arrow?.centerOffset,i=o?0:e.arrowWidth,s=o?0:e.arrowHeight,[l,c]=$y(r),d={start:"0%",center:"50%",end:"100%"}[c],u=(a.arrow?.x??0)+i/2,f=(a.arrow?.y??0)+s/2;let m="",p="";return"bottom"===l?(m=o?d:`${u}px`,p=-s+"px"):"top"===l?(m=o?d:`${u}px`,p=`${n.floating.height+s}px`):"right"===l?(m=-s+"px",p=o?d:`${f}px`):"left"===l&&(m=`${n.floating.width+s}px`,p=o?d:`${f}px`),{data:{x:m,y:p}}}});function $y(e){const[t,r="center"]=e.split("-");return[t,r]}var Wy=Py,Gy=Dy,Ky=Ly,Hy=jy,Zy="Popover",[qy,Jy]=Kd(Zy,[Ny]),Yy=Ny(),[Xy,Qy]=qy(Zy),ew=t=>{const{__scopePopover:r,children:a,open:o,defaultOpen:i,onOpenChange:s,modal:l=!1}=t,c=Yy(r),d=n.useRef(null),[u,f]=n.useState(!1),[m,p]=_u({prop:o,defaultProp:i??!1,onChange:s,caller:Zy});return e(Wy,{...c,children:e(Xy,{scope:r,contentId:Tu(),triggerRef:d,open:m,onOpenChange:p,onOpenToggle:n.useCallback(()=>p(e=>!e),[p]),hasCustomAnchor:u,onCustomAnchorAdd:n.useCallback(()=>f(!0),[]),onCustomAnchorRemove:n.useCallback(()=>f(!1),[]),modal:l,children:a})})};ew.displayName=Zy;var tw="PopoverAnchor";n.forwardRef((t,r)=>{const{__scopePopover:a,...o}=t,i=Qy(tw,a),s=Yy(a),{onCustomAnchorAdd:l,onCustomAnchorRemove:c}=i;return n.useEffect(()=>(l(),()=>c()),[l,c]),e(Gy,{...s,...o,ref:r})}).displayName=tw;var rw="PopoverTrigger",nw=n.forwardRef((t,r)=>{const{__scopePopover:n,...a}=t,o=Qy(rw,n),i=Yy(n),s=ai(r,o.triggerRef),l=e(zi.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":hw(o.open),...a,ref:s,onClick:Au(t.onClick,o.onOpenToggle)});return o.hasCustomAnchor?l:e(Gy,{asChild:!0,...i,children:l})});nw.displayName=rw;var aw="PopoverPortal",[ow,iw]=qy(aw,{forceMount:void 0}),sw=t=>{const{__scopePopover:r,forceMount:n,children:a,container:o}=t,i=Qy(aw,r);return e(ow,{scope:r,forceMount:n,children:e(qu,{present:n||i.open,children:e(Zu,{asChild:!0,container:o,children:a})})})};sw.displayName=aw;var lw="PopoverContent",cw=n.forwardRef((t,r)=>{const n=iw(lw,t.__scopePopover),{forceMount:a=n.forceMount,...o}=t,i=Qy(lw,t.__scopePopover);return e(qu,{present:a||i.open,children:i.modal?e(uw,{...o,ref:r}):e(fw,{...o,ref:r})})});cw.displayName=lw;var dw=oi("PopoverContent.RemoveScroll"),uw=n.forwardRef((t,r)=>{const a=Qy(lw,t.__scopePopover),o=n.useRef(null),i=ai(r,o),s=n.useRef(!1);return n.useEffect(()=>{const e=o.current;if(e)return Zf(e)},[]),e(Bf,{as:dw,allowPinchZoom:!0,children:e(mw,{...t,ref:i,trapFocus:a.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Au(t.onCloseAutoFocus,e=>{e.preventDefault(),s.current||a.triggerRef.current?.focus()}),onPointerDownOutside:Au(t.onPointerDownOutside,e=>{const t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey,n=2===t.button||r;s.current=n},{checkForDefaultPrevented:!1}),onFocusOutside:Au(t.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),fw=n.forwardRef((t,r)=>{const a=Qy(lw,t.__scopePopover),o=n.useRef(!1),i=n.useRef(!1);return e(mw,{...t,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:e=>{t.onCloseAutoFocus?.(e),e.defaultPrevented||(o.current||a.triggerRef.current?.focus(),e.preventDefault()),o.current=!1,i.current=!1},onInteractOutside:e=>{t.onInteractOutside?.(e),e.defaultPrevented||(o.current=!0,"pointerdown"===e.detail.originalEvent.type&&(i.current=!0));const r=e.target,n=a.triggerRef.current?.contains(r);n&&e.preventDefault(),"focusin"===e.detail.originalEvent.type&&i.current&&e.preventDefault()}})}),mw=n.forwardRef((t,r)=>{const{__scopePopover:n,trapFocus:a,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:u,...f}=t,m=Qy(lw,n),p=Yy(n);return Xu(),e(Bu,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:o,onUnmountAutoFocus:i,children:e(Mu,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:u,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onDismiss:()=>m.onOpenChange(!1),children:e(Ky,{"data-state":hw(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)"}})})})}),pw="PopoverClose";n.forwardRef((t,r)=>{const{__scopePopover:n,...a}=t,o=Qy(pw,n);return e(zi.button,{type:"button",...a,ref:r,onClick:Au(t.onClick,()=>o.onOpenChange(!1))})}).displayName=pw;function hw(e){return e?"open":"closed"}n.forwardRef((t,r)=>{const{__scopePopover:n,...a}=t,o=Yy(n);return e(Hy,{...o,...a,ref:r})}).displayName="PopoverArrow";var gw=sw,vw=cw;const bw=ew,yw=nw,ww=n.forwardRef(({className:t,align:r="center",sideOffset:a=4,...o},i)=>{const{container:s}=n.useContext(ge);return e(gw,{container:s,children:e(vw,{ref:i,align:r,sideOffset:a,className:ti("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})})});ww.displayName=vw.displayName;const xw={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"},Sw={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"},kw=[{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=Sw[e.code]||"USD",r=xw[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 Aw(t){const[n,a]=f(t.value||""),[o,i]=f(!1),s=kw.find(e=>e.value==n);return r(bw,{open:o,onOpenChange:i,children:[e(yw,{asChild:!0,children:r(Li,{variant:"outline",role:"combobox","aria-expanded":o,className:"justify-between overflow-hidden text-ellipsis",children:[s?.text&&r("div",{children:[String(s.text).trim(),e("span",{className:"ml-2 text-xs text-muted-foreground",children:s.flag})]}),!s&&e("span",{className:"text-muted-foreground",children:"Choose country"}),e(Si,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),e(ww,{className:"p-0 overflow-hidden text-ellipsis",children:r(Rv,{children:[e(Pv,{placeholder:"Choose country..."}),e(Ov,{children:e(Dv,{children:kw.map(o=>r(Iv,{className:ti("whitespace-nowrap text-left",{"text-green-500":n===o.value}),value:o.value,defaultValue:o.value,onSelect:e=>{const r=o.value;a(r),t.onChange&&"function"==typeof t.onChange&&t.onChange(r),i(!1)},children:[n===o.value&&e(xi,{className:ti("mr-2 h-4 w-4 text-green-400",n===o.value?"opacity-100":"opacity-0")}),String(o.text).trim(),e("span",{className:"ml-2 text-xs text-muted-foreground",children:o.flag})]},o.value))})})]})})]})}const Ew=kw.map(e=>({value:e.currencyCode,text:e.currencyCode,icon:e.currencyIcon??null})),Cw=Array.from(new Set(Ew.map(e=>e.value))).map(e=>Ew.find(t=>t.value===e)).filter(e=>void 0!==e);function Tw(t){const[n,a]=f(t.value||""),[o,i]=f(!1),s=Cw.find(e=>e.value==n);return r(bw,{open:o,onOpenChange:i,children:[e(yw,{asChild:!0,children:r(Li,{variant:"outline",role:"combobox","aria-expanded":o,className:"justify-between overflow-hidden text-ellipsis",children:[s?.text&&r("div",{children:[String(s.text).trim(),e("span",{className:"ml-2 text-xs text-muted-foreground",children:s.icon})]}),!s&&e("span",{className:"text-muted-foreground",children:"Choose Currency"}),e(Si,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),e(ww,{className:"p-0 overflow-hidden text-ellipsis",children:r(Rv,{children:[e(Pv,{placeholder:"Choose currency..."}),e(Ov,{children:e(Dv,{children:Cw.map(o=>r(Iv,{className:ti("whitespace-nowrap text-left",{"text-green-500":n===o.value}),value:o.value,defaultValue:o.value,onSelect:e=>{const r=o.value;a(r),t.onChange&&"function"==typeof t.onChange&&t.onChange(r),i(!1)},children:[n===o.value&&e(xi,{className:ti("mr-2 h-4 w-4 text-green-400",n===o.value?"opacity-100":"opacity-0")}),String(o.text).trim(),e("span",{className:"ml-2 text-xs text-muted-foreground",children:o.icon})]},o.value))})})]})})]})}let Nw=[{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:"🇮🇱"}];Nw=Nw.filter((e,t,r)=>t===r.findIndex(t=>t.code===e.code&&t.label===e.label)),Nw.sort((e,t)=>e.label<t.label?-1:e.label>t.label?1:0);const _w=Nw.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 Rw(t){const[n,a]=f(t.value||""),[o,i]=f(!1),s=_w.find(e=>e.value==n);return r(bw,{open:o,onOpenChange:i,children:[e(yw,{asChild:!0,children:r(Li,{variant:"outline",role:"combobox","aria-expanded":o,className:"justify-between overflow-hidden text-ellipsis",children:[s&&r("div",{children:[String(s.label).trim(),e("span",{className:"ml-2 text-xs text-muted-foreground",children:s.flag})]}),!s&&"Choose language",e(Si,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),e(ww,{className:"p-0 overflow-hidden text-ellipsis",children:r(Rv,{children:[e(Pv,{placeholder:"Choose timezone..."}),e(Ov,{children:e(Dv,{children:_w.map(o=>r(Iv,{className:ti("whitespace-nowrap text-left",{"text-green-500":n===o.value}),value:o.value,defaultValue:o.value,onSelect:e=>{const r=o.value;a(r),t.onChange&&"function"==typeof t.onChange&&t.onChange(r),i(!1)},children:[n===o.value&&e(xi,{className:ti("mr-2 h-4 w-4 text-green-400",n===o.value?"opacity-100":"opacity-0")}),String(o.label).trim(),e("span",{className:"ml-2 text-xs text-muted-foreground",children:o.flag})]},o.value))})})]})})]})}const Pw=[{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 i=o.substring(o.indexOf("(")+1,o.indexOf(")"));-1!==i.indexOf("UTC")&&e.push({value:a,abbr:t.abbr,offset:t.offset,isdst:t.isdst,text:`(${i}) ${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 Ow(t){const[n,a]=f(t.value||""),[o,i]=f(!1),s=Pw.find(e=>e.value==n);return r(bw,{open:o,onOpenChange:i,children:[e(yw,{asChild:!0,children:r(Li,{variant:"outline",role:"combobox","aria-expanded":o,className:"justify-between overflow-hidden text-ellipsis",children:[s?.text||"Choose timezone",e(Si,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),e(ww,{className:"p-0 overflow-hidden text-ellipsis",children:r(Rv,{children:[e(Pv,{placeholder:"Choose timezone..."}),e(Ov,{children:e(Dv,{children:Pw.map(o=>r(Iv,{className:ti("whitespace-nowrap text-left",{"text-green-500":n===o.value}),value:o.value,defaultValue:o.value,onSelect:e=>{const r=o.value;a(r),t.onChange&&"function"==typeof t.onChange&&t.onChange(r),i(!1)},children:[n===o.value&&e(xi,{className:ti("mr-2 h-4 w-4 text-green-400",n===o.value?"opacity-100":"opacity-0")}),String(o.text).trim()]},o.value))})})]})})]})}const Dw=({workspace:t})=>{const{updateUserProfile:n,getProfile:a}=lS(),[o,i]=f(!1),[s,l]=f(),[d,u]=f(0),m=Gt({resolver:Ga(Qs({name:Cs().min(2,{message:"Name must be at least 2 characters."}),country:Cs().optional(),timezone:Cs().optional(),language:Cs().optional(),currency:Cs().optional()})),defaultValues:{name:s?.name||"",country:s?.country||"",timezone:s?.timezone||"",language:s?.language||"",currency:s?.currency||""}});return c(()=>{a().then(e=>{l(e),m.setValue("name",e.name),m.setValue("country",e.country),m.setValue("timezone",e.timezone),m.setValue("language",e.language),m.setValue("currency",e.currency)})},[d]),s?r("div",{children:[e("div",{className:"space-y-4",children:e($i,{...m,children:r("form",{onSubmit:m.handleSubmit(async function(e){i(!0),await n({name:e.name,country:e.country,timezone:e.timezone,language:e.language,currency:e.currency}),i(!1)}),className:"space-y-4",children:[r("div",{children:[e("label",{className:"block text-sm font-medium mb-1",children:"Email"}),e(Qi,{disabled:!0,className:"w-full border rounded px-3 py-2 bg-gray-100",value:s?.email})]}),e(Gi,{disabled:o,control:m.control,name:"name",render:({field:t})=>r(Zi,{children:[e(qi,{children:"Name"}),e(Ji,{children:e(Qi,{...t})}),e(Xi,{})]})}),r("div",{className:"flex gap-y-2 my-4 flex-col",children:[r("div",{className:"flex flex-col gap-0.5",children:[e("div",{className:"text-sm font-medium",children:"Language"}),e(Rw,{value:m.getValues("language"),onChange:e=>{m.setValue("language",e)}})]}),r("div",{className:"flex flex-col gap-0.5",children:[e("div",{className:"text-sm font-medium",children:"Country"}),e(Aw,{value:m.getValues("country"),onChange:e=>{m.setValue("country",e)}})]}),r("div",{className:"flex flex-col gap-0.5",children:[e("div",{className:"text-sm font-medium",children:"Currency"}),e(Tw,{value:m.getValues("currency"),onChange:e=>{m.setValue("currency",e)}})]}),r("div",{className:"flex flex-col gap-0.5",children:[e("div",{className:"text-sm font-medium",children:"Timezone"}),e(Ow,{value:m.getValues("timezone"),onChange:e=>{m.setValue("timezone",e)}})]})]}),r("div",{className:"flex justify-end gap-x-2",children:[e(Li,{type:"submit",progress:o,disabled:o,children:"Save"}),e(Li,{type:"button",variant:"outline",onClick:()=>{u(e=>e+1)},disabled:o,children:"Reset"})]})]})})}),s?.image&&r("div",{children:[e("label",{className:"block text-sm font-medium mb-1",children:"Profile Image"}),e("div",{className:"w-16 h-16 rounded-full overflow-hidden",children:e("img",{src:s.image,alt:s.name,className:"w-full h-full object-cover"})})]})]}):e(Eg,{})};var Iw=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"});n.forwardRef((t,r)=>e(zi.span,{...t,ref:r,style:{...Iw,...t.style}})).displayName="VisuallyHidden";var Mw=[" ","Enter","ArrowUp","ArrowDown"],Uw=[" ","Enter"],Lw="Select",[zw,Fw,jw]=Qm(Lw),[Bw,Vw]=Kd(Lw,[jw,Ny]),$w=Ny(),[Ww,Gw]=Bw(Lw),[Kw,Hw]=Bw(Lw),Zw=t=>{const{__scopeSelect:a,children:o,open:i,defaultOpen:s,onOpenChange:l,value:c,defaultValue:d,onValueChange:u,dir:f,name:m,autoComplete:p,disabled:h,required:g,form:v}=t,b=$w(a),[y,w]=n.useState(null),[x,S]=n.useState(null),[k,A]=n.useState(!1),E=tp(f),[C,T]=_u({prop:i,defaultProp:s??!1,onChange:l,caller:Lw}),[N,_]=_u({prop:c,defaultProp:d,onChange:u,caller:Lw}),R=n.useRef(null),P=!y||(v||!!y.closest("form")),[O,D]=n.useState(new Set),I=Array.from(O).map(e=>e.props.value).join(";");return e(Wy,{...b,children:r(Ww,{required:g,scope:a,trigger:y,onTriggerChange:w,valueNode:x,onValueNodeChange:S,valueNodeHasChildren:k,onValueNodeHasChildrenChange:A,contentId:Tu(),value:N,onValueChange:_,open:C,onOpenChange:T,dir:E,triggerPointerDownPosRef:R,disabled:h,children:[e(zw.Provider,{scope:a,children:e(Kw,{scope:t.__scopeSelect,onNativeOptionAdd:n.useCallback(e=>{D(t=>new Set(t).add(e))},[]),onNativeOptionRemove:n.useCallback(e=>{D(t=>{const r=new Set(t);return r.delete(e),r})},[]),children:o})}),P?r(Ox,{"aria-hidden":!0,required:g,tabIndex:-1,name:m,autoComplete:p,value:N,onChange:e=>_(e.target.value),disabled:h,form:v,children:[void 0===N?e("option",{value:""}):null,Array.from(O)]},I):null]})})};Zw.displayName=Lw;var qw="SelectTrigger",Jw=n.forwardRef((t,r)=>{const{__scopeSelect:a,disabled:o=!1,...i}=t,s=$w(a),l=Gw(qw,a),c=l.disabled||o,d=ai(r,l.onTriggerChange),u=Fw(a),f=n.useRef("touch"),[m,p,h]=Ix(e=>{const t=u().filter(e=>!e.disabled),r=t.find(e=>e.value===l.value),n=Mx(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(Gy,{asChild:!0,...s,children:e(zi.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":Dx(l.value)?"":void 0,...i,ref:d,onClick:Au(i.onClick,e=>{e.currentTarget.focus(),"mouse"!==f.current&&g(e)}),onPointerDown:Au(i.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:Au(i.onKeyDown,e=>{const t=""!==m.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||p(e.key),t&&" "===e.key||Mw.includes(e.key)&&(g(),e.preventDefault())})})})});Jw.displayName=qw;var Yw="SelectValue",Xw=n.forwardRef((r,n)=>{const{__scopeSelect:a,className:o,style:i,children:s,placeholder:l="",...c}=r,d=Gw(Yw,a),{onValueNodeHasChildrenChange:u}=d,f=void 0!==s,m=ai(n,d.onValueNodeChange);return Jd(()=>{u(f)},[u,f]),e(zi.span,{...c,ref:m,style:{pointerEvents:"none"},children:Dx(d.value)?e(t,{children:l}):s})});Xw.displayName=Yw;var Qw=n.forwardRef((t,r)=>{const{__scopeSelect:n,children:a,...o}=t;return e(zi.span,{"aria-hidden":!0,...o,ref:r,children:a||"▼"})});Qw.displayName="SelectIcon";var ex=t=>e(Zu,{asChild:!0,...t});ex.displayName="SelectPortal";var tx="SelectContent",rx=n.forwardRef((t,r)=>{const a=Gw(tx,t.__scopeSelect),[o,i]=n.useState();if(Jd(()=>{i(new DocumentFragment)},[]),!a.open){const r=o;return r?h.createPortal(e(ax,{scope:t.__scopeSelect,children:e(zw.Slot,{scope:t.__scopeSelect,children:e("div",{children:t.children})})}),r):null}return e(sx,{...t,ref:r})});rx.displayName=tx;var nx=10,[ax,ox]=Bw(tx),ix=oi("SelectContent.RemoveScroll"),sx=n.forwardRef((t,r)=>{const{__scopeSelect:a,position:o="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:s,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=Gw(tx,a),[x,S]=n.useState(null),[k,A]=n.useState(null),E=ai(r,e=>S(e)),[C,T]=n.useState(null),[N,_]=n.useState(null),R=Fw(a),[P,O]=n.useState(!1),D=n.useRef(!1);n.useEffect(()=>{if(x)return Zf(x)},[x]),Xu();const I=n.useCallback(e=>{const[t,...r]=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}},[R,k]),M=n.useCallback(()=>I([C,x]),[I,C,x]);n.useEffect(()=>{P&&M()},[P,M]);const{onOpenChange:U,triggerPointerDownPosRef:L}=w;n.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)||U(!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,U,L]),n.useEffect(()=>{const e=()=>U(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[U]);const[z,F]=Ix(e=>{const t=R().filter(e=>!e.disabled),r=t.find(e=>e.ref.current===document.activeElement),n=Mx(t,e,r);n&&setTimeout(()=>n.ref.current.focus())}),j=n.useCallback((e,t,r)=>{const n=!D.current&&!r;(void 0!==w.value&&w.value===t||n)&&(T(e),n&&(D.current=!0))},[w.value]),B=n.useCallback(()=>x?.focus(),[x]),V=n.useCallback((e,t,r)=>{const n=!D.current&&!r;(void 0!==w.value&&w.value===t||n)&&_(e)},[w.value]),$="popper"===o?cx:lx,W=$===cx?{side:c,sideOffset:d,align:u,alignOffset:f,arrowPadding:m,collisionBoundary:p,collisionPadding:h,sticky:g,hideWhenDetached:v,avoidCollisions:b}:{};return e(ax,{scope:a,content:x,viewport:k,onViewportChange:A,itemRefCallback:j,selectedItem:C,onItemLeave:B,itemTextRefCallback:V,focusSelectedItem:M,selectedItemText:N,position:o,isPositioned:P,searchRef:z,children:e(Bf,{as:ix,allowPinchZoom:!0,children:e(Bu,{asChild:!0,trapped:w.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:Au(i,e=>{w.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:e(Mu,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>w.onOpenChange(!1),children:e($,{role:"listbox",id:w.contentId,"data-state":w.open?"open":"closed",dir:w.dir,onContextMenu:e=>e.preventDefault(),...y,...W,onPlaced:()=>O(!0),ref:E,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:Au(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=R().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(()=>I(t)),e.preventDefault()}})})})})})})});sx.displayName="SelectContentImpl";var lx=n.forwardRef((t,r)=>{const{__scopeSelect:a,onPlaced:o,...i}=t,s=Gw(tx,a),l=ox(tx,a),[c,d]=n.useState(null),[u,f]=n.useState(null),m=ai(r,e=>f(e)),p=Fw(a),h=n.useRef(!1),g=n.useRef(!0),{viewport:v,selectedItem:b,selectedItemText:y,focusSelectedItem:w}=l,x=n.useCallback(()=>{if(s.trigger&&s.valueNode&&c&&u&&v&&b&&y){const e=s.trigger.getBoundingClientRect(),t=u.getBoundingClientRect(),r=s.valueNode.getBoundingClientRect(),n=y.getBoundingClientRect();if("rtl"!==s.dir){const a=n.left-t.left,o=r.left-a,i=e.left-o,s=e.width+i,l=Math.max(s,t.width),d=window.innerWidth-nx,u=qp(o,[nx,Math.max(nx,d-l)]);c.style.minWidth=s+"px",c.style.left=u+"px"}else{const a=t.right-n.right,o=window.innerWidth-r.right-a,i=window.innerWidth-e.right-o,s=e.width+i,l=Math.max(s,t.width),d=window.innerWidth-nx,u=qp(o,[nx,Math.max(nx,d-l)]);c.style.minWidth=s+"px",c.style.right=u+"px"}const a=p(),i=window.innerHeight-2*nx,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-nx,C=i-E,T=b.offsetHeight/2,N=f+m+(b.offsetTop+T),_=w-N;if(N<=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=N+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=N-E+v.offsetTop}c.style.margin=`${nx}px 0`,c.style.minHeight=x+"px",c.style.maxHeight=i+"px",o?.(),requestAnimationFrame(()=>h.current=!0)}},[p,s.trigger,s.valueNode,c,u,v,b,y,s.dir,o]);Jd(()=>x(),[x]);const[S,k]=n.useState();Jd(()=>{u&&k(window.getComputedStyle(u).zIndex)},[u]);const A=n.useCallback(e=>{e&&!0===g.current&&(x(),w?.(),g.current=!1)},[x,w]);return e(dx,{scope:a,contentWrapper:c,shouldExpandOnScrollRef:h,onScrollButtonChange:A,children:e("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:e(zi.div,{...i,ref:m,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});lx.displayName="SelectItemAlignedPosition";var cx=n.forwardRef((t,r)=>{const{__scopeSelect:n,align:a="start",collisionPadding:o=nx,...i}=t,s=$w(n);return e(Ky,{...s,...i,ref:r,align:a,collisionPadding:o,style:{boxSizing:"border-box",...i.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)"}})});cx.displayName="SelectPopperPosition";var[dx,ux]=Bw(tx,{}),fx="SelectViewport",mx=n.forwardRef((a,o)=>{const{__scopeSelect:i,nonce:s,...l}=a,c=ox(fx,i),d=ux(fx,i),u=ai(o,c.onViewportChange),f=n.useRef(0);return r(t,{children:[e("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:s}),e(zw.Slot,{scope:i,children:e(zi.div,{"data-radix-select-viewport":"",role:"presentation",...l,ref:u,style:{position:"relative",flex:1,overflow:"hidden auto",...l.style},onScroll:Au(l.onScroll,e=>{const t=e.currentTarget,{contentWrapper:r,shouldExpandOnScrollRef:n}=d;if(n?.current&&r){const e=Math.abs(f.current-t.scrollTop);if(e>0){const n=window.innerHeight-2*nx,a=parseFloat(r.style.minHeight),o=parseFloat(r.style.height),i=Math.max(a,o);if(i<n){const a=i+e,o=Math.min(n,a),s=a-o;r.style.height=o+"px","0px"===r.style.bottom&&(t.scrollTop=s>0?s:0,r.style.justifyContent="flex-end")}}}f.current=t.scrollTop})})})]})});mx.displayName=fx;var px="SelectGroup",[hx,gx]=Bw(px);n.forwardRef((t,r)=>{const{__scopeSelect:n,...a}=t,o=Tu();return e(hx,{scope:n,id:o,children:e(zi.div,{role:"group","aria-labelledby":o,...a,ref:r})})}).displayName=px;var vx="SelectLabel",bx=n.forwardRef((t,r)=>{const{__scopeSelect:n,...a}=t,o=gx(vx,n);return e(zi.div,{id:o.id,...a,ref:r})});bx.displayName=vx;var yx="SelectItem",[wx,xx]=Bw(yx),Sx=n.forwardRef((t,r)=>{const{__scopeSelect:a,value:o,disabled:i=!1,textValue:s,...l}=t,c=Gw(yx,a),d=ox(yx,a),u=c.value===o,[f,m]=n.useState(s??""),[p,h]=n.useState(!1),g=ai(r,e=>d.itemRefCallback?.(e,o,i)),v=Tu(),b=n.useRef("touch"),y=()=>{i||(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(wx,{scope:a,value:o,disabled:i,textId:v,isSelected:u,onItemTextChange:n.useCallback(e=>{m(t=>t||(e?.textContent??"").trim())},[]),children:e(zw.ItemSlot,{scope:a,value:o,disabled:i,textValue:f,children:e(zi.div,{role:"option","aria-labelledby":v,"data-highlighted":p?"":void 0,"aria-selected":u&&p,"data-state":u?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...l,ref:g,onFocus:Au(l.onFocus,()=>h(!0)),onBlur:Au(l.onBlur,()=>h(!1)),onClick:Au(l.onClick,()=>{"mouse"!==b.current&&y()}),onPointerUp:Au(l.onPointerUp,()=>{"mouse"===b.current&&y()}),onPointerDown:Au(l.onPointerDown,e=>{b.current=e.pointerType}),onPointerMove:Au(l.onPointerMove,e=>{b.current=e.pointerType,i?d.onItemLeave?.():"mouse"===b.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Au(l.onPointerLeave,e=>{e.currentTarget===document.activeElement&&d.onItemLeave?.()}),onKeyDown:Au(l.onKeyDown,e=>{""!==d.searchRef?.current&&" "===e.key||(Uw.includes(e.key)&&y()," "===e.key&&e.preventDefault())})})})})});Sx.displayName=yx;var kx="SelectItemText",Ax=n.forwardRef((a,o)=>{const{__scopeSelect:i,className:s,style:l,...c}=a,d=Gw(kx,i),u=ox(kx,i),f=xx(kx,i),m=Hw(kx,i),[p,g]=n.useState(null),v=ai(o,e=>g(e),f.onItemTextChange,e=>u.itemTextRefCallback?.(e,f.value,f.disabled)),b=p?.textContent,y=n.useMemo(()=>e("option",{value:f.value,disabled:f.disabled,children:b},f.value),[f.disabled,f.value,b]),{onNativeOptionAdd:w,onNativeOptionRemove:x}=m;return Jd(()=>(w(y),()=>x(y)),[w,x,y]),r(t,{children:[e(zi.span,{id:f.textId,...c,ref:v}),f.isSelected&&d.valueNode&&!d.valueNodeHasChildren?h.createPortal(c.children,d.valueNode):null]})});Ax.displayName=kx;var Ex="SelectItemIndicator",Cx=n.forwardRef((t,r)=>{const{__scopeSelect:n,...a}=t;return xx(Ex,n).isSelected?e(zi.span,{"aria-hidden":!0,...a,ref:r}):null});Cx.displayName=Ex;var Tx="SelectScrollUpButton";n.forwardRef((t,r)=>{const a=ox(Tx,t.__scopeSelect),o=ux(Tx,t.__scopeSelect),[i,s]=n.useState(!1),l=ai(r,o.onScrollButtonChange);return Jd(()=>{if(a.viewport&&a.isPositioned){let e=function(){const e=t.scrollTop>0;s(e)};const t=a.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[a.viewport,a.isPositioned]),i?e(_x,{...t,ref:l,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=a;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null}).displayName=Tx;var Nx="SelectScrollDownButton";n.forwardRef((t,r)=>{const a=ox(Nx,t.__scopeSelect),o=ux(Nx,t.__scopeSelect),[i,s]=n.useState(!1),l=ai(r,o.onScrollButtonChange);return Jd(()=>{if(a.viewport&&a.isPositioned){let e=function(){const e=t.scrollHeight-t.clientHeight,r=Math.ceil(t.scrollTop)<e;s(r)};const t=a.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[a.viewport,a.isPositioned]),i?e(_x,{...t,ref:l,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=a;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null}).displayName=Nx;var _x=n.forwardRef((t,r)=>{const{__scopeSelect:a,onAutoScroll:o,...i}=t,s=ox("SelectScrollButton",a),l=n.useRef(null),c=Fw(a),d=n.useCallback(()=>{null!==l.current&&(window.clearInterval(l.current),l.current=null)},[]);return n.useEffect(()=>()=>d(),[d]),Jd(()=>{const e=c().find(e=>e.ref.current===document.activeElement);e?.ref.current?.scrollIntoView({block:"nearest"})},[c]),e(zi.div,{"aria-hidden":!0,...i,ref:r,style:{flexShrink:0,...i.style},onPointerDown:Au(i.onPointerDown,()=>{null===l.current&&(l.current=window.setInterval(o,50))}),onPointerMove:Au(i.onPointerMove,()=>{s.onItemLeave?.(),null===l.current&&(l.current=window.setInterval(o,50))}),onPointerLeave:Au(i.onPointerLeave,()=>{d()})})}),Rx=n.forwardRef((t,r)=>{const{__scopeSelect:n,...a}=t;return e(zi.div,{"aria-hidden":!0,...a,ref:r})});Rx.displayName="SelectSeparator";var Px="SelectArrow";n.forwardRef((t,r)=>{const{__scopeSelect:n,...a}=t,o=$w(n),i=Gw(Px,n),s=ox(Px,n);return i.open&&"popper"===s.position?e(Hy,{...o,...a,ref:r}):null}).displayName=Px;var Ox=n.forwardRef(({__scopeSelect:t,value:r,...a},o)=>{const i=n.useRef(null),s=ai(o,i),l=xp(r);return n.useEffect(()=>{const e=i.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(zi.select,{...a,style:{...Iw,...a.style},ref:s,defaultValue:r})});function Dx(e){return""===e||void 0===e}function Ix(e){const t=Zd(e),r=n.useRef(""),a=n.useRef(0),o=n.useCallback(e=>{const n=r.current+e;t(n),function e(t){r.current=t,window.clearTimeout(a.current),""!==t&&(a.current=window.setTimeout(()=>e(""),1e3))}(n)},[t]),i=n.useCallback(()=>{r.current="",window.clearTimeout(a.current)},[]);return n.useEffect(()=>()=>window.clearTimeout(a.current),[]),[r,o,i]}function Mx(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 i=o.find(e=>e.textValue.toLowerCase().startsWith(n.toLowerCase()));return i!==r?i:void 0}Ox.displayName="SelectBubbleInput";var Ux=Jw,Lx=Qw,zx=ex,Fx=rx,jx=mx,Bx=bx,Vx=Sx,$x=Ax,Wx=Cx,Gx=Rx;const Kx=Zw,Hx=n.forwardRef(({className:t,children:n,...a},o)=>r(Ux,{ref:o,className:ti("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),...a,children:[n,e(Lx,{asChild:!0,children:e(zm,{className:"h-4 w-4 opacity-50"})})]}));Hx.displayName=Ux.displayName;const Zx=n.forwardRef(({className:t,children:r,position:a="popper",...o},i)=>{const{container:s}=n.useContext(ge);return e(zx,{container:s,children:e(Fx,{ref:i,className:ti("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"===a&&"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:a,...o,children:e(jx,{className:ti("p-1","popper"===a&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:r})})})});Zx.displayName=Fx.displayName;n.forwardRef(({className:t,...r},n)=>e(Bx,{ref:n,className:ti("px-2 py-1.5 text-sm font-semibold",t),...r})).displayName=Bx.displayName;const qx=n.forwardRef(({className:t,children:n,...a},o)=>r(Vx,{ref:o,className:ti("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),...a,children:[e("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:e(Wx,{children:e(jm,{className:"h-4 w-4"})})}),e($x,{children:n})]}));qx.displayName=Vx.displayName;n.forwardRef(({className:t,...r},n)=>e(Gx,{ref:n,className:ti("-mx-1 my-1 h-px bg-muted",t),...r})).displayName=Gx.displayName;const Jx=({workspace:t})=>{const n=ue(e=>e.auth.session?.user||null),[a,o]=f(0),[i,s]=f(!1),[l,d]=f([]),{getUsers:u,removeUser:m,updateUser:p}=lS(),{settings:h}=jh();c(()=>{t&&(s(!0),u(t._id).then(e=>{d(e)}).catch(e=>{console.error(e)}).finally(()=>{s(!1)}))},[t,a]);const g=()=>{o(e=>e+1)};if(i||!t)return e(Eg,{});const v=e=>"string"==typeof e?{name:"Unknown User",email:e,id:e,role:"-"}:{name:e.name,email:e.email,id:e._id},b=l.map(e=>({...e,...v(e.user)})),y=l.find(e=>("string"==typeof e.user?e.user:e.user._id)===n?.id)?.role,w="admin"===y,x=(h?.workspace.maxWorkspaceUsers??Number.MAX_VALUE)>(l.length??0);return r("div",{children:[!w&&e("div",{className:"text-red-500",children:"Only workspace admin can manage users and roles."}),w&&r("div",{className:"mb-4",children:[x&&e(Yx,{onInvite:g,workspaceId:t._id}),!x&&e("div",{className:"text-red-500",children:"You have reached the maximum number of users for this workspace."})]}),r("div",{className:"mb-4 flex items-center justify-between",children:[e("div",{children:r("div",{className:"text-sm text-gray-600 mb-2",children:[l.length," member",1!==l.length?"s":""]})}),e("div",{children:e(Li,{variant:"ghost",size:"sm",onClick:g,progress:i,startIcon:e(Ci,{}),children:"Refresh"})})]}),e("ul",{className:"space-y-2",children:b.map((a,o)=>{const i=a.id===n?.id,s=("object"==typeof t.createdBy&&null!==t.createdBy?t.createdBy._id:t.createdBy)===a.id;return r("li",{className:"flex items-center justify-between border rounded p-3",children:[r("div",{className:"flex items-center space-x-3",children:[e("div",{className:"w-8 h-8 bg-gray-200 rounded-full flex items-center justify-center text-sm font-medium",children:a.name.charAt(0).toUpperCase()}),r("div",{children:[e("div",{className:"font-medium",children:a.name}),e("div",{className:"text-xs text-gray-500",children:a.email})]})]}),r("div",{className:"flex items-center gap-x-1",children:[e("div",{children:r(Kx,{disabled:i||!w||s,value:a.role,onValueChange:e=>{return r=t._id,n=a.id,o=e,void(("object"==typeof t.createdBy&&null!==t.createdBy?t.createdBy._id:t.createdBy)!==n?p(r,n,{role:o}).then(()=>{g()}):console.error("Cannot change the role of the workspace owner"));var r,n,o},children:[e(Hx,{children:e(Xw,{placeholder:"Select a role"})}),e(Zx,{children:t?.roles.map(t=>e(qx,{value:t,children:t},t))})]})}),i&&e("span",{className:"text-xs bg-blue-100 text-blue-800 px-2 py-1 rounded",children:"You"}),s&&e("span",{className:"text-xs bg-purple-100 text-purple-800 px-2 py-1 rounded",children:"Owner"}),!i&&!s&&w&&e(Li,{variant:"destructive",size:"sm",startIcon:e(Oi,{}),onClick:()=>{var e;e=a.id,("object"==typeof t.createdBy&&null!==t.createdBy?t.createdBy._id:t.createdBy)!==e?m(t._id,e).then(()=>{g()}):console.error("Cannot remove the workspace owner")}})]})]},o)})}),0===l.length&&e("div",{className:"text-center py-8 text-gray-500",children:"No members found in this workspace."})]})};function Yx({onInvite:t,workspaceId:n}){const[a,o]=f(""),[i,s]=f("admin"),[l,d]=f(!1),[u,m]=f(null),[p,h]=f(null),{addUser:g,getWorkspace:v}=lS(),[b,y]=f(null),{settings:w}=jh(),x=w?.workspace.roles??b?.roles??[];c(()=>{n&&v(n).then(y)},[n]);const S=()=>{m(null),h(null),o(""),s("admin")};return r("div",{className:"flex gap-2 flex-col gap-y-2",children:[u&&e("div",{className:"text-red-500 capitalize",children:u}),p&&e("div",{className:"text-green-500 capitalize",children:p}),r("div",{children:[e(Vi,{children:"Invite member by email"}),e(Qi,{type:"email",value:a,onChange:e=>o(e.target.value),placeholder:"example@example.com"})]}),r("div",{children:[e(Vi,{children:"Role"}),r(Kx,{value:i,onValueChange:s,children:[e(Hx,{children:e(Xw,{placeholder:"Select a role"})}),e(Zx,{children:x.map(t=>e(qx,{value:t,children:t},t))})]})]}),e("div",{children:e(Li,{progress:l,onClick:async()=>{const e=a.trim();if(!e)return void m("Email is required");/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)?(d(!0),await g(n,e,i).then(()=>{h("User invited successfully"),t?.()}).catch(e=>{console.error(e),m(e.message||"Failed to invite member")}).finally(()=>{d(!1),setTimeout(()=>{S()},6e3)})):m("Invalid email address format")},disabled:l||!a||!i,children:l?"Inviting...":`Invite as ${i}`})})]})}const Xx=({workspace:t,section:n,setSection:a})=>{const o=ue(e=>e.auth.session?.user||null),i=("object"==typeof t.createdBy&&null!==t.createdBy?t.createdBy._id:t.createdBy)===o?.id;return r("div",{className:"w-56 h-full flex flex-col space-y-6",children:[t&&e("div",{className:"border-b p-2 py-4",children:r("div",{className:"flex items-center gap-x-2",children:[t.image&&e("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("img",{src:t.image,className:"w-full h-full object-contain",style:{width:"36px",height:"36px",maxWidth:"36px",maxHeight:"36px",objectFit:"contain"}})}),r("div",{className:ti("flex-1 min-w-0",t.image?"":"pl-2"),children:[e("div",{className:"font-medium text-sm line-clamp-1 text-ellipsis overflow-hidden",children:t.name}),e("div",{className:"text-xs text-gray-500",children:t.workspaceId})]})]})}),e(Qx,{title:"Account",children:e(eS,{activeSection:n,icon:e(Ii,{className:"h-3.5 w-3.5"}),label:"Profile",section:"profile",onClick:()=>a("profile")})}),r(Qx,{title:"Workspace",children:[e(eS,{activeSection:n,icon:e(Ni,{className:"h-3.5 w-3.5"}),label:"General",section:"general",onClick:()=>a("general")}),e(eS,{activeSection:n,icon:e(Mi,{className:"h-3.5 w-3.5"}),label:"Users",section:"users",onClick:()=>a("users")}),e(eS,{activeSection:n,icon:e(Ri,{className:"h-3.5 w-3.5"}),label:"Features",section:"features",onClick:()=>a("features")}),i&&e(eS,{activeSection:n,icon:e(Di,{className:"h-3.5 w-3.5"}),label:"Danger Zone",section:"danger",onClick:()=>a("danger")})]})]})};function Qx({title:t,children:n}){return r("div",{className:"px-2 flex flex-col space-y-1",children:[e("div",{className:"text-xs font-bold mb-2 text-gray-500 uppercase tracking-wide px-2",children:t}),n]})}function eS({icon:e,label:t,section:n,onClick:a,activeSection:o}){return r("button",{className:ti("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:[e,t]})}const tS=({workspace:t,onClose:n})=>{const[a,o]=f(!1),[i,s]=f("profile");return t?r(Gm,{open:a,onOpenChange:e=>{o(e),e||n()},children:[e(Km,{asChild:!0,children:e(Li,{variant:"outline",size:"icon",children:e(Ni,{className:"h-4 w-4"})})}),r(qm,{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(Xm,{className:"sr-only",children:"Workspace settings dialog"}),e(Xx,{workspace:t,section:i,setSection:s}),r("div",{className:"flex-1 p-6 overflow-auto flex flex-col bg-background",children:[r(Ym,{className:"text-xl font-bold mb-4 capitalize",children:["profile"===i&&"Account","general"===i&&"Workspace Settings","users"===i&&"Workspace Members","features"===i&&"Workspace Features","danger"===i&&"Danger Zone"]}),r("div",{className:"max-h-[500px] overflow-y-auto",children:["profile"===i&&e(Dw,{workspace:t}),"general"===i&&e($g,{workspace:t}),"users"===i&&e(Jx,{workspace:t}),"features"===i&&e(jg,{workspaceId:t._id?.toString()}),"danger"===i&&e(Cg,{workspace:t})]})]})]})]}):null};function rS(n){const{workspaces:a,currentWorkspace:o,loading:i,refreshing:s}=ue(e=>e.workspaces),l=ue(e=>e.auth.session?.user),{settings:d}=jh(),[u,m]=f(!1),[p,h]=f(0),[g,v]=f(""),{fetchWorkspaces:b,getFeatures:y,refreshWorkspaces:w,setCurrentWorkspace:x,workspaces:S}=lS(),k=i||s;c(()=>{0===S.length?(b(),y()):y()},[]),c(()=>{p>0&&w()},[p]);const A=S.length>0?S:a,E=A.filter(e=>e._id!==o?._id).filter(e=>e.name.toLowerCase().includes(g.toLowerCase())),C=d?.workspace.maxWorkspaces??Number.MAX_VALUE,T=A?.filter(e=>("object"==typeof e.createdBy?e.createdBy._id?.toString():e.createdBy?.toString())===l?.id?.toString()).length,N=C>(T??0);return r(Gm,{open:u,onOpenChange:m,children:[e(Km,{children:n.trigger?.(k,o)}),r(qm,{className:"max-w-2xl min-w-full sm:min-w-[800px]",children:[r(Jm,{children:[r(Ym,{className:"flex items-center gap-2",children:[e(wi,{className:"h-5 w-5"}),"Switch Workspace"]}),e(Xm,{children:"Select a workspace to switch to or create a new one."})]}),!l&&e("div",{className:"flex flex-col items-center justify-center h-full py-4 sm:py-8",children:e("div",{className:"text-sm font-medium text-muted-foreground",children:"Looks like you are not logged in. Please login to continue."})}),l&&r("div",{className:"flex flex-col gap-4",children:[o&&e(nS,{workspace:o,isCurrentWorkspace:!0,onWorkspaceChange:n.onWorkspaceChange,onClose:()=>m(!1),setCurrentWorkspace:x,setOpen:m,workspacesToUse:A}),e(Fh,{}),r("div",{children:[r("div",{className:"flex items-center justify-between",children:[r("div",{className:"text-sm font-medium text-muted-foreground",children:["Available Workspaces (",E.length,")"]}),e("div",{children:e(Li,{progress:s,disabled:s,variant:"ghost",onClick:function(){h(e=>e+1)},startIcon:e(Ci,{}),children:s?"Refreshing...":"Refresh"})})]}),r("div",{className:"relative",children:[e(Ti,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground pointer-events-none"}),e(Qi,{placeholder:"Search workspaces...",value:g,onChange:e=>v(e.target.value),className:"pl-10"})]}),i?r("div",{className:"flex items-center justify-center py-8",children:[e(Ai,{className:"h-6 w-6 animate-spin text-muted-foreground"}),e("span",{className:"ml-2 text-sm text-muted-foreground",children:"Loading workspaces..."})]}):0===E.length?r("div",{className:"text-center py-8",children:[e(wi,{className:"mx-auto h-12 w-12 text-muted-foreground"}),e("p",{className:"mt-2 text-sm text-muted-foreground",children:g?"No workspaces found":"No workspaces available"})]}):e(Dh,{className:"h-64",children:e("div",{className:"flex flex-col gap-2 my-2.5",children:E.map(t=>{const r=t._id===o?._id;return e(nS,{workspace:t,isCurrentWorkspace:r,onWorkspaceChange:n.onWorkspaceChange,onClose:()=>m(!1),setCurrentWorkspace:x,setOpen:m,workspacesToUse:A},t._id)})})})]}),N&&r(t,{children:[e(Fh,{}),e(aS,{onCreated:()=>{b()}})]})]})]})]})}function nS(t){const{workspace:n,setCurrentWorkspace:a,setOpen:o,workspacesToUse:i}=t,s=t.isCurrentWorkspace??!1;return r("div",{className:ti("flex items-center gap-3 rounded-lg border-2 p-3 border-border",{"bg-muted text-muted-foreground":s}),children:[r(xu,{className:"h-8 w-8 flex items-center justify-center",children:[e("div",{children:e(Su,{src:n.image})}),e(ku,{children:(l=n.name,l.split(" ").map(e=>e[0]).join("").toUpperCase().slice(0,2))})]}),r("div",{className:"flex-1 min-w-0 max-w-full",children:[e("div",{className:"flex items-center gap-2",children:e("span",{className:"font-medium line-clamp-1 text-ellipsis overflow-hidden max-w-full",children:n.name})}),r("div",{className:"flex items-center gap-1 text-sm text-muted-foreground",children:[e(Mi,{className:"h-3 w-3"}),r("span",{children:[n.users?.length||0," members"]})]})]}),r("div",{className:"flex items-center gap-2",children:[s?null:e(Li,{size:"sm",onClick:()=>{t.onWorkspaceChange(n).then(()=>{a(n),o(!1)})},children:"Switch to"}),e(tS,{workspace:n,onClose:()=>{if(s){const e=i.findIndex(e=>e._id?.toString()===n._id?.toString());-1!==e&&a(i[e])}}})]})]});var l}function aS(n){const[a,o]=f(!1),[i,s]=f("emoji"),[l,c]=f("🏢"),[d,u]=f(!1),{createWorkspace:m}=lS(),p=Gt({resolver:Ga(Qs({name:Cs().min(2,{message:"Workspace name must be at least 2 characters."}),image:Cs().optional()})),defaultValues:{name:"",image:""}});return r(Gm,{open:a,onOpenChange:o,children:[e(Km,{asChild:!0,children:r(Li,{className:"w-full rounded-none",children:[e(Ei,{className:"h-4 w-4 mr-2"}),"Create New Workspace"]})}),r(qm,{className:"max-w-xl min-w-full sm:min-w-[600px]",children:[r(Jm,{children:[e(Ym,{children:"Create New Workspace"}),e(Xm,{children:"Create a new workspace to get started."})]}),e($i,{...p,children:r("form",{onSubmit:p.handleSubmit(async function(e){let t="";if("emoji"===i)t=Bg(l);else if("url"===i&&e.image)try{new URL(e.image),t=e.image}catch{return void p.setError("image",{message:"Please enter a valid URL"})}u(!0);try{await m(e.name,t),o(!1),p.reset(),c("🏢"),s("emoji"),n?.onCreated?.()}catch(e){console.error("Failed to create workspace:",e)}finally{u(!1)}}),children:[e(Gi,{control:p.control,name:"name",render:({field:t})=>r(Zi,{children:[e(qi,{children:"Workspace Name"}),e(Ji,{children:e(Qi,{placeholder:"My Awesome Workspace",...t})}),e(Xi,{})]})}),r("div",{className:"flex flex-col gap-y-2 my-2",children:[r("div",{children:[e(Vi,{className:"text-sm font-medium",children:"Workspace Icon"}),e(Yi,{children:"Choose an emoji or upload a custom image for your workspace."})]}),r(Hp,{value:i,onValueChange:e=>s(e),className:"flex flex-col gap-y-2",children:[r("div",{className:"flex items-center gap-x-2 my-1",children:[e(Zp,{value:"emoji",id:"emoji"}),r(Vi,{htmlFor:"emoji",className:"flex items-center gap-2",children:[e(_i,{className:"h-4 w-4"}),"Choose Emoji"]})]}),r("div",{className:"flex items-center gap-x-2 my-1",children:[e(Zp,{value:"url",id:"url"}),r(Vi,{htmlFor:"url",className:"flex items-center gap-2",children:[e(ki,{className:"h-4 w-4"}),"Custom Image URL"]})]})]}),"emoji"===i&&r("div",{className:"flex flex-col gap-y-2",children:[r("div",{className:"flex items-center gap-3",children:[e("span",{className:"text-sm font-medium",children:"Preview:"}),e("div",{className:"w-12 h-12 rounded-lg border-2 border-border flex items-center justify-center text-2xl bg-muted",children:l})]}),e(Dh,{className:"h-32 w-full rounded-md border",children:e("div",{className:"p-4 grid grid-cols-8 gap-2",children:Vg.map((t,r)=>e("button",{type:"button",onClick:()=>(e=>{c(e),p.setValue("image",Bg(e))})(t),className:"w-8 h-8 rounded flex items-center justify-center text-lg hover:bg-muted transition-colors "+(l===t?"bg-primary text-primary-foreground":""),children:t},r))})})]}),"url"===i&&r("div",{className:"flex flex-col gap-y-2",children:[e(Gi,{control:p.control,name:"image",render:({field:t})=>r(Zi,{children:[e(qi,{children:"Image URL"}),e(Ji,{children:e(Qi,{placeholder:"https://example.com/image.png",...t})}),e(Yi,{children:"Enter a valid URL for your workspace image. Supports PNG, JPG, and SVG formats."}),e(Xi,{})]})}),p.watch("image")&&r("div",{className:"flex items-center gap-3",children:[e("span",{className:"text-sm font-medium",children:"Preview:"}),e("div",{className:"w-12 h-12 rounded-lg border-2 border-border overflow-hidden bg-muted",children:e("img",{src:p.watch("image"),alt:"Workspace preview",className:"w-full h-full object-cover",onError:e=>{e.currentTarget.style.display="none"}})})]})]})]}),r("div",{className:"flex justify-end gap-3 pt-4",children:[e(Li,{type:"button",variant:"outline",onClick:()=>{o(!1),p.reset(),c("🏢"),s("emoji")},disabled:d,children:"Cancel"}),e(Li,{type:"submit",disabled:d,children:d?r(t,{children:[e(Ai,{className:"mr-2 h-4 w-4 animate-spin"}),"Creating..."]}):"Create Workspace"})]})]})})]})]})}const oS="saas-workspace-current",iS=()=>A(oS),sS=(e,t)=>!!e&&t.some(t=>t._id===e),lS=()=>{const e=fe(),t=ue(e=>e.os),r=s(()=>new Gd(t),[t]),n=ue(e=>e.workspaces),o=ue(e=>e.auth.session?.user),i=l(t=>{if(t._id!==n.currentWorkspace?._id&&t){const r=n.currentWorkspace;e.workspaces(Y(t)),he.emitWorkspaceChanged(t,r).catch(e=>{console.error("Error emitting workspace changed event:",e)})}},[n.currentWorkspace,e]);c(()=>{if(!n.isInitialized){const t=iS();if(e.workspaces(Q(!0)),t){const e=n.workspaces.find(e=>e._id===t);if(e){if(e._id===n.currentWorkspace?._id)return;i(e)}}}},[n.isInitialized,n.workspaces,n.currentWorkspace,e,i]);const d=l(()=>{e.workspaces(X())},[e]),u=a.useRef(!1),f=a.useRef(!1),m=l(async()=>{if(!n.loading&&!u.current){u.current=!0,e.workspaces(ee(!0)),e.workspaces(te(null));try{const t=await r.getWorkspaces();if(e.workspaces(q(t)),t.length>0){const e=iS();if(e&&sS(e,t)){const r=t.find(t=>t._id===e);r&&i(r)}else t.length>0&&(n.currentWorkspace||i(t[0]))}}catch(t){e.workspaces(te(t instanceof Error?t.message:"Failed to fetch workspaces"))}finally{e.workspaces(ee(!1)),u.current=!1}}},[r,n.loading,n.currentWorkspace,e,i]),p=l(async()=>{if(!n.refreshing&&!u.current){u.current=!0,e.workspaces(re(!0));try{const t=await r.getWorkspaces();e.workspaces(q(t))}catch(e){}finally{e.workspaces(re(!1)),u.current=!1}}},[r,n.refreshing,e]),h=l(async(t,a)=>{const o=await r.createWorkspace({name:t,image:a});e.workspaces(q([...n.workspaces,o])),he.emitWorkspaceCreated(o).catch(e=>{console.error("Error emitting workspace created event:",e)})},[r,n.workspaces,e]),g=l(async(t,a)=>{const o=await r.updateWorkspace(t._id,a);e.workspaces(q(n.workspaces.map(e=>e._id===t._id?o:e))),he.emitWorkspaceUpdated(o).catch(e=>{console.error("Error emitting workspace updated event:",e)})},[r,n.workspaces,e]),v=l(async()=>{if(f.current)return n.allFeatures.length>0?n.allFeatures:null;if(n.allFeatures.length>0)return n.allFeatures;f.current=!0;try{const t=await r.getFeatures();return e.workspaces(J(t)),t}catch(e){return console.error("Failed to fetch features:",e),null}finally{f.current=!1}},[r,e,n.allFeatures]),b=l(async(e,t,n)=>await r.updateFeature(e,t,n),[r]);c(()=>{if(n.currentWorkspace?._id){const e=n.workspaces.find(e=>e._id===n.currentWorkspace?._id);if(e){if(e._id===n.currentWorkspace._id)return;i(e)}else if(n.workspaces.length>0){if(n.workspaces[0]._id===n.currentWorkspace._id)return;i(n.workspaces[0])}}},[n.currentWorkspace?._id,n.workspaces,i]);const y=l(async e=>await r.getWorkspaceUsers(e),[r]),w=l(async(e,t,a)=>{const o=await r.addUser(e,{email:t,role:a}),i=n.workspaces.find(t=>t._id===e);return i&&he.emitWorkspaceUserAdded(o.userId,i,a).catch(e=>{console.error("Error emitting workspace user added event:",e)}),o},[r,n.workspaces]),x=l(async(e,t)=>{const a=n.workspaces.find(t=>t._id===e);if(a){if(("object"==typeof a.createdBy&&null!==a.createdBy?a.createdBy._id:a.createdBy)===t)throw new Error("Cannot remove the workspace owner")}const o=(await r.getWorkspaceUsers(e).catch(()=>[])).find(e=>("string"==typeof e.user?e.user:e.user._id)===t),i=await r.removeUser(e,t);if(a&&o){const e=o.role;he.emitWorkspaceUserRemoved(i.userId,a,e).catch(e=>{console.error("Error emitting workspace user removed event:",e)})}return i},[r,n.workspaces]),S=l(async(e,t,a)=>{if(a.role){const r=n.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(a.role){const n=(await r.getWorkspaceUsers(e).catch(()=>[])).find(e=>("string"==typeof e.user?e.user:e.user._id)===t);o=n?.role}const i=await r.updateUser(e,t,a);return a.role&&o&&o!==a.role&&he.emitWorkspaceUserRoleChanged(i.userId,i.workspace,o,a.role).catch(e=>{console.error("Error emitting workspace user role changed event:",e)}),i},[r,n.workspaces]),k=l(async e=>{const t=await r.getProfile().catch(()=>null),n=await r.updateUserProfile(e);return he.emitUserUpdated(n,t||void 0).catch(e=>{console.error("Error emitting user updated event:",e)}),n},[r]),A=l(async()=>await r.getProfile(),[r]),E=l(async e=>await r.getWorkspace(e),[r]),C=l(async t=>{if(!o)throw new Error("User must be authenticated to delete a workspace");const a=n.workspaces.find(e=>e._id===t);if(!a)throw new Error("Workspace not found");if(!(("object"==typeof a.createdBy&&null!==a.createdBy?a.createdBy._id:a.createdBy)===o.id))throw new Error("Only the workspace creator can delete the workspace");const i=await r.deleteWorkspace(t);return e.workspaces(q(n.workspaces.filter(e=>e._id!==t))),n.currentWorkspace?._id===t&&e.workspaces(X()),a&&he.emitWorkspaceDeleted(a).catch(e=>{console.error("Error emitting workspace deleted event:",e)}),i},[r,n.workspaces,n.currentWorkspace,e,o]);return{workspaces:n.workspaces,loading:n.loading,error:n.error,fetchWorkspaces:m,refreshWorkspaces:p,refreshing:n.refreshing,WorkspaceSwitcher:rS,currentWorkspace:n.currentWorkspace,setCurrentWorkspace:i,resetCurrentWorkspace:d,createWorkspace:h,allFeatures:n.allFeatures,getFeatures:v,updateFeature:b,getWorkspace:E,switching:n.switching,updateWorkspace:g,getUsers:y,addUser:w,removeUser:x,updateUser:S,getProfile:A,updateUserProfile:k,deleteWorkspace:C}};function cS(){const e=fe(),t=ue(e=>e.auth),r=ue(e=>e.os),{serverUrl:n,orgId:a,auth:o}=r,{resetCurrentWorkspace:i}=lS(),c=l(async()=>{e.auth(b());try{const t=await Wd.post(`${n}/api/v1/auth/request`,{orgId:a,clientId:o?.clientId,redirect:{success:o?.redirectUrl||window.location.href,error:o?.redirectUrl||window.location.href}});if(!t.data.success)throw e.auth(y()),new Error(t.data.message||"Authentication failed");window.location.href=t.data.data.redirectUrl}catch(t){throw e.auth(y()),console.error("Sign in error:",t),t}},[n,a,o,e]),d=l(async()=>{try{o?.callbacks?.onSignOut&&"function"==typeof o.callbacks.onSignOut&&await o.callbacks.onSignOut(),e.auth(x()),i(),_()}catch(e){console.error("Logout error:",e),_()}},[e,i,o?.callbacks?.onSignOut]);return s(()=>({user:t.session?.user,session:t.session,isLoading:t.isLoading,isAuthenticated:t.isAuthenticated,isRedirecting:t.isRedirecting,status:t.status,signIn:c,signOut:d}),[t,c,d])}const dS=e=>{const{children:t}=e,{status:r}=cS();return r!==k.authenticated?null:t},uS=e=>{const{children:t}=e,{status:r}=cS();return r===k.authenticated?null:t},fS=e=>{const{children:t,fallback:r,roles:n}=e,{user:a}=cS();return n.includes(a?.role??"")?t:r||null},mS=e=>{const{children:t,fallback:r,roles:n}=e,{user:a}=cS(),{currentWorkspace:o}=lS(),i=o?.users.find(e=>e._id===a?.id);return i&&n.includes(i?.role??"")?t:r||null},pS=e=>{const{children:t,slug:r}=e,{currentWorkspace:n}=lS(),a=n?.features?.[r];return a?t:null},hS=e=>{const{children:t,slug:r}=e,{currentWorkspace:n}=lS(),a=n?.features?.[r];return a?null:t};export{v as ApiVersion,bl as BetaForm,ye as SaaSOSProvider,dS as WhenAuthenticated,fS as WhenRoles,uS as WhenUnauthenticated,hS as WhenWorkspaceFeatureDisabled,pS as WhenWorkspaceFeatureEnabled,mS as WhenWorkspaceRoles,rS as WorkspaceSwitcher,he as eventEmitter,cS as useSaaSAuth,jh as useSaaSSettings,lS as useSaaSWorkspaces};
|
|
30
30
|
//# sourceMappingURL=index.esm.js.map
|