intlayer-editor 5.1.7 → 5.1.8

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.
@@ -220,7 +220,7 @@ Please change the parent <Route path="${x}"> to <Route path="${x==="/"?"*":`${x}
220
220
  *
221
221
  * This source code is licensed under the MIT license found in the
222
222
  * LICENSE file in the root directory of this source tree.
223
- */var Gp;function HL(){if(Gp)return O6;Gp=1;var e=$r(),t=TN();function a(f,v){return f===v&&(f!==0||1/f===1/v)||f!==f&&v!==v}var n=typeof Object.is=="function"?Object.is:a,r=t.useSyncExternalStore,s=e.useRef,o=e.useEffect,u=e.useMemo,d=e.useDebugValue;return O6.useSyncExternalStoreWithSelector=function(f,v,p,A,E){var _=s(null);if(_.current===null){var S={hasValue:!1,value:null};_.current=S}else S=_.current;_=u(function(){function C(b){if(!M){if(M=!0,x=b,b=A(b),E!==void 0&&S.hasValue){var T=S.value;if(E(T,b))return D=T}return D=b}if(T=D,n(x,b))return T;var O=A(b);return E!==void 0&&E(T,O)?(x=b,T):(x=b,D=O)}var M=!1,x,D,w=p===void 0?null:p;return[function(){return C(v())},w===null?void 0:function(){return C(w())}]},[v,p,A,E]);var z=r(f,_[0],_[1]);return o(function(){S.hasValue=!0,S.value=z},[z]),d(z),z},O6}var jp;function PL(){return jp||(jp=1,L6.exports=HL()),L6.exports}var UL=PL();const VL=So(UL),kN={},{useDebugValue:GL}=X2,{useSyncExternalStoreWithSelector:jL}=VL;let Kp=!1;const KL=e=>e;function $L(e,t=KL,a){(kN?"production":void 0)!=="production"&&a&&!Kp&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),Kp=!0);const n=jL(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,a);return GL(n),n}const $p=e=>{(kN?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?OL(e):e,a=(n,r)=>$L(t,n,r);return Object.assign(a,t),a},DN=e=>e?$p(e):$p,YL=DN((e,t)=>({scrollBlockers:[],addBlockage:(a,n)=>e(r=>{const s=r.scrollBlockers,o=s.find(u=>u.element===n);if(o){const d=o.blockers.includes(a)?o.blockers:[...o.blockers,a];return{scrollBlockers:s.map(f=>f.element===n?{...f,blockers:d}:f)}}return n.style.overflowY="hidden",n.style.overflowX="hidden",{scrollBlockers:[...s,{element:n,blockers:[a]}]}}),removeBlockage:(a,n)=>e(r=>{const s=r.scrollBlockers,o=s.find(u=>u.element===n);return o?o.blockers.length>1?{scrollBlockers:s.map(u=>u.element===n?{...u,blockers:u.blockers.filter(d=>d!==a)}:u)}:(n.style.overflowY="auto",{scrollBlockers:s.filter(u=>u.element!==n)}):{scrollBlockers:s}}),isElementScrollBlocked:a=>t().scrollBlockers.some(n=>n.element===a)}));function ZL(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[n,r]of e)if(!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}const a=Object.keys(e);if(a.length!==Object.keys(t).length)return!1;for(const n of a)if(!Object.prototype.hasOwnProperty.call(t,n)||!Object.is(e[n],t[n]))return!1;return!0}const{useRef:WL}=X2;function BN(e){const t=WL();return a=>{const n=e(a);return ZL(t.current,n)?t.current:t.current=n}}const LN=e=>{const{disableScroll:t=!1,element:a,key:n="unnamed_blocker"}=e??{},{isElementScrollBlocked:r,addBlockage:s,removeBlockage:o}=YL(BN(f=>({isElementScrollBlocked:f.isElementScrollBlocked,addBlockage:f.addBlockage,removeBlockage:f.removeBlockage}))),u=bN(a);return y.useEffect(()=>{const f=a??window.document.body;t?s(n,f):o(n,f)},[s,t,a,n,o]),{isScrollBlocked:u?r(u):!1}},qL=e=>{switch(e){case"sm":return 640;case"md":return 768;case"lg":return 1024;case"xl":return 1280;case"2xl":return 1536;default:return e}},XL=()=>{var t;if(typeof window>"u")return;const e=(t=window.navigator)==null?void 0:t.userAgent;if(!(typeof e>"u"))return/android|bb\d+|meego|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(?:hone|od|ad)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(?:ob|in)i|palm(?: os)?|phone|p(?:ixi|re)\/|plucker|pocket|psp|series(?:4|6)0|symbian|treo|up\.(?:browser|link)|vodafone|wap|windows ce|windows phone|xda|xiino|zte-/i.test(e)},QL=e=>{if(!(typeof window>"u"))return((window==null?void 0:window.innerWidth)??0)<=e},Yp=e=>{const t=qL(e),a=XL(),n=QL(t);return{isMobileScreen:n,isMobileUserAgent:a,isMobile:n??a}},JL=(e="md")=>{const[t,a]=y.useState(Yp(e));return y.useEffect(()=>{const n=()=>{a(Yp(e))};return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[e]),t},eO=e=>{const t=e.getBoundingClientRect(),a=t.top,n=t.bottom;if(a>=0&&n<=window.innerHeight){const s=t.left+t.width/2,o=t.top+10,u=document.elementFromPoint(s,o);return e===u||e.contains(u)}return!1},Zp=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Wp=Mo,Me=(e,t)=>a=>{var n;if((t==null?void 0:t.variants)==null)return Wp(e,a==null?void 0:a.class,a==null?void 0:a.className);const{variants:r,defaultVariants:s}=t,o=Object.keys(r).map(f=>{const v=a==null?void 0:a[f],p=s==null?void 0:s[f];if(v===null)return null;const A=Zp(v)||Zp(p);return r[f][A]}),u=a&&Object.entries(a).reduce((f,v)=>{let[p,A]=v;return A===void 0||(f[p]=A),f},{}),d=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((f,v)=>{let{class:p,className:A,...E}=v;return Object.entries(E).every(_=>{let[S,z]=_;return Array.isArray(z)?z.includes({...s,...u}[S]):{...s,...u}[S]===z})?[...f,p,A]:f},[]);return Wp(e,o,d,a==null?void 0:a.class,a==null?void 0:a.className)},tO=({className:e,strokeWidth:t=4})=>I.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"44",height:"44",viewBox:"0 0 44 44",stroke:"currentColor",className:C2("size-full",e),children:I.jsxs("g",{fill:"none",fillRule:"evenodd",strokeWidth:t,children:[I.jsxs("circle",{cx:"22",cy:"22",r:"1",children:[I.jsx("animate",{attributeName:"r",begin:"0s",dur:"1.8s",values:"1; 20",calcMode:"spline",keyTimes:"0; 1",keySplines:"0.165, 0.84, 0.44, 1",repeatCount:"indefinite"}),I.jsx("animate",{attributeName:"stroke-opacity",begin:"0s",dur:"1.8s",values:"1; 0",calcMode:"spline",keyTimes:"0; 1",keySplines:"0.3, 0.61, 0.355, 1",repeatCount:"indefinite"})]}),I.jsxs("circle",{cx:"22",cy:"22",r:"1",children:[I.jsx("animate",{attributeName:"r",begin:"-0.9s",dur:"1.8s",values:"1; 20",calcMode:"spline",keyTimes:"0; 1",keySplines:"0.165, 0.84, 0.44, 1",repeatCount:"indefinite"}),I.jsx("animate",{attributeName:"stroke-opacity",begin:"-0.9s",dur:"1.8s",values:"1; 0",calcMode:"spline",keyTimes:"0; 1",keySplines:"0.3, 0.61, 0.355, 1",repeatCount:"indefinite"})]})]})}),i4=({children:e,isLoading:t=!0,className:a,...n})=>I.jsx(I.Fragment,{children:t?I.jsx("div",{className:C2("flex size-full max-h-screen max-w-[100vw] flex-1 items-center justify-center",a),role:"status","aria-label":"Animated icon, meaning that the website is processing",...n,children:I.jsx(tO,{className:"size-10 max-h-full max-w-full"})}):e??I.jsx(I.Fragment,{})}),P6=Me("",{variants:{size:{sm:"size-3 absolute top-1/2 -translate-y-1/2",md:"size-4 absolute top-1/2 -translate-y-1/2",lg:"size-5 absolute top-1/2 -translate-y-1/2",xl:"size-6 absolute top-1/2 -translate-y-1/2","icon-sm":"size-3","icon-md":"size-4","icon-lg":"size-5","icon-xl":"size-6"},position:{left:"left-3",right:"right-3"}},defaultVariants:{size:"md"}}),aO=Me("relative cursor-pointer truncate whitespace-nowrap font-medium transition focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50",{variants:{size:{sm:"min-h-7 px-3 max-md:py-1 text-xs",md:"min-h-8 px-6 max-md:py-2 text-sm",lg:"min-h-10 px-8 max-md:py-3 text-lg",xl:"min-h-11 px-10 max-md:py-4 text-xl","icon-sm":"p-1.5","icon-md":"p-1.5","icon-lg":"p-2","icon-xl":"p-3"},color:{primary:"text-primary *:text-text-light",secondary:"text-secondary *:text-text-light",destructive:"text-destructive *:text-text-light",neutral:"text-neutral *:text-text-light",light:"text-white *:text-text-light",dark:"text-neutral-800 *:text-text-light",text:"text-text *:text-text-opposite","text-inverse":"text-text-opposite *:text-text",error:"text-error *:text-text-light",success:"text-success *:text-text-light",custom:""},variant:{default:"rounded-lg bg-current",none:"border-none bg-current/0 text-inherit hover:bg-current/0",outline:"*:!text-current rounded-lg border-[1.5px] bg-current/0 hover:bg-current/30",link:"*:!text-current h-auto justify-start border-inherit bg-transparent px-1 underline-offset-4 hover:bg-transparent hover:underline","invisible-link":"*:!text-current h-auto justify-start border-inherit bg-transparent px-1 underline-offset-4 hover:bg-transparent",hoverable:"*:!text-current rounded-lg border-none bg-current/0 transition hover:bg-current/10 aria-[current]:bg-current/5",input:["*:!text-current w-full select-text resize-none rounded-xl border-2 bg-input-background text-sm text-input-text shadow-none outline-0 transition-all","border-input-border hover:border-input-border-hover focus:border-input-border-focus focus:outline-0 focus:[box-shadow:none]","aria-[invalid=true]:border-error","disabled:opacity-50"]},textAlign:{left:"text-left",center:"text-center",right:"text-right"},isFullWidth:{true:"w-full",false:""},hasIconLeft:{true:"px-12",false:""},hasIconRight:{true:"pr-8",false:""}},defaultVariants:{variant:"default",size:"md",color:"primary",textAlign:"center",isFullWidth:!1,hasIconRight:!1,hasIconLeft:!1}}),_0=({variant:e,size:t,color:a,children:n,Icon:r,IconRight:s,iconClassName:o,isLoading:u,isActive:d,isFullWidth:f=!1,textAlign:v,disabled:p,label:A,className:E,type:_="button",...S})=>{const z=e==="link"||e==="invisible-link";return I.jsxs("button",{disabled:u||p,"aria-current":d?"page":void 0,"aria-label":A,"aria-busy":u,role:z?"link":void 0,type:_,className:aO({variant:e,size:t,color:a,isFullWidth:f,textAlign:v??(s?"left":"center"),hasIconLeft:typeof n<"u"&&(typeof r<"u"||typeof u<"u"),hasIconRight:typeof n<"u"&&typeof s<"u",className:E}),...S,children:[r&&!u&&I.jsx(r,{className:P6({size:t,className:o,position:"left"})}),I.jsx(i4,{className:P6({size:t,className:o,position:"left"}),isLoading:u??!1}),I.jsx("span",{children:n}),s&&I.jsx(s,{className:P6({size:t,className:o,position:"right"})})]})},nO=Me("flex text-text flex-col backdrop-blur",{variants:{roundedSize:{none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl","2xl":"rounded-2xl","3xl":"rounded-3xl",full:"rounded-full"},transparency:{none:"bg-card",sm:"bg-card/90",md:"bg-card/70",lg:"bg-card/40",xl:"bg-card/20",full:""},padding:{none:"p-0",sm:"p-1",md:"p-2",lg:"p-3",xl:"p-4"},separator:{without:"",x:"divide-x divide-dashed divide-text/20",y:"divide-y divide-dashed divide-text/20",both:"divide-x divide-y divide-dashed divide-text/20"},border:{none:"",with:"border-[1.5px]"},borderColor:{primary:"border-primary",secondary:"border-secondary",neutral:"border-neutral",text:"border-text ",error:"border-error",warning:"border-warning",success:"border-success"},background:{none:"bg-inherit",hoverable:"!bg-opacity-5 backdrop-blur-0 hover:!bg-opacity-10 hover:backdrop-blur focus:!bg-opacity-10 focus:backdrop-blur aria-selected:!bg-opacity-15 aria-selected:backdrop-blur",with:""},gap:{none:"gap-0",sm:"gap-1",md:"gap-3",lg:"gap-5",xl:"gap-8","2xl":"gap-10"}},defaultVariants:{roundedSize:"md",border:"none",borderColor:"text",transparency:"md",padding:"none",separator:"without",gap:"none"}}),d3=({children:e,roundedSize:t,padding:a,transparency:n,separator:r,className:s,border:o,borderColor:u,background:d,...f})=>I.jsx("div",{className:C2(nO({roundedSize:t,transparency:n,padding:a,separator:r,border:typeof o=="boolean"?o?"with":"none":void 0,background:d,borderColor:u,className:s})),...f,children:e}),xo=DN((e,t)=>({drawers:{},open:a=>e(n=>({drawers:{...n.drawers,[a]:!0}})),close:a=>e(n=>({drawers:{...n.drawers,[a]:!1}})),isOpen:a=>t().drawers[a]??!1})),ON=({title:e,identifier:t,children:a,header:n,closeOnOutsideClick:r=!0,backButton:s,isOpen:o,onClose:u})=>{const{isMobile:d}=JL("md"),f=y.useRef(null),v=y.useRef(null),{close:p,open:A,isOpen:E}=xo(BN(S=>({close:()=>S.close(t),open:()=>S.open(t),isOpen:S.isOpen(t)})));LN({disableScroll:E,key:t?`right_drawer_${t}`:"right_drawer"}),y.useEffect(()=>{const S=z=>{try{if(!f.current)return;const C=E&&r,M=z.target&&!f.current.contains(z.target),x=eO(f.current);(C&&M&&x||!z.target)&&(p(),u==null||u())}catch{p(),u==null||u()}};return window.addEventListener("mousedown",S),()=>window.removeEventListener("mousedown",S)},[E,p,u,r,t]),y.useEffect(()=>{o!==void 0&&(o?A():(p(),u==null||u()))},[p,A,u,o,t]);const _=S=>{S.target===S.currentTarget&&d&&(p(),u==null||u())};return I.jsx("div",{className:"fixed right-0 top-0 z-50 flex h-full justify-end",children:I.jsx($B,{isHidden:!E,align:"right",children:I.jsxs(d3,{className:"text-text relative flex h-screen w-screen flex-col md:w-[400px]",ref:f,roundedSize:"none",children:[I.jsxs("div",{className:"flex flex-col gap-3 p-6",children:[I.jsxs("div",{className:"flex justify-between gap-3",children:[I.jsx("div",{children:s&&I.jsx(_0,{variant:"hoverable",color:"text",label:s.text??"Go back",onClick:s.onBack,Icon:nL,children:s==null?void 0:s.text})}),I.jsx("div",{children:I.jsx(_0,{variant:"hoverable",color:"text",label:"Close",className:"ml-auto",onClick:p,Icon:Ya,size:"icon-md"})})]}),e&&I.jsx("h2",{className:"flex items-center justify-center text-lg font-bold",children:e}),n]}),I.jsx("div",{className:"flex h-full flex-col overflow-y-auto p-2",children:I.jsx("div",{className:"flex flex-1 flex-col",onClick:_,ref:v,children:a})})]})})})},Pn=()=>({isFetched:!1,fetchedDateTime:null,isLoading:!1,isInvalidated:!1,error:null,isSuccess:!1,data:null,errorCount:0,isEnabled:!0}),U6=(e,t)=>t.filter(a=>e.includes(a.split("/")[0])),lO=(e,t)=>{var a;switch(t.type){case"SET_QUERY_STATE":{const{key:n,value:r}=t;return{...e,states:{...e.states,[n]:{...e.states[n]??Pn(),...r}}}}case"MAKE_QUERY_IN_ERROR":{const{key:n,error:r}=t;return{...e,states:{...e.states,[n]:{...e.states[n]??Pn(),error:r,isFetched:!0,isSuccess:!1,errorCount:(((a=e.states[n])==null?void 0:a.errorCount)??0)+1,isLoading:!1,isInvalidated:!1}}}}case"SET_QUERIES_STATE":{const{keys:n,value:r}=t,s=[n].flat(),o=Object.keys(e.states),u=U6(s,o);if(u.length===0)return e;const d=structuredClone(e.states);return u.forEach(f=>{d[f]={...e.states[f]??Pn(),...r}}),{...e,states:d}}case"RESET_KEY_STATE":{const{keys:n}=t,r=[n].flat();if(r.length===0)return e;const s=Object.keys(e.states),o=U6(r,s);if(o.length===0)return e;const u={...e.states};return o.forEach(d=>{u[d]=Pn()}),{...e,states:u}}case"RESET_STATE":{const n=[t.excludeKeys].flat(),r=Object.keys(e.states),s=U6(n,r),o={};return r.forEach(u=>{o[u]=s.includes(u)?e.states[u]:Pn()}),{...e,states:o}}default:return e}},FN=y.createContext(null),rO=({children:e})=>{const[t,a]=y.useReducer(lO,{states:{}}),n=f=>t.states[f]??Pn(),r=(f,v)=>{a({type:"SET_QUERY_STATE",key:f,value:v})},s=(f,v)=>{a({type:"SET_QUERIES_STATE",keys:f,value:v})},o=(f,v)=>{a({type:"MAKE_QUERY_IN_ERROR",key:f,error:v})},u=f=>{a({type:"RESET_KEY_STATE",keys:f})},d=f=>{a({type:"RESET_STATE",excludeKeys:f})};return I.jsx(FN.Provider,{value:{getStates:n,setQueryState:r,setQueriesState:s,makeQueryInError:o,resetKeyState:u,resetState:d},children:e})},iO=()=>{const e=y.useContext(FN);if(!e)throw new Error("useAsyncState must be used within an AsyncStateProvider");return e},Us=new Map,sO=!1,cO=!1,oO=!0,uO=!1,hO=1,dO=!1,fO=5*60*1e3,mO=5*60*1e3,l8=e=>e?Array.isArray(e)?e:[e]:[],qp=(e,t)=>l8(t).length>0?`${e}/${JSON.stringify(t)}`:e,Jr=(e,t,a)=>{const n=(a==null?void 0:a.retryLimit)??hO,r=(a==null?void 0:a.autoFetch)??uO,s=(a==null?void 0:a.retryTime)??mO,o=(a==null?void 0:a.cache)??sO,u=(a==null?void 0:a.store)??cO,d=(a==null?void 0:a.enable)??oO,f=(a==null?void 0:a.revalidation)??dO,v=(a==null?void 0:a.revalidateTime)??fO,p=(a==null?void 0:a.updateQueries)??[],A=(a==null?void 0:a.invalidateQueries)??[],E=a==null?void 0:a.onSuccess,_=a==null?void 0:a.onError,S=l8((a==null?void 0:a.args)??[]),{getStates:z,setQueryState:C,setQueriesState:M,makeQueryInError:x}=iO(),D=y.useRef(S),w=y.useRef(null),b=qp(e,D.current),{isFetched:T,fetchedDateTime:O,isLoading:H,isEnabled:U,error:f2,isSuccess:s2,isInvalidated:h2,data:W,errorCount:a2}=z(b),V=y.useCallback(async(...q)=>{const K=qp(e,q);w.current&&w.current.abort();const l2=new AbortController;if(w.current=l2,Us.has(K))return Us.get(K);const n2=(async()=>{C(K,{isLoading:!0});let d2=null;return await t(...q).then(g2=>{d2=g2,C(K,{data:g2,errorCount:0,isLoading:!1,isFetched:!0,fetchedDateTime:new Date,isSuccess:!0,isInvalidated:!1,error:null}),E==null||E(g2),A.length>0&&M(A,{isInvalidated:!0}),p.length>0&&M(p,{data:g2}),u&&localStorage.setItem(K,JSON.stringify(g2))}).catch(g2=>{const A2=g2 instanceof Error?g2.message:String(g2);x(K,A2),_==null||_(g2.message)}).finally(()=>{Us.delete(K)}),d2})();return Us.set(K,n2),await n2},[t,b,u,o,E,_]),t2=y.useCallback(async(...q)=>{if(!(!U||!d))return q&&(D.current=l8(q)),await V(...D.current)},[U,d,D,V]),J=y.useCallback(async(...q)=>!U||!d||H?void 0:!h2&&s2&&o&&W?W:await t2(...q),[U,d,h2,o,s2,W,H,t2]);y.useEffect(()=>{d!==U&&C(b,{isEnabled:U})},[d,U,b]),y.useEffect(()=>{if(!U||!d||!u||h2||T||W)return;const q=localStorage.getItem(b);try{q&&C(b,{data:JSON.parse(q)})}catch(K){console.error(K)}},[u,b,T,h2,U,d,W]),y.useEffect(()=>{r&&(!U||!d||T&&!h2||H||V(...D.current))},[r,U,d,T,h2,H,V]),y.useEffect(()=>{const q=a2>0&&n>0,K=a2>n;if(!U||!d||!q||K||!(o||u)||H||s2)return;const l2=setTimeout(()=>{V(...D.current)},s);return()=>clearTimeout(l2)},[U,a2,n,d,s,o,u,s2,H,V]),y.useEffect(()=>{if(!f||v<=0||!U||!d||H||!s2||!O||!(o||u))return;const q=setTimeout(()=>{V(...D.current)},v);return()=>clearTimeout(q)},[f,v,o,u,s2,O,H,U,d,V]);const v2=y.useCallback(q=>{C(b,{data:q})},[b]),F=y.useMemo(()=>({isFetched:T,isInvalidated:h2,error:f2,data:W,errorCount:a2,isSuccess:s2,isEnabled:U,isDisabled:!U,isLoading:H,isWaitingData:H&&!T&&!W,isRevalidating:H&&T,[e]:J,revalidate:t2,setData:v2}),[T,H,h2,f2,s2,W,a2,U,e,J,t2,v2]);return y.useEffect(()=>()=>{w.current&&w.current.abort()},[]),F},vO=e=>{var u;const t=u3(),a=e??t??d0(),n=Yr(void 0,a),{data:r,isFetched:s}=Jr("getCSRFToken",n.auth.getCSRFToken,{cache:!0,autoFetch:!0});return{csrfToken:(u=r==null?void 0:r.data)==null?void 0:u.csrf_token,csrfTokenFetched:s}},pO=(e,t)=>{const a=u3(),n=t??a??d0(),r=Yr(void 0,n),{data:s}=Jr("getOAuth2AccessToken",()=>r.auth.getOAuth2AccessToken({body:{csrf_token:e}}),{cache:!0,autoFetch:!0,enable:!!(n.editor.clientId&&n.editor.clientSecret&&e)});return{oAuth2AccessToken:s==null?void 0:s.data}},AO=(e,t)=>{const a=u3(),n=t??a??d0(),r=Yr(void 0,n),{getSession:s,revalidate:o,data:u,setData:d,isFetched:f}=Jr("getSession",async()=>{try{const p=await r.auth.getSession();if(p.data){const{user:A,organization:E,project:_}=p.data;return{user:A,organization:E,isOrganizationAdmin:(A&&((E==null?void 0:E.adminsIds)??[]).includes(A._id))??!1,project:_,isProjectAdmin:(A&&((_==null?void 0:_.adminsIds)??[]).includes(A._id))??!1}}}catch(p){console.error(p)}return null},{cache:!0,store:!0,autoFetch:!0,enable:!e,invalidateQueries:["getOrganizations","getProjects","getUsers","getDictionaries"]});return{session:y.useMemo(()=>u??(f?null:void 0),[u,f]),fetchSession:s,revalidateSession:o,setSession:d}},ei=({session:e,intlayerConfiguration:t}={})=>{const{csrfToken:a,csrfTokenFetched:n}=vO(t),{session:r,fetchSession:s,revalidateSession:o,setSession:u}=AO(e,t),{oAuth2AccessToken:d}=pO(a,t);return y.useMemo(()=>({session:r,fetchSession:s,setSession:u,revalidateSession:o,csrfToken:a,csrfTokenFetched:n,oAuth2AccessToken:d,isAuthenticated:!!(r||d),isProjectAdmin:r==null?void 0:r.isProjectAdmin,isOrganizationAdmin:r==null?void 0:r.isOrganizationAdmin}),[r,u,s,o,a,n,d])};function m0(e,t,{checkForDefaultPrevented:a=!0}={}){return function(r){if(e==null||e(r),a===!1||!r.defaultPrevented)return t==null?void 0:t(r)}}function Xp(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function HN(...e){return t=>{let a=!1;const n=e.map(r=>{const s=Xp(r,t);return!a&&typeof s=="function"&&(a=!0),s});if(a)return()=>{for(let r=0;r<n.length;r++){const s=n[r];typeof s=="function"?s():Xp(e[r],null)}}}}function B0(...e){return y.useCallback(HN(...e),e)}function gO(e,t){const a=y.createContext(t),n=s=>{const{children:o,...u}=s,d=y.useMemo(()=>u,Object.values(u));return I.jsx(a.Provider,{value:d,children:o})};n.displayName=e+"Provider";function r(s){const o=y.useContext(a);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[n,r]}function ti(e,t=[]){let a=[];function n(s,o){const u=y.createContext(o),d=a.length;a=[...a,o];const f=p=>{var C;const{scope:A,children:E,..._}=p,S=((C=A==null?void 0:A[e])==null?void 0:C[d])||u,z=y.useMemo(()=>_,Object.values(_));return I.jsx(S.Provider,{value:z,children:E})};f.displayName=s+"Provider";function v(p,A){var S;const E=((S=A==null?void 0:A[e])==null?void 0:S[d])||u,_=y.useContext(E);if(_)return _;if(o!==void 0)return o;throw new Error(`\`${p}\` must be used within \`${s}\``)}return[f,v]}const r=()=>{const s=a.map(o=>y.createContext(o));return function(u){const d=(u==null?void 0:u[e])||s;return y.useMemo(()=>({[`__scope${e}`]:{...u,[e]:d}}),[u,d])}};return r.scopeName=e,[n,EO(r,...t)]}function EO(...e){const t=e[0];if(e.length===1)return t;const a=()=>{const n=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(s){const o=n.reduce((u,{useScope:d,scopeName:f})=>{const p=d(s)[`__scope${f}`];return{...u,...p}},{});return y.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return a.scopeName=t.scopeName,a}var Ba=y.forwardRef((e,t)=>{const{children:a,...n}=e,r=y.Children.toArray(a),s=r.find(IO);if(s){const o=s.props.children,u=r.map(d=>d===s?y.Children.count(o)>1?y.Children.only(null):y.isValidElement(o)?o.props.children:null:d);return I.jsx(r8,{...n,ref:t,children:y.isValidElement(o)?y.cloneElement(o,void 0,u):null})}return I.jsx(r8,{...n,ref:t,children:a})});Ba.displayName="Slot";var r8=y.forwardRef((e,t)=>{const{children:a,...n}=e;if(y.isValidElement(a)){const r=SO(a),s=NO(n,a.props);return a.type!==y.Fragment&&(s.ref=t?HN(t,r):r),y.cloneElement(a,s)}return y.Children.count(a)>1?y.Children.only(null):null});r8.displayName="SlotClone";var _O=({children:e})=>I.jsx(I.Fragment,{children:e});function IO(e){return y.isValidElement(e)&&e.type===_O}function NO(e,t){const a={...t};for(const n in t){const r=e[n],s=t[n];/^on[A-Z]/.test(n)?r&&s?a[n]=(...u)=>{s(...u),r(...u)}:r&&(a[n]=r):n==="style"?a[n]={...r,...s}:n==="className"&&(a[n]=[r,s].filter(Boolean).join(" "))}return{...e,...a}}function SO(e){var n,r;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,a=t&&"isReactWarning"in t&&t.isReactWarning;return a?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,a=t&&"isReactWarning"in t&&t.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}function PN(e){const t=e+"CollectionProvider",[a,n]=ti(t),[r,s]=a(t,{collectionRef:{current:null},itemMap:new Map}),o=E=>{const{scope:_,children:S}=E,z=X2.useRef(null),C=X2.useRef(new Map).current;return I.jsx(r,{scope:_,itemMap:C,collectionRef:z,children:S})};o.displayName=t;const u=e+"CollectionSlot",d=X2.forwardRef((E,_)=>{const{scope:S,children:z}=E,C=s(u,S),M=B0(_,C.collectionRef);return I.jsx(Ba,{ref:M,children:z})});d.displayName=u;const f=e+"CollectionItemSlot",v="data-radix-collection-item",p=X2.forwardRef((E,_)=>{const{scope:S,children:z,...C}=E,M=X2.useRef(null),x=B0(_,M),D=s(f,S);return X2.useEffect(()=>(D.itemMap.set(M,{ref:M,...C}),()=>void D.itemMap.delete(M))),I.jsx(Ba,{[v]:"",ref:x,children:z})});p.displayName=f;function A(E){const _=s(e+"CollectionConsumer",E);return X2.useCallback(()=>{const z=_.collectionRef.current;if(!z)return[];const C=Array.from(z.querySelectorAll(`[${v}]`));return Array.from(_.itemMap.values()).sort((D,w)=>C.indexOf(D.ref.current)-C.indexOf(w.ref.current))},[_.collectionRef,_.itemMap])}return[{Provider:o,Slot:d,ItemSlot:p},A,n]}var yO=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],i0=yO.reduce((e,t)=>{const a=y.forwardRef((n,r)=>{const{asChild:s,...o}=n,u=s?Ba:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),I.jsx(u,{...o,ref:r})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{});function UN(e,t){e&&$a.flushSync(()=>e.dispatchEvent(t))}function re(e){const t=y.useRef(e);return y.useEffect(()=>{t.current=e}),y.useMemo(()=>(...a)=>{var n;return(n=t.current)==null?void 0:n.call(t,...a)},[])}function zO(e,t=globalThis==null?void 0:globalThis.document){const a=re(e);y.useEffect(()=>{const n=r=>{r.key==="Escape"&&a(r)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[a,t])}var CO="DismissableLayer",i8="dismissableLayer.update",MO="dismissableLayer.pointerDownOutside",RO="dismissableLayer.focusOutside",Qp,VN=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),wo=y.forwardRef((e,t)=>{const{disableOutsidePointerEvents:a=!1,onEscapeKeyDown:n,onPointerDownOutside:r,onFocusOutside:s,onInteractOutside:o,onDismiss:u,...d}=e,f=y.useContext(VN),[v,p]=y.useState(null),A=(v==null?void 0:v.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,E]=y.useState({}),_=B0(t,T=>p(T)),S=Array.from(f.layers),[z]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),C=S.indexOf(z),M=v?S.indexOf(v):-1,x=f.layersWithOutsidePointerEventsDisabled.size>0,D=M>=C,w=wO(T=>{const O=T.target,H=[...f.branches].some(U=>U.contains(O));!D||H||(r==null||r(T),o==null||o(T),T.defaultPrevented||u==null||u())},A),b=bO(T=>{const O=T.target;[...f.branches].some(U=>U.contains(O))||(s==null||s(T),o==null||o(T),T.defaultPrevented||u==null||u())},A);return zO(T=>{M===f.layers.size-1&&(n==null||n(T),!T.defaultPrevented&&u&&(T.preventDefault(),u()))},A),y.useEffect(()=>{if(v)return a&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(Qp=A.body.style.pointerEvents,A.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(v)),f.layers.add(v),Jp(),()=>{a&&f.layersWithOutsidePointerEventsDisabled.size===1&&(A.body.style.pointerEvents=Qp)}},[v,A,a,f]),y.useEffect(()=>()=>{v&&(f.layers.delete(v),f.layersWithOutsidePointerEventsDisabled.delete(v),Jp())},[v,f]),y.useEffect(()=>{const T=()=>E({});return document.addEventListener(i8,T),()=>document.removeEventListener(i8,T)},[]),I.jsx(i0.div,{...d,ref:_,style:{pointerEvents:x?D?"auto":"none":void 0,...e.style},onFocusCapture:m0(e.onFocusCapture,b.onFocusCapture),onBlurCapture:m0(e.onBlurCapture,b.onBlurCapture),onPointerDownCapture:m0(e.onPointerDownCapture,w.onPointerDownCapture)})});wo.displayName=CO;var xO="DismissableLayerBranch",GN=y.forwardRef((e,t)=>{const a=y.useContext(VN),n=y.useRef(null),r=B0(t,n);return y.useEffect(()=>{const s=n.current;if(s)return a.branches.add(s),()=>{a.branches.delete(s)}},[a.branches]),I.jsx(i0.div,{...e,ref:r})});GN.displayName=xO;function wO(e,t=globalThis==null?void 0:globalThis.document){const a=re(e),n=y.useRef(!1),r=y.useRef(()=>{});return y.useEffect(()=>{const s=u=>{if(u.target&&!n.current){let d=function(){jN(MO,a,f,{discrete:!0})};const f={originalEvent:u};u.pointerType==="touch"?(t.removeEventListener("click",r.current),r.current=d,t.addEventListener("click",r.current,{once:!0})):d()}else t.removeEventListener("click",r.current);n.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",s),t.removeEventListener("click",r.current)}},[t,a]),{onPointerDownCapture:()=>n.current=!0}}function bO(e,t=globalThis==null?void 0:globalThis.document){const a=re(e),n=y.useRef(!1);return y.useEffect(()=>{const r=s=>{s.target&&!n.current&&jN(RO,a,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,a]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function Jp(){const e=new CustomEvent(i8);document.dispatchEvent(e)}function jN(e,t,a,{discrete:n}){const r=a.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:a});t&&r.addEventListener(e,t,{once:!0}),n?UN(r,s):r.dispatchEvent(s)}var TO=wo,kO=GN,x1=globalThis!=null&&globalThis.document?y.useLayoutEffect:()=>{},DO="Portal",bo=y.forwardRef((e,t)=>{var u;const{container:a,...n}=e,[r,s]=y.useState(!1);x1(()=>s(!0),[]);const o=a||r&&((u=globalThis==null?void 0:globalThis.document)==null?void 0:u.body);return o?rB.createPortal(I.jsx(i0.div,{...n,ref:t}),o):null});bo.displayName=DO;function BO(e,t){return y.useReducer((a,n)=>t[a][n]??a,e)}var ai=e=>{const{present:t,children:a}=e,n=LO(t),r=typeof a=="function"?a({present:n.isPresent}):y.Children.only(a),s=B0(n.ref,OO(r));return typeof a=="function"||n.isPresent?y.cloneElement(r,{ref:s}):null};ai.displayName="Presence";function LO(e){const[t,a]=y.useState(),n=y.useRef({}),r=y.useRef(e),s=y.useRef("none"),o=e?"mounted":"unmounted",[u,d]=BO(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return y.useEffect(()=>{const f=Vs(n.current);s.current=u==="mounted"?f:"none"},[u]),x1(()=>{const f=n.current,v=r.current;if(v!==e){const A=s.current,E=Vs(f);e?d("MOUNT"):E==="none"||(f==null?void 0:f.display)==="none"?d("UNMOUNT"):d(v&&A!==E?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,d]),x1(()=>{if(t){let f;const v=t.ownerDocument.defaultView??window,p=E=>{const S=Vs(n.current).includes(E.animationName);if(E.target===t&&S&&(d("ANIMATION_END"),!r.current)){const z=t.style.animationFillMode;t.style.animationFillMode="forwards",f=v.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=z)})}},A=E=>{E.target===t&&(s.current=Vs(n.current))};return t.addEventListener("animationstart",A),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{v.clearTimeout(f),t.removeEventListener("animationstart",A),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:y.useCallback(f=>{f&&(n.current=getComputedStyle(f)),a(f)},[])}}function Vs(e){return(e==null?void 0:e.animationName)||"none"}function OO(e){var n,r;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,a=t&&"isReactWarning"in t&&t.isReactWarning;return a?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,a=t&&"isReactWarning"in t&&t.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}function bc({prop:e,defaultProp:t,onChange:a=()=>{}}){const[n,r]=FO({defaultProp:t,onChange:a}),s=e!==void 0,o=s?e:n,u=re(a),d=y.useCallback(f=>{if(s){const p=typeof f=="function"?f(e):f;p!==e&&u(p)}else r(f)},[s,e,r,u]);return[o,d]}function FO({defaultProp:e,onChange:t}){const a=y.useState(e),[n]=a,r=y.useRef(n),s=re(t);return y.useEffect(()=>{r.current!==n&&(s(n),r.current=n)},[n,r,s]),a}var HO="VisuallyHidden",To=y.forwardRef((e,t)=>I.jsx(i0.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));To.displayName=HO;var kh="ToastProvider",[Dh,PO,UO]=PN("Toast"),[KN,VO]=ti("Toast",[UO]),[GO,ko]=KN(kh),Bh=e=>{const{__scopeToast:t,label:a="Notification",duration:n=5e3,swipeDirection:r="right",swipeThreshold:s=50,children:o}=e,[u,d]=y.useState(null),[f,v]=y.useState(0),p=y.useRef(!1),A=y.useRef(!1);return a.trim()||console.error(`Invalid prop \`label\` supplied to \`${kh}\`. Expected non-empty \`string\`.`),I.jsx(Dh.Provider,{scope:t,children:I.jsx(GO,{scope:t,label:a,duration:n,swipeDirection:r,swipeThreshold:s,toastCount:f,viewport:u,onViewportChange:d,onToastAdd:y.useCallback(()=>v(E=>E+1),[]),onToastRemove:y.useCallback(()=>v(E=>E-1),[]),isFocusedToastEscapeKeyDownRef:p,isClosePausedRef:A,children:o})})};Bh.displayName=kh;var $N="ToastViewport",jO=["F8"],s8="toast.viewportPause",c8="toast.viewportResume",Lh=y.forwardRef((e,t)=>{const{__scopeToast:a,hotkey:n=jO,label:r="Notifications ({hotkey})",...s}=e,o=ko($N,a),u=PO(a),d=y.useRef(null),f=y.useRef(null),v=y.useRef(null),p=y.useRef(null),A=B0(t,p,o.onViewportChange),E=n.join("+").replace(/Key/g,"").replace(/Digit/g,""),_=o.toastCount>0;y.useEffect(()=>{const z=C=>{var x;n.length!==0&&n.every(D=>C[D]||C.code===D)&&((x=p.current)==null||x.focus())};return document.addEventListener("keydown",z),()=>document.removeEventListener("keydown",z)},[n]),y.useEffect(()=>{const z=d.current,C=p.current;if(_&&z&&C){const M=()=>{if(!o.isClosePausedRef.current){const b=new CustomEvent(s8);C.dispatchEvent(b),o.isClosePausedRef.current=!0}},x=()=>{if(o.isClosePausedRef.current){const b=new CustomEvent(c8);C.dispatchEvent(b),o.isClosePausedRef.current=!1}},D=b=>{!z.contains(b.relatedTarget)&&x()},w=()=>{z.contains(document.activeElement)||x()};return z.addEventListener("focusin",M),z.addEventListener("focusout",D),z.addEventListener("pointermove",M),z.addEventListener("pointerleave",w),window.addEventListener("blur",M),window.addEventListener("focus",x),()=>{z.removeEventListener("focusin",M),z.removeEventListener("focusout",D),z.removeEventListener("pointermove",M),z.removeEventListener("pointerleave",w),window.removeEventListener("blur",M),window.removeEventListener("focus",x)}}},[_,o.isClosePausedRef]);const S=y.useCallback(({tabbingDirection:z})=>{const M=u().map(x=>{const D=x.ref.current,w=[D,...nF(D)];return z==="forwards"?w:w.reverse()});return(z==="forwards"?M.reverse():M).flat()},[u]);return y.useEffect(()=>{const z=p.current;if(z){const C=M=>{var w,b,T;const x=M.altKey||M.ctrlKey||M.metaKey;if(M.key==="Tab"&&!x){const O=document.activeElement,H=M.shiftKey;if(M.target===z&&H){(w=f.current)==null||w.focus();return}const s2=S({tabbingDirection:H?"backwards":"forwards"}),h2=s2.findIndex(W=>W===O);V6(s2.slice(h2+1))?M.preventDefault():H?(b=f.current)==null||b.focus():(T=v.current)==null||T.focus()}};return z.addEventListener("keydown",C),()=>z.removeEventListener("keydown",C)}},[u,S]),I.jsxs(kO,{ref:d,role:"region","aria-label":r.replace("{hotkey}",E),tabIndex:-1,style:{pointerEvents:_?void 0:"none"},children:[_&&I.jsx(o8,{ref:f,onFocusFromOutsideViewport:()=>{const z=S({tabbingDirection:"forwards"});V6(z)}}),I.jsx(Dh.Slot,{scope:a,children:I.jsx(i0.ol,{tabIndex:-1,...s,ref:A})}),_&&I.jsx(o8,{ref:v,onFocusFromOutsideViewport:()=>{const z=S({tabbingDirection:"backwards"});V6(z)}})]})});Lh.displayName=$N;var YN="ToastFocusProxy",o8=y.forwardRef((e,t)=>{const{__scopeToast:a,onFocusFromOutsideViewport:n,...r}=e,s=ko(YN,a);return I.jsx(To,{"aria-hidden":!0,tabIndex:0,...r,ref:t,style:{position:"fixed"},onFocus:o=>{var f;const u=o.relatedTarget;!((f=s.viewport)!=null&&f.contains(u))&&n()}})});o8.displayName=YN;var Do="Toast",KO="toast.swipeStart",$O="toast.swipeMove",YO="toast.swipeCancel",ZO="toast.swipeEnd",Oh=y.forwardRef((e,t)=>{const{forceMount:a,open:n,defaultOpen:r,onOpenChange:s,...o}=e,[u=!0,d]=bc({prop:n,defaultProp:r,onChange:s});return I.jsx(ai,{present:a||u,children:I.jsx(XO,{open:u,...o,ref:t,onClose:()=>d(!1),onPause:re(e.onPause),onResume:re(e.onResume),onSwipeStart:m0(e.onSwipeStart,f=>{f.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:m0(e.onSwipeMove,f=>{const{x:v,y:p}=f.detail.delta;f.currentTarget.setAttribute("data-swipe","move"),f.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${v}px`),f.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${p}px`)}),onSwipeCancel:m0(e.onSwipeCancel,f=>{f.currentTarget.setAttribute("data-swipe","cancel"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),f.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),f.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:m0(e.onSwipeEnd,f=>{const{x:v,y:p}=f.detail.delta;f.currentTarget.setAttribute("data-swipe","end"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),f.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${v}px`),f.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${p}px`),d(!1)})})})});Oh.displayName=Do;var[WO,qO]=KN(Do,{onClose(){}}),XO=y.forwardRef((e,t)=>{const{__scopeToast:a,type:n="foreground",duration:r,open:s,onClose:o,onEscapeKeyDown:u,onPause:d,onResume:f,onSwipeStart:v,onSwipeMove:p,onSwipeCancel:A,onSwipeEnd:E,..._}=e,S=ko(Do,a),[z,C]=y.useState(null),M=B0(t,W=>C(W)),x=y.useRef(null),D=y.useRef(null),w=r||S.duration,b=y.useRef(0),T=y.useRef(w),O=y.useRef(0),{onToastAdd:H,onToastRemove:U}=S,f2=re(()=>{var a2;(z==null?void 0:z.contains(document.activeElement))&&((a2=S.viewport)==null||a2.focus()),o()}),s2=y.useCallback(W=>{!W||W===1/0||(window.clearTimeout(O.current),b.current=new Date().getTime(),O.current=window.setTimeout(f2,W))},[f2]);y.useEffect(()=>{const W=S.viewport;if(W){const a2=()=>{s2(T.current),f==null||f()},V=()=>{const t2=new Date().getTime()-b.current;T.current=T.current-t2,window.clearTimeout(O.current),d==null||d()};return W.addEventListener(s8,V),W.addEventListener(c8,a2),()=>{W.removeEventListener(s8,V),W.removeEventListener(c8,a2)}}},[S.viewport,w,d,f,s2]),y.useEffect(()=>{s&&!S.isClosePausedRef.current&&s2(w)},[s,w,S.isClosePausedRef,s2]),y.useEffect(()=>(H(),()=>U()),[H,U]);const h2=y.useMemo(()=>z?XN(z):null,[z]);return S.viewport?I.jsxs(I.Fragment,{children:[h2&&I.jsx(QO,{__scopeToast:a,role:"status","aria-live":n==="foreground"?"assertive":"polite","aria-atomic":!0,children:h2}),I.jsx(WO,{scope:a,onClose:f2,children:$a.createPortal(I.jsx(Dh.ItemSlot,{scope:a,children:I.jsx(TO,{asChild:!0,onEscapeKeyDown:m0(u,()=>{S.isFocusedToastEscapeKeyDownRef.current||f2(),S.isFocusedToastEscapeKeyDownRef.current=!1}),children:I.jsx(i0.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":s?"open":"closed","data-swipe-direction":S.swipeDirection,..._,ref:M,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:m0(e.onKeyDown,W=>{W.key==="Escape"&&(u==null||u(W.nativeEvent),W.nativeEvent.defaultPrevented||(S.isFocusedToastEscapeKeyDownRef.current=!0,f2()))}),onPointerDown:m0(e.onPointerDown,W=>{W.button===0&&(x.current={x:W.clientX,y:W.clientY})}),onPointerMove:m0(e.onPointerMove,W=>{if(!x.current)return;const a2=W.clientX-x.current.x,V=W.clientY-x.current.y,t2=!!D.current,J=["left","right"].includes(S.swipeDirection),v2=["left","up"].includes(S.swipeDirection)?Math.min:Math.max,F=J?v2(0,a2):0,q=J?0:v2(0,V),K=W.pointerType==="touch"?10:2,l2={x:F,y:q},n2={originalEvent:W,delta:l2};t2?(D.current=l2,Gs($O,p,n2,{discrete:!1})):eA(l2,S.swipeDirection,K)?(D.current=l2,Gs(KO,v,n2,{discrete:!1}),W.target.setPointerCapture(W.pointerId)):(Math.abs(a2)>K||Math.abs(V)>K)&&(x.current=null)}),onPointerUp:m0(e.onPointerUp,W=>{const a2=D.current,V=W.target;if(V.hasPointerCapture(W.pointerId)&&V.releasePointerCapture(W.pointerId),D.current=null,x.current=null,a2){const t2=W.currentTarget,J={originalEvent:W,delta:a2};eA(a2,S.swipeDirection,S.swipeThreshold)?Gs(ZO,E,J,{discrete:!0}):Gs(YO,A,J,{discrete:!0}),t2.addEventListener("click",v2=>v2.preventDefault(),{once:!0})}})})})}),S.viewport)})]}):null}),QO=e=>{const{__scopeToast:t,children:a,...n}=e,r=ko(Do,t),[s,o]=y.useState(!1),[u,d]=y.useState(!1);return tF(()=>o(!0)),y.useEffect(()=>{const f=window.setTimeout(()=>d(!0),1e3);return()=>window.clearTimeout(f)},[]),u?null:I.jsx(bo,{asChild:!0,children:I.jsx(To,{...n,children:s&&I.jsxs(I.Fragment,{children:[r.label," ",a]})})})},JO="ToastTitle",Fh=y.forwardRef((e,t)=>{const{__scopeToast:a,...n}=e;return I.jsx(i0.div,{...n,ref:t})});Fh.displayName=JO;var eF="ToastDescription",Hh=y.forwardRef((e,t)=>{const{__scopeToast:a,...n}=e;return I.jsx(i0.div,{...n,ref:t})});Hh.displayName=eF;var ZN="ToastAction",Ph=y.forwardRef((e,t)=>{const{altText:a,...n}=e;return a.trim()?I.jsx(qN,{altText:a,asChild:!0,children:I.jsx(Bo,{...n,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${ZN}\`. Expected non-empty \`string\`.`),null)});Ph.displayName=ZN;var WN="ToastClose",Bo=y.forwardRef((e,t)=>{const{__scopeToast:a,...n}=e,r=qO(WN,a);return I.jsx(qN,{asChild:!0,children:I.jsx(i0.button,{type:"button",...n,ref:t,onClick:m0(e.onClick,r.onClose)})})});Bo.displayName=WN;var qN=y.forwardRef((e,t)=>{const{__scopeToast:a,altText:n,...r}=e;return I.jsx(i0.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0,...r,ref:t})});function XN(e){const t=[];return Array.from(e.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&t.push(n.textContent),aF(n)){const r=n.ariaHidden||n.hidden||n.style.display==="none",s=n.dataset.radixToastAnnounceExclude==="";if(!r)if(s){const o=n.dataset.radixToastAnnounceAlt;o&&t.push(o)}else t.push(...XN(n))}}),t}function Gs(e,t,a,{discrete:n}){const r=a.originalEvent.currentTarget,s=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:a});t&&r.addEventListener(e,t,{once:!0}),n?UN(r,s):r.dispatchEvent(s)}var eA=(e,t,a=0)=>{const n=Math.abs(e.x),r=Math.abs(e.y),s=n>r;return t==="left"||t==="right"?s&&n>a:!s&&r>a};function tF(e=()=>{}){const t=re(e);x1(()=>{let a=0,n=0;return a=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(a),window.cancelAnimationFrame(n)}},[t])}function aF(e){return e.nodeType===e.ELEMENT_NODE}function nF(e){const t=[],a=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const r=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||r?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;a.nextNode();)t.push(a.currentNode);return t}function V6(e){const t=document.activeElement;return e.some(a=>a===t?!0:(a.focus(),document.activeElement!==t))}var lF=Bh,QN=Lh,JN=Oh,eS=Fh,tS=Hh,rF=Ph,aS=Bo;const iF=Object.freeze(Object.defineProperty({__proto__:null,Action:rF,Close:aS,Description:tS,Provider:lF,Root:JN,Title:eS,Toast:Oh,ToastAction:Ph,ToastClose:Bo,ToastDescription:Hh,ToastProvider:Bh,ToastTitle:Fh,ToastViewport:Lh,Viewport:QN,createToastScope:VO},Symbol.toStringTag,{value:"Module"})),sF=iF,cF=({className:e,...t})=>I.jsx(QN,{className:C2("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}),oF=Me("group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md p-4 pr-6 shadow-[0_0_10px_-15px_rgba(0,0,0,0.3)] backdrop-blur transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{error:"bg-error/40 text-text",success:"bg-success/30 text-text",default:"bg-card/80 text-text"}},defaultVariants:{variant:"default"}}),uF=({className:e,variant:t,...a})=>I.jsx(JN,{className:C2(oF({variant:t}),e),...a}),hF=({className:e,...t})=>I.jsx(aS,{className:C2("text-text/50 hover:text-text/80 focus:outline-hidden absolute right-1 top-1 rounded-md p-1 opacity-0 transition-opacity focus:opacity-100 focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:I.jsx(Ya,{className:"size-5"})}),dF=({className:e,...t})=>I.jsx(eS,{className:C2("text-sm font-semibold [&+div]:text-xs",e),...t}),fF=({className:e,...t})=>I.jsx(tS,{className:C2("text-sm opacity-90",e),...t}),mF=1,vF=15*60*1e3;let G6=0;const pF=()=>(G6=(G6+1)%Number.MAX_SAFE_INTEGER,G6.toString()),j6=new Map,tA=e=>{if(j6.has(e))return;const t=setTimeout(()=>{j6.delete(e),ar({type:"REMOVE_TOAST",toastId:e})},vF);j6.set(e,t)},AF=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,mF)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(a=>a.id===t.toast.id?{...a,...t.toast}:a)};case"DISMISS_TOAST":{const{toastId:a}=t;return a?tA(a):e.toasts.forEach(n=>{tA(n.id)}),{...e,toasts:e.toasts.map(n=>n.id===a||a===void 0?{...n,open:!1}:n)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(a=>a.id!==t.toastId)}}},Ac=[];let gc={toasts:[]};const ar=e=>{gc=AF(gc,e),Ac.forEach(t=>{t(gc)})},gF=({...e})=>{const t=pF(),a=r=>ar({type:"UPDATE_TOAST",toast:{...r,id:t}}),n=()=>ar({type:"DISMISS_TOAST",toastId:t});return ar({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:r=>{r||n()}}}),{id:t,dismiss:n,update:a}},nS=()=>{const[e,t]=y.useState(gc);return y.useEffect(()=>(Ac.push(t),()=>{const a=Ac.indexOf(t);a>-1&&Ac.splice(a,1)}),[e]),{...e,toast:gF,dismiss:a=>ar({type:"DISMISS_TOAST",toastId:a})}},$3=e=>{const t=u3(),{csrfToken:a,oAuth2AccessToken:n}=ei(),r=y.useMemo(()=>n!=null&&n.accessToken?{Authorization:`Bearer ${n.accessToken}`}:void 0,[n==null?void 0:n.accessToken]),s=y.useMemo(()=>a?{csrf_token:a}:void 0,[a]);return y.useMemo(()=>Yr({headers:r,body:s},t),[s,r])};var EF={};const lS=e=>{const{toast:t}=nS();return{...e,onError:a=>{var r;let n;try{if(typeof a>"u")return;n=JSON.parse(a)}catch{n=a}[n].flatMap(s=>s).forEach(s=>t({title:(EF.NODE_ENV==="production"?s.title:s.code)??"Error",description:s.message??a??"An error occurred",variant:"error"})),(r=e.onError)==null||r.call(e,a)},onSuccess:a=>{var n;a.message&&t({title:a.message,description:a.description,variant:"success"}),(n=e.onSuccess)==null||n.call(e,a)}}},_F=(e,{requireUser:t,requireProject:a,requireOrganization:n}={})=>{const r=u3(),{csrfToken:s,oAuth2AccessToken:o,session:u}=ei({intlayerConfiguration:r}),d=(e==null?void 0:e.enable)??!0,f=u?u.user:o==null?void 0:o.user,v=u?u.organization:o==null?void 0:o.organization,p=u?u.project:o==null?void 0:o.project;return{...e,enable:d&&(t?!!f:!0)&&(a?!!p:!0)&&(n?!!v:!0)&&(!!s||!u&&!!o)}},Pt=(e,t,a,n)=>{const r=_F(a??{},n),s=lS(r);return Jr(e,t,s)},IF=(e,t,a)=>{const n=lS({});return Jr(e,t,n)},NF=e=>Pt("logout",$3().auth.logout,{invalidateQueries:["getSession"],...e}),SF=e=>Pt("getProjects",$3().project.getProjects,{cache:!0,store:!0,retryLimit:3,autoFetch:!0,revalidation:!0,revalidateTime:5*60*1e3,...e},{requireUser:!0,requireOrganization:!0}),yF=e=>Pt("getDictionaries",$3().dictionary.getDictionaries,{cache:!0,store:!0,retryLimit:3,autoFetch:!0,revalidation:!0,revalidateTime:5*60*1e3,...e},{requireUser:!0,requireOrganization:!0,requireProject:!0}),zF=e=>Pt("pushDictionaries",$3().dictionary.pushDictionaries,{invalidateQueries:["getDictionaries","getDictionary","getDictionariesKeys"],...e}),CF=e=>Pt("getTags",$3().tag.getTags,{cache:!0,store:!0,retryLimit:3,autoFetch:!0,revalidation:!0,revalidateTime:5*60*1e3,...e},{requireUser:!0,requireOrganization:!0}),MF=e=>Pt("auditContentDeclaration",$3().ai.auditContentDeclarationMetadata,e,{requireUser:!0,requireOrganization:!0,requireProject:!0}),RF=e=>Pt("auditContentDeclarationField",$3().ai.auditContentDeclarationField,e,{requireUser:!0,requireOrganization:!0,requireProject:!0}),xF=e=>Pt("autocomplete",$3().ai.autocomplete,e),wF=e=>IF("writeDictionary",$3().editor.writeDictionary);var K6,aA;function bF(){if(aA)return K6;aA=1;var e=function(M){return t(M)&&!a(M)};function t(C){return!!C&&typeof C=="object"}function a(C){var M=Object.prototype.toString.call(C);return M==="[object RegExp]"||M==="[object Date]"||s(C)}var n=typeof Symbol=="function"&&Symbol.for,r=n?Symbol.for("react.element"):60103;function s(C){return C.$$typeof===r}function o(C){return Array.isArray(C)?[]:{}}function u(C,M){return M.clone!==!1&&M.isMergeableObject(C)?S(o(C),C,M):C}function d(C,M,x){return C.concat(M).map(function(D){return u(D,x)})}function f(C,M){if(!M.customMerge)return S;var x=M.customMerge(C);return typeof x=="function"?x:S}function v(C){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(C).filter(function(M){return Object.propertyIsEnumerable.call(C,M)}):[]}function p(C){return Object.keys(C).concat(v(C))}function A(C,M){try{return M in C}catch{return!1}}function E(C,M){return A(C,M)&&!(Object.hasOwnProperty.call(C,M)&&Object.propertyIsEnumerable.call(C,M))}function _(C,M,x){var D={};return x.isMergeableObject(C)&&p(C).forEach(function(w){D[w]=u(C[w],x)}),p(M).forEach(function(w){E(C,w)||(A(C,w)&&x.isMergeableObject(M[w])?D[w]=f(w,x)(C[w],M[w],x):D[w]=u(M[w],x))}),D}function S(C,M,x){x=x||{},x.arrayMerge=x.arrayMerge||d,x.isMergeableObject=x.isMergeableObject||e,x.cloneUnlessOtherwiseSpecified=u;var D=Array.isArray(M),w=Array.isArray(C),b=D===w;return b?D?x.arrayMerge(C,M,x):_(C,M,x):u(M,x)}S.all=function(M,x){if(!Array.isArray(M))throw new Error("first argument should be an array");return M.reduce(function(D,w){return S(D,w,x)},{})};var z=S;return K6=z,K6}var TF=bF();const kF=So(TF),nA={method:"GET",headers:{"Content-Type":"application/json"},credentials:"include"},DF=e=>(Object.keys(e).forEach(t=>{e[t]===void 0&&delete e[t]}),e),js=e=>e.reduce((t,a)=>{const n=t??{},r=DF(a??{});return typeof n=="object"&&typeof r=="object"?{...n,...r}:r??n},{}),k2=async(e,...t)=>{const{signal:a}=new AbortController;let n="",r;const s=t.map(({body:E,params:_,headers:S,...z})=>z),o=js([nA,...s]),u=js([nA.headers,...t.map(E=>E.headers)]),d=js(t.map(E=>E.params)),f=o.method;if(f!=="GET"&&f!=="HEAD"){const E=js(t.map(_=>_.body));(u==null?void 0:u["Content-Type"])==="application/x-www-form-urlencoded"?r=new URLSearchParams(E).toString():r=JSON.stringify(E)}Object.entries(d).length>0&&(n=`?${new URLSearchParams(d).toString()}`);const v={...o,headers:u,body:r,signal:a},p=`${e}${n}`,A=await fetch(p,v);if(!A.ok){const E=await A.json();throw new Error(JSON.stringify(E.error)??"An error occurred")}return await A.json()},rS=(e={},t)=>{const n=`${d0().editor.backendURL}/api/ai`;return{auditContentDeclaration:async(v,p={})=>await k2(`${n}/audit/dictionary`,e,p,{method:"POST",body:v}),auditContentDeclarationField:async(v,p={})=>await k2(`${n}/audit/dictionary/field`,e,p,{method:"POST",body:v}),auditContentDeclarationMetadata:async(v,p={})=>await k2(`${n}/audit/dictionary/metadata`,e,p,{method:"POST",body:v}),auditTag:async(v,p={})=>await k2(`${n}/audit/tag`,e,p,{method:"POST",body:v}),askDocQuestion:async(v,p={})=>await k2(`${n}/ask`,e,p,{method:"POST",body:v}),autocomplete:async(v,p={})=>await k2(`${n}/autocomplete`,e,p,{method:"POST",body:v})}};rS();const iS=(e={},t)=>{const{backendURL:a,clientId:n,clientSecret:r}=d0().editor,s=`${a}/api/auth`;return{login:async(b,T={})=>await k2(`${s}/login`,e,T,{method:"POST",body:b}),getLoginWithGitHubURL:b=>{const T=new URLSearchParams(b);return`${s}/login/github?${T.toString()}`},getLoginWithGoogleURL:b=>{const T=new URLSearchParams(b);return`${s}/login/google?${T.toString()}`},register:async(b,T={},O={})=>await k2(`${s}/register`,e,O,{method:"POST",body:b,params:T}),logout:async(b={})=>await k2(`${s}/logout`,e,b,{method:"POST"}),resetPassword:async(b,T={})=>await k2(`${s}/password/reset`,e,T,{params:b,method:"POST"}),defineNewPassword:async(b,T={})=>await k2(`${s}/password/define`,e,T,{method:"POST",body:b}),askResetPassword:async(b,T={})=>await k2(`${s}/password/reset`,e,T,{method:"POST",body:{email:b}}),checkIfUserHasPassword:async(b={})=>await k2(`${s}/password/has`,e,b,{method:"GET"}),verifyEmail:async({userId:b,secret:T},O={})=>await k2(`${s}/active/${b}/${T}`,e,O,{method:"PUT"}),getVerifyEmailStatusURL:b=>`${s}/verify-email-status/${String(b)}`,changePassword:async(b,T={})=>await k2(`${s}/password`,e,T,{method:"PUT",body:b}),createSession:async(b,T={})=>await k2(`${s}/session`,e,T,{method:"POST",body:b}),getSession:async(b,T={})=>await k2(`${a}/session`,e,T,{params:{session_token:b}}),getCSRFToken:async(b={})=>await k2(`${a}/csrf-token`,e,b),getOAuth2AccessToken:async(b={})=>await k2(`${a}/oauth2/token`,e,b,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:{grant_type:"client_credentials",client_id:n,client_secret:r}})}};iS();const sS=(e={},t)=>{const n=`${d0().editor.backendURL}/api/dictionary`;return{getDictionaries:async(p,A={})=>await k2(n,e,A,{params:p}),getDictionariesKeys:async(p={})=>await k2(`${n}/keys`,e,p),getDictionary:async(p,A,E={})=>await k2(`${n}/${p}`,e,E,{params:A?{version:A.toString()}:void 0}),pushDictionaries:async(p,A={})=>await k2(`${n}`,e,A,{method:"PATCH",body:{dictionaries:p}}),addDictionary:async(p,A={})=>await k2(`${n}`,e,A,{method:"POST",body:p}),updateDictionary:async(p,A,E={})=>await k2(`${n}/${p}`,e,E,{method:"PUT",body:A}),deleteDictionary:async(p,A={})=>await k2(`${n}`,e,A,{method:"DELETE",body:{id:p}})}};sS();const cS=(e={},t)=>{const{editorURL:a}=d0().editor,n=`${a}/api`;return{getConfiguration:async(o={})=>(await k2(`${n}/config`,e,o)).data,writeDictionary:async(o,u={})=>{await k2(`${n}/dictionary`,e,u,{method:"POST",body:{dictionary:o}})}}};cS();const oS=(e={},t)=>{const n=`${d0().editor.backendURL}/api/organization`;return{getOrganizations:async(E,_={})=>await k2(n,e,_,{params:E}),getOrganization:async(E,_={})=>await k2(`${n}/${String(E)}`,e,_),addOrganization:async(E,_={})=>await k2(n,e,_,{method:"POST",body:E}),addOrganizationMember:async(E,_={})=>k2(`${n}/member`,e,_,{method:"POST",body:E}),updateOrganization:async(E,_={})=>k2(n,e,_,{method:"PUT",body:E}),updateOrganizationMembers:async(E,_={})=>k2(`${n}/members`,e,_,{method:"PUT",body:E}),deleteOrganization:async(E={})=>await k2(n,e,E,{method:"DELETE"}),selectOrganization:async(E,_={})=>await k2(`${n}/${String(E)}`,e,_,{method:"PUT"}),unselectOrganization:async(E={})=>await k2(`${n}/logout`,e,E,{method:"POST"})}};oS();const uS=(e={},t)=>{const n=`${d0().editor.backendURL}/api/project`;return{getProjects:async(S,z={})=>await k2(n,e,z,{params:S}),addProject:async(S,z={})=>await k2(`${n}`,e,z,{method:"POST",body:S}),updateProject:async(S,z={})=>await k2(`${n}`,e,z,{method:"PUT",body:S}),updateProjectMembers:async(S,z={})=>await k2(`${n}/members`,e,z,{method:"PUT",body:S}),pushProjectConfiguration:async(S,z={})=>await k2(`${n}/configuration`,e,z,{method:"PUT",body:S}),deleteProject:async(S={})=>await k2(`${n}`,e,S,{method:"DELETE"}),selectProject:async(S,z={})=>await k2(`${n}/${String(S)}`,e,z,{method:"PUT"}),unselectProject:async(S={})=>await k2(`${n}/logout`,e,S,{method:"POST"}),addNewAccessKey:async(S,z={})=>await k2(`${n}/access_key`,e,z,{method:"POST",body:S}),deleteAccessKey:async(S,z={})=>await k2(`${n}/access_key`,e,z,{method:"DELETE",body:{clientId:S}}),refreshAccessKey:async(S,z={})=>await k2(`${n}/access_key`,e,z,{method:"PATCH",body:{clientId:S}})}};uS();const BF=(e={},t)=>{const n=`${d0().editor.backendURL}/api/stripe`;return{getPricing:async(u,d={})=>await k2(`${n}/pricing`,e,d,{method:"POST",body:u}),getSubscription:async(u,d={})=>await k2(`${n}/create-subscription`,e,d,{method:"POST",body:u}),cancelSubscription:async(u={})=>await k2(`${n}/cancel-subscription`,e,u,{method:"POST"})}},hS=(e={},t)=>{const n=`${d0().editor.backendURL}/api/tag`;return{getTags:async(d,f={})=>await k2(n,e,f,{params:d}),addTag:async(d,f={})=>await k2(`${n}`,e,f,{method:"POST",body:d}),updateTag:async(d,f,v={})=>await k2(`${n}/${d}`,e,v,{method:"PUT",body:f}),deleteTag:async(d,f={})=>await k2(`${n}/${d}`,e,f,{method:"DELETE"})}};hS();const dS=(e={},t)=>{const n=`${d0().editor.backendURL}/api/user`;return{createUser:async(p,A={})=>await k2(`${n}/`,e,A,{method:"POST",body:p}),getUsers:async(p,A={})=>await k2(n,e,A,{params:p}),getUserById:async(p,A={})=>await k2(`${n}/${p}`,e,A),getUserByAccount:async(p,A,E={})=>await k2(`${n}/account/${A}/${p}`,e,E),getUserByEmail:async(p,A={})=>await k2(`${n}/email/${p}`,e,A),updateUser:async(p,A={})=>await k2(`${n}`,e,A,{method:"PUT",body:p}),deleteUser:async(p,A={})=>await k2(`${n}/${p}`,e,A,{method:"DELETE"})}};dS();const LF=(e={},t)=>({organization:oS(e),project:uS(e),user:dS(e),auth:iS(e),dictionary:sS(e),stripe:BF(e),ai:rS(e),tag:hS(e),editor:cS(e)});LF();j({en:"or",fr:"ou",es:"o",de:"oder",ja:"または",ko:"또는",zh:"或",it:"o",pt:"ou",hi:"या",ar:"أو",ru:"или","en-GB":"or"}),j({en:"Sign in with GitHub",fr:"Se connecter avec GitHub",es:"Iniciar sesión con GitHub",de:"Mit GitHub anmelden",ja:"GitHubでサインイン",ko:"GitHub로 로그인",zh:"使用GitHub登录",it:"Accedi con GitHub",pt:"Entrar com o GitHub",hi:"GitHub के साथ साइनइन करें",ar:"تسجيل الدخول باستخدام GitHub",ru:"Войти с GitHub","en-GB":"Sign in with GitHub"}),j({en:"Sign in with GitHub",fr:"Se connecter avec GitHub",es:"Iniciar sesión con GitHub",de:"Mit GitHub anmelden",ja:"GitHubでサインイン",ko:"GitHub로 로그인",zh:"使用GitHub登录",it:"Accedi con GitHub",pt:"Entrar com o GitHub",hi:"GitHub के साथ साइनइन करें",ar:"تسجيل الدخول باستخدام GitHub",ru:"Войти с GitHub","en-GB":"Sign in with GitHub"}),j({en:"Sign in with Google",fr:"Se connecter avec Google",es:"Iniciar sesión con Google",de:"Mit Google anmelden",ja:"Googleでサインイン",ko:"Google로 로그인",zh:"使用Google登录",it:"Accedi con Google",pt:"Entrar com o Google",hi:"Google के साथ साइनइन करें",ar:"تسجيل الدخول باستخدام Google",ru:"Войти с Google","en-GB":"Sign in with Google"}),j({en:"Sign in with Google",fr:"Se connecter avec Google",es:"Iniciar sesión con Google",de:"Mit Google anmelden",ja:"Googleでサインイン",ko:"Google로 로그인",zh:"使用Google登录",it:"Accedi con Google",pt:"Entrar com o Google",hi:"Google के साथ साइनइन करें",ar:"تسجيل الدخول باستخدام Google",ru:"Войти с Google","en-GB":"Sign in with Google"});var ni=e=>e.type==="checkbox",Ma=e=>e instanceof Date,D1=e=>e==null;const fS=e=>typeof e=="object";var $0=e=>!D1(e)&&!Array.isArray(e)&&fS(e)&&!Ma(e),mS=e=>$0(e)&&e.target?ni(e.target)?e.target.checked:e.target.value:e,OF=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,vS=(e,t)=>e.has(OF(t)),FF=e=>{const t=e.constructor&&e.constructor.prototype;return $0(t)&&t.hasOwnProperty("isPrototypeOf")},Uh=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function U1(e){let t;const a=Array.isArray(e),n=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(Uh&&(e instanceof Blob||n))&&(a||$0(e)))if(t=a?[]:{},!a&&!FF(e))t=e;else for(const r in e)e.hasOwnProperty(r)&&(t[r]=U1(e[r]));else return e;return t}var Lo=e=>Array.isArray(e)?e.filter(Boolean):[],K0=e=>e===void 0,I2=(e,t,a)=>{if(!t||!$0(e))return a;const n=Lo(t.split(/[,[\].]+?/)).reduce((r,s)=>D1(r)?r:r[s],e);return K0(n)||n===e?K0(e[t])?a:e[t]:n},Ne=e=>typeof e=="boolean",Vh=e=>/^\w*$/.test(e),pS=e=>Lo(e.replace(/["|']|\]/g,"").split(/\.|\[/)),E0=(e,t,a)=>{let n=-1;const r=Vh(t)?[t]:pS(t),s=r.length,o=s-1;for(;++n<s;){const u=r[n];let d=a;if(n!==o){const f=e[u];d=$0(f)||Array.isArray(f)?f:isNaN(+r[n+1])?{}:[]}if(u==="__proto__"||u==="constructor"||u==="prototype")return;e[u]=d,e=e[u]}return e};const Tc={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Le={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},b3={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},AS=X2.createContext(null),Ut=()=>X2.useContext(AS),HF=e=>{const{children:t,...a}=e;return X2.createElement(AS.Provider,{value:a},t)};var gS=(e,t,a,n=!0)=>{const r={defaultValues:t._defaultValues};for(const s in e)Object.defineProperty(r,s,{get:()=>{const o=s;return t._proxyFormState[o]!==Le.all&&(t._proxyFormState[o]=!n||Le.all),a&&(a[o]=!0),e[o]}});return r},V1=e=>$0(e)&&!Object.keys(e).length,ES=(e,t,a,n)=>{a(e);const{name:r,...s}=e;return V1(s)||Object.keys(s).length>=Object.keys(t).length||Object.keys(s).find(o=>t[o]===(!n||Le.all))},nr=e=>Array.isArray(e)?e:[e],_S=(e,t,a)=>!e||!t||e===t||nr(e).some(n=>n&&(a?n===t:n.startsWith(t)||t.startsWith(n)));function Gh(e){const t=X2.useRef(e);t.current=e,X2.useEffect(()=>{const a=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{a&&a.unsubscribe()}},[e.disabled])}function PF(e){const t=Ut(),{control:a=t.control,disabled:n,name:r,exact:s}=e||{},[o,u]=X2.useState(a._formState),d=X2.useRef(!0),f=X2.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),v=X2.useRef(r);return v.current=r,Gh({disabled:n,next:p=>d.current&&_S(v.current,p.name,s)&&ES(p,f.current,a._updateFormState)&&u({...a._formState,...p}),subject:a._subjects.state}),X2.useEffect(()=>(d.current=!0,f.current.isValid&&a._updateValid(!0),()=>{d.current=!1}),[a]),X2.useMemo(()=>gS(o,a,f.current,!1),[o,a])}var e3=e=>typeof e=="string",IS=(e,t,a,n,r)=>e3(e)?(n&&t.watch.add(e),I2(a,e,r)):Array.isArray(e)?e.map(s=>(n&&t.watch.add(s),I2(a,s))):(n&&(t.watchAll=!0),a);function UF(e){const t=Ut(),{control:a=t.control,name:n,defaultValue:r,disabled:s,exact:o}=e||{},u=X2.useRef(n);u.current=n,Gh({disabled:s,subject:a._subjects.values,next:v=>{_S(u.current,v.name,o)&&f(U1(IS(u.current,a._names,v.values||a._formValues,!1,r)))}});const[d,f]=X2.useState(a._getWatch(n,r));return X2.useEffect(()=>a._removeUnmounted()),d}function VF(e){const t=Ut(),{name:a,disabled:n,control:r=t.control,shouldUnregister:s}=e,o=vS(r._names.array,a),u=UF({control:r,name:a,defaultValue:I2(r._formValues,a,I2(r._defaultValues,a,e.defaultValue)),exact:!0}),d=PF({control:r,name:a,exact:!0}),f=X2.useRef(r.register(a,{...e.rules,value:u,...Ne(e.disabled)?{disabled:e.disabled}:{}})),v=X2.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!I2(d.errors,a)},isDirty:{enumerable:!0,get:()=>!!I2(d.dirtyFields,a)},isTouched:{enumerable:!0,get:()=>!!I2(d.touchedFields,a)},isValidating:{enumerable:!0,get:()=>!!I2(d.validatingFields,a)},error:{enumerable:!0,get:()=>I2(d.errors,a)}}),[d,a]),p=X2.useMemo(()=>({name:a,value:u,...Ne(n)||d.disabled?{disabled:d.disabled||n}:{},onChange:A=>f.current.onChange({target:{value:mS(A),name:a},type:Tc.CHANGE}),onBlur:()=>f.current.onBlur({target:{value:I2(r._formValues,a),name:a},type:Tc.BLUR}),ref:A=>{const E=I2(r._fields,a);E&&A&&(E._f.ref={focus:()=>A.focus(),select:()=>A.select(),setCustomValidity:_=>A.setCustomValidity(_),reportValidity:()=>A.reportValidity()})}}),[a,r._formValues,n,d.disabled,u,r._fields]);return X2.useEffect(()=>{const A=r._options.shouldUnregister||s,E=(_,S)=>{const z=I2(r._fields,_);z&&z._f&&(z._f.mount=S)};if(E(a,!0),A){const _=U1(I2(r._options.defaultValues,a));E0(r._defaultValues,a,_),K0(I2(r._formValues,a))&&E0(r._formValues,a,_)}return!o&&r.register(a),()=>{(o?A&&!r._state.action:A)?r.unregister(a):E(a,!1)}},[a,r,o,s]),X2.useEffect(()=>{r._updateDisabledField({disabled:n,fields:r._fields,name:a})},[n,a,r]),X2.useMemo(()=>({field:p,formState:d,fieldState:v}),[p,d,v])}const GF=e=>e.render(VF(e));var NS=(e,t,a,n,r)=>t?{...a[e],types:{...a[e]&&a[e].types?a[e].types:{},[n]:r||!0}}:{},lA=e=>({isOnSubmit:!e||e===Le.onSubmit,isOnBlur:e===Le.onBlur,isOnChange:e===Le.onChange,isOnAll:e===Le.all,isOnTouch:e===Le.onTouched}),rA=(e,t,a)=>!a&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(n)&&/^\.\w+/.test(e.slice(n.length))));const lr=(e,t,a,n)=>{for(const r of a||Object.keys(e)){const s=I2(e,r);if(s){const{_f:o,...u}=s;if(o){if(o.refs&&o.refs[0]&&t(o.refs[0],r)&&!n)return!0;if(o.ref&&t(o.ref,o.name)&&!n)return!0;if(lr(u,t))break}else if($0(u)&&lr(u,t))break}}};var jF=(e,t,a)=>{const n=nr(I2(e,a));return E0(n,"root",t[a]),E0(e,a,n),e},jh=e=>e.type==="file",Je=e=>typeof e=="function",kc=e=>{if(!Uh)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Ec=e=>e3(e),Kh=e=>e.type==="radio",Dc=e=>e instanceof RegExp;const iA={value:!1,isValid:!1},sA={value:!0,isValid:!0};var SS=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(a=>a&&a.checked&&!a.disabled).map(a=>a.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!K0(e[0].attributes.value)?K0(e[0].value)||e[0].value===""?sA:{value:e[0].value,isValid:!0}:sA:iA}return iA};const cA={isValid:!1,value:null};var yS=e=>Array.isArray(e)?e.reduce((t,a)=>a&&a.checked&&!a.disabled?{isValid:!0,value:a.value}:t,cA):cA;function oA(e,t,a="validate"){if(Ec(e)||Array.isArray(e)&&e.every(Ec)||Ne(e)&&!e)return{type:a,message:Ec(e)?e:"",ref:t}}var Ln=e=>$0(e)&&!Dc(e)?e:{value:e,message:""},uA=async(e,t,a,n,r,s)=>{const{ref:o,refs:u,required:d,maxLength:f,minLength:v,min:p,max:A,pattern:E,validate:_,name:S,valueAsNumber:z,mount:C}=e._f,M=I2(a,S);if(!C||t.has(S))return{};const x=u?u[0]:o,D=s2=>{r&&x.reportValidity&&(x.setCustomValidity(Ne(s2)?"":s2||""),x.reportValidity())},w={},b=Kh(o),T=ni(o),O=b||T,H=(z||jh(o))&&K0(o.value)&&K0(M)||kc(o)&&o.value===""||M===""||Array.isArray(M)&&!M.length,U=NS.bind(null,S,n,w),f2=(s2,h2,W,a2=b3.maxLength,V=b3.minLength)=>{const t2=s2?h2:W;w[S]={type:s2?a2:V,message:t2,ref:o,...U(s2?a2:V,t2)}};if(s?!Array.isArray(M)||!M.length:d&&(!O&&(H||D1(M))||Ne(M)&&!M||T&&!SS(u).isValid||b&&!yS(u).isValid)){const{value:s2,message:h2}=Ec(d)?{value:!!d,message:d}:Ln(d);if(s2&&(w[S]={type:b3.required,message:h2,ref:x,...U(b3.required,h2)},!n))return D(h2),w}if(!H&&(!D1(p)||!D1(A))){let s2,h2;const W=Ln(A),a2=Ln(p);if(!D1(M)&&!isNaN(M)){const V=o.valueAsNumber||M&&+M;D1(W.value)||(s2=V>W.value),D1(a2.value)||(h2=V<a2.value)}else{const V=o.valueAsDate||new Date(M),t2=F=>new Date(new Date().toDateString()+" "+F),J=o.type=="time",v2=o.type=="week";e3(W.value)&&M&&(s2=J?t2(M)>t2(W.value):v2?M>W.value:V>new Date(W.value)),e3(a2.value)&&M&&(h2=J?t2(M)<t2(a2.value):v2?M<a2.value:V<new Date(a2.value))}if((s2||h2)&&(f2(!!s2,W.message,a2.message,b3.max,b3.min),!n))return D(w[S].message),w}if((f||v)&&!H&&(e3(M)||s&&Array.isArray(M))){const s2=Ln(f),h2=Ln(v),W=!D1(s2.value)&&M.length>+s2.value,a2=!D1(h2.value)&&M.length<+h2.value;if((W||a2)&&(f2(W,s2.message,h2.message),!n))return D(w[S].message),w}if(E&&!H&&e3(M)){const{value:s2,message:h2}=Ln(E);if(Dc(s2)&&!M.match(s2)&&(w[S]={type:b3.pattern,message:h2,ref:o,...U(b3.pattern,h2)},!n))return D(h2),w}if(_){if(Je(_)){const s2=await _(M,a),h2=oA(s2,x);if(h2&&(w[S]={...h2,...U(b3.validate,h2.message)},!n))return D(h2.message),w}else if($0(_)){let s2={};for(const h2 in _){if(!V1(s2)&&!n)break;const W=oA(await _[h2](M,a),x,h2);W&&(s2={...W,...U(h2,W.message)},D(W.message),n&&(w[S]=s2))}if(!V1(s2)&&(w[S]={ref:x,...s2},!n))return w}}return D(!0),w};function KF(e,t){const a=t.slice(0,-1).length;let n=0;for(;n<a;)e=K0(e)?n++:e[t[n++]];return e}function $F(e){for(const t in e)if(e.hasOwnProperty(t)&&!K0(e[t]))return!1;return!0}function e1(e,t){const a=Array.isArray(t)?t:Vh(t)?[t]:pS(t),n=a.length===1?e:KF(e,a),r=a.length-1,s=a[r];return n&&delete n[s],r!==0&&($0(n)&&V1(n)||Array.isArray(n)&&$F(n))&&e1(e,a.slice(0,-1)),e}var $6=()=>{let e=[];return{get observers(){return e},next:r=>{for(const s of e)s.next&&s.next(r)},subscribe:r=>(e.push(r),{unsubscribe:()=>{e=e.filter(s=>s!==r)}}),unsubscribe:()=>{e=[]}}},u8=e=>D1(e)||!fS(e);function yt(e,t){if(u8(e)||u8(t))return e===t;if(Ma(e)&&Ma(t))return e.getTime()===t.getTime();const a=Object.keys(e),n=Object.keys(t);if(a.length!==n.length)return!1;for(const r of a){const s=e[r];if(!n.includes(r))return!1;if(r!=="ref"){const o=t[r];if(Ma(s)&&Ma(o)||$0(s)&&$0(o)||Array.isArray(s)&&Array.isArray(o)?!yt(s,o):s!==o)return!1}}return!0}var zS=e=>e.type==="select-multiple",YF=e=>Kh(e)||ni(e),Y6=e=>kc(e)&&e.isConnected,CS=e=>{for(const t in e)if(Je(e[t]))return!0;return!1};function Bc(e,t={}){const a=Array.isArray(e);if($0(e)||a)for(const n in e)Array.isArray(e[n])||$0(e[n])&&!CS(e[n])?(t[n]=Array.isArray(e[n])?[]:{},Bc(e[n],t[n])):D1(e[n])||(t[n]=!0);return t}function MS(e,t,a){const n=Array.isArray(e);if($0(e)||n)for(const r in e)Array.isArray(e[r])||$0(e[r])&&!CS(e[r])?K0(t)||u8(a[r])?a[r]=Array.isArray(e[r])?Bc(e[r],[]):{...Bc(e[r])}:MS(e[r],D1(t)?{}:t[r],a[r]):a[r]=!yt(e[r],t[r]);return a}var Fl=(e,t)=>MS(e,t,Bc(t)),RS=(e,{valueAsNumber:t,valueAsDate:a,setValueAs:n})=>K0(e)?e:t?e===""?NaN:e&&+e:a&&e3(e)?new Date(e):n?n(e):e;function Z6(e){const t=e.ref;return jh(t)?t.files:Kh(t)?yS(e.refs).value:zS(t)?[...t.selectedOptions].map(({value:a})=>a):ni(t)?SS(e.refs).value:RS(K0(t.value)?e.ref.value:t.value,e)}var ZF=(e,t,a,n)=>{const r={};for(const s of e){const o=I2(t,s);o&&E0(r,s,o._f)}return{criteriaMode:a,names:[...e],fields:r,shouldUseNativeValidation:n}},Hl=e=>K0(e)?e:Dc(e)?e.source:$0(e)?Dc(e.value)?e.value.source:e.value:e;const hA="AsyncFunction";var WF=e=>!!e&&!!e.validate&&!!(Je(e.validate)&&e.validate.constructor.name===hA||$0(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===hA)),qF=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function dA(e,t,a){const n=I2(e,a);if(n||Vh(a))return{error:n,name:a};const r=a.split(".");for(;r.length;){const s=r.join("."),o=I2(t,s),u=I2(e,s);if(o&&!Array.isArray(o)&&a!==s)return{name:a};if(u&&u.type)return{name:s,error:u};r.pop()}return{name:a}}var XF=(e,t,a,n,r)=>r.isOnAll?!1:!a&&r.isOnTouch?!(t||e):(a?n.isOnBlur:r.isOnBlur)?!e:(a?n.isOnChange:r.isOnChange)?e:!0,QF=(e,t)=>!Lo(I2(e,t)).length&&e1(e,t);const JF={mode:Le.onSubmit,reValidateMode:Le.onChange,shouldFocusError:!0};function eH(e={}){let t={...JF,...e},a={submitCount:0,isDirty:!1,isLoading:Je(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},n={},r=$0(t.defaultValues)||$0(t.values)?U1(t.defaultValues||t.values)||{}:{},s=t.shouldUnregister?{}:U1(r),o={action:!1,mount:!1,watch:!1},u={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},d,f=0;const v={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},p={values:$6(),array:$6(),state:$6()},A=lA(t.mode),E=lA(t.reValidateMode),_=t.criteriaMode===Le.all,S=P=>Q=>{clearTimeout(f),f=setTimeout(P,Q)},z=async P=>{if(!t.disabled&&(v.isValid||P)){const Q=t.resolver?V1((await O()).errors):await U(n,!0);Q!==a.isValid&&p.state.next({isValid:Q})}},C=(P,Q)=>{!t.disabled&&(v.isValidating||v.validatingFields)&&((P||Array.from(u.mount)).forEach(r2=>{r2&&(Q?E0(a.validatingFields,r2,Q):e1(a.validatingFields,r2))}),p.state.next({validatingFields:a.validatingFields,isValidating:!V1(a.validatingFields)}))},M=(P,Q=[],r2,y2,N2=!0,_2=!0)=>{if(y2&&r2&&!t.disabled){if(o.action=!0,_2&&Array.isArray(I2(n,P))){const b2=r2(I2(n,P),y2.argA,y2.argB);N2&&E0(n,P,b2)}if(_2&&Array.isArray(I2(a.errors,P))){const b2=r2(I2(a.errors,P),y2.argA,y2.argB);N2&&E0(a.errors,P,b2),QF(a.errors,P)}if(v.touchedFields&&_2&&Array.isArray(I2(a.touchedFields,P))){const b2=r2(I2(a.touchedFields,P),y2.argA,y2.argB);N2&&E0(a.touchedFields,P,b2)}v.dirtyFields&&(a.dirtyFields=Fl(r,s)),p.state.next({name:P,isDirty:s2(P,Q),dirtyFields:a.dirtyFields,errors:a.errors,isValid:a.isValid})}else E0(s,P,Q)},x=(P,Q)=>{E0(a.errors,P,Q),p.state.next({errors:a.errors})},D=P=>{a.errors=P,p.state.next({errors:a.errors,isValid:!1})},w=(P,Q,r2,y2)=>{const N2=I2(n,P);if(N2){const _2=I2(s,P,K0(r2)?I2(r,P):r2);K0(_2)||y2&&y2.defaultChecked||Q?E0(s,P,Q?_2:Z6(N2._f)):a2(P,_2),o.mount&&z()}},b=(P,Q,r2,y2,N2)=>{let _2=!1,b2=!1;const n0={name:P};if(!t.disabled){const U0=!!(I2(n,P)&&I2(n,P)._f&&I2(n,P)._f.disabled);if(!r2||y2){v.isDirty&&(b2=a.isDirty,a.isDirty=n0.isDirty=s2(),_2=b2!==n0.isDirty);const V0=U0||yt(I2(r,P),Q);b2=!!(!U0&&I2(a.dirtyFields,P)),V0||U0?e1(a.dirtyFields,P):E0(a.dirtyFields,P,!0),n0.dirtyFields=a.dirtyFields,_2=_2||v.dirtyFields&&b2!==!V0}if(r2){const V0=I2(a.touchedFields,P);V0||(E0(a.touchedFields,P,r2),n0.touchedFields=a.touchedFields,_2=_2||v.touchedFields&&V0!==r2)}_2&&N2&&p.state.next(n0)}return _2?n0:{}},T=(P,Q,r2,y2)=>{const N2=I2(a.errors,P),_2=v.isValid&&Ne(Q)&&a.isValid!==Q;if(t.delayError&&r2?(d=S(()=>x(P,r2)),d(t.delayError)):(clearTimeout(f),d=null,r2?E0(a.errors,P,r2):e1(a.errors,P)),(r2?!yt(N2,r2):N2)||!V1(y2)||_2){const b2={...y2,..._2&&Ne(Q)?{isValid:Q}:{},errors:a.errors,name:P};a={...a,...b2},p.state.next(b2)}},O=async P=>{C(P,!0);const Q=await t.resolver(s,t.context,ZF(P||u.mount,n,t.criteriaMode,t.shouldUseNativeValidation));return C(P),Q},H=async P=>{const{errors:Q}=await O(P);if(P)for(const r2 of P){const y2=I2(Q,r2);y2?E0(a.errors,r2,y2):e1(a.errors,r2)}else a.errors=Q;return Q},U=async(P,Q,r2={valid:!0})=>{for(const y2 in P){const N2=P[y2];if(N2){const{_f:_2,...b2}=N2;if(_2){const n0=u.array.has(_2.name),U0=N2._f&&WF(N2._f);U0&&v.validatingFields&&C([y2],!0);const V0=await uA(N2,u.disabled,s,_,t.shouldUseNativeValidation&&!Q,n0);if(U0&&v.validatingFields&&C([y2]),V0[_2.name]&&(r2.valid=!1,Q))break;!Q&&(I2(V0,_2.name)?n0?jF(a.errors,V0,_2.name):E0(a.errors,_2.name,V0[_2.name]):e1(a.errors,_2.name))}!V1(b2)&&await U(b2,Q,r2)}}return r2.valid},f2=()=>{for(const P of u.unMount){const Q=I2(n,P);Q&&(Q._f.refs?Q._f.refs.every(r2=>!Y6(r2)):!Y6(Q._f.ref))&&g2(P)}u.unMount=new Set},s2=(P,Q)=>!t.disabled&&(P&&Q&&E0(s,P,Q),!yt(q(),r)),h2=(P,Q,r2)=>IS(P,u,{...o.mount?s:K0(Q)?r:e3(P)?{[P]:Q}:Q},r2,Q),W=P=>Lo(I2(o.mount?s:r,P,t.shouldUnregister?I2(r,P,[]):[])),a2=(P,Q,r2={})=>{const y2=I2(n,P);let N2=Q;if(y2){const _2=y2._f;_2&&(!_2.disabled&&E0(s,P,RS(Q,_2)),N2=kc(_2.ref)&&D1(Q)?"":Q,zS(_2.ref)?[..._2.ref.options].forEach(b2=>b2.selected=N2.includes(b2.value)):_2.refs?ni(_2.ref)?_2.refs.length>1?_2.refs.forEach(b2=>(!b2.defaultChecked||!b2.disabled)&&(b2.checked=Array.isArray(N2)?!!N2.find(n0=>n0===b2.value):N2===b2.value)):_2.refs[0]&&(_2.refs[0].checked=!!N2):_2.refs.forEach(b2=>b2.checked=b2.value===N2):jh(_2.ref)?_2.ref.value="":(_2.ref.value=N2,_2.ref.type||p.values.next({name:P,values:{...s}})))}(r2.shouldDirty||r2.shouldTouch)&&b(P,N2,r2.shouldTouch,r2.shouldDirty,!0),r2.shouldValidate&&F(P)},V=(P,Q,r2)=>{for(const y2 in Q){const N2=Q[y2],_2=`${P}.${y2}`,b2=I2(n,_2);(u.array.has(P)||$0(N2)||b2&&!b2._f)&&!Ma(N2)?V(_2,N2,r2):a2(_2,N2,r2)}},t2=(P,Q,r2={})=>{const y2=I2(n,P),N2=u.array.has(P),_2=U1(Q);E0(s,P,_2),N2?(p.array.next({name:P,values:{...s}}),(v.isDirty||v.dirtyFields)&&r2.shouldDirty&&p.state.next({name:P,dirtyFields:Fl(r,s),isDirty:s2(P,_2)})):y2&&!y2._f&&!D1(_2)?V(P,_2,r2):a2(P,_2,r2),rA(P,u)&&p.state.next({...a}),p.values.next({name:o.mount?P:void 0,values:{...s}})},J=async P=>{o.mount=!0;const Q=P.target;let r2=Q.name,y2=!0;const N2=I2(n,r2),_2=()=>Q.type?Z6(N2._f):mS(P),b2=n0=>{y2=Number.isNaN(n0)||Ma(n0)&&isNaN(n0.getTime())||yt(n0,I2(s,r2,n0))};if(N2){let n0,U0;const V0=_2(),$1=P.type===Tc.BLUR||P.type===Tc.FOCUS_OUT,vu=!qF(N2._f)&&!t.resolver&&!I2(a.errors,r2)&&!N2._f.deps||XF($1,I2(a.touchedFields,r2),a.isSubmitted,E,A),Xa=rA(r2,u,$1);E0(s,r2,V0),$1?(N2._f.onBlur&&N2._f.onBlur(P),d&&d(0)):N2._f.onChange&&N2._f.onChange(P);const O4=b(r2,V0,$1,!1),pu=!V1(O4)||Xa;if(!$1&&p.values.next({name:r2,type:P.type,values:{...s}}),vu)return v.isValid&&(t.mode==="onBlur"&&$1?z():$1||z()),pu&&p.state.next({name:r2,...Xa?{}:O4});if(!$1&&Xa&&p.state.next({...a}),t.resolver){const{errors:Y3}=await O([r2]);if(b2(V0),y2){const b1=dA(a.errors,n,r2),Ii=dA(Y3,n,b1.name||r2);n0=Ii.error,r2=Ii.name,U0=V1(Y3)}}else C([r2],!0),n0=(await uA(N2,u.disabled,s,_,t.shouldUseNativeValidation))[r2],C([r2]),b2(V0),y2&&(n0?U0=!1:v.isValid&&(U0=await U(n,!0)));y2&&(N2._f.deps&&F(N2._f.deps),T(r2,U0,n0,O4))}},v2=(P,Q)=>{if(I2(a.errors,Q)&&P.focus)return P.focus(),1},F=async(P,Q={})=>{let r2,y2;const N2=nr(P);if(t.resolver){const _2=await H(K0(P)?P:N2);r2=V1(_2),y2=P?!N2.some(b2=>I2(_2,b2)):r2}else P?(y2=(await Promise.all(N2.map(async _2=>{const b2=I2(n,_2);return await U(b2&&b2._f?{[_2]:b2}:b2)}))).every(Boolean),!(!y2&&!a.isValid)&&z()):y2=r2=await U(n);return p.state.next({...!e3(P)||v.isValid&&r2!==a.isValid?{}:{name:P},...t.resolver||!P?{isValid:r2}:{},errors:a.errors}),Q.shouldFocus&&!y2&&lr(n,v2,P?N2:u.mount),y2},q=P=>{const Q={...o.mount?s:r};return K0(P)?Q:e3(P)?I2(Q,P):P.map(r2=>I2(Q,r2))},K=(P,Q)=>({invalid:!!I2((Q||a).errors,P),isDirty:!!I2((Q||a).dirtyFields,P),error:I2((Q||a).errors,P),isValidating:!!I2(a.validatingFields,P),isTouched:!!I2((Q||a).touchedFields,P)}),l2=P=>{P&&nr(P).forEach(Q=>e1(a.errors,Q)),p.state.next({errors:P?a.errors:{}})},n2=(P,Q,r2)=>{const y2=(I2(n,P,{_f:{}})._f||{}).ref,N2=I2(a.errors,P)||{},{ref:_2,message:b2,type:n0,...U0}=N2;E0(a.errors,P,{...U0,...Q,ref:y2}),p.state.next({name:P,errors:a.errors,isValid:!1}),r2&&r2.shouldFocus&&y2&&y2.focus&&y2.focus()},d2=(P,Q)=>Je(P)?p.values.subscribe({next:r2=>P(h2(void 0,Q),r2)}):h2(P,Q,!0),g2=(P,Q={})=>{for(const r2 of P?nr(P):u.mount)u.mount.delete(r2),u.array.delete(r2),Q.keepValue||(e1(n,r2),e1(s,r2)),!Q.keepError&&e1(a.errors,r2),!Q.keepDirty&&e1(a.dirtyFields,r2),!Q.keepTouched&&e1(a.touchedFields,r2),!Q.keepIsValidating&&e1(a.validatingFields,r2),!t.shouldUnregister&&!Q.keepDefaultValue&&e1(r,r2);p.values.next({values:{...s}}),p.state.next({...a,...Q.keepDirty?{isDirty:s2()}:{}}),!Q.keepIsValid&&z()},A2=({disabled:P,name:Q,field:r2,fields:y2})=>{(Ne(P)&&o.mount||P||u.disabled.has(Q))&&(P?u.disabled.add(Q):u.disabled.delete(Q),b(Q,Z6(r2?r2._f:I2(y2,Q)._f),!1,!1,!0))},z2=(P,Q={})=>{let r2=I2(n,P);const y2=Ne(Q.disabled)||Ne(t.disabled);return E0(n,P,{...r2||{},_f:{...r2&&r2._f?r2._f:{ref:{name:P}},name:P,mount:!0,...Q}}),u.mount.add(P),r2?A2({field:r2,disabled:Ne(Q.disabled)?Q.disabled:t.disabled,name:P}):w(P,!0,Q.value),{...y2?{disabled:Q.disabled||t.disabled}:{},...t.progressive?{required:!!Q.required,min:Hl(Q.min),max:Hl(Q.max),minLength:Hl(Q.minLength),maxLength:Hl(Q.maxLength),pattern:Hl(Q.pattern)}:{},name:P,onChange:J,onBlur:J,ref:N2=>{if(N2){z2(P,Q),r2=I2(n,P);const _2=K0(N2.value)&&N2.querySelectorAll&&N2.querySelectorAll("input,select,textarea")[0]||N2,b2=YF(_2),n0=r2._f.refs||[];if(b2?n0.find(U0=>U0===_2):_2===r2._f.ref)return;E0(n,P,{_f:{...r2._f,...b2?{refs:[...n0.filter(Y6),_2,...Array.isArray(I2(r,P))?[{}]:[]],ref:{type:_2.type,name:P}}:{ref:_2}}}),w(P,!1,void 0,_2)}else r2=I2(n,P,{}),r2._f&&(r2._f.mount=!1),(t.shouldUnregister||Q.shouldUnregister)&&!(vS(u.array,P)&&o.action)&&u.unMount.add(P)}}},Y2=()=>t.shouldFocusError&&lr(n,v2,u.mount),L2=P=>{Ne(P)&&(p.state.next({disabled:P}),lr(n,(Q,r2)=>{const y2=I2(n,r2);y2&&(Q.disabled=y2._f.disabled||P,Array.isArray(y2._f.refs)&&y2._f.refs.forEach(N2=>{N2.disabled=y2._f.disabled||P}))},0,!1))},J2=(P,Q)=>async r2=>{let y2;r2&&(r2.preventDefault&&r2.preventDefault(),r2.persist&&r2.persist());let N2=U1(s);if(u.disabled.size)for(const _2 of u.disabled)E0(N2,_2,void 0);if(p.state.next({isSubmitting:!0}),t.resolver){const{errors:_2,values:b2}=await O();a.errors=_2,N2=b2}else await U(n);if(e1(a.errors,"root"),V1(a.errors)){p.state.next({errors:{}});try{await P(N2,r2)}catch(_2){y2=_2}}else Q&&await Q({...a.errors},r2),Y2(),setTimeout(Y2);if(p.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:V1(a.errors)&&!y2,submitCount:a.submitCount+1,errors:a.errors}),y2)throw y2},u0=(P,Q={})=>{I2(n,P)&&(K0(Q.defaultValue)?t2(P,U1(I2(r,P))):(t2(P,Q.defaultValue),E0(r,P,U1(Q.defaultValue))),Q.keepTouched||e1(a.touchedFields,P),Q.keepDirty||(e1(a.dirtyFields,P),a.isDirty=Q.defaultValue?s2(P,U1(I2(r,P))):s2()),Q.keepError||(e1(a.errors,P),v.isValid&&z()),p.state.next({...a}))},M0=(P,Q={})=>{const r2=P?U1(P):r,y2=U1(r2),N2=V1(P),_2=N2?r:y2;if(Q.keepDefaultValues||(r=r2),!Q.keepValues){if(Q.keepDirtyValues){const b2=new Set([...u.mount,...Object.keys(Fl(r,s))]);for(const n0 of Array.from(b2))I2(a.dirtyFields,n0)?E0(_2,n0,I2(s,n0)):t2(n0,I2(_2,n0))}else{if(Uh&&K0(P))for(const b2 of u.mount){const n0=I2(n,b2);if(n0&&n0._f){const U0=Array.isArray(n0._f.refs)?n0._f.refs[0]:n0._f.ref;if(kc(U0)){const V0=U0.closest("form");if(V0){V0.reset();break}}}}n={}}s=t.shouldUnregister?Q.keepDefaultValues?U1(r):{}:U1(_2),p.array.next({values:{..._2}}),p.values.next({values:{..._2}})}u={mount:Q.keepDirtyValues?u.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},o.mount=!v.isValid||!!Q.keepIsValid||!!Q.keepDirtyValues,o.watch=!!t.shouldUnregister,p.state.next({submitCount:Q.keepSubmitCount?a.submitCount:0,isDirty:N2?!1:Q.keepDirty?a.isDirty:!!(Q.keepDefaultValues&&!yt(P,r)),isSubmitted:Q.keepIsSubmitted?a.isSubmitted:!1,dirtyFields:N2?{}:Q.keepDirtyValues?Q.keepDefaultValues&&s?Fl(r,s):a.dirtyFields:Q.keepDefaultValues&&P?Fl(r,P):Q.keepDirty?a.dirtyFields:{},touchedFields:Q.keepTouched?a.touchedFields:{},errors:Q.keepErrors?a.errors:{},isSubmitSuccessful:Q.keepIsSubmitSuccessful?a.isSubmitSuccessful:!1,isSubmitting:!1})},l1=(P,Q)=>M0(Je(P)?P(s):P,Q);return{control:{register:z2,unregister:g2,getFieldState:K,handleSubmit:J2,setError:n2,_executeSchema:O,_getWatch:h2,_getDirty:s2,_updateValid:z,_removeUnmounted:f2,_updateFieldArray:M,_updateDisabledField:A2,_getFieldArray:W,_reset:M0,_resetDefaultValues:()=>Je(t.defaultValues)&&t.defaultValues().then(P=>{l1(P,t.resetOptions),p.state.next({isLoading:!1})}),_updateFormState:P=>{a={...a,...P}},_disableForm:L2,_subjects:p,_proxyFormState:v,_setErrors:D,get _fields(){return n},get _formValues(){return s},get _state(){return o},set _state(P){o=P},get _defaultValues(){return r},get _names(){return u},set _names(P){u=P},get _formState(){return a},set _formState(P){a=P},get _options(){return t},set _options(P){t={...t,...P}}},trigger:F,register:z2,handleSubmit:J2,watch:d2,setValue:t2,getValues:q,reset:l1,resetField:u0,clearErrors:l2,unregister:g2,setError:n2,setFocus:(P,Q={})=>{const r2=I2(n,P),y2=r2&&r2._f;if(y2){const N2=y2.refs?y2.refs[0]:y2.ref;N2.focus&&(N2.focus(),Q.shouldSelect&&Je(N2.select)&&N2.select())}},getFieldState:K}}function tH(e={}){const t=X2.useRef(void 0),a=X2.useRef(void 0),[n,r]=X2.useState({isDirty:!1,isValidating:!1,isLoading:Je(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:Je(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...eH(e),formState:n});const s=t.current.control;return s._options=e,Gh({subject:s._subjects.state,next:o=>{ES(o,s._proxyFormState,s._updateFormState,!0)&&r({...s._formState})}}),X2.useEffect(()=>s._disableForm(e.disabled),[s,e.disabled]),X2.useEffect(()=>{if(s._proxyFormState.isDirty){const o=s._getDirty();o!==n.isDirty&&s._subjects.state.next({isDirty:o})}},[s,n.isDirty]),X2.useEffect(()=>{e.values&&!yt(e.values,a.current)?(s._reset(e.values,s._options.resetOptions),a.current=e.values,r(o=>({...o}))):s._resetDefaultValues()},[e.values,s]),X2.useEffect(()=>{e.errors&&s._setErrors(e.errors)},[e.errors,s]),X2.useEffect(()=>{s._state.mount||(s._updateValid(),s._state.mount=!0),s._state.watch&&(s._state.watch=!1,s._subjects.state.next({...s._formState})),s._removeUnmounted()}),X2.useEffect(()=>{e.shouldUnregister&&s._subjects.values.next({values:s._getWatch()})},[e.shouldUnregister,s]),t.current.formState=gS(n,s),t.current}const fA=(e,t,a)=>{if(e&&"reportValidity"in e){const n=I2(a,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},xS=(e,t)=>{for(const a in t.fields){const n=t.fields[a];n&&n.ref&&"reportValidity"in n.ref?fA(n.ref,a,e):n.refs&&n.refs.forEach(r=>fA(r,a,e))}},aH=(e,t)=>{t.shouldUseNativeValidation&&xS(e,t);const a={};for(const n in e){const r=I2(t.fields,n),s=Object.assign(e[n]||{},{ref:r&&r.ref});if(nH(t.names||Object.keys(e),n)){const o=Object.assign({},I2(a,n));E0(o,"root",s),E0(a,n,o)}else E0(a,n,s)}return a},nH=(e,t)=>e.some(a=>a.startsWith(t+".")),lH=e=>{const t=y.useId(),a=y.useMemo(()=>({id:t}),[t]);return I.jsx(wS,{value:a,children:I.jsx("div",{className:"flex flex-col gap-2 p-2",...e})})},wS=y.createContext({}),bS=y.createContext({}),rH=({...e})=>{const t=y.useMemo(()=>({name:e.name}),[e.name]);return I.jsx(bS,{value:t,children:I.jsx(GF,{...e})})},Vt=()=>{const e=y.useContext(bS),t=y.useContext(wS),{getFieldState:a,formState:n}=Ut(),r=a(e.name,n);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:s}=t;return{id:s,name:e.name,formItemId:`${s}-form-item`,formDescriptionId:`${s}-form-item-description`,formMessageId:`${s}-form-item-message`,...r}},TS=Me("",{variants:{variant:{default:["w-full select-text resize-none rounded-xl border-2 bg-input-background text-base md:text-sm text-input-text shadow-none outline-0 transition-all","border-input-border hover:border-input-border-hover focus:border-input-border-focus focus:outline-0 focus:[box-shadow:none]","aria-[invalid=true]:border-error","disabled:opacity-50"],invisible:["w-full border-none bg-inherit text-inherit outline-hidden ring-0"]},size:{md:"px-2 md:py-1 py-3",lg:"p-4 md:py-2"},validationStyleEnabled:{disabled:"",enabled:"valid:border-success invalid:border-error"}},defaultVariants:{variant:"default",size:"md",validationStyleEnabled:"disabled"}}),N4=({validationStyleEnabled:e=!1,variant:t,size:a,className:n,...r})=>I.jsx("input",{className:TS({variant:t,size:a,validationStyleEnabled:e?"enabled":"disabled",className:n}),...r}),iH=Me("",{variants:{variant:{default:["pointer rounded border-2 bg-input-background text-input-text shadow-none outline-0 transition-all","border-input-border hover:border-input-border-hover focus:border-input-border-focus focus:outline-0 focus:[box-shadow:none]","checked:bg-checkbox-checked checked:border-checkbox-checked-border","disabled:opacity-50"]},size:{sm:"size-4",md:"size-5",lg:"size-6"},color:{primary:"accent-primary",secondary:"accent-secondary",destructive:"accent-destructive",neutral:"accent-neutral",light:"accent-light",text:"accent-text",dark:"accent-dark",error:"accent-error",success:"accent-success",custom:"accent-custom"},validationStyleEnabled:{disabled:"",enabled:"valid:border-success invalid:border-error"}},defaultVariants:{variant:"default",color:"primary",validationStyleEnabled:"disabled",size:"md"}}),sH=({validationStyleEnabled:e=!1,label:t,size:a,color:n,variant:r,className:s,...o})=>{const u=y.useId();return I.jsxs(I.Fragment,{children:[I.jsx("input",{type:"checkbox",className:iH({variant:r,size:a,color:n,validationStyleEnabled:e?"enabled":"disabled",className:s}),id:u,...o}),I.jsx("label",{htmlFor:u,children:t})]})},cH=e=>{const[t,a]=y.useState(!1),n=s=>{s.preventDefault(),s.stopPropagation(),a(o=>!o)},r=t?_L:gL;return I.jsxs("div",{className:"relative",children:[I.jsx(N4,{...e,type:t?"text":"password"}),I.jsx("button",{"data-testid":"eye-icon",className:"absolute right-2 h-full flex-row items-center",onClick:n,"aria-label":t?"Hide password":"Show password",children:I.jsx(r,{className:"text-neutral mr-2 inline-block",size:20})})]})},kS=({className:e,variant:t,validationStyleEnabled:a=!1,...n})=>I.jsx("textarea",{className:C2("resize-none",TS({variant:t,validationStyleEnabled:a?"enabled":"disabled",className:e})),...n}),DS=({value:e="",onCancel:t,onSave:a,onClick:n,children:r,isDisabled:s,...o})=>{const[u,d]=y.useState(!1),f=y.useRef(null),v=_=>{_.stopPropagation(),d(!1),a()},p=_=>{_.stopPropagation(),d(!1),t()},A=!e||e===""?"-":e,E=y.useCallback(_=>{const S=window.getSelection();S&&S.toString().trim()!==""||f.current&&!f.current.contains(_.target)&&(d(!1),a())},[a]);return y.useEffect(()=>(u?document.addEventListener("click",E):document.removeEventListener("click",E),()=>document.removeEventListener("click",E)),[E,u]),I.jsxs("span",{className:"group/editable-field flex gap-2",role:"button",tabIndex:0,onClick:_=>{d(!0),n==null||n(_)},ref:f,...o,children:[I.jsxs("div",{className:C2("flex flex-1 gap-2",u?"display":"hidden"),children:[r,I.jsx(_0,{label:"Save",variant:"hoverable",size:"icon-sm",color:"text",Icon:I4,onClick:v,disabled:s,className:"!text-current"}),I.jsx(_0,{label:"Cancel",color:"text",variant:"hoverable",className:"!text-current",size:"icon-sm",Icon:Ya,onClick:p,disabled:s})]},String(u)),I.jsxs("div",{className:C2("flex flex-1 gap-2",u?"hidden":"display"),children:[I.jsx("span",{className:"ml-2 flex w-full whitespace-pre-wrap p-1 text-sm leading-6",children:A}),I.jsx(_0,{label:"Edit",Icon:xN,color:"text",variant:"hoverable",size:"icon-sm",className:"invisible !text-current group-hover/editable-field:visible",disabled:s,onClick:_=>{_.stopPropagation(),d(!0)}})]})]})},BS=({onSave:e,onCancel:t,ref:a,...n})=>{var d;const r=y.useRef(null),s=()=>{var f;e==null||e(((f=r.current)==null?void 0:f.value)??"")},o=()=>{r.current&&(r.current.value=r.current.defaultValue??""),t==null||t()};y.useImperativeHandle(a,()=>r.current);const u=y.useMemo(()=>{var f;return n.value??((f=r.current)==null?void 0:f.value)??n.defaultValue},[n.value,n.defaultValue,(d=r.current)==null?void 0:d.value]);return I.jsx(DS,{value:u,onCancel:o,onSave:s,children:I.jsx(N4,{ref:r,...n})})},mA=24,vA=12,$h=({className:e,autoSize:t=!0,onChange:a,maxRows:n=999,ref:r,...s})=>{const o=y.useRef(null);y.useImperativeHandle(r,()=>o.current);const u=y.useCallback(()=>{const v=o.current;if(!v||!t)return;const p=v.style;p.height="auto";const A=v.scrollHeight,E=mA*n+vA,_=mA+vA;p.height=Math.max(Math.min(A,E),_)+"px"},[t,n]);y.useEffect(()=>{u()},[s.value,s.defaultValue,u]);const d=v=>{a==null||a(v),u()},f=y.useCallback(v=>{o.current=v,v&&u()},[u]);return I.jsx(kS,{ref:f,onChange:d,className:C2("overflow-y-scroll",t?"resize-none":"",e),...s})},LS=({onSave:e,onCancel:t,ref:a,...n})=>{var d;const r=y.useRef(null);y.useImperativeHandle(a,()=>r.current);const s=()=>{var f;e==null||e(((f=r.current)==null?void 0:f.value)??"")},o=()=>{r.current&&(r.current.value=r.current.defaultValue??""),t==null||t()},u=n.value??((d=r.current)==null?void 0:d.value)??n.defaultValue??"";return I.jsx(DS,{value:u,onCancel:o,onSave:s,onClick:f=>{f.preventDefault(),f.stopPropagation()},children:I.jsx($h,{className:"leading-6",ref:r,onClick:f=>{f.preventDefault(),f.stopPropagation()},...n})})},oH=Me("focus:ring-ring inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-hidden focus:ring-2 focus:ring-offset-2",{variants:{color:{primary:"border-primary bg-primary text-primary hover:bg-primary-500",secondary:"border-secondary bg-secondary text-secondary hover:bg-secondary-300",destructive:"border-destructive bg-destructive text-destructive hover:bg-destructive-500",neutral:"border-neutral bg-neutral text-neutral hover:bg-neutral-600",light:"border-white bg-white text-white hover:bg-neutral-500",dark:"border-neutral-800 bg-neutral-800 text-neutral-800 hover:bg-neutral-900",text:"border-text bg-text text-text hover:opacity-80",custom:""},variant:{default:"rounded-lg text-text-opposite",none:"border-none bg-opacity-0 text-inherit hover:bg-opacity-0",outline:"rounded-lg border-[1.5px] bg-opacity-0 hover:bg-opacity-30",hoverable:"rounded-lg border-none bg-opacity-0 transition hover:bg-opacity-10"}},defaultVariants:{variant:"default",color:"primary"}}),uH=({className:e,variant:t,color:a,...n})=>I.jsx("div",{className:C2(oH({variant:t,color:a}),e),...n});var hH=$b.useId||(()=>{}),dH=0;function Ce(e){const[t,a]=y.useState(hH());return x1(()=>{a(n=>n??String(dH++))},[e]),t?`radix-${t}`:""}var W6="focusScope.autoFocusOnMount",q6="focusScope.autoFocusOnUnmount",pA={bubbles:!1,cancelable:!0},fH="FocusScope",Yh=y.forwardRef((e,t)=>{const{loop:a=!1,trapped:n=!1,onMountAutoFocus:r,onUnmountAutoFocus:s,...o}=e,[u,d]=y.useState(null),f=re(r),v=re(s),p=y.useRef(null),A=B0(t,S=>d(S)),E=y.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;y.useEffect(()=>{if(n){let S=function(x){if(E.paused||!u)return;const D=x.target;u.contains(D)?p.current=D:It(p.current,{select:!0})},z=function(x){if(E.paused||!u)return;const D=x.relatedTarget;D!==null&&(u.contains(D)||It(p.current,{select:!0}))},C=function(x){if(document.activeElement===document.body)for(const w of x)w.removedNodes.length>0&&It(u)};document.addEventListener("focusin",S),document.addEventListener("focusout",z);const M=new MutationObserver(C);return u&&M.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",S),document.removeEventListener("focusout",z),M.disconnect()}}},[n,u,E.paused]),y.useEffect(()=>{if(u){gA.add(E);const S=document.activeElement;if(!u.contains(S)){const C=new CustomEvent(W6,pA);u.addEventListener(W6,f),u.dispatchEvent(C),C.defaultPrevented||(mH(EH(OS(u)),{select:!0}),document.activeElement===S&&It(u))}return()=>{u.removeEventListener(W6,f),setTimeout(()=>{const C=new CustomEvent(q6,pA);u.addEventListener(q6,v),u.dispatchEvent(C),C.defaultPrevented||It(S??document.body,{select:!0}),u.removeEventListener(q6,v),gA.remove(E)},0)}}},[u,f,v,E]);const _=y.useCallback(S=>{if(!a&&!n||E.paused)return;const z=S.key==="Tab"&&!S.altKey&&!S.ctrlKey&&!S.metaKey,C=document.activeElement;if(z&&C){const M=S.currentTarget,[x,D]=vH(M);x&&D?!S.shiftKey&&C===D?(S.preventDefault(),a&&It(x,{select:!0})):S.shiftKey&&C===x&&(S.preventDefault(),a&&It(D,{select:!0})):C===M&&S.preventDefault()}},[a,n,E.paused]);return I.jsx(i0.div,{tabIndex:-1,...o,ref:A,onKeyDown:_})});Yh.displayName=fH;function mH(e,{select:t=!1}={}){const a=document.activeElement;for(const n of e)if(It(n,{select:t}),document.activeElement!==a)return}function vH(e){const t=OS(e),a=AA(t,e),n=AA(t.reverse(),e);return[a,n]}function OS(e){const t=[],a=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const r=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||r?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;a.nextNode();)t.push(a.currentNode);return t}function AA(e,t){for(const a of e)if(!pH(a,{upTo:t}))return a}function pH(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function AH(e){return e instanceof HTMLInputElement&&"select"in e}function It(e,{select:t=!1}={}){if(e&&e.focus){const a=document.activeElement;e.focus({preventScroll:!0}),e!==a&&AH(e)&&t&&e.select()}}var gA=gH();function gH(){let e=[];return{add(t){const a=e[0];t!==a&&(a==null||a.pause()),e=EA(e,t),e.unshift(t)},remove(t){var a;e=EA(e,t),(a=e[0])==null||a.resume()}}}function EA(e,t){const a=[...e],n=a.indexOf(t);return n!==-1&&a.splice(n,1),a}function EH(e){return e.filter(t=>t.tagName!=="A")}var X6=0;function FS(){y.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??_A()),document.body.insertAdjacentElement("beforeend",e[1]??_A()),X6++,()=>{X6===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),X6--}},[])}function _A(){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 _c="right-scroll-bar-position",Ic="width-before-scroll-bar",_H="with-scroll-bars-hidden",IH="--removed-body-scroll-bar-size";function Q6(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function NH(e,t){var a=y.useState(function(){return{value:e,callback:t,facade:{get current(){return a.value},set current(n){var r=a.value;r!==n&&(a.value=n,a.callback(n,r))}}}})[0];return a.callback=t,a.facade}var SH=typeof window<"u"?y.useLayoutEffect:y.useEffect,IA=new WeakMap;function yH(e,t){var a=NH(null,function(n){return e.forEach(function(r){return Q6(r,n)})});return SH(function(){var n=IA.get(a);if(n){var r=new Set(n),s=new Set(e),o=a.current;r.forEach(function(u){s.has(u)||Q6(u,null)}),s.forEach(function(u){r.has(u)||Q6(u,o)})}IA.set(a,e)},[e]),a}function zH(e){return e}function CH(e,t){t===void 0&&(t=zH);var a=[],n=!1,r={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return a.length?a[a.length-1]:e},useMedium:function(s){var o=t(s,n);return a.push(o),function(){a=a.filter(function(u){return u!==o})}},assignSyncMedium:function(s){for(n=!0;a.length;){var o=a;a=[],o.forEach(s)}a={push:function(u){return s(u)},filter:function(){return a}}},assignMedium:function(s){n=!0;var o=[];if(a.length){var u=a;a=[],u.forEach(s),o=a}var d=function(){var v=o;o=[],v.forEach(s)},f=function(){return Promise.resolve().then(d)};f(),a={push:function(v){o.push(v),f()},filter:function(v){return o=o.filter(v),a}}}};return r}function MH(e){e===void 0&&(e={});var t=CH(null);return t.options=Qe({async:!0,ssr:!1},e),t}var HS=function(e){var t=e.sideCar,a=PI(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return y.createElement(n,Qe({},a))};HS.isSideCarExport=!0;function RH(e,t){return e.useMedium(t),HS}var PS=MH(),J6=function(){},Oo=y.forwardRef(function(e,t){var a=y.useRef(null),n=y.useState({onScrollCapture:J6,onWheelCapture:J6,onTouchMoveCapture:J6}),r=n[0],s=n[1],o=e.forwardProps,u=e.children,d=e.className,f=e.removeScrollBar,v=e.enabled,p=e.shards,A=e.sideCar,E=e.noIsolation,_=e.inert,S=e.allowPinchZoom,z=e.as,C=z===void 0?"div":z,M=e.gapMode,x=PI(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),D=A,w=yH([a,t]),b=Qe(Qe({},x),r);return y.createElement(y.Fragment,null,v&&y.createElement(D,{sideCar:PS,removeScrollBar:f,shards:p,noIsolation:E,inert:_,setCallbacks:s,allowPinchZoom:!!S,lockRef:a,gapMode:M}),o?y.cloneElement(y.Children.only(u),Qe(Qe({},b),{ref:w})):y.createElement(C,Qe({},b,{className:d,ref:w}),u))});Oo.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Oo.classNames={fullWidth:Ic,zeroRight:_c};var xH=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function wH(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=xH();return t&&e.setAttribute("nonce",t),e}function bH(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function TH(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var kH=function(){var e=0,t=null;return{add:function(a){e==0&&(t=wH())&&(bH(t,a),TH(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},DH=function(){var e=kH();return function(t,a){y.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&a])}},US=function(){var e=DH(),t=function(a){var n=a.styles,r=a.dynamic;return e(n,r),null};return t},BH={left:0,top:0,right:0,gap:0},e7=function(e){return parseInt(e||"",10)||0},LH=function(e){var t=window.getComputedStyle(document.body),a=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],r=t[e==="padding"?"paddingRight":"marginRight"];return[e7(a),e7(n),e7(r)]},OH=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return BH;var t=LH(e),a=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-a+t[2]-t[0])}},FH=US(),Jn="data-scroll-locked",HH=function(e,t,a,n){var r=e.left,s=e.top,o=e.right,u=e.gap;return a===void 0&&(a="margin"),`
223
+ */var Gp;function HL(){if(Gp)return O6;Gp=1;var e=$r(),t=TN();function a(f,v){return f===v&&(f!==0||1/f===1/v)||f!==f&&v!==v}var n=typeof Object.is=="function"?Object.is:a,r=t.useSyncExternalStore,s=e.useRef,o=e.useEffect,u=e.useMemo,d=e.useDebugValue;return O6.useSyncExternalStoreWithSelector=function(f,v,p,A,E){var _=s(null);if(_.current===null){var S={hasValue:!1,value:null};_.current=S}else S=_.current;_=u(function(){function C(b){if(!M){if(M=!0,x=b,b=A(b),E!==void 0&&S.hasValue){var T=S.value;if(E(T,b))return D=T}return D=b}if(T=D,n(x,b))return T;var O=A(b);return E!==void 0&&E(T,O)?(x=b,T):(x=b,D=O)}var M=!1,x,D,w=p===void 0?null:p;return[function(){return C(v())},w===null?void 0:function(){return C(w())}]},[v,p,A,E]);var z=r(f,_[0],_[1]);return o(function(){S.hasValue=!0,S.value=z},[z]),d(z),z},O6}var jp;function PL(){return jp||(jp=1,L6.exports=HL()),L6.exports}var UL=PL();const VL=So(UL),kN={},{useDebugValue:GL}=X2,{useSyncExternalStoreWithSelector:jL}=VL;let Kp=!1;const KL=e=>e;function $L(e,t=KL,a){(kN?"production":void 0)!=="production"&&a&&!Kp&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),Kp=!0);const n=jL(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,a);return GL(n),n}const $p=e=>{(kN?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?OL(e):e,a=(n,r)=>$L(t,n,r);return Object.assign(a,t),a},DN=e=>e?$p(e):$p,YL=DN((e,t)=>({scrollBlockers:[],addBlockage:(a,n)=>e(r=>{const s=r.scrollBlockers,o=s.find(u=>u.element===n);if(o){const d=o.blockers.includes(a)?o.blockers:[...o.blockers,a];return{scrollBlockers:s.map(f=>f.element===n?{...f,blockers:d}:f)}}return n.style.overflowY="hidden",n.style.overflowX="hidden",{scrollBlockers:[...s,{element:n,blockers:[a]}]}}),removeBlockage:(a,n)=>e(r=>{const s=r.scrollBlockers,o=s.find(u=>u.element===n);return o?o.blockers.length>1?{scrollBlockers:s.map(u=>u.element===n?{...u,blockers:u.blockers.filter(d=>d!==a)}:u)}:(n.style.overflowY="auto",{scrollBlockers:s.filter(u=>u.element!==n)}):{scrollBlockers:s}}),isElementScrollBlocked:a=>t().scrollBlockers.some(n=>n.element===a)}));function ZL(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[n,r]of e)if(!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}const a=Object.keys(e);if(a.length!==Object.keys(t).length)return!1;for(const n of a)if(!Object.prototype.hasOwnProperty.call(t,n)||!Object.is(e[n],t[n]))return!1;return!0}const{useRef:WL}=X2;function BN(e){const t=WL();return a=>{const n=e(a);return ZL(t.current,n)?t.current:t.current=n}}const LN=e=>{const{disableScroll:t=!1,element:a,key:n="unnamed_blocker"}=e??{},{isElementScrollBlocked:r,addBlockage:s,removeBlockage:o}=YL(BN(f=>({isElementScrollBlocked:f.isElementScrollBlocked,addBlockage:f.addBlockage,removeBlockage:f.removeBlockage}))),u=bN(a);return y.useEffect(()=>{const f=a??window.document.body;t?s(n,f):o(n,f)},[s,t,a,n,o]),{isScrollBlocked:u?r(u):!1}},qL=e=>{switch(e){case"sm":return 640;case"md":return 768;case"lg":return 1024;case"xl":return 1280;case"2xl":return 1536;default:return e}},XL=()=>{var t;if(typeof window>"u")return;const e=(t=window.navigator)==null?void 0:t.userAgent;if(!(typeof e>"u"))return/android|bb\d+|meego|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(?:hone|od|ad)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(?:ob|in)i|palm(?: os)?|phone|p(?:ixi|re)\/|plucker|pocket|psp|series(?:4|6)0|symbian|treo|up\.(?:browser|link)|vodafone|wap|windows ce|windows phone|xda|xiino|zte-/i.test(e)},QL=e=>{if(!(typeof window>"u"))return((window==null?void 0:window.innerWidth)??0)<=e},Yp=e=>{const t=qL(e),a=XL(),n=QL(t);return{isMobileScreen:n,isMobileUserAgent:a,isMobile:n??a}},JL=(e="md")=>{const[t,a]=y.useState(Yp(e));return y.useEffect(()=>{const n=()=>{a(Yp(e))};return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[e]),t},eO=e=>{const t=e.getBoundingClientRect(),a=t.top,n=t.bottom;if(a>=0&&n<=window.innerHeight){const s=t.left+t.width/2,o=t.top+10,u=document.elementFromPoint(s,o);return e===u||e.contains(u)}return!1},Zp=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Wp=Mo,Me=(e,t)=>a=>{var n;if((t==null?void 0:t.variants)==null)return Wp(e,a==null?void 0:a.class,a==null?void 0:a.className);const{variants:r,defaultVariants:s}=t,o=Object.keys(r).map(f=>{const v=a==null?void 0:a[f],p=s==null?void 0:s[f];if(v===null)return null;const A=Zp(v)||Zp(p);return r[f][A]}),u=a&&Object.entries(a).reduce((f,v)=>{let[p,A]=v;return A===void 0||(f[p]=A),f},{}),d=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((f,v)=>{let{class:p,className:A,...E}=v;return Object.entries(E).every(_=>{let[S,z]=_;return Array.isArray(z)?z.includes({...s,...u}[S]):{...s,...u}[S]===z})?[...f,p,A]:f},[]);return Wp(e,o,d,a==null?void 0:a.class,a==null?void 0:a.className)},tO=({className:e,strokeWidth:t=4})=>I.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"44",height:"44",viewBox:"0 0 44 44",stroke:"currentColor",className:C2("size-full",e),children:I.jsxs("g",{fill:"none",fillRule:"evenodd",strokeWidth:t,children:[I.jsxs("circle",{cx:"22",cy:"22",r:"1",children:[I.jsx("animate",{attributeName:"r",begin:"0s",dur:"1.8s",values:"1; 20",calcMode:"spline",keyTimes:"0; 1",keySplines:"0.165, 0.84, 0.44, 1",repeatCount:"indefinite"}),I.jsx("animate",{attributeName:"stroke-opacity",begin:"0s",dur:"1.8s",values:"1; 0",calcMode:"spline",keyTimes:"0; 1",keySplines:"0.3, 0.61, 0.355, 1",repeatCount:"indefinite"})]}),I.jsxs("circle",{cx:"22",cy:"22",r:"1",children:[I.jsx("animate",{attributeName:"r",begin:"-0.9s",dur:"1.8s",values:"1; 20",calcMode:"spline",keyTimes:"0; 1",keySplines:"0.165, 0.84, 0.44, 1",repeatCount:"indefinite"}),I.jsx("animate",{attributeName:"stroke-opacity",begin:"-0.9s",dur:"1.8s",values:"1; 0",calcMode:"spline",keyTimes:"0; 1",keySplines:"0.3, 0.61, 0.355, 1",repeatCount:"indefinite"})]})]})}),i4=({children:e,isLoading:t=!0,className:a,...n})=>I.jsx(I.Fragment,{children:t?I.jsx("div",{className:C2("flex size-full max-h-screen max-w-[100vw] flex-1 items-center justify-center",a),role:"status","aria-label":"Animated icon, meaning that the website is processing",...n,children:I.jsx(tO,{className:"size-10 max-h-full max-w-full"})}):e??I.jsx(I.Fragment,{})}),P6=Me("",{variants:{size:{sm:"size-3 absolute top-1/2 -translate-y-1/2",md:"size-4 absolute top-1/2 -translate-y-1/2",lg:"size-5 absolute top-1/2 -translate-y-1/2",xl:"size-6 absolute top-1/2 -translate-y-1/2","icon-sm":"size-3","icon-md":"size-4","icon-lg":"size-5","icon-xl":"size-6"},position:{left:"left-3",right:"right-3"}},defaultVariants:{size:"md"}}),aO=Me("relative cursor-pointer truncate whitespace-nowrap font-medium transition focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50",{variants:{size:{sm:"min-h-7 px-3 max-md:py-1 text-xs",md:"min-h-8 px-6 max-md:py-2 text-sm",lg:"min-h-10 px-8 max-md:py-3 text-lg",xl:"min-h-11 px-10 max-md:py-4 text-xl","icon-sm":"p-1.5","icon-md":"p-1.5","icon-lg":"p-2","icon-xl":"p-3"},color:{primary:"text-primary *:text-text-light",secondary:"text-secondary *:text-text-light",destructive:"text-destructive *:text-text-light",neutral:"text-neutral *:text-text-light",light:"text-white *:text-text-light",dark:"text-neutral-800 *:text-text-light",text:"text-text *:text-text-opposite","text-inverse":"text-text-opposite *:text-text",error:"text-error *:text-text-light",success:"text-success *:text-text-light",custom:""},variant:{default:"rounded-lg bg-current",none:"border-none bg-current/0 text-inherit hover:bg-current/0",outline:"*:!text-current rounded-lg border-[1.5px] bg-current/0 hover:bg-current/30",link:"*:!text-current h-auto justify-start border-inherit bg-transparent px-1 underline-offset-4 hover:bg-transparent hover:underline","invisible-link":"*:!text-current h-auto justify-start border-inherit bg-transparent px-1 underline-offset-4 hover:bg-transparent",hoverable:"*:!text-current rounded-lg border-none bg-current/0 transition hover:bg-current/10 aria-[current]:bg-current/5",input:["*:!text-current w-full select-text resize-none rounded-xl border-2 bg-input-background text-sm text-input-text shadow-none outline-0 transition-all","border-input-border hover:border-input-border-hover focus:border-input-border-focus focus:outline-0 focus:[box-shadow:none]","aria-[invalid=true]:border-error","disabled:opacity-50"]},textAlign:{left:"text-left",center:"text-center",right:"text-right"},isFullWidth:{true:"w-full",false:""},hasIconLeft:{true:"px-12",false:""},hasIconRight:{true:"pr-8",false:""}},defaultVariants:{variant:"default",size:"md",color:"primary",textAlign:"center",isFullWidth:!1,hasIconRight:!1,hasIconLeft:!1}}),_0=({variant:e,size:t,color:a,children:n,Icon:r,IconRight:s,iconClassName:o,isLoading:u,isActive:d,isFullWidth:f=!1,textAlign:v,disabled:p,label:A,className:E,type:_="button",...S})=>{const z=e==="link"||e==="invisible-link";return I.jsxs("button",{disabled:u||p,"aria-current":d?"page":void 0,"aria-label":A,"aria-busy":u,role:z?"link":void 0,type:_,className:aO({variant:e,size:t,color:a,isFullWidth:f,textAlign:v??(s?"left":"center"),hasIconLeft:typeof n<"u"&&(typeof r<"u"||typeof u<"u"),hasIconRight:typeof n<"u"&&typeof s<"u",className:E}),...S,children:[r&&!u&&I.jsx(r,{className:P6({size:t,className:o,position:"left"})}),I.jsx(i4,{className:P6({size:t,className:o,position:"left"}),isLoading:u??!1}),I.jsx("span",{children:n}),s&&I.jsx(s,{className:P6({size:t,className:o,position:"right"})})]})},nO=Me("flex text-text flex-col backdrop-blur",{variants:{roundedSize:{none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl","2xl":"rounded-2xl","3xl":"rounded-3xl",full:"rounded-full"},transparency:{none:"bg-card",sm:"bg-card/90",md:"bg-card/70",lg:"bg-card/40",xl:"bg-card/20",full:""},padding:{none:"p-0",sm:"p-1",md:"p-2",lg:"p-3",xl:"p-4"},separator:{without:"",x:"divide-x divide-dashed divide-text/20",y:"divide-y divide-dashed divide-text/20",both:"divide-x divide-y divide-dashed divide-text/20"},border:{none:"",with:"border-[1.5px]"},borderColor:{primary:"border-primary",secondary:"border-secondary",neutral:"border-neutral",text:"border-text ",error:"border-error",warning:"border-warning",success:"border-success"},background:{none:"bg-inherit",hoverable:"!bg-opacity-5 backdrop-blur-0 hover:!bg-opacity-10 hover:backdrop-blur focus:!bg-opacity-10 focus:backdrop-blur aria-selected:!bg-opacity-15 aria-selected:backdrop-blur",with:""},gap:{none:"gap-0",sm:"gap-1",md:"gap-3",lg:"gap-5",xl:"gap-8","2xl":"gap-10"}},defaultVariants:{roundedSize:"md",border:"none",borderColor:"text",transparency:"md",padding:"none",separator:"without",gap:"none"}}),d3=({children:e,roundedSize:t,padding:a,transparency:n,separator:r,className:s,border:o,borderColor:u,background:d,...f})=>I.jsx("div",{className:C2(nO({roundedSize:t,transparency:n,padding:a,separator:r,border:typeof o=="boolean"?o?"with":"none":void 0,background:d,borderColor:u,className:s})),...f,children:e}),xo=DN((e,t)=>({drawers:{},open:a=>e(n=>({drawers:{...n.drawers,[a]:!0}})),close:a=>e(n=>({drawers:{...n.drawers,[a]:!1}})),isOpen:a=>t().drawers[a]??!1})),ON=({title:e,identifier:t,children:a,header:n,closeOnOutsideClick:r=!0,backButton:s,isOpen:o,onClose:u})=>{const{isMobile:d}=JL("md"),f=y.useRef(null),v=y.useRef(null),{close:p,open:A,isOpen:E}=xo(BN(S=>({close:()=>S.close(t),open:()=>S.open(t),isOpen:S.isOpen(t)})));LN({disableScroll:E,key:t?`right_drawer_${t}`:"right_drawer"}),y.useEffect(()=>{const S=z=>{try{if(!f.current)return;const C=E&&r,M=z.target&&!f.current.contains(z.target),x=eO(f.current);(C&&M&&x||!z.target)&&(p(),u==null||u())}catch{p(),u==null||u()}};return window.addEventListener("mousedown",S),()=>window.removeEventListener("mousedown",S)},[E,p,u,r,t]),y.useEffect(()=>{o!==void 0&&(o?A():(p(),u==null||u()))},[p,A,u,o,t]);const _=S=>{S.target===S.currentTarget&&d&&(p(),u==null||u())};return I.jsx("div",{className:"fixed right-0 top-0 z-50 flex h-full justify-end",children:I.jsx($B,{isHidden:!E,align:"right",children:I.jsxs(d3,{className:"text-text relative flex h-screen w-screen flex-col md:w-[400px]",ref:f,roundedSize:"none",children:[I.jsxs("div",{className:"flex flex-col gap-3 p-6",children:[I.jsxs("div",{className:"flex justify-between gap-3",children:[I.jsx("div",{children:s&&I.jsx(_0,{variant:"hoverable",color:"text",label:s.text??"Go back",onClick:s.onBack,Icon:nL,children:s==null?void 0:s.text})}),I.jsx("div",{children:I.jsx(_0,{variant:"hoverable",color:"text",label:"Close",className:"ml-auto",onClick:p,Icon:Ya,size:"icon-md"})})]}),e&&I.jsx("h2",{className:"flex items-center justify-center text-lg font-bold",children:e}),n]}),I.jsx("div",{className:"flex h-full flex-col overflow-y-auto p-2",children:I.jsx("div",{className:"flex flex-1 flex-col",onClick:_,ref:v,children:a})})]})})})},Pn=()=>({isFetched:!1,fetchedDateTime:null,isLoading:!1,isInvalidated:!1,error:null,isSuccess:!1,data:null,errorCount:0,isEnabled:!0}),U6=(e,t)=>t.filter(a=>e.includes(a.split("/")[0])),lO=(e,t)=>{var a;switch(t.type){case"SET_QUERY_STATE":{const{key:n,value:r}=t;return{...e,states:{...e.states,[n]:{...e.states[n]??Pn(),...r}}}}case"MAKE_QUERY_IN_ERROR":{const{key:n,error:r}=t;return{...e,states:{...e.states,[n]:{...e.states[n]??Pn(),error:r,isFetched:!0,isSuccess:!1,errorCount:(((a=e.states[n])==null?void 0:a.errorCount)??0)+1,isLoading:!1,isInvalidated:!1}}}}case"SET_QUERIES_STATE":{const{keys:n,value:r}=t,s=[n].flat(),o=Object.keys(e.states),u=U6(s,o);if(u.length===0)return e;const d=structuredClone(e.states);return u.forEach(f=>{d[f]={...e.states[f]??Pn(),...r}}),{...e,states:d}}case"RESET_KEY_STATE":{const{keys:n}=t,r=[n].flat();if(r.length===0)return e;const s=Object.keys(e.states),o=U6(r,s);if(o.length===0)return e;const u={...e.states};return o.forEach(d=>{u[d]=Pn()}),{...e,states:u}}case"RESET_STATE":{const n=[t.excludeKeys].flat(),r=Object.keys(e.states),s=U6(n,r),o={};return r.forEach(u=>{o[u]=s.includes(u)?e.states[u]:Pn()}),{...e,states:o}}default:return e}},FN=y.createContext(null),rO=({children:e})=>{const[t,a]=y.useReducer(lO,{states:{}}),n=f=>t.states[f]??Pn(),r=(f,v)=>{a({type:"SET_QUERY_STATE",key:f,value:v})},s=(f,v)=>{a({type:"SET_QUERIES_STATE",keys:f,value:v})},o=(f,v)=>{a({type:"MAKE_QUERY_IN_ERROR",key:f,error:v})},u=f=>{a({type:"RESET_KEY_STATE",keys:f})},d=f=>{a({type:"RESET_STATE",excludeKeys:f})};return I.jsx(FN.Provider,{value:{getStates:n,setQueryState:r,setQueriesState:s,makeQueryInError:o,resetKeyState:u,resetState:d},children:e})},iO=()=>{const e=y.useContext(FN);if(!e)throw new Error("useAsyncState must be used within an AsyncStateProvider");return e},Us=new Map,sO=!1,cO=!1,oO=!0,uO=!1,hO=1,dO=!1,fO=5*60*1e3,mO=5*60*1e3,l8=e=>e?Array.isArray(e)?e:[e]:[],qp=(e,t)=>l8(t).length>0?`${e}/${JSON.stringify(t)}`:e,Jr=(e,t,a)=>{const n=(a==null?void 0:a.retryLimit)??hO,r=(a==null?void 0:a.autoFetch)??uO,s=(a==null?void 0:a.retryTime)??mO,o=(a==null?void 0:a.cache)??sO,u=(a==null?void 0:a.store)??cO,d=(a==null?void 0:a.enable)??oO,f=(a==null?void 0:a.revalidation)??dO,v=(a==null?void 0:a.revalidateTime)??fO,p=(a==null?void 0:a.updateQueries)??[],A=(a==null?void 0:a.invalidateQueries)??[],E=a==null?void 0:a.onSuccess,_=a==null?void 0:a.onError,S=l8((a==null?void 0:a.args)??[]),{getStates:z,setQueryState:C,setQueriesState:M,makeQueryInError:x}=iO(),D=y.useRef(S),w=y.useRef(null),b=qp(e,D.current),{isFetched:T,fetchedDateTime:O,isLoading:H,isEnabled:U,error:f2,isSuccess:s2,isInvalidated:h2,data:W,errorCount:a2}=z(b),V=async(...q)=>{const K=qp(e,q);w.current&&w.current.abort();const l2=new AbortController;if(w.current=l2,Us.has(K))return Us.get(K);const n2=(async()=>{C(K,{isLoading:!0});let d2=null;return await t(...q).then(g2=>{d2=g2,C(K,{data:g2,errorCount:0,isLoading:!1,isFetched:!0,fetchedDateTime:new Date,isSuccess:!0,isInvalidated:!1,error:null}),E==null||E(g2),A.length>0&&M(A,{isInvalidated:!0}),p.length>0&&M(p,{data:g2}),u&&localStorage.setItem(K,JSON.stringify(g2))}).catch(g2=>{const A2=g2 instanceof Error?g2.message:String(g2);x(K,A2),_==null||_(g2.message)}).finally(()=>{Us.delete(K)}),d2})();return Us.set(K,n2),await n2},t2=async(...q)=>{if(!(!U||!d))return q&&(D.current=l8(q)),await V(...D.current)},J=async(...q)=>!U||!d||H?void 0:!h2&&s2&&o&&W?W:await t2(...q);y.useEffect(()=>{d!==U&&C(b,{isEnabled:U})},[d,U,b]),y.useEffect(()=>{if(!U||!d||!u||h2||T||W)return;const q=localStorage.getItem(b);try{q&&C(b,{data:JSON.parse(q)})}catch(K){console.error(K)}},[u,b,T,h2,U,d,W]),y.useEffect(()=>{r&&(!U||!d||T&&!h2||H||V(...D.current))},[r,U,d,T,h2,H,V]),y.useEffect(()=>{const q=a2>0&&n>0,K=a2>n;if(!U||!d||!q||K||!(o||u)||H||s2)return;const l2=setTimeout(()=>{V(...D.current)},s);return()=>clearTimeout(l2)},[U,a2,n,d,s,o,u,s2,H,V]),y.useEffect(()=>{if(!f||v<=0||!U||!d||H||!s2||!O||!(o||u))return;const q=setTimeout(()=>{V(...D.current)},v);return()=>clearTimeout(q)},[f,v,o,u,s2,O,H,U,d,V]);const v2=q=>{C(b,{data:q})},F={isFetched:T,isInvalidated:h2,error:f2,data:W,errorCount:a2,isSuccess:s2,isEnabled:U,isDisabled:!U,isLoading:H,isWaitingData:H&&!T&&!W,isRevalidating:H&&T,[e]:J,revalidate:t2,setData:v2};return y.useEffect(()=>()=>{w.current&&w.current.abort()},[]),F},vO=e=>{var u;const t=u3(),a=e??t??d0(),n=Yr(void 0,a),{data:r,isFetched:s}=Jr("getCSRFToken",n.auth.getCSRFToken,{cache:!0,autoFetch:!0});return{csrfToken:(u=r==null?void 0:r.data)==null?void 0:u.csrf_token,csrfTokenFetched:s}},pO=e=>{const t=u3(),a=e??t??d0(),n=Yr(void 0,a),{data:r}=Jr("getOAuth2AccessToken",()=>n.auth.getOAuth2AccessToken(),{cache:!0,autoFetch:!0,enable:!!(a.editor.clientId&&a.editor.clientSecret)});return{oAuth2AccessToken:r==null?void 0:r.data}},AO=(e,t)=>{const a=u3(),n=t??a??d0(),r=Yr(void 0,n),{getSession:s,revalidate:o,data:u,setData:d,isFetched:f}=Jr("getSession",async()=>{try{const p=await r.auth.getSession();if(p.data){const{user:A,organization:E,project:_}=p.data;return{user:A,organization:E,isOrganizationAdmin:(A&&((E==null?void 0:E.adminsIds)??[]).includes(A._id))??!1,project:_,isProjectAdmin:(A&&((_==null?void 0:_.adminsIds)??[]).includes(A._id))??!1}}}catch(p){console.error(p)}return null},{cache:!0,store:!0,autoFetch:!0,enable:!e,invalidateQueries:["getOrganizations","getProjects","getUsers","getDictionaries"]});return{session:y.useMemo(()=>u??(f?null:void 0),[u,f]),fetchSession:s,revalidateSession:o,setSession:d}},ei=({session:e,intlayerConfiguration:t}={})=>{const{csrfToken:a,csrfTokenFetched:n}=vO(t),{session:r,fetchSession:s,revalidateSession:o,setSession:u}=AO(e,t),{oAuth2AccessToken:d}=pO(t);return{session:r,fetchSession:s,setSession:u,revalidateSession:o,csrfToken:a,csrfTokenFetched:n,oAuth2AccessToken:d,isAuthenticated:!!(r||d),isProjectAdmin:r==null?void 0:r.isProjectAdmin,isOrganizationAdmin:r==null?void 0:r.isOrganizationAdmin}};function m0(e,t,{checkForDefaultPrevented:a=!0}={}){return function(r){if(e==null||e(r),a===!1||!r.defaultPrevented)return t==null?void 0:t(r)}}function Xp(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function HN(...e){return t=>{let a=!1;const n=e.map(r=>{const s=Xp(r,t);return!a&&typeof s=="function"&&(a=!0),s});if(a)return()=>{for(let r=0;r<n.length;r++){const s=n[r];typeof s=="function"?s():Xp(e[r],null)}}}}function B0(...e){return y.useCallback(HN(...e),e)}function gO(e,t){const a=y.createContext(t),n=s=>{const{children:o,...u}=s,d=y.useMemo(()=>u,Object.values(u));return I.jsx(a.Provider,{value:d,children:o})};n.displayName=e+"Provider";function r(s){const o=y.useContext(a);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[n,r]}function ti(e,t=[]){let a=[];function n(s,o){const u=y.createContext(o),d=a.length;a=[...a,o];const f=p=>{var C;const{scope:A,children:E,..._}=p,S=((C=A==null?void 0:A[e])==null?void 0:C[d])||u,z=y.useMemo(()=>_,Object.values(_));return I.jsx(S.Provider,{value:z,children:E})};f.displayName=s+"Provider";function v(p,A){var S;const E=((S=A==null?void 0:A[e])==null?void 0:S[d])||u,_=y.useContext(E);if(_)return _;if(o!==void 0)return o;throw new Error(`\`${p}\` must be used within \`${s}\``)}return[f,v]}const r=()=>{const s=a.map(o=>y.createContext(o));return function(u){const d=(u==null?void 0:u[e])||s;return y.useMemo(()=>({[`__scope${e}`]:{...u,[e]:d}}),[u,d])}};return r.scopeName=e,[n,EO(r,...t)]}function EO(...e){const t=e[0];if(e.length===1)return t;const a=()=>{const n=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(s){const o=n.reduce((u,{useScope:d,scopeName:f})=>{const p=d(s)[`__scope${f}`];return{...u,...p}},{});return y.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return a.scopeName=t.scopeName,a}var Ba=y.forwardRef((e,t)=>{const{children:a,...n}=e,r=y.Children.toArray(a),s=r.find(IO);if(s){const o=s.props.children,u=r.map(d=>d===s?y.Children.count(o)>1?y.Children.only(null):y.isValidElement(o)?o.props.children:null:d);return I.jsx(r8,{...n,ref:t,children:y.isValidElement(o)?y.cloneElement(o,void 0,u):null})}return I.jsx(r8,{...n,ref:t,children:a})});Ba.displayName="Slot";var r8=y.forwardRef((e,t)=>{const{children:a,...n}=e;if(y.isValidElement(a)){const r=SO(a),s=NO(n,a.props);return a.type!==y.Fragment&&(s.ref=t?HN(t,r):r),y.cloneElement(a,s)}return y.Children.count(a)>1?y.Children.only(null):null});r8.displayName="SlotClone";var _O=({children:e})=>I.jsx(I.Fragment,{children:e});function IO(e){return y.isValidElement(e)&&e.type===_O}function NO(e,t){const a={...t};for(const n in t){const r=e[n],s=t[n];/^on[A-Z]/.test(n)?r&&s?a[n]=(...u)=>{s(...u),r(...u)}:r&&(a[n]=r):n==="style"?a[n]={...r,...s}:n==="className"&&(a[n]=[r,s].filter(Boolean).join(" "))}return{...e,...a}}function SO(e){var n,r;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,a=t&&"isReactWarning"in t&&t.isReactWarning;return a?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,a=t&&"isReactWarning"in t&&t.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}function PN(e){const t=e+"CollectionProvider",[a,n]=ti(t),[r,s]=a(t,{collectionRef:{current:null},itemMap:new Map}),o=E=>{const{scope:_,children:S}=E,z=X2.useRef(null),C=X2.useRef(new Map).current;return I.jsx(r,{scope:_,itemMap:C,collectionRef:z,children:S})};o.displayName=t;const u=e+"CollectionSlot",d=X2.forwardRef((E,_)=>{const{scope:S,children:z}=E,C=s(u,S),M=B0(_,C.collectionRef);return I.jsx(Ba,{ref:M,children:z})});d.displayName=u;const f=e+"CollectionItemSlot",v="data-radix-collection-item",p=X2.forwardRef((E,_)=>{const{scope:S,children:z,...C}=E,M=X2.useRef(null),x=B0(_,M),D=s(f,S);return X2.useEffect(()=>(D.itemMap.set(M,{ref:M,...C}),()=>void D.itemMap.delete(M))),I.jsx(Ba,{[v]:"",ref:x,children:z})});p.displayName=f;function A(E){const _=s(e+"CollectionConsumer",E);return X2.useCallback(()=>{const z=_.collectionRef.current;if(!z)return[];const C=Array.from(z.querySelectorAll(`[${v}]`));return Array.from(_.itemMap.values()).sort((D,w)=>C.indexOf(D.ref.current)-C.indexOf(w.ref.current))},[_.collectionRef,_.itemMap])}return[{Provider:o,Slot:d,ItemSlot:p},A,n]}var yO=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],i0=yO.reduce((e,t)=>{const a=y.forwardRef((n,r)=>{const{asChild:s,...o}=n,u=s?Ba:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),I.jsx(u,{...o,ref:r})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{});function UN(e,t){e&&$a.flushSync(()=>e.dispatchEvent(t))}function re(e){const t=y.useRef(e);return y.useEffect(()=>{t.current=e}),y.useMemo(()=>(...a)=>{var n;return(n=t.current)==null?void 0:n.call(t,...a)},[])}function zO(e,t=globalThis==null?void 0:globalThis.document){const a=re(e);y.useEffect(()=>{const n=r=>{r.key==="Escape"&&a(r)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[a,t])}var CO="DismissableLayer",i8="dismissableLayer.update",MO="dismissableLayer.pointerDownOutside",RO="dismissableLayer.focusOutside",Qp,VN=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),wo=y.forwardRef((e,t)=>{const{disableOutsidePointerEvents:a=!1,onEscapeKeyDown:n,onPointerDownOutside:r,onFocusOutside:s,onInteractOutside:o,onDismiss:u,...d}=e,f=y.useContext(VN),[v,p]=y.useState(null),A=(v==null?void 0:v.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,E]=y.useState({}),_=B0(t,T=>p(T)),S=Array.from(f.layers),[z]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),C=S.indexOf(z),M=v?S.indexOf(v):-1,x=f.layersWithOutsidePointerEventsDisabled.size>0,D=M>=C,w=wO(T=>{const O=T.target,H=[...f.branches].some(U=>U.contains(O));!D||H||(r==null||r(T),o==null||o(T),T.defaultPrevented||u==null||u())},A),b=bO(T=>{const O=T.target;[...f.branches].some(U=>U.contains(O))||(s==null||s(T),o==null||o(T),T.defaultPrevented||u==null||u())},A);return zO(T=>{M===f.layers.size-1&&(n==null||n(T),!T.defaultPrevented&&u&&(T.preventDefault(),u()))},A),y.useEffect(()=>{if(v)return a&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(Qp=A.body.style.pointerEvents,A.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(v)),f.layers.add(v),Jp(),()=>{a&&f.layersWithOutsidePointerEventsDisabled.size===1&&(A.body.style.pointerEvents=Qp)}},[v,A,a,f]),y.useEffect(()=>()=>{v&&(f.layers.delete(v),f.layersWithOutsidePointerEventsDisabled.delete(v),Jp())},[v,f]),y.useEffect(()=>{const T=()=>E({});return document.addEventListener(i8,T),()=>document.removeEventListener(i8,T)},[]),I.jsx(i0.div,{...d,ref:_,style:{pointerEvents:x?D?"auto":"none":void 0,...e.style},onFocusCapture:m0(e.onFocusCapture,b.onFocusCapture),onBlurCapture:m0(e.onBlurCapture,b.onBlurCapture),onPointerDownCapture:m0(e.onPointerDownCapture,w.onPointerDownCapture)})});wo.displayName=CO;var xO="DismissableLayerBranch",GN=y.forwardRef((e,t)=>{const a=y.useContext(VN),n=y.useRef(null),r=B0(t,n);return y.useEffect(()=>{const s=n.current;if(s)return a.branches.add(s),()=>{a.branches.delete(s)}},[a.branches]),I.jsx(i0.div,{...e,ref:r})});GN.displayName=xO;function wO(e,t=globalThis==null?void 0:globalThis.document){const a=re(e),n=y.useRef(!1),r=y.useRef(()=>{});return y.useEffect(()=>{const s=u=>{if(u.target&&!n.current){let d=function(){jN(MO,a,f,{discrete:!0})};const f={originalEvent:u};u.pointerType==="touch"?(t.removeEventListener("click",r.current),r.current=d,t.addEventListener("click",r.current,{once:!0})):d()}else t.removeEventListener("click",r.current);n.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",s),t.removeEventListener("click",r.current)}},[t,a]),{onPointerDownCapture:()=>n.current=!0}}function bO(e,t=globalThis==null?void 0:globalThis.document){const a=re(e),n=y.useRef(!1);return y.useEffect(()=>{const r=s=>{s.target&&!n.current&&jN(RO,a,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,a]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function Jp(){const e=new CustomEvent(i8);document.dispatchEvent(e)}function jN(e,t,a,{discrete:n}){const r=a.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:a});t&&r.addEventListener(e,t,{once:!0}),n?UN(r,s):r.dispatchEvent(s)}var TO=wo,kO=GN,x1=globalThis!=null&&globalThis.document?y.useLayoutEffect:()=>{},DO="Portal",bo=y.forwardRef((e,t)=>{var u;const{container:a,...n}=e,[r,s]=y.useState(!1);x1(()=>s(!0),[]);const o=a||r&&((u=globalThis==null?void 0:globalThis.document)==null?void 0:u.body);return o?rB.createPortal(I.jsx(i0.div,{...n,ref:t}),o):null});bo.displayName=DO;function BO(e,t){return y.useReducer((a,n)=>t[a][n]??a,e)}var ai=e=>{const{present:t,children:a}=e,n=LO(t),r=typeof a=="function"?a({present:n.isPresent}):y.Children.only(a),s=B0(n.ref,OO(r));return typeof a=="function"||n.isPresent?y.cloneElement(r,{ref:s}):null};ai.displayName="Presence";function LO(e){const[t,a]=y.useState(),n=y.useRef({}),r=y.useRef(e),s=y.useRef("none"),o=e?"mounted":"unmounted",[u,d]=BO(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return y.useEffect(()=>{const f=Vs(n.current);s.current=u==="mounted"?f:"none"},[u]),x1(()=>{const f=n.current,v=r.current;if(v!==e){const A=s.current,E=Vs(f);e?d("MOUNT"):E==="none"||(f==null?void 0:f.display)==="none"?d("UNMOUNT"):d(v&&A!==E?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,d]),x1(()=>{if(t){let f;const v=t.ownerDocument.defaultView??window,p=E=>{const S=Vs(n.current).includes(E.animationName);if(E.target===t&&S&&(d("ANIMATION_END"),!r.current)){const z=t.style.animationFillMode;t.style.animationFillMode="forwards",f=v.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=z)})}},A=E=>{E.target===t&&(s.current=Vs(n.current))};return t.addEventListener("animationstart",A),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{v.clearTimeout(f),t.removeEventListener("animationstart",A),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:y.useCallback(f=>{f&&(n.current=getComputedStyle(f)),a(f)},[])}}function Vs(e){return(e==null?void 0:e.animationName)||"none"}function OO(e){var n,r;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,a=t&&"isReactWarning"in t&&t.isReactWarning;return a?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,a=t&&"isReactWarning"in t&&t.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}function bc({prop:e,defaultProp:t,onChange:a=()=>{}}){const[n,r]=FO({defaultProp:t,onChange:a}),s=e!==void 0,o=s?e:n,u=re(a),d=y.useCallback(f=>{if(s){const p=typeof f=="function"?f(e):f;p!==e&&u(p)}else r(f)},[s,e,r,u]);return[o,d]}function FO({defaultProp:e,onChange:t}){const a=y.useState(e),[n]=a,r=y.useRef(n),s=re(t);return y.useEffect(()=>{r.current!==n&&(s(n),r.current=n)},[n,r,s]),a}var HO="VisuallyHidden",To=y.forwardRef((e,t)=>I.jsx(i0.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));To.displayName=HO;var kh="ToastProvider",[Dh,PO,UO]=PN("Toast"),[KN,VO]=ti("Toast",[UO]),[GO,ko]=KN(kh),Bh=e=>{const{__scopeToast:t,label:a="Notification",duration:n=5e3,swipeDirection:r="right",swipeThreshold:s=50,children:o}=e,[u,d]=y.useState(null),[f,v]=y.useState(0),p=y.useRef(!1),A=y.useRef(!1);return a.trim()||console.error(`Invalid prop \`label\` supplied to \`${kh}\`. Expected non-empty \`string\`.`),I.jsx(Dh.Provider,{scope:t,children:I.jsx(GO,{scope:t,label:a,duration:n,swipeDirection:r,swipeThreshold:s,toastCount:f,viewport:u,onViewportChange:d,onToastAdd:y.useCallback(()=>v(E=>E+1),[]),onToastRemove:y.useCallback(()=>v(E=>E-1),[]),isFocusedToastEscapeKeyDownRef:p,isClosePausedRef:A,children:o})})};Bh.displayName=kh;var $N="ToastViewport",jO=["F8"],s8="toast.viewportPause",c8="toast.viewportResume",Lh=y.forwardRef((e,t)=>{const{__scopeToast:a,hotkey:n=jO,label:r="Notifications ({hotkey})",...s}=e,o=ko($N,a),u=PO(a),d=y.useRef(null),f=y.useRef(null),v=y.useRef(null),p=y.useRef(null),A=B0(t,p,o.onViewportChange),E=n.join("+").replace(/Key/g,"").replace(/Digit/g,""),_=o.toastCount>0;y.useEffect(()=>{const z=C=>{var x;n.length!==0&&n.every(D=>C[D]||C.code===D)&&((x=p.current)==null||x.focus())};return document.addEventListener("keydown",z),()=>document.removeEventListener("keydown",z)},[n]),y.useEffect(()=>{const z=d.current,C=p.current;if(_&&z&&C){const M=()=>{if(!o.isClosePausedRef.current){const b=new CustomEvent(s8);C.dispatchEvent(b),o.isClosePausedRef.current=!0}},x=()=>{if(o.isClosePausedRef.current){const b=new CustomEvent(c8);C.dispatchEvent(b),o.isClosePausedRef.current=!1}},D=b=>{!z.contains(b.relatedTarget)&&x()},w=()=>{z.contains(document.activeElement)||x()};return z.addEventListener("focusin",M),z.addEventListener("focusout",D),z.addEventListener("pointermove",M),z.addEventListener("pointerleave",w),window.addEventListener("blur",M),window.addEventListener("focus",x),()=>{z.removeEventListener("focusin",M),z.removeEventListener("focusout",D),z.removeEventListener("pointermove",M),z.removeEventListener("pointerleave",w),window.removeEventListener("blur",M),window.removeEventListener("focus",x)}}},[_,o.isClosePausedRef]);const S=y.useCallback(({tabbingDirection:z})=>{const M=u().map(x=>{const D=x.ref.current,w=[D,...nF(D)];return z==="forwards"?w:w.reverse()});return(z==="forwards"?M.reverse():M).flat()},[u]);return y.useEffect(()=>{const z=p.current;if(z){const C=M=>{var w,b,T;const x=M.altKey||M.ctrlKey||M.metaKey;if(M.key==="Tab"&&!x){const O=document.activeElement,H=M.shiftKey;if(M.target===z&&H){(w=f.current)==null||w.focus();return}const s2=S({tabbingDirection:H?"backwards":"forwards"}),h2=s2.findIndex(W=>W===O);V6(s2.slice(h2+1))?M.preventDefault():H?(b=f.current)==null||b.focus():(T=v.current)==null||T.focus()}};return z.addEventListener("keydown",C),()=>z.removeEventListener("keydown",C)}},[u,S]),I.jsxs(kO,{ref:d,role:"region","aria-label":r.replace("{hotkey}",E),tabIndex:-1,style:{pointerEvents:_?void 0:"none"},children:[_&&I.jsx(o8,{ref:f,onFocusFromOutsideViewport:()=>{const z=S({tabbingDirection:"forwards"});V6(z)}}),I.jsx(Dh.Slot,{scope:a,children:I.jsx(i0.ol,{tabIndex:-1,...s,ref:A})}),_&&I.jsx(o8,{ref:v,onFocusFromOutsideViewport:()=>{const z=S({tabbingDirection:"backwards"});V6(z)}})]})});Lh.displayName=$N;var YN="ToastFocusProxy",o8=y.forwardRef((e,t)=>{const{__scopeToast:a,onFocusFromOutsideViewport:n,...r}=e,s=ko(YN,a);return I.jsx(To,{"aria-hidden":!0,tabIndex:0,...r,ref:t,style:{position:"fixed"},onFocus:o=>{var f;const u=o.relatedTarget;!((f=s.viewport)!=null&&f.contains(u))&&n()}})});o8.displayName=YN;var Do="Toast",KO="toast.swipeStart",$O="toast.swipeMove",YO="toast.swipeCancel",ZO="toast.swipeEnd",Oh=y.forwardRef((e,t)=>{const{forceMount:a,open:n,defaultOpen:r,onOpenChange:s,...o}=e,[u=!0,d]=bc({prop:n,defaultProp:r,onChange:s});return I.jsx(ai,{present:a||u,children:I.jsx(XO,{open:u,...o,ref:t,onClose:()=>d(!1),onPause:re(e.onPause),onResume:re(e.onResume),onSwipeStart:m0(e.onSwipeStart,f=>{f.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:m0(e.onSwipeMove,f=>{const{x:v,y:p}=f.detail.delta;f.currentTarget.setAttribute("data-swipe","move"),f.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${v}px`),f.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${p}px`)}),onSwipeCancel:m0(e.onSwipeCancel,f=>{f.currentTarget.setAttribute("data-swipe","cancel"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),f.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),f.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:m0(e.onSwipeEnd,f=>{const{x:v,y:p}=f.detail.delta;f.currentTarget.setAttribute("data-swipe","end"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),f.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${v}px`),f.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${p}px`),d(!1)})})})});Oh.displayName=Do;var[WO,qO]=KN(Do,{onClose(){}}),XO=y.forwardRef((e,t)=>{const{__scopeToast:a,type:n="foreground",duration:r,open:s,onClose:o,onEscapeKeyDown:u,onPause:d,onResume:f,onSwipeStart:v,onSwipeMove:p,onSwipeCancel:A,onSwipeEnd:E,..._}=e,S=ko(Do,a),[z,C]=y.useState(null),M=B0(t,W=>C(W)),x=y.useRef(null),D=y.useRef(null),w=r||S.duration,b=y.useRef(0),T=y.useRef(w),O=y.useRef(0),{onToastAdd:H,onToastRemove:U}=S,f2=re(()=>{var a2;(z==null?void 0:z.contains(document.activeElement))&&((a2=S.viewport)==null||a2.focus()),o()}),s2=y.useCallback(W=>{!W||W===1/0||(window.clearTimeout(O.current),b.current=new Date().getTime(),O.current=window.setTimeout(f2,W))},[f2]);y.useEffect(()=>{const W=S.viewport;if(W){const a2=()=>{s2(T.current),f==null||f()},V=()=>{const t2=new Date().getTime()-b.current;T.current=T.current-t2,window.clearTimeout(O.current),d==null||d()};return W.addEventListener(s8,V),W.addEventListener(c8,a2),()=>{W.removeEventListener(s8,V),W.removeEventListener(c8,a2)}}},[S.viewport,w,d,f,s2]),y.useEffect(()=>{s&&!S.isClosePausedRef.current&&s2(w)},[s,w,S.isClosePausedRef,s2]),y.useEffect(()=>(H(),()=>U()),[H,U]);const h2=y.useMemo(()=>z?XN(z):null,[z]);return S.viewport?I.jsxs(I.Fragment,{children:[h2&&I.jsx(QO,{__scopeToast:a,role:"status","aria-live":n==="foreground"?"assertive":"polite","aria-atomic":!0,children:h2}),I.jsx(WO,{scope:a,onClose:f2,children:$a.createPortal(I.jsx(Dh.ItemSlot,{scope:a,children:I.jsx(TO,{asChild:!0,onEscapeKeyDown:m0(u,()=>{S.isFocusedToastEscapeKeyDownRef.current||f2(),S.isFocusedToastEscapeKeyDownRef.current=!1}),children:I.jsx(i0.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":s?"open":"closed","data-swipe-direction":S.swipeDirection,..._,ref:M,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:m0(e.onKeyDown,W=>{W.key==="Escape"&&(u==null||u(W.nativeEvent),W.nativeEvent.defaultPrevented||(S.isFocusedToastEscapeKeyDownRef.current=!0,f2()))}),onPointerDown:m0(e.onPointerDown,W=>{W.button===0&&(x.current={x:W.clientX,y:W.clientY})}),onPointerMove:m0(e.onPointerMove,W=>{if(!x.current)return;const a2=W.clientX-x.current.x,V=W.clientY-x.current.y,t2=!!D.current,J=["left","right"].includes(S.swipeDirection),v2=["left","up"].includes(S.swipeDirection)?Math.min:Math.max,F=J?v2(0,a2):0,q=J?0:v2(0,V),K=W.pointerType==="touch"?10:2,l2={x:F,y:q},n2={originalEvent:W,delta:l2};t2?(D.current=l2,Gs($O,p,n2,{discrete:!1})):eA(l2,S.swipeDirection,K)?(D.current=l2,Gs(KO,v,n2,{discrete:!1}),W.target.setPointerCapture(W.pointerId)):(Math.abs(a2)>K||Math.abs(V)>K)&&(x.current=null)}),onPointerUp:m0(e.onPointerUp,W=>{const a2=D.current,V=W.target;if(V.hasPointerCapture(W.pointerId)&&V.releasePointerCapture(W.pointerId),D.current=null,x.current=null,a2){const t2=W.currentTarget,J={originalEvent:W,delta:a2};eA(a2,S.swipeDirection,S.swipeThreshold)?Gs(ZO,E,J,{discrete:!0}):Gs(YO,A,J,{discrete:!0}),t2.addEventListener("click",v2=>v2.preventDefault(),{once:!0})}})})})}),S.viewport)})]}):null}),QO=e=>{const{__scopeToast:t,children:a,...n}=e,r=ko(Do,t),[s,o]=y.useState(!1),[u,d]=y.useState(!1);return tF(()=>o(!0)),y.useEffect(()=>{const f=window.setTimeout(()=>d(!0),1e3);return()=>window.clearTimeout(f)},[]),u?null:I.jsx(bo,{asChild:!0,children:I.jsx(To,{...n,children:s&&I.jsxs(I.Fragment,{children:[r.label," ",a]})})})},JO="ToastTitle",Fh=y.forwardRef((e,t)=>{const{__scopeToast:a,...n}=e;return I.jsx(i0.div,{...n,ref:t})});Fh.displayName=JO;var eF="ToastDescription",Hh=y.forwardRef((e,t)=>{const{__scopeToast:a,...n}=e;return I.jsx(i0.div,{...n,ref:t})});Hh.displayName=eF;var ZN="ToastAction",Ph=y.forwardRef((e,t)=>{const{altText:a,...n}=e;return a.trim()?I.jsx(qN,{altText:a,asChild:!0,children:I.jsx(Bo,{...n,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${ZN}\`. Expected non-empty \`string\`.`),null)});Ph.displayName=ZN;var WN="ToastClose",Bo=y.forwardRef((e,t)=>{const{__scopeToast:a,...n}=e,r=qO(WN,a);return I.jsx(qN,{asChild:!0,children:I.jsx(i0.button,{type:"button",...n,ref:t,onClick:m0(e.onClick,r.onClose)})})});Bo.displayName=WN;var qN=y.forwardRef((e,t)=>{const{__scopeToast:a,altText:n,...r}=e;return I.jsx(i0.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0,...r,ref:t})});function XN(e){const t=[];return Array.from(e.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&t.push(n.textContent),aF(n)){const r=n.ariaHidden||n.hidden||n.style.display==="none",s=n.dataset.radixToastAnnounceExclude==="";if(!r)if(s){const o=n.dataset.radixToastAnnounceAlt;o&&t.push(o)}else t.push(...XN(n))}}),t}function Gs(e,t,a,{discrete:n}){const r=a.originalEvent.currentTarget,s=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:a});t&&r.addEventListener(e,t,{once:!0}),n?UN(r,s):r.dispatchEvent(s)}var eA=(e,t,a=0)=>{const n=Math.abs(e.x),r=Math.abs(e.y),s=n>r;return t==="left"||t==="right"?s&&n>a:!s&&r>a};function tF(e=()=>{}){const t=re(e);x1(()=>{let a=0,n=0;return a=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(a),window.cancelAnimationFrame(n)}},[t])}function aF(e){return e.nodeType===e.ELEMENT_NODE}function nF(e){const t=[],a=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const r=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||r?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;a.nextNode();)t.push(a.currentNode);return t}function V6(e){const t=document.activeElement;return e.some(a=>a===t?!0:(a.focus(),document.activeElement!==t))}var lF=Bh,QN=Lh,JN=Oh,eS=Fh,tS=Hh,rF=Ph,aS=Bo;const iF=Object.freeze(Object.defineProperty({__proto__:null,Action:rF,Close:aS,Description:tS,Provider:lF,Root:JN,Title:eS,Toast:Oh,ToastAction:Ph,ToastClose:Bo,ToastDescription:Hh,ToastProvider:Bh,ToastTitle:Fh,ToastViewport:Lh,Viewport:QN,createToastScope:VO},Symbol.toStringTag,{value:"Module"})),sF=iF,cF=({className:e,...t})=>I.jsx(QN,{className:C2("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}),oF=Me("group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md p-4 pr-6 shadow-[0_0_10px_-15px_rgba(0,0,0,0.3)] backdrop-blur transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{error:"bg-error/40 text-text",success:"bg-success/30 text-text",default:"bg-card/80 text-text"}},defaultVariants:{variant:"default"}}),uF=({className:e,variant:t,...a})=>I.jsx(JN,{className:C2(oF({variant:t}),e),...a}),hF=({className:e,...t})=>I.jsx(aS,{className:C2("text-text/50 hover:text-text/80 focus:outline-hidden absolute right-1 top-1 rounded-md p-1 opacity-0 transition-opacity focus:opacity-100 focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:I.jsx(Ya,{className:"size-5"})}),dF=({className:e,...t})=>I.jsx(eS,{className:C2("text-sm font-semibold [&+div]:text-xs",e),...t}),fF=({className:e,...t})=>I.jsx(tS,{className:C2("text-sm opacity-90",e),...t}),mF=1,vF=15*60*1e3;let G6=0;const pF=()=>(G6=(G6+1)%Number.MAX_SAFE_INTEGER,G6.toString()),j6=new Map,tA=e=>{if(j6.has(e))return;const t=setTimeout(()=>{j6.delete(e),ar({type:"REMOVE_TOAST",toastId:e})},vF);j6.set(e,t)},AF=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,mF)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(a=>a.id===t.toast.id?{...a,...t.toast}:a)};case"DISMISS_TOAST":{const{toastId:a}=t;return a?tA(a):e.toasts.forEach(n=>{tA(n.id)}),{...e,toasts:e.toasts.map(n=>n.id===a||a===void 0?{...n,open:!1}:n)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(a=>a.id!==t.toastId)}}},Ac=[];let gc={toasts:[]};const ar=e=>{gc=AF(gc,e),Ac.forEach(t=>{t(gc)})},gF=({...e})=>{const t=pF(),a=r=>ar({type:"UPDATE_TOAST",toast:{...r,id:t}}),n=()=>ar({type:"DISMISS_TOAST",toastId:t});return ar({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:r=>{r||n()}}}),{id:t,dismiss:n,update:a}},nS=()=>{const[e,t]=y.useState(gc);return y.useEffect(()=>(Ac.push(t),()=>{const a=Ac.indexOf(t);a>-1&&Ac.splice(a,1)}),[e]),{...e,toast:gF,dismiss:a=>ar({type:"DISMISS_TOAST",toastId:a})}},$3=e=>{const t=u3(),{csrfToken:a,oAuth2AccessToken:n}=ei(),r=n!=null&&n.accessToken?{Authorization:`Bearer ${n.accessToken}`}:void 0;return Yr({headers:r,body:a?{csrf_token:a}:void 0},t)};var EF={};const lS=e=>{const{toast:t}=nS();return{...e,onError:a=>{var r;let n;try{if(typeof a>"u")return;n=JSON.parse(a)}catch{n=a}[n].flatMap(s=>s).forEach(s=>t({title:(EF.NODE_ENV==="production"?s.title:s.code)??"Error",description:s.message??a??"An error occurred",variant:"error"})),(r=e.onError)==null||r.call(e,a)},onSuccess:a=>{var n;a.message&&t({title:a.message,description:a.description,variant:"success"}),(n=e.onSuccess)==null||n.call(e,a)}}},_F=(e,{requireUser:t,requireProject:a,requireOrganization:n}={})=>{const r=u3(),{csrfToken:s,oAuth2AccessToken:o,session:u}=ei({intlayerConfiguration:r}),d=(e==null?void 0:e.enable)??!0,f=u?u.user:o==null?void 0:o.user,v=u?u.organization:o==null?void 0:o.organization,p=u?u.project:o==null?void 0:o.project;return{...e,enable:d&&(t?!!f:!0)&&(a?!!p:!0)&&(n?!!v:!0)&&(!!s||!u&&!!o)}},Pt=(e,t,a,n)=>{const r=_F(a??{},n),s=lS(r);return Jr(e,t,s)},IF=(e,t,a)=>{const n=lS({});return Jr(e,t,n)},NF=e=>Pt("logout",$3().auth.logout,{invalidateQueries:["getSession"],...e}),SF=e=>Pt("getProjects",$3().project.getProjects,{cache:!0,store:!0,retryLimit:3,autoFetch:!0,revalidation:!0,revalidateTime:5*60*1e3,...e},{requireUser:!0,requireOrganization:!0}),yF=e=>Pt("getDictionaries",$3().dictionary.getDictionaries,{cache:!0,store:!0,retryLimit:3,autoFetch:!0,revalidation:!0,revalidateTime:5*60*1e3,...e},{requireUser:!0,requireOrganization:!0,requireProject:!0}),zF=e=>Pt("pushDictionaries",$3().dictionary.pushDictionaries,{invalidateQueries:["getDictionaries","getDictionary","getDictionariesKeys"],...e}),CF=e=>Pt("getTags",$3().tag.getTags,{cache:!0,store:!0,retryLimit:3,autoFetch:!0,revalidation:!0,revalidateTime:5*60*1e3,...e},{requireUser:!0,requireOrganization:!0}),MF=e=>Pt("auditContentDeclaration",$3().ai.auditContentDeclarationMetadata,e,{requireUser:!0,requireOrganization:!0,requireProject:!0}),RF=e=>Pt("auditContentDeclarationField",$3().ai.auditContentDeclarationField,e,{requireUser:!0,requireOrganization:!0,requireProject:!0}),xF=e=>Pt("autocomplete",$3().ai.autocomplete,e),wF=e=>IF("writeDictionary",$3().editor.writeDictionary);var K6,aA;function bF(){if(aA)return K6;aA=1;var e=function(M){return t(M)&&!a(M)};function t(C){return!!C&&typeof C=="object"}function a(C){var M=Object.prototype.toString.call(C);return M==="[object RegExp]"||M==="[object Date]"||s(C)}var n=typeof Symbol=="function"&&Symbol.for,r=n?Symbol.for("react.element"):60103;function s(C){return C.$$typeof===r}function o(C){return Array.isArray(C)?[]:{}}function u(C,M){return M.clone!==!1&&M.isMergeableObject(C)?S(o(C),C,M):C}function d(C,M,x){return C.concat(M).map(function(D){return u(D,x)})}function f(C,M){if(!M.customMerge)return S;var x=M.customMerge(C);return typeof x=="function"?x:S}function v(C){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(C).filter(function(M){return Object.propertyIsEnumerable.call(C,M)}):[]}function p(C){return Object.keys(C).concat(v(C))}function A(C,M){try{return M in C}catch{return!1}}function E(C,M){return A(C,M)&&!(Object.hasOwnProperty.call(C,M)&&Object.propertyIsEnumerable.call(C,M))}function _(C,M,x){var D={};return x.isMergeableObject(C)&&p(C).forEach(function(w){D[w]=u(C[w],x)}),p(M).forEach(function(w){E(C,w)||(A(C,w)&&x.isMergeableObject(M[w])?D[w]=f(w,x)(C[w],M[w],x):D[w]=u(M[w],x))}),D}function S(C,M,x){x=x||{},x.arrayMerge=x.arrayMerge||d,x.isMergeableObject=x.isMergeableObject||e,x.cloneUnlessOtherwiseSpecified=u;var D=Array.isArray(M),w=Array.isArray(C),b=D===w;return b?D?x.arrayMerge(C,M,x):_(C,M,x):u(M,x)}S.all=function(M,x){if(!Array.isArray(M))throw new Error("first argument should be an array");return M.reduce(function(D,w){return S(D,w,x)},{})};var z=S;return K6=z,K6}var TF=bF();const kF=So(TF),nA={method:"GET",headers:{"Content-Type":"application/json"},credentials:"include"},DF=e=>(Object.keys(e).forEach(t=>{e[t]===void 0&&delete e[t]}),e),js=e=>e.reduce((t,a)=>{const n=t??{},r=DF(a??{});return typeof n=="object"&&typeof r=="object"?{...n,...r}:r??n},{}),k2=async(e,...t)=>{const{signal:a}=new AbortController;let n="",r;const s=t.map(({body:E,params:_,headers:S,...z})=>z),o=js([nA,...s]),u=js([nA.headers,...t.map(E=>E.headers)]),d=js(t.map(E=>E.params)),f=o.method;if(f!=="GET"&&f!=="HEAD"){const E=js(t.map(_=>_.body));(u==null?void 0:u["Content-Type"])==="application/x-www-form-urlencoded"?r=new URLSearchParams(E).toString():r=JSON.stringify(E)}Object.entries(d).length>0&&(n=`?${new URLSearchParams(d).toString()}`);const v={...o,headers:u,body:r,signal:a},p=`${e}${n}`,A=await fetch(p,v);if(!A.ok){const E=await A.json();throw new Error(JSON.stringify(E.error)??"An error occurred")}return await A.json()},rS=(e={},t)=>{const n=`${d0().editor.backendURL}/api/ai`;return{auditContentDeclaration:async(v,p={})=>await k2(`${n}/audit/dictionary`,e,p,{method:"POST",body:v}),auditContentDeclarationField:async(v,p={})=>await k2(`${n}/audit/dictionary/field`,e,p,{method:"POST",body:v}),auditContentDeclarationMetadata:async(v,p={})=>await k2(`${n}/audit/dictionary/metadata`,e,p,{method:"POST",body:v}),auditTag:async(v,p={})=>await k2(`${n}/audit/tag`,e,p,{method:"POST",body:v}),askDocQuestion:async(v,p={})=>await k2(`${n}/ask`,e,p,{method:"POST",body:v}),autocomplete:async(v,p={})=>await k2(`${n}/autocomplete`,e,p,{method:"POST",body:v})}};rS();const iS=(e={},t)=>{const{backendURL:a,clientId:n,clientSecret:r}=d0().editor,s=`${a}/api/auth`;return{login:async(b,T={})=>await k2(`${s}/login`,e,T,{method:"POST",body:b}),getLoginWithGitHubURL:b=>{const T=new URLSearchParams(b);return`${s}/login/github?${T.toString()}`},getLoginWithGoogleURL:b=>{const T=new URLSearchParams(b);return`${s}/login/google?${T.toString()}`},register:async(b,T={},O={})=>await k2(`${s}/register`,e,O,{method:"POST",body:b,params:T}),logout:async(b={})=>await k2(`${s}/logout`,e,b,{method:"POST"}),resetPassword:async(b,T={})=>await k2(`${s}/password/reset`,e,T,{params:b,method:"POST"}),defineNewPassword:async(b,T={})=>await k2(`${s}/password/define`,e,T,{method:"POST",body:b}),askResetPassword:async(b,T={})=>await k2(`${s}/password/reset`,e,T,{method:"POST",body:{email:b}}),checkIfUserHasPassword:async(b={})=>await k2(`${s}/password/has`,e,b,{method:"GET"}),verifyEmail:async({userId:b,secret:T},O={})=>await k2(`${s}/active/${b}/${T}`,e,O,{method:"PUT"}),getVerifyEmailStatusURL:b=>`${s}/verify-email-status/${String(b)}`,changePassword:async(b,T={})=>await k2(`${s}/password`,e,T,{method:"PUT",body:b}),createSession:async(b,T={})=>await k2(`${s}/session`,e,T,{method:"POST",body:b}),getSession:async(b,T={})=>await k2(`${a}/session`,e,T,{params:{session_token:b}}),getCSRFToken:async(b={})=>await k2(`${a}/csrf-token`,e,b),getOAuth2AccessToken:async(b={})=>await k2(`${a}/oauth2/token`,e,b,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:{grant_type:"client_credentials",client_id:n,client_secret:r}})}};iS();const sS=(e={},t)=>{const n=`${d0().editor.backendURL}/api/dictionary`;return{getDictionaries:async(p,A={})=>await k2(n,e,A,{params:p}),getDictionariesKeys:async(p={})=>await k2(`${n}/keys`,e,p),getDictionary:async(p,A,E={})=>await k2(`${n}/${p}`,e,E,{params:A?{version:A.toString()}:void 0}),pushDictionaries:async(p,A={})=>await k2(`${n}`,e,A,{method:"PATCH",body:{dictionaries:p}}),addDictionary:async(p,A={})=>await k2(`${n}`,e,A,{method:"POST",body:p}),updateDictionary:async(p,A,E={})=>await k2(`${n}/${p}`,e,E,{method:"PUT",body:A}),deleteDictionary:async(p,A={})=>await k2(`${n}`,e,A,{method:"DELETE",body:{id:p}})}};sS();const cS=(e={},t)=>{const{editorURL:a}=d0().editor,n=`${a}/api`;return{getConfiguration:async(o={})=>(await k2(`${n}/config`,e,o)).data,writeDictionary:async(o,u={})=>{await k2(`${n}/dictionary`,e,u,{method:"POST",body:{dictionary:o}})}}};cS();const oS=(e={},t)=>{const n=`${d0().editor.backendURL}/api/organization`;return{getOrganizations:async(E,_={})=>await k2(n,e,_,{params:E}),getOrganization:async(E,_={})=>await k2(`${n}/${String(E)}`,e,_),addOrganization:async(E,_={})=>await k2(n,e,_,{method:"POST",body:E}),addOrganizationMember:async(E,_={})=>k2(`${n}/member`,e,_,{method:"POST",body:E}),updateOrganization:async(E,_={})=>k2(n,e,_,{method:"PUT",body:E}),updateOrganizationMembers:async(E,_={})=>k2(`${n}/members`,e,_,{method:"PUT",body:E}),deleteOrganization:async(E={})=>await k2(n,e,E,{method:"DELETE"}),selectOrganization:async(E,_={})=>await k2(`${n}/${String(E)}`,e,_,{method:"PUT"}),unselectOrganization:async(E={})=>await k2(`${n}/logout`,e,E,{method:"POST"})}};oS();const uS=(e={},t)=>{const n=`${d0().editor.backendURL}/api/project`;return{getProjects:async(S,z={})=>await k2(n,e,z,{params:S}),addProject:async(S,z={})=>await k2(`${n}`,e,z,{method:"POST",body:S}),updateProject:async(S,z={})=>await k2(`${n}`,e,z,{method:"PUT",body:S}),updateProjectMembers:async(S,z={})=>await k2(`${n}/members`,e,z,{method:"PUT",body:S}),pushProjectConfiguration:async(S,z={})=>await k2(`${n}/configuration`,e,z,{method:"PUT",body:S}),deleteProject:async(S={})=>await k2(`${n}`,e,S,{method:"DELETE"}),selectProject:async(S,z={})=>await k2(`${n}/${String(S)}`,e,z,{method:"PUT"}),unselectProject:async(S={})=>await k2(`${n}/logout`,e,S,{method:"POST"}),addNewAccessKey:async(S,z={})=>await k2(`${n}/access_key`,e,z,{method:"POST",body:S}),deleteAccessKey:async(S,z={})=>await k2(`${n}/access_key`,e,z,{method:"DELETE",body:{clientId:S}}),refreshAccessKey:async(S,z={})=>await k2(`${n}/access_key`,e,z,{method:"PATCH",body:{clientId:S}})}};uS();const BF=(e={},t)=>{const n=`${d0().editor.backendURL}/api/stripe`;return{getPricing:async(u,d={})=>await k2(`${n}/pricing`,e,d,{method:"POST",body:u}),getSubscription:async(u,d={})=>await k2(`${n}/create-subscription`,e,d,{method:"POST",body:u}),cancelSubscription:async(u={})=>await k2(`${n}/cancel-subscription`,e,u,{method:"POST"})}},hS=(e={},t)=>{const n=`${d0().editor.backendURL}/api/tag`;return{getTags:async(d,f={})=>await k2(n,e,f,{params:d}),addTag:async(d,f={})=>await k2(`${n}`,e,f,{method:"POST",body:d}),updateTag:async(d,f,v={})=>await k2(`${n}/${d}`,e,v,{method:"PUT",body:f}),deleteTag:async(d,f={})=>await k2(`${n}/${d}`,e,f,{method:"DELETE"})}};hS();const dS=(e={},t)=>{const n=`${d0().editor.backendURL}/api/user`;return{createUser:async(p,A={})=>await k2(`${n}/`,e,A,{method:"POST",body:p}),getUsers:async(p,A={})=>await k2(n,e,A,{params:p}),getUserById:async(p,A={})=>await k2(`${n}/${p}`,e,A),getUserByAccount:async(p,A,E={})=>await k2(`${n}/account/${A}/${p}`,e,E),getUserByEmail:async(p,A={})=>await k2(`${n}/email/${p}`,e,A),updateUser:async(p,A={})=>await k2(`${n}`,e,A,{method:"PUT",body:p}),deleteUser:async(p,A={})=>await k2(`${n}/${p}`,e,A,{method:"DELETE"})}};dS();const LF=(e={},t)=>({organization:oS(e),project:uS(e),user:dS(e),auth:iS(e),dictionary:sS(e),stripe:BF(e),ai:rS(e),tag:hS(e),editor:cS(e)});LF();j({en:"or",fr:"ou",es:"o",de:"oder",ja:"または",ko:"또는",zh:"或",it:"o",pt:"ou",hi:"या",ar:"أو",ru:"или","en-GB":"or"}),j({en:"Sign in with GitHub",fr:"Se connecter avec GitHub",es:"Iniciar sesión con GitHub",de:"Mit GitHub anmelden",ja:"GitHubでサインイン",ko:"GitHub로 로그인",zh:"使用GitHub登录",it:"Accedi con GitHub",pt:"Entrar com o GitHub",hi:"GitHub के साथ साइनइन करें",ar:"تسجيل الدخول باستخدام GitHub",ru:"Войти с GitHub","en-GB":"Sign in with GitHub"}),j({en:"Sign in with GitHub",fr:"Se connecter avec GitHub",es:"Iniciar sesión con GitHub",de:"Mit GitHub anmelden",ja:"GitHubでサインイン",ko:"GitHub로 로그인",zh:"使用GitHub登录",it:"Accedi con GitHub",pt:"Entrar com o GitHub",hi:"GitHub के साथ साइनइन करें",ar:"تسجيل الدخول باستخدام GitHub",ru:"Войти с GitHub","en-GB":"Sign in with GitHub"}),j({en:"Sign in with Google",fr:"Se connecter avec Google",es:"Iniciar sesión con Google",de:"Mit Google anmelden",ja:"Googleでサインイン",ko:"Google로 로그인",zh:"使用Google登录",it:"Accedi con Google",pt:"Entrar com o Google",hi:"Google के साथ साइनइन करें",ar:"تسجيل الدخول باستخدام Google",ru:"Войти с Google","en-GB":"Sign in with Google"}),j({en:"Sign in with Google",fr:"Se connecter avec Google",es:"Iniciar sesión con Google",de:"Mit Google anmelden",ja:"Googleでサインイン",ko:"Google로 로그인",zh:"使用Google登录",it:"Accedi con Google",pt:"Entrar com o Google",hi:"Google के साथ साइनइन करें",ar:"تسجيل الدخول باستخدام Google",ru:"Войти с Google","en-GB":"Sign in with Google"});var ni=e=>e.type==="checkbox",Ma=e=>e instanceof Date,D1=e=>e==null;const fS=e=>typeof e=="object";var $0=e=>!D1(e)&&!Array.isArray(e)&&fS(e)&&!Ma(e),mS=e=>$0(e)&&e.target?ni(e.target)?e.target.checked:e.target.value:e,OF=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,vS=(e,t)=>e.has(OF(t)),FF=e=>{const t=e.constructor&&e.constructor.prototype;return $0(t)&&t.hasOwnProperty("isPrototypeOf")},Uh=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function U1(e){let t;const a=Array.isArray(e),n=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(Uh&&(e instanceof Blob||n))&&(a||$0(e)))if(t=a?[]:{},!a&&!FF(e))t=e;else for(const r in e)e.hasOwnProperty(r)&&(t[r]=U1(e[r]));else return e;return t}var Lo=e=>Array.isArray(e)?e.filter(Boolean):[],K0=e=>e===void 0,I2=(e,t,a)=>{if(!t||!$0(e))return a;const n=Lo(t.split(/[,[\].]+?/)).reduce((r,s)=>D1(r)?r:r[s],e);return K0(n)||n===e?K0(e[t])?a:e[t]:n},Ne=e=>typeof e=="boolean",Vh=e=>/^\w*$/.test(e),pS=e=>Lo(e.replace(/["|']|\]/g,"").split(/\.|\[/)),E0=(e,t,a)=>{let n=-1;const r=Vh(t)?[t]:pS(t),s=r.length,o=s-1;for(;++n<s;){const u=r[n];let d=a;if(n!==o){const f=e[u];d=$0(f)||Array.isArray(f)?f:isNaN(+r[n+1])?{}:[]}if(u==="__proto__"||u==="constructor"||u==="prototype")return;e[u]=d,e=e[u]}return e};const Tc={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Le={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},b3={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},AS=X2.createContext(null),Ut=()=>X2.useContext(AS),HF=e=>{const{children:t,...a}=e;return X2.createElement(AS.Provider,{value:a},t)};var gS=(e,t,a,n=!0)=>{const r={defaultValues:t._defaultValues};for(const s in e)Object.defineProperty(r,s,{get:()=>{const o=s;return t._proxyFormState[o]!==Le.all&&(t._proxyFormState[o]=!n||Le.all),a&&(a[o]=!0),e[o]}});return r},V1=e=>$0(e)&&!Object.keys(e).length,ES=(e,t,a,n)=>{a(e);const{name:r,...s}=e;return V1(s)||Object.keys(s).length>=Object.keys(t).length||Object.keys(s).find(o=>t[o]===(!n||Le.all))},nr=e=>Array.isArray(e)?e:[e],_S=(e,t,a)=>!e||!t||e===t||nr(e).some(n=>n&&(a?n===t:n.startsWith(t)||t.startsWith(n)));function Gh(e){const t=X2.useRef(e);t.current=e,X2.useEffect(()=>{const a=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{a&&a.unsubscribe()}},[e.disabled])}function PF(e){const t=Ut(),{control:a=t.control,disabled:n,name:r,exact:s}=e||{},[o,u]=X2.useState(a._formState),d=X2.useRef(!0),f=X2.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),v=X2.useRef(r);return v.current=r,Gh({disabled:n,next:p=>d.current&&_S(v.current,p.name,s)&&ES(p,f.current,a._updateFormState)&&u({...a._formState,...p}),subject:a._subjects.state}),X2.useEffect(()=>(d.current=!0,f.current.isValid&&a._updateValid(!0),()=>{d.current=!1}),[a]),X2.useMemo(()=>gS(o,a,f.current,!1),[o,a])}var e3=e=>typeof e=="string",IS=(e,t,a,n,r)=>e3(e)?(n&&t.watch.add(e),I2(a,e,r)):Array.isArray(e)?e.map(s=>(n&&t.watch.add(s),I2(a,s))):(n&&(t.watchAll=!0),a);function UF(e){const t=Ut(),{control:a=t.control,name:n,defaultValue:r,disabled:s,exact:o}=e||{},u=X2.useRef(n);u.current=n,Gh({disabled:s,subject:a._subjects.values,next:v=>{_S(u.current,v.name,o)&&f(U1(IS(u.current,a._names,v.values||a._formValues,!1,r)))}});const[d,f]=X2.useState(a._getWatch(n,r));return X2.useEffect(()=>a._removeUnmounted()),d}function VF(e){const t=Ut(),{name:a,disabled:n,control:r=t.control,shouldUnregister:s}=e,o=vS(r._names.array,a),u=UF({control:r,name:a,defaultValue:I2(r._formValues,a,I2(r._defaultValues,a,e.defaultValue)),exact:!0}),d=PF({control:r,name:a,exact:!0}),f=X2.useRef(r.register(a,{...e.rules,value:u,...Ne(e.disabled)?{disabled:e.disabled}:{}})),v=X2.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!I2(d.errors,a)},isDirty:{enumerable:!0,get:()=>!!I2(d.dirtyFields,a)},isTouched:{enumerable:!0,get:()=>!!I2(d.touchedFields,a)},isValidating:{enumerable:!0,get:()=>!!I2(d.validatingFields,a)},error:{enumerable:!0,get:()=>I2(d.errors,a)}}),[d,a]),p=X2.useMemo(()=>({name:a,value:u,...Ne(n)||d.disabled?{disabled:d.disabled||n}:{},onChange:A=>f.current.onChange({target:{value:mS(A),name:a},type:Tc.CHANGE}),onBlur:()=>f.current.onBlur({target:{value:I2(r._formValues,a),name:a},type:Tc.BLUR}),ref:A=>{const E=I2(r._fields,a);E&&A&&(E._f.ref={focus:()=>A.focus(),select:()=>A.select(),setCustomValidity:_=>A.setCustomValidity(_),reportValidity:()=>A.reportValidity()})}}),[a,r._formValues,n,d.disabled,u,r._fields]);return X2.useEffect(()=>{const A=r._options.shouldUnregister||s,E=(_,S)=>{const z=I2(r._fields,_);z&&z._f&&(z._f.mount=S)};if(E(a,!0),A){const _=U1(I2(r._options.defaultValues,a));E0(r._defaultValues,a,_),K0(I2(r._formValues,a))&&E0(r._formValues,a,_)}return!o&&r.register(a),()=>{(o?A&&!r._state.action:A)?r.unregister(a):E(a,!1)}},[a,r,o,s]),X2.useEffect(()=>{r._updateDisabledField({disabled:n,fields:r._fields,name:a})},[n,a,r]),X2.useMemo(()=>({field:p,formState:d,fieldState:v}),[p,d,v])}const GF=e=>e.render(VF(e));var NS=(e,t,a,n,r)=>t?{...a[e],types:{...a[e]&&a[e].types?a[e].types:{},[n]:r||!0}}:{},lA=e=>({isOnSubmit:!e||e===Le.onSubmit,isOnBlur:e===Le.onBlur,isOnChange:e===Le.onChange,isOnAll:e===Le.all,isOnTouch:e===Le.onTouched}),rA=(e,t,a)=>!a&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(n)&&/^\.\w+/.test(e.slice(n.length))));const lr=(e,t,a,n)=>{for(const r of a||Object.keys(e)){const s=I2(e,r);if(s){const{_f:o,...u}=s;if(o){if(o.refs&&o.refs[0]&&t(o.refs[0],r)&&!n)return!0;if(o.ref&&t(o.ref,o.name)&&!n)return!0;if(lr(u,t))break}else if($0(u)&&lr(u,t))break}}};var jF=(e,t,a)=>{const n=nr(I2(e,a));return E0(n,"root",t[a]),E0(e,a,n),e},jh=e=>e.type==="file",Je=e=>typeof e=="function",kc=e=>{if(!Uh)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Ec=e=>e3(e),Kh=e=>e.type==="radio",Dc=e=>e instanceof RegExp;const iA={value:!1,isValid:!1},sA={value:!0,isValid:!0};var SS=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(a=>a&&a.checked&&!a.disabled).map(a=>a.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!K0(e[0].attributes.value)?K0(e[0].value)||e[0].value===""?sA:{value:e[0].value,isValid:!0}:sA:iA}return iA};const cA={isValid:!1,value:null};var yS=e=>Array.isArray(e)?e.reduce((t,a)=>a&&a.checked&&!a.disabled?{isValid:!0,value:a.value}:t,cA):cA;function oA(e,t,a="validate"){if(Ec(e)||Array.isArray(e)&&e.every(Ec)||Ne(e)&&!e)return{type:a,message:Ec(e)?e:"",ref:t}}var Ln=e=>$0(e)&&!Dc(e)?e:{value:e,message:""},uA=async(e,t,a,n,r,s)=>{const{ref:o,refs:u,required:d,maxLength:f,minLength:v,min:p,max:A,pattern:E,validate:_,name:S,valueAsNumber:z,mount:C}=e._f,M=I2(a,S);if(!C||t.has(S))return{};const x=u?u[0]:o,D=s2=>{r&&x.reportValidity&&(x.setCustomValidity(Ne(s2)?"":s2||""),x.reportValidity())},w={},b=Kh(o),T=ni(o),O=b||T,H=(z||jh(o))&&K0(o.value)&&K0(M)||kc(o)&&o.value===""||M===""||Array.isArray(M)&&!M.length,U=NS.bind(null,S,n,w),f2=(s2,h2,W,a2=b3.maxLength,V=b3.minLength)=>{const t2=s2?h2:W;w[S]={type:s2?a2:V,message:t2,ref:o,...U(s2?a2:V,t2)}};if(s?!Array.isArray(M)||!M.length:d&&(!O&&(H||D1(M))||Ne(M)&&!M||T&&!SS(u).isValid||b&&!yS(u).isValid)){const{value:s2,message:h2}=Ec(d)?{value:!!d,message:d}:Ln(d);if(s2&&(w[S]={type:b3.required,message:h2,ref:x,...U(b3.required,h2)},!n))return D(h2),w}if(!H&&(!D1(p)||!D1(A))){let s2,h2;const W=Ln(A),a2=Ln(p);if(!D1(M)&&!isNaN(M)){const V=o.valueAsNumber||M&&+M;D1(W.value)||(s2=V>W.value),D1(a2.value)||(h2=V<a2.value)}else{const V=o.valueAsDate||new Date(M),t2=F=>new Date(new Date().toDateString()+" "+F),J=o.type=="time",v2=o.type=="week";e3(W.value)&&M&&(s2=J?t2(M)>t2(W.value):v2?M>W.value:V>new Date(W.value)),e3(a2.value)&&M&&(h2=J?t2(M)<t2(a2.value):v2?M<a2.value:V<new Date(a2.value))}if((s2||h2)&&(f2(!!s2,W.message,a2.message,b3.max,b3.min),!n))return D(w[S].message),w}if((f||v)&&!H&&(e3(M)||s&&Array.isArray(M))){const s2=Ln(f),h2=Ln(v),W=!D1(s2.value)&&M.length>+s2.value,a2=!D1(h2.value)&&M.length<+h2.value;if((W||a2)&&(f2(W,s2.message,h2.message),!n))return D(w[S].message),w}if(E&&!H&&e3(M)){const{value:s2,message:h2}=Ln(E);if(Dc(s2)&&!M.match(s2)&&(w[S]={type:b3.pattern,message:h2,ref:o,...U(b3.pattern,h2)},!n))return D(h2),w}if(_){if(Je(_)){const s2=await _(M,a),h2=oA(s2,x);if(h2&&(w[S]={...h2,...U(b3.validate,h2.message)},!n))return D(h2.message),w}else if($0(_)){let s2={};for(const h2 in _){if(!V1(s2)&&!n)break;const W=oA(await _[h2](M,a),x,h2);W&&(s2={...W,...U(h2,W.message)},D(W.message),n&&(w[S]=s2))}if(!V1(s2)&&(w[S]={ref:x,...s2},!n))return w}}return D(!0),w};function KF(e,t){const a=t.slice(0,-1).length;let n=0;for(;n<a;)e=K0(e)?n++:e[t[n++]];return e}function $F(e){for(const t in e)if(e.hasOwnProperty(t)&&!K0(e[t]))return!1;return!0}function e1(e,t){const a=Array.isArray(t)?t:Vh(t)?[t]:pS(t),n=a.length===1?e:KF(e,a),r=a.length-1,s=a[r];return n&&delete n[s],r!==0&&($0(n)&&V1(n)||Array.isArray(n)&&$F(n))&&e1(e,a.slice(0,-1)),e}var $6=()=>{let e=[];return{get observers(){return e},next:r=>{for(const s of e)s.next&&s.next(r)},subscribe:r=>(e.push(r),{unsubscribe:()=>{e=e.filter(s=>s!==r)}}),unsubscribe:()=>{e=[]}}},u8=e=>D1(e)||!fS(e);function yt(e,t){if(u8(e)||u8(t))return e===t;if(Ma(e)&&Ma(t))return e.getTime()===t.getTime();const a=Object.keys(e),n=Object.keys(t);if(a.length!==n.length)return!1;for(const r of a){const s=e[r];if(!n.includes(r))return!1;if(r!=="ref"){const o=t[r];if(Ma(s)&&Ma(o)||$0(s)&&$0(o)||Array.isArray(s)&&Array.isArray(o)?!yt(s,o):s!==o)return!1}}return!0}var zS=e=>e.type==="select-multiple",YF=e=>Kh(e)||ni(e),Y6=e=>kc(e)&&e.isConnected,CS=e=>{for(const t in e)if(Je(e[t]))return!0;return!1};function Bc(e,t={}){const a=Array.isArray(e);if($0(e)||a)for(const n in e)Array.isArray(e[n])||$0(e[n])&&!CS(e[n])?(t[n]=Array.isArray(e[n])?[]:{},Bc(e[n],t[n])):D1(e[n])||(t[n]=!0);return t}function MS(e,t,a){const n=Array.isArray(e);if($0(e)||n)for(const r in e)Array.isArray(e[r])||$0(e[r])&&!CS(e[r])?K0(t)||u8(a[r])?a[r]=Array.isArray(e[r])?Bc(e[r],[]):{...Bc(e[r])}:MS(e[r],D1(t)?{}:t[r],a[r]):a[r]=!yt(e[r],t[r]);return a}var Fl=(e,t)=>MS(e,t,Bc(t)),RS=(e,{valueAsNumber:t,valueAsDate:a,setValueAs:n})=>K0(e)?e:t?e===""?NaN:e&&+e:a&&e3(e)?new Date(e):n?n(e):e;function Z6(e){const t=e.ref;return jh(t)?t.files:Kh(t)?yS(e.refs).value:zS(t)?[...t.selectedOptions].map(({value:a})=>a):ni(t)?SS(e.refs).value:RS(K0(t.value)?e.ref.value:t.value,e)}var ZF=(e,t,a,n)=>{const r={};for(const s of e){const o=I2(t,s);o&&E0(r,s,o._f)}return{criteriaMode:a,names:[...e],fields:r,shouldUseNativeValidation:n}},Hl=e=>K0(e)?e:Dc(e)?e.source:$0(e)?Dc(e.value)?e.value.source:e.value:e;const hA="AsyncFunction";var WF=e=>!!e&&!!e.validate&&!!(Je(e.validate)&&e.validate.constructor.name===hA||$0(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===hA)),qF=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function dA(e,t,a){const n=I2(e,a);if(n||Vh(a))return{error:n,name:a};const r=a.split(".");for(;r.length;){const s=r.join("."),o=I2(t,s),u=I2(e,s);if(o&&!Array.isArray(o)&&a!==s)return{name:a};if(u&&u.type)return{name:s,error:u};r.pop()}return{name:a}}var XF=(e,t,a,n,r)=>r.isOnAll?!1:!a&&r.isOnTouch?!(t||e):(a?n.isOnBlur:r.isOnBlur)?!e:(a?n.isOnChange:r.isOnChange)?e:!0,QF=(e,t)=>!Lo(I2(e,t)).length&&e1(e,t);const JF={mode:Le.onSubmit,reValidateMode:Le.onChange,shouldFocusError:!0};function eH(e={}){let t={...JF,...e},a={submitCount:0,isDirty:!1,isLoading:Je(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},n={},r=$0(t.defaultValues)||$0(t.values)?U1(t.defaultValues||t.values)||{}:{},s=t.shouldUnregister?{}:U1(r),o={action:!1,mount:!1,watch:!1},u={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},d,f=0;const v={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},p={values:$6(),array:$6(),state:$6()},A=lA(t.mode),E=lA(t.reValidateMode),_=t.criteriaMode===Le.all,S=P=>Q=>{clearTimeout(f),f=setTimeout(P,Q)},z=async P=>{if(!t.disabled&&(v.isValid||P)){const Q=t.resolver?V1((await O()).errors):await U(n,!0);Q!==a.isValid&&p.state.next({isValid:Q})}},C=(P,Q)=>{!t.disabled&&(v.isValidating||v.validatingFields)&&((P||Array.from(u.mount)).forEach(r2=>{r2&&(Q?E0(a.validatingFields,r2,Q):e1(a.validatingFields,r2))}),p.state.next({validatingFields:a.validatingFields,isValidating:!V1(a.validatingFields)}))},M=(P,Q=[],r2,y2,N2=!0,_2=!0)=>{if(y2&&r2&&!t.disabled){if(o.action=!0,_2&&Array.isArray(I2(n,P))){const b2=r2(I2(n,P),y2.argA,y2.argB);N2&&E0(n,P,b2)}if(_2&&Array.isArray(I2(a.errors,P))){const b2=r2(I2(a.errors,P),y2.argA,y2.argB);N2&&E0(a.errors,P,b2),QF(a.errors,P)}if(v.touchedFields&&_2&&Array.isArray(I2(a.touchedFields,P))){const b2=r2(I2(a.touchedFields,P),y2.argA,y2.argB);N2&&E0(a.touchedFields,P,b2)}v.dirtyFields&&(a.dirtyFields=Fl(r,s)),p.state.next({name:P,isDirty:s2(P,Q),dirtyFields:a.dirtyFields,errors:a.errors,isValid:a.isValid})}else E0(s,P,Q)},x=(P,Q)=>{E0(a.errors,P,Q),p.state.next({errors:a.errors})},D=P=>{a.errors=P,p.state.next({errors:a.errors,isValid:!1})},w=(P,Q,r2,y2)=>{const N2=I2(n,P);if(N2){const _2=I2(s,P,K0(r2)?I2(r,P):r2);K0(_2)||y2&&y2.defaultChecked||Q?E0(s,P,Q?_2:Z6(N2._f)):a2(P,_2),o.mount&&z()}},b=(P,Q,r2,y2,N2)=>{let _2=!1,b2=!1;const n0={name:P};if(!t.disabled){const U0=!!(I2(n,P)&&I2(n,P)._f&&I2(n,P)._f.disabled);if(!r2||y2){v.isDirty&&(b2=a.isDirty,a.isDirty=n0.isDirty=s2(),_2=b2!==n0.isDirty);const V0=U0||yt(I2(r,P),Q);b2=!!(!U0&&I2(a.dirtyFields,P)),V0||U0?e1(a.dirtyFields,P):E0(a.dirtyFields,P,!0),n0.dirtyFields=a.dirtyFields,_2=_2||v.dirtyFields&&b2!==!V0}if(r2){const V0=I2(a.touchedFields,P);V0||(E0(a.touchedFields,P,r2),n0.touchedFields=a.touchedFields,_2=_2||v.touchedFields&&V0!==r2)}_2&&N2&&p.state.next(n0)}return _2?n0:{}},T=(P,Q,r2,y2)=>{const N2=I2(a.errors,P),_2=v.isValid&&Ne(Q)&&a.isValid!==Q;if(t.delayError&&r2?(d=S(()=>x(P,r2)),d(t.delayError)):(clearTimeout(f),d=null,r2?E0(a.errors,P,r2):e1(a.errors,P)),(r2?!yt(N2,r2):N2)||!V1(y2)||_2){const b2={...y2,..._2&&Ne(Q)?{isValid:Q}:{},errors:a.errors,name:P};a={...a,...b2},p.state.next(b2)}},O=async P=>{C(P,!0);const Q=await t.resolver(s,t.context,ZF(P||u.mount,n,t.criteriaMode,t.shouldUseNativeValidation));return C(P),Q},H=async P=>{const{errors:Q}=await O(P);if(P)for(const r2 of P){const y2=I2(Q,r2);y2?E0(a.errors,r2,y2):e1(a.errors,r2)}else a.errors=Q;return Q},U=async(P,Q,r2={valid:!0})=>{for(const y2 in P){const N2=P[y2];if(N2){const{_f:_2,...b2}=N2;if(_2){const n0=u.array.has(_2.name),U0=N2._f&&WF(N2._f);U0&&v.validatingFields&&C([y2],!0);const V0=await uA(N2,u.disabled,s,_,t.shouldUseNativeValidation&&!Q,n0);if(U0&&v.validatingFields&&C([y2]),V0[_2.name]&&(r2.valid=!1,Q))break;!Q&&(I2(V0,_2.name)?n0?jF(a.errors,V0,_2.name):E0(a.errors,_2.name,V0[_2.name]):e1(a.errors,_2.name))}!V1(b2)&&await U(b2,Q,r2)}}return r2.valid},f2=()=>{for(const P of u.unMount){const Q=I2(n,P);Q&&(Q._f.refs?Q._f.refs.every(r2=>!Y6(r2)):!Y6(Q._f.ref))&&g2(P)}u.unMount=new Set},s2=(P,Q)=>!t.disabled&&(P&&Q&&E0(s,P,Q),!yt(q(),r)),h2=(P,Q,r2)=>IS(P,u,{...o.mount?s:K0(Q)?r:e3(P)?{[P]:Q}:Q},r2,Q),W=P=>Lo(I2(o.mount?s:r,P,t.shouldUnregister?I2(r,P,[]):[])),a2=(P,Q,r2={})=>{const y2=I2(n,P);let N2=Q;if(y2){const _2=y2._f;_2&&(!_2.disabled&&E0(s,P,RS(Q,_2)),N2=kc(_2.ref)&&D1(Q)?"":Q,zS(_2.ref)?[..._2.ref.options].forEach(b2=>b2.selected=N2.includes(b2.value)):_2.refs?ni(_2.ref)?_2.refs.length>1?_2.refs.forEach(b2=>(!b2.defaultChecked||!b2.disabled)&&(b2.checked=Array.isArray(N2)?!!N2.find(n0=>n0===b2.value):N2===b2.value)):_2.refs[0]&&(_2.refs[0].checked=!!N2):_2.refs.forEach(b2=>b2.checked=b2.value===N2):jh(_2.ref)?_2.ref.value="":(_2.ref.value=N2,_2.ref.type||p.values.next({name:P,values:{...s}})))}(r2.shouldDirty||r2.shouldTouch)&&b(P,N2,r2.shouldTouch,r2.shouldDirty,!0),r2.shouldValidate&&F(P)},V=(P,Q,r2)=>{for(const y2 in Q){const N2=Q[y2],_2=`${P}.${y2}`,b2=I2(n,_2);(u.array.has(P)||$0(N2)||b2&&!b2._f)&&!Ma(N2)?V(_2,N2,r2):a2(_2,N2,r2)}},t2=(P,Q,r2={})=>{const y2=I2(n,P),N2=u.array.has(P),_2=U1(Q);E0(s,P,_2),N2?(p.array.next({name:P,values:{...s}}),(v.isDirty||v.dirtyFields)&&r2.shouldDirty&&p.state.next({name:P,dirtyFields:Fl(r,s),isDirty:s2(P,_2)})):y2&&!y2._f&&!D1(_2)?V(P,_2,r2):a2(P,_2,r2),rA(P,u)&&p.state.next({...a}),p.values.next({name:o.mount?P:void 0,values:{...s}})},J=async P=>{o.mount=!0;const Q=P.target;let r2=Q.name,y2=!0;const N2=I2(n,r2),_2=()=>Q.type?Z6(N2._f):mS(P),b2=n0=>{y2=Number.isNaN(n0)||Ma(n0)&&isNaN(n0.getTime())||yt(n0,I2(s,r2,n0))};if(N2){let n0,U0;const V0=_2(),$1=P.type===Tc.BLUR||P.type===Tc.FOCUS_OUT,vu=!qF(N2._f)&&!t.resolver&&!I2(a.errors,r2)&&!N2._f.deps||XF($1,I2(a.touchedFields,r2),a.isSubmitted,E,A),Xa=rA(r2,u,$1);E0(s,r2,V0),$1?(N2._f.onBlur&&N2._f.onBlur(P),d&&d(0)):N2._f.onChange&&N2._f.onChange(P);const O4=b(r2,V0,$1,!1),pu=!V1(O4)||Xa;if(!$1&&p.values.next({name:r2,type:P.type,values:{...s}}),vu)return v.isValid&&(t.mode==="onBlur"&&$1?z():$1||z()),pu&&p.state.next({name:r2,...Xa?{}:O4});if(!$1&&Xa&&p.state.next({...a}),t.resolver){const{errors:Y3}=await O([r2]);if(b2(V0),y2){const b1=dA(a.errors,n,r2),Ii=dA(Y3,n,b1.name||r2);n0=Ii.error,r2=Ii.name,U0=V1(Y3)}}else C([r2],!0),n0=(await uA(N2,u.disabled,s,_,t.shouldUseNativeValidation))[r2],C([r2]),b2(V0),y2&&(n0?U0=!1:v.isValid&&(U0=await U(n,!0)));y2&&(N2._f.deps&&F(N2._f.deps),T(r2,U0,n0,O4))}},v2=(P,Q)=>{if(I2(a.errors,Q)&&P.focus)return P.focus(),1},F=async(P,Q={})=>{let r2,y2;const N2=nr(P);if(t.resolver){const _2=await H(K0(P)?P:N2);r2=V1(_2),y2=P?!N2.some(b2=>I2(_2,b2)):r2}else P?(y2=(await Promise.all(N2.map(async _2=>{const b2=I2(n,_2);return await U(b2&&b2._f?{[_2]:b2}:b2)}))).every(Boolean),!(!y2&&!a.isValid)&&z()):y2=r2=await U(n);return p.state.next({...!e3(P)||v.isValid&&r2!==a.isValid?{}:{name:P},...t.resolver||!P?{isValid:r2}:{},errors:a.errors}),Q.shouldFocus&&!y2&&lr(n,v2,P?N2:u.mount),y2},q=P=>{const Q={...o.mount?s:r};return K0(P)?Q:e3(P)?I2(Q,P):P.map(r2=>I2(Q,r2))},K=(P,Q)=>({invalid:!!I2((Q||a).errors,P),isDirty:!!I2((Q||a).dirtyFields,P),error:I2((Q||a).errors,P),isValidating:!!I2(a.validatingFields,P),isTouched:!!I2((Q||a).touchedFields,P)}),l2=P=>{P&&nr(P).forEach(Q=>e1(a.errors,Q)),p.state.next({errors:P?a.errors:{}})},n2=(P,Q,r2)=>{const y2=(I2(n,P,{_f:{}})._f||{}).ref,N2=I2(a.errors,P)||{},{ref:_2,message:b2,type:n0,...U0}=N2;E0(a.errors,P,{...U0,...Q,ref:y2}),p.state.next({name:P,errors:a.errors,isValid:!1}),r2&&r2.shouldFocus&&y2&&y2.focus&&y2.focus()},d2=(P,Q)=>Je(P)?p.values.subscribe({next:r2=>P(h2(void 0,Q),r2)}):h2(P,Q,!0),g2=(P,Q={})=>{for(const r2 of P?nr(P):u.mount)u.mount.delete(r2),u.array.delete(r2),Q.keepValue||(e1(n,r2),e1(s,r2)),!Q.keepError&&e1(a.errors,r2),!Q.keepDirty&&e1(a.dirtyFields,r2),!Q.keepTouched&&e1(a.touchedFields,r2),!Q.keepIsValidating&&e1(a.validatingFields,r2),!t.shouldUnregister&&!Q.keepDefaultValue&&e1(r,r2);p.values.next({values:{...s}}),p.state.next({...a,...Q.keepDirty?{isDirty:s2()}:{}}),!Q.keepIsValid&&z()},A2=({disabled:P,name:Q,field:r2,fields:y2})=>{(Ne(P)&&o.mount||P||u.disabled.has(Q))&&(P?u.disabled.add(Q):u.disabled.delete(Q),b(Q,Z6(r2?r2._f:I2(y2,Q)._f),!1,!1,!0))},z2=(P,Q={})=>{let r2=I2(n,P);const y2=Ne(Q.disabled)||Ne(t.disabled);return E0(n,P,{...r2||{},_f:{...r2&&r2._f?r2._f:{ref:{name:P}},name:P,mount:!0,...Q}}),u.mount.add(P),r2?A2({field:r2,disabled:Ne(Q.disabled)?Q.disabled:t.disabled,name:P}):w(P,!0,Q.value),{...y2?{disabled:Q.disabled||t.disabled}:{},...t.progressive?{required:!!Q.required,min:Hl(Q.min),max:Hl(Q.max),minLength:Hl(Q.minLength),maxLength:Hl(Q.maxLength),pattern:Hl(Q.pattern)}:{},name:P,onChange:J,onBlur:J,ref:N2=>{if(N2){z2(P,Q),r2=I2(n,P);const _2=K0(N2.value)&&N2.querySelectorAll&&N2.querySelectorAll("input,select,textarea")[0]||N2,b2=YF(_2),n0=r2._f.refs||[];if(b2?n0.find(U0=>U0===_2):_2===r2._f.ref)return;E0(n,P,{_f:{...r2._f,...b2?{refs:[...n0.filter(Y6),_2,...Array.isArray(I2(r,P))?[{}]:[]],ref:{type:_2.type,name:P}}:{ref:_2}}}),w(P,!1,void 0,_2)}else r2=I2(n,P,{}),r2._f&&(r2._f.mount=!1),(t.shouldUnregister||Q.shouldUnregister)&&!(vS(u.array,P)&&o.action)&&u.unMount.add(P)}}},Y2=()=>t.shouldFocusError&&lr(n,v2,u.mount),L2=P=>{Ne(P)&&(p.state.next({disabled:P}),lr(n,(Q,r2)=>{const y2=I2(n,r2);y2&&(Q.disabled=y2._f.disabled||P,Array.isArray(y2._f.refs)&&y2._f.refs.forEach(N2=>{N2.disabled=y2._f.disabled||P}))},0,!1))},J2=(P,Q)=>async r2=>{let y2;r2&&(r2.preventDefault&&r2.preventDefault(),r2.persist&&r2.persist());let N2=U1(s);if(u.disabled.size)for(const _2 of u.disabled)E0(N2,_2,void 0);if(p.state.next({isSubmitting:!0}),t.resolver){const{errors:_2,values:b2}=await O();a.errors=_2,N2=b2}else await U(n);if(e1(a.errors,"root"),V1(a.errors)){p.state.next({errors:{}});try{await P(N2,r2)}catch(_2){y2=_2}}else Q&&await Q({...a.errors},r2),Y2(),setTimeout(Y2);if(p.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:V1(a.errors)&&!y2,submitCount:a.submitCount+1,errors:a.errors}),y2)throw y2},u0=(P,Q={})=>{I2(n,P)&&(K0(Q.defaultValue)?t2(P,U1(I2(r,P))):(t2(P,Q.defaultValue),E0(r,P,U1(Q.defaultValue))),Q.keepTouched||e1(a.touchedFields,P),Q.keepDirty||(e1(a.dirtyFields,P),a.isDirty=Q.defaultValue?s2(P,U1(I2(r,P))):s2()),Q.keepError||(e1(a.errors,P),v.isValid&&z()),p.state.next({...a}))},M0=(P,Q={})=>{const r2=P?U1(P):r,y2=U1(r2),N2=V1(P),_2=N2?r:y2;if(Q.keepDefaultValues||(r=r2),!Q.keepValues){if(Q.keepDirtyValues){const b2=new Set([...u.mount,...Object.keys(Fl(r,s))]);for(const n0 of Array.from(b2))I2(a.dirtyFields,n0)?E0(_2,n0,I2(s,n0)):t2(n0,I2(_2,n0))}else{if(Uh&&K0(P))for(const b2 of u.mount){const n0=I2(n,b2);if(n0&&n0._f){const U0=Array.isArray(n0._f.refs)?n0._f.refs[0]:n0._f.ref;if(kc(U0)){const V0=U0.closest("form");if(V0){V0.reset();break}}}}n={}}s=t.shouldUnregister?Q.keepDefaultValues?U1(r):{}:U1(_2),p.array.next({values:{..._2}}),p.values.next({values:{..._2}})}u={mount:Q.keepDirtyValues?u.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},o.mount=!v.isValid||!!Q.keepIsValid||!!Q.keepDirtyValues,o.watch=!!t.shouldUnregister,p.state.next({submitCount:Q.keepSubmitCount?a.submitCount:0,isDirty:N2?!1:Q.keepDirty?a.isDirty:!!(Q.keepDefaultValues&&!yt(P,r)),isSubmitted:Q.keepIsSubmitted?a.isSubmitted:!1,dirtyFields:N2?{}:Q.keepDirtyValues?Q.keepDefaultValues&&s?Fl(r,s):a.dirtyFields:Q.keepDefaultValues&&P?Fl(r,P):Q.keepDirty?a.dirtyFields:{},touchedFields:Q.keepTouched?a.touchedFields:{},errors:Q.keepErrors?a.errors:{},isSubmitSuccessful:Q.keepIsSubmitSuccessful?a.isSubmitSuccessful:!1,isSubmitting:!1})},l1=(P,Q)=>M0(Je(P)?P(s):P,Q);return{control:{register:z2,unregister:g2,getFieldState:K,handleSubmit:J2,setError:n2,_executeSchema:O,_getWatch:h2,_getDirty:s2,_updateValid:z,_removeUnmounted:f2,_updateFieldArray:M,_updateDisabledField:A2,_getFieldArray:W,_reset:M0,_resetDefaultValues:()=>Je(t.defaultValues)&&t.defaultValues().then(P=>{l1(P,t.resetOptions),p.state.next({isLoading:!1})}),_updateFormState:P=>{a={...a,...P}},_disableForm:L2,_subjects:p,_proxyFormState:v,_setErrors:D,get _fields(){return n},get _formValues(){return s},get _state(){return o},set _state(P){o=P},get _defaultValues(){return r},get _names(){return u},set _names(P){u=P},get _formState(){return a},set _formState(P){a=P},get _options(){return t},set _options(P){t={...t,...P}}},trigger:F,register:z2,handleSubmit:J2,watch:d2,setValue:t2,getValues:q,reset:l1,resetField:u0,clearErrors:l2,unregister:g2,setError:n2,setFocus:(P,Q={})=>{const r2=I2(n,P),y2=r2&&r2._f;if(y2){const N2=y2.refs?y2.refs[0]:y2.ref;N2.focus&&(N2.focus(),Q.shouldSelect&&Je(N2.select)&&N2.select())}},getFieldState:K}}function tH(e={}){const t=X2.useRef(void 0),a=X2.useRef(void 0),[n,r]=X2.useState({isDirty:!1,isValidating:!1,isLoading:Je(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:Je(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...eH(e),formState:n});const s=t.current.control;return s._options=e,Gh({subject:s._subjects.state,next:o=>{ES(o,s._proxyFormState,s._updateFormState,!0)&&r({...s._formState})}}),X2.useEffect(()=>s._disableForm(e.disabled),[s,e.disabled]),X2.useEffect(()=>{if(s._proxyFormState.isDirty){const o=s._getDirty();o!==n.isDirty&&s._subjects.state.next({isDirty:o})}},[s,n.isDirty]),X2.useEffect(()=>{e.values&&!yt(e.values,a.current)?(s._reset(e.values,s._options.resetOptions),a.current=e.values,r(o=>({...o}))):s._resetDefaultValues()},[e.values,s]),X2.useEffect(()=>{e.errors&&s._setErrors(e.errors)},[e.errors,s]),X2.useEffect(()=>{s._state.mount||(s._updateValid(),s._state.mount=!0),s._state.watch&&(s._state.watch=!1,s._subjects.state.next({...s._formState})),s._removeUnmounted()}),X2.useEffect(()=>{e.shouldUnregister&&s._subjects.values.next({values:s._getWatch()})},[e.shouldUnregister,s]),t.current.formState=gS(n,s),t.current}const fA=(e,t,a)=>{if(e&&"reportValidity"in e){const n=I2(a,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},xS=(e,t)=>{for(const a in t.fields){const n=t.fields[a];n&&n.ref&&"reportValidity"in n.ref?fA(n.ref,a,e):n.refs&&n.refs.forEach(r=>fA(r,a,e))}},aH=(e,t)=>{t.shouldUseNativeValidation&&xS(e,t);const a={};for(const n in e){const r=I2(t.fields,n),s=Object.assign(e[n]||{},{ref:r&&r.ref});if(nH(t.names||Object.keys(e),n)){const o=Object.assign({},I2(a,n));E0(o,"root",s),E0(a,n,o)}else E0(a,n,s)}return a},nH=(e,t)=>e.some(a=>a.startsWith(t+".")),lH=e=>{const t=y.useId(),a=y.useMemo(()=>({id:t}),[t]);return I.jsx(wS,{value:a,children:I.jsx("div",{className:"flex flex-col gap-2 p-2",...e})})},wS=y.createContext({}),bS=y.createContext({}),rH=({...e})=>{const t=y.useMemo(()=>({name:e.name}),[e.name]);return I.jsx(bS,{value:t,children:I.jsx(GF,{...e})})},Vt=()=>{const e=y.useContext(bS),t=y.useContext(wS),{getFieldState:a,formState:n}=Ut(),r=a(e.name,n);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:s}=t;return{id:s,name:e.name,formItemId:`${s}-form-item`,formDescriptionId:`${s}-form-item-description`,formMessageId:`${s}-form-item-message`,...r}},TS=Me("",{variants:{variant:{default:["w-full select-text resize-none rounded-xl border-2 bg-input-background text-base md:text-sm text-input-text shadow-none outline-0 transition-all","border-input-border hover:border-input-border-hover focus:border-input-border-focus focus:outline-0 focus:[box-shadow:none]","aria-[invalid=true]:border-error","disabled:opacity-50"],invisible:["w-full border-none bg-inherit text-inherit outline-hidden ring-0"]},size:{md:"px-2 md:py-1 py-3",lg:"p-4 md:py-2"},validationStyleEnabled:{disabled:"",enabled:"valid:border-success invalid:border-error"}},defaultVariants:{variant:"default",size:"md",validationStyleEnabled:"disabled"}}),N4=({validationStyleEnabled:e=!1,variant:t,size:a,className:n,...r})=>I.jsx("input",{className:TS({variant:t,size:a,validationStyleEnabled:e?"enabled":"disabled",className:n}),...r}),iH=Me("",{variants:{variant:{default:["pointer rounded border-2 bg-input-background text-input-text shadow-none outline-0 transition-all","border-input-border hover:border-input-border-hover focus:border-input-border-focus focus:outline-0 focus:[box-shadow:none]","checked:bg-checkbox-checked checked:border-checkbox-checked-border","disabled:opacity-50"]},size:{sm:"size-4",md:"size-5",lg:"size-6"},color:{primary:"accent-primary",secondary:"accent-secondary",destructive:"accent-destructive",neutral:"accent-neutral",light:"accent-light",text:"accent-text",dark:"accent-dark",error:"accent-error",success:"accent-success",custom:"accent-custom"},validationStyleEnabled:{disabled:"",enabled:"valid:border-success invalid:border-error"}},defaultVariants:{variant:"default",color:"primary",validationStyleEnabled:"disabled",size:"md"}}),sH=({validationStyleEnabled:e=!1,label:t,size:a,color:n,variant:r,className:s,...o})=>{const u=y.useId();return I.jsxs(I.Fragment,{children:[I.jsx("input",{type:"checkbox",className:iH({variant:r,size:a,color:n,validationStyleEnabled:e?"enabled":"disabled",className:s}),id:u,...o}),I.jsx("label",{htmlFor:u,children:t})]})},cH=e=>{const[t,a]=y.useState(!1),n=s=>{s.preventDefault(),s.stopPropagation(),a(o=>!o)},r=t?_L:gL;return I.jsxs("div",{className:"relative",children:[I.jsx(N4,{...e,type:t?"text":"password"}),I.jsx("button",{"data-testid":"eye-icon",className:"absolute right-2 h-full flex-row items-center",onClick:n,"aria-label":t?"Hide password":"Show password",children:I.jsx(r,{className:"text-neutral mr-2 inline-block",size:20})})]})},kS=({className:e,variant:t,validationStyleEnabled:a=!1,...n})=>I.jsx("textarea",{className:C2("resize-none",TS({variant:t,validationStyleEnabled:a?"enabled":"disabled",className:e})),...n}),DS=({value:e="",onCancel:t,onSave:a,onClick:n,children:r,isDisabled:s,...o})=>{const[u,d]=y.useState(!1),f=y.useRef(null),v=_=>{_.stopPropagation(),d(!1),a()},p=_=>{_.stopPropagation(),d(!1),t()},A=!e||e===""?"-":e,E=y.useCallback(_=>{const S=window.getSelection();S&&S.toString().trim()!==""||f.current&&!f.current.contains(_.target)&&(d(!1),a())},[a]);return y.useEffect(()=>(u?document.addEventListener("click",E):document.removeEventListener("click",E),()=>document.removeEventListener("click",E)),[E,u]),I.jsxs("span",{className:"group/editable-field flex gap-2",role:"button",tabIndex:0,onClick:_=>{d(!0),n==null||n(_)},ref:f,...o,children:[I.jsxs("div",{className:C2("flex flex-1 gap-2",u?"display":"hidden"),children:[r,I.jsx(_0,{label:"Save",variant:"hoverable",size:"icon-sm",color:"text",Icon:I4,onClick:v,disabled:s,className:"!text-current"}),I.jsx(_0,{label:"Cancel",color:"text",variant:"hoverable",className:"!text-current",size:"icon-sm",Icon:Ya,onClick:p,disabled:s})]},String(u)),I.jsxs("div",{className:C2("flex flex-1 gap-2",u?"hidden":"display"),children:[I.jsx("span",{className:"ml-2 flex w-full whitespace-pre-wrap p-1 text-sm leading-6",children:A}),I.jsx(_0,{label:"Edit",Icon:xN,color:"text",variant:"hoverable",size:"icon-sm",className:"invisible !text-current group-hover/editable-field:visible",disabled:s,onClick:_=>{_.stopPropagation(),d(!0)}})]})]})},BS=({onSave:e,onCancel:t,ref:a,...n})=>{var d;const r=y.useRef(null),s=()=>{var f;e==null||e(((f=r.current)==null?void 0:f.value)??"")},o=()=>{r.current&&(r.current.value=r.current.defaultValue??""),t==null||t()};y.useImperativeHandle(a,()=>r.current);const u=y.useMemo(()=>{var f;return n.value??((f=r.current)==null?void 0:f.value)??n.defaultValue},[n.value,n.defaultValue,(d=r.current)==null?void 0:d.value]);return I.jsx(DS,{value:u,onCancel:o,onSave:s,children:I.jsx(N4,{ref:r,...n})})},mA=24,vA=12,$h=({className:e,autoSize:t=!0,onChange:a,maxRows:n=999,ref:r,...s})=>{const o=y.useRef(null);y.useImperativeHandle(r,()=>o.current);const u=y.useCallback(()=>{const v=o.current;if(!v||!t)return;const p=v.style;p.height="auto";const A=v.scrollHeight,E=mA*n+vA,_=mA+vA;p.height=Math.max(Math.min(A,E),_)+"px"},[t,n]);y.useEffect(()=>{u()},[s.value,s.defaultValue,u]);const d=v=>{a==null||a(v),u()},f=y.useCallback(v=>{o.current=v,v&&u()},[u]);return I.jsx(kS,{ref:f,onChange:d,className:C2("overflow-y-scroll",t?"resize-none":"",e),...s})},LS=({onSave:e,onCancel:t,ref:a,...n})=>{var d;const r=y.useRef(null);y.useImperativeHandle(a,()=>r.current);const s=()=>{var f;e==null||e(((f=r.current)==null?void 0:f.value)??"")},o=()=>{r.current&&(r.current.value=r.current.defaultValue??""),t==null||t()},u=n.value??((d=r.current)==null?void 0:d.value)??n.defaultValue??"";return I.jsx(DS,{value:u,onCancel:o,onSave:s,onClick:f=>{f.preventDefault(),f.stopPropagation()},children:I.jsx($h,{className:"leading-6",ref:r,onClick:f=>{f.preventDefault(),f.stopPropagation()},...n})})},oH=Me("focus:ring-ring inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-hidden focus:ring-2 focus:ring-offset-2",{variants:{color:{primary:"border-primary bg-primary text-primary hover:bg-primary-500",secondary:"border-secondary bg-secondary text-secondary hover:bg-secondary-300",destructive:"border-destructive bg-destructive text-destructive hover:bg-destructive-500",neutral:"border-neutral bg-neutral text-neutral hover:bg-neutral-600",light:"border-white bg-white text-white hover:bg-neutral-500",dark:"border-neutral-800 bg-neutral-800 text-neutral-800 hover:bg-neutral-900",text:"border-text bg-text text-text hover:opacity-80",custom:""},variant:{default:"rounded-lg text-text-opposite",none:"border-none bg-opacity-0 text-inherit hover:bg-opacity-0",outline:"rounded-lg border-[1.5px] bg-opacity-0 hover:bg-opacity-30",hoverable:"rounded-lg border-none bg-opacity-0 transition hover:bg-opacity-10"}},defaultVariants:{variant:"default",color:"primary"}}),uH=({className:e,variant:t,color:a,...n})=>I.jsx("div",{className:C2(oH({variant:t,color:a}),e),...n});var hH=$b.useId||(()=>{}),dH=0;function Ce(e){const[t,a]=y.useState(hH());return x1(()=>{a(n=>n??String(dH++))},[e]),t?`radix-${t}`:""}var W6="focusScope.autoFocusOnMount",q6="focusScope.autoFocusOnUnmount",pA={bubbles:!1,cancelable:!0},fH="FocusScope",Yh=y.forwardRef((e,t)=>{const{loop:a=!1,trapped:n=!1,onMountAutoFocus:r,onUnmountAutoFocus:s,...o}=e,[u,d]=y.useState(null),f=re(r),v=re(s),p=y.useRef(null),A=B0(t,S=>d(S)),E=y.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;y.useEffect(()=>{if(n){let S=function(x){if(E.paused||!u)return;const D=x.target;u.contains(D)?p.current=D:It(p.current,{select:!0})},z=function(x){if(E.paused||!u)return;const D=x.relatedTarget;D!==null&&(u.contains(D)||It(p.current,{select:!0}))},C=function(x){if(document.activeElement===document.body)for(const w of x)w.removedNodes.length>0&&It(u)};document.addEventListener("focusin",S),document.addEventListener("focusout",z);const M=new MutationObserver(C);return u&&M.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",S),document.removeEventListener("focusout",z),M.disconnect()}}},[n,u,E.paused]),y.useEffect(()=>{if(u){gA.add(E);const S=document.activeElement;if(!u.contains(S)){const C=new CustomEvent(W6,pA);u.addEventListener(W6,f),u.dispatchEvent(C),C.defaultPrevented||(mH(EH(OS(u)),{select:!0}),document.activeElement===S&&It(u))}return()=>{u.removeEventListener(W6,f),setTimeout(()=>{const C=new CustomEvent(q6,pA);u.addEventListener(q6,v),u.dispatchEvent(C),C.defaultPrevented||It(S??document.body,{select:!0}),u.removeEventListener(q6,v),gA.remove(E)},0)}}},[u,f,v,E]);const _=y.useCallback(S=>{if(!a&&!n||E.paused)return;const z=S.key==="Tab"&&!S.altKey&&!S.ctrlKey&&!S.metaKey,C=document.activeElement;if(z&&C){const M=S.currentTarget,[x,D]=vH(M);x&&D?!S.shiftKey&&C===D?(S.preventDefault(),a&&It(x,{select:!0})):S.shiftKey&&C===x&&(S.preventDefault(),a&&It(D,{select:!0})):C===M&&S.preventDefault()}},[a,n,E.paused]);return I.jsx(i0.div,{tabIndex:-1,...o,ref:A,onKeyDown:_})});Yh.displayName=fH;function mH(e,{select:t=!1}={}){const a=document.activeElement;for(const n of e)if(It(n,{select:t}),document.activeElement!==a)return}function vH(e){const t=OS(e),a=AA(t,e),n=AA(t.reverse(),e);return[a,n]}function OS(e){const t=[],a=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const r=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||r?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;a.nextNode();)t.push(a.currentNode);return t}function AA(e,t){for(const a of e)if(!pH(a,{upTo:t}))return a}function pH(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function AH(e){return e instanceof HTMLInputElement&&"select"in e}function It(e,{select:t=!1}={}){if(e&&e.focus){const a=document.activeElement;e.focus({preventScroll:!0}),e!==a&&AH(e)&&t&&e.select()}}var gA=gH();function gH(){let e=[];return{add(t){const a=e[0];t!==a&&(a==null||a.pause()),e=EA(e,t),e.unshift(t)},remove(t){var a;e=EA(e,t),(a=e[0])==null||a.resume()}}}function EA(e,t){const a=[...e],n=a.indexOf(t);return n!==-1&&a.splice(n,1),a}function EH(e){return e.filter(t=>t.tagName!=="A")}var X6=0;function FS(){y.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??_A()),document.body.insertAdjacentElement("beforeend",e[1]??_A()),X6++,()=>{X6===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),X6--}},[])}function _A(){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 _c="right-scroll-bar-position",Ic="width-before-scroll-bar",_H="with-scroll-bars-hidden",IH="--removed-body-scroll-bar-size";function Q6(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function NH(e,t){var a=y.useState(function(){return{value:e,callback:t,facade:{get current(){return a.value},set current(n){var r=a.value;r!==n&&(a.value=n,a.callback(n,r))}}}})[0];return a.callback=t,a.facade}var SH=typeof window<"u"?y.useLayoutEffect:y.useEffect,IA=new WeakMap;function yH(e,t){var a=NH(null,function(n){return e.forEach(function(r){return Q6(r,n)})});return SH(function(){var n=IA.get(a);if(n){var r=new Set(n),s=new Set(e),o=a.current;r.forEach(function(u){s.has(u)||Q6(u,null)}),s.forEach(function(u){r.has(u)||Q6(u,o)})}IA.set(a,e)},[e]),a}function zH(e){return e}function CH(e,t){t===void 0&&(t=zH);var a=[],n=!1,r={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return a.length?a[a.length-1]:e},useMedium:function(s){var o=t(s,n);return a.push(o),function(){a=a.filter(function(u){return u!==o})}},assignSyncMedium:function(s){for(n=!0;a.length;){var o=a;a=[],o.forEach(s)}a={push:function(u){return s(u)},filter:function(){return a}}},assignMedium:function(s){n=!0;var o=[];if(a.length){var u=a;a=[],u.forEach(s),o=a}var d=function(){var v=o;o=[],v.forEach(s)},f=function(){return Promise.resolve().then(d)};f(),a={push:function(v){o.push(v),f()},filter:function(v){return o=o.filter(v),a}}}};return r}function MH(e){e===void 0&&(e={});var t=CH(null);return t.options=Qe({async:!0,ssr:!1},e),t}var HS=function(e){var t=e.sideCar,a=PI(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return y.createElement(n,Qe({},a))};HS.isSideCarExport=!0;function RH(e,t){return e.useMedium(t),HS}var PS=MH(),J6=function(){},Oo=y.forwardRef(function(e,t){var a=y.useRef(null),n=y.useState({onScrollCapture:J6,onWheelCapture:J6,onTouchMoveCapture:J6}),r=n[0],s=n[1],o=e.forwardProps,u=e.children,d=e.className,f=e.removeScrollBar,v=e.enabled,p=e.shards,A=e.sideCar,E=e.noIsolation,_=e.inert,S=e.allowPinchZoom,z=e.as,C=z===void 0?"div":z,M=e.gapMode,x=PI(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),D=A,w=yH([a,t]),b=Qe(Qe({},x),r);return y.createElement(y.Fragment,null,v&&y.createElement(D,{sideCar:PS,removeScrollBar:f,shards:p,noIsolation:E,inert:_,setCallbacks:s,allowPinchZoom:!!S,lockRef:a,gapMode:M}),o?y.cloneElement(y.Children.only(u),Qe(Qe({},b),{ref:w})):y.createElement(C,Qe({},b,{className:d,ref:w}),u))});Oo.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Oo.classNames={fullWidth:Ic,zeroRight:_c};var xH=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function wH(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=xH();return t&&e.setAttribute("nonce",t),e}function bH(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function TH(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var kH=function(){var e=0,t=null;return{add:function(a){e==0&&(t=wH())&&(bH(t,a),TH(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},DH=function(){var e=kH();return function(t,a){y.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&a])}},US=function(){var e=DH(),t=function(a){var n=a.styles,r=a.dynamic;return e(n,r),null};return t},BH={left:0,top:0,right:0,gap:0},e7=function(e){return parseInt(e||"",10)||0},LH=function(e){var t=window.getComputedStyle(document.body),a=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],r=t[e==="padding"?"paddingRight":"marginRight"];return[e7(a),e7(n),e7(r)]},OH=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return BH;var t=LH(e),a=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-a+t[2]-t[0])}},FH=US(),Jn="data-scroll-locked",HH=function(e,t,a,n){var r=e.left,s=e.top,o=e.right,u=e.gap;return a===void 0&&(a="margin"),`
224
224
  .`.concat(_H,` {
225
225
  overflow: hidden `).concat(n,`;
226
226
  padding-right: `).concat(u,"px ").concat(n,`;
@@ -264,7 +264,7 @@ Please change the parent <Route path="${x}"> to <Route path="${x==="/"?"*":`${x}
264
264
 
265
265
  If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
266
266
 
267
- For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return y.useEffect(()=>{e&&(document.getElementById(e)||console.error(a))},[a,e]),null},mP="DialogDescriptionWarning",vP=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${ly(mP).contentName}}.`;return y.useEffect(()=>{var s;const r=(s=e.current)==null?void 0:s.getAttribute("aria-describedby");t&&r&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},pP=ZS,AP=XS,gP=QS,EP=JS,CA=1,_P=.9,IP=.8,NP=.17,a7=.1,n7=.999,SP=.9999,yP=.99,zP=/[\\\/_+.#"@\[\(\{&]/,CP=/[\\\/_+.#"@\[\(\{&]/g,MP=/[\s-]/,ry=/[\s-]/g;function d8(e,t,a,n,r,s,o){if(s===t.length)return r===e.length?CA:yP;var u=`${r},${s}`;if(o[u]!==void 0)return o[u];for(var d=n.charAt(s),f=a.indexOf(d,r),v=0,p,A,E,_;f>=0;)p=d8(e,t,a,n,f+1,s+1,o),p>v&&(f===r?p*=CA:zP.test(e.charAt(f-1))?(p*=IP,E=e.slice(r,f-1).match(CP),E&&r>0&&(p*=Math.pow(n7,E.length))):MP.test(e.charAt(f-1))?(p*=_P,_=e.slice(r,f-1).match(ry),_&&r>0&&(p*=Math.pow(n7,_.length))):(p*=NP,r>0&&(p*=Math.pow(n7,f-r))),e.charAt(f)!==t.charAt(s)&&(p*=SP)),(p<a7&&a.charAt(f-1)===n.charAt(s+1)||n.charAt(s+1)===n.charAt(s)&&a.charAt(f-1)!==n.charAt(s))&&(A=d8(e,t,a,n,f+1,s+2,o),A*a7>p&&(p=A*a7)),p>v&&(v=p),f=a.indexOf(d,f+1);return o[u]=v,v}function MA(e){return e.toLowerCase().replace(ry," ")}function RP(e,t,a){return e=a&&a.length>0?`${e+" "+a.join(" ")}`:e,d8(e,t,MA(e),MA(t),0,0,{})}var xP=TN(),Pl='[cmdk-group=""]',l7='[cmdk-group-items=""]',wP='[cmdk-group-heading=""]',Jh='[cmdk-item=""]',RA=`${Jh}:not([aria-disabled="true"])`,f8="cmdk-item-select",ya="data-value",bP=(e,t,a)=>RP(e,t,a),iy=y.createContext(void 0),li=()=>y.useContext(iy),sy=y.createContext(void 0),ed=()=>y.useContext(sy),cy=y.createContext(void 0),oy=y.forwardRef((e,t)=>{let a=Un(()=>{var K,l2;return{search:"",value:(l2=(K=e.value)!=null?K:e.defaultValue)!=null?l2:"",filtered:{count:0,items:new Map,groups:new Set}}}),n=Un(()=>new Set),r=Un(()=>new Map),s=Un(()=>new Map),o=Un(()=>new Set),u=uy(e),{label:d,children:f,value:v,onValueChange:p,filter:A,shouldFilter:E,loop:_,disablePointerSelection:S=!1,vimBindings:z=!0,...C}=e,M=Ce(),x=Ce(),D=Ce(),w=y.useRef(null),b=VP();Oa(()=>{if(v!==void 0){let K=v.trim();a.current.value=K,T.emit()}},[v]),Oa(()=>{b(6,h2)},[]);let T=y.useMemo(()=>({subscribe:K=>(o.current.add(K),()=>o.current.delete(K)),snapshot:()=>a.current,setState:(K,l2,n2)=>{var d2,g2,A2;if(!Object.is(a.current[K],l2)){if(a.current[K]=l2,K==="search")s2(),U(),b(1,f2);else if(K==="value"&&(n2||b(5,h2),((d2=u.current)==null?void 0:d2.value)!==void 0)){let z2=l2??"";(A2=(g2=u.current).onValueChange)==null||A2.call(g2,z2);return}T.emit()}},emit:()=>{o.current.forEach(K=>K())}}),[]),O=y.useMemo(()=>({value:(K,l2,n2)=>{var d2;l2!==((d2=s.current.get(K))==null?void 0:d2.value)&&(s.current.set(K,{value:l2,keywords:n2}),a.current.filtered.items.set(K,H(l2,n2)),b(2,()=>{U(),T.emit()}))},item:(K,l2)=>(n.current.add(K),l2&&(r.current.has(l2)?r.current.get(l2).add(K):r.current.set(l2,new Set([K]))),b(3,()=>{s2(),U(),a.current.value||f2(),T.emit()}),()=>{s.current.delete(K),n.current.delete(K),a.current.filtered.items.delete(K);let n2=W();b(4,()=>{s2(),(n2==null?void 0:n2.getAttribute("id"))===K&&f2(),T.emit()})}),group:K=>(r.current.has(K)||r.current.set(K,new Set),()=>{s.current.delete(K),r.current.delete(K)}),filter:()=>u.current.shouldFilter,label:d||e["aria-label"],getDisablePointerSelection:()=>u.current.disablePointerSelection,listId:M,inputId:D,labelId:x,listInnerRef:w}),[]);function H(K,l2){var n2,d2;let g2=(d2=(n2=u.current)==null?void 0:n2.filter)!=null?d2:bP;return K?g2(K,a.current.search,l2):0}function U(){if(!a.current.search||u.current.shouldFilter===!1)return;let K=a.current.filtered.items,l2=[];a.current.filtered.groups.forEach(d2=>{let g2=r.current.get(d2),A2=0;g2.forEach(z2=>{let Y2=K.get(z2);A2=Math.max(Y2,A2)}),l2.push([d2,A2])});let n2=w.current;a2().sort((d2,g2)=>{var A2,z2;let Y2=d2.getAttribute("id"),L2=g2.getAttribute("id");return((A2=K.get(L2))!=null?A2:0)-((z2=K.get(Y2))!=null?z2:0)}).forEach(d2=>{let g2=d2.closest(l7);g2?g2.appendChild(d2.parentElement===g2?d2:d2.closest(`${l7} > *`)):n2.appendChild(d2.parentElement===n2?d2:d2.closest(`${l7} > *`))}),l2.sort((d2,g2)=>g2[1]-d2[1]).forEach(d2=>{var g2;let A2=(g2=w.current)==null?void 0:g2.querySelector(`${Pl}[${ya}="${encodeURIComponent(d2[0])}"]`);A2==null||A2.parentElement.appendChild(A2)})}function f2(){let K=a2().find(n2=>n2.getAttribute("aria-disabled")!=="true"),l2=K==null?void 0:K.getAttribute(ya);T.setState("value",l2||void 0)}function s2(){var K,l2,n2,d2;if(!a.current.search||u.current.shouldFilter===!1){a.current.filtered.count=n.current.size;return}a.current.filtered.groups=new Set;let g2=0;for(let A2 of n.current){let z2=(l2=(K=s.current.get(A2))==null?void 0:K.value)!=null?l2:"",Y2=(d2=(n2=s.current.get(A2))==null?void 0:n2.keywords)!=null?d2:[],L2=H(z2,Y2);a.current.filtered.items.set(A2,L2),L2>0&&g2++}for(let[A2,z2]of r.current)for(let Y2 of z2)if(a.current.filtered.items.get(Y2)>0){a.current.filtered.groups.add(A2);break}a.current.filtered.count=g2}function h2(){var K,l2,n2;let d2=W();d2&&(((K=d2.parentElement)==null?void 0:K.firstChild)===d2&&((n2=(l2=d2.closest(Pl))==null?void 0:l2.querySelector(wP))==null||n2.scrollIntoView({block:"nearest"})),d2.scrollIntoView({block:"nearest"}))}function W(){var K;return(K=w.current)==null?void 0:K.querySelector(`${Jh}[aria-selected="true"]`)}function a2(){var K;return Array.from(((K=w.current)==null?void 0:K.querySelectorAll(RA))||[])}function V(K){let l2=a2()[K];l2&&T.setState("value",l2.getAttribute(ya))}function t2(K){var l2;let n2=W(),d2=a2(),g2=d2.findIndex(z2=>z2===n2),A2=d2[g2+K];(l2=u.current)!=null&&l2.loop&&(A2=g2+K<0?d2[d2.length-1]:g2+K===d2.length?d2[0]:d2[g2+K]),A2&&T.setState("value",A2.getAttribute(ya))}function J(K){let l2=W(),n2=l2==null?void 0:l2.closest(Pl),d2;for(;n2&&!d2;)n2=K>0?PP(n2,Pl):UP(n2,Pl),d2=n2==null?void 0:n2.querySelector(RA);d2?T.setState("value",d2.getAttribute(ya)):t2(K)}let v2=()=>V(a2().length-1),F=K=>{K.preventDefault(),K.metaKey?v2():K.altKey?J(1):t2(1)},q=K=>{K.preventDefault(),K.metaKey?V(0):K.altKey?J(-1):t2(-1)};return y.createElement(i0.div,{ref:t,tabIndex:-1,...C,"cmdk-root":"",onKeyDown:K=>{var l2;if((l2=C.onKeyDown)==null||l2.call(C,K),!K.defaultPrevented)switch(K.key){case"n":case"j":{z&&K.ctrlKey&&F(K);break}case"ArrowDown":{F(K);break}case"p":case"k":{z&&K.ctrlKey&&q(K);break}case"ArrowUp":{q(K);break}case"Home":{K.preventDefault(),V(0);break}case"End":{K.preventDefault(),v2();break}case"Enter":if(!K.nativeEvent.isComposing&&K.keyCode!==229){K.preventDefault();let n2=W();if(n2){let d2=new Event(f8);n2.dispatchEvent(d2)}}}}},y.createElement("label",{"cmdk-label":"",htmlFor:O.inputId,id:O.labelId,style:jP},d),Fo(e,K=>y.createElement(sy.Provider,{value:T},y.createElement(iy.Provider,{value:O},K))))}),TP=y.forwardRef((e,t)=>{var a,n;let r=Ce(),s=y.useRef(null),o=y.useContext(cy),u=li(),d=uy(e),f=(n=(a=d.current)==null?void 0:a.forceMount)!=null?n:o==null?void 0:o.forceMount;Oa(()=>{if(!f)return u.item(r,o==null?void 0:o.id)},[f]);let v=hy(r,s,[e.value,e.children,s],e.keywords),p=ed(),A=Fa(b=>b.value&&b.value===v.current),E=Fa(b=>f||u.filter()===!1?!0:b.search?b.filtered.items.get(r)>0:!0);y.useEffect(()=>{let b=s.current;if(!(!b||e.disabled))return b.addEventListener(f8,_),()=>b.removeEventListener(f8,_)},[E,e.onSelect,e.disabled]);function _(){var b,T;S(),(T=(b=d.current).onSelect)==null||T.call(b,v.current)}function S(){p.setState("value",v.current,!0)}if(!E)return null;let{disabled:z,value:C,onSelect:M,forceMount:x,keywords:D,...w}=e;return y.createElement(i0.div,{ref:vr([s,t]),...w,id:r,"cmdk-item":"",role:"option","aria-disabled":!!z,"aria-selected":!!A,"data-disabled":!!z,"data-selected":!!A,onPointerMove:z||u.getDisablePointerSelection()?void 0:S,onClick:z?void 0:_},e.children)}),kP=y.forwardRef((e,t)=>{let{heading:a,children:n,forceMount:r,...s}=e,o=Ce(),u=y.useRef(null),d=y.useRef(null),f=Ce(),v=li(),p=Fa(E=>r||v.filter()===!1?!0:E.search?E.filtered.groups.has(o):!0);Oa(()=>v.group(o),[]),hy(o,u,[e.value,e.heading,d]);let A=y.useMemo(()=>({id:o,forceMount:r}),[r]);return y.createElement(i0.div,{ref:vr([u,t]),...s,"cmdk-group":"",role:"presentation",hidden:p?void 0:!0},a&&y.createElement("div",{ref:d,"cmdk-group-heading":"","aria-hidden":!0,id:f},a),Fo(e,E=>y.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":a?f:void 0},y.createElement(cy.Provider,{value:A},E))))}),DP=y.forwardRef((e,t)=>{let{alwaysRender:a,...n}=e,r=y.useRef(null),s=Fa(o=>!o.search);return!a&&!s?null:y.createElement(i0.div,{ref:vr([r,t]),...n,"cmdk-separator":"",role:"separator"})}),BP=y.forwardRef((e,t)=>{let{onValueChange:a,...n}=e,r=e.value!=null,s=ed(),o=Fa(v=>v.search),u=Fa(v=>v.value),d=li(),f=y.useMemo(()=>{var v;let p=(v=d.listInnerRef.current)==null?void 0:v.querySelector(`${Jh}[${ya}="${encodeURIComponent(u)}"]`);return p==null?void 0:p.getAttribute("id")},[]);return y.useEffect(()=>{e.value!=null&&s.setState("search",e.value)},[e.value]),y.createElement(i0.input,{ref:t,...n,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":d.listId,"aria-labelledby":d.labelId,"aria-activedescendant":f,id:d.inputId,type:"text",value:r?e.value:o,onChange:v=>{r||s.setState("search",v.target.value),a==null||a(v.target.value)}})}),LP=y.forwardRef((e,t)=>{let{children:a,label:n="Suggestions",...r}=e,s=y.useRef(null),o=y.useRef(null),u=li();return y.useEffect(()=>{if(o.current&&s.current){let d=o.current,f=s.current,v,p=new ResizeObserver(()=>{v=requestAnimationFrame(()=>{let A=d.offsetHeight;f.style.setProperty("--cmdk-list-height",A.toFixed(1)+"px")})});return p.observe(d),()=>{cancelAnimationFrame(v),p.unobserve(d)}}},[]),y.createElement(i0.div,{ref:vr([s,t]),...r,"cmdk-list":"",role:"listbox","aria-label":n,id:u.listId},Fo(e,d=>y.createElement("div",{ref:vr([o,u.listInnerRef]),"cmdk-list-sizer":""},d)))}),OP=y.forwardRef((e,t)=>{let{open:a,onOpenChange:n,overlayClassName:r,contentClassName:s,container:o,...u}=e;return y.createElement(pP,{open:a,onOpenChange:n},y.createElement(AP,{container:o},y.createElement(gP,{"cmdk-overlay":"",className:r}),y.createElement(EP,{"aria-label":e.label,"cmdk-dialog":"",className:s},y.createElement(oy,{ref:t,...u}))))}),FP=y.forwardRef((e,t)=>Fa(a=>a.filtered.count===0)?y.createElement(i0.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),HP=y.forwardRef((e,t)=>{let{progress:a,children:n,label:r="Loading...",...s}=e;return y.createElement(i0.div,{ref:t,...s,"cmdk-loading":"",role:"progressbar","aria-valuenow":a,"aria-valuemin":0,"aria-valuemax":100,"aria-label":r},Fo(e,o=>y.createElement("div",{"aria-hidden":!0},o)))}),ri=Object.assign(oy,{List:LP,Item:TP,Input:BP,Group:kP,Separator:DP,Dialog:OP,Empty:FP,Loading:HP});function PP(e,t){let a=e.nextElementSibling;for(;a;){if(a.matches(t))return a;a=a.nextElementSibling}}function UP(e,t){let a=e.previousElementSibling;for(;a;){if(a.matches(t))return a;a=a.previousElementSibling}}function uy(e){let t=y.useRef(e);return Oa(()=>{t.current=e}),t}var Oa=typeof window>"u"?y.useEffect:y.useLayoutEffect;function Un(e){let t=y.useRef();return t.current===void 0&&(t.current=e()),t}function vr(e){return t=>{e.forEach(a=>{typeof a=="function"?a(t):a!=null&&(a.current=t)})}}function Fa(e){let t=ed(),a=()=>e(t.snapshot());return xP.useSyncExternalStore(t.subscribe,a,a)}function hy(e,t,a,n=[]){let r=y.useRef(),s=li();return Oa(()=>{var o;let u=(()=>{var f;for(let v of a){if(typeof v=="string")return v.trim();if(typeof v=="object"&&"current"in v)return v.current?(f=v.current.textContent)==null?void 0:f.trim():r.current}})(),d=n.map(f=>f.trim());s.value(e,u,d),(o=t.current)==null||o.setAttribute(ya,u),r.current=u}),r}var VP=()=>{let[e,t]=y.useState(),a=Un(()=>new Map);return Oa(()=>{a.current.forEach(n=>n()),a.current=new Map},[e]),(n,r)=>{a.current.set(n,r),t({})}};function GP(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Fo({asChild:e,children:t},a){return e&&y.isValidElement(t)?y.cloneElement(GP(t),{ref:t.ref},a(t.props.children)):a(t)}var jP={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const dy=({className:e,...t})=>I.jsx(ri,{className:C2("flex size-full flex-col overflow-hidden rounded-md",e),...t}),KP=({className:e,...t})=>I.jsxs("div",{className:"flex w-full items-center","cmdk-input-wrapper":"",children:[I.jsx(TL,{className:"mr-2 size-4 shrink-0 opacity-50"}),I.jsx(ri.Input,{className:C2("placeholder:text-muted-foreground outline-hidden flex w-full rounded-md bg-transparent text-sm disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}),$P=({className:e,...t})=>I.jsx(ri.List,{className:C2("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}),YP=e=>I.jsx(ri.Empty,{className:"py-6 text-center text-sm",...e}),ZP=({className:e,...t})=>I.jsx(ri.Item,{className:C2("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground outline-hidden relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50",e),...t}),Oc={...dy,Input:KP,List:$P,Empty:YP,Item:ZP},fy=y.createContext(null),Ho=()=>{const e=y.useContext(fy);if(!e)throw new Error("useMultiSelect must be used within MultiSelectProvider");return e},WP=({values:e,defaultValues:t,onValueChange:a,loop:n=!1,className:r,children:s,dir:o,...u})=>{const[d,f]=y.useState(t??[]),[v,p]=y.useState(""),[A,E]=y.useState(!1),[_,S]=y.useState(-1),z=y.useRef(null),[C,M]=y.useState(!1),[x,D]=y.useState("");y.useEffect(()=>{e&&f(e)},[e]);const w=y.useCallback(H=>{if(d.includes(H)){const U=d.filter(f2=>f2!==H);f(U),a==null||a(U)}else{const U=[...d,H];f(U),a==null||a(U)}},[d]),b=y.useCallback(H=>{H.preventDefault();const U=H.currentTarget,f2=U.value.substring(U.selectionStart??0,U.selectionEnd??0);D(f2),M(f2===v)},[v]),T=y.useCallback(H=>{H.stopPropagation();const U=z.current;if(!U)return;const f2=()=>{const W=_+1;S(W>d.length-1?n?0:-1:W)},s2=()=>{const W=_-1;S(W<0?d.length-1:W)},h2=()=>{const W=_-1<=0?d.length-1===0?-1:0:_-1;S(W)};switch(H.key){case"ArrowLeft":o==="rtl"?d.length>0&&(_!==-1||n)&&f2():d.length>0&&U.selectionStart===0&&s2();break;case"ArrowRight":o==="rtl"?d.length>0&&U.selectionStart===0&&s2():d.length>0&&(_!==-1||n)&&f2();break;case"Backspace":case"Delete":d.length>0&&(_!==-1&&_<d.length?(w(d[_]),h2()):(U.selectionStart===0&&x===v||C)&&w(d[d.length-1]));break;case"Enter":E(!0);break;case"Escape":_!==-1?S(-1):A&&E(!1);break}},[d,v,_,n]),O=y.useMemo(()=>({value:d,onValueChange:w,open:A,setOpen:E,inputValue:v,setInputValue:p,activeIndex:_,setActiveIndex:S,ref:z,handleSelect:b}),[d,w,A,E,v,p,_,S,z,b]);return I.jsx(fy,{value:O,children:I.jsx(dy,{onKeyDown:T,className:C2("flex w-full flex-col gap-2 overflow-visible bg-transparent",r),dir:o,...u,children:s})})},qP=({className:e,getBadgeValue:t=s=>s,validationStyleEnabled:a=!1,children:n,...r})=>{const{value:s,onValueChange:o,activeIndex:u}=Ho(),d=y.useCallback(f=>{f.preventDefault(),f.stopPropagation()},[]);return I.jsxs("div",{className:C2("flex w-full flex-col gap-3 rounded-lg p-1 py-2","border-input ring-offset-background placeholder:text-muted-foreground focus:ring-ring focus:outline-hidden flex w-full items-center justify-between whitespace-nowrap border px-3 py-2 text-sm focus:ring-1 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1","bg-input-background text-input-text w-full select-text resize-none rounded-xl border-2 px-2 py-1 text-sm shadow-none outline-0 transition-all","border-input-border hover:border-input-border-hover focus:border-input-border-focus focus:outline-0 focus:[box-shadow:none]","aria-[invalid=true]:border-error",a&&"valid:border-success invalid:border-error",e),...r,children:[s.length>0&&I.jsx("div",{className:"flex w-full flex-wrap gap-1",children:s.map((f,v)=>I.jsxs(uH,{className:C2("flex items-center gap-1 rounded-xl px-1",u===v&&"ring-muted-foreground ring-2"),color:"text",children:[I.jsx("span",{className:"text-xs",children:t(f)}),I.jsxs("button",{"aria-label":`Remove ${f} option`,"aria-roledescription":"button to remove option",onMouseDown:d,onClick:()=>o(f),children:[I.jsxs("span",{className:"sr-only",children:["Remove ",f," option"]}),I.jsx(Ya,{className:"size-4 cursor-pointer"})]})]},f))}),n]})},XP=({className:e,...t})=>{const{setOpen:a,inputValue:n,setInputValue:r,activeIndex:s,setActiveIndex:o,handleSelect:u,ref:d}=Ho();return I.jsx(Oc.Input,{...t,tabIndex:0,ref:d,value:n,onValueChange:s===-1?r:void 0,onSelect:u,onBlur:()=>a(!1),onFocus:()=>a(!0),onClick:()=>o(-1),className:C2("outline-hidden ml-2 flex-1 cursor-pointer",e,s!==-1&&"caret-transparent")})},QP=({children:e})=>{const{open:t}=Ho();return I.jsx("div",{className:"relative",children:t&&e})},JP=({className:e,children:t})=>I.jsxs(Oc.List,{className:C2("border-muted bg-input-background absolute top-0 z-10 flex w-full flex-col gap-2 rounded-lg border p-2 shadow-md transition-colors",e),children:[t,I.jsx(Oc.Empty,{children:I.jsx("span",{className:"text-muted-foreground",children:"No results found"})})]}),eU=({className:e,value:t,children:a,...n})=>{const{value:r,onValueChange:s,setInputValue:o}=Ho(),u=y.useCallback(f=>{f.preventDefault(),f.stopPropagation()},[]),d=r.includes(t);return I.jsxs(Oc.Item,{...n,onSelect:()=>{s(t),o("")},className:C2("flex cursor-pointer justify-between rounded-lg px-2 py-1 transition-colors","hover:bg-neutral/10",e,d&&"opacity-50",n.disabled&&"cursor-not-allowed opacity-50"),onMouseDown:u,children:[a,d&&I.jsx(I4,{className:"size-4"})]})},z1=WP;z1.Trigger=qP;z1.Input=XP;z1.Content=QP;z1.List=JP;z1.Item=eU;const tU=({className:e,children:t,...a})=>I.jsxs("i",{className:C2("text-xs text-neutral-400",e),...a,children:["ⓘ ",t]}),m8=({htmlFor:e,...t})=>I.jsx("label",{className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",htmlFor:e,...t}),aU=({className:e,...t})=>{const{error:a,formItemId:n}=Vt();return I.jsx(m8,{className:C2("mb-2",a&&"text-error",e),htmlFor:n,...t})},nU=({isRequired:e})=>e?I.jsx("span",{"aria-label":"Asterisk meaning the field is required",children:"*"}):I.jsx(I.Fragment,{}),my=({children:e,isRequired:t,info:a,htmlFor:n,className:r})=>I.jsxs("div",{className:"ml-1 flex gap-1 align-middle text-base leading-none",children:[e&&I.jsxs(aU,{htmlFor:n,className:Mo("font-bold",r),children:[e,I.jsx(nU,{isRequired:t})]}),a&&I.jsx(tU,{content:a})]});function xA(e,[t,a]){return Math.min(a,Math.max(t,e))}var lU=y.createContext(void 0);function rU(e){const t=y.useContext(lU);return e||t||"ltr"}const iU=["top","right","bottom","left"],Rt=Math.min,te=Math.max,Fc=Math.round,Ws=Math.floor,a3=e=>({x:e,y:e}),sU={left:"right",right:"left",bottom:"top",top:"bottom"},cU={start:"end",end:"start"};function v8(e,t,a){return te(e,Rt(t,a))}function P3(e,t){return typeof e=="function"?e(t):e}function U3(e){return e.split("-")[0]}function S4(e){return e.split("-")[1]}function td(e){return e==="x"?"y":"x"}function ad(e){return e==="y"?"height":"width"}function xt(e){return["top","bottom"].includes(U3(e))?"y":"x"}function nd(e){return td(xt(e))}function oU(e,t,a){a===void 0&&(a=!1);const n=S4(e),r=nd(e),s=ad(r);let o=r==="x"?n===(a?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(o=Hc(o)),[o,Hc(o)]}function uU(e){const t=Hc(e);return[p8(e),t,p8(t)]}function p8(e){return e.replace(/start|end/g,t=>cU[t])}function hU(e,t,a){const n=["left","right"],r=["right","left"],s=["top","bottom"],o=["bottom","top"];switch(e){case"top":case"bottom":return a?t?r:n:t?n:r;case"left":case"right":return t?s:o;default:return[]}}function dU(e,t,a,n){const r=S4(e);let s=hU(U3(e),a==="start",n);return r&&(s=s.map(o=>o+"-"+r),t&&(s=s.concat(s.map(p8)))),s}function Hc(e){return e.replace(/left|right|bottom|top/g,t=>sU[t])}function fU(e){return{top:0,right:0,bottom:0,left:0,...e}}function vy(e){return typeof e!="number"?fU(e):{top:e,right:e,bottom:e,left:e}}function Pc(e){const{x:t,y:a,width:n,height:r}=e;return{width:n,height:r,top:a,left:t,right:t+n,bottom:a+r,x:t,y:a}}function wA(e,t,a){let{reference:n,floating:r}=e;const s=xt(t),o=nd(t),u=ad(o),d=U3(t),f=s==="y",v=n.x+n.width/2-r.width/2,p=n.y+n.height/2-r.height/2,A=n[u]/2-r[u]/2;let E;switch(d){case"top":E={x:v,y:n.y-r.height};break;case"bottom":E={x:v,y:n.y+n.height};break;case"right":E={x:n.x+n.width,y:p};break;case"left":E={x:n.x-r.width,y:p};break;default:E={x:n.x,y:n.y}}switch(S4(t)){case"start":E[o]-=A*(a&&f?-1:1);break;case"end":E[o]+=A*(a&&f?-1:1);break}return E}const mU=async(e,t,a)=>{const{placement:n="bottom",strategy:r="absolute",middleware:s=[],platform:o}=a,u=s.filter(Boolean),d=await(o.isRTL==null?void 0:o.isRTL(t));let f=await o.getElementRects({reference:e,floating:t,strategy:r}),{x:v,y:p}=wA(f,n,d),A=n,E={},_=0;for(let S=0;S<u.length;S++){const{name:z,fn:C}=u[S],{x:M,y:x,data:D,reset:w}=await C({x:v,y:p,initialPlacement:n,placement:A,strategy:r,middlewareData:E,rects:f,platform:o,elements:{reference:e,floating:t}});v=M??v,p=x??p,E={...E,[z]:{...E[z],...D}},w&&_<=50&&(_++,typeof w=="object"&&(w.placement&&(A=w.placement),w.rects&&(f=w.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:r}):w.rects),{x:v,y:p}=wA(f,A,d)),S=-1)}return{x:v,y:p,placement:A,strategy:r,middlewareData:E}};async function pr(e,t){var a;t===void 0&&(t={});const{x:n,y:r,platform:s,rects:o,elements:u,strategy:d}=e,{boundary:f="clippingAncestors",rootBoundary:v="viewport",elementContext:p="floating",altBoundary:A=!1,padding:E=0}=P3(t,e),_=vy(E),z=u[A?p==="floating"?"reference":"floating":p],C=Pc(await s.getClippingRect({element:(a=await(s.isElement==null?void 0:s.isElement(z)))==null||a?z:z.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(u.floating)),boundary:f,rootBoundary:v,strategy:d})),M=p==="floating"?{x:n,y:r,width:o.floating.width,height:o.floating.height}:o.reference,x=await(s.getOffsetParent==null?void 0:s.getOffsetParent(u.floating)),D=await(s.isElement==null?void 0:s.isElement(x))?await(s.getScale==null?void 0:s.getScale(x))||{x:1,y:1}:{x:1,y:1},w=Pc(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:M,offsetParent:x,strategy:d}):M);return{top:(C.top-w.top+_.top)/D.y,bottom:(w.bottom-C.bottom+_.bottom)/D.y,left:(C.left-w.left+_.left)/D.x,right:(w.right-C.right+_.right)/D.x}}const vU=e=>({name:"arrow",options:e,async fn(t){const{x:a,y:n,placement:r,rects:s,platform:o,elements:u,middlewareData:d}=t,{element:f,padding:v=0}=P3(e,t)||{};if(f==null)return{};const p=vy(v),A={x:a,y:n},E=nd(r),_=ad(E),S=await o.getDimensions(f),z=E==="y",C=z?"top":"left",M=z?"bottom":"right",x=z?"clientHeight":"clientWidth",D=s.reference[_]+s.reference[E]-A[E]-s.floating[_],w=A[E]-s.reference[E],b=await(o.getOffsetParent==null?void 0:o.getOffsetParent(f));let T=b?b[x]:0;(!T||!await(o.isElement==null?void 0:o.isElement(b)))&&(T=u.floating[x]||s.floating[_]);const O=D/2-w/2,H=T/2-S[_]/2-1,U=Rt(p[C],H),f2=Rt(p[M],H),s2=U,h2=T-S[_]-f2,W=T/2-S[_]/2+O,a2=v8(s2,W,h2),V=!d.arrow&&S4(r)!=null&&W!==a2&&s.reference[_]/2-(W<s2?U:f2)-S[_]/2<0,t2=V?W<s2?W-s2:W-h2:0;return{[E]:A[E]+t2,data:{[E]:a2,centerOffset:W-a2-t2,...V&&{alignmentOffset:t2}},reset:V}}}),pU=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var a,n;const{placement:r,middlewareData:s,rects:o,initialPlacement:u,platform:d,elements:f}=t,{mainAxis:v=!0,crossAxis:p=!0,fallbackPlacements:A,fallbackStrategy:E="bestFit",fallbackAxisSideDirection:_="none",flipAlignment:S=!0,...z}=P3(e,t);if((a=s.arrow)!=null&&a.alignmentOffset)return{};const C=U3(r),M=xt(u),x=U3(u)===u,D=await(d.isRTL==null?void 0:d.isRTL(f.floating)),w=A||(x||!S?[Hc(u)]:uU(u)),b=_!=="none";!A&&b&&w.push(...dU(u,S,_,D));const T=[u,...w],O=await pr(t,z),H=[];let U=((n=s.flip)==null?void 0:n.overflows)||[];if(v&&H.push(O[C]),p){const W=oU(r,o,D);H.push(O[W[0]],O[W[1]])}if(U=[...U,{placement:r,overflows:H}],!H.every(W=>W<=0)){var f2,s2;const W=(((f2=s.flip)==null?void 0:f2.index)||0)+1,a2=T[W];if(a2)return{data:{index:W,overflows:U},reset:{placement:a2}};let V=(s2=U.filter(t2=>t2.overflows[0]<=0).sort((t2,J)=>t2.overflows[1]-J.overflows[1])[0])==null?void 0:s2.placement;if(!V)switch(E){case"bestFit":{var h2;const t2=(h2=U.filter(J=>{if(b){const v2=xt(J.placement);return v2===M||v2==="y"}return!0}).map(J=>[J.placement,J.overflows.filter(v2=>v2>0).reduce((v2,F)=>v2+F,0)]).sort((J,v2)=>J[1]-v2[1])[0])==null?void 0:h2[0];t2&&(V=t2);break}case"initialPlacement":V=u;break}if(r!==V)return{reset:{placement:V}}}return{}}}};function bA(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function TA(e){return iU.some(t=>e[t]>=0)}const AU=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:a}=t,{strategy:n="referenceHidden",...r}=P3(e,t);switch(n){case"referenceHidden":{const s=await pr(t,{...r,elementContext:"reference"}),o=bA(s,a.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:TA(o)}}}case"escaped":{const s=await pr(t,{...r,altBoundary:!0}),o=bA(s,a.floating);return{data:{escapedOffsets:o,escaped:TA(o)}}}default:return{}}}}};async function gU(e,t){const{placement:a,platform:n,elements:r}=e,s=await(n.isRTL==null?void 0:n.isRTL(r.floating)),o=U3(a),u=S4(a),d=xt(a)==="y",f=["left","top"].includes(o)?-1:1,v=s&&d?-1:1,p=P3(t,e);let{mainAxis:A,crossAxis:E,alignmentAxis:_}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return u&&typeof _=="number"&&(E=u==="end"?_*-1:_),d?{x:E*v,y:A*f}:{x:A*f,y:E*v}}const EU=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var a,n;const{x:r,y:s,placement:o,middlewareData:u}=t,d=await gU(t,e);return o===((a=u.offset)==null?void 0:a.placement)&&(n=u.arrow)!=null&&n.alignmentOffset?{}:{x:r+d.x,y:s+d.y,data:{...d,placement:o}}}}},_U=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:a,y:n,placement:r}=t,{mainAxis:s=!0,crossAxis:o=!1,limiter:u={fn:z=>{let{x:C,y:M}=z;return{x:C,y:M}}},...d}=P3(e,t),f={x:a,y:n},v=await pr(t,d),p=xt(U3(r)),A=td(p);let E=f[A],_=f[p];if(s){const z=A==="y"?"top":"left",C=A==="y"?"bottom":"right",M=E+v[z],x=E-v[C];E=v8(M,E,x)}if(o){const z=p==="y"?"top":"left",C=p==="y"?"bottom":"right",M=_+v[z],x=_-v[C];_=v8(M,_,x)}const S=u.fn({...t,[A]:E,[p]:_});return{...S,data:{x:S.x-a,y:S.y-n,enabled:{[A]:s,[p]:o}}}}}},IU=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:a,y:n,placement:r,rects:s,middlewareData:o}=t,{offset:u=0,mainAxis:d=!0,crossAxis:f=!0}=P3(e,t),v={x:a,y:n},p=xt(r),A=td(p);let E=v[A],_=v[p];const S=P3(u,t),z=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:0,crossAxis:0,...S};if(d){const x=A==="y"?"height":"width",D=s.reference[A]-s.floating[x]+z.mainAxis,w=s.reference[A]+s.reference[x]-z.mainAxis;E<D?E=D:E>w&&(E=w)}if(f){var C,M;const x=A==="y"?"width":"height",D=["top","left"].includes(U3(r)),w=s.reference[p]-s.floating[x]+(D&&((C=o.offset)==null?void 0:C[p])||0)+(D?0:z.crossAxis),b=s.reference[p]+s.reference[x]+(D?0:((M=o.offset)==null?void 0:M[p])||0)-(D?z.crossAxis:0);_<w?_=w:_>b&&(_=b)}return{[A]:E,[p]:_}}}},NU=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var a,n;const{placement:r,rects:s,platform:o,elements:u}=t,{apply:d=()=>{},...f}=P3(e,t),v=await pr(t,f),p=U3(r),A=S4(r),E=xt(r)==="y",{width:_,height:S}=s.floating;let z,C;p==="top"||p==="bottom"?(z=p,C=A===(await(o.isRTL==null?void 0:o.isRTL(u.floating))?"start":"end")?"left":"right"):(C=p,z=A==="end"?"top":"bottom");const M=S-v.top-v.bottom,x=_-v.left-v.right,D=Rt(S-v[z],M),w=Rt(_-v[C],x),b=!t.middlewareData.shift;let T=D,O=w;if((a=t.middlewareData.shift)!=null&&a.enabled.x&&(O=x),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(T=M),b&&!A){const U=te(v.left,0),f2=te(v.right,0),s2=te(v.top,0),h2=te(v.bottom,0);E?O=_-2*(U!==0||f2!==0?U+f2:te(v.left,v.right)):T=S-2*(s2!==0||h2!==0?s2+h2:te(v.top,v.bottom))}await d({...t,availableWidth:O,availableHeight:T});const H=await o.getDimensions(u.floating);return _!==H.width||S!==H.height?{reset:{rects:!0}}:{}}}};function Po(){return typeof window<"u"}function y4(e){return py(e)?(e.nodeName||"").toLowerCase():"#document"}function ne(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function f3(e){var t;return(t=(py(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function py(e){return Po()?e instanceof Node||e instanceof ne(e).Node:!1}function He(e){return Po()?e instanceof Element||e instanceof ne(e).Element:!1}function s3(e){return Po()?e instanceof HTMLElement||e instanceof ne(e).HTMLElement:!1}function kA(e){return!Po()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ne(e).ShadowRoot}function ii(e){const{overflow:t,overflowX:a,overflowY:n,display:r}=Pe(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+a)&&!["inline","contents"].includes(r)}function SU(e){return["table","td","th"].includes(y4(e))}function Uo(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function ld(e){const t=rd(),a=He(e)?Pe(e):e;return["transform","translate","scale","rotate","perspective"].some(n=>a[n]?a[n]!=="none":!1)||(a.containerType?a.containerType!=="normal":!1)||!t&&(a.backdropFilter?a.backdropFilter!=="none":!1)||!t&&(a.filter?a.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(n=>(a.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(a.contain||"").includes(n))}function yU(e){let t=wt(e);for(;s3(t)&&!s4(t);){if(ld(t))return t;if(Uo(t))return null;t=wt(t)}return null}function rd(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function s4(e){return["html","body","#document"].includes(y4(e))}function Pe(e){return ne(e).getComputedStyle(e)}function Vo(e){return He(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function wt(e){if(y4(e)==="html")return e;const t=e.assignedSlot||e.parentNode||kA(e)&&e.host||f3(e);return kA(t)?t.host:t}function Ay(e){const t=wt(e);return s4(t)?e.ownerDocument?e.ownerDocument.body:e.body:s3(t)&&ii(t)?t:Ay(t)}function Ar(e,t,a){var n;t===void 0&&(t=[]),a===void 0&&(a=!0);const r=Ay(e),s=r===((n=e.ownerDocument)==null?void 0:n.body),o=ne(r);if(s){const u=A8(o);return t.concat(o,o.visualViewport||[],ii(r)?r:[],u&&a?Ar(u):[])}return t.concat(r,Ar(r,[],a))}function A8(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function gy(e){const t=Pe(e);let a=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const r=s3(e),s=r?e.offsetWidth:a,o=r?e.offsetHeight:n,u=Fc(a)!==s||Fc(n)!==o;return u&&(a=s,n=o),{width:a,height:n,$:u}}function id(e){return He(e)?e:e.contextElement}function e4(e){const t=id(e);if(!s3(t))return a3(1);const a=t.getBoundingClientRect(),{width:n,height:r,$:s}=gy(t);let o=(s?Fc(a.width):a.width)/n,u=(s?Fc(a.height):a.height)/r;return(!o||!Number.isFinite(o))&&(o=1),(!u||!Number.isFinite(u))&&(u=1),{x:o,y:u}}const zU=a3(0);function Ey(e){const t=ne(e);return!rd()||!t.visualViewport?zU:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function CU(e,t,a){return t===void 0&&(t=!1),!a||t&&a!==ne(e)?!1:t}function Ha(e,t,a,n){t===void 0&&(t=!1),a===void 0&&(a=!1);const r=e.getBoundingClientRect(),s=id(e);let o=a3(1);t&&(n?He(n)&&(o=e4(n)):o=e4(e));const u=CU(s,a,n)?Ey(s):a3(0);let d=(r.left+u.x)/o.x,f=(r.top+u.y)/o.y,v=r.width/o.x,p=r.height/o.y;if(s){const A=ne(s),E=n&&He(n)?ne(n):n;let _=A,S=A8(_);for(;S&&n&&E!==_;){const z=e4(S),C=S.getBoundingClientRect(),M=Pe(S),x=C.left+(S.clientLeft+parseFloat(M.paddingLeft))*z.x,D=C.top+(S.clientTop+parseFloat(M.paddingTop))*z.y;d*=z.x,f*=z.y,v*=z.x,p*=z.y,d+=x,f+=D,_=ne(S),S=A8(_)}}return Pc({width:v,height:p,x:d,y:f})}function sd(e,t){const a=Vo(e).scrollLeft;return t?t.left+a:Ha(f3(e)).left+a}function _y(e,t,a){a===void 0&&(a=!1);const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-(a?0:sd(e,n)),s=n.top+t.scrollTop;return{x:r,y:s}}function MU(e){let{elements:t,rect:a,offsetParent:n,strategy:r}=e;const s=r==="fixed",o=f3(n),u=t?Uo(t.floating):!1;if(n===o||u&&s)return a;let d={scrollLeft:0,scrollTop:0},f=a3(1);const v=a3(0),p=s3(n);if((p||!p&&!s)&&((y4(n)!=="body"||ii(o))&&(d=Vo(n)),s3(n))){const E=Ha(n);f=e4(n),v.x=E.x+n.clientLeft,v.y=E.y+n.clientTop}const A=o&&!p&&!s?_y(o,d,!0):a3(0);return{width:a.width*f.x,height:a.height*f.y,x:a.x*f.x-d.scrollLeft*f.x+v.x+A.x,y:a.y*f.y-d.scrollTop*f.y+v.y+A.y}}function RU(e){return Array.from(e.getClientRects())}function xU(e){const t=f3(e),a=Vo(e),n=e.ownerDocument.body,r=te(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),s=te(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let o=-a.scrollLeft+sd(e);const u=-a.scrollTop;return Pe(n).direction==="rtl"&&(o+=te(t.clientWidth,n.clientWidth)-r),{width:r,height:s,x:o,y:u}}function wU(e,t){const a=ne(e),n=f3(e),r=a.visualViewport;let s=n.clientWidth,o=n.clientHeight,u=0,d=0;if(r){s=r.width,o=r.height;const f=rd();(!f||f&&t==="fixed")&&(u=r.offsetLeft,d=r.offsetTop)}return{width:s,height:o,x:u,y:d}}function bU(e,t){const a=Ha(e,!0,t==="fixed"),n=a.top+e.clientTop,r=a.left+e.clientLeft,s=s3(e)?e4(e):a3(1),o=e.clientWidth*s.x,u=e.clientHeight*s.y,d=r*s.x,f=n*s.y;return{width:o,height:u,x:d,y:f}}function DA(e,t,a){let n;if(t==="viewport")n=wU(e,a);else if(t==="document")n=xU(f3(e));else if(He(t))n=bU(t,a);else{const r=Ey(e);n={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return Pc(n)}function Iy(e,t){const a=wt(e);return a===t||!He(a)||s4(a)?!1:Pe(a).position==="fixed"||Iy(a,t)}function TU(e,t){const a=t.get(e);if(a)return a;let n=Ar(e,[],!1).filter(u=>He(u)&&y4(u)!=="body"),r=null;const s=Pe(e).position==="fixed";let o=s?wt(e):e;for(;He(o)&&!s4(o);){const u=Pe(o),d=ld(o);!d&&u.position==="fixed"&&(r=null),(s?!d&&!r:!d&&u.position==="static"&&!!r&&["absolute","fixed"].includes(r.position)||ii(o)&&!d&&Iy(e,o))?n=n.filter(v=>v!==o):r=u,o=wt(o)}return t.set(e,n),n}function kU(e){let{element:t,boundary:a,rootBoundary:n,strategy:r}=e;const o=[...a==="clippingAncestors"?Uo(t)?[]:TU(t,this._c):[].concat(a),n],u=o[0],d=o.reduce((f,v)=>{const p=DA(t,v,r);return f.top=te(p.top,f.top),f.right=Rt(p.right,f.right),f.bottom=Rt(p.bottom,f.bottom),f.left=te(p.left,f.left),f},DA(t,u,r));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function DU(e){const{width:t,height:a}=gy(e);return{width:t,height:a}}function BU(e,t,a){const n=s3(t),r=f3(t),s=a==="fixed",o=Ha(e,!0,s,t);let u={scrollLeft:0,scrollTop:0};const d=a3(0);if(n||!n&&!s)if((y4(t)!=="body"||ii(r))&&(u=Vo(t)),n){const A=Ha(t,!0,s,t);d.x=A.x+t.clientLeft,d.y=A.y+t.clientTop}else r&&(d.x=sd(r));const f=r&&!n&&!s?_y(r,u):a3(0),v=o.left+u.scrollLeft-d.x-f.x,p=o.top+u.scrollTop-d.y-f.y;return{x:v,y:p,width:o.width,height:o.height}}function r7(e){return Pe(e).position==="static"}function BA(e,t){if(!s3(e)||Pe(e).position==="fixed")return null;if(t)return t(e);let a=e.offsetParent;return f3(e)===a&&(a=a.ownerDocument.body),a}function Ny(e,t){const a=ne(e);if(Uo(e))return a;if(!s3(e)){let r=wt(e);for(;r&&!s4(r);){if(He(r)&&!r7(r))return r;r=wt(r)}return a}let n=BA(e,t);for(;n&&SU(n)&&r7(n);)n=BA(n,t);return n&&s4(n)&&r7(n)&&!ld(n)?a:n||yU(e)||a}const LU=async function(e){const t=this.getOffsetParent||Ny,a=this.getDimensions,n=await a(e.floating);return{reference:BU(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function OU(e){return Pe(e).direction==="rtl"}const FU={convertOffsetParentRelativeRectToViewportRelativeRect:MU,getDocumentElement:f3,getClippingRect:kU,getOffsetParent:Ny,getElementRects:LU,getClientRects:RU,getDimensions:DU,getScale:e4,isElement:He,isRTL:OU};function Sy(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function HU(e,t){let a=null,n;const r=f3(e);function s(){var u;clearTimeout(n),(u=a)==null||u.disconnect(),a=null}function o(u,d){u===void 0&&(u=!1),d===void 0&&(d=1),s();const f=e.getBoundingClientRect(),{left:v,top:p,width:A,height:E}=f;if(u||t(),!A||!E)return;const _=Ws(p),S=Ws(r.clientWidth-(v+A)),z=Ws(r.clientHeight-(p+E)),C=Ws(v),x={rootMargin:-_+"px "+-S+"px "+-z+"px "+-C+"px",threshold:te(0,Rt(1,d))||1};let D=!0;function w(b){const T=b[0].intersectionRatio;if(T!==d){if(!D)return o();T?o(!1,T):n=setTimeout(()=>{o(!1,1e-7)},1e3)}T===1&&!Sy(f,e.getBoundingClientRect())&&o(),D=!1}try{a=new IntersectionObserver(w,{...x,root:r.ownerDocument})}catch{a=new IntersectionObserver(w,x)}a.observe(e)}return o(!0),s}function PU(e,t,a,n){n===void 0&&(n={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:d=!1}=n,f=id(e),v=r||s?[...f?Ar(f):[],...Ar(t)]:[];v.forEach(C=>{r&&C.addEventListener("scroll",a,{passive:!0}),s&&C.addEventListener("resize",a)});const p=f&&u?HU(f,a):null;let A=-1,E=null;o&&(E=new ResizeObserver(C=>{let[M]=C;M&&M.target===f&&E&&(E.unobserve(t),cancelAnimationFrame(A),A=requestAnimationFrame(()=>{var x;(x=E)==null||x.observe(t)})),a()}),f&&!d&&E.observe(f),E.observe(t));let _,S=d?Ha(e):null;d&&z();function z(){const C=Ha(e);S&&!Sy(S,C)&&a(),S=C,_=requestAnimationFrame(z)}return a(),()=>{var C;v.forEach(M=>{r&&M.removeEventListener("scroll",a),s&&M.removeEventListener("resize",a)}),p==null||p(),(C=E)==null||C.disconnect(),E=null,d&&cancelAnimationFrame(_)}}const UU=EU,VU=_U,GU=pU,jU=NU,KU=AU,LA=vU,$U=IU,YU=(e,t,a)=>{const n=new Map,r={platform:FU,...a},s={...r.platform,_c:n};return mU(e,t,{...r,platform:s})};var Nc=typeof document<"u"?y.useLayoutEffect:y.useEffect;function Uc(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let a,n,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(a=e.length,a!==t.length)return!1;for(n=a;n--!==0;)if(!Uc(e[n],t[n]))return!1;return!0}if(r=Object.keys(e),a=r.length,a!==Object.keys(t).length)return!1;for(n=a;n--!==0;)if(!{}.hasOwnProperty.call(t,r[n]))return!1;for(n=a;n--!==0;){const s=r[n];if(!(s==="_owner"&&e.$$typeof)&&!Uc(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function yy(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function OA(e,t){const a=yy(e);return Math.round(t*a)/a}function i7(e){const t=y.useRef(e);return Nc(()=>{t.current=e}),t}function ZU(e){e===void 0&&(e={});const{placement:t="bottom",strategy:a="absolute",middleware:n=[],platform:r,elements:{reference:s,floating:o}={},transform:u=!0,whileElementsMounted:d,open:f}=e,[v,p]=y.useState({x:0,y:0,strategy:a,placement:t,middlewareData:{},isPositioned:!1}),[A,E]=y.useState(n);Uc(A,n)||E(n);const[_,S]=y.useState(null),[z,C]=y.useState(null),M=y.useCallback(J=>{J!==b.current&&(b.current=J,S(J))},[]),x=y.useCallback(J=>{J!==T.current&&(T.current=J,C(J))},[]),D=s||_,w=o||z,b=y.useRef(null),T=y.useRef(null),O=y.useRef(v),H=d!=null,U=i7(d),f2=i7(r),s2=i7(f),h2=y.useCallback(()=>{if(!b.current||!T.current)return;const J={placement:t,strategy:a,middleware:A};f2.current&&(J.platform=f2.current),YU(b.current,T.current,J).then(v2=>{const F={...v2,isPositioned:s2.current!==!1};W.current&&!Uc(O.current,F)&&(O.current=F,$a.flushSync(()=>{p(F)}))})},[A,t,a,f2,s2]);Nc(()=>{f===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,p(J=>({...J,isPositioned:!1})))},[f]);const W=y.useRef(!1);Nc(()=>(W.current=!0,()=>{W.current=!1}),[]),Nc(()=>{if(D&&(b.current=D),w&&(T.current=w),D&&w){if(U.current)return U.current(D,w,h2);h2()}},[D,w,h2,U,H]);const a2=y.useMemo(()=>({reference:b,floating:T,setReference:M,setFloating:x}),[M,x]),V=y.useMemo(()=>({reference:D,floating:w}),[D,w]),t2=y.useMemo(()=>{const J={position:a,left:0,top:0};if(!V.floating)return J;const v2=OA(V.floating,v.x),F=OA(V.floating,v.y);return u?{...J,transform:"translate("+v2+"px, "+F+"px)",...yy(V.floating)>=1.5&&{willChange:"transform"}}:{position:a,left:v2,top:F}},[a,u,V.floating,v.x,v.y]);return y.useMemo(()=>({...v,update:h2,refs:a2,elements:V,floatingStyles:t2}),[v,h2,a2,V,t2])}const WU=e=>{function t(a){return{}.hasOwnProperty.call(a,"current")}return{name:"arrow",options:e,fn(a){const{element:n,padding:r}=typeof e=="function"?e(a):e;return n&&t(n)?n.current!=null?LA({element:n.current,padding:r}).fn(a):{}:n?LA({element:n,padding:r}).fn(a):{}}}},qU=(e,t)=>({...UU(e),options:[e,t]}),XU=(e,t)=>({...VU(e),options:[e,t]}),QU=(e,t)=>({...$U(e),options:[e,t]}),JU=(e,t)=>({...GU(e),options:[e,t]}),eV=(e,t)=>({...jU(e),options:[e,t]}),tV=(e,t)=>({...KU(e),options:[e,t]}),aV=(e,t)=>({...WU(e),options:[e,t]});var nV="Arrow",zy=y.forwardRef((e,t)=>{const{children:a,width:n=10,height:r=5,...s}=e;return I.jsx(i0.svg,{...s,ref:t,width:n,height:r,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?a:I.jsx("polygon",{points:"0,0 30,0 15,10"})})});zy.displayName=nV;var lV=zy;function rV(e){const[t,a]=y.useState(void 0);return x1(()=>{if(e){a({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const s=r[0];let o,u;if("borderBoxSize"in s){const d=s.borderBoxSize,f=Array.isArray(d)?d[0]:d;o=f.inlineSize,u=f.blockSize}else o=e.offsetWidth,u=e.offsetHeight;a({width:o,height:u})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else a(void 0)},[e]),t}var cd="Popper",[Cy,My]=ti(cd),[iV,Ry]=Cy(cd),xy=e=>{const{__scopePopper:t,children:a}=e,[n,r]=y.useState(null);return I.jsx(iV,{scope:t,anchor:n,onAnchorChange:r,children:a})};xy.displayName=cd;var wy="PopperAnchor",by=y.forwardRef((e,t)=>{const{__scopePopper:a,virtualRef:n,...r}=e,s=Ry(wy,a),o=y.useRef(null),u=B0(t,o);return y.useEffect(()=>{s.onAnchorChange((n==null?void 0:n.current)||o.current)}),n?null:I.jsx(i0.div,{...r,ref:u})});by.displayName=wy;var od="PopperContent",[sV,cV]=Cy(od),Ty=y.forwardRef((e,t)=>{var A2,z2,Y2,L2,J2,u0;const{__scopePopper:a,side:n="bottom",sideOffset:r=0,align:s="center",alignOffset:o=0,arrowPadding:u=0,avoidCollisions:d=!0,collisionBoundary:f=[],collisionPadding:v=0,sticky:p="partial",hideWhenDetached:A=!1,updatePositionStrategy:E="optimized",onPlaced:_,...S}=e,z=Ry(od,a),[C,M]=y.useState(null),x=B0(t,M0=>M(M0)),[D,w]=y.useState(null),b=rV(D),T=(b==null?void 0:b.width)??0,O=(b==null?void 0:b.height)??0,H=n+(s!=="center"?"-"+s:""),U=typeof v=="number"?v:{top:0,right:0,bottom:0,left:0,...v},f2=Array.isArray(f)?f:[f],s2=f2.length>0,h2={padding:U,boundary:f2.filter(uV),altBoundary:s2},{refs:W,floatingStyles:a2,placement:V,isPositioned:t2,middlewareData:J}=ZU({strategy:"fixed",placement:H,whileElementsMounted:(...M0)=>PU(...M0,{animationFrame:E==="always"}),elements:{reference:z.anchor},middleware:[qU({mainAxis:r+O,alignmentAxis:o}),d&&XU({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?QU():void 0,...h2}),d&&JU({...h2}),eV({...h2,apply:({elements:M0,rects:l1,availableWidth:Re,availableHeight:K1})=>{const{width:je,height:P}=l1.reference,Q=M0.floating.style;Q.setProperty("--radix-popper-available-width",`${Re}px`),Q.setProperty("--radix-popper-available-height",`${K1}px`),Q.setProperty("--radix-popper-anchor-width",`${je}px`),Q.setProperty("--radix-popper-anchor-height",`${P}px`)}}),D&&aV({element:D,padding:u}),hV({arrowWidth:T,arrowHeight:O}),A&&tV({strategy:"referenceHidden",...h2})]}),[v2,F]=By(V),q=re(_);x1(()=>{t2&&(q==null||q())},[t2,q]);const K=(A2=J.arrow)==null?void 0:A2.x,l2=(z2=J.arrow)==null?void 0:z2.y,n2=((Y2=J.arrow)==null?void 0:Y2.centerOffset)!==0,[d2,g2]=y.useState();return x1(()=>{C&&g2(window.getComputedStyle(C).zIndex)},[C]),I.jsx("div",{ref:W.setFloating,"data-radix-popper-content-wrapper":"",style:{...a2,transform:t2?a2.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:d2,"--radix-popper-transform-origin":[(L2=J.transformOrigin)==null?void 0:L2.x,(J2=J.transformOrigin)==null?void 0:J2.y].join(" "),...((u0=J.hide)==null?void 0:u0.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:I.jsx(sV,{scope:a,placedSide:v2,onArrowChange:w,arrowX:K,arrowY:l2,shouldHideArrow:n2,children:I.jsx(i0.div,{"data-side":v2,"data-align":F,...S,ref:x,style:{...S.style,animation:t2?void 0:"none"}})})})});Ty.displayName=od;var ky="PopperArrow",oV={top:"bottom",right:"left",bottom:"top",left:"right"},Dy=y.forwardRef(function(t,a){const{__scopePopper:n,...r}=t,s=cV(ky,n),o=oV[s.placedSide];return I.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:I.jsx(lV,{...r,ref:a,style:{...r.style,display:"block"}})})});Dy.displayName=ky;function uV(e){return e!==null}var hV=e=>({name:"transformOrigin",options:e,fn(t){var z,C,M;const{placement:a,rects:n,middlewareData:r}=t,o=((z=r.arrow)==null?void 0:z.centerOffset)!==0,u=o?0:e.arrowWidth,d=o?0:e.arrowHeight,[f,v]=By(a),p={start:"0%",center:"50%",end:"100%"}[v],A=(((C=r.arrow)==null?void 0:C.x)??0)+u/2,E=(((M=r.arrow)==null?void 0:M.y)??0)+d/2;let _="",S="";return f==="bottom"?(_=o?p:`${A}px`,S=`${-d}px`):f==="top"?(_=o?p:`${A}px`,S=`${n.floating.height+d}px`):f==="right"?(_=`${-d}px`,S=o?p:`${E}px`):f==="left"&&(_=`${n.floating.width+d}px`,S=o?p:`${E}px`),{data:{x:_,y:S}}}});function By(e){const[t,a="center"]=e.split("-");return[t,a]}var dV=xy,fV=by,mV=Ty,vV=Dy;function pV(e){const t=y.useRef({value:e,previous:e});return y.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var AV=[" ","Enter","ArrowUp","ArrowDown"],gV=[" ","Enter"],si="Select",[Go,jo,EV]=PN(si),[z4,un2]=ti(si,[EV,My]),Ko=My(),[_V,Gt]=z4(si),[IV,NV]=z4(si),Ly=e=>{const{__scopeSelect:t,children:a,open:n,defaultOpen:r,onOpenChange:s,value:o,defaultValue:u,onValueChange:d,dir:f,name:v,autoComplete:p,disabled:A,required:E,form:_}=e,S=Ko(t),[z,C]=y.useState(null),[M,x]=y.useState(null),[D,w]=y.useState(!1),b=rU(f),[T=!1,O]=bc({prop:n,defaultProp:r,onChange:s}),[H,U]=bc({prop:o,defaultProp:u,onChange:d}),f2=y.useRef(null),s2=z?_||!!z.closest("form"):!0,[h2,W]=y.useState(new Set),a2=Array.from(h2).map(V=>V.props.value).join(";");return I.jsx(dV,{...S,children:I.jsxs(_V,{required:E,scope:t,trigger:z,onTriggerChange:C,valueNode:M,onValueNodeChange:x,valueNodeHasChildren:D,onValueNodeHasChildrenChange:w,contentId:Ce(),value:H,onValueChange:U,open:T,onOpenChange:O,dir:b,triggerPointerDownPosRef:f2,disabled:A,children:[I.jsx(Go.Provider,{scope:t,children:I.jsx(IV,{scope:e.__scopeSelect,onNativeOptionAdd:y.useCallback(V=>{W(t2=>new Set(t2).add(V))},[]),onNativeOptionRemove:y.useCallback(V=>{W(t2=>{const J=new Set(t2);return J.delete(V),J})},[]),children:a})}),s2?I.jsxs(cz,{"aria-hidden":!0,required:E,tabIndex:-1,name:v,autoComplete:p,value:H,onChange:V=>U(V.target.value),disabled:A,form:_,children:[H===void 0?I.jsx("option",{value:""}):null,Array.from(h2)]},a2):null]})})};Ly.displayName=si;var Oy="SelectTrigger",Fy=y.forwardRef((e,t)=>{const{__scopeSelect:a,disabled:n=!1,...r}=e,s=Ko(a),o=Gt(Oy,a),u=o.disabled||n,d=B0(t,o.onTriggerChange),f=jo(a),v=y.useRef("touch"),[p,A,E]=oz(S=>{const z=f().filter(x=>!x.disabled),C=z.find(x=>x.value===o.value),M=uz(z,S,C);M!==void 0&&o.onValueChange(M.value)}),_=S=>{u||(o.onOpenChange(!0),E()),S&&(o.triggerPointerDownPosRef.current={x:Math.round(S.pageX),y:Math.round(S.pageY)})};return I.jsx(fV,{asChild:!0,...s,children:I.jsx(i0.button,{type:"button",role:"combobox","aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:u,"data-disabled":u?"":void 0,"data-placeholder":sz(o.value)?"":void 0,...r,ref:d,onClick:m0(r.onClick,S=>{S.currentTarget.focus(),v.current!=="mouse"&&_(S)}),onPointerDown:m0(r.onPointerDown,S=>{v.current=S.pointerType;const z=S.target;z.hasPointerCapture(S.pointerId)&&z.releasePointerCapture(S.pointerId),S.button===0&&S.ctrlKey===!1&&S.pointerType==="mouse"&&(_(S),S.preventDefault())}),onKeyDown:m0(r.onKeyDown,S=>{const z=p.current!=="";!(S.ctrlKey||S.altKey||S.metaKey)&&S.key.length===1&&A(S.key),!(z&&S.key===" ")&&AV.includes(S.key)&&(_(),S.preventDefault())})})})});Fy.displayName=Oy;var Hy="SelectValue",Py=y.forwardRef((e,t)=>{const{__scopeSelect:a,className:n,style:r,children:s,placeholder:o="",...u}=e,d=Gt(Hy,a),{onValueNodeHasChildrenChange:f}=d,v=s!==void 0,p=B0(t,d.onValueNodeChange);return x1(()=>{f(v)},[f,v]),I.jsx(i0.span,{...u,ref:p,style:{pointerEvents:"none"},children:sz(d.value)?I.jsx(I.Fragment,{children:o}):s})});Py.displayName=Hy;var SV="SelectIcon",Uy=y.forwardRef((e,t)=>{const{__scopeSelect:a,children:n,...r}=e;return I.jsx(i0.span,{"aria-hidden":!0,...r,ref:t,children:n||"▼"})});Uy.displayName=SV;var yV="SelectPortal",Vy=e=>I.jsx(bo,{asChild:!0,...e});Vy.displayName=yV;var Pa="SelectContent",Gy=y.forwardRef((e,t)=>{const a=Gt(Pa,e.__scopeSelect),[n,r]=y.useState();if(x1(()=>{r(new DocumentFragment)},[]),!a.open){const s=n;return s?$a.createPortal(I.jsx(jy,{scope:e.__scopeSelect,children:I.jsx(Go.Slot,{scope:e.__scopeSelect,children:I.jsx("div",{children:e.children})})}),s):null}return I.jsx(Ky,{...e,ref:t})});Gy.displayName=Pa;var De=10,[jy,jt]=z4(Pa),zV="SelectContentImpl",Ky=y.forwardRef((e,t)=>{const{__scopeSelect:a,position:n="item-aligned",onCloseAutoFocus:r,onEscapeKeyDown:s,onPointerDownOutside:o,side:u,sideOffset:d,align:f,alignOffset:v,arrowPadding:p,collisionBoundary:A,collisionPadding:E,sticky:_,hideWhenDetached:S,avoidCollisions:z,...C}=e,M=Gt(Pa,a),[x,D]=y.useState(null),[w,b]=y.useState(null),T=B0(t,A2=>D(A2)),[O,H]=y.useState(null),[U,f2]=y.useState(null),s2=jo(a),[h2,W]=y.useState(!1),a2=y.useRef(!1);y.useEffect(()=>{if(x)return $S(x)},[x]),FS();const V=y.useCallback(A2=>{const[z2,...Y2]=s2().map(u0=>u0.ref.current),[L2]=Y2.slice(-1),J2=document.activeElement;for(const u0 of A2)if(u0===J2||(u0==null||u0.scrollIntoView({block:"nearest"}),u0===z2&&w&&(w.scrollTop=0),u0===L2&&w&&(w.scrollTop=w.scrollHeight),u0==null||u0.focus(),document.activeElement!==J2))return},[s2,w]),t2=y.useCallback(()=>V([O,x]),[V,O,x]);y.useEffect(()=>{h2&&t2()},[h2,t2]);const{onOpenChange:J,triggerPointerDownPosRef:v2}=M;y.useEffect(()=>{if(x){let A2={x:0,y:0};const z2=L2=>{var J2,u0;A2={x:Math.abs(Math.round(L2.pageX)-(((J2=v2.current)==null?void 0:J2.x)??0)),y:Math.abs(Math.round(L2.pageY)-(((u0=v2.current)==null?void 0:u0.y)??0))}},Y2=L2=>{A2.x<=10&&A2.y<=10?L2.preventDefault():x.contains(L2.target)||J(!1),document.removeEventListener("pointermove",z2),v2.current=null};return v2.current!==null&&(document.addEventListener("pointermove",z2),document.addEventListener("pointerup",Y2,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",z2),document.removeEventListener("pointerup",Y2,{capture:!0})}}},[x,J,v2]),y.useEffect(()=>{const A2=()=>J(!1);return window.addEventListener("blur",A2),window.addEventListener("resize",A2),()=>{window.removeEventListener("blur",A2),window.removeEventListener("resize",A2)}},[J]);const[F,q]=oz(A2=>{const z2=s2().filter(J2=>!J2.disabled),Y2=z2.find(J2=>J2.ref.current===document.activeElement),L2=uz(z2,A2,Y2);L2&&setTimeout(()=>L2.ref.current.focus())}),K=y.useCallback((A2,z2,Y2)=>{const L2=!a2.current&&!Y2;(M.value!==void 0&&M.value===z2||L2)&&(H(A2),L2&&(a2.current=!0))},[M.value]),l2=y.useCallback(()=>x==null?void 0:x.focus(),[x]),n2=y.useCallback((A2,z2,Y2)=>{const L2=!a2.current&&!Y2;(M.value!==void 0&&M.value===z2||L2)&&f2(A2)},[M.value]),d2=n==="popper"?g8:$y,g2=d2===g8?{side:u,sideOffset:d,align:f,alignOffset:v,arrowPadding:p,collisionBoundary:A,collisionPadding:E,sticky:_,hideWhenDetached:S,avoidCollisions:z}:{};return I.jsx(jy,{scope:a,content:x,viewport:w,onViewportChange:b,itemRefCallback:K,selectedItem:O,onItemLeave:l2,itemTextRefCallback:n2,focusSelectedItem:t2,selectedItemText:U,position:n,isPositioned:h2,searchRef:F,children:I.jsx(Zh,{as:Ba,allowPinchZoom:!0,children:I.jsx(Yh,{asChild:!0,trapped:M.open,onMountAutoFocus:A2=>{A2.preventDefault()},onUnmountAutoFocus:m0(r,A2=>{var z2;(z2=M.trigger)==null||z2.focus({preventScroll:!0}),A2.preventDefault()}),children:I.jsx(wo,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:o,onFocusOutside:A2=>A2.preventDefault(),onDismiss:()=>M.onOpenChange(!1),children:I.jsx(d2,{role:"listbox",id:M.contentId,"data-state":M.open?"open":"closed",dir:M.dir,onContextMenu:A2=>A2.preventDefault(),...C,...g2,onPlaced:()=>W(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:m0(C.onKeyDown,A2=>{const z2=A2.ctrlKey||A2.altKey||A2.metaKey;if(A2.key==="Tab"&&A2.preventDefault(),!z2&&A2.key.length===1&&q(A2.key),["ArrowUp","ArrowDown","Home","End"].includes(A2.key)){let L2=s2().filter(J2=>!J2.disabled).map(J2=>J2.ref.current);if(["ArrowUp","End"].includes(A2.key)&&(L2=L2.slice().reverse()),["ArrowUp","ArrowDown"].includes(A2.key)){const J2=A2.target,u0=L2.indexOf(J2);L2=L2.slice(u0+1)}setTimeout(()=>V(L2)),A2.preventDefault()}})})})})})})});Ky.displayName=zV;var CV="SelectItemAlignedPosition",$y=y.forwardRef((e,t)=>{const{__scopeSelect:a,onPlaced:n,...r}=e,s=Gt(Pa,a),o=jt(Pa,a),[u,d]=y.useState(null),[f,v]=y.useState(null),p=B0(t,T=>v(T)),A=jo(a),E=y.useRef(!1),_=y.useRef(!0),{viewport:S,selectedItem:z,selectedItemText:C,focusSelectedItem:M}=o,x=y.useCallback(()=>{if(s.trigger&&s.valueNode&&u&&f&&S&&z&&C){const T=s.trigger.getBoundingClientRect(),O=f.getBoundingClientRect(),H=s.valueNode.getBoundingClientRect(),U=C.getBoundingClientRect();if(s.dir!=="rtl"){const J2=U.left-O.left,u0=H.left-J2,M0=T.left-u0,l1=T.width+M0,Re=Math.max(l1,O.width),K1=window.innerWidth-De,je=xA(u0,[De,Math.max(De,K1-Re)]);u.style.minWidth=l1+"px",u.style.left=je+"px"}else{const J2=O.right-U.right,u0=window.innerWidth-H.right-J2,M0=window.innerWidth-T.right-u0,l1=T.width+M0,Re=Math.max(l1,O.width),K1=window.innerWidth-De,je=xA(u0,[De,Math.max(De,K1-Re)]);u.style.minWidth=l1+"px",u.style.right=je+"px"}const f2=A(),s2=window.innerHeight-De*2,h2=S.scrollHeight,W=window.getComputedStyle(f),a2=parseInt(W.borderTopWidth,10),V=parseInt(W.paddingTop,10),t2=parseInt(W.borderBottomWidth,10),J=parseInt(W.paddingBottom,10),v2=a2+V+h2+J+t2,F=Math.min(z.offsetHeight*5,v2),q=window.getComputedStyle(S),K=parseInt(q.paddingTop,10),l2=parseInt(q.paddingBottom,10),n2=T.top+T.height/2-De,d2=s2-n2,g2=z.offsetHeight/2,A2=z.offsetTop+g2,z2=a2+V+A2,Y2=v2-z2;if(z2<=n2){const J2=f2.length>0&&z===f2[f2.length-1].ref.current;u.style.bottom="0px";const u0=f.clientHeight-S.offsetTop-S.offsetHeight,M0=Math.max(d2,g2+(J2?l2:0)+u0+t2),l1=z2+M0;u.style.height=l1+"px"}else{const J2=f2.length>0&&z===f2[0].ref.current;u.style.top="0px";const M0=Math.max(n2,a2+S.offsetTop+(J2?K:0)+g2)+Y2;u.style.height=M0+"px",S.scrollTop=z2-n2+S.offsetTop}u.style.margin=`${De}px 0`,u.style.minHeight=F+"px",u.style.maxHeight=s2+"px",n==null||n(),requestAnimationFrame(()=>E.current=!0)}},[A,s.trigger,s.valueNode,u,f,S,z,C,s.dir,n]);x1(()=>x(),[x]);const[D,w]=y.useState();x1(()=>{f&&w(window.getComputedStyle(f).zIndex)},[f]);const b=y.useCallback(T=>{T&&_.current===!0&&(x(),M==null||M(),_.current=!1)},[x,M]);return I.jsx(RV,{scope:a,contentWrapper:u,shouldExpandOnScrollRef:E,onScrollButtonChange:b,children:I.jsx("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:D},children:I.jsx(i0.div,{...r,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...r.style}})})})});$y.displayName=CV;var MV="SelectPopperPosition",g8=y.forwardRef((e,t)=>{const{__scopeSelect:a,align:n="start",collisionPadding:r=De,...s}=e,o=Ko(a);return I.jsx(mV,{...o,...s,ref:t,align:n,collisionPadding:r,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});g8.displayName=MV;var[RV,ud]=z4(Pa,{}),E8="SelectViewport",Yy=y.forwardRef((e,t)=>{const{__scopeSelect:a,nonce:n,...r}=e,s=jt(E8,a),o=ud(E8,a),u=B0(t,s.onViewportChange),d=y.useRef(0);return I.jsxs(I.Fragment,{children:[I.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),I.jsx(Go.Slot,{scope:a,children:I.jsx(i0.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:u,style:{position:"relative",flex:1,overflow:"hidden auto",...r.style},onScroll:m0(r.onScroll,f=>{const v=f.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:A}=o;if(A!=null&&A.current&&p){const E=Math.abs(d.current-v.scrollTop);if(E>0){const _=window.innerHeight-De*2,S=parseFloat(p.style.minHeight),z=parseFloat(p.style.height),C=Math.max(S,z);if(C<_){const M=C+E,x=Math.min(_,M),D=M-x;p.style.height=x+"px",p.style.bottom==="0px"&&(v.scrollTop=D>0?D:0,p.style.justifyContent="flex-end")}}}d.current=v.scrollTop})})})]})});Yy.displayName=E8;var Zy="SelectGroup",[xV,wV]=z4(Zy),Wy=y.forwardRef((e,t)=>{const{__scopeSelect:a,...n}=e,r=Ce();return I.jsx(xV,{scope:a,id:r,children:I.jsx(i0.div,{role:"group","aria-labelledby":r,...n,ref:t})})});Wy.displayName=Zy;var qy="SelectLabel",Xy=y.forwardRef((e,t)=>{const{__scopeSelect:a,...n}=e,r=wV(qy,a);return I.jsx(i0.div,{id:r.id,...n,ref:t})});Xy.displayName=qy;var Vc="SelectItem",[bV,Qy]=z4(Vc),Jy=y.forwardRef((e,t)=>{const{__scopeSelect:a,value:n,disabled:r=!1,textValue:s,...o}=e,u=Gt(Vc,a),d=jt(Vc,a),f=u.value===n,[v,p]=y.useState(s??""),[A,E]=y.useState(!1),_=B0(t,M=>{var x;return(x=d.itemRefCallback)==null?void 0:x.call(d,M,n,r)}),S=Ce(),z=y.useRef("touch"),C=()=>{r||(u.onValueChange(n),u.onOpenChange(!1))};if(n==="")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 I.jsx(bV,{scope:a,value:n,disabled:r,textId:S,isSelected:f,onItemTextChange:y.useCallback(M=>{p(x=>x||((M==null?void 0:M.textContent)??"").trim())},[]),children:I.jsx(Go.ItemSlot,{scope:a,value:n,disabled:r,textValue:v,children:I.jsx(i0.div,{role:"option","aria-labelledby":S,"data-highlighted":A?"":void 0,"aria-selected":f&&A,"data-state":f?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1,...o,ref:_,onFocus:m0(o.onFocus,()=>E(!0)),onBlur:m0(o.onBlur,()=>E(!1)),onClick:m0(o.onClick,()=>{z.current!=="mouse"&&C()}),onPointerUp:m0(o.onPointerUp,()=>{z.current==="mouse"&&C()}),onPointerDown:m0(o.onPointerDown,M=>{z.current=M.pointerType}),onPointerMove:m0(o.onPointerMove,M=>{var x;z.current=M.pointerType,r?(x=d.onItemLeave)==null||x.call(d):z.current==="mouse"&&M.currentTarget.focus({preventScroll:!0})}),onPointerLeave:m0(o.onPointerLeave,M=>{var x;M.currentTarget===document.activeElement&&((x=d.onItemLeave)==null||x.call(d))}),onKeyDown:m0(o.onKeyDown,M=>{var D;((D=d.searchRef)==null?void 0:D.current)!==""&&M.key===" "||(gV.includes(M.key)&&C(),M.key===" "&&M.preventDefault())})})})})});Jy.displayName=Vc;var $l="SelectItemText",ez=y.forwardRef((e,t)=>{const{__scopeSelect:a,className:n,style:r,...s}=e,o=Gt($l,a),u=jt($l,a),d=Qy($l,a),f=NV($l,a),[v,p]=y.useState(null),A=B0(t,C=>p(C),d.onItemTextChange,C=>{var M;return(M=u.itemTextRefCallback)==null?void 0:M.call(u,C,d.value,d.disabled)}),E=v==null?void 0:v.textContent,_=y.useMemo(()=>I.jsx("option",{value:d.value,disabled:d.disabled,children:E},d.value),[d.disabled,d.value,E]),{onNativeOptionAdd:S,onNativeOptionRemove:z}=f;return x1(()=>(S(_),()=>z(_)),[S,z,_]),I.jsxs(I.Fragment,{children:[I.jsx(i0.span,{id:d.textId,...s,ref:A}),d.isSelected&&o.valueNode&&!o.valueNodeHasChildren?$a.createPortal(s.children,o.valueNode):null]})});ez.displayName=$l;var tz="SelectItemIndicator",az=y.forwardRef((e,t)=>{const{__scopeSelect:a,...n}=e;return Qy(tz,a).isSelected?I.jsx(i0.span,{"aria-hidden":!0,...n,ref:t}):null});az.displayName=tz;var _8="SelectScrollUpButton",nz=y.forwardRef((e,t)=>{const a=jt(_8,e.__scopeSelect),n=ud(_8,e.__scopeSelect),[r,s]=y.useState(!1),o=B0(t,n.onScrollButtonChange);return x1(()=>{if(a.viewport&&a.isPositioned){let u=function(){const f=d.scrollTop>0;s(f)};const d=a.viewport;return u(),d.addEventListener("scroll",u),()=>d.removeEventListener("scroll",u)}},[a.viewport,a.isPositioned]),r?I.jsx(rz,{...e,ref:o,onAutoScroll:()=>{const{viewport:u,selectedItem:d}=a;u&&d&&(u.scrollTop=u.scrollTop-d.offsetHeight)}}):null});nz.displayName=_8;var I8="SelectScrollDownButton",lz=y.forwardRef((e,t)=>{const a=jt(I8,e.__scopeSelect),n=ud(I8,e.__scopeSelect),[r,s]=y.useState(!1),o=B0(t,n.onScrollButtonChange);return x1(()=>{if(a.viewport&&a.isPositioned){let u=function(){const f=d.scrollHeight-d.clientHeight,v=Math.ceil(d.scrollTop)<f;s(v)};const d=a.viewport;return u(),d.addEventListener("scroll",u),()=>d.removeEventListener("scroll",u)}},[a.viewport,a.isPositioned]),r?I.jsx(rz,{...e,ref:o,onAutoScroll:()=>{const{viewport:u,selectedItem:d}=a;u&&d&&(u.scrollTop=u.scrollTop+d.offsetHeight)}}):null});lz.displayName=I8;var rz=y.forwardRef((e,t)=>{const{__scopeSelect:a,onAutoScroll:n,...r}=e,s=jt("SelectScrollButton",a),o=y.useRef(null),u=jo(a),d=y.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return y.useEffect(()=>()=>d(),[d]),x1(()=>{var v;const f=u().find(p=>p.ref.current===document.activeElement);(v=f==null?void 0:f.ref.current)==null||v.scrollIntoView({block:"nearest"})},[u]),I.jsx(i0.div,{"aria-hidden":!0,...r,ref:t,style:{flexShrink:0,...r.style},onPointerDown:m0(r.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(n,50))}),onPointerMove:m0(r.onPointerMove,()=>{var f;(f=s.onItemLeave)==null||f.call(s),o.current===null&&(o.current=window.setInterval(n,50))}),onPointerLeave:m0(r.onPointerLeave,()=>{d()})})}),TV="SelectSeparator",iz=y.forwardRef((e,t)=>{const{__scopeSelect:a,...n}=e;return I.jsx(i0.div,{"aria-hidden":!0,...n,ref:t})});iz.displayName=TV;var N8="SelectArrow",kV=y.forwardRef((e,t)=>{const{__scopeSelect:a,...n}=e,r=Ko(a),s=Gt(N8,a),o=jt(N8,a);return s.open&&o.position==="popper"?I.jsx(vV,{...r,...n,ref:t}):null});kV.displayName=N8;function sz(e){return e===""||e===void 0}var cz=y.forwardRef((e,t)=>{const{value:a,...n}=e,r=y.useRef(null),s=B0(t,r),o=pV(a);return y.useEffect(()=>{const u=r.current,d=window.HTMLSelectElement.prototype,v=Object.getOwnPropertyDescriptor(d,"value").set;if(o!==a&&v){const p=new Event("change",{bubbles:!0});v.call(u,a),u.dispatchEvent(p)}},[o,a]),I.jsx(To,{asChild:!0,children:I.jsx("select",{...n,ref:s,defaultValue:a})})});cz.displayName="BubbleSelect";function oz(e){const t=re(e),a=y.useRef(""),n=y.useRef(0),r=y.useCallback(o=>{const u=a.current+o;t(u),function d(f){a.current=f,window.clearTimeout(n.current),f!==""&&(n.current=window.setTimeout(()=>d(""),1e3))}(u)},[t]),s=y.useCallback(()=>{a.current="",window.clearTimeout(n.current)},[]);return y.useEffect(()=>()=>window.clearTimeout(n.current),[]),[a,r,s]}function uz(e,t,a){const r=t.length>1&&Array.from(t).every(f=>f===t[0])?t[0]:t,s=a?e.indexOf(a):-1;let o=DV(e,Math.max(s,0));r.length===1&&(o=o.filter(f=>f!==a));const d=o.find(f=>f.textValue.toLowerCase().startsWith(r.toLowerCase()));return d!==a?d:void 0}function DV(e,t){return e.map((a,n)=>e[(t+n)%e.length])}var BV=Ly,LV=Fy,OV=Py,FV=Uy,HV=Vy,PV=Gy,UV=Yy,VV=Wy,GV=Xy,jV=Jy,KV=ez,$V=az,YV=nz,ZV=lz,WV=iz;const qV=BV,XV=VV,QV=OV,JV=({validationStyleEnabled:e=!1,className:t,children:a,...n})=>I.jsxs(LV,{className:C2("border-input ring-offset-background placeholder:text-muted-foreground focus:ring-ring focus:outline-hidden flex w-full items-center justify-between whitespace-nowrap rounded-md border px-3 py-2 text-sm focus:ring-1 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1","bg-input-background text-input-text w-full select-text resize-none rounded-xl border-2 px-2 py-1 text-sm shadow-none outline-0 transition-all","border-input-border hover:border-input-border-hover focus:border-input-border-focus focus:outline-0 focus:[box-shadow:none]","aria-[invalid=true]:border-error",e&&"valid:border-success invalid:border-error",t),...n,children:[a,I.jsx(FV,{asChild:!0,children:I.jsx(cL,{className:"size-4 opacity-50"})})]}),hz=({className:e,...t})=>I.jsx(YV,{className:C2("flex cursor-default items-center justify-center py-1",e),...t,children:I.jsx(iL,{})}),dz=({className:e,...t})=>I.jsx(ZV,{className:C2("flex cursor-default items-center justify-center py-1",e),...t,children:I.jsx(RN,{})}),eG=({className:e,children:t,position:a="popper",...n})=>I.jsx(HV,{children:I.jsxs(PV,{className:C2("bg-input-background text-input-text w-full select-text resize-none rounded-xl border-2 p-1 text-sm shadow-none outline-0 transition-all","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 relative z-50 max-h-96 min-w-[8rem] overflow-hidden border shadow-md",a==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:a,...n,children:[I.jsx(hz,{}),I.jsx(UV,{className:C2("p-1",a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),I.jsx(dz,{})]})}),tG=({className:e,...t})=>I.jsx(GV,{className:C2("px-1 py-0.5 text-sm font-semibold",e),...t}),aG=({className:e,children:t,...a})=>I.jsxs(jV,{className:C2("focus:bg-neutral/10 outline-hidden relative flex w-full cursor-pointer select-none items-center rounded-lg py-1.5 pl-2 pr-8 text-sm data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...a,children:[I.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:I.jsx($V,{children:I.jsx(I4,{className:"size-4"})})}),I.jsx(KV,{children:t})]}),nG=({className:e,...t})=>I.jsx(WV,{className:C2("-mx-1 my-1 h-px bg-red-300",e),...t}),F2=qV;F2.Group=XV;F2.Value=QV;F2.Trigger=JV;F2.ScrollUpButton=hz;F2.ScrollDownButton=dz;F2.Content=eG;F2.Label=tG;F2.Item=aG;F2.Separator=nG;const lG=e=>(e==null?void 0:e.getAttribute("aria-selected"))==="true",rG=(e,t=lG,a=!1)=>{const[n,r]=y.useState(null),[s,o]=y.useState(null),u=e.current.length;return y.useEffect(()=>{const d=()=>{let S=null;if(s?S=s:S=e.current.find(t)??null,!S){r(M=>({left:0,width:0,...M,opacity:0}));return}const z=S.offsetLeft,C=S.offsetWidth;r({left:z,width:C,opacity:1})};d(),window.addEventListener("resize",d),window.addEventListener("DOMContentLoaded",d);const f=[];e.current.forEach(S=>{if(S){const z=new MutationObserver(C=>{for(const M of C)if(M.type==="attributes"&&M.attributeName==="aria-selected"){d();break}});z.observe(S,{attributes:!0,attributeFilter:["aria-selected"]}),f.push(z)}});const v=[],p=S=>{if(!S)return;const z=new ResizeObserver(()=>{d()});z.observe(S),v.push(z)},A=e.current.find(t)??null;A&&p(A),s&&p(s);const E=S=>{o(S.currentTarget)},_=()=>{o(null)};return a&&e.current.forEach(S=>{S==null||S.addEventListener("mouseenter",E),S==null||S.addEventListener("mouseleave",_)}),()=>{window.removeEventListener("resize",d),window.removeEventListener("DOMContentLoaded",d),f.forEach(S=>S.disconnect()),v.forEach(S=>S.disconnect()),e.current.forEach(S=>{S==null||S.removeEventListener("mouseenter",E),S==null||S.removeEventListener("mouseleave",_)})}},[e,t,s,u]),{choiceIndicatorPosition:n}},iG=[{content:"Off",value:!1},{content:"On",value:!0}],sG=Me("flex flex-row gap-2 rounded-full w-fit border-[1.5px] p-[1.5px]",{variants:{color:{primary:"border-primary text-primary",secondary:"border-secondary text-secondary",destructive:"border-destructive bg-destructive text-destructive",neutral:"border-neutral text-neutral ",light:"border-white text-white",dark:"border-neutral-800 text-neutral-800",text:"border-text text-text"}},defaultVariants:{color:"primary"}}),cG=Me("z-1 w-full flex-1 text-sm font-medium transition-all duration-300 ease-in-out aria-selected:cursor-default aria-selected:text-text-opposite motion-reduce:transition-none",{variants:{size:{sm:"py-1 px-2 text-xs",md:"p-2 text-sm",lg:"p-4 text-base"}},defaultVariants:{size:"md"}}),oG=Me("absolute top-0 z-[-1] h-full w-auto rounded-full transition-[left,width] duration-300 ease-in-out motion-reduce:transition-none",{variants:{color:{primary:"bg-primary aria-selected:text-text",secondary:"bg-secondary aria-selected:text-text",destructive:"bg-destructive aria-selected:text-text",neutral:"bg-neutral aria-selected:text-white ",light:"bg-white aria-selected:text-black",dark:"bg-neutral-800 aria-selected:text-white",text:"bg-text aria-selected:text-text-opposite"}}}),ci=({choices:e=iG,value:t,defaultValue:a,onChange:n,color:r="primary",size:s="md",className:o})=>{const[u,d]=y.useState(t??a??e[0].value),f=y.useRef([]),v=y.useRef(null),{choiceIndicatorPosition:p}=rG(f),A=E=>{d(E),n==null||n(E)};return y.useEffect(()=>{t!==void 0&&d(t)},[t]),I.jsx("div",{className:sG({color:r,className:o}),role:"tablist",children:I.jsxs("div",{className:"relative flex size-full flex-row items-center justify-center",children:[e.map((E,_)=>{const{content:S,value:z,...C}=E,M=typeof z=="string"||typeof z=="number",x=z===u;return y.createElement("button",{...C,className:C2(cG({size:s})),key:M?z:_,role:"tab",onClick:()=>A(z),"aria-selected":x,disabled:x,ref:D=>{f.current[_]=D}},S)}),p&&I.jsx("div",{className:C2(oG({color:r})),style:p,ref:v})]})})};var uG=function(e,t){for(var a={};e.length;){var n=e[0],r=n.code,s=n.message,o=n.path.join(".");if(!a[o])if("unionErrors"in n){var u=n.unionErrors[0].errors[0];a[o]={message:u.message,type:u.code}}else a[o]={message:s,type:r};if("unionErrors"in n&&n.unionErrors.forEach(function(v){return v.errors.forEach(function(p){return e.push(p)})}),t){var d=a[o].types,f=d&&d[n.code];a[o]=NS(o,t,a,r,f?[].concat(f,n.message):n.message)}e.shift()}return a},hG=function(e,t,a){return a===void 0&&(a={}),function(n,r,s){try{return Promise.resolve(function(o,u){try{var d=Promise.resolve(e[a.mode==="sync"?"parse":"parseAsync"](n,t)).then(function(f){return s.shouldUseNativeValidation&&xS({},s),{errors:{},values:a.raw?n:f}})}catch(f){return u(f)}return d&&d.then?d.then(void 0,u):d}(0,function(o){if(function(u){return Array.isArray(u==null?void 0:u.errors)}(o))return{values:{},errors:aH(uG(o.errors,!s.shouldUseNativeValidation&&s.criteriaMode==="all"),s)};throw o}))}catch(o){return Promise.reject(o)}}};const s7=async e=>{e&&typeof e.then=="function"&&await e},dG=({schema:e,onSubmit:t,onSubmitSuccess:a,onSubmitError:n,className:r,children:s,autoComplete:o,...u})=>{const d=async f=>{const v=(e==null?void 0:e.safeParse(f))??{success:!0,data:void 0};await s7(t==null?void 0:t(f)),v.success?await s7(a==null?void 0:a(v.data)):await s7(n==null?void 0:n(new Error(v.error.errors.map(p=>p.message).join(", "))))};return I.jsx(HF,{...u,children:I.jsx("form",{className:C2("flex size-full flex-col gap-y-6",r),onSubmit:u.handleSubmit(d),autoComplete:o?"on":"off",children:s})})},fG=(e,t)=>{const a=tH({resolver:hG(e),...t}),n=a.formState.isSubmitting,r=a.formState.isSubmitted,s=a.formState.isLoading,o=a.formState.isValid;return{form:a,isSubmitting:n,isSubmitted:r,isLoading:s,isValid:o}},mG=e=>{const{error:t,formItemId:a,formDescriptionId:n,formMessageId:r}=Vt();return I.jsx(Ba,{id:a,"aria-describedby":t?`${n} ${r}`:`${n}`,"aria-invalid":!!t,...e})},vG=e=>{const{formDescriptionId:t}=Vt();return I.jsx("p",{className:"text-neutral text-sm",id:t,...e})},pG=({children:e,...t})=>{const{error:a,formMessageId:n}=Vt(),r=a?String((a==null?void 0:a.message)??""):e;return r?I.jsx("p",{className:"text-error text-xs font-medium",role:"alert",id:n,...t,children:r}):null},$o=({label:e,description:t,isRequired:a,info:n,children:r,showErrorMessage:s=!0,htmlFor:o})=>I.jsxs(o0.Item,{className:"flex w-full flex-col gap-2 p-2",children:[(t||e)&&I.jsxs("div",{className:"flex flex-col gap-1 p-1 leading-none",children:[e&&I.jsx(my,{isRequired:a,info:n,htmlFor:o,children:e}),t&&I.jsx(o0.Description,{children:t})]}),I.jsx(o0.Control,{children:r}),s&&I.jsx(o0.Message,{"data-testid":"error-message"})]}),AG=({field:e,name:t,label:a,Element:n,isRequired:r=!1,info:s,description:o,showErrorMessage:u=!0,...d})=>{const{error:f}=Vt();return I.jsx($o,{htmlFor:t,label:a,description:o,isRequired:r,info:s,showErrorMessage:u,"aria-invalid":!!f,children:I.jsx(n,{"data-testid":"element",id:t,...e,...d,children:d.children})})},Kt=e=>{const{control:t}=Ut();return I.jsx(o0.Field,{control:t,name:e.name,render:({field:a})=>I.jsx(AG,{...e,field:a})})},gG=e=>I.jsx(Kt,{id:e.name,"data-testid":e.name,Element:N4,...e}),EG=({autoComplete:e,...t})=>I.jsx(Kt,{Element:cH,id:t.name,"data-testid":t.name,autoComplete:e,minLength:6,maxLength:255,...t}),_G=e=>I.jsx(Kt,{Element:kS,id:e.name,"data-testid":e.name,...e}),IG=e=>I.jsx(Kt,{id:e.name,"data-testid":e.name,Element:BS,...e}),NG=e=>I.jsx(Kt,{id:e.name,"data-testid":e.name,Element:LS,...e}),SG=e=>I.jsx(Kt,{Element:$h,id:e.name,"data-testid":e.name,...e}),yG=({inputLabel:e,...t})=>I.jsx(sH,{...t,label:e}),zG=({autoComplete:e,...t})=>I.jsx(Kt,{Element:yG,id:t.name,"data-testid":t.name,autoComplete:e,minLength:6,maxLength:255,...t}),CG=({name:e,description:t,label:a,isRequired:n,info:r,showErrorMessage:s,children:o,...u})=>{const{control:d}=Ut();return I.jsx(o0.Field,{control:d,name:e,render:({field:f})=>{const{error:v}=Vt();return I.jsx($o,{htmlFor:e,label:a,description:t,isRequired:n,info:r,showErrorMessage:s,"aria-invalid":!!v,children:I.jsx(z1,{onValueChange:f.onChange,values:f.value,...u,children:o})})}})},MG=({name:e,description:t,label:a,isRequired:n,info:r,showErrorMessage:s,children:o,...u})=>{const{control:d}=Ut();return I.jsx(o0.Field,{control:d,name:e,render:({field:f})=>{const{error:v}=Vt();return I.jsx($o,{htmlFor:e,label:a,description:t,isRequired:n,info:r,showErrorMessage:s,"aria-invalid":!!v,children:I.jsx(F2,{onValueChange:f.onChange,defaultValue:f.value,...u,children:o})})}})},RG=({name:e,description:t,label:a,isRequired:n,info:r,showErrorMessage:s,children:o,...u})=>{const{control:d}=Ut();return I.jsx(o0.Field,{control:d,name:e,render:({field:f})=>{const{error:v}=Vt();return I.jsx($o,{htmlFor:e,label:a,description:t,isRequired:n,info:r,showErrorMessage:s,"aria-invalid":!!v,children:I.jsx(ci,{...f,...u,children:o})})}})},o0=dG;o0.Description=vG;o0.Control=mG;o0.Field=rH;o0.Item=lH;o0.Label=my;o0.Message=pG;o0.Element=Kt;o0.Input=gG;o0.InputPassword=EG;o0.Checkbox=zG;o0.TextArea=_G;o0.AutoSizedTextArea=SG;o0.Button=_0;o0.Select=MG;o0.MultiSelect=CG;o0.EditableFieldInput=IG;o0.EditableFieldTextArea=NG;o0.SwitchSelector=RG;j({en:"Forgot your password?","en-GB":"Forgot your password?",fr:"Mot de passe oublié ?",es:"¿Olvidaste tu contraseña?",de:"Haben Sie Ihr Passwort vergessen?",ja:"パスワードをお忘れですか?",ko:"비밀번호를 잊으셨나요?",zh:"忘记密码?",it:"Hai dimenticato la password?",pt:"Esqueceu sua senha?",hi:"क्या आपने अपना पासवर्ड भुला दिया?",ar:"نسيت كلمة المرور؟",ru:"Забыли пароль?"}),j({en:"Forgot password?","en-GB":"Forgot password?",fr:"Mot de passe oublié ?",es:"¿Olvidaste tu contraseña?",de:"Passwort vergessen?",ja:"パスワードをお忘れですか?",ko:"비밀번호를 잊으셨나요?",zh:"忘记密码?",it:"Hai dimenticato la password?",pt:"Esqueceu sua senha?",hi:"क्या आपने अपना पासवर्ड भुला दिया?",ar:"نسيت كلمة المرور؟",ru:"Забыли пароль?"}),j({en:"Email address","en-GB":"Email address",fr:"Adresse e-mail",es:"Dirección de correo electrónico",de:"E-Mail-Adresse",ja:"メールアドレス",ko:"이메일 주소",zh:"电子邮件地址",it:"Indirizzo email",pt:"Endereço de e-mail",hi:"ईमेल पता",ar:"عنوان البريد الإلكتروني",ru:"Адрес электронной почты"}),j({en:"Enter e-mail address","en-GB":"Enter e-mail address",fr:"Entrez votre adresse e-mail",es:"Ingrese su dirección de correo electrónico",de:"Geben Sie die E-Mail-Adresse ein",ja:"メールアドレスを入力してください",ko:"이메일 주소를 입력하세요",zh:"请输入电子邮件地址",it:"Inserisci l'indirizzo email",pt:"Digite o endereço de e-mail",hi:"ईमेल पता दर्ज करें",ar:"أدخل عنوان البريد الإلكتروني",ru:"Введите адрес электронной почты"}),j({en:"Password","en-GB":"Password",fr:"Mot de passe",es:"Contraseña",de:"Passwort",ja:"パスワード",ko:"비밀번호",zh:"密码",it:"Password",pt:"Senha",hi:"पासवर्ड",ar:"كلمة المرور",ru:"Пароль"}),j({en:"Enter password","en-GB":"Enter password",fr:"Entrez votre mot de passe",es:"Ingrese su contraseña",de:"Geben Sie das Passwort ein",ja:"パスワードを入力してください",ko:"비밀번호를 입력하세요",zh:"请输入密码",it:"Inserisci la password",pt:"Digite a senha",hi:"पासवर्ड दर्ज करें",ar:"أدخل كلمة المرور",ru:"Введите пароль"}),j({en:"Log in","en-GB":"Log in",fr:"Se connecter",es:"Iniciar sesión",de:"Einloggen",ja:"ログイン",ko:"로그인",zh:"登录",it:"Accedi",pt:"Entrar",hi:"लॉग इन करें",ar:"تسجيل الدخول",ru:"Войти"}),j({en:"Click to log in","en-GB":"Click to log in",fr:"Cliquez pour vous connecter",es:"Haga clic para iniciar sesión",de:"Klicken Sie, um sich anzumelden",ja:"ログインするにはクリックしてください",ko:"로그인하려면 클릭하세요",zh:"点击登录",it:"Clicca per accedere",pt:"Clique para entrar",hi:"लॉग इन करने के लिए क्लिक करें",ar:"انقر لتسجيل الدخول",ru:"Нажмите, чтобы войти"}),j({en:"Log in","en-GB":"Log in",fr:"Se connecter",es:"Iniciar sesión",de:"Einloggen",ja:"ログイン",ko:"로그인",zh:"登录",it:"Accedi",pt:"Entrar",hi:"लॉग इन करें",ar:"تسجيل الدخول",ru:"Войти"}),j({en:"Click to log in","en-GB":"Click to log in",fr:"Cliquez pour vous connecter",es:"Haga clic para iniciar sesión",de:"Klicken Sie, um sich anzumelden",ja:"ログインするにはクリックしてください",ko:"로그인하려면 클릭하세요",zh:"点击登录",it:"Clicca per accedere",pt:"Clique para entrar",hi:"लॉग इन करने के लिए क्लिक करें",ar:"انقر لتسجيل الدخول",ru:"Нажмите, чтобы войти"}),j({en:"Don’t have an account?","en-GB":"Don’t have an account?",fr:"Vous n’avez pas de compte ?",es:"¿No tienes una cuenta?",de:"Haben Sie kein Konto?",ja:"アカウントをお持ちでないですか?",ko:"계정이 없으신가요?",zh:"还没有账户?",it:"Non hai un account?",pt:"Você não tem uma conta?",hi:"क्या आपके पास खाता नहीं है?",ar:"ليس لديك حساب؟",ru:"У вас нет аккаунта?"}),j({en:"Click to go to create an account page","en-GB":"Click to go to create an account page",fr:"Cliquez pour aller à la page de création de compte",es:"Haga clic para ir a la página de creación de cuenta",de:"Klicken Sie, um zur Seite zur Erstellung eines Kontos zu gelangen",ja:"アカウント作成ページに移動するにはクリックしてください",ko:"계정 생성 페이지로 이동하려면 클릭하세요",zh:"单击以转到创建账户页面",it:"Clicca per andare alla pagina di creazione dell'account",pt:"Clique para ir para a página de criação de conta",hi:"खाता बनाने के पृष्ठ पर जाने के लिए क्लिक करें",ar:"انقر للانتقال إلى صفحة إنشاء حساب",ru:"Нажмите, чтобы перейти на страницу создания аккаунта"}),j({en:"Create an account","en-GB":"Create an account",fr:"Créer un compte",es:"Crear una cuenta",de:"Ein Konto erstellen",ja:"アカウントを作成",ko:"계정을 만들다",zh:"创建一个账户",it:"Crea un account",pt:"Criar uma conta",hi:"एक खाता बनाएं",ar:"إنشاء حساب",ru:"Создать аккаунт"});var p0;(function(e){e.assertEqual=r=>r;function t(r){}e.assertIs=t;function a(r){throw new Error}e.assertNever=a,e.arrayToEnum=r=>{const s={};for(const o of r)s[o]=o;return s},e.getValidEnumValues=r=>{const s=e.objectKeys(r).filter(u=>typeof r[r[u]]!="number"),o={};for(const u of s)o[u]=r[u];return e.objectValues(o)},e.objectValues=r=>e.objectKeys(r).map(function(s){return r[s]}),e.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{const s=[];for(const o in r)Object.prototype.hasOwnProperty.call(r,o)&&s.push(o);return s},e.find=(r,s)=>{for(const o of r)if(s(o))return o},e.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&isFinite(r)&&Math.floor(r)===r;function n(r,s=" | "){return r.map(o=>typeof o=="string"?`'${o}'`:o).join(s)}e.joinValues=n,e.jsonStringifyReplacer=(r,s)=>typeof s=="bigint"?s.toString():s})(p0||(p0={}));var S8;(function(e){e.mergeShapes=(t,a)=>({...t,...a})})(S8||(S8={}));const M2=p0.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),D3=e=>{switch(typeof e){case"undefined":return M2.undefined;case"string":return M2.string;case"number":return isNaN(e)?M2.nan:M2.number;case"boolean":return M2.boolean;case"function":return M2.function;case"bigint":return M2.bigint;case"symbol":return M2.symbol;case"object":return Array.isArray(e)?M2.array:e===null?M2.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?M2.promise:typeof Map<"u"&&e instanceof Map?M2.map:typeof Set<"u"&&e instanceof Set?M2.set:typeof Date<"u"&&e instanceof Date?M2.date:M2.object;default:return M2.unknown}},p2=p0.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),xG=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class le extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const a=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,a):this.__proto__=a,this.name="ZodError",this.issues=t}format(t){const a=t||function(s){return s.message},n={_errors:[]},r=s=>{for(const o of s.issues)if(o.code==="invalid_union")o.unionErrors.map(r);else if(o.code==="invalid_return_type")r(o.returnTypeError);else if(o.code==="invalid_arguments")r(o.argumentsError);else if(o.path.length===0)n._errors.push(a(o));else{let u=n,d=0;for(;d<o.path.length;){const f=o.path[d];d===o.path.length-1?(u[f]=u[f]||{_errors:[]},u[f]._errors.push(a(o))):u[f]=u[f]||{_errors:[]},u=u[f],d++}}};return r(this),n}static assert(t){if(!(t instanceof le))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,p0.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=a=>a.message){const a={},n=[];for(const r of this.issues)r.path.length>0?(a[r.path[0]]=a[r.path[0]]||[],a[r.path[0]].push(t(r))):n.push(t(r));return{formErrors:n,fieldErrors:a}}get formErrors(){return this.flatten()}}le.create=e=>new le(e);const c4=(e,t)=>{let a;switch(e.code){case p2.invalid_type:e.received===M2.undefined?a="Required":a=`Expected ${e.expected}, received ${e.received}`;break;case p2.invalid_literal:a=`Invalid literal value, expected ${JSON.stringify(e.expected,p0.jsonStringifyReplacer)}`;break;case p2.unrecognized_keys:a=`Unrecognized key(s) in object: ${p0.joinValues(e.keys,", ")}`;break;case p2.invalid_union:a="Invalid input";break;case p2.invalid_union_discriminator:a=`Invalid discriminator value. Expected ${p0.joinValues(e.options)}`;break;case p2.invalid_enum_value:a=`Invalid enum value. Expected ${p0.joinValues(e.options)}, received '${e.received}'`;break;case p2.invalid_arguments:a="Invalid function arguments";break;case p2.invalid_return_type:a="Invalid function return type";break;case p2.invalid_date:a="Invalid date";break;case p2.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(a=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(a=`${a} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?a=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?a=`Invalid input: must end with "${e.validation.endsWith}"`:p0.assertNever(e.validation):e.validation!=="regex"?a=`Invalid ${e.validation}`:a="Invalid";break;case p2.too_small:e.type==="array"?a=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?a=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?a=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?a=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:a="Invalid input";break;case p2.too_big:e.type==="array"?a=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?a=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?a=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?a=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?a=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:a="Invalid input";break;case p2.custom:a="Invalid input";break;case p2.invalid_intersection_types:a="Intersection results could not be merged";break;case p2.not_multiple_of:a=`Number must be a multiple of ${e.multipleOf}`;break;case p2.not_finite:a="Number must be finite";break;default:a=t.defaultError,p0.assertNever(e)}return{message:a}};let fz=c4;function wG(e){fz=e}function Gc(){return fz}const jc=e=>{const{data:t,path:a,errorMaps:n,issueData:r}=e,s=[...a,...r.path||[]],o={...r,path:s};if(r.message!==void 0)return{...r,path:s,message:r.message};let u="";const d=n.filter(f=>!!f).slice().reverse();for(const f of d)u=f(o,{data:t,defaultError:u}).message;return{...r,path:s,message:u}},bG=[];function S2(e,t){const a=Gc(),n=jc({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,a,a===c4?void 0:c4].filter(r=>!!r)});e.common.issues.push(n)}class w1{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,a){const n=[];for(const r of a){if(r.status==="aborted")return q2;r.status==="dirty"&&t.dirty(),n.push(r.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,a){const n=[];for(const r of a){const s=await r.key,o=await r.value;n.push({key:s,value:o})}return w1.mergeObjectSync(t,n)}static mergeObjectSync(t,a){const n={};for(const r of a){const{key:s,value:o}=r;if(s.status==="aborted"||o.status==="aborted")return q2;s.status==="dirty"&&t.dirty(),o.status==="dirty"&&t.dirty(),s.value!=="__proto__"&&(typeof o.value<"u"||r.alwaysSet)&&(n[s.value]=o.value)}return{status:t.value,value:n}}}const q2=Object.freeze({status:"aborted"}),jn=e=>({status:"dirty",value:e}),L1=e=>({status:"valid",value:e}),y8=e=>e.status==="aborted",z8=e=>e.status==="dirty",Ua=e=>e.status==="valid",gr=e=>typeof Promise<"u"&&e instanceof Promise;function Kc(e,t,a,n){if(typeof t=="function"?e!==t||!0:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function mz(e,t,a,n,r){if(typeof t=="function"?e!==t||!0:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,a),a}var D2;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(D2||(D2={}));var Yl,Zl;class c3{constructor(t,a,n,r){this._cachedPath=[],this.parent=t,this.data=a,this._path=n,this._key=r}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const FA=(e,t)=>{if(Ua(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const a=new le(e.common.issues);return this._error=a,this._error}}};function t0(e){if(!e)return{};const{errorMap:t,invalid_type_error:a,required_error:n,description:r}=e;if(t&&(a||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:r}:{errorMap:(o,u)=>{var d,f;const{message:v}=e;return o.code==="invalid_enum_value"?{message:v??u.defaultError}:typeof u.data>"u"?{message:(d=v??n)!==null&&d!==void 0?d:u.defaultError}:o.code!=="invalid_type"?{message:u.defaultError}:{message:(f=v??a)!==null&&f!==void 0?f:u.defaultError}},description:r}}class l0{get description(){return this._def.description}_getType(t){return D3(t.data)}_getOrReturnCtx(t,a){return a||{common:t.parent.common,data:t.data,parsedType:D3(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new w1,ctx:{common:t.parent.common,data:t.data,parsedType:D3(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const a=this._parse(t);if(gr(a))throw new Error("Synchronous parse encountered promise.");return a}_parseAsync(t){const a=this._parse(t);return Promise.resolve(a)}parse(t,a){const n=this.safeParse(t,a);if(n.success)return n.data;throw n.error}safeParse(t,a){var n;const r={common:{issues:[],async:(n=a==null?void 0:a.async)!==null&&n!==void 0?n:!1,contextualErrorMap:a==null?void 0:a.errorMap},path:(a==null?void 0:a.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:D3(t)},s=this._parseSync({data:t,path:r.path,parent:r});return FA(r,s)}"~validate"(t){var a,n;const r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:D3(t)};if(!this["~standard"].async)try{const s=this._parseSync({data:t,path:[],parent:r});return Ua(s)?{value:s.value}:{issues:r.common.issues}}catch(s){!((n=(a=s==null?void 0:s.message)===null||a===void 0?void 0:a.toLowerCase())===null||n===void 0)&&n.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:r}).then(s=>Ua(s)?{value:s.value}:{issues:r.common.issues})}async parseAsync(t,a){const n=await this.safeParseAsync(t,a);if(n.success)return n.data;throw n.error}async safeParseAsync(t,a){const n={common:{issues:[],contextualErrorMap:a==null?void 0:a.errorMap,async:!0},path:(a==null?void 0:a.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:D3(t)},r=this._parse({data:t,path:n.path,parent:n}),s=await(gr(r)?r:Promise.resolve(r));return FA(n,s)}refine(t,a){const n=r=>typeof a=="string"||typeof a>"u"?{message:a}:typeof a=="function"?a(r):a;return this._refinement((r,s)=>{const o=t(r),u=()=>s.addIssue({code:p2.custom,...n(r)});return typeof Promise<"u"&&o instanceof Promise?o.then(d=>d?!0:(u(),!1)):o?!0:(u(),!1)})}refinement(t,a){return this._refinement((n,r)=>t(n)?!0:(r.addIssue(typeof a=="function"?a(n,r):a),!1))}_refinement(t){return new Ue({schema:this,typeName:$2.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:a=>this["~validate"](a)}}optional(){return n3.create(this,this._def)}nullable(){return Dt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Fe.create(this)}promise(){return u4.create(this,this._def)}or(t){return Nr.create([this,t],this._def)}and(t){return Sr.create(this,t,this._def)}transform(t){return new Ue({...t0(this._def),schema:this,typeName:$2.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const a=typeof t=="function"?t:()=>t;return new Rr({...t0(this._def),innerType:this,defaultValue:a,typeName:$2.ZodDefault})}brand(){return new hd({typeName:$2.ZodBranded,type:this,...t0(this._def)})}catch(t){const a=typeof t=="function"?t:()=>t;return new xr({...t0(this._def),innerType:this,catchValue:a,typeName:$2.ZodCatch})}describe(t){const a=this.constructor;return new a({...this._def,description:t})}pipe(t){return oi.create(this,t)}readonly(){return wr.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const TG=/^c[^\s-]{8,}$/i,kG=/^[0-9a-z]+$/,DG=/^[0-9A-HJKMNP-TV-Z]{26}$/i,BG=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,LG=/^[a-z0-9_-]{21}$/i,OG=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,FG=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,HG=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,PG="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let c7;const UG=/^(?:(?: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])$/,VG=/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,GG=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,jG=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,KG=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,$G=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,vz="((\\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])))",YG=new RegExp(`^${vz}$`);function pz(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}function ZG(e){return new RegExp(`^${pz(e)}$`)}function Az(e){let t=`${vz}T${pz(e)}`;const a=[];return a.push(e.local?"Z?":"Z"),e.offset&&a.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${a.join("|")})`,new RegExp(`^${t}$`)}function WG(e,t){return!!((t==="v4"||!t)&&UG.test(e)||(t==="v6"||!t)&&GG.test(e))}function qG(e,t){if(!OG.test(e))return!1;try{const[a]=e.split("."),n=a.replace(/-/g,"+").replace(/_/g,"/").padEnd(a.length+(4-a.length%4)%4,"="),r=JSON.parse(atob(n));return!(typeof r!="object"||r===null||!r.typ||!r.alg||t&&r.alg!==t)}catch{return!1}}function XG(e,t){return!!((t==="v4"||!t)&&VG.test(e)||(t==="v6"||!t)&&jG.test(e))}class Oe extends l0{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==M2.string){const s=this._getOrReturnCtx(t);return S2(s,{code:p2.invalid_type,expected:M2.string,received:s.parsedType}),q2}const n=new w1;let r;for(const s of this._def.checks)if(s.kind==="min")t.data.length<s.value&&(r=this._getOrReturnCtx(t,r),S2(r,{code:p2.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="max")t.data.length>s.value&&(r=this._getOrReturnCtx(t,r),S2(r,{code:p2.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="length"){const o=t.data.length>s.value,u=t.data.length<s.value;(o||u)&&(r=this._getOrReturnCtx(t,r),o?S2(r,{code:p2.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):u&&S2(r,{code:p2.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty())}else if(s.kind==="email")HG.test(t.data)||(r=this._getOrReturnCtx(t,r),S2(r,{validation:"email",code:p2.invalid_string,message:s.message}),n.dirty());else if(s.kind==="emoji")c7||(c7=new RegExp(PG,"u")),c7.test(t.data)||(r=this._getOrReturnCtx(t,r),S2(r,{validation:"emoji",code:p2.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")BG.test(t.data)||(r=this._getOrReturnCtx(t,r),S2(r,{validation:"uuid",code:p2.invalid_string,message:s.message}),n.dirty());else if(s.kind==="nanoid")LG.test(t.data)||(r=this._getOrReturnCtx(t,r),S2(r,{validation:"nanoid",code:p2.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")TG.test(t.data)||(r=this._getOrReturnCtx(t,r),S2(r,{validation:"cuid",code:p2.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid2")kG.test(t.data)||(r=this._getOrReturnCtx(t,r),S2(r,{validation:"cuid2",code:p2.invalid_string,message:s.message}),n.dirty());else if(s.kind==="ulid")DG.test(t.data)||(r=this._getOrReturnCtx(t,r),S2(r,{validation:"ulid",code:p2.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(t.data)}catch{r=this._getOrReturnCtx(t,r),S2(r,{validation:"url",code:p2.invalid_string,message:s.message}),n.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(t.data)||(r=this._getOrReturnCtx(t,r),S2(r,{validation:"regex",code:p2.invalid_string,message:s.message}),n.dirty())):s.kind==="trim"?t.data=t.data.trim():s.kind==="includes"?t.data.includes(s.value,s.position)||(r=this._getOrReturnCtx(t,r),S2(r,{code:p2.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),n.dirty()):s.kind==="toLowerCase"?t.data=t.data.toLowerCase():s.kind==="toUpperCase"?t.data=t.data.toUpperCase():s.kind==="startsWith"?t.data.startsWith(s.value)||(r=this._getOrReturnCtx(t,r),S2(r,{code:p2.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty()):s.kind==="endsWith"?t.data.endsWith(s.value)||(r=this._getOrReturnCtx(t,r),S2(r,{code:p2.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?Az(s).test(t.data)||(r=this._getOrReturnCtx(t,r),S2(r,{code:p2.invalid_string,validation:"datetime",message:s.message}),n.dirty()):s.kind==="date"?YG.test(t.data)||(r=this._getOrReturnCtx(t,r),S2(r,{code:p2.invalid_string,validation:"date",message:s.message}),n.dirty()):s.kind==="time"?ZG(s).test(t.data)||(r=this._getOrReturnCtx(t,r),S2(r,{code:p2.invalid_string,validation:"time",message:s.message}),n.dirty()):s.kind==="duration"?FG.test(t.data)||(r=this._getOrReturnCtx(t,r),S2(r,{validation:"duration",code:p2.invalid_string,message:s.message}),n.dirty()):s.kind==="ip"?WG(t.data,s.version)||(r=this._getOrReturnCtx(t,r),S2(r,{validation:"ip",code:p2.invalid_string,message:s.message}),n.dirty()):s.kind==="jwt"?qG(t.data,s.alg)||(r=this._getOrReturnCtx(t,r),S2(r,{validation:"jwt",code:p2.invalid_string,message:s.message}),n.dirty()):s.kind==="cidr"?XG(t.data,s.version)||(r=this._getOrReturnCtx(t,r),S2(r,{validation:"cidr",code:p2.invalid_string,message:s.message}),n.dirty()):s.kind==="base64"?KG.test(t.data)||(r=this._getOrReturnCtx(t,r),S2(r,{validation:"base64",code:p2.invalid_string,message:s.message}),n.dirty()):s.kind==="base64url"?$G.test(t.data)||(r=this._getOrReturnCtx(t,r),S2(r,{validation:"base64url",code:p2.invalid_string,message:s.message}),n.dirty()):p0.assertNever(s);return{status:n.value,value:t.data}}_regex(t,a,n){return this.refinement(r=>t.test(r),{validation:a,code:p2.invalid_string,...D2.errToObj(n)})}_addCheck(t){return new Oe({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...D2.errToObj(t)})}url(t){return this._addCheck({kind:"url",...D2.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...D2.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...D2.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...D2.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...D2.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...D2.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...D2.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...D2.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...D2.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...D2.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...D2.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...D2.errToObj(t)})}datetime(t){var a,n;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(a=t==null?void 0:t.offset)!==null&&a!==void 0?a:!1,local:(n=t==null?void 0:t.local)!==null&&n!==void 0?n:!1,...D2.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...D2.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...D2.errToObj(t)})}regex(t,a){return this._addCheck({kind:"regex",regex:t,...D2.errToObj(a)})}includes(t,a){return this._addCheck({kind:"includes",value:t,position:a==null?void 0:a.position,...D2.errToObj(a==null?void 0:a.message)})}startsWith(t,a){return this._addCheck({kind:"startsWith",value:t,...D2.errToObj(a)})}endsWith(t,a){return this._addCheck({kind:"endsWith",value:t,...D2.errToObj(a)})}min(t,a){return this._addCheck({kind:"min",value:t,...D2.errToObj(a)})}max(t,a){return this._addCheck({kind:"max",value:t,...D2.errToObj(a)})}length(t,a){return this._addCheck({kind:"length",value:t,...D2.errToObj(a)})}nonempty(t){return this.min(1,D2.errToObj(t))}trim(){return new Oe({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Oe({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Oe({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const a of this._def.checks)a.kind==="min"&&(t===null||a.value>t)&&(t=a.value);return t}get maxLength(){let t=null;for(const a of this._def.checks)a.kind==="max"&&(t===null||a.value<t)&&(t=a.value);return t}}Oe.create=e=>{var t;return new Oe({checks:[],typeName:$2.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...t0(e)})};function QG(e,t){const a=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,r=a>n?a:n,s=parseInt(e.toFixed(r).replace(".","")),o=parseInt(t.toFixed(r).replace(".",""));return s%o/Math.pow(10,r)}class bt extends l0{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==M2.number){const s=this._getOrReturnCtx(t);return S2(s,{code:p2.invalid_type,expected:M2.number,received:s.parsedType}),q2}let n;const r=new w1;for(const s of this._def.checks)s.kind==="int"?p0.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),S2(n,{code:p2.invalid_type,expected:"integer",received:"float",message:s.message}),r.dirty()):s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(n=this._getOrReturnCtx(t,n),S2(n,{code:p2.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),r.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(n=this._getOrReturnCtx(t,n),S2(n,{code:p2.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),r.dirty()):s.kind==="multipleOf"?QG(t.data,s.value)!==0&&(n=this._getOrReturnCtx(t,n),S2(n,{code:p2.not_multiple_of,multipleOf:s.value,message:s.message}),r.dirty()):s.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),S2(n,{code:p2.not_finite,message:s.message}),r.dirty()):p0.assertNever(s);return{status:r.value,value:t.data}}gte(t,a){return this.setLimit("min",t,!0,D2.toString(a))}gt(t,a){return this.setLimit("min",t,!1,D2.toString(a))}lte(t,a){return this.setLimit("max",t,!0,D2.toString(a))}lt(t,a){return this.setLimit("max",t,!1,D2.toString(a))}setLimit(t,a,n,r){return new bt({...this._def,checks:[...this._def.checks,{kind:t,value:a,inclusive:n,message:D2.toString(r)}]})}_addCheck(t){return new bt({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:D2.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:D2.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:D2.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:D2.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:D2.toString(t)})}multipleOf(t,a){return this._addCheck({kind:"multipleOf",value:t,message:D2.toString(a)})}finite(t){return this._addCheck({kind:"finite",message:D2.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:D2.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:D2.toString(t)})}get minValue(){let t=null;for(const a of this._def.checks)a.kind==="min"&&(t===null||a.value>t)&&(t=a.value);return t}get maxValue(){let t=null;for(const a of this._def.checks)a.kind==="max"&&(t===null||a.value<t)&&(t=a.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&p0.isInteger(t.value))}get isFinite(){let t=null,a=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(a===null||n.value>a)&&(a=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(a)&&Number.isFinite(t)}}bt.create=e=>new bt({checks:[],typeName:$2.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...t0(e)});class Tt extends l0{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==M2.bigint)return this._getInvalidInput(t);let n;const r=new w1;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(n=this._getOrReturnCtx(t,n),S2(n,{code:p2.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),r.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(n=this._getOrReturnCtx(t,n),S2(n,{code:p2.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),r.dirty()):s.kind==="multipleOf"?t.data%s.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),S2(n,{code:p2.not_multiple_of,multipleOf:s.value,message:s.message}),r.dirty()):p0.assertNever(s);return{status:r.value,value:t.data}}_getInvalidInput(t){const a=this._getOrReturnCtx(t);return S2(a,{code:p2.invalid_type,expected:M2.bigint,received:a.parsedType}),q2}gte(t,a){return this.setLimit("min",t,!0,D2.toString(a))}gt(t,a){return this.setLimit("min",t,!1,D2.toString(a))}lte(t,a){return this.setLimit("max",t,!0,D2.toString(a))}lt(t,a){return this.setLimit("max",t,!1,D2.toString(a))}setLimit(t,a,n,r){return new Tt({...this._def,checks:[...this._def.checks,{kind:t,value:a,inclusive:n,message:D2.toString(r)}]})}_addCheck(t){return new Tt({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:D2.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:D2.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:D2.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:D2.toString(t)})}multipleOf(t,a){return this._addCheck({kind:"multipleOf",value:t,message:D2.toString(a)})}get minValue(){let t=null;for(const a of this._def.checks)a.kind==="min"&&(t===null||a.value>t)&&(t=a.value);return t}get maxValue(){let t=null;for(const a of this._def.checks)a.kind==="max"&&(t===null||a.value<t)&&(t=a.value);return t}}Tt.create=e=>{var t;return new Tt({checks:[],typeName:$2.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...t0(e)})};class Er extends l0{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==M2.boolean){const n=this._getOrReturnCtx(t);return S2(n,{code:p2.invalid_type,expected:M2.boolean,received:n.parsedType}),q2}return L1(t.data)}}Er.create=e=>new Er({typeName:$2.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...t0(e)});class Va extends l0{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==M2.date){const s=this._getOrReturnCtx(t);return S2(s,{code:p2.invalid_type,expected:M2.date,received:s.parsedType}),q2}if(isNaN(t.data.getTime())){const s=this._getOrReturnCtx(t);return S2(s,{code:p2.invalid_date}),q2}const n=new w1;let r;for(const s of this._def.checks)s.kind==="min"?t.data.getTime()<s.value&&(r=this._getOrReturnCtx(t,r),S2(r,{code:p2.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),n.dirty()):s.kind==="max"?t.data.getTime()>s.value&&(r=this._getOrReturnCtx(t,r),S2(r,{code:p2.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):p0.assertNever(s);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Va({...this._def,checks:[...this._def.checks,t]})}min(t,a){return this._addCheck({kind:"min",value:t.getTime(),message:D2.toString(a)})}max(t,a){return this._addCheck({kind:"max",value:t.getTime(),message:D2.toString(a)})}get minDate(){let t=null;for(const a of this._def.checks)a.kind==="min"&&(t===null||a.value>t)&&(t=a.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const a of this._def.checks)a.kind==="max"&&(t===null||a.value<t)&&(t=a.value);return t!=null?new Date(t):null}}Va.create=e=>new Va({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:$2.ZodDate,...t0(e)});class $c extends l0{_parse(t){if(this._getType(t)!==M2.symbol){const n=this._getOrReturnCtx(t);return S2(n,{code:p2.invalid_type,expected:M2.symbol,received:n.parsedType}),q2}return L1(t.data)}}$c.create=e=>new $c({typeName:$2.ZodSymbol,...t0(e)});class _r extends l0{_parse(t){if(this._getType(t)!==M2.undefined){const n=this._getOrReturnCtx(t);return S2(n,{code:p2.invalid_type,expected:M2.undefined,received:n.parsedType}),q2}return L1(t.data)}}_r.create=e=>new _r({typeName:$2.ZodUndefined,...t0(e)});class Ir extends l0{_parse(t){if(this._getType(t)!==M2.null){const n=this._getOrReturnCtx(t);return S2(n,{code:p2.invalid_type,expected:M2.null,received:n.parsedType}),q2}return L1(t.data)}}Ir.create=e=>new Ir({typeName:$2.ZodNull,...t0(e)});class o4 extends l0{constructor(){super(...arguments),this._any=!0}_parse(t){return L1(t.data)}}o4.create=e=>new o4({typeName:$2.ZodAny,...t0(e)});class Ta extends l0{constructor(){super(...arguments),this._unknown=!0}_parse(t){return L1(t.data)}}Ta.create=e=>new Ta({typeName:$2.ZodUnknown,...t0(e)});class V3 extends l0{_parse(t){const a=this._getOrReturnCtx(t);return S2(a,{code:p2.invalid_type,expected:M2.never,received:a.parsedType}),q2}}V3.create=e=>new V3({typeName:$2.ZodNever,...t0(e)});class Yc extends l0{_parse(t){if(this._getType(t)!==M2.undefined){const n=this._getOrReturnCtx(t);return S2(n,{code:p2.invalid_type,expected:M2.void,received:n.parsedType}),q2}return L1(t.data)}}Yc.create=e=>new Yc({typeName:$2.ZodVoid,...t0(e)});class Fe extends l0{_parse(t){const{ctx:a,status:n}=this._processInputParams(t),r=this._def;if(a.parsedType!==M2.array)return S2(a,{code:p2.invalid_type,expected:M2.array,received:a.parsedType}),q2;if(r.exactLength!==null){const o=a.data.length>r.exactLength.value,u=a.data.length<r.exactLength.value;(o||u)&&(S2(a,{code:o?p2.too_big:p2.too_small,minimum:u?r.exactLength.value:void 0,maximum:o?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(r.minLength!==null&&a.data.length<r.minLength.value&&(S2(a,{code:p2.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),r.maxLength!==null&&a.data.length>r.maxLength.value&&(S2(a,{code:p2.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),a.common.async)return Promise.all([...a.data].map((o,u)=>r.type._parseAsync(new c3(a,o,a.path,u)))).then(o=>w1.mergeArray(n,o));const s=[...a.data].map((o,u)=>r.type._parseSync(new c3(a,o,a.path,u)));return w1.mergeArray(n,s)}get element(){return this._def.type}min(t,a){return new Fe({...this._def,minLength:{value:t,message:D2.toString(a)}})}max(t,a){return new Fe({...this._def,maxLength:{value:t,message:D2.toString(a)}})}length(t,a){return new Fe({...this._def,exactLength:{value:t,message:D2.toString(a)}})}nonempty(t){return this.min(1,t)}}Fe.create=(e,t)=>new Fe({type:e,minLength:null,maxLength:null,exactLength:null,typeName:$2.ZodArray,...t0(t)});function Vn(e){if(e instanceof T0){const t={};for(const a in e.shape){const n=e.shape[a];t[a]=n3.create(Vn(n))}return new T0({...e._def,shape:()=>t})}else return e instanceof Fe?new Fe({...e._def,type:Vn(e.element)}):e instanceof n3?n3.create(Vn(e.unwrap())):e instanceof Dt?Dt.create(Vn(e.unwrap())):e instanceof o3?o3.create(e.items.map(t=>Vn(t))):e}class T0 extends l0{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),a=p0.objectKeys(t);return this._cached={shape:t,keys:a}}_parse(t){if(this._getType(t)!==M2.object){const f=this._getOrReturnCtx(t);return S2(f,{code:p2.invalid_type,expected:M2.object,received:f.parsedType}),q2}const{status:n,ctx:r}=this._processInputParams(t),{shape:s,keys:o}=this._getCached(),u=[];if(!(this._def.catchall instanceof V3&&this._def.unknownKeys==="strip"))for(const f in r.data)o.includes(f)||u.push(f);const d=[];for(const f of o){const v=s[f],p=r.data[f];d.push({key:{status:"valid",value:f},value:v._parse(new c3(r,p,r.path,f)),alwaysSet:f in r.data})}if(this._def.catchall instanceof V3){const f=this._def.unknownKeys;if(f==="passthrough")for(const v of u)d.push({key:{status:"valid",value:v},value:{status:"valid",value:r.data[v]}});else if(f==="strict")u.length>0&&(S2(r,{code:p2.unrecognized_keys,keys:u}),n.dirty());else if(f!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const f=this._def.catchall;for(const v of u){const p=r.data[v];d.push({key:{status:"valid",value:v},value:f._parse(new c3(r,p,r.path,v)),alwaysSet:v in r.data})}}return r.common.async?Promise.resolve().then(async()=>{const f=[];for(const v of d){const p=await v.key,A=await v.value;f.push({key:p,value:A,alwaysSet:v.alwaysSet})}return f}).then(f=>w1.mergeObjectSync(n,f)):w1.mergeObjectSync(n,d)}get shape(){return this._def.shape()}strict(t){return D2.errToObj,new T0({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(a,n)=>{var r,s,o,u;const d=(o=(s=(r=this._def).errorMap)===null||s===void 0?void 0:s.call(r,a,n).message)!==null&&o!==void 0?o:n.defaultError;return a.code==="unrecognized_keys"?{message:(u=D2.errToObj(t).message)!==null&&u!==void 0?u:d}:{message:d}}}:{}})}strip(){return new T0({...this._def,unknownKeys:"strip"})}passthrough(){return new T0({...this._def,unknownKeys:"passthrough"})}extend(t){return new T0({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new T0({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:$2.ZodObject})}setKey(t,a){return this.augment({[t]:a})}catchall(t){return new T0({...this._def,catchall:t})}pick(t){const a={};return p0.objectKeys(t).forEach(n=>{t[n]&&this.shape[n]&&(a[n]=this.shape[n])}),new T0({...this._def,shape:()=>a})}omit(t){const a={};return p0.objectKeys(this.shape).forEach(n=>{t[n]||(a[n]=this.shape[n])}),new T0({...this._def,shape:()=>a})}deepPartial(){return Vn(this)}partial(t){const a={};return p0.objectKeys(this.shape).forEach(n=>{const r=this.shape[n];t&&!t[n]?a[n]=r:a[n]=r.optional()}),new T0({...this._def,shape:()=>a})}required(t){const a={};return p0.objectKeys(this.shape).forEach(n=>{if(t&&!t[n])a[n]=this.shape[n];else{let s=this.shape[n];for(;s instanceof n3;)s=s._def.innerType;a[n]=s}}),new T0({...this._def,shape:()=>a})}keyof(){return gz(p0.objectKeys(this.shape))}}T0.create=(e,t)=>new T0({shape:()=>e,unknownKeys:"strip",catchall:V3.create(),typeName:$2.ZodObject,...t0(t)});T0.strictCreate=(e,t)=>new T0({shape:()=>e,unknownKeys:"strict",catchall:V3.create(),typeName:$2.ZodObject,...t0(t)});T0.lazycreate=(e,t)=>new T0({shape:e,unknownKeys:"strip",catchall:V3.create(),typeName:$2.ZodObject,...t0(t)});class Nr extends l0{_parse(t){const{ctx:a}=this._processInputParams(t),n=this._def.options;function r(s){for(const u of s)if(u.result.status==="valid")return u.result;for(const u of s)if(u.result.status==="dirty")return a.common.issues.push(...u.ctx.common.issues),u.result;const o=s.map(u=>new le(u.ctx.common.issues));return S2(a,{code:p2.invalid_union,unionErrors:o}),q2}if(a.common.async)return Promise.all(n.map(async s=>{const o={...a,common:{...a.common,issues:[]},parent:null};return{result:await s._parseAsync({data:a.data,path:a.path,parent:o}),ctx:o}})).then(r);{let s;const o=[];for(const d of n){const f={...a,common:{...a.common,issues:[]},parent:null},v=d._parseSync({data:a.data,path:a.path,parent:f});if(v.status==="valid")return v;v.status==="dirty"&&!s&&(s={result:v,ctx:f}),f.common.issues.length&&o.push(f.common.issues)}if(s)return a.common.issues.push(...s.ctx.common.issues),s.result;const u=o.map(d=>new le(d));return S2(a,{code:p2.invalid_union,unionErrors:u}),q2}}get options(){return this._def.options}}Nr.create=(e,t)=>new Nr({options:e,typeName:$2.ZodUnion,...t0(t)});const k3=e=>e instanceof zr?k3(e.schema):e instanceof Ue?k3(e.innerType()):e instanceof Cr?[e.value]:e instanceof kt?e.options:e instanceof Mr?p0.objectValues(e.enum):e instanceof Rr?k3(e._def.innerType):e instanceof _r?[void 0]:e instanceof Ir?[null]:e instanceof n3?[void 0,...k3(e.unwrap())]:e instanceof Dt?[null,...k3(e.unwrap())]:e instanceof hd||e instanceof wr?k3(e.unwrap()):e instanceof xr?k3(e._def.innerType):[];class Yo extends l0{_parse(t){const{ctx:a}=this._processInputParams(t);if(a.parsedType!==M2.object)return S2(a,{code:p2.invalid_type,expected:M2.object,received:a.parsedType}),q2;const n=this.discriminator,r=a.data[n],s=this.optionsMap.get(r);return s?a.common.async?s._parseAsync({data:a.data,path:a.path,parent:a}):s._parseSync({data:a.data,path:a.path,parent:a}):(S2(a,{code:p2.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),q2)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,a,n){const r=new Map;for(const s of a){const o=k3(s.shape[t]);if(!o.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const u of o){if(r.has(u))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(u)}`);r.set(u,s)}}return new Yo({typeName:$2.ZodDiscriminatedUnion,discriminator:t,options:a,optionsMap:r,...t0(n)})}}function C8(e,t){const a=D3(e),n=D3(t);if(e===t)return{valid:!0,data:e};if(a===M2.object&&n===M2.object){const r=p0.objectKeys(t),s=p0.objectKeys(e).filter(u=>r.indexOf(u)!==-1),o={...e,...t};for(const u of s){const d=C8(e[u],t[u]);if(!d.valid)return{valid:!1};o[u]=d.data}return{valid:!0,data:o}}else if(a===M2.array&&n===M2.array){if(e.length!==t.length)return{valid:!1};const r=[];for(let s=0;s<e.length;s++){const o=e[s],u=t[s],d=C8(o,u);if(!d.valid)return{valid:!1};r.push(d.data)}return{valid:!0,data:r}}else return a===M2.date&&n===M2.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class Sr extends l0{_parse(t){const{status:a,ctx:n}=this._processInputParams(t),r=(s,o)=>{if(y8(s)||y8(o))return q2;const u=C8(s.value,o.value);return u.valid?((z8(s)||z8(o))&&a.dirty(),{status:a.value,value:u.data}):(S2(n,{code:p2.invalid_intersection_types}),q2)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([s,o])=>r(s,o)):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}Sr.create=(e,t,a)=>new Sr({left:e,right:t,typeName:$2.ZodIntersection,...t0(a)});class o3 extends l0{_parse(t){const{status:a,ctx:n}=this._processInputParams(t);if(n.parsedType!==M2.array)return S2(n,{code:p2.invalid_type,expected:M2.array,received:n.parsedType}),q2;if(n.data.length<this._def.items.length)return S2(n,{code:p2.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),q2;!this._def.rest&&n.data.length>this._def.items.length&&(S2(n,{code:p2.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),a.dirty());const s=[...n.data].map((o,u)=>{const d=this._def.items[u]||this._def.rest;return d?d._parse(new c3(n,o,n.path,u)):null}).filter(o=>!!o);return n.common.async?Promise.all(s).then(o=>w1.mergeArray(a,o)):w1.mergeArray(a,s)}get items(){return this._def.items}rest(t){return new o3({...this._def,rest:t})}}o3.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new o3({items:e,typeName:$2.ZodTuple,rest:null,...t0(t)})};class yr extends l0{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:a,ctx:n}=this._processInputParams(t);if(n.parsedType!==M2.object)return S2(n,{code:p2.invalid_type,expected:M2.object,received:n.parsedType}),q2;const r=[],s=this._def.keyType,o=this._def.valueType;for(const u in n.data)r.push({key:s._parse(new c3(n,u,n.path,u)),value:o._parse(new c3(n,n.data[u],n.path,u)),alwaysSet:u in n.data});return n.common.async?w1.mergeObjectAsync(a,r):w1.mergeObjectSync(a,r)}get element(){return this._def.valueType}static create(t,a,n){return a instanceof l0?new yr({keyType:t,valueType:a,typeName:$2.ZodRecord,...t0(n)}):new yr({keyType:Oe.create(),valueType:t,typeName:$2.ZodRecord,...t0(a)})}}class Zc extends l0{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:a,ctx:n}=this._processInputParams(t);if(n.parsedType!==M2.map)return S2(n,{code:p2.invalid_type,expected:M2.map,received:n.parsedType}),q2;const r=this._def.keyType,s=this._def.valueType,o=[...n.data.entries()].map(([u,d],f)=>({key:r._parse(new c3(n,u,n.path,[f,"key"])),value:s._parse(new c3(n,d,n.path,[f,"value"]))}));if(n.common.async){const u=new Map;return Promise.resolve().then(async()=>{for(const d of o){const f=await d.key,v=await d.value;if(f.status==="aborted"||v.status==="aborted")return q2;(f.status==="dirty"||v.status==="dirty")&&a.dirty(),u.set(f.value,v.value)}return{status:a.value,value:u}})}else{const u=new Map;for(const d of o){const f=d.key,v=d.value;if(f.status==="aborted"||v.status==="aborted")return q2;(f.status==="dirty"||v.status==="dirty")&&a.dirty(),u.set(f.value,v.value)}return{status:a.value,value:u}}}}Zc.create=(e,t,a)=>new Zc({valueType:t,keyType:e,typeName:$2.ZodMap,...t0(a)});class Ga extends l0{_parse(t){const{status:a,ctx:n}=this._processInputParams(t);if(n.parsedType!==M2.set)return S2(n,{code:p2.invalid_type,expected:M2.set,received:n.parsedType}),q2;const r=this._def;r.minSize!==null&&n.data.size<r.minSize.value&&(S2(n,{code:p2.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),a.dirty()),r.maxSize!==null&&n.data.size>r.maxSize.value&&(S2(n,{code:p2.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),a.dirty());const s=this._def.valueType;function o(d){const f=new Set;for(const v of d){if(v.status==="aborted")return q2;v.status==="dirty"&&a.dirty(),f.add(v.value)}return{status:a.value,value:f}}const u=[...n.data.values()].map((d,f)=>s._parse(new c3(n,d,n.path,f)));return n.common.async?Promise.all(u).then(d=>o(d)):o(u)}min(t,a){return new Ga({...this._def,minSize:{value:t,message:D2.toString(a)}})}max(t,a){return new Ga({...this._def,maxSize:{value:t,message:D2.toString(a)}})}size(t,a){return this.min(t,a).max(t,a)}nonempty(t){return this.min(1,t)}}Ga.create=(e,t)=>new Ga({valueType:e,minSize:null,maxSize:null,typeName:$2.ZodSet,...t0(t)});class t4 extends l0{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:a}=this._processInputParams(t);if(a.parsedType!==M2.function)return S2(a,{code:p2.invalid_type,expected:M2.function,received:a.parsedType}),q2;function n(u,d){return jc({data:u,path:a.path,errorMaps:[a.common.contextualErrorMap,a.schemaErrorMap,Gc(),c4].filter(f=>!!f),issueData:{code:p2.invalid_arguments,argumentsError:d}})}function r(u,d){return jc({data:u,path:a.path,errorMaps:[a.common.contextualErrorMap,a.schemaErrorMap,Gc(),c4].filter(f=>!!f),issueData:{code:p2.invalid_return_type,returnTypeError:d}})}const s={errorMap:a.common.contextualErrorMap},o=a.data;if(this._def.returns instanceof u4){const u=this;return L1(async function(...d){const f=new le([]),v=await u._def.args.parseAsync(d,s).catch(E=>{throw f.addIssue(n(d,E)),f}),p=await Reflect.apply(o,this,v);return await u._def.returns._def.type.parseAsync(p,s).catch(E=>{throw f.addIssue(r(p,E)),f})})}else{const u=this;return L1(function(...d){const f=u._def.args.safeParse(d,s);if(!f.success)throw new le([n(d,f.error)]);const v=Reflect.apply(o,this,f.data),p=u._def.returns.safeParse(v,s);if(!p.success)throw new le([r(v,p.error)]);return p.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new t4({...this._def,args:o3.create(t).rest(Ta.create())})}returns(t){return new t4({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,a,n){return new t4({args:t||o3.create([]).rest(Ta.create()),returns:a||Ta.create(),typeName:$2.ZodFunction,...t0(n)})}}class zr extends l0{get schema(){return this._def.getter()}_parse(t){const{ctx:a}=this._processInputParams(t);return this._def.getter()._parse({data:a.data,path:a.path,parent:a})}}zr.create=(e,t)=>new zr({getter:e,typeName:$2.ZodLazy,...t0(t)});class Cr extends l0{_parse(t){if(t.data!==this._def.value){const a=this._getOrReturnCtx(t);return S2(a,{received:a.data,code:p2.invalid_literal,expected:this._def.value}),q2}return{status:"valid",value:t.data}}get value(){return this._def.value}}Cr.create=(e,t)=>new Cr({value:e,typeName:$2.ZodLiteral,...t0(t)});function gz(e,t){return new kt({values:e,typeName:$2.ZodEnum,...t0(t)})}class kt extends l0{constructor(){super(...arguments),Yl.set(this,void 0)}_parse(t){if(typeof t.data!="string"){const a=this._getOrReturnCtx(t),n=this._def.values;return S2(a,{expected:p0.joinValues(n),received:a.parsedType,code:p2.invalid_type}),q2}if(Kc(this,Yl)||mz(this,Yl,new Set(this._def.values)),!Kc(this,Yl).has(t.data)){const a=this._getOrReturnCtx(t),n=this._def.values;return S2(a,{received:a.data,code:p2.invalid_enum_value,options:n}),q2}return L1(t.data)}get options(){return this._def.values}get enum(){const t={};for(const a of this._def.values)t[a]=a;return t}get Values(){const t={};for(const a of this._def.values)t[a]=a;return t}get Enum(){const t={};for(const a of this._def.values)t[a]=a;return t}extract(t,a=this._def){return kt.create(t,{...this._def,...a})}exclude(t,a=this._def){return kt.create(this.options.filter(n=>!t.includes(n)),{...this._def,...a})}}Yl=new WeakMap;kt.create=gz;class Mr extends l0{constructor(){super(...arguments),Zl.set(this,void 0)}_parse(t){const a=p0.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==M2.string&&n.parsedType!==M2.number){const r=p0.objectValues(a);return S2(n,{expected:p0.joinValues(r),received:n.parsedType,code:p2.invalid_type}),q2}if(Kc(this,Zl)||mz(this,Zl,new Set(p0.getValidEnumValues(this._def.values))),!Kc(this,Zl).has(t.data)){const r=p0.objectValues(a);return S2(n,{received:n.data,code:p2.invalid_enum_value,options:r}),q2}return L1(t.data)}get enum(){return this._def.values}}Zl=new WeakMap;Mr.create=(e,t)=>new Mr({values:e,typeName:$2.ZodNativeEnum,...t0(t)});class u4 extends l0{unwrap(){return this._def.type}_parse(t){const{ctx:a}=this._processInputParams(t);if(a.parsedType!==M2.promise&&a.common.async===!1)return S2(a,{code:p2.invalid_type,expected:M2.promise,received:a.parsedType}),q2;const n=a.parsedType===M2.promise?a.data:Promise.resolve(a.data);return L1(n.then(r=>this._def.type.parseAsync(r,{path:a.path,errorMap:a.common.contextualErrorMap})))}}u4.create=(e,t)=>new u4({type:e,typeName:$2.ZodPromise,...t0(t)});class Ue extends l0{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===$2.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:a,ctx:n}=this._processInputParams(t),r=this._def.effect||null,s={addIssue:o=>{S2(n,o),o.fatal?a.abort():a.dirty()},get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),r.type==="preprocess"){const o=r.transform(n.data,s);if(n.common.async)return Promise.resolve(o).then(async u=>{if(a.value==="aborted")return q2;const d=await this._def.schema._parseAsync({data:u,path:n.path,parent:n});return d.status==="aborted"?q2:d.status==="dirty"||a.value==="dirty"?jn(d.value):d});{if(a.value==="aborted")return q2;const u=this._def.schema._parseSync({data:o,path:n.path,parent:n});return u.status==="aborted"?q2:u.status==="dirty"||a.value==="dirty"?jn(u.value):u}}if(r.type==="refinement"){const o=u=>{const d=r.refinement(u,s);if(n.common.async)return Promise.resolve(d);if(d instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return u};if(n.common.async===!1){const u=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return u.status==="aborted"?q2:(u.status==="dirty"&&a.dirty(),o(u.value),{status:a.value,value:u.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(u=>u.status==="aborted"?q2:(u.status==="dirty"&&a.dirty(),o(u.value).then(()=>({status:a.value,value:u.value}))))}if(r.type==="transform")if(n.common.async===!1){const o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Ua(o))return o;const u=r.transform(o.value,s);if(u instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:a.value,value:u}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>Ua(o)?Promise.resolve(r.transform(o.value,s)).then(u=>({status:a.value,value:u})):o);p0.assertNever(r)}}Ue.create=(e,t,a)=>new Ue({schema:e,typeName:$2.ZodEffects,effect:t,...t0(a)});Ue.createWithPreprocess=(e,t,a)=>new Ue({schema:t,effect:{type:"preprocess",transform:e},typeName:$2.ZodEffects,...t0(a)});class n3 extends l0{_parse(t){return this._getType(t)===M2.undefined?L1(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}n3.create=(e,t)=>new n3({innerType:e,typeName:$2.ZodOptional,...t0(t)});class Dt extends l0{_parse(t){return this._getType(t)===M2.null?L1(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Dt.create=(e,t)=>new Dt({innerType:e,typeName:$2.ZodNullable,...t0(t)});class Rr extends l0{_parse(t){const{ctx:a}=this._processInputParams(t);let n=a.data;return a.parsedType===M2.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:a.path,parent:a})}removeDefault(){return this._def.innerType}}Rr.create=(e,t)=>new Rr({innerType:e,typeName:$2.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...t0(t)});class xr extends l0{_parse(t){const{ctx:a}=this._processInputParams(t),n={...a,common:{...a.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return gr(r)?r.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new le(n.common.issues)},input:n.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new le(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}xr.create=(e,t)=>new xr({innerType:e,typeName:$2.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...t0(t)});class Wc extends l0{_parse(t){if(this._getType(t)!==M2.nan){const n=this._getOrReturnCtx(t);return S2(n,{code:p2.invalid_type,expected:M2.nan,received:n.parsedType}),q2}return{status:"valid",value:t.data}}}Wc.create=e=>new Wc({typeName:$2.ZodNaN,...t0(e)});const JG=Symbol("zod_brand");class hd extends l0{_parse(t){const{ctx:a}=this._processInputParams(t),n=a.data;return this._def.type._parse({data:n,path:a.path,parent:a})}unwrap(){return this._def.type}}class oi extends l0{_parse(t){const{status:a,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?q2:s.status==="dirty"?(a.dirty(),jn(s.value)):this._def.out._parseAsync({data:s.value,path:n.path,parent:n})})();{const r=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return r.status==="aborted"?q2:r.status==="dirty"?(a.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:n.path,parent:n})}}static create(t,a){return new oi({in:t,out:a,typeName:$2.ZodPipeline})}}class wr extends l0{_parse(t){const a=this._def.innerType._parse(t),n=r=>(Ua(r)&&(r.value=Object.freeze(r.value)),r);return gr(a)?a.then(r=>n(r)):n(a)}unwrap(){return this._def.innerType}}wr.create=(e,t)=>new wr({innerType:e,typeName:$2.ZodReadonly,...t0(t)});function HA(e,t){const a=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof a=="string"?{message:a}:a}function Ez(e,t={},a){return e?o4.create().superRefine((n,r)=>{var s,o;const u=e(n);if(u instanceof Promise)return u.then(d=>{var f,v;if(!d){const p=HA(t,n),A=(v=(f=p.fatal)!==null&&f!==void 0?f:a)!==null&&v!==void 0?v:!0;r.addIssue({code:"custom",...p,fatal:A})}});if(!u){const d=HA(t,n),f=(o=(s=d.fatal)!==null&&s!==void 0?s:a)!==null&&o!==void 0?o:!0;r.addIssue({code:"custom",...d,fatal:f})}}):o4.create()}const ej={object:T0.lazycreate};var $2;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})($2||($2={}));const tj=(e,t={message:`Input not instance of ${e.name}`})=>Ez(a=>a instanceof e,t),_z=Oe.create,Iz=bt.create,aj=Wc.create,nj=Tt.create,Nz=Er.create,lj=Va.create,rj=$c.create,ij=_r.create,sj=Ir.create,cj=o4.create,oj=Ta.create,uj=V3.create,hj=Yc.create,dj=Fe.create,fj=T0.create,mj=T0.strictCreate,vj=Nr.create,pj=Yo.create,Aj=Sr.create,gj=o3.create,Ej=yr.create,_j=Zc.create,Ij=Ga.create,Nj=t4.create,Sj=zr.create,yj=Cr.create,zj=kt.create,Cj=Mr.create,Mj=u4.create,PA=Ue.create,Rj=n3.create,xj=Dt.create,wj=Ue.createWithPreprocess,bj=oi.create,Tj=()=>_z().optional(),kj=()=>Iz().optional(),Dj=()=>Nz().optional(),Bj={string:e=>Oe.create({...e,coerce:!0}),number:e=>bt.create({...e,coerce:!0}),boolean:e=>Er.create({...e,coerce:!0}),bigint:e=>Tt.create({...e,coerce:!0}),date:e=>Va.create({...e,coerce:!0})},Lj=q2;var gt=Object.freeze({__proto__:null,defaultErrorMap:c4,setErrorMap:wG,getErrorMap:Gc,makeIssue:jc,EMPTY_PATH:bG,addIssueToContext:S2,ParseStatus:w1,INVALID:q2,DIRTY:jn,OK:L1,isAborted:y8,isDirty:z8,isValid:Ua,isAsync:gr,get util(){return p0},get objectUtil(){return S8},ZodParsedType:M2,getParsedType:D3,ZodType:l0,datetimeRegex:Az,ZodString:Oe,ZodNumber:bt,ZodBigInt:Tt,ZodBoolean:Er,ZodDate:Va,ZodSymbol:$c,ZodUndefined:_r,ZodNull:Ir,ZodAny:o4,ZodUnknown:Ta,ZodNever:V3,ZodVoid:Yc,ZodArray:Fe,ZodObject:T0,ZodUnion:Nr,ZodDiscriminatedUnion:Yo,ZodIntersection:Sr,ZodTuple:o3,ZodRecord:yr,ZodMap:Zc,ZodSet:Ga,ZodFunction:t4,ZodLazy:zr,ZodLiteral:Cr,ZodEnum:kt,ZodNativeEnum:Mr,ZodPromise:u4,ZodEffects:Ue,ZodTransformer:Ue,ZodOptional:n3,ZodNullable:Dt,ZodDefault:Rr,ZodCatch:xr,ZodNaN:Wc,BRAND:JG,ZodBranded:hd,ZodPipeline:oi,ZodReadonly:wr,custom:Ez,Schema:l0,ZodSchema:l0,late:ej,get ZodFirstPartyTypeKind(){return $2},coerce:Bj,any:cj,array:dj,bigint:nj,boolean:Nz,date:lj,discriminatedUnion:pj,effect:PA,enum:zj,function:Nj,instanceof:tj,intersection:Aj,lazy:Sj,literal:yj,map:_j,nan:aj,nativeEnum:Cj,never:uj,null:sj,nullable:xj,number:Iz,object:fj,oboolean:Dj,onumber:kj,optional:Rj,ostring:Tj,pipeline:bj,preprocess:wj,promise:Mj,record:Ej,set:Ij,strictObject:mj,string:_z,symbol:rj,transformer:PA,tuple:gj,undefined:ij,union:vj,unknown:oj,void:hj,NEVER:Lj,ZodIssueCode:p2,quotelessJson:xG,ZodError:le});j({en:"Please enter your username","en-GB":"Please enter your username",fr:"Veuillez saisir votre nom d’utilisateur",es:"Por favor, ingrese su nombre de usuario",de:"Bitte geben Sie Ihren Benutzernamen ein",ja:"ユーザー名を入力してください",ko:"사용자 이름을 입력해 주세요",zh:"请输入您的用户名",it:"Per favore, inserisci il tuo nome utente",pt:"Por favor, insira seu nome de usuário",hi:"कृपया अपना उपयोगकर्ता नाम दर्ज करें",ar:"يرجى إدخال اسم المستخدم الخاص بك",ru:"Пожалуйста, введите ваше имя пользователя"}),j({en:"Please enter a valid username","en-GB":"Please enter a valid username",fr:"Veuillez saisir un nom d’utilisateur valide",es:"Por favor, ingrese un nombre de usuario válido",de:"Bitte geben Sie einen gültigen Benutzernamen ein",ja:"有効なユーザー名を入力してください",ko:"유효한 사용자 이름을 입력해 주세요",zh:"请输入有效的用户名",it:"Per favore, inserisci un nome utente valido",pt:"Por favor, insira um nome de usuário válido",hi:"कृपया एक मान्य उपयोगकर्ता नाम दर्ज करें",ar:"يرجى إدخال اسم مستخدم صالح",ru:"Пожалуйста, введите корректное имя пользователя"}),j({en:"Please enter your password","en-GB":"Please enter your password",fr:"Veuillez saisir votre mot de passe",es:"Por favor, ingrese su contraseña",de:"Bitte geben Sie Ihr Passwort ein",ja:"パスワードを入力してください",ko:"비밀번호를 입력해 주세요",zh:"请您输入密码",it:"Si prega di inserire la password",pt:"Por favor, insira sua senha",hi:"कृपया अपना पासवर्ड दर्ज करें",ar:"يرجى إدخال كلمة المرور الخاصة بك",ru:"Пожалуйста, введите ваш пароль"}),j({en:"Please enter a valid password","en-GB":"Please enter a valid password",fr:"Veuillez saisir un mot de passe valide",es:"Por favor, ingrese una contraseña válida",de:"Bitte geben Sie ein gültiges Passwort ein",ja:"有効なパスワードを入力してください",ko:"유효한 비밀번호를 입력해 주세요",zh:"请输入有效的密码",it:"Per favore, inserisci una password valida",pt:"Por favor, insira uma senha válida",hi:"कृपया एक मान्य पासवर्ड दर्ज करें",ar:"يرجى إدخال كلمة مرور صالحة",ru:"Пожалуйста, введите корректный пароль"});j({en:"Email address","en-GB":"Email address",fr:"Adresse e-mail",es:"Dirección de correo electrónico",de:"E-Mail-Adresse",ja:"メールアドレス",ko:"이메일 주소",zh:"电子邮件地址",it:"Indirizzo email",pt:"Endereço de e-mail",hi:"ई-मेल पता",ar:"عنوان البريد الإلكتروني",ru:"Адрес электронной почты"}),j({en:"Enter e-mail address","en-GB":"Enter e-mail address",fr:"Entrez votre adresse e-mail",es:"Ingrese su dirección de correo electrónico",de:"E-Mail-Adresse eingeben",ja:"メールアドレスを入力してください",ko:"이메일 주소를 입력하세요",zh:"请输入电子邮件地址",it:"Inserisci l'indirizzo email",pt:"Insira o endereço de e-mail",hi:"ई-मेल पता दर्ज करें",ar:"أدخل عنوان البريد الإلكتروني",ru:"Введите адрес электронной почты"}),j({en:"Password","en-GB":"Password",fr:"Mot de passe",es:"Contraseña",de:"Passwort",ja:"パスワード",ko:"비밀번호",zh:"密码",it:"Password",pt:"Senha",hi:"पासवर्ड",ar:"كلمة المرور",ru:"Пароль"}),j({en:"Enter password","en-GB":"Enter password",fr:"Entrez votre mot de passe",es:"Ingrese su contraseña",de:"Passwort eingeben",ja:"パスワードを入力してください",ko:"비밀번호를 입력하세요",zh:"请输入密码",it:"Inserisci la password",pt:"Insira a senha",hi:"पासवर्ड डालें",ar:"أدخل كلمة المرور",ru:"Введите пароль"}),j({en:"Password Confirmation","en-GB":"Password Confirmation",fr:"Confirmation du mot de passe",es:"Confirmación de contraseña",de:"Passwortbestätigung",ja:"パスワードの確認",ko:"비밀번호 확인",zh:"确认密码",it:"Conferma password",pt:"Confirmação de senha",hi:"पासवर्ड की पुष्टि",ar:"تأكيد كلمة المرور",ru:"Подтверждение пароля"}),j({en:"Enter password again","en-GB":"Enter password again",fr:"Entrez votre mot de passe à nouveau",es:"Ingrese su contraseña nuevamente",de:"Passwort erneut eingeben",ja:"パスワードを再度入力してください",ko:"비밀번호를 다시 입력하세요",zh:"请再次输入密码",it:"Reinserisci la password",pt:"Digite a senha novamente",hi:"पासवर्ड पुनः दर्ज करें",ar:"أعد إدخال كلمة المرور",ru:"Введите пароль еще раз"}),j({en:"Create account","en-GB":"Create account",fr:"Créer un compte",es:"Crear una cuenta",de:"Konto erstellen",ja:"アカウントを作成",ko:"계정 만들기",zh:"创建账户",it:"Crea account",pt:"Criar conta",hi:"खाता बनाएं",ar:"إنشاء حساب",ru:"Создать аккаунт"}),j({en:"Submit form to create account","en-GB":"Submit form to create account",fr:"Soumettre le formulaire pour créer un compte",es:"Enviar formulario para crear cuenta",de:"Formular absenden, um ein Konto zu erstellen",ja:"アカウントを作成するためにフォームを送信する",ko:"계정을 만들기 위해 양식을 제출하세요",zh:"提交表单以创建账户",it:"Invia il modulo per creare un account",pt:"Envie o formulário para criar uma conta",hi:"खाता बनाने के लिए फॉर्म जमा करें",ar:"إرسال النموذج لإنشاء حساب",ru:"Отправить форму для создания аккаунта"}),j({en:"You already have an account?","en-GB":"You already have an account?",fr:"Vous avez déjà un compte ?",es:"¿Ya tienes una cuenta?",de:"Sie haben bereits ein Konto?",ja:"すでにアカウントをお持ちですか?",ko:"이미 계정이 있습니까?",zh:"您已经有一个账户了吗?",it:"Hai già un account?",pt:"Você já tem uma conta?",hi:"क्या आपके पास पहले से ही एक खाता है?",ar:"هل لديك حساب بالفعل؟",ru:"У вас уже есть аккаунт?"}),j({en:"Log in","en-GB":"Log in",fr:"Se connecter",es:"Iniciar sesión",de:"Einloggen",ja:"ログイン",ko:"로그인",zh:"登录",it:"Accedi",pt:"Entrar",hi:"लॉग इन करें",ar:"تسجيل الدخول",ru:"Войти"}),j({en:"Click to go to login page","en-GB":"Click to go to login page",fr:"Cliquez pour aller à la page de connexion",es:"Haz clic para ir a la página de inicio de sesión",de:"Klicken Sie, um zur Anmeldeseite zu gelangen",ja:"ログインページに移動するにはクリックしてください",ko:"로그인 페이지로 이동하려면 클릭하세요",zh:"点击进入登录页面",it:"Clicca per andare alla pagina di login",pt:"Clique para ir para a página de login",hi:"लॉगिन पृष्ठ पर जाने के लिए क्लिक करें",ar:"انقر للذهاب إلى صفحة تسجيل الدخول",ru:"Нажмите, чтобы перейти на страницу входа"});j({en:"Please enter your email address","en-GB":"Please enter your email address",fr:"Veuillez saisir votre adresse e-mail",es:"Por favor, ingrese su dirección de correo electrónico",de:"Bitte geben Sie Ihre E-Mail-Adresse ein",ja:"メールアドレスを入力してください",ko:"이메일 주소를 입력해주세요",zh:"请输入您的电子邮件地址",it:"Si prega di inserire il proprio indirizzo email",pt:"Por favor, insira seu endereço de e-mail",hi:"कृपया अपना ईमेल पता दर्ज करें",ar:"يرجى إدخال عنوان بريدك الإلكتروني",ru:"Пожалуйста, введите свой адрес электронной почты"}),j({en:"Please enter a valid email address","en-GB":"Please enter a valid email address",fr:"Veuillez saisir une adresse e-mail valide",es:"Por favor, ingrese una dirección de correo electrónico válida",de:"Bitte geben Sie eine gültige E-Mail-Adresse ein",ja:"正しいメールアドレスを入力してください",ko:"유효한 이메일 주소를 입력해주세요",zh:"请输入有效的电子邮件地址",it:"Si prega di inserire un indirizzo email valido",pt:"Por favor, insira um endereço de e-mail válido",hi:"कृपया एक वैध ईमेल पता दर्ज करें",ar:"يرجى إدخال عنوان بريد إلكتروني صالح",ru:"Пожалуйста, введите корректный адрес электронной почты"}),j({en:"Please enter your password","en-GB":"Please enter your password",fr:"Veuillez saisir votre mot de passe",es:"Por favor, ingrese su contraseña",de:"Bitte geben Sie Ihr Passwort ein",ja:"パスワードを入力してください",ko:"비밀번호를 입력해주세요",zh:"请输入您的密码",it:"Si prega di inserire la propria password",pt:"Por favor, insira sua senha",hi:"कृपया अपना पासवर्ड डालें",ar:"يرجى إدخال كلمة المرور الخاصة بك",ru:"Пожалуйста, введите ваш пароль"}),j({en:"Please enter a valid password","en-GB":"Please enter a valid password",fr:"Veuillez saisir un mot de passe valide",es:"Por favor, ingrese una contraseña válida",de:"Bitte geben Sie ein gültiges Passwort ein",ja:"有効なパスワードを入力してください",ko:"유효한 비밀번호를 입력해주세요",zh:"请输入有效的密码",it:"Si prega di inserire una password valida",pt:"Por favor, insira uma senha válida",hi:"कृपया एक वैध पासवर्ड दर्ज करें",ar:"يرجى إدخال كلمة مرور صالحة",ru:"Пожалуйста, введите корректный пароль"}),j({en:"Please enter your password again","en-GB":"Please enter your password again",fr:"Veuillez saisir votre mot de passe à nouveau",es:"Por favor, ingrese su contraseña nuevamente",de:"Bitte geben Sie Ihr Passwort erneut ein",ja:"再度パスワードを入力してください",ko:"비밀번호를 다시 입력해주세요",zh:"请再次输入您的密码",it:"Si prega di reinserire la propria password",pt:"Por favor, insira sua senha novamente",hi:"कृपया अपना पासवर्ड फिर से दर्ज करें",ar:"يرجى إعادة إدخال كلمة المرور الخاصة بك",ru:"Пожалуйста, введите ваш пароль еще раз"}),j({en:"Please enter a valid password","en-GB":"Please enter a valid password",fr:"Veuillez saisir un mot de passe valide",es:"Por favor, ingrese una contraseña válida",de:"Bitte geben Sie ein gültiges Passwort ein",ja:"有効なパスワードを入力してください",ko:"유효한 비밀번호를 입력해주세요",zh:"请输入有效的密码",it:"Si prega di inserire una password valida",pt:"Por favor, insira uma senha válida",hi:"कृपया एक वैध पासवर्ड दर्ज करें",ar:"يرجى إدخال كلمة مرور صالحة",ru:"Пожалуйста, введите корректный пароль"}),j({en:"Password and password confirmation must match","en-GB":"Password and password confirmation must match",fr:"Le mot de passe et la confirmation de mot de passe doivent correspondre",es:"La contraseña y la confirmación de la contraseña deben coincidir",de:"Das Passwort und die Bestätigung müssen übereinstimmen",ja:"パスワードと確認用パスワードは一致する必要があります",ko:"비밀번호와 비밀번호 확인이 일치해야 합니다",zh:"密码和密码确认必须匹配",it:"La password e la conferma della password devono corrispondere",pt:"A senha e a confirmação da senha devem coincidir",hi:"पासवर्ड और पासवर्ड की पुष्टि मेल खानी चाहिए",ar:"يجب أن تتطابق كلمة المرور وتأكيد كلمة المرور",ru:"Пароль и подтверждение пароля должны совпадать"});j({en:"Current password",fr:"Mot de passe actuel",es:"Contraseña actual",de:"Aktuelles Passwort",ja:"現在のパスワード",ko:"현재 비밀번호",zh:"当前密码",it:"Password attuale",pt:"Senha atual",hi:"वर्तमान पासवर्ड",ar:"كلمة المرور الحالية",ru:"Текущий пароль","en-GB":"Current password"}),j({en:"Enter actual password",fr:"Entrez votre mot de passe actuel",es:"Ingresa tu contraseña actual",de:"Geben Sie das aktuelle Passwort ein",ja:"現在のパスワードを入力してください",ko:"현재 비밀번호를 입력하세요",zh:"输入当前密码",it:"Inserisci la password attuale",pt:"Digite a senha atual",hi:"वर्तमान पासवर्ड दर्ज करें",ar:"أدخل كلمة المرور الحالية",ru:"Введите текущий пароль","en-GB":"Enter actual password"}),j({en:"New password",fr:"Nouveau mot de passe",es:"Nueva contraseña",de:"Neues Passwort",ja:"新しいパスワード",ko:"새 비밀번호",zh:"新密码",it:"Nuova password",pt:"Nova senha",hi:"नया पासवर्ड",ar:"كلمة المرور الجديدة",ru:"Новый пароль","en-GB":"New password"}),j({en:"Enter new password",fr:"Entrez votre nouveau mot de passe",es:"Ingresa tu nueva contraseña",de:"Geben Sie das neue Passwort ein",ja:"新しいパスワードを入力してください",ko:"새 비밀번호를 입력하세요",zh:"输入新密码",it:"Inserisci la nuova password",pt:"Digite a nova senha",hi:"नया पासवर्ड दर्ज करें",ar:"أدخل كلمة المرور الجديدة",ru:"Введите новый пароль","en-GB":"Enter new password"}),j({en:"Confirm new password",fr:"Confirmez le nouveau mot de passe",es:"Confirma tu nueva contraseña",de:"Bestätigen Sie das neue Passwort",ja:"新しいパスワードを確認してください",ko:"새 비밀번호를 확인하세요",zh:"确认新密码",it:"Conferma la nuova password",pt:"Confirme a nova senha",hi:"नए पासवर्ड की पुष्टि करें",ar:"تأكيد كلمة المرور الجديدة",ru:"Подтвердите новый пароль","en-GB":"Confirm new password"}),j({en:"Confirm new password",fr:"Confirmez votre nouveau mot de passe",es:"Confirma tu nueva contraseña",de:"Bestätigen Sie das neue Passwort",ja:"新しいパスワードを確認してください",ko:"새 비밀번호를 확인하세요",zh:"确认新密码",it:"Conferma la nuova password",pt:"Confirme a nova senha",hi:"नए पासवर्ड की पुष्टि करें",ar:"تأكيد كلمة المرور الجديدة",ru:"Подтвердите новый пароль","en-GB":"Confirm new password"}),j({en:"Change password",fr:"Changer le mot de passe",es:"Cambiar la contraseña",de:"Passwort ändern",ja:"パスワードを変更",ko:"비밀번호 변경",zh:"更改密码",it:"Cambia password",pt:"Alterar senha",hi:"पासवर्ड बदलें",ar:"تغيير كلمة المرور",ru:"Сменить пароль","en-GB":"Change password"}),j({en:"Click to change password",fr:"Cliquez pour changer le mot de passe",es:"Haz clic para cambiar la contraseña",de:"Klicken Sie, um das Passwort zu ändern",ja:"パスワードを変更するにはクリックしてください",ko:"비밀번호를 변경하려면 클릭하세요",zh:"单击以更改密码",it:"Clicca per cambiare la password",pt:"Clique para alterar a senha",hi:"पासवर्ड बदलने के लिए क्लिक करें",ar:"انقر لتغيير كلمة المرور",ru:"Нажмите, чтобы изменить пароль","en-GB":"Click to change password"});j({en:"Please enter your current password","en-GB":"Please enter your current password",fr:"Veuillez saisir votre mot de passe actuel",es:"Por favor, ingrese su contraseña actual",de:"Bitte geben Sie Ihr aktuelles Passwort ein",ja:"現在のパスワードを入力してください",ko:"현재 비밀번호를 입력하십시오",zh:"请输入您的当前密码",it:"Si prega di inserire la propria password attuale",pt:"Por favor, insira sua senha atual",hi:"कृपया अपना वर्तमान पासवर्ड दर्ज करें",ar:"يرجى إدخال كلمة المرور الحالية",ru:"Пожалуйста, введите ваш текущий пароль"}),j({en:"Please enter a valid password","en-GB":"Please enter a valid password",fr:"Veuillez saisir un mot de passe valide",es:"Por favor, ingrese una contraseña válida",de:"Bitte geben Sie ein gültiges Passwort ein",ja:"有効なパスワードを入力してください",ko:"유효한 비밀번호를 입력하십시오",zh:"请输入有效的密码",it:"Si prega di inserire una password valida",pt:"Por favor, insira uma senha válida",hi:"कृपया एक मान्य पासवर्ड दर्ज करें",ar:"يرجى إدخال كلمة مرور صالحة",ru:"Пожалуйста, введите действительный пароль"}),j({en:"Your password must be at least 8 characters","en-GB":"Your password must be at least 8 characters",fr:"Votre mot de passe doit comporter au moins 8 caractères",es:"Su contraseña debe tener al menos 8 caracteres",de:"Ihr Passwort muss mindestens 8 Zeichen lang sein",ja:"パスワードは8文字以上でなければなりません",ko:"비밀번호는 8자 이상이어야 합니다",zh:"您的密码必须至少为8个字符",it:"La tua password deve contenere almeno 8 caratteri",pt:"Sua senha deve ter pelo menos 8 caracteres",hi:"आपका पासवर्ड कम से कम 8 अक्षरों का होना चाहिए",ar:"يجب أن تحتوي كلمة المرور الخاصة بك على 8 أحرف على الأقل",ru:"Ваш пароль должен содержать не менее 8 символов"}),j({en:"Please enter your new password","en-GB":"Please enter your new password",fr:"Veuillez saisir votre nouveau mot de passe",es:"Por favor, ingrese su nueva contraseña",de:"Bitte geben Sie Ihr neues Passwort ein",ja:"新しいパスワードを入力してください",ko:"새 비밀번호를 입력하십시오",zh:"请输入您的新密码",it:"Si prega di inserire la propria nuova password",pt:"Por favor, insira sua nova senha",hi:"कृपया अपना नया पासवर्ड दर्ज करें",ar:"يرجى إدخال كلمة المرور الجديدة الخاصة بك",ru:"Пожалуйста, введите ваш новый пароль"}),j({en:"Please enter a valid new password","en-GB":"Please enter a valid new password",fr:"Veuillez saisir un nouveau mot de passe valide",es:"Por favor, ingrese una nueva contraseña válida",de:"Bitte geben Sie ein gültiges neues Passwort ein",ja:"有効な新しいパスワードを入力してください",ko:"유효한 새 비밀번호를 입력하십시오",zh:"请输入有效的新密码",it:"Si prega di inserire una nuova password valida",pt:"Por favor, insira uma nova senha válida",hi:"कृपया एक वैध नया पासवर्ड दर्ज करें",ar:"يرجى إدخال كلمة مرور جديدة صالحة",ru:"Пожалуйста, введите действительный новый пароль"}),j({en:"Please enter your new password again","en-GB":"Please enter your new password again",fr:"Veuillez saisir votre nouveau mot de passe à nouveau",es:"Por favor, ingrese su nueva contraseña nuevamente",de:"Bitte geben Sie Ihr neues Passwort erneut ein",ja:"新しいパスワードを再度入力してください",ko:"새 비밀번호를 다시 입력하십시오",zh:"请再次输入您的新密码",it:"Si prega di reinserire la propria nuova password",pt:"Por favor, insira sua nova senha novamente",hi:"कृपया अपना नया पासवर्ड फिर से दर्ज करें",ar:"يرجى إدخال كلمة المرور الجديدة الخاصة بك مرة أخرى",ru:"Пожалуйста, повторно введите ваш новый пароль"}),j({en:"Please enter a valid new password again","en-GB":"Please enter a valid new password again",fr:"Veuillez saisir un nouveau mot de passe valide à nouveau",es:"Por favor, ingrese una nueva contraseña válida nuevamente",de:"Bitte geben Sie erneut ein gültiges neues Passwort ein",ja:"もう一度有効な新しいパスワードを入力してください",ko:"유효한 새 비밀번호를 다시 입력하십시오",zh:"请再次输入有效的新密码",it:"Si prega di reinserire una nuova password valida",pt:"Por favor, insira uma nova senha válida novamente",hi:"कृपया एक वैध नया पासवर्ड फिर से दर्ज करें",ar:"يرجى إدخال كلمة مرور جديدة صالحة مرة أخرى",ru:"Пожалуйста, повторно введите действительный новый пароль"}),j({en:"New password and password confirmation must match","en-GB":"New password and password confirmation must match",fr:"Le nouveau mot de passe et la confirmation de mot de passe doivent correspondre",es:"La nueva contraseña y la confirmación de la contraseña deben coincidir",de:"Das neue Passwort und die Bestätigung müssen übereinstimmen",ja:"新しいパスワードとパスワード確認が一致する必要があります",ko:"새 비밀번호와 비밀번호 확인이 일치해야 합니다",zh:"新密码和密码确认必须匹配",it:"La nuova password e la conferma della password devono corrispondere",pt:"A nova senha e a confirmação da senha devem corresponder",hi:"नया पासवर्ड और पासवर्ड की पुष्टि मिलनी चाहिए",ar:"يجب أن يتطابق كلمة المرور الجديدة مع تأكيد كلمة المرور",ru:"Новый пароль и подтверждение пароля должны совпадать"});j({en:"Email address",fr:"Adresse e-mail",es:"Dirección de correo electrónico","en-GB":"Email address",de:"E-Mail-Adresse",ja:"電子メールアドレス",ko:"이메일 주소",zh:"电子邮件地址",it:"Indirizzo email",pt:"Endereço de e-mail",hi:"ईमेल पता",ar:"عنوان البريد الإلكتروني",ru:"Адрес электронной почты"}),j({en:"Enter e-mail address",fr:"Entrez votre adresse e-mail",es:"Ingrese su dirección de correo electrónico","en-GB":"Enter e-mail address",de:"Geben Sie die E-Mail-Adresse ein",ja:"メールアドレスを入力してください",ko:"이메일 주소를 입력하세요",zh:"输入电子邮件地址",it:"Inserisci l'indirizzo email",pt:"Insira o endereço de e-mail",hi:"ईमेल पता दर्ज करें",ar:"أدخل عنوان البريد الإلكتروني",ru:"Введите адрес электронной почты"}),j({en:"Send recovery email",fr:"Envoyer un e-mail de récupération",es:"Enviar correo de recuperación","en-GB":"Send recovery email",de:"Wiederherstellungs-E-Mail senden",ja:"回復メールを送信",ko:"복구 이메일 전송",zh:"发送恢复电子邮件",it:"Invia email di recupero",pt:"Enviar e-mail de recuperação",hi:"पुनर्प्राप्ति ईमेल भेजें",ar:"إرسال بريد إلكتروني لاستعادة كلمة المرور",ru:"Отправить письмо для восстановления"}),j({en:"Click to send recovery email",fr:"Cliquez pour envoyer un e-mail de récupération",es:"Haz clic para enviar correo de recuperación","en-GB":"Click to send recovery email",de:"Klicken Sie, um die Wiederherstellungs-E-Mail zu senden",ja:"回復メールを送信するにはクリックしてください",ko:"복구 이메일을 보내려면 클릭하세요",zh:"点击发送恢复电子邮件",it:"Clicca per inviare l'email di recupero",pt:"Clique para enviar o e-mail de recuperação",hi:"पुनर्प्राप्ति ईमेल भेजने के लिए क्लिक करें",ar:"انقر لإرسال بريد إلكتروني لاستعادة كلمة المرور",ru:"Щелкните, чтобы отправить электронное письмо для восстановления"}),j({en:"Resend recovery email",fr:"Renvoyer l’e-mail de récupération",es:"Reenviar correo de recuperación","en-GB":"Resend recovery email",de:"Wiederherstellungs-E-Mail erneut senden",ja:"回復メールを再送信",ko:"복구 이메일 재전송",zh:"重新发送恢复电子邮件",it:"Invia di nuovo l'email di recupero",pt:"Reenviar e-mail de recuperação",hi:"पुनर्प्राप्ति ईमेल पुनः भेजें",ar:"إعادة إرسال البريد الإلكتروني لاستعادة كلمة المرور",ru:"Повторно отправить письмо для восстановления"}),j({en:"Resend in",fr:"Renvoyer dans",es:"Reenviar en","en-GB":"Resend in",de:"Erneut senden in",ja:"再送信まで",ko:"다시 전송하기까지",zh:"重新发送",it:"Reinvia in",pt:"Reenviar em",hi:"फिर से भेजें",ar:"إعادة الإرسال في",ru:"Повторно отправить через"}),j({en:"Back to login",fr:"Retour à la connexion",es:"Volver al inicio de sesión","en-GB":"Back to login",de:"Zurück zur Anmeldung",ja:"ログインに戻る",ko:"로그인으로 돌아가기",zh:"返回登录",it:"Torna al login",pt:"Voltar ao login",hi:"लॉगइन पर वापस जाएं",ar:"العودة إلى تسجيل الدخول",ru:"Вернуться к входу"});j({en:"Please enter your email address","en-GB":"Please enter your email address",fr:"Veuillez saisir votre adresse e-mail",es:"Por favor, ingrese su dirección de correo electrónico",de:"Bitte geben Sie Ihre E-Mail-Adresse ein",ja:"メールアドレスを入力してください",ko:"이메일 주소를 입력하십시오",zh:"请输入您的电子邮件地址",it:"Si prega di inserire il proprio indirizzo email",pt:"Por favor, insira seu endereço de e-mail",hi:"कृपया अपना ईमेल पता डालें",ar:"يرجى إدخال عنوان بريدك الإلكتروني",ru:"Пожалуйста, введите свой адрес электронной почты"}),j({en:"Please enter a valid email address","en-GB":"Please enter a valid email address",fr:"Veuillez saisir une adresse e-mail valide",es:"Por favor, ingrese una dirección de correo electrónico válida",de:"Bitte geben Sie eine gültige E-Mail-Adresse ein",ja:"有効なメールアドレスを入力してください",ko:"유효한 이메일 주소를 입력하십시오",zh:"请输入有效的电子邮件地址",it:"Si prega di inserire un indirizzo email valido",pt:"Por favor, insira um endereço de e-mail válido",hi:"कृपया एक वैध ईमेल पता दर्ज करें",ar:"يرجى إدخال عنوان بريد إلكتروني صالح",ru:"Пожалуйста, введите действующий адрес электронной почты"}),j({en:"Please enter a valid email address","en-GB":"Please enter a valid email address",fr:"Veuillez saisir une adresse e-mail valide",es:"Por favor, ingrese una dirección de correo electrónico válida",de:"Bitte geben Sie eine gültige E-Mail-Adresse ein",ja:"有効なメールアドレスを入力してください",ko:"유효한 이메일 주소를 입력하십시오",zh:"请输入有效的电子邮件地址",it:"Si prega di inserire un indirizzo email valido",pt:"Por favor, insira um endereço de e-mail válido",hi:"कृपया एक वैध ईमेल पता दर्ज करें",ar:"يرجى إدخال عنوان بريد إلكتروني صالح",ru:"Пожалуйста, введите действующий адрес электронной почты"});const Sz=y.createContext({});function Oj(e){const t=y.useRef(null);return t.current===null&&(t.current=e()),t.current}const dd=y.createContext(null),yz=y.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function Fj(e=!0){const t=y.useContext(dd);if(t===null)return[!0,null];const{isPresent:a,onExitComplete:n,register:r}=t,s=y.useId();y.useEffect(()=>{e&&r(s)},[e]);const o=y.useCallback(()=>e&&n&&n(s),[s,n,e]);return!a&&n?[!1,o]:[!0]}const fd=typeof window<"u",Hj=fd?y.useLayoutEffect:y.useEffect,a1=e=>e;let Zo=a1;function Wo(e){let t;return()=>(t===void 0&&(t=e()),t)}const Bt=(e,t,a)=>{const n=t-e;return n===0?1:(a-e)/n},E1=e=>e*1e3,_1=e=>e/1e3,Pj={useManualTiming:!1};function Uj(e){let t=new Set,a=new Set,n=!1,r=!1;const s=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function u(f){s.has(f)&&(d.schedule(f),e()),f(o)}const d={schedule:(f,v=!1,p=!1)=>{const E=p&&n?t:a;return v&&s.add(f),E.has(f)||E.add(f),f},cancel:f=>{a.delete(f),s.delete(f)},process:f=>{if(o=f,n){r=!0;return}n=!0,[t,a]=[a,t],t.forEach(u),t.clear(),n=!1,r&&(r=!1,d.process(f))}};return d}const qs=["read","resolveKeyframes","update","preRender","render","postRender"],Vj=40;function zz(e,t){let a=!1,n=!0;const r={delta:0,timestamp:0,isProcessing:!1},s=()=>a=!0,o=qs.reduce((C,M)=>(C[M]=Uj(s),C),{}),{read:u,resolveKeyframes:d,update:f,preRender:v,render:p,postRender:A}=o,E=()=>{const C=performance.now();a=!1,r.delta=n?1e3/60:Math.max(Math.min(C-r.timestamp,Vj),1),r.timestamp=C,r.isProcessing=!0,u.process(r),d.process(r),f.process(r),v.process(r),p.process(r),A.process(r),r.isProcessing=!1,a&&t&&(n=!1,e(E))},_=()=>{a=!0,n=!0,r.isProcessing||e(E)};return{schedule:qs.reduce((C,M)=>{const x=o[M];return C[M]=(D,w=!1,b=!1)=>(a||_(),x.schedule(D,w,b)),C},{}),cancel:C=>{for(let M=0;M<qs.length;M++)o[qs[M]].cancel(C)},state:r,steps:o}}const{schedule:R0,cancel:Lt,state:g1,steps:o7}=zz(typeof requestAnimationFrame<"u"?requestAnimationFrame:a1,!0),Cz=y.createContext({strict:!1}),UA={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},h4={};for(const e in UA)h4[e]={isEnabled:t=>UA[e].some(a=>!!t[a])};function Gj(e){for(const t in e)h4[t]={...h4[t],...e[t]}}const jj=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function qc(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||jj.has(e)}let Mz=e=>!qc(e);function Kj(e){e&&(Mz=t=>t.startsWith("on")?!qc(t):e(t))}try{Kj(require("@emotion/is-prop-valid").default)}catch{}function $j(e,t,a){const n={};for(const r in e)r==="values"&&typeof e.values=="object"||(Mz(r)||a===!0&&qc(r)||!t&&!qc(r)||e.draggable&&r.startsWith("onDrag"))&&(n[r]=e[r]);return n}function Yj(e){if(typeof Proxy>"u")return e;const t=new Map,a=(...n)=>e(...n);return new Proxy(a,{get:(n,r)=>r==="create"?e:(t.has(r)||t.set(r,e(r)),t.get(r))})}const qo=y.createContext({});function br(e){return typeof e=="string"||Array.isArray(e)}function Xo(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const md=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],vd=["initial",...md];function Qo(e){return Xo(e.animate)||vd.some(t=>br(e[t]))}function Rz(e){return!!(Qo(e)||e.variants)}function Zj(e,t){if(Qo(e)){const{initial:a,animate:n}=e;return{initial:a===!1||br(a)?a:void 0,animate:br(n)?n:void 0}}return e.inherit!==!1?t:{}}function Wj(e){const{initial:t,animate:a}=Zj(e,y.useContext(qo));return y.useMemo(()=>({initial:t,animate:a}),[VA(t),VA(a)])}function VA(e){return Array.isArray(e)?e.join(" "):e}const qj=Symbol.for("motionComponentSymbol");function Kn(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Xj(e,t,a){return y.useCallback(n=>{n&&e.onMount&&e.onMount(n),t&&(n?t.mount(n):t.unmount()),a&&(typeof a=="function"?a(n):Kn(a)&&(a.current=n))},[t])}const pd=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Qj="framerAppearId",xz="data-"+pd(Qj),{schedule:Ad}=zz(queueMicrotask,!1),wz=y.createContext({});function Jj(e,t,a,n,r){var s,o;const{visualElement:u}=y.useContext(qo),d=y.useContext(Cz),f=y.useContext(dd),v=y.useContext(yz).reducedMotion,p=y.useRef(null);n=n||d.renderer,!p.current&&n&&(p.current=n(e,{visualState:t,parent:u,props:a,presenceContext:f,blockInitialAnimation:f?f.initial===!1:!1,reducedMotionConfig:v}));const A=p.current,E=y.useContext(wz);A&&!A.projection&&r&&(A.type==="html"||A.type==="svg")&&eK(p.current,a,r,E);const _=y.useRef(!1);y.useInsertionEffect(()=>{A&&_.current&&A.update(a,f)});const S=a[xz],z=y.useRef(!!S&&!(!((s=window.MotionHandoffIsComplete)===null||s===void 0)&&s.call(window,S))&&((o=window.MotionHasOptimisedAnimation)===null||o===void 0?void 0:o.call(window,S)));return Hj(()=>{A&&(_.current=!0,window.MotionIsMounted=!0,A.updateFeatures(),Ad.render(A.render),z.current&&A.animationState&&A.animationState.animateChanges())}),y.useEffect(()=>{A&&(!z.current&&A.animationState&&A.animationState.animateChanges(),z.current&&(queueMicrotask(()=>{var C;(C=window.MotionHandoffMarkAsComplete)===null||C===void 0||C.call(window,S)}),z.current=!1))}),A}function eK(e,t,a,n){const{layoutId:r,layout:s,drag:o,dragConstraints:u,layoutScroll:d,layoutRoot:f}=t;e.projection=new a(e.latestValues,t["data-framer-portal-id"]?void 0:bz(e.parent)),e.projection.setOptions({layoutId:r,layout:s,alwaysMeasureLayout:!!o||u&&Kn(u),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:n,layoutScroll:d,layoutRoot:f})}function bz(e){if(e)return e.options.allowProjection!==!1?e.projection:bz(e.parent)}function tK({preloadedFeatures:e,createVisualElement:t,useRender:a,useVisualState:n,Component:r}){var s,o;e&&Gj(e);function u(f,v){let p;const A={...y.useContext(yz),...f,layoutId:aK(f)},{isStatic:E}=A,_=Wj(f),S=n(f,E);if(!E&&fd){nK();const z=lK(A);p=z.MeasureLayout,_.visualElement=Jj(r,S,A,t,z.ProjectionNode)}return I.jsxs(qo.Provider,{value:_,children:[p&&_.visualElement?I.jsx(p,{visualElement:_.visualElement,...A}):null,a(r,f,Xj(S,_.visualElement,v),S,E,_.visualElement)]})}u.displayName=`motion.${typeof r=="string"?r:`create(${(o=(s=r.displayName)!==null&&s!==void 0?s:r.name)!==null&&o!==void 0?o:""})`}`;const d=y.forwardRef(u);return d[qj]=r,d}function aK({layoutId:e}){const t=y.useContext(Sz).id;return t&&e!==void 0?t+"-"+e:e}function nK(e,t){y.useContext(Cz).strict}function lK(e){const{drag:t,layout:a}=h4;if(!t&&!a)return{};const n={...t,...a};return{MeasureLayout:t!=null&&t.isEnabled(e)||a!=null&&a.isEnabled(e)?n.MeasureLayout:void 0,ProjectionNode:n.ProjectionNode}}const rK=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function gd(e){return typeof e!="string"||e.includes("-")?!1:!!(rK.indexOf(e)>-1||/[A-Z]/u.test(e))}function GA(e){const t=[{},{}];return e==null||e.values.forEach((a,n)=>{t[0][n]=a.get(),t[1][n]=a.getVelocity()}),t}function Ed(e,t,a,n){if(typeof t=="function"){const[r,s]=GA(n);t=t(a!==void 0?a:e.custom,r,s)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[r,s]=GA(n);t=t(a!==void 0?a:e.custom,r,s)}return t}const M8=e=>Array.isArray(e),iK=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),sK=e=>M8(e)?e[e.length-1]||0:e,R1=e=>!!(e&&e.getVelocity);function Sc(e){const t=R1(e)?e.get():e;return iK(t)?t.toValue():t}function cK({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:a},n,r,s){const o={latestValues:oK(n,r,s,e),renderState:t()};return a&&(o.onMount=u=>a({props:n,current:u,...o}),o.onUpdate=u=>a(u)),o}const Tz=e=>(t,a)=>{const n=y.useContext(qo),r=y.useContext(dd),s=()=>cK(e,t,n,r);return a?s():Oj(s)};function oK(e,t,a,n){const r={},s=n(e,{});for(const A in s)r[A]=Sc(s[A]);let{initial:o,animate:u}=e;const d=Qo(e),f=Rz(e);t&&f&&!d&&e.inherit!==!1&&(o===void 0&&(o=t.initial),u===void 0&&(u=t.animate));let v=a?a.initial===!1:!1;v=v||o===!1;const p=v?u:o;if(p&&typeof p!="boolean"&&!Xo(p)){const A=Array.isArray(p)?p:[p];for(let E=0;E<A.length;E++){const _=Ed(e,A[E]);if(_){const{transitionEnd:S,transition:z,...C}=_;for(const M in C){let x=C[M];if(Array.isArray(x)){const D=v?x.length-1:0;x=x[D]}x!==null&&(r[M]=x)}for(const M in S)r[M]=S[M]}}}return r}const C4=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Za=new Set(C4),kz=e=>t=>typeof t=="string"&&t.startsWith(e),Dz=kz("--"),uK=kz("var(--"),_d=e=>uK(e)?hK.test(e.split("/*")[0].trim()):!1,hK=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Bz=(e,t)=>t&&typeof e=="number"?t.transform(e):e,G3=(e,t,a)=>a>t?t:a<e?e:a,M4={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Tr={...M4,transform:e=>G3(0,1,e)},Xs={...M4,default:1},ui=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Nt=ui("deg"),l3=ui("%"),P2=ui("px"),dK=ui("vh"),fK=ui("vw"),jA={...l3,parse:e=>l3.parse(e)/100,transform:e=>l3.transform(e*100)},mK={borderWidth:P2,borderTopWidth:P2,borderRightWidth:P2,borderBottomWidth:P2,borderLeftWidth:P2,borderRadius:P2,radius:P2,borderTopLeftRadius:P2,borderTopRightRadius:P2,borderBottomRightRadius:P2,borderBottomLeftRadius:P2,width:P2,maxWidth:P2,height:P2,maxHeight:P2,top:P2,right:P2,bottom:P2,left:P2,padding:P2,paddingTop:P2,paddingRight:P2,paddingBottom:P2,paddingLeft:P2,margin:P2,marginTop:P2,marginRight:P2,marginBottom:P2,marginLeft:P2,backgroundPositionX:P2,backgroundPositionY:P2},vK={rotate:Nt,rotateX:Nt,rotateY:Nt,rotateZ:Nt,scale:Xs,scaleX:Xs,scaleY:Xs,scaleZ:Xs,skew:Nt,skewX:Nt,skewY:Nt,distance:P2,translateX:P2,translateY:P2,translateZ:P2,x:P2,y:P2,z:P2,perspective:P2,transformPerspective:P2,opacity:Tr,originX:jA,originY:jA,originZ:P2},KA={...M4,transform:Math.round},Id={...mK,...vK,zIndex:KA,size:P2,fillOpacity:Tr,strokeOpacity:Tr,numOctaves:KA},pK={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},AK=C4.length;function gK(e,t,a){let n="",r=!0;for(let s=0;s<AK;s++){const o=C4[s],u=e[o];if(u===void 0)continue;let d=!0;if(typeof u=="number"?d=u===(o.startsWith("scale")?1:0):d=parseFloat(u)===0,!d||a){const f=Bz(u,Id[o]);if(!d){r=!1;const v=pK[o]||o;n+=`${v}(${f}) `}a&&(t[o]=f)}}return n=n.trim(),a?n=a(t,r?"":n):r&&(n="none"),n}function Nd(e,t,a){const{style:n,vars:r,transformOrigin:s}=e;let o=!1,u=!1;for(const d in t){const f=t[d];if(Za.has(d)){o=!0;continue}else if(Dz(d)){r[d]=f;continue}else{const v=Bz(f,Id[d]);d.startsWith("origin")?(u=!0,s[d]=v):n[d]=v}}if(t.transform||(o||a?n.transform=gK(t,e.transform,a):n.transform&&(n.transform="none")),u){const{originX:d="50%",originY:f="50%",originZ:v=0}=s;n.transformOrigin=`${d} ${f} ${v}`}}const EK={offset:"stroke-dashoffset",array:"stroke-dasharray"},_K={offset:"strokeDashoffset",array:"strokeDasharray"};function IK(e,t,a=1,n=0,r=!0){e.pathLength=1;const s=r?EK:_K;e[s.offset]=P2.transform(-n);const o=P2.transform(t),u=P2.transform(a);e[s.array]=`${o} ${u}`}function $A(e,t,a){return typeof e=="string"?e:P2.transform(t+a*e)}function NK(e,t,a){const n=$A(t,e.x,e.width),r=$A(a,e.y,e.height);return`${n} ${r}`}function Sd(e,{attrX:t,attrY:a,attrScale:n,originX:r,originY:s,pathLength:o,pathSpacing:u=1,pathOffset:d=0,...f},v,p){if(Nd(e,f,p),v){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:A,style:E,dimensions:_}=e;A.transform&&(_&&(E.transform=A.transform),delete A.transform),_&&(r!==void 0||s!==void 0||E.transform)&&(E.transformOrigin=NK(_,r!==void 0?r:.5,s!==void 0?s:.5)),t!==void 0&&(A.x=t),a!==void 0&&(A.y=a),n!==void 0&&(A.scale=n),o!==void 0&&IK(A,o,u,d,!1)}const yd=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),Lz=()=>({...yd(),attrs:{}}),zd=e=>typeof e=="string"&&e.toLowerCase()==="svg";function Oz(e,{style:t,vars:a},n,r){Object.assign(e.style,t,r&&r.getProjectionStyles(n));for(const s in a)e.style.setProperty(s,a[s])}const Fz=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function Hz(e,t,a,n){Oz(e,t,void 0,n);for(const r in t.attrs)e.setAttribute(Fz.has(r)?r:pd(r),t.attrs[r])}const Xc={};function SK(e){Object.assign(Xc,e)}function Pz(e,{layout:t,layoutId:a}){return Za.has(e)||e.startsWith("origin")||(t||a!==void 0)&&(!!Xc[e]||e==="opacity")}function Cd(e,t,a){var n;const{style:r}=e,s={};for(const o in r)(R1(r[o])||t.style&&R1(t.style[o])||Pz(o,e)||((n=a==null?void 0:a.getValue(o))===null||n===void 0?void 0:n.liveStyle)!==void 0)&&(s[o]=r[o]);return s}function Uz(e,t,a){const n=Cd(e,t,a);for(const r in e)if(R1(e[r])||R1(t[r])){const s=C4.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;n[s]=e[r]}return n}function yK(e,t){try{t.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}}const YA=["x","y","width","height","cx","cy","r"],zK={useVisualState:Tz({scrapeMotionValuesFromProps:Uz,createRenderState:Lz,onUpdate:({props:e,prevProps:t,current:a,renderState:n,latestValues:r})=>{if(!a)return;let s=!!e.drag;if(!s){for(const u in r)if(Za.has(u)){s=!0;break}}if(!s)return;let o=!t;if(t)for(let u=0;u<YA.length;u++){const d=YA[u];e[d]!==t[d]&&(o=!0)}o&&R0.read(()=>{yK(a,n),R0.render(()=>{Sd(n,r,zd(a.tagName),e.transformTemplate),Hz(a,n)})})}})},CK={useVisualState:Tz({scrapeMotionValuesFromProps:Cd,createRenderState:yd})};function Vz(e,t,a){for(const n in t)!R1(t[n])&&!Pz(n,a)&&(e[n]=t[n])}function MK({transformTemplate:e},t){return y.useMemo(()=>{const a=yd();return Nd(a,t,e),Object.assign({},a.vars,a.style)},[t])}function RK(e,t){const a=e.style||{},n={};return Vz(n,a,e),Object.assign(n,MK(e,t)),n}function xK(e,t){const a={},n=RK(e,t);return e.drag&&e.dragListener!==!1&&(a.draggable=!1,n.userSelect=n.WebkitUserSelect=n.WebkitTouchCallout="none",n.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(a.tabIndex=0),a.style=n,a}function wK(e,t,a,n){const r=y.useMemo(()=>{const s=Lz();return Sd(s,t,zd(n),e.transformTemplate),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};Vz(s,e.style,e),r.style={...s,...r.style}}return r}function bK(e=!1){return(a,n,r,{latestValues:s},o)=>{const d=(gd(a)?wK:xK)(n,s,o,a),f=$j(n,typeof a=="string",e),v=a!==y.Fragment?{...f,...d,ref:r}:{},{children:p}=n,A=y.useMemo(()=>R1(p)?p.get():p,[p]);return y.createElement(a,{...v,children:A})}}function TK(e,t){return function(n,{forwardMotionProps:r}={forwardMotionProps:!1}){const o={...gd(n)?zK:CK,preloadedFeatures:e,useRender:bK(r),createVisualElement:t,Component:n};return tK(o)}}function Gz(e,t){if(!Array.isArray(t))return!1;const a=t.length;if(a!==e.length)return!1;for(let n=0;n<a;n++)if(t[n]!==e[n])return!1;return!0}function Jo(e,t,a){const n=e.getProps();return Ed(n,t,a!==void 0?a:n.custom,e)}const kK=Wo(()=>window.ScrollTimeline!==void 0);class DK{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>"finished"in t?t.finished:t))}getAll(t){return this.animations[0][t]}setAll(t,a){for(let n=0;n<this.animations.length;n++)this.animations[n][t]=a}attachTimeline(t,a){const n=this.animations.map(r=>{if(kK()&&r.attachTimeline)return r.attachTimeline(t);if(typeof a=="function")return a(r)});return()=>{n.forEach((r,s)=>{r&&r(),this.animations[s].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let a=0;a<this.animations.length;a++)t=Math.max(t,this.animations[a].duration);return t}runAll(t){this.animations.forEach(a=>a[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class jz extends DK{then(t,a){return Promise.all(this.animations).then(t).catch(a)}}function hi(e,t){return e?e[t]||e.default||e:void 0}const Qc=2e4;function eu(e){let t=0;const a=50;let n=e.next(t);for(;!n.done&&t<Qc;)t+=a,n=e.next(t);return t>=Qc?1/0:t}function R4(e){return typeof e=="function"}function Jc(e,t){e.timeline=t,e.onfinish=null}const tu=e=>Array.isArray(e)&&typeof e[0]=="number",BK={linearEasing:void 0};function LK(e,t){const a=Wo(e);return()=>{var n;return(n=BK[t])!==null&&n!==void 0?n:a()}}const kr=LK(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Md=(e,t,a=10)=>{let n="";const r=Math.max(Math.round(t/a),2);for(let s=0;s<r;s++)n+=e(Bt(0,r-1,s))+", ";return`linear(${n.substring(0,n.length-2)})`};function Rd(e){return!!(typeof e=="function"&&kr()||!e||typeof e=="string"&&(e in R8||kr())||tu(e)||Array.isArray(e)&&e.every(Rd))}const Wl=([e,t,a,n])=>`cubic-bezier(${e}, ${t}, ${a}, ${n})`,R8={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Wl([0,.65,.55,1]),circOut:Wl([.55,0,1,.45]),backIn:Wl([.31,.01,.66,-.59]),backOut:Wl([.33,1.53,.69,.99])};function xd(e,t){if(e)return typeof e=="function"&&kr()?Md(e,t):tu(e)?Wl(e):Array.isArray(e)?e.map(a=>xd(a,t)||R8.easeOut):R8[e]}const Be={x:!1,y:!1};function Kz(){return Be.x||Be.y}function OK(e,t,a){var n;if(e instanceof Element)return[e];if(typeof e=="string"){let r=document;const s=(n=void 0)!==null&&n!==void 0?n:r.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e)}function $z(e,t){const a=OK(e),n=new AbortController,r={passive:!0,...t,signal:n.signal};return[a,r,()=>n.abort()]}function ZA(e){return t=>{t.pointerType==="touch"||Kz()||e(t)}}function Yz(e,t,a={}){const[n,r,s]=$z(e,a),o=ZA(u=>{const{target:d}=u,f=t(u);if(typeof f!="function"||!d)return;const v=ZA(p=>{f(p),d.removeEventListener("pointerleave",v)});d.addEventListener("pointerleave",v,r)});return n.forEach(u=>{u.addEventListener("pointerenter",o,r)}),s}const Zz=(e,t)=>t?e===t?!0:Zz(e,t.parentElement):!1,wd=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,FK=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function HK(e){return FK.has(e.tagName)||e.tabIndex!==-1}const ql=new WeakSet;function WA(e){return t=>{t.key==="Enter"&&e(t)}}function u7(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const PK=(e,t)=>{const a=e.currentTarget;if(!a)return;const n=WA(()=>{if(ql.has(a))return;u7(a,"down");const r=WA(()=>{u7(a,"up")}),s=()=>u7(a,"cancel");a.addEventListener("keyup",r,t),a.addEventListener("blur",s,t)});a.addEventListener("keydown",n,t),a.addEventListener("blur",()=>a.removeEventListener("keydown",n),t)};function qA(e){return wd(e)&&!Kz()}function Wz(e,t,a={}){const[n,r,s]=$z(e,a),o=u=>{const d=u.currentTarget;if(!qA(u)||ql.has(d))return;ql.add(d);const f=t(u),v=(E,_)=>{window.removeEventListener("pointerup",p),window.removeEventListener("pointercancel",A),!(!qA(E)||!ql.has(d))&&(ql.delete(d),typeof f=="function"&&f(E,{success:_}))},p=E=>{v(E,a.useGlobalTarget||Zz(d,E.target))},A=E=>{v(E,!1)};window.addEventListener("pointerup",p,r),window.addEventListener("pointercancel",A,r)};return n.forEach(u=>{!HK(u)&&u.getAttribute("tabindex")===null&&(u.tabIndex=0),(a.useGlobalTarget?window:u).addEventListener("pointerdown",o,r),u.addEventListener("focus",f=>PK(f,r),r)}),s}function UK(e){return e==="x"||e==="y"?Be[e]?null:(Be[e]=!0,()=>{Be[e]=!1}):Be.x||Be.y?null:(Be.x=Be.y=!0,()=>{Be.x=Be.y=!1})}const qz=new Set(["width","height","top","left","right","bottom",...C4]);let yc;function VK(){yc=void 0}const r3={now:()=>(yc===void 0&&r3.set(g1.isProcessing||Pj.useManualTiming?g1.timestamp:performance.now()),yc),set:e=>{yc=e,queueMicrotask(VK)}};function bd(e,t){e.indexOf(t)===-1&&e.push(t)}function Td(e,t){const a=e.indexOf(t);a>-1&&e.splice(a,1)}let kd=class{constructor(){this.subscriptions=[]}add(t){return bd(this.subscriptions,t),()=>Td(this.subscriptions,t)}notify(t,a,n){const r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](t,a,n);else for(let s=0;s<r;s++){const o=this.subscriptions[s];o&&o(t,a,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}};function Xz(e,t){return t?e*(1e3/t):0}const XA=30,GK=e=>!isNaN(parseFloat(e));let jK=class{constructor(t,a={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(n,r=!0)=>{const s=r3.now();this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(n),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),r&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=a.owner}setCurrent(t){this.current=t,this.updatedAt=r3.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=GK(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,a){this.events[t]||(this.events[t]=new kd);const n=this.events[t].add(a);return t==="change"?()=>{n(),R0.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,a){this.passiveEffect=t,this.stopPassiveEffect=a}set(t,a=!0){!a||!this.passiveEffect?this.updateAndNotify(t,a):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,a,n){this.set(a),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,a=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,a&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=r3.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>XA)return 0;const a=Math.min(this.updatedAt-this.prevUpdatedAt,XA);return Xz(parseFloat(this.current)-parseFloat(this.prevFrameValue),a)}start(t){return this.stop(),new Promise(a=>{this.hasAnimated=!0,this.animation=t(a),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function Dr(e,t){return new jK(e,t)}function KK(e,t,a){e.hasValue(t)?e.getValue(t).set(a):e.addValue(t,Dr(a))}function $K(e,t){const a=Jo(e,t);let{transitionEnd:n={},transition:r={},...s}=a||{};s={...s,...n};for(const o in s){const u=sK(s[o]);KK(e,o,u)}}function YK(e){return!!(R1(e)&&e.add)}function x8(e,t){const a=e.getValue("willChange");if(YK(a))return a.add(t)}function Qz(e){return e.props[xz]}const Jz=(e,t,a)=>(((1-3*a+3*t)*e+(3*a-6*t))*e+3*t)*e,ZK=1e-7,WK=12;function qK(e,t,a,n,r){let s,o,u=0;do o=t+(a-t)/2,s=Jz(o,n,r)-e,s>0?a=o:t=o;while(Math.abs(s)>ZK&&++u<WK);return o}function di(e,t,a,n){if(e===t&&a===n)return a1;const r=s=>qK(s,0,1,e,a);return s=>s===0||s===1?s:Jz(r(s),t,n)}const eC=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,tC=e=>t=>1-e(1-t),aC=di(.33,1.53,.69,.99),Dd=tC(aC),nC=eC(Dd),lC=e=>(e*=2)<1?.5*Dd(e):.5*(2-Math.pow(2,-10*(e-1))),Bd=e=>1-Math.sin(Math.acos(e)),rC=tC(Bd),iC=eC(Bd),sC=e=>/^0[^.\s]+$/u.test(e);function XK(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||sC(e):!0}const rr=e=>Math.round(e*1e5)/1e5,Ld=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function QK(e){return e==null}const JK=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Od=(e,t)=>a=>!!(typeof a=="string"&&JK.test(a)&&a.startsWith(e)||t&&!QK(a)&&Object.prototype.hasOwnProperty.call(a,t)),cC=(e,t,a)=>n=>{if(typeof n!="string")return n;const[r,s,o,u]=n.match(Ld);return{[e]:parseFloat(r),[t]:parseFloat(s),[a]:parseFloat(o),alpha:u!==void 0?parseFloat(u):1}},e$=e=>G3(0,255,e),h7={...M4,transform:e=>Math.round(e$(e))},Ra={test:Od("rgb","red"),parse:cC("red","green","blue"),transform:({red:e,green:t,blue:a,alpha:n=1})=>"rgba("+h7.transform(e)+", "+h7.transform(t)+", "+h7.transform(a)+", "+rr(Tr.transform(n))+")"};function t$(e){let t="",a="",n="",r="";return e.length>5?(t=e.substring(1,3),a=e.substring(3,5),n=e.substring(5,7),r=e.substring(7,9)):(t=e.substring(1,2),a=e.substring(2,3),n=e.substring(3,4),r=e.substring(4,5),t+=t,a+=a,n+=n,r+=r),{red:parseInt(t,16),green:parseInt(a,16),blue:parseInt(n,16),alpha:r?parseInt(r,16)/255:1}}const w8={test:Od("#"),parse:t$,transform:Ra.transform},$n={test:Od("hsl","hue"),parse:cC("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:a,alpha:n=1})=>"hsla("+Math.round(e)+", "+l3.transform(rr(t))+", "+l3.transform(rr(a))+", "+rr(Tr.transform(n))+")"},C1={test:e=>Ra.test(e)||w8.test(e)||$n.test(e),parse:e=>Ra.test(e)?Ra.parse(e):$n.test(e)?$n.parse(e):w8.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Ra.transform(e):$n.transform(e)},a$=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function n$(e){var t,a;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Ld))===null||t===void 0?void 0:t.length)||0)+(((a=e.match(a$))===null||a===void 0?void 0:a.length)||0)>0}const oC="number",uC="color",l$="var",r$="var(",QA="${}",i$=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Br(e){const t=e.toString(),a=[],n={color:[],number:[],var:[]},r=[];let s=0;const u=t.replace(i$,d=>(C1.test(d)?(n.color.push(s),r.push(uC),a.push(C1.parse(d))):d.startsWith(r$)?(n.var.push(s),r.push(l$),a.push(d)):(n.number.push(s),r.push(oC),a.push(parseFloat(d))),++s,QA)).split(QA);return{values:a,split:u,indexes:n,types:r}}function hC(e){return Br(e).values}function dC(e){const{split:t,types:a}=Br(e),n=t.length;return r=>{let s="";for(let o=0;o<n;o++)if(s+=t[o],r[o]!==void 0){const u=a[o];u===oC?s+=rr(r[o]):u===uC?s+=C1.transform(r[o]):s+=r[o]}return s}}const s$=e=>typeof e=="number"?0:e;function c$(e){const t=hC(e);return dC(e)(t.map(s$))}const Ot={test:n$,parse:hC,createTransformer:dC,getAnimatableNone:c$},o$=new Set(["brightness","contrast","saturate","opacity"]);function u$(e){const[t,a]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[n]=a.match(Ld)||[];if(!n)return e;const r=a.replace(n,"");let s=o$.has(t)?1:0;return n!==a&&(s*=100),t+"("+s+r+")"}const h$=/\b([a-z-]*)\(.*?\)/gu,b8={...Ot,getAnimatableNone:e=>{const t=e.match(h$);return t?t.map(u$).join(" "):e}},d$={...Id,color:C1,backgroundColor:C1,outlineColor:C1,fill:C1,stroke:C1,borderColor:C1,borderTopColor:C1,borderRightColor:C1,borderBottomColor:C1,borderLeftColor:C1,filter:b8,WebkitFilter:b8},Fd=e=>d$[e];function fC(e,t){let a=Fd(e);return a!==b8&&(a=Ot),a.getAnimatableNone?a.getAnimatableNone(t):void 0}const f$=new Set(["auto","none","0"]);function m$(e,t,a){let n=0,r;for(;n<e.length&&!r;){const s=e[n];typeof s=="string"&&!f$.has(s)&&Br(s).values.length&&(r=e[n]),n++}if(r&&a)for(const s of t)e[s]=fC(a,r)}const JA=e=>e===M4||e===P2,eg=(e,t)=>parseFloat(e.split(", ")[t]),tg=(e,t)=>(a,{transform:n})=>{if(n==="none"||!n)return 0;const r=n.match(/^matrix3d\((.+)\)$/u);if(r)return eg(r[1],t);{const s=n.match(/^matrix\((.+)\)$/u);return s?eg(s[1],e):0}},v$=new Set(["x","y","z"]),p$=C4.filter(e=>!v$.has(e));function A$(e){const t=[];return p$.forEach(a=>{const n=e.getValue(a);n!==void 0&&(t.push([a,n.get()]),n.set(a.startsWith("scale")?1:0))}),t}const d4={width:({x:e},{paddingLeft:t="0",paddingRight:a="0"})=>e.max-e.min-parseFloat(t)-parseFloat(a),height:({y:e},{paddingTop:t="0",paddingBottom:a="0"})=>e.max-e.min-parseFloat(t)-parseFloat(a),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:tg(4,13),y:tg(5,14)};d4.translateX=d4.x;d4.translateY=d4.y;const ka=new Set;let T8=!1,k8=!1;function mC(){if(k8){const e=Array.from(ka).filter(n=>n.needsMeasurement),t=new Set(e.map(n=>n.element)),a=new Map;t.forEach(n=>{const r=A$(n);r.length&&(a.set(n,r),n.render())}),e.forEach(n=>n.measureInitialState()),t.forEach(n=>{n.render();const r=a.get(n);r&&r.forEach(([s,o])=>{var u;(u=n.getValue(s))===null||u===void 0||u.set(o)})}),e.forEach(n=>n.measureEndState()),e.forEach(n=>{n.suspendedScrollY!==void 0&&window.scrollTo(0,n.suspendedScrollY)})}k8=!1,T8=!1,ka.forEach(e=>e.complete()),ka.clear()}function vC(){ka.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(k8=!0)})}function g$(){vC(),mC()}let Hd=class{constructor(t,a,n,r,s,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=a,this.name=n,this.motionValue=r,this.element=s,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(ka.add(this),T8||(T8=!0,R0.read(vC),R0.resolveKeyframes(mC))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:a,element:n,motionValue:r}=this;for(let s=0;s<t.length;s++)if(t[s]===null)if(s===0){const o=r==null?void 0:r.get(),u=t[t.length-1];if(o!==void 0)t[0]=o;else if(n&&a){const d=n.readValue(a,u);d!=null&&(t[0]=d)}t[0]===void 0&&(t[0]=u),r&&o===void 0&&r.set(t[0])}else t[s]=t[s-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),ka.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,ka.delete(this))}resume(){this.isComplete||this.scheduleResolve()}};const pC=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),E$=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function _$(e){const t=E$.exec(e);if(!t)return[,];const[,a,n,r]=t;return[`--${a??n}`,r]}function AC(e,t,a=1){const[n,r]=_$(e);if(!n)return;const s=window.getComputedStyle(t).getPropertyValue(n);if(s){const o=s.trim();return pC(o)?parseFloat(o):o}return _d(r)?AC(r,t,a+1):r}const gC=e=>t=>t.test(e),I$={test:e=>e==="auto",parse:e=>e},EC=[M4,P2,l3,Nt,fK,dK,I$],ag=e=>EC.find(gC(e));let _C=class extends Hd{constructor(t,a,n,r,s){super(t,a,n,r,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:a,name:n}=this;if(!a||!a.current)return;super.readKeyframes();for(let d=0;d<t.length;d++){let f=t[d];if(typeof f=="string"&&(f=f.trim(),_d(f))){const v=AC(f,a.current);v!==void 0&&(t[d]=v),d===t.length-1&&(this.finalKeyframe=f)}}if(this.resolveNoneKeyframes(),!qz.has(n)||t.length!==2)return;const[r,s]=t,o=ag(r),u=ag(s);if(o!==u)if(JA(o)&&JA(u))for(let d=0;d<t.length;d++){const f=t[d];typeof f=="string"&&(t[d]=parseFloat(f))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:a}=this,n=[];for(let r=0;r<t.length;r++)XK(t[r])&&n.push(r);n.length&&m$(t,n,a)}measureInitialState(){const{element:t,unresolvedKeyframes:a,name:n}=this;if(!t||!t.current)return;n==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=d4[n](t.measureViewportBox(),window.getComputedStyle(t.current)),a[0]=this.measuredOrigin;const r=a[a.length-1];r!==void 0&&t.getValue(n,r).jump(r,!1)}measureEndState(){var t;const{element:a,name:n,unresolvedKeyframes:r}=this;if(!a||!a.current)return;const s=a.getValue(n);s&&s.jump(this.measuredOrigin,!1);const o=r.length-1,u=r[o];r[o]=d4[n](a.measureViewportBox(),window.getComputedStyle(a.current)),u!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=u),!((t=this.removedTransforms)===null||t===void 0)&&t.length&&this.removedTransforms.forEach(([d,f])=>{a.getValue(d).set(f)}),this.resolveNoneKeyframes()}};const ng=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Ot.test(e)||e==="0")&&!e.startsWith("url("));function N$(e){const t=e[0];if(e.length===1)return!0;for(let a=0;a<e.length;a++)if(e[a]!==t)return!0}function S$(e,t,a,n){const r=e[0];if(r===null)return!1;if(t==="display"||t==="visibility")return!0;const s=e[e.length-1],o=ng(r,t),u=ng(s,t);return!o||!u?!1:N$(e)||(a==="spring"||R4(a))&&n}const y$=e=>e!==null;function au(e,{repeat:t,repeatType:a="loop"},n){const r=e.filter(y$),s=t&&a!=="loop"&&t%2===1?0:r.length-1;return!s||n===void 0?r[s]:n}const z$=40;let IC=class{constructor({autoplay:t=!0,delay:a=0,type:n="keyframes",repeat:r=0,repeatDelay:s=0,repeatType:o="loop",...u}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=r3.now(),this.options={autoplay:t,delay:a,type:n,repeat:r,repeatDelay:s,repeatType:o,...u},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>z$?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&g$(),this._resolved}onKeyframesResolved(t,a){this.resolvedAt=r3.now(),this.hasAttemptedResolve=!0;const{name:n,type:r,velocity:s,delay:o,onComplete:u,onUpdate:d,isGenerator:f}=this.options;if(!f&&!S$(t,n,r,s))if(o)this.options.duration=0;else{d&&d(au(t,this.options,a)),u&&u(),this.resolveFinishedPromise();return}const v=this.initPlayback(t,a);v!==!1&&(this._resolved={keyframes:t,finalKeyframe:a,...v},this.onPostResolved())}onPostResolved(){}then(t,a){return this.currentFinishedPromise.then(t,a)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}};const k0=(e,t,a)=>e+(t-e)*a;function d7(e,t,a){return a<0&&(a+=1),a>1&&(a-=1),a<1/6?e+(t-e)*6*a:a<1/2?t:a<2/3?e+(t-e)*(2/3-a)*6:e}function C$({hue:e,saturation:t,lightness:a,alpha:n}){e/=360,t/=100,a/=100;let r=0,s=0,o=0;if(!t)r=s=o=a;else{const u=a<.5?a*(1+t):a+t-a*t,d=2*a-u;r=d7(d,u,e+1/3),s=d7(d,u,e),o=d7(d,u,e-1/3)}return{red:Math.round(r*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:n}}function eo(e,t){return a=>a>0?t:e}const f7=(e,t,a)=>{const n=e*e,r=a*(t*t-n)+n;return r<0?0:Math.sqrt(r)},M$=[w8,Ra,$n],R$=e=>M$.find(t=>t.test(e));function lg(e){const t=R$(e);if(!t)return!1;let a=t.parse(e);return t===$n&&(a=C$(a)),a}const rg=(e,t)=>{const a=lg(e),n=lg(t);if(!a||!n)return eo(e,t);const r={...a};return s=>(r.red=f7(a.red,n.red,s),r.green=f7(a.green,n.green,s),r.blue=f7(a.blue,n.blue,s),r.alpha=k0(a.alpha,n.alpha,s),Ra.transform(r))},x$=(e,t)=>a=>t(e(a)),fi=(...e)=>e.reduce(x$),D8=new Set(["none","hidden"]);function w$(e,t){return D8.has(e)?a=>a<=0?e:t:a=>a>=1?t:e}function b$(e,t){return a=>k0(e,t,a)}function Pd(e){return typeof e=="number"?b$:typeof e=="string"?_d(e)?eo:C1.test(e)?rg:D$:Array.isArray(e)?NC:typeof e=="object"?C1.test(e)?rg:T$:eo}function NC(e,t){const a=[...e],n=a.length,r=e.map((s,o)=>Pd(s)(s,t[o]));return s=>{for(let o=0;o<n;o++)a[o]=r[o](s);return a}}function T$(e,t){const a={...e,...t},n={};for(const r in a)e[r]!==void 0&&t[r]!==void 0&&(n[r]=Pd(e[r])(e[r],t[r]));return r=>{for(const s in n)a[s]=n[s](r);return a}}function k$(e,t){var a;const n=[],r={color:0,var:0,number:0};for(let s=0;s<t.values.length;s++){const o=t.types[s],u=e.indexes[o][r[o]],d=(a=e.values[u])!==null&&a!==void 0?a:0;n[s]=d,r[o]++}return n}const D$=(e,t)=>{const a=Ot.createTransformer(t),n=Br(e),r=Br(t);return n.indexes.var.length===r.indexes.var.length&&n.indexes.color.length===r.indexes.color.length&&n.indexes.number.length>=r.indexes.number.length?D8.has(e)&&!r.values.length||D8.has(t)&&!n.values.length?w$(e,t):fi(NC(k$(n,r),r.values),a):eo(e,t)};function SC(e,t,a){return typeof e=="number"&&typeof t=="number"&&typeof a=="number"?k0(e,t,a):Pd(e)(e,t)}const B$=5;function yC(e,t,a){const n=Math.max(t-B$,0);return Xz(a-e(n),t-n)}const H0={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},ig=.001;function L$({duration:e=H0.duration,bounce:t=H0.bounce,velocity:a=H0.velocity,mass:n=H0.mass}){let r,s,o=1-t;o=G3(H0.minDamping,H0.maxDamping,o),e=G3(H0.minDuration,H0.maxDuration,_1(e)),o<1?(r=f=>{const v=f*o,p=v*e,A=v-a,E=B8(f,o),_=Math.exp(-p);return ig-A/E*_},s=f=>{const p=f*o*e,A=p*a+a,E=Math.pow(o,2)*Math.pow(f,2)*e,_=Math.exp(-p),S=B8(Math.pow(f,2),o);return(-r(f)+ig>0?-1:1)*((A-E)*_)/S}):(r=f=>{const v=Math.exp(-f*e),p=(f-a)*e+1;return-.001+v*p},s=f=>{const v=Math.exp(-f*e),p=(a-f)*(e*e);return v*p});const u=5/e,d=F$(r,s,u);if(e=E1(e),isNaN(d))return{stiffness:H0.stiffness,damping:H0.damping,duration:e};{const f=Math.pow(d,2)*n;return{stiffness:f,damping:o*2*Math.sqrt(n*f),duration:e}}}const O$=12;function F$(e,t,a){let n=a;for(let r=1;r<O$;r++)n=n-e(n)/t(n);return n}function B8(e,t){return e*Math.sqrt(1-t*t)}const H$=["duration","bounce"],P$=["stiffness","damping","mass"];function sg(e,t){return t.some(a=>e[a]!==void 0)}function U$(e){let t={velocity:H0.velocity,stiffness:H0.stiffness,damping:H0.damping,mass:H0.mass,isResolvedFromDuration:!1,...e};if(!sg(e,P$)&&sg(e,H$))if(e.visualDuration){const a=e.visualDuration,n=2*Math.PI/(a*1.2),r=n*n,s=2*G3(.05,1,1-(e.bounce||0))*Math.sqrt(r);t={...t,mass:H0.mass,stiffness:r,damping:s}}else{const a=L$(e);t={...t,...a,mass:H0.mass},t.isResolvedFromDuration=!0}return t}function zC(e=H0.visualDuration,t=H0.bounce){const a=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:n,restDelta:r}=a;const s=a.keyframes[0],o=a.keyframes[a.keyframes.length-1],u={done:!1,value:s},{stiffness:d,damping:f,mass:v,duration:p,velocity:A,isResolvedFromDuration:E}=U$({...a,velocity:-_1(a.velocity||0)}),_=A||0,S=f/(2*Math.sqrt(d*v)),z=o-s,C=_1(Math.sqrt(d/v)),M=Math.abs(z)<5;n||(n=M?H0.restSpeed.granular:H0.restSpeed.default),r||(r=M?H0.restDelta.granular:H0.restDelta.default);let x;if(S<1){const w=B8(C,S);x=b=>{const T=Math.exp(-S*C*b);return o-T*((_+S*C*z)/w*Math.sin(w*b)+z*Math.cos(w*b))}}else if(S===1)x=w=>o-Math.exp(-C*w)*(z+(_+C*z)*w);else{const w=C*Math.sqrt(S*S-1);x=b=>{const T=Math.exp(-S*C*b),O=Math.min(w*b,300);return o-T*((_+S*C*z)*Math.sinh(O)+w*z*Math.cosh(O))/w}}const D={calculatedDuration:E&&p||null,next:w=>{const b=x(w);if(E)u.done=w>=p;else{let T=0;S<1&&(T=w===0?E1(_):yC(x,w,b));const O=Math.abs(T)<=n,H=Math.abs(o-b)<=r;u.done=O&&H}return u.value=u.done?o:b,u},toString:()=>{const w=Math.min(eu(D),Qc),b=Md(T=>D.next(w*T).value,w,30);return w+"ms "+b}};return D}function cg({keyframes:e,velocity:t=0,power:a=.8,timeConstant:n=325,bounceDamping:r=10,bounceStiffness:s=500,modifyTarget:o,min:u,max:d,restDelta:f=.5,restSpeed:v}){const p=e[0],A={done:!1,value:p},E=O=>u!==void 0&&O<u||d!==void 0&&O>d,_=O=>u===void 0?d:d===void 0||Math.abs(u-O)<Math.abs(d-O)?u:d;let S=a*t;const z=p+S,C=o===void 0?z:o(z);C!==z&&(S=C-p);const M=O=>-S*Math.exp(-O/n),x=O=>C+M(O),D=O=>{const H=M(O),U=x(O);A.done=Math.abs(H)<=f,A.value=A.done?C:U};let w,b;const T=O=>{E(A.value)&&(w=O,b=zC({keyframes:[A.value,_(A.value)],velocity:yC(x,O,A.value),damping:r,stiffness:s,restDelta:f,restSpeed:v}))};return T(0),{calculatedDuration:null,next:O=>{let H=!1;return!b&&w===void 0&&(H=!0,D(O),T(O)),w!==void 0&&O>=w?b.next(O-w):(!H&&D(O),A)}}}const V$=di(.42,0,1,1),G$=di(0,0,.58,1),CC=di(.42,0,.58,1),j$=e=>Array.isArray(e)&&typeof e[0]!="number",K$={linear:a1,easeIn:V$,easeInOut:CC,easeOut:G$,circIn:Bd,circInOut:iC,circOut:rC,backIn:Dd,backInOut:nC,backOut:aC,anticipate:lC},og=e=>{if(tu(e)){Zo(e.length===4);const[t,a,n,r]=e;return di(t,a,n,r)}else if(typeof e=="string")return K$[e];return e};function $$(e,t,a){const n=[],r=a||SC,s=e.length-1;for(let o=0;o<s;o++){let u=r(e[o],e[o+1]);if(t){const d=Array.isArray(t)?t[o]||a1:t;u=fi(d,u)}n.push(u)}return n}function Y$(e,t,{clamp:a=!0,ease:n,mixer:r}={}){const s=e.length;if(Zo(s===t.length),s===1)return()=>t[0];if(s===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());const u=$$(t,n,r),d=u.length,f=v=>{if(o&&v<e[0])return t[0];let p=0;if(d>1)for(;p<e.length-2&&!(v<e[p+1]);p++);const A=Bt(e[p],e[p+1],v);return u[p](A)};return a?v=>f(G3(e[0],e[s-1],v)):f}function Z$(e,t){const a=e[e.length-1];for(let n=1;n<=t;n++){const r=Bt(0,t,n);e.push(k0(a,1,r))}}function W$(e){const t=[0];return Z$(t,e.length-1),t}function q$(e,t){return e.map(a=>a*t)}function X$(e,t){return e.map(()=>t||CC).splice(0,e.length-1)}function to({duration:e=300,keyframes:t,times:a,ease:n="easeInOut"}){const r=j$(n)?n.map(og):og(n),s={done:!1,value:t[0]},o=q$(a&&a.length===t.length?a:W$(t),e),u=Y$(o,t,{ease:Array.isArray(r)?r:X$(t,r)});return{calculatedDuration:e,next:d=>(s.value=u(d),s.done=d>=e,s)}}const Q$=e=>{const t=({timestamp:a})=>e(a);return{start:()=>R0.update(t,!0),stop:()=>Lt(t),now:()=>g1.isProcessing?g1.timestamp:r3.now()}},J$={decay:cg,inertia:cg,tween:to,keyframes:to,spring:zC},eY=e=>e/100;let Ud=class extends IC{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:d}=this.options;d&&d()};const{name:a,motionValue:n,element:r,keyframes:s}=this.options,o=(r==null?void 0:r.KeyframeResolver)||Hd,u=(d,f)=>this.onKeyframesResolved(d,f);this.resolver=new o(s,u,a,n,r),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:a="keyframes",repeat:n=0,repeatDelay:r=0,repeatType:s,velocity:o=0}=this.options,u=R4(a)?a:J$[a]||to;let d,f;u!==to&&typeof t[0]!="number"&&(d=fi(eY,SC(t[0],t[1])),t=[0,100]);const v=u({...this.options,keyframes:t});s==="mirror"&&(f=u({...this.options,keyframes:[...t].reverse(),velocity:-o})),v.calculatedDuration===null&&(v.calculatedDuration=eu(v));const{calculatedDuration:p}=v,A=p+r,E=A*(n+1)-r;return{generator:v,mirroredGenerator:f,mapPercentToKeyframes:d,calculatedDuration:p,resolvedDuration:A,totalDuration:E}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,a=!1){const{resolved:n}=this;if(!n){const{keyframes:O}=this.options;return{done:!0,value:O[O.length-1]}}const{finalKeyframe:r,generator:s,mirroredGenerator:o,mapPercentToKeyframes:u,keyframes:d,calculatedDuration:f,totalDuration:v,resolvedDuration:p}=n;if(this.startTime===null)return s.next(0);const{delay:A,repeat:E,repeatType:_,repeatDelay:S,onUpdate:z}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-v/this.speed,this.startTime)),a?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const C=this.currentTime-A*(this.speed>=0?1:-1),M=this.speed>=0?C<0:C>v;this.currentTime=Math.max(C,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=v);let x=this.currentTime,D=s;if(E){const O=Math.min(this.currentTime,v)/p;let H=Math.floor(O),U=O%1;!U&&O>=1&&(U=1),U===1&&H--,H=Math.min(H,E+1),!!(H%2)&&(_==="reverse"?(U=1-U,S&&(U-=S/p)):_==="mirror"&&(D=o)),x=G3(0,1,U)*p}const w=M?{done:!1,value:d[0]}:D.next(x);u&&(w.value=u(w.value));let{done:b}=w;!M&&f!==null&&(b=this.speed>=0?this.currentTime>=v:this.currentTime<=0);const T=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&b);return T&&r!==void 0&&(w.value=au(d,this.options,r)),z&&z(w.value),T&&this.finish(),w}get duration(){const{resolved:t}=this;return t?_1(t.calculatedDuration):0}get time(){return _1(this.currentTime)}set time(t){t=E1(t),this.currentTime=t,this.holdTime!==null||this.speed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const a=this.playbackSpeed!==t;this.playbackSpeed=t,a&&(this.time=_1(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=Q$,onPlay:a,startTime:n}=this.options;this.driver||(this.driver=t(s=>this.tick(s))),a&&a();const r=this.driver.now();this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=r):this.startTime=n??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(t=this.currentTime)!==null&&t!==void 0?t:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}};const tY=new Set(["opacity","clipPath","filter","transform"]);function aY(e,t,a,{delay:n=0,duration:r=300,repeat:s=0,repeatType:o="loop",ease:u="easeInOut",times:d}={}){const f={[t]:a};d&&(f.offset=d);const v=xd(u,r);return Array.isArray(v)&&(f.easing=v),e.animate(f,{delay:n,duration:r,easing:Array.isArray(v)?"linear":v,fill:"both",iterations:s+1,direction:o==="reverse"?"alternate":"normal"})}const nY=Wo(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),ao=10,lY=2e4;function rY(e){return R4(e.type)||e.type==="spring"||!Rd(e.ease)}function iY(e,t){const a=new Ud({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let n={done:!1,value:e[0]};const r=[];let s=0;for(;!n.done&&s<lY;)n=a.sample(s),r.push(n.value),s+=ao;return{times:void 0,keyframes:r,duration:s-ao,ease:"linear"}}const MC={anticipate:lC,backInOut:nC,circInOut:iC};function sY(e){return e in MC}let ug=class extends IC{constructor(t){super(t);const{name:a,motionValue:n,element:r,keyframes:s}=this.options;this.resolver=new _C(s,(o,u)=>this.onKeyframesResolved(o,u),a,n,r),this.resolver.scheduleResolve()}initPlayback(t,a){let{duration:n=300,times:r,ease:s,type:o,motionValue:u,name:d,startTime:f}=this.options;if(!u.owner||!u.owner.current)return!1;if(typeof s=="string"&&kr()&&sY(s)&&(s=MC[s]),rY(this.options)){const{onComplete:p,onUpdate:A,motionValue:E,element:_,...S}=this.options,z=iY(t,S);t=z.keyframes,t.length===1&&(t[1]=t[0]),n=z.duration,r=z.times,s=z.ease,o="keyframes"}const v=aY(u.owner.current,d,t,{...this.options,duration:n,times:r,ease:s});return v.startTime=f??this.calcStartTime(),this.pendingTimeline?(Jc(v,this.pendingTimeline),this.pendingTimeline=void 0):v.onfinish=()=>{const{onComplete:p}=this.options;u.set(au(t,this.options,a)),p&&p(),this.cancel(),this.resolveFinishedPromise()},{animation:v,duration:n,times:r,type:o,ease:s,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:a}=t;return _1(a)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:a}=t;return _1(a.currentTime||0)}set time(t){const{resolved:a}=this;if(!a)return;const{animation:n}=a;n.currentTime=E1(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:a}=t;return a.playbackRate}set speed(t){const{resolved:a}=this;if(!a)return;const{animation:n}=a;n.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:a}=t;return a.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:a}=t;return a.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{const{resolved:a}=this;if(!a)return a1;const{animation:n}=a;Jc(n,t)}return a1}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:a}=t;a.playState==="finished"&&this.updateFinishedPromise(),a.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:a}=t;a.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:a,keyframes:n,duration:r,type:s,ease:o,times:u}=t;if(a.playState==="idle"||a.playState==="finished")return;if(this.time){const{motionValue:f,onUpdate:v,onComplete:p,element:A,...E}=this.options,_=new Ud({...E,keyframes:n,duration:r,type:s,ease:o,times:u,isGenerator:!0}),S=E1(this.time);f.setWithVelocity(_.sample(S-ao).value,_.sample(S).value,ao)}const{onStop:d}=this.options;d&&d(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:a,name:n,repeatDelay:r,repeatType:s,damping:o,type:u}=t;if(!a||!a.owner||!(a.owner.current instanceof HTMLElement))return!1;const{onUpdate:d,transformTemplate:f}=a.owner.getProps();return nY()&&n&&tY.has(n)&&!d&&!f&&!r&&s!=="mirror"&&o!==0&&u!=="inertia"}};const cY={type:"spring",stiffness:500,damping:25,restSpeed:10},oY=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),uY={type:"keyframes",duration:.8},hY={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},dY=(e,{keyframes:t})=>t.length>2?uY:Za.has(e)?e.startsWith("scale")?oY(t[1]):cY:hY;function fY({when:e,delay:t,delayChildren:a,staggerChildren:n,staggerDirection:r,repeat:s,repeatType:o,repeatDelay:u,from:d,elapsed:f,...v}){return!!Object.keys(v).length}const Vd=(e,t,a,n={},r,s)=>o=>{const u=hi(n,e)||{},d=u.delay||n.delay||0;let{elapsed:f=0}=n;f=f-E1(d);let v={keyframes:Array.isArray(a)?a:[null,a],ease:"easeOut",velocity:t.getVelocity(),...u,delay:-f,onUpdate:A=>{t.set(A),u.onUpdate&&u.onUpdate(A)},onComplete:()=>{o(),u.onComplete&&u.onComplete()},name:e,motionValue:t,element:s?void 0:r};fY(u)||(v={...v,...dY(e,v)}),v.duration&&(v.duration=E1(v.duration)),v.repeatDelay&&(v.repeatDelay=E1(v.repeatDelay)),v.from!==void 0&&(v.keyframes[0]=v.from);let p=!1;if((v.type===!1||v.duration===0&&!v.repeatDelay)&&(v.duration=0,v.delay===0&&(p=!0)),p&&!s&&t.get()!==void 0){const A=au(v.keyframes,u);if(A!==void 0)return R0.update(()=>{v.onUpdate(A),v.onComplete()}),new jz([])}return!s&&ug.supports(v)?new ug(v):new Ud(v)};function mY({protectedKeys:e,needsAnimating:t},a){const n=e.hasOwnProperty(a)&&t[a]!==!0;return t[a]=!1,n}function RC(e,t,{delay:a=0,transitionOverride:n,type:r}={}){var s;let{transition:o=e.getDefaultTransition(),transitionEnd:u,...d}=t;n&&(o=n);const f=[],v=r&&e.animationState&&e.animationState.getState()[r];for(const p in d){const A=e.getValue(p,(s=e.latestValues[p])!==null&&s!==void 0?s:null),E=d[p];if(E===void 0||v&&mY(v,p))continue;const _={delay:a,...hi(o||{},p)};let S=!1;if(window.MotionHandoffAnimation){const C=Qz(e);if(C){const M=window.MotionHandoffAnimation(C,p,R0);M!==null&&(_.startTime=M,S=!0)}}x8(e,p),A.start(Vd(p,A,E,e.shouldReduceMotion&&qz.has(p)?{type:!1}:_,e,S));const z=A.animation;z&&f.push(z)}return u&&Promise.all(f).then(()=>{R0.update(()=>{u&&$K(e,u)})}),f}function L8(e,t,a={}){var n;const r=Jo(e,t,a.type==="exit"?(n=e.presenceContext)===null||n===void 0?void 0:n.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=r||{};a.transitionOverride&&(s=a.transitionOverride);const o=r?()=>Promise.all(RC(e,r,a)):()=>Promise.resolve(),u=e.variantChildren&&e.variantChildren.size?(f=0)=>{const{delayChildren:v=0,staggerChildren:p,staggerDirection:A}=s;return vY(e,t,v+f,p,A,a)}:()=>Promise.resolve(),{when:d}=s;if(d){const[f,v]=d==="beforeChildren"?[o,u]:[u,o];return f().then(()=>v())}else return Promise.all([o(),u(a.delay)])}function vY(e,t,a=0,n=0,r=1,s){const o=[],u=(e.variantChildren.size-1)*n,d=r===1?(f=0)=>f*n:(f=0)=>u-f*n;return Array.from(e.variantChildren).sort(pY).forEach((f,v)=>{f.notify("AnimationStart",t),o.push(L8(f,t,{...s,delay:a+d(v)}).then(()=>f.notify("AnimationComplete",t)))}),Promise.all(o)}function pY(e,t){return e.sortNodePosition(t)}function AY(e,t,a={}){e.notify("AnimationStart",t);let n;if(Array.isArray(t)){const r=t.map(s=>L8(e,s,a));n=Promise.all(r)}else if(typeof t=="string")n=L8(e,t,a);else{const r=typeof t=="function"?Jo(e,t,a.custom):t;n=Promise.all(RC(e,r,a))}return n.then(()=>{e.notify("AnimationComplete",t)})}const gY=vd.length;function xC(e){if(!e)return;if(!e.isControllingVariants){const a=e.parent?xC(e.parent)||{}:{};return e.props.initial!==void 0&&(a.initial=e.props.initial),a}const t={};for(let a=0;a<gY;a++){const n=vd[a],r=e.props[n];(br(r)||r===!1)&&(t[n]=r)}return t}const EY=[...md].reverse(),_Y=md.length;function IY(e){return t=>Promise.all(t.map(({animation:a,options:n})=>AY(e,a,n)))}function NY(e){let t=IY(e),a=hg(),n=!0;const r=d=>(f,v)=>{var p;const A=Jo(e,v,d==="exit"?(p=e.presenceContext)===null||p===void 0?void 0:p.custom:void 0);if(A){const{transition:E,transitionEnd:_,...S}=A;f={...f,...S,..._}}return f};function s(d){t=d(e)}function o(d){const{props:f}=e,v=xC(e.parent)||{},p=[],A=new Set;let E={},_=1/0;for(let z=0;z<_Y;z++){const C=EY[z],M=a[C],x=f[C]!==void 0?f[C]:v[C],D=br(x),w=C===d?M.isActive:null;w===!1&&(_=z);let b=x===v[C]&&x!==f[C]&&D;if(b&&n&&e.manuallyAnimateOnMount&&(b=!1),M.protectedKeys={...E},!M.isActive&&w===null||!x&&!M.prevProp||Xo(x)||typeof x=="boolean")continue;const T=SY(M.prevProp,x);let O=T||C===d&&M.isActive&&!b&&D||z>_&&D,H=!1;const U=Array.isArray(x)?x:[x];let f2=U.reduce(r(C),{});w===!1&&(f2={});const{prevResolvedValues:s2={}}=M,h2={...s2,...f2},W=t2=>{O=!0,A.has(t2)&&(H=!0,A.delete(t2)),M.needsAnimating[t2]=!0;const J=e.getValue(t2);J&&(J.liveStyle=!1)};for(const t2 in h2){const J=f2[t2],v2=s2[t2];if(E.hasOwnProperty(t2))continue;let F=!1;M8(J)&&M8(v2)?F=!Gz(J,v2):F=J!==v2,F?J!=null?W(t2):A.add(t2):J!==void 0&&A.has(t2)?W(t2):M.protectedKeys[t2]=!0}M.prevProp=x,M.prevResolvedValues=f2,M.isActive&&(E={...E,...f2}),n&&e.blockInitialAnimation&&(O=!1),O&&(!(b&&T)||H)&&p.push(...U.map(t2=>({animation:t2,options:{type:C}})))}if(A.size){const z={};A.forEach(C=>{const M=e.getBaseTarget(C),x=e.getValue(C);x&&(x.liveStyle=!0),z[C]=M??null}),p.push({animation:z})}let S=!!p.length;return n&&(f.initial===!1||f.initial===f.animate)&&!e.manuallyAnimateOnMount&&(S=!1),n=!1,S?t(p):Promise.resolve()}function u(d,f){var v;if(a[d].isActive===f)return Promise.resolve();(v=e.variantChildren)===null||v===void 0||v.forEach(A=>{var E;return(E=A.animationState)===null||E===void 0?void 0:E.setActive(d,f)}),a[d].isActive=f;const p=o(d);for(const A in a)a[A].protectedKeys={};return p}return{animateChanges:o,setActive:u,setAnimateFunction:s,getState:()=>a,reset:()=>{a=hg(),n=!0}}}function SY(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Gz(t,e):!1}function _a(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function hg(){return{animate:_a(!0),whileInView:_a(),whileHover:_a(),whileTap:_a(),whileDrag:_a(),whileFocus:_a(),exit:_a()}}let $t=class{constructor(t){this.isMounted=!1,this.node=t}update(){}},yY=class extends $t{constructor(t){super(t),t.animationState||(t.animationState=NY(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Xo(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:a}=this.node.prevProps||{};t!==a&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)===null||t===void 0||t.call(this)}},zY=0,CY=class extends $t{constructor(){super(...arguments),this.id=zY++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:a}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===n)return;const r=this.node.animationState.setActive("exit",!t);a&&!t&&r.then(()=>a(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}};const MY={animation:{Feature:yY},exit:{Feature:CY}};function Lr(e,t,a,n={passive:!0}){return e.addEventListener(t,a,n),()=>e.removeEventListener(t,a)}function mi(e){return{point:{x:e.pageX,y:e.pageY}}}const RY=e=>t=>wd(t)&&e(t,mi(t));function ir(e,t,a,n){return Lr(e,t,RY(a),n)}const dg=(e,t)=>Math.abs(e-t);function xY(e,t){const a=dg(e.x,t.x),n=dg(e.y,t.y);return Math.sqrt(a**2+n**2)}class wC{constructor(t,a,{transformPagePoint:n,contextWindow:r,dragSnapToOrigin:s=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const p=v7(this.lastMoveEventInfo,this.history),A=this.startEvent!==null,E=xY(p.offset,{x:0,y:0})>=3;if(!A&&!E)return;const{point:_}=p,{timestamp:S}=g1;this.history.push({..._,timestamp:S});const{onStart:z,onMove:C}=this.handlers;A||(z&&z(this.lastMoveEvent,p),this.startEvent=this.lastMoveEvent),C&&C(this.lastMoveEvent,p)},this.handlePointerMove=(p,A)=>{this.lastMoveEvent=p,this.lastMoveEventInfo=m7(A,this.transformPagePoint),R0.update(this.updatePoint,!0)},this.handlePointerUp=(p,A)=>{this.end();const{onEnd:E,onSessionEnd:_,resumeAnimation:S}=this.handlers;if(this.dragSnapToOrigin&&S&&S(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const z=v7(p.type==="pointercancel"?this.lastMoveEventInfo:m7(A,this.transformPagePoint),this.history);this.startEvent&&E&&E(p,z),_&&_(p,z)},!wd(t))return;this.dragSnapToOrigin=s,this.handlers=a,this.transformPagePoint=n,this.contextWindow=r||window;const o=mi(t),u=m7(o,this.transformPagePoint),{point:d}=u,{timestamp:f}=g1;this.history=[{...d,timestamp:f}];const{onSessionStart:v}=a;v&&v(t,v7(u,this.history)),this.removeListeners=fi(ir(this.contextWindow,"pointermove",this.handlePointerMove),ir(this.contextWindow,"pointerup",this.handlePointerUp),ir(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Lt(this.updatePoint)}}function m7(e,t){return t?{point:t(e.point)}:e}function fg(e,t){return{x:e.x-t.x,y:e.y-t.y}}function v7({point:e},t){return{point:e,delta:fg(e,bC(t)),offset:fg(e,wY(t)),velocity:bY(t,.1)}}function wY(e){return e[0]}function bC(e){return e[e.length-1]}function bY(e,t){if(e.length<2)return{x:0,y:0};let a=e.length-1,n=null;const r=bC(e);for(;a>=0&&(n=e[a],!(r.timestamp-n.timestamp>E1(t)));)a--;if(!n)return{x:0,y:0};const s=_1(r.timestamp-n.timestamp);if(s===0)return{x:0,y:0};const o={x:(r.x-n.x)/s,y:(r.y-n.y)/s};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}const TC=1e-4,TY=1-TC,kY=1+TC,kC=.01,DY=0-kC,BY=0+kC;function ie(e){return e.max-e.min}function LY(e,t,a){return Math.abs(e-t)<=a}function mg(e,t,a,n=.5){e.origin=n,e.originPoint=k0(t.min,t.max,e.origin),e.scale=ie(a)/ie(t),e.translate=k0(a.min,a.max,e.origin)-e.originPoint,(e.scale>=TY&&e.scale<=kY||isNaN(e.scale))&&(e.scale=1),(e.translate>=DY&&e.translate<=BY||isNaN(e.translate))&&(e.translate=0)}function sr(e,t,a,n){mg(e.x,t.x,a.x,n?n.originX:void 0),mg(e.y,t.y,a.y,n?n.originY:void 0)}function vg(e,t,a){e.min=a.min+t.min,e.max=e.min+ie(t)}function OY(e,t,a){vg(e.x,t.x,a.x),vg(e.y,t.y,a.y)}function pg(e,t,a){e.min=t.min-a.min,e.max=e.min+ie(t)}function cr(e,t,a){pg(e.x,t.x,a.x),pg(e.y,t.y,a.y)}function FY(e,{min:t,max:a},n){return t!==void 0&&e<t?e=n?k0(t,e,n.min):Math.max(e,t):a!==void 0&&e>a&&(e=n?k0(a,e,n.max):Math.min(e,a)),e}function Ag(e,t,a){return{min:t!==void 0?e.min+t:void 0,max:a!==void 0?e.max+a-(e.max-e.min):void 0}}function HY(e,{top:t,left:a,bottom:n,right:r}){return{x:Ag(e.x,a,r),y:Ag(e.y,t,n)}}function gg(e,t){let a=t.min-e.min,n=t.max-e.max;return t.max-t.min<e.max-e.min&&([a,n]=[n,a]),{min:a,max:n}}function PY(e,t){return{x:gg(e.x,t.x),y:gg(e.y,t.y)}}function UY(e,t){let a=.5;const n=ie(e),r=ie(t);return r>n?a=Bt(t.min,t.max-n,e.min):n>r&&(a=Bt(e.min,e.max-r,t.min)),G3(0,1,a)}function VY(e,t){const a={};return t.min!==void 0&&(a.min=t.min-e.min),t.max!==void 0&&(a.max=t.max-e.min),a}const O8=.35;function GY(e=O8){return e===!1?e=0:e===!0&&(e=O8),{x:Eg(e,"left","right"),y:Eg(e,"top","bottom")}}function Eg(e,t,a){return{min:_g(e,t),max:_g(e,a)}}function _g(e,t){return typeof e=="number"?e:e[t]||0}const Ig=()=>({translate:0,scale:1,origin:0,originPoint:0}),Yn=()=>({x:Ig(),y:Ig()}),Ng=()=>({min:0,max:0}),j0=()=>({x:Ng(),y:Ng()});function Ie(e){return[e("x"),e("y")]}function DC({top:e,left:t,right:a,bottom:n}){return{x:{min:t,max:a},y:{min:e,max:n}}}function jY({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function KY(e,t){if(!t)return e;const a=t({x:e.left,y:e.top}),n=t({x:e.right,y:e.bottom});return{top:a.y,left:a.x,bottom:n.y,right:n.x}}function p7(e){return e===void 0||e===1}function F8({scale:e,scaleX:t,scaleY:a}){return!p7(e)||!p7(t)||!p7(a)}function Na(e){return F8(e)||BC(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function BC(e){return Sg(e.x)||Sg(e.y)}function Sg(e){return e&&e!=="0%"}function no(e,t,a){const n=e-a,r=t*n;return a+r}function yg(e,t,a,n,r){return r!==void 0&&(e=no(e,r,n)),no(e,a,n)+t}function H8(e,t=0,a=1,n,r){e.min=yg(e.min,t,a,n,r),e.max=yg(e.max,t,a,n,r)}function LC(e,{x:t,y:a}){H8(e.x,t.translate,t.scale,t.originPoint),H8(e.y,a.translate,a.scale,a.originPoint)}const zg=.999999999999,Cg=1.0000000000001;function $Y(e,t,a,n=!1){const r=a.length;if(!r)return;t.x=t.y=1;let s,o;for(let u=0;u<r;u++){s=a[u],o=s.projectionDelta;const{visualElement:d}=s.options;d&&d.props.style&&d.props.style.display==="contents"||(n&&s.options.layoutScroll&&s.scroll&&s!==s.root&&Wn(e,{x:-s.scroll.offset.x,y:-s.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,LC(e,o)),n&&Na(s.latestValues)&&Wn(e,s.latestValues))}t.x<Cg&&t.x>zg&&(t.x=1),t.y<Cg&&t.y>zg&&(t.y=1)}function Zn(e,t){e.min=e.min+t,e.max=e.max+t}function Mg(e,t,a,n,r=.5){const s=k0(e.min,e.max,r);H8(e,t,a,s,n)}function Wn(e,t){Mg(e.x,t.x,t.scaleX,t.scale,t.originX),Mg(e.y,t.y,t.scaleY,t.scale,t.originY)}function OC(e,t){return DC(KY(e.getBoundingClientRect(),t))}function YY(e,t,a){const n=OC(e,a),{scroll:r}=t;return r&&(Zn(n.x,r.offset.x),Zn(n.y,r.offset.y)),n}const FC=({current:e})=>e?e.ownerDocument.defaultView:null,ZY=new WeakMap;class WY{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=j0(),this.visualElement=t}start(t,{snapToCursor:a=!1}={}){const{presenceContext:n}=this.visualElement;if(n&&n.isPresent===!1)return;const r=v=>{const{dragSnapToOrigin:p}=this.getProps();p?this.pauseAnimation():this.stopAnimation(),a&&this.snapToCursor(mi(v).point)},s=(v,p)=>{const{drag:A,dragPropagation:E,onDragStart:_}=this.getProps();if(A&&!E&&(this.openDragLock&&this.openDragLock(),this.openDragLock=UK(A),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Ie(z=>{let C=this.getAxisMotionValue(z).get()||0;if(l3.test(C)){const{projection:M}=this.visualElement;if(M&&M.layout){const x=M.layout.layoutBox[z];x&&(C=ie(x)*(parseFloat(C)/100))}}this.originPoint[z]=C}),_&&R0.postRender(()=>_(v,p)),x8(this.visualElement,"transform");const{animationState:S}=this.visualElement;S&&S.setActive("whileDrag",!0)},o=(v,p)=>{const{dragPropagation:A,dragDirectionLock:E,onDirectionLock:_,onDrag:S}=this.getProps();if(!A&&!this.openDragLock)return;const{offset:z}=p;if(E&&this.currentDirection===null){this.currentDirection=qY(z),this.currentDirection!==null&&_&&_(this.currentDirection);return}this.updateAxis("x",p.point,z),this.updateAxis("y",p.point,z),this.visualElement.render(),S&&S(v,p)},u=(v,p)=>this.stop(v,p),d=()=>Ie(v=>{var p;return this.getAnimationState(v)==="paused"&&((p=this.getAxisMotionValue(v).animation)===null||p===void 0?void 0:p.play())}),{dragSnapToOrigin:f}=this.getProps();this.panSession=new wC(t,{onSessionStart:r,onStart:s,onMove:o,onSessionEnd:u,resumeAnimation:d},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:f,contextWindow:FC(this.visualElement)})}stop(t,a){const n=this.isDragging;if(this.cancel(),!n)return;const{velocity:r}=a;this.startAnimation(r);const{onDragEnd:s}=this.getProps();s&&R0.postRender(()=>s(t,a))}cancel(){this.isDragging=!1;const{projection:t,animationState:a}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),a&&a.setActive("whileDrag",!1)}updateAxis(t,a,n){const{drag:r}=this.getProps();if(!n||!Qs(t,r,this.currentDirection))return;const s=this.getAxisMotionValue(t);let o=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(o=FY(o,this.constraints[t],this.elastic[t])),s.set(o)}resolveConstraints(){var t;const{dragConstraints:a,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,s=this.constraints;a&&Kn(a)?this.constraints||(this.constraints=this.resolveRefConstraints()):a&&r?this.constraints=HY(r.layoutBox,a):this.constraints=!1,this.elastic=GY(n),s!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Ie(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=VY(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:a}=this.getProps();if(!t||!Kn(t))return!1;const n=t.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const s=YY(n,r.root,this.visualElement.getTransformPagePoint());let o=PY(r.layout.layoutBox,s);if(a){const u=a(jY(o));this.hasMutatedConstraints=!!u,u&&(o=DC(u))}return o}startAnimation(t){const{drag:a,dragMomentum:n,dragElastic:r,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:u}=this.getProps(),d=this.constraints||{},f=Ie(v=>{if(!Qs(v,a,this.currentDirection))return;let p=d&&d[v]||{};o&&(p={min:0,max:0});const A=r?200:1e6,E=r?40:1e7,_={type:"inertia",velocity:n?t[v]:0,bounceStiffness:A,bounceDamping:E,timeConstant:750,restDelta:1,restSpeed:10,...s,...p};return this.startAxisValueAnimation(v,_)});return Promise.all(f).then(u)}startAxisValueAnimation(t,a){const n=this.getAxisMotionValue(t);return x8(this.visualElement,t),n.start(Vd(t,n,0,a,this.visualElement,!1))}stopAnimation(){Ie(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Ie(t=>{var a;return(a=this.getAxisMotionValue(t).animation)===null||a===void 0?void 0:a.pause()})}getAnimationState(t){var a;return(a=this.getAxisMotionValue(t).animation)===null||a===void 0?void 0:a.state}getAxisMotionValue(t){const a=`_drag${t.toUpperCase()}`,n=this.visualElement.getProps(),r=n[a];return r||this.visualElement.getValue(t,(n.initial?n.initial[t]:void 0)||0)}snapToCursor(t){Ie(a=>{const{drag:n}=this.getProps();if(!Qs(a,n,this.currentDirection))return;const{projection:r}=this.visualElement,s=this.getAxisMotionValue(a);if(r&&r.layout){const{min:o,max:u}=r.layout.layoutBox[a];s.set(t[a]-k0(o,u,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:a}=this.getProps(),{projection:n}=this.visualElement;if(!Kn(a)||!n||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};Ie(o=>{const u=this.getAxisMotionValue(o);if(u&&this.constraints!==!1){const d=u.get();r[o]=UY({min:d,max:d},this.constraints[o])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),Ie(o=>{if(!Qs(o,t,null))return;const u=this.getAxisMotionValue(o),{min:d,max:f}=this.constraints[o];u.set(k0(d,f,r[o]))})}addListeners(){if(!this.visualElement.current)return;ZY.set(this.visualElement,this);const t=this.visualElement.current,a=ir(t,"pointerdown",d=>{const{drag:f,dragListener:v=!0}=this.getProps();f&&v&&this.start(d)}),n=()=>{const{dragConstraints:d}=this.getProps();Kn(d)&&d.current&&(this.constraints=this.resolveRefConstraints())},{projection:r}=this.visualElement,s=r.addEventListener("measure",n);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),R0.read(n);const o=Lr(window,"resize",()=>this.scalePositionWithinConstraints()),u=r.addEventListener("didUpdate",({delta:d,hasLayoutChanged:f})=>{this.isDragging&&f&&(Ie(v=>{const p=this.getAxisMotionValue(v);p&&(this.originPoint[v]+=d[v].translate,p.set(p.get()+d[v].translate))}),this.visualElement.render())});return()=>{o(),a(),s(),u&&u()}}getProps(){const t=this.visualElement.getProps(),{drag:a=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:s=!1,dragElastic:o=O8,dragMomentum:u=!0}=t;return{...t,drag:a,dragDirectionLock:n,dragPropagation:r,dragConstraints:s,dragElastic:o,dragMomentum:u}}}function Qs(e,t,a){return(t===!0||t===e)&&(a===null||a===e)}function qY(e,t=10){let a=null;return Math.abs(e.y)>t?a="y":Math.abs(e.x)>t&&(a="x"),a}class XY extends $t{constructor(t){super(t),this.removeGroupControls=a1,this.removeListeners=a1,this.controls=new WY(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||a1}unmount(){this.removeGroupControls(),this.removeListeners()}}const Rg=e=>(t,a)=>{e&&R0.postRender(()=>e(t,a))};class QY extends $t{constructor(){super(...arguments),this.removePointerDownListener=a1}onPointerDown(t){this.session=new wC(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:FC(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:a,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:Rg(t),onStart:Rg(a),onMove:n,onEnd:(s,o)=>{delete this.session,r&&R0.postRender(()=>r(s,o))}}}mount(){this.removePointerDownListener=ir(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const zc={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function xg(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Ul={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(P2.test(e))e=parseFloat(e);else return e;const a=xg(e,t.target.x),n=xg(e,t.target.y);return`${a}% ${n}%`}},JY={correct:(e,{treeScale:t,projectionDelta:a})=>{const n=e,r=Ot.parse(e);if(r.length>5)return n;const s=Ot.createTransformer(e),o=typeof r[0]!="number"?1:0,u=a.x.scale*t.x,d=a.y.scale*t.y;r[0+o]/=u,r[1+o]/=d;const f=k0(u,d,.5);return typeof r[2+o]=="number"&&(r[2+o]/=f),typeof r[3+o]=="number"&&(r[3+o]/=f),s(r)}};class eZ extends y.Component{componentDidMount(){const{visualElement:t,layoutGroup:a,switchLayoutGroup:n,layoutId:r}=this.props,{projection:s}=t;SK(tZ),s&&(a.group&&a.group.add(s),n&&n.register&&r&&n.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),zc.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:a,visualElement:n,drag:r,isPresent:s}=this.props,o=n.projection;return o&&(o.isPresent=s,r||t.layoutDependency!==a||a===void 0?o.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?o.promote():o.relegate()||R0.postRender(()=>{const u=o.getStack();(!u||!u.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Ad.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:a,switchLayoutGroup:n}=this.props,{projection:r}=t;r&&(r.scheduleCheckAfterUnmount(),a&&a.group&&a.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function HC(e){const[t,a]=Fj(),n=y.useContext(Sz);return I.jsx(eZ,{...e,layoutGroup:n,switchLayoutGroup:y.useContext(wz),isPresent:t,safeToRemove:a})}const tZ={borderRadius:{...Ul,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Ul,borderTopRightRadius:Ul,borderBottomLeftRadius:Ul,borderBottomRightRadius:Ul,boxShadow:JY};function aZ(e,t,a){const n=R1(e)?e:Dr(e);return n.start(Vd("",n,t,a)),n.animation}function nZ(e){return e instanceof SVGElement&&e.tagName!=="svg"}const lZ=(e,t)=>e.depth-t.depth;class rZ{constructor(){this.children=[],this.isDirty=!1}add(t){bd(this.children,t),this.isDirty=!0}remove(t){Td(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(lZ),this.isDirty=!1,this.children.forEach(t)}}function iZ(e,t){const a=r3.now(),n=({timestamp:r})=>{const s=r-a;s>=t&&(Lt(n),e(s-t))};return R0.read(n,!0),()=>Lt(n)}const PC=["TopLeft","TopRight","BottomLeft","BottomRight"],sZ=PC.length,wg=e=>typeof e=="string"?parseFloat(e):e,bg=e=>typeof e=="number"||P2.test(e);function cZ(e,t,a,n,r,s){r?(e.opacity=k0(0,a.opacity!==void 0?a.opacity:1,oZ(n)),e.opacityExit=k0(t.opacity!==void 0?t.opacity:1,0,uZ(n))):s&&(e.opacity=k0(t.opacity!==void 0?t.opacity:1,a.opacity!==void 0?a.opacity:1,n));for(let o=0;o<sZ;o++){const u=`border${PC[o]}Radius`;let d=Tg(t,u),f=Tg(a,u);if(d===void 0&&f===void 0)continue;d||(d=0),f||(f=0),d===0||f===0||bg(d)===bg(f)?(e[u]=Math.max(k0(wg(d),wg(f),n),0),(l3.test(f)||l3.test(d))&&(e[u]+="%")):e[u]=f}(t.rotate||a.rotate)&&(e.rotate=k0(t.rotate||0,a.rotate||0,n))}function Tg(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const oZ=UC(0,.5,rC),uZ=UC(.5,.95,a1);function UC(e,t,a){return n=>n<e?0:n>t?1:a(Bt(e,t,n))}function kg(e,t){e.min=t.min,e.max=t.max}function Ee(e,t){kg(e.x,t.x),kg(e.y,t.y)}function Dg(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Bg(e,t,a,n,r){return e-=t,e=no(e,1/a,n),r!==void 0&&(e=no(e,1/r,n)),e}function hZ(e,t=0,a=1,n=.5,r,s=e,o=e){if(l3.test(t)&&(t=parseFloat(t),t=k0(o.min,o.max,t/100)-o.min),typeof t!="number")return;let u=k0(s.min,s.max,n);e===s&&(u-=t),e.min=Bg(e.min,t,a,u,r),e.max=Bg(e.max,t,a,u,r)}function Lg(e,t,[a,n,r],s,o){hZ(e,t[a],t[n],t[r],t.scale,s,o)}const dZ=["x","scaleX","originX"],fZ=["y","scaleY","originY"];function Og(e,t,a,n){Lg(e.x,t,dZ,a?a.x:void 0,n?n.x:void 0),Lg(e.y,t,fZ,a?a.y:void 0,n?n.y:void 0)}function Fg(e){return e.translate===0&&e.scale===1}function VC(e){return Fg(e.x)&&Fg(e.y)}function Hg(e,t){return e.min===t.min&&e.max===t.max}function mZ(e,t){return Hg(e.x,t.x)&&Hg(e.y,t.y)}function Pg(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function GC(e,t){return Pg(e.x,t.x)&&Pg(e.y,t.y)}function Ug(e){return ie(e.x)/ie(e.y)}function Vg(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class vZ{constructor(){this.members=[]}add(t){bd(this.members,t),t.scheduleRender()}remove(t){if(Td(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const a=this.members[this.members.length-1];a&&this.promote(a)}}relegate(t){const a=this.members.findIndex(r=>t===r);if(a===0)return!1;let n;for(let r=a;r>=0;r--){const s=this.members[r];if(s.isPresent!==!1){n=s;break}}return n?(this.promote(n),!0):!1}promote(t,a){const n=this.lead;if(t!==n&&(this.prevLead=n,this.lead=t,t.show(),n)){n.instance&&n.scheduleRender(),t.scheduleRender(),t.resumeFrom=n,a&&(t.resumeFrom.preserveOpacity=!0),n.snapshot&&(t.snapshot=n.snapshot,t.snapshot.latestValues=n.animationValues||n.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:r}=t.options;r===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:a,resumingFrom:n}=t;a.onExitComplete&&a.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function pZ(e,t,a){let n="";const r=e.x.translate/t.x,s=e.y.translate/t.y,o=(a==null?void 0:a.z)||0;if((r||s||o)&&(n=`translate3d(${r}px, ${s}px, ${o}px) `),(t.x!==1||t.y!==1)&&(n+=`scale(${1/t.x}, ${1/t.y}) `),a){const{transformPerspective:f,rotate:v,rotateX:p,rotateY:A,skewX:E,skewY:_}=a;f&&(n=`perspective(${f}px) ${n}`),v&&(n+=`rotate(${v}deg) `),p&&(n+=`rotateX(${p}deg) `),A&&(n+=`rotateY(${A}deg) `),E&&(n+=`skewX(${E}deg) `),_&&(n+=`skewY(${_}deg) `)}const u=e.x.scale*t.x,d=e.y.scale*t.y;return(u!==1||d!==1)&&(n+=`scale(${u}, ${d})`),n||"none"}const Sa={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Xl=typeof window<"u"&&window.MotionDebug!==void 0,A7=["","X","Y","Z"],AZ={visibility:"hidden"},Gg=1e3;let gZ=0;function g7(e,t,a,n){const{latestValues:r}=t;r[e]&&(a[e]=r[e],t.setStaticValue(e,0),n&&(n[e]=0))}function jC(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const a=Qz(t);if(window.MotionHasOptimisedAnimation(a,"transform")){const{layout:r,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(a,"transform",R0,!(r||s))}const{parent:n}=e;n&&!n.hasCheckedOptimisedAppear&&jC(n)}function KC({attachResizeListener:e,defaultParent:t,measureScroll:a,checkIsScrollRoot:n,resetTransform:r}){return class{constructor(o={},u=t==null?void 0:t()){this.id=gZ++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Xl&&(Sa.totalNodes=Sa.resolvedTargetDeltas=Sa.recalculatedProjection=0),this.nodes.forEach(IZ),this.nodes.forEach(CZ),this.nodes.forEach(MZ),this.nodes.forEach(NZ),Xl&&window.MotionDebug.record(Sa)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=u?u.root||u:this,this.path=u?[...u.path,u]:[],this.parent=u,this.depth=u?u.depth+1:0;for(let d=0;d<this.path.length;d++)this.path[d].shouldResetTransform=!0;this.root===this&&(this.nodes=new rZ)}addEventListener(o,u){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new kd),this.eventHandlers.get(o).add(u)}notifyListeners(o,...u){const d=this.eventHandlers.get(o);d&&d.notify(...u)}hasListeners(o){return this.eventHandlers.has(o)}mount(o,u=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=nZ(o),this.instance=o;const{layoutId:d,layout:f,visualElement:v}=this.options;if(v&&!v.current&&v.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),u&&(f||d)&&(this.isLayoutDirty=!0),e){let p;const A=()=>this.root.updateBlockedByResize=!1;e(o,()=>{this.root.updateBlockedByResize=!0,p&&p(),p=iZ(A,250),zc.hasAnimatedSinceResize&&(zc.hasAnimatedSinceResize=!1,this.nodes.forEach(Kg))})}d&&this.root.registerSharedNode(d,this),this.options.animate!==!1&&v&&(d||f)&&this.addEventListener("didUpdate",({delta:p,hasLayoutChanged:A,hasRelativeTargetChanged:E,layout:_})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const S=this.options.transition||v.getDefaultTransition()||TZ,{onLayoutAnimationStart:z,onLayoutAnimationComplete:C}=v.getProps(),M=!this.targetLayout||!GC(this.targetLayout,_)||E,x=!A&&E;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||x||A&&(M||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(p,x);const D={...hi(S,"layout"),onPlay:z,onComplete:C};(v.shouldReduceMotion||this.options.layoutRoot)&&(D.delay=0,D.type=!1),this.startAnimation(D)}else A||Kg(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=_})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Lt(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(RZ),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&jC(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let v=0;v<this.path.length;v++){const p=this.path[v];p.shouldResetTransform=!0,p.updateScroll("snapshot"),p.options.layoutRoot&&p.willUpdate(!1)}const{layoutId:u,layout:d}=this.options;if(u===void 0&&!d)return;const f=this.getTransformTemplate();this.prevTransformTemplateValue=f?f(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(jg);return}this.isUpdating||this.nodes.forEach(yZ),this.isUpdating=!1,this.nodes.forEach(zZ),this.nodes.forEach(EZ),this.nodes.forEach(_Z),this.clearAllSnapshots();const u=r3.now();g1.delta=G3(0,1e3/60,u-g1.timestamp),g1.timestamp=u,g1.isProcessing=!0,o7.update.process(g1),o7.preRender.process(g1),o7.render.process(g1),g1.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Ad.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(SZ),this.sharedNodes.forEach(xZ)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,R0.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){R0.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let d=0;d<this.path.length;d++)this.path[d].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutCorrected=j0(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:u}=this.options;u&&u.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let u=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(u=!1),u){const d=n(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:d,offset:a(this.instance),wasRoot:this.scroll?this.scroll.isRoot:d}}}resetTransform(){if(!r)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,u=this.projectionDelta&&!VC(this.projectionDelta),d=this.getTransformTemplate(),f=d?d(this.latestValues,""):void 0,v=f!==this.prevTransformTemplateValue;o&&(u||Na(this.latestValues)||v)&&(r(this.instance,f),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const u=this.measurePageBox();let d=this.removeElementScroll(u);return o&&(d=this.removeTransform(d)),kZ(d),{animationId:this.root.animationId,measuredBox:u,layoutBox:d,latestValues:{},source:this.id}}measurePageBox(){var o;const{visualElement:u}=this.options;if(!u)return j0();const d=u.measureViewportBox();if(!(((o=this.scroll)===null||o===void 0?void 0:o.wasRoot)||this.path.some(DZ))){const{scroll:v}=this.root;v&&(Zn(d.x,v.offset.x),Zn(d.y,v.offset.y))}return d}removeElementScroll(o){var u;const d=j0();if(Ee(d,o),!((u=this.scroll)===null||u===void 0)&&u.wasRoot)return d;for(let f=0;f<this.path.length;f++){const v=this.path[f],{scroll:p,options:A}=v;v!==this.root&&p&&A.layoutScroll&&(p.wasRoot&&Ee(d,o),Zn(d.x,p.offset.x),Zn(d.y,p.offset.y))}return d}applyTransform(o,u=!1){const d=j0();Ee(d,o);for(let f=0;f<this.path.length;f++){const v=this.path[f];!u&&v.options.layoutScroll&&v.scroll&&v!==v.root&&Wn(d,{x:-v.scroll.offset.x,y:-v.scroll.offset.y}),Na(v.latestValues)&&Wn(d,v.latestValues)}return Na(this.latestValues)&&Wn(d,this.latestValues),d}removeTransform(o){const u=j0();Ee(u,o);for(let d=0;d<this.path.length;d++){const f=this.path[d];if(!f.instance||!Na(f.latestValues))continue;F8(f.latestValues)&&f.updateSnapshot();const v=j0(),p=f.measurePageBox();Ee(v,p),Og(u,f.latestValues,f.snapshot?f.snapshot.layoutBox:void 0,v)}return Na(this.latestValues)&&Og(u,this.latestValues),u}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==g1.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var u;const d=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=d.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=d.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=d.isSharedProjectionDirty);const f=!!this.resumingFrom||this!==d;if(!(o||f&&this.isSharedProjectionDirty||this.isProjectionDirty||!((u=this.parent)===null||u===void 0)&&u.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:p,layoutId:A}=this.options;if(!(!this.layout||!(p||A))){if(this.resolvedRelativeTargetAt=g1.timestamp,!this.targetDelta&&!this.relativeTarget){const E=this.getClosestProjectingParent();E&&E.layout&&this.animationProgress!==1?(this.relativeParent=E,this.forceRelativeParentToResolveTarget(),this.relativeTarget=j0(),this.relativeTargetOrigin=j0(),cr(this.relativeTargetOrigin,this.layout.layoutBox,E.layout.layoutBox),Ee(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=j0(),this.targetWithTransforms=j0()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),OY(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Ee(this.target,this.layout.layoutBox),LC(this.target,this.targetDelta)):Ee(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const E=this.getClosestProjectingParent();E&&!!E.resumingFrom==!!this.resumingFrom&&!E.options.layoutScroll&&E.target&&this.animationProgress!==1?(this.relativeParent=E,this.forceRelativeParentToResolveTarget(),this.relativeTarget=j0(),this.relativeTargetOrigin=j0(),cr(this.relativeTargetOrigin,this.target,E.target),Ee(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Xl&&Sa.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||F8(this.parent.latestValues)||BC(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var o;const u=this.getLead(),d=!!this.resumingFrom||this!==u;let f=!0;if((this.isProjectionDirty||!((o=this.parent)===null||o===void 0)&&o.isProjectionDirty)&&(f=!1),d&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(f=!1),this.resolvedRelativeTargetAt===g1.timestamp&&(f=!1),f)return;const{layout:v,layoutId:p}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(v||p))return;Ee(this.layoutCorrected,this.layout.layoutBox);const A=this.treeScale.x,E=this.treeScale.y;$Y(this.layoutCorrected,this.treeScale,this.path,d),u.layout&&!u.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(u.target=u.layout.layoutBox,u.targetWithTransforms=j0());const{target:_}=u;if(!_){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Dg(this.prevProjectionDelta.x,this.projectionDelta.x),Dg(this.prevProjectionDelta.y,this.projectionDelta.y)),sr(this.projectionDelta,this.layoutCorrected,_,this.latestValues),(this.treeScale.x!==A||this.treeScale.y!==E||!Vg(this.projectionDelta.x,this.prevProjectionDelta.x)||!Vg(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",_)),Xl&&Sa.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var u;if((u=this.options.visualElement)===null||u===void 0||u.scheduleRender(),o){const d=this.getStack();d&&d.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Yn(),this.projectionDelta=Yn(),this.projectionDeltaWithTransform=Yn()}setAnimationOrigin(o,u=!1){const d=this.snapshot,f=d?d.latestValues:{},v={...this.latestValues},p=Yn();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!u;const A=j0(),E=d?d.source:void 0,_=this.layout?this.layout.source:void 0,S=E!==_,z=this.getStack(),C=!z||z.members.length<=1,M=!!(S&&!C&&this.options.crossfade===!0&&!this.path.some(bZ));this.animationProgress=0;let x;this.mixTargetDelta=D=>{const w=D/1e3;$g(p.x,o.x,w),$g(p.y,o.y,w),this.setTargetDelta(p),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(cr(A,this.layout.layoutBox,this.relativeParent.layout.layoutBox),wZ(this.relativeTarget,this.relativeTargetOrigin,A,w),x&&mZ(this.relativeTarget,x)&&(this.isProjectionDirty=!1),x||(x=j0()),Ee(x,this.relativeTarget)),S&&(this.animationValues=v,cZ(v,f,this.latestValues,w,M,C)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=w},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Lt(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=R0.update(()=>{zc.hasAnimatedSinceResize=!0,this.currentAnimation=aZ(0,Gg,{...o,onUpdate:u=>{this.mixTargetDelta(u),o.onUpdate&&o.onUpdate(u)},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Gg),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:u,target:d,layout:f,latestValues:v}=o;if(!(!u||!d||!f)){if(this!==o&&this.layout&&f&&$C(this.options.animationType,this.layout.layoutBox,f.layoutBox)){d=this.target||j0();const p=ie(this.layout.layoutBox.x);d.x.min=o.target.x.min,d.x.max=d.x.min+p;const A=ie(this.layout.layoutBox.y);d.y.min=o.target.y.min,d.y.max=d.y.min+A}Ee(u,d),Wn(u,v),sr(this.projectionDeltaWithTransform,this.layoutCorrected,u,v)}}registerSharedNode(o,u){this.sharedNodes.has(o)||this.sharedNodes.set(o,new vZ),this.sharedNodes.get(o).add(u);const f=u.options.initialPromotionConfig;u.promote({transition:f?f.transition:void 0,preserveFollowOpacity:f&&f.shouldPreserveFollowOpacity?f.shouldPreserveFollowOpacity(u):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:u}=this.options;return u?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:u}=this.options;return u?(o=this.getStack())===null||o===void 0?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:u,preserveFollowOpacity:d}={}){const f=this.getStack();f&&f.promote(this,d),o&&(this.projectionDelta=void 0,this.needsReset=!0),u&&this.setOptions({transition:u})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let u=!1;const{latestValues:d}=o;if((d.z||d.rotate||d.rotateX||d.rotateY||d.rotateZ||d.skewX||d.skewY)&&(u=!0),!u)return;const f={};d.z&&g7("z",o,f,this.animationValues);for(let v=0;v<A7.length;v++)g7(`rotate${A7[v]}`,o,f,this.animationValues),g7(`skew${A7[v]}`,o,f,this.animationValues);o.render();for(const v in f)o.setStaticValue(v,f[v]),this.animationValues&&(this.animationValues[v]=f[v]);o.scheduleRender()}getProjectionStyles(o){var u,d;if(!this.instance||this.isSVG)return;if(!this.isVisible)return AZ;const f={visibility:""},v=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,f.opacity="",f.pointerEvents=Sc(o==null?void 0:o.pointerEvents)||"",f.transform=v?v(this.latestValues,""):"none",f;const p=this.getLead();if(!this.projectionDelta||!this.layout||!p.target){const S={};return this.options.layoutId&&(S.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,S.pointerEvents=Sc(o==null?void 0:o.pointerEvents)||""),this.hasProjected&&!Na(this.latestValues)&&(S.transform=v?v({},""):"none",this.hasProjected=!1),S}const A=p.animationValues||p.latestValues;this.applyTransformsToTarget(),f.transform=pZ(this.projectionDeltaWithTransform,this.treeScale,A),v&&(f.transform=v(A,f.transform));const{x:E,y:_}=this.projectionDelta;f.transformOrigin=`${E.origin*100}% ${_.origin*100}% 0`,p.animationValues?f.opacity=p===this?(d=(u=A.opacity)!==null&&u!==void 0?u:this.latestValues.opacity)!==null&&d!==void 0?d:1:this.preserveOpacity?this.latestValues.opacity:A.opacityExit:f.opacity=p===this?A.opacity!==void 0?A.opacity:"":A.opacityExit!==void 0?A.opacityExit:0;for(const S in Xc){if(A[S]===void 0)continue;const{correct:z,applyTo:C}=Xc[S],M=f.transform==="none"?A[S]:z(A[S],p);if(C){const x=C.length;for(let D=0;D<x;D++)f[C[D]]=M}else f[S]=M}return this.options.layoutId&&(f.pointerEvents=p===this?Sc(o==null?void 0:o.pointerEvents)||"":"none"),f}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var u;return(u=o.currentAnimation)===null||u===void 0?void 0:u.stop()}),this.root.nodes.forEach(jg),this.root.sharedNodes.clear()}}}function EZ(e){e.updateLayout()}function _Z(e){var t;const a=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&a&&e.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:r}=e.layout,{animationType:s}=e.options,o=a.source!==e.layout.source;s==="size"?Ie(p=>{const A=o?a.measuredBox[p]:a.layoutBox[p],E=ie(A);A.min=n[p].min,A.max=A.min+E}):$C(s,a.layoutBox,n)&&Ie(p=>{const A=o?a.measuredBox[p]:a.layoutBox[p],E=ie(n[p]);A.max=A.min+E,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[p].max=e.relativeTarget[p].min+E)});const u=Yn();sr(u,n,a.layoutBox);const d=Yn();o?sr(d,e.applyTransform(r,!0),a.measuredBox):sr(d,n,a.layoutBox);const f=!VC(u);let v=!1;if(!e.resumeFrom){const p=e.getClosestProjectingParent();if(p&&!p.resumeFrom){const{snapshot:A,layout:E}=p;if(A&&E){const _=j0();cr(_,a.layoutBox,A.layoutBox);const S=j0();cr(S,n,E.layoutBox),GC(_,S)||(v=!0),p.options.layoutRoot&&(e.relativeTarget=S,e.relativeTargetOrigin=_,e.relativeParent=p)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:a,delta:d,layoutDelta:u,hasLayoutChanged:f,hasRelativeTargetChanged:v})}else if(e.isLead()){const{onExitComplete:n}=e.options;n&&n()}e.options.transition=void 0}function IZ(e){Xl&&Sa.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function NZ(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function SZ(e){e.clearSnapshot()}function jg(e){e.clearMeasurements()}function yZ(e){e.isLayoutDirty=!1}function zZ(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Kg(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function CZ(e){e.resolveTargetDelta()}function MZ(e){e.calcProjection()}function RZ(e){e.resetSkewAndRotation()}function xZ(e){e.removeLeadSnapshot()}function $g(e,t,a){e.translate=k0(t.translate,0,a),e.scale=k0(t.scale,1,a),e.origin=t.origin,e.originPoint=t.originPoint}function Yg(e,t,a,n){e.min=k0(t.min,a.min,n),e.max=k0(t.max,a.max,n)}function wZ(e,t,a,n){Yg(e.x,t.x,a.x,n),Yg(e.y,t.y,a.y,n)}function bZ(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const TZ={duration:.45,ease:[.4,0,.1,1]},Zg=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Wg=Zg("applewebkit/")&&!Zg("chrome/")?Math.round:a1;function qg(e){e.min=Wg(e.min),e.max=Wg(e.max)}function kZ(e){qg(e.x),qg(e.y)}function $C(e,t,a){return e==="position"||e==="preserve-aspect"&&!LY(Ug(t),Ug(a),.2)}function DZ(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const BZ=KC({attachResizeListener:(e,t)=>Lr(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),E7={current:void 0},YC=KC({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!E7.current){const e=new BZ({});e.mount(window),e.setOptions({layoutScroll:!0}),E7.current=e}return E7.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),LZ={pan:{Feature:QY},drag:{Feature:XY,ProjectionNode:YC,MeasureLayout:HC}};function Xg(e,t,a){const{props:n}=e;e.animationState&&n.whileHover&&e.animationState.setActive("whileHover",a==="Start");const r="onHover"+a,s=n[r];s&&R0.postRender(()=>s(t,mi(t)))}let OZ=class extends $t{mount(){const{current:t}=this.node;t&&(this.unmount=Yz(t,a=>(Xg(this.node,a,"Start"),n=>Xg(this.node,n,"End"))))}unmount(){}},FZ=class extends $t{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=fi(Lr(this.node.current,"focus",()=>this.onFocus()),Lr(this.node.current,"blur",()=>this.onBlur()))}unmount(){}};function Qg(e,t,a){const{props:n}=e;e.animationState&&n.whileTap&&e.animationState.setActive("whileTap",a==="Start");const r="onTap"+(a==="End"?"":a),s=n[r];s&&R0.postRender(()=>s(t,mi(t)))}let HZ=class extends $t{mount(){const{current:t}=this.node;t&&(this.unmount=Wz(t,a=>(Qg(this.node,a,"Start"),(n,{success:r})=>Qg(this.node,n,r?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}};const P8=new WeakMap,_7=new WeakMap,PZ=e=>{const t=P8.get(e.target);t&&t(e)},UZ=e=>{e.forEach(PZ)};function VZ({root:e,...t}){const a=e||document;_7.has(a)||_7.set(a,{});const n=_7.get(a),r=JSON.stringify(t);return n[r]||(n[r]=new IntersectionObserver(UZ,{root:e,...t})),n[r]}function GZ(e,t,a){const n=VZ(t);return P8.set(e,a),n.observe(e),()=>{P8.delete(e),n.unobserve(e)}}const jZ={some:0,all:1};let KZ=class extends $t{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:a,margin:n,amount:r="some",once:s}=t,o={root:a?a.current:void 0,rootMargin:n,threshold:typeof r=="number"?r:jZ[r]},u=d=>{const{isIntersecting:f}=d;if(this.isInView===f||(this.isInView=f,s&&!f&&this.hasEnteredView))return;f&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",f);const{onViewportEnter:v,onViewportLeave:p}=this.node.getProps(),A=f?v:p;A&&A(d)};return GZ(this.node.current,o,u)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:a}=this.node;["amount","margin","root"].some($Z(t,a))&&this.startObserver()}unmount(){}};function $Z({viewport:e={}},{viewport:t={}}={}){return a=>e[a]!==t[a]}const YZ={inView:{Feature:KZ},tap:{Feature:HZ},focus:{Feature:FZ},hover:{Feature:OZ}},ZZ={layout:{ProjectionNode:YC,MeasureLayout:HC}},U8={current:null},ZC={current:!1};function WZ(){if(ZC.current=!0,!!fd)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>U8.current=e.matches;e.addListener(t),t()}else U8.current=!1}const qZ=[...EC,C1,Ot],XZ=e=>qZ.find(gC(e)),Jg=new WeakMap;function QZ(e,t,a){for(const n in t){const r=t[n],s=a[n];if(R1(r))e.addValue(n,r);else if(R1(s))e.addValue(n,Dr(r,{owner:e}));else if(s!==r)if(e.hasValue(n)){const o=e.getValue(n);o.liveStyle===!0?o.jump(r):o.hasAnimated||o.set(r)}else{const o=e.getStaticValue(n);e.addValue(n,Dr(o!==void 0?o:r,{owner:e}))}}for(const n in a)t[n]===void 0&&e.removeValue(n);return t}const eE=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let JZ=class{scrapeMotionValuesFromProps(t,a,n){return{}}constructor({parent:t,props:a,presenceContext:n,reducedMotionConfig:r,blockInitialAnimation:s,visualState:o},u={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Hd,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const E=r3.now();this.renderScheduledAt<E&&(this.renderScheduledAt=E,R0.render(this.render,!1,!0))};const{latestValues:d,renderState:f,onUpdate:v}=o;this.onUpdate=v,this.latestValues=d,this.baseTarget={...d},this.initialValues=a.initial?{...d}:{},this.renderState=f,this.parent=t,this.props=a,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=r,this.options=u,this.blockInitialAnimation=!!s,this.isControllingVariants=Qo(a),this.isVariantNode=Rz(a),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:p,...A}=this.scrapeMotionValuesFromProps(a,{},this);for(const E in A){const _=A[E];d[E]!==void 0&&R1(_)&&_.set(d[E],!1)}}mount(t){this.current=t,Jg.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((a,n)=>this.bindToMotionValue(n,a)),ZC.current||WZ(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:U8.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){Jg.delete(this.current),this.projection&&this.projection.unmount(),Lt(this.notifyUpdate),Lt(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const a=this.features[t];a&&(a.unmount(),a.isMounted=!1)}this.current=null}bindToMotionValue(t,a){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const n=Za.has(t),r=a.on("change",u=>{this.latestValues[t]=u,this.props.onUpdate&&R0.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0)}),s=a.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,a)),this.valueSubscriptions.set(t,()=>{r(),s(),o&&o(),a.owner&&a.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in h4){const a=h4[t];if(!a)continue;const{isEnabled:n,Feature:r}=a;if(!this.features[t]&&r&&n(this.props)&&(this.features[t]=new r(this)),this.features[t]){const s=this.features[t];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):j0()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,a){this.latestValues[t]=a}update(t,a){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=a;for(let n=0;n<eE.length;n++){const r=eE[n];this.propEventSubscriptions[r]&&(this.propEventSubscriptions[r](),delete this.propEventSubscriptions[r]);const s="on"+r,o=t[s];o&&(this.propEventSubscriptions[r]=this.on(r,o))}this.prevMotionValues=QZ(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const a=this.getClosestVariantNode();if(a)return a.variantChildren&&a.variantChildren.add(t),()=>a.variantChildren.delete(t)}addValue(t,a){const n=this.values.get(t);a!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,a),this.values.set(t,a),this.latestValues[t]=a.get())}removeValue(t){this.values.delete(t);const a=this.valueSubscriptions.get(t);a&&(a(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,a){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return n===void 0&&a!==void 0&&(n=Dr(a===null?void 0:a,{owner:this}),this.addValue(t,n)),n}readValue(t,a){var n;let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(n=this.getBaseTargetFromProps(this.props,t))!==null&&n!==void 0?n:this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(pC(r)||sC(r))?r=parseFloat(r):!XZ(r)&&Ot.test(a)&&(r=fC(t,a)),this.setBaseTarget(t,R1(r)?r.get():r)),R1(r)?r.get():r}setBaseTarget(t,a){this.baseTarget[t]=a}getBaseTarget(t){var a;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const o=Ed(this.props,n,(a=this.presenceContext)===null||a===void 0?void 0:a.custom);o&&(r=o[t])}if(n&&r!==void 0)return r;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!R1(s)?s:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,a){return this.events[t]||(this.events[t]=new kd),this.events[t].add(a)}notify(t,...a){this.events[t]&&this.events[t].notify(...a)}},WC=class extends JZ{constructor(){super(...arguments),this.KeyframeResolver=_C}sortInstanceNodePosition(t,a){return t.compareDocumentPosition(a)&2?1:-1}getBaseTargetFromProps(t,a){return t.style?t.style[a]:void 0}removeValueFromRenderState(t,{vars:a,style:n}){delete a[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;R1(t)&&(this.childSubscription=t.on("change",a=>{this.current&&(this.current.textContent=`${a}`)}))}};function eW(e){return window.getComputedStyle(e)}let tW=class extends WC{constructor(){super(...arguments),this.type="html",this.renderInstance=Oz}readValueFromInstance(t,a){if(Za.has(a)){const n=Fd(a);return n&&n.default||0}else{const n=eW(t),r=(Dz(a)?n.getPropertyValue(a):n[a])||0;return typeof r=="string"?r.trim():r}}measureInstanceViewportBox(t,{transformPagePoint:a}){return OC(t,a)}build(t,a,n){Nd(t,a,n.transformTemplate)}scrapeMotionValuesFromProps(t,a,n){return Cd(t,a,n)}},aW=class extends WC{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=j0}getBaseTargetFromProps(t,a){return t[a]}readValueFromInstance(t,a){if(Za.has(a)){const n=Fd(a);return n&&n.default||0}return a=Fz.has(a)?a:pd(a),t.getAttribute(a)}scrapeMotionValuesFromProps(t,a,n){return Uz(t,a,n)}build(t,a,n){Sd(t,a,this.isSVGTag,n.transformTemplate)}renderInstance(t,a,n,r){Hz(t,a,n,r)}mount(t){this.isSVGTag=zd(t.tagName),super.mount(t)}};const nW=(e,t)=>gd(e)?new aW(t):new tW(t,{allowProjection:e!==y.Fragment}),lW=TK({...MY,...YZ,...LZ,...ZZ},nW),qC=Yj(lW),Gd="relative scroll-mb-8 scroll-mt-[30vh] scroll-p-8",rW="after:content-['#'] after:scale-75 after:px-6 after:text-neutral after:absolute after:top-0 after:h-full after:-left-12 after:hover:cursor-pointer after:absolute after:to-neutral after:md:opacity-0 after:transition-opacity hover:after:opacity-80 after:duration-200 after:delay-100",iW=({className:e,...t})=>I.jsx("h1",{className:C2("mt-5 text-2xl font-bold",e),...t}),sW=({className:e,...t})=>I.jsx("h2",{className:C2("mt-5 text-2xl font-bold",Gd,e),...t}),cW=({className:e,...t})=>I.jsx("h3",{className:C2("mt-3 text-xl font-bold",Gd,e),...t}),oW=({className:e,...t})=>I.jsx("h4",{className:C2("mt-3 text-lg font-bold",Gd,e),...t}),uW=e=>String(e).normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\s+/g,"-").toLowerCase(),hW=e=>{var r;const t=document.getElementById(e),n=(((r=t==null?void 0:t.getBoundingClientRect())==null?void 0:r.top)??0)+window.scrollY-150;window.scrollTo({top:n,behavior:"smooth"})},dW=(e,t)=>{const a=e.getBoundingClientRect().left,n=e.getBoundingClientRect().top,r=window.getComputedStyle(e,":after"),s=a+parseInt(r.getPropertyValue("left"),10),o=s+parseInt(r.width,10),u=n+parseInt(r.getPropertyValue("top"),10),d=u+parseInt(r.height,10),f=t.clientX,v=t.clientY;return f>=s&&f<=o&&v>=u&&v<=d},jd=({H:e,children:t,className:a,isClickable:n,...r})=>{const s=typeof t=="string"?uW(t):void 0,o=u=>{const{id:d}=u.currentTarget;if(dW(u.currentTarget,u)&&typeof d=="string"){const p=`${window.location.href.split("#")[0]}#${d}`;navigator.clipboard.writeText(p),hW(d)}};return I.jsx(e,{id:s,onClick:n?o:void 0,"aria-label":n?`Click to scroll to section ${s} and copy the link to the clipboard`:void 0,className:C2(n&&rW,a),...r,children:t})},fW=({isClickable:e,...t})=>I.jsx(iW,{...t}),mW=({isClickable:e=!1,...t})=>I.jsx(jd,{H:sW,isClickable:e,...t}),Kd=({isClickable:e=!1,...t})=>I.jsx(jd,{H:cW,isClickable:e,...t}),vW=({isClickable:e=!1,...t})=>I.jsx(jd,{H:oW,isClickable:e,...t}),pW=Me("cursor-default overflow-auto py-3 shadow-sm justify-center",{variants:{size:{sm:"h-auto max-h-[30vh] w-[95vw] max-w-xl",md:"h-auto max-h-[50vh] w-[95vw] max-w-xl",lg:"h-auto max-h-[70vh] w-[95vw] max-w-2xl",xl:"h-auto max-h-[95vh] w-[95vw] max-w-6xl",unset:"h-auto max-h-[95vh] w-[95vw]"}},defaultVariants:{size:"unset"}}),AW=qC.create(d3),gW=({children:e,isOpen:t,container:a,disableScroll:n=!1,onClose:r,hasCloseButton:s=!1,title:o,size:u="md",className:d,...f})=>{const v=bN(a);if(LN({key:"modal",disableScroll:t&&n}),!v)return I.jsx(I.Fragment,{});const p=typeof o=="string";return $a.createPortal(I.jsx(qC.div,{className:"bg-background/40 /40 invisible fixed left-0 top-0 z-50 flex size-full cursor-pointer items-center justify-center overflow-auto backdrop-blur",animate:t?"visible":"invisible",variants:{visible:{opacity:1,visibility:"visible",transition:{duration:.1,when:"beforeChildren"}},invisible:{opacity:0,visibility:"hidden",transition:{duration:.1,when:"afterChildren"}}},onClick:A=>{A.stopPropagation(),r==null||r()},"aria-hidden":!t,children:I.jsx("div",{className:"flex justify-center p-4",children:I.jsxs(AW,{onClick:A=>A.stopPropagation(),initial:{scale:t?.5:1},animate:{scale:t?1:.5},transition:{duration:.3},className:pW({size:u,className:d}),role:"dialog","aria-modal":!0,roundedSize:"2xl",...f,children:[I.jsxs("div",{className:C2("cursor-default px-4",s&&p?"flex items-center justify-center":s?"flex items-center justify-end":p?"items-center":"hidden"),children:[p&&I.jsx(Kd,{className:"ml-4 flex items-center justify-center text-lg font-bold",children:o}),s&&I.jsx(_0,{variant:"hoverable",color:"text",label:"Close modal",className:"ml-auto",onClick:A=>{A.stopPropagation(),r==null||r()},Icon:Ya,size:"icon-md"})]}),I.jsx("div",{className:"flex flex-1 flex-col items-center overflow-auto",children:e})]})})}),v)};j({en:"Verify your email","en-GB":"Verify your email",fr:"Vérifiez votre adresse e-mail",es:"Verifique su correo electrónico",de:"Bestätigen Sie Ihre E-Mail",ja:"メールを確認してください",ko:"이메일을 확인해주세요",zh:"请验证您的电子邮件",it:"Verifica la tua email",pt:"Verifique seu e-mail",hi:"अपने ईमेल की पुष्टि करें",ar:"تحقق من بريدك الإلكتروني",ru:"Подтвердите ваш адрес электронной почты"}),j({en:"We sent you an email to verify your email address. Please check your inbox and click on the link to verify your email.","en-GB":"We sent you an email to verify your email address. Please check your inbox and click on the link to verify your email.",fr:"Nous vous avons envoyé un e-mail pour vérifier votre adresse e-mail. Veuillez vérifier votre boîte de réception et cliquez sur le lien pour vérifier votre adresse e-mail.",es:"Te hemos enviado un correo electrónico para verificar tu dirección de correo electrónico. Por favor, revisa tu bandeja de entrada y haz clic en el enlace para verificar tu dirección de correo electrónico.",de:"Wir haben Ihnen eine E-Mail gesendet, um Ihre E-Mail-Adresse zu überprüfen. Bitte überprüfen Sie Ihren Posteingang und klicken Sie auf den Link, um Ihre E-Mail zu bestätigen.",ja:"あなたのメールアドレスを確認するためにメールを送りました。受信トレイを確認し、メールを確認するためにリンクをクリックしてください。",ko:"이메일 주소를 확인하기 위해 이메일을 보냈습니다. 받은 편지함을 확인하고 이메일을 확인하기 위해 링크를 클릭하세요.",zh:"我们给您发送了一封电子邮件以验证您的电子邮件地址。请检查您的收件箱并点击链接以验证您的电子邮件。",it:"Ti abbiamo inviato un'email per verificare il tuo indirizzo email. Controlla la tua casella di posta e fai clic sul link per verificare la tua email.",pt:"Enviamos um e-mail para verificar seu endereço de e-mail. Verifique sua caixa de entrada e clique no link para verificar seu e-mail.",hi:"हमने आपको आपके ईमेल पते की पुष्टि करने के लिए एक ईमेल भेजा है। कृपया अपने इनबॉक्स की जांच करें और अपने ईमेल की पुष्टि करने के लिए लिंक पर क्लिक करें।",ar:"لقد أرسلنا إليك بريدًا إلكترونيًا للتحقق من عنوان بريدك الإلكتروني. يرجى التحقق من صندوق الوارد الخاص بك والنقر على الرابط للتحقق من بريدك الإلكتروني.",ru:"Мы отправили вам письмо для подтверждения вашего адреса электронной почты. Пожалуйста, проверьте свой почтовый ящик и нажмите на ссылку, чтобы подтвердить электронную почту."}),j({en:"Done","en-GB":"Done",fr:"Terminé",es:"Hecho",de:"Fertig",ja:"完了",ko:"완료",zh:"完成",it:"Fatto",pt:"Feito",hi:"किया",ar:"تم",ru:"Готово"}),j({en:"Click to return to the previous page","en-GB":"Click to return to the previous page",fr:"Cliquez pour revenir à la page précédente",es:"Haga clic para volver a la página anterior",de:"Klicken Sie, um zur vorherigen Seite zurückzukehren",ja:"前のページに戻るにはクリックしてください",ko:"이전 페이지로 돌아가려면 클릭하세요",zh:"点击返回到上一页",it:"Clicca per tornare alla pagina precedente",pt:"Clique para voltar à página anterior",hi:"पिछला पृष्ठ पर वापस जाने के लिए क्लिक करें",ar:"انقر للرجوع إلى الصفحة السابقة",ru:"Нажмите, чтобы вернуться на предыдущую страницу"});j({en:"New password",fr:"Nouveau mot de passe",es:"Nueva contraseña",de:"Neues Passwort",ja:"新しいパスワード",ko:"새 비밀번호",zh:"新密码",it:"Nuova password",pt:"Nova senha",hi:"नया पासवर्ड",ar:"كلمة المرور الجديدة",ru:"Новый пароль","en-GB":"New password"}),j({en:"Enter new password",fr:"Entrez votre nouveau mot de passe",es:"Ingresa tu nueva contraseña",de:"Geben Sie das neue Passwort ein",ja:"新しいパスワードを入力してください",ko:"새 비밀번호를 입력하세요",zh:"输入新密码",it:"Inserisci la nuova password",pt:"Digite a nova senha",hi:"नया पासवर्ड दर्ज करें",ar:"أدخل كلمة المرور الجديدة",ru:"Введите новый пароль","en-GB":"Enter new password"}),j({en:"Confirm new password",fr:"Confirmez le nouveau mot de passe",es:"Confirma tu nueva contraseña",de:"Bestätigen Sie das neue Passwort",ja:"新しいパスワードを確認してください",ko:"새 비밀번호를 확인하세요",zh:"确认新密码",it:"Conferma la nuova password",pt:"Confirme a nova senha",hi:"नए पासवर्ड की पुष्टि करें",ar:"تأكيد كلمة المرور الجديدة",ru:"Подтвердите новый пароль","en-GB":"Confirm new password"}),j({en:"Confirm new password",fr:"Confirmez votre nouveau mot de passe",es:"Confirma tu nueva contraseña",de:"Bestätigen Sie das neue Passwort",ja:"新しいパスワードを確認してください",ko:"새 비밀번호를 확인하세요",zh:"确认新密码",it:"Conferma la nuova password",pt:"Confirme a nova senha",hi:"नए पासवर्ड की पुष्टि करें",ar:"تأكيد كلمة المرور الجديدة",ru:"Подтвердите новый пароль","en-GB":"Confirm new password"}),j({en:"Change password",fr:"Changer le mot de passe",es:"Cambiar la contraseña",de:"Passwort ändern",ja:"パスワードを変更",ko:"비밀번호 변경",zh:"更改密码",it:"Cambia password",pt:"Alterar senha",hi:"पासवर्ड बदलें",ar:"تغيير كلمة المرور",ru:"Сменить пароль","en-GB":"Change password"}),j({en:"Click to change password",fr:"Cliquez pour changer le mot de passe",es:"Haz clic para cambiar la contraseña",de:"Klicken Sie, um das Passwort zu ändern",ja:"パスワードを変更するにはクリックしてください",ko:"비밀번호를 변경하려면 클릭하세요",zh:"单击以更改密码",it:"Clicca per cambiare la password",pt:"Clique para alterar a senha",hi:"पासवर्ड बदलने के लिए क्लिक करें",ar:"انقر لتغيير كلمة المرور",ru:"Нажмите, чтобы изменить пароль","en-GB":"Click to change password"});j({en:"Your password must be at least 8 characters","en-GB":"Your password must be at least 8 characters",fr:"Votre mot de passe doit comporter au moins 8 caractères",es:"Su contraseña debe tener al menos 8 caracteres",de:"Ihr Passwort muss mindestens 8 Zeichen lang sein",ja:"パスワードは8文字以上でなければなりません",ko:"비밀번호는 8자 이상이어야 합니다",zh:"您的密码必须至少为8个字符",it:"La tua password deve contenere almeno 8 caratteri",pt:"Sua senha deve ter pelo menos 8 caracteres",hi:"आपका पासवर्ड कम से कम 8 अक्षरों का होना चाहिए",ar:"يجب أن تحتوي كلمة المرور الخاصة بك على 8 أحرف على الأقل",ru:"Ваш пароль должен содержать не менее 8 символов"}),j({en:"Please enter your new password","en-GB":"Please enter your new password",fr:"Veuillez saisir votre nouveau mot de passe",es:"Por favor, ingrese su nueva contraseña",de:"Bitte geben Sie Ihr neues Passwort ein",ja:"新しいパスワードを入力してください",ko:"새 비밀번호를 입력하십시오",zh:"请输入您的新密码",it:"Si prega di inserire la propria nuova password",pt:"Por favor, insira sua nova senha",hi:"कृपया अपना नया पासवर्ड दर्ज करें",ar:"يرجى إدخال كلمة المرور الجديدة الخاصة بك",ru:"Пожалуйста, введите ваш новый пароль"}),j({en:"Please enter a valid new password","en-GB":"Please enter a valid new password",fr:"Veuillez saisir un nouveau mot de passe valide",es:"Por favor, ingrese una nueva contraseña válida",de:"Bitte geben Sie ein gültiges neues Passwort ein",ja:"有効な新しいパスワードを入力してください",ko:"유효한 새 비밀번호를 입력하십시오",zh:"请输入有效的新密码",it:"Si prega di inserire una nuova password valida",pt:"Por favor, insira uma nova senha válida",hi:"कृपया एक वैध नया पासवर्ड दर्ज करें",ar:"يرجى إدخال كلمة مرور جديدة صالحة",ru:"Пожалуйста, введите действительный новый пароль"}),j({en:"Please enter your new password again","en-GB":"Please enter your new password again",fr:"Veuillez saisir votre nouveau mot de passe à nouveau",es:"Por favor, ingrese su nueva contraseña nuevamente",de:"Bitte geben Sie Ihr neues Passwort erneut ein",ja:"新しいパスワードを再度入力してください",ko:"새 비밀번호를 다시 입력하십시오",zh:"请再次输入您的新密码",it:"Si prega di reinserire la propria nuova password",pt:"Por favor, insira sua nova senha novamente",hi:"कृपया अपना नया पासवर्ड फिर से दर्ज करें",ar:"يرجى إدخال كلمة المرور الجديدة الخاصة بك مرة أخرى",ru:"Пожалуйста, повторно введите ваш новый пароль"}),j({en:"Please enter a valid new password again","en-GB":"Please enter a valid new password again",fr:"Veuillez saisir un nouveau mot de passe valide à nouveau",es:"Por favor, ingrese una nueva contraseña válida nuevamente",de:"Bitte geben Sie erneut ein gültiges neues Passwort ein",ja:"もう一度有効な新しいパスワードを入力してください",ko:"유효한 새 비밀번호를 다시 입력하십시오",zh:"请再次输入有效的新密码",it:"Si prega di reinserire una nuova password valida",pt:"Por favor, insira uma nova senha válida novamente",hi:"कृपया एक वैध नया पासवर्ड फिर से दर्ज करें",ar:"يرجى إدخال كلمة مرور جديدة صالحة مرة أخرى",ru:"Пожалуйста, повторно введите действительный новый пароль"}),j({en:"New password and password confirmation must match","en-GB":"New password and password confirmation must match",fr:"Le nouveau mot de passe et la confirmation de mot de passe doivent correspondre",es:"La nueva contraseña y la confirmación de la contraseña deben coincidir",de:"Das neue Passwort und die Bestätigung müssen übereinstimmen",ja:"新しいパスワードとパスワード確認が一致する必要があります",ko:"새 비밀번호와 비밀번호 확인이 일치해야 합니다",zh:"新密码和密码确认必须匹配",it:"La nuova password e la conferma della password devono corrispondere",pt:"A nova senha e a confirmação da senha devem corresponder",hi:"नया पासवर्ड और पासवर्ड की पुष्टि मिलनी चाहिए",ar:"يجب أن يتطابق كلمة المرور الجديدة مع تأكيد كلمة المرور",ru:"Новый пароль и подтверждение пароля должны совпадать"});const EW={key:"save-dictionary-details",content:{resetButton:{text:j({en:"Reset all changes","en-GB":"Reset all changes",fr:"Réinitialiser toutes les modifications",es:"Restablecer todas las modificaciones",de:"Alle Änderungen zurücksetzen",ja:"すべての変更をリセット",ko:"모든 변경 사항 초기화",zh:"重置所有更改",it:"Reimposta tutte le modifiche",pt:"Redefinir todas as alterações",hi:"सभी परिवर्तनों को रीसेट करें",ar:"إعادة تعيين جميع التغييرات",ru:"Сбросить все изменения"}),label:j({en:"Click to reset all the changes","en-GB":"Click to reset all the changes",fr:"Cliquez pour réinitialiser toutes les modifications",es:"Haga clic para restablecer todas las modificaciones",de:"Klicken Sie, um alle Änderungen zurückzusetzen",ja:"すべての変更をリセットするにはクリックしてください",ko:"모든 변경 사항을 초기화하려면 클릭하세요",zh:"单击以重置所有更改",it:"Fai clic per ripristinare tutte le modifiche",pt:"Clique para redefinir todas as alterações",hi:"सभी परिवर्तनों को रीसेट करने के लिए क्लिक करें",ar:"انقر لإعادة تعيين جميع التغييرات",ru:"Нажмите, чтобы сбросить все изменения"})},saveButton:{text:j({en:"Save changes","en-GB":"Save changes",fr:"Enregistrer les modifications",es:"Guardar cambios",de:"Änderungen speichern",ja:"変更を保存",ko:"변경 사항 저장",zh:"保存更改",it:"Salva le modifiche",pt:"Salvar alterações",hi:"परिवर्तनों को सहेजें",ar:"احفظ التغييرات",ru:"Сохранить изменения"}),label:j({en:"Click to save changes","en-GB":"Click to save changes",fr:"Cliquez pour enregistrer les modifications",es:"Haga clic para guardar cambios",de:"Klicken Sie, um Änderungen zu speichern",ja:"変更を保存するにはクリックしてください",ko:"변경 사항을 저장하려면 클릭하세요",zh:"单击保存更改",it:"Fai clic per salvare le modifiche",pt:"Clique para salvar alterações",hi:"परिवर्तनों को सहेजने के लिए क्लिक करें",ar:"انقر لحفظ التغييرات",ru:"Нажмите, чтобы сохранить изменения"})},publishButton:{text:j({en:"Publish dictionary","en-GB":"Publish dictionary",fr:"Publier dictionnaire",es:"Publicar diccionario",de:"Wörterbuch veröffentlichen",ja:"辞書を公開",ko:"사전을 게시합니다",zh:"发布字典",it:"Pubblica dizionario",pt:"Publicar dicionário",hi:"शब्दकोश प्रकाशित करें",ar:"نشر القاموس",ru:"Опубликовать словарь"}),label:j({en:"Click to publish dictionary","en-GB":"Click to publish dictionary",fr:"Cliquez pour publier dictionnaire",es:"Haga clic para publicar diccionario",de:"Klicken Sie, um das Wörterbuch zu veröffentlichen",ja:"辞書を公開するにはクリックしてください",ko:"사전을 게시하려면 클릭하세요",zh:"单击以发布字典",it:"Fai clic per pubblicare il dizionario",pt:"Clique para publicar dicionário",hi:"शब्दकोश प्रकाशित करने के लिए क्लिक करें",ar:"انقر لنشر القاموس",ru:"Нажмите, чтобы опубликовать словарь"})},downloadButton:{text:j({en:"Download","en-GB":"Download",fr:"Télécharger",es:"Descargar",de:"Herunterladen",ja:"ダウンロード",ko:"다운로드",zh:"下载",it:"Scarica",pt:"Baixar",hi:"डाउनलोड",ar:"تنزيل",ru:"Скачать"}),label:j({en:"Click to download","en-GB":"Click to download",fr:"Cliquez pour télécharger",es:"Haga clic para descargar",de:"Klicken Sie, um herunterzuladen",ja:"ダウンロードするにはクリックしてください",ko:"다운로드를 클릭하세요",zh:"单击下载",it:"Fai clic per scaricare",pt:"Clique para baixar",hi:"डाउनलोड करने के लिए क्लिक करें",ar:"انقر لتنزيل",ru:"Нажмите, чтобы скачать"})}}},XC=({dictionary:e,mode:t,className:a,...n})=>{const{setLocaleDictionary:r}=_h(),{writeDictionary:s,isLoading:o}=wF(),{pushDictionaries:u,isLoading:d}=zF(),f=o||d,{editedContent:v,restoreEditedContent:p}=G1(),{resetButton:A,saveButton:E,publishButton:_,downloadButton:S}=d1(EW),{isAuthenticated:z}=ei(),C=y.useMemo(()=>v==null?void 0:v[e.key],[v,e.key]),M=y.useMemo(()=>C&&JSON.stringify(C)!==JSON.stringify(e),[C,e,t]),x=y.useMemo(()=>typeof(e==null?void 0:e._id)>"u",[e]),D=async()=>{if(!(v!=null&&v[e.key]))return;const b={...e,...v==null?void 0:v[e.key]};await s(b).then(()=>{r(v==null?void 0:v[e.key]),p(e.key)})},w=async()=>{if(!(v!=null&&v[e.key]))return;const b={...e,...v==null?void 0:v[e.key]};await u([b]).then(()=>{r(v==null?void 0:v[e.key]),p(e.key)})};return I.jsxs("form",{className:C2("flex justify-end gap-2 max-md:flex-col",a),...n,children:[M&&I.jsx(o0.Button,{label:A.label.value,disabled:!M,Icon:RL,variant:"outline",color:"text",className:"max-md:w-full",onClick:()=>p(e.key),children:A.text}),t.includes("local")&&I.jsx(o0.Button,{label:S.label.value,disabled:!M||f,Icon:mL,color:"text",variant:z?"outline":"default",className:"max-md:w-full",isLoading:o,onClick:D,children:S.text}),t.includes("remote")&&z&&x&&I.jsx(o0.Button,{label:_.label.value,disabled:!M,Icon:JB,color:"text",className:"max-md:w-full",isLoading:d,onClick:w,children:_.text}),t.includes("remote")&&z&&!x&&M&&I.jsx(o0.Button,{label:E.label.value,disabled:!M||f,Icon:wL,color:"text",className:"max-md:w-full",isLoading:d,onClick:w,children:E.text})]})},Ql=({children:e,header:t,isOpen:a=!1,onClick:n,...r})=>{const[s,o]=y.useState(a),u=s==null?void 0:!s;return y.useEffect(()=>{a!=null&&o(a)},[a]),I.jsxs("div",{className:"w-full",children:[I.jsx(_0,{variant:"hoverable",color:"text",onClick:d=>{o(f=>!f),n==null||n(d)},isFullWidth:!0,className:"flex items-center justify-between gap-2",IconRight:RN,iconClassName:C2("transform transition-transform duration-500 ease-in-out",s?"rotate-0":"-rotate-180"),...r,children:t}),I.jsx(CN,{tabIndex:u!==!1?void 0:-1,isHidden:u,children:e})]})},QC=({level:e,title:t,description:a,children:n,rightParam:r,isSelected:s,...o})=>I.jsx("div",{className:C2("rounded-md p-2 transition","hover:bg-card/30 [&:has(.section:hover)]:bg-transparent",e===2&&"hover:bg-card/30",e>=3&&"",s===!0&&"bg-card/40"),...o,children:I.jsx(Ql,{isOpen:s,label:t,header:I.jsxs("div",{className:"flex w-full",children:[I.jsxs("div",{className:"flex w-full items-center justify-between",children:[I.jsx("span",{className:C2(e===0&&"text-2xl",e===1&&"text-xl",e===2&&"text-lg",e>=3&&"text-base"),children:t}),r&&I.jsx("div",{className:"flex w-auto items-center justify-between p-3",children:r})]}),a&&I.jsx("p",{className:"text-card pl-3 text-sm",children:a})]}),children:n})}),_W=({keyPath:e,section:t,editedContent:a,onContentChange:n,onFocusKeyPath:r})=>{const s=L3(a,e);if(s&&typeof s!="string")return I.jsx(I.Fragment,{children:"Error loading section"});const o=e.length,u=s??t;return I.jsx("span",{role:"button",tabIndex:0,className:C2("w-full rounded-md p-2 text-left transition","hover:bg-card/30 [&:has(.section:hover)]:bg-transparent",o===2&&"hover:bg-card/30",o>=3&&""),onClick:d=>{d.stopPropagation(),r(e)},children:I.jsx(LS,{defaultValue:String(u),onSave:d=>n({keyPath:e,newValue:d}),onCancel:()=>null})})},IW=e=>{const{keyPath:t,section:a,onFocusKeyPath:n,focusedKeyPath:r=[]}=e;return a.map((s,o)=>{const u={key:o,type:G.Array},d=[...t,u];return I.jsx(QC,{level:t.length,title:`${o}`,description:"",isSelected:Wr(d,r),onClick:f=>{f.stopPropagation(),n(d)},children:I.jsx(Wa,{...e,keyPath:d,section:s})},JSON.stringify(s))})},NW=e=>{const{keyPath:t,section:a}=e;return I.jsx("div",{className:"ml-2 grid grid-cols-[auto,1fr] gap-2",children:Object.keys(a).filter(n=>!$d.includes(n)).map(n=>{const r={type:G.Condition,key:n},s=[...t,r],o=a[G.Condition][n];return I.jsxs(I.Fragment,{children:[I.jsx("span",{className:"flex items-center font-bold",children:n}),y.createElement(Wa,{...e,key:n,keyPath:s,section:o})]})})})},SW=e=>{const{keyPath:t,section:a}=e;return I.jsx("div",{className:"ml-2 grid grid-cols-[auto,1fr] gap-2",children:Object.keys(a).filter(n=>!$d.includes(n)).map(n=>{const r={type:G.Enumeration,key:n},s=[...t,r],o=a[G.Enumeration][n];return I.jsxs(I.Fragment,{children:[I.jsx("span",{className:"flex items-center font-bold",children:n}),y.createElement(Wa,{...e,key:n,keyPath:s,section:o})]})})})},yW=e=>{const{keyPath:t,section:a}=e,n={type:G.Markdown},r=[...t,n],s=a[G.Markdown];return I.jsx("div",{className:"ml-2 grid grid-cols-[auto,1fr] gap-2",children:I.jsx(Wa,{...e,keyPath:r,section:s})})},zW=e=>{const{keyPath:t,section:a,focusedKeyPath:n=[],onFocusKeyPath:r}=e;return Object.keys(a).filter(s=>!$d.includes(s)).map(s=>{const o={key:s,type:G.Object},u=[...t,o];return I.jsx(QC,{level:t.length,title:s,description:"",isSelected:Wr(u,n),onClick:d=>{d.stopPropagation(),r(u)},children:I.jsx(Wa,{...e,keyPath:u,section:a[s]})},s)})},CW=e=>{const{keyPath:t,section:a,locale:n}=e,r={type:G.Translation,key:n},s=[...t,r],o=a.translation[n];return I.jsx(Wa,{...e,keyPath:s,section:o})},$d=["filePath","id","nodeType"],Wa=e=>{const{section:t}=e,a=Zr(t);if(typeof t=="object")return a===G.ReactNode?I.jsx("span",{className:"text-neutral text-xs",children:"React node not editable"}):a===G.Nested?I.jsx("div",{className:"ml-2 grid grid-cols-[auto,1fr] gap-2",children:"[Nested] Dictionary"}):a===G.Markdown?I.jsx(yW,{...e,section:t}):a===G.Translation?I.jsx(CW,{...e,section:t}):a===G.Enumeration?I.jsx(SW,{...e,section:t}):a===G.Condition?I.jsx(NW,{...e,section:t}):a===G.Array?I.jsx(IW,{...e,section:t}):I.jsx(zW,{...e,section:t});if(typeof t=="string")return I.jsx(_W,{...e,section:t})},MW=({dictionary:e,mode:t,...a})=>{var d;const{editedContent:n,addEditedContent:r}=G1(),{focusedContent:s,setFocusedContentKeyPath:o}=Ft(),u=s==null?void 0:s.keyPath;return I.jsxs("div",{className:"flex flex-1 flex-col justify-between gap-2",children:[I.jsx("div",{children:y.createElement(Wa,{...a,keyPath:[],key:JSON.stringify(((n==null?void 0:n[e.key])??e).content),editedContent:(d=n==null?void 0:n[e.key])==null?void 0:d.content,focusedKeyPath:u,section:e.content,onContentChange:f=>{r(e.key,f.newValue,f.keyPath)},onFocusKeyPath:o})}),I.jsx(XC,{dictionary:e,mode:t,className:"mb-4 flex-col"})]})};j({en:"Key","en-GB":"Key",fr:"Clé",es:"Clave",de:"Schlüssel",ja:"キー",ko:"키",zh:"键",it:"Chiave",pt:"Chave",hi:"की",ar:"مفتاح",ru:"Ключ"}),j({en:"Enter the key of your dictionary","en-GB":"Enter the key of your dictionary",fr:"Entrez la clé de votre dictionnaire",es:"Ingrese la clave de su diccionario",de:"Geben Sie den Schlüssel Ihres Wörterbuchs ein",ja:"辞書のキーを入力してください",ko:"사전의 키를 입력하세요",zh:"输入字典的键",it:"Inserisci la chiave del tuo dizionario",pt:"Insira a chave do seu dicionário",hi:"अपने शब्दकोश की कुंजी दर्ज करें",ar:"أدخل مفتاح القاموس الخاص بك",ru:"Введите ключ вашего словаря"}),j({en:"Projects","en-GB":"Projects",fr:"Projets",es:"Proyectos",de:"Projekte",ja:"プロジェクト",ko:"프로젝트",zh:"项目",it:"Progetti",pt:"Projetos",hi:"प्रोजेक्ट",ar:"مشاريع",ru:"Проекты"}),j({en:"Select one or more projects to associate with your dictionary","en-GB":"Select one or more projects to associate with your dictionary",fr:"Sélectionnez un ou plusieurs projets à associer à votre dictionnaire",es:"Seleccione uno o más proyectos para asociar con su diccionario",de:"Wählen Sie ein oder mehrere Projekte aus, um sie mit Ihrem Wörterbuch zu verknüpfen",ja:"辞書に関連付けるプロジェクトを1つ以上選択してください",ko:"사전과 연결할 프로젝트를 하나 이상 선택하세요",zh:"选择一个或多个项目与您的字典关联",it:"Seleziona uno o più progetti da associare al tuo dizionario",pt:"Selecione um ou mais projetos para associar ao seu dicionário",hi:"अपने शब्दकोश से जोड़ने के लिए एक या एक से अधिक प्रोजेक्ट चुनें",ar:"حدد مشروعًا أو أكثر للربط مع قاموسك",ru:"Выберите один или несколько проектов для связывания со словарем"}),j({en:"No dictionary","en-GB":"No dictionary",fr:"Aucun dictionnaire",es:"Sin diccionario",de:"Kein Wörterbuch",ja:"辞書がありません",ko:"사전이 없습니다",zh:"没有字典",it:"Nessun dizionario",pt:"Nenhum dicionário",hi:"कोई शब्दकोश नहीं",ar:"لا يوجد قاموس",ru:"Нет словаря"}),j({en:"Create your first dictionary to start using Intlayer","en-GB":"Create your first dictionary to start using Intlayer",fr:"Créez votre premier dictionnaire pour commencer à utiliser Intlayer",es:"Cree su primer diccionario para comenzar a usar Intlayer",de:"Erstellen Sie Ihr erstes Wörterbuch, um Intlayer zu verwenden",ja:"Intlayerを使用するために最初の辞書を作成してください",ko:"Intlayer를 사용하려면 첫 번째 사전을 만들어주세요",zh:"创建您的第一个字典以开始使用Intlayer",it:"Crea il tuo primo dizionario per iniziare a usare Intlayer",pt:"Crie seu primeiro dicionário para começar a usar o Intlayer",hi:"Intlayer का उपयोग करने के लिए अपना पहला शब्दकोश बनाएं",ar:"أنشئ قاموسك الأول لبدء استخدام Intlayer",ru:"Создайте свой первый словарь, чтобы начать использовать Intlayer"}),j({en:"Dictionary list","en-GB":"Dictionary list",fr:"Liste des dictionnaires",es:"Lista de diccionarios",de:"Wörterbuchliste",ja:"辞書リスト",ko:"사전 목록",zh:"字典列表",it:"Elenco dei dizionari",pt:"Lista de dicionários",hi:"शब्दकोश सूची",ar:"قائمة القاموس",ru:"Список словарей"}),j({en:"No dictionary","en-GB":"No dictionary",fr:"Aucun dictionnaire",es:"Sin diccionario",de:"Kein Wörterbuch",ja:"辞書がありません",ko:"사전이 없습니다",zh:"没有字典",it:"Nessun dizionario",pt:"Nenhum dicionário",hi:"कोई शब्दकोश नहीं",ar:"لا يوجد قاموس",ru:"Нет словаря"}),j({en:"Create your first dictionary to start using Intlayer","en-GB":"Create your first dictionary to start using Intlayer",fr:"Créez votre premier dictionnaire pour commencer à utiliser Intlayer",es:"Cree su primer diccionario para comenzar a usar Intlayer",de:"Erstellen Sie Ihr erstes Wörterbuch, um Intlayer zu verwenden",ja:"Intlayerを使用するために最初の辞書を作成してください",ko:"Intlayer를 사용하려면 첫 번째 사전을 만들어주세요",zh:"创建您的第一个字典以开始使用Intlayer",it:"Crea il tuo primo dizionario per iniziare a usare Intlayer",pt:"Crie seu primeiro dicionário para começar a usar o Intlayer",hi:"Intlayer का उपयोग करने के लिए अपना पहला शब्दकोश बनाएं",ar:"أنشئ قاموسك الأول لبدء استخدام Intlayer",ru:"Создайте свой первый словарь, чтобы начать использовать Intlayer"}),j({en:"Create dictionary","en-GB":"Create dictionary",fr:"Créer un dictionnaire",es:"Crear un diccionario",de:"Wörterbuch erstellen",ja:"辞書を作成",ko:"사전 만들기",zh:"创建字典",it:"Crea dizionario",pt:"Criar dicionário",hi:"शब्दकोश बनाएँ",ar:"إنشاء قاموس",ru:"Создать словарь"}),j({en:"Click to create dictionary","en-GB":"Click to create dictionary",fr:"Cliquez pour créer un dictionnaire",es:"Haga clic para crear un diccionario",de:"Klicken Sie, um ein Wörterbuch zu erstellen",ja:"辞書を作成するにはクリックしてください",ko:"사전을 만들려면 클릭하세요",zh:"点击创建字典",it:"Clicca per creare un dizionario",pt:"Clique para criar dicionário",hi:"शब्दकोश बनाने के लिए क्लिक करें",ar:"انقر لإنشاء قاموس",ru:"Нажмите, чтобы создать словарь"}),j({en:"Edit dictionary","en-GB":"Edit dictionary",fr:"Modifier le dictionnaire",es:"Editar el diccionario",de:"Wörterbuch bearbeiten",ja:"辞書を編集",ko:"사전 편집",zh:"编辑字典",it:"Modifica dizionario",pt:"Editar dicionário",hi:"शब्दकोश संपादित करें",ar:"تعديل القاموس",ru:"Редактировать словарь"}),j({en:"Click to edit","en-GB":"Click to edit",fr:"Cliquez pour modifier",es:"Haga clic para editar",de:"Klicken Sie, um zu bearbeiten",ja:"編集するにはクリックしてください",ko:"편집하려면 클릭하세요",zh:"点击编辑",it:"Clicca per modificare",pt:"Clique para editar",hi:"संपादित करने के लिए क्लिक करें",ar:"انقر لتعديل",ru:"Нажмите, чтобы отредактировать"});j({en:"Please enter a key for your dictionary","en-GB":"Please enter a key for your dictionary",fr:"Veuillez saisir une clef pour votre dictionaire",es:"Por favor, ingrese un clave para su diccionario",de:"Bitte geben Sie einen Schlüssel für Ihr Wörterbuch ein",ja:"辞書のキーを入力してください",ko:"사전 키를 입력해 주세요",zh:"请输入字典的键",it:"Si prega di inserire una chiave per il proprio dizionario",pt:"Por favor, insira uma chave para seu dicionário",hi:"कृपया अपने शब्दकोश के लिए एक कुंजी दर्ज करें",ar:"الرجاء إدخال مفتاح لقاموسك",ru:"Пожалуйста, введите ключ для вашего словаря"}),j({en:"Please enter a valid key for your dictionary","en-GB":"Please enter a valid key for your dictionary",fr:"Veuillez saisir une clée valide pour votre dictionaire",es:"Por favor, ingrese un clave válido para su diccionario",de:"Bitte geben Sie einen gültigen Schlüssel für Ihr Wörterbuch ein",ja:"辞書の有効なキーを入力してください",ko:"유효한 사전 키를 입력해 주세요",zh:"请输入字典的有效键",it:"Si prega di inserire una chiave valida per il proprio dizionario",pt:"Por favor, insira uma chave válida para seu dicionário",hi:"कृपया अपने शब्दकोश के लिए एक मान्य कुंजी दर्ज करें",ar:"الرجاء إدخال مفتاح صالح لقاموسك",ru:"Пожалуйста, введите действительный ключ для вашего словаря"}),j({en:"Please select a project","en-GB":"Please select a project",fr:"Veuillez sélectionner un projet",es:"Por favor, seleccione un proyecto",de:"Bitte wählen Sie ein Projekt aus",ja:"プロジェクトを選択してください",ko:"프로젝트를 선택해 주세요",zh:"请选择一个项目",it:"Si prega di selezionare un progetto",pt:"Por favor, selecione um projeto",hi:"कृपया एक परियोजना चुनें",ar:"الرجاء تحديد مشروع",ru:"Пожалуйста, выберите проект"}),j({en:"Please select a valid project","en-GB":"Please select a valid project",fr:"Veuillez sélectionner un projet valide",es:"Por favor, seleccione un proyecto válido",de:"Bitte wählen Sie ein gültiges Projekt aus",ja:"有効なプロジェクトを選択してください",ko:"유효한 프로젝트를 선택해 주세요",zh:"请选择一个有效的项目",it:"Si prega di selezionare un progetto valido",pt:"Por favor, selecione um projeto válido",hi:"कृपया एक मान्य परियोजना चुनें",ar:"الرجاء تحديد مشروع صالح",ru:"Пожалуйста, выберите действительный проект"});function j3(e){return Array.isArray?Array.isArray(e):tM(e)==="[object Array]"}function RW(e){if(typeof e=="string")return e;let t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function xW(e){return e==null?"":RW(e)}function t3(e){return typeof e=="string"}function JC(e){return typeof e=="number"}function wW(e){return e===!0||e===!1||bW(e)&&tM(e)=="[object Boolean]"}function eM(e){return typeof e=="object"}function bW(e){return eM(e)&&e!==null}function ae(e){return e!=null}function I7(e){return!e.trim().length}function tM(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const TW="Incorrect 'index' type",kW=e=>`Invalid value for key ${e}`,DW=e=>`Pattern length exceeds max of ${e}.`,BW=e=>`Missing ${e} property in key`,LW=e=>`Property 'weight' in key '${e}' must be a positive integer`,tE=Object.prototype.hasOwnProperty;class OW{constructor(t){this._keys=[],this._keyMap={};let a=0;t.forEach(n=>{let r=aM(n);this._keys.push(r),this._keyMap[r.id]=r,a+=r.weight}),this._keys.forEach(n=>{n.weight/=a})}get(t){return this._keyMap[t]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function aM(e){let t=null,a=null,n=null,r=1,s=null;if(t3(e)||j3(e))n=e,t=aE(e),a=V8(e);else{if(!tE.call(e,"name"))throw new Error(BW("name"));const o=e.name;if(n=o,tE.call(e,"weight")&&(r=e.weight,r<=0))throw new Error(LW(o));t=aE(o),a=V8(o),s=e.getFn}return{path:t,id:a,weight:r,src:n,getFn:s}}function aE(e){return j3(e)?e:e.split(".")}function V8(e){return j3(e)?e.join("."):e}function FW(e,t){let a=[],n=!1;const r=(s,o,u)=>{if(ae(s))if(!o[u])a.push(s);else{let d=o[u];const f=s[d];if(!ae(f))return;if(u===o.length-1&&(t3(f)||JC(f)||wW(f)))a.push(xW(f));else if(j3(f)){n=!0;for(let v=0,p=f.length;v<p;v+=1)r(f[v],o,u+1)}else o.length&&r(f,o,u+1)}};return r(e,t3(t)?t.split("."):t,0),n?a:a[0]}const HW={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},PW={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,t)=>e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1},UW={location:0,threshold:.6,distance:100},VW={useExtendedSearch:!1,getFn:FW,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1};var W2={...PW,...HW,...UW,...VW};const GW=/[^ ]+/g;function jW(e=1,t=3){const a=new Map,n=Math.pow(10,t);return{get(r){const s=r.match(GW).length;if(a.has(s))return a.get(s);const o=1/Math.pow(s,.5*e),u=parseFloat(Math.round(o*n)/n);return a.set(s,u),u},clear(){a.clear()}}}class Yd{constructor({getFn:t=W2.getFn,fieldNormWeight:a=W2.fieldNormWeight}={}){this.norm=jW(a,3),this.getFn=t,this.isCreated=!1,this.setIndexRecords()}setSources(t=[]){this.docs=t}setIndexRecords(t=[]){this.records=t}setKeys(t=[]){this.keys=t,this._keysMap={},t.forEach((a,n)=>{this._keysMap[a.id]=n})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,t3(this.docs[0])?this.docs.forEach((t,a)=>{this._addString(t,a)}):this.docs.forEach((t,a)=>{this._addObject(t,a)}),this.norm.clear())}add(t){const a=this.size();t3(t)?this._addString(t,a):this._addObject(t,a)}removeAt(t){this.records.splice(t,1);for(let a=t,n=this.size();a<n;a+=1)this.records[a].i-=1}getValueForItemAtKeyId(t,a){return t[this._keysMap[a]]}size(){return this.records.length}_addString(t,a){if(!ae(t)||I7(t))return;let n={v:t,i:a,n:this.norm.get(t)};this.records.push(n)}_addObject(t,a){let n={i:a,$:{}};this.keys.forEach((r,s)=>{let o=r.getFn?r.getFn(t):this.getFn(t,r.path);if(ae(o)){if(j3(o)){let u=[];const d=[{nestedArrIndex:-1,value:o}];for(;d.length;){const{nestedArrIndex:f,value:v}=d.pop();if(ae(v))if(t3(v)&&!I7(v)){let p={v,i:f,n:this.norm.get(v)};u.push(p)}else j3(v)&&v.forEach((p,A)=>{d.push({nestedArrIndex:A,value:p})})}n.$[s]=u}else if(t3(o)&&!I7(o)){let u={v:o,n:this.norm.get(o)};n.$[s]=u}}}),this.records.push(n)}toJSON(){return{keys:this.keys,records:this.records}}}function nM(e,t,{getFn:a=W2.getFn,fieldNormWeight:n=W2.fieldNormWeight}={}){const r=new Yd({getFn:a,fieldNormWeight:n});return r.setKeys(e.map(aM)),r.setSources(t),r.create(),r}function KW(e,{getFn:t=W2.getFn,fieldNormWeight:a=W2.fieldNormWeight}={}){const{keys:n,records:r}=e,s=new Yd({getFn:t,fieldNormWeight:a});return s.setKeys(n),s.setIndexRecords(r),s}function Js(e,{errors:t=0,currentLocation:a=0,expectedLocation:n=0,distance:r=W2.distance,ignoreLocation:s=W2.ignoreLocation}={}){const o=t/e.length;if(s)return o;const u=Math.abs(n-a);return r?o+u/r:u?1:o}function $W(e=[],t=W2.minMatchCharLength){let a=[],n=-1,r=-1,s=0;for(let o=e.length;s<o;s+=1){let u=e[s];u&&n===-1?n=s:!u&&n!==-1&&(r=s-1,r-n+1>=t&&a.push([n,r]),n=-1)}return e[s-1]&&s-n>=t&&a.push([n,s-1]),a}const za=32;function YW(e,t,a,{location:n=W2.location,distance:r=W2.distance,threshold:s=W2.threshold,findAllMatches:o=W2.findAllMatches,minMatchCharLength:u=W2.minMatchCharLength,includeMatches:d=W2.includeMatches,ignoreLocation:f=W2.ignoreLocation}={}){if(t.length>za)throw new Error(DW(za));const v=t.length,p=e.length,A=Math.max(0,Math.min(n,p));let E=s,_=A;const S=u>1||d,z=S?Array(p):[];let C;for(;(C=e.indexOf(t,_))>-1;){let T=Js(t,{currentLocation:C,expectedLocation:A,distance:r,ignoreLocation:f});if(E=Math.min(T,E),_=C+v,S){let O=0;for(;O<v;)z[C+O]=1,O+=1}}_=-1;let M=[],x=1,D=v+p;const w=1<<v-1;for(let T=0;T<v;T+=1){let O=0,H=D;for(;O<H;)Js(t,{errors:T,currentLocation:A+H,expectedLocation:A,distance:r,ignoreLocation:f})<=E?O=H:D=H,H=Math.floor((D-O)/2+O);D=H;let U=Math.max(1,A-H+1),f2=o?p:Math.min(A+H,p)+v,s2=Array(f2+2);s2[f2+1]=(1<<T)-1;for(let W=f2;W>=U;W-=1){let a2=W-1,V=a[e.charAt(a2)];if(S&&(z[a2]=+!!V),s2[W]=(s2[W+1]<<1|1)&V,T&&(s2[W]|=(M[W+1]|M[W])<<1|1|M[W+1]),s2[W]&w&&(x=Js(t,{errors:T,currentLocation:a2,expectedLocation:A,distance:r,ignoreLocation:f}),x<=E)){if(E=x,_=a2,_<=A)break;U=Math.max(1,2*A-_)}}if(Js(t,{errors:T+1,currentLocation:A,expectedLocation:A,distance:r,ignoreLocation:f})>E)break;M=s2}const b={isMatch:_>=0,score:Math.max(.001,x)};if(S){const T=$W(z,u);T.length?d&&(b.indices=T):b.isMatch=!1}return b}function ZW(e){let t={};for(let a=0,n=e.length;a<n;a+=1){const r=e.charAt(a);t[r]=(t[r]||0)|1<<n-a-1}return t}const lo=String.prototype.normalize?e=>e.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,""):e=>e;class lM{constructor(t,{location:a=W2.location,threshold:n=W2.threshold,distance:r=W2.distance,includeMatches:s=W2.includeMatches,findAllMatches:o=W2.findAllMatches,minMatchCharLength:u=W2.minMatchCharLength,isCaseSensitive:d=W2.isCaseSensitive,ignoreDiacritics:f=W2.ignoreDiacritics,ignoreLocation:v=W2.ignoreLocation}={}){if(this.options={location:a,threshold:n,distance:r,includeMatches:s,findAllMatches:o,minMatchCharLength:u,isCaseSensitive:d,ignoreDiacritics:f,ignoreLocation:v},t=d?t:t.toLowerCase(),t=f?lo(t):t,this.pattern=t,this.chunks=[],!this.pattern.length)return;const p=(E,_)=>{this.chunks.push({pattern:E,alphabet:ZW(E),startIndex:_})},A=this.pattern.length;if(A>za){let E=0;const _=A%za,S=A-_;for(;E<S;)p(this.pattern.substr(E,za),E),E+=za;if(_){const z=A-za;p(this.pattern.substr(z),z)}}else p(this.pattern,0)}searchIn(t){const{isCaseSensitive:a,ignoreDiacritics:n,includeMatches:r}=this.options;if(t=a?t:t.toLowerCase(),t=n?lo(t):t,this.pattern===t){let S={isMatch:!0,score:0};return r&&(S.indices=[[0,t.length-1]]),S}const{location:s,distance:o,threshold:u,findAllMatches:d,minMatchCharLength:f,ignoreLocation:v}=this.options;let p=[],A=0,E=!1;this.chunks.forEach(({pattern:S,alphabet:z,startIndex:C})=>{const{isMatch:M,score:x,indices:D}=YW(t,S,z,{location:s+C,distance:o,threshold:u,findAllMatches:d,minMatchCharLength:f,includeMatches:r,ignoreLocation:v});M&&(E=!0),A+=x,M&&D&&(p=[...p,...D])});let _={isMatch:E,score:E?A/this.chunks.length:1};return E&&r&&(_.indices=p),_}}class Yt{constructor(t){this.pattern=t}static isMultiMatch(t){return nE(t,this.multiRegex)}static isSingleMatch(t){return nE(t,this.singleRegex)}search(){}}function nE(e,t){const a=e.match(t);return a?a[1]:null}class WW extends Yt{constructor(t){super(t)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(t){const a=t===this.pattern;return{isMatch:a,score:a?0:1,indices:[0,this.pattern.length-1]}}}class qW extends Yt{constructor(t){super(t)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(t){const n=t.indexOf(this.pattern)===-1;return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}}class XW extends Yt{constructor(t){super(t)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(t){const a=t.startsWith(this.pattern);return{isMatch:a,score:a?0:1,indices:[0,this.pattern.length-1]}}}class QW extends Yt{constructor(t){super(t)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(t){const a=!t.startsWith(this.pattern);return{isMatch:a,score:a?0:1,indices:[0,t.length-1]}}}class JW extends Yt{constructor(t){super(t)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(t){const a=t.endsWith(this.pattern);return{isMatch:a,score:a?0:1,indices:[t.length-this.pattern.length,t.length-1]}}}class eq extends Yt{constructor(t){super(t)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(t){const a=!t.endsWith(this.pattern);return{isMatch:a,score:a?0:1,indices:[0,t.length-1]}}}class rM extends Yt{constructor(t,{location:a=W2.location,threshold:n=W2.threshold,distance:r=W2.distance,includeMatches:s=W2.includeMatches,findAllMatches:o=W2.findAllMatches,minMatchCharLength:u=W2.minMatchCharLength,isCaseSensitive:d=W2.isCaseSensitive,ignoreDiacritics:f=W2.ignoreDiacritics,ignoreLocation:v=W2.ignoreLocation}={}){super(t),this._bitapSearch=new lM(t,{location:a,threshold:n,distance:r,includeMatches:s,findAllMatches:o,minMatchCharLength:u,isCaseSensitive:d,ignoreDiacritics:f,ignoreLocation:v})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(t){return this._bitapSearch.searchIn(t)}}class iM extends Yt{constructor(t){super(t)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(t){let a=0,n;const r=[],s=this.pattern.length;for(;(n=t.indexOf(this.pattern,a))>-1;)a=n+s,r.push([n,a-1]);const o=!!r.length;return{isMatch:o,score:o?0:1,indices:r}}}const G8=[WW,iM,XW,QW,eq,JW,qW,rM],lE=G8.length,tq=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,aq="|";function nq(e,t={}){return e.split(aq).map(a=>{let n=a.trim().split(tq).filter(s=>s&&!!s.trim()),r=[];for(let s=0,o=n.length;s<o;s+=1){const u=n[s];let d=!1,f=-1;for(;!d&&++f<lE;){const v=G8[f];let p=v.isMultiMatch(u);p&&(r.push(new v(p,t)),d=!0)}if(!d)for(f=-1;++f<lE;){const v=G8[f];let p=v.isSingleMatch(u);if(p){r.push(new v(p,t));break}}}return r})}const lq=new Set([rM.type,iM.type]);class rq{constructor(t,{isCaseSensitive:a=W2.isCaseSensitive,ignoreDiacritics:n=W2.ignoreDiacritics,includeMatches:r=W2.includeMatches,minMatchCharLength:s=W2.minMatchCharLength,ignoreLocation:o=W2.ignoreLocation,findAllMatches:u=W2.findAllMatches,location:d=W2.location,threshold:f=W2.threshold,distance:v=W2.distance}={}){this.query=null,this.options={isCaseSensitive:a,ignoreDiacritics:n,includeMatches:r,minMatchCharLength:s,findAllMatches:u,ignoreLocation:o,location:d,threshold:f,distance:v},t=a?t:t.toLowerCase(),t=n?lo(t):t,this.pattern=t,this.query=nq(this.pattern,this.options)}static condition(t,a){return a.useExtendedSearch}searchIn(t){const a=this.query;if(!a)return{isMatch:!1,score:1};const{includeMatches:n,isCaseSensitive:r,ignoreDiacritics:s}=this.options;t=r?t:t.toLowerCase(),t=s?lo(t):t;let o=0,u=[],d=0;for(let f=0,v=a.length;f<v;f+=1){const p=a[f];u.length=0,o=0;for(let A=0,E=p.length;A<E;A+=1){const _=p[A],{isMatch:S,indices:z,score:C}=_.search(t);if(S){if(o+=1,d+=C,n){const M=_.constructor.type;lq.has(M)?u=[...u,...z]:u.push(z)}}else{d=0,o=0,u.length=0;break}}if(o){let A={isMatch:!0,score:d/o};return n&&(A.indices=u),A}}return{isMatch:!1,score:1}}}const j8=[];function iq(...e){j8.push(...e)}function K8(e,t){for(let a=0,n=j8.length;a<n;a+=1){let r=j8[a];if(r.condition(e,t))return new r(e,t)}return new lM(e,t)}const ro={AND:"$and",OR:"$or"},$8={PATH:"$path",PATTERN:"$val"},Y8=e=>!!(e[ro.AND]||e[ro.OR]),sq=e=>!!e[$8.PATH],cq=e=>!j3(e)&&eM(e)&&!Y8(e),rE=e=>({[ro.AND]:Object.keys(e).map(t=>({[t]:e[t]}))});function sM(e,t,{auto:a=!0}={}){const n=r=>{let s=Object.keys(r);const o=sq(r);if(!o&&s.length>1&&!Y8(r))return n(rE(r));if(cq(r)){const d=o?r[$8.PATH]:s[0],f=o?r[$8.PATTERN]:r[d];if(!t3(f))throw new Error(kW(d));const v={keyId:V8(d),pattern:f};return a&&(v.searcher=K8(f,t)),v}let u={children:[],operator:s[0]};return s.forEach(d=>{const f=r[d];j3(f)&&f.forEach(v=>{u.children.push(n(v))})}),u};return Y8(e)||(e=rE(e)),n(e)}function oq(e,{ignoreFieldNorm:t=W2.ignoreFieldNorm}){e.forEach(a=>{let n=1;a.matches.forEach(({key:r,norm:s,score:o})=>{const u=r?r.weight:null;n*=Math.pow(o===0&&u?Number.EPSILON:o,(u||1)*(t?1:s))}),a.score=n})}function uq(e,t){const a=e.matches;t.matches=[],ae(a)&&a.forEach(n=>{if(!ae(n.indices)||!n.indices.length)return;const{indices:r,value:s}=n;let o={indices:r,value:s};n.key&&(o.key=n.key.src),n.idx>-1&&(o.refIndex=n.idx),t.matches.push(o)})}function hq(e,t){t.score=e.score}function dq(e,t,{includeMatches:a=W2.includeMatches,includeScore:n=W2.includeScore}={}){const r=[];return a&&r.push(uq),n&&r.push(hq),e.map(s=>{const{idx:o}=s,u={item:t[o],refIndex:o};return r.length&&r.forEach(d=>{d(s,u)}),u})}class x4{constructor(t,a={},n){this.options={...W2,...a},this.options.useExtendedSearch,this._keyStore=new OW(this.options.keys),this.setCollection(t,n)}setCollection(t,a){if(this._docs=t,a&&!(a instanceof Yd))throw new Error(TW);this._myIndex=a||nM(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(t){ae(t)&&(this._docs.push(t),this._myIndex.add(t))}remove(t=()=>!1){const a=[];for(let n=0,r=this._docs.length;n<r;n+=1){const s=this._docs[n];t(s,n)&&(this.removeAt(n),n-=1,r-=1,a.push(s))}return a}removeAt(t){this._docs.splice(t,1),this._myIndex.removeAt(t)}getIndex(){return this._myIndex}search(t,{limit:a=-1}={}){const{includeMatches:n,includeScore:r,shouldSort:s,sortFn:o,ignoreFieldNorm:u}=this.options;let d=t3(t)?t3(this._docs[0])?this._searchStringList(t):this._searchObjectList(t):this._searchLogical(t);return oq(d,{ignoreFieldNorm:u}),s&&d.sort(o),JC(a)&&a>-1&&(d=d.slice(0,a)),dq(d,this._docs,{includeMatches:n,includeScore:r})}_searchStringList(t){const a=K8(t,this.options),{records:n}=this._myIndex,r=[];return n.forEach(({v:s,i:o,n:u})=>{if(!ae(s))return;const{isMatch:d,score:f,indices:v}=a.searchIn(s);d&&r.push({item:s,idx:o,matches:[{score:f,value:s,norm:u,indices:v}]})}),r}_searchLogical(t){const a=sM(t,this.options),n=(u,d,f)=>{if(!u.children){const{keyId:p,searcher:A}=u,E=this._findMatches({key:this._keyStore.get(p),value:this._myIndex.getValueForItemAtKeyId(d,p),searcher:A});return E&&E.length?[{idx:f,item:d,matches:E}]:[]}const v=[];for(let p=0,A=u.children.length;p<A;p+=1){const E=u.children[p],_=n(E,d,f);if(_.length)v.push(..._);else if(u.operator===ro.AND)return[]}return v},r=this._myIndex.records,s={},o=[];return r.forEach(({$:u,i:d})=>{if(ae(u)){let f=n(a,u,d);f.length&&(s[d]||(s[d]={idx:d,item:u,matches:[]},o.push(s[d])),f.forEach(({matches:v})=>{s[d].matches.push(...v)}))}}),o}_searchObjectList(t){const a=K8(t,this.options),{keys:n,records:r}=this._myIndex,s=[];return r.forEach(({$:o,i:u})=>{if(!ae(o))return;let d=[];n.forEach((f,v)=>{d.push(...this._findMatches({key:f,value:o[v],searcher:a}))}),d.length&&s.push({idx:u,item:o,matches:d})}),s}_findMatches({key:t,value:a,searcher:n}){if(!ae(a))return[];let r=[];if(j3(a))a.forEach(({v:s,i:o,n:u})=>{if(!ae(s))return;const{isMatch:d,score:f,indices:v}=n.searchIn(s);d&&r.push({score:f,key:t,value:s,idx:o,norm:u,indices:v})});else{const{v:s,n:o}=a,{isMatch:u,score:d,indices:f}=n.searchIn(s);u&&r.push({score:d,key:t,value:s,norm:o,indices:f})}return r}}x4.version="7.1.0";x4.createIndex=nM;x4.parseIndex=KW;x4.config=W2;x4.parseQuery=sM;iq(rq);const or=({children:e,className:t,identifier:a,...n})=>I.jsx("div",{className:C2("group/dropdown relative flex",t),"aria-label":`DropDown ${a}`,id:`unrollable-panel-button-${a}`,"aria-haspopup":!0,...n,children:e}),fq=({children:e,identifier:t,className:a,...n})=>I.jsx("button",{className:C2("w-full cursor-pointer",a),"aria-label":`Open panel ${t}`,...n,children:e}),mq=({children:e,isHidden:t=void 0,isOverable:a=!1,isFocusable:n=!1,align:r="start",identifier:s,className:o,...u})=>I.jsx("div",{className:C2("absolute top-[calc(100%+0.5rem)] z-[1000] min-w-full",r==="start"&&"left-0",r==="end"&&"right-0",o),"aria-hidden":t,role:"region","aria-labelledby":`unrollable-panel-button-${s}`,id:`unrollable-panel-${s}`,children:I.jsx(CN,{isHidden:t,className:C2("overflow-x-visible",t!==!1?"invisible":"visible",a&&"group-hover/dropdown:visible group-hover/dropdown:grid-rows-[1fr]",n&&"group-focus-within/dropdown:visible group-focus-within/dropdown:grid-rows-[1fr]"),...u,children:e})});or.Trigger=fq;or.Panel=mq;const vq={key:"locale-switcher-content",content:{localeSwitcherLabel:j({en:"Language switcher","en-GB":"Language switcher",fr:"Changer de langue",es:"Cambiar idioma",de:"Sprachwechsler",ja:"言語スイッチャー",ko:"언어 스위치",zh:"语言切换器",it:"Cambia lingua",pt:"Mudar idioma",hi:"भाषा स्विचर",ar:"مبدل اللغة",ru:"Переключатель языка"}),languageListLabel:j({en:"Language list","en-GB":"Language list",fr:"Liste des langues",es:"Lista de idiomas",de:"Sprachliste",ja:"言語リスト",ko:"언어 목록",zh:"语言列表",it:"Elenco lingue",pt:"Lista de idiomas",hi:"भाषा सूची",ar:"قائمة اللغات",ru:"Список языков"}),switchTo:j({en:"Switch to",fr:"Passer à",es:"Cambiar a","en-GB":"Switch to",de:"Wechseln Sie zu",ja:"に切り替える",ko:"전환",zh:"切换到",it:"Passa a",pt:"Mudar para",hi:"स्विच करें",ar:"التبديل إلى",ru:"Переключиться на"}),searchInput:{text:j({en:"Search Locale","en-GB":"Search Locale",fr:"Rechercher la locale",es:"Buscar idioma",de:"Sprache durchsuchen",ja:"ロケールを検索",ko:"언어 검색",zh:"搜索语言",it:"Cerca lingua",pt:"Pesquisar idioma",hi:"भाषा खोजें",ar:"بحث اللغة",ru:"Поиск языка"}),placeholder:j({en:"Search a locale","en-GB":"Search a locale",fr:"Rechercher une locale",es:"Buscar un idioma",de:"Sprache suchen",ja:"ロケールを検索",ko:"언어 검색",zh:"搜索语言",it:"Cerca una lingua",pt:"Pesquisar um idioma",hi:"भाषा खोजें",ar:"بحث اللغة",ru:"Поиск языка"})},seeAllLocalesSwitch:{true:j({en:"See all locales","en-GB":"See all locales",fr:"Voir toutes les langues",es:"Ver todos los idiomas",de:"Alle Sprachen anzeigen",ja:"すべての言語を表示",ko:"모든 언어 보기",zh:"查看所有语言",it:"Vedi tutte le lingue",pt:"Ver todos os idiomas",hi:"सभी भाषाओं को देखें",ar:"عرض جميع اللغات",ru:"Показать все языки"}),false:j({en:"See only selected locales","en-GB":"See only selected locales",fr:"Voir seulement les langues sélectionnées",es:"Ver solo los idiomas seleccionados",de:"Nur ausgewählte Sprachen anzeigen",ja:"選択された言語のみを表示",ko:"선택한 언어만 보기",zh:"仅查看选定的语言",it:"Vedi solo le lingue selezionate",pt:"Ver apenas os idiomas selecionados",hi:"केवल चुने गए भाषाओं को देखें",ar:"عرض اللغات المحددة فقط",ru:"Показать только выбранные языки"})}}},ur=(e,t)=>{const[a,n]=y.useState(()=>{if(t!==void 0){const s=typeof t=="function"?t():t;if(typeof window>"u")return s;const o=localStorage==null?void 0:localStorage.getItem(e);if(o)try{return JSON.parse(o)}catch(u){console.error(u)}return s}});y.useEffect(()=>{const s=localStorage==null?void 0:localStorage.getItem(e);if(s&&a===void 0)try{n(JSON.parse(s))}catch(o){console.error(o)}else t!==void 0&&a===void 0&&n(t)},[e,a]);const r=y.useCallback(s=>{n(o=>{const u=typeof s=="function"?s(o):s;return localStorage==null||localStorage.setItem(e,JSON.stringify(u)),u})},[e,n]);return y.useMemo(()=>[a,r],[a,r])},cM=y.createContext({availableLocales:[],selectedLocales:[],setSelectedLocales:()=>{}}),oM=()=>y.useContext(cM),pq=({availableLocales:e,defaultSelectedLocales:t,children:a})=>{const{locale:n}=yh(),[r,s]=ur("locale-content-selector-selected-locales",t??[n]);return I.jsx(cM,{value:{availableLocales:e,selectedLocales:r,setSelectedLocales:s},children:a})},N7="locale-switcher-content",Aq=({panelProps:e,isMultilingual:t=!0})=>{const{switchTo:a,searchInput:n,localeSwitcherLabel:r,languageListLabel:s,seeAllLocalesSwitch:o}=d1(vq),u=y.useRef(null),{locale:d}=yh(),{availableLocales:f,selectedLocales:v,setSelectedLocales:p}=oM(),A=y.useMemo(()=>f.map(w=>{const b=mc(w,l.ENGLISH),T=mc(w,d),O=mc(w);return{locale:w,englishName:b,currentLocaleName:T,ownLocaleName:O}}),[f,d]),[E,_]=y.useState(A),[S,z]=ur("locale-content-selector-see-all-locales",!1),C=y.useMemo(()=>{const w={keys:[{name:"ownLocaleName",weight:.4},{name:"englishName",weight:.2},{name:"currentLocaleName",weight:.2},{name:"locale",weight:.2}],threshold:.02};return new x4(A,w)},[A]),M=y.useCallback(w=>{if(w){const b=C.search(w).map(T=>T.item);_(b)}else _(A)},[C,A]),x=w=>{t?v.includes(w)?v.length>1&&p(b=>b.filter(T=>T!==w)):p(b=>[...b,w]):p([w])},D=w=>{z(w),p(w?f:[d])};return I.jsx("div",{className:"border-text text-text rounded-xl border transition-colors","aria-label":r.value,children:I.jsxs(or,{identifier:N7,children:[I.jsx(or.Trigger,{identifier:N7,children:I.jsxs("div",{className:"flex w-full items-center justify-between",children:[I.jsx("div",{className:"px-2 py-1",children:I.jsx(NL,{size:18})}),I.jsx(yL,{className:"self-center",size:18})]})}),I.jsx(or.Panel,{identifier:N7,isOverable:!0,isFocusable:!0,className:"left-auto right-0",...e,children:I.jsxs(d3,{className:"max-h-[80vh] min-w-28",separator:"y",role:"listbox",transparency:"sm",border:!0,roundedSize:"2xl",borderColor:"text","aria-label":s.value,children:[t&&I.jsx("div",{className:"m-auto p-2",children:I.jsx(ci,{defaultValue:!1,onChange:D,color:"text",size:"sm",className:"!w-60",choices:[{content:o.true.value,value:!0},{content:o.false.value,value:!1}]})}),!(t&&S)&&I.jsxs(I.Fragment,{children:[I.jsx("div",{className:"p-3",children:I.jsx(N4,{type:"search",placeholder:n.placeholder.value,onChange:w=>M(w.target.value),ref:u})}),I.jsx("ol",{className:"divide-text/20 divide-y divide-dashed overflow-y-auto p-1",children:E.map(({locale:w,currentLocaleName:b,ownLocaleName:T})=>I.jsx("li",{className:"px-1.5 py-1",children:I.jsx(_0,{onClick:()=>x(w),label:`${a} ${b}`,disabled:!(f??f).includes(w),isActive:v.includes(w),variant:"hoverable",color:"text",isFullWidth:!0,textAlign:"left",size:"sm",children:I.jsxs("div",{className:"flex flex-row items-center justify-between gap-3 px-2 py-1",children:[t&&I.jsx("div",{className:"w-4",children:v.includes(w)&&I.jsx(I4,{className:"size-full"})}),I.jsxs("div",{className:"flex flex-1 flex-row items-center justify-between gap-3 px-2 py-1",children:[I.jsxs("div",{className:"flex flex-col text-nowrap",children:[I.jsx("span",{dir:kT(w),lang:w,children:T}),I.jsx("span",{className:"text-neutral text-xs",children:b})]}),I.jsx("span",{className:"text-neutral text-sm",children:w.toUpperCase()})]})]})})},w))})]})]})})]})})},gq=(e,t,a)=>{const n={...e};for(const r of Object.keys(e))r===t?(n[a]=e[t],delete n[t]):n[r]=e[r];return n},Z8=({children:e,onContentChange:t,disabled:a,validate:n,additionalButtons:r,...s})=>{const[o,u]=y.useState(e),[d,f]=y.useState(0),v=o!==e,p=()=>{u(e),f(S=>S+1)},A=()=>{t(o)},E=S=>{u(S.currentTarget.value)};y.useEffect(()=>{u(e)},[e]);const _=(n==null?void 0:n(o))??!0;return I.jsxs("div",{className:"flex size-full flex-col items-center justify-between gap-2",children:[I.jsx(N4,{onChange:E,variant:"invisible",className:"size-full",defaultValue:e,...s},d),(v||r)&&I.jsxs("div",{className:"flex w-full items-center justify-end gap-2",children:[v&&I.jsxs(I.Fragment,{children:[I.jsx(_0,{Icon:I4,label:"Validate",variant:"hoverable",color:"text",size:"icon-sm",className:"cursor-pointer hover:scale-110",disabled:a||!_,onClick:A}),I.jsx(_0,{Icon:Ya,label:"Cancel",variant:"hoverable",size:"icon-sm",color:"text",className:"cursor-pointer hover:scale-110",onClick:p})]}),r]})]},String(e))},Eq=(e,t)=>{const[a,n]=y.useState(e);return y.useEffect(()=>{const r=setTimeout(()=>{n(e)},t);return()=>clearTimeout(r)},[e,t]),a},_q=({isActive:e=!0,suggestion:t,...a})=>{const n=String(a.value??a.defaultValue??""),{autocomplete:r}=xF(),s=u3(),[o,u]=y.useState(!1),[d,f]=y.useState(n),[v,p]=y.useState(""),A=Eq(d,200);y.useEffect(()=>{typeof a.value>"u"||f(n)},[a.value,a.defaultValue]),y.useEffect(()=>{if(!e||!o)return;const _=async()=>{var S;try{const z=await r({text:A,openAiApiKey:s.editor.openAiApiKey,model:s.editor.openAiApiModel,temperature:s.editor.openAiApiTemperature}),C=((S=z==null?void 0:z.data)==null?void 0:S.autocompletion)??"";if(C.startsWith(A)){const M=C.slice(A.length);return p(M)}return p(C)}catch(z){console.error("Autocomplete error:",z)}};A.length>3?(p(""),_()):p("")},[A,e]);const E=()=>{f(_=>_+v),p("")};return I.jsxs("div",{className:"relative w-full",children:[I.jsxs("div",{className:"pointer-events-none absolute inset-0 whitespace-pre-wrap break-words px-1 py-3 text-base leading-[1.45rem] md:py-1 md:text-sm md:leading-[1.23rem]","aria-hidden":"true",children:[I.jsx("span",{className:"align-text-top text-transparent",children:d}),(v||t)&&I.jsx("span",{className:"text-neutral ml-3 align-text-top",children:t??v})]}),I.jsx($h,{...a,value:d,onChange:_=>{var S;u(!0),f(_.target.value),(S=a.onChange)==null||S.call(a,_)},onKeyDown:_=>{var S;_.key==="Tab"&&v&&(_.preventDefault(),E()),(S=a.onKeyDown)==null||S.call(a,_)}})]})},Iq=()=>{const{session:e,revalidateSession:t,setSession:a}=ei(),{logout:n}=NF(),r=e!=null&&e.user?"authenticated":"unauthenticated",s=r==="authenticated",o=r==="unauthenticated",u=e==null?void 0:e.user;return{isAuthenticated:s,isUnauthenticated:o,user:u,revalidateSession:t,logout:async()=>{a(null),await n()}}},Nq=({children:e,onContentChange:t,disabled:a,validate:n,additionalButtons:r,...s})=>{const{isAuthenticated:o}=Iq(),[u,d]=y.useState(e),[f,v]=y.useState(0),p=u!==e,A=()=>{d(e),v(z=>z+1)},E=()=>{t(u)},_=z=>d(z.currentTarget.value??"");y.useEffect(()=>{d(e)},[e]);const S=(n==null?void 0:n(u))??!0;return I.jsxs("div",{className:"flex size-full flex-col items-center justify-between gap-2",children:[I.jsx(_q,{onChange:_,variant:"invisible",className:"size-full",defaultValue:e,isActive:o,...s},f),(p||r)&&I.jsxs("div",{className:"flex w-full items-center justify-end gap-2",children:[p&&I.jsxs(I.Fragment,{children:[I.jsx(_0,{Icon:I4,label:"Validate",variant:"hoverable",color:"text",size:"icon-sm",className:"cursor-pointer hover:scale-110",disabled:a||!S,onClick:E}),I.jsx(_0,{Icon:Ya,label:"Cancel",variant:"hoverable",size:"icon-sm",color:"text",className:"cursor-pointer hover:scale-110",onClick:A})]}),r]})]},e)};function Ca(){return Ca=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},Ca.apply(this,arguments)}const Sq=["children","options"],K2={blockQuote:"0",breakLine:"1",breakThematic:"2",codeBlock:"3",codeFenced:"4",codeInline:"5",footnote:"6",footnoteReference:"7",gfmTask:"8",heading:"9",headingSetext:"10",htmlBlock:"11",htmlComment:"12",htmlSelfClosing:"13",image:"14",link:"15",linkAngleBraceStyleDetector:"16",linkBareUrlDetector:"17",linkMailtoDetector:"18",newlineCoalescer:"19",orderedList:"20",paragraph:"21",ref:"22",refImage:"23",refLink:"24",table:"25",text:"27",textBolded:"28",textEmphasized:"29",textEscaped:"30",textMarked:"31",textStrikethroughed:"32",unorderedList:"33"};var iE;(function(e){e[e.MAX=0]="MAX",e[e.HIGH=1]="HIGH",e[e.MED=2]="MED",e[e.LOW=3]="LOW",e[e.MIN=4]="MIN"})(iE||(iE={}));const sE=["allowFullScreen","allowTransparency","autoComplete","autoFocus","autoPlay","cellPadding","cellSpacing","charSet","classId","colSpan","contentEditable","contextMenu","crossOrigin","encType","formAction","formEncType","formMethod","formNoValidate","formTarget","frameBorder","hrefLang","inputMode","keyParams","keyType","marginHeight","marginWidth","maxLength","mediaGroup","minLength","noValidate","radioGroup","readOnly","rowSpan","spellCheck","srcDoc","srcLang","srcSet","tabIndex","useMap"].reduce((e,t)=>(e[t.toLowerCase()]=t,e),{class:"className",for:"htmlFor"}),cE={amp:"&",apos:"'",gt:">",lt:"<",nbsp:" ",quot:"“"},yq=["style","script"],zq=/([-A-Z0-9_:]+)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|(?:\{((?:\\.|{[^}]*?}|[^}])*)\})))?/gi,Cq=/mailto:/i,Mq=/\n{2,}$/,uM=/^(\s*>[\s\S]*?)(?=\n\n|$)/,Rq=/^ *> ?/gm,xq=/^(?:\[!([^\]]*)\]\n)?([\s\S]*)/,wq=/^ {2,}\n/,bq=/^(?:( *[-*_])){3,} *(?:\n *)+\n/,hM=/^(?: {1,3})?(`{3,}|~{3,}) *(\S+)? *([^\n]*?)?\n([\s\S]*?)(?:\1\n?|$)/,dM=/^(?: {4}[^\n]+\n*)+(?:\n *)+\n?/,Tq=/^(`+)((?:\\`|[^`])+)\1/,kq=/^(?:\n *)*\n/,Dq=/\r\n?/g,Bq=/^\[\^([^\]]+)](:(.*)((\n+ {4,}.*)|(\n(?!\[\^).+))*)/,Lq=/^\[\^([^\]]+)]/,Oq=/\f/g,Fq=/^---[ \t]*\n(.|\n)*\n---[ \t]*\n/,Hq=/^\s*?\[(x|\s)\]/,fM=/^ *(#{1,6}) *([^\n]+?)(?: +#*)?(?:\n *)*(?:\n|$)/,mM=/^ *(#{1,6}) +([^\n]+?)(?: +#*)?(?:\n *)*(?:\n|$)/,vM=/^([^\n]+)\n *(=|-){3,} *(?:\n *)+\n/,W8=/^ *(?!<[a-z][^ >/]* ?\/>)<([a-z][^ >/]*) ?((?:[^>]*[^/])?)>\n?(\s*(?:<\1[^>]*?>[\s\S]*?<\/\1>|(?!<\1\b)[\s\S])*?)<\/\1>(?!<\/\1>)\n*/i,Pq=/&([a-z0-9]+|#[0-9]{1,6}|#x[0-9a-fA-F]{1,6});/gi,pM=/^<!--[\s\S]*?(?:-->)/,Uq=/^(data|aria|x)-[a-z_][a-z\d_.-]*$/,q8=/^ *<([a-z][a-z0-9:]*)(?:\s+((?:<.*?>|[^>])*))?\/?>(?!<\/\1>)(\s*\n)?/i,Vq=/^\{.*\}$/,Gq=/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,jq=/^<([^ >]+@[^ >]+)>/,Kq=/^<([^ >]+:\/[^ >]+)>/,$q=/-([a-z])?/gi,AM=/^(\|.*)\n(?: *(\|? *[-:]+ *\|[-| :]*)\n((?:.*\|.*\n)*))?\n?/,Yq=/^\[([^\]]*)\]:\s+<?([^\s>]+)>?\s*("([^"]*)")?/,Zq=/^!\[([^\]]*)\] ?\[([^\]]*)\]/,Wq=/^\[([^\]]*)\] ?\[([^\]]*)\]/,qq=/(\n|^[-*]\s|^#|^ {2,}|^-{2,}|^>\s)/,Xq=/\t/g,Qq=/(^ *\||\| *$)/g,Jq=/^ *:-+: *$/,eX=/^ *:-+ *$/,tX=/^ *-+: *$/,nu="((?:\\[.*?\\][([].*?[)\\]]|<.*?>(?:.*?<.*?>)?|`.*?`|\\\\\\1|[\\s\\S])+?)",aX=new RegExp(`^([*_])\\1${nu}\\1\\1(?!\\1)`),nX=new RegExp(`^([*_])${nu}\\1(?!\\1)`),lX=new RegExp(`^(==)${nu}\\1`),rX=new RegExp(`^(~~)${nu}\\1`),iX=/^\\([^0-9A-Za-z\s])/,S7=/\\([^0-9A-Za-z\s])/g,sX=/^([\s\S](?:(?! |[0-9]\.)[^*_~\-\n<`\\\[!])*)/,cX=/^\n+/,oX=/^([ \t]*)/,uX=/\\([^\\])/g,hX=/(?:^|\n)( *)$/,Zd="(?:\\d+\\.)",Wd="(?:[*+-])";function gM(e){return"( *)("+(e===1?Zd:Wd)+") +"}const EM=gM(1),_M=gM(2);function IM(e){return new RegExp("^"+(e===1?EM:_M))}const dX=IM(1),fX=IM(2);function NM(e){return new RegExp("^"+(e===1?EM:_M)+"[^\\n]*(?:\\n(?!\\1"+(e===1?Zd:Wd)+" )[^\\n]*)*(\\n|$)","gm")}const mX=NM(1),vX=NM(2);function SM(e){const t=e===1?Zd:Wd;return new RegExp("^( *)("+t+") [\\s\\S]+?(?:\\n{2,}(?! )(?!\\1"+t+" (?!"+t+" ))\\n*|\\s*\\n*$)")}const yM=SM(1),zM=SM(2);function oE(e,t){const a=t===1,n=a?yM:zM,r=a?mX:vX,s=a?dX:fX;return{match:f4(function(o,u){const d=hX.exec(u.prevCapture);return d&&(u.list||!u.inline&&!u.simple)?n.exec(o=d[1]+o):null}),order:1,parse(o,u,d){const f=a?+o[2]:void 0,v=o[0].replace(Mq,`
267
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return y.useEffect(()=>{e&&(document.getElementById(e)||console.error(a))},[a,e]),null},mP="DialogDescriptionWarning",vP=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${ly(mP).contentName}}.`;return y.useEffect(()=>{var s;const r=(s=e.current)==null?void 0:s.getAttribute("aria-describedby");t&&r&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},pP=ZS,AP=XS,gP=QS,EP=JS,CA=1,_P=.9,IP=.8,NP=.17,a7=.1,n7=.999,SP=.9999,yP=.99,zP=/[\\\/_+.#"@\[\(\{&]/,CP=/[\\\/_+.#"@\[\(\{&]/g,MP=/[\s-]/,ry=/[\s-]/g;function d8(e,t,a,n,r,s,o){if(s===t.length)return r===e.length?CA:yP;var u=`${r},${s}`;if(o[u]!==void 0)return o[u];for(var d=n.charAt(s),f=a.indexOf(d,r),v=0,p,A,E,_;f>=0;)p=d8(e,t,a,n,f+1,s+1,o),p>v&&(f===r?p*=CA:zP.test(e.charAt(f-1))?(p*=IP,E=e.slice(r,f-1).match(CP),E&&r>0&&(p*=Math.pow(n7,E.length))):MP.test(e.charAt(f-1))?(p*=_P,_=e.slice(r,f-1).match(ry),_&&r>0&&(p*=Math.pow(n7,_.length))):(p*=NP,r>0&&(p*=Math.pow(n7,f-r))),e.charAt(f)!==t.charAt(s)&&(p*=SP)),(p<a7&&a.charAt(f-1)===n.charAt(s+1)||n.charAt(s+1)===n.charAt(s)&&a.charAt(f-1)!==n.charAt(s))&&(A=d8(e,t,a,n,f+1,s+2,o),A*a7>p&&(p=A*a7)),p>v&&(v=p),f=a.indexOf(d,f+1);return o[u]=v,v}function MA(e){return e.toLowerCase().replace(ry," ")}function RP(e,t,a){return e=a&&a.length>0?`${e+" "+a.join(" ")}`:e,d8(e,t,MA(e),MA(t),0,0,{})}var xP=TN(),Pl='[cmdk-group=""]',l7='[cmdk-group-items=""]',wP='[cmdk-group-heading=""]',Jh='[cmdk-item=""]',RA=`${Jh}:not([aria-disabled="true"])`,f8="cmdk-item-select",ya="data-value",bP=(e,t,a)=>RP(e,t,a),iy=y.createContext(void 0),li=()=>y.useContext(iy),sy=y.createContext(void 0),ed=()=>y.useContext(sy),cy=y.createContext(void 0),oy=y.forwardRef((e,t)=>{let a=Un(()=>{var K,l2;return{search:"",value:(l2=(K=e.value)!=null?K:e.defaultValue)!=null?l2:"",filtered:{count:0,items:new Map,groups:new Set}}}),n=Un(()=>new Set),r=Un(()=>new Map),s=Un(()=>new Map),o=Un(()=>new Set),u=uy(e),{label:d,children:f,value:v,onValueChange:p,filter:A,shouldFilter:E,loop:_,disablePointerSelection:S=!1,vimBindings:z=!0,...C}=e,M=Ce(),x=Ce(),D=Ce(),w=y.useRef(null),b=VP();Oa(()=>{if(v!==void 0){let K=v.trim();a.current.value=K,T.emit()}},[v]),Oa(()=>{b(6,h2)},[]);let T=y.useMemo(()=>({subscribe:K=>(o.current.add(K),()=>o.current.delete(K)),snapshot:()=>a.current,setState:(K,l2,n2)=>{var d2,g2,A2;if(!Object.is(a.current[K],l2)){if(a.current[K]=l2,K==="search")s2(),U(),b(1,f2);else if(K==="value"&&(n2||b(5,h2),((d2=u.current)==null?void 0:d2.value)!==void 0)){let z2=l2??"";(A2=(g2=u.current).onValueChange)==null||A2.call(g2,z2);return}T.emit()}},emit:()=>{o.current.forEach(K=>K())}}),[]),O=y.useMemo(()=>({value:(K,l2,n2)=>{var d2;l2!==((d2=s.current.get(K))==null?void 0:d2.value)&&(s.current.set(K,{value:l2,keywords:n2}),a.current.filtered.items.set(K,H(l2,n2)),b(2,()=>{U(),T.emit()}))},item:(K,l2)=>(n.current.add(K),l2&&(r.current.has(l2)?r.current.get(l2).add(K):r.current.set(l2,new Set([K]))),b(3,()=>{s2(),U(),a.current.value||f2(),T.emit()}),()=>{s.current.delete(K),n.current.delete(K),a.current.filtered.items.delete(K);let n2=W();b(4,()=>{s2(),(n2==null?void 0:n2.getAttribute("id"))===K&&f2(),T.emit()})}),group:K=>(r.current.has(K)||r.current.set(K,new Set),()=>{s.current.delete(K),r.current.delete(K)}),filter:()=>u.current.shouldFilter,label:d||e["aria-label"],getDisablePointerSelection:()=>u.current.disablePointerSelection,listId:M,inputId:D,labelId:x,listInnerRef:w}),[]);function H(K,l2){var n2,d2;let g2=(d2=(n2=u.current)==null?void 0:n2.filter)!=null?d2:bP;return K?g2(K,a.current.search,l2):0}function U(){if(!a.current.search||u.current.shouldFilter===!1)return;let K=a.current.filtered.items,l2=[];a.current.filtered.groups.forEach(d2=>{let g2=r.current.get(d2),A2=0;g2.forEach(z2=>{let Y2=K.get(z2);A2=Math.max(Y2,A2)}),l2.push([d2,A2])});let n2=w.current;a2().sort((d2,g2)=>{var A2,z2;let Y2=d2.getAttribute("id"),L2=g2.getAttribute("id");return((A2=K.get(L2))!=null?A2:0)-((z2=K.get(Y2))!=null?z2:0)}).forEach(d2=>{let g2=d2.closest(l7);g2?g2.appendChild(d2.parentElement===g2?d2:d2.closest(`${l7} > *`)):n2.appendChild(d2.parentElement===n2?d2:d2.closest(`${l7} > *`))}),l2.sort((d2,g2)=>g2[1]-d2[1]).forEach(d2=>{var g2;let A2=(g2=w.current)==null?void 0:g2.querySelector(`${Pl}[${ya}="${encodeURIComponent(d2[0])}"]`);A2==null||A2.parentElement.appendChild(A2)})}function f2(){let K=a2().find(n2=>n2.getAttribute("aria-disabled")!=="true"),l2=K==null?void 0:K.getAttribute(ya);T.setState("value",l2||void 0)}function s2(){var K,l2,n2,d2;if(!a.current.search||u.current.shouldFilter===!1){a.current.filtered.count=n.current.size;return}a.current.filtered.groups=new Set;let g2=0;for(let A2 of n.current){let z2=(l2=(K=s.current.get(A2))==null?void 0:K.value)!=null?l2:"",Y2=(d2=(n2=s.current.get(A2))==null?void 0:n2.keywords)!=null?d2:[],L2=H(z2,Y2);a.current.filtered.items.set(A2,L2),L2>0&&g2++}for(let[A2,z2]of r.current)for(let Y2 of z2)if(a.current.filtered.items.get(Y2)>0){a.current.filtered.groups.add(A2);break}a.current.filtered.count=g2}function h2(){var K,l2,n2;let d2=W();d2&&(((K=d2.parentElement)==null?void 0:K.firstChild)===d2&&((n2=(l2=d2.closest(Pl))==null?void 0:l2.querySelector(wP))==null||n2.scrollIntoView({block:"nearest"})),d2.scrollIntoView({block:"nearest"}))}function W(){var K;return(K=w.current)==null?void 0:K.querySelector(`${Jh}[aria-selected="true"]`)}function a2(){var K;return Array.from(((K=w.current)==null?void 0:K.querySelectorAll(RA))||[])}function V(K){let l2=a2()[K];l2&&T.setState("value",l2.getAttribute(ya))}function t2(K){var l2;let n2=W(),d2=a2(),g2=d2.findIndex(z2=>z2===n2),A2=d2[g2+K];(l2=u.current)!=null&&l2.loop&&(A2=g2+K<0?d2[d2.length-1]:g2+K===d2.length?d2[0]:d2[g2+K]),A2&&T.setState("value",A2.getAttribute(ya))}function J(K){let l2=W(),n2=l2==null?void 0:l2.closest(Pl),d2;for(;n2&&!d2;)n2=K>0?PP(n2,Pl):UP(n2,Pl),d2=n2==null?void 0:n2.querySelector(RA);d2?T.setState("value",d2.getAttribute(ya)):t2(K)}let v2=()=>V(a2().length-1),F=K=>{K.preventDefault(),K.metaKey?v2():K.altKey?J(1):t2(1)},q=K=>{K.preventDefault(),K.metaKey?V(0):K.altKey?J(-1):t2(-1)};return y.createElement(i0.div,{ref:t,tabIndex:-1,...C,"cmdk-root":"",onKeyDown:K=>{var l2;if((l2=C.onKeyDown)==null||l2.call(C,K),!K.defaultPrevented)switch(K.key){case"n":case"j":{z&&K.ctrlKey&&F(K);break}case"ArrowDown":{F(K);break}case"p":case"k":{z&&K.ctrlKey&&q(K);break}case"ArrowUp":{q(K);break}case"Home":{K.preventDefault(),V(0);break}case"End":{K.preventDefault(),v2();break}case"Enter":if(!K.nativeEvent.isComposing&&K.keyCode!==229){K.preventDefault();let n2=W();if(n2){let d2=new Event(f8);n2.dispatchEvent(d2)}}}}},y.createElement("label",{"cmdk-label":"",htmlFor:O.inputId,id:O.labelId,style:jP},d),Fo(e,K=>y.createElement(sy.Provider,{value:T},y.createElement(iy.Provider,{value:O},K))))}),TP=y.forwardRef((e,t)=>{var a,n;let r=Ce(),s=y.useRef(null),o=y.useContext(cy),u=li(),d=uy(e),f=(n=(a=d.current)==null?void 0:a.forceMount)!=null?n:o==null?void 0:o.forceMount;Oa(()=>{if(!f)return u.item(r,o==null?void 0:o.id)},[f]);let v=hy(r,s,[e.value,e.children,s],e.keywords),p=ed(),A=Fa(b=>b.value&&b.value===v.current),E=Fa(b=>f||u.filter()===!1?!0:b.search?b.filtered.items.get(r)>0:!0);y.useEffect(()=>{let b=s.current;if(!(!b||e.disabled))return b.addEventListener(f8,_),()=>b.removeEventListener(f8,_)},[E,e.onSelect,e.disabled]);function _(){var b,T;S(),(T=(b=d.current).onSelect)==null||T.call(b,v.current)}function S(){p.setState("value",v.current,!0)}if(!E)return null;let{disabled:z,value:C,onSelect:M,forceMount:x,keywords:D,...w}=e;return y.createElement(i0.div,{ref:vr([s,t]),...w,id:r,"cmdk-item":"",role:"option","aria-disabled":!!z,"aria-selected":!!A,"data-disabled":!!z,"data-selected":!!A,onPointerMove:z||u.getDisablePointerSelection()?void 0:S,onClick:z?void 0:_},e.children)}),kP=y.forwardRef((e,t)=>{let{heading:a,children:n,forceMount:r,...s}=e,o=Ce(),u=y.useRef(null),d=y.useRef(null),f=Ce(),v=li(),p=Fa(E=>r||v.filter()===!1?!0:E.search?E.filtered.groups.has(o):!0);Oa(()=>v.group(o),[]),hy(o,u,[e.value,e.heading,d]);let A=y.useMemo(()=>({id:o,forceMount:r}),[r]);return y.createElement(i0.div,{ref:vr([u,t]),...s,"cmdk-group":"",role:"presentation",hidden:p?void 0:!0},a&&y.createElement("div",{ref:d,"cmdk-group-heading":"","aria-hidden":!0,id:f},a),Fo(e,E=>y.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":a?f:void 0},y.createElement(cy.Provider,{value:A},E))))}),DP=y.forwardRef((e,t)=>{let{alwaysRender:a,...n}=e,r=y.useRef(null),s=Fa(o=>!o.search);return!a&&!s?null:y.createElement(i0.div,{ref:vr([r,t]),...n,"cmdk-separator":"",role:"separator"})}),BP=y.forwardRef((e,t)=>{let{onValueChange:a,...n}=e,r=e.value!=null,s=ed(),o=Fa(v=>v.search),u=Fa(v=>v.value),d=li(),f=y.useMemo(()=>{var v;let p=(v=d.listInnerRef.current)==null?void 0:v.querySelector(`${Jh}[${ya}="${encodeURIComponent(u)}"]`);return p==null?void 0:p.getAttribute("id")},[]);return y.useEffect(()=>{e.value!=null&&s.setState("search",e.value)},[e.value]),y.createElement(i0.input,{ref:t,...n,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":d.listId,"aria-labelledby":d.labelId,"aria-activedescendant":f,id:d.inputId,type:"text",value:r?e.value:o,onChange:v=>{r||s.setState("search",v.target.value),a==null||a(v.target.value)}})}),LP=y.forwardRef((e,t)=>{let{children:a,label:n="Suggestions",...r}=e,s=y.useRef(null),o=y.useRef(null),u=li();return y.useEffect(()=>{if(o.current&&s.current){let d=o.current,f=s.current,v,p=new ResizeObserver(()=>{v=requestAnimationFrame(()=>{let A=d.offsetHeight;f.style.setProperty("--cmdk-list-height",A.toFixed(1)+"px")})});return p.observe(d),()=>{cancelAnimationFrame(v),p.unobserve(d)}}},[]),y.createElement(i0.div,{ref:vr([s,t]),...r,"cmdk-list":"",role:"listbox","aria-label":n,id:u.listId},Fo(e,d=>y.createElement("div",{ref:vr([o,u.listInnerRef]),"cmdk-list-sizer":""},d)))}),OP=y.forwardRef((e,t)=>{let{open:a,onOpenChange:n,overlayClassName:r,contentClassName:s,container:o,...u}=e;return y.createElement(pP,{open:a,onOpenChange:n},y.createElement(AP,{container:o},y.createElement(gP,{"cmdk-overlay":"",className:r}),y.createElement(EP,{"aria-label":e.label,"cmdk-dialog":"",className:s},y.createElement(oy,{ref:t,...u}))))}),FP=y.forwardRef((e,t)=>Fa(a=>a.filtered.count===0)?y.createElement(i0.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),HP=y.forwardRef((e,t)=>{let{progress:a,children:n,label:r="Loading...",...s}=e;return y.createElement(i0.div,{ref:t,...s,"cmdk-loading":"",role:"progressbar","aria-valuenow":a,"aria-valuemin":0,"aria-valuemax":100,"aria-label":r},Fo(e,o=>y.createElement("div",{"aria-hidden":!0},o)))}),ri=Object.assign(oy,{List:LP,Item:TP,Input:BP,Group:kP,Separator:DP,Dialog:OP,Empty:FP,Loading:HP});function PP(e,t){let a=e.nextElementSibling;for(;a;){if(a.matches(t))return a;a=a.nextElementSibling}}function UP(e,t){let a=e.previousElementSibling;for(;a;){if(a.matches(t))return a;a=a.previousElementSibling}}function uy(e){let t=y.useRef(e);return Oa(()=>{t.current=e}),t}var Oa=typeof window>"u"?y.useEffect:y.useLayoutEffect;function Un(e){let t=y.useRef();return t.current===void 0&&(t.current=e()),t}function vr(e){return t=>{e.forEach(a=>{typeof a=="function"?a(t):a!=null&&(a.current=t)})}}function Fa(e){let t=ed(),a=()=>e(t.snapshot());return xP.useSyncExternalStore(t.subscribe,a,a)}function hy(e,t,a,n=[]){let r=y.useRef(),s=li();return Oa(()=>{var o;let u=(()=>{var f;for(let v of a){if(typeof v=="string")return v.trim();if(typeof v=="object"&&"current"in v)return v.current?(f=v.current.textContent)==null?void 0:f.trim():r.current}})(),d=n.map(f=>f.trim());s.value(e,u,d),(o=t.current)==null||o.setAttribute(ya,u),r.current=u}),r}var VP=()=>{let[e,t]=y.useState(),a=Un(()=>new Map);return Oa(()=>{a.current.forEach(n=>n()),a.current=new Map},[e]),(n,r)=>{a.current.set(n,r),t({})}};function GP(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Fo({asChild:e,children:t},a){return e&&y.isValidElement(t)?y.cloneElement(GP(t),{ref:t.ref},a(t.props.children)):a(t)}var jP={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const dy=({className:e,...t})=>I.jsx(ri,{className:C2("flex size-full flex-col overflow-hidden rounded-md",e),...t}),KP=({className:e,...t})=>I.jsxs("div",{className:"flex w-full items-center","cmdk-input-wrapper":"",children:[I.jsx(TL,{className:"mr-2 size-4 shrink-0 opacity-50"}),I.jsx(ri.Input,{className:C2("placeholder:text-muted-foreground outline-hidden flex w-full rounded-md bg-transparent text-sm disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}),$P=({className:e,...t})=>I.jsx(ri.List,{className:C2("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}),YP=e=>I.jsx(ri.Empty,{className:"py-6 text-center text-sm",...e}),ZP=({className:e,...t})=>I.jsx(ri.Item,{className:C2("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground outline-hidden relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50",e),...t}),Oc={...dy,Input:KP,List:$P,Empty:YP,Item:ZP},fy=y.createContext(null),Ho=()=>{const e=y.useContext(fy);if(!e)throw new Error("useMultiSelect must be used within MultiSelectProvider");return e},WP=({values:e,defaultValues:t,onValueChange:a,loop:n=!1,className:r,children:s,dir:o,...u})=>{const[d,f]=y.useState(t??[]),[v,p]=y.useState(""),[A,E]=y.useState(!1),[_,S]=y.useState(-1),z=y.useRef(null),[C,M]=y.useState(!1),[x,D]=y.useState("");y.useEffect(()=>{e&&f(e)},[e]);const w=y.useCallback(H=>{if(d.includes(H)){const U=d.filter(f2=>f2!==H);f(U),a==null||a(U)}else{const U=[...d,H];f(U),a==null||a(U)}},[d]),b=y.useCallback(H=>{H.preventDefault();const U=H.currentTarget,f2=U.value.substring(U.selectionStart??0,U.selectionEnd??0);D(f2),M(f2===v)},[v]),T=y.useCallback(H=>{H.stopPropagation();const U=z.current;if(!U)return;const f2=()=>{const W=_+1;S(W>d.length-1?n?0:-1:W)},s2=()=>{const W=_-1;S(W<0?d.length-1:W)},h2=()=>{const W=_-1<=0?d.length-1===0?-1:0:_-1;S(W)};switch(H.key){case"ArrowLeft":o==="rtl"?d.length>0&&(_!==-1||n)&&f2():d.length>0&&U.selectionStart===0&&s2();break;case"ArrowRight":o==="rtl"?d.length>0&&U.selectionStart===0&&s2():d.length>0&&(_!==-1||n)&&f2();break;case"Backspace":case"Delete":d.length>0&&(_!==-1&&_<d.length?(w(d[_]),h2()):(U.selectionStart===0&&x===v||C)&&w(d[d.length-1]));break;case"Enter":E(!0);break;case"Escape":_!==-1?S(-1):A&&E(!1);break}},[d,v,_,n]),O=y.useMemo(()=>({value:d,onValueChange:w,open:A,setOpen:E,inputValue:v,setInputValue:p,activeIndex:_,setActiveIndex:S,ref:z,handleSelect:b}),[d,w,A,E,v,p,_,S,z,b]);return I.jsx(fy,{value:O,children:I.jsx(dy,{onKeyDown:T,className:C2("flex w-full flex-col gap-2 overflow-visible bg-transparent",r),dir:o,...u,children:s})})},qP=({className:e,getBadgeValue:t=s=>s,validationStyleEnabled:a=!1,children:n,...r})=>{const{value:s,onValueChange:o,activeIndex:u}=Ho(),d=y.useCallback(f=>{f.preventDefault(),f.stopPropagation()},[]);return I.jsxs("div",{className:C2("flex w-full flex-col gap-3 rounded-lg p-1 py-2","border-input ring-offset-background placeholder:text-muted-foreground focus:ring-ring focus:outline-hidden flex w-full items-center justify-between whitespace-nowrap border px-3 py-2 text-sm focus:ring-1 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1","bg-input-background text-input-text w-full select-text resize-none rounded-xl border-2 px-2 py-1 text-sm shadow-none outline-0 transition-all","border-input-border hover:border-input-border-hover focus:border-input-border-focus focus:outline-0 focus:[box-shadow:none]","aria-[invalid=true]:border-error",a&&"valid:border-success invalid:border-error",e),...r,children:[s.length>0&&I.jsx("div",{className:"flex w-full flex-wrap gap-1",children:s.map((f,v)=>I.jsxs(uH,{className:C2("flex items-center gap-1 rounded-xl px-1",u===v&&"ring-muted-foreground ring-2"),color:"text",children:[I.jsx("span",{className:"text-xs",children:t(f)}),I.jsxs("button",{"aria-label":`Remove ${f} option`,"aria-roledescription":"button to remove option",onMouseDown:d,onClick:()=>o(f),children:[I.jsxs("span",{className:"sr-only",children:["Remove ",f," option"]}),I.jsx(Ya,{className:"size-4 cursor-pointer"})]})]},f))}),n]})},XP=({className:e,...t})=>{const{setOpen:a,inputValue:n,setInputValue:r,activeIndex:s,setActiveIndex:o,handleSelect:u,ref:d}=Ho();return I.jsx(Oc.Input,{...t,tabIndex:0,ref:d,value:n,onValueChange:s===-1?r:void 0,onSelect:u,onBlur:()=>a(!1),onFocus:()=>a(!0),onClick:()=>o(-1),className:C2("outline-hidden ml-2 flex-1 cursor-pointer",e,s!==-1&&"caret-transparent")})},QP=({children:e})=>{const{open:t}=Ho();return I.jsx("div",{className:"relative",children:t&&e})},JP=({className:e,children:t})=>I.jsxs(Oc.List,{className:C2("border-muted bg-input-background absolute top-0 z-10 flex w-full flex-col gap-2 rounded-lg border p-2 shadow-md transition-colors",e),children:[t,I.jsx(Oc.Empty,{children:I.jsx("span",{className:"text-muted-foreground",children:"No results found"})})]}),eU=({className:e,value:t,children:a,...n})=>{const{value:r,onValueChange:s,setInputValue:o}=Ho(),u=y.useCallback(f=>{f.preventDefault(),f.stopPropagation()},[]),d=r.includes(t);return I.jsxs(Oc.Item,{...n,onSelect:()=>{s(t),o("")},className:C2("flex cursor-pointer justify-between rounded-lg px-2 py-1 transition-colors","hover:bg-neutral/10",e,d&&"opacity-50",n.disabled&&"cursor-not-allowed opacity-50"),onMouseDown:u,children:[a,d&&I.jsx(I4,{className:"size-4"})]})},z1=WP;z1.Trigger=qP;z1.Input=XP;z1.Content=QP;z1.List=JP;z1.Item=eU;const tU=({className:e,children:t,...a})=>I.jsxs("i",{className:C2("text-xs text-neutral-400",e),...a,children:["ⓘ ",t]}),m8=({htmlFor:e,...t})=>I.jsx("label",{className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",htmlFor:e,...t}),aU=({className:e,...t})=>{const{error:a,formItemId:n}=Vt();return I.jsx(m8,{className:C2("mb-2",a&&"text-error",e),htmlFor:n,...t})},nU=({isRequired:e})=>e?I.jsx("span",{"aria-label":"Asterisk meaning the field is required",children:"*"}):I.jsx(I.Fragment,{}),my=({children:e,isRequired:t,info:a,htmlFor:n,className:r})=>I.jsxs("div",{className:"ml-1 flex gap-1 align-middle text-base leading-none",children:[e&&I.jsxs(aU,{htmlFor:n,className:Mo("font-bold",r),children:[e,I.jsx(nU,{isRequired:t})]}),a&&I.jsx(tU,{content:a})]});function xA(e,[t,a]){return Math.min(a,Math.max(t,e))}var lU=y.createContext(void 0);function rU(e){const t=y.useContext(lU);return e||t||"ltr"}const iU=["top","right","bottom","left"],Rt=Math.min,te=Math.max,Fc=Math.round,Ws=Math.floor,a3=e=>({x:e,y:e}),sU={left:"right",right:"left",bottom:"top",top:"bottom"},cU={start:"end",end:"start"};function v8(e,t,a){return te(e,Rt(t,a))}function P3(e,t){return typeof e=="function"?e(t):e}function U3(e){return e.split("-")[0]}function S4(e){return e.split("-")[1]}function td(e){return e==="x"?"y":"x"}function ad(e){return e==="y"?"height":"width"}function xt(e){return["top","bottom"].includes(U3(e))?"y":"x"}function nd(e){return td(xt(e))}function oU(e,t,a){a===void 0&&(a=!1);const n=S4(e),r=nd(e),s=ad(r);let o=r==="x"?n===(a?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(o=Hc(o)),[o,Hc(o)]}function uU(e){const t=Hc(e);return[p8(e),t,p8(t)]}function p8(e){return e.replace(/start|end/g,t=>cU[t])}function hU(e,t,a){const n=["left","right"],r=["right","left"],s=["top","bottom"],o=["bottom","top"];switch(e){case"top":case"bottom":return a?t?r:n:t?n:r;case"left":case"right":return t?s:o;default:return[]}}function dU(e,t,a,n){const r=S4(e);let s=hU(U3(e),a==="start",n);return r&&(s=s.map(o=>o+"-"+r),t&&(s=s.concat(s.map(p8)))),s}function Hc(e){return e.replace(/left|right|bottom|top/g,t=>sU[t])}function fU(e){return{top:0,right:0,bottom:0,left:0,...e}}function vy(e){return typeof e!="number"?fU(e):{top:e,right:e,bottom:e,left:e}}function Pc(e){const{x:t,y:a,width:n,height:r}=e;return{width:n,height:r,top:a,left:t,right:t+n,bottom:a+r,x:t,y:a}}function wA(e,t,a){let{reference:n,floating:r}=e;const s=xt(t),o=nd(t),u=ad(o),d=U3(t),f=s==="y",v=n.x+n.width/2-r.width/2,p=n.y+n.height/2-r.height/2,A=n[u]/2-r[u]/2;let E;switch(d){case"top":E={x:v,y:n.y-r.height};break;case"bottom":E={x:v,y:n.y+n.height};break;case"right":E={x:n.x+n.width,y:p};break;case"left":E={x:n.x-r.width,y:p};break;default:E={x:n.x,y:n.y}}switch(S4(t)){case"start":E[o]-=A*(a&&f?-1:1);break;case"end":E[o]+=A*(a&&f?-1:1);break}return E}const mU=async(e,t,a)=>{const{placement:n="bottom",strategy:r="absolute",middleware:s=[],platform:o}=a,u=s.filter(Boolean),d=await(o.isRTL==null?void 0:o.isRTL(t));let f=await o.getElementRects({reference:e,floating:t,strategy:r}),{x:v,y:p}=wA(f,n,d),A=n,E={},_=0;for(let S=0;S<u.length;S++){const{name:z,fn:C}=u[S],{x:M,y:x,data:D,reset:w}=await C({x:v,y:p,initialPlacement:n,placement:A,strategy:r,middlewareData:E,rects:f,platform:o,elements:{reference:e,floating:t}});v=M??v,p=x??p,E={...E,[z]:{...E[z],...D}},w&&_<=50&&(_++,typeof w=="object"&&(w.placement&&(A=w.placement),w.rects&&(f=w.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:r}):w.rects),{x:v,y:p}=wA(f,A,d)),S=-1)}return{x:v,y:p,placement:A,strategy:r,middlewareData:E}};async function pr(e,t){var a;t===void 0&&(t={});const{x:n,y:r,platform:s,rects:o,elements:u,strategy:d}=e,{boundary:f="clippingAncestors",rootBoundary:v="viewport",elementContext:p="floating",altBoundary:A=!1,padding:E=0}=P3(t,e),_=vy(E),z=u[A?p==="floating"?"reference":"floating":p],C=Pc(await s.getClippingRect({element:(a=await(s.isElement==null?void 0:s.isElement(z)))==null||a?z:z.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(u.floating)),boundary:f,rootBoundary:v,strategy:d})),M=p==="floating"?{x:n,y:r,width:o.floating.width,height:o.floating.height}:o.reference,x=await(s.getOffsetParent==null?void 0:s.getOffsetParent(u.floating)),D=await(s.isElement==null?void 0:s.isElement(x))?await(s.getScale==null?void 0:s.getScale(x))||{x:1,y:1}:{x:1,y:1},w=Pc(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:M,offsetParent:x,strategy:d}):M);return{top:(C.top-w.top+_.top)/D.y,bottom:(w.bottom-C.bottom+_.bottom)/D.y,left:(C.left-w.left+_.left)/D.x,right:(w.right-C.right+_.right)/D.x}}const vU=e=>({name:"arrow",options:e,async fn(t){const{x:a,y:n,placement:r,rects:s,platform:o,elements:u,middlewareData:d}=t,{element:f,padding:v=0}=P3(e,t)||{};if(f==null)return{};const p=vy(v),A={x:a,y:n},E=nd(r),_=ad(E),S=await o.getDimensions(f),z=E==="y",C=z?"top":"left",M=z?"bottom":"right",x=z?"clientHeight":"clientWidth",D=s.reference[_]+s.reference[E]-A[E]-s.floating[_],w=A[E]-s.reference[E],b=await(o.getOffsetParent==null?void 0:o.getOffsetParent(f));let T=b?b[x]:0;(!T||!await(o.isElement==null?void 0:o.isElement(b)))&&(T=u.floating[x]||s.floating[_]);const O=D/2-w/2,H=T/2-S[_]/2-1,U=Rt(p[C],H),f2=Rt(p[M],H),s2=U,h2=T-S[_]-f2,W=T/2-S[_]/2+O,a2=v8(s2,W,h2),V=!d.arrow&&S4(r)!=null&&W!==a2&&s.reference[_]/2-(W<s2?U:f2)-S[_]/2<0,t2=V?W<s2?W-s2:W-h2:0;return{[E]:A[E]+t2,data:{[E]:a2,centerOffset:W-a2-t2,...V&&{alignmentOffset:t2}},reset:V}}}),pU=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var a,n;const{placement:r,middlewareData:s,rects:o,initialPlacement:u,platform:d,elements:f}=t,{mainAxis:v=!0,crossAxis:p=!0,fallbackPlacements:A,fallbackStrategy:E="bestFit",fallbackAxisSideDirection:_="none",flipAlignment:S=!0,...z}=P3(e,t);if((a=s.arrow)!=null&&a.alignmentOffset)return{};const C=U3(r),M=xt(u),x=U3(u)===u,D=await(d.isRTL==null?void 0:d.isRTL(f.floating)),w=A||(x||!S?[Hc(u)]:uU(u)),b=_!=="none";!A&&b&&w.push(...dU(u,S,_,D));const T=[u,...w],O=await pr(t,z),H=[];let U=((n=s.flip)==null?void 0:n.overflows)||[];if(v&&H.push(O[C]),p){const W=oU(r,o,D);H.push(O[W[0]],O[W[1]])}if(U=[...U,{placement:r,overflows:H}],!H.every(W=>W<=0)){var f2,s2;const W=(((f2=s.flip)==null?void 0:f2.index)||0)+1,a2=T[W];if(a2)return{data:{index:W,overflows:U},reset:{placement:a2}};let V=(s2=U.filter(t2=>t2.overflows[0]<=0).sort((t2,J)=>t2.overflows[1]-J.overflows[1])[0])==null?void 0:s2.placement;if(!V)switch(E){case"bestFit":{var h2;const t2=(h2=U.filter(J=>{if(b){const v2=xt(J.placement);return v2===M||v2==="y"}return!0}).map(J=>[J.placement,J.overflows.filter(v2=>v2>0).reduce((v2,F)=>v2+F,0)]).sort((J,v2)=>J[1]-v2[1])[0])==null?void 0:h2[0];t2&&(V=t2);break}case"initialPlacement":V=u;break}if(r!==V)return{reset:{placement:V}}}return{}}}};function bA(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function TA(e){return iU.some(t=>e[t]>=0)}const AU=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:a}=t,{strategy:n="referenceHidden",...r}=P3(e,t);switch(n){case"referenceHidden":{const s=await pr(t,{...r,elementContext:"reference"}),o=bA(s,a.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:TA(o)}}}case"escaped":{const s=await pr(t,{...r,altBoundary:!0}),o=bA(s,a.floating);return{data:{escapedOffsets:o,escaped:TA(o)}}}default:return{}}}}};async function gU(e,t){const{placement:a,platform:n,elements:r}=e,s=await(n.isRTL==null?void 0:n.isRTL(r.floating)),o=U3(a),u=S4(a),d=xt(a)==="y",f=["left","top"].includes(o)?-1:1,v=s&&d?-1:1,p=P3(t,e);let{mainAxis:A,crossAxis:E,alignmentAxis:_}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return u&&typeof _=="number"&&(E=u==="end"?_*-1:_),d?{x:E*v,y:A*f}:{x:A*f,y:E*v}}const EU=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var a,n;const{x:r,y:s,placement:o,middlewareData:u}=t,d=await gU(t,e);return o===((a=u.offset)==null?void 0:a.placement)&&(n=u.arrow)!=null&&n.alignmentOffset?{}:{x:r+d.x,y:s+d.y,data:{...d,placement:o}}}}},_U=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:a,y:n,placement:r}=t,{mainAxis:s=!0,crossAxis:o=!1,limiter:u={fn:z=>{let{x:C,y:M}=z;return{x:C,y:M}}},...d}=P3(e,t),f={x:a,y:n},v=await pr(t,d),p=xt(U3(r)),A=td(p);let E=f[A],_=f[p];if(s){const z=A==="y"?"top":"left",C=A==="y"?"bottom":"right",M=E+v[z],x=E-v[C];E=v8(M,E,x)}if(o){const z=p==="y"?"top":"left",C=p==="y"?"bottom":"right",M=_+v[z],x=_-v[C];_=v8(M,_,x)}const S=u.fn({...t,[A]:E,[p]:_});return{...S,data:{x:S.x-a,y:S.y-n,enabled:{[A]:s,[p]:o}}}}}},IU=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:a,y:n,placement:r,rects:s,middlewareData:o}=t,{offset:u=0,mainAxis:d=!0,crossAxis:f=!0}=P3(e,t),v={x:a,y:n},p=xt(r),A=td(p);let E=v[A],_=v[p];const S=P3(u,t),z=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:0,crossAxis:0,...S};if(d){const x=A==="y"?"height":"width",D=s.reference[A]-s.floating[x]+z.mainAxis,w=s.reference[A]+s.reference[x]-z.mainAxis;E<D?E=D:E>w&&(E=w)}if(f){var C,M;const x=A==="y"?"width":"height",D=["top","left"].includes(U3(r)),w=s.reference[p]-s.floating[x]+(D&&((C=o.offset)==null?void 0:C[p])||0)+(D?0:z.crossAxis),b=s.reference[p]+s.reference[x]+(D?0:((M=o.offset)==null?void 0:M[p])||0)-(D?z.crossAxis:0);_<w?_=w:_>b&&(_=b)}return{[A]:E,[p]:_}}}},NU=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var a,n;const{placement:r,rects:s,platform:o,elements:u}=t,{apply:d=()=>{},...f}=P3(e,t),v=await pr(t,f),p=U3(r),A=S4(r),E=xt(r)==="y",{width:_,height:S}=s.floating;let z,C;p==="top"||p==="bottom"?(z=p,C=A===(await(o.isRTL==null?void 0:o.isRTL(u.floating))?"start":"end")?"left":"right"):(C=p,z=A==="end"?"top":"bottom");const M=S-v.top-v.bottom,x=_-v.left-v.right,D=Rt(S-v[z],M),w=Rt(_-v[C],x),b=!t.middlewareData.shift;let T=D,O=w;if((a=t.middlewareData.shift)!=null&&a.enabled.x&&(O=x),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(T=M),b&&!A){const U=te(v.left,0),f2=te(v.right,0),s2=te(v.top,0),h2=te(v.bottom,0);E?O=_-2*(U!==0||f2!==0?U+f2:te(v.left,v.right)):T=S-2*(s2!==0||h2!==0?s2+h2:te(v.top,v.bottom))}await d({...t,availableWidth:O,availableHeight:T});const H=await o.getDimensions(u.floating);return _!==H.width||S!==H.height?{reset:{rects:!0}}:{}}}};function Po(){return typeof window<"u"}function y4(e){return py(e)?(e.nodeName||"").toLowerCase():"#document"}function ne(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function f3(e){var t;return(t=(py(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function py(e){return Po()?e instanceof Node||e instanceof ne(e).Node:!1}function He(e){return Po()?e instanceof Element||e instanceof ne(e).Element:!1}function s3(e){return Po()?e instanceof HTMLElement||e instanceof ne(e).HTMLElement:!1}function kA(e){return!Po()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ne(e).ShadowRoot}function ii(e){const{overflow:t,overflowX:a,overflowY:n,display:r}=Pe(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+a)&&!["inline","contents"].includes(r)}function SU(e){return["table","td","th"].includes(y4(e))}function Uo(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function ld(e){const t=rd(),a=He(e)?Pe(e):e;return["transform","translate","scale","rotate","perspective"].some(n=>a[n]?a[n]!=="none":!1)||(a.containerType?a.containerType!=="normal":!1)||!t&&(a.backdropFilter?a.backdropFilter!=="none":!1)||!t&&(a.filter?a.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(n=>(a.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(a.contain||"").includes(n))}function yU(e){let t=wt(e);for(;s3(t)&&!s4(t);){if(ld(t))return t;if(Uo(t))return null;t=wt(t)}return null}function rd(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function s4(e){return["html","body","#document"].includes(y4(e))}function Pe(e){return ne(e).getComputedStyle(e)}function Vo(e){return He(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function wt(e){if(y4(e)==="html")return e;const t=e.assignedSlot||e.parentNode||kA(e)&&e.host||f3(e);return kA(t)?t.host:t}function Ay(e){const t=wt(e);return s4(t)?e.ownerDocument?e.ownerDocument.body:e.body:s3(t)&&ii(t)?t:Ay(t)}function Ar(e,t,a){var n;t===void 0&&(t=[]),a===void 0&&(a=!0);const r=Ay(e),s=r===((n=e.ownerDocument)==null?void 0:n.body),o=ne(r);if(s){const u=A8(o);return t.concat(o,o.visualViewport||[],ii(r)?r:[],u&&a?Ar(u):[])}return t.concat(r,Ar(r,[],a))}function A8(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function gy(e){const t=Pe(e);let a=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const r=s3(e),s=r?e.offsetWidth:a,o=r?e.offsetHeight:n,u=Fc(a)!==s||Fc(n)!==o;return u&&(a=s,n=o),{width:a,height:n,$:u}}function id(e){return He(e)?e:e.contextElement}function e4(e){const t=id(e);if(!s3(t))return a3(1);const a=t.getBoundingClientRect(),{width:n,height:r,$:s}=gy(t);let o=(s?Fc(a.width):a.width)/n,u=(s?Fc(a.height):a.height)/r;return(!o||!Number.isFinite(o))&&(o=1),(!u||!Number.isFinite(u))&&(u=1),{x:o,y:u}}const zU=a3(0);function Ey(e){const t=ne(e);return!rd()||!t.visualViewport?zU:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function CU(e,t,a){return t===void 0&&(t=!1),!a||t&&a!==ne(e)?!1:t}function Ha(e,t,a,n){t===void 0&&(t=!1),a===void 0&&(a=!1);const r=e.getBoundingClientRect(),s=id(e);let o=a3(1);t&&(n?He(n)&&(o=e4(n)):o=e4(e));const u=CU(s,a,n)?Ey(s):a3(0);let d=(r.left+u.x)/o.x,f=(r.top+u.y)/o.y,v=r.width/o.x,p=r.height/o.y;if(s){const A=ne(s),E=n&&He(n)?ne(n):n;let _=A,S=A8(_);for(;S&&n&&E!==_;){const z=e4(S),C=S.getBoundingClientRect(),M=Pe(S),x=C.left+(S.clientLeft+parseFloat(M.paddingLeft))*z.x,D=C.top+(S.clientTop+parseFloat(M.paddingTop))*z.y;d*=z.x,f*=z.y,v*=z.x,p*=z.y,d+=x,f+=D,_=ne(S),S=A8(_)}}return Pc({width:v,height:p,x:d,y:f})}function sd(e,t){const a=Vo(e).scrollLeft;return t?t.left+a:Ha(f3(e)).left+a}function _y(e,t,a){a===void 0&&(a=!1);const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-(a?0:sd(e,n)),s=n.top+t.scrollTop;return{x:r,y:s}}function MU(e){let{elements:t,rect:a,offsetParent:n,strategy:r}=e;const s=r==="fixed",o=f3(n),u=t?Uo(t.floating):!1;if(n===o||u&&s)return a;let d={scrollLeft:0,scrollTop:0},f=a3(1);const v=a3(0),p=s3(n);if((p||!p&&!s)&&((y4(n)!=="body"||ii(o))&&(d=Vo(n)),s3(n))){const E=Ha(n);f=e4(n),v.x=E.x+n.clientLeft,v.y=E.y+n.clientTop}const A=o&&!p&&!s?_y(o,d,!0):a3(0);return{width:a.width*f.x,height:a.height*f.y,x:a.x*f.x-d.scrollLeft*f.x+v.x+A.x,y:a.y*f.y-d.scrollTop*f.y+v.y+A.y}}function RU(e){return Array.from(e.getClientRects())}function xU(e){const t=f3(e),a=Vo(e),n=e.ownerDocument.body,r=te(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),s=te(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let o=-a.scrollLeft+sd(e);const u=-a.scrollTop;return Pe(n).direction==="rtl"&&(o+=te(t.clientWidth,n.clientWidth)-r),{width:r,height:s,x:o,y:u}}function wU(e,t){const a=ne(e),n=f3(e),r=a.visualViewport;let s=n.clientWidth,o=n.clientHeight,u=0,d=0;if(r){s=r.width,o=r.height;const f=rd();(!f||f&&t==="fixed")&&(u=r.offsetLeft,d=r.offsetTop)}return{width:s,height:o,x:u,y:d}}function bU(e,t){const a=Ha(e,!0,t==="fixed"),n=a.top+e.clientTop,r=a.left+e.clientLeft,s=s3(e)?e4(e):a3(1),o=e.clientWidth*s.x,u=e.clientHeight*s.y,d=r*s.x,f=n*s.y;return{width:o,height:u,x:d,y:f}}function DA(e,t,a){let n;if(t==="viewport")n=wU(e,a);else if(t==="document")n=xU(f3(e));else if(He(t))n=bU(t,a);else{const r=Ey(e);n={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return Pc(n)}function Iy(e,t){const a=wt(e);return a===t||!He(a)||s4(a)?!1:Pe(a).position==="fixed"||Iy(a,t)}function TU(e,t){const a=t.get(e);if(a)return a;let n=Ar(e,[],!1).filter(u=>He(u)&&y4(u)!=="body"),r=null;const s=Pe(e).position==="fixed";let o=s?wt(e):e;for(;He(o)&&!s4(o);){const u=Pe(o),d=ld(o);!d&&u.position==="fixed"&&(r=null),(s?!d&&!r:!d&&u.position==="static"&&!!r&&["absolute","fixed"].includes(r.position)||ii(o)&&!d&&Iy(e,o))?n=n.filter(v=>v!==o):r=u,o=wt(o)}return t.set(e,n),n}function kU(e){let{element:t,boundary:a,rootBoundary:n,strategy:r}=e;const o=[...a==="clippingAncestors"?Uo(t)?[]:TU(t,this._c):[].concat(a),n],u=o[0],d=o.reduce((f,v)=>{const p=DA(t,v,r);return f.top=te(p.top,f.top),f.right=Rt(p.right,f.right),f.bottom=Rt(p.bottom,f.bottom),f.left=te(p.left,f.left),f},DA(t,u,r));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function DU(e){const{width:t,height:a}=gy(e);return{width:t,height:a}}function BU(e,t,a){const n=s3(t),r=f3(t),s=a==="fixed",o=Ha(e,!0,s,t);let u={scrollLeft:0,scrollTop:0};const d=a3(0);if(n||!n&&!s)if((y4(t)!=="body"||ii(r))&&(u=Vo(t)),n){const A=Ha(t,!0,s,t);d.x=A.x+t.clientLeft,d.y=A.y+t.clientTop}else r&&(d.x=sd(r));const f=r&&!n&&!s?_y(r,u):a3(0),v=o.left+u.scrollLeft-d.x-f.x,p=o.top+u.scrollTop-d.y-f.y;return{x:v,y:p,width:o.width,height:o.height}}function r7(e){return Pe(e).position==="static"}function BA(e,t){if(!s3(e)||Pe(e).position==="fixed")return null;if(t)return t(e);let a=e.offsetParent;return f3(e)===a&&(a=a.ownerDocument.body),a}function Ny(e,t){const a=ne(e);if(Uo(e))return a;if(!s3(e)){let r=wt(e);for(;r&&!s4(r);){if(He(r)&&!r7(r))return r;r=wt(r)}return a}let n=BA(e,t);for(;n&&SU(n)&&r7(n);)n=BA(n,t);return n&&s4(n)&&r7(n)&&!ld(n)?a:n||yU(e)||a}const LU=async function(e){const t=this.getOffsetParent||Ny,a=this.getDimensions,n=await a(e.floating);return{reference:BU(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function OU(e){return Pe(e).direction==="rtl"}const FU={convertOffsetParentRelativeRectToViewportRelativeRect:MU,getDocumentElement:f3,getClippingRect:kU,getOffsetParent:Ny,getElementRects:LU,getClientRects:RU,getDimensions:DU,getScale:e4,isElement:He,isRTL:OU};function Sy(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function HU(e,t){let a=null,n;const r=f3(e);function s(){var u;clearTimeout(n),(u=a)==null||u.disconnect(),a=null}function o(u,d){u===void 0&&(u=!1),d===void 0&&(d=1),s();const f=e.getBoundingClientRect(),{left:v,top:p,width:A,height:E}=f;if(u||t(),!A||!E)return;const _=Ws(p),S=Ws(r.clientWidth-(v+A)),z=Ws(r.clientHeight-(p+E)),C=Ws(v),x={rootMargin:-_+"px "+-S+"px "+-z+"px "+-C+"px",threshold:te(0,Rt(1,d))||1};let D=!0;function w(b){const T=b[0].intersectionRatio;if(T!==d){if(!D)return o();T?o(!1,T):n=setTimeout(()=>{o(!1,1e-7)},1e3)}T===1&&!Sy(f,e.getBoundingClientRect())&&o(),D=!1}try{a=new IntersectionObserver(w,{...x,root:r.ownerDocument})}catch{a=new IntersectionObserver(w,x)}a.observe(e)}return o(!0),s}function PU(e,t,a,n){n===void 0&&(n={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:d=!1}=n,f=id(e),v=r||s?[...f?Ar(f):[],...Ar(t)]:[];v.forEach(C=>{r&&C.addEventListener("scroll",a,{passive:!0}),s&&C.addEventListener("resize",a)});const p=f&&u?HU(f,a):null;let A=-1,E=null;o&&(E=new ResizeObserver(C=>{let[M]=C;M&&M.target===f&&E&&(E.unobserve(t),cancelAnimationFrame(A),A=requestAnimationFrame(()=>{var x;(x=E)==null||x.observe(t)})),a()}),f&&!d&&E.observe(f),E.observe(t));let _,S=d?Ha(e):null;d&&z();function z(){const C=Ha(e);S&&!Sy(S,C)&&a(),S=C,_=requestAnimationFrame(z)}return a(),()=>{var C;v.forEach(M=>{r&&M.removeEventListener("scroll",a),s&&M.removeEventListener("resize",a)}),p==null||p(),(C=E)==null||C.disconnect(),E=null,d&&cancelAnimationFrame(_)}}const UU=EU,VU=_U,GU=pU,jU=NU,KU=AU,LA=vU,$U=IU,YU=(e,t,a)=>{const n=new Map,r={platform:FU,...a},s={...r.platform,_c:n};return mU(e,t,{...r,platform:s})};var Nc=typeof document<"u"?y.useLayoutEffect:y.useEffect;function Uc(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let a,n,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(a=e.length,a!==t.length)return!1;for(n=a;n--!==0;)if(!Uc(e[n],t[n]))return!1;return!0}if(r=Object.keys(e),a=r.length,a!==Object.keys(t).length)return!1;for(n=a;n--!==0;)if(!{}.hasOwnProperty.call(t,r[n]))return!1;for(n=a;n--!==0;){const s=r[n];if(!(s==="_owner"&&e.$$typeof)&&!Uc(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function yy(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function OA(e,t){const a=yy(e);return Math.round(t*a)/a}function i7(e){const t=y.useRef(e);return Nc(()=>{t.current=e}),t}function ZU(e){e===void 0&&(e={});const{placement:t="bottom",strategy:a="absolute",middleware:n=[],platform:r,elements:{reference:s,floating:o}={},transform:u=!0,whileElementsMounted:d,open:f}=e,[v,p]=y.useState({x:0,y:0,strategy:a,placement:t,middlewareData:{},isPositioned:!1}),[A,E]=y.useState(n);Uc(A,n)||E(n);const[_,S]=y.useState(null),[z,C]=y.useState(null),M=y.useCallback(J=>{J!==b.current&&(b.current=J,S(J))},[]),x=y.useCallback(J=>{J!==T.current&&(T.current=J,C(J))},[]),D=s||_,w=o||z,b=y.useRef(null),T=y.useRef(null),O=y.useRef(v),H=d!=null,U=i7(d),f2=i7(r),s2=i7(f),h2=y.useCallback(()=>{if(!b.current||!T.current)return;const J={placement:t,strategy:a,middleware:A};f2.current&&(J.platform=f2.current),YU(b.current,T.current,J).then(v2=>{const F={...v2,isPositioned:s2.current!==!1};W.current&&!Uc(O.current,F)&&(O.current=F,$a.flushSync(()=>{p(F)}))})},[A,t,a,f2,s2]);Nc(()=>{f===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,p(J=>({...J,isPositioned:!1})))},[f]);const W=y.useRef(!1);Nc(()=>(W.current=!0,()=>{W.current=!1}),[]),Nc(()=>{if(D&&(b.current=D),w&&(T.current=w),D&&w){if(U.current)return U.current(D,w,h2);h2()}},[D,w,h2,U,H]);const a2=y.useMemo(()=>({reference:b,floating:T,setReference:M,setFloating:x}),[M,x]),V=y.useMemo(()=>({reference:D,floating:w}),[D,w]),t2=y.useMemo(()=>{const J={position:a,left:0,top:0};if(!V.floating)return J;const v2=OA(V.floating,v.x),F=OA(V.floating,v.y);return u?{...J,transform:"translate("+v2+"px, "+F+"px)",...yy(V.floating)>=1.5&&{willChange:"transform"}}:{position:a,left:v2,top:F}},[a,u,V.floating,v.x,v.y]);return y.useMemo(()=>({...v,update:h2,refs:a2,elements:V,floatingStyles:t2}),[v,h2,a2,V,t2])}const WU=e=>{function t(a){return{}.hasOwnProperty.call(a,"current")}return{name:"arrow",options:e,fn(a){const{element:n,padding:r}=typeof e=="function"?e(a):e;return n&&t(n)?n.current!=null?LA({element:n.current,padding:r}).fn(a):{}:n?LA({element:n,padding:r}).fn(a):{}}}},qU=(e,t)=>({...UU(e),options:[e,t]}),XU=(e,t)=>({...VU(e),options:[e,t]}),QU=(e,t)=>({...$U(e),options:[e,t]}),JU=(e,t)=>({...GU(e),options:[e,t]}),eV=(e,t)=>({...jU(e),options:[e,t]}),tV=(e,t)=>({...KU(e),options:[e,t]}),aV=(e,t)=>({...WU(e),options:[e,t]});var nV="Arrow",zy=y.forwardRef((e,t)=>{const{children:a,width:n=10,height:r=5,...s}=e;return I.jsx(i0.svg,{...s,ref:t,width:n,height:r,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?a:I.jsx("polygon",{points:"0,0 30,0 15,10"})})});zy.displayName=nV;var lV=zy;function rV(e){const[t,a]=y.useState(void 0);return x1(()=>{if(e){a({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const s=r[0];let o,u;if("borderBoxSize"in s){const d=s.borderBoxSize,f=Array.isArray(d)?d[0]:d;o=f.inlineSize,u=f.blockSize}else o=e.offsetWidth,u=e.offsetHeight;a({width:o,height:u})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else a(void 0)},[e]),t}var cd="Popper",[Cy,My]=ti(cd),[iV,Ry]=Cy(cd),xy=e=>{const{__scopePopper:t,children:a}=e,[n,r]=y.useState(null);return I.jsx(iV,{scope:t,anchor:n,onAnchorChange:r,children:a})};xy.displayName=cd;var wy="PopperAnchor",by=y.forwardRef((e,t)=>{const{__scopePopper:a,virtualRef:n,...r}=e,s=Ry(wy,a),o=y.useRef(null),u=B0(t,o);return y.useEffect(()=>{s.onAnchorChange((n==null?void 0:n.current)||o.current)}),n?null:I.jsx(i0.div,{...r,ref:u})});by.displayName=wy;var od="PopperContent",[sV,cV]=Cy(od),Ty=y.forwardRef((e,t)=>{var A2,z2,Y2,L2,J2,u0;const{__scopePopper:a,side:n="bottom",sideOffset:r=0,align:s="center",alignOffset:o=0,arrowPadding:u=0,avoidCollisions:d=!0,collisionBoundary:f=[],collisionPadding:v=0,sticky:p="partial",hideWhenDetached:A=!1,updatePositionStrategy:E="optimized",onPlaced:_,...S}=e,z=Ry(od,a),[C,M]=y.useState(null),x=B0(t,M0=>M(M0)),[D,w]=y.useState(null),b=rV(D),T=(b==null?void 0:b.width)??0,O=(b==null?void 0:b.height)??0,H=n+(s!=="center"?"-"+s:""),U=typeof v=="number"?v:{top:0,right:0,bottom:0,left:0,...v},f2=Array.isArray(f)?f:[f],s2=f2.length>0,h2={padding:U,boundary:f2.filter(uV),altBoundary:s2},{refs:W,floatingStyles:a2,placement:V,isPositioned:t2,middlewareData:J}=ZU({strategy:"fixed",placement:H,whileElementsMounted:(...M0)=>PU(...M0,{animationFrame:E==="always"}),elements:{reference:z.anchor},middleware:[qU({mainAxis:r+O,alignmentAxis:o}),d&&XU({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?QU():void 0,...h2}),d&&JU({...h2}),eV({...h2,apply:({elements:M0,rects:l1,availableWidth:Re,availableHeight:K1})=>{const{width:je,height:P}=l1.reference,Q=M0.floating.style;Q.setProperty("--radix-popper-available-width",`${Re}px`),Q.setProperty("--radix-popper-available-height",`${K1}px`),Q.setProperty("--radix-popper-anchor-width",`${je}px`),Q.setProperty("--radix-popper-anchor-height",`${P}px`)}}),D&&aV({element:D,padding:u}),hV({arrowWidth:T,arrowHeight:O}),A&&tV({strategy:"referenceHidden",...h2})]}),[v2,F]=By(V),q=re(_);x1(()=>{t2&&(q==null||q())},[t2,q]);const K=(A2=J.arrow)==null?void 0:A2.x,l2=(z2=J.arrow)==null?void 0:z2.y,n2=((Y2=J.arrow)==null?void 0:Y2.centerOffset)!==0,[d2,g2]=y.useState();return x1(()=>{C&&g2(window.getComputedStyle(C).zIndex)},[C]),I.jsx("div",{ref:W.setFloating,"data-radix-popper-content-wrapper":"",style:{...a2,transform:t2?a2.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:d2,"--radix-popper-transform-origin":[(L2=J.transformOrigin)==null?void 0:L2.x,(J2=J.transformOrigin)==null?void 0:J2.y].join(" "),...((u0=J.hide)==null?void 0:u0.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:I.jsx(sV,{scope:a,placedSide:v2,onArrowChange:w,arrowX:K,arrowY:l2,shouldHideArrow:n2,children:I.jsx(i0.div,{"data-side":v2,"data-align":F,...S,ref:x,style:{...S.style,animation:t2?void 0:"none"}})})})});Ty.displayName=od;var ky="PopperArrow",oV={top:"bottom",right:"left",bottom:"top",left:"right"},Dy=y.forwardRef(function(t,a){const{__scopePopper:n,...r}=t,s=cV(ky,n),o=oV[s.placedSide];return I.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:I.jsx(lV,{...r,ref:a,style:{...r.style,display:"block"}})})});Dy.displayName=ky;function uV(e){return e!==null}var hV=e=>({name:"transformOrigin",options:e,fn(t){var z,C,M;const{placement:a,rects:n,middlewareData:r}=t,o=((z=r.arrow)==null?void 0:z.centerOffset)!==0,u=o?0:e.arrowWidth,d=o?0:e.arrowHeight,[f,v]=By(a),p={start:"0%",center:"50%",end:"100%"}[v],A=(((C=r.arrow)==null?void 0:C.x)??0)+u/2,E=(((M=r.arrow)==null?void 0:M.y)??0)+d/2;let _="",S="";return f==="bottom"?(_=o?p:`${A}px`,S=`${-d}px`):f==="top"?(_=o?p:`${A}px`,S=`${n.floating.height+d}px`):f==="right"?(_=`${-d}px`,S=o?p:`${E}px`):f==="left"&&(_=`${n.floating.width+d}px`,S=o?p:`${E}px`),{data:{x:_,y:S}}}});function By(e){const[t,a="center"]=e.split("-");return[t,a]}var dV=xy,fV=by,mV=Ty,vV=Dy;function pV(e){const t=y.useRef({value:e,previous:e});return y.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var AV=[" ","Enter","ArrowUp","ArrowDown"],gV=[" ","Enter"],si="Select",[Go,jo,EV]=PN(si),[z4,un2]=ti(si,[EV,My]),Ko=My(),[_V,Gt]=z4(si),[IV,NV]=z4(si),Ly=e=>{const{__scopeSelect:t,children:a,open:n,defaultOpen:r,onOpenChange:s,value:o,defaultValue:u,onValueChange:d,dir:f,name:v,autoComplete:p,disabled:A,required:E,form:_}=e,S=Ko(t),[z,C]=y.useState(null),[M,x]=y.useState(null),[D,w]=y.useState(!1),b=rU(f),[T=!1,O]=bc({prop:n,defaultProp:r,onChange:s}),[H,U]=bc({prop:o,defaultProp:u,onChange:d}),f2=y.useRef(null),s2=z?_||!!z.closest("form"):!0,[h2,W]=y.useState(new Set),a2=Array.from(h2).map(V=>V.props.value).join(";");return I.jsx(dV,{...S,children:I.jsxs(_V,{required:E,scope:t,trigger:z,onTriggerChange:C,valueNode:M,onValueNodeChange:x,valueNodeHasChildren:D,onValueNodeHasChildrenChange:w,contentId:Ce(),value:H,onValueChange:U,open:T,onOpenChange:O,dir:b,triggerPointerDownPosRef:f2,disabled:A,children:[I.jsx(Go.Provider,{scope:t,children:I.jsx(IV,{scope:e.__scopeSelect,onNativeOptionAdd:y.useCallback(V=>{W(t2=>new Set(t2).add(V))},[]),onNativeOptionRemove:y.useCallback(V=>{W(t2=>{const J=new Set(t2);return J.delete(V),J})},[]),children:a})}),s2?I.jsxs(cz,{"aria-hidden":!0,required:E,tabIndex:-1,name:v,autoComplete:p,value:H,onChange:V=>U(V.target.value),disabled:A,form:_,children:[H===void 0?I.jsx("option",{value:""}):null,Array.from(h2)]},a2):null]})})};Ly.displayName=si;var Oy="SelectTrigger",Fy=y.forwardRef((e,t)=>{const{__scopeSelect:a,disabled:n=!1,...r}=e,s=Ko(a),o=Gt(Oy,a),u=o.disabled||n,d=B0(t,o.onTriggerChange),f=jo(a),v=y.useRef("touch"),[p,A,E]=oz(S=>{const z=f().filter(x=>!x.disabled),C=z.find(x=>x.value===o.value),M=uz(z,S,C);M!==void 0&&o.onValueChange(M.value)}),_=S=>{u||(o.onOpenChange(!0),E()),S&&(o.triggerPointerDownPosRef.current={x:Math.round(S.pageX),y:Math.round(S.pageY)})};return I.jsx(fV,{asChild:!0,...s,children:I.jsx(i0.button,{type:"button",role:"combobox","aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:u,"data-disabled":u?"":void 0,"data-placeholder":sz(o.value)?"":void 0,...r,ref:d,onClick:m0(r.onClick,S=>{S.currentTarget.focus(),v.current!=="mouse"&&_(S)}),onPointerDown:m0(r.onPointerDown,S=>{v.current=S.pointerType;const z=S.target;z.hasPointerCapture(S.pointerId)&&z.releasePointerCapture(S.pointerId),S.button===0&&S.ctrlKey===!1&&S.pointerType==="mouse"&&(_(S),S.preventDefault())}),onKeyDown:m0(r.onKeyDown,S=>{const z=p.current!=="";!(S.ctrlKey||S.altKey||S.metaKey)&&S.key.length===1&&A(S.key),!(z&&S.key===" ")&&AV.includes(S.key)&&(_(),S.preventDefault())})})})});Fy.displayName=Oy;var Hy="SelectValue",Py=y.forwardRef((e,t)=>{const{__scopeSelect:a,className:n,style:r,children:s,placeholder:o="",...u}=e,d=Gt(Hy,a),{onValueNodeHasChildrenChange:f}=d,v=s!==void 0,p=B0(t,d.onValueNodeChange);return x1(()=>{f(v)},[f,v]),I.jsx(i0.span,{...u,ref:p,style:{pointerEvents:"none"},children:sz(d.value)?I.jsx(I.Fragment,{children:o}):s})});Py.displayName=Hy;var SV="SelectIcon",Uy=y.forwardRef((e,t)=>{const{__scopeSelect:a,children:n,...r}=e;return I.jsx(i0.span,{"aria-hidden":!0,...r,ref:t,children:n||"▼"})});Uy.displayName=SV;var yV="SelectPortal",Vy=e=>I.jsx(bo,{asChild:!0,...e});Vy.displayName=yV;var Pa="SelectContent",Gy=y.forwardRef((e,t)=>{const a=Gt(Pa,e.__scopeSelect),[n,r]=y.useState();if(x1(()=>{r(new DocumentFragment)},[]),!a.open){const s=n;return s?$a.createPortal(I.jsx(jy,{scope:e.__scopeSelect,children:I.jsx(Go.Slot,{scope:e.__scopeSelect,children:I.jsx("div",{children:e.children})})}),s):null}return I.jsx(Ky,{...e,ref:t})});Gy.displayName=Pa;var De=10,[jy,jt]=z4(Pa),zV="SelectContentImpl",Ky=y.forwardRef((e,t)=>{const{__scopeSelect:a,position:n="item-aligned",onCloseAutoFocus:r,onEscapeKeyDown:s,onPointerDownOutside:o,side:u,sideOffset:d,align:f,alignOffset:v,arrowPadding:p,collisionBoundary:A,collisionPadding:E,sticky:_,hideWhenDetached:S,avoidCollisions:z,...C}=e,M=Gt(Pa,a),[x,D]=y.useState(null),[w,b]=y.useState(null),T=B0(t,A2=>D(A2)),[O,H]=y.useState(null),[U,f2]=y.useState(null),s2=jo(a),[h2,W]=y.useState(!1),a2=y.useRef(!1);y.useEffect(()=>{if(x)return $S(x)},[x]),FS();const V=y.useCallback(A2=>{const[z2,...Y2]=s2().map(u0=>u0.ref.current),[L2]=Y2.slice(-1),J2=document.activeElement;for(const u0 of A2)if(u0===J2||(u0==null||u0.scrollIntoView({block:"nearest"}),u0===z2&&w&&(w.scrollTop=0),u0===L2&&w&&(w.scrollTop=w.scrollHeight),u0==null||u0.focus(),document.activeElement!==J2))return},[s2,w]),t2=y.useCallback(()=>V([O,x]),[V,O,x]);y.useEffect(()=>{h2&&t2()},[h2,t2]);const{onOpenChange:J,triggerPointerDownPosRef:v2}=M;y.useEffect(()=>{if(x){let A2={x:0,y:0};const z2=L2=>{var J2,u0;A2={x:Math.abs(Math.round(L2.pageX)-(((J2=v2.current)==null?void 0:J2.x)??0)),y:Math.abs(Math.round(L2.pageY)-(((u0=v2.current)==null?void 0:u0.y)??0))}},Y2=L2=>{A2.x<=10&&A2.y<=10?L2.preventDefault():x.contains(L2.target)||J(!1),document.removeEventListener("pointermove",z2),v2.current=null};return v2.current!==null&&(document.addEventListener("pointermove",z2),document.addEventListener("pointerup",Y2,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",z2),document.removeEventListener("pointerup",Y2,{capture:!0})}}},[x,J,v2]),y.useEffect(()=>{const A2=()=>J(!1);return window.addEventListener("blur",A2),window.addEventListener("resize",A2),()=>{window.removeEventListener("blur",A2),window.removeEventListener("resize",A2)}},[J]);const[F,q]=oz(A2=>{const z2=s2().filter(J2=>!J2.disabled),Y2=z2.find(J2=>J2.ref.current===document.activeElement),L2=uz(z2,A2,Y2);L2&&setTimeout(()=>L2.ref.current.focus())}),K=y.useCallback((A2,z2,Y2)=>{const L2=!a2.current&&!Y2;(M.value!==void 0&&M.value===z2||L2)&&(H(A2),L2&&(a2.current=!0))},[M.value]),l2=y.useCallback(()=>x==null?void 0:x.focus(),[x]),n2=y.useCallback((A2,z2,Y2)=>{const L2=!a2.current&&!Y2;(M.value!==void 0&&M.value===z2||L2)&&f2(A2)},[M.value]),d2=n==="popper"?g8:$y,g2=d2===g8?{side:u,sideOffset:d,align:f,alignOffset:v,arrowPadding:p,collisionBoundary:A,collisionPadding:E,sticky:_,hideWhenDetached:S,avoidCollisions:z}:{};return I.jsx(jy,{scope:a,content:x,viewport:w,onViewportChange:b,itemRefCallback:K,selectedItem:O,onItemLeave:l2,itemTextRefCallback:n2,focusSelectedItem:t2,selectedItemText:U,position:n,isPositioned:h2,searchRef:F,children:I.jsx(Zh,{as:Ba,allowPinchZoom:!0,children:I.jsx(Yh,{asChild:!0,trapped:M.open,onMountAutoFocus:A2=>{A2.preventDefault()},onUnmountAutoFocus:m0(r,A2=>{var z2;(z2=M.trigger)==null||z2.focus({preventScroll:!0}),A2.preventDefault()}),children:I.jsx(wo,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:o,onFocusOutside:A2=>A2.preventDefault(),onDismiss:()=>M.onOpenChange(!1),children:I.jsx(d2,{role:"listbox",id:M.contentId,"data-state":M.open?"open":"closed",dir:M.dir,onContextMenu:A2=>A2.preventDefault(),...C,...g2,onPlaced:()=>W(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:m0(C.onKeyDown,A2=>{const z2=A2.ctrlKey||A2.altKey||A2.metaKey;if(A2.key==="Tab"&&A2.preventDefault(),!z2&&A2.key.length===1&&q(A2.key),["ArrowUp","ArrowDown","Home","End"].includes(A2.key)){let L2=s2().filter(J2=>!J2.disabled).map(J2=>J2.ref.current);if(["ArrowUp","End"].includes(A2.key)&&(L2=L2.slice().reverse()),["ArrowUp","ArrowDown"].includes(A2.key)){const J2=A2.target,u0=L2.indexOf(J2);L2=L2.slice(u0+1)}setTimeout(()=>V(L2)),A2.preventDefault()}})})})})})})});Ky.displayName=zV;var CV="SelectItemAlignedPosition",$y=y.forwardRef((e,t)=>{const{__scopeSelect:a,onPlaced:n,...r}=e,s=Gt(Pa,a),o=jt(Pa,a),[u,d]=y.useState(null),[f,v]=y.useState(null),p=B0(t,T=>v(T)),A=jo(a),E=y.useRef(!1),_=y.useRef(!0),{viewport:S,selectedItem:z,selectedItemText:C,focusSelectedItem:M}=o,x=y.useCallback(()=>{if(s.trigger&&s.valueNode&&u&&f&&S&&z&&C){const T=s.trigger.getBoundingClientRect(),O=f.getBoundingClientRect(),H=s.valueNode.getBoundingClientRect(),U=C.getBoundingClientRect();if(s.dir!=="rtl"){const J2=U.left-O.left,u0=H.left-J2,M0=T.left-u0,l1=T.width+M0,Re=Math.max(l1,O.width),K1=window.innerWidth-De,je=xA(u0,[De,Math.max(De,K1-Re)]);u.style.minWidth=l1+"px",u.style.left=je+"px"}else{const J2=O.right-U.right,u0=window.innerWidth-H.right-J2,M0=window.innerWidth-T.right-u0,l1=T.width+M0,Re=Math.max(l1,O.width),K1=window.innerWidth-De,je=xA(u0,[De,Math.max(De,K1-Re)]);u.style.minWidth=l1+"px",u.style.right=je+"px"}const f2=A(),s2=window.innerHeight-De*2,h2=S.scrollHeight,W=window.getComputedStyle(f),a2=parseInt(W.borderTopWidth,10),V=parseInt(W.paddingTop,10),t2=parseInt(W.borderBottomWidth,10),J=parseInt(W.paddingBottom,10),v2=a2+V+h2+J+t2,F=Math.min(z.offsetHeight*5,v2),q=window.getComputedStyle(S),K=parseInt(q.paddingTop,10),l2=parseInt(q.paddingBottom,10),n2=T.top+T.height/2-De,d2=s2-n2,g2=z.offsetHeight/2,A2=z.offsetTop+g2,z2=a2+V+A2,Y2=v2-z2;if(z2<=n2){const J2=f2.length>0&&z===f2[f2.length-1].ref.current;u.style.bottom="0px";const u0=f.clientHeight-S.offsetTop-S.offsetHeight,M0=Math.max(d2,g2+(J2?l2:0)+u0+t2),l1=z2+M0;u.style.height=l1+"px"}else{const J2=f2.length>0&&z===f2[0].ref.current;u.style.top="0px";const M0=Math.max(n2,a2+S.offsetTop+(J2?K:0)+g2)+Y2;u.style.height=M0+"px",S.scrollTop=z2-n2+S.offsetTop}u.style.margin=`${De}px 0`,u.style.minHeight=F+"px",u.style.maxHeight=s2+"px",n==null||n(),requestAnimationFrame(()=>E.current=!0)}},[A,s.trigger,s.valueNode,u,f,S,z,C,s.dir,n]);x1(()=>x(),[x]);const[D,w]=y.useState();x1(()=>{f&&w(window.getComputedStyle(f).zIndex)},[f]);const b=y.useCallback(T=>{T&&_.current===!0&&(x(),M==null||M(),_.current=!1)},[x,M]);return I.jsx(RV,{scope:a,contentWrapper:u,shouldExpandOnScrollRef:E,onScrollButtonChange:b,children:I.jsx("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:D},children:I.jsx(i0.div,{...r,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...r.style}})})})});$y.displayName=CV;var MV="SelectPopperPosition",g8=y.forwardRef((e,t)=>{const{__scopeSelect:a,align:n="start",collisionPadding:r=De,...s}=e,o=Ko(a);return I.jsx(mV,{...o,...s,ref:t,align:n,collisionPadding:r,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});g8.displayName=MV;var[RV,ud]=z4(Pa,{}),E8="SelectViewport",Yy=y.forwardRef((e,t)=>{const{__scopeSelect:a,nonce:n,...r}=e,s=jt(E8,a),o=ud(E8,a),u=B0(t,s.onViewportChange),d=y.useRef(0);return I.jsxs(I.Fragment,{children:[I.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),I.jsx(Go.Slot,{scope:a,children:I.jsx(i0.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:u,style:{position:"relative",flex:1,overflow:"hidden auto",...r.style},onScroll:m0(r.onScroll,f=>{const v=f.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:A}=o;if(A!=null&&A.current&&p){const E=Math.abs(d.current-v.scrollTop);if(E>0){const _=window.innerHeight-De*2,S=parseFloat(p.style.minHeight),z=parseFloat(p.style.height),C=Math.max(S,z);if(C<_){const M=C+E,x=Math.min(_,M),D=M-x;p.style.height=x+"px",p.style.bottom==="0px"&&(v.scrollTop=D>0?D:0,p.style.justifyContent="flex-end")}}}d.current=v.scrollTop})})})]})});Yy.displayName=E8;var Zy="SelectGroup",[xV,wV]=z4(Zy),Wy=y.forwardRef((e,t)=>{const{__scopeSelect:a,...n}=e,r=Ce();return I.jsx(xV,{scope:a,id:r,children:I.jsx(i0.div,{role:"group","aria-labelledby":r,...n,ref:t})})});Wy.displayName=Zy;var qy="SelectLabel",Xy=y.forwardRef((e,t)=>{const{__scopeSelect:a,...n}=e,r=wV(qy,a);return I.jsx(i0.div,{id:r.id,...n,ref:t})});Xy.displayName=qy;var Vc="SelectItem",[bV,Qy]=z4(Vc),Jy=y.forwardRef((e,t)=>{const{__scopeSelect:a,value:n,disabled:r=!1,textValue:s,...o}=e,u=Gt(Vc,a),d=jt(Vc,a),f=u.value===n,[v,p]=y.useState(s??""),[A,E]=y.useState(!1),_=B0(t,M=>{var x;return(x=d.itemRefCallback)==null?void 0:x.call(d,M,n,r)}),S=Ce(),z=y.useRef("touch"),C=()=>{r||(u.onValueChange(n),u.onOpenChange(!1))};if(n==="")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 I.jsx(bV,{scope:a,value:n,disabled:r,textId:S,isSelected:f,onItemTextChange:y.useCallback(M=>{p(x=>x||((M==null?void 0:M.textContent)??"").trim())},[]),children:I.jsx(Go.ItemSlot,{scope:a,value:n,disabled:r,textValue:v,children:I.jsx(i0.div,{role:"option","aria-labelledby":S,"data-highlighted":A?"":void 0,"aria-selected":f&&A,"data-state":f?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1,...o,ref:_,onFocus:m0(o.onFocus,()=>E(!0)),onBlur:m0(o.onBlur,()=>E(!1)),onClick:m0(o.onClick,()=>{z.current!=="mouse"&&C()}),onPointerUp:m0(o.onPointerUp,()=>{z.current==="mouse"&&C()}),onPointerDown:m0(o.onPointerDown,M=>{z.current=M.pointerType}),onPointerMove:m0(o.onPointerMove,M=>{var x;z.current=M.pointerType,r?(x=d.onItemLeave)==null||x.call(d):z.current==="mouse"&&M.currentTarget.focus({preventScroll:!0})}),onPointerLeave:m0(o.onPointerLeave,M=>{var x;M.currentTarget===document.activeElement&&((x=d.onItemLeave)==null||x.call(d))}),onKeyDown:m0(o.onKeyDown,M=>{var D;((D=d.searchRef)==null?void 0:D.current)!==""&&M.key===" "||(gV.includes(M.key)&&C(),M.key===" "&&M.preventDefault())})})})})});Jy.displayName=Vc;var $l="SelectItemText",ez=y.forwardRef((e,t)=>{const{__scopeSelect:a,className:n,style:r,...s}=e,o=Gt($l,a),u=jt($l,a),d=Qy($l,a),f=NV($l,a),[v,p]=y.useState(null),A=B0(t,C=>p(C),d.onItemTextChange,C=>{var M;return(M=u.itemTextRefCallback)==null?void 0:M.call(u,C,d.value,d.disabled)}),E=v==null?void 0:v.textContent,_=y.useMemo(()=>I.jsx("option",{value:d.value,disabled:d.disabled,children:E},d.value),[d.disabled,d.value,E]),{onNativeOptionAdd:S,onNativeOptionRemove:z}=f;return x1(()=>(S(_),()=>z(_)),[S,z,_]),I.jsxs(I.Fragment,{children:[I.jsx(i0.span,{id:d.textId,...s,ref:A}),d.isSelected&&o.valueNode&&!o.valueNodeHasChildren?$a.createPortal(s.children,o.valueNode):null]})});ez.displayName=$l;var tz="SelectItemIndicator",az=y.forwardRef((e,t)=>{const{__scopeSelect:a,...n}=e;return Qy(tz,a).isSelected?I.jsx(i0.span,{"aria-hidden":!0,...n,ref:t}):null});az.displayName=tz;var _8="SelectScrollUpButton",nz=y.forwardRef((e,t)=>{const a=jt(_8,e.__scopeSelect),n=ud(_8,e.__scopeSelect),[r,s]=y.useState(!1),o=B0(t,n.onScrollButtonChange);return x1(()=>{if(a.viewport&&a.isPositioned){let u=function(){const f=d.scrollTop>0;s(f)};const d=a.viewport;return u(),d.addEventListener("scroll",u),()=>d.removeEventListener("scroll",u)}},[a.viewport,a.isPositioned]),r?I.jsx(rz,{...e,ref:o,onAutoScroll:()=>{const{viewport:u,selectedItem:d}=a;u&&d&&(u.scrollTop=u.scrollTop-d.offsetHeight)}}):null});nz.displayName=_8;var I8="SelectScrollDownButton",lz=y.forwardRef((e,t)=>{const a=jt(I8,e.__scopeSelect),n=ud(I8,e.__scopeSelect),[r,s]=y.useState(!1),o=B0(t,n.onScrollButtonChange);return x1(()=>{if(a.viewport&&a.isPositioned){let u=function(){const f=d.scrollHeight-d.clientHeight,v=Math.ceil(d.scrollTop)<f;s(v)};const d=a.viewport;return u(),d.addEventListener("scroll",u),()=>d.removeEventListener("scroll",u)}},[a.viewport,a.isPositioned]),r?I.jsx(rz,{...e,ref:o,onAutoScroll:()=>{const{viewport:u,selectedItem:d}=a;u&&d&&(u.scrollTop=u.scrollTop+d.offsetHeight)}}):null});lz.displayName=I8;var rz=y.forwardRef((e,t)=>{const{__scopeSelect:a,onAutoScroll:n,...r}=e,s=jt("SelectScrollButton",a),o=y.useRef(null),u=jo(a),d=y.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return y.useEffect(()=>()=>d(),[d]),x1(()=>{var v;const f=u().find(p=>p.ref.current===document.activeElement);(v=f==null?void 0:f.ref.current)==null||v.scrollIntoView({block:"nearest"})},[u]),I.jsx(i0.div,{"aria-hidden":!0,...r,ref:t,style:{flexShrink:0,...r.style},onPointerDown:m0(r.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(n,50))}),onPointerMove:m0(r.onPointerMove,()=>{var f;(f=s.onItemLeave)==null||f.call(s),o.current===null&&(o.current=window.setInterval(n,50))}),onPointerLeave:m0(r.onPointerLeave,()=>{d()})})}),TV="SelectSeparator",iz=y.forwardRef((e,t)=>{const{__scopeSelect:a,...n}=e;return I.jsx(i0.div,{"aria-hidden":!0,...n,ref:t})});iz.displayName=TV;var N8="SelectArrow",kV=y.forwardRef((e,t)=>{const{__scopeSelect:a,...n}=e,r=Ko(a),s=Gt(N8,a),o=jt(N8,a);return s.open&&o.position==="popper"?I.jsx(vV,{...r,...n,ref:t}):null});kV.displayName=N8;function sz(e){return e===""||e===void 0}var cz=y.forwardRef((e,t)=>{const{value:a,...n}=e,r=y.useRef(null),s=B0(t,r),o=pV(a);return y.useEffect(()=>{const u=r.current,d=window.HTMLSelectElement.prototype,v=Object.getOwnPropertyDescriptor(d,"value").set;if(o!==a&&v){const p=new Event("change",{bubbles:!0});v.call(u,a),u.dispatchEvent(p)}},[o,a]),I.jsx(To,{asChild:!0,children:I.jsx("select",{...n,ref:s,defaultValue:a})})});cz.displayName="BubbleSelect";function oz(e){const t=re(e),a=y.useRef(""),n=y.useRef(0),r=y.useCallback(o=>{const u=a.current+o;t(u),function d(f){a.current=f,window.clearTimeout(n.current),f!==""&&(n.current=window.setTimeout(()=>d(""),1e3))}(u)},[t]),s=y.useCallback(()=>{a.current="",window.clearTimeout(n.current)},[]);return y.useEffect(()=>()=>window.clearTimeout(n.current),[]),[a,r,s]}function uz(e,t,a){const r=t.length>1&&Array.from(t).every(f=>f===t[0])?t[0]:t,s=a?e.indexOf(a):-1;let o=DV(e,Math.max(s,0));r.length===1&&(o=o.filter(f=>f!==a));const d=o.find(f=>f.textValue.toLowerCase().startsWith(r.toLowerCase()));return d!==a?d:void 0}function DV(e,t){return e.map((a,n)=>e[(t+n)%e.length])}var BV=Ly,LV=Fy,OV=Py,FV=Uy,HV=Vy,PV=Gy,UV=Yy,VV=Wy,GV=Xy,jV=Jy,KV=ez,$V=az,YV=nz,ZV=lz,WV=iz;const qV=BV,XV=VV,QV=OV,JV=({validationStyleEnabled:e=!1,className:t,children:a,...n})=>I.jsxs(LV,{className:C2("border-input ring-offset-background placeholder:text-muted-foreground focus:ring-ring focus:outline-hidden flex w-full items-center justify-between whitespace-nowrap rounded-md border px-3 py-2 text-sm focus:ring-1 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1","bg-input-background text-input-text w-full select-text resize-none rounded-xl border-2 px-2 py-1 text-sm shadow-none outline-0 transition-all","border-input-border hover:border-input-border-hover focus:border-input-border-focus focus:outline-0 focus:[box-shadow:none]","aria-[invalid=true]:border-error",e&&"valid:border-success invalid:border-error",t),...n,children:[a,I.jsx(FV,{asChild:!0,children:I.jsx(cL,{className:"size-4 opacity-50"})})]}),hz=({className:e,...t})=>I.jsx(YV,{className:C2("flex cursor-default items-center justify-center py-1",e),...t,children:I.jsx(iL,{})}),dz=({className:e,...t})=>I.jsx(ZV,{className:C2("flex cursor-default items-center justify-center py-1",e),...t,children:I.jsx(RN,{})}),eG=({className:e,children:t,position:a="popper",...n})=>I.jsx(HV,{children:I.jsxs(PV,{className:C2("bg-input-background text-input-text w-full select-text resize-none rounded-xl border-2 p-1 text-sm shadow-none outline-0 transition-all","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 relative z-50 max-h-96 min-w-[8rem] overflow-hidden border shadow-md",a==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:a,...n,children:[I.jsx(hz,{}),I.jsx(UV,{className:C2("p-1",a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),I.jsx(dz,{})]})}),tG=({className:e,...t})=>I.jsx(GV,{className:C2("px-1 py-0.5 text-sm font-semibold",e),...t}),aG=({className:e,children:t,...a})=>I.jsxs(jV,{className:C2("focus:bg-neutral/10 outline-hidden relative flex w-full cursor-pointer select-none items-center rounded-lg py-1.5 pl-2 pr-8 text-sm data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...a,children:[I.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:I.jsx($V,{children:I.jsx(I4,{className:"size-4"})})}),I.jsx(KV,{children:t})]}),nG=({className:e,...t})=>I.jsx(WV,{className:C2("-mx-1 my-1 h-px bg-red-300",e),...t}),F2=qV;F2.Group=XV;F2.Value=QV;F2.Trigger=JV;F2.ScrollUpButton=hz;F2.ScrollDownButton=dz;F2.Content=eG;F2.Label=tG;F2.Item=aG;F2.Separator=nG;const lG=e=>(e==null?void 0:e.getAttribute("aria-selected"))==="true",rG=(e,t=lG,a=!1)=>{const[n,r]=y.useState(null),[s,o]=y.useState(null),u=e.current.length;return y.useEffect(()=>{const d=()=>{let S=null;if(s?S=s:S=e.current.find(t)??null,!S){r(M=>({left:0,width:0,...M,opacity:0}));return}const z=S.offsetLeft,C=S.offsetWidth;r({left:z,width:C,opacity:1})};d(),window.addEventListener("resize",d),window.addEventListener("DOMContentLoaded",d);const f=[];e.current.forEach(S=>{if(S){const z=new MutationObserver(C=>{for(const M of C)if(M.type==="attributes"&&M.attributeName==="aria-selected"){d();break}});z.observe(S,{attributes:!0,attributeFilter:["aria-selected"]}),f.push(z)}});const v=[],p=S=>{if(!S)return;const z=new ResizeObserver(()=>{d()});z.observe(S),v.push(z)},A=e.current.find(t)??null;A&&p(A),s&&p(s);const E=S=>{o(S.currentTarget)},_=()=>{o(null)};return a&&e.current.forEach(S=>{S==null||S.addEventListener("mouseenter",E),S==null||S.addEventListener("mouseleave",_)}),()=>{window.removeEventListener("resize",d),window.removeEventListener("DOMContentLoaded",d),f.forEach(S=>S.disconnect()),v.forEach(S=>S.disconnect()),e.current.forEach(S=>{S==null||S.removeEventListener("mouseenter",E),S==null||S.removeEventListener("mouseleave",_)})}},[e,t,s,u]),{choiceIndicatorPosition:n}},iG=[{content:"Off",value:!1},{content:"On",value:!0}],sG=Me("flex flex-row gap-2 rounded-full w-fit border-[1.5px] p-[1.5px]",{variants:{color:{primary:"border-primary text-primary",secondary:"border-secondary text-secondary",destructive:"border-destructive bg-destructive text-destructive",neutral:"border-neutral text-neutral ",light:"border-white text-white",dark:"border-neutral-800 text-neutral-800",text:"border-text text-text"}},defaultVariants:{color:"primary"}}),cG=Me("z-1 w-full flex-1 text-sm font-medium transition-all duration-300 ease-in-out aria-selected:cursor-default aria-selected:text-text-opposite motion-reduce:transition-none",{variants:{size:{sm:"py-1 px-2 text-xs",md:"p-2 text-sm",lg:"p-4 text-base"}},defaultVariants:{size:"md"}}),oG=Me("absolute top-0 z-[-1] h-full w-auto rounded-full transition-[left,width] duration-300 ease-in-out motion-reduce:transition-none",{variants:{color:{primary:"bg-primary aria-selected:text-text",secondary:"bg-secondary aria-selected:text-text",destructive:"bg-destructive aria-selected:text-text",neutral:"bg-neutral aria-selected:text-white ",light:"bg-white aria-selected:text-black",dark:"bg-neutral-800 aria-selected:text-white",text:"bg-text aria-selected:text-text-opposite"}}}),ci=({choices:e=iG,value:t,defaultValue:a,onChange:n,color:r="primary",size:s="md",className:o})=>{const[u,d]=y.useState(t??a??e[0].value),f=y.useRef([]),v=y.useRef(null),{choiceIndicatorPosition:p}=rG(f),A=E=>{d(E),n==null||n(E)};return y.useEffect(()=>{t!==void 0&&d(t)},[t]),I.jsx("div",{className:sG({color:r,className:o}),role:"tablist",children:I.jsxs("div",{className:"relative flex size-full flex-row items-center justify-center",children:[e.map((E,_)=>{const{content:S,value:z,...C}=E,M=typeof z=="string"||typeof z=="number",x=z===u;return y.createElement("button",{...C,className:C2(cG({size:s})),key:M?z:_,role:"tab",onClick:()=>A(z),"aria-selected":x,disabled:x,ref:D=>{f.current[_]=D}},S)}),p&&I.jsx("div",{className:C2(oG({color:r})),style:p,ref:v})]})})};var uG=function(e,t){for(var a={};e.length;){var n=e[0],r=n.code,s=n.message,o=n.path.join(".");if(!a[o])if("unionErrors"in n){var u=n.unionErrors[0].errors[0];a[o]={message:u.message,type:u.code}}else a[o]={message:s,type:r};if("unionErrors"in n&&n.unionErrors.forEach(function(v){return v.errors.forEach(function(p){return e.push(p)})}),t){var d=a[o].types,f=d&&d[n.code];a[o]=NS(o,t,a,r,f?[].concat(f,n.message):n.message)}e.shift()}return a},hG=function(e,t,a){return a===void 0&&(a={}),function(n,r,s){try{return Promise.resolve(function(o,u){try{var d=Promise.resolve(e[a.mode==="sync"?"parse":"parseAsync"](n,t)).then(function(f){return s.shouldUseNativeValidation&&xS({},s),{errors:{},values:a.raw?n:f}})}catch(f){return u(f)}return d&&d.then?d.then(void 0,u):d}(0,function(o){if(function(u){return Array.isArray(u==null?void 0:u.errors)}(o))return{values:{},errors:aH(uG(o.errors,!s.shouldUseNativeValidation&&s.criteriaMode==="all"),s)};throw o}))}catch(o){return Promise.reject(o)}}};const s7=async e=>{e&&typeof e.then=="function"&&await e},dG=({schema:e,onSubmit:t,onSubmitSuccess:a,onSubmitError:n,className:r,children:s,autoComplete:o,...u})=>{const d=async f=>{const v=(e==null?void 0:e.safeParse(f))??{success:!0,data:void 0};await s7(t==null?void 0:t(f)),v.success?await s7(a==null?void 0:a(v.data)):await s7(n==null?void 0:n(new Error(v.error.errors.map(p=>p.message).join(", "))))};return I.jsx(HF,{...u,children:I.jsx("form",{className:C2("flex size-full flex-col gap-y-6",r),onSubmit:u.handleSubmit(d),autoComplete:o?"on":"off",children:s})})},fG=(e,t)=>{const a=tH({resolver:hG(e),...t}),n=a.formState.isSubmitting,r=a.formState.isSubmitted,s=a.formState.isLoading,o=a.formState.isValid;return{form:a,isSubmitting:n,isSubmitted:r,isLoading:s,isValid:o}},mG=e=>{const{error:t,formItemId:a,formDescriptionId:n,formMessageId:r}=Vt();return I.jsx(Ba,{id:a,"aria-describedby":t?`${n} ${r}`:`${n}`,"aria-invalid":!!t,...e})},vG=e=>{const{formDescriptionId:t}=Vt();return I.jsx("p",{className:"text-neutral text-sm",id:t,...e})},pG=({children:e,...t})=>{const{error:a,formMessageId:n}=Vt(),r=a?String((a==null?void 0:a.message)??""):e;return r?I.jsx("p",{className:"text-error text-xs font-medium",role:"alert",id:n,...t,children:r}):null},$o=({label:e,description:t,isRequired:a,info:n,children:r,showErrorMessage:s=!0,htmlFor:o})=>I.jsxs(o0.Item,{className:"flex w-full flex-col gap-2 p-2",children:[(t||e)&&I.jsxs("div",{className:"flex flex-col gap-1 p-1 leading-none",children:[e&&I.jsx(my,{isRequired:a,info:n,htmlFor:o,children:e}),t&&I.jsx(o0.Description,{children:t})]}),I.jsx(o0.Control,{children:r}),s&&I.jsx(o0.Message,{"data-testid":"error-message"})]}),AG=({field:e,name:t,label:a,Element:n,isRequired:r=!1,info:s,description:o,showErrorMessage:u=!0,...d})=>{const{error:f}=Vt();return I.jsx($o,{htmlFor:t,label:a,description:o,isRequired:r,info:s,showErrorMessage:u,"aria-invalid":!!f,children:I.jsx(n,{"data-testid":"element",id:t,...e,...d,children:d.children})})},Kt=e=>{const{control:t}=Ut();return I.jsx(o0.Field,{control:t,name:e.name,render:({field:a})=>I.jsx(AG,{...e,field:a})})},gG=e=>I.jsx(Kt,{id:e.name,"data-testid":e.name,Element:N4,...e}),EG=({autoComplete:e,...t})=>I.jsx(Kt,{Element:cH,id:t.name,"data-testid":t.name,autoComplete:e,minLength:6,maxLength:255,...t}),_G=e=>I.jsx(Kt,{Element:kS,id:e.name,"data-testid":e.name,...e}),IG=e=>I.jsx(Kt,{id:e.name,"data-testid":e.name,Element:BS,...e}),NG=e=>I.jsx(Kt,{id:e.name,"data-testid":e.name,Element:LS,...e}),SG=e=>I.jsx(Kt,{Element:$h,id:e.name,"data-testid":e.name,...e}),yG=({inputLabel:e,...t})=>I.jsx(sH,{...t,label:e}),zG=({autoComplete:e,...t})=>I.jsx(Kt,{Element:yG,id:t.name,"data-testid":t.name,autoComplete:e,minLength:6,maxLength:255,...t}),CG=({name:e,description:t,label:a,isRequired:n,info:r,showErrorMessage:s,children:o,...u})=>{const{control:d}=Ut();return I.jsx(o0.Field,{control:d,name:e,render:({field:f})=>{const{error:v}=Vt();return I.jsx($o,{htmlFor:e,label:a,description:t,isRequired:n,info:r,showErrorMessage:s,"aria-invalid":!!v,children:I.jsx(z1,{onValueChange:f.onChange,values:f.value,...u,children:o})})}})},MG=({name:e,description:t,label:a,isRequired:n,info:r,showErrorMessage:s,children:o,...u})=>{const{control:d}=Ut();return I.jsx(o0.Field,{control:d,name:e,render:({field:f})=>{const{error:v}=Vt();return I.jsx($o,{htmlFor:e,label:a,description:t,isRequired:n,info:r,showErrorMessage:s,"aria-invalid":!!v,children:I.jsx(F2,{onValueChange:f.onChange,defaultValue:f.value,...u,children:o})})}})},RG=({name:e,description:t,label:a,isRequired:n,info:r,showErrorMessage:s,children:o,...u})=>{const{control:d}=Ut();return I.jsx(o0.Field,{control:d,name:e,render:({field:f})=>{const{error:v}=Vt();return I.jsx($o,{htmlFor:e,label:a,description:t,isRequired:n,info:r,showErrorMessage:s,"aria-invalid":!!v,children:I.jsx(ci,{...f,...u,children:o})})}})},o0=dG;o0.Description=vG;o0.Control=mG;o0.Field=rH;o0.Item=lH;o0.Label=my;o0.Message=pG;o0.Element=Kt;o0.Input=gG;o0.InputPassword=EG;o0.Checkbox=zG;o0.TextArea=_G;o0.AutoSizedTextArea=SG;o0.Button=_0;o0.Select=MG;o0.MultiSelect=CG;o0.EditableFieldInput=IG;o0.EditableFieldTextArea=NG;o0.SwitchSelector=RG;j({en:"Forgot your password?","en-GB":"Forgot your password?",fr:"Mot de passe oublié ?",es:"¿Olvidaste tu contraseña?",de:"Haben Sie Ihr Passwort vergessen?",ja:"パスワードをお忘れですか?",ko:"비밀번호를 잊으셨나요?",zh:"忘记密码?",it:"Hai dimenticato la password?",pt:"Esqueceu sua senha?",hi:"क्या आपने अपना पासवर्ड भुला दिया?",ar:"نسيت كلمة المرور؟",ru:"Забыли пароль?"}),j({en:"Forgot password?","en-GB":"Forgot password?",fr:"Mot de passe oublié ?",es:"¿Olvidaste tu contraseña?",de:"Passwort vergessen?",ja:"パスワードをお忘れですか?",ko:"비밀번호를 잊으셨나요?",zh:"忘记密码?",it:"Hai dimenticato la password?",pt:"Esqueceu sua senha?",hi:"क्या आपने अपना पासवर्ड भुला दिया?",ar:"نسيت كلمة المرور؟",ru:"Забыли пароль?"}),j({en:"Email address","en-GB":"Email address",fr:"Adresse e-mail",es:"Dirección de correo electrónico",de:"E-Mail-Adresse",ja:"メールアドレス",ko:"이메일 주소",zh:"电子邮件地址",it:"Indirizzo email",pt:"Endereço de e-mail",hi:"ईमेल पता",ar:"عنوان البريد الإلكتروني",ru:"Адрес электронной почты"}),j({en:"Enter e-mail address","en-GB":"Enter e-mail address",fr:"Entrez votre adresse e-mail",es:"Ingrese su dirección de correo electrónico",de:"Geben Sie die E-Mail-Adresse ein",ja:"メールアドレスを入力してください",ko:"이메일 주소를 입력하세요",zh:"请输入电子邮件地址",it:"Inserisci l'indirizzo email",pt:"Digite o endereço de e-mail",hi:"ईमेल पता दर्ज करें",ar:"أدخل عنوان البريد الإلكتروني",ru:"Введите адрес электронной почты"}),j({en:"Password","en-GB":"Password",fr:"Mot de passe",es:"Contraseña",de:"Passwort",ja:"パスワード",ko:"비밀번호",zh:"密码",it:"Password",pt:"Senha",hi:"पासवर्ड",ar:"كلمة المرور",ru:"Пароль"}),j({en:"Enter password","en-GB":"Enter password",fr:"Entrez votre mot de passe",es:"Ingrese su contraseña",de:"Geben Sie das Passwort ein",ja:"パスワードを入力してください",ko:"비밀번호를 입력하세요",zh:"请输入密码",it:"Inserisci la password",pt:"Digite a senha",hi:"पासवर्ड दर्ज करें",ar:"أدخل كلمة المرور",ru:"Введите пароль"}),j({en:"Log in","en-GB":"Log in",fr:"Se connecter",es:"Iniciar sesión",de:"Einloggen",ja:"ログイン",ko:"로그인",zh:"登录",it:"Accedi",pt:"Entrar",hi:"लॉग इन करें",ar:"تسجيل الدخول",ru:"Войти"}),j({en:"Click to log in","en-GB":"Click to log in",fr:"Cliquez pour vous connecter",es:"Haga clic para iniciar sesión",de:"Klicken Sie, um sich anzumelden",ja:"ログインするにはクリックしてください",ko:"로그인하려면 클릭하세요",zh:"点击登录",it:"Clicca per accedere",pt:"Clique para entrar",hi:"लॉग इन करने के लिए क्लिक करें",ar:"انقر لتسجيل الدخول",ru:"Нажмите, чтобы войти"}),j({en:"Log in","en-GB":"Log in",fr:"Se connecter",es:"Iniciar sesión",de:"Einloggen",ja:"ログイン",ko:"로그인",zh:"登录",it:"Accedi",pt:"Entrar",hi:"लॉग इन करें",ar:"تسجيل الدخول",ru:"Войти"}),j({en:"Click to log in","en-GB":"Click to log in",fr:"Cliquez pour vous connecter",es:"Haga clic para iniciar sesión",de:"Klicken Sie, um sich anzumelden",ja:"ログインするにはクリックしてください",ko:"로그인하려면 클릭하세요",zh:"点击登录",it:"Clicca per accedere",pt:"Clique para entrar",hi:"लॉग इन करने के लिए क्लिक करें",ar:"انقر لتسجيل الدخول",ru:"Нажмите, чтобы войти"}),j({en:"Don’t have an account?","en-GB":"Don’t have an account?",fr:"Vous n’avez pas de compte ?",es:"¿No tienes una cuenta?",de:"Haben Sie kein Konto?",ja:"アカウントをお持ちでないですか?",ko:"계정이 없으신가요?",zh:"还没有账户?",it:"Non hai un account?",pt:"Você não tem uma conta?",hi:"क्या आपके पास खाता नहीं है?",ar:"ليس لديك حساب؟",ru:"У вас нет аккаунта?"}),j({en:"Click to go to create an account page","en-GB":"Click to go to create an account page",fr:"Cliquez pour aller à la page de création de compte",es:"Haga clic para ir a la página de creación de cuenta",de:"Klicken Sie, um zur Seite zur Erstellung eines Kontos zu gelangen",ja:"アカウント作成ページに移動するにはクリックしてください",ko:"계정 생성 페이지로 이동하려면 클릭하세요",zh:"单击以转到创建账户页面",it:"Clicca per andare alla pagina di creazione dell'account",pt:"Clique para ir para a página de criação de conta",hi:"खाता बनाने के पृष्ठ पर जाने के लिए क्लिक करें",ar:"انقر للانتقال إلى صفحة إنشاء حساب",ru:"Нажмите, чтобы перейти на страницу создания аккаунта"}),j({en:"Create an account","en-GB":"Create an account",fr:"Créer un compte",es:"Crear una cuenta",de:"Ein Konto erstellen",ja:"アカウントを作成",ko:"계정을 만들다",zh:"创建一个账户",it:"Crea un account",pt:"Criar uma conta",hi:"एक खाता बनाएं",ar:"إنشاء حساب",ru:"Создать аккаунт"});var p0;(function(e){e.assertEqual=r=>r;function t(r){}e.assertIs=t;function a(r){throw new Error}e.assertNever=a,e.arrayToEnum=r=>{const s={};for(const o of r)s[o]=o;return s},e.getValidEnumValues=r=>{const s=e.objectKeys(r).filter(u=>typeof r[r[u]]!="number"),o={};for(const u of s)o[u]=r[u];return e.objectValues(o)},e.objectValues=r=>e.objectKeys(r).map(function(s){return r[s]}),e.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{const s=[];for(const o in r)Object.prototype.hasOwnProperty.call(r,o)&&s.push(o);return s},e.find=(r,s)=>{for(const o of r)if(s(o))return o},e.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&isFinite(r)&&Math.floor(r)===r;function n(r,s=" | "){return r.map(o=>typeof o=="string"?`'${o}'`:o).join(s)}e.joinValues=n,e.jsonStringifyReplacer=(r,s)=>typeof s=="bigint"?s.toString():s})(p0||(p0={}));var S8;(function(e){e.mergeShapes=(t,a)=>({...t,...a})})(S8||(S8={}));const M2=p0.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),D3=e=>{switch(typeof e){case"undefined":return M2.undefined;case"string":return M2.string;case"number":return isNaN(e)?M2.nan:M2.number;case"boolean":return M2.boolean;case"function":return M2.function;case"bigint":return M2.bigint;case"symbol":return M2.symbol;case"object":return Array.isArray(e)?M2.array:e===null?M2.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?M2.promise:typeof Map<"u"&&e instanceof Map?M2.map:typeof Set<"u"&&e instanceof Set?M2.set:typeof Date<"u"&&e instanceof Date?M2.date:M2.object;default:return M2.unknown}},p2=p0.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),xG=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class le extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const a=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,a):this.__proto__=a,this.name="ZodError",this.issues=t}format(t){const a=t||function(s){return s.message},n={_errors:[]},r=s=>{for(const o of s.issues)if(o.code==="invalid_union")o.unionErrors.map(r);else if(o.code==="invalid_return_type")r(o.returnTypeError);else if(o.code==="invalid_arguments")r(o.argumentsError);else if(o.path.length===0)n._errors.push(a(o));else{let u=n,d=0;for(;d<o.path.length;){const f=o.path[d];d===o.path.length-1?(u[f]=u[f]||{_errors:[]},u[f]._errors.push(a(o))):u[f]=u[f]||{_errors:[]},u=u[f],d++}}};return r(this),n}static assert(t){if(!(t instanceof le))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,p0.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=a=>a.message){const a={},n=[];for(const r of this.issues)r.path.length>0?(a[r.path[0]]=a[r.path[0]]||[],a[r.path[0]].push(t(r))):n.push(t(r));return{formErrors:n,fieldErrors:a}}get formErrors(){return this.flatten()}}le.create=e=>new le(e);const c4=(e,t)=>{let a;switch(e.code){case p2.invalid_type:e.received===M2.undefined?a="Required":a=`Expected ${e.expected}, received ${e.received}`;break;case p2.invalid_literal:a=`Invalid literal value, expected ${JSON.stringify(e.expected,p0.jsonStringifyReplacer)}`;break;case p2.unrecognized_keys:a=`Unrecognized key(s) in object: ${p0.joinValues(e.keys,", ")}`;break;case p2.invalid_union:a="Invalid input";break;case p2.invalid_union_discriminator:a=`Invalid discriminator value. Expected ${p0.joinValues(e.options)}`;break;case p2.invalid_enum_value:a=`Invalid enum value. Expected ${p0.joinValues(e.options)}, received '${e.received}'`;break;case p2.invalid_arguments:a="Invalid function arguments";break;case p2.invalid_return_type:a="Invalid function return type";break;case p2.invalid_date:a="Invalid date";break;case p2.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(a=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(a=`${a} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?a=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?a=`Invalid input: must end with "${e.validation.endsWith}"`:p0.assertNever(e.validation):e.validation!=="regex"?a=`Invalid ${e.validation}`:a="Invalid";break;case p2.too_small:e.type==="array"?a=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?a=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?a=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?a=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:a="Invalid input";break;case p2.too_big:e.type==="array"?a=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?a=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?a=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?a=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?a=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:a="Invalid input";break;case p2.custom:a="Invalid input";break;case p2.invalid_intersection_types:a="Intersection results could not be merged";break;case p2.not_multiple_of:a=`Number must be a multiple of ${e.multipleOf}`;break;case p2.not_finite:a="Number must be finite";break;default:a=t.defaultError,p0.assertNever(e)}return{message:a}};let fz=c4;function wG(e){fz=e}function Gc(){return fz}const jc=e=>{const{data:t,path:a,errorMaps:n,issueData:r}=e,s=[...a,...r.path||[]],o={...r,path:s};if(r.message!==void 0)return{...r,path:s,message:r.message};let u="";const d=n.filter(f=>!!f).slice().reverse();for(const f of d)u=f(o,{data:t,defaultError:u}).message;return{...r,path:s,message:u}},bG=[];function S2(e,t){const a=Gc(),n=jc({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,a,a===c4?void 0:c4].filter(r=>!!r)});e.common.issues.push(n)}class w1{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,a){const n=[];for(const r of a){if(r.status==="aborted")return q2;r.status==="dirty"&&t.dirty(),n.push(r.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,a){const n=[];for(const r of a){const s=await r.key,o=await r.value;n.push({key:s,value:o})}return w1.mergeObjectSync(t,n)}static mergeObjectSync(t,a){const n={};for(const r of a){const{key:s,value:o}=r;if(s.status==="aborted"||o.status==="aborted")return q2;s.status==="dirty"&&t.dirty(),o.status==="dirty"&&t.dirty(),s.value!=="__proto__"&&(typeof o.value<"u"||r.alwaysSet)&&(n[s.value]=o.value)}return{status:t.value,value:n}}}const q2=Object.freeze({status:"aborted"}),jn=e=>({status:"dirty",value:e}),L1=e=>({status:"valid",value:e}),y8=e=>e.status==="aborted",z8=e=>e.status==="dirty",Ua=e=>e.status==="valid",gr=e=>typeof Promise<"u"&&e instanceof Promise;function Kc(e,t,a,n){if(typeof t=="function"?e!==t||!0:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function mz(e,t,a,n,r){if(typeof t=="function"?e!==t||!0:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,a),a}var D2;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(D2||(D2={}));var Yl,Zl;class c3{constructor(t,a,n,r){this._cachedPath=[],this.parent=t,this.data=a,this._path=n,this._key=r}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const FA=(e,t)=>{if(Ua(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const a=new le(e.common.issues);return this._error=a,this._error}}};function t0(e){if(!e)return{};const{errorMap:t,invalid_type_error:a,required_error:n,description:r}=e;if(t&&(a||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:r}:{errorMap:(o,u)=>{var d,f;const{message:v}=e;return o.code==="invalid_enum_value"?{message:v??u.defaultError}:typeof u.data>"u"?{message:(d=v??n)!==null&&d!==void 0?d:u.defaultError}:o.code!=="invalid_type"?{message:u.defaultError}:{message:(f=v??a)!==null&&f!==void 0?f:u.defaultError}},description:r}}class l0{get description(){return this._def.description}_getType(t){return D3(t.data)}_getOrReturnCtx(t,a){return a||{common:t.parent.common,data:t.data,parsedType:D3(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new w1,ctx:{common:t.parent.common,data:t.data,parsedType:D3(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const a=this._parse(t);if(gr(a))throw new Error("Synchronous parse encountered promise.");return a}_parseAsync(t){const a=this._parse(t);return Promise.resolve(a)}parse(t,a){const n=this.safeParse(t,a);if(n.success)return n.data;throw n.error}safeParse(t,a){var n;const r={common:{issues:[],async:(n=a==null?void 0:a.async)!==null&&n!==void 0?n:!1,contextualErrorMap:a==null?void 0:a.errorMap},path:(a==null?void 0:a.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:D3(t)},s=this._parseSync({data:t,path:r.path,parent:r});return FA(r,s)}"~validate"(t){var a,n;const r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:D3(t)};if(!this["~standard"].async)try{const s=this._parseSync({data:t,path:[],parent:r});return Ua(s)?{value:s.value}:{issues:r.common.issues}}catch(s){!((n=(a=s==null?void 0:s.message)===null||a===void 0?void 0:a.toLowerCase())===null||n===void 0)&&n.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:r}).then(s=>Ua(s)?{value:s.value}:{issues:r.common.issues})}async parseAsync(t,a){const n=await this.safeParseAsync(t,a);if(n.success)return n.data;throw n.error}async safeParseAsync(t,a){const n={common:{issues:[],contextualErrorMap:a==null?void 0:a.errorMap,async:!0},path:(a==null?void 0:a.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:D3(t)},r=this._parse({data:t,path:n.path,parent:n}),s=await(gr(r)?r:Promise.resolve(r));return FA(n,s)}refine(t,a){const n=r=>typeof a=="string"||typeof a>"u"?{message:a}:typeof a=="function"?a(r):a;return this._refinement((r,s)=>{const o=t(r),u=()=>s.addIssue({code:p2.custom,...n(r)});return typeof Promise<"u"&&o instanceof Promise?o.then(d=>d?!0:(u(),!1)):o?!0:(u(),!1)})}refinement(t,a){return this._refinement((n,r)=>t(n)?!0:(r.addIssue(typeof a=="function"?a(n,r):a),!1))}_refinement(t){return new Ue({schema:this,typeName:$2.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:a=>this["~validate"](a)}}optional(){return n3.create(this,this._def)}nullable(){return Dt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Fe.create(this)}promise(){return u4.create(this,this._def)}or(t){return Nr.create([this,t],this._def)}and(t){return Sr.create(this,t,this._def)}transform(t){return new Ue({...t0(this._def),schema:this,typeName:$2.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const a=typeof t=="function"?t:()=>t;return new Rr({...t0(this._def),innerType:this,defaultValue:a,typeName:$2.ZodDefault})}brand(){return new hd({typeName:$2.ZodBranded,type:this,...t0(this._def)})}catch(t){const a=typeof t=="function"?t:()=>t;return new xr({...t0(this._def),innerType:this,catchValue:a,typeName:$2.ZodCatch})}describe(t){const a=this.constructor;return new a({...this._def,description:t})}pipe(t){return oi.create(this,t)}readonly(){return wr.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const TG=/^c[^\s-]{8,}$/i,kG=/^[0-9a-z]+$/,DG=/^[0-9A-HJKMNP-TV-Z]{26}$/i,BG=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,LG=/^[a-z0-9_-]{21}$/i,OG=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,FG=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,HG=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,PG="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let c7;const UG=/^(?:(?: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])$/,VG=/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,GG=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,jG=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,KG=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,$G=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,vz="((\\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])))",YG=new RegExp(`^${vz}$`);function pz(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}function ZG(e){return new RegExp(`^${pz(e)}$`)}function Az(e){let t=`${vz}T${pz(e)}`;const a=[];return a.push(e.local?"Z?":"Z"),e.offset&&a.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${a.join("|")})`,new RegExp(`^${t}$`)}function WG(e,t){return!!((t==="v4"||!t)&&UG.test(e)||(t==="v6"||!t)&&GG.test(e))}function qG(e,t){if(!OG.test(e))return!1;try{const[a]=e.split("."),n=a.replace(/-/g,"+").replace(/_/g,"/").padEnd(a.length+(4-a.length%4)%4,"="),r=JSON.parse(atob(n));return!(typeof r!="object"||r===null||!r.typ||!r.alg||t&&r.alg!==t)}catch{return!1}}function XG(e,t){return!!((t==="v4"||!t)&&VG.test(e)||(t==="v6"||!t)&&jG.test(e))}class Oe extends l0{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==M2.string){const s=this._getOrReturnCtx(t);return S2(s,{code:p2.invalid_type,expected:M2.string,received:s.parsedType}),q2}const n=new w1;let r;for(const s of this._def.checks)if(s.kind==="min")t.data.length<s.value&&(r=this._getOrReturnCtx(t,r),S2(r,{code:p2.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="max")t.data.length>s.value&&(r=this._getOrReturnCtx(t,r),S2(r,{code:p2.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="length"){const o=t.data.length>s.value,u=t.data.length<s.value;(o||u)&&(r=this._getOrReturnCtx(t,r),o?S2(r,{code:p2.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):u&&S2(r,{code:p2.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty())}else if(s.kind==="email")HG.test(t.data)||(r=this._getOrReturnCtx(t,r),S2(r,{validation:"email",code:p2.invalid_string,message:s.message}),n.dirty());else if(s.kind==="emoji")c7||(c7=new RegExp(PG,"u")),c7.test(t.data)||(r=this._getOrReturnCtx(t,r),S2(r,{validation:"emoji",code:p2.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")BG.test(t.data)||(r=this._getOrReturnCtx(t,r),S2(r,{validation:"uuid",code:p2.invalid_string,message:s.message}),n.dirty());else if(s.kind==="nanoid")LG.test(t.data)||(r=this._getOrReturnCtx(t,r),S2(r,{validation:"nanoid",code:p2.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")TG.test(t.data)||(r=this._getOrReturnCtx(t,r),S2(r,{validation:"cuid",code:p2.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid2")kG.test(t.data)||(r=this._getOrReturnCtx(t,r),S2(r,{validation:"cuid2",code:p2.invalid_string,message:s.message}),n.dirty());else if(s.kind==="ulid")DG.test(t.data)||(r=this._getOrReturnCtx(t,r),S2(r,{validation:"ulid",code:p2.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(t.data)}catch{r=this._getOrReturnCtx(t,r),S2(r,{validation:"url",code:p2.invalid_string,message:s.message}),n.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(t.data)||(r=this._getOrReturnCtx(t,r),S2(r,{validation:"regex",code:p2.invalid_string,message:s.message}),n.dirty())):s.kind==="trim"?t.data=t.data.trim():s.kind==="includes"?t.data.includes(s.value,s.position)||(r=this._getOrReturnCtx(t,r),S2(r,{code:p2.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),n.dirty()):s.kind==="toLowerCase"?t.data=t.data.toLowerCase():s.kind==="toUpperCase"?t.data=t.data.toUpperCase():s.kind==="startsWith"?t.data.startsWith(s.value)||(r=this._getOrReturnCtx(t,r),S2(r,{code:p2.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty()):s.kind==="endsWith"?t.data.endsWith(s.value)||(r=this._getOrReturnCtx(t,r),S2(r,{code:p2.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?Az(s).test(t.data)||(r=this._getOrReturnCtx(t,r),S2(r,{code:p2.invalid_string,validation:"datetime",message:s.message}),n.dirty()):s.kind==="date"?YG.test(t.data)||(r=this._getOrReturnCtx(t,r),S2(r,{code:p2.invalid_string,validation:"date",message:s.message}),n.dirty()):s.kind==="time"?ZG(s).test(t.data)||(r=this._getOrReturnCtx(t,r),S2(r,{code:p2.invalid_string,validation:"time",message:s.message}),n.dirty()):s.kind==="duration"?FG.test(t.data)||(r=this._getOrReturnCtx(t,r),S2(r,{validation:"duration",code:p2.invalid_string,message:s.message}),n.dirty()):s.kind==="ip"?WG(t.data,s.version)||(r=this._getOrReturnCtx(t,r),S2(r,{validation:"ip",code:p2.invalid_string,message:s.message}),n.dirty()):s.kind==="jwt"?qG(t.data,s.alg)||(r=this._getOrReturnCtx(t,r),S2(r,{validation:"jwt",code:p2.invalid_string,message:s.message}),n.dirty()):s.kind==="cidr"?XG(t.data,s.version)||(r=this._getOrReturnCtx(t,r),S2(r,{validation:"cidr",code:p2.invalid_string,message:s.message}),n.dirty()):s.kind==="base64"?KG.test(t.data)||(r=this._getOrReturnCtx(t,r),S2(r,{validation:"base64",code:p2.invalid_string,message:s.message}),n.dirty()):s.kind==="base64url"?$G.test(t.data)||(r=this._getOrReturnCtx(t,r),S2(r,{validation:"base64url",code:p2.invalid_string,message:s.message}),n.dirty()):p0.assertNever(s);return{status:n.value,value:t.data}}_regex(t,a,n){return this.refinement(r=>t.test(r),{validation:a,code:p2.invalid_string,...D2.errToObj(n)})}_addCheck(t){return new Oe({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...D2.errToObj(t)})}url(t){return this._addCheck({kind:"url",...D2.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...D2.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...D2.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...D2.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...D2.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...D2.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...D2.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...D2.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...D2.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...D2.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...D2.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...D2.errToObj(t)})}datetime(t){var a,n;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(a=t==null?void 0:t.offset)!==null&&a!==void 0?a:!1,local:(n=t==null?void 0:t.local)!==null&&n!==void 0?n:!1,...D2.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...D2.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...D2.errToObj(t)})}regex(t,a){return this._addCheck({kind:"regex",regex:t,...D2.errToObj(a)})}includes(t,a){return this._addCheck({kind:"includes",value:t,position:a==null?void 0:a.position,...D2.errToObj(a==null?void 0:a.message)})}startsWith(t,a){return this._addCheck({kind:"startsWith",value:t,...D2.errToObj(a)})}endsWith(t,a){return this._addCheck({kind:"endsWith",value:t,...D2.errToObj(a)})}min(t,a){return this._addCheck({kind:"min",value:t,...D2.errToObj(a)})}max(t,a){return this._addCheck({kind:"max",value:t,...D2.errToObj(a)})}length(t,a){return this._addCheck({kind:"length",value:t,...D2.errToObj(a)})}nonempty(t){return this.min(1,D2.errToObj(t))}trim(){return new Oe({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Oe({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Oe({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const a of this._def.checks)a.kind==="min"&&(t===null||a.value>t)&&(t=a.value);return t}get maxLength(){let t=null;for(const a of this._def.checks)a.kind==="max"&&(t===null||a.value<t)&&(t=a.value);return t}}Oe.create=e=>{var t;return new Oe({checks:[],typeName:$2.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...t0(e)})};function QG(e,t){const a=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,r=a>n?a:n,s=parseInt(e.toFixed(r).replace(".","")),o=parseInt(t.toFixed(r).replace(".",""));return s%o/Math.pow(10,r)}class bt extends l0{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==M2.number){const s=this._getOrReturnCtx(t);return S2(s,{code:p2.invalid_type,expected:M2.number,received:s.parsedType}),q2}let n;const r=new w1;for(const s of this._def.checks)s.kind==="int"?p0.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),S2(n,{code:p2.invalid_type,expected:"integer",received:"float",message:s.message}),r.dirty()):s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(n=this._getOrReturnCtx(t,n),S2(n,{code:p2.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),r.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(n=this._getOrReturnCtx(t,n),S2(n,{code:p2.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),r.dirty()):s.kind==="multipleOf"?QG(t.data,s.value)!==0&&(n=this._getOrReturnCtx(t,n),S2(n,{code:p2.not_multiple_of,multipleOf:s.value,message:s.message}),r.dirty()):s.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),S2(n,{code:p2.not_finite,message:s.message}),r.dirty()):p0.assertNever(s);return{status:r.value,value:t.data}}gte(t,a){return this.setLimit("min",t,!0,D2.toString(a))}gt(t,a){return this.setLimit("min",t,!1,D2.toString(a))}lte(t,a){return this.setLimit("max",t,!0,D2.toString(a))}lt(t,a){return this.setLimit("max",t,!1,D2.toString(a))}setLimit(t,a,n,r){return new bt({...this._def,checks:[...this._def.checks,{kind:t,value:a,inclusive:n,message:D2.toString(r)}]})}_addCheck(t){return new bt({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:D2.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:D2.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:D2.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:D2.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:D2.toString(t)})}multipleOf(t,a){return this._addCheck({kind:"multipleOf",value:t,message:D2.toString(a)})}finite(t){return this._addCheck({kind:"finite",message:D2.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:D2.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:D2.toString(t)})}get minValue(){let t=null;for(const a of this._def.checks)a.kind==="min"&&(t===null||a.value>t)&&(t=a.value);return t}get maxValue(){let t=null;for(const a of this._def.checks)a.kind==="max"&&(t===null||a.value<t)&&(t=a.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&p0.isInteger(t.value))}get isFinite(){let t=null,a=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(a===null||n.value>a)&&(a=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(a)&&Number.isFinite(t)}}bt.create=e=>new bt({checks:[],typeName:$2.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...t0(e)});class Tt extends l0{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==M2.bigint)return this._getInvalidInput(t);let n;const r=new w1;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(n=this._getOrReturnCtx(t,n),S2(n,{code:p2.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),r.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(n=this._getOrReturnCtx(t,n),S2(n,{code:p2.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),r.dirty()):s.kind==="multipleOf"?t.data%s.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),S2(n,{code:p2.not_multiple_of,multipleOf:s.value,message:s.message}),r.dirty()):p0.assertNever(s);return{status:r.value,value:t.data}}_getInvalidInput(t){const a=this._getOrReturnCtx(t);return S2(a,{code:p2.invalid_type,expected:M2.bigint,received:a.parsedType}),q2}gte(t,a){return this.setLimit("min",t,!0,D2.toString(a))}gt(t,a){return this.setLimit("min",t,!1,D2.toString(a))}lte(t,a){return this.setLimit("max",t,!0,D2.toString(a))}lt(t,a){return this.setLimit("max",t,!1,D2.toString(a))}setLimit(t,a,n,r){return new Tt({...this._def,checks:[...this._def.checks,{kind:t,value:a,inclusive:n,message:D2.toString(r)}]})}_addCheck(t){return new Tt({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:D2.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:D2.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:D2.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:D2.toString(t)})}multipleOf(t,a){return this._addCheck({kind:"multipleOf",value:t,message:D2.toString(a)})}get minValue(){let t=null;for(const a of this._def.checks)a.kind==="min"&&(t===null||a.value>t)&&(t=a.value);return t}get maxValue(){let t=null;for(const a of this._def.checks)a.kind==="max"&&(t===null||a.value<t)&&(t=a.value);return t}}Tt.create=e=>{var t;return new Tt({checks:[],typeName:$2.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...t0(e)})};class Er extends l0{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==M2.boolean){const n=this._getOrReturnCtx(t);return S2(n,{code:p2.invalid_type,expected:M2.boolean,received:n.parsedType}),q2}return L1(t.data)}}Er.create=e=>new Er({typeName:$2.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...t0(e)});class Va extends l0{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==M2.date){const s=this._getOrReturnCtx(t);return S2(s,{code:p2.invalid_type,expected:M2.date,received:s.parsedType}),q2}if(isNaN(t.data.getTime())){const s=this._getOrReturnCtx(t);return S2(s,{code:p2.invalid_date}),q2}const n=new w1;let r;for(const s of this._def.checks)s.kind==="min"?t.data.getTime()<s.value&&(r=this._getOrReturnCtx(t,r),S2(r,{code:p2.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),n.dirty()):s.kind==="max"?t.data.getTime()>s.value&&(r=this._getOrReturnCtx(t,r),S2(r,{code:p2.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):p0.assertNever(s);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Va({...this._def,checks:[...this._def.checks,t]})}min(t,a){return this._addCheck({kind:"min",value:t.getTime(),message:D2.toString(a)})}max(t,a){return this._addCheck({kind:"max",value:t.getTime(),message:D2.toString(a)})}get minDate(){let t=null;for(const a of this._def.checks)a.kind==="min"&&(t===null||a.value>t)&&(t=a.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const a of this._def.checks)a.kind==="max"&&(t===null||a.value<t)&&(t=a.value);return t!=null?new Date(t):null}}Va.create=e=>new Va({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:$2.ZodDate,...t0(e)});class $c extends l0{_parse(t){if(this._getType(t)!==M2.symbol){const n=this._getOrReturnCtx(t);return S2(n,{code:p2.invalid_type,expected:M2.symbol,received:n.parsedType}),q2}return L1(t.data)}}$c.create=e=>new $c({typeName:$2.ZodSymbol,...t0(e)});class _r extends l0{_parse(t){if(this._getType(t)!==M2.undefined){const n=this._getOrReturnCtx(t);return S2(n,{code:p2.invalid_type,expected:M2.undefined,received:n.parsedType}),q2}return L1(t.data)}}_r.create=e=>new _r({typeName:$2.ZodUndefined,...t0(e)});class Ir extends l0{_parse(t){if(this._getType(t)!==M2.null){const n=this._getOrReturnCtx(t);return S2(n,{code:p2.invalid_type,expected:M2.null,received:n.parsedType}),q2}return L1(t.data)}}Ir.create=e=>new Ir({typeName:$2.ZodNull,...t0(e)});class o4 extends l0{constructor(){super(...arguments),this._any=!0}_parse(t){return L1(t.data)}}o4.create=e=>new o4({typeName:$2.ZodAny,...t0(e)});class Ta extends l0{constructor(){super(...arguments),this._unknown=!0}_parse(t){return L1(t.data)}}Ta.create=e=>new Ta({typeName:$2.ZodUnknown,...t0(e)});class V3 extends l0{_parse(t){const a=this._getOrReturnCtx(t);return S2(a,{code:p2.invalid_type,expected:M2.never,received:a.parsedType}),q2}}V3.create=e=>new V3({typeName:$2.ZodNever,...t0(e)});class Yc extends l0{_parse(t){if(this._getType(t)!==M2.undefined){const n=this._getOrReturnCtx(t);return S2(n,{code:p2.invalid_type,expected:M2.void,received:n.parsedType}),q2}return L1(t.data)}}Yc.create=e=>new Yc({typeName:$2.ZodVoid,...t0(e)});class Fe extends l0{_parse(t){const{ctx:a,status:n}=this._processInputParams(t),r=this._def;if(a.parsedType!==M2.array)return S2(a,{code:p2.invalid_type,expected:M2.array,received:a.parsedType}),q2;if(r.exactLength!==null){const o=a.data.length>r.exactLength.value,u=a.data.length<r.exactLength.value;(o||u)&&(S2(a,{code:o?p2.too_big:p2.too_small,minimum:u?r.exactLength.value:void 0,maximum:o?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(r.minLength!==null&&a.data.length<r.minLength.value&&(S2(a,{code:p2.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),r.maxLength!==null&&a.data.length>r.maxLength.value&&(S2(a,{code:p2.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),a.common.async)return Promise.all([...a.data].map((o,u)=>r.type._parseAsync(new c3(a,o,a.path,u)))).then(o=>w1.mergeArray(n,o));const s=[...a.data].map((o,u)=>r.type._parseSync(new c3(a,o,a.path,u)));return w1.mergeArray(n,s)}get element(){return this._def.type}min(t,a){return new Fe({...this._def,minLength:{value:t,message:D2.toString(a)}})}max(t,a){return new Fe({...this._def,maxLength:{value:t,message:D2.toString(a)}})}length(t,a){return new Fe({...this._def,exactLength:{value:t,message:D2.toString(a)}})}nonempty(t){return this.min(1,t)}}Fe.create=(e,t)=>new Fe({type:e,minLength:null,maxLength:null,exactLength:null,typeName:$2.ZodArray,...t0(t)});function Vn(e){if(e instanceof T0){const t={};for(const a in e.shape){const n=e.shape[a];t[a]=n3.create(Vn(n))}return new T0({...e._def,shape:()=>t})}else return e instanceof Fe?new Fe({...e._def,type:Vn(e.element)}):e instanceof n3?n3.create(Vn(e.unwrap())):e instanceof Dt?Dt.create(Vn(e.unwrap())):e instanceof o3?o3.create(e.items.map(t=>Vn(t))):e}class T0 extends l0{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),a=p0.objectKeys(t);return this._cached={shape:t,keys:a}}_parse(t){if(this._getType(t)!==M2.object){const f=this._getOrReturnCtx(t);return S2(f,{code:p2.invalid_type,expected:M2.object,received:f.parsedType}),q2}const{status:n,ctx:r}=this._processInputParams(t),{shape:s,keys:o}=this._getCached(),u=[];if(!(this._def.catchall instanceof V3&&this._def.unknownKeys==="strip"))for(const f in r.data)o.includes(f)||u.push(f);const d=[];for(const f of o){const v=s[f],p=r.data[f];d.push({key:{status:"valid",value:f},value:v._parse(new c3(r,p,r.path,f)),alwaysSet:f in r.data})}if(this._def.catchall instanceof V3){const f=this._def.unknownKeys;if(f==="passthrough")for(const v of u)d.push({key:{status:"valid",value:v},value:{status:"valid",value:r.data[v]}});else if(f==="strict")u.length>0&&(S2(r,{code:p2.unrecognized_keys,keys:u}),n.dirty());else if(f!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const f=this._def.catchall;for(const v of u){const p=r.data[v];d.push({key:{status:"valid",value:v},value:f._parse(new c3(r,p,r.path,v)),alwaysSet:v in r.data})}}return r.common.async?Promise.resolve().then(async()=>{const f=[];for(const v of d){const p=await v.key,A=await v.value;f.push({key:p,value:A,alwaysSet:v.alwaysSet})}return f}).then(f=>w1.mergeObjectSync(n,f)):w1.mergeObjectSync(n,d)}get shape(){return this._def.shape()}strict(t){return D2.errToObj,new T0({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(a,n)=>{var r,s,o,u;const d=(o=(s=(r=this._def).errorMap)===null||s===void 0?void 0:s.call(r,a,n).message)!==null&&o!==void 0?o:n.defaultError;return a.code==="unrecognized_keys"?{message:(u=D2.errToObj(t).message)!==null&&u!==void 0?u:d}:{message:d}}}:{}})}strip(){return new T0({...this._def,unknownKeys:"strip"})}passthrough(){return new T0({...this._def,unknownKeys:"passthrough"})}extend(t){return new T0({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new T0({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:$2.ZodObject})}setKey(t,a){return this.augment({[t]:a})}catchall(t){return new T0({...this._def,catchall:t})}pick(t){const a={};return p0.objectKeys(t).forEach(n=>{t[n]&&this.shape[n]&&(a[n]=this.shape[n])}),new T0({...this._def,shape:()=>a})}omit(t){const a={};return p0.objectKeys(this.shape).forEach(n=>{t[n]||(a[n]=this.shape[n])}),new T0({...this._def,shape:()=>a})}deepPartial(){return Vn(this)}partial(t){const a={};return p0.objectKeys(this.shape).forEach(n=>{const r=this.shape[n];t&&!t[n]?a[n]=r:a[n]=r.optional()}),new T0({...this._def,shape:()=>a})}required(t){const a={};return p0.objectKeys(this.shape).forEach(n=>{if(t&&!t[n])a[n]=this.shape[n];else{let s=this.shape[n];for(;s instanceof n3;)s=s._def.innerType;a[n]=s}}),new T0({...this._def,shape:()=>a})}keyof(){return gz(p0.objectKeys(this.shape))}}T0.create=(e,t)=>new T0({shape:()=>e,unknownKeys:"strip",catchall:V3.create(),typeName:$2.ZodObject,...t0(t)});T0.strictCreate=(e,t)=>new T0({shape:()=>e,unknownKeys:"strict",catchall:V3.create(),typeName:$2.ZodObject,...t0(t)});T0.lazycreate=(e,t)=>new T0({shape:e,unknownKeys:"strip",catchall:V3.create(),typeName:$2.ZodObject,...t0(t)});class Nr extends l0{_parse(t){const{ctx:a}=this._processInputParams(t),n=this._def.options;function r(s){for(const u of s)if(u.result.status==="valid")return u.result;for(const u of s)if(u.result.status==="dirty")return a.common.issues.push(...u.ctx.common.issues),u.result;const o=s.map(u=>new le(u.ctx.common.issues));return S2(a,{code:p2.invalid_union,unionErrors:o}),q2}if(a.common.async)return Promise.all(n.map(async s=>{const o={...a,common:{...a.common,issues:[]},parent:null};return{result:await s._parseAsync({data:a.data,path:a.path,parent:o}),ctx:o}})).then(r);{let s;const o=[];for(const d of n){const f={...a,common:{...a.common,issues:[]},parent:null},v=d._parseSync({data:a.data,path:a.path,parent:f});if(v.status==="valid")return v;v.status==="dirty"&&!s&&(s={result:v,ctx:f}),f.common.issues.length&&o.push(f.common.issues)}if(s)return a.common.issues.push(...s.ctx.common.issues),s.result;const u=o.map(d=>new le(d));return S2(a,{code:p2.invalid_union,unionErrors:u}),q2}}get options(){return this._def.options}}Nr.create=(e,t)=>new Nr({options:e,typeName:$2.ZodUnion,...t0(t)});const k3=e=>e instanceof zr?k3(e.schema):e instanceof Ue?k3(e.innerType()):e instanceof Cr?[e.value]:e instanceof kt?e.options:e instanceof Mr?p0.objectValues(e.enum):e instanceof Rr?k3(e._def.innerType):e instanceof _r?[void 0]:e instanceof Ir?[null]:e instanceof n3?[void 0,...k3(e.unwrap())]:e instanceof Dt?[null,...k3(e.unwrap())]:e instanceof hd||e instanceof wr?k3(e.unwrap()):e instanceof xr?k3(e._def.innerType):[];class Yo extends l0{_parse(t){const{ctx:a}=this._processInputParams(t);if(a.parsedType!==M2.object)return S2(a,{code:p2.invalid_type,expected:M2.object,received:a.parsedType}),q2;const n=this.discriminator,r=a.data[n],s=this.optionsMap.get(r);return s?a.common.async?s._parseAsync({data:a.data,path:a.path,parent:a}):s._parseSync({data:a.data,path:a.path,parent:a}):(S2(a,{code:p2.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),q2)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,a,n){const r=new Map;for(const s of a){const o=k3(s.shape[t]);if(!o.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const u of o){if(r.has(u))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(u)}`);r.set(u,s)}}return new Yo({typeName:$2.ZodDiscriminatedUnion,discriminator:t,options:a,optionsMap:r,...t0(n)})}}function C8(e,t){const a=D3(e),n=D3(t);if(e===t)return{valid:!0,data:e};if(a===M2.object&&n===M2.object){const r=p0.objectKeys(t),s=p0.objectKeys(e).filter(u=>r.indexOf(u)!==-1),o={...e,...t};for(const u of s){const d=C8(e[u],t[u]);if(!d.valid)return{valid:!1};o[u]=d.data}return{valid:!0,data:o}}else if(a===M2.array&&n===M2.array){if(e.length!==t.length)return{valid:!1};const r=[];for(let s=0;s<e.length;s++){const o=e[s],u=t[s],d=C8(o,u);if(!d.valid)return{valid:!1};r.push(d.data)}return{valid:!0,data:r}}else return a===M2.date&&n===M2.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class Sr extends l0{_parse(t){const{status:a,ctx:n}=this._processInputParams(t),r=(s,o)=>{if(y8(s)||y8(o))return q2;const u=C8(s.value,o.value);return u.valid?((z8(s)||z8(o))&&a.dirty(),{status:a.value,value:u.data}):(S2(n,{code:p2.invalid_intersection_types}),q2)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([s,o])=>r(s,o)):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}Sr.create=(e,t,a)=>new Sr({left:e,right:t,typeName:$2.ZodIntersection,...t0(a)});class o3 extends l0{_parse(t){const{status:a,ctx:n}=this._processInputParams(t);if(n.parsedType!==M2.array)return S2(n,{code:p2.invalid_type,expected:M2.array,received:n.parsedType}),q2;if(n.data.length<this._def.items.length)return S2(n,{code:p2.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),q2;!this._def.rest&&n.data.length>this._def.items.length&&(S2(n,{code:p2.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),a.dirty());const s=[...n.data].map((o,u)=>{const d=this._def.items[u]||this._def.rest;return d?d._parse(new c3(n,o,n.path,u)):null}).filter(o=>!!o);return n.common.async?Promise.all(s).then(o=>w1.mergeArray(a,o)):w1.mergeArray(a,s)}get items(){return this._def.items}rest(t){return new o3({...this._def,rest:t})}}o3.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new o3({items:e,typeName:$2.ZodTuple,rest:null,...t0(t)})};class yr extends l0{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:a,ctx:n}=this._processInputParams(t);if(n.parsedType!==M2.object)return S2(n,{code:p2.invalid_type,expected:M2.object,received:n.parsedType}),q2;const r=[],s=this._def.keyType,o=this._def.valueType;for(const u in n.data)r.push({key:s._parse(new c3(n,u,n.path,u)),value:o._parse(new c3(n,n.data[u],n.path,u)),alwaysSet:u in n.data});return n.common.async?w1.mergeObjectAsync(a,r):w1.mergeObjectSync(a,r)}get element(){return this._def.valueType}static create(t,a,n){return a instanceof l0?new yr({keyType:t,valueType:a,typeName:$2.ZodRecord,...t0(n)}):new yr({keyType:Oe.create(),valueType:t,typeName:$2.ZodRecord,...t0(a)})}}class Zc extends l0{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:a,ctx:n}=this._processInputParams(t);if(n.parsedType!==M2.map)return S2(n,{code:p2.invalid_type,expected:M2.map,received:n.parsedType}),q2;const r=this._def.keyType,s=this._def.valueType,o=[...n.data.entries()].map(([u,d],f)=>({key:r._parse(new c3(n,u,n.path,[f,"key"])),value:s._parse(new c3(n,d,n.path,[f,"value"]))}));if(n.common.async){const u=new Map;return Promise.resolve().then(async()=>{for(const d of o){const f=await d.key,v=await d.value;if(f.status==="aborted"||v.status==="aborted")return q2;(f.status==="dirty"||v.status==="dirty")&&a.dirty(),u.set(f.value,v.value)}return{status:a.value,value:u}})}else{const u=new Map;for(const d of o){const f=d.key,v=d.value;if(f.status==="aborted"||v.status==="aborted")return q2;(f.status==="dirty"||v.status==="dirty")&&a.dirty(),u.set(f.value,v.value)}return{status:a.value,value:u}}}}Zc.create=(e,t,a)=>new Zc({valueType:t,keyType:e,typeName:$2.ZodMap,...t0(a)});class Ga extends l0{_parse(t){const{status:a,ctx:n}=this._processInputParams(t);if(n.parsedType!==M2.set)return S2(n,{code:p2.invalid_type,expected:M2.set,received:n.parsedType}),q2;const r=this._def;r.minSize!==null&&n.data.size<r.minSize.value&&(S2(n,{code:p2.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),a.dirty()),r.maxSize!==null&&n.data.size>r.maxSize.value&&(S2(n,{code:p2.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),a.dirty());const s=this._def.valueType;function o(d){const f=new Set;for(const v of d){if(v.status==="aborted")return q2;v.status==="dirty"&&a.dirty(),f.add(v.value)}return{status:a.value,value:f}}const u=[...n.data.values()].map((d,f)=>s._parse(new c3(n,d,n.path,f)));return n.common.async?Promise.all(u).then(d=>o(d)):o(u)}min(t,a){return new Ga({...this._def,minSize:{value:t,message:D2.toString(a)}})}max(t,a){return new Ga({...this._def,maxSize:{value:t,message:D2.toString(a)}})}size(t,a){return this.min(t,a).max(t,a)}nonempty(t){return this.min(1,t)}}Ga.create=(e,t)=>new Ga({valueType:e,minSize:null,maxSize:null,typeName:$2.ZodSet,...t0(t)});class t4 extends l0{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:a}=this._processInputParams(t);if(a.parsedType!==M2.function)return S2(a,{code:p2.invalid_type,expected:M2.function,received:a.parsedType}),q2;function n(u,d){return jc({data:u,path:a.path,errorMaps:[a.common.contextualErrorMap,a.schemaErrorMap,Gc(),c4].filter(f=>!!f),issueData:{code:p2.invalid_arguments,argumentsError:d}})}function r(u,d){return jc({data:u,path:a.path,errorMaps:[a.common.contextualErrorMap,a.schemaErrorMap,Gc(),c4].filter(f=>!!f),issueData:{code:p2.invalid_return_type,returnTypeError:d}})}const s={errorMap:a.common.contextualErrorMap},o=a.data;if(this._def.returns instanceof u4){const u=this;return L1(async function(...d){const f=new le([]),v=await u._def.args.parseAsync(d,s).catch(E=>{throw f.addIssue(n(d,E)),f}),p=await Reflect.apply(o,this,v);return await u._def.returns._def.type.parseAsync(p,s).catch(E=>{throw f.addIssue(r(p,E)),f})})}else{const u=this;return L1(function(...d){const f=u._def.args.safeParse(d,s);if(!f.success)throw new le([n(d,f.error)]);const v=Reflect.apply(o,this,f.data),p=u._def.returns.safeParse(v,s);if(!p.success)throw new le([r(v,p.error)]);return p.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new t4({...this._def,args:o3.create(t).rest(Ta.create())})}returns(t){return new t4({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,a,n){return new t4({args:t||o3.create([]).rest(Ta.create()),returns:a||Ta.create(),typeName:$2.ZodFunction,...t0(n)})}}class zr extends l0{get schema(){return this._def.getter()}_parse(t){const{ctx:a}=this._processInputParams(t);return this._def.getter()._parse({data:a.data,path:a.path,parent:a})}}zr.create=(e,t)=>new zr({getter:e,typeName:$2.ZodLazy,...t0(t)});class Cr extends l0{_parse(t){if(t.data!==this._def.value){const a=this._getOrReturnCtx(t);return S2(a,{received:a.data,code:p2.invalid_literal,expected:this._def.value}),q2}return{status:"valid",value:t.data}}get value(){return this._def.value}}Cr.create=(e,t)=>new Cr({value:e,typeName:$2.ZodLiteral,...t0(t)});function gz(e,t){return new kt({values:e,typeName:$2.ZodEnum,...t0(t)})}class kt extends l0{constructor(){super(...arguments),Yl.set(this,void 0)}_parse(t){if(typeof t.data!="string"){const a=this._getOrReturnCtx(t),n=this._def.values;return S2(a,{expected:p0.joinValues(n),received:a.parsedType,code:p2.invalid_type}),q2}if(Kc(this,Yl)||mz(this,Yl,new Set(this._def.values)),!Kc(this,Yl).has(t.data)){const a=this._getOrReturnCtx(t),n=this._def.values;return S2(a,{received:a.data,code:p2.invalid_enum_value,options:n}),q2}return L1(t.data)}get options(){return this._def.values}get enum(){const t={};for(const a of this._def.values)t[a]=a;return t}get Values(){const t={};for(const a of this._def.values)t[a]=a;return t}get Enum(){const t={};for(const a of this._def.values)t[a]=a;return t}extract(t,a=this._def){return kt.create(t,{...this._def,...a})}exclude(t,a=this._def){return kt.create(this.options.filter(n=>!t.includes(n)),{...this._def,...a})}}Yl=new WeakMap;kt.create=gz;class Mr extends l0{constructor(){super(...arguments),Zl.set(this,void 0)}_parse(t){const a=p0.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==M2.string&&n.parsedType!==M2.number){const r=p0.objectValues(a);return S2(n,{expected:p0.joinValues(r),received:n.parsedType,code:p2.invalid_type}),q2}if(Kc(this,Zl)||mz(this,Zl,new Set(p0.getValidEnumValues(this._def.values))),!Kc(this,Zl).has(t.data)){const r=p0.objectValues(a);return S2(n,{received:n.data,code:p2.invalid_enum_value,options:r}),q2}return L1(t.data)}get enum(){return this._def.values}}Zl=new WeakMap;Mr.create=(e,t)=>new Mr({values:e,typeName:$2.ZodNativeEnum,...t0(t)});class u4 extends l0{unwrap(){return this._def.type}_parse(t){const{ctx:a}=this._processInputParams(t);if(a.parsedType!==M2.promise&&a.common.async===!1)return S2(a,{code:p2.invalid_type,expected:M2.promise,received:a.parsedType}),q2;const n=a.parsedType===M2.promise?a.data:Promise.resolve(a.data);return L1(n.then(r=>this._def.type.parseAsync(r,{path:a.path,errorMap:a.common.contextualErrorMap})))}}u4.create=(e,t)=>new u4({type:e,typeName:$2.ZodPromise,...t0(t)});class Ue extends l0{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===$2.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:a,ctx:n}=this._processInputParams(t),r=this._def.effect||null,s={addIssue:o=>{S2(n,o),o.fatal?a.abort():a.dirty()},get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),r.type==="preprocess"){const o=r.transform(n.data,s);if(n.common.async)return Promise.resolve(o).then(async u=>{if(a.value==="aborted")return q2;const d=await this._def.schema._parseAsync({data:u,path:n.path,parent:n});return d.status==="aborted"?q2:d.status==="dirty"||a.value==="dirty"?jn(d.value):d});{if(a.value==="aborted")return q2;const u=this._def.schema._parseSync({data:o,path:n.path,parent:n});return u.status==="aborted"?q2:u.status==="dirty"||a.value==="dirty"?jn(u.value):u}}if(r.type==="refinement"){const o=u=>{const d=r.refinement(u,s);if(n.common.async)return Promise.resolve(d);if(d instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return u};if(n.common.async===!1){const u=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return u.status==="aborted"?q2:(u.status==="dirty"&&a.dirty(),o(u.value),{status:a.value,value:u.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(u=>u.status==="aborted"?q2:(u.status==="dirty"&&a.dirty(),o(u.value).then(()=>({status:a.value,value:u.value}))))}if(r.type==="transform")if(n.common.async===!1){const o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Ua(o))return o;const u=r.transform(o.value,s);if(u instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:a.value,value:u}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>Ua(o)?Promise.resolve(r.transform(o.value,s)).then(u=>({status:a.value,value:u})):o);p0.assertNever(r)}}Ue.create=(e,t,a)=>new Ue({schema:e,typeName:$2.ZodEffects,effect:t,...t0(a)});Ue.createWithPreprocess=(e,t,a)=>new Ue({schema:t,effect:{type:"preprocess",transform:e},typeName:$2.ZodEffects,...t0(a)});class n3 extends l0{_parse(t){return this._getType(t)===M2.undefined?L1(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}n3.create=(e,t)=>new n3({innerType:e,typeName:$2.ZodOptional,...t0(t)});class Dt extends l0{_parse(t){return this._getType(t)===M2.null?L1(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Dt.create=(e,t)=>new Dt({innerType:e,typeName:$2.ZodNullable,...t0(t)});class Rr extends l0{_parse(t){const{ctx:a}=this._processInputParams(t);let n=a.data;return a.parsedType===M2.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:a.path,parent:a})}removeDefault(){return this._def.innerType}}Rr.create=(e,t)=>new Rr({innerType:e,typeName:$2.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...t0(t)});class xr extends l0{_parse(t){const{ctx:a}=this._processInputParams(t),n={...a,common:{...a.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return gr(r)?r.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new le(n.common.issues)},input:n.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new le(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}xr.create=(e,t)=>new xr({innerType:e,typeName:$2.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...t0(t)});class Wc extends l0{_parse(t){if(this._getType(t)!==M2.nan){const n=this._getOrReturnCtx(t);return S2(n,{code:p2.invalid_type,expected:M2.nan,received:n.parsedType}),q2}return{status:"valid",value:t.data}}}Wc.create=e=>new Wc({typeName:$2.ZodNaN,...t0(e)});const JG=Symbol("zod_brand");class hd extends l0{_parse(t){const{ctx:a}=this._processInputParams(t),n=a.data;return this._def.type._parse({data:n,path:a.path,parent:a})}unwrap(){return this._def.type}}class oi extends l0{_parse(t){const{status:a,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?q2:s.status==="dirty"?(a.dirty(),jn(s.value)):this._def.out._parseAsync({data:s.value,path:n.path,parent:n})})();{const r=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return r.status==="aborted"?q2:r.status==="dirty"?(a.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:n.path,parent:n})}}static create(t,a){return new oi({in:t,out:a,typeName:$2.ZodPipeline})}}class wr extends l0{_parse(t){const a=this._def.innerType._parse(t),n=r=>(Ua(r)&&(r.value=Object.freeze(r.value)),r);return gr(a)?a.then(r=>n(r)):n(a)}unwrap(){return this._def.innerType}}wr.create=(e,t)=>new wr({innerType:e,typeName:$2.ZodReadonly,...t0(t)});function HA(e,t){const a=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof a=="string"?{message:a}:a}function Ez(e,t={},a){return e?o4.create().superRefine((n,r)=>{var s,o;const u=e(n);if(u instanceof Promise)return u.then(d=>{var f,v;if(!d){const p=HA(t,n),A=(v=(f=p.fatal)!==null&&f!==void 0?f:a)!==null&&v!==void 0?v:!0;r.addIssue({code:"custom",...p,fatal:A})}});if(!u){const d=HA(t,n),f=(o=(s=d.fatal)!==null&&s!==void 0?s:a)!==null&&o!==void 0?o:!0;r.addIssue({code:"custom",...d,fatal:f})}}):o4.create()}const ej={object:T0.lazycreate};var $2;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})($2||($2={}));const tj=(e,t={message:`Input not instance of ${e.name}`})=>Ez(a=>a instanceof e,t),_z=Oe.create,Iz=bt.create,aj=Wc.create,nj=Tt.create,Nz=Er.create,lj=Va.create,rj=$c.create,ij=_r.create,sj=Ir.create,cj=o4.create,oj=Ta.create,uj=V3.create,hj=Yc.create,dj=Fe.create,fj=T0.create,mj=T0.strictCreate,vj=Nr.create,pj=Yo.create,Aj=Sr.create,gj=o3.create,Ej=yr.create,_j=Zc.create,Ij=Ga.create,Nj=t4.create,Sj=zr.create,yj=Cr.create,zj=kt.create,Cj=Mr.create,Mj=u4.create,PA=Ue.create,Rj=n3.create,xj=Dt.create,wj=Ue.createWithPreprocess,bj=oi.create,Tj=()=>_z().optional(),kj=()=>Iz().optional(),Dj=()=>Nz().optional(),Bj={string:e=>Oe.create({...e,coerce:!0}),number:e=>bt.create({...e,coerce:!0}),boolean:e=>Er.create({...e,coerce:!0}),bigint:e=>Tt.create({...e,coerce:!0}),date:e=>Va.create({...e,coerce:!0})},Lj=q2;var gt=Object.freeze({__proto__:null,defaultErrorMap:c4,setErrorMap:wG,getErrorMap:Gc,makeIssue:jc,EMPTY_PATH:bG,addIssueToContext:S2,ParseStatus:w1,INVALID:q2,DIRTY:jn,OK:L1,isAborted:y8,isDirty:z8,isValid:Ua,isAsync:gr,get util(){return p0},get objectUtil(){return S8},ZodParsedType:M2,getParsedType:D3,ZodType:l0,datetimeRegex:Az,ZodString:Oe,ZodNumber:bt,ZodBigInt:Tt,ZodBoolean:Er,ZodDate:Va,ZodSymbol:$c,ZodUndefined:_r,ZodNull:Ir,ZodAny:o4,ZodUnknown:Ta,ZodNever:V3,ZodVoid:Yc,ZodArray:Fe,ZodObject:T0,ZodUnion:Nr,ZodDiscriminatedUnion:Yo,ZodIntersection:Sr,ZodTuple:o3,ZodRecord:yr,ZodMap:Zc,ZodSet:Ga,ZodFunction:t4,ZodLazy:zr,ZodLiteral:Cr,ZodEnum:kt,ZodNativeEnum:Mr,ZodPromise:u4,ZodEffects:Ue,ZodTransformer:Ue,ZodOptional:n3,ZodNullable:Dt,ZodDefault:Rr,ZodCatch:xr,ZodNaN:Wc,BRAND:JG,ZodBranded:hd,ZodPipeline:oi,ZodReadonly:wr,custom:Ez,Schema:l0,ZodSchema:l0,late:ej,get ZodFirstPartyTypeKind(){return $2},coerce:Bj,any:cj,array:dj,bigint:nj,boolean:Nz,date:lj,discriminatedUnion:pj,effect:PA,enum:zj,function:Nj,instanceof:tj,intersection:Aj,lazy:Sj,literal:yj,map:_j,nan:aj,nativeEnum:Cj,never:uj,null:sj,nullable:xj,number:Iz,object:fj,oboolean:Dj,onumber:kj,optional:Rj,ostring:Tj,pipeline:bj,preprocess:wj,promise:Mj,record:Ej,set:Ij,strictObject:mj,string:_z,symbol:rj,transformer:PA,tuple:gj,undefined:ij,union:vj,unknown:oj,void:hj,NEVER:Lj,ZodIssueCode:p2,quotelessJson:xG,ZodError:le});j({en:"Please enter your username","en-GB":"Please enter your username",fr:"Veuillez saisir votre nom d’utilisateur",es:"Por favor, ingrese su nombre de usuario",de:"Bitte geben Sie Ihren Benutzernamen ein",ja:"ユーザー名を入力してください",ko:"사용자 이름을 입력해 주세요",zh:"请输入您的用户名",it:"Per favore, inserisci il tuo nome utente",pt:"Por favor, insira seu nome de usuário",hi:"कृपया अपना उपयोगकर्ता नाम दर्ज करें",ar:"يرجى إدخال اسم المستخدم الخاص بك",ru:"Пожалуйста, введите ваше имя пользователя"}),j({en:"Please enter a valid username","en-GB":"Please enter a valid username",fr:"Veuillez saisir un nom d’utilisateur valide",es:"Por favor, ingrese un nombre de usuario válido",de:"Bitte geben Sie einen gültigen Benutzernamen ein",ja:"有効なユーザー名を入力してください",ko:"유효한 사용자 이름을 입력해 주세요",zh:"请输入有效的用户名",it:"Per favore, inserisci un nome utente valido",pt:"Por favor, insira um nome de usuário válido",hi:"कृपया एक मान्य उपयोगकर्ता नाम दर्ज करें",ar:"يرجى إدخال اسم مستخدم صالح",ru:"Пожалуйста, введите корректное имя пользователя"}),j({en:"Please enter your password","en-GB":"Please enter your password",fr:"Veuillez saisir votre mot de passe",es:"Por favor, ingrese su contraseña",de:"Bitte geben Sie Ihr Passwort ein",ja:"パスワードを入力してください",ko:"비밀번호를 입력해 주세요",zh:"请您输入密码",it:"Si prega di inserire la password",pt:"Por favor, insira sua senha",hi:"कृपया अपना पासवर्ड दर्ज करें",ar:"يرجى إدخال كلمة المرور الخاصة بك",ru:"Пожалуйста, введите ваш пароль"}),j({en:"Please enter a valid password","en-GB":"Please enter a valid password",fr:"Veuillez saisir un mot de passe valide",es:"Por favor, ingrese una contraseña válida",de:"Bitte geben Sie ein gültiges Passwort ein",ja:"有効なパスワードを入力してください",ko:"유효한 비밀번호를 입력해 주세요",zh:"请输入有效的密码",it:"Per favore, inserisci una password valida",pt:"Por favor, insira uma senha válida",hi:"कृपया एक मान्य पासवर्ड दर्ज करें",ar:"يرجى إدخال كلمة مرور صالحة",ru:"Пожалуйста, введите корректный пароль"});j({en:"Email address","en-GB":"Email address",fr:"Adresse e-mail",es:"Dirección de correo electrónico",de:"E-Mail-Adresse",ja:"メールアドレス",ko:"이메일 주소",zh:"电子邮件地址",it:"Indirizzo email",pt:"Endereço de e-mail",hi:"ई-मेल पता",ar:"عنوان البريد الإلكتروني",ru:"Адрес электронной почты"}),j({en:"Enter e-mail address","en-GB":"Enter e-mail address",fr:"Entrez votre adresse e-mail",es:"Ingrese su dirección de correo electrónico",de:"E-Mail-Adresse eingeben",ja:"メールアドレスを入力してください",ko:"이메일 주소를 입력하세요",zh:"请输入电子邮件地址",it:"Inserisci l'indirizzo email",pt:"Insira o endereço de e-mail",hi:"ई-मेल पता दर्ज करें",ar:"أدخل عنوان البريد الإلكتروني",ru:"Введите адрес электронной почты"}),j({en:"Password","en-GB":"Password",fr:"Mot de passe",es:"Contraseña",de:"Passwort",ja:"パスワード",ko:"비밀번호",zh:"密码",it:"Password",pt:"Senha",hi:"पासवर्ड",ar:"كلمة المرور",ru:"Пароль"}),j({en:"Enter password","en-GB":"Enter password",fr:"Entrez votre mot de passe",es:"Ingrese su contraseña",de:"Passwort eingeben",ja:"パスワードを入力してください",ko:"비밀번호를 입력하세요",zh:"请输入密码",it:"Inserisci la password",pt:"Insira a senha",hi:"पासवर्ड डालें",ar:"أدخل كلمة المرور",ru:"Введите пароль"}),j({en:"Password Confirmation","en-GB":"Password Confirmation",fr:"Confirmation du mot de passe",es:"Confirmación de contraseña",de:"Passwortbestätigung",ja:"パスワードの確認",ko:"비밀번호 확인",zh:"确认密码",it:"Conferma password",pt:"Confirmação de senha",hi:"पासवर्ड की पुष्टि",ar:"تأكيد كلمة المرور",ru:"Подтверждение пароля"}),j({en:"Enter password again","en-GB":"Enter password again",fr:"Entrez votre mot de passe à nouveau",es:"Ingrese su contraseña nuevamente",de:"Passwort erneut eingeben",ja:"パスワードを再度入力してください",ko:"비밀번호를 다시 입력하세요",zh:"请再次输入密码",it:"Reinserisci la password",pt:"Digite a senha novamente",hi:"पासवर्ड पुनः दर्ज करें",ar:"أعد إدخال كلمة المرور",ru:"Введите пароль еще раз"}),j({en:"Create account","en-GB":"Create account",fr:"Créer un compte",es:"Crear una cuenta",de:"Konto erstellen",ja:"アカウントを作成",ko:"계정 만들기",zh:"创建账户",it:"Crea account",pt:"Criar conta",hi:"खाता बनाएं",ar:"إنشاء حساب",ru:"Создать аккаунт"}),j({en:"Submit form to create account","en-GB":"Submit form to create account",fr:"Soumettre le formulaire pour créer un compte",es:"Enviar formulario para crear cuenta",de:"Formular absenden, um ein Konto zu erstellen",ja:"アカウントを作成するためにフォームを送信する",ko:"계정을 만들기 위해 양식을 제출하세요",zh:"提交表单以创建账户",it:"Invia il modulo per creare un account",pt:"Envie o formulário para criar uma conta",hi:"खाता बनाने के लिए फॉर्म जमा करें",ar:"إرسال النموذج لإنشاء حساب",ru:"Отправить форму для создания аккаунта"}),j({en:"You already have an account?","en-GB":"You already have an account?",fr:"Vous avez déjà un compte ?",es:"¿Ya tienes una cuenta?",de:"Sie haben bereits ein Konto?",ja:"すでにアカウントをお持ちですか?",ko:"이미 계정이 있습니까?",zh:"您已经有一个账户了吗?",it:"Hai già un account?",pt:"Você já tem uma conta?",hi:"क्या आपके पास पहले से ही एक खाता है?",ar:"هل لديك حساب بالفعل؟",ru:"У вас уже есть аккаунт?"}),j({en:"Log in","en-GB":"Log in",fr:"Se connecter",es:"Iniciar sesión",de:"Einloggen",ja:"ログイン",ko:"로그인",zh:"登录",it:"Accedi",pt:"Entrar",hi:"लॉग इन करें",ar:"تسجيل الدخول",ru:"Войти"}),j({en:"Click to go to login page","en-GB":"Click to go to login page",fr:"Cliquez pour aller à la page de connexion",es:"Haz clic para ir a la página de inicio de sesión",de:"Klicken Sie, um zur Anmeldeseite zu gelangen",ja:"ログインページに移動するにはクリックしてください",ko:"로그인 페이지로 이동하려면 클릭하세요",zh:"点击进入登录页面",it:"Clicca per andare alla pagina di login",pt:"Clique para ir para a página de login",hi:"लॉगिन पृष्ठ पर जाने के लिए क्लिक करें",ar:"انقر للذهاب إلى صفحة تسجيل الدخول",ru:"Нажмите, чтобы перейти на страницу входа"});j({en:"Please enter your email address","en-GB":"Please enter your email address",fr:"Veuillez saisir votre adresse e-mail",es:"Por favor, ingrese su dirección de correo electrónico",de:"Bitte geben Sie Ihre E-Mail-Adresse ein",ja:"メールアドレスを入力してください",ko:"이메일 주소를 입력해주세요",zh:"请输入您的电子邮件地址",it:"Si prega di inserire il proprio indirizzo email",pt:"Por favor, insira seu endereço de e-mail",hi:"कृपया अपना ईमेल पता दर्ज करें",ar:"يرجى إدخال عنوان بريدك الإلكتروني",ru:"Пожалуйста, введите свой адрес электронной почты"}),j({en:"Please enter a valid email address","en-GB":"Please enter a valid email address",fr:"Veuillez saisir une adresse e-mail valide",es:"Por favor, ingrese una dirección de correo electrónico válida",de:"Bitte geben Sie eine gültige E-Mail-Adresse ein",ja:"正しいメールアドレスを入力してください",ko:"유효한 이메일 주소를 입력해주세요",zh:"请输入有效的电子邮件地址",it:"Si prega di inserire un indirizzo email valido",pt:"Por favor, insira um endereço de e-mail válido",hi:"कृपया एक वैध ईमेल पता दर्ज करें",ar:"يرجى إدخال عنوان بريد إلكتروني صالح",ru:"Пожалуйста, введите корректный адрес электронной почты"}),j({en:"Please enter your password","en-GB":"Please enter your password",fr:"Veuillez saisir votre mot de passe",es:"Por favor, ingrese su contraseña",de:"Bitte geben Sie Ihr Passwort ein",ja:"パスワードを入力してください",ko:"비밀번호를 입력해주세요",zh:"请输入您的密码",it:"Si prega di inserire la propria password",pt:"Por favor, insira sua senha",hi:"कृपया अपना पासवर्ड डालें",ar:"يرجى إدخال كلمة المرور الخاصة بك",ru:"Пожалуйста, введите ваш пароль"}),j({en:"Please enter a valid password","en-GB":"Please enter a valid password",fr:"Veuillez saisir un mot de passe valide",es:"Por favor, ingrese una contraseña válida",de:"Bitte geben Sie ein gültiges Passwort ein",ja:"有効なパスワードを入力してください",ko:"유효한 비밀번호를 입력해주세요",zh:"请输入有效的密码",it:"Si prega di inserire una password valida",pt:"Por favor, insira uma senha válida",hi:"कृपया एक वैध पासवर्ड दर्ज करें",ar:"يرجى إدخال كلمة مرور صالحة",ru:"Пожалуйста, введите корректный пароль"}),j({en:"Please enter your password again","en-GB":"Please enter your password again",fr:"Veuillez saisir votre mot de passe à nouveau",es:"Por favor, ingrese su contraseña nuevamente",de:"Bitte geben Sie Ihr Passwort erneut ein",ja:"再度パスワードを入力してください",ko:"비밀번호를 다시 입력해주세요",zh:"请再次输入您的密码",it:"Si prega di reinserire la propria password",pt:"Por favor, insira sua senha novamente",hi:"कृपया अपना पासवर्ड फिर से दर्ज करें",ar:"يرجى إعادة إدخال كلمة المرور الخاصة بك",ru:"Пожалуйста, введите ваш пароль еще раз"}),j({en:"Please enter a valid password","en-GB":"Please enter a valid password",fr:"Veuillez saisir un mot de passe valide",es:"Por favor, ingrese una contraseña válida",de:"Bitte geben Sie ein gültiges Passwort ein",ja:"有効なパスワードを入力してください",ko:"유효한 비밀번호를 입력해주세요",zh:"请输入有效的密码",it:"Si prega di inserire una password valida",pt:"Por favor, insira uma senha válida",hi:"कृपया एक वैध पासवर्ड दर्ज करें",ar:"يرجى إدخال كلمة مرور صالحة",ru:"Пожалуйста, введите корректный пароль"}),j({en:"Password and password confirmation must match","en-GB":"Password and password confirmation must match",fr:"Le mot de passe et la confirmation de mot de passe doivent correspondre",es:"La contraseña y la confirmación de la contraseña deben coincidir",de:"Das Passwort und die Bestätigung müssen übereinstimmen",ja:"パスワードと確認用パスワードは一致する必要があります",ko:"비밀번호와 비밀번호 확인이 일치해야 합니다",zh:"密码和密码确认必须匹配",it:"La password e la conferma della password devono corrispondere",pt:"A senha e a confirmação da senha devem coincidir",hi:"पासवर्ड और पासवर्ड की पुष्टि मेल खानी चाहिए",ar:"يجب أن تتطابق كلمة المرور وتأكيد كلمة المرور",ru:"Пароль и подтверждение пароля должны совпадать"});j({en:"Current password",fr:"Mot de passe actuel",es:"Contraseña actual",de:"Aktuelles Passwort",ja:"現在のパスワード",ko:"현재 비밀번호",zh:"当前密码",it:"Password attuale",pt:"Senha atual",hi:"वर्तमान पासवर्ड",ar:"كلمة المرور الحالية",ru:"Текущий пароль","en-GB":"Current password"}),j({en:"Enter actual password",fr:"Entrez votre mot de passe actuel",es:"Ingresa tu contraseña actual",de:"Geben Sie das aktuelle Passwort ein",ja:"現在のパスワードを入力してください",ko:"현재 비밀번호를 입력하세요",zh:"输入当前密码",it:"Inserisci la password attuale",pt:"Digite a senha atual",hi:"वर्तमान पासवर्ड दर्ज करें",ar:"أدخل كلمة المرور الحالية",ru:"Введите текущий пароль","en-GB":"Enter actual password"}),j({en:"New password",fr:"Nouveau mot de passe",es:"Nueva contraseña",de:"Neues Passwort",ja:"新しいパスワード",ko:"새 비밀번호",zh:"新密码",it:"Nuova password",pt:"Nova senha",hi:"नया पासवर्ड",ar:"كلمة المرور الجديدة",ru:"Новый пароль","en-GB":"New password"}),j({en:"Enter new password",fr:"Entrez votre nouveau mot de passe",es:"Ingresa tu nueva contraseña",de:"Geben Sie das neue Passwort ein",ja:"新しいパスワードを入力してください",ko:"새 비밀번호를 입력하세요",zh:"输入新密码",it:"Inserisci la nuova password",pt:"Digite a nova senha",hi:"नया पासवर्ड दर्ज करें",ar:"أدخل كلمة المرور الجديدة",ru:"Введите новый пароль","en-GB":"Enter new password"}),j({en:"Confirm new password",fr:"Confirmez le nouveau mot de passe",es:"Confirma tu nueva contraseña",de:"Bestätigen Sie das neue Passwort",ja:"新しいパスワードを確認してください",ko:"새 비밀번호를 확인하세요",zh:"确认新密码",it:"Conferma la nuova password",pt:"Confirme a nova senha",hi:"नए पासवर्ड की पुष्टि करें",ar:"تأكيد كلمة المرور الجديدة",ru:"Подтвердите новый пароль","en-GB":"Confirm new password"}),j({en:"Confirm new password",fr:"Confirmez votre nouveau mot de passe",es:"Confirma tu nueva contraseña",de:"Bestätigen Sie das neue Passwort",ja:"新しいパスワードを確認してください",ko:"새 비밀번호를 확인하세요",zh:"确认新密码",it:"Conferma la nuova password",pt:"Confirme a nova senha",hi:"नए पासवर्ड की पुष्टि करें",ar:"تأكيد كلمة المرور الجديدة",ru:"Подтвердите новый пароль","en-GB":"Confirm new password"}),j({en:"Change password",fr:"Changer le mot de passe",es:"Cambiar la contraseña",de:"Passwort ändern",ja:"パスワードを変更",ko:"비밀번호 변경",zh:"更改密码",it:"Cambia password",pt:"Alterar senha",hi:"पासवर्ड बदलें",ar:"تغيير كلمة المرور",ru:"Сменить пароль","en-GB":"Change password"}),j({en:"Click to change password",fr:"Cliquez pour changer le mot de passe",es:"Haz clic para cambiar la contraseña",de:"Klicken Sie, um das Passwort zu ändern",ja:"パスワードを変更するにはクリックしてください",ko:"비밀번호를 변경하려면 클릭하세요",zh:"单击以更改密码",it:"Clicca per cambiare la password",pt:"Clique para alterar a senha",hi:"पासवर्ड बदलने के लिए क्लिक करें",ar:"انقر لتغيير كلمة المرور",ru:"Нажмите, чтобы изменить пароль","en-GB":"Click to change password"});j({en:"Please enter your current password","en-GB":"Please enter your current password",fr:"Veuillez saisir votre mot de passe actuel",es:"Por favor, ingrese su contraseña actual",de:"Bitte geben Sie Ihr aktuelles Passwort ein",ja:"現在のパスワードを入力してください",ko:"현재 비밀번호를 입력하십시오",zh:"请输入您的当前密码",it:"Si prega di inserire la propria password attuale",pt:"Por favor, insira sua senha atual",hi:"कृपया अपना वर्तमान पासवर्ड दर्ज करें",ar:"يرجى إدخال كلمة المرور الحالية",ru:"Пожалуйста, введите ваш текущий пароль"}),j({en:"Please enter a valid password","en-GB":"Please enter a valid password",fr:"Veuillez saisir un mot de passe valide",es:"Por favor, ingrese una contraseña válida",de:"Bitte geben Sie ein gültiges Passwort ein",ja:"有効なパスワードを入力してください",ko:"유효한 비밀번호를 입력하십시오",zh:"请输入有效的密码",it:"Si prega di inserire una password valida",pt:"Por favor, insira uma senha válida",hi:"कृपया एक मान्य पासवर्ड दर्ज करें",ar:"يرجى إدخال كلمة مرور صالحة",ru:"Пожалуйста, введите действительный пароль"}),j({en:"Your password must be at least 8 characters","en-GB":"Your password must be at least 8 characters",fr:"Votre mot de passe doit comporter au moins 8 caractères",es:"Su contraseña debe tener al menos 8 caracteres",de:"Ihr Passwort muss mindestens 8 Zeichen lang sein",ja:"パスワードは8文字以上でなければなりません",ko:"비밀번호는 8자 이상이어야 합니다",zh:"您的密码必须至少为8个字符",it:"La tua password deve contenere almeno 8 caratteri",pt:"Sua senha deve ter pelo menos 8 caracteres",hi:"आपका पासवर्ड कम से कम 8 अक्षरों का होना चाहिए",ar:"يجب أن تحتوي كلمة المرور الخاصة بك على 8 أحرف على الأقل",ru:"Ваш пароль должен содержать не менее 8 символов"}),j({en:"Please enter your new password","en-GB":"Please enter your new password",fr:"Veuillez saisir votre nouveau mot de passe",es:"Por favor, ingrese su nueva contraseña",de:"Bitte geben Sie Ihr neues Passwort ein",ja:"新しいパスワードを入力してください",ko:"새 비밀번호를 입력하십시오",zh:"请输入您的新密码",it:"Si prega di inserire la propria nuova password",pt:"Por favor, insira sua nova senha",hi:"कृपया अपना नया पासवर्ड दर्ज करें",ar:"يرجى إدخال كلمة المرور الجديدة الخاصة بك",ru:"Пожалуйста, введите ваш новый пароль"}),j({en:"Please enter a valid new password","en-GB":"Please enter a valid new password",fr:"Veuillez saisir un nouveau mot de passe valide",es:"Por favor, ingrese una nueva contraseña válida",de:"Bitte geben Sie ein gültiges neues Passwort ein",ja:"有効な新しいパスワードを入力してください",ko:"유효한 새 비밀번호를 입력하십시오",zh:"请输入有效的新密码",it:"Si prega di inserire una nuova password valida",pt:"Por favor, insira uma nova senha válida",hi:"कृपया एक वैध नया पासवर्ड दर्ज करें",ar:"يرجى إدخال كلمة مرور جديدة صالحة",ru:"Пожалуйста, введите действительный новый пароль"}),j({en:"Please enter your new password again","en-GB":"Please enter your new password again",fr:"Veuillez saisir votre nouveau mot de passe à nouveau",es:"Por favor, ingrese su nueva contraseña nuevamente",de:"Bitte geben Sie Ihr neues Passwort erneut ein",ja:"新しいパスワードを再度入力してください",ko:"새 비밀번호를 다시 입력하십시오",zh:"请再次输入您的新密码",it:"Si prega di reinserire la propria nuova password",pt:"Por favor, insira sua nova senha novamente",hi:"कृपया अपना नया पासवर्ड फिर से दर्ज करें",ar:"يرجى إدخال كلمة المرور الجديدة الخاصة بك مرة أخرى",ru:"Пожалуйста, повторно введите ваш новый пароль"}),j({en:"Please enter a valid new password again","en-GB":"Please enter a valid new password again",fr:"Veuillez saisir un nouveau mot de passe valide à nouveau",es:"Por favor, ingrese una nueva contraseña válida nuevamente",de:"Bitte geben Sie erneut ein gültiges neues Passwort ein",ja:"もう一度有効な新しいパスワードを入力してください",ko:"유효한 새 비밀번호를 다시 입력하십시오",zh:"请再次输入有效的新密码",it:"Si prega di reinserire una nuova password valida",pt:"Por favor, insira uma nova senha válida novamente",hi:"कृपया एक वैध नया पासवर्ड फिर से दर्ज करें",ar:"يرجى إدخال كلمة مرور جديدة صالحة مرة أخرى",ru:"Пожалуйста, повторно введите действительный новый пароль"}),j({en:"New password and password confirmation must match","en-GB":"New password and password confirmation must match",fr:"Le nouveau mot de passe et la confirmation de mot de passe doivent correspondre",es:"La nueva contraseña y la confirmación de la contraseña deben coincidir",de:"Das neue Passwort und die Bestätigung müssen übereinstimmen",ja:"新しいパスワードとパスワード確認が一致する必要があります",ko:"새 비밀번호와 비밀번호 확인이 일치해야 합니다",zh:"新密码和密码确认必须匹配",it:"La nuova password e la conferma della password devono corrispondere",pt:"A nova senha e a confirmação da senha devem corresponder",hi:"नया पासवर्ड और पासवर्ड की पुष्टि मिलनी चाहिए",ar:"يجب أن يتطابق كلمة المرور الجديدة مع تأكيد كلمة المرور",ru:"Новый пароль и подтверждение пароля должны совпадать"});j({en:"Email address",fr:"Adresse e-mail",es:"Dirección de correo electrónico","en-GB":"Email address",de:"E-Mail-Adresse",ja:"電子メールアドレス",ko:"이메일 주소",zh:"电子邮件地址",it:"Indirizzo email",pt:"Endereço de e-mail",hi:"ईमेल पता",ar:"عنوان البريد الإلكتروني",ru:"Адрес электронной почты"}),j({en:"Enter e-mail address",fr:"Entrez votre adresse e-mail",es:"Ingrese su dirección de correo electrónico","en-GB":"Enter e-mail address",de:"Geben Sie die E-Mail-Adresse ein",ja:"メールアドレスを入力してください",ko:"이메일 주소를 입력하세요",zh:"输入电子邮件地址",it:"Inserisci l'indirizzo email",pt:"Insira o endereço de e-mail",hi:"ईमेल पता दर्ज करें",ar:"أدخل عنوان البريد الإلكتروني",ru:"Введите адрес электронной почты"}),j({en:"Send recovery email",fr:"Envoyer un e-mail de récupération",es:"Enviar correo de recuperación","en-GB":"Send recovery email",de:"Wiederherstellungs-E-Mail senden",ja:"回復メールを送信",ko:"복구 이메일 전송",zh:"发送恢复电子邮件",it:"Invia email di recupero",pt:"Enviar e-mail de recuperação",hi:"पुनर्प्राप्ति ईमेल भेजें",ar:"إرسال بريد إلكتروني لاستعادة كلمة المرور",ru:"Отправить письмо для восстановления"}),j({en:"Click to send recovery email",fr:"Cliquez pour envoyer un e-mail de récupération",es:"Haz clic para enviar correo de recuperación","en-GB":"Click to send recovery email",de:"Klicken Sie, um die Wiederherstellungs-E-Mail zu senden",ja:"回復メールを送信するにはクリックしてください",ko:"복구 이메일을 보내려면 클릭하세요",zh:"点击发送恢复电子邮件",it:"Clicca per inviare l'email di recupero",pt:"Clique para enviar o e-mail de recuperação",hi:"पुनर्प्राप्ति ईमेल भेजने के लिए क्लिक करें",ar:"انقر لإرسال بريد إلكتروني لاستعادة كلمة المرور",ru:"Щелкните, чтобы отправить электронное письмо для восстановления"}),j({en:"Resend recovery email",fr:"Renvoyer l’e-mail de récupération",es:"Reenviar correo de recuperación","en-GB":"Resend recovery email",de:"Wiederherstellungs-E-Mail erneut senden",ja:"回復メールを再送信",ko:"복구 이메일 재전송",zh:"重新发送恢复电子邮件",it:"Invia di nuovo l'email di recupero",pt:"Reenviar e-mail de recuperação",hi:"पुनर्प्राप्ति ईमेल पुनः भेजें",ar:"إعادة إرسال البريد الإلكتروني لاستعادة كلمة المرور",ru:"Повторно отправить письмо для восстановления"}),j({en:"Resend in",fr:"Renvoyer dans",es:"Reenviar en","en-GB":"Resend in",de:"Erneut senden in",ja:"再送信まで",ko:"다시 전송하기까지",zh:"重新发送",it:"Reinvia in",pt:"Reenviar em",hi:"फिर से भेजें",ar:"إعادة الإرسال في",ru:"Повторно отправить через"}),j({en:"Back to login",fr:"Retour à la connexion",es:"Volver al inicio de sesión","en-GB":"Back to login",de:"Zurück zur Anmeldung",ja:"ログインに戻る",ko:"로그인으로 돌아가기",zh:"返回登录",it:"Torna al login",pt:"Voltar ao login",hi:"लॉगइन पर वापस जाएं",ar:"العودة إلى تسجيل الدخول",ru:"Вернуться к входу"});j({en:"Please enter your email address","en-GB":"Please enter your email address",fr:"Veuillez saisir votre adresse e-mail",es:"Por favor, ingrese su dirección de correo electrónico",de:"Bitte geben Sie Ihre E-Mail-Adresse ein",ja:"メールアドレスを入力してください",ko:"이메일 주소를 입력하십시오",zh:"请输入您的电子邮件地址",it:"Si prega di inserire il proprio indirizzo email",pt:"Por favor, insira seu endereço de e-mail",hi:"कृपया अपना ईमेल पता डालें",ar:"يرجى إدخال عنوان بريدك الإلكتروني",ru:"Пожалуйста, введите свой адрес электронной почты"}),j({en:"Please enter a valid email address","en-GB":"Please enter a valid email address",fr:"Veuillez saisir une adresse e-mail valide",es:"Por favor, ingrese una dirección de correo electrónico válida",de:"Bitte geben Sie eine gültige E-Mail-Adresse ein",ja:"有効なメールアドレスを入力してください",ko:"유효한 이메일 주소를 입력하십시오",zh:"请输入有效的电子邮件地址",it:"Si prega di inserire un indirizzo email valido",pt:"Por favor, insira um endereço de e-mail válido",hi:"कृपया एक वैध ईमेल पता दर्ज करें",ar:"يرجى إدخال عنوان بريد إلكتروني صالح",ru:"Пожалуйста, введите действующий адрес электронной почты"}),j({en:"Please enter a valid email address","en-GB":"Please enter a valid email address",fr:"Veuillez saisir une adresse e-mail valide",es:"Por favor, ingrese una dirección de correo electrónico válida",de:"Bitte geben Sie eine gültige E-Mail-Adresse ein",ja:"有効なメールアドレスを入力してください",ko:"유효한 이메일 주소를 입력하십시오",zh:"请输入有效的电子邮件地址",it:"Si prega di inserire un indirizzo email valido",pt:"Por favor, insira um endereço de e-mail válido",hi:"कृपया एक वैध ईमेल पता दर्ज करें",ar:"يرجى إدخال عنوان بريد إلكتروني صالح",ru:"Пожалуйста, введите действующий адрес электронной почты"});const Sz=y.createContext({});function Oj(e){const t=y.useRef(null);return t.current===null&&(t.current=e()),t.current}const dd=y.createContext(null),yz=y.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function Fj(e=!0){const t=y.useContext(dd);if(t===null)return[!0,null];const{isPresent:a,onExitComplete:n,register:r}=t,s=y.useId();y.useEffect(()=>{e&&r(s)},[e]);const o=y.useCallback(()=>e&&n&&n(s),[s,n,e]);return!a&&n?[!1,o]:[!0]}const fd=typeof window<"u",Hj=fd?y.useLayoutEffect:y.useEffect,a1=e=>e;let Zo=a1;function Wo(e){let t;return()=>(t===void 0&&(t=e()),t)}const Bt=(e,t,a)=>{const n=t-e;return n===0?1:(a-e)/n},E1=e=>e*1e3,_1=e=>e/1e3,Pj={useManualTiming:!1};function Uj(e){let t=new Set,a=new Set,n=!1,r=!1;const s=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function u(f){s.has(f)&&(d.schedule(f),e()),f(o)}const d={schedule:(f,v=!1,p=!1)=>{const E=p&&n?t:a;return v&&s.add(f),E.has(f)||E.add(f),f},cancel:f=>{a.delete(f),s.delete(f)},process:f=>{if(o=f,n){r=!0;return}n=!0,[t,a]=[a,t],t.forEach(u),t.clear(),n=!1,r&&(r=!1,d.process(f))}};return d}const qs=["read","resolveKeyframes","update","preRender","render","postRender"],Vj=40;function zz(e,t){let a=!1,n=!0;const r={delta:0,timestamp:0,isProcessing:!1},s=()=>a=!0,o=qs.reduce((C,M)=>(C[M]=Uj(s),C),{}),{read:u,resolveKeyframes:d,update:f,preRender:v,render:p,postRender:A}=o,E=()=>{const C=performance.now();a=!1,r.delta=n?1e3/60:Math.max(Math.min(C-r.timestamp,Vj),1),r.timestamp=C,r.isProcessing=!0,u.process(r),d.process(r),f.process(r),v.process(r),p.process(r),A.process(r),r.isProcessing=!1,a&&t&&(n=!1,e(E))},_=()=>{a=!0,n=!0,r.isProcessing||e(E)};return{schedule:qs.reduce((C,M)=>{const x=o[M];return C[M]=(D,w=!1,b=!1)=>(a||_(),x.schedule(D,w,b)),C},{}),cancel:C=>{for(let M=0;M<qs.length;M++)o[qs[M]].cancel(C)},state:r,steps:o}}const{schedule:R0,cancel:Lt,state:g1,steps:o7}=zz(typeof requestAnimationFrame<"u"?requestAnimationFrame:a1,!0),Cz=y.createContext({strict:!1}),UA={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},h4={};for(const e in UA)h4[e]={isEnabled:t=>UA[e].some(a=>!!t[a])};function Gj(e){for(const t in e)h4[t]={...h4[t],...e[t]}}const jj=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function qc(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||jj.has(e)}let Mz=e=>!qc(e);function Kj(e){e&&(Mz=t=>t.startsWith("on")?!qc(t):e(t))}try{Kj(require("@emotion/is-prop-valid").default)}catch{}function $j(e,t,a){const n={};for(const r in e)r==="values"&&typeof e.values=="object"||(Mz(r)||a===!0&&qc(r)||!t&&!qc(r)||e.draggable&&r.startsWith("onDrag"))&&(n[r]=e[r]);return n}function Yj(e){if(typeof Proxy>"u")return e;const t=new Map,a=(...n)=>e(...n);return new Proxy(a,{get:(n,r)=>r==="create"?e:(t.has(r)||t.set(r,e(r)),t.get(r))})}const qo=y.createContext({});function br(e){return typeof e=="string"||Array.isArray(e)}function Xo(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const md=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],vd=["initial",...md];function Qo(e){return Xo(e.animate)||vd.some(t=>br(e[t]))}function Rz(e){return!!(Qo(e)||e.variants)}function Zj(e,t){if(Qo(e)){const{initial:a,animate:n}=e;return{initial:a===!1||br(a)?a:void 0,animate:br(n)?n:void 0}}return e.inherit!==!1?t:{}}function Wj(e){const{initial:t,animate:a}=Zj(e,y.useContext(qo));return y.useMemo(()=>({initial:t,animate:a}),[VA(t),VA(a)])}function VA(e){return Array.isArray(e)?e.join(" "):e}const qj=Symbol.for("motionComponentSymbol");function Kn(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Xj(e,t,a){return y.useCallback(n=>{n&&e.onMount&&e.onMount(n),t&&(n?t.mount(n):t.unmount()),a&&(typeof a=="function"?a(n):Kn(a)&&(a.current=n))},[t])}const pd=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Qj="framerAppearId",xz="data-"+pd(Qj),{schedule:Ad}=zz(queueMicrotask,!1),wz=y.createContext({});function Jj(e,t,a,n,r){var s,o;const{visualElement:u}=y.useContext(qo),d=y.useContext(Cz),f=y.useContext(dd),v=y.useContext(yz).reducedMotion,p=y.useRef(null);n=n||d.renderer,!p.current&&n&&(p.current=n(e,{visualState:t,parent:u,props:a,presenceContext:f,blockInitialAnimation:f?f.initial===!1:!1,reducedMotionConfig:v}));const A=p.current,E=y.useContext(wz);A&&!A.projection&&r&&(A.type==="html"||A.type==="svg")&&eK(p.current,a,r,E);const _=y.useRef(!1);y.useInsertionEffect(()=>{A&&_.current&&A.update(a,f)});const S=a[xz],z=y.useRef(!!S&&!(!((s=window.MotionHandoffIsComplete)===null||s===void 0)&&s.call(window,S))&&((o=window.MotionHasOptimisedAnimation)===null||o===void 0?void 0:o.call(window,S)));return Hj(()=>{A&&(_.current=!0,window.MotionIsMounted=!0,A.updateFeatures(),Ad.render(A.render),z.current&&A.animationState&&A.animationState.animateChanges())}),y.useEffect(()=>{A&&(!z.current&&A.animationState&&A.animationState.animateChanges(),z.current&&(queueMicrotask(()=>{var C;(C=window.MotionHandoffMarkAsComplete)===null||C===void 0||C.call(window,S)}),z.current=!1))}),A}function eK(e,t,a,n){const{layoutId:r,layout:s,drag:o,dragConstraints:u,layoutScroll:d,layoutRoot:f}=t;e.projection=new a(e.latestValues,t["data-framer-portal-id"]?void 0:bz(e.parent)),e.projection.setOptions({layoutId:r,layout:s,alwaysMeasureLayout:!!o||u&&Kn(u),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:n,layoutScroll:d,layoutRoot:f})}function bz(e){if(e)return e.options.allowProjection!==!1?e.projection:bz(e.parent)}function tK({preloadedFeatures:e,createVisualElement:t,useRender:a,useVisualState:n,Component:r}){var s,o;e&&Gj(e);function u(f,v){let p;const A={...y.useContext(yz),...f,layoutId:aK(f)},{isStatic:E}=A,_=Wj(f),S=n(f,E);if(!E&&fd){nK();const z=lK(A);p=z.MeasureLayout,_.visualElement=Jj(r,S,A,t,z.ProjectionNode)}return I.jsxs(qo.Provider,{value:_,children:[p&&_.visualElement?I.jsx(p,{visualElement:_.visualElement,...A}):null,a(r,f,Xj(S,_.visualElement,v),S,E,_.visualElement)]})}u.displayName=`motion.${typeof r=="string"?r:`create(${(o=(s=r.displayName)!==null&&s!==void 0?s:r.name)!==null&&o!==void 0?o:""})`}`;const d=y.forwardRef(u);return d[qj]=r,d}function aK({layoutId:e}){const t=y.useContext(Sz).id;return t&&e!==void 0?t+"-"+e:e}function nK(e,t){y.useContext(Cz).strict}function lK(e){const{drag:t,layout:a}=h4;if(!t&&!a)return{};const n={...t,...a};return{MeasureLayout:t!=null&&t.isEnabled(e)||a!=null&&a.isEnabled(e)?n.MeasureLayout:void 0,ProjectionNode:n.ProjectionNode}}const rK=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function gd(e){return typeof e!="string"||e.includes("-")?!1:!!(rK.indexOf(e)>-1||/[A-Z]/u.test(e))}function GA(e){const t=[{},{}];return e==null||e.values.forEach((a,n)=>{t[0][n]=a.get(),t[1][n]=a.getVelocity()}),t}function Ed(e,t,a,n){if(typeof t=="function"){const[r,s]=GA(n);t=t(a!==void 0?a:e.custom,r,s)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[r,s]=GA(n);t=t(a!==void 0?a:e.custom,r,s)}return t}const M8=e=>Array.isArray(e),iK=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),sK=e=>M8(e)?e[e.length-1]||0:e,R1=e=>!!(e&&e.getVelocity);function Sc(e){const t=R1(e)?e.get():e;return iK(t)?t.toValue():t}function cK({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:a},n,r,s){const o={latestValues:oK(n,r,s,e),renderState:t()};return a&&(o.onMount=u=>a({props:n,current:u,...o}),o.onUpdate=u=>a(u)),o}const Tz=e=>(t,a)=>{const n=y.useContext(qo),r=y.useContext(dd),s=()=>cK(e,t,n,r);return a?s():Oj(s)};function oK(e,t,a,n){const r={},s=n(e,{});for(const A in s)r[A]=Sc(s[A]);let{initial:o,animate:u}=e;const d=Qo(e),f=Rz(e);t&&f&&!d&&e.inherit!==!1&&(o===void 0&&(o=t.initial),u===void 0&&(u=t.animate));let v=a?a.initial===!1:!1;v=v||o===!1;const p=v?u:o;if(p&&typeof p!="boolean"&&!Xo(p)){const A=Array.isArray(p)?p:[p];for(let E=0;E<A.length;E++){const _=Ed(e,A[E]);if(_){const{transitionEnd:S,transition:z,...C}=_;for(const M in C){let x=C[M];if(Array.isArray(x)){const D=v?x.length-1:0;x=x[D]}x!==null&&(r[M]=x)}for(const M in S)r[M]=S[M]}}}return r}const C4=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Za=new Set(C4),kz=e=>t=>typeof t=="string"&&t.startsWith(e),Dz=kz("--"),uK=kz("var(--"),_d=e=>uK(e)?hK.test(e.split("/*")[0].trim()):!1,hK=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Bz=(e,t)=>t&&typeof e=="number"?t.transform(e):e,G3=(e,t,a)=>a>t?t:a<e?e:a,M4={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Tr={...M4,transform:e=>G3(0,1,e)},Xs={...M4,default:1},ui=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Nt=ui("deg"),l3=ui("%"),P2=ui("px"),dK=ui("vh"),fK=ui("vw"),jA={...l3,parse:e=>l3.parse(e)/100,transform:e=>l3.transform(e*100)},mK={borderWidth:P2,borderTopWidth:P2,borderRightWidth:P2,borderBottomWidth:P2,borderLeftWidth:P2,borderRadius:P2,radius:P2,borderTopLeftRadius:P2,borderTopRightRadius:P2,borderBottomRightRadius:P2,borderBottomLeftRadius:P2,width:P2,maxWidth:P2,height:P2,maxHeight:P2,top:P2,right:P2,bottom:P2,left:P2,padding:P2,paddingTop:P2,paddingRight:P2,paddingBottom:P2,paddingLeft:P2,margin:P2,marginTop:P2,marginRight:P2,marginBottom:P2,marginLeft:P2,backgroundPositionX:P2,backgroundPositionY:P2},vK={rotate:Nt,rotateX:Nt,rotateY:Nt,rotateZ:Nt,scale:Xs,scaleX:Xs,scaleY:Xs,scaleZ:Xs,skew:Nt,skewX:Nt,skewY:Nt,distance:P2,translateX:P2,translateY:P2,translateZ:P2,x:P2,y:P2,z:P2,perspective:P2,transformPerspective:P2,opacity:Tr,originX:jA,originY:jA,originZ:P2},KA={...M4,transform:Math.round},Id={...mK,...vK,zIndex:KA,size:P2,fillOpacity:Tr,strokeOpacity:Tr,numOctaves:KA},pK={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},AK=C4.length;function gK(e,t,a){let n="",r=!0;for(let s=0;s<AK;s++){const o=C4[s],u=e[o];if(u===void 0)continue;let d=!0;if(typeof u=="number"?d=u===(o.startsWith("scale")?1:0):d=parseFloat(u)===0,!d||a){const f=Bz(u,Id[o]);if(!d){r=!1;const v=pK[o]||o;n+=`${v}(${f}) `}a&&(t[o]=f)}}return n=n.trim(),a?n=a(t,r?"":n):r&&(n="none"),n}function Nd(e,t,a){const{style:n,vars:r,transformOrigin:s}=e;let o=!1,u=!1;for(const d in t){const f=t[d];if(Za.has(d)){o=!0;continue}else if(Dz(d)){r[d]=f;continue}else{const v=Bz(f,Id[d]);d.startsWith("origin")?(u=!0,s[d]=v):n[d]=v}}if(t.transform||(o||a?n.transform=gK(t,e.transform,a):n.transform&&(n.transform="none")),u){const{originX:d="50%",originY:f="50%",originZ:v=0}=s;n.transformOrigin=`${d} ${f} ${v}`}}const EK={offset:"stroke-dashoffset",array:"stroke-dasharray"},_K={offset:"strokeDashoffset",array:"strokeDasharray"};function IK(e,t,a=1,n=0,r=!0){e.pathLength=1;const s=r?EK:_K;e[s.offset]=P2.transform(-n);const o=P2.transform(t),u=P2.transform(a);e[s.array]=`${o} ${u}`}function $A(e,t,a){return typeof e=="string"?e:P2.transform(t+a*e)}function NK(e,t,a){const n=$A(t,e.x,e.width),r=$A(a,e.y,e.height);return`${n} ${r}`}function Sd(e,{attrX:t,attrY:a,attrScale:n,originX:r,originY:s,pathLength:o,pathSpacing:u=1,pathOffset:d=0,...f},v,p){if(Nd(e,f,p),v){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:A,style:E,dimensions:_}=e;A.transform&&(_&&(E.transform=A.transform),delete A.transform),_&&(r!==void 0||s!==void 0||E.transform)&&(E.transformOrigin=NK(_,r!==void 0?r:.5,s!==void 0?s:.5)),t!==void 0&&(A.x=t),a!==void 0&&(A.y=a),n!==void 0&&(A.scale=n),o!==void 0&&IK(A,o,u,d,!1)}const yd=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),Lz=()=>({...yd(),attrs:{}}),zd=e=>typeof e=="string"&&e.toLowerCase()==="svg";function Oz(e,{style:t,vars:a},n,r){Object.assign(e.style,t,r&&r.getProjectionStyles(n));for(const s in a)e.style.setProperty(s,a[s])}const Fz=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function Hz(e,t,a,n){Oz(e,t,void 0,n);for(const r in t.attrs)e.setAttribute(Fz.has(r)?r:pd(r),t.attrs[r])}const Xc={};function SK(e){Object.assign(Xc,e)}function Pz(e,{layout:t,layoutId:a}){return Za.has(e)||e.startsWith("origin")||(t||a!==void 0)&&(!!Xc[e]||e==="opacity")}function Cd(e,t,a){var n;const{style:r}=e,s={};for(const o in r)(R1(r[o])||t.style&&R1(t.style[o])||Pz(o,e)||((n=a==null?void 0:a.getValue(o))===null||n===void 0?void 0:n.liveStyle)!==void 0)&&(s[o]=r[o]);return s}function Uz(e,t,a){const n=Cd(e,t,a);for(const r in e)if(R1(e[r])||R1(t[r])){const s=C4.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;n[s]=e[r]}return n}function yK(e,t){try{t.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}}const YA=["x","y","width","height","cx","cy","r"],zK={useVisualState:Tz({scrapeMotionValuesFromProps:Uz,createRenderState:Lz,onUpdate:({props:e,prevProps:t,current:a,renderState:n,latestValues:r})=>{if(!a)return;let s=!!e.drag;if(!s){for(const u in r)if(Za.has(u)){s=!0;break}}if(!s)return;let o=!t;if(t)for(let u=0;u<YA.length;u++){const d=YA[u];e[d]!==t[d]&&(o=!0)}o&&R0.read(()=>{yK(a,n),R0.render(()=>{Sd(n,r,zd(a.tagName),e.transformTemplate),Hz(a,n)})})}})},CK={useVisualState:Tz({scrapeMotionValuesFromProps:Cd,createRenderState:yd})};function Vz(e,t,a){for(const n in t)!R1(t[n])&&!Pz(n,a)&&(e[n]=t[n])}function MK({transformTemplate:e},t){return y.useMemo(()=>{const a=yd();return Nd(a,t,e),Object.assign({},a.vars,a.style)},[t])}function RK(e,t){const a=e.style||{},n={};return Vz(n,a,e),Object.assign(n,MK(e,t)),n}function xK(e,t){const a={},n=RK(e,t);return e.drag&&e.dragListener!==!1&&(a.draggable=!1,n.userSelect=n.WebkitUserSelect=n.WebkitTouchCallout="none",n.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(a.tabIndex=0),a.style=n,a}function wK(e,t,a,n){const r=y.useMemo(()=>{const s=Lz();return Sd(s,t,zd(n),e.transformTemplate),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};Vz(s,e.style,e),r.style={...s,...r.style}}return r}function bK(e=!1){return(a,n,r,{latestValues:s},o)=>{const d=(gd(a)?wK:xK)(n,s,o,a),f=$j(n,typeof a=="string",e),v=a!==y.Fragment?{...f,...d,ref:r}:{},{children:p}=n,A=y.useMemo(()=>R1(p)?p.get():p,[p]);return y.createElement(a,{...v,children:A})}}function TK(e,t){return function(n,{forwardMotionProps:r}={forwardMotionProps:!1}){const o={...gd(n)?zK:CK,preloadedFeatures:e,useRender:bK(r),createVisualElement:t,Component:n};return tK(o)}}function Gz(e,t){if(!Array.isArray(t))return!1;const a=t.length;if(a!==e.length)return!1;for(let n=0;n<a;n++)if(t[n]!==e[n])return!1;return!0}function Jo(e,t,a){const n=e.getProps();return Ed(n,t,a!==void 0?a:n.custom,e)}const kK=Wo(()=>window.ScrollTimeline!==void 0);class DK{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>"finished"in t?t.finished:t))}getAll(t){return this.animations[0][t]}setAll(t,a){for(let n=0;n<this.animations.length;n++)this.animations[n][t]=a}attachTimeline(t,a){const n=this.animations.map(r=>{if(kK()&&r.attachTimeline)return r.attachTimeline(t);if(typeof a=="function")return a(r)});return()=>{n.forEach((r,s)=>{r&&r(),this.animations[s].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let a=0;a<this.animations.length;a++)t=Math.max(t,this.animations[a].duration);return t}runAll(t){this.animations.forEach(a=>a[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class jz extends DK{then(t,a){return Promise.all(this.animations).then(t).catch(a)}}function hi(e,t){return e?e[t]||e.default||e:void 0}const Qc=2e4;function eu(e){let t=0;const a=50;let n=e.next(t);for(;!n.done&&t<Qc;)t+=a,n=e.next(t);return t>=Qc?1/0:t}function R4(e){return typeof e=="function"}function Jc(e,t){e.timeline=t,e.onfinish=null}const tu=e=>Array.isArray(e)&&typeof e[0]=="number",BK={linearEasing:void 0};function LK(e,t){const a=Wo(e);return()=>{var n;return(n=BK[t])!==null&&n!==void 0?n:a()}}const kr=LK(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Md=(e,t,a=10)=>{let n="";const r=Math.max(Math.round(t/a),2);for(let s=0;s<r;s++)n+=e(Bt(0,r-1,s))+", ";return`linear(${n.substring(0,n.length-2)})`};function Rd(e){return!!(typeof e=="function"&&kr()||!e||typeof e=="string"&&(e in R8||kr())||tu(e)||Array.isArray(e)&&e.every(Rd))}const Wl=([e,t,a,n])=>`cubic-bezier(${e}, ${t}, ${a}, ${n})`,R8={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Wl([0,.65,.55,1]),circOut:Wl([.55,0,1,.45]),backIn:Wl([.31,.01,.66,-.59]),backOut:Wl([.33,1.53,.69,.99])};function xd(e,t){if(e)return typeof e=="function"&&kr()?Md(e,t):tu(e)?Wl(e):Array.isArray(e)?e.map(a=>xd(a,t)||R8.easeOut):R8[e]}const Be={x:!1,y:!1};function Kz(){return Be.x||Be.y}function OK(e,t,a){var n;if(e instanceof Element)return[e];if(typeof e=="string"){let r=document;const s=(n=void 0)!==null&&n!==void 0?n:r.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e)}function $z(e,t){const a=OK(e),n=new AbortController,r={passive:!0,...t,signal:n.signal};return[a,r,()=>n.abort()]}function ZA(e){return t=>{t.pointerType==="touch"||Kz()||e(t)}}function Yz(e,t,a={}){const[n,r,s]=$z(e,a),o=ZA(u=>{const{target:d}=u,f=t(u);if(typeof f!="function"||!d)return;const v=ZA(p=>{f(p),d.removeEventListener("pointerleave",v)});d.addEventListener("pointerleave",v,r)});return n.forEach(u=>{u.addEventListener("pointerenter",o,r)}),s}const Zz=(e,t)=>t?e===t?!0:Zz(e,t.parentElement):!1,wd=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,FK=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function HK(e){return FK.has(e.tagName)||e.tabIndex!==-1}const ql=new WeakSet;function WA(e){return t=>{t.key==="Enter"&&e(t)}}function u7(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const PK=(e,t)=>{const a=e.currentTarget;if(!a)return;const n=WA(()=>{if(ql.has(a))return;u7(a,"down");const r=WA(()=>{u7(a,"up")}),s=()=>u7(a,"cancel");a.addEventListener("keyup",r,t),a.addEventListener("blur",s,t)});a.addEventListener("keydown",n,t),a.addEventListener("blur",()=>a.removeEventListener("keydown",n),t)};function qA(e){return wd(e)&&!Kz()}function Wz(e,t,a={}){const[n,r,s]=$z(e,a),o=u=>{const d=u.currentTarget;if(!qA(u)||ql.has(d))return;ql.add(d);const f=t(u),v=(E,_)=>{window.removeEventListener("pointerup",p),window.removeEventListener("pointercancel",A),!(!qA(E)||!ql.has(d))&&(ql.delete(d),typeof f=="function"&&f(E,{success:_}))},p=E=>{v(E,a.useGlobalTarget||Zz(d,E.target))},A=E=>{v(E,!1)};window.addEventListener("pointerup",p,r),window.addEventListener("pointercancel",A,r)};return n.forEach(u=>{!HK(u)&&u.getAttribute("tabindex")===null&&(u.tabIndex=0),(a.useGlobalTarget?window:u).addEventListener("pointerdown",o,r),u.addEventListener("focus",f=>PK(f,r),r)}),s}function UK(e){return e==="x"||e==="y"?Be[e]?null:(Be[e]=!0,()=>{Be[e]=!1}):Be.x||Be.y?null:(Be.x=Be.y=!0,()=>{Be.x=Be.y=!1})}const qz=new Set(["width","height","top","left","right","bottom",...C4]);let yc;function VK(){yc=void 0}const r3={now:()=>(yc===void 0&&r3.set(g1.isProcessing||Pj.useManualTiming?g1.timestamp:performance.now()),yc),set:e=>{yc=e,queueMicrotask(VK)}};function bd(e,t){e.indexOf(t)===-1&&e.push(t)}function Td(e,t){const a=e.indexOf(t);a>-1&&e.splice(a,1)}let kd=class{constructor(){this.subscriptions=[]}add(t){return bd(this.subscriptions,t),()=>Td(this.subscriptions,t)}notify(t,a,n){const r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](t,a,n);else for(let s=0;s<r;s++){const o=this.subscriptions[s];o&&o(t,a,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}};function Xz(e,t){return t?e*(1e3/t):0}const XA=30,GK=e=>!isNaN(parseFloat(e));let jK=class{constructor(t,a={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(n,r=!0)=>{const s=r3.now();this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(n),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),r&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=a.owner}setCurrent(t){this.current=t,this.updatedAt=r3.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=GK(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,a){this.events[t]||(this.events[t]=new kd);const n=this.events[t].add(a);return t==="change"?()=>{n(),R0.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,a){this.passiveEffect=t,this.stopPassiveEffect=a}set(t,a=!0){!a||!this.passiveEffect?this.updateAndNotify(t,a):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,a,n){this.set(a),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,a=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,a&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=r3.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>XA)return 0;const a=Math.min(this.updatedAt-this.prevUpdatedAt,XA);return Xz(parseFloat(this.current)-parseFloat(this.prevFrameValue),a)}start(t){return this.stop(),new Promise(a=>{this.hasAnimated=!0,this.animation=t(a),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function Dr(e,t){return new jK(e,t)}function KK(e,t,a){e.hasValue(t)?e.getValue(t).set(a):e.addValue(t,Dr(a))}function $K(e,t){const a=Jo(e,t);let{transitionEnd:n={},transition:r={},...s}=a||{};s={...s,...n};for(const o in s){const u=sK(s[o]);KK(e,o,u)}}function YK(e){return!!(R1(e)&&e.add)}function x8(e,t){const a=e.getValue("willChange");if(YK(a))return a.add(t)}function Qz(e){return e.props[xz]}const Jz=(e,t,a)=>(((1-3*a+3*t)*e+(3*a-6*t))*e+3*t)*e,ZK=1e-7,WK=12;function qK(e,t,a,n,r){let s,o,u=0;do o=t+(a-t)/2,s=Jz(o,n,r)-e,s>0?a=o:t=o;while(Math.abs(s)>ZK&&++u<WK);return o}function di(e,t,a,n){if(e===t&&a===n)return a1;const r=s=>qK(s,0,1,e,a);return s=>s===0||s===1?s:Jz(r(s),t,n)}const eC=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,tC=e=>t=>1-e(1-t),aC=di(.33,1.53,.69,.99),Dd=tC(aC),nC=eC(Dd),lC=e=>(e*=2)<1?.5*Dd(e):.5*(2-Math.pow(2,-10*(e-1))),Bd=e=>1-Math.sin(Math.acos(e)),rC=tC(Bd),iC=eC(Bd),sC=e=>/^0[^.\s]+$/u.test(e);function XK(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||sC(e):!0}const rr=e=>Math.round(e*1e5)/1e5,Ld=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function QK(e){return e==null}const JK=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Od=(e,t)=>a=>!!(typeof a=="string"&&JK.test(a)&&a.startsWith(e)||t&&!QK(a)&&Object.prototype.hasOwnProperty.call(a,t)),cC=(e,t,a)=>n=>{if(typeof n!="string")return n;const[r,s,o,u]=n.match(Ld);return{[e]:parseFloat(r),[t]:parseFloat(s),[a]:parseFloat(o),alpha:u!==void 0?parseFloat(u):1}},e$=e=>G3(0,255,e),h7={...M4,transform:e=>Math.round(e$(e))},Ra={test:Od("rgb","red"),parse:cC("red","green","blue"),transform:({red:e,green:t,blue:a,alpha:n=1})=>"rgba("+h7.transform(e)+", "+h7.transform(t)+", "+h7.transform(a)+", "+rr(Tr.transform(n))+")"};function t$(e){let t="",a="",n="",r="";return e.length>5?(t=e.substring(1,3),a=e.substring(3,5),n=e.substring(5,7),r=e.substring(7,9)):(t=e.substring(1,2),a=e.substring(2,3),n=e.substring(3,4),r=e.substring(4,5),t+=t,a+=a,n+=n,r+=r),{red:parseInt(t,16),green:parseInt(a,16),blue:parseInt(n,16),alpha:r?parseInt(r,16)/255:1}}const w8={test:Od("#"),parse:t$,transform:Ra.transform},$n={test:Od("hsl","hue"),parse:cC("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:a,alpha:n=1})=>"hsla("+Math.round(e)+", "+l3.transform(rr(t))+", "+l3.transform(rr(a))+", "+rr(Tr.transform(n))+")"},C1={test:e=>Ra.test(e)||w8.test(e)||$n.test(e),parse:e=>Ra.test(e)?Ra.parse(e):$n.test(e)?$n.parse(e):w8.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Ra.transform(e):$n.transform(e)},a$=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function n$(e){var t,a;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Ld))===null||t===void 0?void 0:t.length)||0)+(((a=e.match(a$))===null||a===void 0?void 0:a.length)||0)>0}const oC="number",uC="color",l$="var",r$="var(",QA="${}",i$=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Br(e){const t=e.toString(),a=[],n={color:[],number:[],var:[]},r=[];let s=0;const u=t.replace(i$,d=>(C1.test(d)?(n.color.push(s),r.push(uC),a.push(C1.parse(d))):d.startsWith(r$)?(n.var.push(s),r.push(l$),a.push(d)):(n.number.push(s),r.push(oC),a.push(parseFloat(d))),++s,QA)).split(QA);return{values:a,split:u,indexes:n,types:r}}function hC(e){return Br(e).values}function dC(e){const{split:t,types:a}=Br(e),n=t.length;return r=>{let s="";for(let o=0;o<n;o++)if(s+=t[o],r[o]!==void 0){const u=a[o];u===oC?s+=rr(r[o]):u===uC?s+=C1.transform(r[o]):s+=r[o]}return s}}const s$=e=>typeof e=="number"?0:e;function c$(e){const t=hC(e);return dC(e)(t.map(s$))}const Ot={test:n$,parse:hC,createTransformer:dC,getAnimatableNone:c$},o$=new Set(["brightness","contrast","saturate","opacity"]);function u$(e){const[t,a]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[n]=a.match(Ld)||[];if(!n)return e;const r=a.replace(n,"");let s=o$.has(t)?1:0;return n!==a&&(s*=100),t+"("+s+r+")"}const h$=/\b([a-z-]*)\(.*?\)/gu,b8={...Ot,getAnimatableNone:e=>{const t=e.match(h$);return t?t.map(u$).join(" "):e}},d$={...Id,color:C1,backgroundColor:C1,outlineColor:C1,fill:C1,stroke:C1,borderColor:C1,borderTopColor:C1,borderRightColor:C1,borderBottomColor:C1,borderLeftColor:C1,filter:b8,WebkitFilter:b8},Fd=e=>d$[e];function fC(e,t){let a=Fd(e);return a!==b8&&(a=Ot),a.getAnimatableNone?a.getAnimatableNone(t):void 0}const f$=new Set(["auto","none","0"]);function m$(e,t,a){let n=0,r;for(;n<e.length&&!r;){const s=e[n];typeof s=="string"&&!f$.has(s)&&Br(s).values.length&&(r=e[n]),n++}if(r&&a)for(const s of t)e[s]=fC(a,r)}const JA=e=>e===M4||e===P2,eg=(e,t)=>parseFloat(e.split(", ")[t]),tg=(e,t)=>(a,{transform:n})=>{if(n==="none"||!n)return 0;const r=n.match(/^matrix3d\((.+)\)$/u);if(r)return eg(r[1],t);{const s=n.match(/^matrix\((.+)\)$/u);return s?eg(s[1],e):0}},v$=new Set(["x","y","z"]),p$=C4.filter(e=>!v$.has(e));function A$(e){const t=[];return p$.forEach(a=>{const n=e.getValue(a);n!==void 0&&(t.push([a,n.get()]),n.set(a.startsWith("scale")?1:0))}),t}const d4={width:({x:e},{paddingLeft:t="0",paddingRight:a="0"})=>e.max-e.min-parseFloat(t)-parseFloat(a),height:({y:e},{paddingTop:t="0",paddingBottom:a="0"})=>e.max-e.min-parseFloat(t)-parseFloat(a),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:tg(4,13),y:tg(5,14)};d4.translateX=d4.x;d4.translateY=d4.y;const ka=new Set;let T8=!1,k8=!1;function mC(){if(k8){const e=Array.from(ka).filter(n=>n.needsMeasurement),t=new Set(e.map(n=>n.element)),a=new Map;t.forEach(n=>{const r=A$(n);r.length&&(a.set(n,r),n.render())}),e.forEach(n=>n.measureInitialState()),t.forEach(n=>{n.render();const r=a.get(n);r&&r.forEach(([s,o])=>{var u;(u=n.getValue(s))===null||u===void 0||u.set(o)})}),e.forEach(n=>n.measureEndState()),e.forEach(n=>{n.suspendedScrollY!==void 0&&window.scrollTo(0,n.suspendedScrollY)})}k8=!1,T8=!1,ka.forEach(e=>e.complete()),ka.clear()}function vC(){ka.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(k8=!0)})}function g$(){vC(),mC()}let Hd=class{constructor(t,a,n,r,s,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=a,this.name=n,this.motionValue=r,this.element=s,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(ka.add(this),T8||(T8=!0,R0.read(vC),R0.resolveKeyframes(mC))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:a,element:n,motionValue:r}=this;for(let s=0;s<t.length;s++)if(t[s]===null)if(s===0){const o=r==null?void 0:r.get(),u=t[t.length-1];if(o!==void 0)t[0]=o;else if(n&&a){const d=n.readValue(a,u);d!=null&&(t[0]=d)}t[0]===void 0&&(t[0]=u),r&&o===void 0&&r.set(t[0])}else t[s]=t[s-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),ka.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,ka.delete(this))}resume(){this.isComplete||this.scheduleResolve()}};const pC=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),E$=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function _$(e){const t=E$.exec(e);if(!t)return[,];const[,a,n,r]=t;return[`--${a??n}`,r]}function AC(e,t,a=1){const[n,r]=_$(e);if(!n)return;const s=window.getComputedStyle(t).getPropertyValue(n);if(s){const o=s.trim();return pC(o)?parseFloat(o):o}return _d(r)?AC(r,t,a+1):r}const gC=e=>t=>t.test(e),I$={test:e=>e==="auto",parse:e=>e},EC=[M4,P2,l3,Nt,fK,dK,I$],ag=e=>EC.find(gC(e));let _C=class extends Hd{constructor(t,a,n,r,s){super(t,a,n,r,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:a,name:n}=this;if(!a||!a.current)return;super.readKeyframes();for(let d=0;d<t.length;d++){let f=t[d];if(typeof f=="string"&&(f=f.trim(),_d(f))){const v=AC(f,a.current);v!==void 0&&(t[d]=v),d===t.length-1&&(this.finalKeyframe=f)}}if(this.resolveNoneKeyframes(),!qz.has(n)||t.length!==2)return;const[r,s]=t,o=ag(r),u=ag(s);if(o!==u)if(JA(o)&&JA(u))for(let d=0;d<t.length;d++){const f=t[d];typeof f=="string"&&(t[d]=parseFloat(f))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:a}=this,n=[];for(let r=0;r<t.length;r++)XK(t[r])&&n.push(r);n.length&&m$(t,n,a)}measureInitialState(){const{element:t,unresolvedKeyframes:a,name:n}=this;if(!t||!t.current)return;n==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=d4[n](t.measureViewportBox(),window.getComputedStyle(t.current)),a[0]=this.measuredOrigin;const r=a[a.length-1];r!==void 0&&t.getValue(n,r).jump(r,!1)}measureEndState(){var t;const{element:a,name:n,unresolvedKeyframes:r}=this;if(!a||!a.current)return;const s=a.getValue(n);s&&s.jump(this.measuredOrigin,!1);const o=r.length-1,u=r[o];r[o]=d4[n](a.measureViewportBox(),window.getComputedStyle(a.current)),u!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=u),!((t=this.removedTransforms)===null||t===void 0)&&t.length&&this.removedTransforms.forEach(([d,f])=>{a.getValue(d).set(f)}),this.resolveNoneKeyframes()}};const ng=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Ot.test(e)||e==="0")&&!e.startsWith("url("));function N$(e){const t=e[0];if(e.length===1)return!0;for(let a=0;a<e.length;a++)if(e[a]!==t)return!0}function S$(e,t,a,n){const r=e[0];if(r===null)return!1;if(t==="display"||t==="visibility")return!0;const s=e[e.length-1],o=ng(r,t),u=ng(s,t);return!o||!u?!1:N$(e)||(a==="spring"||R4(a))&&n}const y$=e=>e!==null;function au(e,{repeat:t,repeatType:a="loop"},n){const r=e.filter(y$),s=t&&a!=="loop"&&t%2===1?0:r.length-1;return!s||n===void 0?r[s]:n}const z$=40;let IC=class{constructor({autoplay:t=!0,delay:a=0,type:n="keyframes",repeat:r=0,repeatDelay:s=0,repeatType:o="loop",...u}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=r3.now(),this.options={autoplay:t,delay:a,type:n,repeat:r,repeatDelay:s,repeatType:o,...u},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>z$?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&g$(),this._resolved}onKeyframesResolved(t,a){this.resolvedAt=r3.now(),this.hasAttemptedResolve=!0;const{name:n,type:r,velocity:s,delay:o,onComplete:u,onUpdate:d,isGenerator:f}=this.options;if(!f&&!S$(t,n,r,s))if(o)this.options.duration=0;else{d&&d(au(t,this.options,a)),u&&u(),this.resolveFinishedPromise();return}const v=this.initPlayback(t,a);v!==!1&&(this._resolved={keyframes:t,finalKeyframe:a,...v},this.onPostResolved())}onPostResolved(){}then(t,a){return this.currentFinishedPromise.then(t,a)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}};const k0=(e,t,a)=>e+(t-e)*a;function d7(e,t,a){return a<0&&(a+=1),a>1&&(a-=1),a<1/6?e+(t-e)*6*a:a<1/2?t:a<2/3?e+(t-e)*(2/3-a)*6:e}function C$({hue:e,saturation:t,lightness:a,alpha:n}){e/=360,t/=100,a/=100;let r=0,s=0,o=0;if(!t)r=s=o=a;else{const u=a<.5?a*(1+t):a+t-a*t,d=2*a-u;r=d7(d,u,e+1/3),s=d7(d,u,e),o=d7(d,u,e-1/3)}return{red:Math.round(r*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:n}}function eo(e,t){return a=>a>0?t:e}const f7=(e,t,a)=>{const n=e*e,r=a*(t*t-n)+n;return r<0?0:Math.sqrt(r)},M$=[w8,Ra,$n],R$=e=>M$.find(t=>t.test(e));function lg(e){const t=R$(e);if(!t)return!1;let a=t.parse(e);return t===$n&&(a=C$(a)),a}const rg=(e,t)=>{const a=lg(e),n=lg(t);if(!a||!n)return eo(e,t);const r={...a};return s=>(r.red=f7(a.red,n.red,s),r.green=f7(a.green,n.green,s),r.blue=f7(a.blue,n.blue,s),r.alpha=k0(a.alpha,n.alpha,s),Ra.transform(r))},x$=(e,t)=>a=>t(e(a)),fi=(...e)=>e.reduce(x$),D8=new Set(["none","hidden"]);function w$(e,t){return D8.has(e)?a=>a<=0?e:t:a=>a>=1?t:e}function b$(e,t){return a=>k0(e,t,a)}function Pd(e){return typeof e=="number"?b$:typeof e=="string"?_d(e)?eo:C1.test(e)?rg:D$:Array.isArray(e)?NC:typeof e=="object"?C1.test(e)?rg:T$:eo}function NC(e,t){const a=[...e],n=a.length,r=e.map((s,o)=>Pd(s)(s,t[o]));return s=>{for(let o=0;o<n;o++)a[o]=r[o](s);return a}}function T$(e,t){const a={...e,...t},n={};for(const r in a)e[r]!==void 0&&t[r]!==void 0&&(n[r]=Pd(e[r])(e[r],t[r]));return r=>{for(const s in n)a[s]=n[s](r);return a}}function k$(e,t){var a;const n=[],r={color:0,var:0,number:0};for(let s=0;s<t.values.length;s++){const o=t.types[s],u=e.indexes[o][r[o]],d=(a=e.values[u])!==null&&a!==void 0?a:0;n[s]=d,r[o]++}return n}const D$=(e,t)=>{const a=Ot.createTransformer(t),n=Br(e),r=Br(t);return n.indexes.var.length===r.indexes.var.length&&n.indexes.color.length===r.indexes.color.length&&n.indexes.number.length>=r.indexes.number.length?D8.has(e)&&!r.values.length||D8.has(t)&&!n.values.length?w$(e,t):fi(NC(k$(n,r),r.values),a):eo(e,t)};function SC(e,t,a){return typeof e=="number"&&typeof t=="number"&&typeof a=="number"?k0(e,t,a):Pd(e)(e,t)}const B$=5;function yC(e,t,a){const n=Math.max(t-B$,0);return Xz(a-e(n),t-n)}const H0={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},ig=.001;function L$({duration:e=H0.duration,bounce:t=H0.bounce,velocity:a=H0.velocity,mass:n=H0.mass}){let r,s,o=1-t;o=G3(H0.minDamping,H0.maxDamping,o),e=G3(H0.minDuration,H0.maxDuration,_1(e)),o<1?(r=f=>{const v=f*o,p=v*e,A=v-a,E=B8(f,o),_=Math.exp(-p);return ig-A/E*_},s=f=>{const p=f*o*e,A=p*a+a,E=Math.pow(o,2)*Math.pow(f,2)*e,_=Math.exp(-p),S=B8(Math.pow(f,2),o);return(-r(f)+ig>0?-1:1)*((A-E)*_)/S}):(r=f=>{const v=Math.exp(-f*e),p=(f-a)*e+1;return-.001+v*p},s=f=>{const v=Math.exp(-f*e),p=(a-f)*(e*e);return v*p});const u=5/e,d=F$(r,s,u);if(e=E1(e),isNaN(d))return{stiffness:H0.stiffness,damping:H0.damping,duration:e};{const f=Math.pow(d,2)*n;return{stiffness:f,damping:o*2*Math.sqrt(n*f),duration:e}}}const O$=12;function F$(e,t,a){let n=a;for(let r=1;r<O$;r++)n=n-e(n)/t(n);return n}function B8(e,t){return e*Math.sqrt(1-t*t)}const H$=["duration","bounce"],P$=["stiffness","damping","mass"];function sg(e,t){return t.some(a=>e[a]!==void 0)}function U$(e){let t={velocity:H0.velocity,stiffness:H0.stiffness,damping:H0.damping,mass:H0.mass,isResolvedFromDuration:!1,...e};if(!sg(e,P$)&&sg(e,H$))if(e.visualDuration){const a=e.visualDuration,n=2*Math.PI/(a*1.2),r=n*n,s=2*G3(.05,1,1-(e.bounce||0))*Math.sqrt(r);t={...t,mass:H0.mass,stiffness:r,damping:s}}else{const a=L$(e);t={...t,...a,mass:H0.mass},t.isResolvedFromDuration=!0}return t}function zC(e=H0.visualDuration,t=H0.bounce){const a=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:n,restDelta:r}=a;const s=a.keyframes[0],o=a.keyframes[a.keyframes.length-1],u={done:!1,value:s},{stiffness:d,damping:f,mass:v,duration:p,velocity:A,isResolvedFromDuration:E}=U$({...a,velocity:-_1(a.velocity||0)}),_=A||0,S=f/(2*Math.sqrt(d*v)),z=o-s,C=_1(Math.sqrt(d/v)),M=Math.abs(z)<5;n||(n=M?H0.restSpeed.granular:H0.restSpeed.default),r||(r=M?H0.restDelta.granular:H0.restDelta.default);let x;if(S<1){const w=B8(C,S);x=b=>{const T=Math.exp(-S*C*b);return o-T*((_+S*C*z)/w*Math.sin(w*b)+z*Math.cos(w*b))}}else if(S===1)x=w=>o-Math.exp(-C*w)*(z+(_+C*z)*w);else{const w=C*Math.sqrt(S*S-1);x=b=>{const T=Math.exp(-S*C*b),O=Math.min(w*b,300);return o-T*((_+S*C*z)*Math.sinh(O)+w*z*Math.cosh(O))/w}}const D={calculatedDuration:E&&p||null,next:w=>{const b=x(w);if(E)u.done=w>=p;else{let T=0;S<1&&(T=w===0?E1(_):yC(x,w,b));const O=Math.abs(T)<=n,H=Math.abs(o-b)<=r;u.done=O&&H}return u.value=u.done?o:b,u},toString:()=>{const w=Math.min(eu(D),Qc),b=Md(T=>D.next(w*T).value,w,30);return w+"ms "+b}};return D}function cg({keyframes:e,velocity:t=0,power:a=.8,timeConstant:n=325,bounceDamping:r=10,bounceStiffness:s=500,modifyTarget:o,min:u,max:d,restDelta:f=.5,restSpeed:v}){const p=e[0],A={done:!1,value:p},E=O=>u!==void 0&&O<u||d!==void 0&&O>d,_=O=>u===void 0?d:d===void 0||Math.abs(u-O)<Math.abs(d-O)?u:d;let S=a*t;const z=p+S,C=o===void 0?z:o(z);C!==z&&(S=C-p);const M=O=>-S*Math.exp(-O/n),x=O=>C+M(O),D=O=>{const H=M(O),U=x(O);A.done=Math.abs(H)<=f,A.value=A.done?C:U};let w,b;const T=O=>{E(A.value)&&(w=O,b=zC({keyframes:[A.value,_(A.value)],velocity:yC(x,O,A.value),damping:r,stiffness:s,restDelta:f,restSpeed:v}))};return T(0),{calculatedDuration:null,next:O=>{let H=!1;return!b&&w===void 0&&(H=!0,D(O),T(O)),w!==void 0&&O>=w?b.next(O-w):(!H&&D(O),A)}}}const V$=di(.42,0,1,1),G$=di(0,0,.58,1),CC=di(.42,0,.58,1),j$=e=>Array.isArray(e)&&typeof e[0]!="number",K$={linear:a1,easeIn:V$,easeInOut:CC,easeOut:G$,circIn:Bd,circInOut:iC,circOut:rC,backIn:Dd,backInOut:nC,backOut:aC,anticipate:lC},og=e=>{if(tu(e)){Zo(e.length===4);const[t,a,n,r]=e;return di(t,a,n,r)}else if(typeof e=="string")return K$[e];return e};function $$(e,t,a){const n=[],r=a||SC,s=e.length-1;for(let o=0;o<s;o++){let u=r(e[o],e[o+1]);if(t){const d=Array.isArray(t)?t[o]||a1:t;u=fi(d,u)}n.push(u)}return n}function Y$(e,t,{clamp:a=!0,ease:n,mixer:r}={}){const s=e.length;if(Zo(s===t.length),s===1)return()=>t[0];if(s===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());const u=$$(t,n,r),d=u.length,f=v=>{if(o&&v<e[0])return t[0];let p=0;if(d>1)for(;p<e.length-2&&!(v<e[p+1]);p++);const A=Bt(e[p],e[p+1],v);return u[p](A)};return a?v=>f(G3(e[0],e[s-1],v)):f}function Z$(e,t){const a=e[e.length-1];for(let n=1;n<=t;n++){const r=Bt(0,t,n);e.push(k0(a,1,r))}}function W$(e){const t=[0];return Z$(t,e.length-1),t}function q$(e,t){return e.map(a=>a*t)}function X$(e,t){return e.map(()=>t||CC).splice(0,e.length-1)}function to({duration:e=300,keyframes:t,times:a,ease:n="easeInOut"}){const r=j$(n)?n.map(og):og(n),s={done:!1,value:t[0]},o=q$(a&&a.length===t.length?a:W$(t),e),u=Y$(o,t,{ease:Array.isArray(r)?r:X$(t,r)});return{calculatedDuration:e,next:d=>(s.value=u(d),s.done=d>=e,s)}}const Q$=e=>{const t=({timestamp:a})=>e(a);return{start:()=>R0.update(t,!0),stop:()=>Lt(t),now:()=>g1.isProcessing?g1.timestamp:r3.now()}},J$={decay:cg,inertia:cg,tween:to,keyframes:to,spring:zC},eY=e=>e/100;let Ud=class extends IC{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:d}=this.options;d&&d()};const{name:a,motionValue:n,element:r,keyframes:s}=this.options,o=(r==null?void 0:r.KeyframeResolver)||Hd,u=(d,f)=>this.onKeyframesResolved(d,f);this.resolver=new o(s,u,a,n,r),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:a="keyframes",repeat:n=0,repeatDelay:r=0,repeatType:s,velocity:o=0}=this.options,u=R4(a)?a:J$[a]||to;let d,f;u!==to&&typeof t[0]!="number"&&(d=fi(eY,SC(t[0],t[1])),t=[0,100]);const v=u({...this.options,keyframes:t});s==="mirror"&&(f=u({...this.options,keyframes:[...t].reverse(),velocity:-o})),v.calculatedDuration===null&&(v.calculatedDuration=eu(v));const{calculatedDuration:p}=v,A=p+r,E=A*(n+1)-r;return{generator:v,mirroredGenerator:f,mapPercentToKeyframes:d,calculatedDuration:p,resolvedDuration:A,totalDuration:E}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,a=!1){const{resolved:n}=this;if(!n){const{keyframes:O}=this.options;return{done:!0,value:O[O.length-1]}}const{finalKeyframe:r,generator:s,mirroredGenerator:o,mapPercentToKeyframes:u,keyframes:d,calculatedDuration:f,totalDuration:v,resolvedDuration:p}=n;if(this.startTime===null)return s.next(0);const{delay:A,repeat:E,repeatType:_,repeatDelay:S,onUpdate:z}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-v/this.speed,this.startTime)),a?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const C=this.currentTime-A*(this.speed>=0?1:-1),M=this.speed>=0?C<0:C>v;this.currentTime=Math.max(C,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=v);let x=this.currentTime,D=s;if(E){const O=Math.min(this.currentTime,v)/p;let H=Math.floor(O),U=O%1;!U&&O>=1&&(U=1),U===1&&H--,H=Math.min(H,E+1),!!(H%2)&&(_==="reverse"?(U=1-U,S&&(U-=S/p)):_==="mirror"&&(D=o)),x=G3(0,1,U)*p}const w=M?{done:!1,value:d[0]}:D.next(x);u&&(w.value=u(w.value));let{done:b}=w;!M&&f!==null&&(b=this.speed>=0?this.currentTime>=v:this.currentTime<=0);const T=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&b);return T&&r!==void 0&&(w.value=au(d,this.options,r)),z&&z(w.value),T&&this.finish(),w}get duration(){const{resolved:t}=this;return t?_1(t.calculatedDuration):0}get time(){return _1(this.currentTime)}set time(t){t=E1(t),this.currentTime=t,this.holdTime!==null||this.speed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const a=this.playbackSpeed!==t;this.playbackSpeed=t,a&&(this.time=_1(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=Q$,onPlay:a,startTime:n}=this.options;this.driver||(this.driver=t(s=>this.tick(s))),a&&a();const r=this.driver.now();this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=r):this.startTime=n??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(t=this.currentTime)!==null&&t!==void 0?t:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}};const tY=new Set(["opacity","clipPath","filter","transform"]);function aY(e,t,a,{delay:n=0,duration:r=300,repeat:s=0,repeatType:o="loop",ease:u="easeInOut",times:d}={}){const f={[t]:a};d&&(f.offset=d);const v=xd(u,r);return Array.isArray(v)&&(f.easing=v),e.animate(f,{delay:n,duration:r,easing:Array.isArray(v)?"linear":v,fill:"both",iterations:s+1,direction:o==="reverse"?"alternate":"normal"})}const nY=Wo(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),ao=10,lY=2e4;function rY(e){return R4(e.type)||e.type==="spring"||!Rd(e.ease)}function iY(e,t){const a=new Ud({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let n={done:!1,value:e[0]};const r=[];let s=0;for(;!n.done&&s<lY;)n=a.sample(s),r.push(n.value),s+=ao;return{times:void 0,keyframes:r,duration:s-ao,ease:"linear"}}const MC={anticipate:lC,backInOut:nC,circInOut:iC};function sY(e){return e in MC}let ug=class extends IC{constructor(t){super(t);const{name:a,motionValue:n,element:r,keyframes:s}=this.options;this.resolver=new _C(s,(o,u)=>this.onKeyframesResolved(o,u),a,n,r),this.resolver.scheduleResolve()}initPlayback(t,a){let{duration:n=300,times:r,ease:s,type:o,motionValue:u,name:d,startTime:f}=this.options;if(!u.owner||!u.owner.current)return!1;if(typeof s=="string"&&kr()&&sY(s)&&(s=MC[s]),rY(this.options)){const{onComplete:p,onUpdate:A,motionValue:E,element:_,...S}=this.options,z=iY(t,S);t=z.keyframes,t.length===1&&(t[1]=t[0]),n=z.duration,r=z.times,s=z.ease,o="keyframes"}const v=aY(u.owner.current,d,t,{...this.options,duration:n,times:r,ease:s});return v.startTime=f??this.calcStartTime(),this.pendingTimeline?(Jc(v,this.pendingTimeline),this.pendingTimeline=void 0):v.onfinish=()=>{const{onComplete:p}=this.options;u.set(au(t,this.options,a)),p&&p(),this.cancel(),this.resolveFinishedPromise()},{animation:v,duration:n,times:r,type:o,ease:s,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:a}=t;return _1(a)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:a}=t;return _1(a.currentTime||0)}set time(t){const{resolved:a}=this;if(!a)return;const{animation:n}=a;n.currentTime=E1(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:a}=t;return a.playbackRate}set speed(t){const{resolved:a}=this;if(!a)return;const{animation:n}=a;n.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:a}=t;return a.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:a}=t;return a.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{const{resolved:a}=this;if(!a)return a1;const{animation:n}=a;Jc(n,t)}return a1}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:a}=t;a.playState==="finished"&&this.updateFinishedPromise(),a.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:a}=t;a.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:a,keyframes:n,duration:r,type:s,ease:o,times:u}=t;if(a.playState==="idle"||a.playState==="finished")return;if(this.time){const{motionValue:f,onUpdate:v,onComplete:p,element:A,...E}=this.options,_=new Ud({...E,keyframes:n,duration:r,type:s,ease:o,times:u,isGenerator:!0}),S=E1(this.time);f.setWithVelocity(_.sample(S-ao).value,_.sample(S).value,ao)}const{onStop:d}=this.options;d&&d(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:a,name:n,repeatDelay:r,repeatType:s,damping:o,type:u}=t;if(!a||!a.owner||!(a.owner.current instanceof HTMLElement))return!1;const{onUpdate:d,transformTemplate:f}=a.owner.getProps();return nY()&&n&&tY.has(n)&&!d&&!f&&!r&&s!=="mirror"&&o!==0&&u!=="inertia"}};const cY={type:"spring",stiffness:500,damping:25,restSpeed:10},oY=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),uY={type:"keyframes",duration:.8},hY={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},dY=(e,{keyframes:t})=>t.length>2?uY:Za.has(e)?e.startsWith("scale")?oY(t[1]):cY:hY;function fY({when:e,delay:t,delayChildren:a,staggerChildren:n,staggerDirection:r,repeat:s,repeatType:o,repeatDelay:u,from:d,elapsed:f,...v}){return!!Object.keys(v).length}const Vd=(e,t,a,n={},r,s)=>o=>{const u=hi(n,e)||{},d=u.delay||n.delay||0;let{elapsed:f=0}=n;f=f-E1(d);let v={keyframes:Array.isArray(a)?a:[null,a],ease:"easeOut",velocity:t.getVelocity(),...u,delay:-f,onUpdate:A=>{t.set(A),u.onUpdate&&u.onUpdate(A)},onComplete:()=>{o(),u.onComplete&&u.onComplete()},name:e,motionValue:t,element:s?void 0:r};fY(u)||(v={...v,...dY(e,v)}),v.duration&&(v.duration=E1(v.duration)),v.repeatDelay&&(v.repeatDelay=E1(v.repeatDelay)),v.from!==void 0&&(v.keyframes[0]=v.from);let p=!1;if((v.type===!1||v.duration===0&&!v.repeatDelay)&&(v.duration=0,v.delay===0&&(p=!0)),p&&!s&&t.get()!==void 0){const A=au(v.keyframes,u);if(A!==void 0)return R0.update(()=>{v.onUpdate(A),v.onComplete()}),new jz([])}return!s&&ug.supports(v)?new ug(v):new Ud(v)};function mY({protectedKeys:e,needsAnimating:t},a){const n=e.hasOwnProperty(a)&&t[a]!==!0;return t[a]=!1,n}function RC(e,t,{delay:a=0,transitionOverride:n,type:r}={}){var s;let{transition:o=e.getDefaultTransition(),transitionEnd:u,...d}=t;n&&(o=n);const f=[],v=r&&e.animationState&&e.animationState.getState()[r];for(const p in d){const A=e.getValue(p,(s=e.latestValues[p])!==null&&s!==void 0?s:null),E=d[p];if(E===void 0||v&&mY(v,p))continue;const _={delay:a,...hi(o||{},p)};let S=!1;if(window.MotionHandoffAnimation){const C=Qz(e);if(C){const M=window.MotionHandoffAnimation(C,p,R0);M!==null&&(_.startTime=M,S=!0)}}x8(e,p),A.start(Vd(p,A,E,e.shouldReduceMotion&&qz.has(p)?{type:!1}:_,e,S));const z=A.animation;z&&f.push(z)}return u&&Promise.all(f).then(()=>{R0.update(()=>{u&&$K(e,u)})}),f}function L8(e,t,a={}){var n;const r=Jo(e,t,a.type==="exit"?(n=e.presenceContext)===null||n===void 0?void 0:n.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=r||{};a.transitionOverride&&(s=a.transitionOverride);const o=r?()=>Promise.all(RC(e,r,a)):()=>Promise.resolve(),u=e.variantChildren&&e.variantChildren.size?(f=0)=>{const{delayChildren:v=0,staggerChildren:p,staggerDirection:A}=s;return vY(e,t,v+f,p,A,a)}:()=>Promise.resolve(),{when:d}=s;if(d){const[f,v]=d==="beforeChildren"?[o,u]:[u,o];return f().then(()=>v())}else return Promise.all([o(),u(a.delay)])}function vY(e,t,a=0,n=0,r=1,s){const o=[],u=(e.variantChildren.size-1)*n,d=r===1?(f=0)=>f*n:(f=0)=>u-f*n;return Array.from(e.variantChildren).sort(pY).forEach((f,v)=>{f.notify("AnimationStart",t),o.push(L8(f,t,{...s,delay:a+d(v)}).then(()=>f.notify("AnimationComplete",t)))}),Promise.all(o)}function pY(e,t){return e.sortNodePosition(t)}function AY(e,t,a={}){e.notify("AnimationStart",t);let n;if(Array.isArray(t)){const r=t.map(s=>L8(e,s,a));n=Promise.all(r)}else if(typeof t=="string")n=L8(e,t,a);else{const r=typeof t=="function"?Jo(e,t,a.custom):t;n=Promise.all(RC(e,r,a))}return n.then(()=>{e.notify("AnimationComplete",t)})}const gY=vd.length;function xC(e){if(!e)return;if(!e.isControllingVariants){const a=e.parent?xC(e.parent)||{}:{};return e.props.initial!==void 0&&(a.initial=e.props.initial),a}const t={};for(let a=0;a<gY;a++){const n=vd[a],r=e.props[n];(br(r)||r===!1)&&(t[n]=r)}return t}const EY=[...md].reverse(),_Y=md.length;function IY(e){return t=>Promise.all(t.map(({animation:a,options:n})=>AY(e,a,n)))}function NY(e){let t=IY(e),a=hg(),n=!0;const r=d=>(f,v)=>{var p;const A=Jo(e,v,d==="exit"?(p=e.presenceContext)===null||p===void 0?void 0:p.custom:void 0);if(A){const{transition:E,transitionEnd:_,...S}=A;f={...f,...S,..._}}return f};function s(d){t=d(e)}function o(d){const{props:f}=e,v=xC(e.parent)||{},p=[],A=new Set;let E={},_=1/0;for(let z=0;z<_Y;z++){const C=EY[z],M=a[C],x=f[C]!==void 0?f[C]:v[C],D=br(x),w=C===d?M.isActive:null;w===!1&&(_=z);let b=x===v[C]&&x!==f[C]&&D;if(b&&n&&e.manuallyAnimateOnMount&&(b=!1),M.protectedKeys={...E},!M.isActive&&w===null||!x&&!M.prevProp||Xo(x)||typeof x=="boolean")continue;const T=SY(M.prevProp,x);let O=T||C===d&&M.isActive&&!b&&D||z>_&&D,H=!1;const U=Array.isArray(x)?x:[x];let f2=U.reduce(r(C),{});w===!1&&(f2={});const{prevResolvedValues:s2={}}=M,h2={...s2,...f2},W=t2=>{O=!0,A.has(t2)&&(H=!0,A.delete(t2)),M.needsAnimating[t2]=!0;const J=e.getValue(t2);J&&(J.liveStyle=!1)};for(const t2 in h2){const J=f2[t2],v2=s2[t2];if(E.hasOwnProperty(t2))continue;let F=!1;M8(J)&&M8(v2)?F=!Gz(J,v2):F=J!==v2,F?J!=null?W(t2):A.add(t2):J!==void 0&&A.has(t2)?W(t2):M.protectedKeys[t2]=!0}M.prevProp=x,M.prevResolvedValues=f2,M.isActive&&(E={...E,...f2}),n&&e.blockInitialAnimation&&(O=!1),O&&(!(b&&T)||H)&&p.push(...U.map(t2=>({animation:t2,options:{type:C}})))}if(A.size){const z={};A.forEach(C=>{const M=e.getBaseTarget(C),x=e.getValue(C);x&&(x.liveStyle=!0),z[C]=M??null}),p.push({animation:z})}let S=!!p.length;return n&&(f.initial===!1||f.initial===f.animate)&&!e.manuallyAnimateOnMount&&(S=!1),n=!1,S?t(p):Promise.resolve()}function u(d,f){var v;if(a[d].isActive===f)return Promise.resolve();(v=e.variantChildren)===null||v===void 0||v.forEach(A=>{var E;return(E=A.animationState)===null||E===void 0?void 0:E.setActive(d,f)}),a[d].isActive=f;const p=o(d);for(const A in a)a[A].protectedKeys={};return p}return{animateChanges:o,setActive:u,setAnimateFunction:s,getState:()=>a,reset:()=>{a=hg(),n=!0}}}function SY(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Gz(t,e):!1}function _a(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function hg(){return{animate:_a(!0),whileInView:_a(),whileHover:_a(),whileTap:_a(),whileDrag:_a(),whileFocus:_a(),exit:_a()}}let $t=class{constructor(t){this.isMounted=!1,this.node=t}update(){}},yY=class extends $t{constructor(t){super(t),t.animationState||(t.animationState=NY(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Xo(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:a}=this.node.prevProps||{};t!==a&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)===null||t===void 0||t.call(this)}},zY=0,CY=class extends $t{constructor(){super(...arguments),this.id=zY++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:a}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===n)return;const r=this.node.animationState.setActive("exit",!t);a&&!t&&r.then(()=>a(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}};const MY={animation:{Feature:yY},exit:{Feature:CY}};function Lr(e,t,a,n={passive:!0}){return e.addEventListener(t,a,n),()=>e.removeEventListener(t,a)}function mi(e){return{point:{x:e.pageX,y:e.pageY}}}const RY=e=>t=>wd(t)&&e(t,mi(t));function ir(e,t,a,n){return Lr(e,t,RY(a),n)}const dg=(e,t)=>Math.abs(e-t);function xY(e,t){const a=dg(e.x,t.x),n=dg(e.y,t.y);return Math.sqrt(a**2+n**2)}class wC{constructor(t,a,{transformPagePoint:n,contextWindow:r,dragSnapToOrigin:s=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const p=v7(this.lastMoveEventInfo,this.history),A=this.startEvent!==null,E=xY(p.offset,{x:0,y:0})>=3;if(!A&&!E)return;const{point:_}=p,{timestamp:S}=g1;this.history.push({..._,timestamp:S});const{onStart:z,onMove:C}=this.handlers;A||(z&&z(this.lastMoveEvent,p),this.startEvent=this.lastMoveEvent),C&&C(this.lastMoveEvent,p)},this.handlePointerMove=(p,A)=>{this.lastMoveEvent=p,this.lastMoveEventInfo=m7(A,this.transformPagePoint),R0.update(this.updatePoint,!0)},this.handlePointerUp=(p,A)=>{this.end();const{onEnd:E,onSessionEnd:_,resumeAnimation:S}=this.handlers;if(this.dragSnapToOrigin&&S&&S(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const z=v7(p.type==="pointercancel"?this.lastMoveEventInfo:m7(A,this.transformPagePoint),this.history);this.startEvent&&E&&E(p,z),_&&_(p,z)},!wd(t))return;this.dragSnapToOrigin=s,this.handlers=a,this.transformPagePoint=n,this.contextWindow=r||window;const o=mi(t),u=m7(o,this.transformPagePoint),{point:d}=u,{timestamp:f}=g1;this.history=[{...d,timestamp:f}];const{onSessionStart:v}=a;v&&v(t,v7(u,this.history)),this.removeListeners=fi(ir(this.contextWindow,"pointermove",this.handlePointerMove),ir(this.contextWindow,"pointerup",this.handlePointerUp),ir(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Lt(this.updatePoint)}}function m7(e,t){return t?{point:t(e.point)}:e}function fg(e,t){return{x:e.x-t.x,y:e.y-t.y}}function v7({point:e},t){return{point:e,delta:fg(e,bC(t)),offset:fg(e,wY(t)),velocity:bY(t,.1)}}function wY(e){return e[0]}function bC(e){return e[e.length-1]}function bY(e,t){if(e.length<2)return{x:0,y:0};let a=e.length-1,n=null;const r=bC(e);for(;a>=0&&(n=e[a],!(r.timestamp-n.timestamp>E1(t)));)a--;if(!n)return{x:0,y:0};const s=_1(r.timestamp-n.timestamp);if(s===0)return{x:0,y:0};const o={x:(r.x-n.x)/s,y:(r.y-n.y)/s};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}const TC=1e-4,TY=1-TC,kY=1+TC,kC=.01,DY=0-kC,BY=0+kC;function ie(e){return e.max-e.min}function LY(e,t,a){return Math.abs(e-t)<=a}function mg(e,t,a,n=.5){e.origin=n,e.originPoint=k0(t.min,t.max,e.origin),e.scale=ie(a)/ie(t),e.translate=k0(a.min,a.max,e.origin)-e.originPoint,(e.scale>=TY&&e.scale<=kY||isNaN(e.scale))&&(e.scale=1),(e.translate>=DY&&e.translate<=BY||isNaN(e.translate))&&(e.translate=0)}function sr(e,t,a,n){mg(e.x,t.x,a.x,n?n.originX:void 0),mg(e.y,t.y,a.y,n?n.originY:void 0)}function vg(e,t,a){e.min=a.min+t.min,e.max=e.min+ie(t)}function OY(e,t,a){vg(e.x,t.x,a.x),vg(e.y,t.y,a.y)}function pg(e,t,a){e.min=t.min-a.min,e.max=e.min+ie(t)}function cr(e,t,a){pg(e.x,t.x,a.x),pg(e.y,t.y,a.y)}function FY(e,{min:t,max:a},n){return t!==void 0&&e<t?e=n?k0(t,e,n.min):Math.max(e,t):a!==void 0&&e>a&&(e=n?k0(a,e,n.max):Math.min(e,a)),e}function Ag(e,t,a){return{min:t!==void 0?e.min+t:void 0,max:a!==void 0?e.max+a-(e.max-e.min):void 0}}function HY(e,{top:t,left:a,bottom:n,right:r}){return{x:Ag(e.x,a,r),y:Ag(e.y,t,n)}}function gg(e,t){let a=t.min-e.min,n=t.max-e.max;return t.max-t.min<e.max-e.min&&([a,n]=[n,a]),{min:a,max:n}}function PY(e,t){return{x:gg(e.x,t.x),y:gg(e.y,t.y)}}function UY(e,t){let a=.5;const n=ie(e),r=ie(t);return r>n?a=Bt(t.min,t.max-n,e.min):n>r&&(a=Bt(e.min,e.max-r,t.min)),G3(0,1,a)}function VY(e,t){const a={};return t.min!==void 0&&(a.min=t.min-e.min),t.max!==void 0&&(a.max=t.max-e.min),a}const O8=.35;function GY(e=O8){return e===!1?e=0:e===!0&&(e=O8),{x:Eg(e,"left","right"),y:Eg(e,"top","bottom")}}function Eg(e,t,a){return{min:_g(e,t),max:_g(e,a)}}function _g(e,t){return typeof e=="number"?e:e[t]||0}const Ig=()=>({translate:0,scale:1,origin:0,originPoint:0}),Yn=()=>({x:Ig(),y:Ig()}),Ng=()=>({min:0,max:0}),j0=()=>({x:Ng(),y:Ng()});function Ie(e){return[e("x"),e("y")]}function DC({top:e,left:t,right:a,bottom:n}){return{x:{min:t,max:a},y:{min:e,max:n}}}function jY({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function KY(e,t){if(!t)return e;const a=t({x:e.left,y:e.top}),n=t({x:e.right,y:e.bottom});return{top:a.y,left:a.x,bottom:n.y,right:n.x}}function p7(e){return e===void 0||e===1}function F8({scale:e,scaleX:t,scaleY:a}){return!p7(e)||!p7(t)||!p7(a)}function Na(e){return F8(e)||BC(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function BC(e){return Sg(e.x)||Sg(e.y)}function Sg(e){return e&&e!=="0%"}function no(e,t,a){const n=e-a,r=t*n;return a+r}function yg(e,t,a,n,r){return r!==void 0&&(e=no(e,r,n)),no(e,a,n)+t}function H8(e,t=0,a=1,n,r){e.min=yg(e.min,t,a,n,r),e.max=yg(e.max,t,a,n,r)}function LC(e,{x:t,y:a}){H8(e.x,t.translate,t.scale,t.originPoint),H8(e.y,a.translate,a.scale,a.originPoint)}const zg=.999999999999,Cg=1.0000000000001;function $Y(e,t,a,n=!1){const r=a.length;if(!r)return;t.x=t.y=1;let s,o;for(let u=0;u<r;u++){s=a[u],o=s.projectionDelta;const{visualElement:d}=s.options;d&&d.props.style&&d.props.style.display==="contents"||(n&&s.options.layoutScroll&&s.scroll&&s!==s.root&&Wn(e,{x:-s.scroll.offset.x,y:-s.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,LC(e,o)),n&&Na(s.latestValues)&&Wn(e,s.latestValues))}t.x<Cg&&t.x>zg&&(t.x=1),t.y<Cg&&t.y>zg&&(t.y=1)}function Zn(e,t){e.min=e.min+t,e.max=e.max+t}function Mg(e,t,a,n,r=.5){const s=k0(e.min,e.max,r);H8(e,t,a,s,n)}function Wn(e,t){Mg(e.x,t.x,t.scaleX,t.scale,t.originX),Mg(e.y,t.y,t.scaleY,t.scale,t.originY)}function OC(e,t){return DC(KY(e.getBoundingClientRect(),t))}function YY(e,t,a){const n=OC(e,a),{scroll:r}=t;return r&&(Zn(n.x,r.offset.x),Zn(n.y,r.offset.y)),n}const FC=({current:e})=>e?e.ownerDocument.defaultView:null,ZY=new WeakMap;class WY{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=j0(),this.visualElement=t}start(t,{snapToCursor:a=!1}={}){const{presenceContext:n}=this.visualElement;if(n&&n.isPresent===!1)return;const r=v=>{const{dragSnapToOrigin:p}=this.getProps();p?this.pauseAnimation():this.stopAnimation(),a&&this.snapToCursor(mi(v).point)},s=(v,p)=>{const{drag:A,dragPropagation:E,onDragStart:_}=this.getProps();if(A&&!E&&(this.openDragLock&&this.openDragLock(),this.openDragLock=UK(A),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Ie(z=>{let C=this.getAxisMotionValue(z).get()||0;if(l3.test(C)){const{projection:M}=this.visualElement;if(M&&M.layout){const x=M.layout.layoutBox[z];x&&(C=ie(x)*(parseFloat(C)/100))}}this.originPoint[z]=C}),_&&R0.postRender(()=>_(v,p)),x8(this.visualElement,"transform");const{animationState:S}=this.visualElement;S&&S.setActive("whileDrag",!0)},o=(v,p)=>{const{dragPropagation:A,dragDirectionLock:E,onDirectionLock:_,onDrag:S}=this.getProps();if(!A&&!this.openDragLock)return;const{offset:z}=p;if(E&&this.currentDirection===null){this.currentDirection=qY(z),this.currentDirection!==null&&_&&_(this.currentDirection);return}this.updateAxis("x",p.point,z),this.updateAxis("y",p.point,z),this.visualElement.render(),S&&S(v,p)},u=(v,p)=>this.stop(v,p),d=()=>Ie(v=>{var p;return this.getAnimationState(v)==="paused"&&((p=this.getAxisMotionValue(v).animation)===null||p===void 0?void 0:p.play())}),{dragSnapToOrigin:f}=this.getProps();this.panSession=new wC(t,{onSessionStart:r,onStart:s,onMove:o,onSessionEnd:u,resumeAnimation:d},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:f,contextWindow:FC(this.visualElement)})}stop(t,a){const n=this.isDragging;if(this.cancel(),!n)return;const{velocity:r}=a;this.startAnimation(r);const{onDragEnd:s}=this.getProps();s&&R0.postRender(()=>s(t,a))}cancel(){this.isDragging=!1;const{projection:t,animationState:a}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),a&&a.setActive("whileDrag",!1)}updateAxis(t,a,n){const{drag:r}=this.getProps();if(!n||!Qs(t,r,this.currentDirection))return;const s=this.getAxisMotionValue(t);let o=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(o=FY(o,this.constraints[t],this.elastic[t])),s.set(o)}resolveConstraints(){var t;const{dragConstraints:a,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,s=this.constraints;a&&Kn(a)?this.constraints||(this.constraints=this.resolveRefConstraints()):a&&r?this.constraints=HY(r.layoutBox,a):this.constraints=!1,this.elastic=GY(n),s!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Ie(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=VY(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:a}=this.getProps();if(!t||!Kn(t))return!1;const n=t.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const s=YY(n,r.root,this.visualElement.getTransformPagePoint());let o=PY(r.layout.layoutBox,s);if(a){const u=a(jY(o));this.hasMutatedConstraints=!!u,u&&(o=DC(u))}return o}startAnimation(t){const{drag:a,dragMomentum:n,dragElastic:r,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:u}=this.getProps(),d=this.constraints||{},f=Ie(v=>{if(!Qs(v,a,this.currentDirection))return;let p=d&&d[v]||{};o&&(p={min:0,max:0});const A=r?200:1e6,E=r?40:1e7,_={type:"inertia",velocity:n?t[v]:0,bounceStiffness:A,bounceDamping:E,timeConstant:750,restDelta:1,restSpeed:10,...s,...p};return this.startAxisValueAnimation(v,_)});return Promise.all(f).then(u)}startAxisValueAnimation(t,a){const n=this.getAxisMotionValue(t);return x8(this.visualElement,t),n.start(Vd(t,n,0,a,this.visualElement,!1))}stopAnimation(){Ie(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Ie(t=>{var a;return(a=this.getAxisMotionValue(t).animation)===null||a===void 0?void 0:a.pause()})}getAnimationState(t){var a;return(a=this.getAxisMotionValue(t).animation)===null||a===void 0?void 0:a.state}getAxisMotionValue(t){const a=`_drag${t.toUpperCase()}`,n=this.visualElement.getProps(),r=n[a];return r||this.visualElement.getValue(t,(n.initial?n.initial[t]:void 0)||0)}snapToCursor(t){Ie(a=>{const{drag:n}=this.getProps();if(!Qs(a,n,this.currentDirection))return;const{projection:r}=this.visualElement,s=this.getAxisMotionValue(a);if(r&&r.layout){const{min:o,max:u}=r.layout.layoutBox[a];s.set(t[a]-k0(o,u,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:a}=this.getProps(),{projection:n}=this.visualElement;if(!Kn(a)||!n||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};Ie(o=>{const u=this.getAxisMotionValue(o);if(u&&this.constraints!==!1){const d=u.get();r[o]=UY({min:d,max:d},this.constraints[o])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),Ie(o=>{if(!Qs(o,t,null))return;const u=this.getAxisMotionValue(o),{min:d,max:f}=this.constraints[o];u.set(k0(d,f,r[o]))})}addListeners(){if(!this.visualElement.current)return;ZY.set(this.visualElement,this);const t=this.visualElement.current,a=ir(t,"pointerdown",d=>{const{drag:f,dragListener:v=!0}=this.getProps();f&&v&&this.start(d)}),n=()=>{const{dragConstraints:d}=this.getProps();Kn(d)&&d.current&&(this.constraints=this.resolveRefConstraints())},{projection:r}=this.visualElement,s=r.addEventListener("measure",n);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),R0.read(n);const o=Lr(window,"resize",()=>this.scalePositionWithinConstraints()),u=r.addEventListener("didUpdate",({delta:d,hasLayoutChanged:f})=>{this.isDragging&&f&&(Ie(v=>{const p=this.getAxisMotionValue(v);p&&(this.originPoint[v]+=d[v].translate,p.set(p.get()+d[v].translate))}),this.visualElement.render())});return()=>{o(),a(),s(),u&&u()}}getProps(){const t=this.visualElement.getProps(),{drag:a=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:s=!1,dragElastic:o=O8,dragMomentum:u=!0}=t;return{...t,drag:a,dragDirectionLock:n,dragPropagation:r,dragConstraints:s,dragElastic:o,dragMomentum:u}}}function Qs(e,t,a){return(t===!0||t===e)&&(a===null||a===e)}function qY(e,t=10){let a=null;return Math.abs(e.y)>t?a="y":Math.abs(e.x)>t&&(a="x"),a}class XY extends $t{constructor(t){super(t),this.removeGroupControls=a1,this.removeListeners=a1,this.controls=new WY(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||a1}unmount(){this.removeGroupControls(),this.removeListeners()}}const Rg=e=>(t,a)=>{e&&R0.postRender(()=>e(t,a))};class QY extends $t{constructor(){super(...arguments),this.removePointerDownListener=a1}onPointerDown(t){this.session=new wC(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:FC(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:a,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:Rg(t),onStart:Rg(a),onMove:n,onEnd:(s,o)=>{delete this.session,r&&R0.postRender(()=>r(s,o))}}}mount(){this.removePointerDownListener=ir(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const zc={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function xg(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Ul={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(P2.test(e))e=parseFloat(e);else return e;const a=xg(e,t.target.x),n=xg(e,t.target.y);return`${a}% ${n}%`}},JY={correct:(e,{treeScale:t,projectionDelta:a})=>{const n=e,r=Ot.parse(e);if(r.length>5)return n;const s=Ot.createTransformer(e),o=typeof r[0]!="number"?1:0,u=a.x.scale*t.x,d=a.y.scale*t.y;r[0+o]/=u,r[1+o]/=d;const f=k0(u,d,.5);return typeof r[2+o]=="number"&&(r[2+o]/=f),typeof r[3+o]=="number"&&(r[3+o]/=f),s(r)}};class eZ extends y.Component{componentDidMount(){const{visualElement:t,layoutGroup:a,switchLayoutGroup:n,layoutId:r}=this.props,{projection:s}=t;SK(tZ),s&&(a.group&&a.group.add(s),n&&n.register&&r&&n.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),zc.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:a,visualElement:n,drag:r,isPresent:s}=this.props,o=n.projection;return o&&(o.isPresent=s,r||t.layoutDependency!==a||a===void 0?o.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?o.promote():o.relegate()||R0.postRender(()=>{const u=o.getStack();(!u||!u.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Ad.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:a,switchLayoutGroup:n}=this.props,{projection:r}=t;r&&(r.scheduleCheckAfterUnmount(),a&&a.group&&a.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function HC(e){const[t,a]=Fj(),n=y.useContext(Sz);return I.jsx(eZ,{...e,layoutGroup:n,switchLayoutGroup:y.useContext(wz),isPresent:t,safeToRemove:a})}const tZ={borderRadius:{...Ul,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Ul,borderTopRightRadius:Ul,borderBottomLeftRadius:Ul,borderBottomRightRadius:Ul,boxShadow:JY};function aZ(e,t,a){const n=R1(e)?e:Dr(e);return n.start(Vd("",n,t,a)),n.animation}function nZ(e){return e instanceof SVGElement&&e.tagName!=="svg"}const lZ=(e,t)=>e.depth-t.depth;class rZ{constructor(){this.children=[],this.isDirty=!1}add(t){bd(this.children,t),this.isDirty=!0}remove(t){Td(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(lZ),this.isDirty=!1,this.children.forEach(t)}}function iZ(e,t){const a=r3.now(),n=({timestamp:r})=>{const s=r-a;s>=t&&(Lt(n),e(s-t))};return R0.read(n,!0),()=>Lt(n)}const PC=["TopLeft","TopRight","BottomLeft","BottomRight"],sZ=PC.length,wg=e=>typeof e=="string"?parseFloat(e):e,bg=e=>typeof e=="number"||P2.test(e);function cZ(e,t,a,n,r,s){r?(e.opacity=k0(0,a.opacity!==void 0?a.opacity:1,oZ(n)),e.opacityExit=k0(t.opacity!==void 0?t.opacity:1,0,uZ(n))):s&&(e.opacity=k0(t.opacity!==void 0?t.opacity:1,a.opacity!==void 0?a.opacity:1,n));for(let o=0;o<sZ;o++){const u=`border${PC[o]}Radius`;let d=Tg(t,u),f=Tg(a,u);if(d===void 0&&f===void 0)continue;d||(d=0),f||(f=0),d===0||f===0||bg(d)===bg(f)?(e[u]=Math.max(k0(wg(d),wg(f),n),0),(l3.test(f)||l3.test(d))&&(e[u]+="%")):e[u]=f}(t.rotate||a.rotate)&&(e.rotate=k0(t.rotate||0,a.rotate||0,n))}function Tg(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const oZ=UC(0,.5,rC),uZ=UC(.5,.95,a1);function UC(e,t,a){return n=>n<e?0:n>t?1:a(Bt(e,t,n))}function kg(e,t){e.min=t.min,e.max=t.max}function Ee(e,t){kg(e.x,t.x),kg(e.y,t.y)}function Dg(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Bg(e,t,a,n,r){return e-=t,e=no(e,1/a,n),r!==void 0&&(e=no(e,1/r,n)),e}function hZ(e,t=0,a=1,n=.5,r,s=e,o=e){if(l3.test(t)&&(t=parseFloat(t),t=k0(o.min,o.max,t/100)-o.min),typeof t!="number")return;let u=k0(s.min,s.max,n);e===s&&(u-=t),e.min=Bg(e.min,t,a,u,r),e.max=Bg(e.max,t,a,u,r)}function Lg(e,t,[a,n,r],s,o){hZ(e,t[a],t[n],t[r],t.scale,s,o)}const dZ=["x","scaleX","originX"],fZ=["y","scaleY","originY"];function Og(e,t,a,n){Lg(e.x,t,dZ,a?a.x:void 0,n?n.x:void 0),Lg(e.y,t,fZ,a?a.y:void 0,n?n.y:void 0)}function Fg(e){return e.translate===0&&e.scale===1}function VC(e){return Fg(e.x)&&Fg(e.y)}function Hg(e,t){return e.min===t.min&&e.max===t.max}function mZ(e,t){return Hg(e.x,t.x)&&Hg(e.y,t.y)}function Pg(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function GC(e,t){return Pg(e.x,t.x)&&Pg(e.y,t.y)}function Ug(e){return ie(e.x)/ie(e.y)}function Vg(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class vZ{constructor(){this.members=[]}add(t){bd(this.members,t),t.scheduleRender()}remove(t){if(Td(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const a=this.members[this.members.length-1];a&&this.promote(a)}}relegate(t){const a=this.members.findIndex(r=>t===r);if(a===0)return!1;let n;for(let r=a;r>=0;r--){const s=this.members[r];if(s.isPresent!==!1){n=s;break}}return n?(this.promote(n),!0):!1}promote(t,a){const n=this.lead;if(t!==n&&(this.prevLead=n,this.lead=t,t.show(),n)){n.instance&&n.scheduleRender(),t.scheduleRender(),t.resumeFrom=n,a&&(t.resumeFrom.preserveOpacity=!0),n.snapshot&&(t.snapshot=n.snapshot,t.snapshot.latestValues=n.animationValues||n.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:r}=t.options;r===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:a,resumingFrom:n}=t;a.onExitComplete&&a.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function pZ(e,t,a){let n="";const r=e.x.translate/t.x,s=e.y.translate/t.y,o=(a==null?void 0:a.z)||0;if((r||s||o)&&(n=`translate3d(${r}px, ${s}px, ${o}px) `),(t.x!==1||t.y!==1)&&(n+=`scale(${1/t.x}, ${1/t.y}) `),a){const{transformPerspective:f,rotate:v,rotateX:p,rotateY:A,skewX:E,skewY:_}=a;f&&(n=`perspective(${f}px) ${n}`),v&&(n+=`rotate(${v}deg) `),p&&(n+=`rotateX(${p}deg) `),A&&(n+=`rotateY(${A}deg) `),E&&(n+=`skewX(${E}deg) `),_&&(n+=`skewY(${_}deg) `)}const u=e.x.scale*t.x,d=e.y.scale*t.y;return(u!==1||d!==1)&&(n+=`scale(${u}, ${d})`),n||"none"}const Sa={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Xl=typeof window<"u"&&window.MotionDebug!==void 0,A7=["","X","Y","Z"],AZ={visibility:"hidden"},Gg=1e3;let gZ=0;function g7(e,t,a,n){const{latestValues:r}=t;r[e]&&(a[e]=r[e],t.setStaticValue(e,0),n&&(n[e]=0))}function jC(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const a=Qz(t);if(window.MotionHasOptimisedAnimation(a,"transform")){const{layout:r,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(a,"transform",R0,!(r||s))}const{parent:n}=e;n&&!n.hasCheckedOptimisedAppear&&jC(n)}function KC({attachResizeListener:e,defaultParent:t,measureScroll:a,checkIsScrollRoot:n,resetTransform:r}){return class{constructor(o={},u=t==null?void 0:t()){this.id=gZ++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Xl&&(Sa.totalNodes=Sa.resolvedTargetDeltas=Sa.recalculatedProjection=0),this.nodes.forEach(IZ),this.nodes.forEach(CZ),this.nodes.forEach(MZ),this.nodes.forEach(NZ),Xl&&window.MotionDebug.record(Sa)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=u?u.root||u:this,this.path=u?[...u.path,u]:[],this.parent=u,this.depth=u?u.depth+1:0;for(let d=0;d<this.path.length;d++)this.path[d].shouldResetTransform=!0;this.root===this&&(this.nodes=new rZ)}addEventListener(o,u){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new kd),this.eventHandlers.get(o).add(u)}notifyListeners(o,...u){const d=this.eventHandlers.get(o);d&&d.notify(...u)}hasListeners(o){return this.eventHandlers.has(o)}mount(o,u=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=nZ(o),this.instance=o;const{layoutId:d,layout:f,visualElement:v}=this.options;if(v&&!v.current&&v.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),u&&(f||d)&&(this.isLayoutDirty=!0),e){let p;const A=()=>this.root.updateBlockedByResize=!1;e(o,()=>{this.root.updateBlockedByResize=!0,p&&p(),p=iZ(A,250),zc.hasAnimatedSinceResize&&(zc.hasAnimatedSinceResize=!1,this.nodes.forEach(Kg))})}d&&this.root.registerSharedNode(d,this),this.options.animate!==!1&&v&&(d||f)&&this.addEventListener("didUpdate",({delta:p,hasLayoutChanged:A,hasRelativeTargetChanged:E,layout:_})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const S=this.options.transition||v.getDefaultTransition()||TZ,{onLayoutAnimationStart:z,onLayoutAnimationComplete:C}=v.getProps(),M=!this.targetLayout||!GC(this.targetLayout,_)||E,x=!A&&E;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||x||A&&(M||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(p,x);const D={...hi(S,"layout"),onPlay:z,onComplete:C};(v.shouldReduceMotion||this.options.layoutRoot)&&(D.delay=0,D.type=!1),this.startAnimation(D)}else A||Kg(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=_})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Lt(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(RZ),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&jC(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let v=0;v<this.path.length;v++){const p=this.path[v];p.shouldResetTransform=!0,p.updateScroll("snapshot"),p.options.layoutRoot&&p.willUpdate(!1)}const{layoutId:u,layout:d}=this.options;if(u===void 0&&!d)return;const f=this.getTransformTemplate();this.prevTransformTemplateValue=f?f(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(jg);return}this.isUpdating||this.nodes.forEach(yZ),this.isUpdating=!1,this.nodes.forEach(zZ),this.nodes.forEach(EZ),this.nodes.forEach(_Z),this.clearAllSnapshots();const u=r3.now();g1.delta=G3(0,1e3/60,u-g1.timestamp),g1.timestamp=u,g1.isProcessing=!0,o7.update.process(g1),o7.preRender.process(g1),o7.render.process(g1),g1.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Ad.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(SZ),this.sharedNodes.forEach(xZ)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,R0.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){R0.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let d=0;d<this.path.length;d++)this.path[d].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutCorrected=j0(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:u}=this.options;u&&u.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let u=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(u=!1),u){const d=n(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:d,offset:a(this.instance),wasRoot:this.scroll?this.scroll.isRoot:d}}}resetTransform(){if(!r)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,u=this.projectionDelta&&!VC(this.projectionDelta),d=this.getTransformTemplate(),f=d?d(this.latestValues,""):void 0,v=f!==this.prevTransformTemplateValue;o&&(u||Na(this.latestValues)||v)&&(r(this.instance,f),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const u=this.measurePageBox();let d=this.removeElementScroll(u);return o&&(d=this.removeTransform(d)),kZ(d),{animationId:this.root.animationId,measuredBox:u,layoutBox:d,latestValues:{},source:this.id}}measurePageBox(){var o;const{visualElement:u}=this.options;if(!u)return j0();const d=u.measureViewportBox();if(!(((o=this.scroll)===null||o===void 0?void 0:o.wasRoot)||this.path.some(DZ))){const{scroll:v}=this.root;v&&(Zn(d.x,v.offset.x),Zn(d.y,v.offset.y))}return d}removeElementScroll(o){var u;const d=j0();if(Ee(d,o),!((u=this.scroll)===null||u===void 0)&&u.wasRoot)return d;for(let f=0;f<this.path.length;f++){const v=this.path[f],{scroll:p,options:A}=v;v!==this.root&&p&&A.layoutScroll&&(p.wasRoot&&Ee(d,o),Zn(d.x,p.offset.x),Zn(d.y,p.offset.y))}return d}applyTransform(o,u=!1){const d=j0();Ee(d,o);for(let f=0;f<this.path.length;f++){const v=this.path[f];!u&&v.options.layoutScroll&&v.scroll&&v!==v.root&&Wn(d,{x:-v.scroll.offset.x,y:-v.scroll.offset.y}),Na(v.latestValues)&&Wn(d,v.latestValues)}return Na(this.latestValues)&&Wn(d,this.latestValues),d}removeTransform(o){const u=j0();Ee(u,o);for(let d=0;d<this.path.length;d++){const f=this.path[d];if(!f.instance||!Na(f.latestValues))continue;F8(f.latestValues)&&f.updateSnapshot();const v=j0(),p=f.measurePageBox();Ee(v,p),Og(u,f.latestValues,f.snapshot?f.snapshot.layoutBox:void 0,v)}return Na(this.latestValues)&&Og(u,this.latestValues),u}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==g1.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var u;const d=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=d.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=d.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=d.isSharedProjectionDirty);const f=!!this.resumingFrom||this!==d;if(!(o||f&&this.isSharedProjectionDirty||this.isProjectionDirty||!((u=this.parent)===null||u===void 0)&&u.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:p,layoutId:A}=this.options;if(!(!this.layout||!(p||A))){if(this.resolvedRelativeTargetAt=g1.timestamp,!this.targetDelta&&!this.relativeTarget){const E=this.getClosestProjectingParent();E&&E.layout&&this.animationProgress!==1?(this.relativeParent=E,this.forceRelativeParentToResolveTarget(),this.relativeTarget=j0(),this.relativeTargetOrigin=j0(),cr(this.relativeTargetOrigin,this.layout.layoutBox,E.layout.layoutBox),Ee(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=j0(),this.targetWithTransforms=j0()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),OY(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Ee(this.target,this.layout.layoutBox),LC(this.target,this.targetDelta)):Ee(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const E=this.getClosestProjectingParent();E&&!!E.resumingFrom==!!this.resumingFrom&&!E.options.layoutScroll&&E.target&&this.animationProgress!==1?(this.relativeParent=E,this.forceRelativeParentToResolveTarget(),this.relativeTarget=j0(),this.relativeTargetOrigin=j0(),cr(this.relativeTargetOrigin,this.target,E.target),Ee(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Xl&&Sa.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||F8(this.parent.latestValues)||BC(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var o;const u=this.getLead(),d=!!this.resumingFrom||this!==u;let f=!0;if((this.isProjectionDirty||!((o=this.parent)===null||o===void 0)&&o.isProjectionDirty)&&(f=!1),d&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(f=!1),this.resolvedRelativeTargetAt===g1.timestamp&&(f=!1),f)return;const{layout:v,layoutId:p}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(v||p))return;Ee(this.layoutCorrected,this.layout.layoutBox);const A=this.treeScale.x,E=this.treeScale.y;$Y(this.layoutCorrected,this.treeScale,this.path,d),u.layout&&!u.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(u.target=u.layout.layoutBox,u.targetWithTransforms=j0());const{target:_}=u;if(!_){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Dg(this.prevProjectionDelta.x,this.projectionDelta.x),Dg(this.prevProjectionDelta.y,this.projectionDelta.y)),sr(this.projectionDelta,this.layoutCorrected,_,this.latestValues),(this.treeScale.x!==A||this.treeScale.y!==E||!Vg(this.projectionDelta.x,this.prevProjectionDelta.x)||!Vg(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",_)),Xl&&Sa.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var u;if((u=this.options.visualElement)===null||u===void 0||u.scheduleRender(),o){const d=this.getStack();d&&d.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Yn(),this.projectionDelta=Yn(),this.projectionDeltaWithTransform=Yn()}setAnimationOrigin(o,u=!1){const d=this.snapshot,f=d?d.latestValues:{},v={...this.latestValues},p=Yn();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!u;const A=j0(),E=d?d.source:void 0,_=this.layout?this.layout.source:void 0,S=E!==_,z=this.getStack(),C=!z||z.members.length<=1,M=!!(S&&!C&&this.options.crossfade===!0&&!this.path.some(bZ));this.animationProgress=0;let x;this.mixTargetDelta=D=>{const w=D/1e3;$g(p.x,o.x,w),$g(p.y,o.y,w),this.setTargetDelta(p),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(cr(A,this.layout.layoutBox,this.relativeParent.layout.layoutBox),wZ(this.relativeTarget,this.relativeTargetOrigin,A,w),x&&mZ(this.relativeTarget,x)&&(this.isProjectionDirty=!1),x||(x=j0()),Ee(x,this.relativeTarget)),S&&(this.animationValues=v,cZ(v,f,this.latestValues,w,M,C)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=w},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Lt(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=R0.update(()=>{zc.hasAnimatedSinceResize=!0,this.currentAnimation=aZ(0,Gg,{...o,onUpdate:u=>{this.mixTargetDelta(u),o.onUpdate&&o.onUpdate(u)},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Gg),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:u,target:d,layout:f,latestValues:v}=o;if(!(!u||!d||!f)){if(this!==o&&this.layout&&f&&$C(this.options.animationType,this.layout.layoutBox,f.layoutBox)){d=this.target||j0();const p=ie(this.layout.layoutBox.x);d.x.min=o.target.x.min,d.x.max=d.x.min+p;const A=ie(this.layout.layoutBox.y);d.y.min=o.target.y.min,d.y.max=d.y.min+A}Ee(u,d),Wn(u,v),sr(this.projectionDeltaWithTransform,this.layoutCorrected,u,v)}}registerSharedNode(o,u){this.sharedNodes.has(o)||this.sharedNodes.set(o,new vZ),this.sharedNodes.get(o).add(u);const f=u.options.initialPromotionConfig;u.promote({transition:f?f.transition:void 0,preserveFollowOpacity:f&&f.shouldPreserveFollowOpacity?f.shouldPreserveFollowOpacity(u):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:u}=this.options;return u?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:u}=this.options;return u?(o=this.getStack())===null||o===void 0?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:u,preserveFollowOpacity:d}={}){const f=this.getStack();f&&f.promote(this,d),o&&(this.projectionDelta=void 0,this.needsReset=!0),u&&this.setOptions({transition:u})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let u=!1;const{latestValues:d}=o;if((d.z||d.rotate||d.rotateX||d.rotateY||d.rotateZ||d.skewX||d.skewY)&&(u=!0),!u)return;const f={};d.z&&g7("z",o,f,this.animationValues);for(let v=0;v<A7.length;v++)g7(`rotate${A7[v]}`,o,f,this.animationValues),g7(`skew${A7[v]}`,o,f,this.animationValues);o.render();for(const v in f)o.setStaticValue(v,f[v]),this.animationValues&&(this.animationValues[v]=f[v]);o.scheduleRender()}getProjectionStyles(o){var u,d;if(!this.instance||this.isSVG)return;if(!this.isVisible)return AZ;const f={visibility:""},v=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,f.opacity="",f.pointerEvents=Sc(o==null?void 0:o.pointerEvents)||"",f.transform=v?v(this.latestValues,""):"none",f;const p=this.getLead();if(!this.projectionDelta||!this.layout||!p.target){const S={};return this.options.layoutId&&(S.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,S.pointerEvents=Sc(o==null?void 0:o.pointerEvents)||""),this.hasProjected&&!Na(this.latestValues)&&(S.transform=v?v({},""):"none",this.hasProjected=!1),S}const A=p.animationValues||p.latestValues;this.applyTransformsToTarget(),f.transform=pZ(this.projectionDeltaWithTransform,this.treeScale,A),v&&(f.transform=v(A,f.transform));const{x:E,y:_}=this.projectionDelta;f.transformOrigin=`${E.origin*100}% ${_.origin*100}% 0`,p.animationValues?f.opacity=p===this?(d=(u=A.opacity)!==null&&u!==void 0?u:this.latestValues.opacity)!==null&&d!==void 0?d:1:this.preserveOpacity?this.latestValues.opacity:A.opacityExit:f.opacity=p===this?A.opacity!==void 0?A.opacity:"":A.opacityExit!==void 0?A.opacityExit:0;for(const S in Xc){if(A[S]===void 0)continue;const{correct:z,applyTo:C}=Xc[S],M=f.transform==="none"?A[S]:z(A[S],p);if(C){const x=C.length;for(let D=0;D<x;D++)f[C[D]]=M}else f[S]=M}return this.options.layoutId&&(f.pointerEvents=p===this?Sc(o==null?void 0:o.pointerEvents)||"":"none"),f}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var u;return(u=o.currentAnimation)===null||u===void 0?void 0:u.stop()}),this.root.nodes.forEach(jg),this.root.sharedNodes.clear()}}}function EZ(e){e.updateLayout()}function _Z(e){var t;const a=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&a&&e.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:r}=e.layout,{animationType:s}=e.options,o=a.source!==e.layout.source;s==="size"?Ie(p=>{const A=o?a.measuredBox[p]:a.layoutBox[p],E=ie(A);A.min=n[p].min,A.max=A.min+E}):$C(s,a.layoutBox,n)&&Ie(p=>{const A=o?a.measuredBox[p]:a.layoutBox[p],E=ie(n[p]);A.max=A.min+E,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[p].max=e.relativeTarget[p].min+E)});const u=Yn();sr(u,n,a.layoutBox);const d=Yn();o?sr(d,e.applyTransform(r,!0),a.measuredBox):sr(d,n,a.layoutBox);const f=!VC(u);let v=!1;if(!e.resumeFrom){const p=e.getClosestProjectingParent();if(p&&!p.resumeFrom){const{snapshot:A,layout:E}=p;if(A&&E){const _=j0();cr(_,a.layoutBox,A.layoutBox);const S=j0();cr(S,n,E.layoutBox),GC(_,S)||(v=!0),p.options.layoutRoot&&(e.relativeTarget=S,e.relativeTargetOrigin=_,e.relativeParent=p)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:a,delta:d,layoutDelta:u,hasLayoutChanged:f,hasRelativeTargetChanged:v})}else if(e.isLead()){const{onExitComplete:n}=e.options;n&&n()}e.options.transition=void 0}function IZ(e){Xl&&Sa.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function NZ(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function SZ(e){e.clearSnapshot()}function jg(e){e.clearMeasurements()}function yZ(e){e.isLayoutDirty=!1}function zZ(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Kg(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function CZ(e){e.resolveTargetDelta()}function MZ(e){e.calcProjection()}function RZ(e){e.resetSkewAndRotation()}function xZ(e){e.removeLeadSnapshot()}function $g(e,t,a){e.translate=k0(t.translate,0,a),e.scale=k0(t.scale,1,a),e.origin=t.origin,e.originPoint=t.originPoint}function Yg(e,t,a,n){e.min=k0(t.min,a.min,n),e.max=k0(t.max,a.max,n)}function wZ(e,t,a,n){Yg(e.x,t.x,a.x,n),Yg(e.y,t.y,a.y,n)}function bZ(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const TZ={duration:.45,ease:[.4,0,.1,1]},Zg=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Wg=Zg("applewebkit/")&&!Zg("chrome/")?Math.round:a1;function qg(e){e.min=Wg(e.min),e.max=Wg(e.max)}function kZ(e){qg(e.x),qg(e.y)}function $C(e,t,a){return e==="position"||e==="preserve-aspect"&&!LY(Ug(t),Ug(a),.2)}function DZ(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const BZ=KC({attachResizeListener:(e,t)=>Lr(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),E7={current:void 0},YC=KC({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!E7.current){const e=new BZ({});e.mount(window),e.setOptions({layoutScroll:!0}),E7.current=e}return E7.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),LZ={pan:{Feature:QY},drag:{Feature:XY,ProjectionNode:YC,MeasureLayout:HC}};function Xg(e,t,a){const{props:n}=e;e.animationState&&n.whileHover&&e.animationState.setActive("whileHover",a==="Start");const r="onHover"+a,s=n[r];s&&R0.postRender(()=>s(t,mi(t)))}let OZ=class extends $t{mount(){const{current:t}=this.node;t&&(this.unmount=Yz(t,a=>(Xg(this.node,a,"Start"),n=>Xg(this.node,n,"End"))))}unmount(){}},FZ=class extends $t{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=fi(Lr(this.node.current,"focus",()=>this.onFocus()),Lr(this.node.current,"blur",()=>this.onBlur()))}unmount(){}};function Qg(e,t,a){const{props:n}=e;e.animationState&&n.whileTap&&e.animationState.setActive("whileTap",a==="Start");const r="onTap"+(a==="End"?"":a),s=n[r];s&&R0.postRender(()=>s(t,mi(t)))}let HZ=class extends $t{mount(){const{current:t}=this.node;t&&(this.unmount=Wz(t,a=>(Qg(this.node,a,"Start"),(n,{success:r})=>Qg(this.node,n,r?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}};const P8=new WeakMap,_7=new WeakMap,PZ=e=>{const t=P8.get(e.target);t&&t(e)},UZ=e=>{e.forEach(PZ)};function VZ({root:e,...t}){const a=e||document;_7.has(a)||_7.set(a,{});const n=_7.get(a),r=JSON.stringify(t);return n[r]||(n[r]=new IntersectionObserver(UZ,{root:e,...t})),n[r]}function GZ(e,t,a){const n=VZ(t);return P8.set(e,a),n.observe(e),()=>{P8.delete(e),n.unobserve(e)}}const jZ={some:0,all:1};let KZ=class extends $t{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:a,margin:n,amount:r="some",once:s}=t,o={root:a?a.current:void 0,rootMargin:n,threshold:typeof r=="number"?r:jZ[r]},u=d=>{const{isIntersecting:f}=d;if(this.isInView===f||(this.isInView=f,s&&!f&&this.hasEnteredView))return;f&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",f);const{onViewportEnter:v,onViewportLeave:p}=this.node.getProps(),A=f?v:p;A&&A(d)};return GZ(this.node.current,o,u)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:a}=this.node;["amount","margin","root"].some($Z(t,a))&&this.startObserver()}unmount(){}};function $Z({viewport:e={}},{viewport:t={}}={}){return a=>e[a]!==t[a]}const YZ={inView:{Feature:KZ},tap:{Feature:HZ},focus:{Feature:FZ},hover:{Feature:OZ}},ZZ={layout:{ProjectionNode:YC,MeasureLayout:HC}},U8={current:null},ZC={current:!1};function WZ(){if(ZC.current=!0,!!fd)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>U8.current=e.matches;e.addListener(t),t()}else U8.current=!1}const qZ=[...EC,C1,Ot],XZ=e=>qZ.find(gC(e)),Jg=new WeakMap;function QZ(e,t,a){for(const n in t){const r=t[n],s=a[n];if(R1(r))e.addValue(n,r);else if(R1(s))e.addValue(n,Dr(r,{owner:e}));else if(s!==r)if(e.hasValue(n)){const o=e.getValue(n);o.liveStyle===!0?o.jump(r):o.hasAnimated||o.set(r)}else{const o=e.getStaticValue(n);e.addValue(n,Dr(o!==void 0?o:r,{owner:e}))}}for(const n in a)t[n]===void 0&&e.removeValue(n);return t}const eE=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let JZ=class{scrapeMotionValuesFromProps(t,a,n){return{}}constructor({parent:t,props:a,presenceContext:n,reducedMotionConfig:r,blockInitialAnimation:s,visualState:o},u={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Hd,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const E=r3.now();this.renderScheduledAt<E&&(this.renderScheduledAt=E,R0.render(this.render,!1,!0))};const{latestValues:d,renderState:f,onUpdate:v}=o;this.onUpdate=v,this.latestValues=d,this.baseTarget={...d},this.initialValues=a.initial?{...d}:{},this.renderState=f,this.parent=t,this.props=a,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=r,this.options=u,this.blockInitialAnimation=!!s,this.isControllingVariants=Qo(a),this.isVariantNode=Rz(a),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:p,...A}=this.scrapeMotionValuesFromProps(a,{},this);for(const E in A){const _=A[E];d[E]!==void 0&&R1(_)&&_.set(d[E],!1)}}mount(t){this.current=t,Jg.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((a,n)=>this.bindToMotionValue(n,a)),ZC.current||WZ(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:U8.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){Jg.delete(this.current),this.projection&&this.projection.unmount(),Lt(this.notifyUpdate),Lt(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const a=this.features[t];a&&(a.unmount(),a.isMounted=!1)}this.current=null}bindToMotionValue(t,a){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const n=Za.has(t),r=a.on("change",u=>{this.latestValues[t]=u,this.props.onUpdate&&R0.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0)}),s=a.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,a)),this.valueSubscriptions.set(t,()=>{r(),s(),o&&o(),a.owner&&a.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in h4){const a=h4[t];if(!a)continue;const{isEnabled:n,Feature:r}=a;if(!this.features[t]&&r&&n(this.props)&&(this.features[t]=new r(this)),this.features[t]){const s=this.features[t];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):j0()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,a){this.latestValues[t]=a}update(t,a){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=a;for(let n=0;n<eE.length;n++){const r=eE[n];this.propEventSubscriptions[r]&&(this.propEventSubscriptions[r](),delete this.propEventSubscriptions[r]);const s="on"+r,o=t[s];o&&(this.propEventSubscriptions[r]=this.on(r,o))}this.prevMotionValues=QZ(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const a=this.getClosestVariantNode();if(a)return a.variantChildren&&a.variantChildren.add(t),()=>a.variantChildren.delete(t)}addValue(t,a){const n=this.values.get(t);a!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,a),this.values.set(t,a),this.latestValues[t]=a.get())}removeValue(t){this.values.delete(t);const a=this.valueSubscriptions.get(t);a&&(a(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,a){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return n===void 0&&a!==void 0&&(n=Dr(a===null?void 0:a,{owner:this}),this.addValue(t,n)),n}readValue(t,a){var n;let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(n=this.getBaseTargetFromProps(this.props,t))!==null&&n!==void 0?n:this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(pC(r)||sC(r))?r=parseFloat(r):!XZ(r)&&Ot.test(a)&&(r=fC(t,a)),this.setBaseTarget(t,R1(r)?r.get():r)),R1(r)?r.get():r}setBaseTarget(t,a){this.baseTarget[t]=a}getBaseTarget(t){var a;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const o=Ed(this.props,n,(a=this.presenceContext)===null||a===void 0?void 0:a.custom);o&&(r=o[t])}if(n&&r!==void 0)return r;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!R1(s)?s:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,a){return this.events[t]||(this.events[t]=new kd),this.events[t].add(a)}notify(t,...a){this.events[t]&&this.events[t].notify(...a)}},WC=class extends JZ{constructor(){super(...arguments),this.KeyframeResolver=_C}sortInstanceNodePosition(t,a){return t.compareDocumentPosition(a)&2?1:-1}getBaseTargetFromProps(t,a){return t.style?t.style[a]:void 0}removeValueFromRenderState(t,{vars:a,style:n}){delete a[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;R1(t)&&(this.childSubscription=t.on("change",a=>{this.current&&(this.current.textContent=`${a}`)}))}};function eW(e){return window.getComputedStyle(e)}let tW=class extends WC{constructor(){super(...arguments),this.type="html",this.renderInstance=Oz}readValueFromInstance(t,a){if(Za.has(a)){const n=Fd(a);return n&&n.default||0}else{const n=eW(t),r=(Dz(a)?n.getPropertyValue(a):n[a])||0;return typeof r=="string"?r.trim():r}}measureInstanceViewportBox(t,{transformPagePoint:a}){return OC(t,a)}build(t,a,n){Nd(t,a,n.transformTemplate)}scrapeMotionValuesFromProps(t,a,n){return Cd(t,a,n)}},aW=class extends WC{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=j0}getBaseTargetFromProps(t,a){return t[a]}readValueFromInstance(t,a){if(Za.has(a)){const n=Fd(a);return n&&n.default||0}return a=Fz.has(a)?a:pd(a),t.getAttribute(a)}scrapeMotionValuesFromProps(t,a,n){return Uz(t,a,n)}build(t,a,n){Sd(t,a,this.isSVGTag,n.transformTemplate)}renderInstance(t,a,n,r){Hz(t,a,n,r)}mount(t){this.isSVGTag=zd(t.tagName),super.mount(t)}};const nW=(e,t)=>gd(e)?new aW(t):new tW(t,{allowProjection:e!==y.Fragment}),lW=TK({...MY,...YZ,...LZ,...ZZ},nW),qC=Yj(lW),Gd="relative scroll-mb-8 scroll-mt-[30vh] scroll-p-8",rW="after:content-['#'] after:scale-75 after:px-6 after:text-neutral after:absolute after:top-0 after:h-full after:-left-12 after:hover:cursor-pointer after:absolute after:to-neutral after:md:opacity-0 after:transition-opacity hover:after:opacity-80 after:duration-200 after:delay-100",iW=({className:e,...t})=>I.jsx("h1",{className:C2("mt-5 text-2xl font-bold",e),...t}),sW=({className:e,...t})=>I.jsx("h2",{className:C2("mt-5 text-2xl font-bold",Gd,e),...t}),cW=({className:e,...t})=>I.jsx("h3",{className:C2("mt-3 text-xl font-bold",Gd,e),...t}),oW=({className:e,...t})=>I.jsx("h4",{className:C2("mt-3 text-lg font-bold",Gd,e),...t}),uW=e=>String(e).normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\s+/g,"-").toLowerCase(),hW=e=>{var r;const t=document.getElementById(e),n=(((r=t==null?void 0:t.getBoundingClientRect())==null?void 0:r.top)??0)+window.scrollY-150;window.scrollTo({top:n,behavior:"smooth"})},dW=(e,t)=>{const a=e.getBoundingClientRect().left,n=e.getBoundingClientRect().top,r=window.getComputedStyle(e,":after"),s=a+parseInt(r.getPropertyValue("left"),10),o=s+parseInt(r.width,10),u=n+parseInt(r.getPropertyValue("top"),10),d=u+parseInt(r.height,10),f=t.clientX,v=t.clientY;return f>=s&&f<=o&&v>=u&&v<=d},jd=({H:e,children:t,className:a,isClickable:n,...r})=>{const s=typeof t=="string"?uW(t):void 0,o=u=>{const{id:d}=u.currentTarget;if(dW(u.currentTarget,u)&&typeof d=="string"){const p=`${window.location.href.split("#")[0]}#${d}`;navigator.clipboard.writeText(p),hW(d)}};return I.jsx(e,{id:s,onClick:n?o:void 0,"aria-label":n?`Click to scroll to section ${s} and copy the link to the clipboard`:void 0,className:C2(n&&rW,a),...r,children:t})},fW=({isClickable:e,...t})=>I.jsx(iW,{...t}),mW=({isClickable:e=!1,...t})=>I.jsx(jd,{H:sW,isClickable:e,...t}),Kd=({isClickable:e=!1,...t})=>I.jsx(jd,{H:cW,isClickable:e,...t}),vW=({isClickable:e=!1,...t})=>I.jsx(jd,{H:oW,isClickable:e,...t}),pW=Me("cursor-default overflow-auto py-3 shadow-sm justify-center",{variants:{size:{sm:"h-auto max-h-[30vh] w-[95vw] max-w-xl",md:"h-auto max-h-[50vh] w-[95vw] max-w-xl",lg:"h-auto max-h-[70vh] w-[95vw] max-w-2xl",xl:"h-auto max-h-[95vh] w-[95vw] max-w-6xl",unset:"h-auto max-h-[95vh] w-[95vw]"}},defaultVariants:{size:"unset"}}),AW=qC.create(d3),gW=({children:e,isOpen:t,container:a,disableScroll:n=!1,onClose:r,hasCloseButton:s=!1,title:o,size:u="md",className:d,...f})=>{const v=bN(a);if(LN({key:"modal",disableScroll:t&&n}),!v)return I.jsx(I.Fragment,{});const p=typeof o=="string";return $a.createPortal(I.jsx(qC.div,{className:"bg-background/40 /40 invisible fixed left-0 top-0 z-50 flex size-full cursor-pointer items-center justify-center overflow-auto backdrop-blur",animate:t?"visible":"invisible",variants:{visible:{opacity:1,visibility:"visible",transition:{duration:.1,when:"beforeChildren"}},invisible:{opacity:0,visibility:"hidden",transition:{duration:.1,when:"afterChildren"}}},onClick:A=>{A.stopPropagation(),r==null||r()},"aria-hidden":!t,children:I.jsx("div",{className:"flex justify-center p-4",children:I.jsxs(AW,{onClick:A=>A.stopPropagation(),initial:{scale:t?.5:1},animate:{scale:t?1:.5},transition:{duration:.3},className:pW({size:u,className:d}),role:"dialog","aria-modal":!0,roundedSize:"2xl",...f,children:[I.jsxs("div",{className:C2("cursor-default px-4",s&&p?"flex items-center justify-center":s?"flex items-center justify-end":p?"items-center":"hidden"),children:[p&&I.jsx(Kd,{className:"ml-4 flex items-center justify-center text-lg font-bold",children:o}),s&&I.jsx(_0,{variant:"hoverable",color:"text",label:"Close modal",className:"ml-auto",onClick:A=>{A.stopPropagation(),r==null||r()},Icon:Ya,size:"icon-md"})]}),I.jsx("div",{className:"flex flex-1 flex-col items-center overflow-auto",children:e})]})})}),v)};j({en:"Verify your email","en-GB":"Verify your email",fr:"Vérifiez votre adresse e-mail",es:"Verifique su correo electrónico",de:"Bestätigen Sie Ihre E-Mail",ja:"メールを確認してください",ko:"이메일을 확인해주세요",zh:"请验证您的电子邮件",it:"Verifica la tua email",pt:"Verifique seu e-mail",hi:"अपने ईमेल की पुष्टि करें",ar:"تحقق من بريدك الإلكتروني",ru:"Подтвердите ваш адрес электронной почты"}),j({en:"We sent you an email to verify your email address. Please check your inbox and click on the link to verify your email.","en-GB":"We sent you an email to verify your email address. Please check your inbox and click on the link to verify your email.",fr:"Nous vous avons envoyé un e-mail pour vérifier votre adresse e-mail. Veuillez vérifier votre boîte de réception et cliquez sur le lien pour vérifier votre adresse e-mail.",es:"Te hemos enviado un correo electrónico para verificar tu dirección de correo electrónico. Por favor, revisa tu bandeja de entrada y haz clic en el enlace para verificar tu dirección de correo electrónico.",de:"Wir haben Ihnen eine E-Mail gesendet, um Ihre E-Mail-Adresse zu überprüfen. Bitte überprüfen Sie Ihren Posteingang und klicken Sie auf den Link, um Ihre E-Mail zu bestätigen.",ja:"あなたのメールアドレスを確認するためにメールを送りました。受信トレイを確認し、メールを確認するためにリンクをクリックしてください。",ko:"이메일 주소를 확인하기 위해 이메일을 보냈습니다. 받은 편지함을 확인하고 이메일을 확인하기 위해 링크를 클릭하세요.",zh:"我们给您发送了一封电子邮件以验证您的电子邮件地址。请检查您的收件箱并点击链接以验证您的电子邮件。",it:"Ti abbiamo inviato un'email per verificare il tuo indirizzo email. Controlla la tua casella di posta e fai clic sul link per verificare la tua email.",pt:"Enviamos um e-mail para verificar seu endereço de e-mail. Verifique sua caixa de entrada e clique no link para verificar seu e-mail.",hi:"हमने आपको आपके ईमेल पते की पुष्टि करने के लिए एक ईमेल भेजा है। कृपया अपने इनबॉक्स की जांच करें और अपने ईमेल की पुष्टि करने के लिए लिंक पर क्लिक करें।",ar:"لقد أرسلنا إليك بريدًا إلكترونيًا للتحقق من عنوان بريدك الإلكتروني. يرجى التحقق من صندوق الوارد الخاص بك والنقر على الرابط للتحقق من بريدك الإلكتروني.",ru:"Мы отправили вам письмо для подтверждения вашего адреса электронной почты. Пожалуйста, проверьте свой почтовый ящик и нажмите на ссылку, чтобы подтвердить электронную почту."}),j({en:"Done","en-GB":"Done",fr:"Terminé",es:"Hecho",de:"Fertig",ja:"完了",ko:"완료",zh:"完成",it:"Fatto",pt:"Feito",hi:"किया",ar:"تم",ru:"Готово"}),j({en:"Click to return to the previous page","en-GB":"Click to return to the previous page",fr:"Cliquez pour revenir à la page précédente",es:"Haga clic para volver a la página anterior",de:"Klicken Sie, um zur vorherigen Seite zurückzukehren",ja:"前のページに戻るにはクリックしてください",ko:"이전 페이지로 돌아가려면 클릭하세요",zh:"点击返回到上一页",it:"Clicca per tornare alla pagina precedente",pt:"Clique para voltar à página anterior",hi:"पिछला पृष्ठ पर वापस जाने के लिए क्लिक करें",ar:"انقر للرجوع إلى الصفحة السابقة",ru:"Нажмите, чтобы вернуться на предыдущую страницу"});j({en:"New password",fr:"Nouveau mot de passe",es:"Nueva contraseña",de:"Neues Passwort",ja:"新しいパスワード",ko:"새 비밀번호",zh:"新密码",it:"Nuova password",pt:"Nova senha",hi:"नया पासवर्ड",ar:"كلمة المرور الجديدة",ru:"Новый пароль","en-GB":"New password"}),j({en:"Enter new password",fr:"Entrez votre nouveau mot de passe",es:"Ingresa tu nueva contraseña",de:"Geben Sie das neue Passwort ein",ja:"新しいパスワードを入力してください",ko:"새 비밀번호를 입력하세요",zh:"输入新密码",it:"Inserisci la nuova password",pt:"Digite a nova senha",hi:"नया पासवर्ड दर्ज करें",ar:"أدخل كلمة المرور الجديدة",ru:"Введите новый пароль","en-GB":"Enter new password"}),j({en:"Confirm new password",fr:"Confirmez le nouveau mot de passe",es:"Confirma tu nueva contraseña",de:"Bestätigen Sie das neue Passwort",ja:"新しいパスワードを確認してください",ko:"새 비밀번호를 확인하세요",zh:"确认新密码",it:"Conferma la nuova password",pt:"Confirme a nova senha",hi:"नए पासवर्ड की पुष्टि करें",ar:"تأكيد كلمة المرور الجديدة",ru:"Подтвердите новый пароль","en-GB":"Confirm new password"}),j({en:"Confirm new password",fr:"Confirmez votre nouveau mot de passe",es:"Confirma tu nueva contraseña",de:"Bestätigen Sie das neue Passwort",ja:"新しいパスワードを確認してください",ko:"새 비밀번호를 확인하세요",zh:"确认新密码",it:"Conferma la nuova password",pt:"Confirme a nova senha",hi:"नए पासवर्ड की पुष्टि करें",ar:"تأكيد كلمة المرور الجديدة",ru:"Подтвердите новый пароль","en-GB":"Confirm new password"}),j({en:"Change password",fr:"Changer le mot de passe",es:"Cambiar la contraseña",de:"Passwort ändern",ja:"パスワードを変更",ko:"비밀번호 변경",zh:"更改密码",it:"Cambia password",pt:"Alterar senha",hi:"पासवर्ड बदलें",ar:"تغيير كلمة المرور",ru:"Сменить пароль","en-GB":"Change password"}),j({en:"Click to change password",fr:"Cliquez pour changer le mot de passe",es:"Haz clic para cambiar la contraseña",de:"Klicken Sie, um das Passwort zu ändern",ja:"パスワードを変更するにはクリックしてください",ko:"비밀번호를 변경하려면 클릭하세요",zh:"单击以更改密码",it:"Clicca per cambiare la password",pt:"Clique para alterar a senha",hi:"पासवर्ड बदलने के लिए क्लिक करें",ar:"انقر لتغيير كلمة المرور",ru:"Нажмите, чтобы изменить пароль","en-GB":"Click to change password"});j({en:"Your password must be at least 8 characters","en-GB":"Your password must be at least 8 characters",fr:"Votre mot de passe doit comporter au moins 8 caractères",es:"Su contraseña debe tener al menos 8 caracteres",de:"Ihr Passwort muss mindestens 8 Zeichen lang sein",ja:"パスワードは8文字以上でなければなりません",ko:"비밀번호는 8자 이상이어야 합니다",zh:"您的密码必须至少为8个字符",it:"La tua password deve contenere almeno 8 caratteri",pt:"Sua senha deve ter pelo menos 8 caracteres",hi:"आपका पासवर्ड कम से कम 8 अक्षरों का होना चाहिए",ar:"يجب أن تحتوي كلمة المرور الخاصة بك على 8 أحرف على الأقل",ru:"Ваш пароль должен содержать не менее 8 символов"}),j({en:"Please enter your new password","en-GB":"Please enter your new password",fr:"Veuillez saisir votre nouveau mot de passe",es:"Por favor, ingrese su nueva contraseña",de:"Bitte geben Sie Ihr neues Passwort ein",ja:"新しいパスワードを入力してください",ko:"새 비밀번호를 입력하십시오",zh:"请输入您的新密码",it:"Si prega di inserire la propria nuova password",pt:"Por favor, insira sua nova senha",hi:"कृपया अपना नया पासवर्ड दर्ज करें",ar:"يرجى إدخال كلمة المرور الجديدة الخاصة بك",ru:"Пожалуйста, введите ваш новый пароль"}),j({en:"Please enter a valid new password","en-GB":"Please enter a valid new password",fr:"Veuillez saisir un nouveau mot de passe valide",es:"Por favor, ingrese una nueva contraseña válida",de:"Bitte geben Sie ein gültiges neues Passwort ein",ja:"有効な新しいパスワードを入力してください",ko:"유효한 새 비밀번호를 입력하십시오",zh:"请输入有效的新密码",it:"Si prega di inserire una nuova password valida",pt:"Por favor, insira uma nova senha válida",hi:"कृपया एक वैध नया पासवर्ड दर्ज करें",ar:"يرجى إدخال كلمة مرور جديدة صالحة",ru:"Пожалуйста, введите действительный новый пароль"}),j({en:"Please enter your new password again","en-GB":"Please enter your new password again",fr:"Veuillez saisir votre nouveau mot de passe à nouveau",es:"Por favor, ingrese su nueva contraseña nuevamente",de:"Bitte geben Sie Ihr neues Passwort erneut ein",ja:"新しいパスワードを再度入力してください",ko:"새 비밀번호를 다시 입력하십시오",zh:"请再次输入您的新密码",it:"Si prega di reinserire la propria nuova password",pt:"Por favor, insira sua nova senha novamente",hi:"कृपया अपना नया पासवर्ड फिर से दर्ज करें",ar:"يرجى إدخال كلمة المرور الجديدة الخاصة بك مرة أخرى",ru:"Пожалуйста, повторно введите ваш новый пароль"}),j({en:"Please enter a valid new password again","en-GB":"Please enter a valid new password again",fr:"Veuillez saisir un nouveau mot de passe valide à nouveau",es:"Por favor, ingrese una nueva contraseña válida nuevamente",de:"Bitte geben Sie erneut ein gültiges neues Passwort ein",ja:"もう一度有効な新しいパスワードを入力してください",ko:"유효한 새 비밀번호를 다시 입력하십시오",zh:"请再次输入有效的新密码",it:"Si prega di reinserire una nuova password valida",pt:"Por favor, insira uma nova senha válida novamente",hi:"कृपया एक वैध नया पासवर्ड फिर से दर्ज करें",ar:"يرجى إدخال كلمة مرور جديدة صالحة مرة أخرى",ru:"Пожалуйста, повторно введите действительный новый пароль"}),j({en:"New password and password confirmation must match","en-GB":"New password and password confirmation must match",fr:"Le nouveau mot de passe et la confirmation de mot de passe doivent correspondre",es:"La nueva contraseña y la confirmación de la contraseña deben coincidir",de:"Das neue Passwort und die Bestätigung müssen übereinstimmen",ja:"新しいパスワードとパスワード確認が一致する必要があります",ko:"새 비밀번호와 비밀번호 확인이 일치해야 합니다",zh:"新密码和密码确认必须匹配",it:"La nuova password e la conferma della password devono corrispondere",pt:"A nova senha e a confirmação da senha devem corresponder",hi:"नया पासवर्ड और पासवर्ड की पुष्टि मिलनी चाहिए",ar:"يجب أن يتطابق كلمة المرور الجديدة مع تأكيد كلمة المرور",ru:"Новый пароль и подтверждение пароля должны совпадать"});const EW={key:"save-dictionary-details",content:{resetButton:{text:j({en:"Reset all changes","en-GB":"Reset all changes",fr:"Réinitialiser toutes les modifications",es:"Restablecer todas las modificaciones",de:"Alle Änderungen zurücksetzen",ja:"すべての変更をリセット",ko:"모든 변경 사항 초기화",zh:"重置所有更改",it:"Reimposta tutte le modifiche",pt:"Redefinir todas as alterações",hi:"सभी परिवर्तनों को रीसेट करें",ar:"إعادة تعيين جميع التغييرات",ru:"Сбросить все изменения"}),label:j({en:"Click to reset all the changes","en-GB":"Click to reset all the changes",fr:"Cliquez pour réinitialiser toutes les modifications",es:"Haga clic para restablecer todas las modificaciones",de:"Klicken Sie, um alle Änderungen zurückzusetzen",ja:"すべての変更をリセットするにはクリックしてください",ko:"모든 변경 사항을 초기화하려면 클릭하세요",zh:"单击以重置所有更改",it:"Fai clic per ripristinare tutte le modifiche",pt:"Clique para redefinir todas as alterações",hi:"सभी परिवर्तनों को रीसेट करने के लिए क्लिक करें",ar:"انقر لإعادة تعيين جميع التغييرات",ru:"Нажмите, чтобы сбросить все изменения"})},saveButton:{text:j({en:"Save changes","en-GB":"Save changes",fr:"Enregistrer les modifications",es:"Guardar cambios",de:"Änderungen speichern",ja:"変更を保存",ko:"변경 사항 저장",zh:"保存更改",it:"Salva le modifiche",pt:"Salvar alterações",hi:"परिवर्तनों को सहेजें",ar:"احفظ التغييرات",ru:"Сохранить изменения"}),label:j({en:"Click to save changes","en-GB":"Click to save changes",fr:"Cliquez pour enregistrer les modifications",es:"Haga clic para guardar cambios",de:"Klicken Sie, um Änderungen zu speichern",ja:"変更を保存するにはクリックしてください",ko:"변경 사항을 저장하려면 클릭하세요",zh:"单击保存更改",it:"Fai clic per salvare le modifiche",pt:"Clique para salvar alterações",hi:"परिवर्तनों को सहेजने के लिए क्लिक करें",ar:"انقر لحفظ التغييرات",ru:"Нажмите, чтобы сохранить изменения"})},publishButton:{text:j({en:"Publish dictionary","en-GB":"Publish dictionary",fr:"Publier dictionnaire",es:"Publicar diccionario",de:"Wörterbuch veröffentlichen",ja:"辞書を公開",ko:"사전을 게시합니다",zh:"发布字典",it:"Pubblica dizionario",pt:"Publicar dicionário",hi:"शब्दकोश प्रकाशित करें",ar:"نشر القاموس",ru:"Опубликовать словарь"}),label:j({en:"Click to publish dictionary","en-GB":"Click to publish dictionary",fr:"Cliquez pour publier dictionnaire",es:"Haga clic para publicar diccionario",de:"Klicken Sie, um das Wörterbuch zu veröffentlichen",ja:"辞書を公開するにはクリックしてください",ko:"사전을 게시하려면 클릭하세요",zh:"单击以发布字典",it:"Fai clic per pubblicare il dizionario",pt:"Clique para publicar dicionário",hi:"शब्दकोश प्रकाशित करने के लिए क्लिक करें",ar:"انقر لنشر القاموس",ru:"Нажмите, чтобы опубликовать словарь"})},downloadButton:{text:j({en:"Download","en-GB":"Download",fr:"Télécharger",es:"Descargar",de:"Herunterladen",ja:"ダウンロード",ko:"다운로드",zh:"下载",it:"Scarica",pt:"Baixar",hi:"डाउनलोड",ar:"تنزيل",ru:"Скачать"}),label:j({en:"Click to download","en-GB":"Click to download",fr:"Cliquez pour télécharger",es:"Haga clic para descargar",de:"Klicken Sie, um herunterzuladen",ja:"ダウンロードするにはクリックしてください",ko:"다운로드를 클릭하세요",zh:"单击下载",it:"Fai clic per scaricare",pt:"Clique para baixar",hi:"डाउनलोड करने के लिए क्लिक करें",ar:"انقر لتنزيل",ru:"Нажмите, чтобы скачать"})}}},XC=({dictionary:e,mode:t,className:a,...n})=>{const{setLocaleDictionary:r}=_h(),{writeDictionary:s,isLoading:o}=wF(),{pushDictionaries:u,isLoading:d}=zF(),f=o||d,{editedContent:v,restoreEditedContent:p}=G1(),{resetButton:A,saveButton:E,publishButton:_,downloadButton:S}=d1(EW),{isAuthenticated:z}=ei(),C=y.useMemo(()=>v==null?void 0:v[e.key],[v,e.key]),M=y.useMemo(()=>C&&JSON.stringify(C)!==JSON.stringify(e),[C,e,t]),x=y.useMemo(()=>typeof(e==null?void 0:e._id)>"u",[e]),D=async()=>{if(!(v!=null&&v[e.key]))return;const b={...e,...v==null?void 0:v[e.key]};await s(b).then(()=>{r(v==null?void 0:v[e.key]),p(e.key)})},w=async()=>{if(!(v!=null&&v[e.key]))return;const b={...e,...v==null?void 0:v[e.key]};await u([b]).then(T=>{T&&(r(v==null?void 0:v[e.key]),p(e.key))})};return I.jsxs("form",{className:C2("flex justify-end gap-2 max-md:flex-col",a),...n,children:[M&&I.jsx(o0.Button,{label:A.label.value,disabled:!M,Icon:RL,variant:"outline",color:"text",className:"max-md:w-full",onClick:()=>p(e.key),children:A.text}),t.includes("local")&&I.jsx(o0.Button,{label:S.label.value,disabled:!M||f,Icon:mL,color:"text",variant:z?"outline":"default",className:"max-md:w-full",isLoading:o,onClick:D,children:S.text}),t.includes("remote")&&z&&x&&I.jsx(o0.Button,{label:_.label.value,disabled:f,Icon:JB,color:"text",className:"max-md:w-full",isLoading:d,onClick:w,children:_.text}),t.includes("remote")&&z&&!x&&M&&I.jsx(o0.Button,{label:E.label.value,disabled:!M||f,Icon:wL,color:"text",className:"max-md:w-full",isLoading:d,onClick:w,children:E.text})]})},Ql=({children:e,header:t,isOpen:a=!1,onClick:n,...r})=>{const[s,o]=y.useState(a),u=s==null?void 0:!s;return y.useEffect(()=>{a!=null&&o(a)},[a]),I.jsxs("div",{className:"w-full",children:[I.jsx(_0,{variant:"hoverable",color:"text",onClick:d=>{o(f=>!f),n==null||n(d)},isFullWidth:!0,className:"flex items-center justify-between gap-2",IconRight:RN,iconClassName:C2("transform transition-transform duration-500 ease-in-out",s?"rotate-0":"-rotate-180"),...r,children:t}),I.jsx(CN,{tabIndex:u!==!1?void 0:-1,isHidden:u,children:e})]})},QC=({level:e,title:t,description:a,children:n,rightParam:r,isSelected:s,...o})=>I.jsx("div",{className:C2("rounded-md p-2 transition","hover:bg-card/30 [&:has(.section:hover)]:bg-transparent",e===2&&"hover:bg-card/30",e>=3&&"",s===!0&&"bg-card/40"),...o,children:I.jsx(Ql,{isOpen:s,label:t,header:I.jsxs("div",{className:"flex w-full",children:[I.jsxs("div",{className:"flex w-full items-center justify-between",children:[I.jsx("span",{className:C2(e===0&&"text-2xl",e===1&&"text-xl",e===2&&"text-lg",e>=3&&"text-base"),children:t}),r&&I.jsx("div",{className:"flex w-auto items-center justify-between p-3",children:r})]}),a&&I.jsx("p",{className:"text-card pl-3 text-sm",children:a})]}),children:n})}),_W=({keyPath:e,section:t,editedContent:a,onContentChange:n,onFocusKeyPath:r})=>{const s=L3(a,e);if(s&&typeof s!="string")return I.jsx(I.Fragment,{children:"Error loading section"});const o=e.length,u=s??t;return I.jsx("span",{role:"button",tabIndex:0,className:C2("w-full rounded-md p-2 text-left transition","hover:bg-card/30 [&:has(.section:hover)]:bg-transparent",o===2&&"hover:bg-card/30",o>=3&&""),onClick:d=>{d.stopPropagation(),r(e)},children:I.jsx(LS,{defaultValue:String(u),onSave:d=>n({keyPath:e,newValue:d}),onCancel:()=>null})})},IW=e=>{const{keyPath:t,section:a,onFocusKeyPath:n,focusedKeyPath:r=[]}=e;return a.map((s,o)=>{const u={key:o,type:G.Array},d=[...t,u];return I.jsx(QC,{level:t.length,title:`${o}`,description:"",isSelected:Wr(d,r),onClick:f=>{f.stopPropagation(),n(d)},children:I.jsx(Wa,{...e,keyPath:d,section:s})},JSON.stringify(s))})},NW=e=>{const{keyPath:t,section:a}=e;return I.jsx("div",{className:"ml-2 grid grid-cols-[auto,1fr] gap-2",children:Object.keys(a).filter(n=>!$d.includes(n)).map(n=>{const r={type:G.Condition,key:n},s=[...t,r],o=a[G.Condition][n];return I.jsxs(I.Fragment,{children:[I.jsx("span",{className:"flex items-center font-bold",children:n}),y.createElement(Wa,{...e,key:n,keyPath:s,section:o})]})})})},SW=e=>{const{keyPath:t,section:a}=e;return I.jsx("div",{className:"ml-2 grid grid-cols-[auto,1fr] gap-2",children:Object.keys(a).filter(n=>!$d.includes(n)).map(n=>{const r={type:G.Enumeration,key:n},s=[...t,r],o=a[G.Enumeration][n];return I.jsxs(I.Fragment,{children:[I.jsx("span",{className:"flex items-center font-bold",children:n}),y.createElement(Wa,{...e,key:n,keyPath:s,section:o})]})})})},yW=e=>{const{keyPath:t,section:a}=e,n={type:G.Markdown},r=[...t,n],s=a[G.Markdown];return I.jsx("div",{className:"ml-2 grid grid-cols-[auto,1fr] gap-2",children:I.jsx(Wa,{...e,keyPath:r,section:s})})},zW=e=>{const{keyPath:t,section:a,focusedKeyPath:n=[],onFocusKeyPath:r}=e;return Object.keys(a).filter(s=>!$d.includes(s)).map(s=>{const o={key:s,type:G.Object},u=[...t,o];return I.jsx(QC,{level:t.length,title:s,description:"",isSelected:Wr(u,n),onClick:d=>{d.stopPropagation(),r(u)},children:I.jsx(Wa,{...e,keyPath:u,section:a[s]})},s)})},CW=e=>{const{keyPath:t,section:a,locale:n}=e,r={type:G.Translation,key:n},s=[...t,r],o=a.translation[n];return I.jsx(Wa,{...e,keyPath:s,section:o})},$d=["filePath","id","nodeType"],Wa=e=>{const{section:t}=e,a=Zr(t);if(typeof t=="object")return a===G.ReactNode?I.jsx("span",{className:"text-neutral text-xs",children:"React node not editable"}):a===G.Nested?I.jsx("div",{className:"ml-2 grid grid-cols-[auto,1fr] gap-2",children:"[Nested] Dictionary"}):a===G.Markdown?I.jsx(yW,{...e,section:t}):a===G.Translation?I.jsx(CW,{...e,section:t}):a===G.Enumeration?I.jsx(SW,{...e,section:t}):a===G.Condition?I.jsx(NW,{...e,section:t}):a===G.Array?I.jsx(IW,{...e,section:t}):I.jsx(zW,{...e,section:t});if(typeof t=="string")return I.jsx(_W,{...e,section:t})},MW=({dictionary:e,mode:t,...a})=>{var d;const{editedContent:n,addEditedContent:r}=G1(),{focusedContent:s,setFocusedContentKeyPath:o}=Ft(),u=s==null?void 0:s.keyPath;return I.jsxs("div",{className:"flex flex-1 flex-col justify-between gap-2",children:[I.jsx("div",{children:y.createElement(Wa,{...a,keyPath:[],key:JSON.stringify(((n==null?void 0:n[e.key])??e).content),editedContent:(d=n==null?void 0:n[e.key])==null?void 0:d.content,focusedKeyPath:u,section:e.content,onContentChange:f=>{r(e.key,f.newValue,f.keyPath)},onFocusKeyPath:o})}),I.jsx(XC,{dictionary:e,mode:t,className:"mb-4 flex-col"})]})};j({en:"Key","en-GB":"Key",fr:"Clé",es:"Clave",de:"Schlüssel",ja:"キー",ko:"키",zh:"键",it:"Chiave",pt:"Chave",hi:"की",ar:"مفتاح",ru:"Ключ"}),j({en:"Enter the key of your dictionary","en-GB":"Enter the key of your dictionary",fr:"Entrez la clé de votre dictionnaire",es:"Ingrese la clave de su diccionario",de:"Geben Sie den Schlüssel Ihres Wörterbuchs ein",ja:"辞書のキーを入力してください",ko:"사전의 키를 입력하세요",zh:"输入字典的键",it:"Inserisci la chiave del tuo dizionario",pt:"Insira a chave do seu dicionário",hi:"अपने शब्दकोश की कुंजी दर्ज करें",ar:"أدخل مفتاح القاموس الخاص بك",ru:"Введите ключ вашего словаря"}),j({en:"Projects","en-GB":"Projects",fr:"Projets",es:"Proyectos",de:"Projekte",ja:"プロジェクト",ko:"프로젝트",zh:"项目",it:"Progetti",pt:"Projetos",hi:"प्रोजेक्ट",ar:"مشاريع",ru:"Проекты"}),j({en:"Select one or more projects to associate with your dictionary","en-GB":"Select one or more projects to associate with your dictionary",fr:"Sélectionnez un ou plusieurs projets à associer à votre dictionnaire",es:"Seleccione uno o más proyectos para asociar con su diccionario",de:"Wählen Sie ein oder mehrere Projekte aus, um sie mit Ihrem Wörterbuch zu verknüpfen",ja:"辞書に関連付けるプロジェクトを1つ以上選択してください",ko:"사전과 연결할 프로젝트를 하나 이상 선택하세요",zh:"选择一个或多个项目与您的字典关联",it:"Seleziona uno o più progetti da associare al tuo dizionario",pt:"Selecione um ou mais projetos para associar ao seu dicionário",hi:"अपने शब्दकोश से जोड़ने के लिए एक या एक से अधिक प्रोजेक्ट चुनें",ar:"حدد مشروعًا أو أكثر للربط مع قاموسك",ru:"Выберите один или несколько проектов для связывания со словарем"}),j({en:"No dictionary","en-GB":"No dictionary",fr:"Aucun dictionnaire",es:"Sin diccionario",de:"Kein Wörterbuch",ja:"辞書がありません",ko:"사전이 없습니다",zh:"没有字典",it:"Nessun dizionario",pt:"Nenhum dicionário",hi:"कोई शब्दकोश नहीं",ar:"لا يوجد قاموس",ru:"Нет словаря"}),j({en:"Create your first dictionary to start using Intlayer","en-GB":"Create your first dictionary to start using Intlayer",fr:"Créez votre premier dictionnaire pour commencer à utiliser Intlayer",es:"Cree su primer diccionario para comenzar a usar Intlayer",de:"Erstellen Sie Ihr erstes Wörterbuch, um Intlayer zu verwenden",ja:"Intlayerを使用するために最初の辞書を作成してください",ko:"Intlayer를 사용하려면 첫 번째 사전을 만들어주세요",zh:"创建您的第一个字典以开始使用Intlayer",it:"Crea il tuo primo dizionario per iniziare a usare Intlayer",pt:"Crie seu primeiro dicionário para começar a usar o Intlayer",hi:"Intlayer का उपयोग करने के लिए अपना पहला शब्दकोश बनाएं",ar:"أنشئ قاموسك الأول لبدء استخدام Intlayer",ru:"Создайте свой первый словарь, чтобы начать использовать Intlayer"}),j({en:"Dictionary list","en-GB":"Dictionary list",fr:"Liste des dictionnaires",es:"Lista de diccionarios",de:"Wörterbuchliste",ja:"辞書リスト",ko:"사전 목록",zh:"字典列表",it:"Elenco dei dizionari",pt:"Lista de dicionários",hi:"शब्दकोश सूची",ar:"قائمة القاموس",ru:"Список словарей"}),j({en:"No dictionary","en-GB":"No dictionary",fr:"Aucun dictionnaire",es:"Sin diccionario",de:"Kein Wörterbuch",ja:"辞書がありません",ko:"사전이 없습니다",zh:"没有字典",it:"Nessun dizionario",pt:"Nenhum dicionário",hi:"कोई शब्दकोश नहीं",ar:"لا يوجد قاموس",ru:"Нет словаря"}),j({en:"Create your first dictionary to start using Intlayer","en-GB":"Create your first dictionary to start using Intlayer",fr:"Créez votre premier dictionnaire pour commencer à utiliser Intlayer",es:"Cree su primer diccionario para comenzar a usar Intlayer",de:"Erstellen Sie Ihr erstes Wörterbuch, um Intlayer zu verwenden",ja:"Intlayerを使用するために最初の辞書を作成してください",ko:"Intlayer를 사용하려면 첫 번째 사전을 만들어주세요",zh:"创建您的第一个字典以开始使用Intlayer",it:"Crea il tuo primo dizionario per iniziare a usare Intlayer",pt:"Crie seu primeiro dicionário para começar a usar o Intlayer",hi:"Intlayer का उपयोग करने के लिए अपना पहला शब्दकोश बनाएं",ar:"أنشئ قاموسك الأول لبدء استخدام Intlayer",ru:"Создайте свой первый словарь, чтобы начать использовать Intlayer"}),j({en:"Create dictionary","en-GB":"Create dictionary",fr:"Créer un dictionnaire",es:"Crear un diccionario",de:"Wörterbuch erstellen",ja:"辞書を作成",ko:"사전 만들기",zh:"创建字典",it:"Crea dizionario",pt:"Criar dicionário",hi:"शब्दकोश बनाएँ",ar:"إنشاء قاموس",ru:"Создать словарь"}),j({en:"Click to create dictionary","en-GB":"Click to create dictionary",fr:"Cliquez pour créer un dictionnaire",es:"Haga clic para crear un diccionario",de:"Klicken Sie, um ein Wörterbuch zu erstellen",ja:"辞書を作成するにはクリックしてください",ko:"사전을 만들려면 클릭하세요",zh:"点击创建字典",it:"Clicca per creare un dizionario",pt:"Clique para criar dicionário",hi:"शब्दकोश बनाने के लिए क्लिक करें",ar:"انقر لإنشاء قاموس",ru:"Нажмите, чтобы создать словарь"}),j({en:"Edit dictionary","en-GB":"Edit dictionary",fr:"Modifier le dictionnaire",es:"Editar el diccionario",de:"Wörterbuch bearbeiten",ja:"辞書を編集",ko:"사전 편집",zh:"编辑字典",it:"Modifica dizionario",pt:"Editar dicionário",hi:"शब्दकोश संपादित करें",ar:"تعديل القاموس",ru:"Редактировать словарь"}),j({en:"Click to edit","en-GB":"Click to edit",fr:"Cliquez pour modifier",es:"Haga clic para editar",de:"Klicken Sie, um zu bearbeiten",ja:"編集するにはクリックしてください",ko:"편집하려면 클릭하세요",zh:"点击编辑",it:"Clicca per modificare",pt:"Clique para editar",hi:"संपादित करने के लिए क्लिक करें",ar:"انقر لتعديل",ru:"Нажмите, чтобы отредактировать"});j({en:"Please enter a key for your dictionary","en-GB":"Please enter a key for your dictionary",fr:"Veuillez saisir une clef pour votre dictionaire",es:"Por favor, ingrese un clave para su diccionario",de:"Bitte geben Sie einen Schlüssel für Ihr Wörterbuch ein",ja:"辞書のキーを入力してください",ko:"사전 키를 입력해 주세요",zh:"请输入字典的键",it:"Si prega di inserire una chiave per il proprio dizionario",pt:"Por favor, insira uma chave para seu dicionário",hi:"कृपया अपने शब्दकोश के लिए एक कुंजी दर्ज करें",ar:"الرجاء إدخال مفتاح لقاموسك",ru:"Пожалуйста, введите ключ для вашего словаря"}),j({en:"Please enter a valid key for your dictionary","en-GB":"Please enter a valid key for your dictionary",fr:"Veuillez saisir une clée valide pour votre dictionaire",es:"Por favor, ingrese un clave válido para su diccionario",de:"Bitte geben Sie einen gültigen Schlüssel für Ihr Wörterbuch ein",ja:"辞書の有効なキーを入力してください",ko:"유효한 사전 키를 입력해 주세요",zh:"请输入字典的有效键",it:"Si prega di inserire una chiave valida per il proprio dizionario",pt:"Por favor, insira uma chave válida para seu dicionário",hi:"कृपया अपने शब्दकोश के लिए एक मान्य कुंजी दर्ज करें",ar:"الرجاء إدخال مفتاح صالح لقاموسك",ru:"Пожалуйста, введите действительный ключ для вашего словаря"}),j({en:"Please select a project","en-GB":"Please select a project",fr:"Veuillez sélectionner un projet",es:"Por favor, seleccione un proyecto",de:"Bitte wählen Sie ein Projekt aus",ja:"プロジェクトを選択してください",ko:"프로젝트를 선택해 주세요",zh:"请选择一个项目",it:"Si prega di selezionare un progetto",pt:"Por favor, selecione um projeto",hi:"कृपया एक परियोजना चुनें",ar:"الرجاء تحديد مشروع",ru:"Пожалуйста, выберите проект"}),j({en:"Please select a valid project","en-GB":"Please select a valid project",fr:"Veuillez sélectionner un projet valide",es:"Por favor, seleccione un proyecto válido",de:"Bitte wählen Sie ein gültiges Projekt aus",ja:"有効なプロジェクトを選択してください",ko:"유효한 프로젝트를 선택해 주세요",zh:"请选择一个有效的项目",it:"Si prega di selezionare un progetto valido",pt:"Por favor, selecione um projeto válido",hi:"कृपया एक मान्य परियोजना चुनें",ar:"الرجاء تحديد مشروع صالح",ru:"Пожалуйста, выберите действительный проект"});function j3(e){return Array.isArray?Array.isArray(e):tM(e)==="[object Array]"}function RW(e){if(typeof e=="string")return e;let t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function xW(e){return e==null?"":RW(e)}function t3(e){return typeof e=="string"}function JC(e){return typeof e=="number"}function wW(e){return e===!0||e===!1||bW(e)&&tM(e)=="[object Boolean]"}function eM(e){return typeof e=="object"}function bW(e){return eM(e)&&e!==null}function ae(e){return e!=null}function I7(e){return!e.trim().length}function tM(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const TW="Incorrect 'index' type",kW=e=>`Invalid value for key ${e}`,DW=e=>`Pattern length exceeds max of ${e}.`,BW=e=>`Missing ${e} property in key`,LW=e=>`Property 'weight' in key '${e}' must be a positive integer`,tE=Object.prototype.hasOwnProperty;class OW{constructor(t){this._keys=[],this._keyMap={};let a=0;t.forEach(n=>{let r=aM(n);this._keys.push(r),this._keyMap[r.id]=r,a+=r.weight}),this._keys.forEach(n=>{n.weight/=a})}get(t){return this._keyMap[t]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function aM(e){let t=null,a=null,n=null,r=1,s=null;if(t3(e)||j3(e))n=e,t=aE(e),a=V8(e);else{if(!tE.call(e,"name"))throw new Error(BW("name"));const o=e.name;if(n=o,tE.call(e,"weight")&&(r=e.weight,r<=0))throw new Error(LW(o));t=aE(o),a=V8(o),s=e.getFn}return{path:t,id:a,weight:r,src:n,getFn:s}}function aE(e){return j3(e)?e:e.split(".")}function V8(e){return j3(e)?e.join("."):e}function FW(e,t){let a=[],n=!1;const r=(s,o,u)=>{if(ae(s))if(!o[u])a.push(s);else{let d=o[u];const f=s[d];if(!ae(f))return;if(u===o.length-1&&(t3(f)||JC(f)||wW(f)))a.push(xW(f));else if(j3(f)){n=!0;for(let v=0,p=f.length;v<p;v+=1)r(f[v],o,u+1)}else o.length&&r(f,o,u+1)}};return r(e,t3(t)?t.split("."):t,0),n?a:a[0]}const HW={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},PW={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,t)=>e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1},UW={location:0,threshold:.6,distance:100},VW={useExtendedSearch:!1,getFn:FW,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1};var W2={...PW,...HW,...UW,...VW};const GW=/[^ ]+/g;function jW(e=1,t=3){const a=new Map,n=Math.pow(10,t);return{get(r){const s=r.match(GW).length;if(a.has(s))return a.get(s);const o=1/Math.pow(s,.5*e),u=parseFloat(Math.round(o*n)/n);return a.set(s,u),u},clear(){a.clear()}}}class Yd{constructor({getFn:t=W2.getFn,fieldNormWeight:a=W2.fieldNormWeight}={}){this.norm=jW(a,3),this.getFn=t,this.isCreated=!1,this.setIndexRecords()}setSources(t=[]){this.docs=t}setIndexRecords(t=[]){this.records=t}setKeys(t=[]){this.keys=t,this._keysMap={},t.forEach((a,n)=>{this._keysMap[a.id]=n})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,t3(this.docs[0])?this.docs.forEach((t,a)=>{this._addString(t,a)}):this.docs.forEach((t,a)=>{this._addObject(t,a)}),this.norm.clear())}add(t){const a=this.size();t3(t)?this._addString(t,a):this._addObject(t,a)}removeAt(t){this.records.splice(t,1);for(let a=t,n=this.size();a<n;a+=1)this.records[a].i-=1}getValueForItemAtKeyId(t,a){return t[this._keysMap[a]]}size(){return this.records.length}_addString(t,a){if(!ae(t)||I7(t))return;let n={v:t,i:a,n:this.norm.get(t)};this.records.push(n)}_addObject(t,a){let n={i:a,$:{}};this.keys.forEach((r,s)=>{let o=r.getFn?r.getFn(t):this.getFn(t,r.path);if(ae(o)){if(j3(o)){let u=[];const d=[{nestedArrIndex:-1,value:o}];for(;d.length;){const{nestedArrIndex:f,value:v}=d.pop();if(ae(v))if(t3(v)&&!I7(v)){let p={v,i:f,n:this.norm.get(v)};u.push(p)}else j3(v)&&v.forEach((p,A)=>{d.push({nestedArrIndex:A,value:p})})}n.$[s]=u}else if(t3(o)&&!I7(o)){let u={v:o,n:this.norm.get(o)};n.$[s]=u}}}),this.records.push(n)}toJSON(){return{keys:this.keys,records:this.records}}}function nM(e,t,{getFn:a=W2.getFn,fieldNormWeight:n=W2.fieldNormWeight}={}){const r=new Yd({getFn:a,fieldNormWeight:n});return r.setKeys(e.map(aM)),r.setSources(t),r.create(),r}function KW(e,{getFn:t=W2.getFn,fieldNormWeight:a=W2.fieldNormWeight}={}){const{keys:n,records:r}=e,s=new Yd({getFn:t,fieldNormWeight:a});return s.setKeys(n),s.setIndexRecords(r),s}function Js(e,{errors:t=0,currentLocation:a=0,expectedLocation:n=0,distance:r=W2.distance,ignoreLocation:s=W2.ignoreLocation}={}){const o=t/e.length;if(s)return o;const u=Math.abs(n-a);return r?o+u/r:u?1:o}function $W(e=[],t=W2.minMatchCharLength){let a=[],n=-1,r=-1,s=0;for(let o=e.length;s<o;s+=1){let u=e[s];u&&n===-1?n=s:!u&&n!==-1&&(r=s-1,r-n+1>=t&&a.push([n,r]),n=-1)}return e[s-1]&&s-n>=t&&a.push([n,s-1]),a}const za=32;function YW(e,t,a,{location:n=W2.location,distance:r=W2.distance,threshold:s=W2.threshold,findAllMatches:o=W2.findAllMatches,minMatchCharLength:u=W2.minMatchCharLength,includeMatches:d=W2.includeMatches,ignoreLocation:f=W2.ignoreLocation}={}){if(t.length>za)throw new Error(DW(za));const v=t.length,p=e.length,A=Math.max(0,Math.min(n,p));let E=s,_=A;const S=u>1||d,z=S?Array(p):[];let C;for(;(C=e.indexOf(t,_))>-1;){let T=Js(t,{currentLocation:C,expectedLocation:A,distance:r,ignoreLocation:f});if(E=Math.min(T,E),_=C+v,S){let O=0;for(;O<v;)z[C+O]=1,O+=1}}_=-1;let M=[],x=1,D=v+p;const w=1<<v-1;for(let T=0;T<v;T+=1){let O=0,H=D;for(;O<H;)Js(t,{errors:T,currentLocation:A+H,expectedLocation:A,distance:r,ignoreLocation:f})<=E?O=H:D=H,H=Math.floor((D-O)/2+O);D=H;let U=Math.max(1,A-H+1),f2=o?p:Math.min(A+H,p)+v,s2=Array(f2+2);s2[f2+1]=(1<<T)-1;for(let W=f2;W>=U;W-=1){let a2=W-1,V=a[e.charAt(a2)];if(S&&(z[a2]=+!!V),s2[W]=(s2[W+1]<<1|1)&V,T&&(s2[W]|=(M[W+1]|M[W])<<1|1|M[W+1]),s2[W]&w&&(x=Js(t,{errors:T,currentLocation:a2,expectedLocation:A,distance:r,ignoreLocation:f}),x<=E)){if(E=x,_=a2,_<=A)break;U=Math.max(1,2*A-_)}}if(Js(t,{errors:T+1,currentLocation:A,expectedLocation:A,distance:r,ignoreLocation:f})>E)break;M=s2}const b={isMatch:_>=0,score:Math.max(.001,x)};if(S){const T=$W(z,u);T.length?d&&(b.indices=T):b.isMatch=!1}return b}function ZW(e){let t={};for(let a=0,n=e.length;a<n;a+=1){const r=e.charAt(a);t[r]=(t[r]||0)|1<<n-a-1}return t}const lo=String.prototype.normalize?e=>e.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,""):e=>e;class lM{constructor(t,{location:a=W2.location,threshold:n=W2.threshold,distance:r=W2.distance,includeMatches:s=W2.includeMatches,findAllMatches:o=W2.findAllMatches,minMatchCharLength:u=W2.minMatchCharLength,isCaseSensitive:d=W2.isCaseSensitive,ignoreDiacritics:f=W2.ignoreDiacritics,ignoreLocation:v=W2.ignoreLocation}={}){if(this.options={location:a,threshold:n,distance:r,includeMatches:s,findAllMatches:o,minMatchCharLength:u,isCaseSensitive:d,ignoreDiacritics:f,ignoreLocation:v},t=d?t:t.toLowerCase(),t=f?lo(t):t,this.pattern=t,this.chunks=[],!this.pattern.length)return;const p=(E,_)=>{this.chunks.push({pattern:E,alphabet:ZW(E),startIndex:_})},A=this.pattern.length;if(A>za){let E=0;const _=A%za,S=A-_;for(;E<S;)p(this.pattern.substr(E,za),E),E+=za;if(_){const z=A-za;p(this.pattern.substr(z),z)}}else p(this.pattern,0)}searchIn(t){const{isCaseSensitive:a,ignoreDiacritics:n,includeMatches:r}=this.options;if(t=a?t:t.toLowerCase(),t=n?lo(t):t,this.pattern===t){let S={isMatch:!0,score:0};return r&&(S.indices=[[0,t.length-1]]),S}const{location:s,distance:o,threshold:u,findAllMatches:d,minMatchCharLength:f,ignoreLocation:v}=this.options;let p=[],A=0,E=!1;this.chunks.forEach(({pattern:S,alphabet:z,startIndex:C})=>{const{isMatch:M,score:x,indices:D}=YW(t,S,z,{location:s+C,distance:o,threshold:u,findAllMatches:d,minMatchCharLength:f,includeMatches:r,ignoreLocation:v});M&&(E=!0),A+=x,M&&D&&(p=[...p,...D])});let _={isMatch:E,score:E?A/this.chunks.length:1};return E&&r&&(_.indices=p),_}}class Yt{constructor(t){this.pattern=t}static isMultiMatch(t){return nE(t,this.multiRegex)}static isSingleMatch(t){return nE(t,this.singleRegex)}search(){}}function nE(e,t){const a=e.match(t);return a?a[1]:null}class WW extends Yt{constructor(t){super(t)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(t){const a=t===this.pattern;return{isMatch:a,score:a?0:1,indices:[0,this.pattern.length-1]}}}class qW extends Yt{constructor(t){super(t)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(t){const n=t.indexOf(this.pattern)===-1;return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}}class XW extends Yt{constructor(t){super(t)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(t){const a=t.startsWith(this.pattern);return{isMatch:a,score:a?0:1,indices:[0,this.pattern.length-1]}}}class QW extends Yt{constructor(t){super(t)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(t){const a=!t.startsWith(this.pattern);return{isMatch:a,score:a?0:1,indices:[0,t.length-1]}}}class JW extends Yt{constructor(t){super(t)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(t){const a=t.endsWith(this.pattern);return{isMatch:a,score:a?0:1,indices:[t.length-this.pattern.length,t.length-1]}}}class eq extends Yt{constructor(t){super(t)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(t){const a=!t.endsWith(this.pattern);return{isMatch:a,score:a?0:1,indices:[0,t.length-1]}}}class rM extends Yt{constructor(t,{location:a=W2.location,threshold:n=W2.threshold,distance:r=W2.distance,includeMatches:s=W2.includeMatches,findAllMatches:o=W2.findAllMatches,minMatchCharLength:u=W2.minMatchCharLength,isCaseSensitive:d=W2.isCaseSensitive,ignoreDiacritics:f=W2.ignoreDiacritics,ignoreLocation:v=W2.ignoreLocation}={}){super(t),this._bitapSearch=new lM(t,{location:a,threshold:n,distance:r,includeMatches:s,findAllMatches:o,minMatchCharLength:u,isCaseSensitive:d,ignoreDiacritics:f,ignoreLocation:v})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(t){return this._bitapSearch.searchIn(t)}}class iM extends Yt{constructor(t){super(t)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(t){let a=0,n;const r=[],s=this.pattern.length;for(;(n=t.indexOf(this.pattern,a))>-1;)a=n+s,r.push([n,a-1]);const o=!!r.length;return{isMatch:o,score:o?0:1,indices:r}}}const G8=[WW,iM,XW,QW,eq,JW,qW,rM],lE=G8.length,tq=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,aq="|";function nq(e,t={}){return e.split(aq).map(a=>{let n=a.trim().split(tq).filter(s=>s&&!!s.trim()),r=[];for(let s=0,o=n.length;s<o;s+=1){const u=n[s];let d=!1,f=-1;for(;!d&&++f<lE;){const v=G8[f];let p=v.isMultiMatch(u);p&&(r.push(new v(p,t)),d=!0)}if(!d)for(f=-1;++f<lE;){const v=G8[f];let p=v.isSingleMatch(u);if(p){r.push(new v(p,t));break}}}return r})}const lq=new Set([rM.type,iM.type]);class rq{constructor(t,{isCaseSensitive:a=W2.isCaseSensitive,ignoreDiacritics:n=W2.ignoreDiacritics,includeMatches:r=W2.includeMatches,minMatchCharLength:s=W2.minMatchCharLength,ignoreLocation:o=W2.ignoreLocation,findAllMatches:u=W2.findAllMatches,location:d=W2.location,threshold:f=W2.threshold,distance:v=W2.distance}={}){this.query=null,this.options={isCaseSensitive:a,ignoreDiacritics:n,includeMatches:r,minMatchCharLength:s,findAllMatches:u,ignoreLocation:o,location:d,threshold:f,distance:v},t=a?t:t.toLowerCase(),t=n?lo(t):t,this.pattern=t,this.query=nq(this.pattern,this.options)}static condition(t,a){return a.useExtendedSearch}searchIn(t){const a=this.query;if(!a)return{isMatch:!1,score:1};const{includeMatches:n,isCaseSensitive:r,ignoreDiacritics:s}=this.options;t=r?t:t.toLowerCase(),t=s?lo(t):t;let o=0,u=[],d=0;for(let f=0,v=a.length;f<v;f+=1){const p=a[f];u.length=0,o=0;for(let A=0,E=p.length;A<E;A+=1){const _=p[A],{isMatch:S,indices:z,score:C}=_.search(t);if(S){if(o+=1,d+=C,n){const M=_.constructor.type;lq.has(M)?u=[...u,...z]:u.push(z)}}else{d=0,o=0,u.length=0;break}}if(o){let A={isMatch:!0,score:d/o};return n&&(A.indices=u),A}}return{isMatch:!1,score:1}}}const j8=[];function iq(...e){j8.push(...e)}function K8(e,t){for(let a=0,n=j8.length;a<n;a+=1){let r=j8[a];if(r.condition(e,t))return new r(e,t)}return new lM(e,t)}const ro={AND:"$and",OR:"$or"},$8={PATH:"$path",PATTERN:"$val"},Y8=e=>!!(e[ro.AND]||e[ro.OR]),sq=e=>!!e[$8.PATH],cq=e=>!j3(e)&&eM(e)&&!Y8(e),rE=e=>({[ro.AND]:Object.keys(e).map(t=>({[t]:e[t]}))});function sM(e,t,{auto:a=!0}={}){const n=r=>{let s=Object.keys(r);const o=sq(r);if(!o&&s.length>1&&!Y8(r))return n(rE(r));if(cq(r)){const d=o?r[$8.PATH]:s[0],f=o?r[$8.PATTERN]:r[d];if(!t3(f))throw new Error(kW(d));const v={keyId:V8(d),pattern:f};return a&&(v.searcher=K8(f,t)),v}let u={children:[],operator:s[0]};return s.forEach(d=>{const f=r[d];j3(f)&&f.forEach(v=>{u.children.push(n(v))})}),u};return Y8(e)||(e=rE(e)),n(e)}function oq(e,{ignoreFieldNorm:t=W2.ignoreFieldNorm}){e.forEach(a=>{let n=1;a.matches.forEach(({key:r,norm:s,score:o})=>{const u=r?r.weight:null;n*=Math.pow(o===0&&u?Number.EPSILON:o,(u||1)*(t?1:s))}),a.score=n})}function uq(e,t){const a=e.matches;t.matches=[],ae(a)&&a.forEach(n=>{if(!ae(n.indices)||!n.indices.length)return;const{indices:r,value:s}=n;let o={indices:r,value:s};n.key&&(o.key=n.key.src),n.idx>-1&&(o.refIndex=n.idx),t.matches.push(o)})}function hq(e,t){t.score=e.score}function dq(e,t,{includeMatches:a=W2.includeMatches,includeScore:n=W2.includeScore}={}){const r=[];return a&&r.push(uq),n&&r.push(hq),e.map(s=>{const{idx:o}=s,u={item:t[o],refIndex:o};return r.length&&r.forEach(d=>{d(s,u)}),u})}class x4{constructor(t,a={},n){this.options={...W2,...a},this.options.useExtendedSearch,this._keyStore=new OW(this.options.keys),this.setCollection(t,n)}setCollection(t,a){if(this._docs=t,a&&!(a instanceof Yd))throw new Error(TW);this._myIndex=a||nM(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(t){ae(t)&&(this._docs.push(t),this._myIndex.add(t))}remove(t=()=>!1){const a=[];for(let n=0,r=this._docs.length;n<r;n+=1){const s=this._docs[n];t(s,n)&&(this.removeAt(n),n-=1,r-=1,a.push(s))}return a}removeAt(t){this._docs.splice(t,1),this._myIndex.removeAt(t)}getIndex(){return this._myIndex}search(t,{limit:a=-1}={}){const{includeMatches:n,includeScore:r,shouldSort:s,sortFn:o,ignoreFieldNorm:u}=this.options;let d=t3(t)?t3(this._docs[0])?this._searchStringList(t):this._searchObjectList(t):this._searchLogical(t);return oq(d,{ignoreFieldNorm:u}),s&&d.sort(o),JC(a)&&a>-1&&(d=d.slice(0,a)),dq(d,this._docs,{includeMatches:n,includeScore:r})}_searchStringList(t){const a=K8(t,this.options),{records:n}=this._myIndex,r=[];return n.forEach(({v:s,i:o,n:u})=>{if(!ae(s))return;const{isMatch:d,score:f,indices:v}=a.searchIn(s);d&&r.push({item:s,idx:o,matches:[{score:f,value:s,norm:u,indices:v}]})}),r}_searchLogical(t){const a=sM(t,this.options),n=(u,d,f)=>{if(!u.children){const{keyId:p,searcher:A}=u,E=this._findMatches({key:this._keyStore.get(p),value:this._myIndex.getValueForItemAtKeyId(d,p),searcher:A});return E&&E.length?[{idx:f,item:d,matches:E}]:[]}const v=[];for(let p=0,A=u.children.length;p<A;p+=1){const E=u.children[p],_=n(E,d,f);if(_.length)v.push(..._);else if(u.operator===ro.AND)return[]}return v},r=this._myIndex.records,s={},o=[];return r.forEach(({$:u,i:d})=>{if(ae(u)){let f=n(a,u,d);f.length&&(s[d]||(s[d]={idx:d,item:u,matches:[]},o.push(s[d])),f.forEach(({matches:v})=>{s[d].matches.push(...v)}))}}),o}_searchObjectList(t){const a=K8(t,this.options),{keys:n,records:r}=this._myIndex,s=[];return r.forEach(({$:o,i:u})=>{if(!ae(o))return;let d=[];n.forEach((f,v)=>{d.push(...this._findMatches({key:f,value:o[v],searcher:a}))}),d.length&&s.push({idx:u,item:o,matches:d})}),s}_findMatches({key:t,value:a,searcher:n}){if(!ae(a))return[];let r=[];if(j3(a))a.forEach(({v:s,i:o,n:u})=>{if(!ae(s))return;const{isMatch:d,score:f,indices:v}=n.searchIn(s);d&&r.push({score:f,key:t,value:s,idx:o,norm:u,indices:v})});else{const{v:s,n:o}=a,{isMatch:u,score:d,indices:f}=n.searchIn(s);u&&r.push({score:d,key:t,value:s,norm:o,indices:f})}return r}}x4.version="7.1.0";x4.createIndex=nM;x4.parseIndex=KW;x4.config=W2;x4.parseQuery=sM;iq(rq);const or=({children:e,className:t,identifier:a,...n})=>I.jsx("div",{className:C2("group/dropdown relative flex",t),"aria-label":`DropDown ${a}`,id:`unrollable-panel-button-${a}`,"aria-haspopup":!0,...n,children:e}),fq=({children:e,identifier:t,className:a,...n})=>I.jsx("button",{className:C2("w-full cursor-pointer",a),"aria-label":`Open panel ${t}`,...n,children:e}),mq=({children:e,isHidden:t=void 0,isOverable:a=!1,isFocusable:n=!1,align:r="start",identifier:s,className:o,...u})=>I.jsx("div",{className:C2("absolute top-[calc(100%+0.5rem)] z-[1000] min-w-full",r==="start"&&"left-0",r==="end"&&"right-0",o),"aria-hidden":t,role:"region","aria-labelledby":`unrollable-panel-button-${s}`,id:`unrollable-panel-${s}`,children:I.jsx(CN,{isHidden:t,className:C2("overflow-x-visible",t!==!1?"invisible":"visible",a&&"group-hover/dropdown:visible group-hover/dropdown:grid-rows-[1fr]",n&&"group-focus-within/dropdown:visible group-focus-within/dropdown:grid-rows-[1fr]"),...u,children:e})});or.Trigger=fq;or.Panel=mq;const vq={key:"locale-switcher-content",content:{localeSwitcherLabel:j({en:"Language switcher","en-GB":"Language switcher",fr:"Changer de langue",es:"Cambiar idioma",de:"Sprachwechsler",ja:"言語スイッチャー",ko:"언어 스위치",zh:"语言切换器",it:"Cambia lingua",pt:"Mudar idioma",hi:"भाषा स्विचर",ar:"مبدل اللغة",ru:"Переключатель языка"}),languageListLabel:j({en:"Language list","en-GB":"Language list",fr:"Liste des langues",es:"Lista de idiomas",de:"Sprachliste",ja:"言語リスト",ko:"언어 목록",zh:"语言列表",it:"Elenco lingue",pt:"Lista de idiomas",hi:"भाषा सूची",ar:"قائمة اللغات",ru:"Список языков"}),switchTo:j({en:"Switch to",fr:"Passer à",es:"Cambiar a","en-GB":"Switch to",de:"Wechseln Sie zu",ja:"に切り替える",ko:"전환",zh:"切换到",it:"Passa a",pt:"Mudar para",hi:"स्विच करें",ar:"التبديل إلى",ru:"Переключиться на"}),searchInput:{text:j({en:"Search Locale","en-GB":"Search Locale",fr:"Rechercher la locale",es:"Buscar idioma",de:"Sprache durchsuchen",ja:"ロケールを検索",ko:"언어 검색",zh:"搜索语言",it:"Cerca lingua",pt:"Pesquisar idioma",hi:"भाषा खोजें",ar:"بحث اللغة",ru:"Поиск языка"}),placeholder:j({en:"Search a locale","en-GB":"Search a locale",fr:"Rechercher une locale",es:"Buscar un idioma",de:"Sprache suchen",ja:"ロケールを検索",ko:"언어 검색",zh:"搜索语言",it:"Cerca una lingua",pt:"Pesquisar um idioma",hi:"भाषा खोजें",ar:"بحث اللغة",ru:"Поиск языка"})},seeAllLocalesSwitch:{true:j({en:"See all locales","en-GB":"See all locales",fr:"Voir toutes les langues",es:"Ver todos los idiomas",de:"Alle Sprachen anzeigen",ja:"すべての言語を表示",ko:"모든 언어 보기",zh:"查看所有语言",it:"Vedi tutte le lingue",pt:"Ver todos os idiomas",hi:"सभी भाषाओं को देखें",ar:"عرض جميع اللغات",ru:"Показать все языки"}),false:j({en:"See only selected locales","en-GB":"See only selected locales",fr:"Voir seulement les langues sélectionnées",es:"Ver solo los idiomas seleccionados",de:"Nur ausgewählte Sprachen anzeigen",ja:"選択された言語のみを表示",ko:"선택한 언어만 보기",zh:"仅查看选定的语言",it:"Vedi solo le lingue selezionate",pt:"Ver apenas os idiomas selecionados",hi:"केवल चुने गए भाषाओं को देखें",ar:"عرض اللغات المحددة فقط",ru:"Показать только выбранные языки"})}}},ur=(e,t)=>{const[a,n]=y.useState(()=>{if(t!==void 0){const s=typeof t=="function"?t():t;if(typeof window>"u")return s;const o=localStorage==null?void 0:localStorage.getItem(e);if(o)try{return JSON.parse(o)}catch(u){console.error(u)}return s}});y.useEffect(()=>{const s=localStorage==null?void 0:localStorage.getItem(e);if(s&&a===void 0)try{n(JSON.parse(s))}catch(o){console.error(o)}else t!==void 0&&a===void 0&&n(t)},[e,a]);const r=y.useCallback(s=>{n(o=>{const u=typeof s=="function"?s(o):s;return localStorage==null||localStorage.setItem(e,JSON.stringify(u)),u})},[e,n]);return y.useMemo(()=>[a,r],[a,r])},cM=y.createContext({availableLocales:[],selectedLocales:[],setSelectedLocales:()=>{}}),oM=()=>y.useContext(cM),pq=({availableLocales:e,defaultSelectedLocales:t,children:a})=>{const{locale:n}=yh(),[r,s]=ur("locale-content-selector-selected-locales",t??[n]);return I.jsx(cM,{value:{availableLocales:e,selectedLocales:r,setSelectedLocales:s},children:a})},N7="locale-switcher-content",Aq=({panelProps:e,isMultilingual:t=!0})=>{const{switchTo:a,searchInput:n,localeSwitcherLabel:r,languageListLabel:s,seeAllLocalesSwitch:o}=d1(vq),u=y.useRef(null),{locale:d}=yh(),{availableLocales:f,selectedLocales:v,setSelectedLocales:p}=oM(),A=y.useMemo(()=>f.map(w=>{const b=mc(w,l.ENGLISH),T=mc(w,d),O=mc(w);return{locale:w,englishName:b,currentLocaleName:T,ownLocaleName:O}}),[f,d]),[E,_]=y.useState(A),[S,z]=ur("locale-content-selector-see-all-locales",!1),C=y.useMemo(()=>{const w={keys:[{name:"ownLocaleName",weight:.4},{name:"englishName",weight:.2},{name:"currentLocaleName",weight:.2},{name:"locale",weight:.2}],threshold:.02};return new x4(A,w)},[A]),M=y.useCallback(w=>{if(w){const b=C.search(w).map(T=>T.item);_(b)}else _(A)},[C,A]),x=w=>{t?v.includes(w)?v.length>1&&p(b=>b.filter(T=>T!==w)):p(b=>[...b,w]):p([w])},D=w=>{z(w),p(w?f:[d])};return I.jsx("div",{className:"border-text text-text rounded-xl border transition-colors","aria-label":r.value,children:I.jsxs(or,{identifier:N7,children:[I.jsx(or.Trigger,{identifier:N7,children:I.jsxs("div",{className:"flex w-full items-center justify-between",children:[I.jsx("div",{className:"px-2 py-1",children:I.jsx(NL,{size:18})}),I.jsx(yL,{className:"self-center",size:18})]})}),I.jsx(or.Panel,{identifier:N7,isOverable:!0,isFocusable:!0,className:"left-auto right-0",...e,children:I.jsxs(d3,{className:"max-h-[80vh] min-w-28",separator:"y",role:"listbox",transparency:"sm",border:!0,roundedSize:"2xl",borderColor:"text","aria-label":s.value,children:[t&&I.jsx("div",{className:"m-auto p-2",children:I.jsx(ci,{defaultValue:!1,onChange:D,color:"text",size:"sm",className:"!w-60",choices:[{content:o.true.value,value:!0},{content:o.false.value,value:!1}]})}),!(t&&S)&&I.jsxs(I.Fragment,{children:[I.jsx("div",{className:"p-3",children:I.jsx(N4,{type:"search",placeholder:n.placeholder.value,onChange:w=>M(w.target.value),ref:u})}),I.jsx("ol",{className:"divide-text/20 divide-y divide-dashed overflow-y-auto p-1",children:E.map(({locale:w,currentLocaleName:b,ownLocaleName:T})=>I.jsx("li",{className:"px-1.5 py-1",children:I.jsx(_0,{onClick:()=>x(w),label:`${a} ${b}`,disabled:!(f??f).includes(w),isActive:v.includes(w),variant:"hoverable",color:"text",isFullWidth:!0,textAlign:"left",size:"sm",children:I.jsxs("div",{className:"flex flex-row items-center justify-between gap-3 px-2 py-1",children:[t&&I.jsx("div",{className:"w-4",children:v.includes(w)&&I.jsx(I4,{className:"size-full"})}),I.jsxs("div",{className:"flex flex-1 flex-row items-center justify-between gap-3 px-2 py-1",children:[I.jsxs("div",{className:"flex flex-col text-nowrap",children:[I.jsx("span",{dir:kT(w),lang:w,children:T}),I.jsx("span",{className:"text-neutral text-xs",children:b})]}),I.jsx("span",{className:"text-neutral text-sm",children:w.toUpperCase()})]})]})})},w))})]})]})})]})})},gq=(e,t,a)=>{const n={...e};for(const r of Object.keys(e))r===t?(n[a]=e[t],delete n[t]):n[r]=e[r];return n},Z8=({children:e,onContentChange:t,disabled:a,validate:n,additionalButtons:r,...s})=>{const[o,u]=y.useState(e),[d,f]=y.useState(0),v=o!==e,p=()=>{u(e),f(S=>S+1)},A=()=>{t(o)},E=S=>{u(S.currentTarget.value)};y.useEffect(()=>{u(e)},[e]);const _=(n==null?void 0:n(o))??!0;return I.jsxs("div",{className:"flex size-full flex-col items-center justify-between gap-2",children:[I.jsx(N4,{onChange:E,variant:"invisible",className:"size-full",defaultValue:e,...s},d),(v||r)&&I.jsxs("div",{className:"flex w-full items-center justify-end gap-2",children:[v&&I.jsxs(I.Fragment,{children:[I.jsx(_0,{Icon:I4,label:"Validate",variant:"hoverable",color:"text",size:"icon-sm",className:"cursor-pointer hover:scale-110",disabled:a||!_,onClick:A}),I.jsx(_0,{Icon:Ya,label:"Cancel",variant:"hoverable",size:"icon-sm",color:"text",className:"cursor-pointer hover:scale-110",onClick:p})]}),r]})]},String(e))},Eq=(e,t)=>{const[a,n]=y.useState(e);return y.useEffect(()=>{const r=setTimeout(()=>{n(e)},t);return()=>clearTimeout(r)},[e,t]),a},_q=({isActive:e=!0,suggestion:t,...a})=>{const n=String(a.value??a.defaultValue??""),{autocomplete:r}=xF(),s=u3(),[o,u]=y.useState(!1),[d,f]=y.useState(n),[v,p]=y.useState(""),A=Eq(d,200);y.useEffect(()=>{typeof a.value>"u"||f(n)},[a.value,a.defaultValue]),y.useEffect(()=>{if(!e||!o)return;const _=async()=>{var S;try{const z=await r({text:A,openAiApiKey:s.editor.openAiApiKey,model:s.editor.openAiApiModel,temperature:s.editor.openAiApiTemperature}),C=((S=z==null?void 0:z.data)==null?void 0:S.autocompletion)??"";if(C.startsWith(A)){const M=C.slice(A.length);return p(M)}return p(C)}catch(z){console.error("Autocomplete error:",z)}};A.length>3?(p(""),_()):p("")},[A,e]);const E=()=>{f(_=>_+v),p("")};return I.jsxs("div",{className:"relative w-full",children:[I.jsxs("div",{className:"pointer-events-none absolute inset-0 whitespace-pre-wrap break-words px-1 py-3 text-base leading-[1.45rem] md:py-1 md:text-sm md:leading-[1.23rem]","aria-hidden":"true",children:[I.jsx("span",{className:"align-text-top text-transparent",children:d}),(v||t)&&I.jsx("span",{className:"text-neutral ml-3 align-text-top",children:t??v})]}),I.jsx($h,{...a,value:d,onChange:_=>{var S;u(!0),f(_.target.value),(S=a.onChange)==null||S.call(a,_)},onKeyDown:_=>{var S;_.key==="Tab"&&v&&(_.preventDefault(),E()),(S=a.onKeyDown)==null||S.call(a,_)}})]})},Iq=()=>{const{session:e,revalidateSession:t,setSession:a}=ei(),{logout:n}=NF(),r=e!=null&&e.user?"authenticated":"unauthenticated",s=r==="authenticated",o=r==="unauthenticated",u=e==null?void 0:e.user;return{isAuthenticated:s,isUnauthenticated:o,user:u,revalidateSession:t,logout:async()=>{a(null),await n()}}},Nq=({children:e,onContentChange:t,disabled:a,validate:n,additionalButtons:r,...s})=>{const{isAuthenticated:o}=Iq(),[u,d]=y.useState(e),[f,v]=y.useState(0),p=u!==e,A=()=>{d(e),v(z=>z+1)},E=()=>{t(u)},_=z=>d(z.currentTarget.value??"");y.useEffect(()=>{d(e)},[e]);const S=(n==null?void 0:n(u))??!0;return I.jsxs("div",{className:"flex size-full flex-col items-center justify-between gap-2",children:[I.jsx(_q,{onChange:_,variant:"invisible",className:"size-full",defaultValue:e,isActive:o,...s},f),(p||r)&&I.jsxs("div",{className:"flex w-full items-center justify-end gap-2",children:[p&&I.jsxs(I.Fragment,{children:[I.jsx(_0,{Icon:I4,label:"Validate",variant:"hoverable",color:"text",size:"icon-sm",className:"cursor-pointer hover:scale-110",disabled:a||!S,onClick:E}),I.jsx(_0,{Icon:Ya,label:"Cancel",variant:"hoverable",size:"icon-sm",color:"text",className:"cursor-pointer hover:scale-110",onClick:A})]}),r]})]},e)};function Ca(){return Ca=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},Ca.apply(this,arguments)}const Sq=["children","options"],K2={blockQuote:"0",breakLine:"1",breakThematic:"2",codeBlock:"3",codeFenced:"4",codeInline:"5",footnote:"6",footnoteReference:"7",gfmTask:"8",heading:"9",headingSetext:"10",htmlBlock:"11",htmlComment:"12",htmlSelfClosing:"13",image:"14",link:"15",linkAngleBraceStyleDetector:"16",linkBareUrlDetector:"17",linkMailtoDetector:"18",newlineCoalescer:"19",orderedList:"20",paragraph:"21",ref:"22",refImage:"23",refLink:"24",table:"25",text:"27",textBolded:"28",textEmphasized:"29",textEscaped:"30",textMarked:"31",textStrikethroughed:"32",unorderedList:"33"};var iE;(function(e){e[e.MAX=0]="MAX",e[e.HIGH=1]="HIGH",e[e.MED=2]="MED",e[e.LOW=3]="LOW",e[e.MIN=4]="MIN"})(iE||(iE={}));const sE=["allowFullScreen","allowTransparency","autoComplete","autoFocus","autoPlay","cellPadding","cellSpacing","charSet","classId","colSpan","contentEditable","contextMenu","crossOrigin","encType","formAction","formEncType","formMethod","formNoValidate","formTarget","frameBorder","hrefLang","inputMode","keyParams","keyType","marginHeight","marginWidth","maxLength","mediaGroup","minLength","noValidate","radioGroup","readOnly","rowSpan","spellCheck","srcDoc","srcLang","srcSet","tabIndex","useMap"].reduce((e,t)=>(e[t.toLowerCase()]=t,e),{class:"className",for:"htmlFor"}),cE={amp:"&",apos:"'",gt:">",lt:"<",nbsp:" ",quot:"“"},yq=["style","script"],zq=/([-A-Z0-9_:]+)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|(?:\{((?:\\.|{[^}]*?}|[^}])*)\})))?/gi,Cq=/mailto:/i,Mq=/\n{2,}$/,uM=/^(\s*>[\s\S]*?)(?=\n\n|$)/,Rq=/^ *> ?/gm,xq=/^(?:\[!([^\]]*)\]\n)?([\s\S]*)/,wq=/^ {2,}\n/,bq=/^(?:( *[-*_])){3,} *(?:\n *)+\n/,hM=/^(?: {1,3})?(`{3,}|~{3,}) *(\S+)? *([^\n]*?)?\n([\s\S]*?)(?:\1\n?|$)/,dM=/^(?: {4}[^\n]+\n*)+(?:\n *)+\n?/,Tq=/^(`+)((?:\\`|[^`])+)\1/,kq=/^(?:\n *)*\n/,Dq=/\r\n?/g,Bq=/^\[\^([^\]]+)](:(.*)((\n+ {4,}.*)|(\n(?!\[\^).+))*)/,Lq=/^\[\^([^\]]+)]/,Oq=/\f/g,Fq=/^---[ \t]*\n(.|\n)*\n---[ \t]*\n/,Hq=/^\s*?\[(x|\s)\]/,fM=/^ *(#{1,6}) *([^\n]+?)(?: +#*)?(?:\n *)*(?:\n|$)/,mM=/^ *(#{1,6}) +([^\n]+?)(?: +#*)?(?:\n *)*(?:\n|$)/,vM=/^([^\n]+)\n *(=|-){3,} *(?:\n *)+\n/,W8=/^ *(?!<[a-z][^ >/]* ?\/>)<([a-z][^ >/]*) ?((?:[^>]*[^/])?)>\n?(\s*(?:<\1[^>]*?>[\s\S]*?<\/\1>|(?!<\1\b)[\s\S])*?)<\/\1>(?!<\/\1>)\n*/i,Pq=/&([a-z0-9]+|#[0-9]{1,6}|#x[0-9a-fA-F]{1,6});/gi,pM=/^<!--[\s\S]*?(?:-->)/,Uq=/^(data|aria|x)-[a-z_][a-z\d_.-]*$/,q8=/^ *<([a-z][a-z0-9:]*)(?:\s+((?:<.*?>|[^>])*))?\/?>(?!<\/\1>)(\s*\n)?/i,Vq=/^\{.*\}$/,Gq=/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,jq=/^<([^ >]+@[^ >]+)>/,Kq=/^<([^ >]+:\/[^ >]+)>/,$q=/-([a-z])?/gi,AM=/^(\|.*)\n(?: *(\|? *[-:]+ *\|[-| :]*)\n((?:.*\|.*\n)*))?\n?/,Yq=/^\[([^\]]*)\]:\s+<?([^\s>]+)>?\s*("([^"]*)")?/,Zq=/^!\[([^\]]*)\] ?\[([^\]]*)\]/,Wq=/^\[([^\]]*)\] ?\[([^\]]*)\]/,qq=/(\n|^[-*]\s|^#|^ {2,}|^-{2,}|^>\s)/,Xq=/\t/g,Qq=/(^ *\||\| *$)/g,Jq=/^ *:-+: *$/,eX=/^ *:-+ *$/,tX=/^ *-+: *$/,nu="((?:\\[.*?\\][([].*?[)\\]]|<.*?>(?:.*?<.*?>)?|`.*?`|\\\\\\1|[\\s\\S])+?)",aX=new RegExp(`^([*_])\\1${nu}\\1\\1(?!\\1)`),nX=new RegExp(`^([*_])${nu}\\1(?!\\1)`),lX=new RegExp(`^(==)${nu}\\1`),rX=new RegExp(`^(~~)${nu}\\1`),iX=/^\\([^0-9A-Za-z\s])/,S7=/\\([^0-9A-Za-z\s])/g,sX=/^([\s\S](?:(?! |[0-9]\.)[^*_~\-\n<`\\\[!])*)/,cX=/^\n+/,oX=/^([ \t]*)/,uX=/\\([^\\])/g,hX=/(?:^|\n)( *)$/,Zd="(?:\\d+\\.)",Wd="(?:[*+-])";function gM(e){return"( *)("+(e===1?Zd:Wd)+") +"}const EM=gM(1),_M=gM(2);function IM(e){return new RegExp("^"+(e===1?EM:_M))}const dX=IM(1),fX=IM(2);function NM(e){return new RegExp("^"+(e===1?EM:_M)+"[^\\n]*(?:\\n(?!\\1"+(e===1?Zd:Wd)+" )[^\\n]*)*(\\n|$)","gm")}const mX=NM(1),vX=NM(2);function SM(e){const t=e===1?Zd:Wd;return new RegExp("^( *)("+t+") [\\s\\S]+?(?:\\n{2,}(?! )(?!\\1"+t+" (?!"+t+" ))\\n*|\\s*\\n*$)")}const yM=SM(1),zM=SM(2);function oE(e,t){const a=t===1,n=a?yM:zM,r=a?mX:vX,s=a?dX:fX;return{match:f4(function(o,u){const d=hX.exec(u.prevCapture);return d&&(u.list||!u.inline&&!u.simple)?n.exec(o=d[1]+o):null}),order:1,parse(o,u,d){const f=a?+o[2]:void 0,v=o[0].replace(Mq,`
268
268
  `).match(r);let p=!1;return{items:v.map(function(A,E){const _=s.exec(A)[0].length,S=new RegExp("^ {1,"+_+"}","gm"),z=A.replace(S,"").replace(s,""),C=E===v.length-1,M=z.indexOf(`
269
269
 
270
270
  `)!==-1||C&&p;p=M;const x=d.inline,D=d.list;let w;d.list=!0,M?(d.inline=!1,w=Or(z)+`