meshy-node 0.2.2 → 0.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -57,7 +57,7 @@ Error generating stack: `+l.message+`
57
57
  * @license MIT
58
58
  */var sg="popstate";function ug(a){return typeof a=="object"&&a!=null&&"pathname"in a&&"search"in a&&"hash"in a&&"state"in a&&"key"in a}function L1(a={}){function o(i,c){var p;let f=(p=c.state)==null?void 0:p.masked,{pathname:d,search:m,hash:h}=f||i.location;return pf("",{pathname:d,search:m,hash:h},c.state&&c.state.usr||null,c.state&&c.state.key||"default",f?{pathname:i.location.pathname,search:i.location.search,hash:i.location.hash}:void 0)}function r(i,c){return typeof c=="string"?c:Cr(c)}return B1(o,r,null,a)}function Fe(a,o){if(a===!1||a===null||typeof a>"u")throw new Error(o)}function yn(a,o){if(!a){typeof console<"u"&&console.warn(o);try{throw new Error(o)}catch{}}}function U1(){return Math.random().toString(36).substring(2,10)}function cg(a,o){return{usr:a.state,key:a.key,idx:o,masked:a.unstable_mask?{pathname:a.pathname,search:a.search,hash:a.hash}:void 0}}function pf(a,o,r=null,i,c){return{pathname:typeof a=="string"?a:a.pathname,search:"",hash:"",...typeof o=="string"?bo(o):o,state:r,key:o&&o.key||i||U1(),unstable_mask:c}}function Cr({pathname:a="/",search:o="",hash:r=""}){return o&&o!=="?"&&(a+=o.charAt(0)==="?"?o:"?"+o),r&&r!=="#"&&(a+=r.charAt(0)==="#"?r:"#"+r),a}function bo(a){let o={};if(a){let r=a.indexOf("#");r>=0&&(o.hash=a.substring(r),a=a.substring(0,r));let i=a.indexOf("?");i>=0&&(o.search=a.substring(i),a=a.substring(0,i)),a&&(o.pathname=a)}return o}function B1(a,o,r,i={}){let{window:c=document.defaultView,v5Compat:f=!1}=i,d=c.history,m="POP",h=null,p=x();p==null&&(p=0,d.replaceState({...d.state,idx:p},""));function x(){return(d.state||{idx:null}).idx}function v(){m="POP";let C=x(),T=C==null?null:C-p;p=C,h&&h({action:m,location:E.location,delta:T})}function w(C,T){m="PUSH";let j=ug(C)?C:pf(E.location,C,T);p=x()+1;let D=cg(j,p),B=E.createHref(j.unstable_mask||j);try{d.pushState(D,"",B)}catch(K){if(K instanceof DOMException&&K.name==="DataCloneError")throw K;c.location.assign(B)}f&&h&&h({action:m,location:E.location,delta:1})}function N(C,T){m="REPLACE";let j=ug(C)?C:pf(E.location,C,T);p=x();let D=cg(j,p),B=E.createHref(j.unstable_mask||j);d.replaceState(D,"",B),f&&h&&h({action:m,location:E.location,delta:0})}function _(C){return H1(C)}let E={get action(){return m},get location(){return a(c,d)},listen(C){if(h)throw new Error("A history only accepts one active listener");return c.addEventListener(sg,v),h=C,()=>{c.removeEventListener(sg,v),h=null}},createHref(C){return o(c,C)},createURL:_,encodeLocation(C){let T=_(C);return{pathname:T.pathname,search:T.search,hash:T.hash}},push:w,replace:N,go(C){return d.go(C)}};return E}function H1(a,o=!1){let r="http://localhost";typeof window<"u"&&(r=window.location.origin!=="null"?window.location.origin:window.location.href),Fe(r,"No window.location.(origin|href) available to create URL");let i=typeof a=="string"?a:Cr(a);return i=i.replace(/ $/,"%20"),!o&&i.startsWith("//")&&(i=r+i),new URL(i,r)}function nv(a,o,r="/"){return V1(a,o,r,!1)}function V1(a,o,r,i){let c=typeof o=="string"?bo(o):o,f=ra(c.pathname||"/",r);if(f==null)return null;let d=av(a);Y1(d);let m=null;for(let h=0;m==null&&h<d.length;++h){let p=W1(f);m=F1(d[h],p,i)}return m}function av(a,o=[],r=[],i="",c=!1){let f=(d,m,h=c,p)=>{let x={relativePath:p===void 0?d.path||"":p,caseSensitive:d.caseSensitive===!0,childrenIndex:m,route:d};if(x.relativePath.startsWith("/")){if(!x.relativePath.startsWith(i)&&h)return;Fe(x.relativePath.startsWith(i),`Absolute route path "${x.relativePath}" nested under path "${i}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),x.relativePath=x.relativePath.slice(i.length)}let v=Ln([i,x.relativePath]),w=r.concat(x);d.children&&d.children.length>0&&(Fe(d.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${v}".`),av(d.children,o,w,v,h)),!(d.path==null&&!d.index)&&o.push({path:v,score:$1(v,d.index),routesMeta:w})};return a.forEach((d,m)=>{var h;if(d.path===""||!((h=d.path)!=null&&h.includes("?")))f(d,m);else for(let p of lv(d.path))f(d,m,!0,p)}),o}function lv(a){let o=a.split("/");if(o.length===0)return[];let[r,...i]=o,c=r.endsWith("?"),f=r.replace(/\?$/,"");if(i.length===0)return c?[f,""]:[f];let d=lv(i.join("/")),m=[];return m.push(...d.map(h=>h===""?f:[f,h].join("/"))),c&&m.push(...d),m.map(h=>a.startsWith("/")&&h===""?"/":h)}function Y1(a){a.sort((o,r)=>o.score!==r.score?r.score-o.score:J1(o.routesMeta.map(i=>i.childrenIndex),r.routesMeta.map(i=>i.childrenIndex)))}var q1=/^:[\w-]+$/,G1=3,X1=2,Q1=1,Z1=10,K1=-2,fg=a=>a==="*";function $1(a,o){let r=a.split("/"),i=r.length;return r.some(fg)&&(i+=K1),o&&(i+=X1),r.filter(c=>!fg(c)).reduce((c,f)=>c+(q1.test(f)?G1:f===""?Q1:Z1),i)}function J1(a,o){return a.length===o.length&&a.slice(0,-1).every((i,c)=>i===o[c])?a[a.length-1]-o[o.length-1]:0}function F1(a,o,r=!1){let{routesMeta:i}=a,c={},f="/",d=[];for(let m=0;m<i.length;++m){let h=i[m],p=m===i.length-1,x=f==="/"?o:o.slice(f.length)||"/",v=ds({path:h.relativePath,caseSensitive:h.caseSensitive,end:p},x),w=h.route;if(!v&&p&&r&&!i[i.length-1].route.index&&(v=ds({path:h.relativePath,caseSensitive:h.caseSensitive,end:!1},x)),!v)return null;Object.assign(c,v.params),d.push({params:c,pathname:Ln([f,v.pathname]),pathnameBase:nS(Ln([f,v.pathnameBase])),route:w}),v.pathnameBase!=="/"&&(f=Ln([f,v.pathnameBase]))}return d}function ds(a,o){typeof a=="string"&&(a={path:a,caseSensitive:!1,end:!0});let[r,i]=P1(a.path,a.caseSensitive,a.end),c=o.match(r);if(!c)return null;let f=c[0],d=f.replace(/(.)\/+$/,"$1"),m=c.slice(1);return{params:i.reduce((p,{paramName:x,isOptional:v},w)=>{if(x==="*"){let _=m[w]||"";d=f.slice(0,f.length-_.length).replace(/(.)\/+$/,"$1")}const N=m[w];return v&&!N?p[x]=void 0:p[x]=(N||"").replace(/%2F/g,"/"),p},{}),pathname:f,pathnameBase:d,pattern:a}}function P1(a,o=!1,r=!0){yn(a==="*"||!a.endsWith("*")||a.endsWith("/*"),`Route path "${a}" will be treated as if it were "${a.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${a.replace(/\*$/,"/*")}".`);let i=[],c="^"+a.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(d,m,h,p,x)=>{if(i.push({paramName:m,isOptional:h!=null}),h){let v=x.charAt(p+d.length);return v&&v!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return a.endsWith("*")?(i.push({paramName:"*"}),c+=a==="*"||a==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?c+="\\/*$":a!==""&&a!=="/"&&(c+="(?:(?=\\/|$))"),[new RegExp(c,o?void 0:"i"),i]}function W1(a){try{return a.split("/").map(o=>decodeURIComponent(o).replace(/\//g,"%2F")).join("/")}catch(o){return yn(!1,`The URL path "${a}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${o}).`),a}}function ra(a,o){if(o==="/")return a;if(!a.toLowerCase().startsWith(o.toLowerCase()))return null;let r=o.endsWith("/")?o.length-1:o.length,i=a.charAt(r);return i&&i!=="/"?null:a.slice(r)||"/"}var I1=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function eS(a,o="/"){let{pathname:r,search:i="",hash:c=""}=typeof a=="string"?bo(a):a,f;return r?(r=r.replace(/\/\/+/g,"/"),r.startsWith("/")?f=dg(r.substring(1),"/"):f=dg(r,o)):f=o,{pathname:f,search:aS(i),hash:lS(c)}}function dg(a,o){let r=o.replace(/\/+$/,"").split("/");return a.split("/").forEach(c=>{c===".."?r.length>1&&r.pop():c!=="."&&r.push(c)}),r.length>1?r.join("/"):"/"}function Wc(a,o,r,i){return`Cannot include a '${a}' character in a manually specified \`to.${o}\` field [${JSON.stringify(i)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function tS(a){return a.filter((o,r)=>r===0||o.route.path&&o.route.path.length>0)}function Df(a){let o=tS(a);return o.map((r,i)=>i===o.length-1?r.pathname:r.pathnameBase)}function Ss(a,o,r,i=!1){let c;typeof a=="string"?c=bo(a):(c={...a},Fe(!c.pathname||!c.pathname.includes("?"),Wc("?","pathname","search",c)),Fe(!c.pathname||!c.pathname.includes("#"),Wc("#","pathname","hash",c)),Fe(!c.search||!c.search.includes("#"),Wc("#","search","hash",c)));let f=a===""||c.pathname==="",d=f?"/":c.pathname,m;if(d==null)m=r;else{let v=o.length-1;if(!i&&d.startsWith("..")){let w=d.split("/");for(;w[0]==="..";)w.shift(),v-=1;c.pathname=w.join("/")}m=v>=0?o[v]:"/"}let h=eS(c,m),p=d&&d!=="/"&&d.endsWith("/"),x=(f||d===".")&&r.endsWith("/");return!h.pathname.endsWith("/")&&(p||x)&&(h.pathname+="/"),h}var Ln=a=>a.join("/").replace(/\/\/+/g,"/"),nS=a=>a.replace(/\/+$/,"").replace(/^\/*/,"/"),aS=a=>!a||a==="?"?"":a.startsWith("?")?a:"?"+a,lS=a=>!a||a==="#"?"":a.startsWith("#")?a:"#"+a,oS=class{constructor(a,o,r,i=!1){this.status=a,this.statusText=o||"",this.internal=i,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function rS(a){return a!=null&&typeof a.status=="number"&&typeof a.statusText=="string"&&typeof a.internal=="boolean"&&"data"in a}function iS(a){return a.map(o=>o.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var ov=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function rv(a,o){let r=a;if(typeof r!="string"||!I1.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let i=r,c=!1;if(ov)try{let f=new URL(window.location.href),d=r.startsWith("//")?new URL(f.protocol+r):new URL(r),m=ra(d.pathname,o);d.origin===f.origin&&m!=null?r=m+d.search+d.hash:c=!0}catch{yn(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:i,isExternal:c,to:r}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var iv=["POST","PUT","PATCH","DELETE"];new Set(iv);var sS=["GET",...iv];new Set(sS);var xo=y.createContext(null);xo.displayName="DataRouter";var ws=y.createContext(null);ws.displayName="DataRouterState";var uS=y.createContext(!1),sv=y.createContext({isTransitioning:!1});sv.displayName="ViewTransition";var cS=y.createContext(new Map);cS.displayName="Fetchers";var fS=y.createContext(null);fS.displayName="Await";var Pt=y.createContext(null);Pt.displayName="Navigation";var Ar=y.createContext(null);Ar.displayName="Location";var cn=y.createContext({outlet:null,matches:[],isDataRoute:!1});cn.displayName="Route";var jf=y.createContext(null);jf.displayName="RouteError";var uv="REACT_ROUTER_ERROR",dS="REDIRECT",mS="ROUTE_ERROR_RESPONSE";function hS(a){if(a.startsWith(`${uv}:${dS}:{`))try{let o=JSON.parse(a.slice(28));if(typeof o=="object"&&o&&typeof o.status=="number"&&typeof o.statusText=="string"&&typeof o.location=="string"&&typeof o.reloadDocument=="boolean"&&typeof o.replace=="boolean")return o}catch{}}function pS(a){if(a.startsWith(`${uv}:${mS}:{`))try{let o=JSON.parse(a.slice(40));if(typeof o=="object"&&o&&typeof o.status=="number"&&typeof o.statusText=="string")return new oS(o.status,o.statusText,o.data)}catch{}}function gS(a,{relative:o}={}){Fe(So(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:i}=y.useContext(Pt),{hash:c,pathname:f,search:d}=_r(a,{relative:o}),m=f;return r!=="/"&&(m=f==="/"?r:Ln([r,f])),i.createHref({pathname:m,search:d,hash:c})}function So(){return y.useContext(Ar)!=null}function Bn(){return Fe(So(),"useLocation() may be used only in the context of a <Router> component."),y.useContext(Ar).location}var cv="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function fv(a){y.useContext(Pt).static||y.useLayoutEffect(a)}function dv(){let{isDataRoute:a}=y.useContext(cn);return a?MS():vS()}function vS(){Fe(So(),"useNavigate() may be used only in the context of a <Router> component.");let a=y.useContext(xo),{basename:o,navigator:r}=y.useContext(Pt),{matches:i}=y.useContext(cn),{pathname:c}=Bn(),f=JSON.stringify(Df(i)),d=y.useRef(!1);return fv(()=>{d.current=!0}),y.useCallback((h,p={})=>{if(yn(d.current,cv),!d.current)return;if(typeof h=="number"){r.go(h);return}let x=Ss(h,JSON.parse(f),c,p.relative==="path");a==null&&o!=="/"&&(x.pathname=x.pathname==="/"?o:Ln([o,x.pathname])),(p.replace?r.replace:r.push)(x,p.state,p)},[o,r,f,c,a])}var yS=y.createContext(null);function bS(a){let o=y.useContext(cn).outlet;return y.useMemo(()=>o&&y.createElement(yS.Provider,{value:a},o),[o,a])}function nA(){let{matches:a}=y.useContext(cn),o=a[a.length-1];return o?o.params:{}}function _r(a,{relative:o}={}){let{matches:r}=y.useContext(cn),{pathname:i}=Bn(),c=JSON.stringify(Df(r));return y.useMemo(()=>Ss(a,JSON.parse(c),i,o==="path"),[a,c,i,o])}function xS(a,o){return mv(a,o)}function mv(a,o,r){var C;Fe(So(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=y.useContext(Pt),{matches:c}=y.useContext(cn),f=c[c.length-1],d=f?f.params:{},m=f?f.pathname:"/",h=f?f.pathnameBase:"/",p=f&&f.route;{let T=p&&p.path||"";pv(m,!p||T.endsWith("*")||T.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${m}" (under <Route path="${T}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
59
59
 
60
- Please change the parent <Route path="${T}"> to <Route path="${T==="/"?"*":`${T}/*`}">.`)}let x=Bn(),v;if(o){let T=typeof o=="string"?bo(o):o;Fe(h==="/"||((C=T.pathname)==null?void 0:C.startsWith(h)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${h}" but pathname "${T.pathname}" was given in the \`location\` prop.`),v=T}else v=x;let w=v.pathname||"/",N=w;if(h!=="/"){let T=h.replace(/^\//,"").split("/");N="/"+w.replace(/^\//,"").split("/").slice(T.length).join("/")}let _=nv(a,{pathname:N});yn(p||_!=null,`No routes matched location "${v.pathname}${v.search}${v.hash}" `),yn(_==null||_[_.length-1].route.element!==void 0||_[_.length-1].route.Component!==void 0||_[_.length-1].route.lazy!==void 0,`Matched leaf route at location "${v.pathname}${v.search}${v.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let E=TS(_&&_.map(T=>Object.assign({},T,{params:Object.assign({},d,T.params),pathname:Ln([h,i.encodeLocation?i.encodeLocation(T.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:T.pathname]),pathnameBase:T.pathnameBase==="/"?h:Ln([h,i.encodeLocation?i.encodeLocation(T.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:T.pathnameBase])})),c,r);return o&&E?y.createElement(Ar.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...v},navigationType:"POP"}},E):E}function SS(){let a=OS(),o=rS(a)?`${a.status} ${a.statusText}`:a instanceof Error?a.message:JSON.stringify(a),r=a instanceof Error?a.stack:null,i="rgba(200,200,200, 0.5)",c={padding:"0.5rem",backgroundColor:i},f={padding:"2px 4px",backgroundColor:i},d=null;return console.error("Error handled by React Router default ErrorBoundary:",a),d=y.createElement(y.Fragment,null,y.createElement("p",null,"💿 Hey developer 👋"),y.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",y.createElement("code",{style:f},"ErrorBoundary")," or"," ",y.createElement("code",{style:f},"errorElement")," prop on your route.")),y.createElement(y.Fragment,null,y.createElement("h2",null,"Unexpected Application Error!"),y.createElement("h3",{style:{fontStyle:"italic"}},o),r?y.createElement("pre",{style:c},r):null,d)}var wS=y.createElement(SS,null),hv=class extends y.Component{constructor(a){super(a),this.state={location:a.location,revalidation:a.revalidation,error:a.error}}static getDerivedStateFromError(a){return{error:a}}static getDerivedStateFromProps(a,o){return o.location!==a.location||o.revalidation!=="idle"&&a.revalidation==="idle"?{error:a.error,location:a.location,revalidation:a.revalidation}:{error:a.error!==void 0?a.error:o.error,location:o.location,revalidation:a.revalidation||o.revalidation}}componentDidCatch(a,o){this.props.onError?this.props.onError(a,o):console.error("React Router caught the following error during render",a)}render(){let a=this.state.error;if(this.context&&typeof a=="object"&&a&&"digest"in a&&typeof a.digest=="string"){const r=pS(a.digest);r&&(a=r)}let o=a!==void 0?y.createElement(cn.Provider,{value:this.props.routeContext},y.createElement(jf.Provider,{value:a,children:this.props.component})):this.props.children;return this.context?y.createElement(ES,{error:a},o):o}};hv.contextType=uS;var Ic=new WeakMap;function ES({children:a,error:o}){let{basename:r}=y.useContext(Pt);if(typeof o=="object"&&o&&"digest"in o&&typeof o.digest=="string"){let i=hS(o.digest);if(i){let c=Ic.get(o);if(c)throw c;let f=rv(i.location,r);if(ov&&!Ic.get(o))if(f.isExternal||i.reloadDocument)window.location.href=f.absoluteURL||f.to;else{const d=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(f.to,{replace:i.replace}));throw Ic.set(o,d),d}return y.createElement("meta",{httpEquiv:"refresh",content:`0;url=${f.absoluteURL||f.to}`})}}return a}function CS({routeContext:a,match:o,children:r}){let i=y.useContext(xo);return i&&i.static&&i.staticContext&&(o.route.errorElement||o.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=o.route.id),y.createElement(cn.Provider,{value:a},r)}function TS(a,o=[],r){let i=r==null?void 0:r.state;if(a==null){if(!i)return null;if(i.errors)a=i.matches;else if(o.length===0&&!i.initialized&&i.matches.length>0)a=i.matches;else return null}let c=a,f=i==null?void 0:i.errors;if(f!=null){let x=c.findIndex(v=>v.route.id&&(f==null?void 0:f[v.route.id])!==void 0);Fe(x>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(f).join(",")}`),c=c.slice(0,Math.min(c.length,x+1))}let d=!1,m=-1;if(r&&i){d=i.renderFallback;for(let x=0;x<c.length;x++){let v=c[x];if((v.route.HydrateFallback||v.route.hydrateFallbackElement)&&(m=x),v.route.id){let{loaderData:w,errors:N}=i,_=v.route.loader&&!w.hasOwnProperty(v.route.id)&&(!N||N[v.route.id]===void 0);if(v.route.lazy||_){r.isStatic&&(d=!0),m>=0?c=c.slice(0,m+1):c=[c[0]];break}}}}let h=r==null?void 0:r.onError,p=i&&h?(x,v)=>{var w,N;h(x,{location:i.location,params:((N=(w=i.matches)==null?void 0:w[0])==null?void 0:N.params)??{},unstable_pattern:iS(i.matches),errorInfo:v})}:void 0;return c.reduceRight((x,v,w)=>{let N,_=!1,E=null,C=null;i&&(N=f&&v.route.id?f[v.route.id]:void 0,E=v.route.errorElement||wS,d&&(m<0&&w===0?(pv("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),_=!0,C=null):m===w&&(_=!0,C=v.route.hydrateFallbackElement||null)));let T=o.concat(c.slice(0,w+1)),j=()=>{let D;return N?D=E:_?D=C:v.route.Component?D=y.createElement(v.route.Component,null):v.route.element?D=v.route.element:D=x,y.createElement(CS,{match:v,routeContext:{outlet:x,matches:T,isDataRoute:i!=null},children:D})};return i&&(v.route.ErrorBoundary||v.route.errorElement||w===0)?y.createElement(hv,{location:i.location,revalidation:i.revalidation,component:E,error:N,children:j(),routeContext:{outlet:null,matches:T,isDataRoute:!0},onError:p}):j()},null)}function zf(a){return`${a} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function NS(a){let o=y.useContext(xo);return Fe(o,zf(a)),o}function RS(a){let o=y.useContext(ws);return Fe(o,zf(a)),o}function AS(a){let o=y.useContext(cn);return Fe(o,zf(a)),o}function kf(a){let o=AS(a),r=o.matches[o.matches.length-1];return Fe(r.route.id,`${a} can only be used on routes that contain a unique "id"`),r.route.id}function _S(){return kf("useRouteId")}function OS(){var i;let a=y.useContext(jf),o=RS("useRouteError"),r=kf("useRouteError");return a!==void 0?a:(i=o.errors)==null?void 0:i[r]}function MS(){let{router:a}=NS("useNavigate"),o=kf("useNavigate"),r=y.useRef(!1);return fv(()=>{r.current=!0}),y.useCallback(async(c,f={})=>{yn(r.current,cv),r.current&&(typeof c=="number"?await a.navigate(c):await a.navigate(c,{fromRouteId:o,...f}))},[a,o])}var mg={};function pv(a,o,r){!o&&!mg[a]&&(mg[a]=!0,yn(!1,r))}y.memo(DS);function DS({routes:a,future:o,state:r,isStatic:i,onError:c}){return mv(a,void 0,{state:r,isStatic:i,onError:c})}function hg({to:a,replace:o,state:r,relative:i}){Fe(So(),"<Navigate> may be used only in the context of a <Router> component.");let{static:c}=y.useContext(Pt);yn(!c,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:f}=y.useContext(cn),{pathname:d}=Bn(),m=dv(),h=Ss(a,Df(f),d,i==="path"),p=JSON.stringify(h);return y.useEffect(()=>{m(JSON.parse(p),{replace:o,state:r,relative:i})},[m,p,i,o,r]),null}function jS(a){return bS(a.context)}function po(a){Fe(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function zS({basename:a="/",children:o=null,location:r,navigationType:i="POP",navigator:c,static:f=!1,unstable_useTransitions:d}){Fe(!So(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let m=a.replace(/^\/*/,"/"),h=y.useMemo(()=>({basename:m,navigator:c,static:f,unstable_useTransitions:d,future:{}}),[m,c,f,d]);typeof r=="string"&&(r=bo(r));let{pathname:p="/",search:x="",hash:v="",state:w=null,key:N="default",unstable_mask:_}=r,E=y.useMemo(()=>{let C=ra(p,m);return C==null?null:{location:{pathname:C,search:x,hash:v,state:w,key:N,unstable_mask:_},navigationType:i}},[m,p,x,v,w,N,i,_]);return yn(E!=null,`<Router basename="${m}"> is not able to match the URL "${p}${x}${v}" because it does not start with the basename, so the <Router> won't render anything.`),E==null?null:y.createElement(Pt.Provider,{value:h},y.createElement(Ar.Provider,{children:o,value:E}))}function kS({children:a,location:o}){return xS(gf(a),o)}function gf(a,o=[]){let r=[];return y.Children.forEach(a,(i,c)=>{if(!y.isValidElement(i))return;let f=[...o,c];if(i.type===y.Fragment){r.push.apply(r,gf(i.props.children,f));return}Fe(i.type===po,`[${typeof i.type=="string"?i.type:i.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Fe(!i.props.index||!i.props.children,"An index route cannot have child routes.");let d={id:i.props.id||f.join("-"),caseSensitive:i.props.caseSensitive,element:i.props.element,Component:i.props.Component,index:i.props.index,path:i.props.path,middleware:i.props.middleware,loader:i.props.loader,action:i.props.action,hydrateFallbackElement:i.props.hydrateFallbackElement,HydrateFallback:i.props.HydrateFallback,errorElement:i.props.errorElement,ErrorBoundary:i.props.ErrorBoundary,hasErrorBoundary:i.props.hasErrorBoundary===!0||i.props.ErrorBoundary!=null||i.props.errorElement!=null,shouldRevalidate:i.props.shouldRevalidate,handle:i.props.handle,lazy:i.props.lazy};i.props.children&&(d.children=gf(i.props.children,f)),r.push(d)}),r}var os="get",rs="application/x-www-form-urlencoded";function Es(a){return typeof HTMLElement<"u"&&a instanceof HTMLElement}function LS(a){return Es(a)&&a.tagName.toLowerCase()==="button"}function US(a){return Es(a)&&a.tagName.toLowerCase()==="form"}function BS(a){return Es(a)&&a.tagName.toLowerCase()==="input"}function HS(a){return!!(a.metaKey||a.altKey||a.ctrlKey||a.shiftKey)}function VS(a,o){return a.button===0&&(!o||o==="_self")&&!HS(a)}var $i=null;function YS(){if($i===null)try{new FormData(document.createElement("form"),0),$i=!1}catch{$i=!0}return $i}var qS=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function ef(a){return a!=null&&!qS.has(a)?(yn(!1,`"${a}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${rs}"`),null):a}function GS(a,o){let r,i,c,f,d;if(US(a)){let m=a.getAttribute("action");i=m?ra(m,o):null,r=a.getAttribute("method")||os,c=ef(a.getAttribute("enctype"))||rs,f=new FormData(a)}else if(LS(a)||BS(a)&&(a.type==="submit"||a.type==="image")){let m=a.form;if(m==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let h=a.getAttribute("formaction")||m.getAttribute("action");if(i=h?ra(h,o):null,r=a.getAttribute("formmethod")||m.getAttribute("method")||os,c=ef(a.getAttribute("formenctype"))||ef(m.getAttribute("enctype"))||rs,f=new FormData(m,a),!YS()){let{name:p,type:x,value:v}=a;if(x==="image"){let w=p?`${p}.`:"";f.append(`${w}x`,"0"),f.append(`${w}y`,"0")}else p&&f.append(p,v)}}else{if(Es(a))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=os,i=null,c=rs,d=a}return f&&c==="text/plain"&&(d=f,f=void 0),{action:i,method:r.toLowerCase(),encType:c,formData:f,body:d}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Lf(a,o){if(a===!1||a===null||typeof a>"u")throw new Error(o)}function XS(a,o,r,i){let c=typeof a=="string"?new URL(a,typeof window>"u"?"server://singlefetch/":window.location.origin):a;return r?c.pathname.endsWith("/")?c.pathname=`${c.pathname}_.${i}`:c.pathname=`${c.pathname}.${i}`:c.pathname==="/"?c.pathname=`_root.${i}`:o&&ra(c.pathname,o)==="/"?c.pathname=`${o.replace(/\/$/,"")}/_root.${i}`:c.pathname=`${c.pathname.replace(/\/$/,"")}.${i}`,c}async function QS(a,o){if(a.id in o)return o[a.id];try{let r=await import(a.module);return o[a.id]=r,r}catch(r){return console.error(`Error loading route module \`${a.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function ZS(a){return a==null?!1:a.href==null?a.rel==="preload"&&typeof a.imageSrcSet=="string"&&typeof a.imageSizes=="string":typeof a.rel=="string"&&typeof a.href=="string"}async function KS(a,o,r){let i=await Promise.all(a.map(async c=>{let f=o.routes[c.route.id];if(f){let d=await QS(f,r);return d.links?d.links():[]}return[]}));return PS(i.flat(1).filter(ZS).filter(c=>c.rel==="stylesheet"||c.rel==="preload").map(c=>c.rel==="stylesheet"?{...c,rel:"prefetch",as:"style"}:{...c,rel:"prefetch"}))}function pg(a,o,r,i,c,f){let d=(h,p)=>r[p]?h.route.id!==r[p].route.id:!0,m=(h,p)=>{var x;return r[p].pathname!==h.pathname||((x=r[p].route.path)==null?void 0:x.endsWith("*"))&&r[p].params["*"]!==h.params["*"]};return f==="assets"?o.filter((h,p)=>d(h,p)||m(h,p)):f==="data"?o.filter((h,p)=>{var v;let x=i.routes[h.route.id];if(!x||!x.hasLoader)return!1;if(d(h,p)||m(h,p))return!0;if(h.route.shouldRevalidate){let w=h.route.shouldRevalidate({currentUrl:new URL(c.pathname+c.search+c.hash,window.origin),currentParams:((v=r[0])==null?void 0:v.params)||{},nextUrl:new URL(a,window.origin),nextParams:h.params,defaultShouldRevalidate:!0});if(typeof w=="boolean")return w}return!0}):[]}function $S(a,o,{includeHydrateFallback:r}={}){return JS(a.map(i=>{let c=o.routes[i.route.id];if(!c)return[];let f=[c.module];return c.clientActionModule&&(f=f.concat(c.clientActionModule)),c.clientLoaderModule&&(f=f.concat(c.clientLoaderModule)),r&&c.hydrateFallbackModule&&(f=f.concat(c.hydrateFallbackModule)),c.imports&&(f=f.concat(c.imports)),f}).flat(1))}function JS(a){return[...new Set(a)]}function FS(a){let o={},r=Object.keys(a).sort();for(let i of r)o[i]=a[i];return o}function PS(a,o){let r=new Set;return new Set(o),a.reduce((i,c)=>{let f=JSON.stringify(FS(c));return r.has(f)||(r.add(f),i.push({key:f,link:c})),i},[])}function gv(){let a=y.useContext(xo);return Lf(a,"You must render this element inside a <DataRouterContext.Provider> element"),a}function WS(){let a=y.useContext(ws);return Lf(a,"You must render this element inside a <DataRouterStateContext.Provider> element"),a}var Uf=y.createContext(void 0);Uf.displayName="FrameworkContext";function vv(){let a=y.useContext(Uf);return Lf(a,"You must render this element inside a <HydratedRouter> element"),a}function IS(a,o){let r=y.useContext(Uf),[i,c]=y.useState(!1),[f,d]=y.useState(!1),{onFocus:m,onBlur:h,onMouseEnter:p,onMouseLeave:x,onTouchStart:v}=o,w=y.useRef(null);y.useEffect(()=>{if(a==="render"&&d(!0),a==="viewport"){let E=T=>{T.forEach(j=>{d(j.isIntersecting)})},C=new IntersectionObserver(E,{threshold:.5});return w.current&&C.observe(w.current),()=>{C.disconnect()}}},[a]),y.useEffect(()=>{if(i){let E=setTimeout(()=>{d(!0)},100);return()=>{clearTimeout(E)}}},[i]);let N=()=>{c(!0)},_=()=>{c(!1),d(!1)};return r?a!=="intent"?[f,w,{}]:[f,w,{onFocus:Sr(m,N),onBlur:Sr(h,_),onMouseEnter:Sr(p,N),onMouseLeave:Sr(x,_),onTouchStart:Sr(v,N)}]:[!1,w,{}]}function Sr(a,o){return r=>{a&&a(r),r.defaultPrevented||o(r)}}function e2({page:a,...o}){let{router:r}=gv(),i=y.useMemo(()=>nv(r.routes,a,r.basename),[r.routes,a,r.basename]);return i?y.createElement(n2,{page:a,matches:i,...o}):null}function t2(a){let{manifest:o,routeModules:r}=vv(),[i,c]=y.useState([]);return y.useEffect(()=>{let f=!1;return KS(a,o,r).then(d=>{f||c(d)}),()=>{f=!0}},[a,o,r]),i}function n2({page:a,matches:o,...r}){let i=Bn(),{future:c,manifest:f,routeModules:d}=vv(),{basename:m}=gv(),{loaderData:h,matches:p}=WS(),x=y.useMemo(()=>pg(a,o,p,f,i,"data"),[a,o,p,f,i]),v=y.useMemo(()=>pg(a,o,p,f,i,"assets"),[a,o,p,f,i]),w=y.useMemo(()=>{if(a===i.pathname+i.search+i.hash)return[];let E=new Set,C=!1;if(o.forEach(j=>{var B;let D=f.routes[j.route.id];!D||!D.hasLoader||(!x.some(K=>K.route.id===j.route.id)&&j.route.id in h&&((B=d[j.route.id])!=null&&B.shouldRevalidate)||D.hasClientLoader?C=!0:E.add(j.route.id))}),E.size===0)return[];let T=XS(a,m,c.unstable_trailingSlashAwareDataRequests,"data");return C&&E.size>0&&T.searchParams.set("_routes",o.filter(j=>E.has(j.route.id)).map(j=>j.route.id).join(",")),[T.pathname+T.search]},[m,c.unstable_trailingSlashAwareDataRequests,h,i,f,x,o,a,d]),N=y.useMemo(()=>$S(v,f),[v,f]),_=t2(v);return y.createElement(y.Fragment,null,w.map(E=>y.createElement("link",{key:E,rel:"prefetch",as:"fetch",href:E,...r})),N.map(E=>y.createElement("link",{key:E,rel:"modulepreload",href:E,...r})),_.map(({key:E,link:C})=>y.createElement("link",{key:E,nonce:r.nonce,...C,crossOrigin:C.crossOrigin??r.crossOrigin})))}function a2(...a){return o=>{a.forEach(r=>{typeof r=="function"?r(o):r!=null&&(r.current=o)})}}var l2=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{l2&&(window.__reactRouterVersion="7.13.2")}catch{}function o2({basename:a,children:o,unstable_useTransitions:r,window:i}){let c=y.useRef();c.current==null&&(c.current=L1({window:i,v5Compat:!0}));let f=c.current,[d,m]=y.useState({action:f.action,location:f.location}),h=y.useCallback(p=>{r===!1?m(p):y.startTransition(()=>m(p))},[r]);return y.useLayoutEffect(()=>f.listen(h),[f,h]),y.createElement(zS,{basename:a,children:o,location:d.location,navigationType:d.action,navigator:f,unstable_useTransitions:r})}var yv=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,bv=y.forwardRef(function({onClick:o,discover:r="render",prefetch:i="none",relative:c,reloadDocument:f,replace:d,unstable_mask:m,state:h,target:p,to:x,preventScrollReset:v,viewTransition:w,unstable_defaultShouldRevalidate:N,..._},E){let{basename:C,navigator:T,unstable_useTransitions:j}=y.useContext(Pt),D=typeof x=="string"&&yv.test(x),B=rv(x,C);x=B.to;let K=gS(x,{relative:c}),F=Bn(),q=null;if(m){let ce=Ss(m,[],F.unstable_mask?F.unstable_mask.pathname:"/",!0);C!=="/"&&(ce.pathname=ce.pathname==="/"?C:Ln([C,ce.pathname])),q=T.createHref(ce)}let[V,ae,he]=IS(i,_),pe=s2(x,{replace:d,unstable_mask:m,state:h,target:p,preventScrollReset:v,relative:c,viewTransition:w,unstable_defaultShouldRevalidate:N,unstable_useTransitions:j});function fe(ce){o&&o(ce),ce.defaultPrevented||pe(ce)}let me=!(B.isExternal||f),ge=y.createElement("a",{..._,...he,href:(me?q:void 0)||B.absoluteURL||K,onClick:me?fe:o,ref:a2(E,ae),target:p,"data-discover":!D&&r==="render"?"true":void 0});return V&&!D?y.createElement(y.Fragment,null,ge,y.createElement(e2,{page:K})):ge});bv.displayName="Link";var xv=y.forwardRef(function({"aria-current":o="page",caseSensitive:r=!1,className:i="",end:c=!1,style:f,to:d,viewTransition:m,children:h,...p},x){let v=_r(d,{relative:p.relative}),w=Bn(),N=y.useContext(ws),{navigator:_,basename:E}=y.useContext(Pt),C=N!=null&&m2(v)&&m===!0,T=_.encodeLocation?_.encodeLocation(v).pathname:v.pathname,j=w.pathname,D=N&&N.navigation&&N.navigation.location?N.navigation.location.pathname:null;r||(j=j.toLowerCase(),D=D?D.toLowerCase():null,T=T.toLowerCase()),D&&E&&(D=ra(D,E)||D);const B=T!=="/"&&T.endsWith("/")?T.length-1:T.length;let K=j===T||!c&&j.startsWith(T)&&j.charAt(B)==="/",F=D!=null&&(D===T||!c&&D.startsWith(T)&&D.charAt(T.length)==="/"),q={isActive:K,isPending:F,isTransitioning:C},V=K?o:void 0,ae;typeof i=="function"?ae=i(q):ae=[i,K?"active":null,F?"pending":null,C?"transitioning":null].filter(Boolean).join(" ");let he=typeof f=="function"?f(q):f;return y.createElement(bv,{...p,"aria-current":V,className:ae,ref:x,style:he,to:d,viewTransition:m},typeof h=="function"?h(q):h)});xv.displayName="NavLink";var r2=y.forwardRef(({discover:a="render",fetcherKey:o,navigate:r,reloadDocument:i,replace:c,state:f,method:d=os,action:m,onSubmit:h,relative:p,preventScrollReset:x,viewTransition:v,unstable_defaultShouldRevalidate:w,...N},_)=>{let{unstable_useTransitions:E}=y.useContext(Pt),C=f2(),T=d2(m,{relative:p}),j=d.toLowerCase()==="get"?"get":"post",D=typeof m=="string"&&yv.test(m),B=K=>{if(h&&h(K),K.defaultPrevented)return;K.preventDefault();let F=K.nativeEvent.submitter,q=(F==null?void 0:F.getAttribute("formmethod"))||d,V=()=>C(F||K.currentTarget,{fetcherKey:o,method:q,navigate:r,replace:c,state:f,relative:p,preventScrollReset:x,viewTransition:v,unstable_defaultShouldRevalidate:w});E&&r!==!1?y.startTransition(()=>V()):V()};return y.createElement("form",{ref:_,method:j,action:T,onSubmit:i?h:B,...N,"data-discover":!D&&a==="render"?"true":void 0})});r2.displayName="Form";function i2(a){return`${a} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Sv(a){let o=y.useContext(xo);return Fe(o,i2(a)),o}function s2(a,{target:o,replace:r,unstable_mask:i,state:c,preventScrollReset:f,relative:d,viewTransition:m,unstable_defaultShouldRevalidate:h,unstable_useTransitions:p}={}){let x=dv(),v=Bn(),w=_r(a,{relative:d});return y.useCallback(N=>{if(VS(N,o)){N.preventDefault();let _=r!==void 0?r:Cr(v)===Cr(w),E=()=>x(a,{replace:_,unstable_mask:i,state:c,preventScrollReset:f,relative:d,viewTransition:m,unstable_defaultShouldRevalidate:h});p?y.startTransition(()=>E()):E()}},[v,x,w,r,i,c,o,a,f,d,m,h,p])}var u2=0,c2=()=>`__${String(++u2)}__`;function f2(){let{router:a}=Sv("useSubmit"),{basename:o}=y.useContext(Pt),r=_S(),i=a.fetch,c=a.navigate;return y.useCallback(async(f,d={})=>{let{action:m,method:h,encType:p,formData:x,body:v}=GS(f,o);if(d.navigate===!1){let w=d.fetcherKey||c2();await i(w,r,d.action||m,{unstable_defaultShouldRevalidate:d.unstable_defaultShouldRevalidate,preventScrollReset:d.preventScrollReset,formData:x,body:v,formMethod:d.method||h,formEncType:d.encType||p,flushSync:d.flushSync})}else await c(d.action||m,{unstable_defaultShouldRevalidate:d.unstable_defaultShouldRevalidate,preventScrollReset:d.preventScrollReset,formData:x,body:v,formMethod:d.method||h,formEncType:d.encType||p,replace:d.replace,state:d.state,fromRouteId:r,flushSync:d.flushSync,viewTransition:d.viewTransition})},[i,c,o,r])}function d2(a,{relative:o}={}){let{basename:r}=y.useContext(Pt),i=y.useContext(cn);Fe(i,"useFormAction must be used inside a RouteContext");let[c]=i.matches.slice(-1),f={..._r(a||".",{relative:o})},d=Bn();if(a==null){f.search=d.search;let m=new URLSearchParams(f.search),h=m.getAll("index");if(h.some(x=>x==="")){m.delete("index"),h.filter(v=>v).forEach(v=>m.append("index",v));let x=m.toString();f.search=x?`?${x}`:""}}return(!a||a===".")&&c.route.index&&(f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(f.pathname=f.pathname==="/"?r:Ln([r,f.pathname])),Cr(f)}function m2(a,{relative:o}={}){let r=y.useContext(sv);Fe(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=Sv("useViewTransitionState"),c=_r(a,{relative:o});if(!r.isTransitioning)return!1;let f=ra(r.currentLocation.pathname,i)||r.currentLocation.pathname,d=ra(r.nextLocation.pathname,i)||r.nextLocation.pathname;return ds(c.pathname,d)!=null||ds(c.pathname,f)!=null}var Or=tv();const wv=ev(Or),h2="/api";function p2(a,o){if(typeof a=="string"&&a)return a;if(a&&typeof a=="object"){const r=a,i=typeof r.error=="object"&&r.error!==null?r.error:void 0;if(typeof r.error=="string"&&r.error)return r.error;if(typeof(i==null?void 0:i.message)=="string"&&i.message)return i.message;if(typeof r.message=="string"&&r.message)return r.message}return o}async function Pe(a,o){const r=await fetch(`${h2}${a}`,{...o,headers:{"Content-Type":"application/json",...o==null?void 0:o.headers}});if(!r.ok){const i=await r.json().catch(()=>r.statusText);throw new Error(p2(i,`HTTP ${r.status}`))}return r.json()}function g2(){return Pe("/system/info")}function aA(a){return Pe("/system/transport",{method:"POST",body:JSON.stringify({type:a})})}function v2(){return Pe("/cluster/state")}function lA(){return Pe("/cluster/promote",{method:"POST"})}function oA(a){return Pe("/cluster/connect",{method:"POST",body:JSON.stringify(a)})}function rA(){return Pe("/cluster/disconnect",{method:"POST"})}function iA(a,o){return Pe(`/nodes/${a}/devtunnel`,{method:"POST",body:JSON.stringify({enabled:o})})}function sA(a,o={}){const r=new URLSearchParams;o.path&&r.set("path",o.path),o.limit!==void 0&&r.set("limit",String(Math.min(Math.max(1,o.limit),100))),o.offset!==void 0&&r.set("offset",String(Math.max(0,o.offset))),o.directoriesOnly!==void 0&&r.set("directoriesOnly",String(o.directoriesOnly)),o.allowAbsolute!==void 0&&r.set("allowAbsolute",String(o.allowAbsolute));const i=r.toString();return Pe(`/nodes/${a}/workdir/tree${i?`?${i}`:""}`)}function uA(a,o={}){const r=new URLSearchParams;o.path&&r.set("path",o.path),o.limit!==void 0&&r.set("limit",String(Math.min(Math.max(1,o.limit),20))),o.offset!==void 0&&r.set("offset",String(Math.max(0,o.offset))),o.allowAbsolute!==void 0&&r.set("allowAbsolute",String(o.allowAbsolute));const i=r.toString();return Pe(`/nodes/${a}/workdir/branch${i?`?${i}`:""}`)}function cA(a,o){return Pe(`/nodes/${a}/workdir/branch`,{method:"POST",body:JSON.stringify({path:o.path,branchName:o.branchName,startPoint:o.startPoint,limit:o.limit,offset:o.offset,allowAbsolute:o.allowAbsolute})})}async function fA(a){const o=new URLSearchParams;a!=null&&a.status&&o.set("status",a.status),a!=null&&a.assignedTo&&o.set("assignedTo",a.assignedTo),a!=null&&a.priority&&o.set("priority",a.priority);{const c=Math.min(Math.max(1,a.limit),100);o.set("limit",String(c))}a!=null&&a.offset&&o.set("offset",String(a.offset));const r=o.toString();return(await Pe(`/tasks${r?`?${r}`:""}`)).tasks}function dA(a){return Pe(`/tasks/${a}`)}function mA(a){return Pe("/tasks",{method:"POST",body:JSON.stringify(a)})}function hA(a){return Pe("/tasks/batch/delete",{method:"POST",body:JSON.stringify({ids:a})})}function pA(a){return Pe("/tasks/batch/archive",{method:"POST",body:JSON.stringify({ids:a})})}function gA(a){return Pe(`/tasks/${a}/cancel`,{method:"POST"})}function vA(a){return Pe(`/tasks/${a}/retry`,{method:"POST"})}function yA(a,o){return Pe(`/tasks/${a}/logs`)}function bA(a,o){return Pe(`/tasks/${a}/message`,{method:"POST",body:JSON.stringify({content:o})})}function xA(a){return Pe(`/tasks/${a}/output`)}function SA(a,o="."){return Pe(`/tasks/${a}/output/tree?path=${encodeURIComponent(o)}`)}function wA(a,o){return Pe(`/tasks/${a}/output/content?path=${encodeURIComponent(o)}`)}function EA(a,o){return Pe(`/tasks/${a}/output/preview-sessions`,{method:"POST",body:JSON.stringify(o?{path:o}:{})})}function CA(a){return Pe(`/tasks/${a}/output/diff`)}function y2(a,o,r=!0){const i=y.useRef(a);y.useEffect(()=>{i.current=a},[a]),y.useEffect(()=>{if(!r)return;const c=()=>i.current();c();const f=setInterval(c,o);return()=>clearInterval(f)},[o,r])}let b2=0;function x2(a=50){const[o,r]=y.useState([]),[i,c]=y.useState(!1),f=y.useRef(null),d=y.useRef(0),m=y.useRef(new Map);y.useEffect(()=>{const x=new EventSource("/api/events");f.current=x,x.onopen=()=>c(!0),x.onerror=()=>c(!1);const v=["node.joined","node.left","node.status","task.created","task.assigned","task.status","task.deleted","task.output","election.started","election.complete","cluster.state"];for(const w of v)x.addEventListener(w,N=>{const _={id:String(++b2),type:w,data:JSON.parse(N.data),timestamp:Date.now()};r(E=>[_,...E].slice(0,a));for(const[,{pattern:E,callback:C}]of m.current)w.startsWith(E)&&C(_)});return()=>{x.close(),f.current=null,c(!1)}},[a]);const h=y.useCallback((x,v)=>{const w=++d.current;return m.current.set(w,{pattern:x,callback:v}),()=>{m.current.delete(w)}},[]),p=y.useCallback(()=>r([]),[]);return{events:o,connected:i,subscribe:h,clearEvents:p}}const Ev=y.createContext(null);function S2({children:a}){const[o,r]=y.useState(null),[i,c]=y.useState(null),[f,d]=y.useState(!0),[m,h]=y.useState(null),{events:p,connected:x,subscribe:v}=x2(),w=y.useCallback(async()=>{try{const[N,_]=await Promise.all([v2(),g2()]),E=N,C=_.nodeId??_.id,T=E.nodes??[],j=T.find(B=>B.id===C)??{id:C,name:_.name,endpoint:_.endpoint,role:_.role,status:_.status,capabilities:_.capabilities,joinedAt:_.joinedAt,lastHeartbeat:_.lastHeartbeat},D=E.leaderId?T.find(B=>B.id===E.leaderId)??null:null;r({leader:D?{id:D.id,name:D.name,endpoint:D.endpoint}:null,term:E.term??0,nodes:T,self:j,taskSummary:E.taskSummary??{total:0,pending:0,running:0,completed:0,failed:0}}),c(_),h(null)}catch(N){h(N instanceof Error?N.message:"Failed to fetch cluster state")}finally{d(!1)}},[]);return y2(w,1e4),y.useEffect(()=>{const N=[v("cluster",w),v("election",w),v("node",w),v("task",w)];return()=>N.forEach(_=>_())},[v,w]),b.jsx(Ev.Provider,{value:{cluster:o,systemInfo:i,events:p,sseConnected:x,subscribe:v,refresh:w,loading:f,error:m},children:a})}function Cv(){const a=y.useContext(Ev);if(!a)throw new Error("useCluster must be used within ClusterProvider");return a}/**
60
+ Please change the parent <Route path="${T}"> to <Route path="${T==="/"?"*":`${T}/*`}">.`)}let x=Bn(),v;if(o){let T=typeof o=="string"?bo(o):o;Fe(h==="/"||((C=T.pathname)==null?void 0:C.startsWith(h)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${h}" but pathname "${T.pathname}" was given in the \`location\` prop.`),v=T}else v=x;let w=v.pathname||"/",N=w;if(h!=="/"){let T=h.replace(/^\//,"").split("/");N="/"+w.replace(/^\//,"").split("/").slice(T.length).join("/")}let _=nv(a,{pathname:N});yn(p||_!=null,`No routes matched location "${v.pathname}${v.search}${v.hash}" `),yn(_==null||_[_.length-1].route.element!==void 0||_[_.length-1].route.Component!==void 0||_[_.length-1].route.lazy!==void 0,`Matched leaf route at location "${v.pathname}${v.search}${v.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let E=TS(_&&_.map(T=>Object.assign({},T,{params:Object.assign({},d,T.params),pathname:Ln([h,i.encodeLocation?i.encodeLocation(T.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:T.pathname]),pathnameBase:T.pathnameBase==="/"?h:Ln([h,i.encodeLocation?i.encodeLocation(T.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:T.pathnameBase])})),c,r);return o&&E?y.createElement(Ar.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...v},navigationType:"POP"}},E):E}function SS(){let a=OS(),o=rS(a)?`${a.status} ${a.statusText}`:a instanceof Error?a.message:JSON.stringify(a),r=a instanceof Error?a.stack:null,i="rgba(200,200,200, 0.5)",c={padding:"0.5rem",backgroundColor:i},f={padding:"2px 4px",backgroundColor:i},d=null;return console.error("Error handled by React Router default ErrorBoundary:",a),d=y.createElement(y.Fragment,null,y.createElement("p",null,"💿 Hey developer 👋"),y.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",y.createElement("code",{style:f},"ErrorBoundary")," or"," ",y.createElement("code",{style:f},"errorElement")," prop on your route.")),y.createElement(y.Fragment,null,y.createElement("h2",null,"Unexpected Application Error!"),y.createElement("h3",{style:{fontStyle:"italic"}},o),r?y.createElement("pre",{style:c},r):null,d)}var wS=y.createElement(SS,null),hv=class extends y.Component{constructor(a){super(a),this.state={location:a.location,revalidation:a.revalidation,error:a.error}}static getDerivedStateFromError(a){return{error:a}}static getDerivedStateFromProps(a,o){return o.location!==a.location||o.revalidation!=="idle"&&a.revalidation==="idle"?{error:a.error,location:a.location,revalidation:a.revalidation}:{error:a.error!==void 0?a.error:o.error,location:o.location,revalidation:a.revalidation||o.revalidation}}componentDidCatch(a,o){this.props.onError?this.props.onError(a,o):console.error("React Router caught the following error during render",a)}render(){let a=this.state.error;if(this.context&&typeof a=="object"&&a&&"digest"in a&&typeof a.digest=="string"){const r=pS(a.digest);r&&(a=r)}let o=a!==void 0?y.createElement(cn.Provider,{value:this.props.routeContext},y.createElement(jf.Provider,{value:a,children:this.props.component})):this.props.children;return this.context?y.createElement(ES,{error:a},o):o}};hv.contextType=uS;var Ic=new WeakMap;function ES({children:a,error:o}){let{basename:r}=y.useContext(Pt);if(typeof o=="object"&&o&&"digest"in o&&typeof o.digest=="string"){let i=hS(o.digest);if(i){let c=Ic.get(o);if(c)throw c;let f=rv(i.location,r);if(ov&&!Ic.get(o))if(f.isExternal||i.reloadDocument)window.location.href=f.absoluteURL||f.to;else{const d=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(f.to,{replace:i.replace}));throw Ic.set(o,d),d}return y.createElement("meta",{httpEquiv:"refresh",content:`0;url=${f.absoluteURL||f.to}`})}}return a}function CS({routeContext:a,match:o,children:r}){let i=y.useContext(xo);return i&&i.static&&i.staticContext&&(o.route.errorElement||o.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=o.route.id),y.createElement(cn.Provider,{value:a},r)}function TS(a,o=[],r){let i=r==null?void 0:r.state;if(a==null){if(!i)return null;if(i.errors)a=i.matches;else if(o.length===0&&!i.initialized&&i.matches.length>0)a=i.matches;else return null}let c=a,f=i==null?void 0:i.errors;if(f!=null){let x=c.findIndex(v=>v.route.id&&(f==null?void 0:f[v.route.id])!==void 0);Fe(x>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(f).join(",")}`),c=c.slice(0,Math.min(c.length,x+1))}let d=!1,m=-1;if(r&&i){d=i.renderFallback;for(let x=0;x<c.length;x++){let v=c[x];if((v.route.HydrateFallback||v.route.hydrateFallbackElement)&&(m=x),v.route.id){let{loaderData:w,errors:N}=i,_=v.route.loader&&!w.hasOwnProperty(v.route.id)&&(!N||N[v.route.id]===void 0);if(v.route.lazy||_){r.isStatic&&(d=!0),m>=0?c=c.slice(0,m+1):c=[c[0]];break}}}}let h=r==null?void 0:r.onError,p=i&&h?(x,v)=>{var w,N;h(x,{location:i.location,params:((N=(w=i.matches)==null?void 0:w[0])==null?void 0:N.params)??{},unstable_pattern:iS(i.matches),errorInfo:v})}:void 0;return c.reduceRight((x,v,w)=>{let N,_=!1,E=null,C=null;i&&(N=f&&v.route.id?f[v.route.id]:void 0,E=v.route.errorElement||wS,d&&(m<0&&w===0?(pv("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),_=!0,C=null):m===w&&(_=!0,C=v.route.hydrateFallbackElement||null)));let T=o.concat(c.slice(0,w+1)),j=()=>{let D;return N?D=E:_?D=C:v.route.Component?D=y.createElement(v.route.Component,null):v.route.element?D=v.route.element:D=x,y.createElement(CS,{match:v,routeContext:{outlet:x,matches:T,isDataRoute:i!=null},children:D})};return i&&(v.route.ErrorBoundary||v.route.errorElement||w===0)?y.createElement(hv,{location:i.location,revalidation:i.revalidation,component:E,error:N,children:j(),routeContext:{outlet:null,matches:T,isDataRoute:!0},onError:p}):j()},null)}function zf(a){return`${a} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function NS(a){let o=y.useContext(xo);return Fe(o,zf(a)),o}function RS(a){let o=y.useContext(ws);return Fe(o,zf(a)),o}function AS(a){let o=y.useContext(cn);return Fe(o,zf(a)),o}function kf(a){let o=AS(a),r=o.matches[o.matches.length-1];return Fe(r.route.id,`${a} can only be used on routes that contain a unique "id"`),r.route.id}function _S(){return kf("useRouteId")}function OS(){var i;let a=y.useContext(jf),o=RS("useRouteError"),r=kf("useRouteError");return a!==void 0?a:(i=o.errors)==null?void 0:i[r]}function MS(){let{router:a}=NS("useNavigate"),o=kf("useNavigate"),r=y.useRef(!1);return fv(()=>{r.current=!0}),y.useCallback(async(c,f={})=>{yn(r.current,cv),r.current&&(typeof c=="number"?await a.navigate(c):await a.navigate(c,{fromRouteId:o,...f}))},[a,o])}var mg={};function pv(a,o,r){!o&&!mg[a]&&(mg[a]=!0,yn(!1,r))}y.memo(DS);function DS({routes:a,future:o,state:r,isStatic:i,onError:c}){return mv(a,void 0,{state:r,isStatic:i,onError:c})}function hg({to:a,replace:o,state:r,relative:i}){Fe(So(),"<Navigate> may be used only in the context of a <Router> component.");let{static:c}=y.useContext(Pt);yn(!c,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:f}=y.useContext(cn),{pathname:d}=Bn(),m=dv(),h=Ss(a,Df(f),d,i==="path"),p=JSON.stringify(h);return y.useEffect(()=>{m(JSON.parse(p),{replace:o,state:r,relative:i})},[m,p,i,o,r]),null}function jS(a){return bS(a.context)}function po(a){Fe(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function zS({basename:a="/",children:o=null,location:r,navigationType:i="POP",navigator:c,static:f=!1,unstable_useTransitions:d}){Fe(!So(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let m=a.replace(/^\/*/,"/"),h=y.useMemo(()=>({basename:m,navigator:c,static:f,unstable_useTransitions:d,future:{}}),[m,c,f,d]);typeof r=="string"&&(r=bo(r));let{pathname:p="/",search:x="",hash:v="",state:w=null,key:N="default",unstable_mask:_}=r,E=y.useMemo(()=>{let C=ra(p,m);return C==null?null:{location:{pathname:C,search:x,hash:v,state:w,key:N,unstable_mask:_},navigationType:i}},[m,p,x,v,w,N,i,_]);return yn(E!=null,`<Router basename="${m}"> is not able to match the URL "${p}${x}${v}" because it does not start with the basename, so the <Router> won't render anything.`),E==null?null:y.createElement(Pt.Provider,{value:h},y.createElement(Ar.Provider,{children:o,value:E}))}function kS({children:a,location:o}){return xS(gf(a),o)}function gf(a,o=[]){let r=[];return y.Children.forEach(a,(i,c)=>{if(!y.isValidElement(i))return;let f=[...o,c];if(i.type===y.Fragment){r.push.apply(r,gf(i.props.children,f));return}Fe(i.type===po,`[${typeof i.type=="string"?i.type:i.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Fe(!i.props.index||!i.props.children,"An index route cannot have child routes.");let d={id:i.props.id||f.join("-"),caseSensitive:i.props.caseSensitive,element:i.props.element,Component:i.props.Component,index:i.props.index,path:i.props.path,middleware:i.props.middleware,loader:i.props.loader,action:i.props.action,hydrateFallbackElement:i.props.hydrateFallbackElement,HydrateFallback:i.props.HydrateFallback,errorElement:i.props.errorElement,ErrorBoundary:i.props.ErrorBoundary,hasErrorBoundary:i.props.hasErrorBoundary===!0||i.props.ErrorBoundary!=null||i.props.errorElement!=null,shouldRevalidate:i.props.shouldRevalidate,handle:i.props.handle,lazy:i.props.lazy};i.props.children&&(d.children=gf(i.props.children,f)),r.push(d)}),r}var os="get",rs="application/x-www-form-urlencoded";function Es(a){return typeof HTMLElement<"u"&&a instanceof HTMLElement}function LS(a){return Es(a)&&a.tagName.toLowerCase()==="button"}function US(a){return Es(a)&&a.tagName.toLowerCase()==="form"}function BS(a){return Es(a)&&a.tagName.toLowerCase()==="input"}function HS(a){return!!(a.metaKey||a.altKey||a.ctrlKey||a.shiftKey)}function VS(a,o){return a.button===0&&(!o||o==="_self")&&!HS(a)}var $i=null;function YS(){if($i===null)try{new FormData(document.createElement("form"),0),$i=!1}catch{$i=!0}return $i}var qS=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function ef(a){return a!=null&&!qS.has(a)?(yn(!1,`"${a}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${rs}"`),null):a}function GS(a,o){let r,i,c,f,d;if(US(a)){let m=a.getAttribute("action");i=m?ra(m,o):null,r=a.getAttribute("method")||os,c=ef(a.getAttribute("enctype"))||rs,f=new FormData(a)}else if(LS(a)||BS(a)&&(a.type==="submit"||a.type==="image")){let m=a.form;if(m==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let h=a.getAttribute("formaction")||m.getAttribute("action");if(i=h?ra(h,o):null,r=a.getAttribute("formmethod")||m.getAttribute("method")||os,c=ef(a.getAttribute("formenctype"))||ef(m.getAttribute("enctype"))||rs,f=new FormData(m,a),!YS()){let{name:p,type:x,value:v}=a;if(x==="image"){let w=p?`${p}.`:"";f.append(`${w}x`,"0"),f.append(`${w}y`,"0")}else p&&f.append(p,v)}}else{if(Es(a))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=os,i=null,c=rs,d=a}return f&&c==="text/plain"&&(d=f,f=void 0),{action:i,method:r.toLowerCase(),encType:c,formData:f,body:d}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Lf(a,o){if(a===!1||a===null||typeof a>"u")throw new Error(o)}function XS(a,o,r,i){let c=typeof a=="string"?new URL(a,typeof window>"u"?"server://singlefetch/":window.location.origin):a;return r?c.pathname.endsWith("/")?c.pathname=`${c.pathname}_.${i}`:c.pathname=`${c.pathname}.${i}`:c.pathname==="/"?c.pathname=`_root.${i}`:o&&ra(c.pathname,o)==="/"?c.pathname=`${o.replace(/\/$/,"")}/_root.${i}`:c.pathname=`${c.pathname.replace(/\/$/,"")}.${i}`,c}async function QS(a,o){if(a.id in o)return o[a.id];try{let r=await import(a.module);return o[a.id]=r,r}catch(r){return console.error(`Error loading route module \`${a.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function ZS(a){return a==null?!1:a.href==null?a.rel==="preload"&&typeof a.imageSrcSet=="string"&&typeof a.imageSizes=="string":typeof a.rel=="string"&&typeof a.href=="string"}async function KS(a,o,r){let i=await Promise.all(a.map(async c=>{let f=o.routes[c.route.id];if(f){let d=await QS(f,r);return d.links?d.links():[]}return[]}));return PS(i.flat(1).filter(ZS).filter(c=>c.rel==="stylesheet"||c.rel==="preload").map(c=>c.rel==="stylesheet"?{...c,rel:"prefetch",as:"style"}:{...c,rel:"prefetch"}))}function pg(a,o,r,i,c,f){let d=(h,p)=>r[p]?h.route.id!==r[p].route.id:!0,m=(h,p)=>{var x;return r[p].pathname!==h.pathname||((x=r[p].route.path)==null?void 0:x.endsWith("*"))&&r[p].params["*"]!==h.params["*"]};return f==="assets"?o.filter((h,p)=>d(h,p)||m(h,p)):f==="data"?o.filter((h,p)=>{var v;let x=i.routes[h.route.id];if(!x||!x.hasLoader)return!1;if(d(h,p)||m(h,p))return!0;if(h.route.shouldRevalidate){let w=h.route.shouldRevalidate({currentUrl:new URL(c.pathname+c.search+c.hash,window.origin),currentParams:((v=r[0])==null?void 0:v.params)||{},nextUrl:new URL(a,window.origin),nextParams:h.params,defaultShouldRevalidate:!0});if(typeof w=="boolean")return w}return!0}):[]}function $S(a,o,{includeHydrateFallback:r}={}){return JS(a.map(i=>{let c=o.routes[i.route.id];if(!c)return[];let f=[c.module];return c.clientActionModule&&(f=f.concat(c.clientActionModule)),c.clientLoaderModule&&(f=f.concat(c.clientLoaderModule)),r&&c.hydrateFallbackModule&&(f=f.concat(c.hydrateFallbackModule)),c.imports&&(f=f.concat(c.imports)),f}).flat(1))}function JS(a){return[...new Set(a)]}function FS(a){let o={},r=Object.keys(a).sort();for(let i of r)o[i]=a[i];return o}function PS(a,o){let r=new Set;return new Set(o),a.reduce((i,c)=>{let f=JSON.stringify(FS(c));return r.has(f)||(r.add(f),i.push({key:f,link:c})),i},[])}function gv(){let a=y.useContext(xo);return Lf(a,"You must render this element inside a <DataRouterContext.Provider> element"),a}function WS(){let a=y.useContext(ws);return Lf(a,"You must render this element inside a <DataRouterStateContext.Provider> element"),a}var Uf=y.createContext(void 0);Uf.displayName="FrameworkContext";function vv(){let a=y.useContext(Uf);return Lf(a,"You must render this element inside a <HydratedRouter> element"),a}function IS(a,o){let r=y.useContext(Uf),[i,c]=y.useState(!1),[f,d]=y.useState(!1),{onFocus:m,onBlur:h,onMouseEnter:p,onMouseLeave:x,onTouchStart:v}=o,w=y.useRef(null);y.useEffect(()=>{if(a==="render"&&d(!0),a==="viewport"){let E=T=>{T.forEach(j=>{d(j.isIntersecting)})},C=new IntersectionObserver(E,{threshold:.5});return w.current&&C.observe(w.current),()=>{C.disconnect()}}},[a]),y.useEffect(()=>{if(i){let E=setTimeout(()=>{d(!0)},100);return()=>{clearTimeout(E)}}},[i]);let N=()=>{c(!0)},_=()=>{c(!1),d(!1)};return r?a!=="intent"?[f,w,{}]:[f,w,{onFocus:Sr(m,N),onBlur:Sr(h,_),onMouseEnter:Sr(p,N),onMouseLeave:Sr(x,_),onTouchStart:Sr(v,N)}]:[!1,w,{}]}function Sr(a,o){return r=>{a&&a(r),r.defaultPrevented||o(r)}}function e2({page:a,...o}){let{router:r}=gv(),i=y.useMemo(()=>nv(r.routes,a,r.basename),[r.routes,a,r.basename]);return i?y.createElement(n2,{page:a,matches:i,...o}):null}function t2(a){let{manifest:o,routeModules:r}=vv(),[i,c]=y.useState([]);return y.useEffect(()=>{let f=!1;return KS(a,o,r).then(d=>{f||c(d)}),()=>{f=!0}},[a,o,r]),i}function n2({page:a,matches:o,...r}){let i=Bn(),{future:c,manifest:f,routeModules:d}=vv(),{basename:m}=gv(),{loaderData:h,matches:p}=WS(),x=y.useMemo(()=>pg(a,o,p,f,i,"data"),[a,o,p,f,i]),v=y.useMemo(()=>pg(a,o,p,f,i,"assets"),[a,o,p,f,i]),w=y.useMemo(()=>{if(a===i.pathname+i.search+i.hash)return[];let E=new Set,C=!1;if(o.forEach(j=>{var B;let D=f.routes[j.route.id];!D||!D.hasLoader||(!x.some(K=>K.route.id===j.route.id)&&j.route.id in h&&((B=d[j.route.id])!=null&&B.shouldRevalidate)||D.hasClientLoader?C=!0:E.add(j.route.id))}),E.size===0)return[];let T=XS(a,m,c.unstable_trailingSlashAwareDataRequests,"data");return C&&E.size>0&&T.searchParams.set("_routes",o.filter(j=>E.has(j.route.id)).map(j=>j.route.id).join(",")),[T.pathname+T.search]},[m,c.unstable_trailingSlashAwareDataRequests,h,i,f,x,o,a,d]),N=y.useMemo(()=>$S(v,f),[v,f]),_=t2(v);return y.createElement(y.Fragment,null,w.map(E=>y.createElement("link",{key:E,rel:"prefetch",as:"fetch",href:E,...r})),N.map(E=>y.createElement("link",{key:E,rel:"modulepreload",href:E,...r})),_.map(({key:E,link:C})=>y.createElement("link",{key:E,nonce:r.nonce,...C,crossOrigin:C.crossOrigin??r.crossOrigin})))}function a2(...a){return o=>{a.forEach(r=>{typeof r=="function"?r(o):r!=null&&(r.current=o)})}}var l2=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{l2&&(window.__reactRouterVersion="7.13.2")}catch{}function o2({basename:a,children:o,unstable_useTransitions:r,window:i}){let c=y.useRef();c.current==null&&(c.current=L1({window:i,v5Compat:!0}));let f=c.current,[d,m]=y.useState({action:f.action,location:f.location}),h=y.useCallback(p=>{r===!1?m(p):y.startTransition(()=>m(p))},[r]);return y.useLayoutEffect(()=>f.listen(h),[f,h]),y.createElement(zS,{basename:a,children:o,location:d.location,navigationType:d.action,navigator:f,unstable_useTransitions:r})}var yv=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,bv=y.forwardRef(function({onClick:o,discover:r="render",prefetch:i="none",relative:c,reloadDocument:f,replace:d,unstable_mask:m,state:h,target:p,to:x,preventScrollReset:v,viewTransition:w,unstable_defaultShouldRevalidate:N,..._},E){let{basename:C,navigator:T,unstable_useTransitions:j}=y.useContext(Pt),D=typeof x=="string"&&yv.test(x),B=rv(x,C);x=B.to;let K=gS(x,{relative:c}),F=Bn(),q=null;if(m){let ce=Ss(m,[],F.unstable_mask?F.unstable_mask.pathname:"/",!0);C!=="/"&&(ce.pathname=ce.pathname==="/"?C:Ln([C,ce.pathname])),q=T.createHref(ce)}let[V,ae,he]=IS(i,_),pe=s2(x,{replace:d,unstable_mask:m,state:h,target:p,preventScrollReset:v,relative:c,viewTransition:w,unstable_defaultShouldRevalidate:N,unstable_useTransitions:j});function fe(ce){o&&o(ce),ce.defaultPrevented||pe(ce)}let me=!(B.isExternal||f),ge=y.createElement("a",{..._,...he,href:(me?q:void 0)||B.absoluteURL||K,onClick:me?fe:o,ref:a2(E,ae),target:p,"data-discover":!D&&r==="render"?"true":void 0});return V&&!D?y.createElement(y.Fragment,null,ge,y.createElement(e2,{page:K})):ge});bv.displayName="Link";var xv=y.forwardRef(function({"aria-current":o="page",caseSensitive:r=!1,className:i="",end:c=!1,style:f,to:d,viewTransition:m,children:h,...p},x){let v=_r(d,{relative:p.relative}),w=Bn(),N=y.useContext(ws),{navigator:_,basename:E}=y.useContext(Pt),C=N!=null&&m2(v)&&m===!0,T=_.encodeLocation?_.encodeLocation(v).pathname:v.pathname,j=w.pathname,D=N&&N.navigation&&N.navigation.location?N.navigation.location.pathname:null;r||(j=j.toLowerCase(),D=D?D.toLowerCase():null,T=T.toLowerCase()),D&&E&&(D=ra(D,E)||D);const B=T!=="/"&&T.endsWith("/")?T.length-1:T.length;let K=j===T||!c&&j.startsWith(T)&&j.charAt(B)==="/",F=D!=null&&(D===T||!c&&D.startsWith(T)&&D.charAt(T.length)==="/"),q={isActive:K,isPending:F,isTransitioning:C},V=K?o:void 0,ae;typeof i=="function"?ae=i(q):ae=[i,K?"active":null,F?"pending":null,C?"transitioning":null].filter(Boolean).join(" ");let he=typeof f=="function"?f(q):f;return y.createElement(bv,{...p,"aria-current":V,className:ae,ref:x,style:he,to:d,viewTransition:m},typeof h=="function"?h(q):h)});xv.displayName="NavLink";var r2=y.forwardRef(({discover:a="render",fetcherKey:o,navigate:r,reloadDocument:i,replace:c,state:f,method:d=os,action:m,onSubmit:h,relative:p,preventScrollReset:x,viewTransition:v,unstable_defaultShouldRevalidate:w,...N},_)=>{let{unstable_useTransitions:E}=y.useContext(Pt),C=f2(),T=d2(m,{relative:p}),j=d.toLowerCase()==="get"?"get":"post",D=typeof m=="string"&&yv.test(m),B=K=>{if(h&&h(K),K.defaultPrevented)return;K.preventDefault();let F=K.nativeEvent.submitter,q=(F==null?void 0:F.getAttribute("formmethod"))||d,V=()=>C(F||K.currentTarget,{fetcherKey:o,method:q,navigate:r,replace:c,state:f,relative:p,preventScrollReset:x,viewTransition:v,unstable_defaultShouldRevalidate:w});E&&r!==!1?y.startTransition(()=>V()):V()};return y.createElement("form",{ref:_,method:j,action:T,onSubmit:i?h:B,...N,"data-discover":!D&&a==="render"?"true":void 0})});r2.displayName="Form";function i2(a){return`${a} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Sv(a){let o=y.useContext(xo);return Fe(o,i2(a)),o}function s2(a,{target:o,replace:r,unstable_mask:i,state:c,preventScrollReset:f,relative:d,viewTransition:m,unstable_defaultShouldRevalidate:h,unstable_useTransitions:p}={}){let x=dv(),v=Bn(),w=_r(a,{relative:d});return y.useCallback(N=>{if(VS(N,o)){N.preventDefault();let _=r!==void 0?r:Cr(v)===Cr(w),E=()=>x(a,{replace:_,unstable_mask:i,state:c,preventScrollReset:f,relative:d,viewTransition:m,unstable_defaultShouldRevalidate:h});p?y.startTransition(()=>E()):E()}},[v,x,w,r,i,c,o,a,f,d,m,h,p])}var u2=0,c2=()=>`__${String(++u2)}__`;function f2(){let{router:a}=Sv("useSubmit"),{basename:o}=y.useContext(Pt),r=_S(),i=a.fetch,c=a.navigate;return y.useCallback(async(f,d={})=>{let{action:m,method:h,encType:p,formData:x,body:v}=GS(f,o);if(d.navigate===!1){let w=d.fetcherKey||c2();await i(w,r,d.action||m,{unstable_defaultShouldRevalidate:d.unstable_defaultShouldRevalidate,preventScrollReset:d.preventScrollReset,formData:x,body:v,formMethod:d.method||h,formEncType:d.encType||p,flushSync:d.flushSync})}else await c(d.action||m,{unstable_defaultShouldRevalidate:d.unstable_defaultShouldRevalidate,preventScrollReset:d.preventScrollReset,formData:x,body:v,formMethod:d.method||h,formEncType:d.encType||p,replace:d.replace,state:d.state,fromRouteId:r,flushSync:d.flushSync,viewTransition:d.viewTransition})},[i,c,o,r])}function d2(a,{relative:o}={}){let{basename:r}=y.useContext(Pt),i=y.useContext(cn);Fe(i,"useFormAction must be used inside a RouteContext");let[c]=i.matches.slice(-1),f={..._r(a||".",{relative:o})},d=Bn();if(a==null){f.search=d.search;let m=new URLSearchParams(f.search),h=m.getAll("index");if(h.some(x=>x==="")){m.delete("index"),h.filter(v=>v).forEach(v=>m.append("index",v));let x=m.toString();f.search=x?`?${x}`:""}}return(!a||a===".")&&c.route.index&&(f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(f.pathname=f.pathname==="/"?r:Ln([r,f.pathname])),Cr(f)}function m2(a,{relative:o}={}){let r=y.useContext(sv);Fe(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=Sv("useViewTransitionState"),c=_r(a,{relative:o});if(!r.isTransitioning)return!1;let f=ra(r.currentLocation.pathname,i)||r.currentLocation.pathname,d=ra(r.nextLocation.pathname,i)||r.nextLocation.pathname;return ds(c.pathname,d)!=null||ds(c.pathname,f)!=null}var Or=tv();const wv=ev(Or),h2="/api";function p2(a,o){if(typeof a=="string"&&a)return a;if(a&&typeof a=="object"){const r=a,i=typeof r.error=="object"&&r.error!==null?r.error:void 0;if(typeof r.error=="string"&&r.error)return r.error;if(typeof(i==null?void 0:i.message)=="string"&&i.message)return i.message;if(typeof r.message=="string"&&r.message)return r.message}return o}async function Pe(a,o){const r=await fetch(`${h2}${a}`,{...o,headers:{"Content-Type":"application/json",...o==null?void 0:o.headers}});if(!r.ok){const i=await r.json().catch(()=>r.statusText);throw new Error(p2(i,`HTTP ${r.status}`))}return r.json()}function g2(){return Pe("/system/info")}function aA(a){return Pe("/system/transport",{method:"POST",body:JSON.stringify({type:a})})}function v2(){return Pe("/cluster/state")}function lA(){return Pe("/cluster/promote",{method:"POST"})}function oA(a){return Pe("/cluster/connect",{method:"POST",body:JSON.stringify(a)})}function rA(){return Pe("/cluster/disconnect",{method:"POST"})}function iA(a,o){return Pe(`/nodes/${a}/devtunnel`,{method:"POST",body:JSON.stringify({enabled:o})})}function sA(a,o={}){const r=new URLSearchParams;o.path&&r.set("path",o.path),o.limit!==void 0&&r.set("limit",String(Math.min(Math.max(1,o.limit),100))),o.offset!==void 0&&r.set("offset",String(Math.max(0,o.offset))),o.directoriesOnly!==void 0&&r.set("directoriesOnly",String(o.directoriesOnly)),o.allowAbsolute!==void 0&&r.set("allowAbsolute",String(o.allowAbsolute));const i=r.toString();return Pe(`/nodes/${a}/workdir/tree${i?`?${i}`:""}`)}function uA(a,o={}){const r=new URLSearchParams;o.path&&r.set("path",o.path),o.limit!==void 0&&r.set("limit",String(Math.min(Math.max(1,o.limit),20))),o.offset!==void 0&&r.set("offset",String(Math.max(0,o.offset))),o.allowAbsolute!==void 0&&r.set("allowAbsolute",String(o.allowAbsolute));const i=r.toString();return Pe(`/nodes/${a}/workdir/branch${i?`?${i}`:""}`)}function cA(a,o){return Pe(`/nodes/${a}/workdir/branch`,{method:"POST",body:JSON.stringify({path:o.path,branchName:o.branchName,startPoint:o.startPoint,limit:o.limit,offset:o.offset,allowAbsolute:o.allowAbsolute})})}async function fA(a){const o=new URLSearchParams;a!=null&&a.status&&o.set("status",a.status),a!=null&&a.assignedTo&&o.set("assignedTo",a.assignedTo),a!=null&&a.priority&&o.set("priority",a.priority);{const c=Math.min(Math.max(1,a.limit),100);o.set("limit",String(c))}a!=null&&a.offset&&o.set("offset",String(a.offset));const r=o.toString();return(await Pe(`/tasks${r?`?${r}`:""}`)).tasks}function dA(a){return Pe(`/tasks/${a}`)}function mA(a){return Pe("/tasks",{method:"POST",body:JSON.stringify(a)})}function hA(a){return Pe("/tasks/batch/delete",{method:"POST",body:JSON.stringify({ids:a})})}function pA(a){return Pe("/tasks/batch/archive",{method:"POST",body:JSON.stringify({ids:a})})}function gA(a){return Pe(`/tasks/${a}/cancel`,{method:"POST"})}function vA(a){return Pe(`/tasks/${a}/retry`,{method:"POST"})}function yA(a,o){return Pe(`/tasks/${a}/logs`)}function bA(a,o){return Pe(`/tasks/${a}/message`,{method:"POST",body:JSON.stringify({content:o})})}function xA(a){return Pe(`/tasks/${a}/output`)}function SA(a,o="."){return Pe(`/tasks/${a}/output/tree?path=${encodeURIComponent(o)}`)}function wA(a,o){return Pe(`/tasks/${a}/output/content?path=${encodeURIComponent(o)}`)}function EA(a,o){return Pe(`/tasks/${a}/output/preview-sessions`,{method:"POST",body:JSON.stringify(o?{path:o}:{})})}function CA(a){return Pe(`/tasks/${a}/output/diff`)}function y2(a,o,r=!0){const i=y.useRef(a);y.useEffect(()=>{i.current=a},[a]),y.useEffect(()=>{if(!r)return;const c=()=>i.current();c();const f=setInterval(c,o);return()=>clearInterval(f)},[o,r])}let b2=0;function x2(a=50){const[o,r]=y.useState([]),[i,c]=y.useState(!1),f=y.useRef(null),d=y.useRef(0),m=y.useRef(new Map);y.useEffect(()=>{const x=new EventSource("/api/events");f.current=x,x.onopen=()=>c(!0),x.onerror=()=>c(!1);const v=["node.joined","node.left","node.status","task.created","task.assigned","task.status","task.updated","task.deleted","task.output","election.started","election.complete","cluster.state"];for(const w of v)x.addEventListener(w,N=>{const _={id:String(++b2),type:w,data:JSON.parse(N.data),timestamp:Date.now()};r(E=>[_,...E].slice(0,a));for(const[,{pattern:E,callback:C}]of m.current)w.startsWith(E)&&C(_)});return()=>{x.close(),f.current=null,c(!1)}},[a]);const h=y.useCallback((x,v)=>{const w=++d.current;return m.current.set(w,{pattern:x,callback:v}),()=>{m.current.delete(w)}},[]),p=y.useCallback(()=>r([]),[]);return{events:o,connected:i,subscribe:h,clearEvents:p}}const Ev=y.createContext(null);function S2({children:a}){const[o,r]=y.useState(null),[i,c]=y.useState(null),[f,d]=y.useState(!0),[m,h]=y.useState(null),{events:p,connected:x,subscribe:v}=x2(),w=y.useCallback(async()=>{try{const[N,_]=await Promise.all([v2(),g2()]),E=N,C=_.nodeId??_.id,T=E.nodes??[],j=T.find(B=>B.id===C)??{id:C,name:_.name,endpoint:_.endpoint,role:_.role,status:_.status,capabilities:_.capabilities,joinedAt:_.joinedAt,lastHeartbeat:_.lastHeartbeat},D=E.leaderId?T.find(B=>B.id===E.leaderId)??null:null;r({leader:D?{id:D.id,name:D.name,endpoint:D.endpoint}:null,term:E.term??0,nodes:T,self:j,taskSummary:E.taskSummary??{total:0,pending:0,running:0,completed:0,failed:0}}),c(_),h(null)}catch(N){h(N instanceof Error?N.message:"Failed to fetch cluster state")}finally{d(!1)}},[]);return y2(w,1e4),y.useEffect(()=>{const N=[v("cluster",w),v("election",w),v("node",w),v("task",w)];return()=>N.forEach(_=>_())},[v,w]),b.jsx(Ev.Provider,{value:{cluster:o,systemInfo:i,events:p,sseConnected:x,subscribe:v,refresh:w,loading:f,error:m},children:a})}function Cv(){const a=y.useContext(Ev);if(!a)throw new Error("useCluster must be used within ClusterProvider");return a}/**
61
61
  * @license lucide-react v1.7.0 - ISC
62
62
  *
63
63
  * This source code is licensed under the ISC license.
@@ -246,4 +246,4 @@ Please change the parent <Route path="${T}"> to <Route path="${T==="/"?"*":`${T}
246
246
 
247
247
  If you want to hide the \`${o.titleName}\`, you can wrap it with our VisuallyHidden component.
248
248
 
249
- For more information, see https://radix-ui.com/primitives/docs/components/${o.docsSlug}`;return y.useEffect(()=>{a&&(document.getElementById(a)||console.error(r))},[r,a]),null},ZC="DialogDescriptionWarning",KC=({contentRef:a,descriptionId:o})=>{const i=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Cy(ZC).contentName}}.`;return y.useEffect(()=>{var f;const c=(f=a.current)==null?void 0:f.getAttribute("aria-describedby");o&&c&&(document.getElementById(o)||console.warn(i))},[i,a,o]),null},$C=cy,JC=dy,FC=hy,Ty=py,Ny=gy,Ry=yy,Ay=xy,_y=wy;const PC=$C,WC=JC,IC=FC,OA=_y,Oy=y.forwardRef(({className:a,...o},r)=>b.jsx(Ty,{ref:r,className:Be("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",a),...o}));Oy.displayName=Ty.displayName;const My=y.forwardRef(({className:a,children:o,...r},i)=>b.jsxs(IC,{children:[b.jsx(Oy,{}),b.jsxs(Ny,{ref:i,className:Be("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",a),...r,children:[o,b.jsxs(_y,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[b.jsx(hw,{className:"h-4 w-4"}),b.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));My.displayName=Ny.displayName;const Dy=({className:a,...o})=>b.jsx("div",{className:Be("flex flex-col space-y-1.5 text-center sm:text-left",a),...o});Dy.displayName="DialogHeader";const eT=({className:a,...o})=>b.jsx("div",{className:Be("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",a),...o});eT.displayName="DialogFooter";const jy=y.forwardRef(({className:a,...o},r)=>b.jsx(Ry,{ref:r,className:Be("text-lg font-semibold leading-none tracking-tight",a),...o}));jy.displayName=Ry.displayName;const zy=y.forwardRef(({className:a,...o},r)=>b.jsx(Ay,{ref:r,className:Be("text-sm text-muted-foreground",a),...o}));zy.displayName=Ay.displayName;function Bg(a,[o,r]){return Math.min(r,Math.max(o,a))}function ky(a){const o=a+"CollectionProvider",[r,i]=wo(o),[c,f]=r(o,{collectionRef:{current:null},itemMap:new Map}),d=E=>{const{scope:C,children:T}=E,j=I.useRef(null),D=I.useRef(new Map).current;return b.jsx(c,{scope:C,itemMap:D,collectionRef:j,children:T})};d.displayName=o;const m=a+"CollectionSlot",h=Nr(m),p=I.forwardRef((E,C)=>{const{scope:T,children:j}=E,D=f(m,T),B=nt(C,D.collectionRef);return b.jsx(h,{ref:B,children:j})});p.displayName=m;const x=a+"CollectionItemSlot",v="data-radix-collection-item",w=Nr(x),N=I.forwardRef((E,C)=>{const{scope:T,children:j,...D}=E,B=I.useRef(null),K=nt(C,B),F=f(x,T);return I.useEffect(()=>(F.itemMap.set(B,{ref:B,...D}),()=>void F.itemMap.delete(B))),b.jsx(w,{[v]:"",ref:K,children:j})});N.displayName=x;function _(E){const C=f(a+"CollectionConsumer",E);return I.useCallback(()=>{const j=C.collectionRef.current;if(!j)return[];const D=Array.from(j.querySelectorAll(`[${v}]`));return Array.from(C.itemMap.values()).sort((F,q)=>D.indexOf(F.ref.current)-D.indexOf(q.ref.current))},[C.collectionRef,C.itemMap])}return[{Provider:d,Slot:p,ItemSlot:N},_,i]}var tT=y.createContext(void 0);function Jf(a){const o=y.useContext(tT);return a||o||"ltr"}const nT=["top","right","bottom","left"],qa=Math.min,Jt=Math.max,gs=Math.round,ns=Math.floor,Un=a=>({x:a,y:a}),aT={left:"right",right:"left",bottom:"top",top:"bottom"};function xf(a,o,r){return Jt(a,qa(o,r))}function ia(a,o){return typeof a=="function"?a(o):a}function sa(a){return a.split("-")[0]}function Eo(a){return a.split("-")[1]}function Ff(a){return a==="x"?"y":"x"}function Pf(a){return a==="y"?"height":"width"}function kn(a){const o=a[0];return o==="t"||o==="b"?"y":"x"}function Wf(a){return Ff(kn(a))}function lT(a,o,r){r===void 0&&(r=!1);const i=Eo(a),c=Wf(a),f=Pf(c);let d=c==="x"?i===(r?"end":"start")?"right":"left":i==="start"?"bottom":"top";return o.reference[f]>o.floating[f]&&(d=vs(d)),[d,vs(d)]}function oT(a){const o=vs(a);return[Sf(a),o,Sf(o)]}function Sf(a){return a.includes("start")?a.replace("start","end"):a.replace("end","start")}const Hg=["left","right"],Vg=["right","left"],rT=["top","bottom"],iT=["bottom","top"];function sT(a,o,r){switch(a){case"top":case"bottom":return r?o?Vg:Hg:o?Hg:Vg;case"left":case"right":return o?rT:iT;default:return[]}}function uT(a,o,r,i){const c=Eo(a);let f=sT(sa(a),r==="start",i);return c&&(f=f.map(d=>d+"-"+c),o&&(f=f.concat(f.map(Sf)))),f}function vs(a){const o=sa(a);return aT[o]+a.slice(o.length)}function cT(a){return{top:0,right:0,bottom:0,left:0,...a}}function Ly(a){return typeof a!="number"?cT(a):{top:a,right:a,bottom:a,left:a}}function ys(a){const{x:o,y:r,width:i,height:c}=a;return{width:i,height:c,top:r,left:o,right:o+i,bottom:r+c,x:o,y:r}}function Yg(a,o,r){let{reference:i,floating:c}=a;const f=kn(o),d=Wf(o),m=Pf(d),h=sa(o),p=f==="y",x=i.x+i.width/2-c.width/2,v=i.y+i.height/2-c.height/2,w=i[m]/2-c[m]/2;let N;switch(h){case"top":N={x,y:i.y-c.height};break;case"bottom":N={x,y:i.y+i.height};break;case"right":N={x:i.x+i.width,y:v};break;case"left":N={x:i.x-c.width,y:v};break;default:N={x:i.x,y:i.y}}switch(Eo(o)){case"start":N[d]-=w*(r&&p?-1:1);break;case"end":N[d]+=w*(r&&p?-1:1);break}return N}async function fT(a,o){var r;o===void 0&&(o={});const{x:i,y:c,platform:f,rects:d,elements:m,strategy:h}=a,{boundary:p="clippingAncestors",rootBoundary:x="viewport",elementContext:v="floating",altBoundary:w=!1,padding:N=0}=ia(o,a),_=Ly(N),C=m[w?v==="floating"?"reference":"floating":v],T=ys(await f.getClippingRect({element:(r=await(f.isElement==null?void 0:f.isElement(C)))==null||r?C:C.contextElement||await(f.getDocumentElement==null?void 0:f.getDocumentElement(m.floating)),boundary:p,rootBoundary:x,strategy:h})),j=v==="floating"?{x:i,y:c,width:d.floating.width,height:d.floating.height}:d.reference,D=await(f.getOffsetParent==null?void 0:f.getOffsetParent(m.floating)),B=await(f.isElement==null?void 0:f.isElement(D))?await(f.getScale==null?void 0:f.getScale(D))||{x:1,y:1}:{x:1,y:1},K=ys(f.convertOffsetParentRelativeRectToViewportRelativeRect?await f.convertOffsetParentRelativeRectToViewportRelativeRect({elements:m,rect:j,offsetParent:D,strategy:h}):j);return{top:(T.top-K.top+_.top)/B.y,bottom:(K.bottom-T.bottom+_.bottom)/B.y,left:(T.left-K.left+_.left)/B.x,right:(K.right-T.right+_.right)/B.x}}const dT=50,mT=async(a,o,r)=>{const{placement:i="bottom",strategy:c="absolute",middleware:f=[],platform:d}=r,m=d.detectOverflow?d:{...d,detectOverflow:fT},h=await(d.isRTL==null?void 0:d.isRTL(o));let p=await d.getElementRects({reference:a,floating:o,strategy:c}),{x,y:v}=Yg(p,i,h),w=i,N=0;const _={};for(let E=0;E<f.length;E++){const C=f[E];if(!C)continue;const{name:T,fn:j}=C,{x:D,y:B,data:K,reset:F}=await j({x,y:v,initialPlacement:i,placement:w,strategy:c,middlewareData:_,rects:p,platform:m,elements:{reference:a,floating:o}});x=D??x,v=B??v,_[T]={..._[T],...K},F&&N<dT&&(N++,typeof F=="object"&&(F.placement&&(w=F.placement),F.rects&&(p=F.rects===!0?await d.getElementRects({reference:a,floating:o,strategy:c}):F.rects),{x,y:v}=Yg(p,w,h)),E=-1)}return{x,y:v,placement:w,strategy:c,middlewareData:_}},hT=a=>({name:"arrow",options:a,async fn(o){const{x:r,y:i,placement:c,rects:f,platform:d,elements:m,middlewareData:h}=o,{element:p,padding:x=0}=ia(a,o)||{};if(p==null)return{};const v=Ly(x),w={x:r,y:i},N=Wf(c),_=Pf(N),E=await d.getDimensions(p),C=N==="y",T=C?"top":"left",j=C?"bottom":"right",D=C?"clientHeight":"clientWidth",B=f.reference[_]+f.reference[N]-w[N]-f.floating[_],K=w[N]-f.reference[N],F=await(d.getOffsetParent==null?void 0:d.getOffsetParent(p));let q=F?F[D]:0;(!q||!await(d.isElement==null?void 0:d.isElement(F)))&&(q=m.floating[D]||f.floating[_]);const V=B/2-K/2,ae=q/2-E[_]/2-1,he=qa(v[T],ae),pe=qa(v[j],ae),fe=he,me=q-E[_]-pe,ge=q/2-E[_]/2+V,ce=xf(fe,ge,me),O=!h.arrow&&Eo(c)!=null&&ge!==ce&&f.reference[_]/2-(ge<fe?he:pe)-E[_]/2<0,Y=O?ge<fe?ge-fe:ge-me:0;return{[N]:w[N]+Y,data:{[N]:ce,centerOffset:ge-ce-Y,...O&&{alignmentOffset:Y}},reset:O}}}),pT=function(a){return a===void 0&&(a={}),{name:"flip",options:a,async fn(o){var r,i;const{placement:c,middlewareData:f,rects:d,initialPlacement:m,platform:h,elements:p}=o,{mainAxis:x=!0,crossAxis:v=!0,fallbackPlacements:w,fallbackStrategy:N="bestFit",fallbackAxisSideDirection:_="none",flipAlignment:E=!0,...C}=ia(a,o);if((r=f.arrow)!=null&&r.alignmentOffset)return{};const T=sa(c),j=kn(m),D=sa(m)===m,B=await(h.isRTL==null?void 0:h.isRTL(p.floating)),K=w||(D||!E?[vs(m)]:oT(m)),F=_!=="none";!w&&F&&K.push(...uT(m,E,_,B));const q=[m,...K],V=await h.detectOverflow(o,C),ae=[];let he=((i=f.flip)==null?void 0:i.overflows)||[];if(x&&ae.push(V[T]),v){const ge=lT(c,d,B);ae.push(V[ge[0]],V[ge[1]])}if(he=[...he,{placement:c,overflows:ae}],!ae.every(ge=>ge<=0)){var pe,fe;const ge=(((pe=f.flip)==null?void 0:pe.index)||0)+1,ce=q[ge];if(ce&&(!(v==="alignment"?j!==kn(ce):!1)||he.every(J=>kn(J.placement)===j?J.overflows[0]>0:!0)))return{data:{index:ge,overflows:he},reset:{placement:ce}};let O=(fe=he.filter(Y=>Y.overflows[0]<=0).sort((Y,J)=>Y.overflows[1]-J.overflows[1])[0])==null?void 0:fe.placement;if(!O)switch(N){case"bestFit":{var me;const Y=(me=he.filter(J=>{if(F){const le=kn(J.placement);return le===j||le==="y"}return!0}).map(J=>[J.placement,J.overflows.filter(le=>le>0).reduce((le,P)=>le+P,0)]).sort((J,le)=>J[1]-le[1])[0])==null?void 0:me[0];Y&&(O=Y);break}case"initialPlacement":O=m;break}if(c!==O)return{reset:{placement:O}}}return{}}}};function qg(a,o){return{top:a.top-o.height,right:a.right-o.width,bottom:a.bottom-o.height,left:a.left-o.width}}function Gg(a){return nT.some(o=>a[o]>=0)}const gT=function(a){return a===void 0&&(a={}),{name:"hide",options:a,async fn(o){const{rects:r,platform:i}=o,{strategy:c="referenceHidden",...f}=ia(a,o);switch(c){case"referenceHidden":{const d=await i.detectOverflow(o,{...f,elementContext:"reference"}),m=qg(d,r.reference);return{data:{referenceHiddenOffsets:m,referenceHidden:Gg(m)}}}case"escaped":{const d=await i.detectOverflow(o,{...f,altBoundary:!0}),m=qg(d,r.floating);return{data:{escapedOffsets:m,escaped:Gg(m)}}}default:return{}}}}},Uy=new Set(["left","top"]);async function vT(a,o){const{placement:r,platform:i,elements:c}=a,f=await(i.isRTL==null?void 0:i.isRTL(c.floating)),d=sa(r),m=Eo(r),h=kn(r)==="y",p=Uy.has(d)?-1:1,x=f&&h?-1:1,v=ia(o,a);let{mainAxis:w,crossAxis:N,alignmentAxis:_}=typeof v=="number"?{mainAxis:v,crossAxis:0,alignmentAxis:null}:{mainAxis:v.mainAxis||0,crossAxis:v.crossAxis||0,alignmentAxis:v.alignmentAxis};return m&&typeof _=="number"&&(N=m==="end"?_*-1:_),h?{x:N*x,y:w*p}:{x:w*p,y:N*x}}const yT=function(a){return a===void 0&&(a=0),{name:"offset",options:a,async fn(o){var r,i;const{x:c,y:f,placement:d,middlewareData:m}=o,h=await vT(o,a);return d===((r=m.offset)==null?void 0:r.placement)&&(i=m.arrow)!=null&&i.alignmentOffset?{}:{x:c+h.x,y:f+h.y,data:{...h,placement:d}}}}},bT=function(a){return a===void 0&&(a={}),{name:"shift",options:a,async fn(o){const{x:r,y:i,placement:c,platform:f}=o,{mainAxis:d=!0,crossAxis:m=!1,limiter:h={fn:T=>{let{x:j,y:D}=T;return{x:j,y:D}}},...p}=ia(a,o),x={x:r,y:i},v=await f.detectOverflow(o,p),w=kn(sa(c)),N=Ff(w);let _=x[N],E=x[w];if(d){const T=N==="y"?"top":"left",j=N==="y"?"bottom":"right",D=_+v[T],B=_-v[j];_=xf(D,_,B)}if(m){const T=w==="y"?"top":"left",j=w==="y"?"bottom":"right",D=E+v[T],B=E-v[j];E=xf(D,E,B)}const C=h.fn({...o,[N]:_,[w]:E});return{...C,data:{x:C.x-r,y:C.y-i,enabled:{[N]:d,[w]:m}}}}}},xT=function(a){return a===void 0&&(a={}),{options:a,fn(o){const{x:r,y:i,placement:c,rects:f,middlewareData:d}=o,{offset:m=0,mainAxis:h=!0,crossAxis:p=!0}=ia(a,o),x={x:r,y:i},v=kn(c),w=Ff(v);let N=x[w],_=x[v];const E=ia(m,o),C=typeof E=="number"?{mainAxis:E,crossAxis:0}:{mainAxis:0,crossAxis:0,...E};if(h){const D=w==="y"?"height":"width",B=f.reference[w]-f.floating[D]+C.mainAxis,K=f.reference[w]+f.reference[D]-C.mainAxis;N<B?N=B:N>K&&(N=K)}if(p){var T,j;const D=w==="y"?"width":"height",B=Uy.has(sa(c)),K=f.reference[v]-f.floating[D]+(B&&((T=d.offset)==null?void 0:T[v])||0)+(B?0:C.crossAxis),F=f.reference[v]+f.reference[D]+(B?0:((j=d.offset)==null?void 0:j[v])||0)-(B?C.crossAxis:0);_<K?_=K:_>F&&(_=F)}return{[w]:N,[v]:_}}}},ST=function(a){return a===void 0&&(a={}),{name:"size",options:a,async fn(o){var r,i;const{placement:c,rects:f,platform:d,elements:m}=o,{apply:h=()=>{},...p}=ia(a,o),x=await d.detectOverflow(o,p),v=sa(c),w=Eo(c),N=kn(c)==="y",{width:_,height:E}=f.floating;let C,T;v==="top"||v==="bottom"?(C=v,T=w===(await(d.isRTL==null?void 0:d.isRTL(m.floating))?"start":"end")?"left":"right"):(T=v,C=w==="end"?"top":"bottom");const j=E-x.top-x.bottom,D=_-x.left-x.right,B=qa(E-x[C],j),K=qa(_-x[T],D),F=!o.middlewareData.shift;let q=B,V=K;if((r=o.middlewareData.shift)!=null&&r.enabled.x&&(V=D),(i=o.middlewareData.shift)!=null&&i.enabled.y&&(q=j),F&&!w){const he=Jt(x.left,0),pe=Jt(x.right,0),fe=Jt(x.top,0),me=Jt(x.bottom,0);N?V=_-2*(he!==0||pe!==0?he+pe:Jt(x.left,x.right)):q=E-2*(fe!==0||me!==0?fe+me:Jt(x.top,x.bottom))}await h({...o,availableWidth:V,availableHeight:q});const ae=await d.getDimensions(m.floating);return _!==ae.width||E!==ae.height?{reset:{rects:!0}}:{}}}};function Ns(){return typeof window<"u"}function Co(a){return By(a)?(a.nodeName||"").toLowerCase():"#document"}function Ft(a){var o;return(a==null||(o=a.ownerDocument)==null?void 0:o.defaultView)||window}function Hn(a){var o;return(o=(By(a)?a.ownerDocument:a.document)||window.document)==null?void 0:o.documentElement}function By(a){return Ns()?a instanceof Node||a instanceof Ft(a).Node:!1}function bn(a){return Ns()?a instanceof Element||a instanceof Ft(a).Element:!1}function ua(a){return Ns()?a instanceof HTMLElement||a instanceof Ft(a).HTMLElement:!1}function Xg(a){return!Ns()||typeof ShadowRoot>"u"?!1:a instanceof ShadowRoot||a instanceof Ft(a).ShadowRoot}function Dr(a){const{overflow:o,overflowX:r,overflowY:i,display:c}=xn(a);return/auto|scroll|overlay|hidden|clip/.test(o+i+r)&&c!=="inline"&&c!=="contents"}function wT(a){return/^(table|td|th)$/.test(Co(a))}function Rs(a){try{if(a.matches(":popover-open"))return!0}catch{}try{return a.matches(":modal")}catch{return!1}}const ET=/transform|translate|scale|rotate|perspective|filter/,CT=/paint|layout|strict|content/,vl=a=>!!a&&a!=="none";let ff;function If(a){const o=bn(a)?xn(a):a;return vl(o.transform)||vl(o.translate)||vl(o.scale)||vl(o.rotate)||vl(o.perspective)||!ed()&&(vl(o.backdropFilter)||vl(o.filter))||ET.test(o.willChange||"")||CT.test(o.contain||"")}function TT(a){let o=Ga(a);for(;ua(o)&&!yo(o);){if(If(o))return o;if(Rs(o))return null;o=Ga(o)}return null}function ed(){return ff==null&&(ff=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),ff}function yo(a){return/^(html|body|#document)$/.test(Co(a))}function xn(a){return Ft(a).getComputedStyle(a)}function As(a){return bn(a)?{scrollLeft:a.scrollLeft,scrollTop:a.scrollTop}:{scrollLeft:a.scrollX,scrollTop:a.scrollY}}function Ga(a){if(Co(a)==="html")return a;const o=a.assignedSlot||a.parentNode||Xg(a)&&a.host||Hn(a);return Xg(o)?o.host:o}function Hy(a){const o=Ga(a);return yo(o)?a.ownerDocument?a.ownerDocument.body:a.body:ua(o)&&Dr(o)?o:Hy(o)}function Rr(a,o,r){var i;o===void 0&&(o=[]),r===void 0&&(r=!0);const c=Hy(a),f=c===((i=a.ownerDocument)==null?void 0:i.body),d=Ft(c);if(f){const m=wf(d);return o.concat(d,d.visualViewport||[],Dr(c)?c:[],m&&r?Rr(m):[])}else return o.concat(c,Rr(c,[],r))}function wf(a){return a.parent&&Object.getPrototypeOf(a.parent)?a.frameElement:null}function Vy(a){const o=xn(a);let r=parseFloat(o.width)||0,i=parseFloat(o.height)||0;const c=ua(a),f=c?a.offsetWidth:r,d=c?a.offsetHeight:i,m=gs(r)!==f||gs(i)!==d;return m&&(r=f,i=d),{width:r,height:i,$:m}}function td(a){return bn(a)?a:a.contextElement}function vo(a){const o=td(a);if(!ua(o))return Un(1);const r=o.getBoundingClientRect(),{width:i,height:c,$:f}=Vy(o);let d=(f?gs(r.width):r.width)/i,m=(f?gs(r.height):r.height)/c;return(!d||!Number.isFinite(d))&&(d=1),(!m||!Number.isFinite(m))&&(m=1),{x:d,y:m}}const NT=Un(0);function Yy(a){const o=Ft(a);return!ed()||!o.visualViewport?NT:{x:o.visualViewport.offsetLeft,y:o.visualViewport.offsetTop}}function RT(a,o,r){return o===void 0&&(o=!1),!r||o&&r!==Ft(a)?!1:o}function xl(a,o,r,i){o===void 0&&(o=!1),r===void 0&&(r=!1);const c=a.getBoundingClientRect(),f=td(a);let d=Un(1);o&&(i?bn(i)&&(d=vo(i)):d=vo(a));const m=RT(f,r,i)?Yy(f):Un(0);let h=(c.left+m.x)/d.x,p=(c.top+m.y)/d.y,x=c.width/d.x,v=c.height/d.y;if(f){const w=Ft(f),N=i&&bn(i)?Ft(i):i;let _=w,E=wf(_);for(;E&&i&&N!==_;){const C=vo(E),T=E.getBoundingClientRect(),j=xn(E),D=T.left+(E.clientLeft+parseFloat(j.paddingLeft))*C.x,B=T.top+(E.clientTop+parseFloat(j.paddingTop))*C.y;h*=C.x,p*=C.y,x*=C.x,v*=C.y,h+=D,p+=B,_=Ft(E),E=wf(_)}}return ys({width:x,height:v,x:h,y:p})}function _s(a,o){const r=As(a).scrollLeft;return o?o.left+r:xl(Hn(a)).left+r}function qy(a,o){const r=a.getBoundingClientRect(),i=r.left+o.scrollLeft-_s(a,r),c=r.top+o.scrollTop;return{x:i,y:c}}function AT(a){let{elements:o,rect:r,offsetParent:i,strategy:c}=a;const f=c==="fixed",d=Hn(i),m=o?Rs(o.floating):!1;if(i===d||m&&f)return r;let h={scrollLeft:0,scrollTop:0},p=Un(1);const x=Un(0),v=ua(i);if((v||!v&&!f)&&((Co(i)!=="body"||Dr(d))&&(h=As(i)),v)){const N=xl(i);p=vo(i),x.x=N.x+i.clientLeft,x.y=N.y+i.clientTop}const w=d&&!v&&!f?qy(d,h):Un(0);return{width:r.width*p.x,height:r.height*p.y,x:r.x*p.x-h.scrollLeft*p.x+x.x+w.x,y:r.y*p.y-h.scrollTop*p.y+x.y+w.y}}function _T(a){return Array.from(a.getClientRects())}function OT(a){const o=Hn(a),r=As(a),i=a.ownerDocument.body,c=Jt(o.scrollWidth,o.clientWidth,i.scrollWidth,i.clientWidth),f=Jt(o.scrollHeight,o.clientHeight,i.scrollHeight,i.clientHeight);let d=-r.scrollLeft+_s(a);const m=-r.scrollTop;return xn(i).direction==="rtl"&&(d+=Jt(o.clientWidth,i.clientWidth)-c),{width:c,height:f,x:d,y:m}}const Qg=25;function MT(a,o){const r=Ft(a),i=Hn(a),c=r.visualViewport;let f=i.clientWidth,d=i.clientHeight,m=0,h=0;if(c){f=c.width,d=c.height;const x=ed();(!x||x&&o==="fixed")&&(m=c.offsetLeft,h=c.offsetTop)}const p=_s(i);if(p<=0){const x=i.ownerDocument,v=x.body,w=getComputedStyle(v),N=x.compatMode==="CSS1Compat"&&parseFloat(w.marginLeft)+parseFloat(w.marginRight)||0,_=Math.abs(i.clientWidth-v.clientWidth-N);_<=Qg&&(f-=_)}else p<=Qg&&(f+=p);return{width:f,height:d,x:m,y:h}}function DT(a,o){const r=xl(a,!0,o==="fixed"),i=r.top+a.clientTop,c=r.left+a.clientLeft,f=ua(a)?vo(a):Un(1),d=a.clientWidth*f.x,m=a.clientHeight*f.y,h=c*f.x,p=i*f.y;return{width:d,height:m,x:h,y:p}}function Zg(a,o,r){let i;if(o==="viewport")i=MT(a,r);else if(o==="document")i=OT(Hn(a));else if(bn(o))i=DT(o,r);else{const c=Yy(a);i={x:o.x-c.x,y:o.y-c.y,width:o.width,height:o.height}}return ys(i)}function Gy(a,o){const r=Ga(a);return r===o||!bn(r)||yo(r)?!1:xn(r).position==="fixed"||Gy(r,o)}function jT(a,o){const r=o.get(a);if(r)return r;let i=Rr(a,[],!1).filter(m=>bn(m)&&Co(m)!=="body"),c=null;const f=xn(a).position==="fixed";let d=f?Ga(a):a;for(;bn(d)&&!yo(d);){const m=xn(d),h=If(d);!h&&m.position==="fixed"&&(c=null),(f?!h&&!c:!h&&m.position==="static"&&!!c&&(c.position==="absolute"||c.position==="fixed")||Dr(d)&&!h&&Gy(a,d))?i=i.filter(x=>x!==d):c=m,d=Ga(d)}return o.set(a,i),i}function zT(a){let{element:o,boundary:r,rootBoundary:i,strategy:c}=a;const d=[...r==="clippingAncestors"?Rs(o)?[]:jT(o,this._c):[].concat(r),i],m=Zg(o,d[0],c);let h=m.top,p=m.right,x=m.bottom,v=m.left;for(let w=1;w<d.length;w++){const N=Zg(o,d[w],c);h=Jt(N.top,h),p=qa(N.right,p),x=qa(N.bottom,x),v=Jt(N.left,v)}return{width:p-v,height:x-h,x:v,y:h}}function kT(a){const{width:o,height:r}=Vy(a);return{width:o,height:r}}function LT(a,o,r){const i=ua(o),c=Hn(o),f=r==="fixed",d=xl(a,!0,f,o);let m={scrollLeft:0,scrollTop:0};const h=Un(0);function p(){h.x=_s(c)}if(i||!i&&!f)if((Co(o)!=="body"||Dr(c))&&(m=As(o)),i){const N=xl(o,!0,f,o);h.x=N.x+o.clientLeft,h.y=N.y+o.clientTop}else c&&p();f&&!i&&c&&p();const x=c&&!i&&!f?qy(c,m):Un(0),v=d.left+m.scrollLeft-h.x-x.x,w=d.top+m.scrollTop-h.y-x.y;return{x:v,y:w,width:d.width,height:d.height}}function df(a){return xn(a).position==="static"}function Kg(a,o){if(!ua(a)||xn(a).position==="fixed")return null;if(o)return o(a);let r=a.offsetParent;return Hn(a)===r&&(r=r.ownerDocument.body),r}function Xy(a,o){const r=Ft(a);if(Rs(a))return r;if(!ua(a)){let c=Ga(a);for(;c&&!yo(c);){if(bn(c)&&!df(c))return c;c=Ga(c)}return r}let i=Kg(a,o);for(;i&&wT(i)&&df(i);)i=Kg(i,o);return i&&yo(i)&&df(i)&&!If(i)?r:i||TT(a)||r}const UT=async function(a){const o=this.getOffsetParent||Xy,r=this.getDimensions,i=await r(a.floating);return{reference:LT(a.reference,await o(a.floating),a.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function BT(a){return xn(a).direction==="rtl"}const HT={convertOffsetParentRelativeRectToViewportRelativeRect:AT,getDocumentElement:Hn,getClippingRect:zT,getOffsetParent:Xy,getElementRects:UT,getClientRects:_T,getDimensions:kT,getScale:vo,isElement:bn,isRTL:BT};function Qy(a,o){return a.x===o.x&&a.y===o.y&&a.width===o.width&&a.height===o.height}function VT(a,o){let r=null,i;const c=Hn(a);function f(){var m;clearTimeout(i),(m=r)==null||m.disconnect(),r=null}function d(m,h){m===void 0&&(m=!1),h===void 0&&(h=1),f();const p=a.getBoundingClientRect(),{left:x,top:v,width:w,height:N}=p;if(m||o(),!w||!N)return;const _=ns(v),E=ns(c.clientWidth-(x+w)),C=ns(c.clientHeight-(v+N)),T=ns(x),D={rootMargin:-_+"px "+-E+"px "+-C+"px "+-T+"px",threshold:Jt(0,qa(1,h))||1};let B=!0;function K(F){const q=F[0].intersectionRatio;if(q!==h){if(!B)return d();q?d(!1,q):i=setTimeout(()=>{d(!1,1e-7)},1e3)}q===1&&!Qy(p,a.getBoundingClientRect())&&d(),B=!1}try{r=new IntersectionObserver(K,{...D,root:c.ownerDocument})}catch{r=new IntersectionObserver(K,D)}r.observe(a)}return d(!0),f}function YT(a,o,r,i){i===void 0&&(i={});const{ancestorScroll:c=!0,ancestorResize:f=!0,elementResize:d=typeof ResizeObserver=="function",layoutShift:m=typeof IntersectionObserver=="function",animationFrame:h=!1}=i,p=td(a),x=c||f?[...p?Rr(p):[],...o?Rr(o):[]]:[];x.forEach(T=>{c&&T.addEventListener("scroll",r,{passive:!0}),f&&T.addEventListener("resize",r)});const v=p&&m?VT(p,r):null;let w=-1,N=null;d&&(N=new ResizeObserver(T=>{let[j]=T;j&&j.target===p&&N&&o&&(N.unobserve(o),cancelAnimationFrame(w),w=requestAnimationFrame(()=>{var D;(D=N)==null||D.observe(o)})),r()}),p&&!h&&N.observe(p),o&&N.observe(o));let _,E=h?xl(a):null;h&&C();function C(){const T=xl(a);E&&!Qy(E,T)&&r(),E=T,_=requestAnimationFrame(C)}return r(),()=>{var T;x.forEach(j=>{c&&j.removeEventListener("scroll",r),f&&j.removeEventListener("resize",r)}),v==null||v(),(T=N)==null||T.disconnect(),N=null,h&&cancelAnimationFrame(_)}}const qT=yT,GT=bT,XT=pT,QT=ST,ZT=gT,$g=hT,KT=xT,$T=(a,o,r)=>{const i=new Map,c={platform:HT,...r},f={...c.platform,_c:i};return mT(a,o,{...c,platform:f})};var JT=typeof document<"u",FT=function(){},us=JT?y.useLayoutEffect:FT;function bs(a,o){if(a===o)return!0;if(typeof a!=typeof o)return!1;if(typeof a=="function"&&a.toString()===o.toString())return!0;let r,i,c;if(a&&o&&typeof a=="object"){if(Array.isArray(a)){if(r=a.length,r!==o.length)return!1;for(i=r;i--!==0;)if(!bs(a[i],o[i]))return!1;return!0}if(c=Object.keys(a),r=c.length,r!==Object.keys(o).length)return!1;for(i=r;i--!==0;)if(!{}.hasOwnProperty.call(o,c[i]))return!1;for(i=r;i--!==0;){const f=c[i];if(!(f==="_owner"&&a.$$typeof)&&!bs(a[f],o[f]))return!1}return!0}return a!==a&&o!==o}function Zy(a){return typeof window>"u"?1:(a.ownerDocument.defaultView||window).devicePixelRatio||1}function Jg(a,o){const r=Zy(a);return Math.round(o*r)/r}function mf(a){const o=y.useRef(a);return us(()=>{o.current=a}),o}function PT(a){a===void 0&&(a={});const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:c,elements:{reference:f,floating:d}={},transform:m=!0,whileElementsMounted:h,open:p}=a,[x,v]=y.useState({x:0,y:0,strategy:r,placement:o,middlewareData:{},isPositioned:!1}),[w,N]=y.useState(i);bs(w,i)||N(i);const[_,E]=y.useState(null),[C,T]=y.useState(null),j=y.useCallback(J=>{J!==F.current&&(F.current=J,E(J))},[]),D=y.useCallback(J=>{J!==q.current&&(q.current=J,T(J))},[]),B=f||_,K=d||C,F=y.useRef(null),q=y.useRef(null),V=y.useRef(x),ae=h!=null,he=mf(h),pe=mf(c),fe=mf(p),me=y.useCallback(()=>{if(!F.current||!q.current)return;const J={placement:o,strategy:r,middleware:w};pe.current&&(J.platform=pe.current),$T(F.current,q.current,J).then(le=>{const P={...le,isPositioned:fe.current!==!1};ge.current&&!bs(V.current,P)&&(V.current=P,Or.flushSync(()=>{v(P)}))})},[w,o,r,pe,fe]);us(()=>{p===!1&&V.current.isPositioned&&(V.current.isPositioned=!1,v(J=>({...J,isPositioned:!1})))},[p]);const ge=y.useRef(!1);us(()=>(ge.current=!0,()=>{ge.current=!1}),[]),us(()=>{if(B&&(F.current=B),K&&(q.current=K),B&&K){if(he.current)return he.current(B,K,me);me()}},[B,K,me,he,ae]);const ce=y.useMemo(()=>({reference:F,floating:q,setReference:j,setFloating:D}),[j,D]),O=y.useMemo(()=>({reference:B,floating:K}),[B,K]),Y=y.useMemo(()=>{const J={position:r,left:0,top:0};if(!O.floating)return J;const le=Jg(O.floating,x.x),P=Jg(O.floating,x.y);return m?{...J,transform:"translate("+le+"px, "+P+"px)",...Zy(O.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:le,top:P}},[r,m,O.floating,x.x,x.y]);return y.useMemo(()=>({...x,update:me,refs:ce,elements:O,floatingStyles:Y}),[x,me,ce,O,Y])}const WT=a=>{function o(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:a,fn(r){const{element:i,padding:c}=typeof a=="function"?a(r):a;return i&&o(i)?i.current!=null?$g({element:i.current,padding:c}).fn(r):{}:i?$g({element:i,padding:c}).fn(r):{}}}},IT=(a,o)=>{const r=qT(a);return{name:r.name,fn:r.fn,options:[a,o]}},eN=(a,o)=>{const r=GT(a);return{name:r.name,fn:r.fn,options:[a,o]}},tN=(a,o)=>({fn:KT(a).fn,options:[a,o]}),nN=(a,o)=>{const r=XT(a);return{name:r.name,fn:r.fn,options:[a,o]}},aN=(a,o)=>{const r=QT(a);return{name:r.name,fn:r.fn,options:[a,o]}},lN=(a,o)=>{const r=ZT(a);return{name:r.name,fn:r.fn,options:[a,o]}},oN=(a,o)=>{const r=WT(a);return{name:r.name,fn:r.fn,options:[a,o]}};var rN="Arrow",Ky=y.forwardRef((a,o)=>{const{children:r,width:i=10,height:c=5,...f}=a;return b.jsx(Le.svg,{...f,ref:o,width:i,height:c,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:a.asChild?r:b.jsx("polygon",{points:"0,0 30,0 15,10"})})});Ky.displayName=rN;var iN=Ky;function sN(a){const[o,r]=y.useState(void 0);return Ct(()=>{if(a){r({width:a.offsetWidth,height:a.offsetHeight});const i=new ResizeObserver(c=>{if(!Array.isArray(c)||!c.length)return;const f=c[0];let d,m;if("borderBoxSize"in f){const h=f.borderBoxSize,p=Array.isArray(h)?h[0]:h;d=p.inlineSize,m=p.blockSize}else d=a.offsetWidth,m=a.offsetHeight;r({width:d,height:m})});return i.observe(a,{box:"border-box"}),()=>i.unobserve(a)}else r(void 0)},[a]),o}var nd="Popper",[$y,Jy]=wo(nd),[uN,Fy]=$y(nd),Py=a=>{const{__scopePopper:o,children:r}=a,[i,c]=y.useState(null);return b.jsx(uN,{scope:o,anchor:i,onAnchorChange:c,children:r})};Py.displayName=nd;var Wy="PopperAnchor",Iy=y.forwardRef((a,o)=>{const{__scopePopper:r,virtualRef:i,...c}=a,f=Fy(Wy,r),d=y.useRef(null),m=nt(o,d),h=y.useRef(null);return y.useEffect(()=>{const p=h.current;h.current=(i==null?void 0:i.current)||d.current,p!==h.current&&f.onAnchorChange(h.current)}),i?null:b.jsx(Le.div,{...c,ref:m})});Iy.displayName=Wy;var ad="PopperContent",[cN,fN]=$y(ad),e0=y.forwardRef((a,o)=>{var te,oe,ie,Te,we,xe;const{__scopePopper:r,side:i="bottom",sideOffset:c=0,align:f="center",alignOffset:d=0,arrowPadding:m=0,avoidCollisions:h=!0,collisionBoundary:p=[],collisionPadding:x=0,sticky:v="partial",hideWhenDetached:w=!1,updatePositionStrategy:N="optimized",onPlaced:_,...E}=a,C=Fy(ad,r),[T,j]=y.useState(null),D=nt(o,Ie=>j(Ie)),[B,K]=y.useState(null),F=sN(B),q=(F==null?void 0:F.width)??0,V=(F==null?void 0:F.height)??0,ae=i+(f!=="center"?"-"+f:""),he=typeof x=="number"?x:{top:0,right:0,bottom:0,left:0,...x},pe=Array.isArray(p)?p:[p],fe=pe.length>0,me={padding:he,boundary:pe.filter(mN),altBoundary:fe},{refs:ge,floatingStyles:ce,placement:O,isPositioned:Y,middlewareData:J}=PT({strategy:"fixed",placement:ae,whileElementsMounted:(...Ie)=>YT(...Ie,{animationFrame:N==="always"}),elements:{reference:C.anchor},middleware:[IT({mainAxis:c+V,alignmentAxis:d}),h&&eN({mainAxis:!0,crossAxis:!1,limiter:v==="partial"?tN():void 0,...me}),h&&nN({...me}),aN({...me,apply:({elements:Ie,rects:Xe,availableWidth:fn,availableHeight:Wt})=>{const{width:Yt,height:Ka}=Xe.reference,dt=Ie.floating.style;dt.setProperty("--radix-popper-available-width",`${fn}px`),dt.setProperty("--radix-popper-available-height",`${Wt}px`),dt.setProperty("--radix-popper-anchor-width",`${Yt}px`),dt.setProperty("--radix-popper-anchor-height",`${Ka}px`)}}),B&&oN({element:B,padding:m}),hN({arrowWidth:q,arrowHeight:V}),w&&lN({strategy:"referenceHidden",...me})]}),[le,P]=a0(O),R=Ya(_);Ct(()=>{Y&&(R==null||R())},[Y,R]);const G=(te=J.arrow)==null?void 0:te.x,Q=(oe=J.arrow)==null?void 0:oe.y,W=((ie=J.arrow)==null?void 0:ie.centerOffset)!==0,[ee,ne]=y.useState();return Ct(()=>{T&&ne(window.getComputedStyle(T).zIndex)},[T]),b.jsx("div",{ref:ge.setFloating,"data-radix-popper-content-wrapper":"",style:{...ce,transform:Y?ce.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ee,"--radix-popper-transform-origin":[(Te=J.transformOrigin)==null?void 0:Te.x,(we=J.transformOrigin)==null?void 0:we.y].join(" "),...((xe=J.hide)==null?void 0:xe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:a.dir,children:b.jsx(cN,{scope:r,placedSide:le,onArrowChange:K,arrowX:G,arrowY:Q,shouldHideArrow:W,children:b.jsx(Le.div,{"data-side":le,"data-align":P,...E,ref:D,style:{...E.style,animation:Y?void 0:"none"}})})})});e0.displayName=ad;var t0="PopperArrow",dN={top:"bottom",right:"left",bottom:"top",left:"right"},n0=y.forwardRef(function(o,r){const{__scopePopper:i,...c}=o,f=fN(t0,i),d=dN[f.placedSide];return b.jsx("span",{ref:f.onArrowChange,style:{position:"absolute",left:f.arrowX,top:f.arrowY,[d]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[f.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[f.placedSide],visibility:f.shouldHideArrow?"hidden":void 0},children:b.jsx(iN,{...c,ref:r,style:{...c.style,display:"block"}})})});n0.displayName=t0;function mN(a){return a!==null}var hN=a=>({name:"transformOrigin",options:a,fn(o){var C,T,j;const{placement:r,rects:i,middlewareData:c}=o,d=((C=c.arrow)==null?void 0:C.centerOffset)!==0,m=d?0:a.arrowWidth,h=d?0:a.arrowHeight,[p,x]=a0(r),v={start:"0%",center:"50%",end:"100%"}[x],w=(((T=c.arrow)==null?void 0:T.x)??0)+m/2,N=(((j=c.arrow)==null?void 0:j.y)??0)+h/2;let _="",E="";return p==="bottom"?(_=d?v:`${w}px`,E=`${-h}px`):p==="top"?(_=d?v:`${w}px`,E=`${i.floating.height+h}px`):p==="right"?(_=`${-h}px`,E=d?v:`${N}px`):p==="left"&&(_=`${i.floating.width+h}px`,E=d?v:`${N}px`),{data:{x:_,y:E}}}});function a0(a){const[o,r="center"]=a.split("-");return[o,r]}var pN=Py,gN=Iy,vN=e0,yN=n0;function bN(a){const o=y.useRef({value:a,previous:a});return y.useMemo(()=>(o.current.value!==a&&(o.current.previous=o.current.value,o.current.value=a),o.current.previous),[a])}var l0=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),xN="VisuallyHidden",SN=y.forwardRef((a,o)=>b.jsx(Le.span,{...a,ref:o,style:{...l0,...a.style}}));SN.displayName=xN;var wN=[" ","Enter","ArrowUp","ArrowDown"],EN=[" ","Enter"],Sl="Select",[Os,Ms,CN]=ky(Sl),[To]=wo(Sl,[CN,Jy]),Ds=Jy(),[TN,Qa]=To(Sl),[NN,RN]=To(Sl),o0=a=>{const{__scopeSelect:o,children:r,open:i,defaultOpen:c,onOpenChange:f,value:d,defaultValue:m,onValueChange:h,dir:p,name:x,autoComplete:v,disabled:w,required:N,form:_}=a,E=Ds(o),[C,T]=y.useState(null),[j,D]=y.useState(null),[B,K]=y.useState(!1),F=Jf(p),[q,V]=Tr({prop:i,defaultProp:c??!1,onChange:f,caller:Sl}),[ae,he]=Tr({prop:d,defaultProp:m,onChange:h,caller:Sl}),pe=y.useRef(null),fe=C?_||!!C.closest("form"):!0,[me,ge]=y.useState(new Set),ce=Array.from(me).map(O=>O.props.value).join(";");return b.jsx(pN,{...E,children:b.jsxs(TN,{required:N,scope:o,trigger:C,onTriggerChange:T,valueNode:j,onValueNodeChange:D,valueNodeHasChildren:B,onValueNodeHasChildrenChange:K,contentId:Va(),value:ae,onValueChange:he,open:q,onOpenChange:V,dir:F,triggerPointerDownPosRef:pe,disabled:w,children:[b.jsx(Os.Provider,{scope:o,children:b.jsx(NN,{scope:a.__scopeSelect,onNativeOptionAdd:y.useCallback(O=>{ge(Y=>new Set(Y).add(O))},[]),onNativeOptionRemove:y.useCallback(O=>{ge(Y=>{const J=new Set(Y);return J.delete(O),J})},[]),children:r})}),fe?b.jsxs(_0,{"aria-hidden":!0,required:N,tabIndex:-1,name:x,autoComplete:v,value:ae,onChange:O=>he(O.target.value),disabled:w,form:_,children:[ae===void 0?b.jsx("option",{value:""}):null,Array.from(me)]},ce):null]})})};o0.displayName=Sl;var r0="SelectTrigger",i0=y.forwardRef((a,o)=>{const{__scopeSelect:r,disabled:i=!1,...c}=a,f=Ds(r),d=Qa(r0,r),m=d.disabled||i,h=nt(o,d.onTriggerChange),p=Ms(r),x=y.useRef("touch"),[v,w,N]=M0(E=>{const C=p().filter(D=>!D.disabled),T=C.find(D=>D.value===d.value),j=D0(C,E,T);j!==void 0&&d.onValueChange(j.value)}),_=E=>{m||(d.onOpenChange(!0),N()),E&&(d.triggerPointerDownPosRef.current={x:Math.round(E.pageX),y:Math.round(E.pageY)})};return b.jsx(gN,{asChild:!0,...f,children:b.jsx(Le.button,{type:"button",role:"combobox","aria-controls":d.contentId,"aria-expanded":d.open,"aria-required":d.required,"aria-autocomplete":"none",dir:d.dir,"data-state":d.open?"open":"closed",disabled:m,"data-disabled":m?"":void 0,"data-placeholder":O0(d.value)?"":void 0,...c,ref:h,onClick:De(c.onClick,E=>{E.currentTarget.focus(),x.current!=="mouse"&&_(E)}),onPointerDown:De(c.onPointerDown,E=>{x.current=E.pointerType;const C=E.target;C.hasPointerCapture(E.pointerId)&&C.releasePointerCapture(E.pointerId),E.button===0&&E.ctrlKey===!1&&E.pointerType==="mouse"&&(_(E),E.preventDefault())}),onKeyDown:De(c.onKeyDown,E=>{const C=v.current!=="";!(E.ctrlKey||E.altKey||E.metaKey)&&E.key.length===1&&w(E.key),!(C&&E.key===" ")&&wN.includes(E.key)&&(_(),E.preventDefault())})})})});i0.displayName=r0;var s0="SelectValue",u0=y.forwardRef((a,o)=>{const{__scopeSelect:r,className:i,style:c,children:f,placeholder:d="",...m}=a,h=Qa(s0,r),{onValueNodeHasChildrenChange:p}=h,x=f!==void 0,v=nt(o,h.onValueNodeChange);return Ct(()=>{p(x)},[p,x]),b.jsx(Le.span,{...m,ref:v,style:{pointerEvents:"none"},children:O0(h.value)?b.jsx(b.Fragment,{children:d}):f})});u0.displayName=s0;var AN="SelectIcon",c0=y.forwardRef((a,o)=>{const{__scopeSelect:r,children:i,...c}=a;return b.jsx(Le.span,{"aria-hidden":!0,...c,ref:o,children:i||"▼"})});c0.displayName=AN;var _N="SelectPortal",f0=a=>b.jsx(Xf,{asChild:!0,...a});f0.displayName=_N;var wl="SelectContent",d0=y.forwardRef((a,o)=>{const r=Qa(wl,a.__scopeSelect),[i,c]=y.useState();if(Ct(()=>{c(new DocumentFragment)},[]),!r.open){const f=i;return f?Or.createPortal(b.jsx(m0,{scope:a.__scopeSelect,children:b.jsx(Os.Slot,{scope:a.__scopeSelect,children:b.jsx("div",{children:a.children})})}),f):null}return b.jsx(h0,{...a,ref:o})});d0.displayName=wl;var vn=10,[m0,Za]=To(wl),ON="SelectContentImpl",MN=Nr("SelectContent.RemoveScroll"),h0=y.forwardRef((a,o)=>{const{__scopeSelect:r,position:i="item-aligned",onCloseAutoFocus:c,onEscapeKeyDown:f,onPointerDownOutside:d,side:m,sideOffset:h,align:p,alignOffset:x,arrowPadding:v,collisionBoundary:w,collisionPadding:N,sticky:_,hideWhenDetached:E,avoidCollisions:C,...T}=a,j=Qa(wl,r),[D,B]=y.useState(null),[K,F]=y.useState(null),q=nt(o,te=>B(te)),[V,ae]=y.useState(null),[he,pe]=y.useState(null),fe=Ms(r),[me,ge]=y.useState(!1),ce=y.useRef(!1);y.useEffect(()=>{if(D)return sy(D)},[D]),Iv();const O=y.useCallback(te=>{const[oe,...ie]=fe().map(xe=>xe.ref.current),[Te]=ie.slice(-1),we=document.activeElement;for(const xe of te)if(xe===we||(xe==null||xe.scrollIntoView({block:"nearest"}),xe===oe&&K&&(K.scrollTop=0),xe===Te&&K&&(K.scrollTop=K.scrollHeight),xe==null||xe.focus(),document.activeElement!==we))return},[fe,K]),Y=y.useCallback(()=>O([V,D]),[O,V,D]);y.useEffect(()=>{me&&Y()},[me,Y]);const{onOpenChange:J,triggerPointerDownPosRef:le}=j;y.useEffect(()=>{if(D){let te={x:0,y:0};const oe=Te=>{var we,xe;te={x:Math.abs(Math.round(Te.pageX)-(((we=le.current)==null?void 0:we.x)??0)),y:Math.abs(Math.round(Te.pageY)-(((xe=le.current)==null?void 0:xe.y)??0))}},ie=Te=>{te.x<=10&&te.y<=10?Te.preventDefault():D.contains(Te.target)||J(!1),document.removeEventListener("pointermove",oe),le.current=null};return le.current!==null&&(document.addEventListener("pointermove",oe),document.addEventListener("pointerup",ie,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",oe),document.removeEventListener("pointerup",ie,{capture:!0})}}},[D,J,le]),y.useEffect(()=>{const te=()=>J(!1);return window.addEventListener("blur",te),window.addEventListener("resize",te),()=>{window.removeEventListener("blur",te),window.removeEventListener("resize",te)}},[J]);const[P,R]=M0(te=>{const oe=fe().filter(we=>!we.disabled),ie=oe.find(we=>we.ref.current===document.activeElement),Te=D0(oe,te,ie);Te&&setTimeout(()=>Te.ref.current.focus())}),G=y.useCallback((te,oe,ie)=>{const Te=!ce.current&&!ie;(j.value!==void 0&&j.value===oe||Te)&&(ae(te),Te&&(ce.current=!0))},[j.value]),Q=y.useCallback(()=>D==null?void 0:D.focus(),[D]),W=y.useCallback((te,oe,ie)=>{const Te=!ce.current&&!ie;(j.value!==void 0&&j.value===oe||Te)&&pe(te)},[j.value]),ee=i==="popper"?Ef:p0,ne=ee===Ef?{side:m,sideOffset:h,align:p,alignOffset:x,arrowPadding:v,collisionBoundary:w,collisionPadding:N,sticky:_,hideWhenDetached:E,avoidCollisions:C}:{};return b.jsx(m0,{scope:r,content:D,viewport:K,onViewportChange:F,itemRefCallback:G,selectedItem:V,onItemLeave:Q,itemTextRefCallback:W,focusSelectedItem:Y,selectedItemText:he,position:i,isPositioned:me,searchRef:P,children:b.jsx(Qf,{as:MN,allowPinchZoom:!0,children:b.jsx(Gf,{asChild:!0,trapped:j.open,onMountAutoFocus:te=>{te.preventDefault()},onUnmountAutoFocus:De(c,te=>{var oe;(oe=j.trigger)==null||oe.focus({preventScroll:!0}),te.preventDefault()}),children:b.jsx(qf,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:f,onPointerDownOutside:d,onFocusOutside:te=>te.preventDefault(),onDismiss:()=>j.onOpenChange(!1),children:b.jsx(ee,{role:"listbox",id:j.contentId,"data-state":j.open?"open":"closed",dir:j.dir,onContextMenu:te=>te.preventDefault(),...T,...ne,onPlaced:()=>ge(!0),ref:q,style:{display:"flex",flexDirection:"column",outline:"none",...T.style},onKeyDown:De(T.onKeyDown,te=>{const oe=te.ctrlKey||te.altKey||te.metaKey;if(te.key==="Tab"&&te.preventDefault(),!oe&&te.key.length===1&&R(te.key),["ArrowUp","ArrowDown","Home","End"].includes(te.key)){let Te=fe().filter(we=>!we.disabled).map(we=>we.ref.current);if(["ArrowUp","End"].includes(te.key)&&(Te=Te.slice().reverse()),["ArrowUp","ArrowDown"].includes(te.key)){const we=te.target,xe=Te.indexOf(we);Te=Te.slice(xe+1)}setTimeout(()=>O(Te)),te.preventDefault()}})})})})})})});h0.displayName=ON;var DN="SelectItemAlignedPosition",p0=y.forwardRef((a,o)=>{const{__scopeSelect:r,onPlaced:i,...c}=a,f=Qa(wl,r),d=Za(wl,r),[m,h]=y.useState(null),[p,x]=y.useState(null),v=nt(o,q=>x(q)),w=Ms(r),N=y.useRef(!1),_=y.useRef(!0),{viewport:E,selectedItem:C,selectedItemText:T,focusSelectedItem:j}=d,D=y.useCallback(()=>{if(f.trigger&&f.valueNode&&m&&p&&E&&C&&T){const q=f.trigger.getBoundingClientRect(),V=p.getBoundingClientRect(),ae=f.valueNode.getBoundingClientRect(),he=T.getBoundingClientRect();if(f.dir!=="rtl"){const we=he.left-V.left,xe=ae.left-we,Ie=q.left-xe,Xe=q.width+Ie,fn=Math.max(Xe,V.width),Wt=window.innerWidth-vn,Yt=Bg(xe,[vn,Math.max(vn,Wt-fn)]);m.style.minWidth=Xe+"px",m.style.left=Yt+"px"}else{const we=V.right-he.right,xe=window.innerWidth-ae.right-we,Ie=window.innerWidth-q.right-xe,Xe=q.width+Ie,fn=Math.max(Xe,V.width),Wt=window.innerWidth-vn,Yt=Bg(xe,[vn,Math.max(vn,Wt-fn)]);m.style.minWidth=Xe+"px",m.style.right=Yt+"px"}const pe=w(),fe=window.innerHeight-vn*2,me=E.scrollHeight,ge=window.getComputedStyle(p),ce=parseInt(ge.borderTopWidth,10),O=parseInt(ge.paddingTop,10),Y=parseInt(ge.borderBottomWidth,10),J=parseInt(ge.paddingBottom,10),le=ce+O+me+J+Y,P=Math.min(C.offsetHeight*5,le),R=window.getComputedStyle(E),G=parseInt(R.paddingTop,10),Q=parseInt(R.paddingBottom,10),W=q.top+q.height/2-vn,ee=fe-W,ne=C.offsetHeight/2,te=C.offsetTop+ne,oe=ce+O+te,ie=le-oe;if(oe<=W){const we=pe.length>0&&C===pe[pe.length-1].ref.current;m.style.bottom="0px";const xe=p.clientHeight-E.offsetTop-E.offsetHeight,Ie=Math.max(ee,ne+(we?Q:0)+xe+Y),Xe=oe+Ie;m.style.height=Xe+"px"}else{const we=pe.length>0&&C===pe[0].ref.current;m.style.top="0px";const Ie=Math.max(W,ce+E.offsetTop+(we?G:0)+ne)+ie;m.style.height=Ie+"px",E.scrollTop=oe-W+E.offsetTop}m.style.margin=`${vn}px 0`,m.style.minHeight=P+"px",m.style.maxHeight=fe+"px",i==null||i(),requestAnimationFrame(()=>N.current=!0)}},[w,f.trigger,f.valueNode,m,p,E,C,T,f.dir,i]);Ct(()=>D(),[D]);const[B,K]=y.useState();Ct(()=>{p&&K(window.getComputedStyle(p).zIndex)},[p]);const F=y.useCallback(q=>{q&&_.current===!0&&(D(),j==null||j(),_.current=!1)},[D,j]);return b.jsx(zN,{scope:r,contentWrapper:m,shouldExpandOnScrollRef:N,onScrollButtonChange:F,children:b.jsx("div",{ref:h,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:B},children:b.jsx(Le.div,{...c,ref:v,style:{boxSizing:"border-box",maxHeight:"100%",...c.style}})})})});p0.displayName=DN;var jN="SelectPopperPosition",Ef=y.forwardRef((a,o)=>{const{__scopeSelect:r,align:i="start",collisionPadding:c=vn,...f}=a,d=Ds(r);return b.jsx(vN,{...d,...f,ref:o,align:i,collisionPadding:c,style:{boxSizing:"border-box",...f.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)"}})});Ef.displayName=jN;var[zN,ld]=To(wl,{}),Cf="SelectViewport",g0=y.forwardRef((a,o)=>{const{__scopeSelect:r,nonce:i,...c}=a,f=Za(Cf,r),d=ld(Cf,r),m=nt(o,f.onViewportChange),h=y.useRef(0);return b.jsxs(b.Fragment,{children:[b.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:i}),b.jsx(Os.Slot,{scope:r,children:b.jsx(Le.div,{"data-radix-select-viewport":"",role:"presentation",...c,ref:m,style:{position:"relative",flex:1,overflow:"hidden auto",...c.style},onScroll:De(c.onScroll,p=>{const x=p.currentTarget,{contentWrapper:v,shouldExpandOnScrollRef:w}=d;if(w!=null&&w.current&&v){const N=Math.abs(h.current-x.scrollTop);if(N>0){const _=window.innerHeight-vn*2,E=parseFloat(v.style.minHeight),C=parseFloat(v.style.height),T=Math.max(E,C);if(T<_){const j=T+N,D=Math.min(_,j),B=j-D;v.style.height=D+"px",v.style.bottom==="0px"&&(x.scrollTop=B>0?B:0,v.style.justifyContent="flex-end")}}}h.current=x.scrollTop})})})]})});g0.displayName=Cf;var v0="SelectGroup",[kN,LN]=To(v0),UN=y.forwardRef((a,o)=>{const{__scopeSelect:r,...i}=a,c=Va();return b.jsx(kN,{scope:r,id:c,children:b.jsx(Le.div,{role:"group","aria-labelledby":c,...i,ref:o})})});UN.displayName=v0;var y0="SelectLabel",b0=y.forwardRef((a,o)=>{const{__scopeSelect:r,...i}=a,c=LN(y0,r);return b.jsx(Le.div,{id:c.id,...i,ref:o})});b0.displayName=y0;var xs="SelectItem",[BN,x0]=To(xs),S0=y.forwardRef((a,o)=>{const{__scopeSelect:r,value:i,disabled:c=!1,textValue:f,...d}=a,m=Qa(xs,r),h=Za(xs,r),p=m.value===i,[x,v]=y.useState(f??""),[w,N]=y.useState(!1),_=nt(o,j=>{var D;return(D=h.itemRefCallback)==null?void 0:D.call(h,j,i,c)}),E=Va(),C=y.useRef("touch"),T=()=>{c||(m.onValueChange(i),m.onOpenChange(!1))};if(i==="")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 b.jsx(BN,{scope:r,value:i,disabled:c,textId:E,isSelected:p,onItemTextChange:y.useCallback(j=>{v(D=>D||((j==null?void 0:j.textContent)??"").trim())},[]),children:b.jsx(Os.ItemSlot,{scope:r,value:i,disabled:c,textValue:x,children:b.jsx(Le.div,{role:"option","aria-labelledby":E,"data-highlighted":w?"":void 0,"aria-selected":p&&w,"data-state":p?"checked":"unchecked","aria-disabled":c||void 0,"data-disabled":c?"":void 0,tabIndex:c?void 0:-1,...d,ref:_,onFocus:De(d.onFocus,()=>N(!0)),onBlur:De(d.onBlur,()=>N(!1)),onClick:De(d.onClick,()=>{C.current!=="mouse"&&T()}),onPointerUp:De(d.onPointerUp,()=>{C.current==="mouse"&&T()}),onPointerDown:De(d.onPointerDown,j=>{C.current=j.pointerType}),onPointerMove:De(d.onPointerMove,j=>{var D;C.current=j.pointerType,c?(D=h.onItemLeave)==null||D.call(h):C.current==="mouse"&&j.currentTarget.focus({preventScroll:!0})}),onPointerLeave:De(d.onPointerLeave,j=>{var D;j.currentTarget===document.activeElement&&((D=h.onItemLeave)==null||D.call(h))}),onKeyDown:De(d.onKeyDown,j=>{var B;((B=h.searchRef)==null?void 0:B.current)!==""&&j.key===" "||(EN.includes(j.key)&&T(),j.key===" "&&j.preventDefault())})})})})});S0.displayName=xs;var Er="SelectItemText",w0=y.forwardRef((a,o)=>{const{__scopeSelect:r,className:i,style:c,...f}=a,d=Qa(Er,r),m=Za(Er,r),h=x0(Er,r),p=RN(Er,r),[x,v]=y.useState(null),w=nt(o,T=>v(T),h.onItemTextChange,T=>{var j;return(j=m.itemTextRefCallback)==null?void 0:j.call(m,T,h.value,h.disabled)}),N=x==null?void 0:x.textContent,_=y.useMemo(()=>b.jsx("option",{value:h.value,disabled:h.disabled,children:N},h.value),[h.disabled,h.value,N]),{onNativeOptionAdd:E,onNativeOptionRemove:C}=p;return Ct(()=>(E(_),()=>C(_)),[E,C,_]),b.jsxs(b.Fragment,{children:[b.jsx(Le.span,{id:h.textId,...f,ref:w}),h.isSelected&&d.valueNode&&!d.valueNodeHasChildren?Or.createPortal(f.children,d.valueNode):null]})});w0.displayName=Er;var E0="SelectItemIndicator",C0=y.forwardRef((a,o)=>{const{__scopeSelect:r,...i}=a;return x0(E0,r).isSelected?b.jsx(Le.span,{"aria-hidden":!0,...i,ref:o}):null});C0.displayName=E0;var Tf="SelectScrollUpButton",T0=y.forwardRef((a,o)=>{const r=Za(Tf,a.__scopeSelect),i=ld(Tf,a.__scopeSelect),[c,f]=y.useState(!1),d=nt(o,i.onScrollButtonChange);return Ct(()=>{if(r.viewport&&r.isPositioned){let m=function(){const p=h.scrollTop>0;f(p)};const h=r.viewport;return m(),h.addEventListener("scroll",m),()=>h.removeEventListener("scroll",m)}},[r.viewport,r.isPositioned]),c?b.jsx(R0,{...a,ref:d,onAutoScroll:()=>{const{viewport:m,selectedItem:h}=r;m&&h&&(m.scrollTop=m.scrollTop-h.offsetHeight)}}):null});T0.displayName=Tf;var Nf="SelectScrollDownButton",N0=y.forwardRef((a,o)=>{const r=Za(Nf,a.__scopeSelect),i=ld(Nf,a.__scopeSelect),[c,f]=y.useState(!1),d=nt(o,i.onScrollButtonChange);return Ct(()=>{if(r.viewport&&r.isPositioned){let m=function(){const p=h.scrollHeight-h.clientHeight,x=Math.ceil(h.scrollTop)<p;f(x)};const h=r.viewport;return m(),h.addEventListener("scroll",m),()=>h.removeEventListener("scroll",m)}},[r.viewport,r.isPositioned]),c?b.jsx(R0,{...a,ref:d,onAutoScroll:()=>{const{viewport:m,selectedItem:h}=r;m&&h&&(m.scrollTop=m.scrollTop+h.offsetHeight)}}):null});N0.displayName=Nf;var R0=y.forwardRef((a,o)=>{const{__scopeSelect:r,onAutoScroll:i,...c}=a,f=Za("SelectScrollButton",r),d=y.useRef(null),m=Ms(r),h=y.useCallback(()=>{d.current!==null&&(window.clearInterval(d.current),d.current=null)},[]);return y.useEffect(()=>()=>h(),[h]),Ct(()=>{var x;const p=m().find(v=>v.ref.current===document.activeElement);(x=p==null?void 0:p.ref.current)==null||x.scrollIntoView({block:"nearest"})},[m]),b.jsx(Le.div,{"aria-hidden":!0,...c,ref:o,style:{flexShrink:0,...c.style},onPointerDown:De(c.onPointerDown,()=>{d.current===null&&(d.current=window.setInterval(i,50))}),onPointerMove:De(c.onPointerMove,()=>{var p;(p=f.onItemLeave)==null||p.call(f),d.current===null&&(d.current=window.setInterval(i,50))}),onPointerLeave:De(c.onPointerLeave,()=>{h()})})}),HN="SelectSeparator",A0=y.forwardRef((a,o)=>{const{__scopeSelect:r,...i}=a;return b.jsx(Le.div,{"aria-hidden":!0,...i,ref:o})});A0.displayName=HN;var Rf="SelectArrow",VN=y.forwardRef((a,o)=>{const{__scopeSelect:r,...i}=a,c=Ds(r),f=Qa(Rf,r),d=Za(Rf,r);return f.open&&d.position==="popper"?b.jsx(yN,{...c,...i,ref:o}):null});VN.displayName=Rf;var YN="SelectBubbleInput",_0=y.forwardRef(({__scopeSelect:a,value:o,...r},i)=>{const c=y.useRef(null),f=nt(i,c),d=bN(o);return y.useEffect(()=>{const m=c.current;if(!m)return;const h=window.HTMLSelectElement.prototype,x=Object.getOwnPropertyDescriptor(h,"value").set;if(d!==o&&x){const v=new Event("change",{bubbles:!0});x.call(m,o),m.dispatchEvent(v)}},[d,o]),b.jsx(Le.select,{...r,style:{...l0,...r.style},ref:f,defaultValue:o})});_0.displayName=YN;function O0(a){return a===""||a===void 0}function M0(a){const o=Ya(a),r=y.useRef(""),i=y.useRef(0),c=y.useCallback(d=>{const m=r.current+d;o(m),(function h(p){r.current=p,window.clearTimeout(i.current),p!==""&&(i.current=window.setTimeout(()=>h(""),1e3))})(m)},[o]),f=y.useCallback(()=>{r.current="",window.clearTimeout(i.current)},[]);return y.useEffect(()=>()=>window.clearTimeout(i.current),[]),[r,c,f]}function D0(a,o,r){const c=o.length>1&&Array.from(o).every(p=>p===o[0])?o[0]:o,f=r?a.indexOf(r):-1;let d=qN(a,Math.max(f,0));c.length===1&&(d=d.filter(p=>p!==r));const h=d.find(p=>p.textValue.toLowerCase().startsWith(c.toLowerCase()));return h!==r?h:void 0}function qN(a,o){return a.map((r,i)=>a[(o+i)%a.length])}var GN=o0,j0=i0,XN=u0,QN=c0,ZN=f0,z0=d0,KN=g0,k0=b0,L0=S0,$N=w0,JN=C0,U0=T0,B0=N0,H0=A0;const FN=GN,PN=XN,V0=y.forwardRef(({className:a,children:o,...r},i)=>b.jsxs(j0,{ref:i,className:Be("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",a),...r,children:[o,b.jsx(QN,{asChild:!0,children:b.jsx(Rv,{className:"h-4 w-4 opacity-50"})})]}));V0.displayName=j0.displayName;const Y0=y.forwardRef(({className:a,...o},r)=>b.jsx(U0,{ref:r,className:Be("flex cursor-default items-center justify-center py-1",a),...o,children:b.jsx(H2,{className:"h-4 w-4"})}));Y0.displayName=U0.displayName;const q0=y.forwardRef(({className:a,...o},r)=>b.jsx(B0,{ref:r,className:Be("flex cursor-default items-center justify-center py-1",a),...o,children:b.jsx(Rv,{className:"h-4 w-4"})}));q0.displayName=B0.displayName;const G0=y.forwardRef(({className:a,children:o,position:r="popper",...i},c)=>b.jsx(ZN,{children:b.jsxs(z0,{ref:c,className:Be("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r==="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",a),position:r,...i,children:[b.jsx(Y0,{}),b.jsx(KN,{className:Be("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:o}),b.jsx(q0,{})]})}));G0.displayName=z0.displayName;const WN=y.forwardRef(({className:a,...o},r)=>b.jsx(k0,{ref:r,className:Be("py-1.5 pl-8 pr-2 text-sm font-semibold",a),...o}));WN.displayName=k0.displayName;const X0=y.forwardRef(({className:a,children:o,...r},i)=>b.jsxs(L0,{ref:i,className:Be("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a),...r,children:[b.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:b.jsx(JN,{children:b.jsx(L2,{className:"h-4 w-4"})})}),b.jsx($N,{children:o})]}));X0.displayName=L0.displayName;const IN=y.forwardRef(({className:a,...o},r)=>b.jsx(H0,{ref:r,className:Be("-mx-1 my-1 h-px bg-muted",a),...o}));IN.displayName=H0.displayName;var hf="rovingFocusGroup.onEntryFocus",eR={bubbles:!1,cancelable:!0},jr="RovingFocusGroup",[Af,Q0,tR]=ky(jr),[nR,Z0]=wo(jr,[tR]),[aR,lR]=nR(jr),K0=y.forwardRef((a,o)=>b.jsx(Af.Provider,{scope:a.__scopeRovingFocusGroup,children:b.jsx(Af.Slot,{scope:a.__scopeRovingFocusGroup,children:b.jsx(oR,{...a,ref:o})})}));K0.displayName=jr;var oR=y.forwardRef((a,o)=>{const{__scopeRovingFocusGroup:r,orientation:i,loop:c=!1,dir:f,currentTabStopId:d,defaultCurrentTabStopId:m,onCurrentTabStopIdChange:h,onEntryFocus:p,preventScrollOnEntryFocus:x=!1,...v}=a,w=y.useRef(null),N=nt(o,w),_=Jf(f),[E,C]=Tr({prop:d,defaultProp:m??null,onChange:h,caller:jr}),[T,j]=y.useState(!1),D=Ya(p),B=Q0(r),K=y.useRef(!1),[F,q]=y.useState(0);return y.useEffect(()=>{const V=w.current;if(V)return V.addEventListener(hf,D),()=>V.removeEventListener(hf,D)},[D]),b.jsx(aR,{scope:r,orientation:i,dir:_,loop:c,currentTabStopId:E,onItemFocus:y.useCallback(V=>C(V),[C]),onItemShiftTab:y.useCallback(()=>j(!0),[]),onFocusableItemAdd:y.useCallback(()=>q(V=>V+1),[]),onFocusableItemRemove:y.useCallback(()=>q(V=>V-1),[]),children:b.jsx(Le.div,{tabIndex:T||F===0?-1:0,"data-orientation":i,...v,ref:N,style:{outline:"none",...a.style},onMouseDown:De(a.onMouseDown,()=>{K.current=!0}),onFocus:De(a.onFocus,V=>{const ae=!K.current;if(V.target===V.currentTarget&&ae&&!T){const he=new CustomEvent(hf,eR);if(V.currentTarget.dispatchEvent(he),!he.defaultPrevented){const pe=B().filter(O=>O.focusable),fe=pe.find(O=>O.active),me=pe.find(O=>O.id===E),ce=[fe,me,...pe].filter(Boolean).map(O=>O.ref.current);F0(ce,x)}}K.current=!1}),onBlur:De(a.onBlur,()=>j(!1))})})}),$0="RovingFocusGroupItem",J0=y.forwardRef((a,o)=>{const{__scopeRovingFocusGroup:r,focusable:i=!0,active:c=!1,tabStopId:f,children:d,...m}=a,h=Va(),p=f||h,x=lR($0,r),v=x.currentTabStopId===p,w=Q0(r),{onFocusableItemAdd:N,onFocusableItemRemove:_,currentTabStopId:E}=x;return y.useEffect(()=>{if(i)return N(),()=>_()},[i,N,_]),b.jsx(Af.ItemSlot,{scope:r,id:p,focusable:i,active:c,children:b.jsx(Le.span,{tabIndex:v?0:-1,"data-orientation":x.orientation,...m,ref:o,onMouseDown:De(a.onMouseDown,C=>{i?x.onItemFocus(p):C.preventDefault()}),onFocus:De(a.onFocus,()=>x.onItemFocus(p)),onKeyDown:De(a.onKeyDown,C=>{if(C.key==="Tab"&&C.shiftKey){x.onItemShiftTab();return}if(C.target!==C.currentTarget)return;const T=sR(C,x.orientation,x.dir);if(T!==void 0){if(C.metaKey||C.ctrlKey||C.altKey||C.shiftKey)return;C.preventDefault();let D=w().filter(B=>B.focusable).map(B=>B.ref.current);if(T==="last")D.reverse();else if(T==="prev"||T==="next"){T==="prev"&&D.reverse();const B=D.indexOf(C.currentTarget);D=x.loop?uR(D,B+1):D.slice(B+1)}setTimeout(()=>F0(D))}}),children:typeof d=="function"?d({isCurrentTabStop:v,hasTabStop:E!=null}):d})})});J0.displayName=$0;var rR={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function iR(a,o){return o!=="rtl"?a:a==="ArrowLeft"?"ArrowRight":a==="ArrowRight"?"ArrowLeft":a}function sR(a,o,r){const i=iR(a.key,r);if(!(o==="vertical"&&["ArrowLeft","ArrowRight"].includes(i))&&!(o==="horizontal"&&["ArrowUp","ArrowDown"].includes(i)))return rR[i]}function F0(a,o=!1){const r=document.activeElement;for(const i of a)if(i===r||(i.focus({preventScroll:o}),document.activeElement!==r))return}function uR(a,o){return a.map((r,i)=>a[(o+i)%a.length])}var cR=K0,fR=J0,js="Tabs",[dR]=wo(js,[Z0]),P0=Z0(),[mR,od]=dR(js),W0=y.forwardRef((a,o)=>{const{__scopeTabs:r,value:i,onValueChange:c,defaultValue:f,orientation:d="horizontal",dir:m,activationMode:h="automatic",...p}=a,x=Jf(m),[v,w]=Tr({prop:i,onChange:c,defaultProp:f??"",caller:js});return b.jsx(mR,{scope:r,baseId:Va(),value:v,onValueChange:w,orientation:d,dir:x,activationMode:h,children:b.jsx(Le.div,{dir:x,"data-orientation":d,...p,ref:o})})});W0.displayName=js;var I0="TabsList",eb=y.forwardRef((a,o)=>{const{__scopeTabs:r,loop:i=!0,...c}=a,f=od(I0,r),d=P0(r);return b.jsx(cR,{asChild:!0,...d,orientation:f.orientation,dir:f.dir,loop:i,children:b.jsx(Le.div,{role:"tablist","aria-orientation":f.orientation,...c,ref:o})})});eb.displayName=I0;var tb="TabsTrigger",nb=y.forwardRef((a,o)=>{const{__scopeTabs:r,value:i,disabled:c=!1,...f}=a,d=od(tb,r),m=P0(r),h=ob(d.baseId,i),p=rb(d.baseId,i),x=i===d.value;return b.jsx(fR,{asChild:!0,...m,focusable:!c,active:x,children:b.jsx(Le.button,{type:"button",role:"tab","aria-selected":x,"aria-controls":p,"data-state":x?"active":"inactive","data-disabled":c?"":void 0,disabled:c,id:h,...f,ref:o,onMouseDown:De(a.onMouseDown,v=>{!c&&v.button===0&&v.ctrlKey===!1?d.onValueChange(i):v.preventDefault()}),onKeyDown:De(a.onKeyDown,v=>{[" ","Enter"].includes(v.key)&&d.onValueChange(i)}),onFocus:De(a.onFocus,()=>{const v=d.activationMode!=="manual";!x&&!c&&v&&d.onValueChange(i)})})})});nb.displayName=tb;var ab="TabsContent",lb=y.forwardRef((a,o)=>{const{__scopeTabs:r,value:i,forceMount:c,children:f,...d}=a,m=od(ab,r),h=ob(m.baseId,i),p=rb(m.baseId,i),x=i===m.value,v=y.useRef(x);return y.useEffect(()=>{const w=requestAnimationFrame(()=>v.current=!1);return()=>cancelAnimationFrame(w)},[]),b.jsx(Mr,{present:c||x,children:({present:w})=>b.jsx(Le.div,{"data-state":x?"active":"inactive","data-orientation":m.orientation,role:"tabpanel","aria-labelledby":h,hidden:!w,id:p,tabIndex:0,...d,ref:o,style:{...a.style,animationDuration:v.current?"0s":void 0},children:w&&f})})});lb.displayName=ab;function ob(a,o){return`${a}-trigger-${o}`}function rb(a,o){return`${a}-content-${o}`}var hR=W0,ib=eb,sb=nb,ub=lb;const pR=hR,cb=y.forwardRef(({className:a,...o},r)=>b.jsx(ib,{ref:r,className:Be("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",a),...o}));cb.displayName=ib.displayName;const cs=y.forwardRef(({className:a,...o},r)=>b.jsx(sb,{ref:r,className:Be("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",a),...o}));cs.displayName=sb.displayName;const fs=y.forwardRef(({className:a,...o},r)=>b.jsx(ub,{ref:r,className:Be("mt-2 ring-offset-background data-[state=inactive]:hidden focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",a),...o}));fs.displayName=ub.displayName;function yl(a){if(a==null||a==="")return"Unavailable";const o=new Date(a);return Number.isNaN(o.getTime())?"Unavailable":new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}).format(o)}function gR(a){const o=Math.max(0,Math.floor(a)),r=Math.floor(o/86400),i=Math.floor(o%86400/3600),c=Math.floor(o%3600/60);return r>0?`${r}d ${i}h`:i>0?`${i}h ${c}m`:`${c}m`}function Fg(a){if(a==null||Number.isNaN(a))return"Unavailable";const o=["B","KB","MB","GB","TB"];let r=a,i=0;for(;r>=1024&&i<o.length-1;)r/=1024,i+=1;return`${r.toFixed(r>=10||i===0?0:1)} ${o[i]}`}function fb(a){return a==="ok"?"default":a==="missing"||a==="install-failed"||a==="login-failed"?"destructive":a==="not-authenticated"||a==="unsupported-platform"?"outline":"secondary"}function vR(a){return a.available?b.jsxs(Vt,{className:"gap-1 rounded-full",children:[b.jsx(Y2,{className:"h-3.5 w-3.5"}),"Available"]}):b.jsxs(Vt,{variant:"destructive",className:"gap-1 rounded-full",children:[b.jsx(G2,{className:"h-3.5 w-3.5"}),"Unavailable"]})}function je({label:a,value:o,mono:r=!1}){return b.jsxs("div",{className:"flex items-start justify-between gap-3 border-b border-border/50 py-1.5 last:border-b-0 last:pb-0 first:pt-0",children:[b.jsx("span",{className:"shrink-0 text-[10px] uppercase tracking-[0.18em] text-muted-foreground",children:a}),b.jsx("span",{className:Be("break-all text-right text-xs text-foreground",r&&"font-mono text-[11px]"),children:o})]})}function yR({agent:a}){return b.jsxs("div",{className:"rounded-xl border border-border/60 bg-background/70 p-3 shadow-sm",children:[b.jsxs("div",{className:"flex items-start justify-between gap-3",children:[b.jsxs("div",{children:[b.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-semibold text-foreground",children:[b.jsx(Nv,{className:"h-3.5 w-3.5 text-primary"}),a.label]}),b.jsxs("div",{className:"mt-0.5 text-[11px] text-muted-foreground",children:["Command: ",b.jsx("span",{className:"font-mono text-[10px]",children:a.command})]})]}),vR(a)]}),b.jsxs("div",{className:"mt-2.5 space-y-1.5 text-sm",children:[b.jsx(je,{label:"Version",value:a.version??"Unavailable",mono:!!a.version}),b.jsx(je,{label:"Path",value:a.path??"Not on PATH",mono:!!a.path}),b.jsx(je,{label:"Checked",value:yl(a.checkedAt)})]}),a.metadataStatus&&b.jsxs("div",{className:"mt-2 flex items-center gap-2 text-xs text-muted-foreground",children:[b.jsx(Vt,{variant:fb(a.metadataStatus),className:"rounded-full px-2 py-0 text-[10px] uppercase tracking-[0.14em]",children:a.metadataStatus}),b.jsx("span",{children:"Startup preflight"})]}),a.detail&&b.jsx("div",{className:"mt-2 rounded-lg border border-border/60 bg-muted/40 px-2.5 py-1.5 text-[11px] text-muted-foreground",children:a.detail})]})}function as({name:a,status:o}){return b.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-xl border border-border/60 bg-background/70 px-3 py-2",children:[b.jsxs("div",{children:[b.jsx("div",{className:"text-xs font-medium text-foreground",children:a}),b.jsx("div",{className:"text-[11px] text-muted-foreground",children:yl(o==null?void 0:o.checkedAt)})]}),b.jsxs("div",{className:"flex items-center gap-2",children:[typeof(o==null?void 0:o.authenticated)=="boolean"&&b.jsx(Vt,{variant:o.authenticated?"default":"outline",className:"rounded-full text-[10px] uppercase tracking-[0.14em]",children:o.authenticated?"auth ok":"auth required"}),b.jsx(Vt,{variant:fb(o==null?void 0:o.status),className:"rounded-full text-[10px] uppercase tracking-[0.14em]",children:(o==null?void 0:o.status)??"unknown"})]})]})}function bR(a){return[{key:"workspace",label:"Workspace",value:a==null?void 0:a.workspace},{key:"node",label:"Node app",value:a==null?void 0:a.node},{key:"core",label:"Core",value:a==null?void 0:a.core},{key:"dashboard",label:"Dashboard",value:a==null?void 0:a.dashboard},{key:"api",label:"API",value:a==null?void 0:a.api}].filter(r=>r.value)}function xR(a,o){var r;return(r=a==null?void 0:a.nodes)!=null&&r.length?a.nodes:o?[o]:[]}function SR(a,o){var i;if(o&&a.id===o.nodeId)return o;const r=a.settingsSnapshot;return{...a,nodeId:a.id,version:(r==null?void 0:r.version)??"Unavailable",packageName:r==null?void 0:r.packageName,uptime:(r==null?void 0:r.uptime)??0,localDashboardOrigin:((i=r==null?void 0:r.runtime)==null?void 0:i.localDashboardOrigin)??void 0,auth:r==null?void 0:r.auth,os:r==null?void 0:r.os,runtime:r==null?void 0:r.runtime,agents:r==null?void 0:r.agents,startupRequirements:r==null?void 0:r.startupRequirements,components:r==null?void 0:r.components,repository:r==null?void 0:r.repository,packages:r==null?void 0:r.packages}}function wR(a,o){return a.id===o?`${a.name} (this node)`:`${a.name} (${a.role})`}function ER({cluster:a,systemInfo:o,sseConnected:r}){var N,_,E,C,T,j,D,B,K,F,q,V,ae,he,pe,fe,me,ge,ce,O,Y,J,le,P;const i=y.useMemo(()=>xR(a,o),[a,o]),[c,f]=y.useState(()=>{var R;return(o==null?void 0:o.nodeId)??((R=a==null?void 0:a.self)==null?void 0:R.id)??""}),d=(a==null?void 0:a.self)??o??i[0]??null,m=i.find(R=>R.id===c)??d,h=m?SR(m,o):null,p=!!(o&&m&&m.id===o.nodeId),x=p||!!(m!=null&&m.settingsSnapshot),v=y.useMemo(()=>bR(h==null?void 0:h.packages),[h==null?void 0:h.packages]),w=((N=h==null?void 0:h.startupRequirements)==null?void 0:N.components)??(h==null?void 0:h.components)??{};return!m||!h?b.jsx("div",{className:"rounded-3xl border border-dashed border-border/70 bg-muted/20 px-6 py-12 text-center text-sm text-muted-foreground",children:"Loading session metadata..."}):b.jsxs("div",{className:"space-y-4",children:[b.jsx("section",{className:"rounded-2xl border border-border/70 bg-[radial-gradient(circle_at_top_left,rgba(59,130,246,0.18),transparent_42%),radial-gradient(circle_at_bottom_right,rgba(16,185,129,0.12),transparent_32%),rgba(255,255,255,0.72)] p-4 shadow-[0_24px_90px_-54px_rgba(15,23,42,0.55)] dark:bg-[radial-gradient(circle_at_top_left,rgba(59,130,246,0.18),transparent_42%),radial-gradient(circle_at_bottom_right,rgba(16,185,129,0.12),transparent_32%),rgba(10,15,23,0.78)]",children:b.jsxs("div",{className:"flex flex-col gap-3 md:flex-row md:items-end md:justify-between",children:[b.jsxs("div",{className:"space-y-2",children:[b.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[b.jsxs("span",{className:"flex items-center gap-1.5 rounded-full border border-border/70 bg-background/75 px-2.5 py-1 text-[11px] text-muted-foreground backdrop-blur",children:[b.jsx($v,{status:m.status}),b.jsx("span",{className:"font-medium text-foreground",children:m.name})]}),b.jsx(yE,{role:m.role}),b.jsx(Vt,{variant:"outline",className:"rounded-full border-border/70 bg-background/60 text-[10px] uppercase tracking-[0.16em]",children:m.transportType??h.transportType??"direct"}),b.jsx(Vt,{variant:p?"default":"outline",className:"rounded-full px-2.5 py-1 text-[10px] uppercase tracking-[0.16em]",children:p?"Live local session":"Leader-synced snapshot"})]}),b.jsxs("div",{children:[b.jsx("div",{className:"text-[10px] uppercase tracking-[0.34em] text-muted-foreground",children:"Session"}),b.jsx("h3",{className:"mt-0.5 text-lg font-semibold tracking-tight text-foreground",children:"Node runtime"}),b.jsx("p",{className:"mt-1 max-w-2xl text-xs text-muted-foreground",children:"Inspect the selected node's runtime environment, connectivity surface, and packaged build metadata from one place."})]}),i.length>1&&b.jsxs("div",{className:"max-w-md space-y-1.5",children:[b.jsx("div",{className:"text-[10px] uppercase tracking-[0.18em] text-muted-foreground",children:"Inspect node"}),b.jsxs(FN,{value:m.id,onValueChange:f,children:[b.jsx(V0,{className:"h-9 rounded-xl border-border/70 bg-background/70 text-xs",children:b.jsx(PN,{placeholder:"Choose a node"})}),b.jsx(G0,{children:i.map(R=>b.jsx(X0,{value:R.id,children:wR(R,o==null?void 0:o.nodeId)},R.id))})]})]})]}),b.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[b.jsxs(Vt,{variant:r?"default":"outline",className:"gap-1 rounded-full px-2.5 py-1 text-[10px] uppercase tracking-[0.16em]",children:[b.jsx(Av,{className:"h-3 w-3"}),r?"Live link connected":"Live link reconnecting"]}),b.jsxs(Vt,{variant:"outline",className:"rounded-full border-border/70 bg-background/60 px-2.5 py-1 text-[10px] uppercase tracking-[0.16em]",children:["Uptime ",gR(h.uptime)]}),!p&&b.jsxs(Vt,{variant:"outline",className:"rounded-full border-border/70 bg-background/60 px-2.5 py-1 text-[10px] uppercase tracking-[0.16em]",children:["Updated ",yl((_=m.settingsSnapshot)==null?void 0:_.collectedAt)]})]})]})}),!x&&b.jsx("div",{className:"rounded-2xl border border-dashed border-border/70 bg-muted/20 px-4 py-3 text-sm text-muted-foreground",children:"This node has not synced its settings snapshot to the leader yet. Wait for the next keepalive and reopen the dialog if needed."}),b.jsxs(pR,{defaultValue:"session",className:"space-y-3",children:[b.jsxs(cb,{className:"h-auto flex-wrap rounded-xl border border-border/60 bg-muted/40 p-0.5",children:[b.jsx(cs,{value:"session",className:"rounded-lg px-3 py-1.5 text-xs",children:"Session"}),b.jsx(cs,{value:"access",className:"rounded-lg px-3 py-1.5 text-xs",children:"Access"}),b.jsx(cs,{value:"about",className:"rounded-lg px-3 py-1.5 text-xs",children:"About"})]}),b.jsxs(fs,{value:"session",className:"mt-0 grid gap-3 xl:grid-cols-[1.15fr_0.85fr]",children:[b.jsxs(_n,{className:"rounded-2xl border-border/70 bg-background/75 shadow-[0_24px_80px_-58px_rgba(15,23,42,0.45)]",children:[b.jsxs(On,{className:"pb-2 pt-4 px-4",children:[b.jsxs(Mn,{className:"flex items-center gap-1.5 text-sm",children:[b.jsx(rw,{className:"h-4 w-4 text-primary"}),"Selected node"]}),b.jsx(Dn,{className:"text-xs",children:"Cluster role, identity, and node-scoped runtime state."})]}),b.jsxs(jn,{className:"space-y-0 px-4 pb-4",children:[b.jsx(je,{label:"Node ID",value:h.nodeId,mono:!0}),b.jsx(je,{label:"Status",value:m.status}),b.jsx(je,{label:"Role",value:m.role}),b.jsx(je,{label:"Endpoint",value:m.endpoint,mono:!0}),b.jsx(je,{label:"Joined",value:yl(m.joinedAt)}),b.jsx(je,{label:"Heartbeat",value:yl(m.lastHeartbeat)}),b.jsx(je,{label:"Capabilities",value:m.capabilities.length>0?m.capabilities.join(", "):"None"})]})]}),b.jsxs(_n,{className:"rounded-2xl border-border/70 bg-background/75 shadow-[0_24px_80px_-58px_rgba(15,23,42,0.45)]",children:[b.jsxs(On,{className:"pb-2 pt-4 px-4",children:[b.jsxs(Mn,{className:"flex items-center gap-1.5 text-sm",children:[b.jsx(Q2,{className:"h-4 w-4 text-primary"}),"OS info"]}),b.jsx(Dn,{className:"text-xs",children:"Host and resource details reported by the current process."})]}),b.jsxs(jn,{className:"space-y-0 px-4 pb-4",children:[b.jsx(je,{label:"Host",value:((E=h.os)==null?void 0:E.hostname)??"Unavailable"}),b.jsx(je,{label:"Platform",value:h.os?`${h.os.platform} ${h.os.release}`:"Unavailable"}),b.jsx(je,{label:"Arch",value:((C=h.os)==null?void 0:C.arch)??"Unavailable"}),b.jsx(je,{label:"CPU",value:((T=h.os)==null?void 0:T.cpuModel)??"Unavailable"}),b.jsx(je,{label:"Cores",value:String(((j=h.os)==null?void 0:j.cpuCount)??"Unavailable")}),b.jsx(je,{label:"Memory",value:h.os?`${Fg(h.os.freeMemoryBytes)} free / ${Fg(h.os.totalMemoryBytes)} total`:"Unavailable"})]})]}),b.jsxs(_n,{className:"rounded-2xl border-border/70 bg-background/75 shadow-[0_24px_80px_-58px_rgba(15,23,42,0.45)] xl:col-span-2",children:[b.jsxs(On,{className:"pb-2 pt-4 px-4",children:[b.jsxs(Mn,{className:"flex items-center gap-1.5 text-sm",children:[b.jsx(Nv,{className:"h-4 w-4 text-primary"}),"Available agents"]}),b.jsx(Dn,{className:"text-xs",children:p?"Live command availability for Codex and Claude Code on this node.":"Most recent agent availability snapshot synced from this node."})]}),b.jsx(jn,{className:"grid gap-3 px-4 pb-4 md:grid-cols-2",children:(h.agents??[]).map(R=>b.jsx(yR,{agent:R},R.id))})]})]}),b.jsxs(fs,{value:"access",className:"mt-0 grid gap-3 xl:grid-cols-2",children:[b.jsxs(_n,{className:"rounded-2xl border-border/70 bg-background/75 shadow-[0_24px_80px_-58px_rgba(15,23,42,0.45)]",children:[b.jsxs(On,{className:"pb-2 pt-4 px-4",children:[b.jsxs(Mn,{className:"flex items-center gap-1.5 text-sm",children:[b.jsx(z2,{className:"h-4 w-4 text-primary"}),"Access surface"]}),b.jsx(Dn,{className:"text-xs",children:"How this node is exposed to the dashboard and other peers."})]}),b.jsxs(jn,{className:"space-y-0 px-4 pb-4",children:[b.jsx(je,{label:"Transport",value:m.transportType??h.transportType??"direct"}),b.jsx(je,{label:"Node URL",value:m.endpoint,mono:!0}),b.jsx(je,{label:"Node tunnel",value:m.devtunnelEndpoint??"Disabled",mono:!!m.devtunnelEndpoint}),b.jsx(je,{label:"Dashboard URL",value:m.dashboardOrigin??h.localDashboardOrigin??"Unavailable",mono:!!(m.dashboardOrigin||h.localDashboardOrigin)}),b.jsx(je,{label:"Local dashboard",value:h.localDashboardOrigin??"Unavailable",mono:!!h.localDashboardOrigin})]})]}),b.jsxs(_n,{className:"rounded-2xl border-border/70 bg-background/75 shadow-[0_24px_80px_-58px_rgba(15,23,42,0.45)]",children:[b.jsxs(On,{className:"pb-2 pt-4 px-4",children:[b.jsxs(Mn,{className:"flex items-center gap-1.5 text-sm",children:[b.jsx(cw,{className:"h-4 w-4 text-primary"}),"Auth"]}),b.jsx(Dn,{className:"text-xs",children:"Current bearer-auth and trusted access posture."})]}),b.jsxs(jn,{className:"space-y-0 px-4 pb-4",children:[b.jsx(je,{label:"Enabled",value:(D=h.auth)!=null&&D.enabled?"Yes":"No"}),b.jsx(je,{label:"Same tenant",value:(B=h.auth)!=null&&B.allowSameTenant?"Allowed":"Off"}),b.jsx(je,{label:"Allowed users",value:(K=h.auth)!=null&&K.allowedUsers.length?h.auth.allowedUsers.join(", "):"None"})]})]}),b.jsxs(_n,{className:"rounded-2xl border-border/70 bg-background/75 shadow-[0_24px_80px_-58px_rgba(15,23,42,0.45)]",children:[b.jsxs(On,{className:"pb-2 pt-4 px-4",children:[b.jsxs(Mn,{className:"flex items-center gap-1.5 text-sm",children:[b.jsx(J2,{className:"h-4 w-4 text-primary"}),"Paths"]}),b.jsx(Dn,{className:"text-xs",children:"Workspace and runtime paths currently used by this node."})]}),b.jsxs(jn,{className:"space-y-0 px-4 pb-4",children:[b.jsx(je,{label:"Work dir",value:((F=h.runtime)==null?void 0:F.workDir)??h.workDir??"Unavailable",mono:!!(((q=h.runtime)==null?void 0:q.workDir)??h.workDir)}),b.jsx(je,{label:"Storage",value:((V=h.runtime)==null?void 0:V.storagePath)??"Unavailable",mono:!!((ae=h.runtime)!=null&&ae.storagePath)}),b.jsx(je,{label:"Process cwd",value:((he=h.runtime)==null?void 0:he.cwd)??"Unavailable",mono:!!((pe=h.runtime)!=null&&pe.cwd)}),b.jsx(je,{label:"Started",value:yl((fe=h.runtime)==null?void 0:fe.startedAt)}),b.jsx(je,{label:"PID",value:h.runtime?String(h.runtime.pid):"Unavailable",mono:!!h.runtime})]})]}),b.jsxs(_n,{className:"rounded-2xl border-border/70 bg-background/75 shadow-[0_24px_80px_-58px_rgba(15,23,42,0.45)]",children:[b.jsxs(On,{className:"pb-2 pt-4 px-4",children:[b.jsxs(Mn,{className:"flex items-center gap-1.5 text-sm",children:[b.jsx(_2,{className:"h-4 w-4 text-primary"}),"Startup checks"]}),b.jsx(Dn,{className:"text-xs",children:"Dependency preflight snapshot persisted during node startup."})]}),b.jsxs(jn,{className:"space-y-3 px-4 pb-4",children:[b.jsxs("div",{className:"rounded-xl border border-border/60 bg-background/70 px-3 py-2",children:[b.jsx("div",{className:"text-[10px] uppercase tracking-[0.18em] text-muted-foreground",children:"Last checked"}),b.jsx("div",{className:"mt-0.5 text-xs text-foreground",children:yl((me=h.startupRequirements)==null?void 0:me.lastCheckedAt)})]}),b.jsxs("div",{className:"space-y-2",children:[b.jsx(as,{name:"Azure CLI",status:w.az}),b.jsx(as,{name:"DevTunnel",status:w.devtunnel}),b.jsx(as,{name:"Claude Code",status:w.claude}),b.jsx(as,{name:"Codex",status:w.codex})]})]})]})]}),b.jsxs(fs,{value:"about",className:"mt-0 grid gap-3 xl:grid-cols-[0.92fr_1.08fr]",children:[b.jsxs(_n,{className:"rounded-2xl border-border/70 bg-background/75 shadow-[0_24px_80px_-58px_rgba(15,23,42,0.45)]",children:[b.jsxs(On,{className:"pb-2 pt-4 px-4",children:[b.jsxs(Mn,{className:"flex items-center gap-1.5 text-sm",children:[b.jsx(M2,{className:"h-4 w-4 text-primary"}),"Repository"]}),b.jsx(Dn,{className:"text-xs",children:"Source-of-truth repository metadata for this running node."})]}),b.jsxs(jn,{className:"space-y-3 px-4 pb-4",children:[(ge=h.repository)!=null&&ge.url?b.jsxs("a",{href:h.repository.url,target:"_blank",rel:"noreferrer",className:"group flex items-center justify-between rounded-xl border border-border/70 bg-background/70 px-3 py-2 text-xs text-foreground transition-colors hover:border-primary/40 hover:bg-primary/5",children:[b.jsx("span",{className:"font-mono text-[11px]",children:h.repository.url}),b.jsx(K2,{className:"h-3.5 w-3.5 text-muted-foreground transition-transform group-hover:-translate-y-0.5 group-hover:translate-x-0.5"})]}):b.jsx("div",{className:"rounded-xl border border-dashed border-border/70 bg-muted/20 px-3 py-2 text-xs text-muted-foreground",children:"Repository URL is unavailable in this runtime."}),b.jsxs("div",{className:"space-y-0",children:[b.jsx(je,{label:"Branch",value:((ce=h.repository)==null?void 0:ce.branch)??"Unavailable",mono:!!((O=h.repository)!=null&&O.branch)}),b.jsx(je,{label:"Commit",value:((Y=h.repository)==null?void 0:Y.commit)??"Unavailable",mono:!!((J=h.repository)!=null&&J.commit)}),b.jsx(je,{label:"Runtime",value:`${h.packageName??"meshy"} ${h.version}`,mono:!0}),b.jsx(je,{label:"Node.js",value:((le=h.runtime)==null?void 0:le.nodeVersion)??"Unavailable",mono:!!((P=h.runtime)!=null&&P.nodeVersion)})]})]})]}),b.jsxs(_n,{className:"rounded-2xl border-border/70 bg-background/75 shadow-[0_24px_80px_-58px_rgba(15,23,42,0.45)]",children:[b.jsxs(On,{className:"pb-2 pt-4 px-4",children:[b.jsxs(Mn,{className:"flex items-center gap-1.5 text-sm",children:[b.jsx(P2,{className:"h-4 w-4 text-primary"}),"Package versions"]}),b.jsx(Dn,{className:"text-xs",children:"Version snapshot for the packages most relevant to this dashboard session."})]}),b.jsx(jn,{className:"space-y-2 px-4 pb-4",children:v.map(R=>{var G,Q;return b.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-xl border border-border/60 bg-background/70 px-3 py-2",children:[b.jsxs("div",{children:[b.jsx("div",{className:"text-xs font-medium text-foreground",children:R.label}),b.jsx("div",{className:"text-[11px] text-muted-foreground",children:(G=R.value)==null?void 0:G.name})]}),b.jsx(Vt,{variant:"outline",className:"rounded-full border-border/70 bg-background/60 font-mono text-[10px]",children:(Q=R.value)==null?void 0:Q.version})]},R.key)})})]})]})]})]})}function CR(){const{cluster:a,systemInfo:o,sseConnected:r}=Cv(),[i,c]=y.useState(!1);return b.jsxs(PC,{open:i,onOpenChange:c,children:[b.jsx(WC,{asChild:!0,children:b.jsx(Yf,{variant:"ghost",size:"icon","aria-label":"Settings",title:"Settings",className:"rounded-full border border-border/70 bg-background/70 shadow-sm",children:b.jsx(sw,{className:"h-4 w-4"})})}),b.jsxs(My,{className:"grid h-[min(85vh,52rem)] max-h-[85vh] max-w-[min(90vw,68rem)] grid-rows-[auto_minmax(0,1fr)] overflow-hidden rounded-2xl border-border/70 bg-background/96 p-0 shadow-[0_40px_120px_-56px_rgba(15,23,42,0.75)] backdrop-blur-xl",children:[b.jsxs(Dy,{className:"shrink-0 border-b border-border/60 px-4 py-3 sm:px-5",children:[b.jsxs(jy,{className:"flex items-center gap-2 text-sm",children:[b.jsx(I2,{className:"h-4 w-4 text-primary"}),"Settings"]}),b.jsx(zy,{className:"text-xs",children:"Session diagnostics, access configuration, and build metadata for the current Meshy node."})]}),b.jsx("div",{className:"min-h-0 overflow-y-auto px-4 py-3 sm:px-5 sm:py-4",children:b.jsx(ER,{cluster:a,systemInfo:o,sseConnected:r})})]})]})}function TR(){var h,p;const{cluster:a,sseConnected:o}=Cv(),{theme:r,setTheme:i}=pE(),c=Bn(),f=c.pathname==="/"||/^\/tasks\/[^/]+$/.test(c.pathname),d=r==="dark"?aw:r==="light"?dw:tw,m=()=>{const x=["light","dark","system"],v=x.indexOf(r);i(x[(v+1)%x.length])};return b.jsxs("div",{className:"relative h-full overflow-hidden bg-background text-foreground",children:[b.jsx("div",{className:"mesh-grid pointer-events-none absolute inset-0"}),b.jsx("div",{className:"pointer-events-none absolute left-[-12rem] top-[-10rem] h-[28rem] w-[28rem] rounded-full bg-primary/14 blur-3xl"}),b.jsx("div",{className:"pointer-events-none absolute right-[-10rem] top-[10%] h-[24rem] w-[24rem] rounded-full bg-emerald-500/10 blur-3xl dark:bg-emerald-300/8"}),b.jsxs("div",{className:"relative z-10 flex h-full min-h-0 flex-col",children:[b.jsx("header",{className:"shrink-0 px-2 pb-2 pt-3 sm:px-5 sm:pb-3 sm:pt-4 lg:px-6",children:b.jsxs("div",{className:"mx-auto flex max-w-[1760px] flex-wrap items-center justify-between gap-2 rounded-2xl border border-border/60 bg-background/78 px-3 py-2 shadow-[0_20px_80px_-48px_rgba(0,0,0,var(--panel-shadow-alpha))] backdrop-blur-xl sm:gap-3 sm:rounded-[24px] sm:px-4 sm:py-3",children:[b.jsx("div",{className:"flex min-w-0 items-center gap-4",children:b.jsxs(xv,{to:"/",className:"flex items-center gap-3",children:[b.jsx("div",{className:"flex h-9 w-9 items-center justify-center rounded-xl border border-border/70 bg-foreground text-xs font-semibold tracking-[0.24em] text-background sm:h-11 sm:w-11 sm:rounded-2xl sm:text-sm",children:"M"}),b.jsxs("div",{className:"hidden min-w-0 sm:block",children:[b.jsx("div",{className:"text-[11px] font-medium uppercase tracking-[0.34em] text-muted-foreground",children:"MESHY"}),b.jsx("div",{className:"truncate text-base font-semibold tracking-tight text-foreground",children:"Workspace"})]})]})}),b.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-2",children:[b.jsxs("div",{className:"hidden items-center gap-2 rounded-full border border-border/70 bg-background/70 px-3 py-2 text-xs text-muted-foreground sm:flex",children:[b.jsxs("span",{className:"flex items-center gap-2",children:[(a==null?void 0:a.self)&&b.jsx($v,{status:a.self.status}),b.jsx("span",{className:"font-medium text-foreground",children:((h=a==null?void 0:a.self)==null?void 0:h.name)??"offline"})]}),b.jsx("span",{className:"text-border",children:"/"}),b.jsx("span",{className:"capitalize",children:((p=a==null?void 0:a.self)==null?void 0:p.role)??"node"})]}),b.jsxs("div",{className:"flex items-center gap-1.5 rounded-full border border-border/70 bg-background/70 px-2 py-1.5 text-[11px] text-muted-foreground sm:gap-2 sm:px-3 sm:py-2 sm:text-xs",children:[b.jsx(Av,{className:Be("h-3.5 w-3.5",o?"text-emerald-500":"text-destructive")}),o?"Live link":"Reconnecting"]}),b.jsx(CR,{}),b.jsx(Yf,{variant:"ghost",size:"icon",onClick:m,className:"rounded-full border border-border/60 bg-background/70",title:`Theme: ${r}`,children:b.jsx(d,{className:"h-4 w-4"})})]})]})}),b.jsx("main",{className:Be("min-h-0 flex-1 px-3 pb-3 sm:px-5 lg:px-6",f?"overflow-hidden":"overflow-y-auto"),children:b.jsx("div",{className:"mx-auto h-full min-h-0 max-w-[1760px]",children:b.jsx(jS,{})})})]})]})}const Pg=y.lazy(async()=>({default:(await k1(()=>import("./DashboardPage-B4dS4kx6.js").then(o=>o.D),[])).DashboardPage}));function NR(){return b.jsx(o2,{children:b.jsx(S2,{children:b.jsx(y.Suspense,{fallback:b.jsx(RR,{}),children:b.jsx(kS,{children:b.jsxs(po,{element:b.jsx(TR,{}),children:[b.jsx(po,{path:"/",element:b.jsx(Pg,{})}),b.jsx(po,{path:"/nodes",element:b.jsx(hg,{to:"/",replace:!0})}),b.jsx(po,{path:"/tasks",element:b.jsx(hg,{to:"/",replace:!0})}),b.jsx(po,{path:"/tasks/:id",element:b.jsx(Pg,{})})]})})})})})}function RR(){return b.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background text-sm text-muted-foreground",children:"Loading workspace..."})}function AR(a){if(typeof document>"u")return;let o=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",o.appendChild(r),r.styleSheet?r.styleSheet.cssText=a:r.appendChild(document.createTextNode(a))}const _R=a=>{switch(a){case"success":return DR;case"info":return zR;case"warning":return jR;case"error":return kR;default:return null}},OR=Array(12).fill(0),MR=({visible:a,className:o})=>I.createElement("div",{className:["sonner-loading-wrapper",o].filter(Boolean).join(" "),"data-visible":a},I.createElement("div",{className:"sonner-spinner"},OR.map((r,i)=>I.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${i}`})))),DR=I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},I.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),jR=I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},I.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),zR=I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},I.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),kR=I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},I.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),LR=I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},I.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),I.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),UR=()=>{const[a,o]=I.useState(document.hidden);return I.useEffect(()=>{const r=()=>{o(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),a};let _f=1;class BR{constructor(){this.subscribe=o=>(this.subscribers.push(o),()=>{const r=this.subscribers.indexOf(o);this.subscribers.splice(r,1)}),this.publish=o=>{this.subscribers.forEach(r=>r(o))},this.addToast=o=>{this.publish(o),this.toasts=[...this.toasts,o]},this.create=o=>{var r;const{message:i,...c}=o,f=typeof(o==null?void 0:o.id)=="number"||((r=o.id)==null?void 0:r.length)>0?o.id:_f++,d=this.toasts.find(h=>h.id===f),m=o.dismissible===void 0?!0:o.dismissible;return this.dismissedToasts.has(f)&&this.dismissedToasts.delete(f),d?this.toasts=this.toasts.map(h=>h.id===f?(this.publish({...h,...o,id:f,title:i}),{...h,...o,id:f,dismissible:m,title:i}):h):this.addToast({title:i,...c,dismissible:m,id:f}),f},this.dismiss=o=>(o?(this.dismissedToasts.add(o),requestAnimationFrame(()=>this.subscribers.forEach(r=>r({id:o,dismiss:!0})))):this.toasts.forEach(r=>{this.subscribers.forEach(i=>i({id:r.id,dismiss:!0}))}),o),this.message=(o,r)=>this.create({...r,message:o}),this.error=(o,r)=>this.create({...r,message:o,type:"error"}),this.success=(o,r)=>this.create({...r,type:"success",message:o}),this.info=(o,r)=>this.create({...r,type:"info",message:o}),this.warning=(o,r)=>this.create({...r,type:"warning",message:o}),this.loading=(o,r)=>this.create({...r,type:"loading",message:o}),this.promise=(o,r)=>{if(!r)return;let i;r.loading!==void 0&&(i=this.create({...r,promise:o,type:"loading",message:r.loading,description:typeof r.description!="function"?r.description:void 0}));const c=Promise.resolve(o instanceof Function?o():o);let f=i!==void 0,d;const m=c.then(async p=>{if(d=["resolve",p],I.isValidElement(p))f=!1,this.create({id:i,type:"default",message:p});else if(VR(p)&&!p.ok){f=!1;const v=typeof r.error=="function"?await r.error(`HTTP error! status: ${p.status}`):r.error,w=typeof r.description=="function"?await r.description(`HTTP error! status: ${p.status}`):r.description,_=typeof v=="object"&&!I.isValidElement(v)?v:{message:v};this.create({id:i,type:"error",description:w,..._})}else if(p instanceof Error){f=!1;const v=typeof r.error=="function"?await r.error(p):r.error,w=typeof r.description=="function"?await r.description(p):r.description,_=typeof v=="object"&&!I.isValidElement(v)?v:{message:v};this.create({id:i,type:"error",description:w,..._})}else if(r.success!==void 0){f=!1;const v=typeof r.success=="function"?await r.success(p):r.success,w=typeof r.description=="function"?await r.description(p):r.description,_=typeof v=="object"&&!I.isValidElement(v)?v:{message:v};this.create({id:i,type:"success",description:w,..._})}}).catch(async p=>{if(d=["reject",p],r.error!==void 0){f=!1;const x=typeof r.error=="function"?await r.error(p):r.error,v=typeof r.description=="function"?await r.description(p):r.description,N=typeof x=="object"&&!I.isValidElement(x)?x:{message:x};this.create({id:i,type:"error",description:v,...N})}}).finally(()=>{f&&(this.dismiss(i),i=void 0),r.finally==null||r.finally.call(r)}),h=()=>new Promise((p,x)=>m.then(()=>d[0]==="reject"?x(d[1]):p(d[1])).catch(x));return typeof i!="string"&&typeof i!="number"?{unwrap:h}:Object.assign(i,{unwrap:h})},this.custom=(o,r)=>{const i=(r==null?void 0:r.id)||_f++;return this.create({jsx:o(i),id:i,...r}),i},this.getActiveToasts=()=>this.toasts.filter(o=>!this.dismissedToasts.has(o.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Ht=new BR,HR=(a,o)=>{const r=(o==null?void 0:o.id)||_f++;return Ht.addToast({title:a,...o,id:r}),r},VR=a=>a&&typeof a=="object"&&"ok"in a&&typeof a.ok=="boolean"&&"status"in a&&typeof a.status=="number",YR=HR,qR=()=>Ht.toasts,GR=()=>Ht.getActiveToasts(),MA=Object.assign(YR,{success:Ht.success,info:Ht.info,warning:Ht.warning,error:Ht.error,custom:Ht.custom,message:Ht.message,promise:Ht.promise,dismiss:Ht.dismiss,loading:Ht.loading},{getHistory:qR,getToasts:GR});AR("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function ls(a){return a.label!==void 0}const XR=3,QR="24px",ZR="16px",Wg=4e3,KR=356,$R=14,JR=45,FR=200;function An(...a){return a.filter(Boolean).join(" ")}function PR(a){const[o,r]=a.split("-"),i=[];return o&&i.push(o),r&&i.push(r),i}const WR=a=>{var o,r,i,c,f,d,m,h,p;const{invert:x,toast:v,unstyled:w,interacting:N,setHeights:_,visibleToasts:E,heights:C,index:T,toasts:j,expanded:D,removeToast:B,defaultRichColors:K,closeButton:F,style:q,cancelButtonStyle:V,actionButtonStyle:ae,className:he="",descriptionClassName:pe="",duration:fe,position:me,gap:ge,expandByDefault:ce,classNames:O,icons:Y,closeButtonAriaLabel:J="Close toast"}=a,[le,P]=I.useState(null),[R,G]=I.useState(null),[Q,W]=I.useState(!1),[ee,ne]=I.useState(!1),[te,oe]=I.useState(!1),[ie,Te]=I.useState(!1),[we,xe]=I.useState(!1),[Ie,Xe]=I.useState(0),[fn,Wt]=I.useState(0),Yt=I.useRef(v.duration||fe||Wg),Ka=I.useRef(null),dt=I.useRef(null),No=T===0,Ro=T+1<=E,Tt=v.type,ca=v.dismissible!==!1,Nt=v.className||"",zs=v.descriptionClassName||"",$a=I.useMemo(()=>C.findIndex(be=>be.toastId===v.id)||0,[C,v.id]),zr=I.useMemo(()=>{var be;return(be=v.closeButton)!=null?be:F},[v.closeButton,F]),Ja=I.useMemo(()=>v.duration||fe||Wg,[v.duration,fe]),Ao=I.useRef(0),Vn=I.useRef(0),kr=I.useRef(0),fa=I.useRef(null),[Fa,Rt]=me.split("-"),dn=I.useMemo(()=>C.reduce((be,$e,mt)=>mt>=$a?be:be+$e.height,0),[C,$a]),St=UR(),ks=v.invert||x,_o=Tt==="loading";Vn.current=I.useMemo(()=>$a*ge+dn,[$a,dn]),I.useEffect(()=>{Yt.current=Ja},[Ja]),I.useEffect(()=>{W(!0)},[]),I.useEffect(()=>{const be=dt.current;if(be){const $e=be.getBoundingClientRect().height;return Wt($e),_(mt=>[{toastId:v.id,height:$e,position:v.position},...mt]),()=>_(mt=>mt.filter(wt=>wt.toastId!==v.id))}},[_,v.id]),I.useLayoutEffect(()=>{if(!Q)return;const be=dt.current,$e=be.style.height;be.style.height="auto";const mt=be.getBoundingClientRect().height;be.style.height=$e,Wt(mt),_(wt=>wt.find(We=>We.toastId===v.id)?wt.map(We=>We.toastId===v.id?{...We,height:mt}:We):[{toastId:v.id,height:mt,position:v.position},...wt])},[Q,v.title,v.description,_,v.id,v.jsx,v.action,v.cancel]);const wn=I.useCallback(()=>{ne(!0),Xe(Vn.current),_(be=>be.filter($e=>$e.toastId!==v.id)),setTimeout(()=>{B(v)},FR)},[v,B,_,Vn]);I.useEffect(()=>{if(v.promise&&Tt==="loading"||v.duration===1/0||v.type==="loading")return;let be;return D||N||St?(()=>{if(kr.current<Ao.current){const wt=new Date().getTime()-Ao.current;Yt.current=Yt.current-wt}kr.current=new Date().getTime()})():(()=>{Yt.current!==1/0&&(Ao.current=new Date().getTime(),be=setTimeout(()=>{v.onAutoClose==null||v.onAutoClose.call(v,v),wn()},Yt.current))})(),()=>clearTimeout(be)},[D,N,v,Tt,St,wn]),I.useEffect(()=>{v.delete&&(wn(),v.onDismiss==null||v.onDismiss.call(v,v))},[wn,v.delete]);function Cl(){var be;if(Y!=null&&Y.loading){var $e;return I.createElement("div",{className:An(O==null?void 0:O.loader,v==null||($e=v.classNames)==null?void 0:$e.loader,"sonner-loader"),"data-visible":Tt==="loading"},Y.loading)}return I.createElement(MR,{className:An(O==null?void 0:O.loader,v==null||(be=v.classNames)==null?void 0:be.loader),visible:Tt==="loading"})}const Tl=v.icon||(Y==null?void 0:Y[Tt])||_R(Tt);var Pa,En;return I.createElement("li",{tabIndex:0,ref:dt,className:An(he,Nt,O==null?void 0:O.toast,v==null||(o=v.classNames)==null?void 0:o.toast,O==null?void 0:O.default,O==null?void 0:O[Tt],v==null||(r=v.classNames)==null?void 0:r[Tt]),"data-sonner-toast":"","data-rich-colors":(Pa=v.richColors)!=null?Pa:K,"data-styled":!(v.jsx||v.unstyled||w),"data-mounted":Q,"data-promise":!!v.promise,"data-swiped":we,"data-removed":ee,"data-visible":Ro,"data-y-position":Fa,"data-x-position":Rt,"data-index":T,"data-front":No,"data-swiping":te,"data-dismissible":ca,"data-type":Tt,"data-invert":ks,"data-swipe-out":ie,"data-swipe-direction":R,"data-expanded":!!(D||ce&&Q),"data-testid":v.testId,style:{"--index":T,"--toasts-before":T,"--z-index":j.length-T,"--offset":`${ee?Ie:Vn.current}px`,"--initial-height":ce?"auto":`${fn}px`,...q,...v.style},onDragEnd:()=>{oe(!1),P(null),fa.current=null},onPointerDown:be=>{be.button!==2&&(_o||!ca||(Ka.current=new Date,Xe(Vn.current),be.target.setPointerCapture(be.pointerId),be.target.tagName!=="BUTTON"&&(oe(!0),fa.current={x:be.clientX,y:be.clientY})))},onPointerUp:()=>{var be,$e,mt;if(ie||!ca)return;fa.current=null;const wt=Number(((be=dt.current)==null?void 0:be.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),da=Number((($e=dt.current)==null?void 0:$e.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),We=new Date().getTime()-((mt=Ka.current)==null?void 0:mt.getTime()),_t=le==="x"?wt:da,Wa=Math.abs(_t)/We;if(Math.abs(_t)>=JR||Wa>.11){Xe(Vn.current),v.onDismiss==null||v.onDismiss.call(v,v),G(le==="x"?wt>0?"right":"left":da>0?"down":"up"),wn(),Te(!0);return}else{var Ot,Mt;(Ot=dt.current)==null||Ot.style.setProperty("--swipe-amount-x","0px"),(Mt=dt.current)==null||Mt.style.setProperty("--swipe-amount-y","0px")}xe(!1),oe(!1),P(null)},onPointerMove:be=>{var $e,mt,wt;if(!fa.current||!ca||(($e=window.getSelection())==null?void 0:$e.toString().length)>0)return;const We=be.clientY-fa.current.y,_t=be.clientX-fa.current.x;var Wa;const Ot=(Wa=a.swipeDirections)!=null?Wa:PR(me);!le&&(Math.abs(_t)>1||Math.abs(We)>1)&&P(Math.abs(_t)>Math.abs(We)?"x":"y");let Mt={x:0,y:0};const Nl=mn=>1/(1.5+Math.abs(mn)/20);if(le==="y"){if(Ot.includes("top")||Ot.includes("bottom"))if(Ot.includes("top")&&We<0||Ot.includes("bottom")&&We>0)Mt.y=We;else{const mn=We*Nl(We);Mt.y=Math.abs(mn)<Math.abs(We)?mn:We}}else if(le==="x"&&(Ot.includes("left")||Ot.includes("right")))if(Ot.includes("left")&&_t<0||Ot.includes("right")&&_t>0)Mt.x=_t;else{const mn=_t*Nl(_t);Mt.x=Math.abs(mn)<Math.abs(_t)?mn:_t}(Math.abs(Mt.x)>0||Math.abs(Mt.y)>0)&&xe(!0),(mt=dt.current)==null||mt.style.setProperty("--swipe-amount-x",`${Mt.x}px`),(wt=dt.current)==null||wt.style.setProperty("--swipe-amount-y",`${Mt.y}px`)}},zr&&!v.jsx&&Tt!=="loading"?I.createElement("button",{"aria-label":J,"data-disabled":_o,"data-close-button":!0,onClick:_o||!ca?()=>{}:()=>{wn(),v.onDismiss==null||v.onDismiss.call(v,v)},className:An(O==null?void 0:O.closeButton,v==null||(i=v.classNames)==null?void 0:i.closeButton)},(En=Y==null?void 0:Y.close)!=null?En:LR):null,(Tt||v.icon||v.promise)&&v.icon!==null&&((Y==null?void 0:Y[Tt])!==null||v.icon)?I.createElement("div",{"data-icon":"",className:An(O==null?void 0:O.icon,v==null||(c=v.classNames)==null?void 0:c.icon)},v.promise||v.type==="loading"&&!v.icon?v.icon||Cl():null,v.type!=="loading"?Tl:null):null,I.createElement("div",{"data-content":"",className:An(O==null?void 0:O.content,v==null||(f=v.classNames)==null?void 0:f.content)},I.createElement("div",{"data-title":"",className:An(O==null?void 0:O.title,v==null||(d=v.classNames)==null?void 0:d.title)},v.jsx?v.jsx:typeof v.title=="function"?v.title():v.title),v.description?I.createElement("div",{"data-description":"",className:An(pe,zs,O==null?void 0:O.description,v==null||(m=v.classNames)==null?void 0:m.description)},typeof v.description=="function"?v.description():v.description):null),I.isValidElement(v.cancel)?v.cancel:v.cancel&&ls(v.cancel)?I.createElement("button",{"data-button":!0,"data-cancel":!0,style:v.cancelButtonStyle||V,onClick:be=>{ls(v.cancel)&&ca&&(v.cancel.onClick==null||v.cancel.onClick.call(v.cancel,be),wn())},className:An(O==null?void 0:O.cancelButton,v==null||(h=v.classNames)==null?void 0:h.cancelButton)},v.cancel.label):null,I.isValidElement(v.action)?v.action:v.action&&ls(v.action)?I.createElement("button",{"data-button":!0,"data-action":!0,style:v.actionButtonStyle||ae,onClick:be=>{ls(v.action)&&(v.action.onClick==null||v.action.onClick.call(v.action,be),!be.defaultPrevented&&wn())},className:An(O==null?void 0:O.actionButton,v==null||(p=v.classNames)==null?void 0:p.actionButton)},v.action.label):null)};function Ig(){if(typeof window>"u"||typeof document>"u")return"ltr";const a=document.documentElement.getAttribute("dir");return a==="auto"||!a?window.getComputedStyle(document.documentElement).direction:a}function IR(a,o){const r={};return[a,o].forEach((i,c)=>{const f=c===1,d=f?"--mobile-offset":"--offset",m=f?ZR:QR;function h(p){["top","right","bottom","left"].forEach(x=>{r[`${d}-${x}`]=typeof p=="number"?`${p}px`:p})}typeof i=="number"||typeof i=="string"?h(i):typeof i=="object"?["top","right","bottom","left"].forEach(p=>{i[p]===void 0?r[`${d}-${p}`]=m:r[`${d}-${p}`]=typeof i[p]=="number"?`${i[p]}px`:i[p]}):h(m)}),r}const eA=I.forwardRef(function(o,r){const{id:i,invert:c,position:f="bottom-right",hotkey:d=["altKey","KeyT"],expand:m,closeButton:h,className:p,offset:x,mobileOffset:v,theme:w="light",richColors:N,duration:_,style:E,visibleToasts:C=XR,toastOptions:T,dir:j=Ig(),gap:D=$R,icons:B,containerAriaLabel:K="Notifications"}=o,[F,q]=I.useState([]),V=I.useMemo(()=>i?F.filter(Q=>Q.toasterId===i):F.filter(Q=>!Q.toasterId),[F,i]),ae=I.useMemo(()=>Array.from(new Set([f].concat(V.filter(Q=>Q.position).map(Q=>Q.position)))),[V,f]),[he,pe]=I.useState([]),[fe,me]=I.useState(!1),[ge,ce]=I.useState(!1),[O,Y]=I.useState(w!=="system"?w:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),J=I.useRef(null),le=d.join("+").replace(/Key/g,"").replace(/Digit/g,""),P=I.useRef(null),R=I.useRef(!1),G=I.useCallback(Q=>{q(W=>{var ee;return(ee=W.find(ne=>ne.id===Q.id))!=null&&ee.delete||Ht.dismiss(Q.id),W.filter(({id:ne})=>ne!==Q.id)})},[]);return I.useEffect(()=>Ht.subscribe(Q=>{if(Q.dismiss){requestAnimationFrame(()=>{q(W=>W.map(ee=>ee.id===Q.id?{...ee,delete:!0}:ee))});return}setTimeout(()=>{wv.flushSync(()=>{q(W=>{const ee=W.findIndex(ne=>ne.id===Q.id);return ee!==-1?[...W.slice(0,ee),{...W[ee],...Q},...W.slice(ee+1)]:[Q,...W]})})})}),[F]),I.useEffect(()=>{if(w!=="system"){Y(w);return}if(w==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?Y("dark"):Y("light")),typeof window>"u")return;const Q=window.matchMedia("(prefers-color-scheme: dark)");try{Q.addEventListener("change",({matches:W})=>{Y(W?"dark":"light")})}catch{Q.addListener(({matches:ee})=>{try{Y(ee?"dark":"light")}catch(ne){console.error(ne)}})}},[w]),I.useEffect(()=>{F.length<=1&&me(!1)},[F]),I.useEffect(()=>{const Q=W=>{var ee;if(d.every(oe=>W[oe]||W.code===oe)){var te;me(!0),(te=J.current)==null||te.focus()}W.code==="Escape"&&(document.activeElement===J.current||(ee=J.current)!=null&&ee.contains(document.activeElement))&&me(!1)};return document.addEventListener("keydown",Q),()=>document.removeEventListener("keydown",Q)},[d]),I.useEffect(()=>{if(J.current)return()=>{P.current&&(P.current.focus({preventScroll:!0}),P.current=null,R.current=!1)}},[J.current]),I.createElement("section",{ref:r,"aria-label":`${K} ${le}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},ae.map((Q,W)=>{var ee;const[ne,te]=Q.split("-");return V.length?I.createElement("ol",{key:Q,dir:j==="auto"?Ig():j,tabIndex:-1,ref:J,className:p,"data-sonner-toaster":!0,"data-sonner-theme":O,"data-y-position":ne,"data-x-position":te,style:{"--front-toast-height":`${((ee=he[0])==null?void 0:ee.height)||0}px`,"--width":`${KR}px`,"--gap":`${D}px`,...E,...IR(x,v)},onBlur:oe=>{R.current&&!oe.currentTarget.contains(oe.relatedTarget)&&(R.current=!1,P.current&&(P.current.focus({preventScroll:!0}),P.current=null))},onFocus:oe=>{oe.target instanceof HTMLElement&&oe.target.dataset.dismissible==="false"||R.current||(R.current=!0,P.current=oe.relatedTarget)},onMouseEnter:()=>me(!0),onMouseMove:()=>me(!0),onMouseLeave:()=>{ge||me(!1)},onDragEnd:()=>me(!1),onPointerDown:oe=>{oe.target instanceof HTMLElement&&oe.target.dataset.dismissible==="false"||ce(!0)},onPointerUp:()=>ce(!1)},V.filter(oe=>!oe.position&&W===0||oe.position===Q).map((oe,ie)=>{var Te,we;return I.createElement(WR,{key:oe.id,icons:B,index:ie,toast:oe,defaultRichColors:N,duration:(Te=T==null?void 0:T.duration)!=null?Te:_,className:T==null?void 0:T.className,descriptionClassName:T==null?void 0:T.descriptionClassName,invert:c,visibleToasts:C,closeButton:(we=T==null?void 0:T.closeButton)!=null?we:h,interacting:ge,position:Q,style:T==null?void 0:T.style,unstyled:T==null?void 0:T.unstyled,classNames:T==null?void 0:T.classNames,cancelButtonStyle:T==null?void 0:T.cancelButtonStyle,actionButtonStyle:T==null?void 0:T.actionButtonStyle,closeButtonAriaLabel:T==null?void 0:T.closeButtonAriaLabel,removeToast:G,toasts:V.filter(xe=>xe.position==oe.position),heights:he.filter(xe=>xe.position==oe.position),setHeights:pe,expandByDefault:m,gap:D,expanded:fe,swipeDirections:o.swipeDirections})})):null}))});function tA(a){return b.jsx(eA,{className:"toaster group",style:{"--normal-bg":"hsl(var(--popover))","--normal-text":"hsl(var(--popover-foreground))","--normal-border":"hsl(var(--border))"},...a})}D1.createRoot(document.getElementById("root")).render(b.jsx(y.StrictMode,{children:b.jsxs(hE,{children:[b.jsx(NR,{}),b.jsx(tA,{})]})}));export{K2 as $,sA as A,Vt as B,L2 as C,My as D,mA as E,J2 as F,MA as G,V0 as H,PN as I,G0 as J,X0 as K,pR as L,TA as M,NA as N,Ty as O,FC as P,cb as Q,$C as R,FN as S,JC as T,cs as U,fs as V,_A as W,hw as X,Av as Y,$v as Z,k1 as _,Be as a,yE as a0,Mr as a1,Le as a2,Tr as a3,bN as a4,sN as a5,G2 as a6,nA as a7,Bn as a8,dv as a9,Cv as aa,fA as ab,y2 as ac,dA as ad,yA as ae,bA as af,gA as ag,vA as ah,pA as ai,hA as aj,lA as ak,rA as al,aA as am,iA as an,PC as ao,ev as ap,xA as aq,SA as ar,wA as as,EA as at,OA as au,CA as av,vw as b,at as c,Dv as d,oA as e,Dy as f,jy as g,eT as h,Yf as i,b as j,Nv as k,H2 as l,Rv as m,AA as n,Ny as o,De as p,Ry as q,y as r,Ay as s,_y as t,nt as u,RA as v,wo as w,mE as x,uA as y,cA as z};
249
+ For more information, see https://radix-ui.com/primitives/docs/components/${o.docsSlug}`;return y.useEffect(()=>{a&&(document.getElementById(a)||console.error(r))},[r,a]),null},ZC="DialogDescriptionWarning",KC=({contentRef:a,descriptionId:o})=>{const i=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Cy(ZC).contentName}}.`;return y.useEffect(()=>{var f;const c=(f=a.current)==null?void 0:f.getAttribute("aria-describedby");o&&c&&(document.getElementById(o)||console.warn(i))},[i,a,o]),null},$C=cy,JC=dy,FC=hy,Ty=py,Ny=gy,Ry=yy,Ay=xy,_y=wy;const PC=$C,WC=JC,IC=FC,OA=_y,Oy=y.forwardRef(({className:a,...o},r)=>b.jsx(Ty,{ref:r,className:Be("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",a),...o}));Oy.displayName=Ty.displayName;const My=y.forwardRef(({className:a,children:o,...r},i)=>b.jsxs(IC,{children:[b.jsx(Oy,{}),b.jsxs(Ny,{ref:i,className:Be("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",a),...r,children:[o,b.jsxs(_y,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[b.jsx(hw,{className:"h-4 w-4"}),b.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));My.displayName=Ny.displayName;const Dy=({className:a,...o})=>b.jsx("div",{className:Be("flex flex-col space-y-1.5 text-center sm:text-left",a),...o});Dy.displayName="DialogHeader";const eT=({className:a,...o})=>b.jsx("div",{className:Be("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",a),...o});eT.displayName="DialogFooter";const jy=y.forwardRef(({className:a,...o},r)=>b.jsx(Ry,{ref:r,className:Be("text-lg font-semibold leading-none tracking-tight",a),...o}));jy.displayName=Ry.displayName;const zy=y.forwardRef(({className:a,...o},r)=>b.jsx(Ay,{ref:r,className:Be("text-sm text-muted-foreground",a),...o}));zy.displayName=Ay.displayName;function Bg(a,[o,r]){return Math.min(r,Math.max(o,a))}function ky(a){const o=a+"CollectionProvider",[r,i]=wo(o),[c,f]=r(o,{collectionRef:{current:null},itemMap:new Map}),d=E=>{const{scope:C,children:T}=E,j=I.useRef(null),D=I.useRef(new Map).current;return b.jsx(c,{scope:C,itemMap:D,collectionRef:j,children:T})};d.displayName=o;const m=a+"CollectionSlot",h=Nr(m),p=I.forwardRef((E,C)=>{const{scope:T,children:j}=E,D=f(m,T),B=nt(C,D.collectionRef);return b.jsx(h,{ref:B,children:j})});p.displayName=m;const x=a+"CollectionItemSlot",v="data-radix-collection-item",w=Nr(x),N=I.forwardRef((E,C)=>{const{scope:T,children:j,...D}=E,B=I.useRef(null),K=nt(C,B),F=f(x,T);return I.useEffect(()=>(F.itemMap.set(B,{ref:B,...D}),()=>void F.itemMap.delete(B))),b.jsx(w,{[v]:"",ref:K,children:j})});N.displayName=x;function _(E){const C=f(a+"CollectionConsumer",E);return I.useCallback(()=>{const j=C.collectionRef.current;if(!j)return[];const D=Array.from(j.querySelectorAll(`[${v}]`));return Array.from(C.itemMap.values()).sort((F,q)=>D.indexOf(F.ref.current)-D.indexOf(q.ref.current))},[C.collectionRef,C.itemMap])}return[{Provider:d,Slot:p,ItemSlot:N},_,i]}var tT=y.createContext(void 0);function Jf(a){const o=y.useContext(tT);return a||o||"ltr"}const nT=["top","right","bottom","left"],qa=Math.min,Jt=Math.max,gs=Math.round,ns=Math.floor,Un=a=>({x:a,y:a}),aT={left:"right",right:"left",bottom:"top",top:"bottom"};function xf(a,o,r){return Jt(a,qa(o,r))}function ia(a,o){return typeof a=="function"?a(o):a}function sa(a){return a.split("-")[0]}function Eo(a){return a.split("-")[1]}function Ff(a){return a==="x"?"y":"x"}function Pf(a){return a==="y"?"height":"width"}function kn(a){const o=a[0];return o==="t"||o==="b"?"y":"x"}function Wf(a){return Ff(kn(a))}function lT(a,o,r){r===void 0&&(r=!1);const i=Eo(a),c=Wf(a),f=Pf(c);let d=c==="x"?i===(r?"end":"start")?"right":"left":i==="start"?"bottom":"top";return o.reference[f]>o.floating[f]&&(d=vs(d)),[d,vs(d)]}function oT(a){const o=vs(a);return[Sf(a),o,Sf(o)]}function Sf(a){return a.includes("start")?a.replace("start","end"):a.replace("end","start")}const Hg=["left","right"],Vg=["right","left"],rT=["top","bottom"],iT=["bottom","top"];function sT(a,o,r){switch(a){case"top":case"bottom":return r?o?Vg:Hg:o?Hg:Vg;case"left":case"right":return o?rT:iT;default:return[]}}function uT(a,o,r,i){const c=Eo(a);let f=sT(sa(a),r==="start",i);return c&&(f=f.map(d=>d+"-"+c),o&&(f=f.concat(f.map(Sf)))),f}function vs(a){const o=sa(a);return aT[o]+a.slice(o.length)}function cT(a){return{top:0,right:0,bottom:0,left:0,...a}}function Ly(a){return typeof a!="number"?cT(a):{top:a,right:a,bottom:a,left:a}}function ys(a){const{x:o,y:r,width:i,height:c}=a;return{width:i,height:c,top:r,left:o,right:o+i,bottom:r+c,x:o,y:r}}function Yg(a,o,r){let{reference:i,floating:c}=a;const f=kn(o),d=Wf(o),m=Pf(d),h=sa(o),p=f==="y",x=i.x+i.width/2-c.width/2,v=i.y+i.height/2-c.height/2,w=i[m]/2-c[m]/2;let N;switch(h){case"top":N={x,y:i.y-c.height};break;case"bottom":N={x,y:i.y+i.height};break;case"right":N={x:i.x+i.width,y:v};break;case"left":N={x:i.x-c.width,y:v};break;default:N={x:i.x,y:i.y}}switch(Eo(o)){case"start":N[d]-=w*(r&&p?-1:1);break;case"end":N[d]+=w*(r&&p?-1:1);break}return N}async function fT(a,o){var r;o===void 0&&(o={});const{x:i,y:c,platform:f,rects:d,elements:m,strategy:h}=a,{boundary:p="clippingAncestors",rootBoundary:x="viewport",elementContext:v="floating",altBoundary:w=!1,padding:N=0}=ia(o,a),_=Ly(N),C=m[w?v==="floating"?"reference":"floating":v],T=ys(await f.getClippingRect({element:(r=await(f.isElement==null?void 0:f.isElement(C)))==null||r?C:C.contextElement||await(f.getDocumentElement==null?void 0:f.getDocumentElement(m.floating)),boundary:p,rootBoundary:x,strategy:h})),j=v==="floating"?{x:i,y:c,width:d.floating.width,height:d.floating.height}:d.reference,D=await(f.getOffsetParent==null?void 0:f.getOffsetParent(m.floating)),B=await(f.isElement==null?void 0:f.isElement(D))?await(f.getScale==null?void 0:f.getScale(D))||{x:1,y:1}:{x:1,y:1},K=ys(f.convertOffsetParentRelativeRectToViewportRelativeRect?await f.convertOffsetParentRelativeRectToViewportRelativeRect({elements:m,rect:j,offsetParent:D,strategy:h}):j);return{top:(T.top-K.top+_.top)/B.y,bottom:(K.bottom-T.bottom+_.bottom)/B.y,left:(T.left-K.left+_.left)/B.x,right:(K.right-T.right+_.right)/B.x}}const dT=50,mT=async(a,o,r)=>{const{placement:i="bottom",strategy:c="absolute",middleware:f=[],platform:d}=r,m=d.detectOverflow?d:{...d,detectOverflow:fT},h=await(d.isRTL==null?void 0:d.isRTL(o));let p=await d.getElementRects({reference:a,floating:o,strategy:c}),{x,y:v}=Yg(p,i,h),w=i,N=0;const _={};for(let E=0;E<f.length;E++){const C=f[E];if(!C)continue;const{name:T,fn:j}=C,{x:D,y:B,data:K,reset:F}=await j({x,y:v,initialPlacement:i,placement:w,strategy:c,middlewareData:_,rects:p,platform:m,elements:{reference:a,floating:o}});x=D??x,v=B??v,_[T]={..._[T],...K},F&&N<dT&&(N++,typeof F=="object"&&(F.placement&&(w=F.placement),F.rects&&(p=F.rects===!0?await d.getElementRects({reference:a,floating:o,strategy:c}):F.rects),{x,y:v}=Yg(p,w,h)),E=-1)}return{x,y:v,placement:w,strategy:c,middlewareData:_}},hT=a=>({name:"arrow",options:a,async fn(o){const{x:r,y:i,placement:c,rects:f,platform:d,elements:m,middlewareData:h}=o,{element:p,padding:x=0}=ia(a,o)||{};if(p==null)return{};const v=Ly(x),w={x:r,y:i},N=Wf(c),_=Pf(N),E=await d.getDimensions(p),C=N==="y",T=C?"top":"left",j=C?"bottom":"right",D=C?"clientHeight":"clientWidth",B=f.reference[_]+f.reference[N]-w[N]-f.floating[_],K=w[N]-f.reference[N],F=await(d.getOffsetParent==null?void 0:d.getOffsetParent(p));let q=F?F[D]:0;(!q||!await(d.isElement==null?void 0:d.isElement(F)))&&(q=m.floating[D]||f.floating[_]);const V=B/2-K/2,ae=q/2-E[_]/2-1,he=qa(v[T],ae),pe=qa(v[j],ae),fe=he,me=q-E[_]-pe,ge=q/2-E[_]/2+V,ce=xf(fe,ge,me),O=!h.arrow&&Eo(c)!=null&&ge!==ce&&f.reference[_]/2-(ge<fe?he:pe)-E[_]/2<0,Y=O?ge<fe?ge-fe:ge-me:0;return{[N]:w[N]+Y,data:{[N]:ce,centerOffset:ge-ce-Y,...O&&{alignmentOffset:Y}},reset:O}}}),pT=function(a){return a===void 0&&(a={}),{name:"flip",options:a,async fn(o){var r,i;const{placement:c,middlewareData:f,rects:d,initialPlacement:m,platform:h,elements:p}=o,{mainAxis:x=!0,crossAxis:v=!0,fallbackPlacements:w,fallbackStrategy:N="bestFit",fallbackAxisSideDirection:_="none",flipAlignment:E=!0,...C}=ia(a,o);if((r=f.arrow)!=null&&r.alignmentOffset)return{};const T=sa(c),j=kn(m),D=sa(m)===m,B=await(h.isRTL==null?void 0:h.isRTL(p.floating)),K=w||(D||!E?[vs(m)]:oT(m)),F=_!=="none";!w&&F&&K.push(...uT(m,E,_,B));const q=[m,...K],V=await h.detectOverflow(o,C),ae=[];let he=((i=f.flip)==null?void 0:i.overflows)||[];if(x&&ae.push(V[T]),v){const ge=lT(c,d,B);ae.push(V[ge[0]],V[ge[1]])}if(he=[...he,{placement:c,overflows:ae}],!ae.every(ge=>ge<=0)){var pe,fe;const ge=(((pe=f.flip)==null?void 0:pe.index)||0)+1,ce=q[ge];if(ce&&(!(v==="alignment"?j!==kn(ce):!1)||he.every(J=>kn(J.placement)===j?J.overflows[0]>0:!0)))return{data:{index:ge,overflows:he},reset:{placement:ce}};let O=(fe=he.filter(Y=>Y.overflows[0]<=0).sort((Y,J)=>Y.overflows[1]-J.overflows[1])[0])==null?void 0:fe.placement;if(!O)switch(N){case"bestFit":{var me;const Y=(me=he.filter(J=>{if(F){const le=kn(J.placement);return le===j||le==="y"}return!0}).map(J=>[J.placement,J.overflows.filter(le=>le>0).reduce((le,P)=>le+P,0)]).sort((J,le)=>J[1]-le[1])[0])==null?void 0:me[0];Y&&(O=Y);break}case"initialPlacement":O=m;break}if(c!==O)return{reset:{placement:O}}}return{}}}};function qg(a,o){return{top:a.top-o.height,right:a.right-o.width,bottom:a.bottom-o.height,left:a.left-o.width}}function Gg(a){return nT.some(o=>a[o]>=0)}const gT=function(a){return a===void 0&&(a={}),{name:"hide",options:a,async fn(o){const{rects:r,platform:i}=o,{strategy:c="referenceHidden",...f}=ia(a,o);switch(c){case"referenceHidden":{const d=await i.detectOverflow(o,{...f,elementContext:"reference"}),m=qg(d,r.reference);return{data:{referenceHiddenOffsets:m,referenceHidden:Gg(m)}}}case"escaped":{const d=await i.detectOverflow(o,{...f,altBoundary:!0}),m=qg(d,r.floating);return{data:{escapedOffsets:m,escaped:Gg(m)}}}default:return{}}}}},Uy=new Set(["left","top"]);async function vT(a,o){const{placement:r,platform:i,elements:c}=a,f=await(i.isRTL==null?void 0:i.isRTL(c.floating)),d=sa(r),m=Eo(r),h=kn(r)==="y",p=Uy.has(d)?-1:1,x=f&&h?-1:1,v=ia(o,a);let{mainAxis:w,crossAxis:N,alignmentAxis:_}=typeof v=="number"?{mainAxis:v,crossAxis:0,alignmentAxis:null}:{mainAxis:v.mainAxis||0,crossAxis:v.crossAxis||0,alignmentAxis:v.alignmentAxis};return m&&typeof _=="number"&&(N=m==="end"?_*-1:_),h?{x:N*x,y:w*p}:{x:w*p,y:N*x}}const yT=function(a){return a===void 0&&(a=0),{name:"offset",options:a,async fn(o){var r,i;const{x:c,y:f,placement:d,middlewareData:m}=o,h=await vT(o,a);return d===((r=m.offset)==null?void 0:r.placement)&&(i=m.arrow)!=null&&i.alignmentOffset?{}:{x:c+h.x,y:f+h.y,data:{...h,placement:d}}}}},bT=function(a){return a===void 0&&(a={}),{name:"shift",options:a,async fn(o){const{x:r,y:i,placement:c,platform:f}=o,{mainAxis:d=!0,crossAxis:m=!1,limiter:h={fn:T=>{let{x:j,y:D}=T;return{x:j,y:D}}},...p}=ia(a,o),x={x:r,y:i},v=await f.detectOverflow(o,p),w=kn(sa(c)),N=Ff(w);let _=x[N],E=x[w];if(d){const T=N==="y"?"top":"left",j=N==="y"?"bottom":"right",D=_+v[T],B=_-v[j];_=xf(D,_,B)}if(m){const T=w==="y"?"top":"left",j=w==="y"?"bottom":"right",D=E+v[T],B=E-v[j];E=xf(D,E,B)}const C=h.fn({...o,[N]:_,[w]:E});return{...C,data:{x:C.x-r,y:C.y-i,enabled:{[N]:d,[w]:m}}}}}},xT=function(a){return a===void 0&&(a={}),{options:a,fn(o){const{x:r,y:i,placement:c,rects:f,middlewareData:d}=o,{offset:m=0,mainAxis:h=!0,crossAxis:p=!0}=ia(a,o),x={x:r,y:i},v=kn(c),w=Ff(v);let N=x[w],_=x[v];const E=ia(m,o),C=typeof E=="number"?{mainAxis:E,crossAxis:0}:{mainAxis:0,crossAxis:0,...E};if(h){const D=w==="y"?"height":"width",B=f.reference[w]-f.floating[D]+C.mainAxis,K=f.reference[w]+f.reference[D]-C.mainAxis;N<B?N=B:N>K&&(N=K)}if(p){var T,j;const D=w==="y"?"width":"height",B=Uy.has(sa(c)),K=f.reference[v]-f.floating[D]+(B&&((T=d.offset)==null?void 0:T[v])||0)+(B?0:C.crossAxis),F=f.reference[v]+f.reference[D]+(B?0:((j=d.offset)==null?void 0:j[v])||0)-(B?C.crossAxis:0);_<K?_=K:_>F&&(_=F)}return{[w]:N,[v]:_}}}},ST=function(a){return a===void 0&&(a={}),{name:"size",options:a,async fn(o){var r,i;const{placement:c,rects:f,platform:d,elements:m}=o,{apply:h=()=>{},...p}=ia(a,o),x=await d.detectOverflow(o,p),v=sa(c),w=Eo(c),N=kn(c)==="y",{width:_,height:E}=f.floating;let C,T;v==="top"||v==="bottom"?(C=v,T=w===(await(d.isRTL==null?void 0:d.isRTL(m.floating))?"start":"end")?"left":"right"):(T=v,C=w==="end"?"top":"bottom");const j=E-x.top-x.bottom,D=_-x.left-x.right,B=qa(E-x[C],j),K=qa(_-x[T],D),F=!o.middlewareData.shift;let q=B,V=K;if((r=o.middlewareData.shift)!=null&&r.enabled.x&&(V=D),(i=o.middlewareData.shift)!=null&&i.enabled.y&&(q=j),F&&!w){const he=Jt(x.left,0),pe=Jt(x.right,0),fe=Jt(x.top,0),me=Jt(x.bottom,0);N?V=_-2*(he!==0||pe!==0?he+pe:Jt(x.left,x.right)):q=E-2*(fe!==0||me!==0?fe+me:Jt(x.top,x.bottom))}await h({...o,availableWidth:V,availableHeight:q});const ae=await d.getDimensions(m.floating);return _!==ae.width||E!==ae.height?{reset:{rects:!0}}:{}}}};function Ns(){return typeof window<"u"}function Co(a){return By(a)?(a.nodeName||"").toLowerCase():"#document"}function Ft(a){var o;return(a==null||(o=a.ownerDocument)==null?void 0:o.defaultView)||window}function Hn(a){var o;return(o=(By(a)?a.ownerDocument:a.document)||window.document)==null?void 0:o.documentElement}function By(a){return Ns()?a instanceof Node||a instanceof Ft(a).Node:!1}function bn(a){return Ns()?a instanceof Element||a instanceof Ft(a).Element:!1}function ua(a){return Ns()?a instanceof HTMLElement||a instanceof Ft(a).HTMLElement:!1}function Xg(a){return!Ns()||typeof ShadowRoot>"u"?!1:a instanceof ShadowRoot||a instanceof Ft(a).ShadowRoot}function Dr(a){const{overflow:o,overflowX:r,overflowY:i,display:c}=xn(a);return/auto|scroll|overlay|hidden|clip/.test(o+i+r)&&c!=="inline"&&c!=="contents"}function wT(a){return/^(table|td|th)$/.test(Co(a))}function Rs(a){try{if(a.matches(":popover-open"))return!0}catch{}try{return a.matches(":modal")}catch{return!1}}const ET=/transform|translate|scale|rotate|perspective|filter/,CT=/paint|layout|strict|content/,vl=a=>!!a&&a!=="none";let ff;function If(a){const o=bn(a)?xn(a):a;return vl(o.transform)||vl(o.translate)||vl(o.scale)||vl(o.rotate)||vl(o.perspective)||!ed()&&(vl(o.backdropFilter)||vl(o.filter))||ET.test(o.willChange||"")||CT.test(o.contain||"")}function TT(a){let o=Ga(a);for(;ua(o)&&!yo(o);){if(If(o))return o;if(Rs(o))return null;o=Ga(o)}return null}function ed(){return ff==null&&(ff=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),ff}function yo(a){return/^(html|body|#document)$/.test(Co(a))}function xn(a){return Ft(a).getComputedStyle(a)}function As(a){return bn(a)?{scrollLeft:a.scrollLeft,scrollTop:a.scrollTop}:{scrollLeft:a.scrollX,scrollTop:a.scrollY}}function Ga(a){if(Co(a)==="html")return a;const o=a.assignedSlot||a.parentNode||Xg(a)&&a.host||Hn(a);return Xg(o)?o.host:o}function Hy(a){const o=Ga(a);return yo(o)?a.ownerDocument?a.ownerDocument.body:a.body:ua(o)&&Dr(o)?o:Hy(o)}function Rr(a,o,r){var i;o===void 0&&(o=[]),r===void 0&&(r=!0);const c=Hy(a),f=c===((i=a.ownerDocument)==null?void 0:i.body),d=Ft(c);if(f){const m=wf(d);return o.concat(d,d.visualViewport||[],Dr(c)?c:[],m&&r?Rr(m):[])}else return o.concat(c,Rr(c,[],r))}function wf(a){return a.parent&&Object.getPrototypeOf(a.parent)?a.frameElement:null}function Vy(a){const o=xn(a);let r=parseFloat(o.width)||0,i=parseFloat(o.height)||0;const c=ua(a),f=c?a.offsetWidth:r,d=c?a.offsetHeight:i,m=gs(r)!==f||gs(i)!==d;return m&&(r=f,i=d),{width:r,height:i,$:m}}function td(a){return bn(a)?a:a.contextElement}function vo(a){const o=td(a);if(!ua(o))return Un(1);const r=o.getBoundingClientRect(),{width:i,height:c,$:f}=Vy(o);let d=(f?gs(r.width):r.width)/i,m=(f?gs(r.height):r.height)/c;return(!d||!Number.isFinite(d))&&(d=1),(!m||!Number.isFinite(m))&&(m=1),{x:d,y:m}}const NT=Un(0);function Yy(a){const o=Ft(a);return!ed()||!o.visualViewport?NT:{x:o.visualViewport.offsetLeft,y:o.visualViewport.offsetTop}}function RT(a,o,r){return o===void 0&&(o=!1),!r||o&&r!==Ft(a)?!1:o}function xl(a,o,r,i){o===void 0&&(o=!1),r===void 0&&(r=!1);const c=a.getBoundingClientRect(),f=td(a);let d=Un(1);o&&(i?bn(i)&&(d=vo(i)):d=vo(a));const m=RT(f,r,i)?Yy(f):Un(0);let h=(c.left+m.x)/d.x,p=(c.top+m.y)/d.y,x=c.width/d.x,v=c.height/d.y;if(f){const w=Ft(f),N=i&&bn(i)?Ft(i):i;let _=w,E=wf(_);for(;E&&i&&N!==_;){const C=vo(E),T=E.getBoundingClientRect(),j=xn(E),D=T.left+(E.clientLeft+parseFloat(j.paddingLeft))*C.x,B=T.top+(E.clientTop+parseFloat(j.paddingTop))*C.y;h*=C.x,p*=C.y,x*=C.x,v*=C.y,h+=D,p+=B,_=Ft(E),E=wf(_)}}return ys({width:x,height:v,x:h,y:p})}function _s(a,o){const r=As(a).scrollLeft;return o?o.left+r:xl(Hn(a)).left+r}function qy(a,o){const r=a.getBoundingClientRect(),i=r.left+o.scrollLeft-_s(a,r),c=r.top+o.scrollTop;return{x:i,y:c}}function AT(a){let{elements:o,rect:r,offsetParent:i,strategy:c}=a;const f=c==="fixed",d=Hn(i),m=o?Rs(o.floating):!1;if(i===d||m&&f)return r;let h={scrollLeft:0,scrollTop:0},p=Un(1);const x=Un(0),v=ua(i);if((v||!v&&!f)&&((Co(i)!=="body"||Dr(d))&&(h=As(i)),v)){const N=xl(i);p=vo(i),x.x=N.x+i.clientLeft,x.y=N.y+i.clientTop}const w=d&&!v&&!f?qy(d,h):Un(0);return{width:r.width*p.x,height:r.height*p.y,x:r.x*p.x-h.scrollLeft*p.x+x.x+w.x,y:r.y*p.y-h.scrollTop*p.y+x.y+w.y}}function _T(a){return Array.from(a.getClientRects())}function OT(a){const o=Hn(a),r=As(a),i=a.ownerDocument.body,c=Jt(o.scrollWidth,o.clientWidth,i.scrollWidth,i.clientWidth),f=Jt(o.scrollHeight,o.clientHeight,i.scrollHeight,i.clientHeight);let d=-r.scrollLeft+_s(a);const m=-r.scrollTop;return xn(i).direction==="rtl"&&(d+=Jt(o.clientWidth,i.clientWidth)-c),{width:c,height:f,x:d,y:m}}const Qg=25;function MT(a,o){const r=Ft(a),i=Hn(a),c=r.visualViewport;let f=i.clientWidth,d=i.clientHeight,m=0,h=0;if(c){f=c.width,d=c.height;const x=ed();(!x||x&&o==="fixed")&&(m=c.offsetLeft,h=c.offsetTop)}const p=_s(i);if(p<=0){const x=i.ownerDocument,v=x.body,w=getComputedStyle(v),N=x.compatMode==="CSS1Compat"&&parseFloat(w.marginLeft)+parseFloat(w.marginRight)||0,_=Math.abs(i.clientWidth-v.clientWidth-N);_<=Qg&&(f-=_)}else p<=Qg&&(f+=p);return{width:f,height:d,x:m,y:h}}function DT(a,o){const r=xl(a,!0,o==="fixed"),i=r.top+a.clientTop,c=r.left+a.clientLeft,f=ua(a)?vo(a):Un(1),d=a.clientWidth*f.x,m=a.clientHeight*f.y,h=c*f.x,p=i*f.y;return{width:d,height:m,x:h,y:p}}function Zg(a,o,r){let i;if(o==="viewport")i=MT(a,r);else if(o==="document")i=OT(Hn(a));else if(bn(o))i=DT(o,r);else{const c=Yy(a);i={x:o.x-c.x,y:o.y-c.y,width:o.width,height:o.height}}return ys(i)}function Gy(a,o){const r=Ga(a);return r===o||!bn(r)||yo(r)?!1:xn(r).position==="fixed"||Gy(r,o)}function jT(a,o){const r=o.get(a);if(r)return r;let i=Rr(a,[],!1).filter(m=>bn(m)&&Co(m)!=="body"),c=null;const f=xn(a).position==="fixed";let d=f?Ga(a):a;for(;bn(d)&&!yo(d);){const m=xn(d),h=If(d);!h&&m.position==="fixed"&&(c=null),(f?!h&&!c:!h&&m.position==="static"&&!!c&&(c.position==="absolute"||c.position==="fixed")||Dr(d)&&!h&&Gy(a,d))?i=i.filter(x=>x!==d):c=m,d=Ga(d)}return o.set(a,i),i}function zT(a){let{element:o,boundary:r,rootBoundary:i,strategy:c}=a;const d=[...r==="clippingAncestors"?Rs(o)?[]:jT(o,this._c):[].concat(r),i],m=Zg(o,d[0],c);let h=m.top,p=m.right,x=m.bottom,v=m.left;for(let w=1;w<d.length;w++){const N=Zg(o,d[w],c);h=Jt(N.top,h),p=qa(N.right,p),x=qa(N.bottom,x),v=Jt(N.left,v)}return{width:p-v,height:x-h,x:v,y:h}}function kT(a){const{width:o,height:r}=Vy(a);return{width:o,height:r}}function LT(a,o,r){const i=ua(o),c=Hn(o),f=r==="fixed",d=xl(a,!0,f,o);let m={scrollLeft:0,scrollTop:0};const h=Un(0);function p(){h.x=_s(c)}if(i||!i&&!f)if((Co(o)!=="body"||Dr(c))&&(m=As(o)),i){const N=xl(o,!0,f,o);h.x=N.x+o.clientLeft,h.y=N.y+o.clientTop}else c&&p();f&&!i&&c&&p();const x=c&&!i&&!f?qy(c,m):Un(0),v=d.left+m.scrollLeft-h.x-x.x,w=d.top+m.scrollTop-h.y-x.y;return{x:v,y:w,width:d.width,height:d.height}}function df(a){return xn(a).position==="static"}function Kg(a,o){if(!ua(a)||xn(a).position==="fixed")return null;if(o)return o(a);let r=a.offsetParent;return Hn(a)===r&&(r=r.ownerDocument.body),r}function Xy(a,o){const r=Ft(a);if(Rs(a))return r;if(!ua(a)){let c=Ga(a);for(;c&&!yo(c);){if(bn(c)&&!df(c))return c;c=Ga(c)}return r}let i=Kg(a,o);for(;i&&wT(i)&&df(i);)i=Kg(i,o);return i&&yo(i)&&df(i)&&!If(i)?r:i||TT(a)||r}const UT=async function(a){const o=this.getOffsetParent||Xy,r=this.getDimensions,i=await r(a.floating);return{reference:LT(a.reference,await o(a.floating),a.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function BT(a){return xn(a).direction==="rtl"}const HT={convertOffsetParentRelativeRectToViewportRelativeRect:AT,getDocumentElement:Hn,getClippingRect:zT,getOffsetParent:Xy,getElementRects:UT,getClientRects:_T,getDimensions:kT,getScale:vo,isElement:bn,isRTL:BT};function Qy(a,o){return a.x===o.x&&a.y===o.y&&a.width===o.width&&a.height===o.height}function VT(a,o){let r=null,i;const c=Hn(a);function f(){var m;clearTimeout(i),(m=r)==null||m.disconnect(),r=null}function d(m,h){m===void 0&&(m=!1),h===void 0&&(h=1),f();const p=a.getBoundingClientRect(),{left:x,top:v,width:w,height:N}=p;if(m||o(),!w||!N)return;const _=ns(v),E=ns(c.clientWidth-(x+w)),C=ns(c.clientHeight-(v+N)),T=ns(x),D={rootMargin:-_+"px "+-E+"px "+-C+"px "+-T+"px",threshold:Jt(0,qa(1,h))||1};let B=!0;function K(F){const q=F[0].intersectionRatio;if(q!==h){if(!B)return d();q?d(!1,q):i=setTimeout(()=>{d(!1,1e-7)},1e3)}q===1&&!Qy(p,a.getBoundingClientRect())&&d(),B=!1}try{r=new IntersectionObserver(K,{...D,root:c.ownerDocument})}catch{r=new IntersectionObserver(K,D)}r.observe(a)}return d(!0),f}function YT(a,o,r,i){i===void 0&&(i={});const{ancestorScroll:c=!0,ancestorResize:f=!0,elementResize:d=typeof ResizeObserver=="function",layoutShift:m=typeof IntersectionObserver=="function",animationFrame:h=!1}=i,p=td(a),x=c||f?[...p?Rr(p):[],...o?Rr(o):[]]:[];x.forEach(T=>{c&&T.addEventListener("scroll",r,{passive:!0}),f&&T.addEventListener("resize",r)});const v=p&&m?VT(p,r):null;let w=-1,N=null;d&&(N=new ResizeObserver(T=>{let[j]=T;j&&j.target===p&&N&&o&&(N.unobserve(o),cancelAnimationFrame(w),w=requestAnimationFrame(()=>{var D;(D=N)==null||D.observe(o)})),r()}),p&&!h&&N.observe(p),o&&N.observe(o));let _,E=h?xl(a):null;h&&C();function C(){const T=xl(a);E&&!Qy(E,T)&&r(),E=T,_=requestAnimationFrame(C)}return r(),()=>{var T;x.forEach(j=>{c&&j.removeEventListener("scroll",r),f&&j.removeEventListener("resize",r)}),v==null||v(),(T=N)==null||T.disconnect(),N=null,h&&cancelAnimationFrame(_)}}const qT=yT,GT=bT,XT=pT,QT=ST,ZT=gT,$g=hT,KT=xT,$T=(a,o,r)=>{const i=new Map,c={platform:HT,...r},f={...c.platform,_c:i};return mT(a,o,{...c,platform:f})};var JT=typeof document<"u",FT=function(){},us=JT?y.useLayoutEffect:FT;function bs(a,o){if(a===o)return!0;if(typeof a!=typeof o)return!1;if(typeof a=="function"&&a.toString()===o.toString())return!0;let r,i,c;if(a&&o&&typeof a=="object"){if(Array.isArray(a)){if(r=a.length,r!==o.length)return!1;for(i=r;i--!==0;)if(!bs(a[i],o[i]))return!1;return!0}if(c=Object.keys(a),r=c.length,r!==Object.keys(o).length)return!1;for(i=r;i--!==0;)if(!{}.hasOwnProperty.call(o,c[i]))return!1;for(i=r;i--!==0;){const f=c[i];if(!(f==="_owner"&&a.$$typeof)&&!bs(a[f],o[f]))return!1}return!0}return a!==a&&o!==o}function Zy(a){return typeof window>"u"?1:(a.ownerDocument.defaultView||window).devicePixelRatio||1}function Jg(a,o){const r=Zy(a);return Math.round(o*r)/r}function mf(a){const o=y.useRef(a);return us(()=>{o.current=a}),o}function PT(a){a===void 0&&(a={});const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:c,elements:{reference:f,floating:d}={},transform:m=!0,whileElementsMounted:h,open:p}=a,[x,v]=y.useState({x:0,y:0,strategy:r,placement:o,middlewareData:{},isPositioned:!1}),[w,N]=y.useState(i);bs(w,i)||N(i);const[_,E]=y.useState(null),[C,T]=y.useState(null),j=y.useCallback(J=>{J!==F.current&&(F.current=J,E(J))},[]),D=y.useCallback(J=>{J!==q.current&&(q.current=J,T(J))},[]),B=f||_,K=d||C,F=y.useRef(null),q=y.useRef(null),V=y.useRef(x),ae=h!=null,he=mf(h),pe=mf(c),fe=mf(p),me=y.useCallback(()=>{if(!F.current||!q.current)return;const J={placement:o,strategy:r,middleware:w};pe.current&&(J.platform=pe.current),$T(F.current,q.current,J).then(le=>{const P={...le,isPositioned:fe.current!==!1};ge.current&&!bs(V.current,P)&&(V.current=P,Or.flushSync(()=>{v(P)}))})},[w,o,r,pe,fe]);us(()=>{p===!1&&V.current.isPositioned&&(V.current.isPositioned=!1,v(J=>({...J,isPositioned:!1})))},[p]);const ge=y.useRef(!1);us(()=>(ge.current=!0,()=>{ge.current=!1}),[]),us(()=>{if(B&&(F.current=B),K&&(q.current=K),B&&K){if(he.current)return he.current(B,K,me);me()}},[B,K,me,he,ae]);const ce=y.useMemo(()=>({reference:F,floating:q,setReference:j,setFloating:D}),[j,D]),O=y.useMemo(()=>({reference:B,floating:K}),[B,K]),Y=y.useMemo(()=>{const J={position:r,left:0,top:0};if(!O.floating)return J;const le=Jg(O.floating,x.x),P=Jg(O.floating,x.y);return m?{...J,transform:"translate("+le+"px, "+P+"px)",...Zy(O.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:le,top:P}},[r,m,O.floating,x.x,x.y]);return y.useMemo(()=>({...x,update:me,refs:ce,elements:O,floatingStyles:Y}),[x,me,ce,O,Y])}const WT=a=>{function o(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:a,fn(r){const{element:i,padding:c}=typeof a=="function"?a(r):a;return i&&o(i)?i.current!=null?$g({element:i.current,padding:c}).fn(r):{}:i?$g({element:i,padding:c}).fn(r):{}}}},IT=(a,o)=>{const r=qT(a);return{name:r.name,fn:r.fn,options:[a,o]}},eN=(a,o)=>{const r=GT(a);return{name:r.name,fn:r.fn,options:[a,o]}},tN=(a,o)=>({fn:KT(a).fn,options:[a,o]}),nN=(a,o)=>{const r=XT(a);return{name:r.name,fn:r.fn,options:[a,o]}},aN=(a,o)=>{const r=QT(a);return{name:r.name,fn:r.fn,options:[a,o]}},lN=(a,o)=>{const r=ZT(a);return{name:r.name,fn:r.fn,options:[a,o]}},oN=(a,o)=>{const r=WT(a);return{name:r.name,fn:r.fn,options:[a,o]}};var rN="Arrow",Ky=y.forwardRef((a,o)=>{const{children:r,width:i=10,height:c=5,...f}=a;return b.jsx(Le.svg,{...f,ref:o,width:i,height:c,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:a.asChild?r:b.jsx("polygon",{points:"0,0 30,0 15,10"})})});Ky.displayName=rN;var iN=Ky;function sN(a){const[o,r]=y.useState(void 0);return Ct(()=>{if(a){r({width:a.offsetWidth,height:a.offsetHeight});const i=new ResizeObserver(c=>{if(!Array.isArray(c)||!c.length)return;const f=c[0];let d,m;if("borderBoxSize"in f){const h=f.borderBoxSize,p=Array.isArray(h)?h[0]:h;d=p.inlineSize,m=p.blockSize}else d=a.offsetWidth,m=a.offsetHeight;r({width:d,height:m})});return i.observe(a,{box:"border-box"}),()=>i.unobserve(a)}else r(void 0)},[a]),o}var nd="Popper",[$y,Jy]=wo(nd),[uN,Fy]=$y(nd),Py=a=>{const{__scopePopper:o,children:r}=a,[i,c]=y.useState(null);return b.jsx(uN,{scope:o,anchor:i,onAnchorChange:c,children:r})};Py.displayName=nd;var Wy="PopperAnchor",Iy=y.forwardRef((a,o)=>{const{__scopePopper:r,virtualRef:i,...c}=a,f=Fy(Wy,r),d=y.useRef(null),m=nt(o,d),h=y.useRef(null);return y.useEffect(()=>{const p=h.current;h.current=(i==null?void 0:i.current)||d.current,p!==h.current&&f.onAnchorChange(h.current)}),i?null:b.jsx(Le.div,{...c,ref:m})});Iy.displayName=Wy;var ad="PopperContent",[cN,fN]=$y(ad),e0=y.forwardRef((a,o)=>{var te,oe,ie,Te,we,xe;const{__scopePopper:r,side:i="bottom",sideOffset:c=0,align:f="center",alignOffset:d=0,arrowPadding:m=0,avoidCollisions:h=!0,collisionBoundary:p=[],collisionPadding:x=0,sticky:v="partial",hideWhenDetached:w=!1,updatePositionStrategy:N="optimized",onPlaced:_,...E}=a,C=Fy(ad,r),[T,j]=y.useState(null),D=nt(o,Ie=>j(Ie)),[B,K]=y.useState(null),F=sN(B),q=(F==null?void 0:F.width)??0,V=(F==null?void 0:F.height)??0,ae=i+(f!=="center"?"-"+f:""),he=typeof x=="number"?x:{top:0,right:0,bottom:0,left:0,...x},pe=Array.isArray(p)?p:[p],fe=pe.length>0,me={padding:he,boundary:pe.filter(mN),altBoundary:fe},{refs:ge,floatingStyles:ce,placement:O,isPositioned:Y,middlewareData:J}=PT({strategy:"fixed",placement:ae,whileElementsMounted:(...Ie)=>YT(...Ie,{animationFrame:N==="always"}),elements:{reference:C.anchor},middleware:[IT({mainAxis:c+V,alignmentAxis:d}),h&&eN({mainAxis:!0,crossAxis:!1,limiter:v==="partial"?tN():void 0,...me}),h&&nN({...me}),aN({...me,apply:({elements:Ie,rects:Xe,availableWidth:fn,availableHeight:Wt})=>{const{width:Yt,height:Ka}=Xe.reference,dt=Ie.floating.style;dt.setProperty("--radix-popper-available-width",`${fn}px`),dt.setProperty("--radix-popper-available-height",`${Wt}px`),dt.setProperty("--radix-popper-anchor-width",`${Yt}px`),dt.setProperty("--radix-popper-anchor-height",`${Ka}px`)}}),B&&oN({element:B,padding:m}),hN({arrowWidth:q,arrowHeight:V}),w&&lN({strategy:"referenceHidden",...me})]}),[le,P]=a0(O),R=Ya(_);Ct(()=>{Y&&(R==null||R())},[Y,R]);const G=(te=J.arrow)==null?void 0:te.x,Q=(oe=J.arrow)==null?void 0:oe.y,W=((ie=J.arrow)==null?void 0:ie.centerOffset)!==0,[ee,ne]=y.useState();return Ct(()=>{T&&ne(window.getComputedStyle(T).zIndex)},[T]),b.jsx("div",{ref:ge.setFloating,"data-radix-popper-content-wrapper":"",style:{...ce,transform:Y?ce.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ee,"--radix-popper-transform-origin":[(Te=J.transformOrigin)==null?void 0:Te.x,(we=J.transformOrigin)==null?void 0:we.y].join(" "),...((xe=J.hide)==null?void 0:xe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:a.dir,children:b.jsx(cN,{scope:r,placedSide:le,onArrowChange:K,arrowX:G,arrowY:Q,shouldHideArrow:W,children:b.jsx(Le.div,{"data-side":le,"data-align":P,...E,ref:D,style:{...E.style,animation:Y?void 0:"none"}})})})});e0.displayName=ad;var t0="PopperArrow",dN={top:"bottom",right:"left",bottom:"top",left:"right"},n0=y.forwardRef(function(o,r){const{__scopePopper:i,...c}=o,f=fN(t0,i),d=dN[f.placedSide];return b.jsx("span",{ref:f.onArrowChange,style:{position:"absolute",left:f.arrowX,top:f.arrowY,[d]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[f.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[f.placedSide],visibility:f.shouldHideArrow?"hidden":void 0},children:b.jsx(iN,{...c,ref:r,style:{...c.style,display:"block"}})})});n0.displayName=t0;function mN(a){return a!==null}var hN=a=>({name:"transformOrigin",options:a,fn(o){var C,T,j;const{placement:r,rects:i,middlewareData:c}=o,d=((C=c.arrow)==null?void 0:C.centerOffset)!==0,m=d?0:a.arrowWidth,h=d?0:a.arrowHeight,[p,x]=a0(r),v={start:"0%",center:"50%",end:"100%"}[x],w=(((T=c.arrow)==null?void 0:T.x)??0)+m/2,N=(((j=c.arrow)==null?void 0:j.y)??0)+h/2;let _="",E="";return p==="bottom"?(_=d?v:`${w}px`,E=`${-h}px`):p==="top"?(_=d?v:`${w}px`,E=`${i.floating.height+h}px`):p==="right"?(_=`${-h}px`,E=d?v:`${N}px`):p==="left"&&(_=`${i.floating.width+h}px`,E=d?v:`${N}px`),{data:{x:_,y:E}}}});function a0(a){const[o,r="center"]=a.split("-");return[o,r]}var pN=Py,gN=Iy,vN=e0,yN=n0;function bN(a){const o=y.useRef({value:a,previous:a});return y.useMemo(()=>(o.current.value!==a&&(o.current.previous=o.current.value,o.current.value=a),o.current.previous),[a])}var l0=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),xN="VisuallyHidden",SN=y.forwardRef((a,o)=>b.jsx(Le.span,{...a,ref:o,style:{...l0,...a.style}}));SN.displayName=xN;var wN=[" ","Enter","ArrowUp","ArrowDown"],EN=[" ","Enter"],Sl="Select",[Os,Ms,CN]=ky(Sl),[To]=wo(Sl,[CN,Jy]),Ds=Jy(),[TN,Qa]=To(Sl),[NN,RN]=To(Sl),o0=a=>{const{__scopeSelect:o,children:r,open:i,defaultOpen:c,onOpenChange:f,value:d,defaultValue:m,onValueChange:h,dir:p,name:x,autoComplete:v,disabled:w,required:N,form:_}=a,E=Ds(o),[C,T]=y.useState(null),[j,D]=y.useState(null),[B,K]=y.useState(!1),F=Jf(p),[q,V]=Tr({prop:i,defaultProp:c??!1,onChange:f,caller:Sl}),[ae,he]=Tr({prop:d,defaultProp:m,onChange:h,caller:Sl}),pe=y.useRef(null),fe=C?_||!!C.closest("form"):!0,[me,ge]=y.useState(new Set),ce=Array.from(me).map(O=>O.props.value).join(";");return b.jsx(pN,{...E,children:b.jsxs(TN,{required:N,scope:o,trigger:C,onTriggerChange:T,valueNode:j,onValueNodeChange:D,valueNodeHasChildren:B,onValueNodeHasChildrenChange:K,contentId:Va(),value:ae,onValueChange:he,open:q,onOpenChange:V,dir:F,triggerPointerDownPosRef:pe,disabled:w,children:[b.jsx(Os.Provider,{scope:o,children:b.jsx(NN,{scope:a.__scopeSelect,onNativeOptionAdd:y.useCallback(O=>{ge(Y=>new Set(Y).add(O))},[]),onNativeOptionRemove:y.useCallback(O=>{ge(Y=>{const J=new Set(Y);return J.delete(O),J})},[]),children:r})}),fe?b.jsxs(_0,{"aria-hidden":!0,required:N,tabIndex:-1,name:x,autoComplete:v,value:ae,onChange:O=>he(O.target.value),disabled:w,form:_,children:[ae===void 0?b.jsx("option",{value:""}):null,Array.from(me)]},ce):null]})})};o0.displayName=Sl;var r0="SelectTrigger",i0=y.forwardRef((a,o)=>{const{__scopeSelect:r,disabled:i=!1,...c}=a,f=Ds(r),d=Qa(r0,r),m=d.disabled||i,h=nt(o,d.onTriggerChange),p=Ms(r),x=y.useRef("touch"),[v,w,N]=M0(E=>{const C=p().filter(D=>!D.disabled),T=C.find(D=>D.value===d.value),j=D0(C,E,T);j!==void 0&&d.onValueChange(j.value)}),_=E=>{m||(d.onOpenChange(!0),N()),E&&(d.triggerPointerDownPosRef.current={x:Math.round(E.pageX),y:Math.round(E.pageY)})};return b.jsx(gN,{asChild:!0,...f,children:b.jsx(Le.button,{type:"button",role:"combobox","aria-controls":d.contentId,"aria-expanded":d.open,"aria-required":d.required,"aria-autocomplete":"none",dir:d.dir,"data-state":d.open?"open":"closed",disabled:m,"data-disabled":m?"":void 0,"data-placeholder":O0(d.value)?"":void 0,...c,ref:h,onClick:De(c.onClick,E=>{E.currentTarget.focus(),x.current!=="mouse"&&_(E)}),onPointerDown:De(c.onPointerDown,E=>{x.current=E.pointerType;const C=E.target;C.hasPointerCapture(E.pointerId)&&C.releasePointerCapture(E.pointerId),E.button===0&&E.ctrlKey===!1&&E.pointerType==="mouse"&&(_(E),E.preventDefault())}),onKeyDown:De(c.onKeyDown,E=>{const C=v.current!=="";!(E.ctrlKey||E.altKey||E.metaKey)&&E.key.length===1&&w(E.key),!(C&&E.key===" ")&&wN.includes(E.key)&&(_(),E.preventDefault())})})})});i0.displayName=r0;var s0="SelectValue",u0=y.forwardRef((a,o)=>{const{__scopeSelect:r,className:i,style:c,children:f,placeholder:d="",...m}=a,h=Qa(s0,r),{onValueNodeHasChildrenChange:p}=h,x=f!==void 0,v=nt(o,h.onValueNodeChange);return Ct(()=>{p(x)},[p,x]),b.jsx(Le.span,{...m,ref:v,style:{pointerEvents:"none"},children:O0(h.value)?b.jsx(b.Fragment,{children:d}):f})});u0.displayName=s0;var AN="SelectIcon",c0=y.forwardRef((a,o)=>{const{__scopeSelect:r,children:i,...c}=a;return b.jsx(Le.span,{"aria-hidden":!0,...c,ref:o,children:i||"▼"})});c0.displayName=AN;var _N="SelectPortal",f0=a=>b.jsx(Xf,{asChild:!0,...a});f0.displayName=_N;var wl="SelectContent",d0=y.forwardRef((a,o)=>{const r=Qa(wl,a.__scopeSelect),[i,c]=y.useState();if(Ct(()=>{c(new DocumentFragment)},[]),!r.open){const f=i;return f?Or.createPortal(b.jsx(m0,{scope:a.__scopeSelect,children:b.jsx(Os.Slot,{scope:a.__scopeSelect,children:b.jsx("div",{children:a.children})})}),f):null}return b.jsx(h0,{...a,ref:o})});d0.displayName=wl;var vn=10,[m0,Za]=To(wl),ON="SelectContentImpl",MN=Nr("SelectContent.RemoveScroll"),h0=y.forwardRef((a,o)=>{const{__scopeSelect:r,position:i="item-aligned",onCloseAutoFocus:c,onEscapeKeyDown:f,onPointerDownOutside:d,side:m,sideOffset:h,align:p,alignOffset:x,arrowPadding:v,collisionBoundary:w,collisionPadding:N,sticky:_,hideWhenDetached:E,avoidCollisions:C,...T}=a,j=Qa(wl,r),[D,B]=y.useState(null),[K,F]=y.useState(null),q=nt(o,te=>B(te)),[V,ae]=y.useState(null),[he,pe]=y.useState(null),fe=Ms(r),[me,ge]=y.useState(!1),ce=y.useRef(!1);y.useEffect(()=>{if(D)return sy(D)},[D]),Iv();const O=y.useCallback(te=>{const[oe,...ie]=fe().map(xe=>xe.ref.current),[Te]=ie.slice(-1),we=document.activeElement;for(const xe of te)if(xe===we||(xe==null||xe.scrollIntoView({block:"nearest"}),xe===oe&&K&&(K.scrollTop=0),xe===Te&&K&&(K.scrollTop=K.scrollHeight),xe==null||xe.focus(),document.activeElement!==we))return},[fe,K]),Y=y.useCallback(()=>O([V,D]),[O,V,D]);y.useEffect(()=>{me&&Y()},[me,Y]);const{onOpenChange:J,triggerPointerDownPosRef:le}=j;y.useEffect(()=>{if(D){let te={x:0,y:0};const oe=Te=>{var we,xe;te={x:Math.abs(Math.round(Te.pageX)-(((we=le.current)==null?void 0:we.x)??0)),y:Math.abs(Math.round(Te.pageY)-(((xe=le.current)==null?void 0:xe.y)??0))}},ie=Te=>{te.x<=10&&te.y<=10?Te.preventDefault():D.contains(Te.target)||J(!1),document.removeEventListener("pointermove",oe),le.current=null};return le.current!==null&&(document.addEventListener("pointermove",oe),document.addEventListener("pointerup",ie,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",oe),document.removeEventListener("pointerup",ie,{capture:!0})}}},[D,J,le]),y.useEffect(()=>{const te=()=>J(!1);return window.addEventListener("blur",te),window.addEventListener("resize",te),()=>{window.removeEventListener("blur",te),window.removeEventListener("resize",te)}},[J]);const[P,R]=M0(te=>{const oe=fe().filter(we=>!we.disabled),ie=oe.find(we=>we.ref.current===document.activeElement),Te=D0(oe,te,ie);Te&&setTimeout(()=>Te.ref.current.focus())}),G=y.useCallback((te,oe,ie)=>{const Te=!ce.current&&!ie;(j.value!==void 0&&j.value===oe||Te)&&(ae(te),Te&&(ce.current=!0))},[j.value]),Q=y.useCallback(()=>D==null?void 0:D.focus(),[D]),W=y.useCallback((te,oe,ie)=>{const Te=!ce.current&&!ie;(j.value!==void 0&&j.value===oe||Te)&&pe(te)},[j.value]),ee=i==="popper"?Ef:p0,ne=ee===Ef?{side:m,sideOffset:h,align:p,alignOffset:x,arrowPadding:v,collisionBoundary:w,collisionPadding:N,sticky:_,hideWhenDetached:E,avoidCollisions:C}:{};return b.jsx(m0,{scope:r,content:D,viewport:K,onViewportChange:F,itemRefCallback:G,selectedItem:V,onItemLeave:Q,itemTextRefCallback:W,focusSelectedItem:Y,selectedItemText:he,position:i,isPositioned:me,searchRef:P,children:b.jsx(Qf,{as:MN,allowPinchZoom:!0,children:b.jsx(Gf,{asChild:!0,trapped:j.open,onMountAutoFocus:te=>{te.preventDefault()},onUnmountAutoFocus:De(c,te=>{var oe;(oe=j.trigger)==null||oe.focus({preventScroll:!0}),te.preventDefault()}),children:b.jsx(qf,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:f,onPointerDownOutside:d,onFocusOutside:te=>te.preventDefault(),onDismiss:()=>j.onOpenChange(!1),children:b.jsx(ee,{role:"listbox",id:j.contentId,"data-state":j.open?"open":"closed",dir:j.dir,onContextMenu:te=>te.preventDefault(),...T,...ne,onPlaced:()=>ge(!0),ref:q,style:{display:"flex",flexDirection:"column",outline:"none",...T.style},onKeyDown:De(T.onKeyDown,te=>{const oe=te.ctrlKey||te.altKey||te.metaKey;if(te.key==="Tab"&&te.preventDefault(),!oe&&te.key.length===1&&R(te.key),["ArrowUp","ArrowDown","Home","End"].includes(te.key)){let Te=fe().filter(we=>!we.disabled).map(we=>we.ref.current);if(["ArrowUp","End"].includes(te.key)&&(Te=Te.slice().reverse()),["ArrowUp","ArrowDown"].includes(te.key)){const we=te.target,xe=Te.indexOf(we);Te=Te.slice(xe+1)}setTimeout(()=>O(Te)),te.preventDefault()}})})})})})})});h0.displayName=ON;var DN="SelectItemAlignedPosition",p0=y.forwardRef((a,o)=>{const{__scopeSelect:r,onPlaced:i,...c}=a,f=Qa(wl,r),d=Za(wl,r),[m,h]=y.useState(null),[p,x]=y.useState(null),v=nt(o,q=>x(q)),w=Ms(r),N=y.useRef(!1),_=y.useRef(!0),{viewport:E,selectedItem:C,selectedItemText:T,focusSelectedItem:j}=d,D=y.useCallback(()=>{if(f.trigger&&f.valueNode&&m&&p&&E&&C&&T){const q=f.trigger.getBoundingClientRect(),V=p.getBoundingClientRect(),ae=f.valueNode.getBoundingClientRect(),he=T.getBoundingClientRect();if(f.dir!=="rtl"){const we=he.left-V.left,xe=ae.left-we,Ie=q.left-xe,Xe=q.width+Ie,fn=Math.max(Xe,V.width),Wt=window.innerWidth-vn,Yt=Bg(xe,[vn,Math.max(vn,Wt-fn)]);m.style.minWidth=Xe+"px",m.style.left=Yt+"px"}else{const we=V.right-he.right,xe=window.innerWidth-ae.right-we,Ie=window.innerWidth-q.right-xe,Xe=q.width+Ie,fn=Math.max(Xe,V.width),Wt=window.innerWidth-vn,Yt=Bg(xe,[vn,Math.max(vn,Wt-fn)]);m.style.minWidth=Xe+"px",m.style.right=Yt+"px"}const pe=w(),fe=window.innerHeight-vn*2,me=E.scrollHeight,ge=window.getComputedStyle(p),ce=parseInt(ge.borderTopWidth,10),O=parseInt(ge.paddingTop,10),Y=parseInt(ge.borderBottomWidth,10),J=parseInt(ge.paddingBottom,10),le=ce+O+me+J+Y,P=Math.min(C.offsetHeight*5,le),R=window.getComputedStyle(E),G=parseInt(R.paddingTop,10),Q=parseInt(R.paddingBottom,10),W=q.top+q.height/2-vn,ee=fe-W,ne=C.offsetHeight/2,te=C.offsetTop+ne,oe=ce+O+te,ie=le-oe;if(oe<=W){const we=pe.length>0&&C===pe[pe.length-1].ref.current;m.style.bottom="0px";const xe=p.clientHeight-E.offsetTop-E.offsetHeight,Ie=Math.max(ee,ne+(we?Q:0)+xe+Y),Xe=oe+Ie;m.style.height=Xe+"px"}else{const we=pe.length>0&&C===pe[0].ref.current;m.style.top="0px";const Ie=Math.max(W,ce+E.offsetTop+(we?G:0)+ne)+ie;m.style.height=Ie+"px",E.scrollTop=oe-W+E.offsetTop}m.style.margin=`${vn}px 0`,m.style.minHeight=P+"px",m.style.maxHeight=fe+"px",i==null||i(),requestAnimationFrame(()=>N.current=!0)}},[w,f.trigger,f.valueNode,m,p,E,C,T,f.dir,i]);Ct(()=>D(),[D]);const[B,K]=y.useState();Ct(()=>{p&&K(window.getComputedStyle(p).zIndex)},[p]);const F=y.useCallback(q=>{q&&_.current===!0&&(D(),j==null||j(),_.current=!1)},[D,j]);return b.jsx(zN,{scope:r,contentWrapper:m,shouldExpandOnScrollRef:N,onScrollButtonChange:F,children:b.jsx("div",{ref:h,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:B},children:b.jsx(Le.div,{...c,ref:v,style:{boxSizing:"border-box",maxHeight:"100%",...c.style}})})})});p0.displayName=DN;var jN="SelectPopperPosition",Ef=y.forwardRef((a,o)=>{const{__scopeSelect:r,align:i="start",collisionPadding:c=vn,...f}=a,d=Ds(r);return b.jsx(vN,{...d,...f,ref:o,align:i,collisionPadding:c,style:{boxSizing:"border-box",...f.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)"}})});Ef.displayName=jN;var[zN,ld]=To(wl,{}),Cf="SelectViewport",g0=y.forwardRef((a,o)=>{const{__scopeSelect:r,nonce:i,...c}=a,f=Za(Cf,r),d=ld(Cf,r),m=nt(o,f.onViewportChange),h=y.useRef(0);return b.jsxs(b.Fragment,{children:[b.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:i}),b.jsx(Os.Slot,{scope:r,children:b.jsx(Le.div,{"data-radix-select-viewport":"",role:"presentation",...c,ref:m,style:{position:"relative",flex:1,overflow:"hidden auto",...c.style},onScroll:De(c.onScroll,p=>{const x=p.currentTarget,{contentWrapper:v,shouldExpandOnScrollRef:w}=d;if(w!=null&&w.current&&v){const N=Math.abs(h.current-x.scrollTop);if(N>0){const _=window.innerHeight-vn*2,E=parseFloat(v.style.minHeight),C=parseFloat(v.style.height),T=Math.max(E,C);if(T<_){const j=T+N,D=Math.min(_,j),B=j-D;v.style.height=D+"px",v.style.bottom==="0px"&&(x.scrollTop=B>0?B:0,v.style.justifyContent="flex-end")}}}h.current=x.scrollTop})})})]})});g0.displayName=Cf;var v0="SelectGroup",[kN,LN]=To(v0),UN=y.forwardRef((a,o)=>{const{__scopeSelect:r,...i}=a,c=Va();return b.jsx(kN,{scope:r,id:c,children:b.jsx(Le.div,{role:"group","aria-labelledby":c,...i,ref:o})})});UN.displayName=v0;var y0="SelectLabel",b0=y.forwardRef((a,o)=>{const{__scopeSelect:r,...i}=a,c=LN(y0,r);return b.jsx(Le.div,{id:c.id,...i,ref:o})});b0.displayName=y0;var xs="SelectItem",[BN,x0]=To(xs),S0=y.forwardRef((a,o)=>{const{__scopeSelect:r,value:i,disabled:c=!1,textValue:f,...d}=a,m=Qa(xs,r),h=Za(xs,r),p=m.value===i,[x,v]=y.useState(f??""),[w,N]=y.useState(!1),_=nt(o,j=>{var D;return(D=h.itemRefCallback)==null?void 0:D.call(h,j,i,c)}),E=Va(),C=y.useRef("touch"),T=()=>{c||(m.onValueChange(i),m.onOpenChange(!1))};if(i==="")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 b.jsx(BN,{scope:r,value:i,disabled:c,textId:E,isSelected:p,onItemTextChange:y.useCallback(j=>{v(D=>D||((j==null?void 0:j.textContent)??"").trim())},[]),children:b.jsx(Os.ItemSlot,{scope:r,value:i,disabled:c,textValue:x,children:b.jsx(Le.div,{role:"option","aria-labelledby":E,"data-highlighted":w?"":void 0,"aria-selected":p&&w,"data-state":p?"checked":"unchecked","aria-disabled":c||void 0,"data-disabled":c?"":void 0,tabIndex:c?void 0:-1,...d,ref:_,onFocus:De(d.onFocus,()=>N(!0)),onBlur:De(d.onBlur,()=>N(!1)),onClick:De(d.onClick,()=>{C.current!=="mouse"&&T()}),onPointerUp:De(d.onPointerUp,()=>{C.current==="mouse"&&T()}),onPointerDown:De(d.onPointerDown,j=>{C.current=j.pointerType}),onPointerMove:De(d.onPointerMove,j=>{var D;C.current=j.pointerType,c?(D=h.onItemLeave)==null||D.call(h):C.current==="mouse"&&j.currentTarget.focus({preventScroll:!0})}),onPointerLeave:De(d.onPointerLeave,j=>{var D;j.currentTarget===document.activeElement&&((D=h.onItemLeave)==null||D.call(h))}),onKeyDown:De(d.onKeyDown,j=>{var B;((B=h.searchRef)==null?void 0:B.current)!==""&&j.key===" "||(EN.includes(j.key)&&T(),j.key===" "&&j.preventDefault())})})})})});S0.displayName=xs;var Er="SelectItemText",w0=y.forwardRef((a,o)=>{const{__scopeSelect:r,className:i,style:c,...f}=a,d=Qa(Er,r),m=Za(Er,r),h=x0(Er,r),p=RN(Er,r),[x,v]=y.useState(null),w=nt(o,T=>v(T),h.onItemTextChange,T=>{var j;return(j=m.itemTextRefCallback)==null?void 0:j.call(m,T,h.value,h.disabled)}),N=x==null?void 0:x.textContent,_=y.useMemo(()=>b.jsx("option",{value:h.value,disabled:h.disabled,children:N},h.value),[h.disabled,h.value,N]),{onNativeOptionAdd:E,onNativeOptionRemove:C}=p;return Ct(()=>(E(_),()=>C(_)),[E,C,_]),b.jsxs(b.Fragment,{children:[b.jsx(Le.span,{id:h.textId,...f,ref:w}),h.isSelected&&d.valueNode&&!d.valueNodeHasChildren?Or.createPortal(f.children,d.valueNode):null]})});w0.displayName=Er;var E0="SelectItemIndicator",C0=y.forwardRef((a,o)=>{const{__scopeSelect:r,...i}=a;return x0(E0,r).isSelected?b.jsx(Le.span,{"aria-hidden":!0,...i,ref:o}):null});C0.displayName=E0;var Tf="SelectScrollUpButton",T0=y.forwardRef((a,o)=>{const r=Za(Tf,a.__scopeSelect),i=ld(Tf,a.__scopeSelect),[c,f]=y.useState(!1),d=nt(o,i.onScrollButtonChange);return Ct(()=>{if(r.viewport&&r.isPositioned){let m=function(){const p=h.scrollTop>0;f(p)};const h=r.viewport;return m(),h.addEventListener("scroll",m),()=>h.removeEventListener("scroll",m)}},[r.viewport,r.isPositioned]),c?b.jsx(R0,{...a,ref:d,onAutoScroll:()=>{const{viewport:m,selectedItem:h}=r;m&&h&&(m.scrollTop=m.scrollTop-h.offsetHeight)}}):null});T0.displayName=Tf;var Nf="SelectScrollDownButton",N0=y.forwardRef((a,o)=>{const r=Za(Nf,a.__scopeSelect),i=ld(Nf,a.__scopeSelect),[c,f]=y.useState(!1),d=nt(o,i.onScrollButtonChange);return Ct(()=>{if(r.viewport&&r.isPositioned){let m=function(){const p=h.scrollHeight-h.clientHeight,x=Math.ceil(h.scrollTop)<p;f(x)};const h=r.viewport;return m(),h.addEventListener("scroll",m),()=>h.removeEventListener("scroll",m)}},[r.viewport,r.isPositioned]),c?b.jsx(R0,{...a,ref:d,onAutoScroll:()=>{const{viewport:m,selectedItem:h}=r;m&&h&&(m.scrollTop=m.scrollTop+h.offsetHeight)}}):null});N0.displayName=Nf;var R0=y.forwardRef((a,o)=>{const{__scopeSelect:r,onAutoScroll:i,...c}=a,f=Za("SelectScrollButton",r),d=y.useRef(null),m=Ms(r),h=y.useCallback(()=>{d.current!==null&&(window.clearInterval(d.current),d.current=null)},[]);return y.useEffect(()=>()=>h(),[h]),Ct(()=>{var x;const p=m().find(v=>v.ref.current===document.activeElement);(x=p==null?void 0:p.ref.current)==null||x.scrollIntoView({block:"nearest"})},[m]),b.jsx(Le.div,{"aria-hidden":!0,...c,ref:o,style:{flexShrink:0,...c.style},onPointerDown:De(c.onPointerDown,()=>{d.current===null&&(d.current=window.setInterval(i,50))}),onPointerMove:De(c.onPointerMove,()=>{var p;(p=f.onItemLeave)==null||p.call(f),d.current===null&&(d.current=window.setInterval(i,50))}),onPointerLeave:De(c.onPointerLeave,()=>{h()})})}),HN="SelectSeparator",A0=y.forwardRef((a,o)=>{const{__scopeSelect:r,...i}=a;return b.jsx(Le.div,{"aria-hidden":!0,...i,ref:o})});A0.displayName=HN;var Rf="SelectArrow",VN=y.forwardRef((a,o)=>{const{__scopeSelect:r,...i}=a,c=Ds(r),f=Qa(Rf,r),d=Za(Rf,r);return f.open&&d.position==="popper"?b.jsx(yN,{...c,...i,ref:o}):null});VN.displayName=Rf;var YN="SelectBubbleInput",_0=y.forwardRef(({__scopeSelect:a,value:o,...r},i)=>{const c=y.useRef(null),f=nt(i,c),d=bN(o);return y.useEffect(()=>{const m=c.current;if(!m)return;const h=window.HTMLSelectElement.prototype,x=Object.getOwnPropertyDescriptor(h,"value").set;if(d!==o&&x){const v=new Event("change",{bubbles:!0});x.call(m,o),m.dispatchEvent(v)}},[d,o]),b.jsx(Le.select,{...r,style:{...l0,...r.style},ref:f,defaultValue:o})});_0.displayName=YN;function O0(a){return a===""||a===void 0}function M0(a){const o=Ya(a),r=y.useRef(""),i=y.useRef(0),c=y.useCallback(d=>{const m=r.current+d;o(m),(function h(p){r.current=p,window.clearTimeout(i.current),p!==""&&(i.current=window.setTimeout(()=>h(""),1e3))})(m)},[o]),f=y.useCallback(()=>{r.current="",window.clearTimeout(i.current)},[]);return y.useEffect(()=>()=>window.clearTimeout(i.current),[]),[r,c,f]}function D0(a,o,r){const c=o.length>1&&Array.from(o).every(p=>p===o[0])?o[0]:o,f=r?a.indexOf(r):-1;let d=qN(a,Math.max(f,0));c.length===1&&(d=d.filter(p=>p!==r));const h=d.find(p=>p.textValue.toLowerCase().startsWith(c.toLowerCase()));return h!==r?h:void 0}function qN(a,o){return a.map((r,i)=>a[(o+i)%a.length])}var GN=o0,j0=i0,XN=u0,QN=c0,ZN=f0,z0=d0,KN=g0,k0=b0,L0=S0,$N=w0,JN=C0,U0=T0,B0=N0,H0=A0;const FN=GN,PN=XN,V0=y.forwardRef(({className:a,children:o,...r},i)=>b.jsxs(j0,{ref:i,className:Be("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",a),...r,children:[o,b.jsx(QN,{asChild:!0,children:b.jsx(Rv,{className:"h-4 w-4 opacity-50"})})]}));V0.displayName=j0.displayName;const Y0=y.forwardRef(({className:a,...o},r)=>b.jsx(U0,{ref:r,className:Be("flex cursor-default items-center justify-center py-1",a),...o,children:b.jsx(H2,{className:"h-4 w-4"})}));Y0.displayName=U0.displayName;const q0=y.forwardRef(({className:a,...o},r)=>b.jsx(B0,{ref:r,className:Be("flex cursor-default items-center justify-center py-1",a),...o,children:b.jsx(Rv,{className:"h-4 w-4"})}));q0.displayName=B0.displayName;const G0=y.forwardRef(({className:a,children:o,position:r="popper",...i},c)=>b.jsx(ZN,{children:b.jsxs(z0,{ref:c,className:Be("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r==="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",a),position:r,...i,children:[b.jsx(Y0,{}),b.jsx(KN,{className:Be("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:o}),b.jsx(q0,{})]})}));G0.displayName=z0.displayName;const WN=y.forwardRef(({className:a,...o},r)=>b.jsx(k0,{ref:r,className:Be("py-1.5 pl-8 pr-2 text-sm font-semibold",a),...o}));WN.displayName=k0.displayName;const X0=y.forwardRef(({className:a,children:o,...r},i)=>b.jsxs(L0,{ref:i,className:Be("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a),...r,children:[b.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:b.jsx(JN,{children:b.jsx(L2,{className:"h-4 w-4"})})}),b.jsx($N,{children:o})]}));X0.displayName=L0.displayName;const IN=y.forwardRef(({className:a,...o},r)=>b.jsx(H0,{ref:r,className:Be("-mx-1 my-1 h-px bg-muted",a),...o}));IN.displayName=H0.displayName;var hf="rovingFocusGroup.onEntryFocus",eR={bubbles:!1,cancelable:!0},jr="RovingFocusGroup",[Af,Q0,tR]=ky(jr),[nR,Z0]=wo(jr,[tR]),[aR,lR]=nR(jr),K0=y.forwardRef((a,o)=>b.jsx(Af.Provider,{scope:a.__scopeRovingFocusGroup,children:b.jsx(Af.Slot,{scope:a.__scopeRovingFocusGroup,children:b.jsx(oR,{...a,ref:o})})}));K0.displayName=jr;var oR=y.forwardRef((a,o)=>{const{__scopeRovingFocusGroup:r,orientation:i,loop:c=!1,dir:f,currentTabStopId:d,defaultCurrentTabStopId:m,onCurrentTabStopIdChange:h,onEntryFocus:p,preventScrollOnEntryFocus:x=!1,...v}=a,w=y.useRef(null),N=nt(o,w),_=Jf(f),[E,C]=Tr({prop:d,defaultProp:m??null,onChange:h,caller:jr}),[T,j]=y.useState(!1),D=Ya(p),B=Q0(r),K=y.useRef(!1),[F,q]=y.useState(0);return y.useEffect(()=>{const V=w.current;if(V)return V.addEventListener(hf,D),()=>V.removeEventListener(hf,D)},[D]),b.jsx(aR,{scope:r,orientation:i,dir:_,loop:c,currentTabStopId:E,onItemFocus:y.useCallback(V=>C(V),[C]),onItemShiftTab:y.useCallback(()=>j(!0),[]),onFocusableItemAdd:y.useCallback(()=>q(V=>V+1),[]),onFocusableItemRemove:y.useCallback(()=>q(V=>V-1),[]),children:b.jsx(Le.div,{tabIndex:T||F===0?-1:0,"data-orientation":i,...v,ref:N,style:{outline:"none",...a.style},onMouseDown:De(a.onMouseDown,()=>{K.current=!0}),onFocus:De(a.onFocus,V=>{const ae=!K.current;if(V.target===V.currentTarget&&ae&&!T){const he=new CustomEvent(hf,eR);if(V.currentTarget.dispatchEvent(he),!he.defaultPrevented){const pe=B().filter(O=>O.focusable),fe=pe.find(O=>O.active),me=pe.find(O=>O.id===E),ce=[fe,me,...pe].filter(Boolean).map(O=>O.ref.current);F0(ce,x)}}K.current=!1}),onBlur:De(a.onBlur,()=>j(!1))})})}),$0="RovingFocusGroupItem",J0=y.forwardRef((a,o)=>{const{__scopeRovingFocusGroup:r,focusable:i=!0,active:c=!1,tabStopId:f,children:d,...m}=a,h=Va(),p=f||h,x=lR($0,r),v=x.currentTabStopId===p,w=Q0(r),{onFocusableItemAdd:N,onFocusableItemRemove:_,currentTabStopId:E}=x;return y.useEffect(()=>{if(i)return N(),()=>_()},[i,N,_]),b.jsx(Af.ItemSlot,{scope:r,id:p,focusable:i,active:c,children:b.jsx(Le.span,{tabIndex:v?0:-1,"data-orientation":x.orientation,...m,ref:o,onMouseDown:De(a.onMouseDown,C=>{i?x.onItemFocus(p):C.preventDefault()}),onFocus:De(a.onFocus,()=>x.onItemFocus(p)),onKeyDown:De(a.onKeyDown,C=>{if(C.key==="Tab"&&C.shiftKey){x.onItemShiftTab();return}if(C.target!==C.currentTarget)return;const T=sR(C,x.orientation,x.dir);if(T!==void 0){if(C.metaKey||C.ctrlKey||C.altKey||C.shiftKey)return;C.preventDefault();let D=w().filter(B=>B.focusable).map(B=>B.ref.current);if(T==="last")D.reverse();else if(T==="prev"||T==="next"){T==="prev"&&D.reverse();const B=D.indexOf(C.currentTarget);D=x.loop?uR(D,B+1):D.slice(B+1)}setTimeout(()=>F0(D))}}),children:typeof d=="function"?d({isCurrentTabStop:v,hasTabStop:E!=null}):d})})});J0.displayName=$0;var rR={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function iR(a,o){return o!=="rtl"?a:a==="ArrowLeft"?"ArrowRight":a==="ArrowRight"?"ArrowLeft":a}function sR(a,o,r){const i=iR(a.key,r);if(!(o==="vertical"&&["ArrowLeft","ArrowRight"].includes(i))&&!(o==="horizontal"&&["ArrowUp","ArrowDown"].includes(i)))return rR[i]}function F0(a,o=!1){const r=document.activeElement;for(const i of a)if(i===r||(i.focus({preventScroll:o}),document.activeElement!==r))return}function uR(a,o){return a.map((r,i)=>a[(o+i)%a.length])}var cR=K0,fR=J0,js="Tabs",[dR]=wo(js,[Z0]),P0=Z0(),[mR,od]=dR(js),W0=y.forwardRef((a,o)=>{const{__scopeTabs:r,value:i,onValueChange:c,defaultValue:f,orientation:d="horizontal",dir:m,activationMode:h="automatic",...p}=a,x=Jf(m),[v,w]=Tr({prop:i,onChange:c,defaultProp:f??"",caller:js});return b.jsx(mR,{scope:r,baseId:Va(),value:v,onValueChange:w,orientation:d,dir:x,activationMode:h,children:b.jsx(Le.div,{dir:x,"data-orientation":d,...p,ref:o})})});W0.displayName=js;var I0="TabsList",eb=y.forwardRef((a,o)=>{const{__scopeTabs:r,loop:i=!0,...c}=a,f=od(I0,r),d=P0(r);return b.jsx(cR,{asChild:!0,...d,orientation:f.orientation,dir:f.dir,loop:i,children:b.jsx(Le.div,{role:"tablist","aria-orientation":f.orientation,...c,ref:o})})});eb.displayName=I0;var tb="TabsTrigger",nb=y.forwardRef((a,o)=>{const{__scopeTabs:r,value:i,disabled:c=!1,...f}=a,d=od(tb,r),m=P0(r),h=ob(d.baseId,i),p=rb(d.baseId,i),x=i===d.value;return b.jsx(fR,{asChild:!0,...m,focusable:!c,active:x,children:b.jsx(Le.button,{type:"button",role:"tab","aria-selected":x,"aria-controls":p,"data-state":x?"active":"inactive","data-disabled":c?"":void 0,disabled:c,id:h,...f,ref:o,onMouseDown:De(a.onMouseDown,v=>{!c&&v.button===0&&v.ctrlKey===!1?d.onValueChange(i):v.preventDefault()}),onKeyDown:De(a.onKeyDown,v=>{[" ","Enter"].includes(v.key)&&d.onValueChange(i)}),onFocus:De(a.onFocus,()=>{const v=d.activationMode!=="manual";!x&&!c&&v&&d.onValueChange(i)})})})});nb.displayName=tb;var ab="TabsContent",lb=y.forwardRef((a,o)=>{const{__scopeTabs:r,value:i,forceMount:c,children:f,...d}=a,m=od(ab,r),h=ob(m.baseId,i),p=rb(m.baseId,i),x=i===m.value,v=y.useRef(x);return y.useEffect(()=>{const w=requestAnimationFrame(()=>v.current=!1);return()=>cancelAnimationFrame(w)},[]),b.jsx(Mr,{present:c||x,children:({present:w})=>b.jsx(Le.div,{"data-state":x?"active":"inactive","data-orientation":m.orientation,role:"tabpanel","aria-labelledby":h,hidden:!w,id:p,tabIndex:0,...d,ref:o,style:{...a.style,animationDuration:v.current?"0s":void 0},children:w&&f})})});lb.displayName=ab;function ob(a,o){return`${a}-trigger-${o}`}function rb(a,o){return`${a}-content-${o}`}var hR=W0,ib=eb,sb=nb,ub=lb;const pR=hR,cb=y.forwardRef(({className:a,...o},r)=>b.jsx(ib,{ref:r,className:Be("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",a),...o}));cb.displayName=ib.displayName;const cs=y.forwardRef(({className:a,...o},r)=>b.jsx(sb,{ref:r,className:Be("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",a),...o}));cs.displayName=sb.displayName;const fs=y.forwardRef(({className:a,...o},r)=>b.jsx(ub,{ref:r,className:Be("mt-2 ring-offset-background data-[state=inactive]:hidden focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",a),...o}));fs.displayName=ub.displayName;function yl(a){if(a==null||a==="")return"Unavailable";const o=new Date(a);return Number.isNaN(o.getTime())?"Unavailable":new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}).format(o)}function gR(a){const o=Math.max(0,Math.floor(a)),r=Math.floor(o/86400),i=Math.floor(o%86400/3600),c=Math.floor(o%3600/60);return r>0?`${r}d ${i}h`:i>0?`${i}h ${c}m`:`${c}m`}function Fg(a){if(a==null||Number.isNaN(a))return"Unavailable";const o=["B","KB","MB","GB","TB"];let r=a,i=0;for(;r>=1024&&i<o.length-1;)r/=1024,i+=1;return`${r.toFixed(r>=10||i===0?0:1)} ${o[i]}`}function fb(a){return a==="ok"?"default":a==="missing"||a==="install-failed"||a==="login-failed"?"destructive":a==="not-authenticated"||a==="unsupported-platform"?"outline":"secondary"}function vR(a){return a.available?b.jsxs(Vt,{className:"gap-1 rounded-full",children:[b.jsx(Y2,{className:"h-3.5 w-3.5"}),"Available"]}):b.jsxs(Vt,{variant:"destructive",className:"gap-1 rounded-full",children:[b.jsx(G2,{className:"h-3.5 w-3.5"}),"Unavailable"]})}function je({label:a,value:o,mono:r=!1}){return b.jsxs("div",{className:"flex items-start justify-between gap-3 border-b border-border/50 py-1.5 last:border-b-0 last:pb-0 first:pt-0",children:[b.jsx("span",{className:"shrink-0 text-[10px] uppercase tracking-[0.18em] text-muted-foreground",children:a}),b.jsx("span",{className:Be("break-all text-right text-xs text-foreground",r&&"font-mono text-[11px]"),children:o})]})}function yR({agent:a}){return b.jsxs("div",{className:"rounded-xl border border-border/60 bg-background/70 p-3 shadow-sm",children:[b.jsxs("div",{className:"flex items-start justify-between gap-3",children:[b.jsxs("div",{children:[b.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-semibold text-foreground",children:[b.jsx(Nv,{className:"h-3.5 w-3.5 text-primary"}),a.label]}),b.jsxs("div",{className:"mt-0.5 text-[11px] text-muted-foreground",children:["Command: ",b.jsx("span",{className:"font-mono text-[10px]",children:a.command})]})]}),vR(a)]}),b.jsxs("div",{className:"mt-2.5 space-y-1.5 text-sm",children:[b.jsx(je,{label:"Version",value:a.version??"Unavailable",mono:!!a.version}),b.jsx(je,{label:"Path",value:a.path??"Not on PATH",mono:!!a.path}),b.jsx(je,{label:"Checked",value:yl(a.checkedAt)})]}),a.metadataStatus&&b.jsxs("div",{className:"mt-2 flex items-center gap-2 text-xs text-muted-foreground",children:[b.jsx(Vt,{variant:fb(a.metadataStatus),className:"rounded-full px-2 py-0 text-[10px] uppercase tracking-[0.14em]",children:a.metadataStatus}),b.jsx("span",{children:"Startup preflight"})]}),a.detail&&b.jsx("div",{className:"mt-2 rounded-lg border border-border/60 bg-muted/40 px-2.5 py-1.5 text-[11px] text-muted-foreground",children:a.detail})]})}function as({name:a,status:o}){return b.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-xl border border-border/60 bg-background/70 px-3 py-2",children:[b.jsxs("div",{children:[b.jsx("div",{className:"text-xs font-medium text-foreground",children:a}),b.jsx("div",{className:"text-[11px] text-muted-foreground",children:yl(o==null?void 0:o.checkedAt)})]}),b.jsxs("div",{className:"flex items-center gap-2",children:[typeof(o==null?void 0:o.authenticated)=="boolean"&&b.jsx(Vt,{variant:o.authenticated?"default":"outline",className:"rounded-full text-[10px] uppercase tracking-[0.14em]",children:o.authenticated?"auth ok":"auth required"}),b.jsx(Vt,{variant:fb(o==null?void 0:o.status),className:"rounded-full text-[10px] uppercase tracking-[0.14em]",children:(o==null?void 0:o.status)??"unknown"})]})]})}function bR(a){return[{key:"workspace",label:"Workspace",value:a==null?void 0:a.workspace},{key:"node",label:"Node app",value:a==null?void 0:a.node},{key:"core",label:"Core",value:a==null?void 0:a.core},{key:"dashboard",label:"Dashboard",value:a==null?void 0:a.dashboard},{key:"api",label:"API",value:a==null?void 0:a.api}].filter(r=>r.value)}function xR(a,o){var r;return(r=a==null?void 0:a.nodes)!=null&&r.length?a.nodes:o?[o]:[]}function SR(a,o){var i;if(o&&a.id===o.nodeId)return o;const r=a.settingsSnapshot;return{...a,nodeId:a.id,version:(r==null?void 0:r.version)??"Unavailable",packageName:r==null?void 0:r.packageName,uptime:(r==null?void 0:r.uptime)??0,localDashboardOrigin:((i=r==null?void 0:r.runtime)==null?void 0:i.localDashboardOrigin)??void 0,auth:r==null?void 0:r.auth,os:r==null?void 0:r.os,runtime:r==null?void 0:r.runtime,agents:r==null?void 0:r.agents,startupRequirements:r==null?void 0:r.startupRequirements,components:r==null?void 0:r.components,repository:r==null?void 0:r.repository,packages:r==null?void 0:r.packages}}function wR(a,o){return a.id===o?`${a.name} (this node)`:`${a.name} (${a.role})`}function ER({cluster:a,systemInfo:o,sseConnected:r}){var N,_,E,C,T,j,D,B,K,F,q,V,ae,he,pe,fe,me,ge,ce,O,Y,J,le,P;const i=y.useMemo(()=>xR(a,o),[a,o]),[c,f]=y.useState(()=>{var R;return(o==null?void 0:o.nodeId)??((R=a==null?void 0:a.self)==null?void 0:R.id)??""}),d=(a==null?void 0:a.self)??o??i[0]??null,m=i.find(R=>R.id===c)??d,h=m?SR(m,o):null,p=!!(o&&m&&m.id===o.nodeId),x=p||!!(m!=null&&m.settingsSnapshot),v=y.useMemo(()=>bR(h==null?void 0:h.packages),[h==null?void 0:h.packages]),w=((N=h==null?void 0:h.startupRequirements)==null?void 0:N.components)??(h==null?void 0:h.components)??{};return!m||!h?b.jsx("div",{className:"rounded-3xl border border-dashed border-border/70 bg-muted/20 px-6 py-12 text-center text-sm text-muted-foreground",children:"Loading session metadata..."}):b.jsxs("div",{className:"space-y-4",children:[b.jsx("section",{className:"rounded-2xl border border-border/70 bg-[radial-gradient(circle_at_top_left,rgba(59,130,246,0.18),transparent_42%),radial-gradient(circle_at_bottom_right,rgba(16,185,129,0.12),transparent_32%),rgba(255,255,255,0.72)] p-4 shadow-[0_24px_90px_-54px_rgba(15,23,42,0.55)] dark:bg-[radial-gradient(circle_at_top_left,rgba(59,130,246,0.18),transparent_42%),radial-gradient(circle_at_bottom_right,rgba(16,185,129,0.12),transparent_32%),rgba(10,15,23,0.78)]",children:b.jsxs("div",{className:"flex flex-col gap-3 md:flex-row md:items-end md:justify-between",children:[b.jsxs("div",{className:"space-y-2",children:[b.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[b.jsxs("span",{className:"flex items-center gap-1.5 rounded-full border border-border/70 bg-background/75 px-2.5 py-1 text-[11px] text-muted-foreground backdrop-blur",children:[b.jsx($v,{status:m.status}),b.jsx("span",{className:"font-medium text-foreground",children:m.name})]}),b.jsx(yE,{role:m.role}),b.jsx(Vt,{variant:"outline",className:"rounded-full border-border/70 bg-background/60 text-[10px] uppercase tracking-[0.16em]",children:m.transportType??h.transportType??"direct"}),b.jsx(Vt,{variant:p?"default":"outline",className:"rounded-full px-2.5 py-1 text-[10px] uppercase tracking-[0.16em]",children:p?"Live local session":"Leader-synced snapshot"})]}),b.jsxs("div",{children:[b.jsx("div",{className:"text-[10px] uppercase tracking-[0.34em] text-muted-foreground",children:"Session"}),b.jsx("h3",{className:"mt-0.5 text-lg font-semibold tracking-tight text-foreground",children:"Node runtime"}),b.jsx("p",{className:"mt-1 max-w-2xl text-xs text-muted-foreground",children:"Inspect the selected node's runtime environment, connectivity surface, and packaged build metadata from one place."})]}),i.length>1&&b.jsxs("div",{className:"max-w-md space-y-1.5",children:[b.jsx("div",{className:"text-[10px] uppercase tracking-[0.18em] text-muted-foreground",children:"Inspect node"}),b.jsxs(FN,{value:m.id,onValueChange:f,children:[b.jsx(V0,{className:"h-9 rounded-xl border-border/70 bg-background/70 text-xs",children:b.jsx(PN,{placeholder:"Choose a node"})}),b.jsx(G0,{children:i.map(R=>b.jsx(X0,{value:R.id,children:wR(R,o==null?void 0:o.nodeId)},R.id))})]})]})]}),b.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[b.jsxs(Vt,{variant:r?"default":"outline",className:"gap-1 rounded-full px-2.5 py-1 text-[10px] uppercase tracking-[0.16em]",children:[b.jsx(Av,{className:"h-3 w-3"}),r?"Live link connected":"Live link reconnecting"]}),b.jsxs(Vt,{variant:"outline",className:"rounded-full border-border/70 bg-background/60 px-2.5 py-1 text-[10px] uppercase tracking-[0.16em]",children:["Uptime ",gR(h.uptime)]}),!p&&b.jsxs(Vt,{variant:"outline",className:"rounded-full border-border/70 bg-background/60 px-2.5 py-1 text-[10px] uppercase tracking-[0.16em]",children:["Updated ",yl((_=m.settingsSnapshot)==null?void 0:_.collectedAt)]})]})]})}),!x&&b.jsx("div",{className:"rounded-2xl border border-dashed border-border/70 bg-muted/20 px-4 py-3 text-sm text-muted-foreground",children:"This node has not synced its settings snapshot to the leader yet. Wait for the next keepalive and reopen the dialog if needed."}),b.jsxs(pR,{defaultValue:"session",className:"space-y-3",children:[b.jsxs(cb,{className:"h-auto flex-wrap rounded-xl border border-border/60 bg-muted/40 p-0.5",children:[b.jsx(cs,{value:"session",className:"rounded-lg px-3 py-1.5 text-xs",children:"Session"}),b.jsx(cs,{value:"access",className:"rounded-lg px-3 py-1.5 text-xs",children:"Access"}),b.jsx(cs,{value:"about",className:"rounded-lg px-3 py-1.5 text-xs",children:"About"})]}),b.jsxs(fs,{value:"session",className:"mt-0 grid gap-3 xl:grid-cols-[1.15fr_0.85fr]",children:[b.jsxs(_n,{className:"rounded-2xl border-border/70 bg-background/75 shadow-[0_24px_80px_-58px_rgba(15,23,42,0.45)]",children:[b.jsxs(On,{className:"pb-2 pt-4 px-4",children:[b.jsxs(Mn,{className:"flex items-center gap-1.5 text-sm",children:[b.jsx(rw,{className:"h-4 w-4 text-primary"}),"Selected node"]}),b.jsx(Dn,{className:"text-xs",children:"Cluster role, identity, and node-scoped runtime state."})]}),b.jsxs(jn,{className:"space-y-0 px-4 pb-4",children:[b.jsx(je,{label:"Node ID",value:h.nodeId,mono:!0}),b.jsx(je,{label:"Status",value:m.status}),b.jsx(je,{label:"Role",value:m.role}),b.jsx(je,{label:"Endpoint",value:m.endpoint,mono:!0}),b.jsx(je,{label:"Joined",value:yl(m.joinedAt)}),b.jsx(je,{label:"Heartbeat",value:yl(m.lastHeartbeat)}),b.jsx(je,{label:"Capabilities",value:m.capabilities.length>0?m.capabilities.join(", "):"None"})]})]}),b.jsxs(_n,{className:"rounded-2xl border-border/70 bg-background/75 shadow-[0_24px_80px_-58px_rgba(15,23,42,0.45)]",children:[b.jsxs(On,{className:"pb-2 pt-4 px-4",children:[b.jsxs(Mn,{className:"flex items-center gap-1.5 text-sm",children:[b.jsx(Q2,{className:"h-4 w-4 text-primary"}),"OS info"]}),b.jsx(Dn,{className:"text-xs",children:"Host and resource details reported by the current process."})]}),b.jsxs(jn,{className:"space-y-0 px-4 pb-4",children:[b.jsx(je,{label:"Host",value:((E=h.os)==null?void 0:E.hostname)??"Unavailable"}),b.jsx(je,{label:"Platform",value:h.os?`${h.os.platform} ${h.os.release}`:"Unavailable"}),b.jsx(je,{label:"Arch",value:((C=h.os)==null?void 0:C.arch)??"Unavailable"}),b.jsx(je,{label:"CPU",value:((T=h.os)==null?void 0:T.cpuModel)??"Unavailable"}),b.jsx(je,{label:"Cores",value:String(((j=h.os)==null?void 0:j.cpuCount)??"Unavailable")}),b.jsx(je,{label:"Memory",value:h.os?`${Fg(h.os.freeMemoryBytes)} free / ${Fg(h.os.totalMemoryBytes)} total`:"Unavailable"})]})]}),b.jsxs(_n,{className:"rounded-2xl border-border/70 bg-background/75 shadow-[0_24px_80px_-58px_rgba(15,23,42,0.45)] xl:col-span-2",children:[b.jsxs(On,{className:"pb-2 pt-4 px-4",children:[b.jsxs(Mn,{className:"flex items-center gap-1.5 text-sm",children:[b.jsx(Nv,{className:"h-4 w-4 text-primary"}),"Available agents"]}),b.jsx(Dn,{className:"text-xs",children:p?"Live command availability for Codex and Claude Code on this node.":"Most recent agent availability snapshot synced from this node."})]}),b.jsx(jn,{className:"grid gap-3 px-4 pb-4 md:grid-cols-2",children:(h.agents??[]).map(R=>b.jsx(yR,{agent:R},R.id))})]})]}),b.jsxs(fs,{value:"access",className:"mt-0 grid gap-3 xl:grid-cols-2",children:[b.jsxs(_n,{className:"rounded-2xl border-border/70 bg-background/75 shadow-[0_24px_80px_-58px_rgba(15,23,42,0.45)]",children:[b.jsxs(On,{className:"pb-2 pt-4 px-4",children:[b.jsxs(Mn,{className:"flex items-center gap-1.5 text-sm",children:[b.jsx(z2,{className:"h-4 w-4 text-primary"}),"Access surface"]}),b.jsx(Dn,{className:"text-xs",children:"How this node is exposed to the dashboard and other peers."})]}),b.jsxs(jn,{className:"space-y-0 px-4 pb-4",children:[b.jsx(je,{label:"Transport",value:m.transportType??h.transportType??"direct"}),b.jsx(je,{label:"Node URL",value:m.endpoint,mono:!0}),b.jsx(je,{label:"Node tunnel",value:m.devtunnelEndpoint??"Disabled",mono:!!m.devtunnelEndpoint}),b.jsx(je,{label:"Dashboard URL",value:m.dashboardOrigin??h.localDashboardOrigin??"Unavailable",mono:!!(m.dashboardOrigin||h.localDashboardOrigin)}),b.jsx(je,{label:"Local dashboard",value:h.localDashboardOrigin??"Unavailable",mono:!!h.localDashboardOrigin})]})]}),b.jsxs(_n,{className:"rounded-2xl border-border/70 bg-background/75 shadow-[0_24px_80px_-58px_rgba(15,23,42,0.45)]",children:[b.jsxs(On,{className:"pb-2 pt-4 px-4",children:[b.jsxs(Mn,{className:"flex items-center gap-1.5 text-sm",children:[b.jsx(cw,{className:"h-4 w-4 text-primary"}),"Auth"]}),b.jsx(Dn,{className:"text-xs",children:"Current bearer-auth and trusted access posture."})]}),b.jsxs(jn,{className:"space-y-0 px-4 pb-4",children:[b.jsx(je,{label:"Enabled",value:(D=h.auth)!=null&&D.enabled?"Yes":"No"}),b.jsx(je,{label:"Same tenant",value:(B=h.auth)!=null&&B.allowSameTenant?"Allowed":"Off"}),b.jsx(je,{label:"Allowed users",value:(K=h.auth)!=null&&K.allowedUsers.length?h.auth.allowedUsers.join(", "):"None"})]})]}),b.jsxs(_n,{className:"rounded-2xl border-border/70 bg-background/75 shadow-[0_24px_80px_-58px_rgba(15,23,42,0.45)]",children:[b.jsxs(On,{className:"pb-2 pt-4 px-4",children:[b.jsxs(Mn,{className:"flex items-center gap-1.5 text-sm",children:[b.jsx(J2,{className:"h-4 w-4 text-primary"}),"Paths"]}),b.jsx(Dn,{className:"text-xs",children:"Workspace and runtime paths currently used by this node."})]}),b.jsxs(jn,{className:"space-y-0 px-4 pb-4",children:[b.jsx(je,{label:"Work dir",value:((F=h.runtime)==null?void 0:F.workDir)??h.workDir??"Unavailable",mono:!!(((q=h.runtime)==null?void 0:q.workDir)??h.workDir)}),b.jsx(je,{label:"Storage",value:((V=h.runtime)==null?void 0:V.storagePath)??"Unavailable",mono:!!((ae=h.runtime)!=null&&ae.storagePath)}),b.jsx(je,{label:"Process cwd",value:((he=h.runtime)==null?void 0:he.cwd)??"Unavailable",mono:!!((pe=h.runtime)!=null&&pe.cwd)}),b.jsx(je,{label:"Started",value:yl((fe=h.runtime)==null?void 0:fe.startedAt)}),b.jsx(je,{label:"PID",value:h.runtime?String(h.runtime.pid):"Unavailable",mono:!!h.runtime})]})]}),b.jsxs(_n,{className:"rounded-2xl border-border/70 bg-background/75 shadow-[0_24px_80px_-58px_rgba(15,23,42,0.45)]",children:[b.jsxs(On,{className:"pb-2 pt-4 px-4",children:[b.jsxs(Mn,{className:"flex items-center gap-1.5 text-sm",children:[b.jsx(_2,{className:"h-4 w-4 text-primary"}),"Startup checks"]}),b.jsx(Dn,{className:"text-xs",children:"Dependency preflight snapshot persisted during node startup."})]}),b.jsxs(jn,{className:"space-y-3 px-4 pb-4",children:[b.jsxs("div",{className:"rounded-xl border border-border/60 bg-background/70 px-3 py-2",children:[b.jsx("div",{className:"text-[10px] uppercase tracking-[0.18em] text-muted-foreground",children:"Last checked"}),b.jsx("div",{className:"mt-0.5 text-xs text-foreground",children:yl((me=h.startupRequirements)==null?void 0:me.lastCheckedAt)})]}),b.jsxs("div",{className:"space-y-2",children:[b.jsx(as,{name:"Azure CLI",status:w.az}),b.jsx(as,{name:"DevTunnel",status:w.devtunnel}),b.jsx(as,{name:"Claude Code",status:w.claude}),b.jsx(as,{name:"Codex",status:w.codex})]})]})]})]}),b.jsxs(fs,{value:"about",className:"mt-0 grid gap-3 xl:grid-cols-[0.92fr_1.08fr]",children:[b.jsxs(_n,{className:"rounded-2xl border-border/70 bg-background/75 shadow-[0_24px_80px_-58px_rgba(15,23,42,0.45)]",children:[b.jsxs(On,{className:"pb-2 pt-4 px-4",children:[b.jsxs(Mn,{className:"flex items-center gap-1.5 text-sm",children:[b.jsx(M2,{className:"h-4 w-4 text-primary"}),"Repository"]}),b.jsx(Dn,{className:"text-xs",children:"Source-of-truth repository metadata for this running node."})]}),b.jsxs(jn,{className:"space-y-3 px-4 pb-4",children:[(ge=h.repository)!=null&&ge.url?b.jsxs("a",{href:h.repository.url,target:"_blank",rel:"noreferrer",className:"group flex items-center justify-between rounded-xl border border-border/70 bg-background/70 px-3 py-2 text-xs text-foreground transition-colors hover:border-primary/40 hover:bg-primary/5",children:[b.jsx("span",{className:"font-mono text-[11px]",children:h.repository.url}),b.jsx(K2,{className:"h-3.5 w-3.5 text-muted-foreground transition-transform group-hover:-translate-y-0.5 group-hover:translate-x-0.5"})]}):b.jsx("div",{className:"rounded-xl border border-dashed border-border/70 bg-muted/20 px-3 py-2 text-xs text-muted-foreground",children:"Repository URL is unavailable in this runtime."}),b.jsxs("div",{className:"space-y-0",children:[b.jsx(je,{label:"Branch",value:((ce=h.repository)==null?void 0:ce.branch)??"Unavailable",mono:!!((O=h.repository)!=null&&O.branch)}),b.jsx(je,{label:"Commit",value:((Y=h.repository)==null?void 0:Y.commit)??"Unavailable",mono:!!((J=h.repository)!=null&&J.commit)}),b.jsx(je,{label:"Runtime",value:`${h.packageName??"meshy"} ${h.version}`,mono:!0}),b.jsx(je,{label:"Node.js",value:((le=h.runtime)==null?void 0:le.nodeVersion)??"Unavailable",mono:!!((P=h.runtime)!=null&&P.nodeVersion)})]})]})]}),b.jsxs(_n,{className:"rounded-2xl border-border/70 bg-background/75 shadow-[0_24px_80px_-58px_rgba(15,23,42,0.45)]",children:[b.jsxs(On,{className:"pb-2 pt-4 px-4",children:[b.jsxs(Mn,{className:"flex items-center gap-1.5 text-sm",children:[b.jsx(P2,{className:"h-4 w-4 text-primary"}),"Package versions"]}),b.jsx(Dn,{className:"text-xs",children:"Version snapshot for the packages most relevant to this dashboard session."})]}),b.jsx(jn,{className:"space-y-2 px-4 pb-4",children:v.map(R=>{var G,Q;return b.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-xl border border-border/60 bg-background/70 px-3 py-2",children:[b.jsxs("div",{children:[b.jsx("div",{className:"text-xs font-medium text-foreground",children:R.label}),b.jsx("div",{className:"text-[11px] text-muted-foreground",children:(G=R.value)==null?void 0:G.name})]}),b.jsx(Vt,{variant:"outline",className:"rounded-full border-border/70 bg-background/60 font-mono text-[10px]",children:(Q=R.value)==null?void 0:Q.version})]},R.key)})})]})]})]})]})}function CR(){const{cluster:a,systemInfo:o,sseConnected:r}=Cv(),[i,c]=y.useState(!1);return b.jsxs(PC,{open:i,onOpenChange:c,children:[b.jsx(WC,{asChild:!0,children:b.jsx(Yf,{variant:"ghost",size:"icon","aria-label":"Settings",title:"Settings",className:"rounded-full border border-border/70 bg-background/70 shadow-sm",children:b.jsx(sw,{className:"h-4 w-4"})})}),b.jsxs(My,{className:"grid h-[min(85vh,52rem)] max-h-[85vh] max-w-[min(90vw,68rem)] grid-rows-[auto_minmax(0,1fr)] overflow-hidden rounded-2xl border-border/70 bg-background/96 p-0 shadow-[0_40px_120px_-56px_rgba(15,23,42,0.75)] backdrop-blur-xl",children:[b.jsxs(Dy,{className:"shrink-0 border-b border-border/60 px-4 py-3 sm:px-5",children:[b.jsxs(jy,{className:"flex items-center gap-2 text-sm",children:[b.jsx(I2,{className:"h-4 w-4 text-primary"}),"Settings"]}),b.jsx(zy,{className:"text-xs",children:"Session diagnostics, access configuration, and build metadata for the current Meshy node."})]}),b.jsx("div",{className:"min-h-0 overflow-y-auto px-4 py-3 sm:px-5 sm:py-4",children:b.jsx(ER,{cluster:a,systemInfo:o,sseConnected:r})})]})]})}function TR(){var h,p;const{cluster:a,sseConnected:o}=Cv(),{theme:r,setTheme:i}=pE(),c=Bn(),f=c.pathname==="/"||/^\/tasks\/[^/]+$/.test(c.pathname),d=r==="dark"?aw:r==="light"?dw:tw,m=()=>{const x=["light","dark","system"],v=x.indexOf(r);i(x[(v+1)%x.length])};return b.jsxs("div",{className:"relative h-full overflow-hidden bg-background text-foreground",children:[b.jsx("div",{className:"mesh-grid pointer-events-none absolute inset-0"}),b.jsx("div",{className:"pointer-events-none absolute left-[-12rem] top-[-10rem] h-[28rem] w-[28rem] rounded-full bg-primary/14 blur-3xl"}),b.jsx("div",{className:"pointer-events-none absolute right-[-10rem] top-[10%] h-[24rem] w-[24rem] rounded-full bg-emerald-500/10 blur-3xl dark:bg-emerald-300/8"}),b.jsxs("div",{className:"relative z-10 flex h-full min-h-0 flex-col",children:[b.jsx("header",{className:"shrink-0 px-2 pb-2 pt-3 sm:px-5 sm:pb-3 sm:pt-4 lg:px-6",children:b.jsxs("div",{className:"mx-auto flex max-w-[1760px] flex-wrap items-center justify-between gap-2 rounded-2xl border border-border/60 bg-background/78 px-3 py-2 shadow-[0_20px_80px_-48px_rgba(0,0,0,var(--panel-shadow-alpha))] backdrop-blur-xl sm:gap-3 sm:rounded-[24px] sm:px-4 sm:py-3",children:[b.jsx("div",{className:"flex min-w-0 items-center gap-4",children:b.jsxs(xv,{to:"/",className:"flex items-center gap-3",children:[b.jsx("div",{className:"flex h-9 w-9 items-center justify-center rounded-xl border border-border/70 bg-foreground text-xs font-semibold tracking-[0.24em] text-background sm:h-11 sm:w-11 sm:rounded-2xl sm:text-sm",children:"M"}),b.jsxs("div",{className:"hidden min-w-0 sm:block",children:[b.jsx("div",{className:"text-[11px] font-medium uppercase tracking-[0.34em] text-muted-foreground",children:"MESHY"}),b.jsx("div",{className:"truncate text-base font-semibold tracking-tight text-foreground",children:"Workspace"})]})]})}),b.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-2",children:[b.jsxs("div",{className:"hidden items-center gap-2 rounded-full border border-border/70 bg-background/70 px-3 py-2 text-xs text-muted-foreground sm:flex",children:[b.jsxs("span",{className:"flex items-center gap-2",children:[(a==null?void 0:a.self)&&b.jsx($v,{status:a.self.status}),b.jsx("span",{className:"font-medium text-foreground",children:((h=a==null?void 0:a.self)==null?void 0:h.name)??"offline"})]}),b.jsx("span",{className:"text-border",children:"/"}),b.jsx("span",{className:"capitalize",children:((p=a==null?void 0:a.self)==null?void 0:p.role)??"node"})]}),b.jsxs("div",{className:"flex items-center gap-1.5 rounded-full border border-border/70 bg-background/70 px-2 py-1.5 text-[11px] text-muted-foreground sm:gap-2 sm:px-3 sm:py-2 sm:text-xs",children:[b.jsx(Av,{className:Be("h-3.5 w-3.5",o?"text-emerald-500":"text-destructive")}),o?"Live link":"Reconnecting"]}),b.jsx(CR,{}),b.jsx(Yf,{variant:"ghost",size:"icon",onClick:m,className:"rounded-full border border-border/60 bg-background/70",title:`Theme: ${r}`,children:b.jsx(d,{className:"h-4 w-4"})})]})]})}),b.jsx("main",{className:Be("min-h-0 flex-1 px-3 pb-3 sm:px-5 lg:px-6",f?"overflow-hidden":"overflow-y-auto"),children:b.jsx("div",{className:"mx-auto h-full min-h-0 max-w-[1760px]",children:b.jsx(jS,{})})})]})]})}const Pg=y.lazy(async()=>({default:(await k1(()=>import("./DashboardPage-3CEGtmWK.js").then(o=>o.D),[])).DashboardPage}));function NR(){return b.jsx(o2,{children:b.jsx(S2,{children:b.jsx(y.Suspense,{fallback:b.jsx(RR,{}),children:b.jsx(kS,{children:b.jsxs(po,{element:b.jsx(TR,{}),children:[b.jsx(po,{path:"/",element:b.jsx(Pg,{})}),b.jsx(po,{path:"/nodes",element:b.jsx(hg,{to:"/",replace:!0})}),b.jsx(po,{path:"/tasks",element:b.jsx(hg,{to:"/",replace:!0})}),b.jsx(po,{path:"/tasks/:id",element:b.jsx(Pg,{})})]})})})})})}function RR(){return b.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background text-sm text-muted-foreground",children:"Loading workspace..."})}function AR(a){if(typeof document>"u")return;let o=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",o.appendChild(r),r.styleSheet?r.styleSheet.cssText=a:r.appendChild(document.createTextNode(a))}const _R=a=>{switch(a){case"success":return DR;case"info":return zR;case"warning":return jR;case"error":return kR;default:return null}},OR=Array(12).fill(0),MR=({visible:a,className:o})=>I.createElement("div",{className:["sonner-loading-wrapper",o].filter(Boolean).join(" "),"data-visible":a},I.createElement("div",{className:"sonner-spinner"},OR.map((r,i)=>I.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${i}`})))),DR=I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},I.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),jR=I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},I.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),zR=I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},I.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),kR=I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},I.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),LR=I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},I.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),I.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),UR=()=>{const[a,o]=I.useState(document.hidden);return I.useEffect(()=>{const r=()=>{o(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),a};let _f=1;class BR{constructor(){this.subscribe=o=>(this.subscribers.push(o),()=>{const r=this.subscribers.indexOf(o);this.subscribers.splice(r,1)}),this.publish=o=>{this.subscribers.forEach(r=>r(o))},this.addToast=o=>{this.publish(o),this.toasts=[...this.toasts,o]},this.create=o=>{var r;const{message:i,...c}=o,f=typeof(o==null?void 0:o.id)=="number"||((r=o.id)==null?void 0:r.length)>0?o.id:_f++,d=this.toasts.find(h=>h.id===f),m=o.dismissible===void 0?!0:o.dismissible;return this.dismissedToasts.has(f)&&this.dismissedToasts.delete(f),d?this.toasts=this.toasts.map(h=>h.id===f?(this.publish({...h,...o,id:f,title:i}),{...h,...o,id:f,dismissible:m,title:i}):h):this.addToast({title:i,...c,dismissible:m,id:f}),f},this.dismiss=o=>(o?(this.dismissedToasts.add(o),requestAnimationFrame(()=>this.subscribers.forEach(r=>r({id:o,dismiss:!0})))):this.toasts.forEach(r=>{this.subscribers.forEach(i=>i({id:r.id,dismiss:!0}))}),o),this.message=(o,r)=>this.create({...r,message:o}),this.error=(o,r)=>this.create({...r,message:o,type:"error"}),this.success=(o,r)=>this.create({...r,type:"success",message:o}),this.info=(o,r)=>this.create({...r,type:"info",message:o}),this.warning=(o,r)=>this.create({...r,type:"warning",message:o}),this.loading=(o,r)=>this.create({...r,type:"loading",message:o}),this.promise=(o,r)=>{if(!r)return;let i;r.loading!==void 0&&(i=this.create({...r,promise:o,type:"loading",message:r.loading,description:typeof r.description!="function"?r.description:void 0}));const c=Promise.resolve(o instanceof Function?o():o);let f=i!==void 0,d;const m=c.then(async p=>{if(d=["resolve",p],I.isValidElement(p))f=!1,this.create({id:i,type:"default",message:p});else if(VR(p)&&!p.ok){f=!1;const v=typeof r.error=="function"?await r.error(`HTTP error! status: ${p.status}`):r.error,w=typeof r.description=="function"?await r.description(`HTTP error! status: ${p.status}`):r.description,_=typeof v=="object"&&!I.isValidElement(v)?v:{message:v};this.create({id:i,type:"error",description:w,..._})}else if(p instanceof Error){f=!1;const v=typeof r.error=="function"?await r.error(p):r.error,w=typeof r.description=="function"?await r.description(p):r.description,_=typeof v=="object"&&!I.isValidElement(v)?v:{message:v};this.create({id:i,type:"error",description:w,..._})}else if(r.success!==void 0){f=!1;const v=typeof r.success=="function"?await r.success(p):r.success,w=typeof r.description=="function"?await r.description(p):r.description,_=typeof v=="object"&&!I.isValidElement(v)?v:{message:v};this.create({id:i,type:"success",description:w,..._})}}).catch(async p=>{if(d=["reject",p],r.error!==void 0){f=!1;const x=typeof r.error=="function"?await r.error(p):r.error,v=typeof r.description=="function"?await r.description(p):r.description,N=typeof x=="object"&&!I.isValidElement(x)?x:{message:x};this.create({id:i,type:"error",description:v,...N})}}).finally(()=>{f&&(this.dismiss(i),i=void 0),r.finally==null||r.finally.call(r)}),h=()=>new Promise((p,x)=>m.then(()=>d[0]==="reject"?x(d[1]):p(d[1])).catch(x));return typeof i!="string"&&typeof i!="number"?{unwrap:h}:Object.assign(i,{unwrap:h})},this.custom=(o,r)=>{const i=(r==null?void 0:r.id)||_f++;return this.create({jsx:o(i),id:i,...r}),i},this.getActiveToasts=()=>this.toasts.filter(o=>!this.dismissedToasts.has(o.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Ht=new BR,HR=(a,o)=>{const r=(o==null?void 0:o.id)||_f++;return Ht.addToast({title:a,...o,id:r}),r},VR=a=>a&&typeof a=="object"&&"ok"in a&&typeof a.ok=="boolean"&&"status"in a&&typeof a.status=="number",YR=HR,qR=()=>Ht.toasts,GR=()=>Ht.getActiveToasts(),MA=Object.assign(YR,{success:Ht.success,info:Ht.info,warning:Ht.warning,error:Ht.error,custom:Ht.custom,message:Ht.message,promise:Ht.promise,dismiss:Ht.dismiss,loading:Ht.loading},{getHistory:qR,getToasts:GR});AR("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function ls(a){return a.label!==void 0}const XR=3,QR="24px",ZR="16px",Wg=4e3,KR=356,$R=14,JR=45,FR=200;function An(...a){return a.filter(Boolean).join(" ")}function PR(a){const[o,r]=a.split("-"),i=[];return o&&i.push(o),r&&i.push(r),i}const WR=a=>{var o,r,i,c,f,d,m,h,p;const{invert:x,toast:v,unstyled:w,interacting:N,setHeights:_,visibleToasts:E,heights:C,index:T,toasts:j,expanded:D,removeToast:B,defaultRichColors:K,closeButton:F,style:q,cancelButtonStyle:V,actionButtonStyle:ae,className:he="",descriptionClassName:pe="",duration:fe,position:me,gap:ge,expandByDefault:ce,classNames:O,icons:Y,closeButtonAriaLabel:J="Close toast"}=a,[le,P]=I.useState(null),[R,G]=I.useState(null),[Q,W]=I.useState(!1),[ee,ne]=I.useState(!1),[te,oe]=I.useState(!1),[ie,Te]=I.useState(!1),[we,xe]=I.useState(!1),[Ie,Xe]=I.useState(0),[fn,Wt]=I.useState(0),Yt=I.useRef(v.duration||fe||Wg),Ka=I.useRef(null),dt=I.useRef(null),No=T===0,Ro=T+1<=E,Tt=v.type,ca=v.dismissible!==!1,Nt=v.className||"",zs=v.descriptionClassName||"",$a=I.useMemo(()=>C.findIndex(be=>be.toastId===v.id)||0,[C,v.id]),zr=I.useMemo(()=>{var be;return(be=v.closeButton)!=null?be:F},[v.closeButton,F]),Ja=I.useMemo(()=>v.duration||fe||Wg,[v.duration,fe]),Ao=I.useRef(0),Vn=I.useRef(0),kr=I.useRef(0),fa=I.useRef(null),[Fa,Rt]=me.split("-"),dn=I.useMemo(()=>C.reduce((be,$e,mt)=>mt>=$a?be:be+$e.height,0),[C,$a]),St=UR(),ks=v.invert||x,_o=Tt==="loading";Vn.current=I.useMemo(()=>$a*ge+dn,[$a,dn]),I.useEffect(()=>{Yt.current=Ja},[Ja]),I.useEffect(()=>{W(!0)},[]),I.useEffect(()=>{const be=dt.current;if(be){const $e=be.getBoundingClientRect().height;return Wt($e),_(mt=>[{toastId:v.id,height:$e,position:v.position},...mt]),()=>_(mt=>mt.filter(wt=>wt.toastId!==v.id))}},[_,v.id]),I.useLayoutEffect(()=>{if(!Q)return;const be=dt.current,$e=be.style.height;be.style.height="auto";const mt=be.getBoundingClientRect().height;be.style.height=$e,Wt(mt),_(wt=>wt.find(We=>We.toastId===v.id)?wt.map(We=>We.toastId===v.id?{...We,height:mt}:We):[{toastId:v.id,height:mt,position:v.position},...wt])},[Q,v.title,v.description,_,v.id,v.jsx,v.action,v.cancel]);const wn=I.useCallback(()=>{ne(!0),Xe(Vn.current),_(be=>be.filter($e=>$e.toastId!==v.id)),setTimeout(()=>{B(v)},FR)},[v,B,_,Vn]);I.useEffect(()=>{if(v.promise&&Tt==="loading"||v.duration===1/0||v.type==="loading")return;let be;return D||N||St?(()=>{if(kr.current<Ao.current){const wt=new Date().getTime()-Ao.current;Yt.current=Yt.current-wt}kr.current=new Date().getTime()})():(()=>{Yt.current!==1/0&&(Ao.current=new Date().getTime(),be=setTimeout(()=>{v.onAutoClose==null||v.onAutoClose.call(v,v),wn()},Yt.current))})(),()=>clearTimeout(be)},[D,N,v,Tt,St,wn]),I.useEffect(()=>{v.delete&&(wn(),v.onDismiss==null||v.onDismiss.call(v,v))},[wn,v.delete]);function Cl(){var be;if(Y!=null&&Y.loading){var $e;return I.createElement("div",{className:An(O==null?void 0:O.loader,v==null||($e=v.classNames)==null?void 0:$e.loader,"sonner-loader"),"data-visible":Tt==="loading"},Y.loading)}return I.createElement(MR,{className:An(O==null?void 0:O.loader,v==null||(be=v.classNames)==null?void 0:be.loader),visible:Tt==="loading"})}const Tl=v.icon||(Y==null?void 0:Y[Tt])||_R(Tt);var Pa,En;return I.createElement("li",{tabIndex:0,ref:dt,className:An(he,Nt,O==null?void 0:O.toast,v==null||(o=v.classNames)==null?void 0:o.toast,O==null?void 0:O.default,O==null?void 0:O[Tt],v==null||(r=v.classNames)==null?void 0:r[Tt]),"data-sonner-toast":"","data-rich-colors":(Pa=v.richColors)!=null?Pa:K,"data-styled":!(v.jsx||v.unstyled||w),"data-mounted":Q,"data-promise":!!v.promise,"data-swiped":we,"data-removed":ee,"data-visible":Ro,"data-y-position":Fa,"data-x-position":Rt,"data-index":T,"data-front":No,"data-swiping":te,"data-dismissible":ca,"data-type":Tt,"data-invert":ks,"data-swipe-out":ie,"data-swipe-direction":R,"data-expanded":!!(D||ce&&Q),"data-testid":v.testId,style:{"--index":T,"--toasts-before":T,"--z-index":j.length-T,"--offset":`${ee?Ie:Vn.current}px`,"--initial-height":ce?"auto":`${fn}px`,...q,...v.style},onDragEnd:()=>{oe(!1),P(null),fa.current=null},onPointerDown:be=>{be.button!==2&&(_o||!ca||(Ka.current=new Date,Xe(Vn.current),be.target.setPointerCapture(be.pointerId),be.target.tagName!=="BUTTON"&&(oe(!0),fa.current={x:be.clientX,y:be.clientY})))},onPointerUp:()=>{var be,$e,mt;if(ie||!ca)return;fa.current=null;const wt=Number(((be=dt.current)==null?void 0:be.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),da=Number((($e=dt.current)==null?void 0:$e.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),We=new Date().getTime()-((mt=Ka.current)==null?void 0:mt.getTime()),_t=le==="x"?wt:da,Wa=Math.abs(_t)/We;if(Math.abs(_t)>=JR||Wa>.11){Xe(Vn.current),v.onDismiss==null||v.onDismiss.call(v,v),G(le==="x"?wt>0?"right":"left":da>0?"down":"up"),wn(),Te(!0);return}else{var Ot,Mt;(Ot=dt.current)==null||Ot.style.setProperty("--swipe-amount-x","0px"),(Mt=dt.current)==null||Mt.style.setProperty("--swipe-amount-y","0px")}xe(!1),oe(!1),P(null)},onPointerMove:be=>{var $e,mt,wt;if(!fa.current||!ca||(($e=window.getSelection())==null?void 0:$e.toString().length)>0)return;const We=be.clientY-fa.current.y,_t=be.clientX-fa.current.x;var Wa;const Ot=(Wa=a.swipeDirections)!=null?Wa:PR(me);!le&&(Math.abs(_t)>1||Math.abs(We)>1)&&P(Math.abs(_t)>Math.abs(We)?"x":"y");let Mt={x:0,y:0};const Nl=mn=>1/(1.5+Math.abs(mn)/20);if(le==="y"){if(Ot.includes("top")||Ot.includes("bottom"))if(Ot.includes("top")&&We<0||Ot.includes("bottom")&&We>0)Mt.y=We;else{const mn=We*Nl(We);Mt.y=Math.abs(mn)<Math.abs(We)?mn:We}}else if(le==="x"&&(Ot.includes("left")||Ot.includes("right")))if(Ot.includes("left")&&_t<0||Ot.includes("right")&&_t>0)Mt.x=_t;else{const mn=_t*Nl(_t);Mt.x=Math.abs(mn)<Math.abs(_t)?mn:_t}(Math.abs(Mt.x)>0||Math.abs(Mt.y)>0)&&xe(!0),(mt=dt.current)==null||mt.style.setProperty("--swipe-amount-x",`${Mt.x}px`),(wt=dt.current)==null||wt.style.setProperty("--swipe-amount-y",`${Mt.y}px`)}},zr&&!v.jsx&&Tt!=="loading"?I.createElement("button",{"aria-label":J,"data-disabled":_o,"data-close-button":!0,onClick:_o||!ca?()=>{}:()=>{wn(),v.onDismiss==null||v.onDismiss.call(v,v)},className:An(O==null?void 0:O.closeButton,v==null||(i=v.classNames)==null?void 0:i.closeButton)},(En=Y==null?void 0:Y.close)!=null?En:LR):null,(Tt||v.icon||v.promise)&&v.icon!==null&&((Y==null?void 0:Y[Tt])!==null||v.icon)?I.createElement("div",{"data-icon":"",className:An(O==null?void 0:O.icon,v==null||(c=v.classNames)==null?void 0:c.icon)},v.promise||v.type==="loading"&&!v.icon?v.icon||Cl():null,v.type!=="loading"?Tl:null):null,I.createElement("div",{"data-content":"",className:An(O==null?void 0:O.content,v==null||(f=v.classNames)==null?void 0:f.content)},I.createElement("div",{"data-title":"",className:An(O==null?void 0:O.title,v==null||(d=v.classNames)==null?void 0:d.title)},v.jsx?v.jsx:typeof v.title=="function"?v.title():v.title),v.description?I.createElement("div",{"data-description":"",className:An(pe,zs,O==null?void 0:O.description,v==null||(m=v.classNames)==null?void 0:m.description)},typeof v.description=="function"?v.description():v.description):null),I.isValidElement(v.cancel)?v.cancel:v.cancel&&ls(v.cancel)?I.createElement("button",{"data-button":!0,"data-cancel":!0,style:v.cancelButtonStyle||V,onClick:be=>{ls(v.cancel)&&ca&&(v.cancel.onClick==null||v.cancel.onClick.call(v.cancel,be),wn())},className:An(O==null?void 0:O.cancelButton,v==null||(h=v.classNames)==null?void 0:h.cancelButton)},v.cancel.label):null,I.isValidElement(v.action)?v.action:v.action&&ls(v.action)?I.createElement("button",{"data-button":!0,"data-action":!0,style:v.actionButtonStyle||ae,onClick:be=>{ls(v.action)&&(v.action.onClick==null||v.action.onClick.call(v.action,be),!be.defaultPrevented&&wn())},className:An(O==null?void 0:O.actionButton,v==null||(p=v.classNames)==null?void 0:p.actionButton)},v.action.label):null)};function Ig(){if(typeof window>"u"||typeof document>"u")return"ltr";const a=document.documentElement.getAttribute("dir");return a==="auto"||!a?window.getComputedStyle(document.documentElement).direction:a}function IR(a,o){const r={};return[a,o].forEach((i,c)=>{const f=c===1,d=f?"--mobile-offset":"--offset",m=f?ZR:QR;function h(p){["top","right","bottom","left"].forEach(x=>{r[`${d}-${x}`]=typeof p=="number"?`${p}px`:p})}typeof i=="number"||typeof i=="string"?h(i):typeof i=="object"?["top","right","bottom","left"].forEach(p=>{i[p]===void 0?r[`${d}-${p}`]=m:r[`${d}-${p}`]=typeof i[p]=="number"?`${i[p]}px`:i[p]}):h(m)}),r}const eA=I.forwardRef(function(o,r){const{id:i,invert:c,position:f="bottom-right",hotkey:d=["altKey","KeyT"],expand:m,closeButton:h,className:p,offset:x,mobileOffset:v,theme:w="light",richColors:N,duration:_,style:E,visibleToasts:C=XR,toastOptions:T,dir:j=Ig(),gap:D=$R,icons:B,containerAriaLabel:K="Notifications"}=o,[F,q]=I.useState([]),V=I.useMemo(()=>i?F.filter(Q=>Q.toasterId===i):F.filter(Q=>!Q.toasterId),[F,i]),ae=I.useMemo(()=>Array.from(new Set([f].concat(V.filter(Q=>Q.position).map(Q=>Q.position)))),[V,f]),[he,pe]=I.useState([]),[fe,me]=I.useState(!1),[ge,ce]=I.useState(!1),[O,Y]=I.useState(w!=="system"?w:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),J=I.useRef(null),le=d.join("+").replace(/Key/g,"").replace(/Digit/g,""),P=I.useRef(null),R=I.useRef(!1),G=I.useCallback(Q=>{q(W=>{var ee;return(ee=W.find(ne=>ne.id===Q.id))!=null&&ee.delete||Ht.dismiss(Q.id),W.filter(({id:ne})=>ne!==Q.id)})},[]);return I.useEffect(()=>Ht.subscribe(Q=>{if(Q.dismiss){requestAnimationFrame(()=>{q(W=>W.map(ee=>ee.id===Q.id?{...ee,delete:!0}:ee))});return}setTimeout(()=>{wv.flushSync(()=>{q(W=>{const ee=W.findIndex(ne=>ne.id===Q.id);return ee!==-1?[...W.slice(0,ee),{...W[ee],...Q},...W.slice(ee+1)]:[Q,...W]})})})}),[F]),I.useEffect(()=>{if(w!=="system"){Y(w);return}if(w==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?Y("dark"):Y("light")),typeof window>"u")return;const Q=window.matchMedia("(prefers-color-scheme: dark)");try{Q.addEventListener("change",({matches:W})=>{Y(W?"dark":"light")})}catch{Q.addListener(({matches:ee})=>{try{Y(ee?"dark":"light")}catch(ne){console.error(ne)}})}},[w]),I.useEffect(()=>{F.length<=1&&me(!1)},[F]),I.useEffect(()=>{const Q=W=>{var ee;if(d.every(oe=>W[oe]||W.code===oe)){var te;me(!0),(te=J.current)==null||te.focus()}W.code==="Escape"&&(document.activeElement===J.current||(ee=J.current)!=null&&ee.contains(document.activeElement))&&me(!1)};return document.addEventListener("keydown",Q),()=>document.removeEventListener("keydown",Q)},[d]),I.useEffect(()=>{if(J.current)return()=>{P.current&&(P.current.focus({preventScroll:!0}),P.current=null,R.current=!1)}},[J.current]),I.createElement("section",{ref:r,"aria-label":`${K} ${le}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},ae.map((Q,W)=>{var ee;const[ne,te]=Q.split("-");return V.length?I.createElement("ol",{key:Q,dir:j==="auto"?Ig():j,tabIndex:-1,ref:J,className:p,"data-sonner-toaster":!0,"data-sonner-theme":O,"data-y-position":ne,"data-x-position":te,style:{"--front-toast-height":`${((ee=he[0])==null?void 0:ee.height)||0}px`,"--width":`${KR}px`,"--gap":`${D}px`,...E,...IR(x,v)},onBlur:oe=>{R.current&&!oe.currentTarget.contains(oe.relatedTarget)&&(R.current=!1,P.current&&(P.current.focus({preventScroll:!0}),P.current=null))},onFocus:oe=>{oe.target instanceof HTMLElement&&oe.target.dataset.dismissible==="false"||R.current||(R.current=!0,P.current=oe.relatedTarget)},onMouseEnter:()=>me(!0),onMouseMove:()=>me(!0),onMouseLeave:()=>{ge||me(!1)},onDragEnd:()=>me(!1),onPointerDown:oe=>{oe.target instanceof HTMLElement&&oe.target.dataset.dismissible==="false"||ce(!0)},onPointerUp:()=>ce(!1)},V.filter(oe=>!oe.position&&W===0||oe.position===Q).map((oe,ie)=>{var Te,we;return I.createElement(WR,{key:oe.id,icons:B,index:ie,toast:oe,defaultRichColors:N,duration:(Te=T==null?void 0:T.duration)!=null?Te:_,className:T==null?void 0:T.className,descriptionClassName:T==null?void 0:T.descriptionClassName,invert:c,visibleToasts:C,closeButton:(we=T==null?void 0:T.closeButton)!=null?we:h,interacting:ge,position:Q,style:T==null?void 0:T.style,unstyled:T==null?void 0:T.unstyled,classNames:T==null?void 0:T.classNames,cancelButtonStyle:T==null?void 0:T.cancelButtonStyle,actionButtonStyle:T==null?void 0:T.actionButtonStyle,closeButtonAriaLabel:T==null?void 0:T.closeButtonAriaLabel,removeToast:G,toasts:V.filter(xe=>xe.position==oe.position),heights:he.filter(xe=>xe.position==oe.position),setHeights:pe,expandByDefault:m,gap:D,expanded:fe,swipeDirections:o.swipeDirections})})):null}))});function tA(a){return b.jsx(eA,{className:"toaster group",style:{"--normal-bg":"hsl(var(--popover))","--normal-text":"hsl(var(--popover-foreground))","--normal-border":"hsl(var(--border))"},...a})}D1.createRoot(document.getElementById("root")).render(b.jsx(y.StrictMode,{children:b.jsxs(hE,{children:[b.jsx(NR,{}),b.jsx(tA,{})]})}));export{K2 as $,sA as A,Vt as B,L2 as C,My as D,mA as E,J2 as F,MA as G,V0 as H,PN as I,G0 as J,X0 as K,pR as L,TA as M,NA as N,Ty as O,FC as P,cb as Q,$C as R,FN as S,JC as T,cs as U,fs as V,_A as W,hw as X,Av as Y,$v as Z,k1 as _,Be as a,yE as a0,Mr as a1,Le as a2,Tr as a3,bN as a4,sN as a5,G2 as a6,nA as a7,Bn as a8,dv as a9,Cv as aa,fA as ab,y2 as ac,dA as ad,yA as ae,bA as af,gA as ag,vA as ah,pA as ai,hA as aj,lA as ak,rA as al,aA as am,iA as an,PC as ao,ev as ap,xA as aq,SA as ar,wA as as,EA as at,OA as au,CA as av,vw as b,at as c,Dv as d,oA as e,Dy as f,jy as g,eT as h,Yf as i,b as j,Nv as k,H2 as l,Rv as m,AA as n,Ny as o,De as p,Ry as q,y as r,Ay as s,_y as t,nt as u,RA as v,wo as w,mE as x,uA as y,cA as z};