@tyanxie/paimon-darwin-arm64 2.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/paimon +1 -1
- package/package.json +1 -1
- package/web/assets/index-B5Yub30J.css +1 -0
- package/web/assets/index-Dd-YiX5e.js +259 -0
- package/web/assets/{index-DsjiosHk.js → index-PCm-hUF1.js} +1 -1
- package/web/assets/{markdown-OowzRXxA.js → markdown-Bc9cX4Ha.js} +2 -2
- package/web/assets/{modalFeatures-BeDlpc4S.js → modalFeatures-D6PlDlrr.js} +1 -1
- package/web/assets/{modelConfig-BWIG2U9q.js → modelConfig-BvuGgERB.js} +1 -1
- package/web/index.html +3 -3
- package/web/assets/index-BLBkIpT7.css +0 -1
- package/web/assets/index-xz7ziSVU.js +0 -264
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./modalFeatures-D6PlDlrr.js","./framework-gzBbjyR4.js","./markdown-Bc9cX4Ha.js","./index-PCm-hUF1.js","./modelConfig-BvuGgERB.js","./isObjectLike-DlmVz5ty.js","./mermaid.core-DVbCkJL3.js","./purify.es-CAi2OJFm.js","./mix-CrMk8dT1.js","./mermaidTheme-DoQvsUbV.js","./channel-DF8NlRb_.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{a as f,j as l,g as Gc,b as Yc,R as bn,r as kt,_ as gt,c as Jc}from"./framework-gzBbjyR4.js";import{d as bs,M as Xc,b as Zc,c as Qc,r as eu,f as ma,s as tu,e as ga,j as ya,u as nu,g as su,i as vs}from"./markdown-Bc9cX4Ha.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))s(r);new MutationObserver(r=>{for(const i of r)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&s(o)}).observe(document,{childList:!0,subtree:!0});function n(r){const i={};return r.integrity&&(i.integrity=r.integrity),r.referrerPolicy&&(i.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?i.credentials="include":r.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function s(r){if(r.ep)return;r.ep=!0;const i=n(r);fetch(r.href,i)}})();/**
|
|
3
|
+
* react-router v7.15.1
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Remix Software Inc.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
9
|
+
*
|
|
10
|
+
* @license MIT
|
|
11
|
+
*/var Ei="popstate";function Ti(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function ru(e={}){function t(s,r){var u;let i=(u=r.state)==null?void 0:u.masked,{pathname:o,search:a,hash:c}=i||s.location;return Gs("",{pathname:o,search:a,hash:c},r.state&&r.state.usr||null,r.state&&r.state.key||"default",i?{pathname:s.location.pathname,search:s.location.search,hash:s.location.hash}:void 0)}function n(s,r){return typeof r=="string"?r:Ut(r)}return ou(t,n,null,e)}function oe(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Ae(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function iu(){return Math.random().toString(36).substring(2,10)}function Ni(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function Gs(e,t,n=null,s,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?jt(t):t,state:n,key:t&&t.key||s||iu(),mask:r}}function Ut({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function jt(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let s=e.indexOf("?");s>=0&&(t.search=e.substring(s),e=e.substring(0,s)),e&&(t.pathname=e)}return t}function ou(e,t,n,s={}){let{window:r=document.defaultView,v5Compat:i=!1}=s,o=r.history,a="POP",c=null,u=d();u==null&&(u=0,o.replaceState({...o.state,idx:u},""));function d(){return(o.state||{idx:null}).idx}function h(){a="POP";let y=d(),b=y==null?null:y-u;u=y,c&&c({action:a,location:x.location,delta:b})}function m(y,b){a="PUSH";let k=Ti(y)?y:Gs(x.location,y,b);u=d()+1;let v=Ni(k,u),S=x.createHref(k.mask||k);try{o.pushState(v,"",S)}catch(w){if(w instanceof DOMException&&w.name==="DataCloneError")throw w;r.location.assign(S)}i&&c&&c({action:a,location:x.location,delta:1})}function g(y,b){a="REPLACE";let k=Ti(y)?y:Gs(x.location,y,b);u=d();let v=Ni(k,u),S=x.createHref(k.mask||k);o.replaceState(v,"",S),i&&c&&c({action:a,location:x.location,delta:0})}function p(y){return au(y)}let x={get action(){return a},get location(){return e(r,o)},listen(y){if(c)throw new Error("A history only accepts one active listener");return r.addEventListener(Ei,h),c=y,()=>{r.removeEventListener(Ei,h),c=null}},createHref(y){return t(r,y)},createURL:p,encodeLocation(y){let b=p(y);return{pathname:b.pathname,search:b.search,hash:b.hash}},push:m,replace:g,go(y){return o.go(y)}};return x}function au(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),oe(n,"No window.location.(origin|href) available to create URL");let s=typeof e=="string"?e:Ut(e);return s=s.replace(/ $/,"%20"),!t&&s.startsWith("//")&&(s=n+s),new URL(s,n)}function xa(e,t,n="/"){return lu(e,t,n,!1)}function lu(e,t,n,s,r){let i=typeof t=="string"?jt(t):t,o=Be(i.pathname||"/",n);if(o==null)return null;let a=cu(e),c=null,u=wu(o);for(let d=0;c==null&&d<a.length;++d)c=bu(a[d],u,s);return c}function cu(e){let t=ba(e);return uu(t),t}function ba(e,t=[],n=[],s="",r=!1){let i=(o,a,c=r,u)=>{let d={relativePath:u===void 0?o.path||"":u,caseSensitive:o.caseSensitive===!0,childrenIndex:a,route:o};if(d.relativePath.startsWith("/")){if(!d.relativePath.startsWith(s)&&c)return;oe(d.relativePath.startsWith(s),`Absolute route path "${d.relativePath}" nested under path "${s}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),d.relativePath=d.relativePath.slice(s.length)}let h=Ce([s,d.relativePath]),m=n.concat(d);o.children&&o.children.length>0&&(oe(o.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${h}".`),ba(o.children,t,m,h,c)),!(o.path==null&&!o.index)&&t.push({path:h,score:yu(h,o.index),routesMeta:m})};return e.forEach((o,a)=>{var c;if(o.path===""||!((c=o.path)!=null&&c.includes("?")))i(o,a);else for(let u of va(o.path))i(o,a,!0,u)}),t}function va(e){let t=e.split("/");if(t.length===0)return[];let[n,...s]=t,r=n.endsWith("?"),i=n.replace(/\?$/,"");if(s.length===0)return r?[i,""]:[i];let o=va(s.join("/")),a=[];return a.push(...o.map(c=>c===""?i:[i,c].join("/"))),r&&a.push(...o),a.map(c=>e.startsWith("/")&&c===""?"/":c)}function uu(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:xu(t.routesMeta.map(s=>s.childrenIndex),n.routesMeta.map(s=>s.childrenIndex)))}var du=/^:[\w-]+$/,fu=3,hu=2,pu=1,mu=10,gu=-2,Ri=e=>e==="*";function yu(e,t){let n=e.split("/"),s=n.length;return n.some(Ri)&&(s+=gu),t&&(s+=hu),n.filter(r=>!Ri(r)).reduce((r,i)=>r+(du.test(i)?fu:i===""?pu:mu),s)}function xu(e,t){return e.length===t.length&&e.slice(0,-1).every((s,r)=>s===t[r])?e[e.length-1]-t[t.length-1]:0}function bu(e,t,n=!1){let{routesMeta:s}=e,r={},i="/",o=[];for(let a=0;a<s.length;++a){let c=s[a],u=a===s.length-1,d=i==="/"?t:t.slice(i.length)||"/",h=Bn({path:c.relativePath,caseSensitive:c.caseSensitive,end:u},d),m=c.route;if(!h&&u&&n&&!s[s.length-1].route.index&&(h=Bn({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},d)),!h)return null;Object.assign(r,h.params),o.push({params:r,pathname:Ce([i,h.pathname]),pathnameBase:ju(Ce([i,h.pathnameBase])),route:m}),h.pathnameBase!=="/"&&(i=Ce([i,h.pathnameBase]))}return o}function Bn(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,s]=vu(e.path,e.caseSensitive,e.end),r=t.match(n);if(!r)return null;let i=r[0],o=i.replace(/(.)\/+$/,"$1"),a=r.slice(1);return{params:s.reduce((u,{paramName:d,isOptional:h},m)=>{if(d==="*"){let p=a[m]||"";o=i.slice(0,i.length-p.length).replace(/(.)\/+$/,"$1")}const g=a[m];return h&&!g?u[d]=void 0:u[d]=(g||"").replace(/%2F/g,"/"),u},{}),pathname:i,pathnameBase:o,pattern:e}}function vu(e,t=!1,n=!0){Ae(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let s=[],r="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,a,c,u,d)=>{if(s.push({paramName:a,isOptional:c!=null}),c){let h=d.charAt(u+o.length);return h&&h!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(s.push({paramName:"*"}),r+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?r+="\\/*$":e!==""&&e!=="/"&&(r+="(?:(?=\\/|$))"),[new RegExp(r,t?void 0:"i"),s]}function wu(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Ae(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Be(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,s=e.charAt(n);return s&&s!=="/"?null:e.slice(n)||"/"}var Su=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function Cu(e,t="/"){let{pathname:n,search:s="",hash:r=""}=typeof e=="string"?jt(e):e,i;return n?(n=Sa(n),n.startsWith("/")?i=Mi(n.substring(1),"/"):i=Mi(n,t)):i=t,{pathname:i,search:Eu(s),hash:Tu(r)}}function Mi(e,t){let n=zn(t).split("/");return e.split("/").forEach(r=>{r===".."?n.length>1&&n.pop():r!=="."&&n.push(r)}),n.length>1?n.join("/"):"/"}function ws(e,t,n,s){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(s)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function ku(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function wa(e){let t=ku(e);return t.map((n,s)=>s===t.length-1?n.pathname:n.pathnameBase)}function Ar(e,t,n,s=!1){let r;typeof e=="string"?r=jt(e):(r={...e},oe(!r.pathname||!r.pathname.includes("?"),ws("?","pathname","search",r)),oe(!r.pathname||!r.pathname.includes("#"),ws("#","pathname","hash",r)),oe(!r.search||!r.search.includes("#"),ws("#","search","hash",r)));let i=e===""||r.pathname==="",o=i?"/":r.pathname,a;if(o==null)a=n;else{let h=t.length-1;if(!s&&o.startsWith("..")){let m=o.split("/");for(;m[0]==="..";)m.shift(),h-=1;r.pathname=m.join("/")}a=h>=0?t[h]:"/"}let c=Cu(r,a),u=o&&o!=="/"&&o.endsWith("/"),d=(i||o===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||d)&&(c.pathname+="/"),c}var Sa=e=>e.replace(/\/\/+/g,"/"),Ce=e=>Sa(e.join("/")),zn=e=>e.replace(/\/+$/,""),ju=e=>zn(e).replace(/^\/*/,"/"),Eu=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Tu=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,Nu=class{constructor(e,t,n,s=!1){this.status=e,this.statusText=t||"",this.internal=s,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Ru(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function Mu(e){let t=e.map(n=>n.route.path).filter(Boolean);return Ce(t)||"/"}var Ca=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function ka(e,t){let n=e;if(typeof n!="string"||!Su.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let s=n,r=!1;if(Ca)try{let i=new URL(window.location.href),o=n.startsWith("//")?new URL(i.protocol+n):new URL(n),a=Be(o.pathname,t);o.origin===i.origin&&a!=null?n=a+o.search+o.hash:r=!0}catch{Ae(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:s,isExternal:r,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var ja=["POST","PUT","PATCH","DELETE"];new Set(ja);var Au=["GET",...ja];new Set(Au);var Et=f.createContext(null);Et.displayName="DataRouter";var os=f.createContext(null);os.displayName="DataRouterState";var Ea=f.createContext(!1);function Lu(){return f.useContext(Ea)}var Ta=f.createContext({isTransitioning:!1});Ta.displayName="ViewTransition";var Iu=f.createContext(new Map);Iu.displayName="Fetchers";var Pu=f.createContext(null);Pu.displayName="Await";var ve=f.createContext(null);ve.displayName="Navigation";var rn=f.createContext(null);rn.displayName="Location";var je=f.createContext({outlet:null,matches:[],isDataRoute:!1});je.displayName="Route";var Lr=f.createContext(null);Lr.displayName="RouteError";var Na="REACT_ROUTER_ERROR",$u="REDIRECT",Ou="ROUTE_ERROR_RESPONSE";function _u(e){if(e.startsWith(`${Na}:${$u}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function Fu(e){if(e.startsWith(`${Na}:${Ou}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new Nu(t.status,t.statusText,t.data)}catch{}}function Du(e,{relative:t}={}){oe(on(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:s}=f.useContext(ve),{hash:r,pathname:i,search:o}=ln(e,{relative:t}),a=i;return n!=="/"&&(a=i==="/"?n:Ce([n,i])),s.createHref({pathname:a,search:o,hash:r})}function on(){return f.useContext(rn)!=null}function Ee(){return oe(on(),"useLocation() may be used only in the context of a <Router> component."),f.useContext(rn).location}var Ra="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Ma(e){f.useContext(ve).static||f.useLayoutEffect(e)}function an(){let{isDataRoute:e}=f.useContext(je);return e?td():Vu()}function Vu(){oe(on(),"useNavigate() may be used only in the context of a <Router> component.");let e=f.useContext(Et),{basename:t,navigator:n}=f.useContext(ve),{matches:s}=f.useContext(je),{pathname:r}=Ee(),i=JSON.stringify(wa(s)),o=f.useRef(!1);return Ma(()=>{o.current=!0}),f.useCallback((c,u={})=>{if(Ae(o.current,Ra),!o.current)return;if(typeof c=="number"){n.go(c);return}let d=Ar(c,JSON.parse(i),r,u.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:Ce([t,d.pathname])),(u.replace?n.replace:n.push)(d,u.state,u)},[t,n,i,r,e])}var Bu=f.createContext(null);function zu(e){let t=f.useContext(je).outlet;return f.useMemo(()=>t&&f.createElement(Bu.Provider,{value:e},t),[t,e])}function Hu(){let{matches:e}=f.useContext(je),t=e[e.length-1];return(t==null?void 0:t.params)??{}}function ln(e,{relative:t}={}){let{matches:n}=f.useContext(je),{pathname:s}=Ee(),r=JSON.stringify(wa(n));return f.useMemo(()=>Ar(e,JSON.parse(r),s,t==="path"),[e,r,s,t])}function Uu(e,t){return Aa(e,t)}function Aa(e,t,n){var y;oe(on(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:s}=f.useContext(ve),{matches:r}=f.useContext(je),i=r[r.length-1],o=i?i.params:{},a=i?i.pathname:"/",c=i?i.pathnameBase:"/",u=i&&i.route;{let b=u&&u.path||"";Ia(a,!u||b.endsWith("*")||b.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${a}" (under <Route path="${b}">) 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.
|
|
12
|
+
|
|
13
|
+
Please change the parent <Route path="${b}"> to <Route path="${b==="/"?"*":`${b}/*`}">.`)}let d=Ee(),h;if(t){let b=typeof t=="string"?jt(t):t;oe(c==="/"||((y=b.pathname)==null?void 0:y.startsWith(c)),`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 "${c}" but pathname "${b.pathname}" was given in the \`location\` prop.`),h=b}else h=d;let m=h.pathname||"/",g=m;if(c!=="/"){let b=c.replace(/^\//,"").split("/");g="/"+m.replace(/^\//,"").split("/").slice(b.length).join("/")}let p=n&&n.state.matches.length?n.state.matches.map(b=>Object.assign(b,{route:n.manifest[b.route.id]||b.route})):xa(e,{pathname:g});Ae(u||p!=null,`No routes matched location "${h.pathname}${h.search}${h.hash}" `),Ae(p==null||p[p.length-1].route.element!==void 0||p[p.length-1].route.Component!==void 0||p[p.length-1].route.lazy!==void 0,`Matched leaf route at location "${h.pathname}${h.search}${h.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 x=Yu(p&&p.map(b=>Object.assign({},b,{params:Object.assign({},o,b.params),pathname:Ce([c,s.encodeLocation?s.encodeLocation(b.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:b.pathname]),pathnameBase:b.pathnameBase==="/"?c:Ce([c,s.encodeLocation?s.encodeLocation(b.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:b.pathnameBase])})),r,n);return t&&x?f.createElement(rn.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...h},navigationType:"POP"}},x):x}function Ku(){let e=ed(),t=Ru(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,s="rgba(200,200,200, 0.5)",r={padding:"0.5rem",backgroundColor:s},i={padding:"2px 4px",backgroundColor:s},o=null;return console.error("Error handled by React Router default ErrorBoundary:",e),o=f.createElement(f.Fragment,null,f.createElement("p",null,"💿 Hey developer 👋"),f.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",f.createElement("code",{style:i},"ErrorBoundary")," or"," ",f.createElement("code",{style:i},"errorElement")," prop on your route.")),f.createElement(f.Fragment,null,f.createElement("h2",null,"Unexpected Application Error!"),f.createElement("h3",{style:{fontStyle:"italic"}},t),n?f.createElement("pre",{style:r},n):null,o)}var Wu=f.createElement(Ku,null),La=class extends f.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=Fu(e.digest);n&&(e=n)}let t=e!==void 0?f.createElement(je.Provider,{value:this.props.routeContext},f.createElement(Lr.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?f.createElement(qu,{error:e},t):t}};La.contextType=Ea;var Ss=new WeakMap;function qu({children:e,error:t}){let{basename:n}=f.useContext(ve);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let s=_u(t.digest);if(s){let r=Ss.get(t);if(r)throw r;let i=ka(s.location,n);if(Ca&&!Ss.get(t))if(i.isExternal||s.reloadDocument)window.location.href=i.absoluteURL||i.to;else{const o=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:s.replace}));throw Ss.set(t,o),o}return f.createElement("meta",{httpEquiv:"refresh",content:`0;url=${i.absoluteURL||i.to}`})}}return e}function Gu({routeContext:e,match:t,children:n}){let s=f.useContext(Et);return s&&s.static&&s.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=t.route.id),f.createElement(je.Provider,{value:e},n)}function Yu(e,t=[],n){let s=n==null?void 0:n.state;if(e==null){if(!s)return null;if(s.errors)e=s.matches;else if(t.length===0&&!s.initialized&&s.matches.length>0)e=s.matches;else return null}let r=e,i=s==null?void 0:s.errors;if(i!=null){let d=r.findIndex(h=>h.route.id&&(i==null?void 0:i[h.route.id])!==void 0);oe(d>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(i).join(",")}`),r=r.slice(0,Math.min(r.length,d+1))}let o=!1,a=-1;if(n&&s){o=s.renderFallback;for(let d=0;d<r.length;d++){let h=r[d];if((h.route.HydrateFallback||h.route.hydrateFallbackElement)&&(a=d),h.route.id){let{loaderData:m,errors:g}=s,p=h.route.loader&&!m.hasOwnProperty(h.route.id)&&(!g||g[h.route.id]===void 0);if(h.route.lazy||p){n.isStatic&&(o=!0),a>=0?r=r.slice(0,a+1):r=[r[0]];break}}}}let c=n==null?void 0:n.onError,u=s&&c?(d,h)=>{var m,g;c(d,{location:s.location,params:((g=(m=s.matches)==null?void 0:m[0])==null?void 0:g.params)??{},pattern:Mu(s.matches),errorInfo:h})}:void 0;return r.reduceRight((d,h,m)=>{let g,p=!1,x=null,y=null;s&&(g=i&&h.route.id?i[h.route.id]:void 0,x=h.route.errorElement||Wu,o&&(a<0&&m===0?(Ia("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),p=!0,y=null):a===m&&(p=!0,y=h.route.hydrateFallbackElement||null)));let b=t.concat(r.slice(0,m+1)),k=()=>{let v;return g?v=x:p?v=y:h.route.Component?v=f.createElement(h.route.Component,null):h.route.element?v=h.route.element:v=d,f.createElement(Gu,{match:h,routeContext:{outlet:d,matches:b,isDataRoute:s!=null},children:v})};return s&&(h.route.ErrorBoundary||h.route.errorElement||m===0)?f.createElement(La,{location:s.location,revalidation:s.revalidation,component:x,error:g,children:k(),routeContext:{outlet:null,matches:b,isDataRoute:!0},onError:u}):k()},null)}function Ir(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Ju(e){let t=f.useContext(Et);return oe(t,Ir(e)),t}function Xu(e){let t=f.useContext(os);return oe(t,Ir(e)),t}function Zu(e){let t=f.useContext(je);return oe(t,Ir(e)),t}function Pr(e){let t=Zu(e),n=t.matches[t.matches.length-1];return oe(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Qu(){return Pr("useRouteId")}function ed(){var s;let e=f.useContext(Lr),t=Xu("useRouteError"),n=Pr("useRouteError");return e!==void 0?e:(s=t.errors)==null?void 0:s[n]}function td(){let{router:e}=Ju("useNavigate"),t=Pr("useNavigate"),n=f.useRef(!1);return Ma(()=>{n.current=!0}),f.useCallback(async(r,i={})=>{Ae(n.current,Ra),n.current&&(typeof r=="number"?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var Ai={};function Ia(e,t,n){!t&&!Ai[e]&&(Ai[e]=!0,Ae(!1,n))}f.memo(nd);function nd({routes:e,manifest:t,future:n,state:s,isStatic:r,onError:i}){return Aa(e,void 0,{manifest:t,state:s,isStatic:r,onError:i})}function sd(e){return zu(e.context)}function Ot(e){oe(!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 rd({basename:e="/",children:t=null,location:n,navigationType:s="POP",navigator:r,static:i=!1,useTransitions:o}){oe(!on(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let a=e.replace(/^\/*/,"/"),c=f.useMemo(()=>({basename:a,navigator:r,static:i,useTransitions:o,future:{}}),[a,r,i,o]);typeof n=="string"&&(n=jt(n));let{pathname:u="/",search:d="",hash:h="",state:m=null,key:g="default",mask:p}=n,x=f.useMemo(()=>{let y=Be(u,a);return y==null?null:{location:{pathname:y,search:d,hash:h,state:m,key:g,mask:p},navigationType:s}},[a,u,d,h,m,g,s,p]);return Ae(x!=null,`<Router basename="${a}"> is not able to match the URL "${u}${d}${h}" because it does not start with the basename, so the <Router> won't render anything.`),x==null?null:f.createElement(ve.Provider,{value:c},f.createElement(rn.Provider,{children:t,value:x}))}function id({children:e,location:t}){return Uu(Ys(e),t)}function Ys(e,t=[]){let n=[];return f.Children.forEach(e,(s,r)=>{if(!f.isValidElement(s))return;let i=[...t,r];if(s.type===f.Fragment){n.push.apply(n,Ys(s.props.children,i));return}oe(s.type===Ot,`[${typeof s.type=="string"?s.type:s.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),oe(!s.props.index||!s.props.children,"An index route cannot have child routes.");let o={id:s.props.id||i.join("-"),caseSensitive:s.props.caseSensitive,element:s.props.element,Component:s.props.Component,index:s.props.index,path:s.props.path,middleware:s.props.middleware,loader:s.props.loader,action:s.props.action,hydrateFallbackElement:s.props.hydrateFallbackElement,HydrateFallback:s.props.HydrateFallback,errorElement:s.props.errorElement,ErrorBoundary:s.props.ErrorBoundary,hasErrorBoundary:s.props.hasErrorBoundary===!0||s.props.ErrorBoundary!=null||s.props.errorElement!=null,shouldRevalidate:s.props.shouldRevalidate,handle:s.props.handle,lazy:s.props.lazy};s.props.children&&(o.children=Ys(s.props.children,i)),n.push(o)}),n}var En="get",Tn="application/x-www-form-urlencoded";function as(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function od(e){return as(e)&&e.tagName.toLowerCase()==="button"}function ad(e){return as(e)&&e.tagName.toLowerCase()==="form"}function ld(e){return as(e)&&e.tagName.toLowerCase()==="input"}function cd(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function ud(e,t){return e.button===0&&(!t||t==="_self")&&!cd(e)}var vn=null;function dd(){if(vn===null)try{new FormData(document.createElement("form"),0),vn=!1}catch{vn=!0}return vn}var fd=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Cs(e){return e!=null&&!fd.has(e)?(Ae(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Tn}"`),null):e}function hd(e,t){let n,s,r,i,o;if(ad(e)){let a=e.getAttribute("action");s=a?Be(a,t):null,n=e.getAttribute("method")||En,r=Cs(e.getAttribute("enctype"))||Tn,i=new FormData(e)}else if(od(e)||ld(e)&&(e.type==="submit"||e.type==="image")){let a=e.form;if(a==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let c=e.getAttribute("formaction")||a.getAttribute("action");if(s=c?Be(c,t):null,n=e.getAttribute("formmethod")||a.getAttribute("method")||En,r=Cs(e.getAttribute("formenctype"))||Cs(a.getAttribute("enctype"))||Tn,i=new FormData(a,e),!dd()){let{name:u,type:d,value:h}=e;if(d==="image"){let m=u?`${u}.`:"";i.append(`${m}x`,"0"),i.append(`${m}y`,"0")}else u&&i.append(u,h)}}else{if(as(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=En,s=null,r=Tn,o=e}return i&&r==="text/plain"&&(o=i,i=void 0),{action:s,method:n.toLowerCase(),encType:r,formData:i,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function $r(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Pa(e,t,n,s){let r=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?r.pathname.endsWith("/")?r.pathname=`${r.pathname}_.${s}`:r.pathname=`${r.pathname}.${s}`:r.pathname==="/"?r.pathname=`_root.${s}`:t&&Be(r.pathname,t)==="/"?r.pathname=`${zn(t)}/_root.${s}`:r.pathname=`${zn(r.pathname)}.${s}`,r}async function pd(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function md(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function gd(e,t,n){let s=await Promise.all(e.map(async r=>{let i=t.routes[r.route.id];if(i){let o=await pd(i,n);return o.links?o.links():[]}return[]}));return vd(s.flat(1).filter(md).filter(r=>r.rel==="stylesheet"||r.rel==="preload").map(r=>r.rel==="stylesheet"?{...r,rel:"prefetch",as:"style"}:{...r,rel:"prefetch"}))}function Li(e,t,n,s,r,i){let o=(c,u)=>n[u]?c.route.id!==n[u].route.id:!0,a=(c,u)=>{var d;return n[u].pathname!==c.pathname||((d=n[u].route.path)==null?void 0:d.endsWith("*"))&&n[u].params["*"]!==c.params["*"]};return i==="assets"?t.filter((c,u)=>o(c,u)||a(c,u)):i==="data"?t.filter((c,u)=>{var h;let d=s.routes[c.route.id];if(!d||!d.hasLoader)return!1;if(o(c,u)||a(c,u))return!0;if(c.route.shouldRevalidate){let m=c.route.shouldRevalidate({currentUrl:new URL(r.pathname+r.search+r.hash,window.origin),currentParams:((h=n[0])==null?void 0:h.params)||{},nextUrl:new URL(e,window.origin),nextParams:c.params,defaultShouldRevalidate:!0});if(typeof m=="boolean")return m}return!0}):[]}function yd(e,t,{includeHydrateFallback:n}={}){return xd(e.map(s=>{let r=t.routes[s.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function xd(e){return[...new Set(e)]}function bd(e){let t={},n=Object.keys(e).sort();for(let s of n)t[s]=e[s];return t}function vd(e,t){let n=new Set;return new Set(t),e.reduce((s,r)=>{let i=JSON.stringify(bd(r));return n.has(i)||(n.add(i),s.push({key:i,link:r})),s},[])}function Or(){let e=f.useContext(Et);return $r(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function wd(){let e=f.useContext(os);return $r(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var _r=f.createContext(void 0);_r.displayName="FrameworkContext";function Fr(){let e=f.useContext(_r);return $r(e,"You must render this element inside a <HydratedRouter> element"),e}function Sd(e,t){let n=f.useContext(_r),[s,r]=f.useState(!1),[i,o]=f.useState(!1),{onFocus:a,onBlur:c,onMouseEnter:u,onMouseLeave:d,onTouchStart:h}=t,m=f.useRef(null);f.useEffect(()=>{if(e==="render"&&o(!0),e==="viewport"){let x=b=>{b.forEach(k=>{o(k.isIntersecting)})},y=new IntersectionObserver(x,{threshold:.5});return m.current&&y.observe(m.current),()=>{y.disconnect()}}},[e]),f.useEffect(()=>{if(s){let x=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(x)}}},[s]);let g=()=>{r(!0)},p=()=>{r(!1),o(!1)};return n?e!=="intent"?[i,m,{}]:[i,m,{onFocus:Lt(a,g),onBlur:Lt(c,p),onMouseEnter:Lt(u,g),onMouseLeave:Lt(d,p),onTouchStart:Lt(h,g)}]:[!1,m,{}]}function Lt(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Cd({page:e,...t}){let n=Lu(),{router:s}=Or(),r=f.useMemo(()=>xa(s.routes,e,s.basename),[s.routes,e,s.basename]);return r?n?f.createElement(jd,{page:e,matches:r,...t}):f.createElement(Ed,{page:e,matches:r,...t}):null}function kd(e){let{manifest:t,routeModules:n}=Fr(),[s,r]=f.useState([]);return f.useEffect(()=>{let i=!1;return gd(e,t,n).then(o=>{i||r(o)}),()=>{i=!0}},[e,t,n]),s}function jd({page:e,matches:t,...n}){let s=Ee(),{future:r}=Fr(),{basename:i}=Or(),o=f.useMemo(()=>{if(e===s.pathname+s.search+s.hash)return[];let a=Pa(e,i,r.unstable_trailingSlashAwareDataRequests,"rsc"),c=!1,u=[];for(let d of t)typeof d.route.shouldRevalidate=="function"?c=!0:u.push(d.route.id);return c&&u.length>0&&a.searchParams.set("_routes",u.join(",")),[a.pathname+a.search]},[i,r.unstable_trailingSlashAwareDataRequests,e,s,t]);return f.createElement(f.Fragment,null,o.map(a=>f.createElement("link",{key:a,rel:"prefetch",as:"fetch",href:a,...n})))}function Ed({page:e,matches:t,...n}){let s=Ee(),{future:r,manifest:i,routeModules:o}=Fr(),{basename:a}=Or(),{loaderData:c,matches:u}=wd(),d=f.useMemo(()=>Li(e,t,u,i,s,"data"),[e,t,u,i,s]),h=f.useMemo(()=>Li(e,t,u,i,s,"assets"),[e,t,u,i,s]),m=f.useMemo(()=>{if(e===s.pathname+s.search+s.hash)return[];let x=new Set,y=!1;if(t.forEach(k=>{var S;let v=i.routes[k.route.id];!v||!v.hasLoader||(!d.some(w=>w.route.id===k.route.id)&&k.route.id in c&&((S=o[k.route.id])!=null&&S.shouldRevalidate)||v.hasClientLoader?y=!0:x.add(k.route.id))}),x.size===0)return[];let b=Pa(e,a,r.unstable_trailingSlashAwareDataRequests,"data");return y&&x.size>0&&b.searchParams.set("_routes",t.filter(k=>x.has(k.route.id)).map(k=>k.route.id).join(",")),[b.pathname+b.search]},[a,r.unstable_trailingSlashAwareDataRequests,c,s,i,d,t,e,o]),g=f.useMemo(()=>yd(h,i),[h,i]),p=kd(h);return f.createElement(f.Fragment,null,m.map(x=>f.createElement("link",{key:x,rel:"prefetch",as:"fetch",href:x,...n})),g.map(x=>f.createElement("link",{key:x,rel:"modulepreload",href:x,...n})),p.map(({key:x,link:y})=>f.createElement("link",{key:x,nonce:n.nonce,...y,crossOrigin:y.crossOrigin??n.crossOrigin})))}function Td(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var Nd=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Nd&&(window.__reactRouterVersion="7.15.1")}catch{}function Rd({basename:e,children:t,useTransitions:n,window:s}){let r=f.useRef();r.current==null&&(r.current=ru({window:s,v5Compat:!0}));let i=r.current,[o,a]=f.useState({action:i.action,location:i.location}),c=f.useCallback(u=>{n===!1?a(u):f.startTransition(()=>a(u))},[n]);return f.useLayoutEffect(()=>i.listen(c),[i,c]),f.createElement(rd,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:i,useTransitions:n})}var $a=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Oa=f.forwardRef(function({onClick:t,discover:n="render",prefetch:s="none",relative:r,reloadDocument:i,replace:o,mask:a,state:c,target:u,to:d,preventScrollReset:h,viewTransition:m,defaultShouldRevalidate:g,...p},x){let{basename:y,navigator:b,useTransitions:k}=f.useContext(ve),v=typeof d=="string"&&$a.test(d),S=ka(d,y);d=S.to;let w=Du(d,{relative:r}),M=Ee(),T=null;if(a){let I=Ar(a,[],M.mask?M.mask.pathname:"/",!0);y!=="/"&&(I.pathname=I.pathname==="/"?y:Ce([y,I.pathname])),T=b.createHref(I)}let[C,j,E]=Sd(s,p),P=Id(d,{replace:o,mask:a,state:c,target:u,preventScrollReset:h,relative:r,viewTransition:m,defaultShouldRevalidate:g,useTransitions:k});function $(I){t&&t(I),I.defaultPrevented||P(I)}let N=!(S.isExternal||i),R=f.createElement("a",{...p,...E,href:(N?T:void 0)||S.absoluteURL||w,onClick:N?$:t,ref:Td(x,j),target:u,"data-discover":!v&&n==="render"?"true":void 0});return C&&!v?f.createElement(f.Fragment,null,R,f.createElement(Cd,{page:w})):R});Oa.displayName="Link";var Md=f.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:s="",end:r=!1,style:i,to:o,viewTransition:a,children:c,...u},d){let h=ln(o,{relative:u.relative}),m=Ee(),g=f.useContext(os),{navigator:p,basename:x}=f.useContext(ve),y=g!=null&&Fd(h)&&a===!0,b=p.encodeLocation?p.encodeLocation(h).pathname:h.pathname,k=m.pathname,v=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;n||(k=k.toLowerCase(),v=v?v.toLowerCase():null,b=b.toLowerCase()),v&&x&&(v=Be(v,x)||v);const S=b!=="/"&&b.endsWith("/")?b.length-1:b.length;let w=k===b||!r&&k.startsWith(b)&&k.charAt(S)==="/",M=v!=null&&(v===b||!r&&v.startsWith(b)&&v.charAt(b.length)==="/"),T={isActive:w,isPending:M,isTransitioning:y},C=w?t:void 0,j;typeof s=="function"?j=s(T):j=[s,w?"active":null,M?"pending":null,y?"transitioning":null].filter(Boolean).join(" ");let E=typeof i=="function"?i(T):i;return f.createElement(Oa,{...u,"aria-current":C,className:j,ref:d,style:E,to:o,viewTransition:a},typeof c=="function"?c(T):c)});Md.displayName="NavLink";var Ad=f.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:s,replace:r,state:i,method:o=En,action:a,onSubmit:c,relative:u,preventScrollReset:d,viewTransition:h,defaultShouldRevalidate:m,...g},p)=>{let{useTransitions:x}=f.useContext(ve),y=Od(),b=_d(a,{relative:u}),k=o.toLowerCase()==="get"?"get":"post",v=typeof a=="string"&&$a.test(a),S=w=>{if(c&&c(w),w.defaultPrevented)return;w.preventDefault();let M=w.nativeEvent.submitter,T=(M==null?void 0:M.getAttribute("formmethod"))||o,C=()=>y(M||w.currentTarget,{fetcherKey:t,method:T,navigate:n,replace:r,state:i,relative:u,preventScrollReset:d,viewTransition:h,defaultShouldRevalidate:m});x&&n!==!1?f.startTransition(()=>C()):C()};return f.createElement("form",{ref:p,method:k,action:b,onSubmit:s?c:S,...g,"data-discover":!v&&e==="render"?"true":void 0})});Ad.displayName="Form";function Ld(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function _a(e){let t=f.useContext(Et);return oe(t,Ld(e)),t}function Id(e,{target:t,replace:n,mask:s,state:r,preventScrollReset:i,relative:o,viewTransition:a,defaultShouldRevalidate:c,useTransitions:u}={}){let d=an(),h=Ee(),m=ln(e,{relative:o});return f.useCallback(g=>{if(ud(g,t)){g.preventDefault();let p=n!==void 0?n:Ut(h)===Ut(m),x=()=>d(e,{replace:p,mask:s,state:r,preventScrollReset:i,relative:o,viewTransition:a,defaultShouldRevalidate:c});u?f.startTransition(()=>x()):x()}},[h,d,m,n,s,r,t,e,i,o,a,c,u])}var Pd=0,$d=()=>`__${String(++Pd)}__`;function Od(){let{router:e}=_a("useSubmit"),{basename:t}=f.useContext(ve),n=Qu(),s=e.fetch,r=e.navigate;return f.useCallback(async(i,o={})=>{let{action:a,method:c,encType:u,formData:d,body:h}=hd(i,t);if(o.navigate===!1){let m=o.fetcherKey||$d();await s(m,n,o.action||a,{defaultShouldRevalidate:o.defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,formData:d,body:h,formMethod:o.method||c,formEncType:o.encType||u,flushSync:o.flushSync})}else await r(o.action||a,{defaultShouldRevalidate:o.defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,formData:d,body:h,formMethod:o.method||c,formEncType:o.encType||u,replace:o.replace,state:o.state,fromRouteId:n,flushSync:o.flushSync,viewTransition:o.viewTransition})},[s,r,t,n])}function _d(e,{relative:t}={}){let{basename:n}=f.useContext(ve),s=f.useContext(je);oe(s,"useFormAction must be used inside a RouteContext");let[r]=s.matches.slice(-1),i={...ln(e||".",{relative:t})},o=Ee();if(e==null){i.search=o.search;let a=new URLSearchParams(i.search),c=a.getAll("index");if(c.some(d=>d==="")){a.delete("index"),c.filter(h=>h).forEach(h=>a.append("index",h));let d=a.toString();i.search=d?`?${d}`:""}}return(!e||e===".")&&r.route.index&&(i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(i.pathname=i.pathname==="/"?n:Ce([n,i.pathname])),Ut(i)}function Fd(e,{relative:t}={}){let n=f.useContext(Ta);oe(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:s}=_a("useViewTransitionState"),r=ln(e,{relative:t});if(!n.isTransitioning)return!1;let i=Be(n.currentLocation.pathname,s)||n.currentLocation.pathname,o=Be(n.nextLocation.pathname,s)||n.nextLocation.pathname;return Bn(r.pathname,o)!=null||Bn(r.pathname,i)!=null}/**
|
|
14
|
+
* @license lucide-react v1.16.0 - ISC
|
|
15
|
+
*
|
|
16
|
+
* This source code is licensed under the ISC license.
|
|
17
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
18
|
+
*/const Fa=(...e)=>e.filter((t,n,s)=>!!t&&t.trim()!==""&&s.indexOf(t)===n).join(" ").trim();/**
|
|
19
|
+
* @license lucide-react v1.16.0 - ISC
|
|
20
|
+
*
|
|
21
|
+
* This source code is licensed under the ISC license.
|
|
22
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
23
|
+
*/const Dd=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
|
|
24
|
+
* @license lucide-react v1.16.0 - ISC
|
|
25
|
+
*
|
|
26
|
+
* This source code is licensed under the ISC license.
|
|
27
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
28
|
+
*/const Vd=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,s)=>s?s.toUpperCase():n.toLowerCase());/**
|
|
29
|
+
* @license lucide-react v1.16.0 - ISC
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the ISC license.
|
|
32
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/const Ii=e=>{const t=Vd(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
|
|
34
|
+
* @license lucide-react v1.16.0 - ISC
|
|
35
|
+
*
|
|
36
|
+
* This source code is licensed under the ISC license.
|
|
37
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
38
|
+
*/var ks={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
39
|
+
* @license lucide-react v1.16.0 - ISC
|
|
40
|
+
*
|
|
41
|
+
* This source code is licensed under the ISC license.
|
|
42
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
43
|
+
*/const Bd=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},zd=f.createContext({}),Hd=()=>f.useContext(zd),Ud=f.forwardRef(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:s,className:r="",children:i,iconNode:o,...a},c)=>{const{size:u=24,strokeWidth:d=2,absoluteStrokeWidth:h=!1,color:m="currentColor",className:g=""}=Hd()??{},p=s??h?Number(n??d)*24/Number(t??u):n??d;return f.createElement("svg",{ref:c,...ks,width:t??u??ks.width,height:t??u??ks.height,stroke:e??m,strokeWidth:p,className:Fa("lucide",g,r),...!i&&!Bd(a)&&{"aria-hidden":"true"},...a},[...o.map(([x,y])=>f.createElement(x,y)),...Array.isArray(i)?i:[i]])});/**
|
|
44
|
+
* @license lucide-react v1.16.0 - ISC
|
|
45
|
+
*
|
|
46
|
+
* This source code is licensed under the ISC license.
|
|
47
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
48
|
+
*/const J=(e,t)=>{const n=f.forwardRef(({className:s,...r},i)=>f.createElement(Ud,{ref:i,iconNode:t,className:Fa(`lucide-${Dd(Ii(e))}`,`lucide-${e}`,s),...r}));return n.displayName=Ii(e),n};/**
|
|
49
|
+
* @license lucide-react v1.16.0 - ISC
|
|
50
|
+
*
|
|
51
|
+
* This source code is licensed under the ISC license.
|
|
52
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
53
|
+
*/const Kd=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Wd=J("arrow-left",Kd);/**
|
|
54
|
+
* @license lucide-react v1.16.0 - ISC
|
|
55
|
+
*
|
|
56
|
+
* This source code is licensed under the ISC license.
|
|
57
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
58
|
+
*/const qd=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],Gd=J("arrow-up",qd);/**
|
|
59
|
+
* @license lucide-react v1.16.0 - ISC
|
|
60
|
+
*
|
|
61
|
+
* This source code is licensed under the ISC license.
|
|
62
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
63
|
+
*/const Yd=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],ls=J("brain",Yd);/**
|
|
64
|
+
* @license lucide-react v1.16.0 - ISC
|
|
65
|
+
*
|
|
66
|
+
* This source code is licensed under the ISC license.
|
|
67
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
68
|
+
*/const Jd=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Tt=J("check",Jd);/**
|
|
69
|
+
* @license lucide-react v1.16.0 - ISC
|
|
70
|
+
*
|
|
71
|
+
* This source code is licensed under the ISC license.
|
|
72
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
73
|
+
*/const Xd=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Da=J("chevron-down",Xd);/**
|
|
74
|
+
* @license lucide-react v1.16.0 - ISC
|
|
75
|
+
*
|
|
76
|
+
* This source code is licensed under the ISC license.
|
|
77
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
78
|
+
*/const Zd=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Qd=J("chevron-left",Zd);/**
|
|
79
|
+
* @license lucide-react v1.16.0 - ISC
|
|
80
|
+
*
|
|
81
|
+
* This source code is licensed under the ISC license.
|
|
82
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
83
|
+
*/const ef=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Je=J("chevron-right",ef);/**
|
|
84
|
+
* @license lucide-react v1.16.0 - ISC
|
|
85
|
+
*
|
|
86
|
+
* This source code is licensed under the ISC license.
|
|
87
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
88
|
+
*/const tf=[["path",{d:"m7 6 5 5 5-5",key:"1lc07p"}],["path",{d:"m7 13 5 5 5-5",key:"1d48rs"}]],nf=J("chevrons-down",tf);/**
|
|
89
|
+
* @license lucide-react v1.16.0 - ISC
|
|
90
|
+
*
|
|
91
|
+
* This source code is licensed under the ISC license.
|
|
92
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
93
|
+
*/const sf=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Hn=J("circle-alert",sf);/**
|
|
94
|
+
* @license lucide-react v1.16.0 - ISC
|
|
95
|
+
*
|
|
96
|
+
* This source code is licensed under the ISC license.
|
|
97
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
98
|
+
*/const rf=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],of=J("circle-check-big",rf);/**
|
|
99
|
+
* @license lucide-react v1.16.0 - ISC
|
|
100
|
+
*
|
|
101
|
+
* This source code is licensed under the ISC license.
|
|
102
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
103
|
+
*/const af=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],lf=J("circle-check",af);/**
|
|
104
|
+
* @license lucide-react v1.16.0 - ISC
|
|
105
|
+
*
|
|
106
|
+
* This source code is licensed under the ISC license.
|
|
107
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
108
|
+
*/const cf=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],uf=J("circle-question-mark",cf);/**
|
|
109
|
+
* @license lucide-react v1.16.0 - ISC
|
|
110
|
+
*
|
|
111
|
+
* This source code is licensed under the ISC license.
|
|
112
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
113
|
+
*/const df=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]],ff=J("circle-stop",df);/**
|
|
114
|
+
* @license lucide-react v1.16.0 - ISC
|
|
115
|
+
*
|
|
116
|
+
* This source code is licensed under the ISC license.
|
|
117
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
118
|
+
*/const hf=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],pf=J("circle-x",hf);/**
|
|
119
|
+
* @license lucide-react v1.16.0 - ISC
|
|
120
|
+
*
|
|
121
|
+
* This source code is licensed under the ISC license.
|
|
122
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
123
|
+
*/const mf=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Dr=J("copy",mf);/**
|
|
124
|
+
* @license lucide-react v1.16.0 - ISC
|
|
125
|
+
*
|
|
126
|
+
* This source code is licensed under the ISC license.
|
|
127
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
128
|
+
*/const gf=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],Js=J("cpu",gf);/**
|
|
129
|
+
* @license lucide-react v1.16.0 - ISC
|
|
130
|
+
*
|
|
131
|
+
* This source code is licensed under the ISC license.
|
|
132
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
133
|
+
*/const yf=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],Xs=J("ellipsis",yf);/**
|
|
134
|
+
* @license lucide-react v1.16.0 - ISC
|
|
135
|
+
*
|
|
136
|
+
* This source code is licensed under the ISC license.
|
|
137
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
138
|
+
*/const xf=[["path",{d:"m15 15 6 6",key:"1s409w"}],["path",{d:"m15 9 6-6",key:"ko1vev"}],["path",{d:"M21 16v5h-5",key:"1ck2sf"}],["path",{d:"M21 8V3h-5",key:"1qoq8a"}],["path",{d:"M3 16v5h5",key:"1t08am"}],["path",{d:"m3 21 6-6",key:"wwnumi"}],["path",{d:"M3 8V3h5",key:"1ln10m"}],["path",{d:"M9 9 3 3",key:"v551iv"}]],bf=J("expand",xf);/**
|
|
139
|
+
* @license lucide-react v1.16.0 - ISC
|
|
140
|
+
*
|
|
141
|
+
* This source code is licensed under the ISC license.
|
|
142
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
143
|
+
*/const vf=[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],wf=J("folder-plus",vf);/**
|
|
144
|
+
* @license lucide-react v1.16.0 - ISC
|
|
145
|
+
*
|
|
146
|
+
* This source code is licensed under the ISC license.
|
|
147
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
148
|
+
*/const Sf=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],Va=J("folder",Sf);/**
|
|
149
|
+
* @license lucide-react v1.16.0 - ISC
|
|
150
|
+
*
|
|
151
|
+
* This source code is licensed under the ISC license.
|
|
152
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
153
|
+
*/const Cf=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],kf=J("gauge",Cf);/**
|
|
154
|
+
* @license lucide-react v1.16.0 - ISC
|
|
155
|
+
*
|
|
156
|
+
* This source code is licensed under the ISC license.
|
|
157
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
158
|
+
*/const jf=[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]],Ba=J("git-branch",jf);/**
|
|
159
|
+
* @license lucide-react v1.16.0 - ISC
|
|
160
|
+
*
|
|
161
|
+
* This source code is licensed under the ISC license.
|
|
162
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
163
|
+
*/const Ef=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],Tf=J("history",Ef);/**
|
|
164
|
+
* @license lucide-react v1.16.0 - ISC
|
|
165
|
+
*
|
|
166
|
+
* This source code is licensed under the ISC license.
|
|
167
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
168
|
+
*/const Nf=[["path",{d:"M16 5h6",key:"1vod17"}],["path",{d:"M19 2v6",key:"4bpg5p"}],["path",{d:"M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5",key:"1ue2ih"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}]],Pi=J("image-plus",Nf);/**
|
|
169
|
+
* @license lucide-react v1.16.0 - ISC
|
|
170
|
+
*
|
|
171
|
+
* This source code is licensed under the ISC license.
|
|
172
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
173
|
+
*/const Rf=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],za=J("info",Rf);/**
|
|
174
|
+
* @license lucide-react v1.16.0 - ISC
|
|
175
|
+
*
|
|
176
|
+
* This source code is licensed under the ISC license.
|
|
177
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
178
|
+
*/const Mf=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],Af=J("layers",Mf);/**
|
|
179
|
+
* @license lucide-react v1.16.0 - ISC
|
|
180
|
+
*
|
|
181
|
+
* This source code is licensed under the ISC license.
|
|
182
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
183
|
+
*/const Lf=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Le=J("loader-circle",Lf);/**
|
|
184
|
+
* @license lucide-react v1.16.0 - ISC
|
|
185
|
+
*
|
|
186
|
+
* This source code is licensed under the ISC license.
|
|
187
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
188
|
+
*/const If=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],Pf=J("log-out",If);/**
|
|
189
|
+
* @license lucide-react v1.16.0 - ISC
|
|
190
|
+
*
|
|
191
|
+
* This source code is licensed under the ISC license.
|
|
192
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
193
|
+
*/const $f=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],$i=J("minimize-2",$f);/**
|
|
194
|
+
* @license lucide-react v1.16.0 - ISC
|
|
195
|
+
*
|
|
196
|
+
* This source code is licensed under the ISC license.
|
|
197
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
198
|
+
*/const Of=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Ha=J("plus",Of);/**
|
|
199
|
+
* @license lucide-react v1.16.0 - ISC
|
|
200
|
+
*
|
|
201
|
+
* This source code is licensed under the ISC license.
|
|
202
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
203
|
+
*/const _f=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],Ff=J("server",_f);/**
|
|
204
|
+
* @license lucide-react v1.16.0 - ISC
|
|
205
|
+
*
|
|
206
|
+
* This source code is licensed under the ISC license.
|
|
207
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
208
|
+
*/const Df=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Vf=J("settings",Df);/**
|
|
209
|
+
* @license lucide-react v1.16.0 - ISC
|
|
210
|
+
*
|
|
211
|
+
* This source code is licensed under the ISC license.
|
|
212
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
213
|
+
*/const Bf=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],zf=J("square",Bf);/**
|
|
214
|
+
* @license lucide-react v1.16.0 - ISC
|
|
215
|
+
*
|
|
216
|
+
* This source code is licensed under the ISC license.
|
|
217
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
218
|
+
*/const Hf=[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]],Uf=J("timer",Hf);/**
|
|
219
|
+
* @license lucide-react v1.16.0 - ISC
|
|
220
|
+
*
|
|
221
|
+
* This source code is licensed under the ISC license.
|
|
222
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
223
|
+
*/const Kf=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Wf=J("triangle-alert",Kf);/**
|
|
224
|
+
* @license lucide-react v1.16.0 - ISC
|
|
225
|
+
*
|
|
226
|
+
* This source code is licensed under the ISC license.
|
|
227
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
228
|
+
*/const qf=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Vr=J("x",qf);/**
|
|
229
|
+
* @license lucide-react v1.16.0 - ISC
|
|
230
|
+
*
|
|
231
|
+
* This source code is licensed under the ISC license.
|
|
232
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
233
|
+
*/const Gf=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]],Yf=J("zoom-out",Gf);/**
|
|
234
|
+
* @license lucide-react v1.16.0 - ISC
|
|
235
|
+
*
|
|
236
|
+
* This source code is licensed under the ISC license.
|
|
237
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
238
|
+
*/const Jf=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]],Xf=J("zoom-in",Jf);function Re({children:e,detail:t,tone:n="neutral",compact:s=!1,className:r=""}){const i=n==="loading"?Le:n==="error"?Hn:za;return l.jsxs("div",{role:n==="error"?"alert":"status",className:`ui-status ${n==="error"?"select-text":"select-none"} ${s?"ui-status--compact":""} ${r}`,"data-tone":n,children:[l.jsx(i,{size:s?16:20,className:`shrink-0 ${n==="loading"?"animate-spin":""}`,"aria-hidden":"true"}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("div",{children:e}),t&&l.jsx("div",{className:"ui-status-detail",children:t})]})]})}const Ua=f.createContext({});function Nt(e){const t=f.useRef(null);return t.current===null&&(t.current=e()),t.current}const Zf=typeof window<"u",Kt=Zf?f.useLayoutEffect:f.useEffect,cn=f.createContext(null);function Qf(e,t){e.indexOf(t)===-1&&e.push(t)}function eh(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const Qe=(e,t,n)=>n>t?t:n<e?e:n;let cs=()=>{};const Ie={},Br=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),th=e=>typeof e=="object"&&e!==null,zr=e=>/^0[^.\s]+$/u.test(e);function Ka(e){let t;return()=>(t===void 0&&(t=e()),t)}const un=e=>e,us=(...e)=>e.reduce((t,n)=>s=>n(t(s))),Un=(e,t,n)=>{const s=t-e;return s?(n-e)/s:1};class Zs{constructor(){this.subscriptions=[]}add(t){return Qf(this.subscriptions,t),()=>this.remove(t)}remove(t){eh(this.subscriptions,t)}notify(t,n,s){const r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](t,n,s);else for(let i=0;i<r;i++){const o=this.subscriptions[i];o&&o(t,n,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Me=e=>e*1e3,be=e=>e/1e3,Wa=(e,t)=>t?e*(1e3/t):0,js=(e,t,n)=>e*(3*(1-e)*((1-e)*t+e*n)+e*e);function dn(e,t,n,s){return e===t&&n===s?un:r=>{let i=0,o=1,a=r;for(let c=0;;c++){a>=i&&a<=o||(a=(i+o)/2);const u=js(a,e,n)-r;if(u*u<1e-28||c===40)break;u>0?o=a:i=a,a-=u*1e-7/(js(a+1e-7,e,n)-r-u)}return js(a,t,s)}}const qa=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Ga=e=>t=>1-e(1-t),Ya=dn(.33,1.53,.69,.99),Hr=Ga(Ya),Ja=qa(Hr),Xa=e=>e>=1?1:(e*=2)<1?.5*Hr(e):.5*(2-Math.pow(2,-10*(e-1))),Ur=e=>1-Math.sin(Math.acos(e)),nh=Ga(Ur),Za=qa(Ur),sh=dn(.42,0,1,1),rh=dn(0,0,.58,1),Kr=dn(.42,0,.58,1),ih=e=>Array.isArray(e)&&typeof e[0]!="number",Wr=e=>Array.isArray(e)&&typeof e[0]=="number",oh={linear:un,easeIn:sh,easeInOut:Kr,easeOut:rh,circIn:Ur,circInOut:Za,circOut:nh,backIn:Hr,backInOut:Ja,backOut:Ya,anticipate:Xa},ah=e=>typeof e=="string",Oi=e=>{if(Wr(e)){cs(e.length===4);const[t,n,s,r]=e;return dn(t,n,s,r)}else if(ah(e))return oh[e];return e},Xe={delta:0,timestamp:0,isProcessing:!1};let Nn;function lh(){Nn=void 0}const le={now:()=>(Nn===void 0&&le.set(Xe.isProcessing||Ie.useManualTiming?Xe.timestamp:performance.now()),Nn),set:e=>{Nn=e,queueMicrotask(lh)}},yt=e=>Math.round(e*1e5)/1e5,Qa=e=>t=>typeof t=="string"&&t.startsWith(e),el=Qa("--"),ch=Qa("var(--"),qr=e=>ch(e)?uh.test(e.split("/*")[0].trim()):!1,uh=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Es(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const Rt={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Wt={...Rt,transform:e=>Qe(0,1,e)},wn={...Rt,default:1},Gr=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function dh(e){return e==null}const fh=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Yr=(e,t)=>n=>!!(typeof n=="string"&&fh.test(n)&&n.startsWith(e)||t&&!dh(n)&&Object.prototype.hasOwnProperty.call(n,t)),tl=(e,t,n)=>s=>{if(typeof s!="string")return s;const[r,i,o,a]=s.match(Gr);return{[e]:parseFloat(r),[t]:parseFloat(i),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},hh=e=>Qe(0,255,e),Ts={...Rt,transform:e=>Math.round(hh(e))},tt={test:Yr("rgb","red"),parse:tl("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:s=1})=>"rgba("+Ts.transform(e)+", "+Ts.transform(t)+", "+Ts.transform(n)+", "+yt(Wt.transform(s))+")"};function ph(e){let t="",n="",s="",r="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),s=e.substring(5,7),r=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),s=e.substring(3,4),r=e.substring(4,5),t+=t,n+=n,s+=s,r+=r),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:r?parseInt(r,16)/255:1}}const Qs={test:Yr("#"),parse:ph,transform:tt.transform},fn=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Fe=fn("deg"),xt=fn("%"),H=fn("px"),mh=fn("vh"),gh=fn("vw"),_i={...xt,parse:e=>xt.parse(e)/100,transform:e=>xt.transform(e*100)},ft={test:Yr("hsl","hue"),parse:tl("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:s=1})=>"hsla("+Math.round(e)+", "+xt.transform(yt(t))+", "+xt.transform(yt(n))+", "+yt(Wt.transform(s))+")"},ue={test:e=>tt.test(e)||Qs.test(e)||ft.test(e),parse:e=>tt.test(e)?tt.parse(e):ft.test(e)?ft.parse(e):Qs.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?tt.transform(e):ft.transform(e),getAnimatableNone:e=>{const t=ue.parse(e);return t.alpha=0,ue.transform(t)}},yh=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,nl=new RegExp(Gr.source),sl=new RegExp(yh.source,"i");function xh(e){return isNaN(e)&&typeof e=="string"&&(nl.test(e)||sl.test(e))}const rl="number",il="color",bh="var",vh="var(",Fi="${}",wh=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)(?![a-z]*\()/giu;function Sh(e){const t=e.toString();return nl.test(t)||sl.test(t)}function qt(e){const t=e.toString(),n=[],s={color:[],number:[],var:[]},r=[];let i=0;const a=t.replace(wh,c=>(ue.test(c)?(s.color.push(i),r.push(il),n.push(ue.parse(c))):c.startsWith(vh)?(s.var.push(i),r.push(bh),n.push(c)):(s.number.push(i),r.push(rl),n.push(parseFloat(c))),++i,Fi)).split(Fi);return{values:n,split:a,indexes:s,types:r}}function Ch(e){return qt(e).values}function ol({split:e,types:t}){const n=e.length;return s=>{let r="";for(let i=0;i<n;i++)if(r+=e[i],s[i]!==void 0){const o=t[i];o===rl?r+=yt(s[i]):o===il?r+=ue.transform(s[i]):r+=s[i]}return r}}function kh(e){return ol(qt(e))}const jh=e=>typeof e=="number"?0:ue.test(e)?ue.getAnimatableNone(e):e,Eh=(e,t)=>typeof e=="number"?t!=null&&t.trim().endsWith("/")?e:0:jh(e);function Th(e){const t=qt(e);return ol(t)(t.values.map((s,r)=>Eh(s,t.split[r])))}const ke={test:xh,parse:Ch,createTransformer:kh,getAnimatableNone:Th};function Ns(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Nh({hue:e,saturation:t,lightness:n,alpha:s}){e/=360,t/=100,n/=100;let r=0,i=0,o=0;if(!t)r=i=o=n;else{const a=n<.5?n*(1+t):n+t-n*t,c=2*n-a;r=Ns(c,a,e+1/3),i=Ns(c,a,e),o=Ns(c,a,e-1/3)}return{red:Math.round(r*255),green:Math.round(i*255),blue:Math.round(o*255),alpha:s}}function Kn(e,t){return n=>n>0?t:e}const dt=(e,t,n)=>e+(t-e)*n,Rs=(e,t,n)=>{const s=e*e,r=n*(t*t-s)+s;return r<0?0:Math.sqrt(r)},Rh=[Qs,tt,ft],Mh=e=>Rh.find(t=>t.test(e));function Di(e){const t=Mh(e);if(!t)return!1;let n=t.parse(e);return t===ft&&(n=Nh(n)),n}const Vi=(e,t)=>{const n=Di(e),s=Di(t);if(!n||!s)return Kn(e,t);const r={...n};return i=>(r.red=Rs(n.red,s.red,i),r.green=Rs(n.green,s.green,i),r.blue=Rs(n.blue,s.blue,i),r.alpha=dt(n.alpha,s.alpha,i),tt.transform(r))},er=new Set(["none","hidden"]);function Ah(e,t){return er.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function Lh(e,t){return n=>dt(e,t,n)}function Jr(e){return typeof e=="number"?Lh:typeof e=="string"?qr(e)?Kn:ue.test(e)?Vi:$h:Array.isArray(e)?al:typeof e=="object"?ue.test(e)?Vi:Ih:Kn}function al(e,t){const n=[...e],s=n.length,r=e.map((i,o)=>Jr(i)(i,t[o]));return i=>{for(let o=0;o<s;o++)n[o]=r[o](i);return n}}function Ih(e,t){const n={...e,...t},s={};for(const r in n)e[r]!==void 0&&t[r]!==void 0&&(s[r]=Jr(e[r])(e[r],t[r]));return r=>{for(const i in s)n[i]=s[i](r);return n}}function Ph(e,t){const n=[],s={color:0,var:0,number:0};for(let r=0;r<t.values.length;r++){const i=t.types[r],o=e.indexes[i][s[i]],a=e.values[o]??0;n[r]=a,s[i]++}return n}const $h=(e,t)=>{const n=ke.createTransformer(t),s=qt(e),r=qt(t);return s.indexes.var.length===r.indexes.var.length&&s.indexes.color.length===r.indexes.color.length&&s.indexes.number.length>=r.indexes.number.length?er.has(e)&&!r.values.length||er.has(t)&&!s.values.length?Ah(e,t):us(al(Ph(s,r),r.values),n):Kn(e,t)},Bi=/^(-?(?:\d+(?:\.\d*)?|\.\d+))([a-z%]*)$/iu;function Oh(e,t){const n=Bi.exec(e);if(!n)return;const s=Bi.exec(t);if(!s||n[2]!==s[2])return;const r=n[2],i=parseFloat(n[1]),o=parseFloat(s[1]);return a=>yt(dt(i,o,a))+r}function Xr(e,t,n){if(typeof e=="number"&&typeof t=="number"&&typeof n=="number")return dt(e,t,n);if(typeof e=="string"&&typeof t=="string"){const r=Oh(e,t);if(r)return r}return Jr(e)(e,t)}const Sn=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function _h(e){let t=new Set,n=new Set,s=!1,r=!1;const i=new Set;let o={delta:0,timestamp:0,isProcessing:!1};function a(u){i.has(u)&&(n.add(u),e()),u(o)}const c={schedule:(u,d=!1,h=!1)=>{const g=h&&s?t:n;return d&&i.add(u),g.add(u),u},cancel:u=>{n.delete(u),i.delete(u)},process:u=>{if(o=u,s){r=!0;return}s=!0;const d=t;t=n,n=d,t.forEach(a),t.clear(),s=!1,r&&(r=!1,c.process(u))}};return c}const Fh=40;function ll(e,t,n={delta:0,timestamp:0,isProcessing:!1}){let s=!1,r=!0;const i=()=>s=!0,o=Sn.reduce((v,S)=>(v[S]=_h(i),v),{}),{setup:a,read:c,resolveKeyframes:u,preUpdate:d,update:h,preRender:m,render:g,postRender:p}=o,x=()=>{const v=Ie.useManualTiming,S=v?n.timestamp:performance.now();s=!1,v||(n.delta=r?1e3/60:Math.max(Math.min(S-n.timestamp,Fh),1)),n.timestamp=S,n.isProcessing=!0,a.process(n),c.process(n),u.process(n),d.process(n),h.process(n),m.process(n),g.process(n),p.process(n),n.isProcessing=!1,s&&t&&(r=!1,e(x))},y=()=>{s=!0,r=!0,n.isProcessing||e(x)};return{schedule:Sn.reduce((v,S)=>{const w=o[S];return v[S]=(M,T=!1,C=!1)=>(s||y(),w.schedule(M,T,C)),v},{}),cancel:v=>{for(let S=0;S<Sn.length;S++)o[Sn[S]].cancel(v)},state:n,steps:o}}const{schedule:xe,cancel:tr,steps:db}=ll(typeof requestAnimationFrame<"u"?requestAnimationFrame:un,!0,Xe),cl=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>xe.update(t,n),stop:()=>tr(t),now:()=>Xe.isProcessing?Xe.timestamp:le.now()}},ul=(e,t,n=10)=>{let s="";const r=Math.max(Math.round(t/n),2);for(let i=0;i<r;i++)s+=Math.round(e(i/(r-1))*1e4)/1e4+", ";return`linear(${s.substring(0,s.length-2)})`},Zr=2e4;function Qr(e,t=50,n=Zr,s){let r=0,i=e.next(r);for(;!i.done&&r<n;)r+=t,i=e.next(r);return r>=n?1/0:r}function Dh(e,t=100,n){const{keyframes:s,velocity:r}=e,i=s&&s[s.length-1]-s[0],o=n({...e,velocity:r&&i?r*t/i:r,keyframes:[0,t]}),a=Math.min(Qr(o),Zr);return{type:"keyframes",ease:c=>o.next(a*c).value/t,duration:be(a)}}const fe={stiffness:100,damping:10,mass:1,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05},dl=e=>e<0?1/Math.max(1+e,fe.minDamping):Math.max(1-e,fe.minDamping);function fl(e,t){if(!(e>1))return 1;const n=Math.sqrt(e*e-1),s=e-n,r=e+n,i=2*n*Math.exp(-t)*(1+t);return hl(o=>r*Math.exp(-s*o)-s*Math.exp(-r*o)-i,o=>Math.exp(-r*o)-Math.exp(-s*o),t)/t}function nr(e,t){return e*Math.sqrt(1-t*t)}const Vh=12;function hl(e,t,n){let s=n;for(let r=1;r<Vh;r++)s=s-e(s)/t(s);return s}const Ms=.001;function Bh({duration:e=fe.duration,bounce:t=fe.bounce}){let n,s;const r=dl(t);e=Qe(fe.minDuration,fe.maxDuration,be(e)),r<1?(n=u=>{const d=u*r,h=d*e,m=nr(u,r),g=Math.exp(-h);return Ms-d/m*g},s=u=>{const h=u*r*e,m=r*r*u*u*e,g=Math.exp(-h),p=nr(u*u,r);return(-n(u)+Ms>0?-1:1)*-m*g/p}):(n=u=>{const d=Math.exp(-u*e),h=u*e+1;return-Ms+d*h},s=u=>{const d=Math.exp(-u*e),h=-u*(e*e);return d*h});const i=5/e,o=hl(n,s,i),a=o*fl(r,o*e),c=a*a;return{stiffness:c,damping:r*2*Math.sqrt(c),duration:Me(e)}}const sr=(e,t)=>(t?e>=0:e>0)&&e<1/0;function As(e,t){if(sr(e,t))return e}function zh(e){const t=As(e.stiffness),n=As(e.damping,!0),s=As(e.mass),r={...e,stiffness:t??fe.stiffness,damping:n??fe.damping,mass:s??fe.mass,isResolvedFromDuration:!1,isTimeDefined:(t??n??s)===void 0&&(e.duration!==void 0||e.bounce!==void 0)};if(r.isTimeDefined){if(e.visualDuration){const i=dl(e.bounce||0),o=2*Math.PI/(e.visualDuration*1.2)*fl(i,2*Math.PI/1.2);r.stiffness=o*o,r.damping=2*i*Math.sqrt(r.stiffness)}else Object.assign(r,Bh(r)),r.isResolvedFromDuration=!0;(!sr(r.stiffness)||!sr(r.damping,!0))&&(r.stiffness=fe.stiffness,r.damping=fe.damping)}return r}function Wn(e=fe.visualDuration,t=fe.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e,s=n.keyframes[0],r=n.keyframes[n.keyframes.length-1],i={done:!1,value:s},{stiffness:o,damping:a,mass:c,duration:u,isResolvedFromDuration:d,isTimeDefined:h}=zh({...n}),m=T=>h?0:-be(T),g=a/(2*Math.sqrt(o*c)),p=be(Math.sqrt(o/c)),x=g*p,y={target:r,delta:r-s,velocity:m(n.velocity||0)||0,restSpeed:0,restDelta:0},b=()=>{const T=Math.abs(y.delta)<5;y.restSpeed=n.restSpeed||(T?fe.restSpeed.granular:fe.restSpeed.default),y.restDelta=n.restDelta||(T?fe.restDelta.granular:fe.restDelta.default)};b();let k,v,S;if(g<1){const T=nr(p,g),C={A:0,sinC:0,cosC:0,t:-1,env:0,sin:0,cos:0};S=()=>{C.A=(y.velocity+x*y.delta)/T,C.sinC=x*C.A+y.delta*T,C.cosC=x*y.delta-C.A*T};const j=E=>{E!==C.t&&(C.t=E,C.env=Math.exp(-x*E),C.sin=Math.sin(T*E),C.cos=Math.cos(T*E))};k=E=>(j(E),y.target-C.env*(C.A*C.sin+y.delta*C.cos)),v=E=>(j(E),C.env*(C.sinC*C.sin+C.cosC*C.cos))}else if(g===1){k=C=>y.target-Math.exp(-p*C)*(y.delta+(y.velocity+p*y.delta)*C);const T={C:0};S=()=>{T.C=y.velocity+p*y.delta},v=C=>Math.exp(-p*C)*(p*T.C*C-y.velocity)}else{const T=p*Math.sqrt(g*g-1),C=x-T,j=x+T,E=h?1/0:300/T,P=(N,R)=>Math.exp(R>E?-N*E-x*(R-E):-N*R),$={S:0,F:0};S=()=>{const N=(y.velocity+x*y.delta)/T;$.S=(y.delta+N)/2,$.F=(y.delta-N)/2},k=N=>y.target-$.S*P(C,N)-$.F*P(j,N),v=N=>C*$.S*P(C,N)+j*$.F*P(j,N)}S();const w=d&&u||null,M={calculatedDuration:w,retarget:(T,C)=>{y.target=T[T.length-1],y.delta=y.target-T[0],y.velocity=m(C),n.restSpeed&&n.restDelta||b(),M.calculatedDuration=w,i.done=!1,S()},velocity:T=>Me(v(T)),next:T=>{const C=k(T);if(d)i.done=T>=u;else{const j=Me(v(T));i.done=Math.abs(j)<=y.restSpeed&&Math.abs(y.target-C)<=y.restDelta}return i.value=i.done?y.target:C,i},toString:()=>{const T=Math.min(Qr(M),Zr),C=ul(j=>M.next(T*j).value,T,30);return T+"ms "+C},toTransition:()=>{}};return M}Wn.applyToOptions=e=>{const t=Dh(e,100,Wn);return e.ease=t.ease,e.duration=Me(t.duration),e.type="keyframes",e};function qn({keyframes:e,velocity:t=0,power:n=.8,timeConstant:s=325,bounceDamping:r=10,bounceStiffness:i=500,modifyTarget:o,min:a,max:c,restDelta:u=.5,restSpeed:d}){const h=e[0],m={done:!1,value:h},g=T=>T<a||T>c,p=T=>a===void 0?c:c===void 0||Math.abs(a-T)<Math.abs(c-T)?a:c;let x=n*t;const y=h+x,b=o===void 0?y:o(y);b!==y&&(x=b-h);const k=T=>-x*Math.exp(-T/s),v=T=>{const C=k(T);m.done=Math.abs(C)<=u,m.value=m.done?b:b+C};let S,w;const M=T=>{g(m.value)&&(S=T,w=Wn({keyframes:[m.value,p(m.value)],velocity:-k(T)/s*1e3,damping:r,stiffness:i,restDelta:u,restSpeed:d}))};return M(0),{calculatedDuration:null,next:T=>{let C=!1;return!w&&S===void 0&&(C=!0,v(T),M(T)),S!==void 0&&T>=S?w.next(T-S):(!C&&v(T),m)}}}function Hh(e,t,n){const s=[],r=n||Ie.mix||Xr,i=e.length-1;for(let o=0;o<i;o++){let a=r(e[o],e[o+1]);if(t){const c=Array.isArray(t)?t[o]||un:t;a=us(c,a)}s.push(a)}return s}function Uh(e,t,{clamp:n=!0,ease:s,mixer:r}={}){const i=e.length;if(cs(i===t.length),i===1)return()=>t[0];if(i===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=Hh(t,s,r),c=a.length,u=d=>{if(o&&d<e[0])return t[0];let h=0;if(c>1)for(;h<e.length-2&&!(d<e[h+1]);h++);const m=Un(e[h],e[h+1],d);return a[h](m)};return n?d=>u(Qe(e[0],e[i-1],d)):u}function Kh(e,t){const n=e[e.length-1];for(let s=1;s<=t;s++){const r=Un(0,t,s);e.push(dt(n,1,r))}}function pl(e){const t=[0];return Kh(t,e.length-1),t}function Wh(e,t){return e.map(n=>n*t)}function qh(e,t){return e.map(()=>t||Kr).splice(0,e.length-1)}function Ge({duration:e=300,keyframes:t,times:n,ease:s="easeInOut"}){const r=ih(s)?s.map(Oi):Oi(s)||Kr,i={done:!1,value:t[0]};if(t.length===2&&!Array.isArray(r)&&(!n||n.length!==2||n[0]===0&&n[1]===1)){const[c,u]=t,d=c===u?void 0:(Ie.mix||Xr)(c,u);return{calculatedDuration:e,next:h=>(i.value=d?d(r(e>0?Qe(0,1,h/e):1)):u,i.done=h>=e,i)}}const o=Wh(n&&n.length===t.length?n:pl(t),e),a=Uh(o,t,{ease:Array.isArray(r)?r:qh(t,r)});return{calculatedDuration:e,next:c=>(i.value=a(c),i.done=c>=e,i)}}const Gh=5;function Yh(e,t,n){const s=Math.max(t-Gh,0);return Wa(n-e(s),t-s)}function Jh(e,t,n=0){return t<=0?n:e.velocity?e.velocity(t):Yh(s=>e.next(s).value,t,e.next(t).value)}const Xh=e=>e!==null;function Gt(e,{repeat:t,repeatType:n="loop"},s,r=1){const i=e.filter(Xh),a=r<0||t&&n!=="loop"&&t%2===1?0:i.length-1;return!a||s===void 0?i[a]:s}const Zh={decay:qn,inertia:qn,tween:Ge,keyframes:Ge,spring:Wn};function ml(e){typeof e.type=="string"&&(e.type=Zh[e.type])}const Qh=40,gl=(e,t)=>t-e>Qh&&!Ie.useManualTiming?t:e;function yl(e,t){return{kind:e,animation:t,timestamp:le.now(),frameTimestamp:Xe.timestamp,frameIsProcessing:Xe.isProcessing}}function xl(e,t,n){const s=globalThis.__MOTION_INSPECT__;if(s)try{s({...yl("animation-start",e),options:n?{...t,...n}:t})}catch{}}function fb(e,t){const n=globalThis.__MOTION_INSPECT__;if(n)try{n({...yl("layout-animation-start",e),node:t})}catch{}}class ei{constructor(){this.isResolved=!1}get finished(){return this._finished||(this._finished=this.isResolved?Promise.resolve():new Promise(t=>{this._resolve=t})),this._finished}updateFinished(){this._finished=this._resolve=void 0,this.isResolved=!1}notifyFinished(){var t;this.isResolved=!0,(t=this._resolve)==null||t.call(this)}then(t,n){return this.finished.then(t,n)}}const ep=e=>e/100,rr=e=>Math.round(e*1e4)/1e4;class Yt extends ei{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{var s,r;const{motionValue:n}=this.options;n&&n.updatedAt!==le.now()&&this.tick(le.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(r=(s=this.options).onStop)==null||r.call(s))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause(),xl(this,this.options)}initAnimation(){const{options:t}=this;ml(t);const{type:n=Ge,repeat:s=0,repeatDelay:r=0,repeatType:i,velocity:o=0}=t;let{keyframes:a}=t;const c=n||Ge;c!==Ge&&typeof a[0]!="number"&&(this.mixKeyframes=us(ep,Xr(a[0],a[1])),a=[0,100]);const u=c(a===t.keyframes?t:{...t,keyframes:a});i==="mirror"&&(this.mirroredGenerator=c({...t,keyframes:[...a].reverse(),velocity:-o})),u.calculatedDuration===null&&(u.calculatedDuration=Qr(u));const{calculatedDuration:d}=u;this.calculatedDuration=d,this.resolvedDuration=d+r,this.totalDuration=this.resolvedDuration*(s+1)-r,this.generator=u}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:s,totalDuration:r,calculatedDuration:i}=this;if(this.startTime===null)return s.next(0);const{delay:o=0,keyframes:a,type:c,onUpdate:u,finalKeyframe:d}=this.options;this.startTime===this.pendingStartTime&&(this.startTime=gl(this.startTime,t)),this.pendingStartTime=void 0,this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-r/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const h=this.currentTime-o*(this.playbackSpeed>=0?1:-1),m=this.playbackSpeed>=0?h<0:h>r;this.currentTime=Math.max(h,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=r);const g=this.generate(this.currentTime,m);let{done:p}=g;!m&&i!==null&&(p=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);const x=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&p);return x&&c!==qn&&(g.value=Gt(a,this.options,d,this.speed)),u&&u(g.value),x&&this.finish(),g}at(t){return this.holdTime??rr((t-this.startTime)*this.playbackSpeed)}sampleAt(t,n){const{options:s,totalDuration:r}=this,i=this.at(t)-(s.delay||0);return i>=r&&s.type!==qn?Gt(s.keyframes,s,n?void 0:s.finalKeyframe):this.generate(Math.max(i,0),i<0).value}generate(t,n){const{generator:s,totalDuration:r,mixKeyframes:i,mirroredGenerator:o,resolvedDuration:a}=this,{keyframes:c,repeat:u,repeatType:d,repeatDelay:h}=this.options;let m=t,g=s;if(u){const x=Math.min(t,r)/a;let y=Math.floor(x),b=x%1;!b&&x>=1&&(b=1),b===1&&y--,y=Math.min(y,u+1),!!(y%2)&&(d==="reverse"?(b=1-b,h&&(b-=h/a)):d==="mirror"&&(g=o)),m=Qe(0,1,b)*a}let p;return n?(this.delayState.value=c[0],p=this.delayState):p=g.next(m),i&&!n&&(p.value=i(p.value)),p}then(t,n){return this.finished.then(t,n)}get duration(){return be(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+be(t)}get time(){return be(this.currentTime)}set time(t){t=Me(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){return Jh(this.generator,this.currentTime,this.options.velocity)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;n&&this.driver&&this.updateTime(le.now()),this.playbackSpeed=t,n&&this.driver&&(this.time=be(this.currentTime))}play(){var r,i;if(this.isStopped)return;const{driver:t=cl,startTime:n}=this.options;this.driver||(this.driver=t(o=>this.tick(o))),(i=(r=this.options).onPlay)==null||i.call(r);const s=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=s):this.holdTime!==null?this.startTime=s-this.holdTime/(this.playbackSpeed||1):this.startTime||(this.startTime=n??(this.pendingStartTime=s)),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(le.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(t=this.options).onComplete)==null||n.call(t)}cancel(){var t,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(t=this.options).onCancel)==null||n.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),t.observe(this)}}const tp=new Set(["brightness","contrast","saturate","opacity"]);function np(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[s]=n.match(Gr)||[];if(!s)return e;const r=n.replace(s,"");let i=tp.has(t)?1:0;return s!==n&&(i*=100),t+"("+i+r+")"}const sp=/\b([a-z-]*)\(.*?\)/gu,ir={...ke,getAnimatableNone:e=>{const t=e.match(sp);return t?t.map(np).join(" "):e}},or={...ke,getAnimatableNone:e=>{const t=ke.parse(e);return ke.createTransformer(e)(t.map(s=>typeof s=="number"?0:typeof s=="object"?{...s,alpha:1}:s))}},zi={...Rt,transform:Math.round},rp={rotate:Fe,pathRotation:Fe,rotateX:Fe,rotateY:Fe,rotateZ:Fe,scale:wn,scaleX:wn,scaleY:wn,scaleZ:wn,skew:Fe,skewX:Fe,skewY:Fe,distance:H,translateX:H,translateY:H,translateZ:H,x:H,y:H,z:H,perspective:H,transformPerspective:H,opacity:Wt,originX:_i,originY:_i,originZ:H},Jt={borderWidth:H,borderTopWidth:H,borderRightWidth:H,borderBottomWidth:H,borderLeftWidth:H,borderRadius:H,borderTopLeftRadius:H,borderTopRightRadius:H,borderBottomRightRadius:H,borderBottomLeftRadius:H,width:H,maxWidth:H,height:H,maxHeight:H,top:H,right:H,bottom:H,left:H,inset:H,insetBlock:H,insetBlockStart:H,insetBlockEnd:H,insetInline:H,insetInlineStart:H,insetInlineEnd:H,padding:H,paddingTop:H,paddingRight:H,paddingBottom:H,paddingLeft:H,paddingBlock:H,paddingBlockStart:H,paddingBlockEnd:H,paddingInline:H,paddingInlineStart:H,paddingInlineEnd:H,margin:H,marginTop:H,marginRight:H,marginBottom:H,marginLeft:H,marginBlock:H,marginBlockStart:H,marginBlockEnd:H,marginInline:H,marginInlineStart:H,marginInlineEnd:H,fontSize:H,backgroundPositionX:H,backgroundPositionY:H,...rp,zIndex:zi,fillOpacity:Wt,strokeOpacity:Wt,numOctaves:zi},ip={...Jt,color:ue,backgroundColor:ue,outlineColor:ue,fill:ue,stroke:ue,borderColor:ue,borderTopColor:ue,borderRightColor:ue,borderBottomColor:ue,borderLeftColor:ue,filter:ir,WebkitFilter:ir,mask:or,WebkitMask:or},bl=e=>ip[e],op=new Set([ir,or]);function ti(e,t){let n=bl(e);return op.has(n)||(n=ke),n.getAnimatableNone?n.getAnimatableNone(t):void 0}function ap(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const nt=e=>e*180/Math.PI,ar=e=>{const t=nt(Math.atan2(e[1],e[0]));return lr(t)},lp={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scaleZ:()=>1,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:ar,rotateZ:ar,skewX:e=>nt(Math.atan(e[1])),skewY:e=>nt(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},lr=e=>(e=e%360,e<0&&(e+=360),e),Hi=ar,Ui=e=>Math.hypot(e[0],e[1]),Ki=e=>Math.hypot(e[4],e[5]),cp={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Ui,scaleY:Ki,scaleZ:e=>Math.hypot(e[8],e[9],e[10]),scale:e=>(Ui(e)+Ki(e))/2,rotateX:e=>lr(nt(Math.atan2(e[6],e[5]))),rotateY:e=>lr(nt(Math.atan2(-e[2],e[0]))),rotateZ:Hi,rotate:Hi,skewX:e=>nt(Math.atan(e[4])),skewY:e=>nt(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Xt(e){return e.includes("scale")?1:0}function cr(e,t){if(!e||e==="none")return Xt(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,r;if(n)s=cp,r=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=lp,r=a}if(!r)return Xt(t);const i=s[t],o=r[1].split(",").map(dp);return typeof i=="function"?i(o):o[i]}const up=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return cr(n,t)};function dp(e){return parseFloat(e.trim())}const ze=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","scaleZ","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ye=new Set([...ze,"pathRotation"]),Wi=e=>e===Rt||e===H,fp=new Set(["x","y","z"]),hp=ze.filter(e=>!fp.has(e));function pp(e){const t=[];return hp.forEach(n=>{const s=e.getValue(n);if(s!==void 0){const r=s.get(),i=n.startsWith("scale")?1:0;if(r===i)return;t.push([n,r]),s.set(i)}}),t}const mp=new Set(["bottom","right"]);function qi(e,t,n,s,r,i){const o=parseFloat(e);if(!isNaN(o))return o;const{min:a,max:c}=t()[n],u=c-a;return i==="border-box"?u:u-parseFloat(s)-parseFloat(r)}const st={width:({width:e,paddingLeft:t="0",paddingRight:n="0",boxSizing:s},r)=>qi(e,r,"x",t,n,s),height:({height:e,paddingTop:t="0",paddingBottom:n="0",boxSizing:s},r)=>qi(e,r,"y",t,n,s),top:({top:e})=>parseFloat(e),left:({left:e})=>parseFloat(e),bottom:({top:e},t)=>{const{y:n}=t();return parseFloat(e)+(n.max-n.min)},right:({left:e},t)=>{const{x:n}=t();return parseFloat(e)+(n.max-n.min)},x:({transform:e})=>cr(e,"x"),y:({transform:e})=>cr(e,"y")};st.translateX=st.x;st.translateY=st.y;const rt=new Set;let ur=!1,dr=!1,fr=!1;function vl(){if(dr){const e=[],t=new Set,n=new Set;rt.forEach(r=>{r.needsMeasurement&&(e.push(r),t.add(r.element),mp.has(r.name)&&n.add(r.element))});const s=new Map;n.forEach(r=>{const i=pp(r);i.length&&(s.set(r,i),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const i=s.get(r);i&&i.forEach(([o,a])=>{var c;(c=r.getValue(o))==null||c.set(a)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}dr=!1,ur=!1,rt.forEach(e=>e.complete(fr)),rt.clear()}function wl(){rt.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(dr=!0)})}function gp(){fr=!0,wl(),vl(),fr=!1}function yp(e,t,n){if(typeof e=="string"){if(Br(e)||zr(e))return parseFloat(e);if(!ke.test(e)&&ke.test(n))return ti(t,n)}return e??void 0}class ni{constructor(t,n,s,r,i,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=s,this.motionValue=r,this.element=i,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(rt.add(this),ur||(ur=!0,xe.read(wl),xe.resolveKeyframes(vl))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:s,motionValue:r}=this;if(t[0]===null){const i=r==null?void 0:r.get(),o=t[t.length-1];if(i!==void 0)t[0]=i;else if(s&&n){const a=yp(s.readValue(n,o),n,o);a!==void 0&&(t[0]=a)}t[0]===void 0&&(t[0]=o),r&&i===void 0&&r.set(t[0])}ap(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),rt.delete(this)}cancel(){this.state==="scheduled"&&(rt.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const xp=e=>e.startsWith("--");function Sl(e,t,n){xp(t)?e.style.setProperty(t,n):e.style[t]=n}const bp={};function Cl(e,t){const n=Ka(e);return()=>bp[t]??n()}const vp=Cl(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),si=Cl(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),ht=([e,t,n,s])=>`cubic-bezier(${e}, ${t}, ${n}, ${s})`,hr={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:ht([0,.65,.55,1]),circOut:ht([.55,0,1,.45]),backIn:ht([.31,.01,.66,-.59]),backOut:ht([.33,1.53,.69,.99])};function kl(e,t){if(e)return typeof e=="function"?si()?ul(e,t):"ease-out":Wr(e)?ht(e):Array.isArray(e)?e.map(n=>kl(n,t)||hr.easeOut):hr[e]}function wp(e,t,n,{delay:s=0,duration:r=300,repeat:i=0,repeatType:o="loop",ease:a="easeOut",times:c}={},u=void 0){const d={[t]:n};c&&(d.offset=c);const h=kl(a,r);Array.isArray(h)&&(d.easing=h);const m={delay:s,duration:r,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:i+1,direction:o==="reverse"?"alternate":"normal"};return u&&(m.pseudoElement=u),e.animate(d,m)}function jl(e){return typeof e=="function"&&"applyToOptions"in e}function Sp({type:e,...t}){return jl(e)&&si()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class El extends ei{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:s,keyframes:r,pseudoElement:i,allowFlatten:o=!1,finalKeyframe:a,onComplete:c}=t;this.isPseudoElement=!!i,this.allowFlatten=o,this.options=t,cs(typeof t.type!="string");const u=Sp(t);this.animation=wp(n,s,r,u,i),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const d=Gt(r,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(d),Sl(n,s,d),this.animation.cancel()}c==null||c(),this.notifyFinished()},xl(this,t,u)}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,n;(n=(t=this.animation).finish)==null||n.call(t)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var n,s,r;const t=(n=this.options)==null?void 0:n.element;!this.isPseudoElement&&(t!=null&&t.isConnected)&&((r=(s=this.animation).commitStyles)==null||r.call(s))}get duration(){var n,s;const t=((s=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:s.call(n).duration)||0;return be(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+be(t)}get time(){return be(Number(this.animation.currentTime)||0)}set time(t){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Me(t),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,onAttach:n,observe:s}){var r;return this.allowFlatten&&((r=this.animation.effect)==null||r.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&vp()?(this.animation.timeline=t,n==null||n(this.animation),un):s(this)}}const Tl={anticipate:Xa,backInOut:Ja,circInOut:Za};function Cp(e){return e in Tl}function kp(e){typeof e.ease=="string"&&Cp(e.ease)&&(e.ease=Tl[e.ease])}const Gn=10;class jp extends El{constructor(t){kp(t),ml(t),super(t),t.startTime!==void 0&&t.autoplay!==!1&&(this.startTime=t.startTime),this.options=t}elapsed(){return this.state==="running"?(le.now()-this.startTime)*this.speed:this.time*1e3}sample(t){if(!this.sampler){const{motionValue:n,onUpdate:s,onComplete:r,onPlay:i,onStop:o,element:a,...c}=this.options;this.sampler=new Yt({...c,autoplay:!1}),this.sampler.stop()}return this.sampler.sample(Math.max(0,t)).value}liveValue(){const{state:t}=this;if(t==="running"||t==="paused")return this.sample(this.elapsed())}updateMotionValue(t){const{motionValue:n,element:s,name:r}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const{speed:i}=this,o=this.elapsed(),a=this.state==="running"&&i?Qe(0,Gn,o):0,c=this.sample(o);s&&r&&Sl(s,r,c),n.setWithVelocity(this.sample(o-a*Math.sign(i)),c,a/Math.abs(i||1))}}const Gi=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(ke.test(e)||e==="0")&&!e.startsWith("url("));function Ep(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function Tp(e,t,n,s){const r=e[0];if(r===null)return!1;if(t==="display"||t==="visibility")return!0;const i=e[e.length-1],o=Gi(r,t),a=Gi(i,t);return!o||!a?!1:Ep(e)||(n==="spring"||jl(n))&&s}function pr(e){e.duration=0,e.type="keyframes"}const mr=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),Np=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function Rp(e){for(let t=0;t<e.length;t++)if(typeof e[t]=="string"&&Np.test(e[t]))return!0;return!1}const Yi=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),Nl=Ka(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Mp(e){var h;const{motionValue:t,name:n,repeatDelay:s,repeatType:r,damping:i,type:o,keyframes:a}=e;if(!n||!(mr.has(n)||Yi.has(n)))return!1;const c=(h=t==null?void 0:t.owner)==null?void 0:h.current;if(!(c instanceof HTMLElement)&&!(c instanceof SVGElement))return!1;const{onUpdate:u,transformTemplate:d}=t.owner.getProps();return Nl()&&(mr.has(n)||Yi.has(n)&&Rp(a))&&(n!=="transform"||!d)&&!u&&!s&&r!=="mirror"&&i!==0&&o!=="inertia"}const Yn=(e,t)=>t&&typeof e=="number"?t.transform(e):e,Rl={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Ap=ze.length;function Ml(e,t,n){let s="",r=!0;for(let o=0;o<Ap;o++){const a=ze[o],c=e[a];if(c===void 0)continue;let u=!0;if(typeof c=="number")u=c===(a.startsWith("scale")?1:0);else{const d=parseFloat(c);u=a.startsWith("scale")?d===1:d===0}if(!u||n){const d=Yn(c,Jt[a]);if(!u){r=!1;const h=Rl[a]||a;s+=`${h}(${d}) `}n&&(t[a]=d)}}const i=e.pathRotation;return i&&(r=!1,s+=`rotate(${Yn(i,Jt.pathRotation)}) `),s=s.trim(),n?s=n(t,r?"":s):r&&(s="none"),s}const Zt=new WeakMap,Lp=200,Cn=.001,Ip=.1,Pp=.001,$p=100,Op=e=>/^(linear|ease(In|Out|InOut))$/.test(e),Ls=(e,t)=>e-t,Ji=(e,t,n)=>{const s=[];for(let r=0;r<=n;r++)s.push(dt(e,t,r/n));return s},Rn=e=>e.motionValue.owner,Mn=e=>Zt.get(e),pt=(e,t)=>{var n;return e.latestValues?e.latestValues[t]:(n=e.getValue(t))==null?void 0:n.get()},_p=({name:e,motionValue:t})=>{var n;return e&&ze.includes(e)&&((n=t==null?void 0:t.owner)==null?void 0:n.current)instanceof HTMLElement&&Nl()&&si()};function Fp(e){var r;const t=Rn(e),{onUpdate:n,transformTemplate:s}=t.getProps();return!e.isHandoff&&!n&&!e.hasOnUpdate&&!s&&e.type!=="inertia"&&(pt(t,"transform")||"none")==="none"&&!pt(t,"pathRotation")&&!((r=t.projection)!=null&&r.isProjecting())}class Dp extends Yt{constructor(t){const n=Rn(t).current,{driver:s=cl}=t;let r;const i=Fp(t);t.driver=a=>{const c=s(a);return{js:c,now:c.now,start:(u=!0)=>{const d=Mn(n);!d||d.isJS?c.start(u):d.schedule(!1,!u)},stop:()=>{c.stop();const u=Mn(n);u&&!u.isFinishing&&u.release(r)}}},super(t),r=this,this.canAccelerate=i;const{stop:o}=this;this.stop=()=>{this.isAccelerated()&&this.sync(),o()}}get group(){return Mn(Rn(this.options).current)}get js(){var t;return(t=this.driver)==null?void 0:t.js}get name(){return this.options.name}timing(){const{startTime:t,speed:n,totalDuration:s}=this,{delay:r=0,repeatType:i}=this.options;return this.holdTime!==null?[1/0,0]:s===1/0?[t+r/n,this.resolvedDuration*(i==="loop"?1:2)/n||1]:[t+(r+s)/n,0]}isAccelerated(){const{group:t,state:n}=this;return(t==null?void 0:t.tracks.has(this))&&!t.isJS&&this.canAccelerate&&(n==="running"||n==="paused")}liveValue(){return this.isAccelerated()?this.sampleAt(le.now()):void 0}tween(){const{keyframes:t,type:n,ease:s,times:r,repeat:i,delay:o=0}=this.options,a=Wr(s)?ht(s):Op(s)&&hr[s];if(a&&!i&&!r&&t.length===2&&n===Ge&&this.holdTime===null){const c=this.startTime+o/this.speed;return[c,c+this.resolvedDuration/this.speed,a]}}boundaries(t,n){const{startTime:s,speed:r,resolvedDuration:i,options:o}=this,{delay:a=0,repeat:c=0,repeatDelay:u=0,repeatType:d,times:h,keyframes:m,type:g}=o,p=(g||Ge)===Ge?h||pl(m):[0,1],x=s+a/r,y=[];if(this.holdTime!==null||!(i>0))return y;for(let b=Math.max(0,Math.floor((t-x)*r/i));b<=c;b++){const k=x+b*i/r;if(k>n)break;for(const v of p){const S=k+(b%2&&d&&d!=="loop"?1-v:v)*(i-u)/r;S>t&&S<n&&y.push(S)}}return y}numberAt(t){return parseFloat(this.sampleAt(t,!0))}sync(){const t=le.now();this.options.motionValue.setWithVelocity(this.sampleAt(t-Gn,!0),this.sampleAt(t,!0),Gn)}play(){this.isStopped||((this.group||Vp(Rn(this.options))).tracks.add(this),super.play())}pause(){super.pause(),this.isAccelerated()&&(this.sync(),this.group.schedule(!1))}complete(){super.complete();const{group:t}=this;t&&!t.isJS&&this.canAccelerate&&this.tick(le.now())}get time(){return this.isAccelerated()?be(Qe(0,this.totalDuration,this.at(le.now())-(this.options.delay||0))):super.time}set time(t){super.time=t,this.isAccelerated()&&this.sync()}attachTimeline(t){var n;return this.canAccelerate=!1,(n=this.group)==null||n.demote(!0),super.attachTimeline(t)}}function Vp(e){const t=e.current,n=new Set,s=new Map;let r={},i=[],o=new Map,a=[],c=!1,u=!1,d=!1,h=!1,m=-1/0;const g=N=>{for(const R of n)if(R.name===N)return!0},p=(N,R)=>{const I={};for(const L of N===void 0?ze:i){const O=s.get(L),_=N===void 0?pt(e,L):O?O.sampleAt(R>N&&!O.timing()[1]?R:N):r[L];_!==void 0&&(I[L]=_)}return I},x=(N,R)=>{let I="";const L=p(N,R);for(const O in L)I+=(Rl[O]||O)+"("+Yn(L[O],Jt[O])+") ";return I||"none"},y=(N=p())=>{t.style.transform=Ml(N,{})},b=(N=!0)=>{N&&y(),a.forEach(({animation:R})=>R.cancel()),a=[]},k=(N,R,I=1/0)=>{const L={animation:N,offset:R,end:I};N.startTime=le.now()+R,I<1/0&&(N.onfinish=()=>{L.isDone=!0,a.some(O=>O.end===1/0)&&(N.cancel(),a=a.filter(O=>O!==L)),$.schedule(!1)}),N.oncancel=()=>a.includes(L)&&$.demote(),a.push(L)},v=(N,R,I)=>{const L=(_,U)=>Math.abs(N(U)-N(_)),O=L(R,I);for(;I-R>.01;){const _=(R+I)/2;L(R,_)>L(_,I)?I=_:R=_}return L(R,I)>O/2?[R,I]:[]},S=(N,R,I,L)=>{const O=Math.min(Lp,Math.max(2,Math.ceil((I-R)/Gn)));if(L.length*4>O)return;const _=Ji(R,I,O).concat(L).sort(Ls),U=z=>Un(R,I,z);let F,A;for(const z of N){const q=_.map(B=>z.numberAt(B)),[te]=q,ae=q.map(B=>B-te),Oe=ae[ae.length-1],we=ae.some(B=>Math.abs(B)*Cn>Math.abs(Oe))?0:Oe,Ue=ae.map(B=>we?B/we:B);if(we){if(!F)F=Ue,A=B=>(z.numberAt(B)-te)/we;else if(Ue.some((B,ne)=>!(Math.abs(B-F[ne])<=Cn)))return}else if(Ue.some(B=>!(Math.abs(B)<=Cn)))return}if(!F||F.every((z,q)=>Math.abs(z-U(_[q]))<=Cn))return"linear";const D=[],V=(z,q=A(z))=>D.push(rr(q)+" "+rr(U(z)*100)+"%");return F.forEach((z,q)=>{q&&Math.abs(z-F[q-1])>.2&&v(A,_[q-1],_[q]).forEach(te=>V(te)),V(_[q],z)}),"linear("+D+")"},w=(N,R,I,L)=>{const O=[R],_=(D,V)=>N.every(z=>!(Math.abs(z.numberAt((D+V)/2)-(z.numberAt(D)+z.numberAt(V))/2)>(z.name.startsWith("scale")?Pp:Ip))),U=(D,V,z)=>{if(V-D<1||_(D,V))O.push(V);else if(z<4)U(D,(D+V)/2,z+1),U((D+V)/2,V,z+1);else{for(const q of N)O.push(...v(te=>q.numberAt(te),D,V));O.push(V)}},F=Ji(R,I,Math.ceil((I-R)/100));for(const D of L)F.push(D,Math.min(D+.01,I));let A=R;for(const D of F.sort(Ls))D>A&&U(A,D,0),A=D;return O.sort(Ls)},M=N=>{let R;for(const I of N){const L=I.tween();if(!L||R!=null&&R.some((O,_)=>_<2?Math.abs(L[_]-O)>1:L[_]!==O))return;R=L}return R},T=(N,R,I,L={fill:"both"},O,_)=>{const U=N.flatMap(z=>z.boundaries(R,I)),F=_||S(N,R,I,U),A=F?[R,I]:w(N,R,I,U),D=A.map(z=>x(z,O));let V={transform:D};return F||(V.offset=A.map(z=>Un(R,I,z))),D.every(z=>z===D[0])&&(y(p(R,O)),V=null),t.animate(V,{...L,duration:I-R,easing:F||"linear"})},C=N=>{let R=N,I=0,L=0;const O=[],_=[],U=new Set;s.clear(),o=new Map;for(const A of n){s.set(A.name,A);const[D,V]=A.timing(),z=D===1/0;if(o.set(A,[A.at(N),A.speed,z]),z){A.sync();continue}if(A.speed<0)return;if(V){if(I){const q=(D-L)/V;if(Math.abs(V-I)>1||Math.abs(q-Math.round(q))*I>1)return}else I=V,L=D;_.push(A)}else U.add(D);O.push(A),R=Math.max(R,D)}r={},i=ze.filter(A=>{if(s.has(A))return!0;const D=r[A]=pt(e,A);return D!==void 0&&parseFloat(D)!==(A.startsWith("scale")?1:0)}),b(!1);const F=!I&&M(O);try{if(F&&F[1]>N){const[A,D,V]=F;k(T(O,A,D,void 0,void 0,V),A-N,D-A)}else R>N&&(k(T(O,N,R),0,R-N),U.forEach(A=>A<R-1&&k(t.animate(null,{duration:A-N}),0,A-N)));if(I){const A=L+Math.floor((R-L)/I)*I;k(T(_,A,A+I,{iterations:1/0,iterationStart:(R-A)/I,fill:"forwards"},R),R-N)}}catch{return}return a.length||b(),!0},j=N=>{let R,I=0;for(const L of n){const O=o.get(L);if(!O)return!1;const[_,U,F]=O,A=L.at(N),D=L.timing()[0]===1/0;if(F){if(D&&A===_)continue;return!1}const V=(A-_)/U,z=D?0:L.speed/U;if(R===void 0)R=V,I=z;else if(Math.abs(V-R)>1||z!==I)return!1}if(R===void 0)return!0;if(!a.length)return!1;for(const{offset:L,end:O,isDone:_}of a){const U=R-L;if(O<1/0&&(_?U<O-1:U<0||U>=O))return!1}for(const{animation:L,offset:O,isDone:_}of a){if(_)continue;const U=R-O;I?(L.playbackRate=I,L.startTime=N-U/I):(L.pause(),L.currentTime=U)}return!0},E=()=>n.size?!1:(d=!0,Mn(t)===$&&Zt.delete(t),$.isJS||b(),!0),P=()=>{const N=le.now();if($.isJS||($.isFinishing=!0,n.forEach(L=>{const[O,_]=L.timing();L.state==="running"&&L.speed>0&&!_&&O<=N+1&&(L.complete(),r[L.name]=pt(e,L.name),o.has(L)||(c=!0))}),$.isFinishing=!1),u=!1,d||(n.forEach(({state:L},O)=>{(L==="idle"||L==="finished")&&n.delete(O)}),E()))return;for(const L of n)if(!L.canAccelerate)return $.demote(!0);$.isJS&&($.isJS=!1,c=!0,n.forEach(L=>{var O;return(O=L.js)==null?void 0:O.stop()}));const R=c,I=h;if(c=h=!1,R||!j(N)){if(I){if(N-m<$p)return $.demote();m=N}if(!C(N))return $.demote()}},$={tracks:n,isJS:!1,isFinishing:!1,schedule(N,R){d||(c||(c=N),h||(h=!!R),u||(u=!0,Xe.isProcessing?xe.render(P,!1,!0):queueMicrotask(P)))},release(N){const{state:R}=N;(R==="idle"||R==="finished")&&n.delete(N),E()||$.schedule(!0)},check(){if(!$.isJS){for(const N in r)if(pt(e,N)!==r[N]&&!g(N))return $.schedule(!0,!0)}},demote(N){$.isJS||d||(n.forEach(R=>{R.isAccelerated()&&R.sync(),N||(R.canAccelerate=!1)}),$.isJS=!0,o=new Map,b(),n.forEach(R=>{var I;return R.state==="running"&&((I=R.js)==null?void 0:I.start())}))}};return Zt.set(t,$),$}class Bp extends ei{constructor(t){var c;super(),this.stop=()=>{var u,d;this._animation&&(this._animation.stop(),(u=this.stopTimeline)==null||u.call(this)),(d=this.keyframeResolver)==null||d.cancel()},this.createdAt=le.now();const{keyframes:n,name:s,motionValue:r,element:i}=t,o=t;o.autoplay??(o.autoplay=!0),o.delay??(o.delay=0),o.type??(o.type="keyframes"),o.repeat??(o.repeat=0),o.repeatDelay??(o.repeatDelay=0),o.repeatType??(o.repeatType="loop");const a=(i==null?void 0:i.KeyframeResolver)||ni;this.keyframeResolver=new a(n,(u,d,h)=>this.onKeyframesResolved(u,d,o,!h),s,r,i),(c=this.keyframeResolver)==null||c.scheduleResolve()}onKeyframesResolved(t,n,s,r){var y,b;this.keyframeResolver=void 0;const{name:i,type:o,velocity:a,delay:c,isHandoff:u,onUpdate:d}=s;this.resolvedAt=le.now();let h=!0;Tp(t,i,o,a)||(h=!1,(Ie.instantAnimations||!c)&&(d==null||d(Gt(t,s,n))),t[0]=t[t.length-1],pr(s),s.repeat=0);const{onComplete:m}=s;s.finalKeyframe=n,s.keyframes=t,s.onComplete=()=>{m==null||m(),this.notifyFinished()};const g=h&&!u&&Mp(s),p=!g&&_p(s);r&&(g||p||this.resolvedAt!==this.createdAt)&&(s.startTime??(s.startTime=gl(this.createdAt,this.resolvedAt)));let x;if(g){s.element=(b=(y=s.motionValue)==null?void 0:y.owner)==null?void 0:b.current;try{x=new jp(s)}catch{x=new Yt(s)}}else p?x=new Dp(s):x=new Yt(s);this.pendingTimeline&&(this.stopTimeline=x.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=x}get finished(){return this._animation?this._animation.finished:super.finished}then(t,n){return this.finished.finally(t).then(()=>{})}liveValue(){var t,n;return(n=(t=this._animation)==null?void 0:t.liveValue)==null?void 0:n.call(t)}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),gp()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}}function Al(e,t,n,s=0,r=1){const i=Array.from(e).sort((u,d)=>u.sortNodePosition(d)).indexOf(t),o=e.size,a=(o-1)*s;return typeof n=="function"?n(i,o):r===1?i*s:a-i*s}const Xi=30,zp=e=>!isNaN(parseFloat(e));class Hp{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=s=>{const r=le.now();if(this.updatedAt!==r&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&(this.notifyChange(),this.dependents))for(const i of this.dependents)i.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=le.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=zp(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){var s;return t==="change"?this.onChangeSubscribe(n):((s=this.events)[t]||(s[t]=new Zs)).add(n)}onChangeSubscribe(t){const{events:n}=this;return!n.change&&!this.changeSubscriber?this.changeSubscriber=t:(n.change||(n.change=new Zs,n.change.add(this.changeSubscriber),this.changeSubscriber=void 0),n.change.add(t)),()=>{var s;this.changeSubscriber===t?this.changeSubscriber=void 0:(s=n.change)==null||s.remove(t),this.stopIfUnobserved()}}stopIfUnobserved(){xe.read(()=>{var t;!this.changeSubscriber&&!((t=this.events.change)!=null&&t.getSize())&&this.stop()})}clearListeners(){this.changeSubscriber=void 0;for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,s){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-s}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.notifyChange()}notifyChange(){var s;const{current:t,changeSubscriber:n}=this;n?n(t):(s=this.events.change)==null||s.notify(t)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){var n,s;const t=(s=(n=this.animation)==null?void 0:n.liveValue)==null?void 0:s.call(n);return t===void 0?this.current:t}getCurrent(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=le.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Xi)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Xi);return Wa(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{var i;this.hasAnimated=!0;let s=!1,r;r=t(()=>{var o;s=!0,(o=this.events.animationComplete)==null||o.notify(),this.animation===r&&this.clearAnimation(),n()}),s||(this.animation=r),(i=this.events.animationStart)==null||i.notify()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){this.animation=void 0}destroy(){var t,n;(t=this.dependents)==null||t.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Qt(e,t){return new Hp(e,t)}function ri(e,t){if(e!=null&&e.inherit&&t){const{inherit:n,...s}=e;return{...t,...s}}return e}function Ll(e,t){const n=(e==null?void 0:e[t])??(e==null?void 0:e.default)??e;return n!==e?ri(n,e):n}const Up={type:"spring",stiffness:500,damping:25,restSpeed:10},Kp=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Wp={type:"keyframes",duration:.8},qp={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Gp=(e,{keyframes:t})=>t.length>2?Wp:Ye.has(e)?e.startsWith("scale")?Kp(t[1]):Up:qp,Yp=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function Jp(e){for(const t in e)if(!Yp.has(t))return!0;return!1}const Xp=(e,t,n,s={},r,i)=>o=>{const a=Ll(s,e)||{},c=a.delay||s.delay||0;let{elapsed:u=0}=s;u=u-Me(c);const d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-u,onUpdate:m=>{t.set(m),a.onUpdate&&a.onUpdate(m)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:i?void 0:r,hasOnUpdate:!!a.onUpdate};Jp(a)||Object.assign(d,Gp(e,d)),d.duration&&(d.duration=Me(d.duration)),d.repeatDelay&&(d.repeatDelay=Me(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let h=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(pr(d),d.delay===0&&(h=!0)),(Ie.instantAnimations||Ie.skipAnimations||r!=null&&r.shouldSkipAnimations||a.skipAnimations)&&(h=!0,pr(d),d.delay=0),d.allowFlatten=!a.type&&!a.ease,h&&!i&&t.get()!==void 0){const m=Gt(d.keyframes,a);if(m!==void 0){xe.update(()=>{d.onUpdate(m),d.onComplete()});return}}return a.isSync?new Yt(d):new Bp(d)},Zp=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Qp(e){const t=Zp.exec(e);if(!t)return[,];const[,n,s,r]=t;return[`--${n??s}`,r]}function Il(e,t,n=1){const[s,r]=Qp(e);if(!s)return;const i=window.getComputedStyle(t).getPropertyValue(s);if(i){const o=i.trim();return Br(o)?parseFloat(o):o}return qr(r)?Il(r,t,n+1):r}function em(e){const t=[{},{}];return e==null||e.values.forEach((n,s)=>{t[0][s]=n.get(),t[1][s]=n.getVelocity()}),t}function Pl(e,t,n,s){const r=i=>typeof i=="function"?i(n!==void 0?n:e.custom,...em(s)):i;return t=r(t),typeof t=="string"&&(t=e.variants&&e.variants[t]),r(t)}function it(e,t,n){return Pl(e.getProps(),t,n,e)}const $l=(e,t)=>{var n;return t==="exit"?(n=e.presenceContext)==null?void 0:n.custom:void 0},Ol=new Set(["width","height","top","left","right","bottom",...ze]),tm=e=>Array.isArray(e);function nm(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Qt(n))}function sm(e){return tm(e)?e[e.length-1]||0:e}function rm(e,t){const n=it(e,t);let{transitionEnd:s={},transition:r={},...i}=n||{};i={...i,...s};for(const o in i){const a=sm(i[o]);nm(e,o,a)}}const pe=e=>!!(e&&e.getVelocity);function im(e){return!!(pe(e)&&e.add)}function om(e,t){const n=e.getValue("willChange");if(im(n))return n.add(t);if(!n&&Ie.WillChange){const s=new Ie.WillChange("auto");e.addValue("willChange",s),s.add(t)}}function ii(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const am="framerAppearId",_l="data-"+ii(am);function lm(e){return e.props[_l]}const cm=typeof window<"u";function um({protectedKeys:e,needsAnimating:t},n){const s=n in e&&!t[n];return t[n]=!1,s}function Fl(e,t,{delay:n=0,transitionOverride:s,type:r}={}){var p,x;let{transition:i,transitionEnd:o,...a}=t;const c=e.getDefaultTransition();i=i?ri(i,c):c;const u=i==null?void 0:i.reduceMotion,d=i==null?void 0:i.skipAnimations;s&&(i=s);const h=[],m=r&&((p=e.animationState)==null?void 0:p.getState()[r]),g=i==null?void 0:i.path;g&&(g.animateValues?g.animateValues(y=>e.getValue(y,e.latestValues[y]??0),a,i,n,h):(x=g.animateVisualElement)==null||x.call(g,e,a,i,n,h));for(const y in a){const b=e.getValue(y,e.latestValues[y]??null),k=a[y];if(k===void 0||m&&um(m,y))continue;const v={delay:n,...Ll(i||{},y)};d&&(v.skipAnimations=!0);const S=b.get();if(S!==void 0&&!b.isAnimating()&&!Array.isArray(k)&&k===S&&!v.velocity){xe.update(()=>b.set(k));continue}let w=!1;if(cm&&window.MotionHandoffAnimation){const C=lm(e);if(C){const j=window.MotionHandoffAnimation(C,y,xe);j!==null&&(v.startTime=j,w=!0)}}om(e,y);const M=u??e.shouldReduceMotion;b.start(Xp(y,b,k,M&&Ol.has(y)?{type:!1}:v,e,w));const T=b.animation;T&&h.push(T)}if(o){const y=()=>xe.update(()=>{o&&rm(e,o)});h.length?Promise.all(h).then(y):y()}return h}function gr(e,t,n={}){const s=it(e,t,$l(e,n.type)),r=n.transitionOverride||((s==null?void 0:s.transition)??(e.getDefaultTransition()||{})),i=()=>Promise.all(s?Fl(e,s,n):[]),o=(c=0)=>{const{variantChildren:u}=e,{delayChildren:d=0,staggerChildren:h,staggerDirection:m}=r,g=[];return u==null||u.forEach(p=>{p.notify("AnimationStart",t),g.push(gr(p,t,{...n,delay:c+(typeof d=="function"?0:d)+Al(u,p,d,h,m)}).then(()=>p.notify("AnimationComplete",t)))}),Promise.all(g)},{when:a}=r;return a?a==="beforeChildren"?i().then(()=>o()):o().then(i):Promise.all([i(),o(n.delay)])}function dm(e,t,n={}){return e.notify("AnimationStart",t),(Array.isArray(t)?Promise.all(t.map(r=>gr(e,r,n))):typeof t=="string"?gr(e,t,n):Promise.all(Fl(e,it(e,t,n.custom),n))).then(()=>{e.notify("AnimationComplete",t)})}const fm={test:e=>e==="auto",parse:e=>e},hm=e=>t=>t.test(e),pm=[Rt,H,xt,Fe,gh,mh,fm],Zi=e=>pm.find(hm(e));function mm(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||zr(e):!0}const gm=new Set(["auto","none","0"]);function ym(e,t,n){let s=0,r;for(;s<e.length&&!r;){const i=e[s];typeof i=="string"&&!gm.has(i)&&Sh(i)&&(r=e[s]),s++}if(r&&n)for(const i of t)e[i]!==r&&(e[i]=ti(n,r))}class xm extends ni{constructor(t,n,s,r,i){super(t,n,s,r,i,!0)}scheduleResolve(){if(this.canReadNow()&&(this.readKeyframes(),!this.needsMeasurement))return this.complete();super.scheduleResolve()}canReadNow(){const{unresolvedKeyframes:t,element:n,motionValue:s}=this,r=t[0]??(s==null?void 0:s.get());if(!(n!=null&&n.current)||r===void 0)return!1;for(let i=0;i<t.length;i++)if(Es(i?t[i]:r))return!1;return!0}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:s}=this;if(!n||!n.current)return;super.readKeyframes();for(let d=0;d<t.length;d++){let h=t[d];if(typeof h=="string"&&(h=h.trim(),qr(h))){const m=Il(h,n.current);m!==void 0&&(t[d]=m),d===t.length-1&&(this.finalKeyframe=h)}}if(this.resolveNoneKeyframes(),!Ol.has(s)||t.length!==2)return;const[r,i]=t;if(typeof r=="number"&&typeof i=="number")return;const o=Zi(r),a=Zi(i),c=Es(r),u=Es(i);if(c!==u&&st[s]){this.needsMeasurement=!0;return}if(o!==a)if(Wi(o)&&Wi(a))for(let d=0;d<t.length;d++){const h=t[d];typeof h=="string"&&(t[d]=parseFloat(h))}else st[s]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,s=[];for(let r=0;r<t.length;r++)(t[r]===null||mm(t[r]))&&s.push(r);s.length&&ym(t,s,n)}measure(){const{element:t,name:n}=this;return st[n](window.getComputedStyle(t.current),()=>t.measureViewportBox())}measureInitialState(){var i;const{element:t,unresolvedKeyframes:n,name:s}=this;if(!t||!t.current)return;s==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=this.measure(),n[0]=this.measuredOrigin;const r=n[n.length-1];r!==void 0&&((i=this.motionValue)==null||i.jump(r,!1))}measureEndState(){var i,o;const{element:t,unresolvedKeyframes:n}=this;if(!t||!t.current)return;(i=this.motionValue)==null||i.jump(this.measuredOrigin,!1);const s=n.length-1,r=n[s];n[s]=this.measure(),r!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=r),(o=this.removedTransforms)!=null&&o.length&&this.removedTransforms.forEach(([a,c])=>{t.getValue(a).set(c)}),this.resolveNoneKeyframes()}}function An(e){return th(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}function bm(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let s=document;const r=(n==null?void 0:n[e])??s.querySelectorAll(e);return r?Array.from(r):[]}return Array.from(e).filter(s=>s!=null)}function oi(e,t,n){const{style:s,vars:r,transformOrigin:i}=e;let o=!1,a=!1;for(const c in t){const u=t[c];if(Ye.has(c)){o=!0;continue}else if(el(c)){r[c]=u;continue}else{const d=Yn(u,Jt[c]);c.startsWith("origin")?(a=!0,i[c]=d):s[c]=d}}if(t.transform||(o||n?s.transform=Ml(t,e.transform,n):s.transform&&(s.transform="none")),a){const{originX:c="50%",originY:u="50%",originZ:d=0}=i;s.transformOrigin=`${c} ${u} ${d}`}}const vm={offset:"stroke-dashoffset",array:"stroke-dasharray"},wm={offset:"strokeDashoffset",array:"strokeDasharray"};function Sm(e,t,n=1,s=0,r=!0){e.pathLength=1;const i=r?vm:wm;e[i.offset]=`${-s}`,e[i.array]=`${t} ${n}`}const Dl=["transform","opacity","clipPath","filter","offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Vl(e,{attrX:t,attrY:n,attrScale:s,pathLength:r,pathSpacing:i=1,pathOffset:o=0,...a},c,u,d){if(oi(e,a,u),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:h,style:m}=e;for(const g of Dl)h[g]!==void 0&&(m[g]=h[g],delete h[g]);(m.transform||h.transformOrigin)&&(m.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),m.transform&&(m.transformBox=(d==null?void 0:d.transformBox)??"fill-box",delete h.transformBox),t!==void 0&&(h.x=t),n!==void 0&&(h.y=n),s!==void 0&&(h.scale=s),r!==void 0&&Sm(h,r,i,o,!1)}function Cm({top:e,left:t,right:n,bottom:s}){return{x:{min:t,max:n},y:{min:e,max:s}}}function hb({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function km(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),s=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}function Is(e){return e===void 0||e===1}function jm({scale:e,scaleX:t,scaleY:n}){return!Is(e)||!Is(t)||!Is(n)}function Em(e){return jm(e)||Tm(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.rotateZ||e.skewX||e.skewY}function Tm(e){return Qi(e.x)||Qi(e.y)}function Qi(e){return e&&e!=="0%"}function eo(e,t,n){const s=e-n,r=t*s;return n+r}function to(e,t,n,s,r){return r!==void 0&&(e=eo(e,r,s)),eo(e,n,s)+t}function yr(e,t=0,n=1,s,r){e.min=to(e.min,t,n,s,r),e.max=to(e.max,t,n,s,r)}function Nm(e,{x:t,y:n}){yr(e.x,t.translate,t.scale,t.originPoint),yr(e.y,n.translate,n.scale,n.originPoint)}const no=.999999999999,so=1.0000000000001;function pb(e,t,n,s=!1){var a;const r=n.length;if(!r)return;t.x=t.y=1;let i,o;for(let c=0;c<r;c++){i=n[c],o=i.projectionDelta;const{visualElement:u}=i.options;u&&u.props.style&&u.props.style.display==="contents"||(s&&i.options.layoutScroll&&i.scroll&&i!==i.root&&(Jn(e.x,-i.scroll.offset.x),Jn(e.y,-i.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,Nm(e,o)),s&&Em(i.latestValues)&&Rm(e,i.latestValues,(a=i.layout)==null?void 0:a.layoutBox))}t.x<so&&t.x>no&&(t.x=1),t.y<so&&t.y>no&&(t.y=1)}function Jn(e,t){e.min+=t,e.max+=t}function ro(e,t,n,s,r=.5){const i=dt(e.min,e.max,r);yr(e,t,n,i,s)}function io(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function Rm(e,t,n){const s=n??e;ro(e.x,io(t.x,s.x),t.scaleX,t.scale,t.originX),ro(e.y,io(t.y,s.y),t.scaleY,t.scale,t.originY)}function Bl(e,t){return Cm(km(e.getBoundingClientRect(),t))}function mb(e,t,n){const s=Bl(e,n),{scroll:r}=t;return r&&(Jn(s.x,r.offset.x),Jn(s.y,r.offset.y)),s}const{schedule:Mm}=ll(queueMicrotask,!1),Am={};function Lm(e){return pe(e)?e.get():e}const oo=()=>({translate:0,scale:1,origin:0,originPoint:0}),gb=()=>({x:oo(),y:oo()}),ao=()=>({min:0,max:0}),zl=()=>({x:ao(),y:ao()});function lo(e,t,n,s={passive:!0}){return e.addEventListener(t,n,s),()=>e.removeEventListener(t,n,s)}const Im=new WeakMap;function ds(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function en(e){return typeof e=="string"||Array.isArray(e)}const ai=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],co=["initial",...ai];function fs(e){if(ds(e.animate))return!0;for(let t=0;t<co.length;t++)if(en(e[co[t]]))return!0;return!1}function Hl(e){return!!(fs(e)||e.variants)}function Pm(e,t,n){for(const s in t){const r=t[s],i=n[s];if(pe(r))e.addValue(s,r);else if(pe(i))e.addValue(s,Qt(r,{owner:e}));else if(i!==r)if(e.hasValue(s)){const o=e.getValue(s);o.liveStyle===!0?o.jump(r):o.hasAnimated||o.set(r)}else{const o=e.getStaticValue(s);e.addValue(s,Qt(o!==void 0?o:r,{owner:e}))}}for(const s in n)t[s]===void 0&&e.removeValue(s);return t}const Xn={current:null},li={current:!1},$m=typeof window<"u";function Ul(){if(li.current=!0,!!$m)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Xn.current=e.matches;e.addEventListener("change",t),t()}else Xn.current=!1}const uo=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Zn={};function Kl(e){Zn=e}function Om(){return Zn}class _m{scrapeMotionValuesFromProps(t,n,s){return{}}constructor({parent:t,props:n,presenceContext:s,reducedMotionConfig:r,skipAnimations:i,blockInitialAnimation:o,visualState:a},c={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=ni,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const g=le.now();this.renderScheduledAt<g&&(this.renderScheduledAt=g,xe.render(this.render,!1,!0))};const{latestValues:u,renderState:d}=a;this.latestValues=u,this.baseTarget={...u},this.initialValues=n.initial?{...u}:{},this.renderState=d,this.parent=t,this.props=n,this.presenceContext=s,this.depth=t?t.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=i,this.options=c,this.blockInitialAnimation=!!o,this.isControllingVariants=fs(n),this.isVariantNode=Hl(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:h,...m}=this.scrapeMotionValuesFromProps(n,{},this);for(const g in m){const p=m[g];u[g]!==void 0&&pe(p)&&p.set(u[g])}}mount(t){var n,s;if(this.hasBeenMounted)for(const r in this.initialValues)(n=this.values.get(r))==null||n.jump(this.initialValues[r]),this.latestValues[r]=this.initialValues[r];if(this.current=t,Im.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.isVariantNode&&!this.isControllingVariants){let r=this;do r=r.props.inherit!==!1&&r.parent;while(r&&!r.isVariantNode);if(r){const{variantChildren:i}=r;i.add(this),this.removeFromVariantTree=()=>i.delete(this)}}this.values.forEach((r,i)=>this.bindToMotionValue(i,r)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(li.current||Ul(),this.shouldReduceMotion=Xn.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(s=this.parent)==null||s.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var t;this.projection&&this.projection.unmount(),tr(this.notifyUpdate),tr(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(t=this.parent)==null||t.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const s=this.features[n];s&&(s.unmount(),s.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),n.accelerate&&mr.has(t)&&this.current instanceof HTMLElement){const{factory:o,keyframes:a,times:c,ease:u,duration:d}=n.accelerate,h=new El({element:this.current,name:t,keyframes:a,times:c,ease:u,duration:Me(d)}),m=o(h);this.valueSubscriptions.set(t,()=>{m(),h.cancel()});return}const s=Ye.has(t);s&&this.onBindTransform&&this.onBindTransform();const r=n.on("change",o=>{var a;this.latestValues[t]=o,this.props.onUpdate&&xe.preRender(this.notifyUpdate),s&&(this.projection&&(this.projection.isTransformDirty=!0),(a=Zt.get(this.current))==null||a.check()),this.scheduleRender()});let i;typeof window<"u"&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{r(),i&&i()})}sortNodePosition(t){return!this.current||!t.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Zn){const n=Zn[t];if(!n)continue;const{isEnabled:s,Feature:r}=n;if(!this.features[t]&&r&&s(this.props)&&(this.features[t]=new r(this)),this.features[t]){const i=this.features[t];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):zl()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){var i;const{transformTemplate:s,onUpdate:r}=this.props;(t.transformTemplate||s)&&this.scheduleRender(),(t.transformTemplate&&!s||t.onUpdate&&!r)&&((i=Zt.get(this.current))==null||i.demote()),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let o=0;o<uo.length;o++){const a=uo[o];this.propEventSubscriptions[a]&&(this.propEventSubscriptions[a](),delete this.propEventSubscriptions[a]);const c="on"+a,u=t[c];u&&(this.propEventSubscriptions[a]=this.on(a,u))}this.prevMotionValues=Pm(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}addValue(t,n){const s=this.values.get(t);if(n!==s){s&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n);const r=n.get();r!==void 0&&(this.latestValues[t]=r)}}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){var r;if(this.props.values&&this.props.values[t])return this.props.values[t];let s=this.values.get(t);return s===void 0&&n!==void 0&&(s=Qt(n??((r=this.getDefaultValue)==null?void 0:r.call(this,t)),{owner:this}),this.addValue(t,s)),s}readValue(t,n){let s=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return s!=null&&(typeof s=="string"&&(Br(s)||zr(s))?s=parseFloat(s):typeof s!="number"&&!ke.test(s)&&ke.test(n)&&(s=ti(t,n)),this.setBaseTarget(t,pe(s)?s.get():s)),pe(s)?s.get():s}setBaseTarget(t,n){this.baseTarget[t]=n}on(t,n){return this.events[t]||(this.events[t]=new Zs),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){Mm.render(this.render)}}class Wl extends _m{constructor(){super(...arguments),this.KeyframeResolver=xm}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){const s=t.style;return s?s[n]:void 0}removeValueFromRenderState(t,{vars:n,style:s}){delete n[t],delete s[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;pe(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function ql(e,{style:t,vars:n},s,r){const i=e.style;let o;for(o in t)i[o]=t[o];r==null||r.applyProjectionStyles(i,s);for(o in n)i.setProperty(o,n[o])}function Gl(e,{layout:t,layoutId:n}){return Ye.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Am[e]||e==="opacity")}function ci(e,t,n){var o;const s=e.style,r=t==null?void 0:t.style,i={};if(!s)return i;for(const a in s)(pe(s[a])||r&&pe(r[a])||Gl(a,e)||((o=n==null?void 0:n.getValue(a))==null?void 0:o.liveStyle)!==void 0)&&(i[a]=s[a]);return i}function Fm(e){return window.getComputedStyle(e)}class Dm extends Wl{constructor(){super(...arguments),this.type="html",this.renderInstance=ql}mount(t){cs(!!t.style),super.mount(t)}readValueFromInstance(t,n){var s;if(Ye.has(n))return(s=this.projection)!=null&&s.isProjecting?Xt(n):up(t,n);{const r=Fm(t),i=(el(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Bl(t,n)}build(t,n,s){oi(t,n,s.transformTemplate)}scrapeMotionValuesFromProps(t,n,s){return ci(t,n,s)}}const Yl=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;function ui(e){return{point:{x:e.pageX,y:e.pageY}}}const yb=e=>t=>Yl(t)&&e(t,ui(t)),Vm=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Bm(e){return Vm.has(e.tagName)||e.isContentEditable===!0}const zm=new Set(["INPUT","SELECT","TEXTAREA"]);function xb(e){return zm.has(e.tagName)||e.isContentEditable===!0}const fo={x:!1,y:!1};function Jl(){return fo.x||fo.y}function Xl(e,t){const n=bm(e),s=new AbortController,r={passive:!0,...t,signal:s.signal};return[n,r,()=>s.abort()]}function Hm(e){return!(e.pointerType==="touch"||Jl())}function Um(e,t,n={}){const[s,r,i]=Xl(e,n);return s.forEach(o=>{let a=!1,c=!1,u;const d=()=>{o.removeEventListener("pointerleave",p)},h=y=>{u&&(u(y),u=void 0),d()},m=y=>{a=!1,window.removeEventListener("pointerup",m),window.removeEventListener("pointercancel",m),c&&(c=!1,h(y))},g=()=>{a=!0,window.addEventListener("pointerup",m,r),window.addEventListener("pointercancel",m,r)},p=y=>{if(y.pointerType!=="touch"){if(a){c=!0;return}h(y)}},x=y=>{if(!Hm(y))return;c=!1;const b=t(o,y);typeof b=="function"&&(u=b,o.addEventListener("pointerleave",p,r))};o.addEventListener("pointerenter",x,r),o.addEventListener("pointerdown",g,r)}),i}const Zl=(e,t)=>t?e===t?!0:Zl(e,t.parentElement):!1,Ln=new WeakSet;function ho(e){return t=>{t.key==="Enter"&&e(t)}}function Ps(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const Km=(e,t)=>{const n=e.currentTarget;if(!n)return;const s=ho(()=>{if(Ln.has(n))return;Ps(n,"down");const r=ho(()=>{Ps(n,"up")}),i=()=>Ps(n,"cancel");n.addEventListener("keyup",r,t),n.addEventListener("blur",i,t)});n.addEventListener("keydown",s,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",s),t)};function po(e){return Yl(e)&&!Jl()}const mo=new WeakSet;function Wm(e,t,n={}){const[s,r,i]=Xl(e,n),o=a=>{const c=a.currentTarget;if(!po(a)||mo.has(a))return;Ln.add(c),n.stopPropagation&&mo.add(a);const u=t(c,a),d={...r,capture:!0},h=(p,x)=>{window.removeEventListener("pointerup",m,d),window.removeEventListener("pointercancel",g,d),Ln.has(c)&&Ln.delete(c),po(p)&&typeof u=="function"&&u(p,{success:x})},m=p=>{h(p,c===window||c===document||n.useGlobalTarget||Zl(c,p.target))},g=p=>{h(p,!1)};window.addEventListener("pointerup",m,d),window.addEventListener("pointercancel",g,d)};return s.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,r),An(a)&&(a.addEventListener("focus",u=>Km(u,r)),!Bm(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),i}class Mt{constructor(t){this.isMounted=!1,this.node=t}update(){}}const Ql=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),ec=e=>typeof e=="string"&&e.toLowerCase()==="svg";function qm(e,t,n,s){ql(e,t,void 0,s);for(const r in t.attrs)e.setAttribute(Ql.has(r)?r:ii(r),t.attrs[r])}function tc(e,t,n){const s=ci(e,t,n);for(const r in e)if(r!=="children"&&(pe(e[r])||pe(t[r]))){const i=ze.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;s[i]=e[r]}return s}class Gm extends Wl{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=zl}getBaseTargetFromProps(t,n){return Ye.has(n)?super.getBaseTargetFromProps(t,n)??Xt(n):t[n]}getDefaultValue(t){return Ye.has(t)?this.latestValues[t]??Xt(t):void 0}readValueFromInstance(t,n){if(Ye.has(n)){const s=bl(n);return s&&s.default||0}if(Dl.includes(n)){const r=getComputedStyle(t)[n];if(typeof r=="string"&&r)return r.trim()}return n=Ql.has(n)?n:ii(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,s){return tc(t,n,s)}build(t,n,s){Vl(t,n,this.isSVGTag,s.transformTemplate,s.style)}renderInstance(t,n,s,r){qm(t,n,s,r)}mount(t){this.isSVGTag=ec(t.tagName),super.mount(t)}}function nc(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let s=0;s<n;s++)if(t[s]!==e[s])return!1;return!0}const Ym=[...ai].reverse();function Jm(e){let t=a=>Promise.all(a.map(({animation:c,options:u})=>dm(e,c,u))),n=go(),s=!0,r=!1;function i(a){var k;const{props:c,parent:u,manuallyAnimateOnMount:d}=e,h=s||r,m=[],g=new Set;let p={},x=1/0,y=e;do y=y.props.inherit!==!1&&y.parent;while(y&&!y.isControllingVariants);if(Ym.forEach((v,S)=>{var _,U;const w=n[v],M=c[v],T=y&&y.props[v],C=M!==void 0?M:en(T)||T===!1?T:void 0,j=en(C),E=v===a?w.isActive:null;E===!1&&(x=S);const P=j&&M===void 0&&!(h&&d);if(w.protectedKeys={...p},!w.isActive&&E===null||!C&&!w.prevProp||ds(C)||typeof C=="boolean")return;if(v==="exit"&&w.isActive&&E!==!0){p={...p,...w.prevResolvedValues};return}const $=Xm(w.prevProp,C);let N=$||j&&(E&&!P||S>x),R=!1;const I=Array.isArray(C)?C:[C];let L={};if(E!==!1)for(const F of I){const{transition:A,transitionEnd:D,...V}=it(e,F,$l(e,v))||{};L={...L,...V,...D}}const{prevResolvedValues:O}=w;for(const F in{...O,...L}){if(F in p)continue;const A=L[F],D=O[F],V=Array.isArray(A)&&Array.isArray(D)?!nc(A,D)||$:A!==D;if(V&&A==null)g.add(F);else if(V||A!==void 0&&g.has(F)){N=!0,g.delete(F)&&(R=!0),w.needsAnimating[F]=!0;const z=e.getValue(F);z&&(z.liveStyle=!1)}else w.protectedKeys[F]=!0}if(w.prevProp=C,w.prevResolvedValues=L,w.isActive&&(p={...p,...L}),N&&(!(P&&$)||R))for(const F of I){const A={type:v};if(typeof F=="string"&&h&&d&&(u!=null&&u.enteringChildren)){const D=(U=(_=it(u,F))==null?void 0:_.transition)==null?void 0:U.delayChildren;A.delay=Al(u.enteringChildren,e,D)}m.push({animation:F,options:A})}}),g.size){const{initial:v}=c,S={},w=typeof v!="boolean"&&it(e,Array.isArray(v)?v[0]:v,(k=e.presenceContext)==null?void 0:k.custom);w&&w.transition&&(S.transition=w.transition),g.forEach(M=>{const T=e.getValue(M);T&&(T.liveStyle=!0);const C=w&&!Array.isArray(v)?w[M]:void 0,j=e.getBaseTargetFromProps(c,M);S[M]=(C!==void 0?C:j!==void 0&&!pe(j)?j:e.initialValues[M]===void 0?e.baseTarget[M]:void 0)??null}),m.push({animation:S})}const b=h&&e.blockInitialAnimation||s&&!d&&(c.initial===!1||c.initial===c.animate);return s=r=!1,!b&&m.length?t(m):Promise.resolve()}function o(a,c){var d;if(n[a].isActive===c)return Promise.resolve();(d=e.variantChildren)==null||d.forEach(h=>{var m;return(m=h.animationState)==null?void 0:m.setActive(a,c)}),n[a].isActive=c;const u=i(a);for(const h in n)n[h].protectedKeys={};return u}return{animateChanges:i,setActive:o,setAnimateFunction:a=>{t=a(e)},getState:()=>n,reset:()=>{n=go(),r=!0}}}function Xm(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!nc(t,e):!1}function go(){const e={};for(const t of ai)e[t]={isActive:t==="animate",protectedKeys:{},needsAnimating:{},prevResolvedValues:{}};return e}const Pe=f.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function yo(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Zm(...e){return t=>{let n=!1;const s=e.map(r=>{const i=yo(r,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let r=0;r<s.length;r++){const i=s[r];typeof i=="function"?i():yo(e[r],null)}}}}function Qm(...e){return f.useCallback(Zm(...e),e)}class eg extends f.Component{getSnapshotBeforeUpdate(t){const n=this.props.getElement();if(An(n)&&t.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const s=n.offsetParent,r=An(s)&&s.offsetWidth||0,i=An(s)&&s.offsetHeight||0,o=getComputedStyle(n),a=this.props.sizeRef.current;a.height=parseFloat(o.height),a.width=parseFloat(o.width),a.top=n.offsetTop,a.left=n.offsetLeft,a.right=r-a.width-a.left,a.bottom=i-a.height-a.top,a.direction=o.direction}return null}componentDidUpdate(){}render(){return this.props.children}}function tg({children:e,isPresent:t,anchorX:n,anchorY:s,root:r,pop:i,popNode:o}){var p;const a=f.useId(),c=f.useRef(null),u=f.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:d}=f.useContext(Pe),h=i!==!1?((p=e.props)==null?void 0:p.ref)??(e==null?void 0:e.ref):void 0,m=Qm(c,h),g=()=>{var x;return c.current||((x=o==null?void 0:o.current)==null?void 0:x.current)};return f.useInsertionEffect(()=>{const{width:x,height:y,top:b,left:k,right:v,bottom:S,direction:w}=u.current,M=g();if(t||i===!1||!M||!x||!y)return;const T=w==="rtl",C=n==="left"?T?`right: ${v}`:`left: ${k}`:T?`left: ${k}`:`right: ${v}`,j=s==="bottom"?`bottom: ${S}`:`top: ${b}`;M.dataset.motionPopId=a;const E=M.ownerDocument,P=E.createElement("style");d&&(P.nonce=d);const $=r??E.head;return $.appendChild(P),P.sheet&&P.sheet.insertRule(`
|
|
239
|
+
[data-motion-pop-id="${a}"] {
|
|
240
|
+
position: absolute !important;
|
|
241
|
+
width: ${x}px !important;
|
|
242
|
+
height: ${y}px !important;
|
|
243
|
+
${C}px !important;
|
|
244
|
+
${j}px !important;
|
|
245
|
+
}
|
|
246
|
+
`),()=>{M.removeAttribute("data-motion-pop-id"),$.contains(P)&&$.removeChild(P)}},[t]),l.jsx(eg,{isPresent:t,getElement:g,sizeRef:u,pop:i,children:i===!1?e:f.cloneElement(e,{ref:m})})}const ng=({children:e,initial:t,isPresent:n,onExitComplete:s,custom:r,presenceAffectsLayout:i,mode:o,anchorX:a,anchorY:c,root:u})=>{const d=Nt(sg),h=f.useId(),m=f.useRef(),g=f.useRef(n),p=f.useRef(s);Kt(()=>{g.current=n,p.current=s});let x=!0,y=f.useMemo(()=>(x=!1,{id:h,initial:t,isPresent:n,custom:r,onExitComplete:b=>{d.set(b,!0);for(const k of d.values())if(!k)return;s&&s()},register:(b,k)=>{var v,S;return d.set(b,!1),k&&((S=(v=k.parent)==null?void 0:v.presenceContext)==null?void 0:S.id)!==h&&(m.current=k),()=>{var w;d.delete(b),!g.current&&!d.size&&((w=p.current)==null||w.call(p))}}}),[n,d,s]);return i&&x&&(y={...y}),f.useMemo(()=>{d.forEach((b,k)=>d.set(k,!1))},[n]),f.useEffect(()=>{!n&&!d.size&&s&&s()},[n]),e=l.jsx(tg,{pop:o==="popLayout",isPresent:n,anchorX:a,anchorY:c,root:u,popNode:m,children:e}),l.jsx(cn.Provider,{value:y,children:e})};function sg(){return new Map}function rg(e=!0){const t=f.useContext(cn);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:s,register:r}=t,i=f.useId();f.useEffect(()=>{if(e)return r(i)},[e]);const o=f.useCallback(()=>e&&s&&s(i),[i,s,e]);return!n&&s?[!1,o]:[!0]}function hs(){return ig(f.useContext(cn))}function ig(e){return e===null?!0:e.isPresent}const It=e=>e.key||"";function xo(e){const t=[];return f.Children.forEach(e,n=>{f.isValidElement(n)&&t.push(n)}),t}const $e=({children:e,custom:t,initial:n=!0,onExitComplete:s,presenceAffectsLayout:r=!0,mode:i="sync",propagate:o=!1,anchorX:a="left",anchorY:c="top",root:u})=>{const[d,h]=rg(o),m=f.useMemo(()=>xo(e),[e]),g=o&&!d?[]:m.map(It),p=f.useRef(!0),x=Nt(()=>new Map),y=f.useRef(new Set),[b,k]=f.useState(m),[v,S]=f.useState(m);Kt(()=>{o&&!d&&!v.length&&(h==null||h())},[d,o,v.length,h]);const w=f.useRef();f.useEffect(()=>()=>{const C=w.current;w.current=void 0,C==null||C()},[v]),Kt(()=>{p.current=!1;for(let C=0;C<v.length;C++){const j=It(v[C]);g.includes(j)?(x.delete(j),y.current.delete(j)):x.get(j)!==!0&&x.set(j,!1)}},[v,g.length,g.join("-")]);const M=[];if(m!==b){let C=[...m],j=0;for(const E of v){const P=g.indexOf(It(E));P===-1?(C.splice(j++,0,E),M.push(E)):j=P+M.length+1}return M.every(E=>x.get(It(E)))?C=m:i==="wait"&&(C=M),S(xo(C)),k(m),null}const{forceRender:T}=f.useContext(Ua);return l.jsx(l.Fragment,{children:v.map(C=>{const j=It(C),E=o&&!d?!1:m===v||g.includes(j),P=()=>{if(y.current.has(j))return;if(x.has(j))y.current.add(j),x.set(j,!0);else return;let $=!0;x.forEach(N=>{N||($=!1)}),$&&(T==null||T(),k([]),o&&(h==null||h()),w.current=s)};return l.jsx(ng,{isPresent:E,initial:!p.current||n?void 0:!1,custom:t,presenceAffectsLayout:r,mode:i,root:u,onExitComplete:E?void 0:P,anchorX:a,anchorY:c,children:C},j)})})},di=f.createContext({strict:!1}),bo={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let vo=!1;function og(){if(vo)return;const e={};for(const t in bo)e[t]={isEnabled:n=>bo[t].some(s=>!!n[s])};Kl(e),vo=!0}function sc(){return og(),Om()}function wo(e){const t=sc();for(const n in e)t[n]={...t[n],...e[n]};Kl(t)}function hn({children:e,features:t,strict:n=!1}){const[,s]=f.useState(!$s(t)),r=f.useRef(void 0);if(!$s(t)){const{renderer:i,...o}=t;r.current=i,wo(o)}return f.useEffect(()=>{$s(t)&&t().then(({renderer:i,...o})=>{wo(o),r.current=i,s(!0)})},[]),l.jsx(di.Provider,{value:{renderer:r.current,strict:n},children:e})}function $s(e){return typeof e=="function"}function ag({children:e,...t}){const n=f.useContext(Pe);t={...n,...t},t.transition=ri(t.transition,n.transition),t.isStatic=Nt(()=>t.isStatic);const s=f.useMemo(()=>t,[JSON.stringify(t.transition),t.transformPagePoint,t.reducedMotion,t.skipAnimations,t.isValidProp]);return l.jsx(Pe.Provider,{value:s,children:e})}const ps=f.createContext({});function lg(e,t){if(fs(e)){const{initial:n,animate:s}=e;return{initial:n===!1||en(n)?n:void 0,animate:en(s)?s:void 0}}return e.inherit!==!1?t:{}}function cg(e){const{initial:t,animate:n}=lg(e,f.useContext(ps));return f.useMemo(()=>({initial:t,animate:n}),[So(t),So(n)])}function So(e){return Array.isArray(e)?e.join(" "):e}const fi=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function rc(e,t,n){for(const s in t)!pe(t[s])&&!Gl(s,n)&&(e[s]=t[s])}function ug({transformTemplate:e},t){return f.useMemo(()=>{const n=fi();return oi(n,t,e),Object.assign({},n.vars,n.style)},[t])}function dg(e,t){const n=e.style||{},s={};return rc(s,n,e),Object.assign(s,ug(e,t)),s}function fg(e,t){const n={},s=dg(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=s,n}const ic=()=>({...fi(),attrs:{}});function hg(e,t,n,s){const r=f.useMemo(()=>{const i=ic();return Vl(i,t,ec(s),e.transformTemplate,e.style),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};rc(i,e.style,e),r.style={...i,...r.style}}return r}const pg=new Set(["animate","exit","variants","initial","style","values","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function Qn(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||pg.has(e)}function mg(e,t){return e.startsWith("on")?!Qn(e):(t==null?void 0:t(e))??!Qn(e)}function gg(e,t,n,s){const r={};for(const i in e)i==="values"&&typeof e.values=="object"||pe(e[i])||(mg(i,s)||n===!0&&Qn(i)||!t&&!Qn(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}const yg=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function hi(e){return typeof e!="string"||e.includes("-")?!1:!!(yg.indexOf(e)>-1||/[A-Z]/u.test(e))}function xg(e,t,n,{latestValues:s},r,i=!1,o,a){const u=(o??hi(e)?hg:fg)(t,s,r,e),d=gg(t,typeof e=="string",i,a),h=e!==f.Fragment?{...d,...u,ref:n}:{},{children:m}=t,g=f.useMemo(()=>pe(m)?m.get():m,[m]);return f.createElement(e,{...h,children:g})}function bg({scrapeMotionValuesFromProps:e,createRenderState:t},n,s,r){return{latestValues:vg(n,s,r,e),renderState:t()}}function vg(e,t,n,s){const r={},i=s(e,{});for(const m in i)r[m]=Lm(i[m]);let{initial:o,animate:a}=e;const c=fs(e),u=Hl(e);t&&u&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),a===void 0&&(a=t.animate));let d=n?n.initial===!1:!1;d=d||o===!1;const h=d?a:o;if(h&&typeof h!="boolean"&&!ds(h)){const m=Array.isArray(h)?h:[h];for(let g=0;g<m.length;g++){const p=Pl(e,m[g]);if(p){const{transitionEnd:x,transition:y,...b}=p;for(const k in b){let v=b[k];if(Array.isArray(v)){const S=d?v.length-1:0;v=v[S]}v!==null&&(r[k]=v)}for(const k in x)r[k]=x[k]}}}return r}const oc=e=>(t,n)=>{const s=f.useContext(ps),r=f.useContext(cn),i=()=>bg(e,t,s,r);return n?i():Nt(i)},wg=oc({scrapeMotionValuesFromProps:ci,createRenderState:fi}),Sg=oc({scrapeMotionValuesFromProps:tc,createRenderState:ic}),Cg=Symbol.for("motionComponentSymbol");function kg(e,t,n){const s=f.useRef(n);f.useInsertionEffect(()=>{s.current=n});const r=f.useRef(null);return f.useCallback(i=>{var a;i&&((a=e.onMount)==null||a.call(e,i)),t&&(i?t.mount(i):t.unmount());const o=s.current;if(typeof o=="function")if(i){const c=o(i);typeof c=="function"&&(r.current=c)}else r.current?(r.current(),r.current=null):o(i);else o&&(o.current=i)},[t])}const jg=f.createContext({});function Eg(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Tg(e,t,n,s,r,i){var v,S;const{visualElement:o}=f.useContext(ps),a=f.useContext(di),c=f.useContext(cn),u=f.useContext(Pe),d=u.reducedMotion,h=u.skipAnimations,m=f.useRef(null),g=f.useRef(!1);s=s||a.renderer,!m.current&&s&&(m.current=s(e,{visualState:t,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:d,skipAnimations:h,isSVG:i}),g.current&&m.current&&(m.current.manuallyAnimateOnMount=!0));const p=m.current,x=f.useContext(jg);p&&!p.projection&&r&&(p.type==="html"||p.type==="svg")&&Ng(m.current,n,r,x);const y=f.useRef(!1);f.useInsertionEffect(()=>{p&&y.current&&p.update(n,c)});const b=n[_l],k=f.useRef(!!b&&typeof window<"u"&&!((v=window.MotionHandoffIsComplete)!=null&&v.call(window,b))&&((S=window.MotionHasOptimisedAnimation)==null?void 0:S.call(window,b)));return Kt(()=>{var w;!g.current||!p||((w=p.animationState)==null||w.animateChanges(),p.enteringChildren=void 0)},[]),Kt(()=>{g.current=!0,p&&(y.current=!0,window.MotionIsMounted=!0,p.updateFeatures(),p.scheduleRenderMicrotask(),k.current&&p.animationState&&p.animationState.animateChanges())}),f.useEffect(()=>{p&&(!k.current&&p.animationState&&p.animationState.animateChanges(),k.current&&(queueMicrotask(()=>{var w;(w=window.MotionHandoffMarkAsComplete)==null||w.call(window,b)}),k.current=!1),p.enteringChildren=void 0)}),p}function Ng(e,t,n,s){const{layoutId:r,layout:i,drag:o,dragConstraints:a,layoutScroll:c,layoutRoot:u,layoutAnchor:d,layoutCrossfade:h}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:ac(e.parent)),e.projection.setOptions({layoutId:r,layout:i,alwaysMeasureLayout:!!o||a&&Eg(a),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:s,crossfade:h,layoutScroll:c,layoutRoot:u,layoutAnchor:d})}function ac(e){if(e)return e.options.allowProjection!==!1?e.projection:ac(e.parent)}function Rg(e,{forwardMotionProps:t=!1,type:n}={},s,r){const i=n?n==="svg":hi(e),o=i?Sg:wg;function a(u,d){let h;const m={...f.useContext(Pe),...u,layoutId:Mg(u)},{isStatic:g,isValidProp:p}=m,x=cg(u),y=o(u,g);if(!g&&typeof window<"u"){Ag();const b=Lg(m);h=b.MeasureLayout,x.visualElement=Tg(e,y,m,r,b.ProjectionNode,i)}return l.jsxs(ps.Provider,{value:x,children:[h&&x.visualElement?l.jsx(h,{visualElement:x.visualElement,...m}):null,xg(e,u,kg(y,x.visualElement,d),y,g,t,i,p)]})}a.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const c=f.forwardRef(a);return c[Cg]=e,c}function Mg({layoutId:e}){const t=f.useContext(Ua).id;return t&&e!==void 0?t+"-"+e:e}function Ag(e,t){f.useContext(di).strict}function Lg(e){const t=sc(),{drag:n,layout:s}=t;if(!n&&!s)return{};const r={...n,...s};return{MeasureLayout:n!=null&&n.isEnabled(e)||s!=null&&s.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}const Ig=(e,t)=>t.isSVG??hi(e)?new Gm(t):new Dm(t,{allowProjection:e!==f.Fragment});class Pg extends Mt{constructor(t){super(t),t.animationState||(t.animationState=Jm(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();ds(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let $g=0;class Og extends Mt{constructor(){super(...arguments),this.id=$g++}update(){var c;const{presenceContext:t,prevPresenceContext:n,animationState:s}=this.node;if(!t||!s)return;const{isPresent:r,onExitComplete:i}=t,o=n==null?void 0:n.isPresent;if(r===o)return;if(r&&o===!1){if(this.exit===!0){const{initial:u}=this.node.getProps();if(u&&!Array.isArray(u)){const{transition:d,transitionEnd:h,...m}=it(this.node,u)||{};for(const g in m)(c=this.node.getValue(g))==null||c.jump(m[g])}this.node.blockInitialAnimation=!1,s.reset(),s.animateChanges()}else s.setActive("exit",!1);this.exit=void 0;return}const a=this.exit=s.setActive("exit",!r);i&&!r&&a.then(()=>{this.exit===a&&(this.exit=!0,i(this.id))})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id,this.node))}unmount(){}}const _g={animation:{Feature:Pg},exit:{Feature:Og}};function Co(e,t,n){const{props:s}=e;e.animationState&&s.whileHover&&e.animationState.setActive("whileHover",n==="Start");const r="onHover"+n,i=s[r];i&&xe.postRender(()=>i(t,ui(t)))}class Fg extends Mt{mount(){const{current:t}=this.node;t&&(this.unmount=Um(t,(n,s)=>(Co(this.node,s,"Start"),r=>Co(this.node,r,"End"))))}unmount(){}}class Dg extends Mt{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=us(lo(this.node.current,"focus",()=>this.onFocus()),lo(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function ko(e,t,n){const{props:s}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&s.whileTap&&e.animationState.setActive("whileTap",n==="Start");const r="onTap"+(n==="End"?"":n),i=s[r];i&&xe.postRender(()=>i(t,ui(t)))}class Vg extends Mt{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:s}=this.node.props;this.unmount=Wm(t,(r,i)=>(ko(this.node,i,"Start"),(o,{success:a})=>ko(this.node,o,a?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(s==null?void 0:s.tap)===!1})}unmount(){}}const xr=new WeakMap,Os=new WeakMap,Bg=e=>{const t=xr.get(e.target);t&&t(e)},zg=e=>{e.forEach(Bg)};function Hg({root:e,...t}){const n=e||document;Os.has(n)||Os.set(n,{});const s=Os.get(n),r=JSON.stringify(t);return s[r]||(s[r]=new IntersectionObserver(zg,{root:e,...t})),s[r]}function Ug(e,t,n){const s=Hg(t);return xr.set(e,n),s.observe(e),()=>{xr.delete(e),s.unobserve(e)}}const Kg={some:0,all:1};class Wg extends Mt{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var c;(c=this.stopObserver)==null||c.call(this);const{viewport:t={}}=this.node.getProps(),{root:n,margin:s,amount:r="some",once:i}=t,o={root:n?n.current:void 0,rootMargin:s,threshold:typeof r=="number"?r:Kg[r]},a=u=>{const{isIntersecting:d}=u;if(this.isInView===d||(this.isInView=d,i&&!d&&this.hasEnteredView))return;d&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",d);const{onViewportEnter:h,onViewportLeave:m}=this.node.getProps(),g=d?h:m;g&&g(u)};this.stopObserver=Ug(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(qg(t,n))&&this.startObserver()}unmount(){var t;(t=this.stopObserver)==null||t.call(this),this.hasEnteredView=!1,this.isInView=!1}}function qg({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const Gg={inView:{Feature:Wg},tap:{Feature:Vg},focus:{Feature:Dg},hover:{Feature:Fg}},ms={renderer:Ig,..._g,...Gg};function Yg(e){const t=Nt(()=>Qt(e)),{isStatic:n}=f.useContext(Pe);if(n){const[,s]=f.useState(e);f.useEffect(()=>t.on("change",s),[])}return t}function pn(){!li.current&&Ul();const[e]=f.useState(Xn.current);return e}class Jg{constructor(){this.componentControls=new Set}subscribe(t){return this.componentControls.add(t),()=>this.componentControls.delete(t)}start(t,n){this.componentControls.forEach(s=>{s.start(t.nativeEvent||t,n)})}cancel(){this.componentControls.forEach(t=>{t.cancel()})}stop(){this.componentControls.forEach(t=>{t.stop()})}}const Xg=()=>new Jg;function Zg(){return Nt(Xg)}function Qg(){f.useEffect(()=>{const e=window.visualViewport;if(!e)return;const t=document.documentElement;function n(){if(!e)return;window.innerHeight-e.height>1?(t.style.setProperty("--app-viewport-height",`${e.height}px`),t.style.setProperty("--app-viewport-top",`${e.offsetTop}px`),window.scrollY>0&&window.scrollTo(0,0)):(t.style.removeProperty("--app-viewport-height"),t.style.removeProperty("--app-viewport-top"))}return n(),e.addEventListener("resize",n),e.addEventListener("scroll",n),()=>{e.removeEventListener("resize",n),e.removeEventListener("scroll",n),t.style.removeProperty("--app-viewport-height"),t.style.removeProperty("--app-viewport-top")}},[])}function Q({variant:e="ghost",size:t="regular",loading:n=!1,disabled:s,type:r="button",className:i="",children:o,...a}){return l.jsxs("button",{...a,type:r,disabled:s||n,"aria-busy":n||a["aria-busy"]||void 0,className:`ui-button ui-button--${e} ui-button--${t} ${i}`,children:[n&&l.jsx(Le,{size:16,className:"animate-spin shrink-0","aria-hidden":"true"}),o]})}function pi({invalid:e,className:t="",...n}){return l.jsx("input",{...n,"aria-invalid":e||n["aria-invalid"]||void 0,className:`ui-field ${t}`})}function e0({invalid:e,className:t="",...n}){return l.jsx("textarea",{...n,"aria-invalid":e||n["aria-invalid"]||void 0,className:`ui-field ui-field--multiline ${t}`})}function t0({invalid:e,className:t="",...n}){return l.jsx("select",{...n,"aria-invalid":e||n["aria-invalid"]||void 0,className:`ui-field ${t}`})}function br({label:e,htmlFor:t,children:n}){return l.jsxs("div",{className:"ui-form-field",children:[l.jsx("label",{htmlFor:t,className:"ui-field-label",children:e}),n]})}const W=e=>typeof e=="string",Pt=()=>{let e,t;const n=new Promise((s,r)=>{e=s,t=r});return n.resolve=e,n.reject=t,n},jo=e=>e==null?"":String(e),n0=(e,t,n)=>{e.forEach(s=>{t[s]&&(n[s]=t[s])})},s0=/###/g,Eo=e=>e&&e.includes("###")?e.replace(s0,"."):e,To=e=>!e||W(e),Dt=(e,t,n)=>{const s=W(t)?t.split("."):t;let r=0;for(;r<s.length-1;){if(To(e))return{};const i=Eo(s[r]);!e[i]&&n&&(e[i]=new n),Object.prototype.hasOwnProperty.call(e,i)?e=e[i]:e={},++r}return To(e)?{}:{obj:e,k:Eo(s[r])}},No=(e,t,n)=>{const{obj:s,k:r}=Dt(e,t,Object);if(s!==void 0||t.length===1){s[r]=n;return}let i=t[t.length-1],o=t.slice(0,t.length-1),a=Dt(e,o,Object);for(;a.obj===void 0&&o.length;)i=`${o[o.length-1]}.${i}`,o=o.slice(0,o.length-1),a=Dt(e,o,Object),a!=null&&a.obj&&typeof a.obj[`${a.k}.${i}`]<"u"&&(a.obj=void 0);a.obj[`${a.k}.${i}`]=n},r0=(e,t,n,s)=>{const{obj:r,k:i}=Dt(e,t,Object);r[i]=r[i]||[],r[i].push(n)},es=(e,t)=>{const{obj:n,k:s}=Dt(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,s))return n[s]},i0=(e,t,n)=>{const s=es(e,n);return s!==void 0?s:es(t,n)},lc=(e,t,n)=>{for(const s in t)s!=="__proto__"&&s!=="constructor"&&(s in e?W(e[s])||e[s]instanceof String||W(t[s])||t[s]instanceof String?n&&(e[s]=t[s]):lc(e[s],t[s],n):e[s]=t[s]);return e},_e=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),o0={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},a0=e=>W(e)?e.replace(/[&<>"'\/]/g,t=>o0[t]):e;class l0{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const n=this.regExpMap.get(t);if(n!==void 0)return n;const s=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,s),this.regExpQueue.push(t),s}}const c0=[" ",",","?","!",";"],u0=new l0(20),d0=(e,t,n)=>{t=t||"",n=n||"";const s=c0.filter(o=>!t.includes(o)&&!n.includes(o));if(s.length===0)return!0;const r=u0.getRegExp(`(${s.map(o=>o==="?"?"\\?":o).join("|")})`);let i=!r.test(e);if(!i){const o=e.indexOf(n);o>0&&!r.test(e.substring(0,o))&&(i=!0)}return i},vr=(e,t,n=".")=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;const s=t.split(n);let r=e;for(let i=0;i<s.length;){if(!r||typeof r!="object")return;let o,a="";for(let c=i;c<s.length;++c)if(c!==i&&(a+=n),a+=s[c],o=r[a],o!==void 0){if(["string","number","boolean"].includes(typeof o)&&c<s.length-1)continue;i+=c-i+1;break}r=o}return r},tn=e=>e==null?void 0:e.replace(/_/g,"-"),f0={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){var n,s;(s=(n=console==null?void 0:console[e])==null?void 0:n.apply)==null||s.call(n,console,t)}};class ts{constructor(t,n={}){this.init(t,n)}init(t,n={}){this.prefix=n.prefix||"i18next:",this.logger=t||f0,this.options=n,this.debug=n.debug}log(...t){return this.forward(t,"log","",!0)}warn(...t){return this.forward(t,"warn","",!0)}error(...t){return this.forward(t,"error","")}deprecate(...t){return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(t,n,s,r){return r&&!this.debug?null:(t=t.map(i=>W(i)?i.replace(/[\r\n\x00-\x1F\x7F]/g," "):i),W(t[0])&&(t[0]=`${s}${this.prefix} ${t[0]}`),this.logger[n](t))}create(t){return new ts(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new ts(this.logger,t)}}var Te=new ts;class gs{constructor(){this.observers={}}on(t,n){return t.split(" ").forEach(s=>{this.observers[s]||(this.observers[s]=new Map);const r=this.observers[s].get(n)||0;this.observers[s].set(n,r+1)}),this}off(t,n){if(this.observers[t]){if(!n){delete this.observers[t];return}this.observers[t].delete(n)}}once(t,n){const s=(...r)=>{n(...r),this.off(t,s)};return this.on(t,s),this}emit(t,...n){this.observers[t]&&Array.from(this.observers[t].entries()).forEach(([r,i])=>{for(let o=0;o<i;o++)r(...n)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([r,i])=>{for(let o=0;o<i;o++)r(t,...n)})}}class Ro extends gs{constructor(t,n={ns:["translation"],defaultNS:"translation"}){super(),this.data=t||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.includes(t)||this.options.ns.push(t)}removeNamespaces(t){const n=this.options.ns.indexOf(t);n>-1&&this.options.ns.splice(n,1)}getResource(t,n,s,r={}){var u,d;const i=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator,o=r.ignoreJSONStructure!==void 0?r.ignoreJSONStructure:this.options.ignoreJSONStructure;let a;t.includes(".")?a=t.split("."):(a=[t,n],s&&(Array.isArray(s)?a.push(...s):W(s)&&i?a.push(...s.split(i)):a.push(s)));const c=es(this.data,a);return!c&&!n&&!s&&t.includes(".")&&(t=a[0],n=a[1],s=a.slice(2).join(".")),c||!o||!W(s)?c:vr((d=(u=this.data)==null?void 0:u[t])==null?void 0:d[n],s,i)}addResource(t,n,s,r,i={silent:!1}){const o=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator;let a=[t,n];s&&(a=a.concat(o?s.split(o):s)),t.includes(".")&&(a=t.split("."),r=n,n=a[1]),this.addNamespaces(n),No(this.data,a,r),i.silent||this.emit("added",t,n,s,r)}addResources(t,n,s,r={silent:!1}){for(const i in s)(W(s[i])||Array.isArray(s[i]))&&this.addResource(t,n,i,s[i],{silent:!0});r.silent||this.emit("added",t,n,s)}addResourceBundle(t,n,s,r,i,o={silent:!1,skipCopy:!1}){let a=[t,n];t.includes(".")&&(a=t.split("."),r=s,s=n,n=a[1]),this.addNamespaces(n);let c=es(this.data,a)||{};o.skipCopy||(s=JSON.parse(JSON.stringify(s))),r?lc(c,s,i):c={...c,...s},No(this.data,a,c),o.silent||this.emit("added",t,n,s)}removeResourceBundle(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}hasResourceBundle(t,n){return this.getResource(t,n)!==void 0}getResourceBundle(t,n){return n||(n=this.options.defaultNS),this.getResource(t,n)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(r=>n[r]&&Object.keys(n[r]).length>0)}toJSON(){return this.data}}var cc={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,s,r){return e.forEach(i=>{var o;t=((o=this.processors[i])==null?void 0:o.process(t,n,s,r))??t}),t}};const uc=Symbol("i18next/PATH_KEY");function h0(){const e=[],t=Object.create(null);let n;return t.get=(s,r)=>{var i;return(i=n==null?void 0:n.revoke)==null||i.call(n),r===uc?e:(e.push(r),n=Proxy.revocable(s,t),n.proxy)},Proxy.revocable(Object.create(null),t).proxy}function ot(e,t){const{[uc]:n}=e(h0()),s=(t==null?void 0:t.keySeparator)??".",r=(t==null?void 0:t.nsSeparator)??":",i=(t==null?void 0:t.enableSelector)==="strict";if(n.length>1&&r){const o=t==null?void 0:t.ns,a=i?Array.isArray(o)?o:o?[o]:null:Array.isArray(o)?o:null;if(a&&(i?a:a.length>1?a.slice(1):[]).includes(n[0]))return`${n[0]}${r}${n.slice(1).join(s)}`}return n.join(s)}const _s=e=>!W(e)&&typeof e!="boolean"&&typeof e!="number";class ns extends gs{constructor(t,n={}){super(),n0(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Te.create("translator"),this.checkedLoadedFor={}}changeLanguage(t){t&&(this.language=t)}exists(t,n={interpolation:{}}){const s={...n};if(t==null)return!1;const r=this.resolve(t,s);if((r==null?void 0:r.res)===void 0)return!1;const i=_s(r.res);return!(s.returnObjects===!1&&i)}extractFromKey(t,n){let s=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;s===void 0&&(s=":");const r=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let i=n.ns||this.options.defaultNS||[];const o=s&&t.includes(s),a=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!d0(t,s,r);if(o&&!a){const c=t.match(this.interpolator.nestingRegexp);if(c&&c.length>0)return{key:t,namespaces:W(i)?[i]:i};const u=t.split(s);(s!==r||s===r&&this.options.ns.includes(u[0]))&&(i=u.shift()),t=u.join(r)}return{key:t,namespaces:W(i)?[i]:i}}translate(t,n,s){let r=typeof n=="object"?{...n}:n;if(typeof r!="object"&&this.options.overloadTranslationOptionHandler&&(r=this.options.overloadTranslationOptionHandler(arguments)),typeof r=="object"&&(r={...r}),r||(r={}),t==null)return"";typeof t=="function"&&(t=ot(t,{...this.options,...r})),Array.isArray(t)||(t=[String(t)]),t=t.map(N=>typeof N=="function"?ot(N,{...this.options,...r}):String(N));const i=r.returnDetails!==void 0?r.returnDetails:this.options.returnDetails,o=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator,{key:a,namespaces:c}=this.extractFromKey(t[t.length-1],r),u=c[c.length-1];let d=r.nsSeparator!==void 0?r.nsSeparator:this.options.nsSeparator;d===void 0&&(d=":");const h=r.lng||this.language,m=r.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((h==null?void 0:h.toLowerCase())==="cimode")return m?i?{res:`${u}${d}${a}`,usedKey:a,exactUsedKey:a,usedLng:h,usedNS:u,usedParams:this.getUsedParamsDetails(r)}:`${u}${d}${a}`:i?{res:a,usedKey:a,exactUsedKey:a,usedLng:h,usedNS:u,usedParams:this.getUsedParamsDetails(r)}:a;const g=this.resolve(t,r);let p=g==null?void 0:g.res;const x=(g==null?void 0:g.usedKey)||a,y=(g==null?void 0:g.exactUsedKey)||a,b=["[object Number]","[object Function]","[object RegExp]"],k=r.joinArrays!==void 0?r.joinArrays:this.options.joinArrays,v=!this.i18nFormat||this.i18nFormat.handleAsObject,S=r.count!==void 0&&!W(r.count),w=ns.hasDefaultValue(r),M=S?this.pluralResolver.getSuffix(h,r.count,r):"",T=r.ordinal&&S?this.pluralResolver.getSuffix(h,r.count,{ordinal:!1}):"",C=S&&!r.ordinal&&r.count===0,j=C&&r[`defaultValue${this.options.pluralSeparator}zero`]||r[`defaultValue${M}`]||r[`defaultValue${T}`]||r.defaultValue;let E=p;v&&!p&&w&&(E=j);const P=_s(E),$=Object.prototype.toString.apply(E);if(v&&E&&P&&!b.includes($)&&!(W(k)&&Array.isArray(E))){if(!r.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const N=this.options.returnedObjectHandler?this.options.returnedObjectHandler(x,E,{...r,ns:c}):`key '${a} (${this.language})' returned an object instead of string.`;return i?(g.res=N,g.usedParams=this.getUsedParamsDetails(r),g):N}if(o){const N=Array.isArray(E),R=N?[]:{},I=N?y:x;for(const L in E)if(Object.prototype.hasOwnProperty.call(E,L)){const O=`${I}${o}${L}`;w&&!p?R[L]=this.translate(O,{...r,defaultValue:_s(j)?j[L]:void 0,joinArrays:!1,ns:c}):R[L]=this.translate(O,{...r,joinArrays:!1,ns:c}),R[L]===O&&(R[L]=E[L])}p=R}}else if(v&&W(k)&&Array.isArray(p))p=p.join(k),p&&(p=this.extendTranslation(p,t,r,s));else{let N=!1,R=!1;!this.isValidLookup(p)&&w&&(N=!0,p=j),this.isValidLookup(p)||(R=!0,p=a);const L=(r.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&R?void 0:p,O=w&&j!==p&&this.options.updateMissing;if(R||N||O){if(this.logger.log(O?"updateKey":"missingKey",h,u,S&&!O?`${a}${this.pluralResolver.getSuffix(h,r.count,r)}`:a,O?j:p),o){const A=this.resolve(a,{...r,keySeparator:!1});A&&A.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let _=[];const U=this.languageUtils.getFallbackCodes(this.options.fallbackLng,r.lng||this.language);if(this.options.saveMissingTo==="fallback"&&U&&U[0])for(let A=0;A<U.length;A++)_.push(U[A]);else this.options.saveMissingTo==="all"?_=this.languageUtils.toResolveHierarchy(r.lng||this.language):_.push(r.lng||this.language);const F=(A,D,V)=>{var q;const z=w&&V!==p?V:L;this.options.missingKeyHandler?this.options.missingKeyHandler(A,u,D,z,O,r):(q=this.backendConnector)!=null&&q.saveMissing&&this.backendConnector.saveMissing(A,u,D,z,O,r),this.emit("missingKey",A,u,D,p)};this.options.saveMissing&&(this.options.saveMissingPlurals&&S?_.forEach(A=>{const D=this.pluralResolver.getSuffixes(A,r);C&&r[`defaultValue${this.options.pluralSeparator}zero`]&&!D.includes(`${this.options.pluralSeparator}zero`)&&D.push(`${this.options.pluralSeparator}zero`),D.forEach(V=>{F([A],a+V,r[`defaultValue${V}`]||j)})}):F(_,a,j))}p=this.extendTranslation(p,t,r,g,s),R&&p===a&&this.options.appendNamespaceToMissingKey&&(p=`${u}${d}${a}`),(R||N)&&this.options.parseMissingKeyHandler&&(p=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${u}${d}${a}`:a,N?p:void 0,r))}return i?(g.res=p,g.usedParams=this.getUsedParamsDetails(r),g):p}extendTranslation(t,n,s,r,i){var c,u;if((c=this.i18nFormat)!=null&&c.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...s},s.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!s.skipInterpolation){s.interpolation&&this.interpolator.init({...s,interpolation:{...this.options.interpolation,...s.interpolation}});const d=W(t)&&(((u=s==null?void 0:s.interpolation)==null?void 0:u.skipOnVariables)!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let h;if(d){const g=t.match(this.interpolator.nestingRegexp);h=g&&g.length}let m=s.replace&&!W(s.replace)?s.replace:s;if(this.options.interpolation.defaultVariables&&(m={...this.options.interpolation.defaultVariables,...m}),t=this.interpolator.interpolate(t,m,s.lng||this.language||r.usedLng,s),d){const g=t.match(this.interpolator.nestingRegexp),p=g&&g.length;h<p&&(s.nest=!1)}!s.lng&&r&&r.res&&(s.lng=this.language||r.usedLng),s.nest!==!1&&(t=this.interpolator.nest(t,(...g)=>(i==null?void 0:i[0])===g[0]&&!s.context?(this.logger.warn(`It seems you are nesting recursively key: ${g[0]} in key: ${n[0]}`),null):this.translate(...g,n),s)),s.interpolation&&this.interpolator.reset()}const o=s.postProcess||this.options.postProcess,a=W(o)?[o]:o;return t!=null&&(a!=null&&a.length)&&s.applyPostProcessor!==!1&&(t=cc.handle(a,t,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...r,usedParams:this.getUsedParamsDetails(s)},...s}:s,this)),t}resolve(t,n={}){let s,r,i,o,a;return W(t)&&(t=[t]),Array.isArray(t)&&(t=t.map(c=>typeof c=="function"?ot(c,{...this.options,...n}):c)),t.forEach(c=>{if(this.isValidLookup(s))return;const u=this.extractFromKey(c,n),d=u.key;r=d;let h=u.namespaces;this.options.fallbackNS&&(h=h.concat(this.options.fallbackNS));const m=n.count!==void 0&&!W(n.count),g=m&&!n.ordinal&&n.count===0,p=n.context!==void 0&&(W(n.context)||typeof n.context=="number")&&n.context!=="",x=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);h.forEach(y=>{var b,k;this.isValidLookup(s)||(a=y,!this.checkedLoadedFor[`${x[0]}-${y}`]&&((b=this.utils)!=null&&b.hasLoadedNamespace)&&!((k=this.utils)!=null&&k.hasLoadedNamespace(a))&&(this.checkedLoadedFor[`${x[0]}-${y}`]=!0,this.logger.warn(`key "${r}" for languages "${x.join(", ")}" won't get resolved as namespace "${a}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),x.forEach(v=>{var M;if(this.isValidLookup(s))return;o=v;const S=[d];if((M=this.i18nFormat)!=null&&M.addLookupKeys)this.i18nFormat.addLookupKeys(S,d,v,y,n);else{let T;m&&(T=this.pluralResolver.getSuffix(v,n.count,n));const C=`${this.options.pluralSeparator}zero`,j=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(m&&(n.ordinal&&T.startsWith(j)&&S.push(d+T.replace(j,this.options.pluralSeparator)),S.push(d+T),g&&S.push(d+C)),p){const E=`${d}${this.options.contextSeparator||"_"}${n.context}`;S.push(E),m&&(n.ordinal&&T.startsWith(j)&&S.push(E+T.replace(j,this.options.pluralSeparator)),S.push(E+T),g&&S.push(E+C))}}let w;for(;w=S.pop();)this.isValidLookup(s)||(i=w,s=this.getResource(v,y,w,n))}))})}),{res:s,usedKey:r,exactUsedKey:i,usedLng:o,usedNS:a}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,s,r={}){var i;return(i=this.i18nFormat)!=null&&i.getResource?this.i18nFormat.getResource(t,n,s,r):this.resourceStore.getResource(t,n,s,r)}getUsedParamsDetails(t={}){const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],s=t.replace&&!W(t.replace);let r=s?t.replace:t;if(s&&typeof t.count<"u"&&(r.count=t.count),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!s){r={...r};for(const i of n)delete r[i]}return r}static hasDefaultValue(t){const n="defaultValue";for(const s in t)if(Object.prototype.hasOwnProperty.call(t,s)&&s.startsWith(n)&&t[s]!==void 0)return!0;return!1}}class Mo{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Te.create("languageUtils")}getScriptPartFromCode(t){if(t=tn(t),!t||!t.includes("-"))return null;const n=t.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(t){if(t=tn(t),!t||!t.includes("-"))return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(W(t)&&t.includes("-")){let n;try{n=Intl.getCanonicalLocales(t)[0]}catch{}return n&&this.options.lowerCaseLng&&(n=n.toLowerCase()),n||(this.options.lowerCaseLng?t.toLowerCase():t)}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.includes(t)}getBestMatchFromCodes(t){if(!t)return null;let n;return t.forEach(s=>{if(n)return;const r=this.formatLanguageCode(s);(!this.options.supportedLngs||this.isSupportedCode(r))&&(n=r)}),!n&&this.options.supportedLngs&&t.forEach(s=>{if(n)return;const r=this.getScriptPartFromCode(s);if(this.isSupportedCode(r))return n=r;const i=this.getLanguagePartFromCode(s);if(this.isSupportedCode(i))return n=i;n=this.options.supportedLngs.find(o=>o===i?!0:!o.includes("-")&&!i.includes("-")?!1:!!(o.includes("-")&&!i.includes("-")&&o.slice(0,o.indexOf("-"))===i||o.startsWith(i)&&i.length>1))}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),W(t)&&(t=[t]),Array.isArray(t))return t;if(!n)return t.default||[];let s=t[n];return s||(s=t[this.getScriptPartFromCode(n)]),s||(s=t[this.formatLanguageCode(n)]),s||(s=t[this.getLanguagePartFromCode(n)]),s||(s=t.default),s||[]}toResolveHierarchy(t,n){const s=this.getFallbackCodes((n===!1?[]:n)||this.options.fallbackLng||[],t),r=[],i=o=>{o&&(this.isSupportedCode(o)?r.push(o):this.logger.warn(`rejecting language code not found in supportedLngs: ${o}`))};return W(t)&&(t.includes("-")||t.includes("_"))?(this.options.load!=="languageOnly"&&i(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&i(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&i(this.getLanguagePartFromCode(t))):W(t)&&i(this.formatLanguageCode(t)),s.forEach(o=>{r.includes(o)||i(this.formatLanguageCode(o))}),r}}const Ao={zero:0,one:1,two:2,few:3,many:4,other:5},Lo={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class p0{constructor(t,n={}){this.languageUtils=t,this.options=n,this.logger=Te.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(t,n={}){const s=tn(t==="dev"?"en":t),r=n.ordinal?"ordinal":"cardinal",i=JSON.stringify({cleanedCode:s,type:r});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let o;try{o=new Intl.PluralRules(s,{type:r})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl polyfill!"),Lo;if(!t.match(/-|_/))return Lo;const c=this.languageUtils.getLanguagePartFromCode(t);o=this.getRule(c,n)}return this.pluralRulesCache[i]=o,o}needsPlural(t,n={}){let s=this.getRule(t,n);return s||(s=this.getRule("dev",n)),(s==null?void 0:s.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(t,n,s={}){return this.getSuffixes(t,s).map(r=>`${n}${r}`)}getSuffixes(t,n={}){let s=this.getRule(t,n);return s||(s=this.getRule("dev",n)),s?s.resolvedOptions().pluralCategories.sort((r,i)=>Ao[r]-Ao[i]).map(r=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${r}`):[]}getSuffix(t,n,s={}){const r=this.getRule(t,s);return r?`${this.options.prepend}${s.ordinal?`ordinal${this.options.prepend}`:""}${r.select(n)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",n,s))}}const Io=(e,t,n,s=".",r=!0)=>{let i=i0(e,t,n);return!i&&r&&W(n)&&(i=vr(e,n,s),i===void 0&&(i=vr(t,n,s))),i},Fs=e=>e.replace(/\$/g,"$$$$");class Po{constructor(t={}){var n;this.logger=Te.create("interpolator"),this.options=t,this.format=((n=t==null?void 0:t.interpolation)==null?void 0:n.format)||(s=>s),this.init(t)}init(t={}){t.interpolation||(t.interpolation={escapeValue:!0});const{escape:n,escapeValue:s,useRawValueToEscape:r,prefix:i,prefixEscaped:o,suffix:a,suffixEscaped:c,formatSeparator:u,unescapeSuffix:d,unescapePrefix:h,nestingPrefix:m,nestingPrefixEscaped:g,nestingSuffix:p,nestingSuffixEscaped:x,nestingOptionsSeparator:y,maxReplaces:b,alwaysFormat:k}=t.interpolation;this.escape=n!==void 0?n:a0,this.escapeValue=s!==void 0?s:!0,this.useRawValueToEscape=r!==void 0?r:!1,this.prefix=i?_e(i):o||"{{",this.suffix=a?_e(a):c||"}}",this.formatSeparator=u||",",this.unescapePrefix=d?"":h?_e(h):"-",this.unescapeSuffix=this.unescapePrefix?"":d?_e(d):"",this.nestingPrefix=m?_e(m):g||_e("$t("),this.nestingSuffix=p?_e(p):x||_e(")"),this.nestingOptionsSeparator=y||",",this.maxReplaces=b||1e3,this.alwaysFormat=k!==void 0?k:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(n,s)=>(n==null?void 0:n.source)===s?(n.lastIndex=0,n):new RegExp(s,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(t,n,s,r){var g;let i,o,a;const c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=p=>{if(!p.includes(this.formatSeparator)){const k=Io(n,c,p,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(k,void 0,s,{...r,...n,interpolationkey:p}):k}const x=p.split(this.formatSeparator),y=x.shift().trim(),b=x.join(this.formatSeparator).trim();return this.format(Io(n,c,y,this.options.keySeparator,this.options.ignoreJSONStructure),b,s,{...r,...n,interpolationkey:y})};this.resetRegExp(),!this.escapeValue&&typeof t=="string"&&/\$t\([^)]*\{[^}]*\{\{/.test(t)&&this.logger.warn("nesting options string contains interpolated variables with escapeValue: false — if any of those values are attacker-controlled they can inject additional nesting options (e.g. redirect lng/ns). Sanitise untrusted input before passing it to t(), or keep escapeValue: true.");const d=(r==null?void 0:r.missingInterpolationHandler)||this.options.missingInterpolationHandler,h=((g=r==null?void 0:r.interpolation)==null?void 0:g.skipOnVariables)!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:p=>Fs(p)},{regex:this.regexp,safeValue:p=>this.escapeValue?Fs(this.escape(p)):Fs(p)}].forEach(p=>{for(a=0;i=p.regex.exec(t);){const x=i[1].trim();if(o=u(x),o===void 0)if(typeof d=="function"){const b=d(t,i,r);o=W(b)?b:""}else if(r&&Object.prototype.hasOwnProperty.call(r,x))o="";else if(h){o=i[0];continue}else this.logger.warn(`missed to pass in variable ${x} for interpolating ${t}`),o="";else!W(o)&&!this.useRawValueToEscape&&(o=jo(o));const y=p.safeValue(o);if(t=t.replace(i[0],y),h?(p.regex.lastIndex+=o.length,p.regex.lastIndex-=i[0].length):p.regex.lastIndex=0,a++,a>=this.maxReplaces)break}}),t}nest(t,n,s={}){let r,i,o;const a=(c,u)=>{const d=this.nestingOptionsSeparator;if(!c.includes(d))return c;const h=c.split(new RegExp(`${_e(d)}[ ]*{`));let m=`{${h[1]}`;c=h[0],m=this.interpolate(m,o);const g=m.match(/'/g),p=m.match(/"/g);(((g==null?void 0:g.length)??0)%2===0&&!p||((p==null?void 0:p.length)??0)%2!==0)&&(m=m.replace(/'/g,'"'));try{o=JSON.parse(m),u&&(o={...u,...o})}catch(x){return this.logger.warn(`failed parsing options string in nesting for key ${c}`,x),`${c}${d}${m}`}return o.defaultValue&&o.defaultValue.includes(this.prefix)&&delete o.defaultValue,c};for(;r=this.nestingRegexp.exec(t);){let c=[];o={...s},o=o.replace&&!W(o.replace)?o.replace:o,o.applyPostProcessor=!1,delete o.defaultValue;const u=/{.*}/.test(r[1])?r[1].lastIndexOf("}")+1:r[1].indexOf(this.formatSeparator);if(u!==-1&&(c=r[1].slice(u).split(this.formatSeparator).map(d=>d.trim()).filter(Boolean),r[1]=r[1].slice(0,u)),i=n(a.call(this,r[1].trim(),o),o),i&&r[0]===t&&!W(i))return i;W(i)||(i=jo(i)),i||(this.logger.warn(`missed to resolve ${r[1]} for nesting ${t}`),i=""),c.length&&(i=c.reduce((d,h)=>this.format(d,h,s.lng,{...s,interpolationkey:r[1].trim()}),i.trim())),t=t.replace(r[0],i),this.regexp.lastIndex=0}return t}}const m0=e=>{let t=e.toLowerCase().trim();const n={};if(e.includes("(")){const s=e.split("(");t=s[0].toLowerCase().trim();const r=s[1].slice(0,-1);t==="currency"&&!r.includes(":")?n.currency||(n.currency=r.trim()):t==="relativetime"&&!r.includes(":")?n.range||(n.range=r.trim()):r.split(";").forEach(o=>{if(o){const[a,...c]=o.split(":"),u=c.join(":").trim().replace(/^'+|'+$/g,""),d=a.trim();n[d]||(n[d]=u),u==="false"&&(n[d]=!1),u==="true"&&(n[d]=!0),isNaN(u)||(n[d]=parseInt(u,10))}})}return{formatName:t,formatOptions:n}},$o=e=>{const t={};return(n,s,r)=>{let i=r;r&&r.interpolationkey&&r.formatParams&&r.formatParams[r.interpolationkey]&&r[r.interpolationkey]&&(i={...i,[r.interpolationkey]:void 0});const o=s+JSON.stringify(i);let a=t[o];return a||(a=e(tn(s),r),t[o]=a),a(n)}},g0=e=>(t,n,s)=>e(tn(n),s)(t);class y0{constructor(t={}){this.logger=Te.create("formatter"),this.options=t,this.init(t)}init(t,n={interpolation:{}}){this.formatSeparator=n.interpolation.formatSeparator||",";const s=n.cacheInBuiltFormats?$o:g0;this.formats={number:s((r,i)=>{const o=new Intl.NumberFormat(r,{...i});return a=>o.format(a)}),currency:s((r,i)=>{const o=new Intl.NumberFormat(r,{...i,style:"currency"});return a=>o.format(a)}),datetime:s((r,i)=>{const o=new Intl.DateTimeFormat(r,{...i});return a=>o.format(a)}),relativetime:s((r,i)=>{const o=new Intl.RelativeTimeFormat(r,{...i});return a=>o.format(a,i.range||"day")}),list:s((r,i)=>{const o=new Intl.ListFormat(r,{...i});return a=>o.format(a)})}}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=$o(n)}format(t,n,s,r={}){if(!n||t==null)return t;const i=n.split(this.formatSeparator);if(i.length>1&&i[0].indexOf("(")>1&&!i[0].includes(")")&&i.find(a=>a.includes(")"))){const a=i.findIndex(c=>c.includes(")"));i[0]=[i[0],...i.splice(1,a)].join(this.formatSeparator)}return i.reduce((a,c)=>{var h;const{formatName:u,formatOptions:d}=m0(c);if(this.formats[u]){let m=a;try{const g=((h=r==null?void 0:r.formatParams)==null?void 0:h[r.interpolationkey])||{},p=g.locale||g.lng||r.locale||r.lng||s;m=this.formats[u](a,p,{...d,...r,...g})}catch(g){this.logger.warn(g)}return m}else this.logger.warn(`there was no format function for ${u}`);return a},t)}}const x0=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class b0 extends gs{constructor(t,n,s,r={}){var i,o;super(),this.backend=t,this.store=n,this.services=s,this.languageUtils=s.languageUtils,this.options=r,this.logger=Te.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],(o=(i=this.backend)==null?void 0:i.init)==null||o.call(i,s,r.backend,r)}queueLoad(t,n,s,r){const i={},o={},a={},c={};return t.forEach(u=>{let d=!0;n.forEach(h=>{const m=`${u}|${h}`;!s.reload&&this.store.hasResourceBundle(u,h)?this.state[m]=2:this.state[m]<0||(this.state[m]===1?o[m]===void 0&&(o[m]=!0):(this.state[m]=1,d=!1,o[m]===void 0&&(o[m]=!0),i[m]===void 0&&(i[m]=!0),c[h]===void 0&&(c[h]=!0)))}),d||(a[u]=!0)}),(Object.keys(i).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(i),pending:Object.keys(o),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(c)}}loaded(t,n,s){const r=t.split("|"),i=r[0],o=r[1];n&&this.emit("failedLoading",i,o,n),!n&&s&&this.store.addResourceBundle(i,o,s,void 0,void 0,{skipCopy:!0}),this.state[t]=n?-1:2,n&&s&&(this.state[t]=0);const a={};this.queue.forEach(c=>{r0(c.loaded,[i],o),x0(c,t),n&&c.errors.push(n),c.pendingCount===0&&!c.done&&(Object.keys(c.loaded).forEach(u=>{a[u]||(a[u]={});const d=c.loaded[u];d.length&&d.forEach(h=>{a[u][h]===void 0&&(a[u][h]=!0)})}),c.done=!0,c.errors.length?c.callback(c.errors):c.callback())}),this.emit("loaded",a),this.queue=this.queue.filter(c=>!c.done)}read(t,n,s,r=0,i=this.retryTimeout,o){if(!t.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:s,tried:r,wait:i,callback:o});return}this.readingCalls++;const a=(u,d)=>{if(this.readingCalls--,this.waitingReads.length>0){const h=this.waitingReads.shift();this.read(h.lng,h.ns,h.fcName,h.tried,h.wait,h.callback)}if(u&&d&&r<this.maxRetries){setTimeout(()=>{this.read(t,n,s,r+1,i*2,o)},i);return}o(u,d)},c=this.backend[s].bind(this.backend);if(c.length===2){try{const u=c(t,n);u&&typeof u.then=="function"?u.then(d=>a(null,d)).catch(a):a(null,u)}catch(u){a(u)}return}return c(t,n,a)}prepareLoading(t,n,s={},r){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),r&&r();W(t)&&(t=this.languageUtils.toResolveHierarchy(t)),W(n)&&(n=[n]);const i=this.queueLoad(t,n,s,r);if(!i.toLoad.length)return i.pending.length||r(),null;i.toLoad.forEach(o=>{this.loadOne(o)})}load(t,n,s){this.prepareLoading(t,n,{},s)}reload(t,n,s){this.prepareLoading(t,n,{reload:!0},s)}loadOne(t,n=""){const s=t.split("|"),r=s[0],i=s[1];this.read(r,i,"read",void 0,void 0,(o,a)=>{o&&this.logger.warn(`${n}loading namespace ${i} for language ${r} failed`,o),!o&&a&&this.logger.log(`${n}loaded namespace ${i} for language ${r}`,a),this.loaded(t,o,a)})}saveMissing(t,n,s,r,i,o={},a=()=>{}){var c,u,d,h,m;if((u=(c=this.services)==null?void 0:c.utils)!=null&&u.hasLoadedNamespace&&!((h=(d=this.services)==null?void 0:d.utils)!=null&&h.hasLoadedNamespace(n))){this.logger.warn(`did not save key "${s}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(s==null||s==="")){if((m=this.backend)!=null&&m.create){const g={...o,isUpdate:i},p=this.backend.create.bind(this.backend);if(p.length<6)try{let x;p.length===5?x=p(t,n,s,r,g):x=p(t,n,s,r),x&&typeof x.then=="function"?x.then(y=>a(null,y)).catch(a):a(null,x)}catch(x){a(x)}else p(t,n,s,r,a,g)}!t||!t[0]||this.store.addResource(t[0],n,s,r)}}}const Ds=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",enableSelector:!1,partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]=="object"&&(t=e[1]),W(e[1])&&(t.defaultValue=e[1]),W(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const n=e[3]||e[2];Object.keys(n).forEach(s=>{t[s]=n[s]})}return t},interpolation:{escapeValue:!0,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),Oo=e=>(W(e.ns)&&(e.ns=[e.ns]),W(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),W(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&!e.supportedLngs.includes("cimode")&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e),kn=()=>{},v0=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})};class Vt extends gs{constructor(t={},n){if(super(),this.options=Oo(t),this.services={},this.logger=Te,this.modules={external:[]},v0(this),n&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,n),this;setTimeout(()=>{this.init(t,n)},0)}}init(t={},n){this.isInitializing=!0,typeof t=="function"&&(n=t,t={}),t.defaultNS==null&&t.ns&&(W(t.ns)?t.defaultNS=t.ns:t.ns.includes("translation")||(t.defaultNS=t.ns[0]));const s=Ds();this.options={...s,...this.options,...Oo(t)},this.options.interpolation={...s.interpolation,...this.options.interpolation},t.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=t.keySeparator),t.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=t.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=s.overloadTranslationOptionHandler);const r=u=>u?typeof u=="function"?new u:u:null;if(!this.options.isClone){this.modules.logger?Te.init(r(this.modules.logger),this.options):Te.init(null,this.options);let u;this.modules.formatter?u=this.modules.formatter:u=y0;const d=new Mo(this.options);this.store=new Ro(this.options.resources,this.options);const h=this.services;h.logger=Te,h.resourceStore=this.store,h.languageUtils=d,h.pluralResolver=new p0(d,{prepend:this.options.pluralSeparator}),u&&(h.formatter=r(u),h.formatter.init&&h.formatter.init(h,this.options),this.options.interpolation.format=h.formatter.format.bind(h.formatter)),h.interpolator=new Po(this.options),h.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},h.backendConnector=new b0(r(this.modules.backend),h.resourceStore,h,this.options),h.backendConnector.on("*",(m,...g)=>{this.emit(m,...g)}),this.modules.languageDetector&&(h.languageDetector=r(this.modules.languageDetector),h.languageDetector.init&&h.languageDetector.init(h,this.options.detection,this.options)),this.modules.i18nFormat&&(h.i18nFormat=r(this.modules.i18nFormat),h.i18nFormat.init&&h.i18nFormat.init(this)),this.translator=new ns(this.services,this.options),this.translator.on("*",(m,...g)=>{this.emit(m,...g)}),this.modules.external.forEach(m=>{m.init&&m.init(this)})}if(this.format=this.options.interpolation.format,n||(n=kn),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const u=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);u.length>0&&u[0]!=="dev"&&(this.options.lng=u[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(u=>{this[u]=(...d)=>this.store[u](...d)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(u=>{this[u]=(...d)=>(this.store[u](...d),this)});const a=Pt(),c=()=>{const u=(d,h)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),a.resolve(h),n(d,h)};if((this.languages||this.isLanguageChangingTo)&&!this.isInitialized)return u(null,this.t.bind(this));this.changeLanguage(this.options.lng,u)};return this.options.resources||!this.options.initAsync?c():setTimeout(c,0),a}loadResources(t,n=kn){var i,o;let s=n;const r=W(t)?t:this.language;if(typeof t=="function"&&(s=t),!this.options.resources||this.options.partialBundledLanguages){if((r==null?void 0:r.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return s();const a=[],c=u=>{if(!u||u==="cimode")return;this.services.languageUtils.toResolveHierarchy(u).forEach(h=>{h!=="cimode"&&(a.includes(h)||a.push(h))})};r?c(r):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(d=>c(d)),(o=(i=this.options.preload)==null?void 0:i.forEach)==null||o.call(i,u=>c(u)),this.services.backendConnector.load(a,this.options.ns,u=>{!u&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),s(u)})}else s(null)}reloadResources(t,n,s){const r=Pt();return typeof t=="function"&&(s=t,t=void 0),typeof n=="function"&&(s=n,n=void 0),t||(t=this.languages),n||(n=this.options.ns),s||(s=kn),this.services.backendConnector.reload(t,n,i=>{r.resolve(),s(i)}),r}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&cc.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!["cimode","dev"].includes(t)){for(let n=0;n<this.languages.length;n++){const s=this.languages[n];if(!["cimode","dev"].includes(s)&&this.store.hasLanguageSomeTranslations(s)){this.resolvedLanguage=s;break}}!this.resolvedLanguage&&!this.languages.includes(t)&&this.store.hasLanguageSomeTranslations(t)&&(this.resolvedLanguage=t,this.languages.unshift(t))}}changeLanguage(t,n){this.isLanguageChangingTo=t;const s=Pt();this.emit("languageChanging",t);const r=a=>{this.language=a,this.languages=this.services.languageUtils.toResolveHierarchy(a),this.resolvedLanguage=void 0,this.setResolvedLanguage(a)},i=(a,c)=>{c?this.isLanguageChangingTo===t&&(r(c),this.translator.changeLanguage(c),this.isLanguageChangingTo=void 0,this.emit("languageChanged",c),this.logger.log("languageChanged",c)):this.isLanguageChangingTo=void 0,s.resolve((...u)=>this.t(...u)),n&&n(a,(...u)=>this.t(...u))},o=a=>{var d,h;!t&&!a&&this.services.languageDetector&&(a=[]);const c=W(a)?a:a&&a[0],u=this.store.hasLanguageSomeTranslations(c)?c:this.services.languageUtils.getBestMatchFromCodes(W(a)?[a]:a);u&&(this.language||r(u),this.translator.language||this.translator.changeLanguage(u),(h=(d=this.services.languageDetector)==null?void 0:d.cacheUserLanguage)==null||h.call(d,u)),this.loadResources(u,m=>{i(m,u)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?o(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(o):this.services.languageDetector.detect(o):o(t),s}getFixedT(t,n,s,r){const i=r==null?void 0:r.scopeNs,o=(a,c,...u)=>{let d;typeof c!="object"?d=this.options.overloadTranslationOptionHandler([a,c].concat(u)):d={...c},d.lng=d.lng||o.lng,d.lngs=d.lngs||o.lngs;const h=d.ns!==void 0&&d.ns!==null;d.ns=d.ns||o.ns,d.keyPrefix!==""&&(d.keyPrefix=d.keyPrefix||s||o.keyPrefix);const m={...this.options,...d};Array.isArray(i)&&!h&&(m.ns=i),typeof d.keyPrefix=="function"&&(d.keyPrefix=ot(d.keyPrefix,m));const g=this.options.keySeparator||".";let p;return d.keyPrefix&&Array.isArray(a)?p=a.map(x=>(typeof x=="function"&&(x=ot(x,m)),`${d.keyPrefix}${g}${x}`)):(typeof a=="function"&&(a=ot(a,m)),p=d.keyPrefix?`${d.keyPrefix}${g}${a}`:a),this.t(p,d)};return W(t)?o.lng=t:o.lngs=t,o.ns=n,o.keyPrefix=s,o}t(...t){var n;return(n=this.translator)==null?void 0:n.translate(...t)}exists(...t){var n;return(n=this.translator)==null?void 0:n.exists(...t)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t,n={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const s=n.lng||this.resolvedLanguage||this.languages[0],r=this.options?this.options.fallbackLng:!1,i=this.languages[this.languages.length-1];if(s.toLowerCase()==="cimode")return!0;const o=(a,c)=>{const u=this.services.backendConnector.state[`${a}|${c}`];return u===-1||u===0||u===2};if(n.precheck){const a=n.precheck(this,o);if(a!==void 0)return a}return!!(this.hasResourceBundle(s,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||o(s,t)&&(!r||o(i,t)))}loadNamespaces(t,n){const s=Pt();return this.options.ns?(W(t)&&(t=[t]),t.forEach(r=>{this.options.ns.includes(r)||this.options.ns.push(r)}),this.loadResources(r=>{s.resolve(),n&&n(r)}),s):(n&&n(),Promise.resolve())}loadLanguages(t,n){const s=Pt();W(t)&&(t=[t]);const r=this.options.preload||[],i=t.filter(o=>!r.includes(o)&&this.services.languageUtils.isSupportedCode(o));return i.length?(this.options.preload=r.concat(i),this.loadResources(o=>{s.resolve(),n&&n(o)}),s):(n&&n(),Promise.resolve())}dir(t){var r,i;if(t||(t=this.resolvedLanguage||(((r=this.languages)==null?void 0:r.length)>0?this.languages[0]:this.language)),!t)return"rtl";try{const o=new Intl.Locale(t);if(o&&o.getTextInfo){const a=o.getTextInfo();if(a&&a.direction)return a.direction}}catch{}const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],s=((i=this.services)==null?void 0:i.languageUtils)||new Mo(Ds());return t.toLowerCase().indexOf("-latn")>1?"ltr":n.includes(s.getLanguagePartFromCode(t))||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(t={},n){const s=new Vt(t,n);return s.createInstance=Vt.createInstance,s}cloneInstance(t={},n=kn){const s=t.forkResourceStore;s&&delete t.forkResourceStore;const r={...this.options,...t,isClone:!0},i=new Vt(r);if((t.debug!==void 0||t.prefix!==void 0)&&(i.logger=i.logger.clone(t)),["store","services","language"].forEach(a=>{i[a]=this[a]}),i.services={...this.services},i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},s){const a=Object.keys(this.store.data).reduce((c,u)=>(c[u]={...this.store.data[u]},c[u]=Object.keys(c[u]).reduce((d,h)=>(d[h]={...c[u][h]},d),c[u]),c),{});i.store=new Ro(a,r),i.services.resourceStore=i.store}if(t.interpolation){const c={...Ds().interpolation,...this.options.interpolation,...t.interpolation},u={...r,interpolation:c};i.services.interpolator=new Po(u)}return i.translator=new ns(i.services,r),i.translator.on("*",(a,...c)=>{i.emit(a,...c)}),i.init(r,n),i.translator.options=r,i.translator.backendConnector.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const he=Vt.createInstance();he.createInstance;he.dir;he.init;he.loadResources;he.reloadResources;he.use;he.changeLanguage;he.getFixedT;he.t;he.exists;he.setDefaultNamespace;he.hasLoadedNamespace;he.loadNamespaces;he.loadLanguages;var Vs,_o;function w0(){return _o||(_o=1,Vs={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0}),Vs}var S0=w0();const C0=Gc(S0);var k0=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function Fo(e){var t={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},n=e.match(/<\/?([^\s]+?)[/\s>]/);if(n&&(t.name=n[1],(C0[n[1]]||e.charAt(e.length-2)==="/")&&(t.voidElement=!0),t.name.startsWith("!--"))){var s=e.indexOf("-->");return{type:"comment",comment:s!==-1?e.slice(4,s):""}}for(var r=new RegExp(k0),i=null;(i=r.exec(e))!==null;)if(i[0].trim())if(i[1]){var o=i[1].trim(),a=[o,""];o.indexOf("=")>-1&&(a=o.split("=")),t.attrs[a[0]]=a[1],r.lastIndex--}else i[2]&&(t.attrs[i[2]]=i[3].trim().substring(1,i[3].length-1));return t}var j0=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,E0=/^\s*$/,T0=Object.create(null);function dc(e,t){switch(t.type){case"text":return e+t.content;case"tag":return e+="<"+t.name+(t.attrs?(function(n){var s=[];for(var r in n)s.push(r+'="'+n[r]+'"');return s.length?" "+s.join(" "):""})(t.attrs):"")+(t.voidElement?"/>":">"),t.voidElement?e:e+t.children.reduce(dc,"")+"</"+t.name+">";case"comment":return e+"<!--"+t.comment+"-->"}}var N0={parse:function(e,t){t||(t={}),t.components||(t.components=T0);var n,s=[],r=[],i=-1,o=!1;if(e.indexOf("<")!==0){var a=e.indexOf("<");s.push({type:"text",content:a===-1?e:e.substring(0,a)})}return e.replace(j0,function(c,u){if(o){if(c!=="</"+n.name+">")return;o=!1}var d,h=c.charAt(1)!=="/",m=c.startsWith("<!--"),g=u+c.length,p=e.charAt(g);if(m){var x=Fo(c);return i<0?(s.push(x),s):((d=r[i]).children.push(x),s)}if(h&&(i++,(n=Fo(c)).type==="tag"&&t.components[n.name]&&(n.type="component",o=!0),n.voidElement||o||!p||p==="<"||n.children.push({type:"text",content:e.slice(g,e.indexOf("<",g))}),i===0&&s.push(n),(d=r[i-1])&&d.children.push(n),r[i]=n),(!h||n.voidElement)&&(i>-1&&(n.voidElement||n.name===c.slice(2,-1))&&(i--,n=i===-1?s:r[i]),!o&&p!=="<"&&p)){d=i===-1?s:r[i].children;var y=e.indexOf("<",g),b=e.slice(g,y===-1?void 0:y);E0.test(b)&&(b=" "),(y>-1&&i+d.length>=0||b!==" ")&&d.push({type:"text",content:b})}}),s},stringify:function(e){return e.reduce(function(t,n){return t+dc("",n)},"")}};const In=(e,t,n,s)=>{var i,o,a,c;const r=[n,{code:t,...s||{}}];if((o=(i=e==null?void 0:e.services)==null?void 0:i.logger)!=null&&o.forward)return e.services.logger.forward(r,"warn","react-i18next::",!0);ge(r[0])&&(r[0]=`react-i18next:: ${r[0]}`),(c=(a=e==null?void 0:e.services)==null?void 0:a.logger)!=null&&c.warn?e.services.logger.warn(...r):console!=null&&console.warn&&console.warn(...r)},Do={},nn=(e,t,n,s)=>{ge(n)&&Do[n]||(ge(n)&&(Do[n]=new Date),In(e,t,n,s))},fc=(e,t)=>()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout(()=>{e.off("initialized",n)},0),t()};e.on("initialized",n)}},wr=(e,t,n)=>{e.loadNamespaces(t,fc(e,n))},Vo=(e,t,n,s)=>{if(ge(n)&&(n=[n]),e.options.preload&&e.options.preload.indexOf(t)>-1)return wr(e,n,s);n.forEach(r=>{e.options.ns.indexOf(r)<0&&e.options.ns.push(r)}),e.loadLanguages(t,fc(e,s))},R0=(e,t,n={})=>!t.languages||!t.languages.length?(nn(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:n.lng,precheck:(s,r)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&s.services.backendConnector.backend&&s.isLanguageChangingTo&&!r(s.isLanguageChangingTo,e))return!1}}),ge=e=>typeof e=="string",Ve=e=>typeof e=="object"&&e!==null,M0=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,A0={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},L0=e=>A0[e],hc=e=>e.replace(M0,L0);let Sr={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:hc,transDefaultProps:void 0};const I0=(e={})=>{Sr={...Sr,...e}},mi=()=>Sr;let pc;const P0=e=>{pc=e},gi=()=>pc,Pn=(e,t)=>{var s;if(!e)return!1;const n=((s=e.props)==null?void 0:s.children)??e.children;return t?n.length>0:!!n},_t=e=>{var n,s;if(!e)return[];const t=((n=e.props)==null?void 0:n.children)??e.children;return(s=e.props)!=null&&s.i18nIsDynamicList?qe(t):t},$0=e=>Array.isArray(e)&&e.every(f.isValidElement),qe=e=>Array.isArray(e)?e:[e],O0=(e,t)=>{const n={...t};return n.props={...t.props,...e.props},n},_0=e=>{const t={};if(!e)return t;const n=s=>{qe(s).forEach(i=>{ge(i)||(Pn(i)?n(_t(i)):Ve(i)&&!f.isValidElement(i)&&Object.assign(t,i))})};return n(e),t},Cr=(e,t,n,s)=>{if(!e)return"";let r="";const i=qe(e),o=t!=null&&t.transSupportBasicHtmlNodes?t.transKeepBasicHtmlNodesFor??[]:[];return i.forEach((a,c)=>{if(ge(a)){r+=`${a}`;return}if(f.isValidElement(a)){const{props:u,type:d}=a,h=Object.keys(u).length,m=o.indexOf(d)>-1,g=u.children;if(!g&&m&&!h){r+=`<${d}/>`;return}if(!g&&(!m||h)||u.i18nIsDynamicList){r+=`<${c}></${c}>`;return}if(m&&h<=1){const x=ge(g)?g:Cr(g,t,n,s);r+=`<${d}>${x}</${d}>`;return}const p=Cr(g,t,n,s);r+=`<${c}>${p}</${c}>`;return}if(a===null){In(n,"TRANS_NULL_VALUE","Passed in a null value as child",{i18nKey:s});return}if(Ve(a)){const{format:u,...d}=a,h=Object.keys(d);if(h.length===1){const m=u?`${h[0]}, ${u}`:h[0];r+=`{{${m}}}`;return}In(n,"TRANS_INVALID_OBJ","Invalid child - Object should only have keys {{ value, format }} (format is optional).",{i18nKey:s,child:a});return}In(n,"TRANS_INVALID_VAR","Passed in a variable like {number} - pass variables for interpolation as full objects like {{number}}.",{i18nKey:s,child:a})}),r},F0=(e,t=[],n={})=>{if(!e)return e;const s=Object.keys(n),r=[...t,...s];let i="",o=0;for(;o<e.length;)if(e[o]==="<"){let a=!1;const c=e.slice(o).match(/^<\/(\d+|[a-zA-Z][a-zA-Z0-9_-]*)>/);if(c){const u=c[1];(/^\d+$/.test(u)||r.includes(u))&&(a=!0,i+=c[0],o+=c[0].length)}if(!a){const u=e.slice(o).match(/^<(\d+|[a-zA-Z][a-zA-Z0-9_-]*)(\s+[\w-]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]+))?)*\s*(\/)?>/);if(u){const d=u[1];(/^\d+$/.test(d)||r.includes(d))&&(a=!0,i+=u[0],o+=u[0].length)}}a||(i+="<",o+=1)}else i+=e[o],o+=1;return i},D0=(e,t,n,s,r,i,o)=>{if(n==="")return[];const a=r.transKeepBasicHtmlNodesFor||[],c=n&&new RegExp(a.map(k=>`<${k}`).join("|")).test(n);if(!e&&!t&&!c&&!o)return[n];const u=t??{},d=k=>{qe(k).forEach(S=>{ge(S)||(Pn(S)?d(_t(S)):Ve(S)&&!f.isValidElement(S)&&Object.assign(u,S))})};d(e);const h=F0(n,a,u),m=N0.parse(`<0>${h}</0>`),g={...u,...i},p=(k,v,S)=>{var T;const w=_t(k),M=y(w,v.children,S);return $0(w)&&M.length===0||(T=k.props)!=null&&T.i18nIsDynamicList?w:M},x=(k,v,S,w,M)=>{k.dummy?(k.children=v,S.push(f.cloneElement(k,{key:w},M?void 0:v))):S.push(...f.Children.map([k],T=>{var j;if(T.type===f.Fragment||((j=T.props)==null?void 0:j.i18nIsDynamicList)!==void 0){const E={key:w};return T&&T.props&&Object.keys(T.props).forEach(P=>{P==="children"||P==="i18nIsDynamicList"||(E[P]=T.props[P])}),f.createElement(T.type,E,M?null:v)}const C={key:w};return T&&T.props&&Object.keys(T.props).forEach(E=>{E==="ref"||E==="children"||(C[E]=T.props[E])}),f.cloneElement(T,C,M?null:v)}))},y=(k,v,S)=>{const w=qe(k),M=qe(v),T={};return M.reduce((C,j,E)=>{var $,N;const P=((N=($=j.children)==null?void 0:$[0])==null?void 0:N.content)&&s.services.interpolator.interpolate(j.children[0].content,g,s.language);if(j.type==="tag"){let R=w[parseInt(j.name,10)];!R&&t&&(R=t[j.name]),S.length===1&&!R&&(R=S[0][j.name]),R||(R={});const I={...j.attrs};o&&Object.keys(I).forEach(A=>{const D=I[A];ge(D)&&(I[A]=hc(D))});const L=Object.keys(I).length!==0?O0({props:I},R):R,O=f.isValidElement(L),_=O&&Pn(j,!0)&&!j.voidElement,U=c&&Ve(L)&&L.dummy&&!O,F=Ve(t)&&Object.hasOwnProperty.call(t,j.name);if(ge(L)){const A=s.services.interpolator.interpolate(L,g,s.language);C.push(A)}else if(Pn(L)||_){const A=p(L,j,S);x(L,A,C,E)}else if(U){const A=y(w,j.children,S);x(L,A,C,E)}else if(Number.isNaN(parseFloat(j.name)))if(F){const A=p(L,j,S);x(L,A,C,E,j.voidElement)}else if(r.transSupportBasicHtmlNodes&&a.indexOf(j.name)>-1)if(j.voidElement)C.push(f.createElement(j.name,{key:`${j.name}-${E}`}));else{const A=T[j.name]||0;T[j.name]=A+1;let D,V=0;for(let te=0;te<w.length;te+=1){const ae=w[te];if(f.isValidElement(ae)&&ae.type===j.name){if(V===A){D=ae;break}V+=1}}const z=D?qe(_t(D)):w,q=y(z,j.children,S);C.push(f.createElement(j.name,{key:`${j.name}-${E}`},q))}else if(j.voidElement)C.push(`<${j.name} />`);else{const A=y(w,j.children,S);C.push(`<${j.name}>${A}</${j.name}>`)}else if(Ve(L)&&!O){const A=j.children[0]?P:null;A&&C.push(A)}else x(L,P,C,E,j.children.length!==1||!P)}else if(j.type==="text"){const R=r.transWrapTextNodes,I=typeof r.unescape=="function"?r.unescape:mi().unescape,L=o?I(s.services.interpolator.interpolate(j.content,g,s.language)):s.services.interpolator.interpolate(j.content,g,s.language);R?C.push(f.createElement(R,{key:`${j.name}-${E}`},L)):C.push(L)}return C},[])},b=y([{dummy:!0,children:e||[]}],m,qe(e||[]));return _t(b[0])},mc=(e,t,n)=>{const s=e.key||t,r=f.cloneElement(e,{key:s});if(!r.props||!r.props.children||n.indexOf(`${t}/>`)<0&&n.indexOf(`${t} />`)<0)return r;function i(){return f.createElement(f.Fragment,null,r)}return f.createElement(i,{key:s})},V0=(e,t)=>e.map((n,s)=>mc(n,s,t)),B0=(e,t)=>{const n={};return Object.keys(e).forEach(s=>{Object.assign(n,{[s]:mc(e[s],s,t)})}),n},z0=(e,t,n,s)=>e?Array.isArray(e)?V0(e,t):Ve(e)?B0(e,t):(nn(n,"TRANS_INVALID_COMPONENTS",'<Trans /> "components" prop expects an object or array',{i18nKey:s}),null):null,H0=e=>!Ve(e)||Array.isArray(e)?!1:Object.keys(e).reduce((t,n)=>t&&Number.isNaN(Number.parseFloat(n)),!0);function U0({children:e,count:t,parent:n,i18nKey:s,context:r,tOptions:i={},values:o,defaults:a,components:c,ns:u,i18n:d,t:h,shouldUnescape:m,...g}){var F,A,D,V,z,q;const p=d||gi();if(!p)return nn(p,"NO_I18NEXT_INSTANCE","Trans: You need to pass in an i18next instance using i18nextReactModule",{i18nKey:s}),e;const x=h||p.t.bind(p)||(te=>te),y={...mi(),...(F=p.options)==null?void 0:F.react};let b=u||x.ns||((A=p.options)==null?void 0:A.defaultNS);b=ge(b)?[b]:b||["translation"];const{transDefaultProps:k}=y,v=k!=null&&k.tOptions?{...k.tOptions,...i}:i,S=m??(k==null?void 0:k.shouldUnescape),w=k!=null&&k.values?{...k.values,...o}:o,M=k!=null&&k.components?{...k.components,...c}:c,T=Cr(e,y,p,s),C=a||(v==null?void 0:v.defaultValue)||T||y.transEmptyNodeValue||(typeof s=="function"?ot(s):s),{hashTransKey:j}=y,E=s||(j?j(T||C):T||C);(V=(D=p.options)==null?void 0:D.interpolation)!=null&&V.defaultVariables?o=w&&Object.keys(w).length>0?{...w,...p.options.interpolation.defaultVariables}:{...p.options.interpolation.defaultVariables}:o=w;const P=_0(e);P&&typeof P.count=="number"&&t===void 0&&(t=P.count);const $=o||t!==void 0&&!((q=(z=p.options)==null?void 0:z.interpolation)!=null&&q.alwaysFormat)||!e?v.interpolation:{interpolation:{...v.interpolation,prefix:"#$?",suffix:"?$#"}},N={...v,context:r||v.context,count:t,...o,...$,defaultValue:C,ns:b};let R=E?x(E,N):C;R===E&&C&&(R=C);const I=z0(M,R,p,s);let L=I||e,O=null;H0(I)&&(O=I,L=e);const _=D0(L,O,R,p,y,N,S),U=n??y.defaultTransParent;return U?f.createElement(U,g,_):_}const K0={type:"3rdParty",init(e){I0(e.options.react),P0(e)}},gc=f.createContext();class W0{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}function q0({children:e,count:t,parent:n,i18nKey:s,context:r,tOptions:i={},values:o,defaults:a,components:c,ns:u,i18n:d,t:h,shouldUnescape:m,...g}){var k;const{i18n:p,defaultNS:x}=f.useContext(gc)||{},y=d||p||gi(),b=h||(y==null?void 0:y.t.bind(y));return U0({children:e,count:t,parent:n,i18nKey:s,context:r,tOptions:i,values:o,defaults:a,components:c,ns:u||(b==null?void 0:b.ns)||x||((k=y==null?void 0:y.options)==null?void 0:k.defaultNS),i18n:y,t:h,shouldUnescape:m,...g})}var Bs={exports:{}},zs={};/**
|
|
247
|
+
* @license React
|
|
248
|
+
* use-sync-external-store-shim.production.js
|
|
249
|
+
*
|
|
250
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
251
|
+
*
|
|
252
|
+
* This source code is licensed under the MIT license found in the
|
|
253
|
+
* LICENSE file in the root directory of this source tree.
|
|
254
|
+
*/var Bo;function G0(){if(Bo)return zs;Bo=1;var e=Yc();function t(h,m){return h===m&&(h!==0||1/h===1/m)||h!==h&&m!==m}var n=typeof Object.is=="function"?Object.is:t,s=e.useState,r=e.useEffect,i=e.useLayoutEffect,o=e.useDebugValue;function a(h,m){var g=m(),p=s({inst:{value:g,getSnapshot:m}}),x=p[0].inst,y=p[1];return i(function(){x.value=g,x.getSnapshot=m,c(x)&&y({inst:x})},[h,g,m]),r(function(){return c(x)&&y({inst:x}),h(function(){c(x)&&y({inst:x})})},[h]),o(g),g}function c(h){var m=h.getSnapshot;h=h.value;try{var g=m();return!n(h,g)}catch{return!0}}function u(h,m){return m()}var d=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:a;return zs.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:d,zs}var zo;function Y0(){return zo||(zo=1,Bs.exports=G0()),Bs.exports}var J0=Y0();const X0=(e,t)=>{if(ge(t))return t;if(Ve(t)&&ge(t.defaultValue))return t.defaultValue;if(typeof e=="function")return"";if(Array.isArray(e)){const n=e[e.length-1];return typeof n=="function"?"":n}return e},Z0={t:X0,ready:!1},Q0=()=>()=>{},G=(e,t={})=>{var j,E,P;const{i18n:n}=t,{i18n:s,defaultNS:r}=f.useContext(gc)||{},i=n||s||gi();i&&!i.reportNamespaces&&(i.reportNamespaces=new W0),i||nn(i,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const o=f.useMemo(()=>{var $;return{...mi(),...($=i==null?void 0:i.options)==null?void 0:$.react,...t}},[i,t]),{useSuspense:a,keyPrefix:c}=o,u=r||((j=i==null?void 0:i.options)==null?void 0:j.defaultNS),d=ge(u)?[u]:u||["translation"],h=f.useMemo(()=>d,d);(P=(E=i==null?void 0:i.reportNamespaces)==null?void 0:E.addUsedNamespaces)==null||P.call(E,h);const m=f.useRef(0),g=f.useCallback($=>{if(!i)return Q0;const{bindI18n:N,bindI18nStore:R}=o,I=()=>{m.current+=1,$()};return N&&i.on(N,I),R&&i.store.on(R,I),()=>{N&&N.split(" ").forEach(L=>i.off(L,I)),R&&R.split(" ").forEach(L=>i.store.off(L,I))}},[i,o]),p=f.useRef(),x=f.useCallback(()=>{if(!i)return Z0;const $=!!(i.isInitialized||i.initializedStoreOnce)&&h.every(_=>R0(_,i,o)),N=t.lng||i.language,R=m.current,I=p.current;if(I&&I.ready===$&&I.lng===N&&I.keyPrefix===c&&I.revision===R)return I;const O={t:i.getFixedT(N,o.nsMode==="fallback"?h:h[0],c,{scopeNs:h}),ready:$,lng:N,keyPrefix:c,revision:R};return p.current=O,O},[i,h,c,o,t.lng]),[y,b]=f.useState(0),{t:k,ready:v}=J0.useSyncExternalStore(g,x,x);f.useEffect(()=>{if(i&&!v&&!a){const $=()=>b(N=>N+1);t.lng?Vo(i,t.lng,h,$):wr(i,h,$)}},[i,t.lng,h,v,a,y]);const S=i||{},w=f.useRef(null),M=f.useRef(),T=$=>{const N=Object.getOwnPropertyDescriptors($);N.__original&&delete N.__original;const R=Object.create(Object.getPrototypeOf($),N);if(!Object.prototype.hasOwnProperty.call(R,"__original"))try{Object.defineProperty(R,"__original",{value:$,writable:!1,enumerable:!1,configurable:!1})}catch{}return R},C=f.useMemo(()=>{const $=S,N=$==null?void 0:$.language;let R=$;$&&(w.current&&w.current.__original===$?M.current!==N?(R=T($),w.current=R,M.current=N):R=w.current:(R=T($),w.current=R,M.current=N));const I=!v&&!a?(...O)=>(nn(i,"USE_T_BEFORE_READY","useTranslation: t was called before ready. When using useSuspense: false, make sure to check the ready flag before using t."),k(...O)):k,L=[I,R,v];return L.t=I,L.i18n=R,L.ready=v,L},[k,S,v,S.resolvedLanguage,S.language,S.languages]);if(i&&a&&!v)throw new Promise($=>{const N=()=>$();t.lng?Vo(i,t.lng,h,N):wr(i,h,N)});return C},Ho=e=>{let t;const n=new Set,s=(u,d)=>{const h=typeof u=="function"?u(t):u;if(!Object.is(h,t)){const m=t;t=d??(typeof h!="object"||h===null)?h:Object.assign({},t,h),n.forEach(g=>g(t,m))}},r=()=>t,a={setState:s,getState:r,getInitialState:()=>c,subscribe:u=>(n.add(u),()=>n.delete(u))},c=t=e(s,r,a);return a},e1=(e=>e?Ho(e):Ho),t1=e=>e;function n1(e,t=t1){const n=bn.useSyncExternalStore(e.subscribe,bn.useCallback(()=>t(e.getState()),[e,t]),bn.useCallback(()=>t(e.getInitialState()),[e,t]));return bn.useDebugValue(n),n}const Uo=e=>{const t=e1(e),n=s=>n1(t,s);return Object.assign(n,t),n},mn=(e=>e?Uo(e):Uo),bt={appearance:"paimon:appearance",background:"paimon:background",notification:"paimon:notification"};function kr(){const e=localStorage.getItem(bt.appearance);return e==="light"||e==="dark"||e==="system"?e:"system"}function yc(){const e=localStorage.getItem(bt.background);return e==="mist"||e==="aurora"||e==="ember"?e:"mist"}function s1(){return localStorage.getItem(bt.notification)==="true"}function xc(e){return e==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e}function ss(e,t){const n=xc(e);return document.documentElement.setAttribute("data-theme",n),document.documentElement.setAttribute("data-bg",t),n}const ye=mn(e=>({appearance:kr(),background:yc(),resolvedTheme:xc(kr()),notification:s1(),setAppearance:t=>{localStorage.setItem(bt.appearance,t);const n=ss(t,ye.getState().background);e({appearance:t,resolvedTheme:n})},setBackground:t=>{localStorage.setItem(bt.background,t),ss(ye.getState().appearance,t),e({background:t})},setNotification:t=>{localStorage.setItem(bt.notification,String(t)),e({notification:t})}})),r1=window.matchMedia("(prefers-color-scheme: dark)");r1.addEventListener("change",()=>{const{appearance:e,background:t}=ye.getState();if(e==="system"){const n=ss(e,t);ye.setState({resolvedTheme:n})}});function i1(){const e=ye(n=>n.appearance),t=ye(n=>n.setAppearance);return[e,t]}function bc(){const e=ye(n=>n.background),t=ye(n=>n.setBackground);return[e,t]}function vc(){return ye(e=>e.resolvedTheme)}function o1(){const e=ye(n=>n.notification),t=ye(n=>n.setNotification);return[e,t]}ss(kr(),yc());const Ko=window.__BASE_PATH__||"/",wc=Ko==="/"?"":Ko;function ct(e){return`${wc}${e}`}const a1=ct("/logos/mist/light/paimon-logo.png");function Sc(e,t){return!e||!t?a1:ct(`/logos/${e}/${t}/paimon-logo.png`)}function yi(){const[e]=bc(),t=vc();return Sc(e,t)}function l1(){const{background:e,resolvedTheme:t}=ye.getState();return Sc(e,t)}const xi="paimon:accessToken";function jr(){return localStorage.getItem(xi)}function Cc(e){localStorage.setItem(xi,e)}function kc(){localStorage.removeItem(xi)}function c1({onLogin:e,error:t}){const{t:n}=G(),s=f.useId(),r=f.useId(),[i,o]=f.useState(""),[a,c]=f.useState(!1),[u,d]=f.useState(!1),h=yi(),m=f.useCallback(async g=>{g.preventDefault();const p=i.trim();if(!(!p||a)){c(!0),d(!1);try{if((await fetch(ct("/api/instances"),{headers:{Authorization:`Bearer ${p}`}})).status===401){d(!0),c(!1);return}}catch{}c(!1),Cc(p),e(p)}},[i,a,e]);return l.jsx("div",{className:"fixed-viewport flex items-center justify-center p-4 overflow-y-auto",children:l.jsxs("form",{onSubmit:m,className:"glass-panel w-full max-w-[380px] p-8 flex flex-col items-center gap-6",children:[l.jsx("img",{src:h,alt:"Paimon",className:"w-16 h-16 select-none",draggable:!1}),l.jsxs("div",{className:"text-center",children:[l.jsx("h1",{className:"text-[17px] font-semibold text-[var(--label-primary)]",children:"Paimon"}),l.jsx("p",{className:"mt-1 text-[13px] text-[var(--label-secondary)]",children:n("login.subtitle")})]}),l.jsxs(br,{label:n("login.placeholder"),htmlFor:s,children:[l.jsx(pi,{id:s,"aria-describedby":t||u?r:void 0,invalid:t||u,type:"password",value:i,onChange:g=>o(g.target.value),placeholder:n("login.placeholder"),autoFocus:!0,disabled:a,autoComplete:"off"}),(t||u)&&l.jsx("div",{id:r,children:l.jsx(Re,{compact:!0,tone:"error",children:n("login.invalidToken")})})]}),l.jsx(Q,{variant:"primary",loading:a,type:"submit",disabled:!i.trim()||a,className:"w-full",children:n(a?"login.verifying":"login.connect")}),l.jsx("p",{className:"text-[11px] text-[var(--label-tertiary)] text-center leading-relaxed",children:l.jsx(q0,{i18nKey:"login.tokenHint",components:{1:l.jsx("code",{className:"px-1 py-0.5 rounded-inline bg-[var(--fill-secondary)] text-[var(--label-secondary)]"})}})})]})})}function de(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function u1(){const[e,t]=f.useState(jr()),[n,s]=f.useState(!1),[r,i]=f.useState(()=>jr()===null);f.useEffect(()=>{if(!r)return;let c=!1;return(async()=>{try{const d=await fetch(ct("/api/token"),{signal:AbortSignal.timeout(3e3)});if(c||!d.ok)return;const h=await d.json();if(c||!de(h)||typeof h.token!="string")return;const m=h.token;Cc(m),t(m)}catch{}finally{c||i(!1)}})(),()=>{c=!0}},[r]);const o=f.useCallback(c=>{s(!1),t(c)},[]),a=f.useCallback(()=>{kc(),t(null),s(!0)},[]);return{authToken:e,authError:n,probing:r,handleLogin:o,handleAuthError:a}}const Wo={BROWSER_HEARTBEAT_INTERVAL:3e4,BROWSER_PONG_TIMEOUT:1e4};let De=null;const Er=new Set;let vt=!1,$n=null,at=null,On=null,Bt=null,mt=null,zt,Hs=!1;const d1=3e3,f1=3e3;function h1(e){for(const t of Er)try{t(e)}catch(n){console.error("[useWebSocket] listener error:",n)}}function p1(e){$n=setInterval(()=>{e.readyState===WebSocket.OPEN&&(e.send(JSON.stringify({type:"ping"})),at=setTimeout(()=>{e.close()},Wo.BROWSER_PONG_TIMEOUT))},Wo.BROWSER_HEARTBEAT_INTERVAL)}function jc(){$n&&(clearInterval($n),$n=null),at&&(clearTimeout(at),at=null)}function Us(){vt||(On=setTimeout(Ec,f1))}function Tr(){Bt&&(clearTimeout(Bt),Bt=null)}function Ec(){if(vt||!mt)return;const n=`${`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}${ct("/ws/browser")}`}?token=${encodeURIComponent(mt)}`;Hs=!1;const s=new WebSocket(n);De=s,me.setState({connectionState:"connecting"}),Bt=setTimeout(()=>{Bt=null,s.readyState===WebSocket.CONNECTING&&s.close()},d1),s.onopen=()=>{Tr(),Hs=!0,me.setState({connectionState:"connected"}),s.send(JSON.stringify({type:"list"})),p1(s)},s.onmessage=r=>{try{const i=JSON.parse(r.data);if(i.type==="pong"){at&&(clearTimeout(at),at=null);return}h1(i)}catch{}},s.onclose=()=>{if(Tr(),me.setState({connectionState:"disconnected"}),De=null,jc(),!vt&&!Hs){const r={};mt&&(r.Authorization=`Bearer ${mt}`),fetch(ct("/api/instances"),{headers:r}).then(i=>{i.status===401?zt==null||zt():Us()}).catch(()=>{Us()});return}vt||Us()},s.onerror=()=>{s.close()}}const me=mn((e,t)=>({connectionState:"idle",send:n=>{(De==null?void 0:De.readyState)===WebSocket.OPEN&&De.send(JSON.stringify(n))},subscribe:n=>(Er.add(n),()=>{Er.delete(n)}),connect:(n,s)=>{t().disconnect(),vt=!1,mt=n,zt=s,Ec()},disconnect:()=>{vt=!0,mt=null,zt=void 0,jc(),Tr(),On&&(clearTimeout(On),On=null),De&&(De.close(),De=null),e({connectionState:"idle"})}}));function m1(e,t){let n;try{n=e()}catch{return}return{getItem:r=>{var i;const o=c=>c===null?null:JSON.parse(c,void 0),a=(i=n.getItem(r))!=null?i:null;return a instanceof Promise?a.then(o):o(a)},setItem:(r,i)=>n.setItem(r,JSON.stringify(i,void 0)),removeItem:r=>n.removeItem(r)}}const Nr=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(s){return Nr(s)(n)},catch(s){return this}}}catch(n){return{then(s){return this},catch(s){return Nr(s)(n)}}}},g1=(e,t)=>(n,s,r)=>{let i={storage:m1(()=>window.localStorage),partialize:y=>y,version:0,merge:(y,b)=>({...b,...y}),...t},o=!1,a=0;const c=new Set,u=new Set;let d=i.storage;if(!d)return e((...y)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),n(...y)},s,r);const h=()=>{const y=i.partialize({...s()});return d.setItem(i.name,{state:y,version:i.version})},m=r.setState;r.setState=(y,b)=>(m(y,b),h());const g=e((...y)=>(n(...y),h()),s,r);r.getInitialState=()=>g;let p;const x=()=>{var y,b;if(!d)return;const k=++a;o=!1,c.forEach(S=>{var w;return S((w=s())!=null?w:g)});const v=((b=i.onRehydrateStorage)==null?void 0:b.call(i,(y=s())!=null?y:g))||void 0;return Nr(d.getItem.bind(d))(i.name).then(S=>{if(S)if(typeof S.version=="number"&&S.version!==i.version){if(i.migrate){const w=i.migrate(S.state,S.version);return w instanceof Promise?w.then(M=>[!0,M]):[!0,w]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,S.state];return[!1,void 0]}).then(S=>{var w;if(k!==a)return;const[M,T]=S;if(p=i.merge(T,(w=s())!=null?w:g),n(p,!0),M)return h()}).then(()=>{k===a&&(v==null||v(s(),void 0),p=s(),o=!0,u.forEach(S=>S(p)))}).catch(S=>{k===a&&(v==null||v(void 0,S))})};return r.persist={setOptions:y=>{i={...i,...y},y.storage&&(d=y.storage)},clearStorage:()=>{d==null||d.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>x(),hasHydrated:()=>o,onHydrate:y=>(c.add(y),()=>{c.delete(y)}),onFinishHydration:y=>(u.add(y),()=>{u.delete(y)})},i.skipHydration||x(),p||g},Tc=g1,Ft=mn()(Tc(e=>({instances:[],instanceListReady:!1,handleMessage:t=>{switch(t.type){case"instance_list":e({instances:t.payload.instances,instanceListReady:!0});break;case"instance_update":{const{instance:n,action:s}=t.payload;s==="connected"?e(r=>({instances:r.instances.some(o=>o.id===n.id)?r.instances.map(o=>o.id===n.id?n:o):[...r.instances,n]})):s==="disconnected"?e(r=>({instances:r.instances.filter(i=>i.id!==n.id)})):s==="updated"&&e(r=>({instances:r.instances.map(i=>i.id===n.id?n:i)}));break}}}}),{name:"paimon:instances",partialize:e=>({instances:e.instances})}));function y1(e){return t=>e?t.instances.find(n=>n.id===e):void 0}const Nc="Notification"in window;function x1(e){return e.action==="updated"&&e.settledOutcome==="completed"}function b1(){const e=me(r=>r.subscribe),t=an(),n=f.useRef(t);f.useEffect(()=>{n.current=t},[t]);const s=f.useRef(ye.getState().notification);f.useEffect(()=>ye.subscribe(r=>{s.current=r.notification}),[]),f.useEffect(()=>e(r=>{if(r.type==="instance_update"&&s.current&&x1(r.payload)){const{instance:i}=r.payload;v1(i.id,i.cwd,n)}}),[e])}function v1(e,t,n){if(document.hasFocus()||!Nc||Notification.permission!=="granted")return;const s=t.split("/").pop()||t,r=new Notification("Paimon",{body:he.t("notification.taskComplete",{name:s}),icon:l1()});r.onclick=()=>{var i;window.focus(),(i=n.current)==null||i.call(n,`/instance/${e}`),r.close()}}function w1(){const{t:e}=G(),t=yi();return l.jsx("div",{className:"flex-1 flex items-center justify-center",children:l.jsxs("div",{className:"text-center select-none",children:[l.jsx("img",{src:t,alt:"Paimon",className:"w-16 h-16 mx-auto mb-4 opacity-80"}),l.jsx("div",{className:"text-[14px] text-[var(--label-tertiary)] tracking-wide",children:e("eventStream.tagline")})]})})}function S1(){return l.jsx("div",{className:"relative flex-1 min-w-0 overflow-hidden flex flex-col",children:l.jsx(sd,{})})}const wt=e=>e!==void 0&&e!=="idle";function Rc(e){return e==="streaming"?"sidebar.statusStreaming":e==="compacting"?"sidebar.statusCompacting":e==="idle"?"sidebar.statusIdle":"sidebar.statusPending"}function Mc(e){return e==="streaming"?"bg-[var(--color-accent)] animate-pulse motion-reduce:animate-none":e==="compacting"?"bg-[var(--toast-icon-warning)] animate-pulse motion-reduce:animate-none":e==="idle"?"bg-[var(--toast-icon-success)]":"bg-[var(--label-secondary)]"}const qo=mn()(Tc(e=>({collapsedEdges:{},toggleEdge:t=>e(n=>({collapsedEdges:{...n.collapsedEdges,[t]:!n.collapsedEdges[t]}}))}),{name:"paimon:sidebar",partialize:e=>({collapsedEdges:e.collapsedEdges})}));function Ac(e,t){return Rg(e,t)}const C1=Ac("dialog"),St=Ac("div");function Lc(e){return l.jsx(hn,{features:ms,strict:!0,children:l.jsx(k1,{...e})})}function k1({className:e="",children:t,...n}){const s=hs(),r=f.useContext(Pe).reducedMotion,i=pn()||r==="always";return l.jsx(St,{...n,className:`glass-popover ui-floating ${e}`,inert:!s,"aria-hidden":!s||void 0,initial:{opacity:i?1:0,y:i?0:4,scale:i?1:.98},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:i?0:4,scale:i?1:.98},transition:{duration:i?0:.12},children:t})}function Ic(e){function t(){const r=window.visualViewport;return{top:(r==null?void 0:r.offsetTop)??0,left:(r==null?void 0:r.offsetLeft)??0,width:(r==null?void 0:r.width)??window.innerWidth,height:(r==null?void 0:r.height)??window.innerHeight}}const[n,s]=f.useState(t);return f.useLayoutEffect(()=>{if(!e)return;function r(){const o=t();s(a=>a.top===o.top&&a.left===o.left&&a.width===o.width&&a.height===o.height?a:o)}r();const i=window.visualViewport;return window.addEventListener("resize",r),i==null||i.addEventListener("resize",r),i==null||i.addEventListener("scroll",r),()=>{window.removeEventListener("resize",r),i==null||i.removeEventListener("resize",r),i==null||i.removeEventListener("scroll",r)}},[e]),n}function At({trigger:e,label:t,width:n=200,maxHeight:s=1/0,children:r,disabled:i=!1,placement:o="top",align:a="right",onOpenChange:c}){const[u,d]=f.useState(!1),h=f.useRef(c);h.current=c,f.useLayoutEffect(()=>{var w;(w=h.current)==null||w.call(h,u)},[u]);const[m,g]=f.useState(null),p=Ic(u),x=f.useRef(null),y=f.useRef(null),b=f.useId(),k=f.useCallback(()=>{var w,M;d(!1),(M=(w=x.current)==null?void 0:w.querySelector("button"))==null||M.focus()},[]);f.useLayoutEffect(()=>{var R;if(!u)return;const w=(R=x.current)==null?void 0:R.getBoundingClientRect();if(!w)return;const M=Math.min(n,Math.max(0,p.width-24)),T=Math.max(p.top+12,Math.min(w.top,p.top+p.height-12)),C=Math.max(T,Math.min(w.bottom,p.top+p.height-12)),j=Math.max(0,T-p.top-20),E=Math.max(0,p.top+p.height-C-20),P=o==="bottom"?E>=160||E>=j:j<160&&E>j,$=Math.max(p.left+12,Math.min(a==="left"?w.left:w.right-M,p.left+p.width-M-12)),N=Math.max(j,E)<160;g({left:$,...N?{top:p.top+12}:P?{top:Math.max(p.top+12,C+8)}:{bottom:Math.max(12,window.innerHeight-T+8)},maxHeight:Math.min(s,N?Math.max(0,p.height-24):P?E:j)})},[u,p,n,s,o,a]),f.useEffect(()=>{i&&d(!1)},[i]),f.useEffect(()=>{if(!u)return;const w=y.current;w&&!w.contains(document.activeElement)&&(w.querySelector("input, button:not([disabled])")??w).focus();const M=T=>{T.key==="Escape"&&(T.preventDefault(),k())};return document.addEventListener("keydown",M),()=>document.removeEventListener("keydown",M)},[u,!!m,k]),f.useEffect(()=>{if(!u)return;function w(M){const T=M.composedPath(),C=x.current,j=y.current;!(C&&T.includes(C))&&!(j&&T.includes(j))&&d(!1)}return document.addEventListener("mousedown",w,!0),document.addEventListener("click",w,!0),()=>{document.removeEventListener("mousedown",w,!0),document.removeEventListener("click",w,!0)}},[u]),f.useEffect(()=>{if(!u)return;const w=()=>d(!1);return window.addEventListener("resize",w),()=>{window.removeEventListener("resize",w)}},[u]);const v=()=>{if(!i){if(u){d(!1);return}d(!0)}},S=m?kt.createPortal(l.jsx($e,{children:u&&m&&l.jsx(Lc,{ref:y,id:b,role:t?"dialog":void 0,"aria-label":t,tabIndex:-1,className:"z-50",style:{position:"fixed",...m,width:`${Math.min(n,Math.max(0,p.width-24))}px`,maxWidth:"calc(100vw - 24px)"},children:r(k)},"popover")}),document.body):null;return l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"relative min-w-0",ref:x,onClick:v,children:e({open:u,id:b})}),S]})}function Ne({selected:e=!1,danger:t=!1,className:n="",type:s="button",...r}){return l.jsx("button",{...r,type:s,"data-selected":e||void 0,"data-danger":t||void 0,className:`ui-menu-item ${n}`})}function j1(e,t,n=12){const{innerWidth:s,innerHeight:r}=window;let i=e.x,o=e.y;return i+t.width+n>s&&(i=s-t.width-n),o+t.height+n>r&&(o=r-t.height-n),i=Math.max(n,i),o=Math.max(n,o),{left:i,top:o}}function E1({position:e,onClose:t,children:n}){const s=f.useRef(null),r=hs(),i=Ic(r),[o,a]=f.useState(e),c=f.useRef(t);c.current=t;const u=f.useCallback(()=>c.current(),[]);return f.useEffect(()=>{if(!r)return;function d(g){s.current&&!s.current.contains(g.target)&&u()}function h(g){s.current&&!s.current.contains(g.target)&&u()}function m(g){g.key==="Escape"&&u()}return document.addEventListener("mousedown",d),document.addEventListener("contextmenu",h),document.addEventListener("keydown",m),()=>{document.removeEventListener("mousedown",d),document.removeEventListener("contextmenu",h),document.removeEventListener("keydown",m)}},[u,r]),f.useEffect(()=>{var h,m;const d=document.activeElement;return(m=(h=s.current)==null?void 0:h.querySelector("button:not(:disabled)"))==null||m.focus({preventScroll:!0}),()=>{var g;d instanceof HTMLElement&&d.isConnected&&(document.activeElement===document.body||(g=s.current)!=null&&g.contains(document.activeElement))&&d.focus({preventScroll:!0})}},[]),f.useLayoutEffect(()=>{if(s.current){const d=s.current.getBoundingClientRect(),h=j1(e,{width:d.width,height:d.height});a({x:Math.max(i.left+12,Math.min(h.left,i.left+i.width-d.width-12)),y:Math.max(i.top+12,Math.min(h.top,i.top+i.height-d.height-12))})}},[e,i]),kt.createPortal(l.jsx(Lc,{role:"menu",ref:s,className:"z-50 p-1.5 min-w-[160px] scrollbar-auto",style:{position:"fixed",left:o.x,top:o.y,maxWidth:i.width-24,maxHeight:i.height-24},children:n}),document.body)}function T1({icon:e,label:t,danger:n=!1,disabled:s=!1,onClick:r}){return l.jsxs(Ne,{role:"menuitem",danger:n,onClick:i=>{i.stopPropagation(),s||r()},disabled:s,children:[e&&l.jsx("span",{className:"flex-shrink-0 w-4 h-4 flex items-center justify-center",children:e}),l.jsx("span",{children:t})]})}const N1=500;function Go({instances:e,selectedId:t,onSelect:n,onShutdown:s,onNewInstance:r}){const{t:i}=G(),o=an(),{pathname:a}=Ee(),c=yi(),u=f.useId(),d=qo(C=>C.collapsedEdges),h=qo(C=>C.toggleEdge),m=me(C=>C.connectionState),[g,p]=f.useState(null),x=f.useRef(null),y=f.useRef(!1),[b,k]=f.useState(null),v=f.useRef(null),S=f.useCallback(()=>{x.current&&clearTimeout(x.current),x.current=null},[]);f.useEffect(()=>()=>{S(),v.current&&clearTimeout(v.current)},[S]);const w=f.useCallback((C,j)=>{S(),y.current=!1;const E=C.touches[0];if(!E)return;const P={x:E.clientX,y:E.clientY};x.current=setTimeout(()=>{var $;x.current=null,y.current=!0,($=navigator.vibrate)==null||$.call(navigator,10),p({position:P,instanceId:j})},N1)},[S]),M=f.useCallback(C=>{navigator.clipboard.writeText(C).then(()=>{k(C),v.current&&clearTimeout(v.current),v.current=setTimeout(()=>k(null),1500)},()=>{})},[]),T=f.useMemo(()=>{const C=new Map;for(const j of e){const E=C.get(j.edgeId);E?E.push(j):C.set(j.edgeId,[j])}return[...C.entries()].sort((j,E)=>j[0].localeCompare(E[0]))},[e]);return l.jsxs("aside",{className:"sidebar-layout select-none glass-panel flex min-h-0 w-full flex-1 flex-col overflow-hidden md:w-[240px] md:flex-none lg:w-[260px]",children:[l.jsxs("header",{className:"sidebar-header flex min-h-[60px] shrink-0 items-center gap-2 px-3 py-2",children:[l.jsxs("button",{type:"button",onClick:()=>o("/"),title:i("navigation.home"),"aria-label":i("navigation.home"),"aria-current":a==="/"?"page":void 0,className:"sidebar-brand flex min-w-0 flex-1 items-center gap-2 rounded-control text-left",children:[l.jsx("img",{src:c,alt:"",className:"h-[34px] w-[34px] shrink-0 object-contain"}),l.jsxs("span",{className:"min-w-0",children:[l.jsx("span",{className:"block truncate text-[14px] font-semibold leading-[20px] text-[var(--label-primary)]",children:i("navigation.brand")}),l.jsx("span",{className:"block text-[10px] leading-[14px] text-[var(--label-secondary)]",children:i(m==="connected"?"sidebar.hubConnected":m==="connecting"?"sidebar.hubConnecting":"sidebar.hubDisconnected")})]})]}),l.jsxs("nav",{className:"sidebar-navigation flex shrink-0 items-center gap-1","aria-label":i("navigation.main"),children:[l.jsx(Q,{size:"icon",type:"button",onClick:r,title:i("sidebar.newInstance"),"aria-label":i("sidebar.newInstance"),className:"navigation-create",children:l.jsx(Ha,{size:18,"aria-hidden":"true"})}),l.jsx("button",{type:"button",onClick:()=>o("/settings"),title:i("sidebar.settings"),"aria-label":i("sidebar.settings"),"aria-current":a==="/settings"?"page":void 0,className:"navigation-item",children:l.jsx(Vf,{size:18,"aria-hidden":"true"})})]})]}),l.jsx("section",{className:"instance-list flex min-h-0 min-w-0 flex-1 flex-col","aria-label":i("navigation.instances"),children:l.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-3 pb-3 pt-2 scrollbar-auto",children:e.length===0?l.jsxs("div",{className:"px-4 py-12 text-center text-[13px] leading-[20px] text-[var(--label-secondary)]",children:[l.jsx(Ff,{size:24,className:"mx-auto mb-3 opacity-60","aria-hidden":"true"}),i("sidebar.noInstances")]}):T.map(([C,j])=>l.jsxs("section",{className:"mb-3","data-edge-id":C,"aria-label":C,children:[l.jsxs("div",{className:"sidebar-edge-header flex items-center gap-1",children:[l.jsxs("button",{type:"button","aria-expanded":!d[C],"aria-controls":`${u}-edge-${encodeURIComponent(C)}`,"aria-label":i("sidebar.toggleMachine",{edgeId:C}),title:C,onClick:()=>h(C),className:"sidebar-edge-toggle flex min-w-0 flex-1 items-center gap-1.5 rounded-control px-2 py-1.5 text-left text-[11px] leading-[16px] text-[var(--label-secondary)]",children:[l.jsx(Je,{size:12,className:`shrink-0 ${d[C]?"":"rotate-90"}`,"aria-hidden":"true"}),l.jsx("span",{className:"truncate",children:C}),l.jsxs("span",{className:"shrink-0 tabular-nums",children:["(",j.length,")"]})]}),l.jsx(At,{label:i("sidebar.machineActions",{edgeId:C}),placement:"bottom",trigger:({open:E,id:P})=>l.jsx(Q,{size:"icon",type:"button",className:"sidebar-edge-actions","aria-label":i("sidebar.machineActions",{edgeId:C}),title:i("sidebar.machineActions",{edgeId:C}),"aria-haspopup":"dialog","aria-expanded":E,"aria-controls":E?P:void 0,children:b===C?l.jsx(Tt,{size:14,"aria-hidden":"true"}):l.jsx(Xs,{size:14,"aria-hidden":"true"})}),children:E=>l.jsx("div",{className:"p-2",children:l.jsxs(Ne,{onClick:()=>{M(C),E()},children:[l.jsx(Dr,{size:14,"aria-hidden":"true"}),i("sidebar.copyMachineId")]})})})]}),l.jsx("ul",{id:`${u}-edge-${encodeURIComponent(C)}`,hidden:!!d[C],className:"space-y-1",children:j.map(E=>{var R;const P=E.cwd.split("/").filter(Boolean).pop()||E.cwd,$=Rc(E.status),N=(R=E.contextUsage)==null?void 0:R.percent;return l.jsxs("li",{"data-instance-id":E.id,className:"instance-row relative","data-selected":t===E.id||void 0,children:[l.jsxs("button",{type:"button","data-instance-select":!0,title:E.cwd,"aria-current":t===E.id?"page":void 0,onClick:()=>{if(y.current){y.current=!1;return}n(E.id)},onTouchStart:I=>w(I,E.id),onTouchEnd:S,onTouchMove:S,onTouchCancel:S,className:"instance-item w-full rounded-control text-left",children:[l.jsx("span",{className:`instance-status h-2 w-2 rounded-full ${Mc(E.status)}`,title:i($),"aria-hidden":"true"}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("div",{className:"truncate text-[14px] font-medium leading-[20px] text-[var(--label-primary)]",children:P}),l.jsx("span",{className:"sr-only",children:i($)}),l.jsx("div",{className:"mt-0.5 truncate text-[11px] leading-[14px] text-[var(--label-secondary)]",children:E.model.name||`${E.model.provider}/${E.model.id}`}),N!=null&&N>0&&l.jsx("div",{className:"instance-progress-track mt-1.5 h-[3px] overflow-hidden rounded-full bg-[var(--fill-quaternary)]",role:"progressbar","aria-label":i("composer.contextUsage"),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.min(100,Math.max(0,N)),children:l.jsx("div",{className:"h-full rounded-full transition-[width] duration-300 motion-reduce:transition-none",style:{width:`${Math.max(2,Math.min(100,N))}%`,backgroundColor:N>=90?"var(--toast-icon-error)":N>=60?"var(--toast-icon-warning)":"var(--toast-icon-success)"}})})]})]}),l.jsx(Q,{size:"icon",type:"button","aria-label":i("navigation.instanceActions",{name:P}),title:i("navigation.instanceActions",{name:P}),className:"instance-actions absolute right-1 top-1/2 -translate-y-1/2 flex items-center justify-center text-[var(--label-secondary)]",onClick:I=>{const L=I.currentTarget.getBoundingClientRect();p({position:{x:L.left,y:L.bottom},instanceId:E.id})},children:l.jsx(Xs,{size:16,"aria-hidden":"true"})})]},E.id)})})]},C))})}),l.jsx($e,{children:g&&l.jsx(E1,{position:g.position,onClose:()=>p(null),children:l.jsx(T1,{icon:l.jsx(Pf,{size:14}),label:i("sidebar.shutdown"),danger:!0,onClick:()=>{s(g.instanceId),p(null)}})},g.instanceId)})]})}let Yo=0,Jo="";function Pc(e,t){f.useLayoutEffect(()=>{var r;const n=e.current;if(!n)return;const s=document.activeElement;return Yo++===0&&(Jo=document.body.style.overflow,document.body.style.overflow="hidden"),n.showModal(),(r=t.current)==null||r.focus({preventScroll:!0}),()=>{n.close(),--Yo===0&&(document.body.style.overflow=Jo),s instanceof HTMLElement&&s.isConnected&&s.focus({preventScroll:!0})}},[e,t])}function $c(e){if(e.defaultPrevented||e.key!=="Tab"||!e.currentTarget.contains(e.target))return;const t=Array.from(e.currentTarget.querySelectorAll('button, a[href], input, select, textarea, summary, [tabindex], [contenteditable="true"]')).filter(i=>{const o=getComputedStyle(i);return i.tabIndex>=0&&!i.matches(":disabled")&&!i.closest("[hidden], [inert]")&&o.display!=="none"&&o.visibility!=="hidden"}),n=t[0],s=t.at(-1);if(!n||!s)return;const r=document.activeElement;r instanceof HTMLElement&&!t.includes(r)?(e.preventDefault(),(e.shiftKey?s:n).focus({preventScroll:!0})):e.shiftKey&&r===n?(e.preventDefault(),s.focus({preventScroll:!0})):!e.shiftKey&&document.activeElement===s&&(e.preventDefault(),n.focus({preventScroll:!0}))}function bi(e){return l.jsx(hn,{features:ms,strict:!0,children:l.jsx(R1,{...e})})}function R1({src:e,alt:t,zoomable:n=!1,placeholder:s,onClose:r}){const{t:i}=G(),[o,a]=f.useState(!1),[c,u]=f.useState(null),d=f.useRef(null),h=f.useRef(null),m=f.useRef(null),g=hs(),p=f.useContext(Pe).reducedMotion,x=pn()||p==="always";Pc(d,h);function y(){g&&r()}function b(){a(v=>!v),m.current&&(m.current.scrollTop=0,m.current.scrollLeft=0)}const k=l.jsx("div",{onClick:v=>v.stopPropagation(),className:"max-w-full max-h-full overflow-auto rounded-content bg-[var(--btn-solid)] text-[var(--label-primary)] shadow-2xl",children:s});return kt.createPortal(l.jsxs(C1,{ref:d,role:"dialog","aria-modal":"true","aria-label":t??i("imagePreview.title"),inert:!g,"data-presence":g?"present":"exiting",className:"native-dialog-viewport image-lightbox fixed-viewport z-[9999] flex items-center justify-center bg-black/60 backdrop-blur-[30px]",initial:{opacity:x?1:0},animate:{opacity:1},exit:{opacity:0,transition:{duration:x?0:.15}},transition:{duration:x?0:.2},onClick:y,onKeyDown:$c,onCancel:v=>{v.preventDefault(),v.stopPropagation(),y()},children:[l.jsx("span",{ref:h,tabIndex:-1,className:"sr-only outline-none",children:t??i("imagePreview.title")}),n&&l.jsxs(Q,{size:"compact",type:"button",onClick:v=>{v.stopPropagation(),b()},className:"glass-panel absolute top-[max(1rem,env(safe-area-inset-top))] left-1/2 -translate-x-1/2 z-10 flex items-center gap-2 px-3 text-[13px] text-[var(--label-primary)] select-none hover:text-[var(--color-accent)] transition-colors focus-visible:outline-2 focus-visible:outline-[var(--color-accent)]",children:[o?l.jsx(Yf,{size:16}):l.jsx(Xf,{size:16}),i(o?"imagePreview.fitWindow":"imagePreview.actualSize")]}),l.jsx(Q,{size:"icon",type:"button",onClick:v=>{v.stopPropagation(),y()},className:`absolute top-[max(1rem,env(safe-area-inset-top))] right-[max(1rem,env(safe-area-inset-right))] z-10 flex items-center justify-center select-none transition-colors focus-visible:outline-2 focus-visible:outline-[var(--color-accent)] ${n?"glass-panel text-[var(--label-primary)] hover:text-[var(--color-accent)]":"bg-[var(--badge-bg)] hover:bg-[var(--badge-bg-hover)] text-[var(--badge-text)]"}`,"aria-label":i("imagePreview.close"),children:l.jsx(Vr,{size:18})}),n?l.jsxs("div",{className:"absolute left-[max(1rem,env(safe-area-inset-left))] right-[max(1rem,env(safe-area-inset-right))] top-[max(4.5rem,calc(env(safe-area-inset-top)+3.5rem))] bottom-[max(1rem,env(safe-area-inset-bottom))]",children:[l.jsx("div",{ref:m,tabIndex:0,role:"region","aria-label":i("imagePreview.title"),className:"h-full w-full overflow-auto focus-visible:outline-2 focus-visible:outline-[var(--color-accent)]",children:l.jsx("div",{className:`flex items-center justify-center ${o?"min-h-full min-w-full w-max":"h-full w-full"}`,children:e?l.jsx("img",{src:e,alt:t??i("imagePreview.title"),width:o?c==null?void 0:c.width:void 0,height:o?c==null?void 0:c.height:void 0,onLoad:v=>{const S=v.currentTarget;S.naturalWidth>0&&S.naturalHeight>0&&u({width:S.naturalWidth,height:S.naturalHeight})},onClick:v=>v.stopPropagation(),className:`block shrink-0 rounded-content bg-[var(--btn-solid)] shadow-2xl select-none ${o?"max-w-none max-h-none":"max-w-full max-h-full object-contain"}`,draggable:!1}):l.jsx("div",{"aria-hidden":"true",className:"shrink-0",style:o&&c?c:void 0})})}),!e&&l.jsx("div",{className:"absolute inset-0 flex items-center justify-center pointer-events-none",children:l.jsx("div",{className:"max-w-full max-h-full pointer-events-auto",children:k})})]}):e?l.jsx("img",{src:e,alt:t??i("imagePreview.title"),onClick:v=>v.stopPropagation(),className:"max-w-[90vw] max-h-[90vh] object-contain rounded-content shadow-2xl select-none",draggable:!1}):k]}),document.body)}function Oc({title:e,subtitle:t,backTo:n="/",actions:s,children:r}){const i=an(),{t:o}=G();return l.jsxs("div",{className:"md:hidden flex items-center gap-2",children:[l.jsx(Q,{size:"icon",type:"button",onClick:()=>i(n),"aria-label":o("navigation.backToInstances"),className:"flex shrink-0 select-none items-center justify-center text-[var(--label-secondary)] active:bg-[var(--fill-tertiary)] transition-opacity focus-visible:outline-2 focus-visible:outline-[var(--color-accent)]",children:l.jsx(Qd,{size:20})}),r??l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("div",{className:"text-[14px] font-medium text-[var(--label-primary)] truncate select-text",children:e}),t&&l.jsx("div",{className:"text-[11px] text-[var(--label-tertiary)] truncate select-text",children:t})]}),s]})]})}const vi=Object.freeze({text:"",images:[]}),rs=mn(e=>({drafts:new Map,setDraft:(t,n)=>{e(s=>{const r=s.drafts.get(t)??vi,i=typeof n=="function"?n(r):n,o=new Map(s.drafts);return i.text||i.images.length>0?o.set(t,i):o.delete(t),{drafts:o}})}})),M1=()=>gt(()=>import("./modalFeatures-D6PlDlrr.js"),__vite__mapDeps([0,1,2]),import.meta.url).then(e=>e.default);function Xo(e,t){const n=e.offset.y;return n>Math.abs(e.offset.x)&&(n>=Math.min(140,Math.max(80,t*.2))||n>=40&&e.velocity.y>=600)}function He(e){return l.jsx(hn,{features:M1,strict:!0,children:l.jsx(A1,{...e})})}function A1({title:e,trailing:t,onClose:n,children:s,mobileSheet:r=!0,size:i="detail",footer:o}){const{t:a}=G(),c=f.useId(),u=f.useRef(null),d=f.useRef(null),h=f.useRef(null),m=f.useRef(null),g=hs(),p=f.useContext(Pe).reducedMotion,x=pn()||p==="always",y=Zg(),b=Yg(0),[k,v]=f.useState(()=>window.matchMedia("(max-width: 767px)").matches),S=r&&k;Pc(u,d),f.useEffect(()=>{const C=window.matchMedia("(max-width: 767px)"),j=()=>{y.cancel(),b.set(0),v(C.matches)};return C.addEventListener("change",j),()=>C.removeEventListener("change",j)},[y,b]);function w(){g&&n()}const M={duration:x?0:.2,ease:"easeOut"},T={duration:x?0:.15,ease:"easeIn"};return kt.createPortal(l.jsxs("dialog",{ref:u,role:"dialog","aria-modal":"true","aria-labelledby":c,"data-presence":g?"present":"exiting",className:"native-dialog-viewport modal-viewport fixed-viewport",onCancel:C=>{C.preventDefault(),C.stopPropagation(),w()},onKeyDown:$c,children:[l.jsx(St,{className:"modal-overlay pointer-events-none absolute inset-0 bg-black/40 backdrop-blur-sm","aria-hidden":"true",initial:{opacity:x?1:0},animate:{opacity:1},exit:{opacity:0,transition:T},transition:M}),l.jsx("div",{className:"modal-positioner absolute inset-0 flex items-center justify-center","data-sheet":S,onPointerDown:C=>{m.current=C.target===C.currentTarget},onClick:C=>{C.target===C.currentTarget&&m.current!==!1&&w(),m.current=null},children:l.jsx(St,{ref:h,"data-size":i,className:"modal-panel flex min-h-0 flex-col overflow-hidden","data-sheet":S,style:{y:b},initial:x?!1:{opacity:S?1:0,scale:S?1:.96,y:S?"100%":0},animate:{opacity:1,scale:1,y:0},exit:{opacity:S?1:0,scale:x||S?1:.96,y:!x&&S?"100%":0,transition:T},transition:M,drag:S&&g&&!x?"y":!1,dragControls:y,dragListener:!1,dragConstraints:{top:0,bottom:0},dragElastic:{top:0,bottom:1},dragSnapToOrigin:!0,dragMomentum:!1,onDragEnd:(C,j)=>{var E;C.type!=="pointercancel"&&Xo(j,((E=h.current)==null?void 0:E.clientHeight)??0)&&w()},children:l.jsxs("div",{className:"modal-interior flex min-h-0 flex-1 flex-col",inert:!g,children:[S&&l.jsx(St,{className:"modal-grabber flex h-6 shrink-0 items-center justify-center select-none","aria-hidden":"true",onPanEnd:(C,j)=>{var E;x&&C.type!=="pointercancel"&&Xo(j,((E=h.current)==null?void 0:E.clientHeight)??0)&&w()},onPointerDown:C=>{!x&&C.isPrimary&&C.button===0&&y.start(C,{distanceThreshold:10})},children:l.jsx("span",{className:"h-1 w-9 rounded-full bg-[var(--label-tertiary)]"})}),l.jsxs("header",{className:"modal-header flex shrink-0 items-center justify-between gap-3 border-b border-[var(--separator)] px-4 py-1.5",children:[l.jsx("div",{id:c,ref:d,tabIndex:-1,className:"outline-none flex min-w-0 flex-wrap items-center gap-2 text-[15px] font-semibold text-[var(--label-primary)] select-none",children:e}),l.jsxs("div",{className:"flex shrink-0 items-center gap-2 select-none",children:[t,l.jsx(Q,{size:"icon",type:"button",onClick:w,"aria-label":a("common.close"),className:"modal-close select-none flex items-center justify-center text-[var(--label-secondary)] transition-colors hover:bg-[var(--fill-secondary)] focus-visible:outline-2 focus-visible:outline-[var(--color-accent)] motion-reduce:transition-none",children:l.jsx(Vr,{size:18,"aria-hidden":"true"})})]})]}),l.jsx("div",{className:"modal-content min-h-0 flex-1 overflow-auto scrollbar-auto",tabIndex:0,role:"region","aria-label":a("modal.content"),children:s}),o&&l.jsx("footer",{className:"ui-dialog-actions select-none",children:o})]})})})]}),document.body)}function L1({onClose:e,onConfirm:t}){const{t:n}=G(),s=f.useId(),r=f.useId(),[i,o]=f.useState(""),a=f.useCallback(()=>{t(i.trim()||void 0)},[i,t]);return l.jsx(He,{mobileSheet:!1,size:"form",footer:l.jsxs(l.Fragment,{children:[l.jsx(Q,{onClick:e,className:"active:bg-[var(--fill-tertiary)]",children:n("common.cancel")}),l.jsx(Q,{variant:"primary",onClick:a,children:n("compact.start")})]}),title:n("compact.title"),onClose:e,children:l.jsxs("div",{className:"ui-form-content",children:[l.jsx("p",{id:r,className:"ui-form-note select-none",children:n("compact.description")}),l.jsx(e0,{id:s,"aria-label":n("compact.placeholder"),"aria-describedby":r,value:i,onChange:c=>o(c.target.value),placeholder:n("compact.placeholder"),rows:3})]})})}function $t(e){if(!e)return 0;const t=getComputedStyle(e),n=Number.parseFloat(t.width);return Number.isFinite(n)?t.boxSizing==="border-box"?n:n+(Number.parseFloat(t.paddingLeft)||0)+(Number.parseFloat(t.paddingRight)||0)+(Number.parseFloat(t.borderLeftWidth)||0)+(Number.parseFloat(t.borderRightWidth)||0):e.offsetWidth}function I1({items:e}){const{t}=G(),n=f.useRef(null),s=f.useRef(new Map),r=f.useRef(null),[i,o]=f.useState([]),[a,c]=f.useState(!1),[u,d]=f.useState(null),h=f.useRef(null),m=e.find(g=>g.id===u);return f.useLayoutEffect(()=>{var y;if(a)return;const g=n.current;if(!g)return;const p=()=>{var T,C;const b=$t(g);if(!b)return;const k=parseFloat(getComputedStyle(g).columnGap)||0,v=e.map(j=>{const E=s.current.get(j.id),P=j.flexible?E==null?void 0:E.querySelector("[data-toolbar-label]"):null,$=P==null?void 0:P.querySelector("[data-toolbar-label-content]"),N=$t(E),R=$t($),I=Math.max(0,N-$t(P)),L=$?Math.ceil(I+R):N,O=$?Math.ceil(I+Math.min(j.minimumLabelWidth??0,R)):L;return{id:j.id,priority:j.priority,width:O,natural:L,control:E,flexible:j.flexible}});let S=v.reduce((j,E)=>j+E.width,0)+Math.max(0,v.length-1)*k;const w=[];if(S>b){S+=$t(r.current??void 0)+k;for(const j of[...v].sort((E,P)=>E.priority-P.priority)){if(S<=b)break;w.push(j.id),S-=j.width+k}}let M=Math.max(0,b-S);for(const j of v){if(!j.flexible||w.includes(j.id))continue;const E=Math.min(M,Math.max(0,j.natural-j.width)),P=`${j.width+E}px`;((T=j.control)==null?void 0:T.style.getPropertyValue("--toolbar-item-width"))!==P&&((C=j.control)==null||C.style.setProperty("--toolbar-item-width",P)),M-=E}o(j=>j.length===w.length&&j.every((E,P)=>E===w[P])?j:w)};p();const x=typeof ResizeObserver>"u"?null:new ResizeObserver(p);x==null||x.observe(g);for(const b of g.children)x==null||x.observe(b);for(const b of g.querySelectorAll("[data-toolbar-label-content]"))x==null||x.observe(b);return(y=document.fonts)==null||y.addEventListener("loadingdone",p),()=>{var b;x==null||x.disconnect(),(b=document.fonts)==null||b.removeEventListener("loadingdone",p)}},[e,a]),f.useLayoutEffect(()=>{var x;const g=n.current;if(!g)return;[...g.querySelectorAll(".adaptive-toolbar-hidden")].some(y=>y.contains(document.activeElement))&&((x=g.querySelector(".adaptive-toolbar-item:not(.adaptive-toolbar-hidden) button:not(:disabled), .adaptive-toolbar-more:not(.adaptive-toolbar-hidden) button"))==null||x.focus())},[i]),f.useLayoutEffect(()=>{var g,p;a&&((p=(g=h.current)==null?void 0:g.querySelector("button:not(:disabled)"))==null||p.focus())},[u,a]),l.jsxs("div",{ref:n,className:"composer-controls adaptive-toolbar",children:[e.map(g=>l.jsx("div",{ref:p=>{p?s.current.set(g.id,p):s.current.delete(g.id)},"data-toolbar-item":g.id,className:`adaptive-toolbar-item${g.flexible?" adaptive-toolbar-flexible":""}${i.includes(g.id)?" adaptive-toolbar-hidden":""}`,inert:i.includes(g.id)||void 0,"aria-hidden":i.includes(g.id)||void 0,children:g.control},g.id)),l.jsx("div",{ref:r,className:`adaptive-toolbar-more${i.length?"":" adaptive-toolbar-hidden"}`,inert:!i.length||void 0,"aria-hidden":!i.length||void 0,children:l.jsx(At,{label:t("composer.more"),width:280,align:"left",onOpenChange:g=>{c(g),d(null)},trigger:({open:g,id:p})=>l.jsx(Q,{size:"compact",className:"composer-control","aria-label":t("composer.more"),title:t("composer.more"),"aria-haspopup":"dialog","aria-expanded":g,"aria-controls":g?p:void 0,children:l.jsx(Xs,{size:18,"aria-hidden":"true"})}),children:g=>l.jsx("div",{ref:h,className:m!=null&&m.page?"ui-menu-layout select-none":"ui-menu-scroll select-none scrollbar-auto",style:{maxHeight:"inherit"},children:m!=null&&m.page?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"adaptive-toolbar-page-header",children:[l.jsx(Q,{size:"compact","aria-label":t("composer.backToOptions"),onClick:()=>d(null),children:l.jsx(Wd,{size:16,"aria-hidden":"true"})}),l.jsx("span",{children:m.pageLabel})]}),m.page(g)]}):e.filter(p=>i.includes(p.id)).map(p=>l.jsx("div",{children:p.menu(g,d)},p.id))})})})]})}const P1="Claude",bb=.8,vb=.1,$1="#D97757",wb=$1,Sb="#fff",Cb=.75,O1=f.memo(({size:e="1em",style:t,...n})=>l.jsxs("svg",{height:e,style:{flex:"none",lineHeight:1,...t},viewBox:"0 0 24 24",width:e,xmlns:"http://www.w3.org/2000/svg",...n,children:[l.jsx("title",{children:P1}),l.jsx("path",{d:"M4.709 15.955l4.72-2.647.08-.23-.08-.128H9.2l-.79-.048-2.698-.073-2.339-.097-2.266-.122-.571-.121L0 11.784l.055-.352.48-.321.686.06 1.52.103 2.278.158 1.652.097 2.449.255h.389l.055-.157-.134-.098-.103-.097-2.358-1.596-2.552-1.688-1.336-.972-.724-.491-.364-.462-.158-1.008.656-.722.881.06.225.061.893.686 1.908 1.476 2.491 1.833.365.304.145-.103.019-.073-.164-.274-1.355-2.446-1.446-2.49-.644-1.032-.17-.619a2.97 2.97 0 01-.104-.729L6.283.134 6.696 0l.996.134.42.364.62 1.414 1.002 2.229 1.555 3.03.456.898.243.832.091.255h.158V9.01l.128-1.706.237-2.095.23-2.695.08-.76.376-.91.747-.492.584.28.48.685-.067.444-.286 1.851-.559 2.903-.364 1.942h.212l.243-.242.985-1.306 1.652-2.064.73-.82.85-.904.547-.431h1.033l.76 1.129-.34 1.166-1.064 1.347-.881 1.142-1.264 1.7-.79 1.36.073.11.188-.02 2.856-.606 1.543-.28 1.841-.315.833.388.091.395-.328.807-1.969.486-2.309.462-3.439.813-.042.03.049.061 1.549.146.662.036h1.622l3.02.225.79.522.474.638-.079.485-1.215.62-1.64-.389-3.829-.91-1.312-.329h-.182v.11l1.093 1.068 2.006 1.81 2.509 2.33.127.578-.322.455-.34-.049-2.205-1.657-.851-.747-1.926-1.62h-.128v.17l.444.649 2.345 3.521.122 1.08-.17.353-.608.213-.668-.122-1.374-1.925-1.415-2.167-1.143-1.943-.14.08-.674 7.254-.316.37-.729.28-.607-.461-.322-.747.322-1.476.389-1.924.315-1.53.286-1.9.17-.632-.012-.042-.14.018-1.434 1.967-2.18 2.945-1.726 1.845-.414.164-.717-.37.067-.662.401-.589 2.388-3.036 1.44-1.882.93-1.086-.006-.158h-.055L4.132 18.56l-1.13.146-.487-.456.061-.746.231-.243 1.908-1.312-.006.006z",fill:"#D97757",fillRule:"nonzero"})]})),_1="DeepSeek",kb=.65,jb=.2,F1="#4D6BFE",Eb=F1,Tb="#fff",Nb=.75,D1=f.memo(({size:e="1em",style:t,...n})=>l.jsxs("svg",{height:e,style:{flex:"none",lineHeight:1,...t},viewBox:"0 0 24 24",width:e,xmlns:"http://www.w3.org/2000/svg",...n,children:[l.jsx("title",{children:_1}),l.jsx("path",{d:"M23.748 4.482c-.254-.124-.364.113-.512.234-.051.039-.094.09-.137.136-.372.397-.806.657-1.373.626-.829-.046-1.537.214-2.163.848-.133-.782-.575-1.248-1.247-1.548-.352-.156-.708-.311-.955-.65-.172-.241-.219-.51-.305-.774-.055-.16-.11-.323-.293-.35-.2-.031-.278.136-.356.276-.313.572-.434 1.202-.422 1.84.027 1.436.633 2.58 1.838 3.393.137.093.172.187.129.323-.082.28-.18.552-.266.833-.055.179-.137.217-.329.14a5.526 5.526 0 01-1.736-1.18c-.857-.828-1.631-1.742-2.597-2.458a11.365 11.365 0 00-.689-.471c-.985-.957.13-1.743.388-1.836.27-.098.093-.432-.779-.428-.872.004-1.67.295-2.687.684a3.055 3.055 0 01-.465.137 9.597 9.597 0 00-2.883-.102c-1.885.21-3.39 1.102-4.497 2.623C.082 8.606-.231 10.684.152 12.85c.403 2.284 1.569 4.175 3.36 5.653 1.858 1.533 3.997 2.284 6.438 2.14 1.482-.085 3.133-.284 4.994-1.86.47.234.962.327 1.78.397.63.059 1.236-.03 1.705-.128.735-.156.684-.837.419-.961-2.155-1.004-1.682-.595-2.113-.926 1.096-1.296 2.746-2.642 3.392-7.003.05-.347.007-.565 0-.845-.004-.17.035-.237.23-.256a4.173 4.173 0 001.545-.475c1.396-.763 1.96-2.015 2.093-3.517.02-.23-.004-.467-.247-.588zM11.581 18c-2.089-1.642-3.102-2.183-3.52-2.16-.392.024-.321.471-.235.763.09.288.207.486.371.739.114.167.192.416-.113.603-.673.416-1.842-.14-1.897-.167-1.361-.802-2.5-1.86-3.301-3.307-.774-1.393-1.224-2.887-1.298-4.482-.02-.386.093-.522.477-.592a4.696 4.696 0 011.529-.039c2.132.312 3.946 1.265 5.468 2.774.868.86 1.525 1.887 2.202 2.891.72 1.066 1.494 2.082 2.48 2.914.348.292.625.514.891.677-.802.09-2.14.11-3.054-.614zm1-6.44a.306.306 0 01.415-.287.302.302 0 01.2.288.306.306 0 01-.31.307.303.303 0 01-.304-.308zm3.11 1.596c-.2.081-.399.151-.59.16a1.245 1.245 0 01-.798-.254c-.274-.23-.47-.358-.552-.758a1.73 1.73 0 01.016-.588c.07-.327-.008-.537-.239-.727-.187-.156-.426-.199-.688-.199a.559.559 0 01-.254-.078c-.11-.054-.2-.19-.114-.358.028-.054.16-.186.192-.21.356-.202.767-.136 1.146.016.352.144.618.408 1.001.782.391.451.462.576.685.914.176.265.336.537.445.848.067.195-.019.354-.25.452z",fill:"#4D6BFE"})]})),V1=new RegExp("\\p{Lu}?\\p{Ll}+|[0-9]+|\\p{Lu}+(?!\\p{Ll})|\\p{Emoji_Presentation}|\\p{Extended_Pictographic}|\\p{L}+","gu");function B1(e){return Array.from(e.match(V1)??[])}function _c(e){return B1(e).map(t=>t.toLowerCase()).join("-")}const z1=e=>{const t=f.useId(),n=`lobe-icons-${_c(e)}-${t}`;return f.useMemo(()=>({fill:`url(#${n})`,id:n}),[e])},H1=(e,t)=>{const n=f.useId();return f.useMemo(()=>Array.from({length:t},(s,r)=>{const i=`lobe-icons-${_c(e)}-${r}-${n}`;return{fill:`url(#${i})`,id:i}}),[e,t,n])},Zo="Gemini",Rb=.8,Mb=.2,U1="#fff",Ab=U1,Lb="#fff",Ib=.8,K1=f.memo(({size:e="1em",style:t,...n})=>{const[s,r,i]=H1(Zo,3);return l.jsxs("svg",{height:e,style:{flex:"none",lineHeight:1,...t},viewBox:"0 0 24 24",width:e,xmlns:"http://www.w3.org/2000/svg",...n,children:[l.jsx("title",{children:Zo}),l.jsx("path",{d:"M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z",fill:"#3186FF"}),l.jsx("path",{d:"M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z",fill:s.fill}),l.jsx("path",{d:"M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z",fill:r.fill}),l.jsx("path",{d:"M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z",fill:i.fill}),l.jsxs("defs",{children:[l.jsxs("linearGradient",{gradientUnits:"userSpaceOnUse",id:s.id,x1:"7",x2:"11",y1:"15.5",y2:"12",children:[l.jsx("stop",{stopColor:"#08B962"}),l.jsx("stop",{offset:"1",stopColor:"#08B962",stopOpacity:"0"})]}),l.jsxs("linearGradient",{gradientUnits:"userSpaceOnUse",id:r.id,x1:"8",x2:"11.5",y1:"5.5",y2:"11",children:[l.jsx("stop",{stopColor:"#F94543"}),l.jsx("stop",{offset:"1",stopColor:"#F94543",stopOpacity:"0"})]}),l.jsxs("linearGradient",{gradientUnits:"userSpaceOnUse",id:i.id,x1:"3.5",x2:"17.5",y1:"13.5",y2:"12",children:[l.jsx("stop",{stopColor:"#FABC12"}),l.jsx("stop",{offset:".46",stopColor:"#FABC12",stopOpacity:"0"})]})]})]})}),W1="Grok",Pb=.75,$b=.2,q1="#000",Ob=q1,_b="#fff",Fb=.75,G1=f.memo(({size:e="1em",style:t,...n})=>l.jsxs("svg",{fill:"currentColor",fillRule:"evenodd",height:e,style:{flex:"none",lineHeight:1,...t},viewBox:"0 0 24 24",width:e,xmlns:"http://www.w3.org/2000/svg",...n,children:[l.jsx("title",{children:W1}),l.jsx("path",{d:"M9.27 15.29l7.978-5.897c.391-.29.95-.177 1.137.272.98 2.369.542 5.215-1.41 7.169-1.951 1.954-4.667 2.382-7.149 1.406l-2.711 1.257c3.889 2.661 8.611 2.003 11.562-.953 2.341-2.344 3.066-5.539 2.388-8.42l.006.007c-.983-4.232.242-5.924 2.75-9.383.06-.082.12-.164.179-.248l-3.301 3.305v-.01L9.267 15.292M7.623 16.723c-2.792-2.67-2.31-6.801.071-9.184 1.761-1.763 4.647-2.483 7.166-1.425l2.705-1.25a7.808 7.808 0 00-1.829-1A8.975 8.975 0 005.984 5.83c-2.533 2.536-3.33 6.436-1.962 9.764 1.022 2.487-.653 4.246-2.34 6.022-.599.63-1.199 1.259-1.682 1.925l7.62-6.815"})]})),Y1="Hunyuan",Db=.75,Vb=.2,J1="#0053e0",Bb=J1,zb="#fff",Hb=.75,X1=f.memo(({size:e="1em",style:t,...n})=>l.jsxs("svg",{height:e,style:{flex:"none",lineHeight:1,...t},viewBox:"0 0 24 24",width:e,xmlns:"http://www.w3.org/2000/svg",...n,children:[l.jsx("title",{children:Y1}),l.jsx("circle",{cx:"12",cy:"12",fill:"#0055E9",r:"12"}),l.jsx("path",{d:"M12 0c.518 0 1.028.033 1.528.096A6.188 6.188 0 0112.12 12.28l-.12.001c-2.99 0-5.242 2.179-5.554 5.11-.223 2.086.353 4.412 2.242 6.146C3.672 22.1 0 17.479 0 12 0 5.373 5.373 0 12 0z",fill:"#A8DFF5"}),l.jsx("path",{d:"M5.286 5a2.438 2.438 0 01.682 3.38c-3.962 5.966-3.215 10.743 2.648 15.136C3.636 22.056 0 17.452 0 12c0-1.787.39-3.482 1.09-5.006.253-.435.525-.872.817-1.311A2.438 2.438 0 015.286 5z",fill:"#0055E9"}),l.jsx("path",{d:"M12.98.04c.272.021.543.053.81.093.583.106 1.117.254 1.538.44 6.638 2.927 8.07 10.052 1.748 15.642a4.125 4.125 0 01-5.822-.358c-1.51-1.706-1.3-4.184.357-5.822.858-.848 3.108-1.223 4.045-2.441 1.257-1.634 2.122-6.009-2.523-7.506L12.98.039z",fill:"#00BCFF"}),l.jsx("path",{d:"M13.528.096A6.187 6.187 0 0112 12.281a5.75 5.75 0 00-1.71.255c.147-.905.595-1.784 1.321-2.501.858-.848 3.108-1.223 4.045-2.441 1.27-1.651 2.14-6.104-2.676-7.554.184.014.367.033.548.056z",fill:"#ECECEE"})]})),Qo="Minimax",Ub=.45,Kb=.15,Wb="#F23F5D",Z1="linear-gradient(to right, #E2167E, #FE603C)",qb=Z1,Gb="#fff",Yb=.75,Q1=f.memo(({size:e="1em",style:t,...n})=>{const{id:s,fill:r}=z1(Qo);return l.jsxs("svg",{height:e,style:{flex:"none",lineHeight:1,...t},viewBox:"0 0 24 24",width:e,xmlns:"http://www.w3.org/2000/svg",...n,children:[l.jsx("title",{children:Qo}),l.jsx("defs",{children:l.jsxs("linearGradient",{id:s,x1:"0%",x2:"100.182%",y1:"50.057%",y2:"50.057%",children:[l.jsx("stop",{offset:"0%",stopColor:"#E2167E"}),l.jsx("stop",{offset:"100%",stopColor:"#FE603C"})]})}),l.jsx("path",{d:"M16.278 2c1.156 0 2.093.927 2.093 2.07v12.501a.74.74 0 00.744.709.74.74 0 00.743-.709V9.099a2.06 2.06 0 012.071-2.049A2.06 2.06 0 0124 9.1v6.561a.649.649 0 01-.652.645.649.649 0 01-.653-.645V9.1a.762.762 0 00-.766-.758.762.762 0 00-.766.758v7.472a2.037 2.037 0 01-2.048 2.026 2.037 2.037 0 01-2.048-2.026v-12.5a.785.785 0 00-.788-.753.785.785 0 00-.789.752l-.001 15.904A2.037 2.037 0 0113.441 22a2.037 2.037 0 01-2.048-2.026V18.04c0-.356.292-.645.652-.645.36 0 .652.289.652.645v1.934c0 .263.142.506.372.638.23.131.514.131.744 0a.734.734 0 00.372-.638V4.07c0-1.143.937-2.07 2.093-2.07zm-5.674 0c1.156 0 2.093.927 2.093 2.07v11.523a.648.648 0 01-.652.645.648.648 0 01-.652-.645V4.07a.785.785 0 00-.789-.78.785.785 0 00-.789.78v14.013a2.06 2.06 0 01-2.07 2.048 2.06 2.06 0 01-2.071-2.048V9.1a.762.762 0 00-.766-.758.762.762 0 00-.766.758v3.8a2.06 2.06 0 01-2.071 2.049A2.06 2.06 0 010 12.9v-1.378c0-.357.292-.646.652-.646.36 0 .653.29.653.646V12.9c0 .418.343.757.766.757s.766-.339.766-.757V9.099a2.06 2.06 0 012.07-2.048 2.06 2.06 0 012.071 2.048v8.984c0 .419.343.758.767.758.423 0 .766-.339.766-.758V4.07c0-1.143.937-2.07 2.093-2.07z",fill:r,fillRule:"nonzero"})]})}),ey="MoonshotAI",Jb=.75,Xb=.4,ty="#16191E",Zb=ty,Qb="#fff",ev=.75,ny=f.memo(({size:e="1em",style:t,...n})=>l.jsxs("svg",{fill:"currentColor",fillRule:"evenodd",height:e,style:{flex:"none",lineHeight:1,...t},viewBox:"0 0 24 24",width:e,xmlns:"http://www.w3.org/2000/svg",...n,children:[l.jsx("title",{children:ey}),l.jsx("path",{d:"M1.052 16.916l9.539 2.552a21.007 21.007 0 00.06 2.033l5.956 1.593a11.997 11.997 0 01-5.586.865l-.18-.016-.044-.004-.084-.009-.094-.01a11.605 11.605 0 01-.157-.02l-.107-.014-.11-.016a11.962 11.962 0 01-.32-.051l-.042-.008-.075-.013-.107-.02-.07-.015-.093-.019-.075-.016-.095-.02-.097-.023-.094-.022-.068-.017-.088-.022-.09-.024-.095-.025-.082-.023-.109-.03-.062-.02-.084-.025-.093-.028-.105-.034-.058-.019-.08-.026-.09-.031-.066-.024a6.293 6.293 0 01-.044-.015l-.068-.025-.101-.037-.057-.022-.08-.03-.087-.035-.088-.035-.079-.032-.095-.04-.063-.028-.063-.027a5.655 5.655 0 01-.041-.018l-.066-.03-.103-.047-.052-.024-.096-.046-.062-.03-.084-.04-.086-.044-.093-.047-.052-.027-.103-.055-.057-.03-.058-.032a6.49 6.49 0 01-.046-.026l-.094-.053-.06-.034-.051-.03-.072-.041-.082-.05-.093-.056-.052-.032-.084-.053-.061-.039-.079-.05-.07-.047-.053-.035a7.785 7.785 0 01-.054-.036l-.044-.03-.044-.03a6.066 6.066 0 01-.04-.028l-.057-.04-.076-.054-.069-.05-.074-.054-.056-.042-.076-.057-.076-.059-.086-.067-.045-.035-.064-.052-.074-.06-.089-.073-.046-.039-.046-.039a7.516 7.516 0 01-.043-.037l-.045-.04-.061-.053-.07-.062-.068-.06-.062-.058-.067-.062-.053-.05-.088-.084a13.28 13.28 0 01-.099-.097l-.029-.028-.041-.042-.069-.07-.05-.051-.05-.053a6.457 6.457 0 01-.168-.179l-.08-.088-.062-.07-.071-.08-.042-.049-.053-.062-.058-.068-.046-.056a7.175 7.175 0 01-.027-.033l-.045-.055-.066-.082-.041-.052-.05-.064-.02-.025a11.99 11.99 0 01-1.44-2.402zm-1.02-5.794l11.353 3.037a20.468 20.468 0 00-.469 2.011l10.817 2.894a12.076 12.076 0 01-1.845 2.005L.657 15.923l-.016-.046-.035-.104a11.965 11.965 0 01-.05-.153l-.007-.023a11.896 11.896 0 01-.207-.741l-.03-.126-.018-.08-.021-.097-.018-.081-.018-.09-.017-.084-.018-.094c-.026-.141-.05-.283-.071-.426l-.017-.118-.011-.083-.013-.102a12.01 12.01 0 01-.019-.161l-.005-.047a12.12 12.12 0 01-.034-2.145zm1.593-5.15l11.948 3.196c-.368.605-.705 1.231-1.01 1.875l11.295 3.022c-.142.82-.368 1.612-.668 2.365l-11.55-3.09L.124 10.26l.015-.1.008-.049.01-.067.015-.087.018-.098c.026-.148.056-.295.088-.442l.028-.124.02-.085.024-.097c.022-.09.045-.18.07-.268l.028-.102.023-.083.03-.1.025-.082.03-.096.026-.082.031-.095a11.896 11.896 0 011.01-2.232zm4.442-4.4L17.352 4.59a20.77 20.77 0 00-1.688 1.721l7.823 2.093c.267.852.442 1.744.513 2.665L2.106 5.213l.045-.065.027-.04.04-.055.046-.065.055-.076.054-.072.064-.086.05-.065.057-.073.055-.07.06-.074.055-.069.065-.077.054-.066.066-.077.053-.06.072-.082.053-.06.067-.074.054-.058.073-.078.058-.06.063-.067.168-.17.1-.098.059-.056.076-.071a12.084 12.084 0 012.272-1.677zM12.017 0h.097l.082.001.069.001.054.002.068.002.046.001.076.003.047.002.06.003.054.002.087.005.105.007.144.011.088.007.044.004.077.008.082.008.047.005.102.012.05.006.108.014.081.01.042.006.065.01.207.032.07.012.065.011.14.026.092.018.11.022.046.01.075.016.041.01L14.7.3l.042.01.065.015.049.012.071.017.096.024.112.03.113.03.113.032.05.015.07.02.078.024.073.023.05.016.05.016.076.025.099.033.102.036.048.017.064.023.093.034.11.041.116.045.1.04.047.02.06.024.041.018.063.026.04.018.057.025.11.048.1.046.074.035.075.036.06.028.092.046.091.045.102.052.053.028.049.026.046.024.06.033.041.022.052.029.088.05.106.06.087.051.057.034.053.032.096.059.088.055.098.062.036.024.064.041.084.056.04.027.062.042.062.043.023.017c.054.037.108.075.161.114l.083.06.065.048.056.043.086.065.082.064.04.03.05.041.086.069.079.065.085.071c.712.6 1.353 1.283 1.909 2.031L7.222.994l.062-.027.065-.028.081-.034.086-.035c.113-.045.227-.09.341-.131l.096-.035.093-.033.084-.03.096-.031c.087-.03.176-.058.264-.085l.091-.027.086-.025.102-.03.085-.023.1-.026L9.04.37l.09-.023.091-.022.095-.022.09-.02.098-.021.091-.02.095-.018.092-.018.1-.018.091-.016.098-.017.092-.014.097-.015.092-.013.102-.013.091-.012.105-.012.09-.01.105-.01c.093-.01.186-.018.28-.024l.106-.008.09-.005.11-.006.093-.004.1-.004.097-.002.099-.002.197-.002z"})]})),sy="OpenAI",tv=.75,nv=.1,ry="#000",sv="#19C37D",rv="#AB68FF",iv="#F86AA4",ov="#F9C322",av="#0099FF",lv="#0000FE",cv=ry,uv="#fff",dv=.75,et=f.memo(({size:e="1em",style:t,...n})=>l.jsxs("svg",{fill:"currentColor",fillRule:"evenodd",height:e,style:{flex:"none",lineHeight:1,...t},viewBox:"0 0 24 24",width:e,xmlns:"http://www.w3.org/2000/svg",...n,children:[l.jsx("title",{children:sy}),l.jsx("path",{d:"M9.205 8.658v-2.26c0-.19.072-.333.238-.428l4.543-2.616c.619-.357 1.356-.523 2.117-.523 2.854 0 4.662 2.212 4.662 4.566 0 .167 0 .357-.024.547l-4.71-2.759a.797.797 0 00-.856 0l-5.97 3.473zm10.609 8.8V12.06c0-.333-.143-.57-.429-.737l-5.97-3.473 1.95-1.118a.433.433 0 01.476 0l4.543 2.617c1.309.76 2.189 2.378 2.189 3.948 0 1.808-1.07 3.473-2.76 4.163zM7.802 12.703l-1.95-1.142c-.167-.095-.239-.238-.239-.428V5.899c0-2.545 1.95-4.472 4.591-4.472 1 0 1.927.333 2.712.928L8.23 5.067c-.285.166-.428.404-.428.737v6.898zM12 15.128l-2.795-1.57v-3.33L12 8.658l2.795 1.57v3.33L12 15.128zm1.796 7.23c-1 0-1.927-.332-2.712-.927l4.686-2.712c.285-.166.428-.404.428-.737v-6.898l1.974 1.142c.167.095.238.238.238.428v5.233c0 2.545-1.974 4.472-4.614 4.472zm-5.637-5.303l-4.544-2.617c-1.308-.761-2.188-2.378-2.188-3.948A4.482 4.482 0 014.21 6.327v5.423c0 .333.143.571.428.738l5.947 3.449-1.95 1.118a.432.432 0 01-.476 0zm-.262 3.9c-2.688 0-4.662-2.021-4.662-4.519 0-.19.024-.38.047-.57l4.686 2.71c.286.167.571.167.856 0l5.97-3.448v2.26c0 .19-.07.333-.237.428l-4.543 2.616c-.619.357-1.356.523-2.117.523zm5.899 2.83a5.947 5.947 0 005.827-4.756C22.287 18.339 24 15.84 24 13.296c0-1.665-.713-3.282-1.998-4.448.119-.5.19-.999.19-1.498 0-3.401-2.759-5.947-5.946-5.947-.642 0-1.26.095-1.88.31A5.962 5.962 0 0010.205 0a5.947 5.947 0 00-5.827 4.757C1.713 5.447 0 7.945 0 10.49c0 1.666.713 3.283 1.998 4.448-.119.5-.19 1-.19 1.499 0 3.401 2.759 5.946 5.946 5.946.642 0 1.26-.095 1.88-.309a5.96 5.96 0 004.162 1.713z"})]})),iy="Qwen",fv=.7,hv=.2,oy="#082dff",pv=oy,mv="#fff",gv=.6,ay=f.memo(({size:e="1em",style:t,...n})=>l.jsxs("svg",{height:e,style:{flex:"none",lineHeight:1,...t},viewBox:"0 0 24 24",width:e,xmlns:"http://www.w3.org/2000/svg",...n,children:[l.jsx("title",{children:iy}),l.jsx("path",{d:"M19.713 2.825h-5.907c0-.251-.066-.503-.196-.728L12.819.728A1.46 1.46 0 0 0 11.559 0h-1.58c-.52 0-1 .275-1.26.728l-2.42 4.19a1.45 1.45 0 0 0 0 1.453l.791 1.37c.26.448.74.727 1.26.727h11.36c.52 0 1-.275 1.26-.728l.79-1.37a1.45 1.45 0 0 0 0-1.451l-.79-1.37a1.46 1.46 0 0 0-1.26-.728zM.195 9.905l2.951 5.115a1.46 1.46 0 0 0-.531.531l-.791 1.37a1.45 1.45 0 0 0 0 1.452l.79 1.37c.26.448.74.727 1.26.727h4.84c.52 0 1-.275 1.26-.728l.79-1.37a1.45 1.45 0 0 0 0-1.451L5.086 7.083a1.46 1.46 0 0 0-1.26-.728h-1.58c-.52 0-1 .276-1.26.728l-.79 1.37a1.45 1.45 0 0 0 0 1.452m15.888 13.367 2.951-5.115c.217.125.469.196.728.196h1.582c.52 0 1-.275 1.26-.728l.79-1.37a1.45 1.45 0 0 0 0-1.451l-2.42-4.191a1.46 1.46 0 0 0-1.259-.728h-1.582c-.52 0-1 .276-1.259.728l-5.678 9.838a1.45 1.45 0 0 0 0 1.452l.79 1.37c.26.448.74.727 1.26.727h1.582c.52 0 1-.275 1.26-.728z",fill:"#082dff"})]})),ly="Z.ai",yv=.9,xv=.3,cy="#000",bv=cy,vv="#fff",wv=.6,uy=f.memo(({size:e="1em",style:t,...n})=>l.jsxs("svg",{fill:"currentColor",fillRule:"evenodd",height:e,style:{flex:"none",lineHeight:1,...t},viewBox:"0 0 24 24",width:e,xmlns:"http://www.w3.org/2000/svg",...n,children:[l.jsx("title",{children:ly}),l.jsx("path",{d:"M12.105 2L9.927 4.953H.653L2.83 2h9.276zM23.254 19.048L21.078 22h-9.242l2.174-2.952h9.244zM24 2L9.264 22H0L14.736 2H24z"})]})),dy=[{Icon:et,keywords:["gpt-3"],props:{type:"gpt3"}},{Icon:et,keywords:["gpt-4"],props:{type:"gpt4"}},{Icon:et,keywords:["gpt-5"],props:{type:"gpt5"}},{keywords:["sora"]},{Icon:et,keywords:["gpt-oss"],props:{type:"oss"}},{Icon:et,keywords:["o1-","^o1","/o1","o3-","^o3","/o3","o4-","^o4","/o4"],props:{type:"o1"}},{keywords:["dalle","dall-e"]},{Icon:et,keywords:["text-embedding-","tts-","whisper-","codex","davinci","babbage","omni-moderation","text-moderation","text-adb","text-ada","computer-use"],props:{type:"platform"}},{Icon:et,keywords:["^gpt-","/gpt-","openai"]},{keywords:["^glm-(.*)v","/glm-(.*)v","-glm-(.*)v"]},{Icon:uy,keywords:["^glm-5","/glm-5","/glm5","-glm-4","^glm-4","/glm-4","/glm4","-glm-5"]},{Icon:O1,keywords:["claude"]},{keywords:["gemini-3.1-flash-image-preview","gemini-3-pro-image-preview","gemini-\\d+(?:\\.\\d+)?-(?:flash(?:-lite)?|pro)-image(?:-preview)?(?::|$)","nanobanana","nano-banana"]},{Icon:K1,keywords:["gemini"]},{Icon:ny,keywords:["kimi","moonshot"]},{Icon:ay,keywords:["qwen","qwq","qvq","wanx","wan\\d/","wan\\d\\.\\d-","tongyi","gte-rerank"]},{Icon:Q1,keywords:["minimax","abab","^image-"]},{Icon:X1,keywords:["hunyuan","hy3","hy4"]},{Icon:G1,keywords:["^grok-","/grok-"]},{Icon:D1,keywords:["deepseek"]}],fy=dy.map(e=>({...e,patterns:e.keywords.map(t=>new RegExp(t,"i"))})),hy=f.lazy(async()=>{try{const[{default:e},{modelMappings:t}]=await Promise.all([gt(()=>import("./index-PCm-hUF1.js"),__vite__mapDeps([3,4,1,2,5]),import.meta.url),gt(()=>import("./modelConfig-BvuGgERB.js").then(s=>s.m),__vite__mapDeps([4,1,2]),import.meta.url)]),n=t.flatMap(({keywords:s})=>s.map(r=>new RegExp(r,"i")));return{default:({model:s,size:r})=>n.some(i=>i.test(s.toLowerCase()))?l.jsx(e,{model:s,type:"color",size:r}):l.jsx(Js,{size:r})}}catch{return{default:({size:e})=>l.jsx(Js,{size:e})}}});function Fc({model:e,size:t=14}){const n=e.toLowerCase(),s=fy.find(({patterns:i})=>i.some(o=>o.test(n))),r=s==null?void 0:s.Icon;return l.jsx("span",{"aria-hidden":"true",className:"model-brand-icon",style:{width:t,height:t},children:r?l.jsx(r,{size:t,...s.props}):l.jsx(f.Suspense,{fallback:null,children:l.jsx(hy,{model:e,size:t})})})}function Dc({currentModel:e,availableModels:t,onSelect:n,onDone:s}){const r=new Map;for(const i of t??[]){const o=r.get(i.provider)??[];o.push(i),r.set(i.provider,o)}return l.jsx("div",{className:"ui-menu-scroll select-none scrollbar-auto",style:{maxHeight:"inherit"},children:Array.from(r.entries()).map(([i,o],a)=>l.jsxs("div",{children:[a>0&&l.jsx("div",{className:"mx-1 my-1 h-px bg-[var(--separator)]"}),l.jsx("div",{className:"ui-menu-section",children:i}),o.map(c=>{const u=c.provider===e.provider&&c.id===e.id;return l.jsxs(Ne,{selected:u,"aria-pressed":u,onClick:()=>{u||n==null||n(c.provider,c.id),s()},children:[l.jsx(Fc,{model:c.id,size:18}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("div",{className:"text-[13px] text-[var(--label-primary)] truncate",children:c.name||c.id}),l.jsx("div",{className:"text-[12px] text-[var(--label-secondary)] truncate",children:c.id})]}),u&&l.jsx(Tt,{size:14,className:"text-[var(--color-accent)] flex-shrink-0"})]},`${c.provider}/${c.id}`)})]},i))})}function py({currentModel:e,availableModels:t,className:n="",onSelect:s}){const{t:r}=G(),o=t&&t.length>0&&s;return l.jsx(At,{label:r("composer.model"),disabled:!o,width:280,align:"left",trigger:({open:a,id:c})=>l.jsxs(Q,{size:"compact",type:"button",disabled:!o,"aria-label":`${r("composer.model")}: ${e.name||e.id}`,"aria-haspopup":o?"dialog":void 0,"aria-expanded":o?a:void 0,"aria-controls":a?c:void 0,title:e.name||e.id,className:`inline-flex max-w-full items-center gap-1.5 px-2 text-[12px] font-normal disabled:opacity-100 transition-colors focus-visible:outline-2 focus-visible:outline-[var(--color-accent)] ${o?"hover:bg-[var(--fill-secondary)] hover:text-[var(--label-primary)] cursor-pointer":"cursor-default"} text-[var(--label-secondary)] ${n}`,children:[l.jsx(Fc,{model:e.id}),l.jsx("span",{"data-toolbar-label":!0,className:"composer-model-name truncate",children:l.jsx("span",{"data-toolbar-label-content":!0,children:e.name||e.id})}),o&&l.jsx(Da,{size:12,"aria-hidden":"true",className:`selector-chevron shrink-0 transition-transform motion-reduce:transition-none ${a?"rotate-180":""}`})]}),children:a=>l.jsx(Dc,{currentModel:e,availableModels:t,onSelect:s,onDone:a})})}const my=["off","minimal","low","medium","high"];function Vc({currentLevel:e,availableLevels:t,onSelect:n,onDone:s}){const r=t.length>0?t:my;return l.jsx("div",{className:"ui-menu-scroll select-none scrollbar-auto",style:{maxHeight:"inherit"},children:r.map(i=>{const o=i===e;return l.jsxs(Ne,{selected:o,type:"button","aria-pressed":o,onClick:()=>{o||n==null||n(i),s()},children:[l.jsx("span",{className:"flex-1 text-[13px] text-[var(--label-primary)]",children:i}),o&&l.jsx(Tt,{size:14,className:"text-[var(--color-accent)] flex-shrink-0","aria-hidden":"true"})]},i)})})}function gy({currentLevel:e,availableLevels:t,onSelect:n,showLabel:s=!1,pending:r=!1,className:i=""}){const{t:o}=G(),a=e??o(r?"composer.pendingThinking":"composer.unsupportedThinking"),c=!!n&&e!=null;return l.jsx(At,{disabled:!c,label:o("composer.thinkingLevel"),width:160,align:"left",trigger:({open:u,id:d})=>l.jsxs(Q,{size:"compact",type:"button",disabled:!c,"aria-label":`${o("composer.thinkingLevel")}: ${a}`,"aria-haspopup":c?"dialog":void 0,"aria-expanded":c?u:void 0,"aria-controls":u?d:void 0,className:`inline-flex items-center gap-1.5 px-2 text-[12px] font-normal disabled:opacity-100 transition-colors focus-visible:outline-2 focus-visible:outline-[var(--color-accent)] ${c?"hover:bg-[var(--fill-secondary)] cursor-pointer":"cursor-default"} text-[var(--label-secondary)] ${i}`,children:[s&&l.jsxs(l.Fragment,{children:[l.jsx(ls,{size:14,"aria-hidden":"true"}),l.jsx("span",{children:o("composer.thinkingLabel")})]}),l.jsx("span",{children:a}),c&&l.jsx(Da,{size:12,"aria-hidden":"true",className:`selector-chevron transition-transform motion-reduce:transition-none ${u?"rotate-180":""}`})]}),children:u=>e!=null?l.jsx(Vc,{currentLevel:e,availableLevels:t,onSelect:n,onDone:u}):null})}function yy({instance:e,showCompactButton:t,compactDisabled:n,onSetModel:s,onSetThinkingLevel:r,onAttachImages:i,onOpenCompact:o}){var y;const{t:a}=G(),c=e==null?void 0:e.contextUsage,u=e==null?void 0:e.model,d=e==null?void 0:e.availableModels,h=e==null?void 0:e.thinkingLevel,m=(y=d==null?void 0:d.find(b=>b.provider===(u==null?void 0:u.provider)&&b.id===(u==null?void 0:u.id)))==null?void 0:y.availableThinkingLevels,g=t&&!!c&&!n&&c.tokens!=null,p=n?a("composer.compactBusy"):!t||(c==null?void 0:c.tokens)==null?a("composer.compactUnavailable"):a("eventStream.compactContext"),x=f.useMemo(()=>[{id:"images",priority:2,control:l.jsxs(Q,{size:"compact",onClick:()=>i(),className:"composer-control shrink-0",title:a("eventStream.attachImage"),"aria-label":a("eventStream.attachImage"),children:[l.jsx(Pi,{size:14,"aria-hidden":"true"}),l.jsx("span",{children:a("composer.images")})]}),menu:b=>l.jsxs(Ne,{onClick:()=>{b(),i()},children:[l.jsx(Pi,{size:16,"aria-hidden":"true"}),l.jsx("span",{children:a("eventStream.attachImage")})]})},{id:"model",priority:3,flexible:!0,minimumLabelWidth:80,pageLabel:a("composer.model"),control:u?l.jsx(py,{currentModel:u,availableModels:d,onSelect:s,className:"composer-control"}):l.jsx(Q,{size:"compact",disabled:!0,className:"composer-control",children:a("composer.modelWaiting")}),menu:(b,k)=>l.jsxs(Ne,{disabled:!u||!(d!=null&&d.length),onClick:()=>k("model"),children:[l.jsx(Js,{size:16,"aria-hidden":"true"}),l.jsxs("span",{className:"min-w-0 flex-1",children:[l.jsx("span",{className:"block",children:a("composer.model")}),l.jsx("span",{className:"block truncate text-[11px] text-[var(--label-secondary)]",children:(u==null?void 0:u.name)||(u==null?void 0:u.id)||a("composer.modelWaiting")})]}),l.jsx(Je,{size:14,"aria-hidden":"true"})]}),page:b=>u&&l.jsx(Dc,{currentModel:u,availableModels:d,onSelect:s,onDone:b})},{id:"thinking",priority:1,pageLabel:a("composer.thinkingLevel"),control:l.jsx(gy,{currentLevel:h,pending:!e,availableLevels:m??[],onSelect:r,showLabel:!0,className:"composer-control"}),menu:(b,k)=>l.jsxs(Ne,{disabled:h==null,onClick:()=>k("thinking"),children:[l.jsx(ls,{size:16,"aria-hidden":"true"}),l.jsx("span",{className:"flex-1",children:a("composer.thinkingLabel")}),l.jsx("span",{className:"text-[11px] text-[var(--label-secondary)]",children:h??a(e?"composer.unsupportedThinking":"composer.pendingThinking")}),l.jsx(Je,{size:14,"aria-hidden":"true"})]}),page:b=>h!=null&&l.jsx(Vc,{currentLevel:h,availableLevels:m??[],onSelect:r,onDone:b})},{id:"compact",priority:0,control:l.jsxs(Q,{size:"compact",disabled:!g,"aria-label":a("eventStream.compactContext"),title:p,onClick:()=>o(),className:"composer-control shrink-0",children:[l.jsx($i,{size:14,"aria-hidden":"true"}),l.jsx("span",{children:a("composer.compact")})]}),menu:b=>l.jsxs(Ne,{disabled:!g,title:p,onClick:()=>{b(),o()},children:[l.jsx($i,{size:16,"aria-hidden":"true"}),l.jsx("span",{children:a("eventStream.compactContext")})]})}],[a,u,d,h,e,m,s,r,g,p,i,o]);return l.jsx(I1,{items:x})}function xy({contextUsage:e}){const{t}=G(),{tokens:n,contextWindow:s,percent:r}=e,i=n!=null&&r!=null,o=i?r>90?"var(--toast-icon-error)":r>60?"var(--toast-icon-warning)":"var(--toast-icon-success)":"var(--label-secondary)",a=u=>u<1e3?String(u):u<1e4?`${(u/1e3).toFixed(1)}k`:u<1e6?`${Math.round(u/1e3)}k`:`${Number((u/1e6).toFixed(1))}M`,c=i?`${a(n)} / ${a(s)} (${Math.round(r)}%)`:t("composer.pendingUsage");return l.jsx(At,{label:t("composer.contextUsage"),width:260,trigger:({open:u,id:d})=>l.jsxs(Q,{size:"compact",type:"button",title:c,"aria-label":`${t("composer.contextUsage")}: ${c}`,"aria-haspopup":"dialog","aria-expanded":u,"aria-controls":u?d:void 0,className:"composer-control composer-context shrink-0 tabular-nums focus-visible:outline-2 focus-visible:outline-[var(--color-accent)]",style:{color:o},children:[l.jsx(kf,{size:14,"aria-hidden":"true"}),i&&l.jsxs("span",{className:"composer-context-detail",children:[a(n)," / ",a(s)]}),l.jsx("span",{children:i?`${Math.round(r)}%`:"—"})]}),children:()=>l.jsx(by,{contextUsage:e})})}function by({contextUsage:e}){const{t,i18n:n}=G(),{tokens:s,contextWindow:r,percent:i}=e,o=new Intl.NumberFormat(n.resolvedLanguage??"zh-CN"),a=s!=null&&i!=null;return l.jsxs("div",{className:"select-none p-3 text-[12px] text-[var(--label-secondary)]",children:[l.jsx("h2",{className:"mb-3 text-[13px] font-semibold text-[var(--label-primary)]",children:t("composer.contextUsage")}),l.jsxs("dl",{className:"space-y-2",children:[l.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[l.jsx("dt",{children:t("composer.usedTokens")}),l.jsx("dd",{className:"select-text tabular-nums text-[var(--label-primary)]",children:a?o.format(s):t("composer.pendingUsage")})]}),l.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[l.jsx("dt",{children:t("composer.contextWindow")}),l.jsx("dd",{className:"select-text tabular-nums text-[var(--label-primary)]",children:o.format(r)})]})]}),a?l.jsx("div",{className:"mt-3 h-1 overflow-hidden rounded-full bg-[var(--fill-secondary)]",role:"progressbar","aria-label":t("composer.contextUsage"),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.min(100,Math.max(0,i)),children:l.jsx("div",{className:"h-full rounded-full bg-[var(--color-accent)]",style:{width:`${Math.min(100,Math.max(0,i))}%`}})}):l.jsx("p",{className:"mt-3 leading-[18px]",children:t("composer.pendingUsageDescription")})]})}function vy(e,t,n){const[s,r]=f.useState({minimum:36,maximum:320,defaultHeight:60}),[i,o]=f.useState(null),[a,c]=f.useState(60),[u,d]=f.useState(!1),h=f.useRef(a),m=f.useRef(s),g=f.useRef(i),p=f.useRef(null);h.current=a,m.current=s,g.current=i;const x=f.useCallback(v=>{const S=m.current;v.style.height="auto";const w=g.current??Math.max(S.defaultHeight,v.scrollHeight),M=Math.min(S.maximum,Math.max(S.minimum,w));v.style.height=`${M}px`,v.style.overflowY=v.scrollHeight>M?"auto":"hidden",h.current=M,c(M)},[]);f.useLayoutEffect(()=>{var w;const v=()=>{var O;const M=((O=window.visualViewport)==null?void 0:O.height)??window.innerHeight,T=t.current,C=e.current,j=Math.max(0,((T==null?void 0:T.getBoundingClientRect().height)??0)-((C==null?void 0:C.getBoundingClientRect().height)??0)),E=Math.max(36,Math.floor(Math.min(320,M*.45,M-j-80))),P=C?getComputedStyle(C):null,$=Number.parseFloat((P==null?void 0:P.lineHeight)??"")||24,N=Number.parseFloat((P==null?void 0:P.paddingTop)??"")||6,R=Number.parseFloat((P==null?void 0:P.paddingBottom)??"")||6,I=Number.parseFloat((P==null?void 0:P.getPropertyValue("--composer-default-lines"))??"")||2,L=Math.ceil($*I+N+R);r(_=>_.maximum===E&&_.defaultHeight===L?_:{minimum:36,maximum:E,defaultHeight:L})};v(),window.addEventListener("resize",v),(w=window.visualViewport)==null||w.addEventListener("resize",v);const S=typeof ResizeObserver>"u"?null:new ResizeObserver(v);return t.current&&(S==null||S.observe(t.current)),()=>{var M,T;(M=p.current)==null||M.call(p),S==null||S.disconnect(),window.removeEventListener("resize",v),(T=window.visualViewport)==null||T.removeEventListener("resize",v)}},[t,e]),f.useLayoutEffect(()=>{e.current&&x(e.current)},[n,s,i,x,e]);const y=f.useCallback(()=>{var v;(v=p.current)==null||v.call(p),d(!1),g.current=null,o(null),e.current&&x(e.current)},[x,e]),b=f.useCallback(v=>{var I,L;if(!v.isPrimary||v.button!==0)return;v.preventDefault(),(I=p.current)==null||I.call(p);const S=v.pointerId,w=v.clientY,M=h.current,T=g.current,C=v.currentTarget;(L=C.setPointerCapture)==null||L.call(C,S),d(!0);const j=O=>{if(O.pointerId!==S)return;O.preventDefault();const _=m.current,U=Math.min(_.maximum,Math.max(_.minimum,M+w-O.clientY));g.current=U,o(U)},E=O=>{var _;(_=p.current)==null||_.call(p),d(!1),O&&(g.current=T,o(T))},P=O=>{O.pointerId===S&&E(!1)},$=O=>{O.pointerId===S&&E(!0)},N=O=>{O.key==="Escape"&&(O.preventDefault(),E(!0))},R=()=>E(!0);window.addEventListener("pointermove",j,{passive:!1}),window.addEventListener("pointerup",P),window.addEventListener("pointercancel",$),window.addEventListener("keydown",N),window.addEventListener("blur",R),C.addEventListener("lostpointercapture",R),p.current=()=>{var O;p.current=null,window.removeEventListener("pointermove",j),window.removeEventListener("pointerup",P),window.removeEventListener("pointercancel",$),window.removeEventListener("keydown",N),window.removeEventListener("blur",R),C.removeEventListener("lostpointercapture",R),(O=C.hasPointerCapture)!=null&&O.call(C,S)&&C.releasePointerCapture(S)}},[]),k=f.useCallback(v=>{if(v.key==="Home"){v.preventDefault(),y();return}if(!["ArrowUp","ArrowDown","End"].includes(v.key))return;v.preventDefault();const S=m.current,w=v.key==="End"?S.maximum:h.current+(v.key==="ArrowUp"?24:-24),M=Math.min(S.maximum,Math.max(S.minimum,w));g.current=M,o(M)},[y]);return{height:a,limits:s,dragging:u,resizeTextarea:x,onPointerDown:b,onKeyDown:k,resetHeight:y}}let wy=0,_n=[];function Ct(e,t="info"){const n={id:++wy,message:e,level:t,phase:"entering"};_n.forEach(s=>s(n))}const Sy=16,Cy=150,ky={info:3e3,success:3e3,warning:4e3,error:5e3},jy={info:za,success:of,warning:Wf,error:Hn},Ey={info:"var(--toast-icon-info)",success:"var(--toast-icon-success)",warning:"var(--toast-icon-warning)",error:"var(--toast-icon-error)"};function Ty(){const[e,t]=f.useState([]),n=f.useRef(new Set),s=f.useRef(null),r=f.useContext(Pe).reducedMotion,i=pn()||r==="always";return f.useEffect(()=>{function o(c,u){const d=setTimeout(()=>{n.current.delete(d),c()},u);n.current.add(d)}const a=c=>{t(u=>[...u,c]),o(()=>t(u=>u.map(d=>d.id===c.id?{...d,phase:"visible"}:d)),Sy),o(()=>{t(u=>u.map(d=>d.id===c.id?{...d,phase:"exiting"}:d)),o(()=>t(u=>u.filter(d=>d.id!==c.id)),Cy)},ky[c.level])};return _n.push(a),()=>{_n=_n.filter(c=>c!==a),n.current.forEach(clearTimeout),n.current.clear()}},[]),f.useLayoutEffect(()=>{const o=s.current;if(o){if(typeof o.showPopover!="function"){o.removeAttribute("popover");return}return o.hidePopover(),o.showPopover(),()=>o.hidePopover()}},[e.length]),e.length?kt.createPortal(l.jsx(hn,{features:ms,strict:!0,children:l.jsx("div",{ref:s,popover:"manual",className:"toast-container",children:e.map(o=>{const a=jy[o.level],c=o.phase==="visible"||i&&o.phase==="entering";return l.jsxs(St,{role:o.level==="error"?"alert":"status","aria-atomic":"true",className:"ui-toast",initial:!1,animate:{opacity:c?1:0,y:i||c?0:-6},transition:{duration:i?0:.15},children:[l.jsx(a,{size:18,className:"mt-0.5 shrink-0",style:{color:Ey[o.level]},"aria-hidden":"true"}),l.jsx("span",{className:"min-w-0 whitespace-pre-wrap",children:o.message})]},o.id)})})}),document.body):null}const Ny=["image/png","image/jpeg","image/gif","image/webp"],Ry=2048,My=2048,ea=.85,Ks=5*1024*1024;function Bc(){return`img_${Date.now()}_${Math.random().toString(36).slice(2,8)}`}async function Ay(e){if(!Ny.includes(e.type))throw new Error(`Unsupported image type: ${e.type}`);const t=await createImageBitmap(e),{width:n,height:s}=Iy(t.width,t.height,Ry,My),r=document.createElement("canvas");r.width=n,r.height=s,r.getContext("2d").drawImage(t,0,0,n,s),t.close();let o=e.type,a=ea;e.type!=="image/png"&&e.type!=="image/gif"&&(o="image/jpeg");let c=r.toDataURL(o,a);if(o==="image/jpeg"||o==="image/webp")for(;Ws(c)>Ks&&a>.3;)a-=.1,c=r.toDataURL(o,a);if(o==="image/png"&&Ws(c)>Ks)for(o="image/jpeg",a=ea,c=r.toDataURL(o,a);Ws(c)>Ks&&a>.3;)a-=.1,c=r.toDataURL(o,a);const u=c.split(",")[1];return{id:Bc(),data:u,mimeType:o,previewUrl:c}}function Ly(e){const t=[];for(let n=0;n<e.items.length;n++){const s=e.items[n];if(s.type.startsWith("image/")){const r=s.getAsFile();r&&t.push(r)}}return t}function Iy(e,t,n,s){if(e<=n&&t<=s)return{width:e,height:t};const r=Math.min(n/e,s/t);return{width:Math.round(e*r),height:Math.round(t*r)}}function Ws(e){const t=e.split(",")[1];return t?Math.ceil(t.length*3/4):0}function Py(e){const{t}=G(),n=f.useCallback(o=>{Promise.all(o.map(Ay)).then(a=>e(c=>({...c,images:[...c.images,...a]}))).catch(a=>{Ct(t("eventStream.imageProcessFailed"),"error"),console.error("Image process failed:",a)})},[e,t]),s=f.useCallback(o=>{const a=Ly(o.clipboardData);a.length!==0&&(o.preventDefault(),n(a))},[n]),r=f.useCallback(o=>{const a=Array.from(o.target.files??[]);a.length!==0&&(n(a),o.target.value="")},[n]),i=f.useCallback(o=>{e(a=>({...a,images:a.images.filter(c=>c.id!==o)}))},[e]);return{handlePaste:s,handleFileSelect:r,handleRemoveImage:i}}function $y({ref:e,instance:t,draft:n,onDraftChange:s,onSendMessage:r,onAbort:i,onSetModel:o,onSetThinkingLevel:a,onCompact:c,buttonMode:u,showCompactButton:d,compactDisabled:h,onImageLightbox:m,startBottomFollow:g}){const{t:p}=G(),x=f.useRef(null),y=f.useRef(null),b=f.useId(),k=f.useId(),v=vy(x,y,n.text);f.useImperativeHandle(e,()=>({focus(){const _=x.current;if(!_)return;_.focus();const U=_.value.length;_.selectionStart=_.selectionEnd=U,_.scrollTop=_.scrollHeight}}));const S=f.useRef(null),w=f.useRef(n);w.current=n;const[M,T]=f.useState(!1),C=t==null?void 0:t.status,j=t==null?void 0:t.contextUsage,E=v.resizeTextarea,P=f.useCallback(_=>{s(U=>({...U,text:_.target.value})),E(_.target)},[s,E]),$=!wt(C)&&(!!n.text.trim()||n.images.length>0),N=f.useCallback(()=>{const _=w.current;if(wt(C)||!_.text.trim()&&_.images.length===0)return;const U=_.images.length?_.images.map(F=>({data:F.data,mimeType:F.mimeType})):void 0;r(_.text.trim(),U),g()},[C,r,g]),R=f.useCallback(_=>{_.nativeEvent.isComposing||_.keyCode===229||_.key==="Enter"&&!_.shiftKey&&(_.preventDefault(),N())},[N]),{handlePaste:I,handleFileSelect:L,handleRemoveImage:O}=Py(s);return l.jsxs(l.Fragment,{children:[l.jsxs("div",{ref:y,className:"composer-surface",children:[l.jsx("div",{role:"separator",tabIndex:0,"aria-orientation":"horizontal","aria-label":p("composer.resizeHeight"),"aria-describedby":k,"aria-controls":b,"aria-valuemin":v.limits.minimum,"aria-valuemax":v.limits.maximum,"aria-valuenow":v.height,"aria-valuetext":p("composer.heightPixels",{height:v.height}),className:"composer-resize-handle","data-dragging":v.dragging||void 0,onPointerDown:v.onPointerDown,onKeyDown:v.onKeyDown,onDoubleClick:v.resetHeight,title:p("composer.resizeHeightHelp"),children:l.jsx("span",{"aria-hidden":"true"})}),l.jsx("span",{id:k,className:"sr-only",children:p("composer.resizeHeightHelp")}),n.images.length>0&&l.jsx("div",{className:"composer-images flex gap-2 overflow-x-auto px-4 pt-4 scrollbar-auto",children:n.images.map((_,U)=>l.jsxs("div",{className:"relative shrink-0",children:[l.jsx("button",{type:"button","aria-label":p("composer.previewImage",{count:U+1}),onClick:()=>m(_.previewUrl),className:"block overflow-hidden rounded-content border border-[var(--separator)] focus-visible:outline-2 focus-visible:outline-[var(--color-accent)]",children:l.jsx("img",{src:_.previewUrl,alt:p("conversation.attachedImage",{count:U+1}),className:"h-14 w-14 object-cover",draggable:!1})}),l.jsx(Q,{size:"badge",type:"button",onClick:()=>O(_.id),className:"absolute -right-1.5 -top-1.5 bg-[var(--badge-bg)] text-[var(--badge-text)] hover:bg-[var(--badge-bg-hover)]","aria-label":p("composer.removeImage",{count:U+1}),children:l.jsx(Vr,{size:12,"aria-hidden":"true"})})]},_.id))}),l.jsx("textarea",{id:b,ref:x,rows:2,"aria-label":p("eventStream.sendPlaceholder"),placeholder:p("eventStream.sendPlaceholder"),value:n.text,onChange:P,onKeyDown:R,onPaste:I,className:"composer-editor block w-full resize-none overflow-hidden bg-transparent text-[16px] leading-[24px] text-[var(--label-primary)] outline-none placeholder:text-[var(--label-tertiary)] md:text-[14px] md:leading-[22px]"}),l.jsxs("div",{className:"composer-toolbar select-none flex min-w-0 items-center gap-2 px-3 pb-3 pt-2",role:"group","aria-label":p("composer.options"),children:[l.jsx("input",{ref:S,type:"file",accept:"image/png,image/jpeg,image/gif,image/webp",multiple:!0,onChange:L,className:"hidden"}),l.jsx(yy,{instance:t,showCompactButton:d,compactDisabled:h,onSetModel:o,onSetThinkingLevel:a,onAttachImages:()=>{var _;return(_=S.current)==null?void 0:_.click()},onOpenCompact:()=>T(!0)}),l.jsxs("div",{className:"composer-actions flex shrink-0 items-center gap-2",children:[l.jsxs("span",{role:"status",className:"composer-agent-status inline-flex items-center gap-1.5 whitespace-nowrap text-[11px] text-[var(--label-secondary)]",children:[l.jsx("span",{"aria-hidden":"true",className:`h-2 w-2 shrink-0 rounded-full ${Mc(C)}`}),p(Rc(C))]}),j&&l.jsx(xy,{contextUsage:j}),u==="stop"?l.jsx(Q,{size:"icon",type:"button",onClick:i,className:"select-none shrink-0 rounded-full bg-[var(--toast-icon-error)] text-white transition-[opacity,transform] hover:opacity-90 active:scale-95 focus-visible:outline-2 focus-visible:outline-[var(--color-accent)] motion-reduce:transition-none motion-reduce:transform-none",title:p("eventStream.stop"),"aria-label":p("eventStream.stop"),children:l.jsx(zf,{size:12,fill:"currentColor","aria-hidden":"true"})}):l.jsx(Q,{size:"icon",type:"button",onClick:N,disabled:!$,className:`select-none shrink-0 rounded-full transition-[opacity,transform] focus-visible:outline-2 focus-visible:outline-[var(--color-accent)] motion-reduce:transition-none motion-reduce:transform-none ${$?"bg-[var(--color-accent)] text-white hover:opacity-90 active:scale-95":"bg-[var(--fill-secondary)] text-[var(--label-tertiary)] opacity-50 cursor-default"}`,title:p("eventStream.send"),"aria-label":p("eventStream.send"),children:l.jsx(Gd,{size:16,strokeWidth:2.5,"aria-hidden":"true"})})]})]})]}),l.jsx($e,{children:M&&l.jsx(L1,{onClose:()=>T(!1),onConfirm:_=>{c(_),T(!1)}},"compact")})]})}function zc({id:e,expanded:t,children:n}){const s=pn();return l.jsx(St,{id:e,initial:!1,animate:t?"expanded":"collapsed",variants:{expanded:{height:"auto",opacity:1,visibility:"visible"},collapsed:{height:0,opacity:0,transitionEnd:{visibility:"hidden"}}},transition:{duration:s?0:t?.2:.15,ease:"easeInOut"},"aria-hidden":!t,inert:!t,className:"min-w-0 overflow-hidden",children:n})}function Oy({message:e,onReEdit:t}){var h,m;const{t:n}=G(),[s,r]=f.useState(!1);let i=e,o="",a="",c="";const u=e.indexOf("{");if(u>0){i=e.slice(0,u).trim();try{const g=JSON.parse(e.slice(u));o=((h=g==null?void 0:g.error)==null?void 0:h.message)??e.slice(u),a=((m=g==null?void 0:g.error)==null?void 0:m.type)??"";const p=o.match(/request id:\s*([\w]+)/i);p&&(c=p[1])}catch{o=e.slice(u)}}const d=o.length>200;return l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"rounded-content border border-[rgba(255,66,69,0.3)] bg-[rgba(255,66,69,0.06)] px-3.5 py-2.5",children:l.jsxs("div",{className:"flex items-start gap-2",children:[l.jsx(Hn,{size:14,"aria-hidden":"true",className:"mt-0.5 shrink-0 text-[#ff4245]"}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsxs("div",{className:"flex items-center justify-between gap-2",children:[l.jsx("p",{className:"text-[12px] font-medium text-[#ff4245]",children:i}),l.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[t&&l.jsx(Q,{size:"compact",type:"button",onClick:t,className:"error-reedit-button select-none text-[12px] text-[var(--color-accent)] hover:opacity-70",children:n("reEdit.button")}),d&&l.jsx(Q,{size:"compact",type:"button","aria-label":n("error.title"),onClick:()=>r(!0),className:"error-details-button inline-flex h-8 w-8 items-center justify-center text-[var(--label-secondary)]",children:l.jsx(Je,{size:14})})]})]}),o&&!d&&l.jsx("p",{className:"mt-1.5 break-all whitespace-pre-wrap text-[11px] text-[var(--label-secondary)]",children:o})]})]})}),l.jsx($e,{children:s&&l.jsx(He,{title:n("error.title"),onClose:()=>r(!1),children:l.jsxs("div",{className:"flex-1 overflow-y-auto px-5 py-6 scrollbar-auto",children:[l.jsxs("div",{className:"mb-5 flex flex-col items-center text-center",children:[l.jsx("div",{className:"mb-3 flex h-10 w-10 items-center justify-center rounded-content bg-[rgba(255,66,69,0.1)]",children:l.jsx(Hn,{size:20,className:"text-[#ff4245]"})}),l.jsx("p",{className:"text-[15px] font-semibold text-[#ff4245]",children:i})]}),l.jsxs("div",{className:"space-y-3 rounded-content bg-[var(--fill-card)] p-4",children:[l.jsx(qs,{label:n("error.message"),value:o}),a&&l.jsx(qs,{label:n("error.type"),value:a}),c&&l.jsx(qs,{label:n("error.requestId"),value:c,mono:!0})]})]})},"error")})]})}function qs({label:e,value:t,mono:n}){return l.jsxs("div",{children:[l.jsx("p",{className:"select-none mb-0.5 text-[11px] text-[var(--label-tertiary)]",children:e}),l.jsx("p",{className:`break-all whitespace-pre-wrap text-[14px] leading-[22px] text-[var(--label-primary)] ${n?"font-mono text-[13px] leading-[20px]":""}`,children:t})]})}function Hc({label:e,children:t}){return l.jsxs("div",{className:"content-toolbar",children:[l.jsx("span",{className:"content-toolbar-label",children:e}),l.jsx("div",{className:"flex shrink-0 items-center gap-1",children:t})]})}function ut({error:e=!1,className:t="",...n}){return l.jsx("pre",{...n,className:`tool-result text-[13px] leading-[20px] whitespace-pre-wrap break-words overflow-x-auto ${e?"tool-result-error":""} ${t}`})}let ta=Promise.resolve(),_y=0;function Fy(e,t,n){const s=ta.then(async()=>{var u;n.throwIfAborted();const[{default:r},{default:i},{createMermaidConfig:o}]=await Promise.all([gt(()=>import("./mermaid.core-DVbCkJL3.js").then(d=>d.bi),__vite__mapDeps([6,1,7,8,5]),import.meta.url),gt(()=>import("./purify.es-CAi2OJFm.js"),[],import.meta.url),gt(()=>import("./mermaidTheme-DoQvsUbV.js"),__vite__mapDeps([9,8,10]),import.meta.url)]);n.throwIfAborted();const a=o(t);r.initialize(a);const c=document.createElement("div");c.style.cssText="position:fixed;left:-100000px;top:0;width:960px;visibility:hidden;pointer-events:none",document.body.append(c);try{const{svg:d}=await r.render(`mermaid-${++_y}`,e,c);n.throwIfAborted();const h=new DOMParser().parseFromString(d,"image/svg+xml").documentElement;if(!(h instanceof SVGSVGElement))throw new Error("Invalid Mermaid SVG document");const m=(u=h.viewBox)==null?void 0:u.baseVal;return m&&m.width>0&&m.height>0&&(h.setAttribute("width",String(m.width)),h.setAttribute("height",String(m.height))),h.style.backgroundColor="transparent",i.sanitize(new XMLSerializer().serializeToString(h),{USE_PROFILES:{svg:!0,svgFilters:!0}})}finally{c.remove()}});return ta=s.then(()=>{},()=>{}),s}function Dy({source:e,streaming:t}){const{t:n}=G(),s=vc(),[r,i]=f.useState({status:"loading",source:e,theme:s}),[o,a]=f.useState(!1),[c,u]=f.useState(!1),d=f.useRef(void 0);f.useEffect(()=>{const b=new AbortController,k=setTimeout(async()=>{try{const v=await Fy(e,s,b.signal);b.signal.aborted||i({status:"ready",source:e,theme:s,svg:v})}catch{b.signal.aborted||i({status:"error",source:e,theme:s})}},t?300:0);return()=>{clearTimeout(k),b.abort()}},[e,s,t]),f.useEffect(()=>()=>clearTimeout(d.current),[]);async function h(){try{await navigator.clipboard.writeText(e),a(!0),clearTimeout(d.current),d.current=setTimeout(()=>a(!1),2e3)}catch{a(!1)}}const m=r.source===e&&r.theme===s,g=m&&r.status==="ready",p=m&&r.status==="error"&&!t,x=g?`data:image/svg+xml;charset=utf-8,${encodeURIComponent(r.svg)}`:"",y=l.jsxs("div",{className:"text-[var(--label-primary)]",children:[l.jsxs("p",{className:"select-none flex min-h-24 items-center justify-center gap-2 px-3 py-3 text-[12px] text-[var(--label-secondary)]",role:"status",children:[!p&&l.jsx(Le,{size:14,className:"animate-spin motion-reduce:animate-none","aria-hidden":"true"}),n(p?"entries.mermaidError":"entries.mermaidLoading")]}),p&&l.jsx("pre",{className:"px-3 py-2.5 overflow-x-auto text-[13px] leading-[20px]",children:l.jsx("code",{children:e})})]});return l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"content-block max-w-full",children:[l.jsxs(Hc,{label:n("entries.mermaidDiagram"),children:[l.jsxs(Q,{size:"compact",type:"button",onClick:h,children:[o?l.jsx(Tt,{size:12,"aria-hidden":"true"}):l.jsx(Dr,{size:12,"aria-hidden":"true"}),l.jsx("span",{"aria-live":"polite",children:n(o?"entries.copied":"entries.copy")})]}),g&&l.jsxs(Q,{size:"compact",type:"button",onClick:()=>u(!0),"aria-haspopup":"dialog",children:[l.jsx(bf,{size:12,"aria-hidden":"true"}),n("entries.mermaidExpand")]})]}),g?l.jsx("div",{className:"px-3 py-2.5 overflow-x-auto",children:l.jsx("img",{src:x,alt:n("entries.mermaidDiagram"),className:"block mx-auto max-w-full h-auto"})}):y]}),l.jsx($e,{children:c&&l.jsx(bi,{src:x,alt:n("entries.mermaidDiagram"),zoomable:!0,placeholder:y,onClose:()=>u(!1)},"preview")})]})}const Uc=f.createContext(!1);function Vy(){return e=>{var t;((t=e.children[0])==null?void 0:t.type)==="yaml"&&(e.children[0]={type:"code",lang:"__frontmatter__",value:e.children[0].value})}}function By({yamlText:e}){let t=[];try{const n=ya.load(e);de(n)&&(t=Object.entries(n).map(([s,r])=>{const i=typeof r=="string"?r:JSON.stringify(r,null,2);return[s,i]}))}catch{t=[["raw",e]]}return t.length===0?null:l.jsx("div",{className:"content-block",children:l.jsx("table",{className:"w-full text-[13px]",children:l.jsx("tbody",{children:t.map(([n,s])=>l.jsxs("tr",{className:"border-b last:border-b-0 border-[var(--separator)]",children:[l.jsx("td",{className:"px-3 py-1.5 bg-[var(--fill-quaternary)] text-[var(--label-secondary)] font-medium whitespace-nowrap align-top w-[1%]",children:n}),l.jsx("td",{className:"px-3 py-1.5 text-[var(--label-primary)] whitespace-pre-wrap break-all",children:s})]},n))})})})}function sn(e){return e==null||typeof e=="boolean"?"":typeof e=="string"||typeof e=="number"?String(e):Array.isArray(e)?e.map(sn).join(""):f.isValidElement(e)?sn(e.props.children):""}function na({language:e,children:t}){const{t:n}=G(),[s,r]=f.useState(!1),i=sn(t).replace(/\n$/,""),o=f.useCallback(()=>{navigator.clipboard.writeText(i),r(!0),setTimeout(()=>r(!1),2e3)},[i]);return l.jsxs("div",{className:"content-block group/code relative",children:[l.jsx(Hc,{label:e||n("entries.code"),children:l.jsxs(Q,{size:"compact",onClick:o,"aria-label":n(s?"entries.copied":"entries.copy"),children:[s?l.jsx(Tt,{size:12}):l.jsx(Dr,{size:12}),n(s?"entries.copied":"entries.copy")]})}),l.jsx("pre",{className:"px-3 py-2.5 overflow-x-auto text-[13px] leading-[20px]",children:l.jsx("code",{children:t})})]})}const zy={code({className:e,children:t,...n}){const s=f.useContext(Uc),r=/language-(\w+)/.exec(e||"");if((r==null?void 0:r[1])==="mermaid")return l.jsx(Dy,{source:sn(t).replace(/\n$/,""),streaming:s});if((r==null?void 0:r[1])==="__frontmatter__"){const i=sn(t).replace(/\n$/,"");return l.jsx(By,{yamlText:i})}return r?l.jsx(na,{language:r[1],children:t}):String(t).includes(`
|
|
255
|
+
`)?l.jsx(na,{language:"",children:t}):l.jsx("code",{className:"px-1.5 py-0.5 rounded-inline bg-[var(--fill-secondary)] text-[13px] font-mono break-words",...n,children:t})},pre({children:e}){return l.jsx(l.Fragment,{children:e})},p({children:e}){return l.jsx("p",{className:"text-[14px] leading-[22px] text-[var(--label-primary)] mb-2 last:mb-0",children:e})},h1({children:e}){return l.jsx("h1",{className:"text-[20px] leading-[26px] font-semibold text-[var(--label-primary)] mt-4 mb-2",children:e})},h2({children:e}){return l.jsx("h2",{className:"text-[17px] leading-[23px] font-semibold text-[var(--label-primary)] mt-3 mb-1.5",children:e})},h3({children:e}){return l.jsx("h3",{className:"text-[15px] leading-[21px] font-semibold text-[var(--label-primary)] mt-2 mb-1",children:e})},ul({children:e}){return l.jsx("ul",{className:"text-[14px] leading-[22px] text-[var(--label-primary)] pl-5 mb-2 list-disc space-y-0.5",children:e})},ol({children:e}){return l.jsx("ol",{className:"text-[14px] leading-[22px] text-[var(--label-primary)] pl-5 mb-2 list-decimal space-y-0.5",children:e})},li({children:e}){return l.jsx("li",{className:"text-[14px] leading-[22px]",children:e})},blockquote({children:e}){return l.jsx("blockquote",{className:"pl-3 border-l-2 border-[var(--color-accent)] text-[14px] leading-[22px] text-[var(--label-secondary)] my-2",children:e})},table({children:e}){return l.jsx("div",{className:"content-block overflow-x-auto",children:l.jsx("table",{className:"w-full text-[13px]",children:e})})},thead({children:e}){return l.jsx("thead",{className:"bg-[var(--fill-tertiary)] text-[var(--label-secondary)]",children:e})},th({children:e}){return l.jsx("th",{className:"px-3 py-1.5 text-left font-medium border-b border-[var(--separator)]",children:e})},td({children:e}){return l.jsx("td",{className:"px-3 py-1.5 border-b border-[var(--separator)]",children:e})},hr(){return l.jsx("hr",{className:"my-3 border-[var(--separator)]"})},a({href:e,children:t}){return l.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"text-[var(--color-accent)] hover:underline",children:t})},strong({children:e}){return l.jsx("strong",{className:"font-semibold text-[var(--label-primary)]",children:e})},em({children:e}){return l.jsx("em",{className:"italic text-[var(--label-primary)]",children:e})}};function Hy(e){if(!/^---\s*\n/.test(e))return e;const t=e.match(/\n---\s*(?:\n|$)/);if(!t||t.index===void 0)return e;const n=e.slice(4,t.index);let s=!1;try{const r=ya.load(n);s=typeof r=="object"&&r!==null&&!Array.isArray(r)&&Object.keys(r).length>0}catch{}return s?e:"***"+e.slice(3)}var pa;const Uy={...bs,attributes:{...bs.attributes,code:[...((pa=bs.attributes)==null?void 0:pa.code)||[],["className",/^language-.+/]]}};function Ze({content:e,streaming:t=!1}){const n=f.useMemo(()=>Hy(e),[e]);return e.trim()?l.jsx(Uc.Provider,{value:t,children:l.jsx("div",{className:"markdown-body min-w-0 max-w-full break-words",children:l.jsx(Xc,{remarkPlugins:[ma,tu,ga,Vy],rehypePlugins:[Zc,[Qc,Uy],[eu,{plainText:["mermaid"]}]],components:zy,children:n})})}):null}function wi({timestamps:e,showRange:t=!1,showDuration:n=!1}){const{t:s,i18n:r}=G(),i=e.filter(p=>!!p).map(p=>({value:p,date:new Date(p)})).filter(({date:p})=>Number.isFinite(p.getTime())),o=i[0],a=i.at(-1),c=o&&a&&o.value!==a.value?[o,a]:o?[o]:[];if(!c.length)return null;const u={year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hourCycle:"h23"},d=o&&a?a.date.getTime()-o.date.getTime():0,h=(p,x=0)=>new Intl.NumberFormat(r.resolvedLanguage,{maximumFractionDigits:x}).format(p),m=(p,x,y=0)=>s(`conversation.duration${p}`,{count:x,value:h(x,y)});let g=null;if(t&&n&&c.length>1&&d>0){if(d<1e3)g=m("Milliseconds",d);else if(d<6e4)g=m("Seconds",Math.min(59.9,Math.round(d/100)/10),1);else{const p=Math.floor(d/1e3);g=(p<3600?[["Minutes",Math.floor(p/60)],["Seconds",p%60]]:p<86400?[["Hours",Math.floor(p/3600)],["Minutes",Math.floor(p/60)%60]]:[["Days",Math.floor(p/86400)],["Hours",Math.floor(p/3600)%24]]).filter(([,y])=>y>0).map(([y,b])=>m(y,b)).join(" ")}g=s("conversation.approximateDuration",{duration:g})}return l.jsxs("span",{className:"conversation-time inline-flex min-w-0 max-w-full flex-wrap items-center gap-x-3 gap-y-1 text-left text-[11px] tabular-nums text-[var(--label-secondary)] select-text",children:[(t?c:c.slice(0,1)).map(({value:p,date:x},y)=>l.jsxs("span",{className:"inline-flex flex-wrap items-baseline gap-x-1",children:[t&&l.jsx("span",{children:s(y===0?"conversation.replyStart":"conversation.replyEnd")}),l.jsx("time",{dateTime:p,children:x.toLocaleString(r.resolvedLanguage,u)})]},p)),g&&l.jsx("span",{className:"conversation-duration",children:g})]})}const Ky=nu().use(su).use(ma).use(ga);function Wy(e){return Ky.parse(e).children.filter(n=>n.type!=="yaml"&&n.type!=="definition").map(n=>n.type==="list"?n.children.map(s=>s.children.map(r=>vs(r,{includeHtml:!1})).join(" ")).join(" "):n.type==="table"?n.children.map(s=>s.children.map(r=>vs(r,{includeHtml:!1})).join(" ")).join(" "):vs(n,{includeHtml:!1})).join(" ").replace(/\s+/g," ").trim()}function sa({state:e}){const{t}=G(),[n,s]=f.useState(!1),r=e.status==="completed"?e.entry:void 0,i=(r==null?void 0:r.summary)??"",o=f.useMemo(()=>Wy(i),[i]),a=e.status==="compacting"||e.status==="refreshing",c=t(e.status==="compacting"?"conversation.compactingContext":e.status==="refreshing"?"conversation.fetchingCompaction":e.status==="failed"?"conversation.compactionFailed":e.status==="aborted"?"conversation.compactionAborted":e.status==="unavailable"?"conversation.compactionUnavailable":(r==null?void 0:r.type)==="compaction"?"entries.contextCompacted":"entries.branchSummary"),u=(r==null?void 0:r.type)==="branch_summary"?Ba:Af,d=e.status==="failed"||e.status==="aborted"?e.message:void 0,h=l.jsxs(l.Fragment,{children:[l.jsx(u,{size:14,"aria-hidden":"true",className:"shrink-0"}),l.jsxs("span",{className:"min-w-0 flex-1",children:[l.jsx("span",{className:"block",children:c}),(o||d)&&l.jsx("span",{className:"conversation-system-preview",children:o||d})]}),a?l.jsx(Le,{size:14,"aria-hidden":"true",className:"shrink-0 animate-spin motion-reduce:animate-none"}):i?l.jsx(Je,{size:14,"aria-hidden":"true",className:"shrink-0"}):null]});return l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"conversation-system-group space-y-1",children:[l.jsx("div",{className:"conversation-system","data-system-state":(r==null?void 0:r.type)??e.status,children:r?l.jsx("button",{type:"button",disabled:!i,onClick:()=>s(!0),className:"conversation-system-row w-full text-left enabled:hover:bg-[var(--fill-quaternary)] focus-visible:outline-2 focus-visible:outline-[var(--color-accent)]",children:h}):l.jsx("div",{className:"conversation-system-row",role:"status",children:h})}),r&&l.jsx("div",{className:"conversation-system-time px-1 md:px-2",children:l.jsx(wi,{timestamps:[r.timestamp]})})]}),l.jsx($e,{children:n&&r&&l.jsx(He,{title:c,onClose:()=>s(!1),children:l.jsx("div",{className:"flex-1 overflow-y-auto px-5 py-4 scrollbar-auto",children:l.jsx(Ze,{content:i})})},"summary")})]})}function qy({content:e,streaming:t,onBeforeToggle:n}){const{t:s}=G(),[r,i]=f.useState(!1),[o,a]=f.useState(!1),c=f.useId();return l.jsxs("div",{className:"rounded-content bg-[var(--fill-quaternary)]",children:[l.jsxs("button",{type:"button","aria-expanded":r,"aria-controls":c,onClick:u=>{n==null||n(u.currentTarget),a(!0),i(!r)},className:"conversation-thinking-toggle select-none flex w-full items-center gap-2 rounded-content px-3 text-left text-[12px] text-[var(--label-secondary)] hover:bg-[var(--fill-quaternary)] focus-visible:outline-2 focus-visible:outline-[var(--color-accent)]",children:[l.jsx(Je,{size:14,"aria-hidden":"true",className:`shrink-0 transition-transform motion-reduce:transition-none ${r?"rotate-90":""}`}),l.jsx(ls,{size:14,"aria-hidden":"true"}),l.jsx("span",{className:"flex-1",children:s(t?"entries.thinkingStreaming":"entries.thinking")})]}),l.jsx(zc,{id:c,expanded:r,children:o&&l.jsx("div",{className:"px-3 pb-3 text-[var(--label-secondary)]",children:l.jsx(Ze,{content:e,streaming:t})})})]})}const Gy={pending:"conversation.toolPending",running:"entries.running",completed:"conversation.toolCompleted",error:"conversation.toolFailed",aborted:"entries.aborted",unknown:"conversation.toolUnknown"},Yy={pending:"conversation.toolsPending",running:"conversation.toolsRunning",completed:"conversation.toolsCompleted",error:"conversation.toolsFailed",aborted:"conversation.toolsAborted",unknown:"conversation.toolsUnknown"},Jy={pending:Le,running:Le,completed:lf,error:pf,aborted:ff,unknown:uf},Xy={pending:"var(--label-secondary)",running:"var(--label-secondary)",completed:"var(--toast-icon-success)",error:"var(--toast-icon-error)",aborted:"var(--label-secondary)",unknown:"var(--label-secondary)"};function Si(e,t){const{t:n}=G();return t===void 0?n(Gy[e]):n(Yy[e],{count:t})}function Ci({status:e,count:t}){const n=Si(e,t),s=Jy[e],r=e==="pending"||e==="running";return l.jsxs("span",{role:"img","aria-label":n,title:n,"data-tool-status":e,className:"inline-flex shrink-0 items-center gap-1 whitespace-nowrap tabular-nums",children:[l.jsx(s,{size:14,"aria-hidden":"true",style:{color:Xy[e]},className:r?"animate-spin motion-reduce:animate-none":void 0}),t!==void 0&&l.jsx("span",{"aria-hidden":"true",children:t})]})}function gn({status:e}){const{t}=G(),n=Si(e);return l.jsxs("div",{className:"select-none space-y-1 text-[12px] text-[var(--label-secondary)]",children:[l.jsx("p",{children:n}),e==="unknown"&&l.jsx("p",{children:t("conversation.toolUnavailableDescription")})]})}function yn({name:e,status:t}){return l.jsxs(l.Fragment,{children:[l.jsx(Ci,{status:t}),e]})}function Zy(e,t){switch(e){case"read":{const n=typeof t.path=="string"?t.path:"",s=typeof t.offset=="number"?t.offset:void 0,r=typeof t.limit=="number"?t.limit:void 0;if(s!=null||r!=null){const i=s??"",o=r!=null?(s??1)+r-1:"";return`${n} [${i}:${o}]`}return n}case"bash":return t.command?String(t.command).slice(0,80):"";case"edit":case"write":return typeof t.path=="string"?t.path:"";default:return""}}function is(e,t){let n=0;const s=/`+/g;let r;for(;(r=s.exec(e))!==null;)r[0].length>n&&(n=r[0].length);const i="`".repeat(Math.max(3,n+1));return`${i}${t}
|
|
256
|
+
${e}
|
|
257
|
+
${i}`}const Qy={ts:"typescript",tsx:"typescript",js:"javascript",jsx:"javascript",mjs:"javascript",cjs:"javascript",json:"json",css:"css",scss:"scss",less:"less",html:"xml",htm:"xml",xml:"xml",svg:"xml",md:"markdown",mdx:"markdown",yaml:"yaml",yml:"yaml",toml:"ini",ini:"ini",sh:"bash",bash:"bash",zsh:"bash",fish:"bash",py:"python",rb:"ruby",rs:"rust",go:"go",java:"java",kt:"kotlin",swift:"swift",c:"c",h:"c",cpp:"cpp",hpp:"cpp",cs:"csharp",php:"php",sql:"sql",graphql:"graphql",gql:"graphql",dockerfile:"dockerfile",makefile:"makefile",lua:"lua",vim:"vim",diff:"diff",patch:"diff"};function Kc(e){var r;const t=e.split("/").pop()??"",n=t.toLowerCase();if(n==="dockerfile")return"dockerfile";if(n==="makefile"||n==="gnumakefile")return"makefile";const s=(r=t.split(".").pop())==null?void 0:r.toLowerCase();if(s)return Qy[s]}function ex({name:e,args:t,result:n,durationDisplay:s,status:r,onClose:i}){const{t:o}=G(),a=typeof t.command=="string"?t.command:"",c=typeof t.timeout=="number"?t.timeout:void 0,u=is(a,"bash"),d=n&&!n.isError?is(n.content.trim(),"plaintext"):null;return l.jsx(He,{title:l.jsx(yn,{name:e,status:r}),onClose:i,trailing:s,children:l.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto scrollbar-auto",children:[l.jsxs("div",{className:"px-5 pt-3 pb-3 bg-[var(--fill-quaternary)]",children:[c!=null&&l.jsxs("p",{className:"select-none mb-2 text-[11px] text-[var(--label-tertiary)]",children:[o("entries.timeout"),": ",l.jsx("span",{className:"whitespace-nowrap",children:`${c} s`})]}),l.jsx(Ze,{content:u})]}),l.jsxs("div",{className:"px-5 pt-3 pb-5",children:[l.jsx("h4",{className:"select-none text-[11px] font-semibold text-[var(--label-tertiary)] uppercase tracking-wide mb-2",children:o("entries.output")}),n!==null?n.isError?l.jsx(ut,{error:!0,children:n.content}):l.jsx(Ze,{content:d}):l.jsx(gn,{status:r})]})]})})}function tx({name:e,args:t,result:n,durationDisplay:s,status:r,onClose:i}){const{t:o}=G();return l.jsx(He,{title:l.jsx(yn,{name:e,status:r}),onClose:i,trailing:s,children:l.jsxs("div",{className:"flex-1 overflow-y-auto px-5 pt-3 pb-5 space-y-3 scrollbar-auto",children:[l.jsxs("section",{children:[l.jsx("h4",{className:"select-none text-[11px] font-semibold text-[var(--label-tertiary)] uppercase tracking-wide mb-1.5",children:o("entries.params")}),l.jsx(ut,{children:JSON.stringify(t,null,2)})]}),n!==null&&l.jsxs("section",{children:[l.jsx("h4",{className:"select-none text-[11px] font-semibold text-[var(--label-tertiary)] uppercase tracking-wide mb-1.5",children:o("entries.result")}),l.jsx(ut,{error:n.isError,children:n.content})]}),n===null&&l.jsx("section",{children:l.jsx(gn,{status:r})})]})})}function nx({diff:e}){const t=e.split(`
|
|
258
|
+
`);return l.jsx("pre",{className:"text-[13px] leading-[20px] font-mono overflow-x-auto",children:l.jsx("div",{style:{minWidth:"fit-content"},children:t.map((n,s)=>{const r=n[0];return r==="+"?l.jsx("div",{className:"px-3 rounded-inline",style:{backgroundColor:"var(--diff-add-bg)",color:"var(--diff-add-text)"},children:n},s):r==="-"?l.jsx("div",{className:"px-3 rounded-inline",style:{backgroundColor:"var(--diff-del-bg)",color:"var(--diff-del-text)"},children:n},s):l.jsx("div",{className:"px-3",style:{color:"var(--diff-context-text)"},children:n},s)})})})}function sx({name:e,args:t,result:n,durationDisplay:s,status:r,onClose:i}){var c;const o=typeof t.path=="string"?t.path:"",a=typeof((c=n==null?void 0:n.details)==null?void 0:c.diff)=="string"?n.details.diff:void 0;return l.jsxs(He,{trailing:s,title:l.jsx(yn,{name:e,status:r}),onClose:i,children:[l.jsx("div",{className:"px-5 py-2 border-b border-[var(--separator)] bg-[var(--fill-quaternary)]",children:l.jsx("p",{className:"text-[13px] text-[var(--label-secondary)] break-all leading-[20px] font-mono",children:o})}),l.jsx("div",{className:"flex-1 overflow-y-auto pt-3 pb-5 scrollbar-auto",children:n!==null?n.isError?l.jsx(ut,{error:!0,className:"mx-5",children:n.content}):a?l.jsx(nx,{diff:a}):l.jsx(ut,{className:"mx-5",children:n.content}):l.jsx("div",{className:"px-5",children:l.jsx(gn,{status:r})})})]})}function rx({name:e,args:t,result:n,durationDisplay:s,status:r,onClose:i}){const o=typeof t.path=="string"?t.path:"",a=typeof t.offset=="number"?t.offset:void 0,c=typeof t.limit=="number"?t.limit:void 0,u=Kc(o);let d=o;if(a!=null||c!=null){const g=a??"",p=c!=null?(a??1)+c-1:"";d+=` [${g}:${p}]`}const h=u==="markdown",m=n&&!n.isError&&!h?is(n.content,u??""):null;return l.jsxs(He,{title:l.jsx(yn,{name:e,status:r}),onClose:i,trailing:s,children:[l.jsx("div",{className:"px-5 py-2 border-b border-[var(--separator)] bg-[var(--fill-quaternary)]",children:l.jsx("p",{className:"text-[13px] text-[var(--label-secondary)] break-all leading-[20px] font-mono",children:d})}),l.jsx("div",{className:"flex-1 overflow-y-auto px-5 pt-3 pb-5 scrollbar-auto",children:n!==null?n.isError?l.jsx(ut,{error:!0,children:n.content}):h?l.jsx(Ze,{content:n.content}):l.jsx(Ze,{content:m}):l.jsx(gn,{status:r})})]})}function ix({name:e,args:t,result:n,durationDisplay:s,status:r,onClose:i}){const{t:o}=G(),a=typeof t.path=="string"?t.path:"",c=typeof t.content=="string"?t.content:"",u=Kc(a),d=u==="markdown",h=d?null:is(c,u??"");return l.jsxs(He,{trailing:s,title:l.jsx(yn,{name:e,status:r}),onClose:i,children:[l.jsx("div",{className:"px-5 py-2 border-b border-[var(--separator)] bg-[var(--fill-quaternary)]",children:l.jsx("p",{className:"text-[13px] text-[var(--label-secondary)] break-all leading-[20px] font-mono",children:a})}),l.jsxs("div",{className:"flex-1 overflow-y-auto px-5 pt-3 pb-5 space-y-3 scrollbar-auto",children:[l.jsx("section",{children:l.jsx(Ze,{content:d?c:h})}),n!==null&&l.jsxs("section",{children:[l.jsx("h4",{className:"select-none text-[11px] font-semibold text-[var(--label-tertiary)] uppercase tracking-wide mb-1.5",children:o("entries.result")}),l.jsx(ut,{error:n.isError,children:n.content})]}),n===null&&l.jsx(gn,{status:r})]})]})}function ox(e){const t=e.name==="read"?rx:e.name==="bash"?ex:e.name==="write"?ix:e.name==="edit"?sx:tx;return l.jsx(t,{...e})}function ax({name:e,args:t,toolCallId:n,presentation:s,compact:r=!1}){const{t:i}=G(),[o,a]=f.useState(!1),c=Zy(e,t),{status:u,result:d,startedAt:h}=s,m=u==="completed"||u==="error",g=Si(u),p=lx(u==="running"?h:void 0),x=l.jsx(cx,{elapsed:m?d==null?void 0:d.durationMs:p,isFinal:m});return l.jsxs(l.Fragment,{children:[l.jsxs("button",{type:"button","aria-label":`${i("conversation.toolDetails",{name:e})}: ${g}`,title:g,"data-tool-state":u,onClick:()=>a(!0),className:r?"conversation-tool-row flex w-full items-center gap-2 rounded-control px-3 py-1 text-left group select-none hover:bg-[var(--fill-quaternary)] focus-visible:outline-2 focus-visible:outline-[var(--color-accent)]":"w-full max-w-[640px] flex items-center gap-2.5 px-3 py-2 rounded-content bg-[var(--fill-card)] border border-[var(--separator)] hover:bg-[var(--fill-tertiary)] transition-colors text-left group select-none",children:[l.jsx(Ci,{status:u}),l.jsx("span",{className:"text-[13px] font-medium text-[var(--label-primary)]",children:e}),c&&l.jsx("span",{className:"text-[12px] text-[var(--label-tertiary)] truncate flex-1 min-w-0",children:c}),l.jsxs("span",{className:"ml-auto flex items-center gap-2.5 flex-shrink-0",children:[x,l.jsx(Je,{size:14,"aria-hidden":"true",className:"text-[var(--label-tertiary)] group-hover:text-[var(--label-secondary)] transition-colors"})]})]}),l.jsx($e,{children:o&&l.jsx(ox,{name:e,args:t,result:d,durationDisplay:x,status:u,onClose:()=>a(!1)},n??e)})]})}function lx(e){const[t,n]=f.useState(0);return f.useEffect(()=>{if(e===void 0)return;const s=()=>n(Math.max(0,performance.now()-e));s();const r=setInterval(s,1e3);return()=>clearInterval(r)},[e]),e===void 0?void 0:t}function cx({elapsed:e,isFinal:t}){const{t:n}=G();return e===void 0||!Number.isFinite(e)||e<=0?null:l.jsxs("span",{title:n(t?"entries.executionDuration":"entries.waitingDuration"),className:"flex items-center gap-1 text-[11px] text-[var(--label-tertiary)] flex-shrink-0",children:[l.jsx(Uf,{size:12}),e<1e3?`${Math.max(1,Math.round(e))} ms`:`${(e/1e3).toFixed(1)} s`]})}function ux({content:e,timestamp:t}){const{t:n}=G(),[s,r]=f.useState(null);let i="",o=[];return typeof e=="string"?i=e:Array.isArray(e)?(i=e.filter(a=>a.type==="text").map(a=>a.text).join(""),o=e.filter(a=>a.type==="image")):i=JSON.stringify(e),l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"flex flex-col items-end gap-1 px-1 py-1 md:px-2","aria-label":n("conversation.you"),children:[l.jsxs("div",{className:"max-w-[90%] rounded-surface bg-[var(--color-accent)] text-white md:max-w-[80%]",children:[o.length>0&&l.jsx("div",{className:"flex flex-wrap gap-1.5 p-2 pb-0",children:o.map((a,c)=>{const u=`data:${a.mimeType};base64,${a.data}`,d=n("conversation.attachedImage",{count:c+1});return l.jsx("button",{type:"button","aria-label":d,onClick:()=>r(u),className:"block overflow-hidden rounded-inline transition-opacity hover:opacity-90 motion-reduce:transition-none",children:l.jsx("img",{src:u,alt:d,className:"max-h-[150px] max-w-[200px] object-cover",draggable:!1})},c)})}),i&&l.jsx("p",{className:"break-words whitespace-pre-wrap px-3 py-2 text-[14px] leading-[22px]",children:i}),!i&&o.length>0&&l.jsx("div",{className:"h-2"})]}),l.jsx(wi,{timestamps:[t]})]}),l.jsx($e,{children:s&&l.jsx(bi,{src:s,onClose:()=>r(null)},"image")})]})}function dx({items:e,conversationKey:t,status:n,isStreaming:s,onReEdit:r,onBeforeToggle:i}){var h;const o=n!=="compacting"&&(n==="streaming"||s),a=e.at(-1),c=o&&(a==null?void 0:a.type)!=="reply"?{type:"reply",key:`reply:${(a==null?void 0:a.key)??"pending"}`,userEntryKey:(a==null?void 0:a.type)==="user"?a.key:void 0,entries:[],parts:[]}:null,u=c?[...e,c]:e,d=(h=u.slice().reverse().find(m=>m.type==="reply"))==null?void 0:h.key;return l.jsx(hn,{features:ms,strict:!0,children:l.jsx(ag,{reducedMotion:"user",children:l.jsxs("div",{className:"conversation-list space-y-3",children:[u.map(m=>{var g;return m.type==="user"?l.jsx("div",{"data-entry-key":m.key,children:l.jsx(ux,{content:(g=m.entry.message)==null?void 0:g.content,timestamp:m.entry.timestamp})},m.key):m.type==="system"?l.jsx("div",{"data-entry-key":m.key,children:l.jsx(sa,{state:m.state??{status:"completed",entry:m.entry}})},m.key):l.jsx(fx,{reply:m,active:o&&m.key===d,settled:n==="idle"&&!s,onReEdit:m.key===d?r:void 0,onBeforeToggle:i},m.key)}),n==="compacting"&&!e.some(m=>{var g;return m.type==="system"&&((g=m.state)==null?void 0:g.status)==="compacting"})&&l.jsx(sa,{state:{status:"compacting"}})]},t)})})}function fx({reply:e,active:t,settled:n,onReEdit:s,onBeforeToggle:r}){var m;const{t:i}=G(),o=(m=e.entries.slice().reverse().find(g=>{var p;return((p=g.message)==null?void 0:p.role)==="assistant"}))==null?void 0:m.message,a=(o==null?void 0:o.stopReason)==="aborted",c=(o==null?void 0:o.stopReason)==="error",u=e.parts.some(g=>g.type!=="execution"||g.items.length>0),d=!u&&t,h=!t&&(c||a);return!u&&!t&&!c&&!a&&!s?null:l.jsxs("div",{className:"conversation-reply-group space-y-1","data-entry-key":e.key,children:[(d||u)&&l.jsxs("article",{className:"conversation-reply rounded-surface border border-[var(--separator)] bg-[var(--fill-quaternary)] shadow-[0_2px_12px_rgba(0,0,0,0.035)]","data-reply-key":e.key,"aria-label":i("conversation.agentName"),children:[d&&l.jsxs("div",{className:"conversation-reply-pending flex items-center gap-2 px-4 py-3 text-[12px] leading-5 text-[var(--label-secondary)] md:px-5 md:py-4",role:"status",children:[l.jsx(Le,{size:14,"aria-hidden":"true",className:"animate-spin motion-reduce:animate-none"}),i("conversation.waitingReply")]}),u&&l.jsx("div",{className:"space-y-2 px-4 py-3 md:px-5 md:py-4",children:e.parts.map(g=>l.jsx("div",{"data-entry-key":g.key,className:"conversation-part min-w-0",children:g.type==="execution"?l.jsx(hx,{execution:g,onBeforeToggle:r}):g.type==="text"?l.jsx(Ze,{content:g.content,streaming:g.source.streaming}):l.jsx(Oy,{message:g.content})},g.key))})]}),l.jsxs("div",{className:"conversation-reply-footer flex flex-wrap items-center gap-x-3 gap-y-1 px-1 md:px-2",children:[l.jsxs("div",{className:"conversation-reply-time flex min-w-0 flex-1 basis-56 flex-wrap items-center gap-x-3 gap-y-1 text-[11px] leading-5 text-[var(--label-secondary)]",children:[l.jsx(wi,{timestamps:e.entries.map(g=>g.timestamp),showRange:!0,showDuration:n}),h&&l.jsx("span",{className:"conversation-reply-state",children:i(c?"conversation.replyFailed":"entries.aborted")})]}),!d&&s&&l.jsx(Q,{size:"compact",type:"button",onClick:s,className:"ml-auto shrink-0 px-2 text-[12px] text-[var(--color-accent)] hover:text-[var(--color-accent)] focus-visible:outline-2 focus-visible:outline-[var(--color-accent)]",children:i("reEdit.button")})]})]})}function hx({execution:e,onBeforeToggle:t}){const{t:n}=G(),[s,r]=f.useState(!1),[i,o]=f.useState(!1),a=f.useId(),c=e.items.filter(h=>h.type==="thinking"),u=c.some(h=>h.source.streaming),d=f.useMemo(()=>[...new Set(e.items.flatMap(h=>h.type==="tool"?[h.name]:[]))],[e.items]);return l.jsxs("section",{className:"conversation-execution rounded-surface border border-[var(--separator)] bg-[var(--fill-quaternary)]","data-execution-key":e.key,children:[l.jsxs("button",{type:"button","aria-expanded":s,"aria-controls":a,"aria-describedby":`${a}-summary`,"aria-label":n(s?"conversation.collapseExecution":"conversation.expandExecution"),onClick:h=>{t==null||t(h.currentTarget),o(!0),r(!s)},className:"conversation-execution-toggle select-none flex w-full items-center gap-2 rounded-surface px-3 py-1 text-left focus-visible:outline-2 focus-visible:outline-[var(--color-accent)]",children:[l.jsx(Je,{size:14,"aria-hidden":"true",className:`shrink-0 text-[var(--label-secondary)] transition-transform motion-reduce:transition-none ${s?"rotate-90":""}`}),l.jsxs("span",{id:`${a}-summary`,className:"flex min-w-0 flex-1 flex-wrap items-center gap-x-3 gap-y-1 text-[12px] text-[var(--label-secondary)]",children:[l.jsxs("span",{className:"conversation-execution-counts inline-flex shrink-0 flex-wrap items-center gap-x-3 gap-y-1",children:[l.jsx(mx,{counts:e.counts}),c.length>0&&l.jsx(gx,{count:c.length,streaming:u})]}),d.length>0&&l.jsx(px,{names:d})]})]}),l.jsx(zc,{id:a,expanded:s,children:i&&l.jsx("div",{className:"space-y-1 border-t border-[var(--separator)] p-2",children:e.items.map(h=>h.type==="thinking"?l.jsx(qy,{content:h.content,streaming:h.source.streaming,onBeforeToggle:t},h.key):l.jsx(ax,{name:h.name,args:h.args,toolCallId:h.toolCallId,presentation:h.presentation,compact:!0},h.key))})})]})}function px({names:e}){const{t}=G(),n=f.useRef(null),s=f.useRef(null),[r,i]=f.useState(e.length);f.useLayoutEffect(()=>{var g;const c=n.current,u=s.current;if(!c||!u)return;let d=!0;const h=()=>{if(!d)return;const p=c.getBoundingClientRect().width;if(p<=0)return;const x=Array.from(u.querySelectorAll("[data-measure-name]")).map(S=>S.getBoundingClientRect().width),y=Array.from(u.querySelectorAll("[data-measure-overflow]")).map(S=>S.getBoundingClientRect().width),b=parseFloat(getComputedStyle(c).columnGap)||0;let k=0,v=0;for(const[S,w]of x.entries()){k+=w+(S>0?b:0);const M=e.length-S-1;k+(M>0?b+(y[M-1]??0):0)<=p&&(v=S+1)}i(v)};h();const m=new ResizeObserver(h);return m.observe(c),m.observe(u),(g=document.fonts)==null||g.ready.then(h),()=>{d=!1,m.disconnect()}},[e]);const o=Math.min(r,e.length),a=e.length-o;return l.jsxs("span",{ref:n,className:"conversation-tool-names relative flex min-w-0 flex-1 items-center gap-1 overflow-hidden",children:[e.slice(0,o).map(c=>l.jsx("span",{"data-tool-name":c,className:"conversation-tool-name",children:c},c)),a>0&&l.jsxs("span",{className:"conversation-tool-overflow shrink-0 text-[11px] tabular-nums","aria-label":t("conversation.moreToolTypes",{count:a}),children:["+",a]}),l.jsxs("span",{ref:s,"aria-hidden":"true",className:"conversation-tool-measure pointer-events-none invisible absolute left-0 top-0 flex w-max items-center gap-1",children:[e.map(c=>l.jsx("span",{"data-measure-name":!0,className:"conversation-tool-name",children:c},c)),e.map((c,u)=>l.jsxs("span",{"data-measure-overflow":!0,className:"shrink-0 text-[11px] tabular-nums",children:["+",u+1]},u))]})]})}function mx({counts:e}){const t=["pending","running","completed","error","aborted","unknown"];return l.jsx(l.Fragment,{children:t.map(n=>e[n]>0?l.jsx(Ci,{status:n,count:e[n]},n):null)})}function gx({count:e,streaming:t}){const{t:n}=G(),s=n(t?"conversation.thinkingStreamingCount":"conversation.thinkingCount",{count:e}),r=t?Le:ls;return l.jsxs("span",{role:"img","aria-label":s,title:s,"data-thinking-status":t?"streaming":"completed",className:"inline-flex shrink-0 items-center gap-1 whitespace-nowrap tabular-nums text-[var(--label-secondary)]",children:[l.jsx(r,{size:14,"aria-hidden":"true",className:t?"animate-spin motion-reduce:animate-none":void 0}),l.jsx("span",{"aria-hidden":"true",children:e})]})}function yx(e,t){if(t&&(e===t||e.startsWith(t.endsWith("/")?t:t+"/"))){const n=e.slice(t.length);return!n||n==="/"?"~":"~"+(n.startsWith("/")?n:"/"+n)}return e}function Rr(e,t){if(e.length<=t)return e;const n=Math.floor((t-1)/2),s=t-1-n;return e.slice(0,s)+"…"+e.slice(-n)}function xx(e){const t=e.split("/").filter(Boolean);return t.length<=2?e.length:t.slice(-2).join("/").length}function ra(e,t){if(e.length<=t)return e;const n=xx(e);if(n+2<=t){const s=t-1-n;return e.slice(0,s)+"…"+e.slice(-n)}return Rr(e,t)}const bx=6.2,vx=20,wx=8;function ia({icon:e,text:t,copyText:n,title:s}){const[r,i]=f.useState(!1),o=f.useRef(null);f.useEffect(()=>()=>{o.current&&clearTimeout(o.current)},[]);const a=f.useCallback(()=>{navigator.clipboard.writeText(n).then(()=>{i(!0),o.current&&clearTimeout(o.current),o.current=setTimeout(()=>i(!1),1500)},()=>{})},[n]);return l.jsxs(Q,{size:"inline",type:"button",onClick:a,title:s??n,className:"inline-flex min-h-[18px] min-w-0 items-center gap-1 px-1 -mx-1 transition-colors hover:bg-[var(--fill-tertiary)] active:bg-[var(--fill-secondary)] cursor-pointer select-none focus-visible:outline-2 focus-visible:outline-[var(--color-accent)]",children:[l.jsx("span",{className:"shrink-0 opacity-70",children:r?l.jsx(Tt,{size:11,className:"text-[var(--toast-icon-success)]"}):e}),l.jsx("span",{className:"truncate",children:t})]})}function oa({title:e,cwd:t,homedir:n,gitBranch:s,actions:r}){const i=t?yx(t,n):null,o=f.useRef(null),[a,c]=f.useState(i),[u,d]=f.useState(s),h=f.useCallback(()=>{const m=o.current;if(!m)return;const g=m.getBoundingClientRect().width;if(g<=0)return;const p=(i?1:0)+(s?1:0),x=p*vx+(p-1)*wx,y=Math.floor((g-x)/bx);if(i&&s){const b=Math.max(10,Math.floor(y*.6)),k=Math.max(8,y-b);c(ra(i,b)),d(Rr(s,k))}else i?c(ra(i,Math.max(10,y))):s&&d(Rr(s,Math.max(8,y)))},[i,s]);return f.useEffect(()=>{const m=o.current;if(!m)return;const g=new ResizeObserver(()=>h());return g.observe(m),h(),()=>g.disconnect()},[h]),f.useEffect(()=>{c(i),d(s),h()},[i,s,h]),l.jsxs("div",{className:"flex min-h-[44px] min-w-0 w-full flex-1 items-center justify-between gap-3",children:[l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsx("div",{className:"truncate text-[14px] leading-[20px] font-medium text-[var(--label-primary)] select-text",children:e}),(i||s)&&l.jsxs("div",{ref:o,className:"mt-0.5 flex min-w-0 items-center gap-2 text-[11px] leading-[14px] text-[var(--label-secondary)]",children:[a&&l.jsx(ia,{icon:l.jsx(Va,{size:11}),text:a,copyText:t,title:t},t),u&&l.jsx(ia,{icon:l.jsx(Ba,{size:11}),text:u,copyText:s},s)]})]}),r&&l.jsx("div",{className:"flex shrink-0 items-center justify-center",children:r})]})}function Sx(e,t){const n=new Date(e),r=Date.now()-n.getTime(),i=Math.floor(r/6e4);if(i<1)return t("session.timeJustNow");if(i<60)return`${i}m`;const o=Math.floor(i/60);if(o<24)return`${o}h`;const a=Math.floor(o/24);if(a<7)return`${a}d`;const c=Math.floor(a/7);return c<4?`${c}w`:n.toLocaleDateString()}function Cx({sessions:e,loading:t,hasMore:n,total:s,disabled:r,onOpen:i,onNewSession:o,onSwitchSession:a,onLoadMore:c,onFilterChange:u}){const{t:d}=G(),[h,m]=f.useState(""),g=f.useRef(null),p=f.useRef(null);f.useEffect(()=>()=>{g.current&&clearTimeout(g.current)},[]);const x=f.useCallback(b=>{m(b),g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{u(b)},300)},[u]),y=f.useCallback(b=>{if(!n||t)return;const k=b.currentTarget;k.scrollHeight-k.scrollTop-k.clientHeight<40&&c(e.length,h)},[n,t,e.length,h,c]);return l.jsx(At,{label:d("session.title"),trigger:({open:b,id:k})=>l.jsx(Q,{size:"icon",type:"button",disabled:r,"aria-label":d("session.title"),"aria-haspopup":"dialog","aria-expanded":b,"aria-controls":b?k:void 0,className:`flex items-center justify-center transition-colors focus-visible:outline-2 focus-visible:outline-[var(--color-accent)] ${b?"bg-[var(--fill-secondary)]":"hover:bg-[var(--fill-tertiary)]"} ${r?"opacity-40 pointer-events-none":""}`,title:d("session.title"),onClick:()=>{b||(m(""),i())},children:l.jsx(Tf,{size:18,className:"text-[var(--label-secondary)]","aria-hidden":"true"})}),width:320,maxHeight:420,disabled:r,placement:"bottom",children:b=>l.jsxs("div",{className:"ui-menu-layout",children:[l.jsxs("div",{className:"ui-menu-heading",children:[l.jsxs("span",{className:"text-[13px] font-medium text-[var(--label-primary)] select-none",children:[d("session.title"),s>0&&l.jsxs("span",{className:"ml-1.5 text-[11px] font-normal text-[var(--label-tertiary)]",children:["(",s,")"]})]}),l.jsxs(Q,{size:"compact",variant:"ghost",className:"active:bg-[var(--fill-tertiary)]",onClick:()=>{o(),b()},disabled:r,children:[l.jsx(Ha,{size:12}),l.jsx("span",{children:d("session.new")})]})]}),l.jsx("div",{className:"px-3 pb-2",children:l.jsx(pi,{"aria-label":d("session.filter"),type:"text",placeholder:d("session.filter"),value:h,onChange:k=>x(k.target.value),autoFocus:!0})}),l.jsx("div",{className:"h-px bg-[var(--separator)] mx-2"}),l.jsx("div",{ref:p,className:"ui-menu-scroll flex-1 scrollbar-auto",onScroll:y,children:t&&e.length===0?l.jsx(Re,{tone:"loading",children:d("common.loading")}):e.length===0?l.jsx(Re,{children:d(h?"session.noMatch":"session.noPrevious")}):l.jsxs(l.Fragment,{children:[e.map(k=>l.jsxs(Ne,{selected:k.isCurrent,"aria-current":k.isCurrent||void 0,onClick:()=>{k.isCurrent||(a(k.path),b())},disabled:k.isCurrent,className:"flex-col items-stretch gap-0.5",children:[l.jsxs("div",{className:"flex items-center justify-between gap-2",children:[l.jsx("span",{className:`text-[14px] leading-[20px] truncate ${k.isCurrent?"font-medium text-[var(--color-accent)]":"text-[var(--label-primary)]"}`,children:k.name||k.firstMessage||d("session.empty")}),l.jsx("span",{className:"text-[12px] text-[var(--label-secondary)] whitespace-nowrap shrink-0",children:Sx(k.modified,d)})]}),k.name&&k.firstMessage&&l.jsx("div",{className:"mt-0.5 text-[12px] leading-[18px] text-[var(--label-secondary)] truncate",children:k.firstMessage}),l.jsx("div",{className:"mt-0.5 text-[11px] text-[var(--label-secondary)]",children:d("session.messageCount",{count:k.messageCount})})]},k.id)),t&&e.length>0&&l.jsx("div",{className:"flex items-center justify-center py-2",children:l.jsx(Le,{size:14,className:"animate-spin text-[var(--label-tertiary)]"})})]})})]})})}function Fn(e){return de(e)&&typeof e.role=="string"&&"content"in e}function aa(e){if(!de(e)||typeof e.type!="string")return!1;for(const t of["id","__renderKey","timestamp","summary"])if(e[t]!==void 0&&typeof e[t]!="string")return!1;return(e.parentId===void 0||e.parentId===null||typeof e.parentId=="string")&&(e.message===void 0||Fn(e.message))}function kx(e){if(!de(e)||typeof e.toolCallId!="string"||!e.toolCallId||e.parentToolCallId!==void 0&&typeof e.parentToolCallId!="string")return!1;switch(e.type){case"tool_execution_start":case"tool_execution_update":return!0;case"tool_execution_end":return typeof e.isError=="boolean"&&(e.durationMs===void 0||typeof e.durationMs=="number");default:return!1}}function Se(e){const t=e.id??e.__renderKey;if(!t)throw new Error(`SessionEntry missing stable render key: type=${e.type}`);return t}function jx(e,t,n,s,r=Ex){return f.useMemo(()=>Nx(e,t,n,s,r),[e,t,n,s,r])}const Ex=new Set;function la(e,t=!1,n){const s=de(e)?e:null,r=s==null?void 0:s.content;return{content:Array.isArray(r)?r.flatMap(i=>de(i)&&i.type==="text"&&typeof i.text=="string"?[i.text]:[]).join(`
|
|
259
|
+
`):String(r??""),details:de(s==null?void 0:s.details)?s.details:void 0,isError:t,durationMs:n}}function ca(e){return e.status==="completed"||e.status==="error"?{status:e.status,result:la(e.result,e.status==="error",e.durationMs)}:e.status==="running"?{status:e.status,result:e.execution.partialResult!=null?la(e.execution.partialResult):null,startedAt:e.execution.startedAt}:{status:e.status,result:null}}function Tx(e,t,n,s,r,i){var c,u;const o=n.get(e);if(o!=null&&o.message){const d=o.message;return{status:d.isError===!0?"error":"completed",result:d,resultEntry:o,durationMs:typeof d.durationMs=="number"?d.durationMs:void 0}}const a=s.get(e);return(a==null?void 0:a.status)==="completed"?{status:a.isError?"error":"completed",result:a.result,durationMs:a.durationMs}:((c=t.message)==null?void 0:c.stopReason)==="aborted"||((u=t.message)==null?void 0:u.stopReason)==="error"?{status:"aborted"}:(a==null?void 0:a.status)==="running"&&r!=="idle"?{status:"running",execution:a}:i&&r!=="idle"?{status:"pending"}:{status:"unknown"}}function Nx(e,t,n,s,r){var p;const i=new Map;for(const x of e){const y=x.message;x.type==="message"&&(y==null?void 0:y.role)==="toolResult"&&typeof y.toolCallId=="string"&&!i.has(y.toolCallId)&&i.set(y.toolCallId,x)}const o=[],a=new Map;let c,u,d,h;function m(x){return u||(u={type:"reply",key:`reply:${h??c??Se(x)}`,userEntryKey:c,entries:[],parts:[]},o.push(u)),u}function g(x){return d||(d={type:"execution",key:`execution:${x.key}`,items:[],counts:{pending:0,running:0,completed:0,error:0,aborted:0,unknown:0}},m(x.entry).parts.push(d)),d}for(const x of e){if(x.type==="compaction"||x.type==="branch_summary"){const S={type:"system",key:Se(x),entry:x};o.push(S),h=S.key,u=void 0,d=void 0;continue}if(x.type!=="message"||!x.message)continue;const y=x.message;if(y.role==="user"){c=Se(x),o.push({type:"user",key:c,entry:x}),u=void 0,h=void 0,d=void 0;continue}if(y.role==="toolResult"){typeof y.toolCallId=="string"&&((p=a.get(y.toolCallId))==null||p.entries.push(x));continue}if(y.role!=="assistant")continue;const b=m(x);b.entries.push(x);const k=Se(x),v=Array.isArray(y.content)?y.content:typeof y.content=="string"?[{type:"text",text:y.content}]:[];for(const[S,w]of v.entries()){if(!de(w))continue;const M={key:`${k}:block:${S}`,entry:x,blockIndex:S,streaming:x===n&&S===v.length-1};if(w.type==="text"&&typeof w.text=="string"){if(!w.text.trim())continue;b.parts.push({type:"text",key:M.key,source:M,content:w.text}),d=void 0}else if(w.type==="thinking"&&typeof w.thinking=="string"){const T=g(M);if(!w.thinking.trim())continue;T.items.push({type:"thinking",key:M.key,source:M,content:w.thinking})}else if(w.type==="toolCall"&&typeof w.id=="string"&&typeof w.name=="string"){if(a.has(w.id))continue;a.set(w.id,b);const T=g(M),C=Tx(w.id,x,i,t,n?"streaming":s,x===n||r.has(w.id));T.items.push({type:"tool",key:`tool:${w.id}`,source:M,toolCallId:w.id,name:w.name,args:de(w.arguments)?w.arguments:{},state:C,presentation:ca(C)}),T.counts[C.status]+=1}}if((y.stopReason==="error"||y.stopReason==="aborted")&&typeof y.errorMessage=="string"&&y.errorMessage&&(b.parts.push({type:"error",key:`${k}:error`,source:{key:k,entry:x,streaming:x===n},content:y.errorMessage,stopReason:y.stopReason}),d=void 0),y.stopReason==="aborted"||y.stopReason==="error"){for(const S of b.parts)if(S.type==="execution")for(const w of S.items)w.type!=="tool"||!["pending","running","unknown"].includes(w.state.status)||(S.counts[w.state.status]-=1,w.state={status:"aborted"},w.presentation=ca(w.state),S.counts.aborted+=1)}}for(const x of o)x.type==="reply"&&(x.parts=x.parts.filter(y=>y.type!=="execution"||y.items.length>0));return o}let Rx=0;function Dn(e,t){return`${e}:${t}:${Rx++}`}function ua(e,t,n){return t.id||t.__renderKey?t:{...t,__renderKey:Dn(e,n)}}const Mx=()=>{};function Ax(e,t,n=Mx){const{t:s}=G(),r=me(B=>B.send),i=me(B=>B.subscribe),o=me(B=>B.connectionState==="connected"),[a,c]=f.useState([]),[u,d]=f.useState(new Map),[h,m]=f.useState(new Set),[g,p]=f.useState(null),x=f.useRef(null),y=f.useRef(null),[b,k]=f.useState("idle"),[v,S]=f.useState(null),[w,M]=f.useState(!1),[T,C]=f.useState([]),j=f.useRef(null),E=f.useRef(!1),P=f.useRef(!1),$=f.useRef(new Set),N=f.useRef(null),R=f.useRef(a);R.current=a;const I=f.useRef(b);I.current=b;const L=f.useRef(w);L.current=w;const O=f.useCallback(()=>{c([]),N.current=null,C([]),j.current=null,E.current=!1,P.current=!1,$.current.clear(),d(new Map),m(new Set),x.current=null,y.current=null,p(null),k("refreshing"),S(null),M(!1),n()},[n]);f.useEffect(()=>i(B=>{switch(B.type){case"forwarded_event":{if(B.payload.instanceId!==e)return;z(e,B.payload.event,B.payload.data,B.payload.timestamp);break}case"history":{if(B.payload.instanceId!==e)return;const ne=B.payload.messages;if(!Array.isArray(ne)||!ne.every(aa)){console.error("[Paimon] Invalid conversation history"),k("error"),S(null);break}const Y=B.payload.hasMore??!1;q(e,ne,Y);break}case"error":{console.error("[Paimon]",B.payload.message),k("error"),S(B.payload.message);break}case"instance_error":{if(B.payload.instanceId!==e)return;const ne=B.payload.action?`error.action.${B.payload.action}`:null,Y=ne?s(ne,{message:B.payload.message,defaultValue:B.payload.message}):B.payload.message;Ct(Y,"error");break}}}),[e,i]),f.useEffect(()=>{if(o)return O(),r({type:"subscribe",payload:{instanceId:e}}),r({type:"get_history",payload:{instanceId:e}}),()=>{r({type:"unsubscribe",payload:{instanceId:e}})}},[e,o,r,O]);const _=f.useRef(t==null?void 0:t.sessionId),U=f.useRef(e);f.useEffect(()=>{const B=t==null?void 0:t.sessionId;if(e!==U.current){U.current=e,B!==void 0&&(_.current=B);return}_.current!==void 0&&B!==void 0&&B!==_.current&&(O(),r({type:"get_history",payload:{instanceId:e}})),B!==void 0&&(_.current=B)},[t==null?void 0:t.sessionId,e,r,O]);const F=f.useRef(t==null?void 0:t.status);f.useEffect(()=>{const B=t==null?void 0:t.status;B==="compacting"&&(!j.current||E.current)&&A(),F.current==="compacting"&&B!=="compacting"&&!E.current&&(D({status:"refreshing"}),P.current=!0,I.current!=="loadingMore"&&r({type:"get_history",payload:{instanceId:e}})),F.current=B},[t==null?void 0:t.status,e,r]);function A(B=Date.now()){const ne=Dn(e,"compaction");j.current=ne,E.current=!1,$.current=new Set(R.current.flatMap(X=>X.type==="compaction"&&X.id?[X.id]:[]));const Y=N.current;C(X=>[...X,{key:ne,afterEntryKey:Y,timestamp:B,state:{status:"compacting"}}])}function D(B){const ne=j.current;C(Y=>Y.map(X=>X.key===ne?{...X,state:B}:X))}function V(B){if((B==null?void 0:B.role)!=="assistant")return;const ne=Array.isArray(B.content)?B.content:[];m(new Set(ne.flatMap(Y=>de(Y)&&Y.type==="toolCall"&&typeof Y.id=="string"?[Y.id]:[])))}function z(B,ne,Y,X){if(!de(Y))return;const ce=Y,Z=new Date(X).toISOString();switch(ne){case"session_before_compact":{(!j.current||E.current)&&A(X);break}case"session_compact":{const K=ce.compactionEntry;if(!aa(K)||K.type!=="compaction"||!K.id)break;j.current||A(X),E.current=!0,D({status:"completed",entry:K}),N.current=Se(K),c(ee=>ee.some(re=>re.id===K.id)?ee:[...ee,K]),j.current=null;break}case"session_compact_failed":{if(typeof ce.aborted!="boolean")break;j.current||A(X),E.current=!0,D({status:ce.aborted?"aborted":"failed",message:typeof ce.errorMessage=="string"?ce.errorMessage:void 0}),j.current=null;break}case"tool_execution_start":case"tool_execution_update":case"tool_execution_end":{const K={...ce,type:ne};if(!kx(K)||K.parentToolCallId)break;const ee=K.type==="tool_execution_start"?performance.now():void 0;d(re=>{const se=re.get(K.toolCallId);if((se==null?void 0:se.status)==="completed"&&K.type!=="tool_execution_end")return re;const Ke=new Map(re);return Ke.set(K.toolCallId,K.type==="tool_execution_end"?{status:"completed",startedAt:se==null?void 0:se.startedAt,result:K.result,isError:K.isError,durationMs:K.durationMs}:{status:"running",startedAt:K.type==="tool_execution_start"?ee:se==null?void 0:se.startedAt,partialResult:K.type==="tool_execution_update"?K.partialResult:(se==null?void 0:se.status)==="running"?se.partialResult:void 0}),Ke});break}case"message_start":{const K=ce.message;if(!Fn(K)||K.role!=="assistant")break;V(K);const ee=ua(B,{type:"message",timestamp:Z,message:K},"streaming");x.current=ee.__renderKey??ee.id??null,y.current=Z,p(ee);break}case"message_update":{const K=ce.message;if(!Fn(K))break;V(K);const ee=x.current??Dn(B,"streaming");x.current=ee;const re=y.current??Z;y.current=re,p(se=>se?{...se,message:K}:{type:"message",timestamp:re,message:K,__renderKey:ee});break}case"message_end":{const K=ce.message;if(Fn(K)){V(K);const ee=x.current??Dn(B,"live"),re={type:"message",timestamp:y.current??Z,message:K,__renderKey:ee};if(N.current=ee,c(se=>[...se,re]),K.role==="toolResult"&&typeof K.toolCallId=="string"){const se=K.toolCallId;d(Ke=>{if(!Ke.has(se))return Ke;const xs=new Map(Ke);return xs.delete(se),xs})}}x.current=null,y.current=null,p(null);break}}}function q(B,ne,Y){const X=ne.map(Z=>ua(B,Z,"history")),ce=P.current;if(I.current==="loadingMore")c(Z=>[...X,...Z]),ce&&r({type:"get_history",payload:{instanceId:e}});else if(ce){const Z=[...X].reverse().find(ee=>ee.type==="compaction"&&ee.id!==void 0&&!$.current.has(ee.id));E.current||(Z?(D({status:"completed",entry:Z}),j.current=null):D({status:"unavailable"}),E.current=!0),P.current=!1,c(X);const K=X.at(-1);N.current=K?Se(K):null}else{c(X);const Z=X.at(-1);if(N.current=Z?Se(Z):null,j.current&&!E.current){for(const ee of X)ee.type==="compaction"&&ee.id&&$.current.add(ee.id);const K=j.current;Z&&C(ee=>ee.map(re=>re.key===K&&!re.afterEntryKey?{...re,afterEntryKey:Se(Z)}:re))}}d(Z=>{var ee;const K=new Map(Z);for(const re of ne)((ee=re.message)==null?void 0:ee.role)==="toolResult"&&typeof re.message.toolCallId=="string"&&K.delete(re.message.toolCallId);return K}),M(Y),k("idle"),S(null)}const te=f.useCallback(()=>{if(!L.current||I.current!=="idle"||P.current)return;const B=R.current.length;k("loadingMore"),r({type:"get_history",payload:{instanceId:e,offset:B}})},[e,r]),ae=f.useMemo(()=>g?[...a,g]:a,[a,g]),Oe=f.useMemo(()=>{const B=new Set(ae.map(Z=>Z.id)),ne=T.filter(Z=>Z.state.status!=="completed"||!B.has(Z.state.entry.id)),Y=new Map(ae.map((Z,K)=>[Se(Z),K])),X=new Map;for(const Z of ne){let K=Z.afterEntryKey?Y.get(Z.afterEntryKey):void 0;if(K===void 0){const re=ae.findIndex(se=>se.timestamp!==void 0&&Date.parse(se.timestamp)>Z.timestamp);K=re>=0?re-1:ae.length-1}const ee=X.get(K)??[];ee.push({type:"compaction",__renderKey:Z.key}),X.set(K,ee)}const ce=[...X.get(-1)??[]];return ae.forEach((Z,K)=>{ce.push(Z,...X.get(K)??[])}),ce},[ae,T]),we=jx(Oe,u,g,t==null?void 0:t.status,h),Ue=f.useMemo(()=>{const B=new Map(T.map(Y=>[Y.key,Y])),ne=new Map(T.flatMap(Y=>Y.state.status==="completed"&&Y.state.entry.id?[[Y.state.entry.id,Y]]:[]));return we.map(Y=>{if(Y.type!=="system")return Y;const X=B.get(Y.key)??(Y.entry.id?ne.get(Y.entry.id):void 0);return X?{...Y,key:X.key,state:X.state}:Y})},[we,T]);return{entries:ae,displayItems:Ue,toolExecutions:u,streamingEntry:g,isStreaming:g!==null,loadState:b,errorMessage:v,hasMore:w,loadMore:te}}const Lx=.5;function Ix({topChromeHeight:e,bottomChromeHeight:t,bottomSafeGap:n=0}){const s=Math.max(0,t-n),r=Math.max(40,s+12);return{paddingTop:Math.max(24,e+16),paddingBottom:r,scrollButtonBottom:n+r}}function Px({previousScrollTop:e,previousScrollHeight:t,nextScrollHeight:n}){return e+n-t}function $x(e){return e==="streaming"||e==="compacting"?"stop":"send"}function Ht(e){return Math.max(0,e)}function Ox({isAtBottom:e,isLoadingMore:t,distanceToBottom:n,overlap:s,force:r=!1,scrollToBottom:i}){return!e||t||!r&&n<=Lx&&s<=0?!1:(i(),!0)}function _x({rawScrollTop:e,hasMore:t,canLoadMore:n,isLoadingMore:s,isSuppressed:r}){return e>=0&&Ht(e)<100&&t&&n&&!s&&!r}function Fx(e){const t=f.useRef(null),n=f.useRef(null),s=f.useRef(null),[r,i]=f.useState(64),[o,a]=f.useState(96),[c,u]=f.useState(12);return f.useLayoutEffect(()=>{const d=(p,x)=>{if(!p)return()=>{};const y=()=>{x(Math.ceil(p.getBoundingClientRect().height))};if(y(),typeof ResizeObserver>"u")return()=>{};const b=new ResizeObserver(y);return b.observe(p),()=>b.disconnect()},h=d(t.current,i),m=d(n.current,a),g=d(s.current,u);return()=>{h(),m(),g()}},[e]),{topChromeRef:t,bottomChromeRef:n,bottomSafeGapRef:s,topChromeHeight:r,bottomChromeHeight:o,bottomSafeGap:c,scrollSpacing:Ix({topChromeHeight:r,bottomChromeHeight:o,bottomSafeGap:c})}}function Dx(e,t,n,s){const{t:r}=G(),i=rs(u=>u.setDraft),{canReEdit:o,userContent:a}=f.useMemo(()=>{var d,h;if(n!=="idle"||t.length===0)return{canReEdit:!1,userContent:null};const u=t[t.length-1];if(u.type!=="message"||((d=u.message)==null?void 0:d.role)!=="assistant"||u.message.stopReason!=="aborted")return{canReEdit:!1,userContent:null};for(let m=t.length-2;m>=0;m--){const g=t[m];if(g.type==="message"&&((h=g.message)==null?void 0:h.role)==="user")return{canReEdit:!0,userContent:g.message.content}}return{canReEdit:!1,userContent:null}},[t,n]),c=f.useCallback(()=>{if(!o||a==null)return;const u=rs.getState().drafts.get(e)??vi;if(u.text.trim()||u.images.length>0){Ct(r("reEdit.draftNotEmpty"),"warning");return}const d=Vx(a);kt.flushSync(()=>{i(e,d)}),s==null||s()},[o,a,e,i,r,s]);return o?c:void 0}function Vx(e){let t="";const n=[];if(typeof e=="string")t=e;else if(Array.isArray(e)){const s=[];for(const r of e)if(de(r)){if(r.type==="text"&&typeof r.text=="string")s.push(r.text);else if(r.type==="image"&&typeof r.data=="string"&&typeof r.mimeType=="string"){const i=Bc();n.push({id:i,data:r.data,mimeType:r.mimeType,previewUrl:`data:${r.mimeType};base64,${r.data}`})}}t=s.join("")}return{text:t,images:n}}const da=350,xn="data-entry-key",Bx=.5,zx=3,Hx=2e3;function ys(e){return e.getAttribute(xn)??void 0}function ki(e,t){const n=t.closest(`[${xn}]`);return!n||!e.contains(n)?null:n}function Wc(e,t){const n=e.querySelectorAll(`[${xn}]`);for(const s of n)if(ys(s)===t)return s;return null}function lt(e,t){return t.getBoundingClientRect().top-e.top}function Ux(e){const t=e.getBoundingClientRect(),n=t.top+8,s=e.querySelectorAll(`[${xn}]`);for(const r of s){const i=r.getBoundingClientRect();if(i.bottom>n&&i.top<t.bottom)return r}return null}function Kx(e){const t={fallbackScrollTop:Ht(e.scrollTop),fallbackScrollHeight:e.scrollHeight},n=e.getBoundingClientRect(),s=Ux(e);if(!s)return t;const r=ys(s);if(!r)return t;const i=s.getBoundingClientRect(),o=Math.min(Math.max(n.top+12,i.top+8),Math.min(i.bottom-1,n.bottom-1)),a=[{x:n.left+n.width/2,y:o},{x:n.left+24,y:o},{x:n.right-24,y:o}];for(const c of a){const u=document.elementsFromPoint(c.x,c.y);for(const d of u){if(d===e||!e.contains(d))continue;const h=ki(e,d);if(!h||h!==s)continue;const m=d.getBoundingClientRect();if(!(m.bottom<=n.top||m.top>=n.bottom))return{...t,entryKey:r,element:d,elementTop:lt(n,d),entryTop:lt(n,s)}}}return{...t,entryKey:r,entryTop:lt(n,s)}}function fa(e,t){Math.abs(t)<=Bx||(e.scrollTop+=t)}function ha(e,t,{allowDiffFallback:n}){const s=e.getBoundingClientRect();if(t.element&&t.elementTop!=null&&t.element.isConnected&&e.contains(t.element)){const r=ki(e,t.element),i=r?ys(r):void 0;if(!t.entryKey||i===t.entryKey){const o=lt(s,t.element)-t.elementTop;return fa(e,o),{mode:"deep"}}}if(t.entryKey&&t.entryTop!=null){const r=Wc(e,t.entryKey);if(r){const i=lt(s,r)-t.entryTop;return fa(e,i),{mode:"entry"}}}if(n){const r=Px({previousScrollTop:t.fallbackScrollTop,previousScrollHeight:t.fallbackScrollHeight,nextScrollHeight:e.scrollHeight});return e.scrollTop=r,{mode:"diff"}}return{mode:"none"}}function Wx({scrollRef:e,contentRef:t,bottomChromeRef:n,entries:s,entriesRef:r,instanceId:i,hasMore:o,shouldScrollToBottom:a,onScrollToBottomHandled:c,onLoadMore:u,bottomChromeHeight:d,bottomSafeGap:h}){const m=f.useRef(!0),[g,p]=f.useState(!1),x=f.useRef(!1),y=f.useRef(!1),b=f.useRef(null),k=f.useRef(null),v=f.useRef(!1),S=f.useRef(null),w=f.useRef(s.length),M=f.useRef(void 0),T=f.useRef(0),C=f.useRef(null),j=f.useCallback(F=>{b.current!=null&&cancelAnimationFrame(b.current),y.current=!0,x.current=!0,F(),b.current=requestAnimationFrame(()=>{y.current=!1,x.current=!1,b.current=null})},[]),E=f.useCallback(()=>{var A;const F=C.current;F&&(F.rafId!=null&&cancelAnimationFrame(F.rafId),(A=F.observer)==null||A.disconnect(),C.current=null)},[]),P=f.useCallback(({force:F=!1}={})=>{const A=e.current,D=t.current,V=n.current;if(!A||!D||!V)return!1;const z=D.querySelectorAll(`[${xn}]`),q=z[z.length-1],te=q==null?void 0:q.getBoundingClientRect(),ae=V.getBoundingClientRect(),Oe=A.scrollHeight-Ht(A.scrollTop)-A.clientHeight,we=te?te.bottom-ae.top:0;return Ox({isAtBottom:m.current,isLoadingMore:v.current,distanceToBottom:Oe,overlap:we,force:F,scrollToBottom:()=>{E(),j(()=>{A.scrollTop=A.scrollHeight}),p(!1)}})},[e,t,n,j,E]),$=f.useCallback(()=>{var F;(F=k.current)==null||F.call(k),k.current=null},[]),N=f.useCallback(()=>{$();const F=performance.now();let A=null,D=!1;const V=(z=performance.now())=>{A=null,!(D||z-F>=Hx)&&(!m.current||v.current||(P(),A=requestAnimationFrame(V)))};V(),k.current=()=>{D=!0,A!=null&&(cancelAnimationFrame(A),A=null)}},[P,$]);f.useLayoutEffect(()=>{v.current||P()},[d,h,P]),f.useLayoutEffect(()=>{const F=t.current;if(!F||typeof ResizeObserver>"u")return;const A=new ResizeObserver(()=>{P()});return A.observe(F),()=>A.disconnect()},[i,t,P]);const R=f.useCallback(()=>{const F=e.current,A=C.current;if(!F||!A)return;let D={mode:"none"};j(()=>{D=ha(F,A.snapshot,{allowDiffFallback:!1})}),D.mode==="none"&&E()},[e,j,E]),I=f.useCallback(()=>{const F=C.current;!F||F.rafId!=null||(F.rafId=requestAnimationFrame(()=>{const A=C.current;!A||A!==F||(A.rafId=null,R())}))},[R]),L=f.useCallback(F=>{const A=e.current,D=t.current;if(!A||!D||!F.entryKey)return;E();const V={snapshot:F,observer:null,rafId:null,warmupFrame:0};if(C.current=V,typeof ResizeObserver<"u"){const q=new ResizeObserver(()=>{I()});q.observe(D);const te=Wc(A,F.entryKey);te&&te!==D&&q.observe(te),V.observer=q}const z=()=>{const q=C.current;!q||q!==V||q.warmupFrame>=zx||(q.rafId=requestAnimationFrame(()=>{const te=C.current;!te||te!==V||(te.rafId=null,te.warmupFrame+=1,R(),z())}))};z()},[e,t,R,I,E]);f.useLayoutEffect(()=>(v.current=!1,S.current=null,M.current=void 0,T.current=0,w.current=r.current.length,m.current=!0,p(!1),()=>{$(),E(),b.current!=null&&(cancelAnimationFrame(b.current),b.current=null),y.current=!1,x.current=!1,v.current=!1,S.current=null,M.current=void 0,T.current=0}),[i,r,E,$]),f.useLayoutEffect(()=>{e.current&&(v.current||P())},[s,i,e,P]),f.useLayoutEffect(()=>{if(!a)return;if(!e.current){c();return}m.current=!0,P({force:!0}),p(!1),c()},[a,s,e,P,c]),f.useLayoutEffect(()=>{const F=e.current;if(v.current&&F&&s.length>w.current){const A=s[0]?Se(s[0]):void 0;if(!M.current||A!==M.current){const V=S.current;let z={mode:"none"};V&&j(()=>{z=ha(F,V,{allowDiffFallback:!0})}),T.current=performance.now()+da,V&&V.entryKey&&z.mode!=="none"&&L(V),v.current=!1,S.current=null,M.current=void 0}else S.current&&(S.current={...S.current,fallbackScrollHeight:F.scrollHeight})}v.current&&!o&&(v.current=!1,S.current=null,M.current=void 0),w.current=s.length},[s,o,i,e,j,L]);const O=f.useCallback(F=>{const A=e.current;if(!A||v.current||(T.current=performance.now()+da,m.current))return;const D=ki(A,F),V=D?ys(D):void 0;if(!D||!V)return;const z=A.getBoundingClientRect();L({entryKey:V,element:F,elementTop:lt(z,F),entryTop:lt(z,D),fallbackScrollTop:Ht(A.scrollTop),fallbackScrollHeight:A.scrollHeight})},[e,L]),_=f.useCallback(()=>{const F=e.current;if(!F)return;const A=F.scrollTop,D=Ht(A),V=performance.now()<T.current;if(A<0||x.current||y.current)return;C.current&&E();const z=F.scrollHeight-D-F.clientHeight<60;if(m.current=z,z||$(),p(!z),_x({rawScrollTop:A,hasMore:o,canLoadMore:!!u,isLoadingMore:v.current,isSuppressed:V})&&u){$(),E(),v.current=!0;const te=r.current,ae=Kx(F);S.current=ae,M.current=te[0]?Se(te[0]):void 0,u()}},[e,r,o,u,E,$]),U=f.useCallback(()=>{e.current&&(E(),j(()=>{e.current.scrollTop=e.current.scrollHeight}),m.current=!0,p(!1))},[e,j,E]);return{handleScroll:_,scrollToBottom:U,showScrollBtn:g,startBottomFollow:N,prepareForContentResize:O}}function qx(e){const t=me(p=>p.send),n=me(p=>p.subscribe),[s,r]=f.useState([]),[i,o]=f.useState(!1),[a,c]=f.useState(!1),[u,d]=f.useState(0),h=f.useRef(0),m=f.useCallback(()=>{r([]),o(!1),c(!1),d(0)},[]);f.useEffect(()=>n(p=>{if(p.type!=="session_list"||p.payload.instanceId!==e)return;const{sessions:x,hasMore:y,total:b}=p.payload;r(k=>h.current>0?[...k,...x]:x),c(y??!1),d(b??x.length),o(!1)}),[e,n]);const g=f.useCallback(p=>{const x=(p==null?void 0:p.offset)??0;h.current=x,x===0&&r([]),o(!0),t({type:"list_sessions",payload:{instanceId:e,offset:x,limit:p==null?void 0:p.limit,filter:p==null?void 0:p.filter}})},[e,t]);return{sessionList:s,sessionListLoading:i,sessionHasMore:a,sessionTotal:u,requestSessionList:g,resetSessionList:m}}function Gx(){const{t:e}=G(),{id:t=""}=Hu(),n=me(ie=>ie.send),s=Ft(y1(t)),r=rs(ie=>ie.drafts.get(t)??vi),i=rs(ie=>ie.setDraft),{sessionList:o,sessionListLoading:a,sessionHasMore:c,sessionTotal:u,requestSessionList:d,resetSessionList:h}=qx(t),{entries:m,displayItems:g,isStreaming:p,loadState:x,errorMessage:y,hasMore:b,loadMore:k}=Ax(t,s,h),v=f.useCallback(ie=>{i(t,ie)},[t,i]),S=f.useCallback((ie,We)=>{n({type:"prompt",payload:{instanceId:t,message:ie,images:We!=null&&We.length?We:void 0}}),i(t,{text:"",images:[]})},[t,n,i]),w=f.useCallback(()=>{n({type:"abort",payload:{instanceId:t}})},[t,n]),M=f.useCallback((ie,We)=>{n({type:"set_model",payload:{instanceId:t,provider:ie,id:We}})},[t,n]),T=f.useCallback(ie=>{n({type:"set_thinking_level",payload:{instanceId:t,level:ie}})},[t,n]),C=f.useCallback(()=>{d({offset:0})},[d]),j=f.useCallback((ie,We)=>{d({offset:ie,filter:We})},[d]),E=f.useCallback(ie=>{d({offset:0,filter:ie||void 0})},[d]),P=f.useCallback(()=>{n({type:"new_session",payload:{instanceId:t}})},[t,n]),$=f.useCallback(ie=>{n({type:"switch_session",payload:{instanceId:t,path:ie}})},[t,n]),N=f.useCallback(ie=>{n({type:"compact",payload:{instanceId:t,customInstructions:ie}})},[t,n]),R=f.useRef(null),I=Dx(t,m,s==null?void 0:s.status,()=>{var ie;(ie=R.current)==null||ie.focus()}),L=f.useRef(null),O=f.useRef(null),[_,U]=f.useState(null),F=f.useRef(m);F.current=m;const A=x==="refreshing",D=$x(s==null?void 0:s.status),V=m.length>0&&m[m.length-1].type==="compaction",z=wt(s==null?void 0:s.status),[q,te]=f.useState(!1),ae=f.useCallback(()=>{te(!1)},[]),Oe=f.useRef(x);f.useLayoutEffect(()=>{Oe.current==="refreshing"&&x==="idle"&&te(!0),Oe.current=x},[x]);const{topChromeRef:we,bottomChromeRef:Ue,bottomSafeGapRef:B,topChromeHeight:ne,bottomChromeHeight:Y,bottomSafeGap:X,scrollSpacing:ce}=Fx(t),{handleScroll:Z,scrollToBottom:K,showScrollBtn:ee,startBottomFollow:re,prepareForContentResize:se}=Wx({scrollRef:L,contentRef:O,bottomChromeRef:Ue,entries:m,entriesRef:F,instanceId:t,hasMore:b,shouldScrollToBottom:q,onScrollToBottomHandled:ae,onLoadMore:k,bottomChromeHeight:Y,bottomSafeGap:X}),Ke={overflowAnchor:"none","--conversation-top-edge":`${ne}px`,"--conversation-bottom-edge":`${Math.max(0,Y-X)}px`},ji={title:(s==null?void 0:s.cwd.split("/").pop())||(s==null?void 0:s.cwd)||"",cwd:s==null?void 0:s.cwd,homedir:s==null?void 0:s.homedir,gitBranch:s==null?void 0:s.gitBranch,actions:l.jsx(Cx,{sessions:o,loading:a,hasMore:c,total:u,disabled:wt(s==null?void 0:s.status),onOpen:C,onNewSession:P,onSwitchSession:$,onLoadMore:j,onFilterChange:E})};return l.jsxs("div",{className:"relative flex-1 min-w-0 overflow-hidden",children:[l.jsxs("main",{className:"absolute inset-0 flex min-h-0 flex-col overflow-hidden",children:[l.jsx("div",{ref:we,className:"pointer-events-none absolute left-0 right-0 top-0 z-20 px-3 pt-3 md:px-4 md:pt-0",children:l.jsxs("div",{className:"conversation-topbar header-material pointer-events-auto w-full px-3 py-2 md:px-4",role:"region","aria-label":e("conversation.instanceInfo"),children:[l.jsx("div",{className:"hidden md:flex",children:l.jsx(oa,{...ji})}),l.jsx(Oc,{children:l.jsx(oa,{...ji})})]})}),l.jsx("div",{ref:L,onScroll:Z,style:Ke,"aria-busy":A,className:"conversation-scroll absolute bottom-[var(--bottom-safe-gap)] left-0 right-0 top-0 overflow-y-auto scrollbar-auto px-3 md:bottom-0 md:px-4",children:l.jsxs("div",{ref:O,style:{paddingTop:ce.paddingTop,paddingBottom:ce.paddingBottom},className:"mx-auto max-w-[920px] space-y-2",children:[x==="loadingMore"&&l.jsx(Re,{compact:!0,tone:"loading",className:"justify-center",children:e("conversation.loadingEarlier")}),A?l.jsx(Yx,{}):x==="error"?l.jsx(Re,{tone:"error",detail:y,className:"mx-auto mt-8 max-w-[520px] border border-[var(--separator)] bg-[var(--fill-card)]",children:e("conversation.loadFailed")}):g.length===0&&!b&&!wt(s==null?void 0:s.status)&&!p?l.jsx(Re,{className:"pt-8",children:e("conversation.noMessages")}):l.jsx(dx,{items:g,conversationKey:`${t}:${(s==null?void 0:s.sessionId)??""}`,status:s==null?void 0:s.status,isStreaming:p,onReEdit:I,onBeforeToggle:se})]})}),ee&&l.jsx("div",{style:{bottom:ce.scrollButtonBottom},className:"absolute left-1/2 z-30 -translate-x-1/2",children:l.jsx(Q,{size:"icon",onClick:K,"aria-label":e("eventStream.scrollToBottom"),className:"conversation-scroll-bottom",title:e("eventStream.scrollToBottom"),children:l.jsx(nf,{size:16,"aria-hidden":"true"})})}),l.jsx("div",{ref:Ue,className:"pointer-events-none absolute bottom-0 left-0 right-0 z-20 px-3 pb-0 md:px-4",children:l.jsxs("div",{className:"pointer-events-auto mx-auto w-full max-w-[920px]",children:[l.jsx($y,{ref:R,instance:s,draft:r,onDraftChange:v,onSendMessage:S,onAbort:w,onSetModel:M,onSetThinkingLevel:T,onCompact:N,buttonMode:D,showCompactButton:!V,compactDisabled:z,onImageLightbox:U,startBottomFollow:re},`${t}:${(s==null?void 0:s.sessionId)??""}`),l.jsx("div",{ref:B,className:"h-[var(--bottom-safe-gap)] md:h-0","aria-hidden":"true"})]})})]}),l.jsx($e,{children:_&&l.jsx(bi,{src:_,onClose:()=>U(null)},"image")})]})}function Yx(){const{t:e}=G();return l.jsx("div",{className:"space-y-3 pt-3 select-none","aria-label":e("conversation.loadingConversation"),children:[0,1,2,3].map(t=>l.jsxs("div",{className:"space-y-4 rounded-surface border border-[var(--separator)] bg-[var(--fill-quaternary)] px-4 py-4 animate-pulse",children:[l.jsx("div",{className:"h-4 w-28 rounded-inline bg-[var(--fill-tertiary)]"}),l.jsxs("div",{className:"space-y-2.5",children:[l.jsx("div",{className:"h-3 w-[82%] rounded-inline bg-[var(--fill-secondary)]"}),l.jsx("div",{className:"h-3 w-[64%] rounded-inline bg-[var(--fill-tertiary)]"})]})]},t))})}function Vn({options:e,value:t,onChange:n,label:s}){return l.jsx("div",{className:"ui-segmented select-none",role:"group","aria-label":s,children:e.map(r=>l.jsx(Q,{size:"compact","aria-pressed":t===r.value,className:"ui-segment",onClick:()=>n(r.value),children:r.label},r.value))})}const Jx={common:{cancel:"取消",close:"关闭",confirm:"确认",loading:"加载中…"},modal:{content:"详情内容"},imagePreview:{title:"图片预览",close:"关闭预览",actualSize:"原始尺寸",fitWindow:"适应窗口"},login:{subtitle:"输入 Access Token 以连接",placeholder:"Access Token",invalidToken:"Token 无效,请检查后重试。",connect:"连接",verifying:"验证中…",tokenHint:"Token 可在 <1>~/.paimon/hub.json</1> 中找到"},sidebar:{newInstance:"新建实例",hubConnected:"Hub 已连接",hubConnecting:"Hub 正在连接",hubDisconnected:"Hub 连接中断",toggleMachine:"展开或折叠机器 {{edgeId}}",machineActions:"{{edgeId}} 的机器操作",copyMachineId:"复制名称",noInstances:"暂无 pi 实例连接",settings:"设置",shutdown:"退出实例",shutdownBusy:"实例正在执行中,请等待完成后再退出",statusStreaming:"执行中",statusCompacting:"压缩中",statusIdle:"空闲",statusPending:"状态等待更新"},navigation:{brand:"Paimon",main:"主导航",home:"首页",instances:"实例",backToInstances:"返回实例列表",instanceActions:"{{name}} 的实例操作"},composer:{options:"输入选项",more:"更多输入选项",backToOptions:"返回输入选项",images:"图片",modelWaiting:"模型等待更新",thinkingLabel:"思考",pendingThinking:"等待更新",unsupportedThinking:"不支持",compact:"压缩",compactBusy:"任务运行期间暂不可压缩",compactUnavailable:"上下文用量更新后可压缩",resizeHeight:"调整输入区高度",resizeHeightHelp:"拖动调整高度;双击或 Home 恢复自动高度;上下方向键调整,End 展开到最大高度",heightPixels:"{{height}} 像素",model:"选择模型",thinkingLevel:"思考等级",contextUsage:"上下文用量",usedTokens:"已用 tokens",contextWindow:"上下文窗口",pendingUsage:"等待更新",pendingUsageDescription:"上下文用量将在下一次响应后更新",previewImage:"预览附加图片 {{count}}",removeImage:"移除附加图片 {{count}}"},eventStream:{tagline:"守望 · 交互 · 掌控",sendPlaceholder:"发送消息…",scrollToBottom:"滚到底部",stop:"停止",send:"发送",attachImage:"添加图片",imageProcessFailed:"图片处理失败,请检查图片格式",compactContext:"压缩上下文",instanceNotFound:"实例不存在"},conversation:{agentName:"Pi",you:"你发送的消息",approximateDuration:"约耗时 {{duration}}",durationMilliseconds:"{{value}} 毫秒",durationSeconds:"{{value}} 秒",durationMinutes:"{{value}} 分",durationHours:"{{value}} 小时",durationDays:"{{value}} 天",compactingContext:"正在整理上下文",fetchingCompaction:"正在获取压缩结果",compactionFailed:"上下文压缩失败",compactionAborted:"上下文压缩已终止",compactionUnavailable:"压缩结果不可用",waitingReply:"等待回复",attachedImage:"附加图片 {{count}}",expandExecution:"展开工具与思考过程",collapseExecution:"收起工具与思考过程",toolDetails:"查看 {{name}} 工具详情",moreToolTypes_one:"另外 {{count}} 种工具",moreToolTypes_other:"另外 {{count}} 种工具",thinkingCount_one:"{{count}} 段思考过程",thinkingCount_other:"{{count}} 段思考过程",thinkingStreamingCount_one:"{{count}} 段思考过程,思考中",thinkingStreamingCount_other:"{{count}} 段思考过程,思考中",toolsPending_one:"{{count}} 个工具准备中",toolsPending_other:"{{count}} 个工具准备中",toolsRunning_one:"{{count}} 个工具执行中",toolsRunning_other:"{{count}} 个工具执行中",toolsCompleted_one:"{{count}} 个工具执行完成",toolsCompleted_other:"{{count}} 个工具执行完成",toolsFailed_one:"{{count}} 个工具执行失败",toolsFailed_other:"{{count}} 个工具执行失败",toolsAborted_one:"{{count}} 个工具已终止",toolsAborted_other:"{{count}} 个工具已终止",toolsUnknown_one:"{{count}} 个工具结果不可用",toolsUnknown_other:"{{count}} 个工具结果不可用",toolPending:"准备中",toolCompleted:"执行完成",toolFailed:"执行失败",toolUnknown:"结果不可用",toolUnavailableDescription:"未收到工具结果或执行记录。",replyFailed:"回复失败",replyStart:"开始",replyEnd:"最后更新",loadingEarlier:"正在加载更早的消息…",loadingConversation:"正在加载对话",loadFailed:"对话加载失败",noMessages:"暂无消息",instanceInfo:"实例信息"},compact:{title:"压缩上下文",description:"压缩将总结旧的对话内容以释放上下文空间。可选填自定义提示词来指定压缩时关注的方向。",placeholder:"例如:重点保留关于数据库设计的讨论…",start:"开始压缩"},settings:{title:"设置",appearance:"外观",theme:"主题",themeLight:"浅色",themeDark:"深色",themeSystem:"系统",background:"背景",bgMist:"雾",bgAurora:"极光",bgEmber:"余烬",language:"语言",langZhCN:"简体中文",langEn:"English"},notification:{title:"通知",label:"任务完成通知",on:"开启",off:"关闭",denied:"通知权限已被浏览器拒绝,请在浏览器设置中允许",taskComplete:"✅ {{name}} 任务完成"},newInstance:{title:"新建实例",edgeNode:"Edge 节点",noEdges:"没有可用的 Edge 节点",workingDir:"工作目录",pathPlaceholder:"/path/to/your/project",create:"创建",creating:"创建中…",truncatedHint:"输入更多字符以缩小范围…",fetchEdgeError:"获取 Edge 列表失败",noEdgeSelected:"未选择 Edge 节点",requestTimeout:"请求超时",networkError:"网络错误",requestFailed:"请求失败 (HTTP {{status}})"},session:{title:"Sessions",new:"新建",filter:"筛选…",noMatch:"无匹配的 Session",noPrevious:"暂无历史 Session",empty:"空 Session",messageCount_one:"{{count}} 条消息",messageCount_other:"{{count}} 条消息",timeJustNow:"刚刚"},entries:{code:"代码",contextCompacted:"上下文已压缩",branchSummary:"分支摘要",thinking:"思考",thinkingStreaming:"思考中...",running:"执行中...",aborted:"已终止",copied:"已复制",copy:"复制",mermaidDiagram:"Mermaid 图表",mermaidExpand:"放大查看",mermaidLoading:"图表生成中…",mermaidError:"图表渲染失败,以下为源码",result:"结果",output:"输出",executionDuration:"执行耗时",waitingDuration:"调用等待时间",timeout:"超时时间",params:"参数"},reEdit:{button:"重新编辑",draftNotEmpty:"输入框已有内容,请先清空"},error:{title:"错误详情",message:"错误信息",type:"错误类型",requestId:"请求 ID",action:{compact:"压缩失败:{{message}}"}}},Xx={common:{cancel:"Cancel",close:"Close",confirm:"Confirm",loading:"Loading…"},modal:{content:"Dialog content"},imagePreview:{title:"Image preview",close:"Close preview",actualSize:"Actual size",fitWindow:"Fit to window"},login:{subtitle:"Enter access token to connect",placeholder:"Access Token",invalidToken:"Invalid token. Please check and try again.",connect:"Connect",verifying:"Verifying…",tokenHint:"Find your token in <1>~/.paimon/hub.json</1>"},sidebar:{newInstance:"New instance",hubConnected:"Hub connected",hubConnecting:"Connecting to Hub",hubDisconnected:"Hub disconnected",toggleMachine:"Expand or collapse machine {{edgeId}}",machineActions:"Machine actions for {{edgeId}}",copyMachineId:"Copy Name",noInstances:"No pi instances connected",settings:"Settings",shutdown:"Shutdown instance",shutdownBusy:"Instance is running, please wait before shutting down",statusStreaming:"Running",statusCompacting:"Compacting",statusIdle:"Idle",statusPending:"Waiting for status"},navigation:{brand:"Paimon",main:"Main navigation",home:"Home",instances:"Instances",backToInstances:"Back to instances",instanceActions:"Actions for {{name}}"},composer:{options:"Input options",more:"More input options",backToOptions:"Back to input options",images:"Images",modelWaiting:"Awaiting model",thinkingLabel:"Thinking",pendingThinking:"Awaiting update",unsupportedThinking:"Unsupported",compact:"Compact",compactBusy:"Compaction is unavailable while a task is running",compactUnavailable:"Compaction will be available after context usage updates",resizeHeight:"Resize input area",resizeHeightHelp:"Drag to resize; double-click or press Home for automatic height; use arrow keys to resize and End for maximum height",heightPixels:"{{height}} pixels",model:"Select model",thinkingLevel:"Thinking level",contextUsage:"Context usage",usedTokens:"Used tokens",contextWindow:"Context window",pendingUsage:"Awaiting update",pendingUsageDescription:"Context usage will update after the next response",previewImage:"Preview attached image {{count}}",removeImage:"Remove attached image {{count}}"},eventStream:{tagline:"Watch · Interact · Control",sendPlaceholder:"Send a message...",scrollToBottom:"Scroll to bottom",stop:"Stop",send:"Send",attachImage:"Attach image",imageProcessFailed:"Image processing failed, please check the format",compactContext:"Compact context",instanceNotFound:"Instance not found"},conversation:{agentName:"Pi",you:"Your message",approximateDuration:"Approx. {{duration}}",durationMilliseconds:"{{value}} ms",durationSeconds:"{{value}} s",durationMinutes:"{{value}} min",durationHours:"{{value}} h",durationDays:"{{value}} d",compactingContext:"Compacting context",fetchingCompaction:"Retrieving compaction result",compactionFailed:"Context compaction failed",compactionAborted:"Context compaction aborted",compactionUnavailable:"Compaction result unavailable",waitingReply:"Waiting for reply",attachedImage:"Attached image {{count}}",expandExecution:"Expand tools and thinking",collapseExecution:"Collapse tools and thinking",toolDetails:"View {{name}} tool details",moreToolTypes_one:"{{count}} more tool type",moreToolTypes_other:"{{count}} more tool types",thinkingCount_one:"{{count}} thinking section",thinkingCount_other:"{{count}} thinking sections",thinkingStreamingCount_one:"{{count}} thinking section, thinking in progress",thinkingStreamingCount_other:"{{count}} thinking sections, thinking in progress",toolsPending_one:"{{count}} tool preparing",toolsPending_other:"{{count}} tools preparing",toolsRunning_one:"{{count}} tool running",toolsRunning_other:"{{count}} tools running",toolsCompleted_one:"{{count}} tool completed",toolsCompleted_other:"{{count}} tools completed",toolsFailed_one:"{{count}} tool failed",toolsFailed_other:"{{count}} tools failed",toolsAborted_one:"{{count}} tool aborted",toolsAborted_other:"{{count}} tools aborted",toolsUnknown_one:"{{count}} tool result unavailable",toolsUnknown_other:"{{count}} tool results unavailable",toolPending:"Preparing",toolCompleted:"Completed",toolFailed:"Failed",toolUnknown:"Result unavailable",toolUnavailableDescription:"No tool result or execution record was received.",replyFailed:"Reply failed",replyStart:"Started",replyEnd:"Last updated",loadingEarlier:"Loading earlier messages…",loadingConversation:"Loading conversation",loadFailed:"Failed to load conversation",noMessages:"No messages yet",instanceInfo:"Instance info"},compact:{title:"Compact Context",description:"Compaction summarizes older conversation to free up context space. Optionally provide custom instructions to guide what to focus on.",placeholder:"e.g. Keep the discussion about database design…",start:"Start compaction"},settings:{title:"Settings",appearance:"Appearance",theme:"Theme",themeLight:"Light",themeDark:"Dark",themeSystem:"System",background:"Background",bgMist:"Mist",bgAurora:"Aurora",bgEmber:"Ember",language:"Language",langZhCN:"简体中文",langEn:"English"},notification:{title:"Notification",label:"Task Completion Notification",on:"On",off:"Off",denied:"Notification permission denied. Please allow in browser settings",taskComplete:"✅ {{name}} task completed"},newInstance:{title:"New Instance",edgeNode:"Edge Node",noEdges:"No available Edge nodes",workingDir:"Working Directory",pathPlaceholder:"/path/to/your/project",create:"Create",creating:"Creating…",truncatedHint:"Type more to narrow results…",fetchEdgeError:"Failed to fetch edge list",noEdgeSelected:"No edge selected",requestTimeout:"Request timed out",networkError:"Network error",requestFailed:"Request failed (HTTP {{status}})"},session:{title:"Sessions",new:"New",filter:"Filter…",noMatch:"No matching sessions",noPrevious:"No previous sessions",empty:"Empty session",messageCount_one:"{{count}} message",messageCount_other:"{{count}} messages",timeJustNow:"just now"},entries:{code:"Code",contextCompacted:"Context compacted",branchSummary:"Branch summary",thinking:"Thinking",thinkingStreaming:"Thinking...",running:"Running...",aborted:"Aborted",copied:"Copied",copy:"Copy",mermaidDiagram:"Mermaid diagram",mermaidExpand:"Enlarge",mermaidLoading:"Rendering diagram…",mermaidError:"Unable to render diagram. Source shown below.",result:"Result",output:"Output",executionDuration:"Execution duration",waitingDuration:"Call elapsed time",timeout:"Timeout",params:"Parameters"},reEdit:{button:"Edit",draftNotEmpty:"Input is not empty, please clear first"},error:{title:"Error Details",message:"Error message",type:"Error type",requestId:"Request ID",action:{compact:"Compaction failed: {{message}}"}}},qc="paimon:language";function Zx(){const e=localStorage.getItem(qc);return e==="zh-CN"||e==="en"?e:"zh-CN"}function Qx(e){localStorage.setItem(qc,e),he.changeLanguage(e)}he.use(K0).init({resources:{"zh-CN":{translation:Jx},en:{translation:Xx}},lng:Zx(),fallbackLng:"zh-CN",interpolation:{escapeValue:!1}});function jn({label:e,children:t,showSeparator:n=!0}){return l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"settings-row select-none",children:[l.jsx("span",{className:"text-[14px] leading-[20px] font-semibold text-[var(--label-primary)]",children:e}),t]}),n&&l.jsx("div",{className:"ml-4 border-b border-[var(--separator)]"})]})}function eb({value:e,onChange:t,options:n}){const{t:s}=G();return l.jsx(Vn,{label:s("settings.background"),value:e,onChange:t,options:n.map(r=>({value:r.value,label:l.jsxs(l.Fragment,{children:[l.jsx("span",{"aria-hidden":"true",className:"h-4 w-4 shrink-0 rounded-full",style:{background:`conic-gradient(${r.colors.join(", ")})`}}),l.jsx("span",{children:r.label})]})}))})}function tb(){const{t:e,i18n:t}=G(),[n,s]=i1(),[r,i]=bc(),[o,a]=o1(),c=[{value:"light",label:e("settings.themeLight")},{value:"dark",label:e("settings.themeDark")},{value:"system",label:e("settings.themeSystem")}],u=[{value:"mist",label:e("settings.bgMist"),colors:["#e8f0fe","#f5e6f0","#e6f0f5","#f0f5e6"]},{value:"aurora",label:e("settings.bgAurora"),colors:["#a8d8ea","#aa96da","#8fd3c4","#c4a8d8"]},{value:"ember",label:e("settings.bgEmber"),colors:["#f8d4b0","#f0b0c0","#f8e0a0","#e8c0d0"]}],d=[{value:"zh-CN",label:e("settings.langZhCN")},{value:"en",label:e("settings.langEn")}],h=[{value:"on",label:e("notification.on")},{value:"off",label:e("notification.off")}];return l.jsx("div",{className:"flex-1 flex items-start justify-center p-4 md:p-6 overflow-y-auto scrollbar-auto",children:l.jsxs("div",{className:"settings-content",children:[l.jsx(Oc,{title:e("settings.title")}),l.jsx("h1",{className:"hidden md:block text-[22px] font-semibold text-[var(--label-primary)] mb-6 px-4 select-none",children:e("settings.title")}),l.jsx("div",{className:"text-[14px] leading-[20px] font-semibold text-[var(--label-primary)] mb-2 px-4 select-none",children:e("settings.appearance")}),l.jsxs("section",{className:"glass-panel overflow-hidden",children:[l.jsx(jn,{label:e("settings.theme"),children:l.jsx(Vn,{label:e("settings.theme"),options:c,value:n,onChange:s})}),l.jsx(jn,{label:e("settings.background"),showSeparator:!1,children:l.jsx(eb,{value:r,onChange:i,options:u})})]}),l.jsx("div",{className:"text-[14px] leading-[20px] font-semibold text-[var(--label-primary)] mb-2 mt-6 px-4 select-none",children:e("settings.language")}),l.jsx("section",{className:"glass-panel overflow-hidden",children:l.jsx(jn,{label:e("settings.language"),showSeparator:!1,children:l.jsx(Vn,{label:e("settings.language"),options:d,value:t.language==="en"?"en":"zh-CN",onChange:Qx})})}),Nc&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"text-[14px] leading-[20px] font-semibold text-[var(--label-primary)] mb-2 mt-6 px-4 select-none",children:e("notification.title")}),l.jsx("section",{className:"glass-panel overflow-hidden",children:l.jsx(jn,{label:e("notification.label"),showSeparator:!1,children:l.jsx(Vn,{label:e("notification.label"),options:h,value:o?"on":"off",onChange:async m=>{m==="on"?await Notification.requestPermission()==="granted"?a(!0):Ct(e("notification.denied"),"warning"):a(!1)}})})})]})]})})}async function Mr(e,t){typeof e=="string"&&e.startsWith("/")&&(e=ct(e));const n=jr(),s=new Headers(t==null?void 0:t.headers);n&&s.set("Authorization",`Bearer ${n}`);const r=await fetch(e,{...t,headers:s});return r.status===401&&(kc(),window.location.reload()),r}function nb(e){return de(e)&&typeof e.edgeId=="string"&&typeof e.hostname=="string"&&typeof e.homedir=="string"}function sb(e){return de(e)&&Array.isArray(e.edges)&&e.edges.every(nb)}function rb(e){return de(e)&&typeof e.name=="string"}function ib({id:e,value:t,onChange:n,edgeId:s,disabled:r=!1,autoFocus:i=!1,onSubmit:o}){const{t:a}=G(),[c,u]=f.useState([]),[d,h]=f.useState(!1),[m,g]=f.useState(!1),[p,x]=f.useState(-1),[y,b]=f.useState(!1),k=f.useRef(null),v=f.useRef(null),S=f.useRef(null),w=f.useRef(null);f.useEffect(()=>()=>{var j;(j=S.current)==null||j.abort(),w.current&&clearTimeout(w.current)},[]),f.useEffect(()=>{var j;i&&!window.matchMedia("(pointer: coarse)").matches&&((j=k.current)==null||j.focus())},[i]);const M=f.useCallback(async(j,E)=>{S.current&&S.current.abort();const P=new AbortController;S.current=P,g(!0);try{const N=await(await Mr(`/api/edges/${encodeURIComponent(j)}/browse?path=${encodeURIComponent(E)}`,{signal:P.signal})).json();if(P.signal.aborted)return;if(!de(N))throw new Error("Invalid directory browse response");if(N.error)u([]),h(!1),b(!1);else{const R=N.entries??[];if(!Array.isArray(R)||!R.every(rb))throw new Error("Invalid directory browse entries");const I=typeof N.truncated=="boolean"?N.truncated:!1;u(R),h(I),b(R.length>0||I)}x(-1)}catch{P.signal.aborted||(u([]),b(!1))}finally{P.signal.aborted||g(!1)}},[]);f.useEffect(()=>{if(!s||!t||!t.startsWith("/")){u([]),b(!1);return}return w.current&&clearTimeout(w.current),w.current=setTimeout(()=>{M(s,t)},250),()=>{w.current&&clearTimeout(w.current)}},[t,s,M]);const T=f.useCallback(j=>{var N;const $=(t.endsWith("/")?t:t.substring(0,t.lastIndexOf("/")+1))+j.name+"/";n($),x(-1),(N=k.current)==null||N.focus()},[t,n]),C=f.useCallback(j=>{if(y&&c.length>0){if(j.key==="ArrowDown"){j.preventDefault(),x(E=>E<c.length-1?E+1:0);return}if(j.key==="ArrowUp"){j.preventDefault(),x(E=>E>0?E-1:c.length-1);return}if(j.key==="Tab"){j.preventDefault(),p>=0&&p<c.length?T(c[p]):c.length===1&&T(c[0]);return}if(j.key==="Enter"&&p>=0&&p<c.length){j.preventDefault(),T(c[p]);return}if(j.key==="Escape"){j.preventDefault(),b(!1),x(-1);return}}j.key==="Enter"&&(j.preventDefault(),o==null||o())},[y,c,p,T,o]);return f.useEffect(()=>{if(p<0||!v.current)return;const E=v.current.children[p];E instanceof HTMLElement&&E.scrollIntoView({block:"nearest"})},[p]),f.useEffect(()=>{u([]),b(!1),x(-1)},[s]),l.jsxs("div",{className:"flex flex-col gap-1.5",children:[l.jsxs("div",{className:"relative",children:[l.jsx(pi,{id:e,ref:k,type:"text",value:t,onChange:j=>n(j.target.value),onKeyDown:C,onFocus:()=>{c.length>0&&b(!0)},onBlur:()=>{setTimeout(()=>b(!1),150)},placeholder:a("newInstance.pathPlaceholder"),disabled:r,spellCheck:!1,autoComplete:"off",className:"pr-10"}),m&&l.jsx("div",{className:"absolute right-2.5 top-1/2 -translate-y-1/2",children:l.jsx(Le,{size:14,className:"animate-spin text-[var(--label-tertiary)]"})})]}),y&&l.jsxs("div",{ref:v,className:"max-h-[200px] overflow-y-auto rounded-surface border border-[var(--separator)] bg-[var(--fill-quaternary)] p-1.5 scrollbar-auto",children:[c.map((j,E)=>l.jsxs(Ne,{selected:E===p,type:"button",onMouseDown:P=>P.preventDefault(),onClick:()=>T(j),onMouseEnter:()=>x(E),children:[l.jsx(Va,{size:14,className:"shrink-0 text-[var(--label-tertiary)]"}),l.jsx("span",{className:"text-[var(--label-primary)] truncate",children:j.name})]},j.name)),d&&l.jsx("div",{className:"px-3 py-1.5 text-[12px] text-[var(--label-tertiary)] border-t border-[var(--separator)]",children:a("newInstance.truncatedHint")})]})]})}function ob({onClose:e,onCreated:t}){const{t:n}=G(),s=f.useId(),r=f.useId(),[i,o]=f.useState(""),[a,c]=f.useState([]),[u,d]=f.useState(""),[h,m]=f.useState(!0),[g,p]=f.useState(!1),[x,y]=f.useState(null);f.useEffect(()=>{Mr("/api/edges").then(v=>v.json()).then(v=>{if(!sb(v))throw new Error("Invalid Edge list response");const S=v.edges;if(c(S),S.length>0){d(S[0].edgeId);const w=S[0].homedir;if(w){const M=w.endsWith("/")?w:w+"/";o(M)}}m(!1)}).catch(()=>{m(!1),y(n("newInstance.fetchEdgeError"))})},[]);const b=f.useCallback(v=>{d(v);const S=a.find(w=>w.edgeId===v);if(S!=null&&S.homedir){const w=S.homedir.endsWith("/")?S.homedir:S.homedir+"/";o(w)}},[a]),k=f.useCallback(async()=>{const v=i.trim();if(!(!v||g)){if(!u){y(n("newInstance.noEdgeSelected"));return}p(!0),y(null);try{const S=await Mr("/api/instances",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cwd:v,edgeId:u}),signal:AbortSignal.timeout(2e4)}),w=await S.json(),M=de(w)&&typeof w.instanceId=="string"?w.instanceId:null;if(!S.ok||!M){y((de(w)&&typeof w.error=="string"?w.error:"")||n("newInstance.requestFailed",{status:S.status})),p(!1);return}t(M)}catch(S){const w=S instanceof Error&&S.name==="TimeoutError"?n("newInstance.requestTimeout"):(S instanceof Error?S.message:"")||n("newInstance.networkError");y(w),p(!1)}}},[i,g,u,t]);return l.jsx(He,{mobileSheet:!1,size:"form",footer:l.jsxs(l.Fragment,{children:[l.jsx(Q,{onClick:e,disabled:g,className:"active:bg-[var(--fill-tertiary)]",children:n("common.cancel")}),l.jsx(Q,{variant:"primary",onClick:k,loading:g,disabled:!i.trim()||!u,children:n(g?"newInstance.creating":"newInstance.create")})]}),title:l.jsxs(l.Fragment,{children:[l.jsx(wf,{size:16}),l.jsx("span",{children:n("newInstance.title")})]}),onClose:e,children:l.jsxs("div",{className:"ui-form-content",children:[l.jsx(br,{label:n("newInstance.edgeNode"),htmlFor:s,children:h?l.jsx(Re,{compact:!0,tone:"loading",children:n("common.loading")}):a.length===0?l.jsx(Re,{compact:!0,tone:"error",children:n("newInstance.noEdges")}):a.length===1?l.jsxs("div",{id:s,className:"ui-form-note",children:[a[0].hostname,l.jsxs("span",{className:"text-[var(--label-tertiary)] ml-1.5",children:["(",a[0].edgeId,")"]})]}):l.jsx(t0,{id:s,value:u,onChange:v=>b(v.target.value),disabled:g,children:a.map(v=>l.jsxs("option",{value:v.edgeId,children:[v.hostname," (",v.edgeId,")"]},v.edgeId))})}),l.jsx(br,{label:n("newInstance.workingDir"),htmlFor:r,children:l.jsx(ib,{id:r,value:i,onChange:o,edgeId:u,disabled:g||h,autoFocus:!h,onSubmit:k})}),x&&l.jsx(Re,{compact:!0,tone:"error",children:x})]})})}function ab(){const{pathname:e}=Ee(),t=e.match(/^\/instance\/(.+)$/);return(t==null?void 0:t[1])??null}function lb(){const{t:e}=G(),{authToken:t,authError:n,probing:s,handleLogin:r,handleAuthError:i}=u1(),o=me(w=>w.connect),a=me(w=>w.disconnect),c=me(w=>w.subscribe),u=me(w=>w.send),d=Ft(w=>w.instances),h=Ft(w=>w.instanceListReady),m=Ft(w=>w.handleMessage),g=an();Qg();const p=ab();f.useEffect(()=>(t?o(t,i):a(),()=>a()),[t,o,a,i]),b1(),f.useEffect(()=>c(w=>{(w.type==="instance_list"||w.type==="instance_update")&&m(w)}),[c,m]);const x=f.useCallback(w=>{g(`/instance/${w}`)},[g]),y=f.useRef(new Set),b=f.useCallback(w=>{const M=Ft.getState().instances.find(T=>T.id===w);if(M&&wt(M.status)){Ct(e("sidebar.shutdownBusy"),"warning");return}y.current.add(w),u({type:"shutdown",payload:{instanceId:w}})},[u,e]),[k,v]=f.useState(!1),S=f.useCallback(w=>{v(!1),g(`/instance/${w}`)},[g]);return f.useEffect(()=>{if(!h||!p)return;d.some(M=>M.id===p)||(y.current.has(p)?y.current.delete(p):Ct(e("eventStream.instanceNotFound"),"error"),g("/"))},[h,p,d,g,e]),s?l.jsx("div",{className:"h-[var(--app-viewport-height,100dvh)] w-screen animated-bg flex items-center justify-center",children:l.jsx("div",{className:"glass-panel p-8 flex flex-col items-center gap-4",children:l.jsx(Re,{tone:"loading",children:e("common.loading")})})}):t?l.jsxs("div",{className:"h-[var(--app-viewport-height,100dvh)] w-screen animated-bg flex items-stretch p-2 gap-2 md:p-3 md:gap-3 overflow-hidden pb-[max(0.5rem,env(safe-area-inset-bottom))]",children:[l.jsx("div",{className:"hidden md:flex self-stretch",children:l.jsx(Go,{instances:d,selectedId:p,onSelect:x,onShutdown:b,onNewInstance:()=>v(!0)})}),l.jsx(id,{children:l.jsxs(Ot,{element:l.jsx(S1,{}),children:[l.jsx(Ot,{path:"/settings",element:l.jsx(tb,{})}),l.jsx(Ot,{path:"/instance/:id",element:l.jsx(Gx,{})}),l.jsx(Ot,{path:"*",element:l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"flex-1 md:hidden min-w-0 flex flex-col",children:l.jsx(Go,{instances:d,selectedId:p,onSelect:x,onShutdown:b,onNewInstance:()=>v(!0)})}),l.jsx("div",{className:"hidden md:flex flex-1 min-w-0",children:l.jsx(w1,{})})]})})]})}),l.jsx($e,{children:k&&l.jsx(ob,{onClose:()=>v(!1),onCreated:S},"new-instance")}),l.jsx(Ty,{})]}):l.jsx("div",{className:"h-[var(--app-viewport-height,100dvh)] w-screen animated-bg flex items-stretch overflow-hidden",children:l.jsx(c1,{onLogin:r,error:n})})}Jc.createRoot(document.getElementById("root")).render(l.jsx(Rd,{basename:wc||"/",children:l.jsx(lb,{})}));export{Xb as $,wb as A,dv as B,gv as C,wv as D,sv as E,rv as F,iv as G,Z1 as H,av as I,ov as J,lv as K,$1 as L,F1 as M,U1 as N,q1 as O,J1 as P,Wb as Q,ty as R,ry as S,oy as T,cy as U,vb as V,jb as W,Mb as X,$b as Y,Vb as Z,Kb as _,Eb as a,qr as a$,nv as a0,hv as a1,xv as a2,bb as a3,kb as a4,Rb as a5,Pb as a6,Db as a7,Ub as a8,Jb as a9,ly as aA,lo as aB,yb as aC,Qf as aD,om as aE,Xp as aF,Nm as aG,pb as aH,tr as aI,nh as aJ,Qe as aK,ke as aL,Cm as aM,hb as aN,zl as aO,gb as aP,ms as aQ,ui as aR,xe as aS,Xe as aT,db as aU,lm as aV,Ll as aW,Il as aX,Tm as aY,jm as aZ,Em as a_,tv as aa,fv as ab,yv as ac,Mt as ad,O1 as ae,et as af,D1 as ag,K1 as ah,G1 as ai,X1 as aj,Q1 as ak,ny as al,ay as am,uy as an,Ua as ao,Zs as ap,jg as aq,P1 as ar,_1 as as,Zo as at,W1 as au,Y1 as av,Qo as aw,ey as ax,sy as ay,iy as az,Ab as b,fo as b0,xb as b1,pe as b2,th as b3,Yl as b4,mb as b5,Mm as b6,be as b7,dt as b8,Qt as b9,un as ba,fb as bb,xt as bc,us as bd,Un as be,H as bf,eh as bg,bm as bh,Lm as bi,Am as bj,eo as bk,Me as bl,le as bm,Rm as bn,Zt as bo,Jn as bp,z1 as bq,H1 as br,rg as bs,Ob as c,Bb as d,qb as e,Zb as f,cv as g,pv as h,bv as i,Sb as j,Tb as k,Lb as l,_b as m,zb as n,Gb as o,Qb as p,uv as q,mv as r,vv as s,Cb as t,Nb as u,Ib as v,Fb as w,Hb as x,Yb as y,ev as z};
|