@kafca/agentdock 0.1.62 → 0.1.63
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/renderer/assets/{AutomationList-BgJgAdVO.js → AutomationList-DR-micIT.js} +1 -1
- package/dist/renderer/assets/{Badge-Bq2hPVcR.js → Badge-COE1Zm2i.js} +1 -1
- package/dist/renderer/assets/{Card-BPJNSZce.js → Card-F6UNFxnQ.js} +1 -1
- package/dist/renderer/assets/{Config-aSFqlI88.js → Config-BKqxfhZi.js} +1 -1
- package/dist/renderer/assets/{Dashboard-D3ezFmb7.js → Dashboard-Bvp7-_2z.js} +2 -2
- package/dist/renderer/assets/{EmptyState-DK496gBq.js → EmptyState-BwV_J0Og.js} +1 -1
- package/dist/renderer/assets/{HighlightedMarkdown-Ckre5jNv.js → HighlightedMarkdown-CBIBaWyM.js} +1 -1
- package/dist/renderer/assets/{Input-C5C1d0ba.js → Input-C8LZd4Bi.js} +1 -1
- package/dist/renderer/assets/{KnowledgeDetail-N8Ey1ikc.js → KnowledgeDetail-DjXYNMIs.js} +1 -1
- package/dist/renderer/assets/{KnowledgeHome-9aF8nJEf.js → KnowledgeHome-Cqk5_nJh.js} +1 -1
- package/dist/renderer/assets/{Logs-sgAdwEeS.js → Logs-B6cXFvW4.js} +1 -1
- package/dist/renderer/assets/{Modal-BB10hTRc.js → Modal-CAj7soll.js} +1 -1
- package/dist/renderer/assets/{Page-DfC319Ck.js → Page-DlnMnu4F.js} +1 -1
- package/dist/renderer/assets/{Select-RHJBmNER.js → Select-CVay_LUX.js} +1 -1
- package/dist/renderer/assets/{ThreadChat-BU1zCdr4.js → ThreadChat-BxXRpYa1.js} +3 -3
- package/dist/renderer/assets/{Workspace-BoZCz7S8.js → Workspace-YC0pC7cM.js} +1 -1
- package/dist/renderer/assets/{arrow-left-D2V1eZSD.js → arrow-left-Cwm09dxx.js} +1 -1
- package/dist/renderer/assets/{book-open-DUcBn7Bb.js → book-open-BwcGC_im.js} +1 -1
- package/dist/renderer/assets/{channels-DMhDSlf2.js → channels-BPytmVCd.js} +1 -1
- package/dist/renderer/assets/{chevron-down-Ca2FQDB7.js → chevron-down-2LP9oGHG.js} +1 -1
- package/dist/renderer/assets/{index-DRJ5wgw_.js → index-eoVERL5K.js} +2 -2
- package/dist/renderer/assets/{index-BlnvlekJ.js → index-llCPCiYk.js} +1 -1
- package/dist/renderer/assets/{knowledge-D1-k56eY.js → knowledge-QujAv-Zh.js} +1 -1
- package/dist/renderer/assets/{pencil-BhWdv_86.js → pencil-0P2INETc.js} +1 -1
- package/dist/renderer/assets/{plus-BacLMlK3.js → plus-tiGRgE2v.js} +1 -1
- package/dist/renderer/assets/{save-Bpoxbzau.js → save-D8U93DNa.js} +1 -1
- package/dist/renderer/assets/{search-BVJcpdFX.js → search-C-9J9J3f.js} +1 -1
- package/dist/renderer/assets/{shield-check-C2cw_Ip6.js → shield-check-BCKkPPTJ.js} +1 -1
- package/dist/renderer/assets/{threads-DOsBQBg_.js → threads-Bsrwwnpm.js} +1 -1
- package/dist/renderer/assets/{trash-2-Bs3rEm3g.js → trash-2-CP4sn15n.js} +1 -1
- package/dist/renderer/index.html +1 -1
- package/dist-electron/tests/electron/automation-sandbox-runner.test.js +20 -9
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./Dashboard-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./Dashboard-Bvp7-_2z.js","./Card-F6UNFxnQ.js","./Badge-COE1Zm2i.js","./EmptyState-BwV_J0Og.js","./Page-DlnMnu4F.js","./threads-Bsrwwnpm.js","./book-open-BwcGC_im.js","./shield-check-BCKkPPTJ.js","./ThreadChat-BxXRpYa1.js","./channels-BPytmVCd.js","./chevron-down-2LP9oGHG.js","./Input-C8LZd4Bi.js","./Modal-CAj7soll.js","./index-llCPCiYk.js","./search-C-9J9J3f.js","./pencil-0P2INETc.js","./trash-2-CP4sn15n.js","./knowledge-QujAv-Zh.js","./Workspace-YC0pC7cM.js","./Select-CVay_LUX.js","./plus-tiGRgE2v.js","./save-D8U93DNa.js","./AutomationList-DR-micIT.js","./Config-BKqxfhZi.js","./Logs-B6cXFvW4.js","./arrow-left-Cwm09dxx.js","./KnowledgeHome-Cqk5_nJh.js","./KnowledgeDetail-DjXYNMIs.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
var I0=Object.defineProperty;var P0=(l,i,s)=>i in l?I0(l,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):l[i]=s;var Au=(l,i,s)=>P0(l,typeof i!="symbol"?i+"":i,s);function ty(l,i){for(var s=0;s<i.length;s++){const o=i[s];if(typeof o!="string"&&!Array.isArray(o)){for(const c in o)if(c!=="default"&&!(c in l)){const f=Object.getOwnPropertyDescriptor(o,c);f&&Object.defineProperty(l,c,f.get?f:{enumerable:!0,get:()=>o[c]})}}}return Object.freeze(Object.defineProperty(l,Symbol.toStringTag,{value:"Module"}))}(function(){const i=document.createElement("link").relList;if(i&&i.supports&&i.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))o(c);new MutationObserver(c=>{for(const f of c)if(f.type==="childList")for(const h of f.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&o(h)}).observe(document,{childList:!0,subtree:!0});function s(c){const f={};return c.integrity&&(f.integrity=c.integrity),c.referrerPolicy&&(f.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?f.credentials="include":c.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function o(c){if(c.ep)return;c.ep=!0;const f=s(c);fetch(c.href,f)}})();function Gm(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}var ro={exports:{}},$l={};/**
|
|
3
3
|
* @license React
|
|
4
4
|
* react-jsx-runtime.production.js
|
|
@@ -158,5 +158,5 @@ Error generating stack: `+n.message+`
|
|
|
158
158
|
* @license MIT
|
|
159
159
|
*/var im="popstate";function um(l){return typeof l=="object"&&l!=null&&"pathname"in l&&"search"in l&&"hash"in l&&"state"in l&&"key"in l}function Jy(l={}){function i(c,f){let{pathname:h="/",search:g="",hash:y=""}=fn(c.location.hash.substring(1));return!h.startsWith("/")&&!h.startsWith(".")&&(h="/"+h),Eo("",{pathname:h,search:g,hash:y},f.state&&f.state.usr||null,f.state&&f.state.key||"default")}function s(c,f){let h=c.document.querySelector("base"),g="";if(h&&h.getAttribute("href")){let y=c.location.href,m=y.indexOf("#");g=m===-1?y:y.slice(0,m)}return g+"#"+(typeof f=="string"?f:ni(f))}function o(c,f){Oe(c.pathname.charAt(0)==="/",`relative pathnames are not supported in hash history.push(${JSON.stringify(f)})`)}return Fy(i,s,o,l)}function wt(l,i){if(l===!1||l===null||typeof l>"u")throw new Error(i)}function Oe(l,i){if(!l){typeof console<"u"&&console.warn(i);try{throw new Error(i)}catch{}}}function $y(){return Math.random().toString(36).substring(2,10)}function rm(l,i){return{usr:l.state,key:l.key,idx:i,masked:l.unstable_mask?{pathname:l.pathname,search:l.search,hash:l.hash}:void 0}}function Eo(l,i,s=null,o,c){return{pathname:typeof l=="string"?l:l.pathname,search:"",hash:"",...typeof i=="string"?fn(i):i,state:s,key:i&&i.key||o||$y(),unstable_mask:c}}function ni({pathname:l="/",search:i="",hash:s=""}){return i&&i!=="?"&&(l+=i.charAt(0)==="?"?i:"?"+i),s&&s!=="#"&&(l+=s.charAt(0)==="#"?s:"#"+s),l}function fn(l){let i={};if(l){let s=l.indexOf("#");s>=0&&(i.hash=l.substring(s),l=l.substring(0,s));let o=l.indexOf("?");o>=0&&(i.search=l.substring(o),l=l.substring(0,o)),l&&(i.pathname=l)}return i}function Fy(l,i,s,o={}){let{window:c=document.defaultView,v5Compat:f=!1}=o,h=c.history,g="POP",y=null,m=b();m==null&&(m=0,h.replaceState({...h.state,idx:m},""));function b(){return(h.state||{idx:null}).idx}function v(){g="POP";let Y=b(),q=Y==null?null:Y-m;m=Y,y&&y({action:g,location:H.location,delta:q})}function A(Y,q){g="PUSH";let V=um(Y)?Y:Eo(H.location,Y,q);s&&s(V,Y),m=b()+1;let X=rm(V,m),$=H.createHref(V.unstable_mask||V);try{h.pushState(X,"",$)}catch(tt){if(tt instanceof DOMException&&tt.name==="DataCloneError")throw tt;c.location.assign($)}f&&y&&y({action:g,location:H.location,delta:1})}function N(Y,q){g="REPLACE";let V=um(Y)?Y:Eo(H.location,Y,q);s&&s(V,Y),m=b();let X=rm(V,m),$=H.createHref(V.unstable_mask||V);h.replaceState(X,"",$),f&&y&&y({action:g,location:H.location,delta:0})}function O(Y){return Wy(Y)}let H={get action(){return g},get location(){return l(c,h)},listen(Y){if(y)throw new Error("A history only accepts one active listener");return c.addEventListener(im,v),y=Y,()=>{c.removeEventListener(im,v),y=null}},createHref(Y){return i(c,Y)},createURL:O,encodeLocation(Y){let q=O(Y);return{pathname:q.pathname,search:q.search,hash:q.hash}},push:A,replace:N,go(Y){return h.go(Y)}};return H}function Wy(l,i=!1){let s="http://localhost";typeof window<"u"&&(s=window.location.origin!=="null"?window.location.origin:window.location.href),wt(s,"No window.location.(origin|href) available to create URL");let o=typeof l=="string"?l:ni(l);return o=o.replace(/ $/,"%20"),!i&&o.startsWith("//")&&(o=s+o),new URL(o,s)}function Qm(l,i,s="/"){return Iy(l,i,s,!1)}function Iy(l,i,s,o){let c=typeof i=="string"?fn(i):i,f=ha(c.pathname||"/",s);if(f==null)return null;let h=Zm(l);Py(h);let g=null;for(let y=0;g==null&&y<h.length;++y){let m=cv(f);g=sv(h[y],m,o)}return g}function Zm(l,i=[],s=[],o="",c=!1){let f=(h,g,y=c,m)=>{let b={relativePath:m===void 0?h.path||"":m,caseSensitive:h.caseSensitive===!0,childrenIndex:g,route:h};if(b.relativePath.startsWith("/")){if(!b.relativePath.startsWith(o)&&y)return;wt(b.relativePath.startsWith(o),`Absolute route path "${b.relativePath}" nested under path "${o}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),b.relativePath=b.relativePath.slice(o.length)}let v=Ge([o,b.relativePath]),A=s.concat(b);h.children&&h.children.length>0&&(wt(h.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${v}".`),Zm(h.children,i,A,v,y)),!(h.path==null&&!h.index)&&i.push({path:v,score:uv(v,h.index),routesMeta:A})};return l.forEach((h,g)=>{var y;if(h.path===""||!((y=h.path)!=null&&y.includes("?")))f(h,g);else for(let m of Jm(h.path))f(h,g,!0,m)}),i}function Jm(l){let i=l.split("/");if(i.length===0)return[];let[s,...o]=i,c=s.endsWith("?"),f=s.replace(/\?$/,"");if(o.length===0)return c?[f,""]:[f];let h=Jm(o.join("/")),g=[];return g.push(...h.map(y=>y===""?f:[f,y].join("/"))),c&&g.push(...h),g.map(y=>l.startsWith("/")&&y===""?"/":y)}function Py(l){l.sort((i,s)=>i.score!==s.score?s.score-i.score:rv(i.routesMeta.map(o=>o.childrenIndex),s.routesMeta.map(o=>o.childrenIndex)))}var tv=/^:[\w-]+$/,ev=3,av=2,nv=1,lv=10,iv=-2,sm=l=>l==="*";function uv(l,i){let s=l.split("/"),o=s.length;return s.some(sm)&&(o+=iv),i&&(o+=av),s.filter(c=>!sm(c)).reduce((c,f)=>c+(tv.test(f)?ev:f===""?nv:lv),o)}function rv(l,i){return l.length===i.length&&l.slice(0,-1).every((o,c)=>o===i[c])?l[l.length-1]-i[i.length-1]:0}function sv(l,i,s=!1){let{routesMeta:o}=l,c={},f="/",h=[];for(let g=0;g<o.length;++g){let y=o[g],m=g===o.length-1,b=f==="/"?i:i.slice(f.length)||"/",v=Du({path:y.relativePath,caseSensitive:y.caseSensitive,end:m},b),A=y.route;if(!v&&m&&s&&!o[o.length-1].route.index&&(v=Du({path:y.relativePath,caseSensitive:y.caseSensitive,end:!1},b)),!v)return null;Object.assign(c,v.params),h.push({params:c,pathname:Ge([f,v.pathname]),pathnameBase:mv(Ge([f,v.pathnameBase])),route:A}),v.pathnameBase!=="/"&&(f=Ge([f,v.pathnameBase]))}return h}function Du(l,i){typeof l=="string"&&(l={path:l,caseSensitive:!1,end:!0});let[s,o]=ov(l.path,l.caseSensitive,l.end),c=i.match(s);if(!c)return null;let f=c[0],h=f.replace(/(.)\/+$/,"$1"),g=c.slice(1);return{params:o.reduce((m,{paramName:b,isOptional:v},A)=>{if(b==="*"){let O=g[A]||"";h=f.slice(0,f.length-O.length).replace(/(.)\/+$/,"$1")}const N=g[A];return v&&!N?m[b]=void 0:m[b]=(N||"").replace(/%2F/g,"/"),m},{}),pathname:f,pathnameBase:h,pattern:l}}function ov(l,i=!1,s=!0){Oe(l==="*"||!l.endsWith("*")||l.endsWith("/*"),`Route path "${l}" will be treated as if it were "${l.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${l.replace(/\*$/,"/*")}".`);let o=[],c="^"+l.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(h,g,y,m,b)=>{if(o.push({paramName:g,isOptional:y!=null}),y){let v=b.charAt(m+h.length);return v&&v!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return l.endsWith("*")?(o.push({paramName:"*"}),c+=l==="*"||l==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):s?c+="\\/*$":l!==""&&l!=="/"&&(c+="(?:(?=\\/|$))"),[new RegExp(c,i?void 0:"i"),o]}function cv(l){try{return l.split("/").map(i=>decodeURIComponent(i).replace(/\//g,"%2F")).join("/")}catch(i){return Oe(!1,`The URL path "${l}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${i}).`),l}}function ha(l,i){if(i==="/")return l;if(!l.toLowerCase().startsWith(i.toLowerCase()))return null;let s=i.endsWith("/")?i.length-1:i.length,o=l.charAt(s);return o&&o!=="/"?null:l.slice(s)||"/"}var fv=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function dv(l,i="/"){let{pathname:s,search:o="",hash:c=""}=typeof l=="string"?fn(l):l,f;return s?(s=$m(s),s.startsWith("/")?f=om(s.substring(1),"/"):f=om(s,i)):f=i,{pathname:f,search:gv(o),hash:pv(c)}}function om(l,i){let s=Lu(i).split("/");return l.split("/").forEach(c=>{c===".."?s.length>1&&s.pop():c!=="."&&s.push(c)}),s.length>1?s.join("/"):"/"}function mo(l,i,s,o){return`Cannot include a '${l}' character in a manually specified \`to.${i}\` field [${JSON.stringify(o)}]. Please separate it out to the \`to.${s}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function hv(l){return l.filter((i,s)=>s===0||i.route.path&&i.route.path.length>0)}function jo(l){let i=hv(l);return i.map((s,o)=>o===i.length-1?s.pathname:s.pathnameBase)}function Bu(l,i,s,o=!1){let c;typeof l=="string"?c=fn(l):(c={...l},wt(!c.pathname||!c.pathname.includes("?"),mo("?","pathname","search",c)),wt(!c.pathname||!c.pathname.includes("#"),mo("#","pathname","hash",c)),wt(!c.search||!c.search.includes("#"),mo("#","search","hash",c)));let f=l===""||c.pathname==="",h=f?"/":c.pathname,g;if(h==null)g=s;else{let v=i.length-1;if(!o&&h.startsWith("..")){let A=h.split("/");for(;A[0]==="..";)A.shift(),v-=1;c.pathname=A.join("/")}g=v>=0?i[v]:"/"}let y=dv(c,g),m=h&&h!=="/"&&h.endsWith("/"),b=(f||h===".")&&s.endsWith("/");return!y.pathname.endsWith("/")&&(m||b)&&(y.pathname+="/"),y}var $m=l=>l.replace(/\/\/+/g,"/"),Ge=l=>$m(l.join("/")),Lu=l=>l.replace(/\/+$/,""),mv=l=>Lu(l).replace(/^\/*/,"/"),gv=l=>!l||l==="?"?"":l.startsWith("?")?l:"?"+l,pv=l=>!l||l==="#"?"":l.startsWith("#")?l:"#"+l,yv=class{constructor(l,i,s,o=!1){this.status=l,this.statusText=i||"",this.internal=o,s instanceof Error?(this.data=s.toString(),this.error=s):this.data=s}};function vv(l){return l!=null&&typeof l.status=="number"&&typeof l.statusText=="string"&&typeof l.internal=="boolean"&&"data"in l}function bv(l){let i=l.map(s=>s.route.path).filter(Boolean);return Ge(i)||"/"}var Fm=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Wm(l,i){let s=l;if(typeof s!="string"||!fv.test(s))return{absoluteURL:void 0,isExternal:!1,to:s};let o=s,c=!1;if(Fm)try{let f=new URL(window.location.href),h=s.startsWith("//")?new URL(f.protocol+s):new URL(s),g=ha(h.pathname,i);h.origin===f.origin&&g!=null?s=g+h.search+h.hash:c=!0}catch{Oe(!1,`<Link to="${s}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:o,isExternal:c,to:s}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Im=["POST","PUT","PATCH","DELETE"];new Set(Im);var Sv=["GET",...Im];new Set(Sv);var tl=T.createContext(null);tl.displayName="DataRouter";var ku=T.createContext(null);ku.displayName="DataRouterState";var Pm=T.createContext(!1);function xv(){return T.useContext(Pm)}var tg=T.createContext({isTransitioning:!1});tg.displayName="ViewTransition";var Ev=T.createContext(new Map);Ev.displayName="Fetchers";var Tv=T.createContext(null);Tv.displayName="Await";var _e=T.createContext(null);_e.displayName="Navigation";var ii=T.createContext(null);ii.displayName="Location";var ke=T.createContext({outlet:null,matches:[],isDataRoute:!1});ke.displayName="Route";var wo=T.createContext(null);wo.displayName="RouteError";var eg="REACT_ROUTER_ERROR",Rv="REDIRECT",Av="ROUTE_ERROR_RESPONSE";function Ov(l){if(l.startsWith(`${eg}:${Rv}:{`))try{let i=JSON.parse(l.slice(28));if(typeof i=="object"&&i&&typeof i.status=="number"&&typeof i.statusText=="string"&&typeof i.location=="string"&&typeof i.reloadDocument=="boolean"&&typeof i.replace=="boolean")return i}catch{}}function _v(l){if(l.startsWith(`${eg}:${Av}:{`))try{let i=JSON.parse(l.slice(40));if(typeof i=="object"&&i&&typeof i.status=="number"&&typeof i.statusText=="string")return new yv(i.status,i.statusText,i.data)}catch{}}function Cv(l,{relative:i}={}){wt(el(),"useHref() may be used only in the context of a <Router> component.");let{basename:s,navigator:o}=T.useContext(_e),{hash:c,pathname:f,search:h}=ui(l,{relative:i}),g=f;return s!=="/"&&(g=f==="/"?s:Ge([s,f])),o.createHref({pathname:g,search:h,hash:c})}function el(){return T.useContext(ii)!=null}function Ce(){return wt(el(),"useLocation() may be used only in the context of a <Router> component."),T.useContext(ii).location}var ag="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function ng(l){T.useContext(_e).static||T.useLayoutEffect(l)}function Uo(){let{isDataRoute:l}=T.useContext(ke);return l?Gv():zv()}function zv(){wt(el(),"useNavigate() may be used only in the context of a <Router> component.");let l=T.useContext(tl),{basename:i,navigator:s}=T.useContext(_e),{matches:o}=T.useContext(ke),{pathname:c}=Ce(),f=JSON.stringify(jo(o)),h=T.useRef(!1);return ng(()=>{h.current=!0}),T.useCallback((y,m={})=>{if(Oe(h.current,ag),!h.current)return;if(typeof y=="number"){s.go(y);return}let b=Bu(y,JSON.parse(f),c,m.relative==="path");l==null&&i!=="/"&&(b.pathname=b.pathname==="/"?i:Ge([i,b.pathname])),(m.replace?s.replace:s.push)(b,m.state,m)},[i,s,f,c,l])}var Nv=T.createContext(null);function Mv(l){let i=T.useContext(ke).outlet;return T.useMemo(()=>i&&T.createElement(Nv.Provider,{value:l},i),[i,l])}function lg(){let{matches:l}=T.useContext(ke),i=l[l.length-1];return(i==null?void 0:i.params)??{}}function ui(l,{relative:i}={}){let{matches:s}=T.useContext(ke),{pathname:o}=Ce(),c=JSON.stringify(jo(s));return T.useMemo(()=>Bu(l,JSON.parse(c),o,i==="path"),[l,c,o,i])}function Dv(l,i){return ig(l,i)}function ig(l,i,s){var Y;wt(el(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:o}=T.useContext(_e),{matches:c}=T.useContext(ke),f=c[c.length-1],h=f?f.params:{},g=f?f.pathname:"/",y=f?f.pathnameBase:"/",m=f&&f.route;{let q=m&&m.path||"";rg(g,!m||q.endsWith("*")||q.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${g}" (under <Route path="${q}">) 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.
|
|
160
160
|
|
|
161
|
-
Please change the parent <Route path="${q}"> to <Route path="${q==="/"?"*":`${q}/*`}">.`)}let b=Ce(),v;if(i){let q=typeof i=="string"?fn(i):i;wt(y==="/"||((Y=q.pathname)==null?void 0:Y.startsWith(y)),`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 "${y}" but pathname "${q.pathname}" was given in the \`location\` prop.`),v=q}else v=b;let A=v.pathname||"/",N=A;if(y!=="/"){let q=y.replace(/^\//,"").split("/");N="/"+A.replace(/^\//,"").split("/").slice(q.length).join("/")}let O=Qm(l,{pathname:N});Oe(m||O!=null,`No routes matched location "${v.pathname}${v.search}${v.hash}" `),Oe(O==null||O[O.length-1].route.element!==void 0||O[O.length-1].route.Component!==void 0||O[O.length-1].route.lazy!==void 0,`Matched leaf route at location "${v.pathname}${v.search}${v.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let H=Hv(O&&O.map(q=>Object.assign({},q,{params:Object.assign({},h,q.params),pathname:Ge([y,o.encodeLocation?o.encodeLocation(q.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:q.pathname]),pathnameBase:q.pathnameBase==="/"?y:Ge([y,o.encodeLocation?o.encodeLocation(q.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:q.pathnameBase])})),c,s);return i&&H?T.createElement(ii.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...v},navigationType:"POP"}},H):H}function Lv(){let l=Vv(),i=vv(l)?`${l.status} ${l.statusText}`:l instanceof Error?l.message:JSON.stringify(l),s=l instanceof Error?l.stack:null,o="rgba(200,200,200, 0.5)",c={padding:"0.5rem",backgroundColor:o},f={padding:"2px 4px",backgroundColor:o},h=null;return console.error("Error handled by React Router default ErrorBoundary:",l),h=T.createElement(T.Fragment,null,T.createElement("p",null,"💿 Hey developer 👋"),T.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",T.createElement("code",{style:f},"ErrorBoundary")," or"," ",T.createElement("code",{style:f},"errorElement")," prop on your route.")),T.createElement(T.Fragment,null,T.createElement("h2",null,"Unexpected Application Error!"),T.createElement("h3",{style:{fontStyle:"italic"}},i),s?T.createElement("pre",{style:c},s):null,h)}var jv=T.createElement(Lv,null),ug=class extends T.Component{constructor(l){super(l),this.state={location:l.location,revalidation:l.revalidation,error:l.error}}static getDerivedStateFromError(l){return{error:l}}static getDerivedStateFromProps(l,i){return i.location!==l.location||i.revalidation!=="idle"&&l.revalidation==="idle"?{error:l.error,location:l.location,revalidation:l.revalidation}:{error:l.error!==void 0?l.error:i.error,location:i.location,revalidation:l.revalidation||i.revalidation}}componentDidCatch(l,i){this.props.onError?this.props.onError(l,i):console.error("React Router caught the following error during render",l)}render(){let l=this.state.error;if(this.context&&typeof l=="object"&&l&&"digest"in l&&typeof l.digest=="string"){const s=_v(l.digest);s&&(l=s)}let i=l!==void 0?T.createElement(ke.Provider,{value:this.props.routeContext},T.createElement(wo.Provider,{value:l,children:this.props.component})):this.props.children;return this.context?T.createElement(wv,{error:l},i):i}};ug.contextType=Pm;var go=new WeakMap;function wv({children:l,error:i}){let{basename:s}=T.useContext(_e);if(typeof i=="object"&&i&&"digest"in i&&typeof i.digest=="string"){let o=Ov(i.digest);if(o){let c=go.get(i);if(c)throw c;let f=Wm(o.location,s);if(Fm&&!go.get(i))if(f.isExternal||o.reloadDocument)window.location.href=f.absoluteURL||f.to;else{const h=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(f.to,{replace:o.replace}));throw go.set(i,h),h}return T.createElement("meta",{httpEquiv:"refresh",content:`0;url=${f.absoluteURL||f.to}`})}}return l}function Uv({routeContext:l,match:i,children:s}){let o=T.useContext(tl);return o&&o.static&&o.staticContext&&(i.route.errorElement||i.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=i.route.id),T.createElement(ke.Provider,{value:l},s)}function Hv(l,i=[],s){let o=s==null?void 0:s.state;if(l==null){if(!o)return null;if(o.errors)l=o.matches;else if(i.length===0&&!o.initialized&&o.matches.length>0)l=o.matches;else return null}let c=l,f=o==null?void 0:o.errors;if(f!=null){let b=c.findIndex(v=>v.route.id&&(f==null?void 0:f[v.route.id])!==void 0);wt(b>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(f).join(",")}`),c=c.slice(0,Math.min(c.length,b+1))}let h=!1,g=-1;if(s&&o){h=o.renderFallback;for(let b=0;b<c.length;b++){let v=c[b];if((v.route.HydrateFallback||v.route.hydrateFallbackElement)&&(g=b),v.route.id){let{loaderData:A,errors:N}=o,O=v.route.loader&&!A.hasOwnProperty(v.route.id)&&(!N||N[v.route.id]===void 0);if(v.route.lazy||O){s.isStatic&&(h=!0),g>=0?c=c.slice(0,g+1):c=[c[0]];break}}}}let y=s==null?void 0:s.onError,m=o&&y?(b,v)=>{var A,N;y(b,{location:o.location,params:((N=(A=o.matches)==null?void 0:A[0])==null?void 0:N.params)??{},unstable_pattern:bv(o.matches),errorInfo:v})}:void 0;return c.reduceRight((b,v,A)=>{let N,O=!1,H=null,Y=null;o&&(N=f&&v.route.id?f[v.route.id]:void 0,H=v.route.errorElement||jv,h&&(g<0&&A===0?(rg("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),O=!0,Y=null):g===A&&(O=!0,Y=v.route.hydrateFallbackElement||null)));let q=i.concat(c.slice(0,A+1)),V=()=>{let X;return N?X=H:O?X=Y:v.route.Component?X=T.createElement(v.route.Component,null):v.route.element?X=v.route.element:X=b,T.createElement(Uv,{match:v,routeContext:{outlet:b,matches:q,isDataRoute:o!=null},children:X})};return o&&(v.route.ErrorBoundary||v.route.errorElement||A===0)?T.createElement(ug,{location:o.location,revalidation:o.revalidation,component:H,error:N,children:V(),routeContext:{outlet:null,matches:q,isDataRoute:!0},onError:m}):V()},null)}function Ho(l){return`${l} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Bv(l){let i=T.useContext(tl);return wt(i,Ho(l)),i}function kv(l){let i=T.useContext(ku);return wt(i,Ho(l)),i}function Yv(l){let i=T.useContext(ke);return wt(i,Ho(l)),i}function Bo(l){let i=Yv(l),s=i.matches[i.matches.length-1];return wt(s.route.id,`${l} can only be used on routes that contain a unique "id"`),s.route.id}function qv(){return Bo("useRouteId")}function Vv(){var o;let l=T.useContext(wo),i=kv("useRouteError"),s=Bo("useRouteError");return l!==void 0?l:(o=i.errors)==null?void 0:o[s]}function Gv(){let{router:l}=Bv("useNavigate"),i=Bo("useNavigate"),s=T.useRef(!1);return ng(()=>{s.current=!0}),T.useCallback(async(c,f={})=>{Oe(s.current,ag),s.current&&(typeof c=="number"?await l.navigate(c):await l.navigate(c,{fromRouteId:i,...f}))},[l,i])}var cm={};function rg(l,i,s){!i&&!cm[l]&&(cm[l]=!0,Oe(!1,s))}T.memo(Kv);function Kv({routes:l,future:i,state:s,isStatic:o,onError:c}){return ig(l,void 0,{state:s,isStatic:o,onError:c})}function qa({to:l,replace:i,state:s,relative:o}){wt(el(),"<Navigate> may be used only in the context of a <Router> component.");let{static:c}=T.useContext(_e);Oe(!c,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:f}=T.useContext(ke),{pathname:h}=Ce(),g=Uo(),y=Bu(l,jo(f),h,o==="path"),m=JSON.stringify(y);return T.useEffect(()=>{g(JSON.parse(m),{replace:i,state:s,relative:o})},[g,m,o,i,s]),null}function Xv(l){return Mv(l.context)}function Wn(l){wt(!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 Qv({basename:l="/",children:i=null,location:s,navigationType:o="POP",navigator:c,static:f=!1,unstable_useTransitions:h}){wt(!el(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let g=l.replace(/^\/*/,"/"),y=T.useMemo(()=>({basename:g,navigator:c,static:f,unstable_useTransitions:h,future:{}}),[g,c,f,h]);typeof s=="string"&&(s=fn(s));let{pathname:m="/",search:b="",hash:v="",state:A=null,key:N="default",unstable_mask:O}=s,H=T.useMemo(()=>{let Y=ha(m,g);return Y==null?null:{location:{pathname:Y,search:b,hash:v,state:A,key:N,unstable_mask:O},navigationType:o}},[g,m,b,v,A,N,o,O]);return Oe(H!=null,`<Router basename="${g}"> is not able to match the URL "${m}${b}${v}" because it does not start with the basename, so the <Router> won't render anything.`),H==null?null:T.createElement(_e.Provider,{value:y},T.createElement(ii.Provider,{children:i,value:H}))}function Zv({children:l,location:i}){return Dv(To(l),i)}function To(l,i=[]){let s=[];return T.Children.forEach(l,(o,c)=>{if(!T.isValidElement(o))return;let f=[...i,c];if(o.type===T.Fragment){s.push.apply(s,To(o.props.children,f));return}wt(o.type===Wn,`[${typeof o.type=="string"?o.type:o.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),wt(!o.props.index||!o.props.children,"An index route cannot have child routes.");let h={id:o.props.id||f.join("-"),caseSensitive:o.props.caseSensitive,element:o.props.element,Component:o.props.Component,index:o.props.index,path:o.props.path,middleware:o.props.middleware,loader:o.props.loader,action:o.props.action,hydrateFallbackElement:o.props.hydrateFallbackElement,HydrateFallback:o.props.HydrateFallback,errorElement:o.props.errorElement,ErrorBoundary:o.props.ErrorBoundary,hasErrorBoundary:o.props.hasErrorBoundary===!0||o.props.ErrorBoundary!=null||o.props.errorElement!=null,shouldRevalidate:o.props.shouldRevalidate,handle:o.props.handle,lazy:o.props.lazy};o.props.children&&(h.children=To(o.props.children,f)),s.push(h)}),s}var zu="get",Nu="application/x-www-form-urlencoded";function Yu(l){return typeof HTMLElement<"u"&&l instanceof HTMLElement}function Jv(l){return Yu(l)&&l.tagName.toLowerCase()==="button"}function $v(l){return Yu(l)&&l.tagName.toLowerCase()==="form"}function Fv(l){return Yu(l)&&l.tagName.toLowerCase()==="input"}function Wv(l){return!!(l.metaKey||l.altKey||l.ctrlKey||l.shiftKey)}function Iv(l,i){return l.button===0&&(!i||i==="_self")&&!Wv(l)}function Ro(l=""){return new URLSearchParams(typeof l=="string"||Array.isArray(l)||l instanceof URLSearchParams?l:Object.keys(l).reduce((i,s)=>{let o=l[s];return i.concat(Array.isArray(o)?o.map(c=>[s,c]):[[s,o]])},[]))}function Pv(l,i){let s=Ro(l);return i&&i.forEach((o,c)=>{s.has(c)||i.getAll(c).forEach(f=>{s.append(c,f)})}),s}var Ou=null;function t1(){if(Ou===null)try{new FormData(document.createElement("form"),0),Ou=!1}catch{Ou=!0}return Ou}var e1=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function po(l){return l!=null&&!e1.has(l)?(Oe(!1,`"${l}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Nu}"`),null):l}function a1(l,i){let s,o,c,f,h;if($v(l)){let g=l.getAttribute("action");o=g?ha(g,i):null,s=l.getAttribute("method")||zu,c=po(l.getAttribute("enctype"))||Nu,f=new FormData(l)}else if(Jv(l)||Fv(l)&&(l.type==="submit"||l.type==="image")){let g=l.form;if(g==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let y=l.getAttribute("formaction")||g.getAttribute("action");if(o=y?ha(y,i):null,s=l.getAttribute("formmethod")||g.getAttribute("method")||zu,c=po(l.getAttribute("formenctype"))||po(g.getAttribute("enctype"))||Nu,f=new FormData(g,l),!t1()){let{name:m,type:b,value:v}=l;if(b==="image"){let A=m?`${m}.`:"";f.append(`${A}x`,"0"),f.append(`${A}y`,"0")}else m&&f.append(m,v)}}else{if(Yu(l))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');s=zu,o=null,c=Nu,h=l}return f&&c==="text/plain"&&(h=f,f=void 0),{action:o,method:s.toLowerCase(),encType:c,formData:f,body:h}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function ko(l,i){if(l===!1||l===null||typeof l>"u")throw new Error(i)}function sg(l,i,s,o){let c=typeof l=="string"?new URL(l,typeof window>"u"?"server://singlefetch/":window.location.origin):l;return s?c.pathname.endsWith("/")?c.pathname=`${c.pathname}_.${o}`:c.pathname=`${c.pathname}.${o}`:c.pathname==="/"?c.pathname=`_root.${o}`:i&&ha(c.pathname,i)==="/"?c.pathname=`${Lu(i)}/_root.${o}`:c.pathname=`${Lu(c.pathname)}.${o}`,c}async function n1(l,i){if(l.id in i)return i[l.id];try{let s=await import(l.module);return i[l.id]=s,s}catch(s){return console.error(`Error loading route module \`${l.module}\`, reloading page...`),console.error(s),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function l1(l){return l==null?!1:l.href==null?l.rel==="preload"&&typeof l.imageSrcSet=="string"&&typeof l.imageSizes=="string":typeof l.rel=="string"&&typeof l.href=="string"}async function i1(l,i,s){let o=await Promise.all(l.map(async c=>{let f=i.routes[c.route.id];if(f){let h=await n1(f,s);return h.links?h.links():[]}return[]}));return o1(o.flat(1).filter(l1).filter(c=>c.rel==="stylesheet"||c.rel==="preload").map(c=>c.rel==="stylesheet"?{...c,rel:"prefetch",as:"style"}:{...c,rel:"prefetch"}))}function fm(l,i,s,o,c,f){let h=(y,m)=>s[m]?y.route.id!==s[m].route.id:!0,g=(y,m)=>{var b;return s[m].pathname!==y.pathname||((b=s[m].route.path)==null?void 0:b.endsWith("*"))&&s[m].params["*"]!==y.params["*"]};return f==="assets"?i.filter((y,m)=>h(y,m)||g(y,m)):f==="data"?i.filter((y,m)=>{var v;let b=o.routes[y.route.id];if(!b||!b.hasLoader)return!1;if(h(y,m)||g(y,m))return!0;if(y.route.shouldRevalidate){let A=y.route.shouldRevalidate({currentUrl:new URL(c.pathname+c.search+c.hash,window.origin),currentParams:((v=s[0])==null?void 0:v.params)||{},nextUrl:new URL(l,window.origin),nextParams:y.params,defaultShouldRevalidate:!0});if(typeof A=="boolean")return A}return!0}):[]}function u1(l,i,{includeHydrateFallback:s}={}){return r1(l.map(o=>{let c=i.routes[o.route.id];if(!c)return[];let f=[c.module];return c.clientActionModule&&(f=f.concat(c.clientActionModule)),c.clientLoaderModule&&(f=f.concat(c.clientLoaderModule)),s&&c.hydrateFallbackModule&&(f=f.concat(c.hydrateFallbackModule)),c.imports&&(f=f.concat(c.imports)),f}).flat(1))}function r1(l){return[...new Set(l)]}function s1(l){let i={},s=Object.keys(l).sort();for(let o of s)i[o]=l[o];return i}function o1(l,i){let s=new Set;return new Set(i),l.reduce((o,c)=>{let f=JSON.stringify(s1(c));return s.has(f)||(s.add(f),o.push({key:f,link:c})),o},[])}function Yo(){let l=T.useContext(tl);return ko(l,"You must render this element inside a <DataRouterContext.Provider> element"),l}function c1(){let l=T.useContext(ku);return ko(l,"You must render this element inside a <DataRouterStateContext.Provider> element"),l}var qo=T.createContext(void 0);qo.displayName="FrameworkContext";function Vo(){let l=T.useContext(qo);return ko(l,"You must render this element inside a <HydratedRouter> element"),l}function f1(l,i){let s=T.useContext(qo),[o,c]=T.useState(!1),[f,h]=T.useState(!1),{onFocus:g,onBlur:y,onMouseEnter:m,onMouseLeave:b,onTouchStart:v}=i,A=T.useRef(null);T.useEffect(()=>{if(l==="render"&&h(!0),l==="viewport"){let H=q=>{q.forEach(V=>{h(V.isIntersecting)})},Y=new IntersectionObserver(H,{threshold:.5});return A.current&&Y.observe(A.current),()=>{Y.disconnect()}}},[l]),T.useEffect(()=>{if(o){let H=setTimeout(()=>{h(!0)},100);return()=>{clearTimeout(H)}}},[o]);let N=()=>{c(!0)},O=()=>{c(!1),h(!1)};return s?l!=="intent"?[f,A,{}]:[f,A,{onFocus:Wl(g,N),onBlur:Wl(y,O),onMouseEnter:Wl(m,N),onMouseLeave:Wl(b,O),onTouchStart:Wl(v,N)}]:[!1,A,{}]}function Wl(l,i){return s=>{l&&l(s),s.defaultPrevented||i(s)}}function d1({page:l,...i}){let s=xv(),{router:o}=Yo(),c=T.useMemo(()=>Qm(o.routes,l,o.basename),[o.routes,l,o.basename]);return c?s?T.createElement(m1,{page:l,matches:c,...i}):T.createElement(g1,{page:l,matches:c,...i}):null}function h1(l){let{manifest:i,routeModules:s}=Vo(),[o,c]=T.useState([]);return T.useEffect(()=>{let f=!1;return i1(l,i,s).then(h=>{f||c(h)}),()=>{f=!0}},[l,i,s]),o}function m1({page:l,matches:i,...s}){let o=Ce(),{future:c}=Vo(),{basename:f}=Yo(),h=T.useMemo(()=>{if(l===o.pathname+o.search+o.hash)return[];let g=sg(l,f,c.unstable_trailingSlashAwareDataRequests,"rsc"),y=!1,m=[];for(let b of i)typeof b.route.shouldRevalidate=="function"?y=!0:m.push(b.route.id);return y&&m.length>0&&g.searchParams.set("_routes",m.join(",")),[g.pathname+g.search]},[f,c.unstable_trailingSlashAwareDataRequests,l,o,i]);return T.createElement(T.Fragment,null,h.map(g=>T.createElement("link",{key:g,rel:"prefetch",as:"fetch",href:g,...s})))}function g1({page:l,matches:i,...s}){let o=Ce(),{future:c,manifest:f,routeModules:h}=Vo(),{basename:g}=Yo(),{loaderData:y,matches:m}=c1(),b=T.useMemo(()=>fm(l,i,m,f,o,"data"),[l,i,m,f,o]),v=T.useMemo(()=>fm(l,i,m,f,o,"assets"),[l,i,m,f,o]),A=T.useMemo(()=>{if(l===o.pathname+o.search+o.hash)return[];let H=new Set,Y=!1;if(i.forEach(V=>{var $;let X=f.routes[V.route.id];!X||!X.hasLoader||(!b.some(tt=>tt.route.id===V.route.id)&&V.route.id in y&&(($=h[V.route.id])!=null&&$.shouldRevalidate)||X.hasClientLoader?Y=!0:H.add(V.route.id))}),H.size===0)return[];let q=sg(l,g,c.unstable_trailingSlashAwareDataRequests,"data");return Y&&H.size>0&&q.searchParams.set("_routes",i.filter(V=>H.has(V.route.id)).map(V=>V.route.id).join(",")),[q.pathname+q.search]},[g,c.unstable_trailingSlashAwareDataRequests,y,o,f,b,i,l,h]),N=T.useMemo(()=>u1(v,f),[v,f]),O=h1(v);return T.createElement(T.Fragment,null,A.map(H=>T.createElement("link",{key:H,rel:"prefetch",as:"fetch",href:H,...s})),N.map(H=>T.createElement("link",{key:H,rel:"modulepreload",href:H,...s})),O.map(({key:H,link:Y})=>T.createElement("link",{key:H,nonce:s.nonce,...Y,crossOrigin:Y.crossOrigin??s.crossOrigin})))}function p1(...l){return i=>{l.forEach(s=>{typeof s=="function"?s(i):s!=null&&(s.current=i)})}}var y1=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{y1&&(window.__reactRouterVersion="7.14.2")}catch{}function v1({basename:l,children:i,unstable_useTransitions:s,window:o}){let c=T.useRef();c.current==null&&(c.current=Jy({window:o,v5Compat:!0}));let f=c.current,[h,g]=T.useState({action:f.action,location:f.location}),y=T.useCallback(m=>{s===!1?g(m):T.startTransition(()=>g(m))},[s]);return T.useLayoutEffect(()=>f.listen(y),[f,y]),T.createElement(Qv,{basename:l,children:i,location:h.location,navigationType:h.action,navigator:f,unstable_useTransitions:s})}var og=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,cg=T.forwardRef(function({onClick:i,discover:s="render",prefetch:o="none",relative:c,reloadDocument:f,replace:h,unstable_mask:g,state:y,target:m,to:b,preventScrollReset:v,viewTransition:A,unstable_defaultShouldRevalidate:N,...O},H){let{basename:Y,navigator:q,unstable_useTransitions:V}=T.useContext(_e),X=typeof b=="string"&&og.test(b),$=Wm(b,Y);b=$.to;let tt=Cv(b,{relative:c}),st=Ce(),J=null;if(g){let Ut=Bu(g,[],st.unstable_mask?st.unstable_mask.pathname:"/",!0);Y!=="/"&&(Ut.pathname=Ut.pathname==="/"?Y:Ge([Y,Ut.pathname])),J=q.createHref(Ut)}let[nt,rt,dt]=f1(o,O),Dt=x1(b,{replace:h,unstable_mask:g,state:y,target:m,preventScrollReset:v,relative:c,viewTransition:A,unstable_defaultShouldRevalidate:N,unstable_useTransitions:V});function $t(Ut){i&&i(Ut),Ut.defaultPrevented||Dt(Ut)}let zt=!($.isExternal||f),Lt=T.createElement("a",{...O,...dt,href:(zt?J:void 0)||$.absoluteURL||tt,onClick:zt?$t:i,ref:p1(H,rt),target:m,"data-discover":!X&&s==="render"?"true":void 0});return nt&&!X?T.createElement(T.Fragment,null,Lt,T.createElement(d1,{page:tt})):Lt});cg.displayName="Link";var Ao=T.forwardRef(function({"aria-current":i="page",caseSensitive:s=!1,className:o="",end:c=!1,style:f,to:h,viewTransition:g,children:y,...m},b){let v=ui(h,{relative:m.relative}),A=Ce(),N=T.useContext(ku),{navigator:O,basename:H}=T.useContext(_e),Y=N!=null&&O1(v)&&g===!0,q=O.encodeLocation?O.encodeLocation(v).pathname:v.pathname,V=A.pathname,X=N&&N.navigation&&N.navigation.location?N.navigation.location.pathname:null;s||(V=V.toLowerCase(),X=X?X.toLowerCase():null,q=q.toLowerCase()),X&&H&&(X=ha(X,H)||X);const $=q!=="/"&&q.endsWith("/")?q.length-1:q.length;let tt=V===q||!c&&V.startsWith(q)&&V.charAt($)==="/",st=X!=null&&(X===q||!c&&X.startsWith(q)&&X.charAt(q.length)==="/"),J={isActive:tt,isPending:st,isTransitioning:Y},nt=tt?i:void 0,rt;typeof o=="function"?rt=o(J):rt=[o,tt?"active":null,st?"pending":null,Y?"transitioning":null].filter(Boolean).join(" ");let dt=typeof f=="function"?f(J):f;return T.createElement(cg,{...m,"aria-current":nt,className:rt,ref:b,style:dt,to:h,viewTransition:g},typeof y=="function"?y(J):y)});Ao.displayName="NavLink";var b1=T.forwardRef(({discover:l="render",fetcherKey:i,navigate:s,reloadDocument:o,replace:c,state:f,method:h=zu,action:g,onSubmit:y,relative:m,preventScrollReset:b,viewTransition:v,unstable_defaultShouldRevalidate:A,...N},O)=>{let{unstable_useTransitions:H}=T.useContext(_e),Y=R1(),q=A1(g,{relative:m}),V=h.toLowerCase()==="get"?"get":"post",X=typeof g=="string"&&og.test(g),$=tt=>{if(y&&y(tt),tt.defaultPrevented)return;tt.preventDefault();let st=tt.nativeEvent.submitter,J=(st==null?void 0:st.getAttribute("formmethod"))||h,nt=()=>Y(st||tt.currentTarget,{fetcherKey:i,method:J,navigate:s,replace:c,state:f,relative:m,preventScrollReset:b,viewTransition:v,unstable_defaultShouldRevalidate:A});H&&s!==!1?T.startTransition(()=>nt()):nt()};return T.createElement("form",{ref:O,method:V,action:q,onSubmit:o?y:$,...N,"data-discover":!X&&l==="render"?"true":void 0})});b1.displayName="Form";function S1(l){return`${l} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function fg(l){let i=T.useContext(tl);return wt(i,S1(l)),i}function x1(l,{target:i,replace:s,unstable_mask:o,state:c,preventScrollReset:f,relative:h,viewTransition:g,unstable_defaultShouldRevalidate:y,unstable_useTransitions:m}={}){let b=Uo(),v=Ce(),A=ui(l,{relative:h});return T.useCallback(N=>{if(Iv(N,i)){N.preventDefault();let O=s!==void 0?s:ni(v)===ni(A),H=()=>b(l,{replace:O,unstable_mask:o,state:c,preventScrollReset:f,relative:h,viewTransition:g,unstable_defaultShouldRevalidate:y});m?T.startTransition(()=>H()):H()}},[v,b,A,s,o,c,i,l,f,h,g,y,m])}function kS(l){Oe(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let i=T.useRef(Ro(l)),s=T.useRef(!1),o=Ce(),c=T.useMemo(()=>Pv(o.search,s.current?null:i.current),[o.search]),f=Uo(),h=T.useCallback((g,y)=>{const m=Ro(typeof g=="function"?g(new URLSearchParams(c)):g);s.current=!0,f("?"+m,y)},[f,c]);return[c,h]}var E1=0,T1=()=>`__${String(++E1)}__`;function R1(){let{router:l}=fg("useSubmit"),{basename:i}=T.useContext(_e),s=qv(),o=l.fetch,c=l.navigate;return T.useCallback(async(f,h={})=>{let{action:g,method:y,encType:m,formData:b,body:v}=a1(f,i);if(h.navigate===!1){let A=h.fetcherKey||T1();await o(A,s,h.action||g,{unstable_defaultShouldRevalidate:h.unstable_defaultShouldRevalidate,preventScrollReset:h.preventScrollReset,formData:b,body:v,formMethod:h.method||y,formEncType:h.encType||m,flushSync:h.flushSync})}else await c(h.action||g,{unstable_defaultShouldRevalidate:h.unstable_defaultShouldRevalidate,preventScrollReset:h.preventScrollReset,formData:b,body:v,formMethod:h.method||y,formEncType:h.encType||m,replace:h.replace,state:h.state,fromRouteId:s,flushSync:h.flushSync,viewTransition:h.viewTransition})},[o,c,i,s])}function A1(l,{relative:i}={}){let{basename:s}=T.useContext(_e),o=T.useContext(ke);wt(o,"useFormAction must be used inside a RouteContext");let[c]=o.matches.slice(-1),f={...ui(l||".",{relative:i})},h=Ce();if(l==null){f.search=h.search;let g=new URLSearchParams(f.search),y=g.getAll("index");if(y.some(b=>b==="")){g.delete("index"),y.filter(v=>v).forEach(v=>g.append("index",v));let b=g.toString();f.search=b?`?${b}`:""}}return(!l||l===".")&&c.route.index&&(f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index"),s!=="/"&&(f.pathname=f.pathname==="/"?s:Ge([s,f.pathname])),ni(f)}function O1(l,{relative:i}={}){let s=T.useContext(tg);wt(s!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:o}=fg("useViewTransitionState"),c=ui(l,{relative:i});if(!s.isTransitioning)return!1;let f=ha(s.currentLocation.pathname,o)||s.currentLocation.pathname,h=ha(s.nextLocation.pathname,o)||s.nextLocation.pathname;return Du(c.pathname,h)!=null||Du(c.pathname,f)!=null}const _1=(l,i,s,o)=>{var f,h,g,y;const c=[s,{code:i,...o||{}}];if((h=(f=l==null?void 0:l.services)==null?void 0:f.logger)!=null&&h.forward)return l.services.logger.forward(c,"warn","react-i18next::",!0);cn(c[0])&&(c[0]=`react-i18next:: ${c[0]}`),(y=(g=l==null?void 0:l.services)==null?void 0:g.logger)!=null&&y.warn?l.services.logger.warn(...c):console!=null&&console.warn&&console.warn(...c)},dm={},Oo=(l,i,s,o)=>{cn(s)&&dm[s]||(cn(s)&&(dm[s]=new Date),_1(l,i,s,o))},dg=(l,i)=>()=>{if(l.isInitialized)i();else{const s=()=>{setTimeout(()=>{l.off("initialized",s)},0),i()};l.on("initialized",s)}},_o=(l,i,s)=>{l.loadNamespaces(i,dg(l,s))},hm=(l,i,s,o)=>{if(cn(s)&&(s=[s]),l.options.preload&&l.options.preload.indexOf(i)>-1)return _o(l,s,o);s.forEach(c=>{l.options.ns.indexOf(c)<0&&l.options.ns.push(c)}),l.loadLanguages(i,dg(l,o))},C1=(l,i,s={})=>!i.languages||!i.languages.length?(Oo(i,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:i.languages}),!0):i.hasLoadedNamespace(l,{lng:s.lng,precheck:(o,c)=>{if(s.bindI18n&&s.bindI18n.indexOf("languageChanging")>-1&&o.services.backendConnector.backend&&o.isLanguageChangingTo&&!c(o.isLanguageChangingTo,l))return!1}}),cn=l=>typeof l=="string",z1=l=>typeof l=="object"&&l!==null,N1=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,M1={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},D1=l=>M1[l],L1=l=>l.replace(N1,D1);let Co={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:L1};const j1=(l={})=>{Co={...Co,...l}},w1=()=>Co;let hg;const U1=l=>{hg=l},H1=()=>hg,B1={type:"3rdParty",init(l){j1(l.options.react),U1(l)}},k1=T.createContext();class Y1{constructor(){this.usedNamespaces={}}addUsedNamespaces(i){i.forEach(s=>{this.usedNamespaces[s]||(this.usedNamespaces[s]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const q1=(l,i)=>{const s=T.useRef();return T.useEffect(()=>{s.current=l},[l,i]),s.current},mg=(l,i,s,o)=>l.getFixedT(i,s,o),V1=(l,i,s,o)=>T.useCallback(mg(l,i,s,o),[l,i,s,o]),G1=(l,i={})=>{var $,tt,st,J;const{i18n:s}=i,{i18n:o,defaultNS:c}=T.useContext(k1)||{},f=s||o||H1();if(f&&!f.reportNamespaces&&(f.reportNamespaces=new Y1),!f){Oo(f,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const nt=(dt,Dt)=>cn(Dt)?Dt:z1(Dt)&&cn(Dt.defaultValue)?Dt.defaultValue:Array.isArray(dt)?dt[dt.length-1]:dt,rt=[nt,{},!1];return rt.t=nt,rt.i18n={},rt.ready=!1,rt}($=f.options.react)!=null&&$.wait&&Oo(f,"DEPRECATED_OPTION","useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const h={...w1(),...f.options.react,...i},{useSuspense:g,keyPrefix:y}=h;let m=c||((tt=f.options)==null?void 0:tt.defaultNS);m=cn(m)?[m]:m||["translation"],(J=(st=f.reportNamespaces).addUsedNamespaces)==null||J.call(st,m);const b=(f.isInitialized||f.initializedStoreOnce)&&m.every(nt=>C1(nt,f,h)),v=V1(f,i.lng||null,h.nsMode==="fallback"?m:m[0],y),A=()=>v,N=()=>mg(f,i.lng||null,h.nsMode==="fallback"?m:m[0],y),[O,H]=T.useState(A);let Y=m.join();i.lng&&(Y=`${i.lng}${Y}`);const q=q1(Y),V=T.useRef(!0);T.useEffect(()=>{const{bindI18n:nt,bindI18nStore:rt}=h;V.current=!0,!b&&!g&&(i.lng?hm(f,i.lng,m,()=>{V.current&&H(N)}):_o(f,m,()=>{V.current&&H(N)})),b&&q&&q!==Y&&V.current&&H(N);const dt=()=>{V.current&&H(N)};return nt&&(f==null||f.on(nt,dt)),rt&&(f==null||f.store.on(rt,dt)),()=>{V.current=!1,f&&nt&&(nt==null||nt.split(" ").forEach(Dt=>f.off(Dt,dt))),rt&&f&&rt.split(" ").forEach(Dt=>f.store.off(Dt,dt))}},[f,Y]),T.useEffect(()=>{V.current&&b&&H(A)},[f,y,b]);const X=[O,f,b];if(X.t=O,X.i18n=f,X.ready=b,b||!b&&!g)return X;throw new Promise(nt=>{i.lng?hm(f,i.lng,m,()=>nt()):_o(f,m,()=>nt())})};function gg(l){var i,s,o="";if(typeof l=="string"||typeof l=="number")o+=l;else if(typeof l=="object")if(Array.isArray(l)){var c=l.length;for(i=0;i<c;i++)l[i]&&(s=gg(l[i]))&&(o&&(o+=" "),o+=s)}else for(s in l)l[s]&&(o&&(o+=" "),o+=s);return o}function K1(){for(var l,i,s=0,o="",c=arguments.length;s<c;s++)(l=arguments[s])&&(i=gg(l))&&(o&&(o+=" "),o+=i);return o}function ne(...l){return K1(l)}function YS(l){return l?new Date(l).toLocaleString():"-"}function qS(l,i="just now"){if(!l)return"";const s=Math.floor((Date.now()-new Date(l).getTime())/6e4);if(s<1)return i;if(s<60)return`${s}m`;const o=Math.floor(s/60);return o<24?`${o}h`:`${Math.floor(o/24)}d`}const mm=l=>{let i;const s=new Set,o=(m,b)=>{const v=typeof m=="function"?m(i):m;if(!Object.is(v,i)){const A=i;i=b??(typeof v!="object"||v===null)?v:Object.assign({},i,v),s.forEach(N=>N(i,A))}},c=()=>i,g={setState:o,getState:c,getInitialState:()=>y,subscribe:m=>(s.add(m),()=>s.delete(m))},y=i=l(o,c,g);return g},X1=(l=>l?mm(l):mm),Q1=l=>l;function Z1(l,i=Q1){const s=In.useSyncExternalStore(l.subscribe,In.useCallback(()=>i(l.getState()),[l,i]),In.useCallback(()=>i(l.getInitialState()),[l,i]));return In.useDebugValue(s),s}const gm=l=>{const i=X1(l),s=o=>Z1(i,o);return Object.assign(s,i),s},pg=(l=>l?gm(l):gm),Go=pg(l=>({snapshot:null,setSnapshot:i=>l({snapshot:i})}));function pm(l){Go.getState().setSnapshot(l)}function J1(){return Go.getState().snapshot}function $1(l){return!!(l!=null&&l.knowledge.some(i=>i.enabled!==!1))}function F1(l){return!!(l!=null&&l.schedulers.some(i=>i.enabled!==!1))}function W1(l){var i;return!!((i=l==null?void 0:l.monitors)!=null&&i.some(s=>s.enabled!==!1))}function ym(l){return!!(l!=null&&l.agents.some(i=>i.agentType))}function I1(l=J1()){const i=!!l,s=i?ym(l):!0;return{desktopRuntime:!0,desktopChat:s,chatRoute:i?s:!0,desktopWorkspace:i?ym(l):!0,knowledgeModule:i?$1(l):!0,schedulerModule:i?F1(l):!0,monitorModule:i?W1(l):!0}}function Ko(){const l=Go(i=>i.snapshot);return I1(l)}function vm(l){return l==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":l}function bm(l){document.documentElement.classList.toggle("dark",l==="dark")}const yg=pg(l=>({theme:"dark",resolved:"dark",setTheme:i=>{const s=vm(i);localStorage.setItem("cc_theme",i),bm(s),l({theme:i,resolved:s})},init:()=>{const i=localStorage.getItem("cc_theme")||"dark",s=vm(i);bm(s),l({theme:i,resolved:s})}})),P1="modulepreload",tb=function(l,i){return new URL(l,i).href},Sm={},Ae=function(i,s,o){let c=Promise.resolve();if(s&&s.length>0){let h=function(b){return Promise.all(b.map(v=>Promise.resolve(v).then(A=>({status:"fulfilled",value:A}),A=>({status:"rejected",reason:A}))))};const g=document.getElementsByTagName("link"),y=document.querySelector("meta[property=csp-nonce]"),m=(y==null?void 0:y.nonce)||(y==null?void 0:y.getAttribute("nonce"));c=h(s.map(b=>{if(b=tb(b,o),b in Sm)return;Sm[b]=!0;const v=b.endsWith(".css"),A=v?'[rel="stylesheet"]':"";if(!!o)for(let H=g.length-1;H>=0;H--){const Y=g[H];if(Y.href===b&&(!v||Y.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${b}"]${A}`))return;const O=document.createElement("link");if(O.rel=v?"stylesheet":P1,v||(O.as="script"),O.crossOrigin="",O.href=b,m&&O.setAttribute("nonce",m),document.head.appendChild(O),v)return new Promise((H,Y)=>{O.addEventListener("load",H),O.addEventListener("error",()=>Y(new Error(`Unable to preload CSS for ${b}`)))})}))}function f(h){const g=new Event("vite:preloadError",{cancelable:!0});if(g.payload=h,window.dispatchEvent(g),!g.defaultPrevented)throw h}return c.then(h=>{for(const g of h||[])g.status==="rejected"&&f(g.reason);return i().catch(f)})},eb=T.lazy(()=>Ae(()=>import("./Dashboard-D3ezFmb7.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url)),ab=T.lazy(()=>Ae(()=>import("./ThreadChat-BU1zCdr4.js").then(l=>l.T),__vite__mapDeps([8,9,10,7,11,12,13,14,15,16,17,5]),import.meta.url)),nb=T.lazy(()=>Ae(()=>import("./Workspace-BoZCz7S8.js"),__vite__mapDeps([18,12,13,11,19,10,3,4,1,9,16,20,21]),import.meta.url)),lb=T.lazy(()=>Ae(()=>import("./AutomationList-BgJgAdVO.js"),__vite__mapDeps([22,5,1,2,19,13,10,3,4,12,11]),import.meta.url)),ib=T.lazy(()=>Ae(()=>import("./Config-aSFqlI88.js"),__vite__mapDeps([23,2,11,4,1,7,21]),import.meta.url)),ub=T.lazy(()=>Ae(()=>import("./Logs-sgAdwEeS.js"),__vite__mapDeps([24,1,2,11,19,13,10,4,25,14]),import.meta.url)),rb=T.lazy(()=>Ae(()=>import("./KnowledgeHome-9aF8nJEf.js"),__vite__mapDeps([26,1,12,13,11,3,17,15,16,14,20,6]),import.meta.url)),sb=T.lazy(()=>Ae(()=>import("./KnowledgeDetail-N8Ey1ikc.js"),__vite__mapDeps([27,1,11,3,17,25,14,16]),import.meta.url));class ob{constructor(){Au(this,"routes",new Map);Au(this,"navItems",new Map)}registerRoute(i){this.routes.set(i.id,i)}registerNavItem(i){this.navItems.set(i.id,i)}listRoutes(){return[...this.routes.values()].sort((i,s)=>i.order-s.order)}listNavItems(){return[...this.navItems.values()].sort((i,s)=>i.order-s.order)}}function ka(l,i,s="/"){return l?i:j.jsx(qa,{to:s,replace:!0})}function cb(){const{name:l}=lg();return j.jsx(qa,{to:l?`/workspace?project=${encodeURIComponent(l)}`:"/workspace",replace:!0})}function xm(){const{project:l,id:i}=lg(),s=new URLSearchParams;return l&&s.set("project",l),i&&s.set("session",i),j.jsx(qa,{to:`/chat${s.toString()?`?${s.toString()}`:""}`,replace:!0})}function fb(l){[{id:"dashboard",index:!0,titleKey:"nav.dashboard",order:10,element:()=>j.jsx(eb,{})},{id:"chat",path:"chat",titleKey:"nav.chat",order:20,element:({features:s})=>ka(s.chatRoute,j.jsx(ab,{}))},{id:"workspace",path:"workspace",titleKey:"nav.workspace",order:30,element:({features:s})=>ka(s.desktopWorkspace,j.jsx(nb,{}))},{id:"knowledge",path:"knowledge",titleKey:"nav.knowledge",order:40,element:({features:s})=>ka(s.knowledgeModule,j.jsx(rb,{}))},{id:"knowledge-detail",path:"knowledge/:knowledgebaseId",titleKey:"nav.knowledge",order:41,element:({features:s})=>ka(s.knowledgeModule,j.jsx(sb,{}))},{id:"projects",path:"projects",titleKey:"nav.projects",order:50,element:({features:s})=>ka(s.desktopWorkspace,j.jsx(qa,{to:"/workspace",replace:!0}))},{id:"project-detail",path:"projects/:name",titleKey:"nav.projects",order:51,element:()=>j.jsx(cb,{})},{id:"sessions",path:"sessions",titleKey:"nav.sessions",order:60,element:()=>j.jsx(xm,{})},{id:"session-detail",path:"sessions/:project/:id",titleKey:"nav.sessions",order:61,element:()=>j.jsx(xm,{})},{id:"automations",path:"automations",titleKey:"nav.automations",order:70,element:({features:s})=>ka(s.schedulerModule||s.monitorModule,j.jsx(lb,{}))},{id:"cron-legacy",path:"cron",titleKey:"nav.automations",order:71,element:({features:s})=>ka(s.schedulerModule||s.monitorModule,j.jsx(qa,{to:"/automations?origin=scheduled-job",replace:!0}))},{id:"monitors-legacy",path:"monitors",titleKey:"nav.automations",order:72,element:({features:s})=>ka(s.schedulerModule||s.monitorModule,j.jsx(qa,{to:"/automations?origin=automation-monitor",replace:!0}))},{id:"system",path:"system",titleKey:"nav.system",order:80,element:()=>j.jsx(ib,{})},{id:"system-logs",path:"system/logs",titleKey:"nav.system",order:81,element:()=>j.jsx(ub,{})}].forEach(s=>l.registerRoute(s))}function db(l){[{id:"dashboard",path:"/",labelKey:"nav.dashboard",icon:Sy,order:10,end:!0},{id:"chat",path:"/chat",labelKey:"nav.chat",icon:Oy,order:20,visible:({features:s})=>s.chatRoute,resolveLabelKey:({features:s})=>s.desktopChat?"nav.chat":"nav.chatWeb"},{id:"workspace",path:"/workspace",labelKey:"nav.workspace",icon:ky,order:30,visible:({features:s})=>s.desktopWorkspace},{id:"knowledge",path:"/knowledge",labelKey:"nav.knowledge",icon:Ey,order:40,visible:({features:s})=>s.knowledgeModule},{id:"projects",path:"/projects",labelKey:"nav.projects",icon:py,order:50,visible:()=>!1},{id:"sessions",path:"/sessions",labelKey:"nav.sessions",icon:Ry,order:60,visible:()=>!1},{id:"automations",path:"/automations",labelKey:"nav.automations",icon:cy,order:70,visible:({features:s})=>s.schedulerModule||s.monitorModule},{id:"system",path:"/system",labelKey:"nav.system",icon:Ly,order:80}].forEach(s=>l.registerNavItem(s))}const qu=new ob;fb(qu);db(qu);function hb({className:l,markClassName:i,showWordmark:s=!1}){const o=T.useId(),c=`${o}-bg`,f=`${o}-stroke`;return j.jsxs("div",{className:ne("inline-flex items-center gap-3",l),children:[j.jsxs("svg",{className:ne("h-8 w-8 shrink-0",i),viewBox:"0 0 64 64",role:"img","aria-label":"AgentDock",fill:"none",children:[j.jsxs("defs",{children:[j.jsxs("linearGradient",{id:c,x1:"7",y1:"5",x2:"57",y2:"59",gradientUnits:"userSpaceOnUse",children:[j.jsx("stop",{className:"[stop-color:#FFFFFF] dark:[stop-color:#3A3A3C]"}),j.jsx("stop",{offset:"0.52",className:"[stop-color:#F5F5F7] dark:[stop-color:#2C2C2E]"}),j.jsx("stop",{offset:"1",className:"[stop-color:#E5E5EA] dark:[stop-color:#1C1C1E]"})]}),j.jsxs("linearGradient",{id:f,x1:"18",y1:"16",x2:"47",y2:"48",gradientUnits:"userSpaceOnUse",children:[j.jsx("stop",{stopColor:"#5AC8FA"}),j.jsx("stop",{offset:"0.44",stopColor:"#0A84FF"}),j.jsx("stop",{offset:"1",stopColor:"#007AFF"})]})]}),j.jsx("rect",{x:"4",y:"4",width:"56",height:"56",rx:"16",fill:`url(#${c})`,className:"stroke-black/10 dark:stroke-white/10",strokeWidth:"1.5"}),j.jsx("path",{d:"M14.5 45L25.3 20.1C26.1 18.1 28.9 18.1 29.8 20.1L40.8 45",stroke:`url(#${f})`,strokeWidth:"7.5",strokeLinecap:"round",strokeLinejoin:"round"}),j.jsx("path",{d:"M20.8 37.5H34.7",className:"stroke-white dark:stroke-white",strokeWidth:"5.25",strokeLinecap:"round"}),j.jsx("path",{d:"M33.8 20.2H37.4C45.1 20.2 50 25.6 50 32.5C50 39.4 45.1 44.8 37.4 44.8H33.8",stroke:`url(#${f})`,strokeWidth:"7",strokeLinecap:"round",strokeLinejoin:"round",opacity:"0.82"}),j.jsx("path",{d:"M34 25.5V39.5",className:"stroke-black/70 dark:stroke-black/80",strokeWidth:"3",strokeLinecap:"round",opacity:"0.18"})]}),s&&j.jsx("span",{className:"text-sm font-semibold tracking-tight text-foreground",children:"AgentDock"})]})}var yo={};const et=l=>typeof l=="string",Il=()=>{let l,i;const s=new Promise((o,c)=>{l=o,i=c});return s.resolve=l,s.reject=i,s},Em=l=>l==null?"":""+l,mb=(l,i,s)=>{l.forEach(o=>{i[o]&&(s[o]=i[o])})},gb=/###/g,Tm=l=>l&&l.indexOf("###")>-1?l.replace(gb,"."):l,Rm=l=>!l||et(l),ti=(l,i,s)=>{const o=et(i)?i.split("."):i;let c=0;for(;c<o.length-1;){if(Rm(l))return{};const f=Tm(o[c]);!l[f]&&s&&(l[f]=new s),Object.prototype.hasOwnProperty.call(l,f)?l=l[f]:l={},++c}return Rm(l)?{}:{obj:l,k:Tm(o[c])}},Am=(l,i,s)=>{const{obj:o,k:c}=ti(l,i,Object);if(o!==void 0||i.length===1){o[c]=s;return}let f=i[i.length-1],h=i.slice(0,i.length-1),g=ti(l,h,Object);for(;g.obj===void 0&&h.length;)f=`${h[h.length-1]}.${f}`,h=h.slice(0,h.length-1),g=ti(l,h,Object),g!=null&&g.obj&&typeof g.obj[`${g.k}.${f}`]<"u"&&(g.obj=void 0);g.obj[`${g.k}.${f}`]=s},pb=(l,i,s,o)=>{const{obj:c,k:f}=ti(l,i,Object);c[f]=c[f]||[],c[f].push(s)},ju=(l,i)=>{const{obj:s,k:o}=ti(l,i);if(s&&Object.prototype.hasOwnProperty.call(s,o))return s[o]},yb=(l,i,s)=>{const o=ju(l,s);return o!==void 0?o:ju(i,s)},vg=(l,i,s)=>{for(const o in i)o!=="__proto__"&&o!=="constructor"&&(o in l?et(l[o])||l[o]instanceof String||et(i[o])||i[o]instanceof String?s&&(l[o]=i[o]):vg(l[o],i[o],s):l[o]=i[o]);return l},on=l=>l.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var vb={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const bb=l=>et(l)?l.replace(/[&<>"'\/]/g,i=>vb[i]):l;class Sb{constructor(i){this.capacity=i,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(i){const s=this.regExpMap.get(i);if(s!==void 0)return s;const o=new RegExp(i);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(i,o),this.regExpQueue.push(i),o}}const xb=[" ",",","?","!",";"],Eb=new Sb(20),Tb=(l,i,s)=>{i=i||"",s=s||"";const o=xb.filter(h=>i.indexOf(h)<0&&s.indexOf(h)<0);if(o.length===0)return!0;const c=Eb.getRegExp(`(${o.map(h=>h==="?"?"\\?":h).join("|")})`);let f=!c.test(l);if(!f){const h=l.indexOf(s);h>0&&!c.test(l.substring(0,h))&&(f=!0)}return f},zo=(l,i,s=".")=>{if(!l)return;if(l[i])return Object.prototype.hasOwnProperty.call(l,i)?l[i]:void 0;const o=i.split(s);let c=l;for(let f=0;f<o.length;){if(!c||typeof c!="object")return;let h,g="";for(let y=f;y<o.length;++y)if(y!==f&&(g+=s),g+=o[y],h=c[g],h!==void 0){if(["string","number","boolean"].indexOf(typeof h)>-1&&y<o.length-1)continue;f+=y-f+1;break}c=h}return c},li=l=>l==null?void 0:l.replace(/_/g,"-"),Rb={type:"logger",log(l){this.output("log",l)},warn(l){this.output("warn",l)},error(l){this.output("error",l)},output(l,i){var s,o;(o=(s=console==null?void 0:console[l])==null?void 0:s.apply)==null||o.call(s,console,i)}};class wu{constructor(i,s={}){this.init(i,s)}init(i,s={}){this.prefix=s.prefix||"i18next:",this.logger=i||Rb,this.options=s,this.debug=s.debug}log(...i){return this.forward(i,"log","",!0)}warn(...i){return this.forward(i,"warn","",!0)}error(...i){return this.forward(i,"error","")}deprecate(...i){return this.forward(i,"warn","WARNING DEPRECATED: ",!0)}forward(i,s,o,c){return c&&!this.debug?null:(et(i[0])&&(i[0]=`${o}${this.prefix} ${i[0]}`),this.logger[s](i))}create(i){return new wu(this.logger,{prefix:`${this.prefix}:${i}:`,...this.options})}clone(i){return i=i||this.options,i.prefix=i.prefix||this.prefix,new wu(this.logger,i)}}var Je=new wu;class Vu{constructor(){this.observers={}}on(i,s){return i.split(" ").forEach(o=>{this.observers[o]||(this.observers[o]=new Map);const c=this.observers[o].get(s)||0;this.observers[o].set(s,c+1)}),this}off(i,s){if(this.observers[i]){if(!s){delete this.observers[i];return}this.observers[i].delete(s)}}emit(i,...s){this.observers[i]&&Array.from(this.observers[i].entries()).forEach(([c,f])=>{for(let h=0;h<f;h++)c(...s)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([c,f])=>{for(let h=0;h<f;h++)c.apply(c,[i,...s])})}}class Om extends Vu{constructor(i,s={ns:["translation"],defaultNS:"translation"}){super(),this.data=i||{},this.options=s,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(i){this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}removeNamespaces(i){const s=this.options.ns.indexOf(i);s>-1&&this.options.ns.splice(s,1)}getResource(i,s,o,c={}){var m,b;const f=c.keySeparator!==void 0?c.keySeparator:this.options.keySeparator,h=c.ignoreJSONStructure!==void 0?c.ignoreJSONStructure:this.options.ignoreJSONStructure;let g;i.indexOf(".")>-1?g=i.split("."):(g=[i,s],o&&(Array.isArray(o)?g.push(...o):et(o)&&f?g.push(...o.split(f)):g.push(o)));const y=ju(this.data,g);return!y&&!s&&!o&&i.indexOf(".")>-1&&(i=g[0],s=g[1],o=g.slice(2).join(".")),y||!h||!et(o)?y:zo((b=(m=this.data)==null?void 0:m[i])==null?void 0:b[s],o,f)}addResource(i,s,o,c,f={silent:!1}){const h=f.keySeparator!==void 0?f.keySeparator:this.options.keySeparator;let g=[i,s];o&&(g=g.concat(h?o.split(h):o)),i.indexOf(".")>-1&&(g=i.split("."),c=s,s=g[1]),this.addNamespaces(s),Am(this.data,g,c),f.silent||this.emit("added",i,s,o,c)}addResources(i,s,o,c={silent:!1}){for(const f in o)(et(o[f])||Array.isArray(o[f]))&&this.addResource(i,s,f,o[f],{silent:!0});c.silent||this.emit("added",i,s,o)}addResourceBundle(i,s,o,c,f,h={silent:!1,skipCopy:!1}){let g=[i,s];i.indexOf(".")>-1&&(g=i.split("."),c=o,o=s,s=g[1]),this.addNamespaces(s);let y=ju(this.data,g)||{};h.skipCopy||(o=JSON.parse(JSON.stringify(o))),c?vg(y,o,f):y={...y,...o},Am(this.data,g,y),h.silent||this.emit("added",i,s,o)}removeResourceBundle(i,s){this.hasResourceBundle(i,s)&&delete this.data[i][s],this.removeNamespaces(s),this.emit("removed",i,s)}hasResourceBundle(i,s){return this.getResource(i,s)!==void 0}getResourceBundle(i,s){return s||(s=this.options.defaultNS),this.getResource(i,s)}getDataByLanguage(i){return this.data[i]}hasLanguageSomeTranslations(i){const s=this.getDataByLanguage(i);return!!(s&&Object.keys(s)||[]).find(c=>s[c]&&Object.keys(s[c]).length>0)}toJSON(){return this.data}}var bg={processors:{},addPostProcessor(l){this.processors[l.name]=l},handle(l,i,s,o,c){return l.forEach(f=>{var h;i=((h=this.processors[f])==null?void 0:h.process(i,s,o,c))??i}),i}};const Sg=Symbol("i18next/PATH_KEY");function Ab(){const l=[],i=Object.create(null);let s;return i.get=(o,c)=>{var f;return(f=s==null?void 0:s.revoke)==null||f.call(s),c===Sg?l:(l.push(c),s=Proxy.revocable(o,i),s.proxy)},Proxy.revocable(Object.create(null),i).proxy}function Pn(l,i){const{[Sg]:s}=l(Ab()),o=(i==null?void 0:i.keySeparator)??".",c=(i==null?void 0:i.nsSeparator)??":";if(s.length>1&&c){const f=i==null?void 0:i.ns,h=Array.isArray(f)?f:null;if(h&&h.length>1&&h.slice(1).includes(s[0]))return`${s[0]}${c}${s.slice(1).join(o)}`}return s.join(o)}const _m={},vo=l=>!et(l)&&typeof l!="boolean"&&typeof l!="number";class Uu extends Vu{constructor(i,s={}){super(),mb(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],i,this),this.options=s,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Je.create("translator")}changeLanguage(i){i&&(this.language=i)}exists(i,s={interpolation:{}}){const o={...s};if(i==null)return!1;const c=this.resolve(i,o);if((c==null?void 0:c.res)===void 0)return!1;const f=vo(c.res);return!(o.returnObjects===!1&&f)}extractFromKey(i,s){let o=s.nsSeparator!==void 0?s.nsSeparator:this.options.nsSeparator;o===void 0&&(o=":");const c=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator;let f=s.ns||this.options.defaultNS||[];const h=o&&i.indexOf(o)>-1,g=!this.options.userDefinedKeySeparator&&!s.keySeparator&&!this.options.userDefinedNsSeparator&&!s.nsSeparator&&!Tb(i,o,c);if(h&&!g){const y=i.match(this.interpolator.nestingRegexp);if(y&&y.length>0)return{key:i,namespaces:et(f)?[f]:f};const m=i.split(o);(o!==c||o===c&&this.options.ns.indexOf(m[0])>-1)&&(f=m.shift()),i=m.join(c)}return{key:i,namespaces:et(f)?[f]:f}}translate(i,s,o){let c=typeof s=="object"?{...s}:s;if(typeof c!="object"&&this.options.overloadTranslationOptionHandler&&(c=this.options.overloadTranslationOptionHandler(arguments)),typeof c=="object"&&(c={...c}),c||(c={}),i==null)return"";typeof i=="function"&&(i=Pn(i,{...this.options,...c})),Array.isArray(i)||(i=[String(i)]),i=i.map(zt=>typeof zt=="function"?Pn(zt,{...this.options,...c}):String(zt));const f=c.returnDetails!==void 0?c.returnDetails:this.options.returnDetails,h=c.keySeparator!==void 0?c.keySeparator:this.options.keySeparator,{key:g,namespaces:y}=this.extractFromKey(i[i.length-1],c),m=y[y.length-1];let b=c.nsSeparator!==void 0?c.nsSeparator:this.options.nsSeparator;b===void 0&&(b=":");const v=c.lng||this.language,A=c.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((v==null?void 0:v.toLowerCase())==="cimode")return A?f?{res:`${m}${b}${g}`,usedKey:g,exactUsedKey:g,usedLng:v,usedNS:m,usedParams:this.getUsedParamsDetails(c)}:`${m}${b}${g}`:f?{res:g,usedKey:g,exactUsedKey:g,usedLng:v,usedNS:m,usedParams:this.getUsedParamsDetails(c)}:g;const N=this.resolve(i,c);let O=N==null?void 0:N.res;const H=(N==null?void 0:N.usedKey)||g,Y=(N==null?void 0:N.exactUsedKey)||g,q=["[object Number]","[object Function]","[object RegExp]"],V=c.joinArrays!==void 0?c.joinArrays:this.options.joinArrays,X=!this.i18nFormat||this.i18nFormat.handleAsObject,$=c.count!==void 0&&!et(c.count),tt=Uu.hasDefaultValue(c),st=$?this.pluralResolver.getSuffix(v,c.count,c):"",J=c.ordinal&&$?this.pluralResolver.getSuffix(v,c.count,{ordinal:!1}):"",nt=$&&!c.ordinal&&c.count===0,rt=nt&&c[`defaultValue${this.options.pluralSeparator}zero`]||c[`defaultValue${st}`]||c[`defaultValue${J}`]||c.defaultValue;let dt=O;X&&!O&&tt&&(dt=rt);const Dt=vo(dt),$t=Object.prototype.toString.apply(dt);if(X&&dt&&Dt&&q.indexOf($t)<0&&!(et(V)&&Array.isArray(dt))){if(!c.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const zt=this.options.returnedObjectHandler?this.options.returnedObjectHandler(H,dt,{...c,ns:y}):`key '${g} (${this.language})' returned an object instead of string.`;return f?(N.res=zt,N.usedParams=this.getUsedParamsDetails(c),N):zt}if(h){const zt=Array.isArray(dt),Lt=zt?[]:{},Ut=zt?Y:H;for(const D in dt)if(Object.prototype.hasOwnProperty.call(dt,D)){const G=`${Ut}${h}${D}`;tt&&!O?Lt[D]=this.translate(G,{...c,defaultValue:vo(rt)?rt[D]:void 0,joinArrays:!1,ns:y}):Lt[D]=this.translate(G,{...c,joinArrays:!1,ns:y}),Lt[D]===G&&(Lt[D]=dt[D])}O=Lt}}else if(X&&et(V)&&Array.isArray(O))O=O.join(V),O&&(O=this.extendTranslation(O,i,c,o));else{let zt=!1,Lt=!1;!this.isValidLookup(O)&&tt&&(zt=!0,O=rt),this.isValidLookup(O)||(Lt=!0,O=g);const D=(c.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&Lt?void 0:O,G=tt&&rt!==O&&this.options.updateMissing;if(Lt||zt||G){if(this.logger.log(G?"updateKey":"missingKey",v,m,g,G?rt:O),h){const x=this.resolve(g,{...c,keySeparator:!1});x&&x.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 I=[];const pt=this.languageUtils.getFallbackCodes(this.options.fallbackLng,c.lng||this.language);if(this.options.saveMissingTo==="fallback"&&pt&&pt[0])for(let x=0;x<pt.length;x++)I.push(pt[x]);else this.options.saveMissingTo==="all"?I=this.languageUtils.toResolveHierarchy(c.lng||this.language):I.push(c.lng||this.language);const xt=(x,w,K)=>{var at;const Q=tt&&K!==O?K:D;this.options.missingKeyHandler?this.options.missingKeyHandler(x,m,w,Q,G,c):(at=this.backendConnector)!=null&&at.saveMissing&&this.backendConnector.saveMissing(x,m,w,Q,G,c),this.emit("missingKey",x,m,w,O)};this.options.saveMissing&&(this.options.saveMissingPlurals&&$?I.forEach(x=>{const w=this.pluralResolver.getSuffixes(x,c);nt&&c[`defaultValue${this.options.pluralSeparator}zero`]&&w.indexOf(`${this.options.pluralSeparator}zero`)<0&&w.push(`${this.options.pluralSeparator}zero`),w.forEach(K=>{xt([x],g+K,c[`defaultValue${K}`]||rt)})}):xt(I,g,rt))}O=this.extendTranslation(O,i,c,N,o),Lt&&O===g&&this.options.appendNamespaceToMissingKey&&(O=`${m}${b}${g}`),(Lt||zt)&&this.options.parseMissingKeyHandler&&(O=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${m}${b}${g}`:g,zt?O:void 0,c))}return f?(N.res=O,N.usedParams=this.getUsedParamsDetails(c),N):O}extendTranslation(i,s,o,c,f){var y,m;if((y=this.i18nFormat)!=null&&y.parse)i=this.i18nFormat.parse(i,{...this.options.interpolation.defaultVariables,...o},o.lng||this.language||c.usedLng,c.usedNS,c.usedKey,{resolved:c});else if(!o.skipInterpolation){o.interpolation&&this.interpolator.init({...o,interpolation:{...this.options.interpolation,...o.interpolation}});const b=et(i)&&(((m=o==null?void 0:o.interpolation)==null?void 0:m.skipOnVariables)!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let v;if(b){const N=i.match(this.interpolator.nestingRegexp);v=N&&N.length}let A=o.replace&&!et(o.replace)?o.replace:o;if(this.options.interpolation.defaultVariables&&(A={...this.options.interpolation.defaultVariables,...A}),i=this.interpolator.interpolate(i,A,o.lng||this.language||c.usedLng,o),b){const N=i.match(this.interpolator.nestingRegexp),O=N&&N.length;v<O&&(o.nest=!1)}!o.lng&&c&&c.res&&(o.lng=this.language||c.usedLng),o.nest!==!1&&(i=this.interpolator.nest(i,(...N)=>(f==null?void 0:f[0])===N[0]&&!o.context?(this.logger.warn(`It seems you are nesting recursively key: ${N[0]} in key: ${s[0]}`),null):this.translate(...N,s),o)),o.interpolation&&this.interpolator.reset()}const h=o.postProcess||this.options.postProcess,g=et(h)?[h]:h;return i!=null&&(g!=null&&g.length)&&o.applyPostProcessor!==!1&&(i=bg.handle(g,i,s,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...c,usedParams:this.getUsedParamsDetails(o)},...o}:o,this)),i}resolve(i,s={}){let o,c,f,h,g;return et(i)&&(i=[i]),Array.isArray(i)&&(i=i.map(y=>typeof y=="function"?Pn(y,{...this.options,...s}):y)),i.forEach(y=>{if(this.isValidLookup(o))return;const m=this.extractFromKey(y,s),b=m.key;c=b;let v=m.namespaces;this.options.fallbackNS&&(v=v.concat(this.options.fallbackNS));const A=s.count!==void 0&&!et(s.count),N=A&&!s.ordinal&&s.count===0,O=s.context!==void 0&&(et(s.context)||typeof s.context=="number")&&s.context!=="",H=s.lngs?s.lngs:this.languageUtils.toResolveHierarchy(s.lng||this.language,s.fallbackLng);v.forEach(Y=>{var q,V;this.isValidLookup(o)||(g=Y,!_m[`${H[0]}-${Y}`]&&((q=this.utils)!=null&&q.hasLoadedNamespace)&&!((V=this.utils)!=null&&V.hasLoadedNamespace(g))&&(_m[`${H[0]}-${Y}`]=!0,this.logger.warn(`key "${c}" for languages "${H.join(", ")}" won't get resolved as namespace "${g}" 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!!!")),H.forEach(X=>{var st;if(this.isValidLookup(o))return;h=X;const $=[b];if((st=this.i18nFormat)!=null&&st.addLookupKeys)this.i18nFormat.addLookupKeys($,b,X,Y,s);else{let J;A&&(J=this.pluralResolver.getSuffix(X,s.count,s));const nt=`${this.options.pluralSeparator}zero`,rt=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(A&&(s.ordinal&&J.indexOf(rt)===0&&$.push(b+J.replace(rt,this.options.pluralSeparator)),$.push(b+J),N&&$.push(b+nt)),O){const dt=`${b}${this.options.contextSeparator||"_"}${s.context}`;$.push(dt),A&&(s.ordinal&&J.indexOf(rt)===0&&$.push(dt+J.replace(rt,this.options.pluralSeparator)),$.push(dt+J),N&&$.push(dt+nt))}}let tt;for(;tt=$.pop();)this.isValidLookup(o)||(f=tt,o=this.getResource(X,Y,tt,s))}))})}),{res:o,usedKey:c,exactUsedKey:f,usedLng:h,usedNS:g}}isValidLookup(i){return i!==void 0&&!(!this.options.returnNull&&i===null)&&!(!this.options.returnEmptyString&&i==="")}getResource(i,s,o,c={}){var f;return(f=this.i18nFormat)!=null&&f.getResource?this.i18nFormat.getResource(i,s,o,c):this.resourceStore.getResource(i,s,o,c)}getUsedParamsDetails(i={}){const s=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],o=i.replace&&!et(i.replace);let c=o?i.replace:i;if(o&&typeof i.count<"u"&&(c.count=i.count),this.options.interpolation.defaultVariables&&(c={...this.options.interpolation.defaultVariables,...c}),!o){c={...c};for(const f of s)delete c[f]}return c}static hasDefaultValue(i){const s="defaultValue";for(const o in i)if(Object.prototype.hasOwnProperty.call(i,o)&&s===o.substring(0,s.length)&&i[o]!==void 0)return!0;return!1}}class Cm{constructor(i){this.options=i,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Je.create("languageUtils")}getScriptPartFromCode(i){if(i=li(i),!i||i.indexOf("-")<0)return null;const s=i.split("-");return s.length===2||(s.pop(),s[s.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(s.join("-"))}getLanguagePartFromCode(i){if(i=li(i),!i||i.indexOf("-")<0)return i;const s=i.split("-");return this.formatLanguageCode(s[0])}formatLanguageCode(i){if(et(i)&&i.indexOf("-")>-1){let s;try{s=Intl.getCanonicalLocales(i)[0]}catch{}return s&&this.options.lowerCaseLng&&(s=s.toLowerCase()),s||(this.options.lowerCaseLng?i.toLowerCase():i)}return this.options.cleanCode||this.options.lowerCaseLng?i.toLowerCase():i}isSupportedCode(i){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(i=this.getLanguagePartFromCode(i)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(i)>-1}getBestMatchFromCodes(i){if(!i)return null;let s;return i.forEach(o=>{if(s)return;const c=this.formatLanguageCode(o);(!this.options.supportedLngs||this.isSupportedCode(c))&&(s=c)}),!s&&this.options.supportedLngs&&i.forEach(o=>{if(s)return;const c=this.getScriptPartFromCode(o);if(this.isSupportedCode(c))return s=c;const f=this.getLanguagePartFromCode(o);if(this.isSupportedCode(f))return s=f;s=this.options.supportedLngs.find(h=>{if(h===f)return h;if(!(h.indexOf("-")<0&&f.indexOf("-")<0)&&(h.indexOf("-")>0&&f.indexOf("-")<0&&h.substring(0,h.indexOf("-"))===f||h.indexOf(f)===0&&f.length>1))return h})}),s||(s=this.getFallbackCodes(this.options.fallbackLng)[0]),s}getFallbackCodes(i,s){if(!i)return[];if(typeof i=="function"&&(i=i(s)),et(i)&&(i=[i]),Array.isArray(i))return i;if(!s)return i.default||[];let o=i[s];return o||(o=i[this.getScriptPartFromCode(s)]),o||(o=i[this.formatLanguageCode(s)]),o||(o=i[this.getLanguagePartFromCode(s)]),o||(o=i.default),o||[]}toResolveHierarchy(i,s){const o=this.getFallbackCodes((s===!1?[]:s)||this.options.fallbackLng||[],i),c=[],f=h=>{h&&(this.isSupportedCode(h)?c.push(h):this.logger.warn(`rejecting language code not found in supportedLngs: ${h}`))};return et(i)&&(i.indexOf("-")>-1||i.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&f(this.formatLanguageCode(i)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&f(this.getScriptPartFromCode(i)),this.options.load!=="currentOnly"&&f(this.getLanguagePartFromCode(i))):et(i)&&f(this.formatLanguageCode(i)),o.forEach(h=>{c.indexOf(h)<0&&f(this.formatLanguageCode(h))}),c}}const zm={zero:0,one:1,two:2,few:3,many:4,other:5},Nm={select:l=>l===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class Ob{constructor(i,s={}){this.languageUtils=i,this.options=s,this.logger=Je.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(i,s={}){const o=li(i==="dev"?"en":i),c=s.ordinal?"ordinal":"cardinal",f=JSON.stringify({cleanedCode:o,type:c});if(f in this.pluralRulesCache)return this.pluralRulesCache[f];let h;try{h=new Intl.PluralRules(o,{type:c})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl polyfill!"),Nm;if(!i.match(/-|_/))return Nm;const y=this.languageUtils.getLanguagePartFromCode(i);h=this.getRule(y,s)}return this.pluralRulesCache[f]=h,h}needsPlural(i,s={}){let o=this.getRule(i,s);return o||(o=this.getRule("dev",s)),(o==null?void 0:o.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(i,s,o={}){return this.getSuffixes(i,o).map(c=>`${s}${c}`)}getSuffixes(i,s={}){let o=this.getRule(i,s);return o||(o=this.getRule("dev",s)),o?o.resolvedOptions().pluralCategories.sort((c,f)=>zm[c]-zm[f]).map(c=>`${this.options.prepend}${s.ordinal?`ordinal${this.options.prepend}`:""}${c}`):[]}getSuffix(i,s,o={}){const c=this.getRule(i,o);return c?`${this.options.prepend}${o.ordinal?`ordinal${this.options.prepend}`:""}${c.select(s)}`:(this.logger.warn(`no plural rule found for: ${i}`),this.getSuffix("dev",s,o))}}const Mm=(l,i,s,o=".",c=!0)=>{let f=yb(l,i,s);return!f&&c&&et(s)&&(f=zo(l,s,o),f===void 0&&(f=zo(i,s,o))),f},bo=l=>l.replace(/\$/g,"$$$$");class Dm{constructor(i={}){var s;this.logger=Je.create("interpolator"),this.options=i,this.format=((s=i==null?void 0:i.interpolation)==null?void 0:s.format)||(o=>o),this.init(i)}init(i={}){i.interpolation||(i.interpolation={escapeValue:!0});const{escape:s,escapeValue:o,useRawValueToEscape:c,prefix:f,prefixEscaped:h,suffix:g,suffixEscaped:y,formatSeparator:m,unescapeSuffix:b,unescapePrefix:v,nestingPrefix:A,nestingPrefixEscaped:N,nestingSuffix:O,nestingSuffixEscaped:H,nestingOptionsSeparator:Y,maxReplaces:q,alwaysFormat:V}=i.interpolation;this.escape=s!==void 0?s:bb,this.escapeValue=o!==void 0?o:!0,this.useRawValueToEscape=c!==void 0?c:!1,this.prefix=f?on(f):h||"{{",this.suffix=g?on(g):y||"}}",this.formatSeparator=m||",",this.unescapePrefix=b?"":v||"-",this.unescapeSuffix=this.unescapePrefix?"":b||"",this.nestingPrefix=A?on(A):N||on("$t("),this.nestingSuffix=O?on(O):H||on(")"),this.nestingOptionsSeparator=Y||",",this.maxReplaces=q||1e3,this.alwaysFormat=V!==void 0?V:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const i=(s,o)=>(s==null?void 0:s.source)===o?(s.lastIndex=0,s):new RegExp(o,"g");this.regexp=i(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=i(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=i(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(i,s,o,c){var N;let f,h,g;const y=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},m=O=>{if(O.indexOf(this.formatSeparator)<0){const V=Mm(s,y,O,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(V,void 0,o,{...c,...s,interpolationkey:O}):V}const H=O.split(this.formatSeparator),Y=H.shift().trim(),q=H.join(this.formatSeparator).trim();return this.format(Mm(s,y,Y,this.options.keySeparator,this.options.ignoreJSONStructure),q,o,{...c,...s,interpolationkey:Y})};this.resetRegExp();const b=(c==null?void 0:c.missingInterpolationHandler)||this.options.missingInterpolationHandler,v=((N=c==null?void 0:c.interpolation)==null?void 0:N.skipOnVariables)!==void 0?c.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:O=>bo(O)},{regex:this.regexp,safeValue:O=>this.escapeValue?bo(this.escape(O)):bo(O)}].forEach(O=>{for(g=0;f=O.regex.exec(i);){const H=f[1].trim();if(h=m(H),h===void 0)if(typeof b=="function"){const q=b(i,f,c);h=et(q)?q:""}else if(c&&Object.prototype.hasOwnProperty.call(c,H))h="";else if(v){h=f[0];continue}else this.logger.warn(`missed to pass in variable ${H} for interpolating ${i}`),h="";else!et(h)&&!this.useRawValueToEscape&&(h=Em(h));const Y=O.safeValue(h);if(i=i.replace(f[0],Y),v?(O.regex.lastIndex+=h.length,O.regex.lastIndex-=f[0].length):O.regex.lastIndex=0,g++,g>=this.maxReplaces)break}}),i}nest(i,s,o={}){let c,f,h;const g=(y,m)=>{const b=this.nestingOptionsSeparator;if(y.indexOf(b)<0)return y;const v=y.split(new RegExp(`${on(b)}[ ]*{`));let A=`{${v[1]}`;y=v[0],A=this.interpolate(A,h);const N=A.match(/'/g),O=A.match(/"/g);(((N==null?void 0:N.length)??0)%2===0&&!O||((O==null?void 0:O.length)??0)%2!==0)&&(A=A.replace(/'/g,'"'));try{h=JSON.parse(A),m&&(h={...m,...h})}catch(H){return this.logger.warn(`failed parsing options string in nesting for key ${y}`,H),`${y}${b}${A}`}return h.defaultValue&&h.defaultValue.indexOf(this.prefix)>-1&&delete h.defaultValue,y};for(;c=this.nestingRegexp.exec(i);){let y=[];h={...o},h=h.replace&&!et(h.replace)?h.replace:h,h.applyPostProcessor=!1,delete h.defaultValue;const m=/{.*}/.test(c[1])?c[1].lastIndexOf("}")+1:c[1].indexOf(this.formatSeparator);if(m!==-1&&(y=c[1].slice(m).split(this.formatSeparator).map(b=>b.trim()).filter(Boolean),c[1]=c[1].slice(0,m)),f=s(g.call(this,c[1].trim(),h),h),f&&c[0]===i&&!et(f))return f;et(f)||(f=Em(f)),f||(this.logger.warn(`missed to resolve ${c[1]} for nesting ${i}`),f=""),y.length&&(f=y.reduce((b,v)=>this.format(b,v,o.lng,{...o,interpolationkey:c[1].trim()}),f.trim())),i=i.replace(c[0],f),this.regexp.lastIndex=0}return i}}const _b=l=>{let i=l.toLowerCase().trim();const s={};if(l.indexOf("(")>-1){const o=l.split("(");i=o[0].toLowerCase().trim();const c=o[1].substring(0,o[1].length-1);i==="currency"&&c.indexOf(":")<0?s.currency||(s.currency=c.trim()):i==="relativetime"&&c.indexOf(":")<0?s.range||(s.range=c.trim()):c.split(";").forEach(h=>{if(h){const[g,...y]=h.split(":"),m=y.join(":").trim().replace(/^'+|'+$/g,""),b=g.trim();s[b]||(s[b]=m),m==="false"&&(s[b]=!1),m==="true"&&(s[b]=!0),isNaN(m)||(s[b]=parseInt(m,10))}})}return{formatName:i,formatOptions:s}},Lm=l=>{const i={};return(s,o,c)=>{let f=c;c&&c.interpolationkey&&c.formatParams&&c.formatParams[c.interpolationkey]&&c[c.interpolationkey]&&(f={...f,[c.interpolationkey]:void 0});const h=o+JSON.stringify(f);let g=i[h];return g||(g=l(li(o),c),i[h]=g),g(s)}},Cb=l=>(i,s,o)=>l(li(s),o)(i);class zb{constructor(i={}){this.logger=Je.create("formatter"),this.options=i,this.init(i)}init(i,s={interpolation:{}}){this.formatSeparator=s.interpolation.formatSeparator||",";const o=s.cacheInBuiltFormats?Lm:Cb;this.formats={number:o((c,f)=>{const h=new Intl.NumberFormat(c,{...f});return g=>h.format(g)}),currency:o((c,f)=>{const h=new Intl.NumberFormat(c,{...f,style:"currency"});return g=>h.format(g)}),datetime:o((c,f)=>{const h=new Intl.DateTimeFormat(c,{...f});return g=>h.format(g)}),relativetime:o((c,f)=>{const h=new Intl.RelativeTimeFormat(c,{...f});return g=>h.format(g,f.range||"day")}),list:o((c,f)=>{const h=new Intl.ListFormat(c,{...f});return g=>h.format(g)})}}add(i,s){this.formats[i.toLowerCase().trim()]=s}addCached(i,s){this.formats[i.toLowerCase().trim()]=Lm(s)}format(i,s,o,c={}){const f=s.split(this.formatSeparator);if(f.length>1&&f[0].indexOf("(")>1&&f[0].indexOf(")")<0&&f.find(g=>g.indexOf(")")>-1)){const g=f.findIndex(y=>y.indexOf(")")>-1);f[0]=[f[0],...f.splice(1,g)].join(this.formatSeparator)}return f.reduce((g,y)=>{var v;const{formatName:m,formatOptions:b}=_b(y);if(this.formats[m]){let A=g;try{const N=((v=c==null?void 0:c.formatParams)==null?void 0:v[c.interpolationkey])||{},O=N.locale||N.lng||c.locale||c.lng||o;A=this.formats[m](g,O,{...b,...c,...N})}catch(N){this.logger.warn(N)}return A}else this.logger.warn(`there was no format function for ${m}`);return g},i)}}const Nb=(l,i)=>{l.pending[i]!==void 0&&(delete l.pending[i],l.pendingCount--)};class Mb extends Vu{constructor(i,s,o,c={}){var f,h;super(),this.backend=i,this.store=s,this.services=o,this.languageUtils=o.languageUtils,this.options=c,this.logger=Je.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=c.maxParallelReads||10,this.readingCalls=0,this.maxRetries=c.maxRetries>=0?c.maxRetries:5,this.retryTimeout=c.retryTimeout>=1?c.retryTimeout:350,this.state={},this.queue=[],(h=(f=this.backend)==null?void 0:f.init)==null||h.call(f,o,c.backend,c)}queueLoad(i,s,o,c){const f={},h={},g={},y={};return i.forEach(m=>{let b=!0;s.forEach(v=>{const A=`${m}|${v}`;!o.reload&&this.store.hasResourceBundle(m,v)?this.state[A]=2:this.state[A]<0||(this.state[A]===1?h[A]===void 0&&(h[A]=!0):(this.state[A]=1,b=!1,h[A]===void 0&&(h[A]=!0),f[A]===void 0&&(f[A]=!0),y[v]===void 0&&(y[v]=!0)))}),b||(g[m]=!0)}),(Object.keys(f).length||Object.keys(h).length)&&this.queue.push({pending:h,pendingCount:Object.keys(h).length,loaded:{},errors:[],callback:c}),{toLoad:Object.keys(f),pending:Object.keys(h),toLoadLanguages:Object.keys(g),toLoadNamespaces:Object.keys(y)}}loaded(i,s,o){const c=i.split("|"),f=c[0],h=c[1];s&&this.emit("failedLoading",f,h,s),!s&&o&&this.store.addResourceBundle(f,h,o,void 0,void 0,{skipCopy:!0}),this.state[i]=s?-1:2,s&&o&&(this.state[i]=0);const g={};this.queue.forEach(y=>{pb(y.loaded,[f],h),Nb(y,i),s&&y.errors.push(s),y.pendingCount===0&&!y.done&&(Object.keys(y.loaded).forEach(m=>{g[m]||(g[m]={});const b=y.loaded[m];b.length&&b.forEach(v=>{g[m][v]===void 0&&(g[m][v]=!0)})}),y.done=!0,y.errors.length?y.callback(y.errors):y.callback())}),this.emit("loaded",g),this.queue=this.queue.filter(y=>!y.done)}read(i,s,o,c=0,f=this.retryTimeout,h){if(!i.length)return h(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:i,ns:s,fcName:o,tried:c,wait:f,callback:h});return}this.readingCalls++;const g=(m,b)=>{if(this.readingCalls--,this.waitingReads.length>0){const v=this.waitingReads.shift();this.read(v.lng,v.ns,v.fcName,v.tried,v.wait,v.callback)}if(m&&b&&c<this.maxRetries){setTimeout(()=>{this.read.call(this,i,s,o,c+1,f*2,h)},f);return}h(m,b)},y=this.backend[o].bind(this.backend);if(y.length===2){try{const m=y(i,s);m&&typeof m.then=="function"?m.then(b=>g(null,b)).catch(g):g(null,m)}catch(m){g(m)}return}return y(i,s,g)}prepareLoading(i,s,o={},c){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),c&&c();et(i)&&(i=this.languageUtils.toResolveHierarchy(i)),et(s)&&(s=[s]);const f=this.queueLoad(i,s,o,c);if(!f.toLoad.length)return f.pending.length||c(),null;f.toLoad.forEach(h=>{this.loadOne(h)})}load(i,s,o){this.prepareLoading(i,s,{},o)}reload(i,s,o){this.prepareLoading(i,s,{reload:!0},o)}loadOne(i,s=""){const o=i.split("|"),c=o[0],f=o[1];this.read(c,f,"read",void 0,void 0,(h,g)=>{h&&this.logger.warn(`${s}loading namespace ${f} for language ${c} failed`,h),!h&&g&&this.logger.log(`${s}loaded namespace ${f} for language ${c}`,g),this.loaded(i,h,g)})}saveMissing(i,s,o,c,f,h={},g=()=>{}){var y,m,b,v,A;if((m=(y=this.services)==null?void 0:y.utils)!=null&&m.hasLoadedNamespace&&!((v=(b=this.services)==null?void 0:b.utils)!=null&&v.hasLoadedNamespace(s))){this.logger.warn(`did not save key "${o}" as the namespace "${s}" 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(!(o==null||o==="")){if((A=this.backend)!=null&&A.create){const N={...h,isUpdate:f},O=this.backend.create.bind(this.backend);if(O.length<6)try{let H;O.length===5?H=O(i,s,o,c,N):H=O(i,s,o,c),H&&typeof H.then=="function"?H.then(Y=>g(null,Y)).catch(g):g(null,H)}catch(H){g(H)}else O(i,s,o,c,g,N)}!i||!i[0]||this.store.addResource(i[0],s,o,c)}}}const So=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",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:l=>{let i={};if(typeof l[1]=="object"&&(i=l[1]),et(l[1])&&(i.defaultValue=l[1]),et(l[2])&&(i.tDescription=l[2]),typeof l[2]=="object"||typeof l[3]=="object"){const s=l[3]||l[2];Object.keys(s).forEach(o=>{i[o]=s[o]})}return i},interpolation:{escapeValue:!0,format:l=>l,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),jm=l=>{var i,s;return et(l.ns)&&(l.ns=[l.ns]),et(l.fallbackLng)&&(l.fallbackLng=[l.fallbackLng]),et(l.fallbackNS)&&(l.fallbackNS=[l.fallbackNS]),((s=(i=l.supportedLngs)==null?void 0:i.indexOf)==null?void 0:s.call(i,"cimode"))<0&&(l.supportedLngs=l.supportedLngs.concat(["cimode"])),typeof l.initImmediate=="boolean"&&(l.initAsync=l.initImmediate),l},_u=()=>{},Db=l=>{Object.getOwnPropertyNames(Object.getPrototypeOf(l)).forEach(s=>{typeof l[s]=="function"&&(l[s]=l[s].bind(l))})},xg="__i18next_supportNoticeShown",Lb=()=>!!(typeof globalThis<"u"&&globalThis[xg]||typeof process<"u"&&yo&&yo.I18NEXT_NO_SUPPORT_NOTICE||typeof process<"u"&&yo),jb=()=>{typeof globalThis<"u"&&(globalThis[xg]=!0)},wb=l=>{var i,s,o,c,f,h,g,y,m,b,v,A,N;return!!(((o=(s=(i=l==null?void 0:l.modules)==null?void 0:i.backend)==null?void 0:s.name)==null?void 0:o.indexOf("Locize"))>0||((g=(h=(f=(c=l==null?void 0:l.modules)==null?void 0:c.backend)==null?void 0:f.constructor)==null?void 0:h.name)==null?void 0:g.indexOf("Locize"))>0||(m=(y=l==null?void 0:l.options)==null?void 0:y.backend)!=null&&m.backends&&l.options.backend.backends.some(O=>{var H,Y,q;return((H=O==null?void 0:O.name)==null?void 0:H.indexOf("Locize"))>0||((q=(Y=O==null?void 0:O.constructor)==null?void 0:Y.name)==null?void 0:q.indexOf("Locize"))>0})||(v=(b=l==null?void 0:l.options)==null?void 0:b.backend)!=null&&v.projectId||(N=(A=l==null?void 0:l.options)==null?void 0:A.backend)!=null&&N.backendOptions&&l.options.backend.backendOptions.some(O=>O==null?void 0:O.projectId))};class ei extends Vu{constructor(i={},s){if(super(),this.options=jm(i),this.services={},this.logger=Je,this.modules={external:[]},Db(this),s&&!this.isInitialized&&!i.isClone){if(!this.options.initAsync)return this.init(i,s),this;setTimeout(()=>{this.init(i,s)},0)}}init(i={},s){this.isInitializing=!0,typeof i=="function"&&(s=i,i={}),i.defaultNS==null&&i.ns&&(et(i.ns)?i.defaultNS=i.ns:i.ns.indexOf("translation")<0&&(i.defaultNS=i.ns[0]));const o=So();this.options={...o,...this.options,...jm(i)},this.options.interpolation={...o.interpolation,...this.options.interpolation},i.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=i.keySeparator),i.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=i.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=o.overloadTranslationOptionHandler),this.options.showSupportNotice!==!1&&!wb(this)&&!Lb()&&(typeof console<"u"&&typeof console.info<"u"&&console.info("🌐 i18next is made possible by our own product, Locize — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙"),jb());const c=m=>m?typeof m=="function"?new m:m:null;if(!this.options.isClone){this.modules.logger?Je.init(c(this.modules.logger),this.options):Je.init(null,this.options);let m;this.modules.formatter?m=this.modules.formatter:m=zb;const b=new Cm(this.options);this.store=new Om(this.options.resources,this.options);const v=this.services;v.logger=Je,v.resourceStore=this.store,v.languageUtils=b,v.pluralResolver=new Ob(b,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==o.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),m&&(!this.options.interpolation.format||this.options.interpolation.format===o.interpolation.format)&&(v.formatter=c(m),v.formatter.init&&v.formatter.init(v,this.options),this.options.interpolation.format=v.formatter.format.bind(v.formatter)),v.interpolator=new Dm(this.options),v.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},v.backendConnector=new Mb(c(this.modules.backend),v.resourceStore,v,this.options),v.backendConnector.on("*",(N,...O)=>{this.emit(N,...O)}),this.modules.languageDetector&&(v.languageDetector=c(this.modules.languageDetector),v.languageDetector.init&&v.languageDetector.init(v,this.options.detection,this.options)),this.modules.i18nFormat&&(v.i18nFormat=c(this.modules.i18nFormat),v.i18nFormat.init&&v.i18nFormat.init(this)),this.translator=new Uu(this.services,this.options),this.translator.on("*",(N,...O)=>{this.emit(N,...O)}),this.modules.external.forEach(N=>{N.init&&N.init(this)})}if(this.format=this.options.interpolation.format,s||(s=_u),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const m=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);m.length>0&&m[0]!=="dev"&&(this.options.lng=m[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(m=>{this[m]=(...b)=>this.store[m](...b)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(m=>{this[m]=(...b)=>(this.store[m](...b),this)});const g=Il(),y=()=>{const m=(b,v)=>{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),g.resolve(v),s(b,v)};if(this.languages&&!this.isInitialized)return m(null,this.t.bind(this));this.changeLanguage(this.options.lng,m)};return this.options.resources||!this.options.initAsync?y():setTimeout(y,0),g}loadResources(i,s=_u){var f,h;let o=s;const c=et(i)?i:this.language;if(typeof i=="function"&&(o=i),!this.options.resources||this.options.partialBundledLanguages){if((c==null?void 0:c.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return o();const g=[],y=m=>{if(!m||m==="cimode")return;this.services.languageUtils.toResolveHierarchy(m).forEach(v=>{v!=="cimode"&&g.indexOf(v)<0&&g.push(v)})};c?y(c):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(b=>y(b)),(h=(f=this.options.preload)==null?void 0:f.forEach)==null||h.call(f,m=>y(m)),this.services.backendConnector.load(g,this.options.ns,m=>{!m&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),o(m)})}else o(null)}reloadResources(i,s,o){const c=Il();return typeof i=="function"&&(o=i,i=void 0),typeof s=="function"&&(o=s,s=void 0),i||(i=this.languages),s||(s=this.options.ns),o||(o=_u),this.services.backendConnector.reload(i,s,f=>{c.resolve(),o(f)}),c}use(i){if(!i)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!i.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return i.type==="backend"&&(this.modules.backend=i),(i.type==="logger"||i.log&&i.warn&&i.error)&&(this.modules.logger=i),i.type==="languageDetector"&&(this.modules.languageDetector=i),i.type==="i18nFormat"&&(this.modules.i18nFormat=i),i.type==="postProcessor"&&bg.addPostProcessor(i),i.type==="formatter"&&(this.modules.formatter=i),i.type==="3rdParty"&&this.modules.external.push(i),this}setResolvedLanguage(i){if(!(!i||!this.languages)&&!(["cimode","dev"].indexOf(i)>-1)){for(let s=0;s<this.languages.length;s++){const o=this.languages[s];if(!(["cimode","dev"].indexOf(o)>-1)&&this.store.hasLanguageSomeTranslations(o)){this.resolvedLanguage=o;break}}!this.resolvedLanguage&&this.languages.indexOf(i)<0&&this.store.hasLanguageSomeTranslations(i)&&(this.resolvedLanguage=i,this.languages.unshift(i))}}changeLanguage(i,s){this.isLanguageChangingTo=i;const o=Il();this.emit("languageChanging",i);const c=g=>{this.language=g,this.languages=this.services.languageUtils.toResolveHierarchy(g),this.resolvedLanguage=void 0,this.setResolvedLanguage(g)},f=(g,y)=>{y?this.isLanguageChangingTo===i&&(c(y),this.translator.changeLanguage(y),this.isLanguageChangingTo=void 0,this.emit("languageChanged",y),this.logger.log("languageChanged",y)):this.isLanguageChangingTo=void 0,o.resolve((...m)=>this.t(...m)),s&&s(g,(...m)=>this.t(...m))},h=g=>{var b,v;!i&&!g&&this.services.languageDetector&&(g=[]);const y=et(g)?g:g&&g[0],m=this.store.hasLanguageSomeTranslations(y)?y:this.services.languageUtils.getBestMatchFromCodes(et(g)?[g]:g);m&&(this.language||c(m),this.translator.language||this.translator.changeLanguage(m),(v=(b=this.services.languageDetector)==null?void 0:b.cacheUserLanguage)==null||v.call(b,m)),this.loadResources(m,A=>{f(A,m)})};return!i&&this.services.languageDetector&&!this.services.languageDetector.async?h(this.services.languageDetector.detect()):!i&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(h):this.services.languageDetector.detect(h):h(i),o}getFixedT(i,s,o){const c=(f,h,...g)=>{let y;typeof h!="object"?y=this.options.overloadTranslationOptionHandler([f,h].concat(g)):y={...h},y.lng=y.lng||c.lng,y.lngs=y.lngs||c.lngs,y.ns=y.ns||c.ns,y.keyPrefix!==""&&(y.keyPrefix=y.keyPrefix||o||c.keyPrefix);const m={...this.options,...y};typeof y.keyPrefix=="function"&&(y.keyPrefix=Pn(y.keyPrefix,m));const b=this.options.keySeparator||".";let v;return y.keyPrefix&&Array.isArray(f)?v=f.map(A=>(typeof A=="function"&&(A=Pn(A,m)),`${y.keyPrefix}${b}${A}`)):(typeof f=="function"&&(f=Pn(f,m)),v=y.keyPrefix?`${y.keyPrefix}${b}${f}`:f),this.t(v,y)};return et(i)?c.lng=i:c.lngs=i,c.ns=s,c.keyPrefix=o,c}t(...i){var s;return(s=this.translator)==null?void 0:s.translate(...i)}exists(...i){var s;return(s=this.translator)==null?void 0:s.exists(...i)}setDefaultNamespace(i){this.options.defaultNS=i}hasLoadedNamespace(i,s={}){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 o=s.lng||this.resolvedLanguage||this.languages[0],c=this.options?this.options.fallbackLng:!1,f=this.languages[this.languages.length-1];if(o.toLowerCase()==="cimode")return!0;const h=(g,y)=>{const m=this.services.backendConnector.state[`${g}|${y}`];return m===-1||m===0||m===2};if(s.precheck){const g=s.precheck(this,h);if(g!==void 0)return g}return!!(this.hasResourceBundle(o,i)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||h(o,i)&&(!c||h(f,i)))}loadNamespaces(i,s){const o=Il();return this.options.ns?(et(i)&&(i=[i]),i.forEach(c=>{this.options.ns.indexOf(c)<0&&this.options.ns.push(c)}),this.loadResources(c=>{o.resolve(),s&&s(c)}),o):(s&&s(),Promise.resolve())}loadLanguages(i,s){const o=Il();et(i)&&(i=[i]);const c=this.options.preload||[],f=i.filter(h=>c.indexOf(h)<0&&this.services.languageUtils.isSupportedCode(h));return f.length?(this.options.preload=c.concat(f),this.loadResources(h=>{o.resolve(),s&&s(h)}),o):(s&&s(),Promise.resolve())}dir(i){var c,f;if(i||(i=this.resolvedLanguage||(((c=this.languages)==null?void 0:c.length)>0?this.languages[0]:this.language)),!i)return"rtl";try{const h=new Intl.Locale(i);if(h&&h.getTextInfo){const g=h.getTextInfo();if(g&&g.direction)return g.direction}}catch{}const s=["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"],o=((f=this.services)==null?void 0:f.languageUtils)||new Cm(So());return i.toLowerCase().indexOf("-latn")>1?"ltr":s.indexOf(o.getLanguagePartFromCode(i))>-1||i.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(i={},s){const o=new ei(i,s);return o.createInstance=ei.createInstance,o}cloneInstance(i={},s=_u){const o=i.forkResourceStore;o&&delete i.forkResourceStore;const c={...this.options,...i,isClone:!0},f=new ei(c);if((i.debug!==void 0||i.prefix!==void 0)&&(f.logger=f.logger.clone(i)),["store","services","language"].forEach(g=>{f[g]=this[g]}),f.services={...this.services},f.services.utils={hasLoadedNamespace:f.hasLoadedNamespace.bind(f)},o){const g=Object.keys(this.store.data).reduce((y,m)=>(y[m]={...this.store.data[m]},y[m]=Object.keys(y[m]).reduce((b,v)=>(b[v]={...y[m][v]},b),y[m]),y),{});f.store=new Om(g,c),f.services.resourceStore=f.store}if(i.interpolation){const y={...So().interpolation,...this.options.interpolation,...i.interpolation},m={...c,interpolation:y};f.services.interpolator=new Dm(m)}return f.translator=new Uu(f.services,c),f.translator.on("*",(g,...y)=>{f.emit(g,...y)}),f.init(c,s),f.translator.options=c,f.translator.backendConnector.services.utils={hasLoadedNamespace:f.hasLoadedNamespace.bind(f)},f}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Jt=ei.createInstance();Jt.createInstance;Jt.dir;Jt.init;Jt.loadResources;Jt.reloadResources;Jt.use;Jt.changeLanguage;Jt.getFixedT;Jt.t;Jt.exists;Jt.setDefaultNamespace;Jt.hasLoadedNamespace;Jt.loadNamespaces;Jt.loadLanguages;const ai="en",Eg={en:()=>Ae(()=>import("./en-Bnr4nMzg.js"),[],import.meta.url),zh:()=>Ae(()=>import("./zh-MSddxMDX.js"),[],import.meta.url),"zh-TW":()=>Ae(()=>import("./zh-TW-C_LNWX0o.js"),[],import.meta.url),ja:()=>Ae(()=>import("./ja-CDWPWqEW.js"),[],import.meta.url),es:()=>Ae(()=>import("./es-B1GIFh3i.js"),[],import.meta.url)},Mu={};function wm(l){return l in Eg}function Tg(l){if(wm(l))return l;const i=l.split("-")[0];return wm(i)?i:ai}function Ub(){const l=localStorage.getItem("cc_lang");return Tg(l||navigator.language||ai)}async function No(l){if(Mu[l])return;const i=await Eg[l]();Mu[l]=i.default,Jt.isInitialized&&Jt.addResourceBundle(l,"translation",Mu[l],!0,!0)}async function Hb(){const l=Ub();await Promise.all([No(ai),l===ai?Promise.resolve():No(l)]),Jt.isInitialized||await Jt.use(B1).init({lng:l,fallbackLng:ai,resources:Object.fromEntries(Object.entries(Mu).map(([i,s])=>[i,{translation:s}])),interpolation:{escapeValue:!1}})}async function Bb(l){const i=Tg(l);await No(i),await Jt.changeLanguage(i),localStorage.setItem("cc_lang",i)}const Um=[{code:"en",label:"English"},{code:"zh",label:"中文"},{code:"zh-TW",label:"繁體中文"},{code:"ja",label:"日本語"},{code:"es",label:"Español"}],kb=[{label:"Core",ids:["dashboard","chat","workspace","projects","sessions"]},{label:"Knowledge",ids:["knowledge","automations"]},{label:"System",ids:["system"]}];function Yb(){var q;const{pathname:l}=Ce(),{t:i,i18n:s}=G1(),{theme:o,setTheme:c}=yg(),f=Ko(),[h,g]=T.useState(!1),[y,m]=T.useState(!1),b=V=>{Bb(V),m(!1)},v={light:wy,dark:Ny,system:Cy},A={light:"dark",dark:"system",system:"light"},N=v[o],O=qu.listNavItems().filter(V=>{var X;return((X=V.visible)==null?void 0:X.call(V,{features:f}))??!0}),H=O.map(V=>{var tt;const X=V.icon,$=((tt=V.resolveLabelKey)==null?void 0:tt.call(V,{features:f}))||V.labelKey;return{...V,Icon:X,labelKey:$}}),Y=l.startsWith("/chat");return j.jsxs(j.Fragment,{children:[j.jsxs("aside",{className:ne("relative hidden h-[100dvh] flex-col overflow-hidden border-r transition-all duration-300 ease-out md:flex","border-white/55 bg-white/24 shadow-[inset_-1px_0_0_rgba(255,255,255,0.36)] backdrop-blur-[34px] supports-[backdrop-filter]:bg-white/18","dark:border-white/[0.10] dark:bg-[#1c1c1e]/34 dark:shadow-[inset_-1px_0_0_rgba(255,255,255,0.08)] dark:supports-[backdrop-filter]:bg-[#1c1c1e]/26",h?"w-16":"w-56"),children:[j.jsx("div",{className:"pointer-events-none absolute inset-0 bg-[linear-gradient(180deg,rgba(255,255,255,0.55),rgba(255,255,255,0.18)_48%,rgba(255,255,255,0.08))] dark:bg-[linear-gradient(180deg,rgba(255,255,255,0.08),rgba(255,255,255,0.025)_52%,rgba(255,255,255,0.015))]","aria-hidden":"true"}),j.jsx("div",{className:ne("relative flex h-[5.25rem] items-center gap-3 px-4 pt-7 transition-colors"),children:j.jsx(hb,{showWordmark:!h})}),j.jsx("nav",{className:"relative flex-1 py-3 space-y-4 px-2 overflow-y-auto",children:kb.map(V=>{const X=O.filter($=>V.ids.includes($.id));return X.length===0?null:j.jsxs("div",{className:"space-y-1",children:[!h&&j.jsx("p",{className:"px-3 pb-1 text-[10px] font-semibold uppercase tracking-[0.08em] text-muted-foreground/80",children:V.label}),X.map($=>{var J;const tt=$.icon,st=((J=$.resolveLabelKey)==null?void 0:J.call($,{features:f}))||$.labelKey;return j.jsxs(Ao,{to:$.path,end:$.end,className:({isActive:nt})=>ne("flex items-center gap-3 px-3 py-2 rounded-lg text-sm font-medium transition-colors duration-200","focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",nt?"bg-black/[0.07] text-foreground dark:bg-white/[0.10]":"text-muted-foreground hover:bg-black/[0.05] hover:text-foreground dark:hover:bg-white/[0.07]"),children:[j.jsx(tt,{size:18,className:"shrink-0"}),!h&&j.jsx("span",{children:i(st)})]},$.id)})]},V.label)})}),j.jsxs("div",{className:ne("relative border-t p-2 space-y-1","border-black/10 dark:border-white/[0.08]"),children:[!h&&j.jsxs("div",{className:"px-3 pb-1 pt-0.5 text-[11px] font-medium text-muted-foreground/75",children:["AgentDock v","0.1.62"]}),j.jsxs("div",{className:"relative",children:[j.jsxs("button",{type:"button",onClick:()=>m(!y),className:ne("flex items-center gap-3 w-full px-3 py-2 rounded-lg text-sm transition-colors duration-200","text-muted-foreground hover:bg-black/[0.05] hover:text-foreground dark:hover:bg-white/[0.07]","focus:outline-none focus-visible:ring-2 focus-visible:ring-ring"),children:[j.jsx(vy,{size:18,className:"shrink-0"}),!h&&j.jsx("span",{children:((q=Um.find(V=>V.code===s.language))==null?void 0:q.label)||"English"})]}),y&&j.jsx("div",{className:ne("absolute bottom-full left-0 mb-1 w-48 rounded-xl py-1 z-50 overflow-hidden","border border-black/10 bg-white/90 text-popover-foreground shadow-[0_18px_40px_rgba(0,0,0,0.12)] backdrop-blur-2xl","dark:border-white/[0.08] dark:bg-[#2c2c2e]/90"),children:Um.map(V=>j.jsx("button",{type:"button",onClick:()=>b(V.code),className:ne("w-full text-left px-3 py-2 text-sm transition-colors duration-150",s.language===V.code?"text-primary font-medium bg-primary/10":"text-muted-foreground hover:bg-black/[0.05] hover:text-foreground dark:hover:bg-white/[0.07]"),children:V.label},V.code))})]}),j.jsxs("button",{type:"button",onClick:()=>c(A[o]),className:ne("flex items-center gap-3 w-full px-3 py-2 rounded-lg text-sm transition-colors duration-200","text-muted-foreground hover:bg-black/[0.05] hover:text-foreground dark:hover:bg-white/[0.07]","focus:outline-none focus-visible:ring-2 focus-visible:ring-ring"),children:[j.jsx(N,{size:18,className:"shrink-0"}),!h&&j.jsx("span",{children:i(`theme.${o}`)})]}),j.jsx("button",{type:"button",onClick:()=>g(!h),className:ne("flex items-center justify-center w-full px-3 py-2 rounded-lg transition-colors duration-200","text-muted-foreground hover:bg-black/[0.05] hover:text-foreground dark:hover:bg-white/[0.07]","focus:outline-none focus-visible:ring-2 focus-visible:ring-ring"),children:h?j.jsx(my,{size:18}):j.jsx(dy,{size:18})})]})]}),Y?null:j.jsx("nav",{className:ne("fixed inset-x-0 bottom-0 z-50 border-t px-2 pb-[max(env(safe-area-inset-bottom),0.5rem)] pt-2 md:hidden","border-black/10 bg-white/88 shadow-[0_-12px_32px_rgba(15,23,42,0.10)] backdrop-blur-2xl","dark:border-white/[0.08] dark:bg-[#111113]/88 dark:shadow-[0_-16px_42px_rgba(0,0,0,0.34)]"),"aria-label":"Primary navigation",children:j.jsx("div",{className:"flex items-stretch gap-1 overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:H.map(({id:V,path:X,end:$,Icon:tt,labelKey:st})=>j.jsxs(Ao,{to:X,end:$,className:({isActive:J})=>ne("flex min-w-[4.5rem] flex-1 flex-col items-center justify-center gap-1 rounded-xl px-2 py-2 text-[11px] font-medium transition-colors","focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",J?"bg-primary/10 text-primary":"text-muted-foreground hover:bg-black/[0.05] hover:text-foreground dark:hover:bg-white/[0.07]"),children:[j.jsx(tt,{size:18,className:"shrink-0"}),j.jsx("span",{className:"max-w-[4.25rem] truncate",children:i(st)})]},V))})})]})}function qb(){const{pathname:l}=Ce(),{desktopChat:i}=Ko(),s=l.startsWith("/chat"),o=l.startsWith("/chat")&&i;return j.jsxs("div",{className:ne("flex h-[100dvh] overflow-hidden","bg-background/60 backdrop-blur-2xl"),children:[j.jsx("div",{className:"fixed left-0 right-0 top-0 z-50 hidden h-8 [-webkit-app-region:drag] md:block","aria-hidden":"true"}),j.jsx(Yb,{}),j.jsx("div",{className:"flex-1 flex flex-col overflow-hidden min-w-0 bg-background/45 backdrop-blur-2xl",children:j.jsx("main",{className:ne("flex-1 min-h-0",o?"overflow-hidden":"overflow-y-auto",s?"p-4 pb-4 sm:p-6 sm:pb-6":"p-4 pb-24 sm:p-6 sm:pb-6"),children:j.jsx("div",{className:ne(o&&"h-full min-h-0","mx-auto w-full max-w-7xl"),children:j.jsx(Xv,{})})})})]})}function Vb(){return j.jsx("div",{className:"flex min-h-64 items-center justify-center text-sm text-muted-foreground",children:"正在加载…"})}function Gb(){const l=Ko();return j.jsx(T.Suspense,{fallback:j.jsx(Vb,{}),children:j.jsxs(Zv,{children:[j.jsxs(Wn,{element:j.jsx(qb,{}),children:[qu.listRoutes().map(i=>i.index?j.jsx(Wn,{index:!0,element:i.element({features:l})},i.id):j.jsx(Wn,{path:i.path,element:i.element({features:l})},i.id)),j.jsx(Wn,{path:"*",element:j.jsx(qa,{to:"/",replace:!0})})]}),j.jsx(Wn,{path:"*",element:j.jsx(qa,{to:"/",replace:!0})})]})})}class Kb extends In.Component{constructor(){super(...arguments);Au(this,"state",{hasError:!1,errorMessage:""})}static getDerivedStateFromError(s){return{hasError:!0,errorMessage:s instanceof Error?s.message:String(s)}}componentDidCatch(s,o){console.error("App render failed",s,o)}render(){return this.state.hasError?j.jsx("div",{className:"min-h-screen flex items-center justify-center bg-white dark:bg-gray-950 p-6",children:j.jsxs("div",{className:"max-w-lg w-full rounded-2xl border border-red-200 dark:border-red-900/40 bg-red-50 dark:bg-red-950/20 px-6 py-5",children:[j.jsx("h1",{className:"text-lg font-semibold text-red-700 dark:text-red-300",children:"页面渲染失败"}),j.jsx("p",{className:"mt-2 text-sm text-red-600 dark:text-red-400 break-words",children:this.state.errorMessage||"Unknown renderer error"}),j.jsx("button",{type:"button",onClick:()=>window.location.reload(),className:"mt-4 inline-flex items-center rounded-lg bg-red-600 px-4 py-2 text-sm font-medium text-white hover:bg-red-700",children:"Reload"})]})}):this.props.children}}function Hm(l,i){if(typeof l=="function")return l(i);l!=null&&(l.current=i)}function Rg(...l){return i=>{let s=!1;const o=l.map(c=>{const f=Hm(c,i);return!s&&typeof f=="function"&&(s=!0),f});if(s)return()=>{for(let c=0;c<o.length;c++){const f=o[c];typeof f=="function"?f():Hm(l[c],null)}}}}function VS(...l){return T.useCallback(Rg(...l),l)}var Xb=Symbol.for("react.lazy"),Hu=ly[" use ".trim().toString()];function Qb(l){return typeof l=="object"&&l!==null&&"then"in l}function Ag(l){return l!=null&&typeof l=="object"&&"$$typeof"in l&&l.$$typeof===Xb&&"_payload"in l&&Qb(l._payload)}function Zb(l){const i=$b(l),s=T.forwardRef((o,c)=>{let{children:f,...h}=o;Ag(f)&&typeof Hu=="function"&&(f=Hu(f._payload));const g=T.Children.toArray(f),y=g.find(Wb);if(y){const m=y.props.children,b=g.map(v=>v===y?T.Children.count(m)>1?T.Children.only(null):T.isValidElement(m)?m.props.children:null:v);return j.jsx(i,{...h,ref:c,children:T.isValidElement(m)?T.cloneElement(m,void 0,b):null})}return j.jsx(i,{...h,ref:c,children:f})});return s.displayName=`${l}.Slot`,s}var Jb=Zb("Slot");function $b(l){const i=T.forwardRef((s,o)=>{let{children:c,...f}=s;if(Ag(c)&&typeof Hu=="function"&&(c=Hu(c._payload)),T.isValidElement(c)){const h=Pb(c),g=Ib(f,c.props);return c.type!==T.Fragment&&(g.ref=o?Rg(o,h):h),T.cloneElement(c,g)}return T.Children.count(c)>1?T.Children.only(null):null});return i.displayName=`${l}.SlotClone`,i}var Fb=Symbol("radix.slottable");function Wb(l){return T.isValidElement(l)&&typeof l.type=="function"&&"__radixId"in l.type&&l.type.__radixId===Fb}function Ib(l,i){const s={...i};for(const o in i){const c=l[o],f=i[o];/^on[A-Z]/.test(o)?c&&f?s[o]=(...g)=>{const y=f(...g);return c(...g),y}:c&&(s[o]=c):o==="style"?s[o]={...c,...f}:o==="className"&&(s[o]=[c,f].filter(Boolean).join(" "))}return{...l,...s}}function Pb(l){var o,c;let i=(o=Object.getOwnPropertyDescriptor(l.props,"ref"))==null?void 0:o.get,s=i&&"isReactWarning"in i&&i.isReactWarning;return s?l.ref:(i=(c=Object.getOwnPropertyDescriptor(l,"ref"))==null?void 0:c.get,s=i&&"isReactWarning"in i&&i.isReactWarning,s?l.props.ref:l.props.ref||l.ref)}const tS={default:"bg-primary text-primary-foreground hover:bg-accent-dim",primary:"bg-primary text-primary-foreground hover:bg-accent-dim",secondary:"bg-black/[0.05] text-secondary-foreground hover:bg-black/[0.08] dark:bg-white/[0.08] dark:hover:bg-white/[0.12]",outline:"border border-input bg-background hover:bg-black/[0.04] hover:text-foreground dark:hover:bg-white/[0.06]",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",danger:"bg-destructive text-destructive-foreground hover:bg-destructive/90",ghost:"text-muted-foreground hover:bg-black/[0.05] hover:text-foreground dark:hover:bg-white/[0.07]",link:"text-primary underline-offset-4 hover:underline"},eS={default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",md:"h-9 rounded-md px-4 py-2 text-sm",lg:"h-10 rounded-md px-6 text-sm",icon:"h-9 w-9"};function Bm({variant:l="primary",size:i="md",className:s,children:o,loading:c,asChild:f,disabled:h,type:g="button",...y}){const m=i==="default"?"md":i,b=f?Jb:"button";return j.jsxs(b,{...f?{}:{type:g},className:ne("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors duration-200","cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background","disabled:pointer-events-none disabled:opacity-50",tS[l],eS[m],s),disabled:h||c,...y,children:[c&&j.jsxs("svg",{className:"animate-spin h-4 w-4",viewBox:"0 0 24 24","aria-hidden":!0,children:[j.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),j.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),o]})}const Mo="http://127.0.0.1:9831",aS=`${Mo}/api/local/v1`,nS=["runtime.updated","runtime.detect.started","runtime.detect.completed","runtime.detect.failed","runtime.status.changed","thread.updated","thread.session.activated","message.created","message.updated","run.updated","scheduler.job.updated","scheduler.run.updated","automation.monitor.updated","automation.monitor.run.updated","automation.definition.updated","automation.evaluation.updated","automation.run.updated","automation.script-version.updated","presence.updated","stream.updated"];function Og(l){return(l.trim()||aS).replace(/\/+$/,"")}function bt(l){return typeof l=="object"&&l!==null&&!Array.isArray(l)}function k(l,i){return typeof l[i]=="string"}function Va(l,i){return typeof l[i]=="boolean"}function Pl(l,i){return bt(l[i])}function Xo(l){return bt(l)&&k(l,"type")&&k(l,"channelId")}function lS(l){if(!bt(l))return!1;const i=l.value;return k(l,"metric")&&k(l,"operator")&&(typeof i=="number"||typeof i=="string"||typeof i=="boolean")}function iS(l){return bt(l)&&k(l,"id")&&k(l,"workspaceId")&&k(l,"title")&&Va(l,"live")&&k(l,"updatedAt")&&k(l,"createdAt")&&typeof l.historyCount=="number"&&k(l,"excerpt")}function uS(l){return bt(l)&&k(l,"id")&&k(l,"role")&&k(l,"content")&&k(l,"timestamp")}function rS(l){return bt(l)?(l.id===void 0||typeof l.id=="string")&&(l.role===void 0||["user","assistant","system"].includes(l.role))&&(l.content===void 0||typeof l.content=="string")&&(l.timestamp===void 0||typeof l.timestamp=="string"):!1}function sS(l){return bt(l)&&k(l,"id")&&k(l,"threadId")&&k(l,"status")&&k(l,"startedAt")&&k(l,"updatedAt")}function oS(l){return bt(l)&&k(l,"id")&&k(l,"workspaceId")&&k(l,"platform")&&Xo(l.route)&&k(l,"executionMode")&&k(l,"triggerType")&&k(l,"promptTemplate")&&k(l,"description")&&Va(l,"enabled")&&k(l,"concurrencyPolicy")&&k(l,"createdAt")&&k(l,"updatedAt")}function cS(l){return bt(l)&&k(l,"id")&&k(l,"jobId")&&k(l,"status")&&k(l,"triggeredAt")}function fS(l){return bt(l)&&k(l,"id")&&k(l,"workspaceId")&&k(l,"title")&&k(l,"sourceType")&&Pl(l,"sourceConfig")&&lS(l.condition)&&k(l,"promptTemplate")&&k(l,"platform")&&Xo(l.route)&&k(l,"executionMode")&&Va(l,"enabled")&&typeof l.cooldownMs=="number"&&k(l,"concurrencyPolicy")&&k(l,"createdAt")&&k(l,"updatedAt")}function dS(l){return bt(l)&&k(l,"id")&&k(l,"monitorId")&&k(l,"status")&&k(l,"triggeredAt")}function hS(l){return bt(l)&&k(l,"id")&&k(l,"workspaceId")&&k(l,"title")&&Va(l,"enabled")&&(l.health==="healthy"||l.health==="blocked")&&yS(l.activation)&&vS(l.condition)&&bS(l.action)&&SS(l.delivery)&&xS(l.policies)&&Ya(l.consecutiveEvaluationFailures)&&k(l,"createdAt")&&k(l,"updatedAt")&&(l.health!=="blocked"||k(l,"blockedReason"))&&(l.blockedReason===void 0||typeof l.blockedReason=="string")&&(l.lastSuccessfulMatch===void 0||typeof l.lastSuccessfulMatch=="boolean")&&(l.lastEvaluationAt===void 0||typeof l.lastEvaluationAt=="string")&&(l.lastTriggeredAt===void 0||typeof l.lastTriggeredAt=="string")}function mS(l){return!bt(l)||!k(l,"id")||!k(l,"automationId")||!k(l,"activationKind")||!["cron","once","interval","provider-event"].includes(String(l.activationKind))||!k(l,"status")||!k(l,"startedAt")?!1:l.status==="running"?l.conditionOutcome===void 0&&l.triggerDecision===void 0&&l.finishedAt===void 0&&l.durationMs===void 0&&l.exitCode===void 0&&l.errorCategory===void 0&&l.stdout===void 0&&l.stderr===void 0&&l.resultSummary===void 0&&l.payload===void 0&&l.nextState===void 0&&l.sandboxViolations===void 0&&l.networkAudit===void 0:l.status!=="finished"||!k(l,"finishedAt")?!1:l.conditionOutcome==="matched"?["triggered","not_rising","skipped_cooldown","skipped_action_running"].includes(String(l.triggerDecision)):l.conditionOutcome==="not_matched"?l.triggerDecision==="not_rising":l.conditionOutcome==="error"?l.triggerDecision==="not_evaluated":l.conditionOutcome==="skipped"&&["not_evaluated","skipped_concurrent","skipped_cooldown","skipped_action_running"].includes(String(l.triggerDecision))}function gS(l){return bt(l)&&k(l,"id")&&k(l,"automationId")&&k(l,"evaluationId")&&["queued","running","succeeded","failed","skipped"].includes(String(l.status))&&["same-thread","side-thread"].includes(String(l.executionMode))&&k(l,"createdAt")&&(l.deliveryStatus===void 0||["pending","delivering","delivered","failed"].includes(String(l.deliveryStatus)))&&(l.threadId===void 0||typeof l.threadId=="string")&&(l.acpRunId===void 0||typeof l.acpRunId=="string")&&(l.error===void 0||typeof l.error=="string")}function pS(l){return bt(l)&&k(l,"id")&&k(l,"scriptId")&&k(l,"status")&&["draft","pending_test_approval","test_authorized","testing","tested","pending_approval","approved","rejected","revoked"].includes(String(l.status))&&k(l,"packageSha256")&&k(l,"packagePath")&&k(l,"shebang")&&k(l,"interpreterPath")&&k(l,"interpreterVersion")&&bt(l.capabilities)&&bt(l.config)&&bt(l.configSchema)&&(l.networkMode==="none"||l.networkMode==="public")&&Va(l,"internalAccess")&&xo(l.allowedReadDirs)&&xo(l.secretRefs)&&xo(l.env)&&bt(l.limits)&&Ya(l.limits.timeoutMs)&&Ya(l.limits.stdoutBytes)&&Ya(l.limits.stderrBytes)&&Ya(l.limits.payloadBytes)&&Ya(l.limits.stateBytes)&&bt(l.staticCheck)&&bt(l.testPlan)&&k(l,"createdAt")&&k(l,"updatedAt")}function yS(l){return bt(l)?l.kind==="cron"?k(l,"expression")&&k(l,"timezone"):l.kind==="once"?k(l,"runAt"):l.kind==="interval"?typeof l.intervalMs=="number"&&Ya(l.intervalMs)&&l.intervalMs>0:l.kind==="provider-event"&&k(l,"sourceType")&&bt(l.sourceConfig):!1}function vS(l){return bt(l)?l.kind==="always"?!0:l.kind==="expression"?k(l,"expression"):l.kind==="approved-script"&&k(l,"scriptId")&&k(l,"approvedVersionId")&&l.edge==="rising":!1}function bS(l){return bt(l)&&l.kind==="agent-prompt"&&k(l,"promptTemplate")&&(l.executionMode==="same-thread"||l.executionMode==="side-thread")}function SS(l){return bt(l)&&k(l,"platform")&&Xo(l.route)}function xS(l){return bt(l)&&l.concurrency==="skip-if-running"&&Ya(l.cooldownMs)}function xo(l){return Array.isArray(l)&&l.every(i=>typeof i=="string")}function Ya(l){return typeof l=="number"&&Number.isSafeInteger(l)&&l>=0}function km(l){return bt(l)&&k(l,"agentType")&&k(l,"runtimeId")&&k(l,"displayName")&&k(l,"status")&&Va(l,"installed")&&k(l,"detectedAt")&&k(l,"summary")&&Array.isArray(l.issues)&&Array.isArray(l.recommendedActions)&&k(l,"source")}function ES(l){return bt(l)&&l.mode==="desktop"&&k(l,"phase")&&Va(l,"pendingRestart")&&Pl(l,"service")&&Pl(l,"roles")&&Pl(l,"settings")&&Pl(l,"runtimeConfig")&&Array.isArray(l.logs)&&l.logs.every(i=>typeof i=="string")}function Fn(l){return bt(l)&&k(l,"type")}function TS(l){if(!bt(l)||!k(l,"type"))return!1;switch(l.type){case"runtime.updated":return ES(l.runtime);case"runtime.detect.started":return k(l,"detectedAt");case"runtime.detect.completed":return k(l,"detectedAt")&&Array.isArray(l.runtimes)&&l.runtimes.every(km);case"runtime.detect.failed":return k(l,"detectedAt")&&k(l,"error");case"runtime.status.changed":return km(l.runtime);case"thread.updated":return iS(l.thread);case"thread.session.activated":return k(l,"workspaceId")&&k(l,"threadId")&&k(l,"reason");case"message.created":return k(l,"threadId")&&uS(l.message)&&(l.stream===void 0||Fn(l.stream));case"message.updated":return k(l,"threadId")&&rS(l.message)&&(l.stream===void 0||Fn(l.stream));case"run.updated":return sS(l.run)&&(l.stream===void 0||Fn(l.stream));case"scheduler.job.updated":return oS(l.job);case"scheduler.run.updated":return cS(l.run);case"automation.monitor.updated":return fS(l.monitor);case"automation.monitor.run.updated":return dS(l.run);case"automation.definition.updated":return hS(l.automation);case"automation.evaluation.updated":return mS(l.evaluation);case"automation.run.updated":return gS(l.run);case"automation.script-version.updated":return pS(l.version);case"presence.updated":return Va(l,"live")&&(l.stream===void 0||Fn(l.stream));case"stream.updated":return Fn(l.stream);case"external.run.snapshot":return bt(l.snapshot)&&k(l.snapshot,"runId");case"external.run.stream":return k(l,"runId")&&Fn(l.stream);default:return!1}}function RS(l){return l.type==="stream.updated"||(l.type==="message.created"||l.type==="message.updated"||l.type==="run.updated")&&l.stream?l.stream:null}const Cu=new Map;function AS(l,i,s){const o=new Set,c=new Set;let f=null,h=null,g="disconnected";const y=N=>{g=N,c.forEach(O=>{try{O(N)}catch{}})},m=()=>{h!==null&&(i.cancelReconnect(h),h=null)},b=()=>{f==null||f.close(),f=null},v=()=>{m(),b(),s()},A=()=>{if(f||o.size===0&&c.size===0)return;const N=i.eventSourceFactory(`${l}/events`);f=N,N.onopen=()=>{f===N&&y("connected")};const O=H=>{try{const Y=JSON.parse(H.data);TS(Y)&&o.forEach(q=>{try{q(Y)}catch{}})}catch{}};nS.forEach(H=>N.addEventListener(H,O)),N.onerror=()=>{f===N&&(b(),y("disconnected"),(o.size>0||c.size>0)&&h===null&&(h=i.scheduleReconnect(()=>{h=null,A()},1e3)))}};return{subscribe(N){const O=H=>N(H);return o.add(O),A(),()=>{o.delete(O)&&o.size===0&&c.size===0&&v()}},subscribeConnectionState(N){if(c.add(N),A(),g==="connected")try{N("connected")}catch{}return()=>{c.delete(N)&&o.size===0&&c.size===0&&v()}}}}function Ym(l,i){const s=Cu.get(l);if(s)return s;let o;return o=AS(l,i,()=>{Cu.get(l)===o&&Cu.delete(l)}),Cu.set(l,o),o}function OS(l){const i=Og(l.baseUrl),s=l.fetchImpl||globalThis.fetch.bind(globalThis),o=l.eventSourceFactory||(b=>new EventSource(b)),c=l.scheduleReconnect||((b,v)=>setTimeout(b,v)),f=l.cancelReconnect||(b=>clearTimeout(b)),h=new Set,g=b=>{const A=Ym(i,{eventSourceFactory:o,scheduleReconnect:c,cancelReconnect:f}).subscribe(b);return h.add(A),()=>{h.delete(A),A()}};return{baseUrl:i,request:async(b,v,A)=>{const N=await s(`${i}${v}`,{method:b,headers:{"Content-Type":"application/json"},body:A===void 0?void 0:JSON.stringify(A)}),O=await N.json();if(!N.ok||!O.ok)throw new Error(O.error||`Local AI Core request failed: ${N.status}`);return O.data},async detect(b=350){var N;const v=new AbortController,A=setTimeout(()=>v.abort(),b);try{const O=await s(`${i}/health`,{signal:v.signal}),H=await O.json();return O.ok&&H.ok&&((N=H.data)==null?void 0:N.name)==="local-ai-core"}catch{return!1}finally{clearTimeout(A)}},events:{subscribe:g,subscribeConnectionState:b=>{const A=Ym(i,{eventSourceFactory:o,scheduleReconnect:c,cancelReconnect:f}).subscribeConnectionState(b);return h.add(A),()=>{h.delete(A),A()}},subscribeRuntime(b){return g(v=>{v.type==="runtime.updated"&&b(v.runtime)})},subscribeBridge(b){return g(v=>{const A=RS(v);A&&b(A)})},close(){const b=Array.from(h);h.clear(),b.forEach(v=>v())}}}}const Do=Og("/api/local/v1");Do.endsWith("/api/local/v1")&&Do.slice(0,-13);const _g=OS({baseUrl:Do});function kt(l,i,s){return _g.request(l,i,s)}function Cg(l){const i=Object.entries(l).filter(([,o])=>o!==void 0&&o!=="");if(i.length===0)return"";const s=new URLSearchParams;for(const[o,c]of i)s.set(o,String(c));return`?${s.toString()}`}function _S(l){return _g.events.subscribe(l)}function CS(){return kt("GET","/runtime")}function GS(){return kt("POST","/runtime/service/start")}function KS(){return kt("POST","/runtime/service/restart")}function zS(l){const i=Cg({limit:l});return kt("GET",`/runtime/logs${i}`)}function XS(l="sys",i=200){const s=Cg({level:l,limit:i});return kt("GET",`/logs${s}`)}function QS(){return kt("GET","/runtime/agent-runtimes")}function ZS(){return kt("POST","/runtimes/refresh")}function JS(){return kt("GET","/diagnostics/errors")}function $S(){return kt("POST","/diagnostics/doctor")}function FS(){return kt("GET","/runtime/runtime-config")}function WS(l){return kt("POST","/runtime/runtime-config",{config:l})}function IS(l){return kt("POST","/runtime/settings",l)}function PS(){return kt("GET","/providers")}function t2(l){return kt("POST","/providers",l)}function e2(l,i){return kt("PUT",`/providers/${encodeURIComponent(l)}`,i)}function a2(l){return kt("DELETE",`/providers/${encodeURIComponent(l)}`)}function n2(l={}){const i=new URLSearchParams;l.workspaceId&&i.set("workspace_id",l.workspaceId),l.runtimeId&&i.set("runtime_id",l.runtimeId),l.status&&i.set("status",Array.isArray(l.status)?l.status.join(","):l.status),l.limit&&i.set("limit",String(l.limit));const s=i.toString()?`?${i.toString()}`:"";return kt("GET",`/tasks${s}`)}function l2(l={}){const i=new URLSearchParams;l.workspaceId&&i.set("workspace_id",l.workspaceId),l.taskId&&i.set("task_id",l.taskId),l.status&&i.set("status",Array.isArray(l.status)?l.status.join(","):l.status),l.limit&&i.set("limit",String(l.limit));const s=i.toString()?`?${i.toString()}`:"";return kt("GET",`/approvals${s}`)}function i2(l,i){return kt("POST",`/approvals/${encodeURIComponent(l)}/resolve`,i)}function u2(l={}){const i=new URLSearchParams;l.workspaceId&&i.set("workspace_id",l.workspaceId),l.taskId&&i.set("task_id",l.taskId),l.approvalId&&i.set("approval_id",l.approvalId),l.type&&i.set("type",Array.isArray(l.type)?l.type.join(","):l.type),l.limit&&i.set("limit",String(l.limit));const s=i.toString()?`?${i.toString()}`:"";return kt("GET",`/audit-events${s}`)}function qm(){return kt("GET","/capabilities/snapshot")}function r2(){return kt("GET","/plugins/diagnostics")}function NS(l){return _S(i=>{i.type==="runtime.updated"&&l(i.runtime)})}const Vm=20,MS=500;function DS(l){return new Promise(i=>window.setTimeout(i,l))}function LS(){const l=window.navigator.userAgent.toLowerCase().includes("windows")?"windows":window.navigator.userAgent.toLowerCase().includes("mac os x")?"macos":window.navigator.userAgent.toLowerCase().includes("linux")?"linux":"unknown";document.documentElement.classList.add(`platform-${l}`)}function jS(){return j.jsx("div",{className:"min-h-screen flex items-center justify-center bg-white dark:bg-gray-950 p-6",children:j.jsxs("div",{className:"flex items-center gap-3 rounded-2xl border border-gray-200 dark:border-white/[0.08] bg-white dark:bg-gray-900 px-5 py-4 text-sm text-gray-600 dark:text-gray-300 shadow-sm",children:[j.jsx(Xm,{size:16,className:"animate-spin"}),"正在初始化 AgentDock 运行时…"]})})}function wS({message:l,logs:i,onRetry:s}){return j.jsx("div",{className:"min-h-screen flex items-center justify-center bg-white dark:bg-gray-950 p-6",children:j.jsxs("div",{className:"max-w-2xl w-full rounded-3xl border border-red-200 dark:border-red-900/40 bg-white dark:bg-gray-900 shadow-sm overflow-hidden",children:[j.jsx("div",{className:"px-6 py-5 border-b border-red-100 dark:border-red-900/30 bg-red-50/80 dark:bg-red-950/20",children:j.jsxs("div",{className:"flex items-start gap-3",children:[j.jsx("div",{className:"w-10 h-10 rounded-2xl bg-red-100 dark:bg-red-950/40 text-red-600 dark:text-red-300 flex items-center justify-center shrink-0",children:j.jsx(Hy,{size:18})}),j.jsxs("div",{children:[j.jsx("h1",{className:"text-lg font-semibold text-red-700 dark:text-red-300",children:"AgentDock 运行时初始化失败"}),j.jsx("p",{className:"mt-1 text-sm text-red-600 dark:text-red-400 break-words",children:l})]})]})}),j.jsxs("div",{className:"px-6 py-5 space-y-4",children:[j.jsxs("div",{className:"rounded-2xl border border-gray-200 dark:border-white/[0.08] px-4 py-3 text-sm text-gray-600 dark:text-gray-300",children:[j.jsx("p",{className:"font-medium text-gray-900 dark:text-white",children:"What we can do next"}),j.jsx("p",{className:"mt-1",children:"请先重试本地运行时初始化。如果仍然失败,请检查下方运行时日志,并确认 Local AI Core 配置文件路径与运行环境是否正确。"})]}),i.length>0&&j.jsxs("div",{className:"rounded-2xl border border-gray-200 dark:border-white/[0.08] bg-gray-50 dark:bg-gray-950/40 px-4 py-3",children:[j.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-white",children:"最近的桌面日志"}),j.jsx("pre",{className:"mt-2 max-h-64 overflow-auto whitespace-pre-wrap break-words text-xs text-gray-600 dark:text-gray-300 font-mono",children:i.join(`
|
|
161
|
+
Please change the parent <Route path="${q}"> to <Route path="${q==="/"?"*":`${q}/*`}">.`)}let b=Ce(),v;if(i){let q=typeof i=="string"?fn(i):i;wt(y==="/"||((Y=q.pathname)==null?void 0:Y.startsWith(y)),`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 "${y}" but pathname "${q.pathname}" was given in the \`location\` prop.`),v=q}else v=b;let A=v.pathname||"/",N=A;if(y!=="/"){let q=y.replace(/^\//,"").split("/");N="/"+A.replace(/^\//,"").split("/").slice(q.length).join("/")}let O=Qm(l,{pathname:N});Oe(m||O!=null,`No routes matched location "${v.pathname}${v.search}${v.hash}" `),Oe(O==null||O[O.length-1].route.element!==void 0||O[O.length-1].route.Component!==void 0||O[O.length-1].route.lazy!==void 0,`Matched leaf route at location "${v.pathname}${v.search}${v.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let H=Hv(O&&O.map(q=>Object.assign({},q,{params:Object.assign({},h,q.params),pathname:Ge([y,o.encodeLocation?o.encodeLocation(q.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:q.pathname]),pathnameBase:q.pathnameBase==="/"?y:Ge([y,o.encodeLocation?o.encodeLocation(q.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:q.pathnameBase])})),c,s);return i&&H?T.createElement(ii.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...v},navigationType:"POP"}},H):H}function Lv(){let l=Vv(),i=vv(l)?`${l.status} ${l.statusText}`:l instanceof Error?l.message:JSON.stringify(l),s=l instanceof Error?l.stack:null,o="rgba(200,200,200, 0.5)",c={padding:"0.5rem",backgroundColor:o},f={padding:"2px 4px",backgroundColor:o},h=null;return console.error("Error handled by React Router default ErrorBoundary:",l),h=T.createElement(T.Fragment,null,T.createElement("p",null,"💿 Hey developer 👋"),T.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",T.createElement("code",{style:f},"ErrorBoundary")," or"," ",T.createElement("code",{style:f},"errorElement")," prop on your route.")),T.createElement(T.Fragment,null,T.createElement("h2",null,"Unexpected Application Error!"),T.createElement("h3",{style:{fontStyle:"italic"}},i),s?T.createElement("pre",{style:c},s):null,h)}var jv=T.createElement(Lv,null),ug=class extends T.Component{constructor(l){super(l),this.state={location:l.location,revalidation:l.revalidation,error:l.error}}static getDerivedStateFromError(l){return{error:l}}static getDerivedStateFromProps(l,i){return i.location!==l.location||i.revalidation!=="idle"&&l.revalidation==="idle"?{error:l.error,location:l.location,revalidation:l.revalidation}:{error:l.error!==void 0?l.error:i.error,location:i.location,revalidation:l.revalidation||i.revalidation}}componentDidCatch(l,i){this.props.onError?this.props.onError(l,i):console.error("React Router caught the following error during render",l)}render(){let l=this.state.error;if(this.context&&typeof l=="object"&&l&&"digest"in l&&typeof l.digest=="string"){const s=_v(l.digest);s&&(l=s)}let i=l!==void 0?T.createElement(ke.Provider,{value:this.props.routeContext},T.createElement(wo.Provider,{value:l,children:this.props.component})):this.props.children;return this.context?T.createElement(wv,{error:l},i):i}};ug.contextType=Pm;var go=new WeakMap;function wv({children:l,error:i}){let{basename:s}=T.useContext(_e);if(typeof i=="object"&&i&&"digest"in i&&typeof i.digest=="string"){let o=Ov(i.digest);if(o){let c=go.get(i);if(c)throw c;let f=Wm(o.location,s);if(Fm&&!go.get(i))if(f.isExternal||o.reloadDocument)window.location.href=f.absoluteURL||f.to;else{const h=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(f.to,{replace:o.replace}));throw go.set(i,h),h}return T.createElement("meta",{httpEquiv:"refresh",content:`0;url=${f.absoluteURL||f.to}`})}}return l}function Uv({routeContext:l,match:i,children:s}){let o=T.useContext(tl);return o&&o.static&&o.staticContext&&(i.route.errorElement||i.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=i.route.id),T.createElement(ke.Provider,{value:l},s)}function Hv(l,i=[],s){let o=s==null?void 0:s.state;if(l==null){if(!o)return null;if(o.errors)l=o.matches;else if(i.length===0&&!o.initialized&&o.matches.length>0)l=o.matches;else return null}let c=l,f=o==null?void 0:o.errors;if(f!=null){let b=c.findIndex(v=>v.route.id&&(f==null?void 0:f[v.route.id])!==void 0);wt(b>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(f).join(",")}`),c=c.slice(0,Math.min(c.length,b+1))}let h=!1,g=-1;if(s&&o){h=o.renderFallback;for(let b=0;b<c.length;b++){let v=c[b];if((v.route.HydrateFallback||v.route.hydrateFallbackElement)&&(g=b),v.route.id){let{loaderData:A,errors:N}=o,O=v.route.loader&&!A.hasOwnProperty(v.route.id)&&(!N||N[v.route.id]===void 0);if(v.route.lazy||O){s.isStatic&&(h=!0),g>=0?c=c.slice(0,g+1):c=[c[0]];break}}}}let y=s==null?void 0:s.onError,m=o&&y?(b,v)=>{var A,N;y(b,{location:o.location,params:((N=(A=o.matches)==null?void 0:A[0])==null?void 0:N.params)??{},unstable_pattern:bv(o.matches),errorInfo:v})}:void 0;return c.reduceRight((b,v,A)=>{let N,O=!1,H=null,Y=null;o&&(N=f&&v.route.id?f[v.route.id]:void 0,H=v.route.errorElement||jv,h&&(g<0&&A===0?(rg("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),O=!0,Y=null):g===A&&(O=!0,Y=v.route.hydrateFallbackElement||null)));let q=i.concat(c.slice(0,A+1)),V=()=>{let X;return N?X=H:O?X=Y:v.route.Component?X=T.createElement(v.route.Component,null):v.route.element?X=v.route.element:X=b,T.createElement(Uv,{match:v,routeContext:{outlet:b,matches:q,isDataRoute:o!=null},children:X})};return o&&(v.route.ErrorBoundary||v.route.errorElement||A===0)?T.createElement(ug,{location:o.location,revalidation:o.revalidation,component:H,error:N,children:V(),routeContext:{outlet:null,matches:q,isDataRoute:!0},onError:m}):V()},null)}function Ho(l){return`${l} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Bv(l){let i=T.useContext(tl);return wt(i,Ho(l)),i}function kv(l){let i=T.useContext(ku);return wt(i,Ho(l)),i}function Yv(l){let i=T.useContext(ke);return wt(i,Ho(l)),i}function Bo(l){let i=Yv(l),s=i.matches[i.matches.length-1];return wt(s.route.id,`${l} can only be used on routes that contain a unique "id"`),s.route.id}function qv(){return Bo("useRouteId")}function Vv(){var o;let l=T.useContext(wo),i=kv("useRouteError"),s=Bo("useRouteError");return l!==void 0?l:(o=i.errors)==null?void 0:o[s]}function Gv(){let{router:l}=Bv("useNavigate"),i=Bo("useNavigate"),s=T.useRef(!1);return ng(()=>{s.current=!0}),T.useCallback(async(c,f={})=>{Oe(s.current,ag),s.current&&(typeof c=="number"?await l.navigate(c):await l.navigate(c,{fromRouteId:i,...f}))},[l,i])}var cm={};function rg(l,i,s){!i&&!cm[l]&&(cm[l]=!0,Oe(!1,s))}T.memo(Kv);function Kv({routes:l,future:i,state:s,isStatic:o,onError:c}){return ig(l,void 0,{state:s,isStatic:o,onError:c})}function qa({to:l,replace:i,state:s,relative:o}){wt(el(),"<Navigate> may be used only in the context of a <Router> component.");let{static:c}=T.useContext(_e);Oe(!c,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:f}=T.useContext(ke),{pathname:h}=Ce(),g=Uo(),y=Bu(l,jo(f),h,o==="path"),m=JSON.stringify(y);return T.useEffect(()=>{g(JSON.parse(m),{replace:i,state:s,relative:o})},[g,m,o,i,s]),null}function Xv(l){return Mv(l.context)}function Wn(l){wt(!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 Qv({basename:l="/",children:i=null,location:s,navigationType:o="POP",navigator:c,static:f=!1,unstable_useTransitions:h}){wt(!el(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let g=l.replace(/^\/*/,"/"),y=T.useMemo(()=>({basename:g,navigator:c,static:f,unstable_useTransitions:h,future:{}}),[g,c,f,h]);typeof s=="string"&&(s=fn(s));let{pathname:m="/",search:b="",hash:v="",state:A=null,key:N="default",unstable_mask:O}=s,H=T.useMemo(()=>{let Y=ha(m,g);return Y==null?null:{location:{pathname:Y,search:b,hash:v,state:A,key:N,unstable_mask:O},navigationType:o}},[g,m,b,v,A,N,o,O]);return Oe(H!=null,`<Router basename="${g}"> is not able to match the URL "${m}${b}${v}" because it does not start with the basename, so the <Router> won't render anything.`),H==null?null:T.createElement(_e.Provider,{value:y},T.createElement(ii.Provider,{children:i,value:H}))}function Zv({children:l,location:i}){return Dv(To(l),i)}function To(l,i=[]){let s=[];return T.Children.forEach(l,(o,c)=>{if(!T.isValidElement(o))return;let f=[...i,c];if(o.type===T.Fragment){s.push.apply(s,To(o.props.children,f));return}wt(o.type===Wn,`[${typeof o.type=="string"?o.type:o.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),wt(!o.props.index||!o.props.children,"An index route cannot have child routes.");let h={id:o.props.id||f.join("-"),caseSensitive:o.props.caseSensitive,element:o.props.element,Component:o.props.Component,index:o.props.index,path:o.props.path,middleware:o.props.middleware,loader:o.props.loader,action:o.props.action,hydrateFallbackElement:o.props.hydrateFallbackElement,HydrateFallback:o.props.HydrateFallback,errorElement:o.props.errorElement,ErrorBoundary:o.props.ErrorBoundary,hasErrorBoundary:o.props.hasErrorBoundary===!0||o.props.ErrorBoundary!=null||o.props.errorElement!=null,shouldRevalidate:o.props.shouldRevalidate,handle:o.props.handle,lazy:o.props.lazy};o.props.children&&(h.children=To(o.props.children,f)),s.push(h)}),s}var zu="get",Nu="application/x-www-form-urlencoded";function Yu(l){return typeof HTMLElement<"u"&&l instanceof HTMLElement}function Jv(l){return Yu(l)&&l.tagName.toLowerCase()==="button"}function $v(l){return Yu(l)&&l.tagName.toLowerCase()==="form"}function Fv(l){return Yu(l)&&l.tagName.toLowerCase()==="input"}function Wv(l){return!!(l.metaKey||l.altKey||l.ctrlKey||l.shiftKey)}function Iv(l,i){return l.button===0&&(!i||i==="_self")&&!Wv(l)}function Ro(l=""){return new URLSearchParams(typeof l=="string"||Array.isArray(l)||l instanceof URLSearchParams?l:Object.keys(l).reduce((i,s)=>{let o=l[s];return i.concat(Array.isArray(o)?o.map(c=>[s,c]):[[s,o]])},[]))}function Pv(l,i){let s=Ro(l);return i&&i.forEach((o,c)=>{s.has(c)||i.getAll(c).forEach(f=>{s.append(c,f)})}),s}var Ou=null;function t1(){if(Ou===null)try{new FormData(document.createElement("form"),0),Ou=!1}catch{Ou=!0}return Ou}var e1=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function po(l){return l!=null&&!e1.has(l)?(Oe(!1,`"${l}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Nu}"`),null):l}function a1(l,i){let s,o,c,f,h;if($v(l)){let g=l.getAttribute("action");o=g?ha(g,i):null,s=l.getAttribute("method")||zu,c=po(l.getAttribute("enctype"))||Nu,f=new FormData(l)}else if(Jv(l)||Fv(l)&&(l.type==="submit"||l.type==="image")){let g=l.form;if(g==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let y=l.getAttribute("formaction")||g.getAttribute("action");if(o=y?ha(y,i):null,s=l.getAttribute("formmethod")||g.getAttribute("method")||zu,c=po(l.getAttribute("formenctype"))||po(g.getAttribute("enctype"))||Nu,f=new FormData(g,l),!t1()){let{name:m,type:b,value:v}=l;if(b==="image"){let A=m?`${m}.`:"";f.append(`${A}x`,"0"),f.append(`${A}y`,"0")}else m&&f.append(m,v)}}else{if(Yu(l))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');s=zu,o=null,c=Nu,h=l}return f&&c==="text/plain"&&(h=f,f=void 0),{action:o,method:s.toLowerCase(),encType:c,formData:f,body:h}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function ko(l,i){if(l===!1||l===null||typeof l>"u")throw new Error(i)}function sg(l,i,s,o){let c=typeof l=="string"?new URL(l,typeof window>"u"?"server://singlefetch/":window.location.origin):l;return s?c.pathname.endsWith("/")?c.pathname=`${c.pathname}_.${o}`:c.pathname=`${c.pathname}.${o}`:c.pathname==="/"?c.pathname=`_root.${o}`:i&&ha(c.pathname,i)==="/"?c.pathname=`${Lu(i)}/_root.${o}`:c.pathname=`${Lu(c.pathname)}.${o}`,c}async function n1(l,i){if(l.id in i)return i[l.id];try{let s=await import(l.module);return i[l.id]=s,s}catch(s){return console.error(`Error loading route module \`${l.module}\`, reloading page...`),console.error(s),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function l1(l){return l==null?!1:l.href==null?l.rel==="preload"&&typeof l.imageSrcSet=="string"&&typeof l.imageSizes=="string":typeof l.rel=="string"&&typeof l.href=="string"}async function i1(l,i,s){let o=await Promise.all(l.map(async c=>{let f=i.routes[c.route.id];if(f){let h=await n1(f,s);return h.links?h.links():[]}return[]}));return o1(o.flat(1).filter(l1).filter(c=>c.rel==="stylesheet"||c.rel==="preload").map(c=>c.rel==="stylesheet"?{...c,rel:"prefetch",as:"style"}:{...c,rel:"prefetch"}))}function fm(l,i,s,o,c,f){let h=(y,m)=>s[m]?y.route.id!==s[m].route.id:!0,g=(y,m)=>{var b;return s[m].pathname!==y.pathname||((b=s[m].route.path)==null?void 0:b.endsWith("*"))&&s[m].params["*"]!==y.params["*"]};return f==="assets"?i.filter((y,m)=>h(y,m)||g(y,m)):f==="data"?i.filter((y,m)=>{var v;let b=o.routes[y.route.id];if(!b||!b.hasLoader)return!1;if(h(y,m)||g(y,m))return!0;if(y.route.shouldRevalidate){let A=y.route.shouldRevalidate({currentUrl:new URL(c.pathname+c.search+c.hash,window.origin),currentParams:((v=s[0])==null?void 0:v.params)||{},nextUrl:new URL(l,window.origin),nextParams:y.params,defaultShouldRevalidate:!0});if(typeof A=="boolean")return A}return!0}):[]}function u1(l,i,{includeHydrateFallback:s}={}){return r1(l.map(o=>{let c=i.routes[o.route.id];if(!c)return[];let f=[c.module];return c.clientActionModule&&(f=f.concat(c.clientActionModule)),c.clientLoaderModule&&(f=f.concat(c.clientLoaderModule)),s&&c.hydrateFallbackModule&&(f=f.concat(c.hydrateFallbackModule)),c.imports&&(f=f.concat(c.imports)),f}).flat(1))}function r1(l){return[...new Set(l)]}function s1(l){let i={},s=Object.keys(l).sort();for(let o of s)i[o]=l[o];return i}function o1(l,i){let s=new Set;return new Set(i),l.reduce((o,c)=>{let f=JSON.stringify(s1(c));return s.has(f)||(s.add(f),o.push({key:f,link:c})),o},[])}function Yo(){let l=T.useContext(tl);return ko(l,"You must render this element inside a <DataRouterContext.Provider> element"),l}function c1(){let l=T.useContext(ku);return ko(l,"You must render this element inside a <DataRouterStateContext.Provider> element"),l}var qo=T.createContext(void 0);qo.displayName="FrameworkContext";function Vo(){let l=T.useContext(qo);return ko(l,"You must render this element inside a <HydratedRouter> element"),l}function f1(l,i){let s=T.useContext(qo),[o,c]=T.useState(!1),[f,h]=T.useState(!1),{onFocus:g,onBlur:y,onMouseEnter:m,onMouseLeave:b,onTouchStart:v}=i,A=T.useRef(null);T.useEffect(()=>{if(l==="render"&&h(!0),l==="viewport"){let H=q=>{q.forEach(V=>{h(V.isIntersecting)})},Y=new IntersectionObserver(H,{threshold:.5});return A.current&&Y.observe(A.current),()=>{Y.disconnect()}}},[l]),T.useEffect(()=>{if(o){let H=setTimeout(()=>{h(!0)},100);return()=>{clearTimeout(H)}}},[o]);let N=()=>{c(!0)},O=()=>{c(!1),h(!1)};return s?l!=="intent"?[f,A,{}]:[f,A,{onFocus:Wl(g,N),onBlur:Wl(y,O),onMouseEnter:Wl(m,N),onMouseLeave:Wl(b,O),onTouchStart:Wl(v,N)}]:[!1,A,{}]}function Wl(l,i){return s=>{l&&l(s),s.defaultPrevented||i(s)}}function d1({page:l,...i}){let s=xv(),{router:o}=Yo(),c=T.useMemo(()=>Qm(o.routes,l,o.basename),[o.routes,l,o.basename]);return c?s?T.createElement(m1,{page:l,matches:c,...i}):T.createElement(g1,{page:l,matches:c,...i}):null}function h1(l){let{manifest:i,routeModules:s}=Vo(),[o,c]=T.useState([]);return T.useEffect(()=>{let f=!1;return i1(l,i,s).then(h=>{f||c(h)}),()=>{f=!0}},[l,i,s]),o}function m1({page:l,matches:i,...s}){let o=Ce(),{future:c}=Vo(),{basename:f}=Yo(),h=T.useMemo(()=>{if(l===o.pathname+o.search+o.hash)return[];let g=sg(l,f,c.unstable_trailingSlashAwareDataRequests,"rsc"),y=!1,m=[];for(let b of i)typeof b.route.shouldRevalidate=="function"?y=!0:m.push(b.route.id);return y&&m.length>0&&g.searchParams.set("_routes",m.join(",")),[g.pathname+g.search]},[f,c.unstable_trailingSlashAwareDataRequests,l,o,i]);return T.createElement(T.Fragment,null,h.map(g=>T.createElement("link",{key:g,rel:"prefetch",as:"fetch",href:g,...s})))}function g1({page:l,matches:i,...s}){let o=Ce(),{future:c,manifest:f,routeModules:h}=Vo(),{basename:g}=Yo(),{loaderData:y,matches:m}=c1(),b=T.useMemo(()=>fm(l,i,m,f,o,"data"),[l,i,m,f,o]),v=T.useMemo(()=>fm(l,i,m,f,o,"assets"),[l,i,m,f,o]),A=T.useMemo(()=>{if(l===o.pathname+o.search+o.hash)return[];let H=new Set,Y=!1;if(i.forEach(V=>{var $;let X=f.routes[V.route.id];!X||!X.hasLoader||(!b.some(tt=>tt.route.id===V.route.id)&&V.route.id in y&&(($=h[V.route.id])!=null&&$.shouldRevalidate)||X.hasClientLoader?Y=!0:H.add(V.route.id))}),H.size===0)return[];let q=sg(l,g,c.unstable_trailingSlashAwareDataRequests,"data");return Y&&H.size>0&&q.searchParams.set("_routes",i.filter(V=>H.has(V.route.id)).map(V=>V.route.id).join(",")),[q.pathname+q.search]},[g,c.unstable_trailingSlashAwareDataRequests,y,o,f,b,i,l,h]),N=T.useMemo(()=>u1(v,f),[v,f]),O=h1(v);return T.createElement(T.Fragment,null,A.map(H=>T.createElement("link",{key:H,rel:"prefetch",as:"fetch",href:H,...s})),N.map(H=>T.createElement("link",{key:H,rel:"modulepreload",href:H,...s})),O.map(({key:H,link:Y})=>T.createElement("link",{key:H,nonce:s.nonce,...Y,crossOrigin:Y.crossOrigin??s.crossOrigin})))}function p1(...l){return i=>{l.forEach(s=>{typeof s=="function"?s(i):s!=null&&(s.current=i)})}}var y1=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{y1&&(window.__reactRouterVersion="7.14.2")}catch{}function v1({basename:l,children:i,unstable_useTransitions:s,window:o}){let c=T.useRef();c.current==null&&(c.current=Jy({window:o,v5Compat:!0}));let f=c.current,[h,g]=T.useState({action:f.action,location:f.location}),y=T.useCallback(m=>{s===!1?g(m):T.startTransition(()=>g(m))},[s]);return T.useLayoutEffect(()=>f.listen(y),[f,y]),T.createElement(Qv,{basename:l,children:i,location:h.location,navigationType:h.action,navigator:f,unstable_useTransitions:s})}var og=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,cg=T.forwardRef(function({onClick:i,discover:s="render",prefetch:o="none",relative:c,reloadDocument:f,replace:h,unstable_mask:g,state:y,target:m,to:b,preventScrollReset:v,viewTransition:A,unstable_defaultShouldRevalidate:N,...O},H){let{basename:Y,navigator:q,unstable_useTransitions:V}=T.useContext(_e),X=typeof b=="string"&&og.test(b),$=Wm(b,Y);b=$.to;let tt=Cv(b,{relative:c}),st=Ce(),J=null;if(g){let Ut=Bu(g,[],st.unstable_mask?st.unstable_mask.pathname:"/",!0);Y!=="/"&&(Ut.pathname=Ut.pathname==="/"?Y:Ge([Y,Ut.pathname])),J=q.createHref(Ut)}let[nt,rt,dt]=f1(o,O),Dt=x1(b,{replace:h,unstable_mask:g,state:y,target:m,preventScrollReset:v,relative:c,viewTransition:A,unstable_defaultShouldRevalidate:N,unstable_useTransitions:V});function $t(Ut){i&&i(Ut),Ut.defaultPrevented||Dt(Ut)}let zt=!($.isExternal||f),Lt=T.createElement("a",{...O,...dt,href:(zt?J:void 0)||$.absoluteURL||tt,onClick:zt?$t:i,ref:p1(H,rt),target:m,"data-discover":!X&&s==="render"?"true":void 0});return nt&&!X?T.createElement(T.Fragment,null,Lt,T.createElement(d1,{page:tt})):Lt});cg.displayName="Link";var Ao=T.forwardRef(function({"aria-current":i="page",caseSensitive:s=!1,className:o="",end:c=!1,style:f,to:h,viewTransition:g,children:y,...m},b){let v=ui(h,{relative:m.relative}),A=Ce(),N=T.useContext(ku),{navigator:O,basename:H}=T.useContext(_e),Y=N!=null&&O1(v)&&g===!0,q=O.encodeLocation?O.encodeLocation(v).pathname:v.pathname,V=A.pathname,X=N&&N.navigation&&N.navigation.location?N.navigation.location.pathname:null;s||(V=V.toLowerCase(),X=X?X.toLowerCase():null,q=q.toLowerCase()),X&&H&&(X=ha(X,H)||X);const $=q!=="/"&&q.endsWith("/")?q.length-1:q.length;let tt=V===q||!c&&V.startsWith(q)&&V.charAt($)==="/",st=X!=null&&(X===q||!c&&X.startsWith(q)&&X.charAt(q.length)==="/"),J={isActive:tt,isPending:st,isTransitioning:Y},nt=tt?i:void 0,rt;typeof o=="function"?rt=o(J):rt=[o,tt?"active":null,st?"pending":null,Y?"transitioning":null].filter(Boolean).join(" ");let dt=typeof f=="function"?f(J):f;return T.createElement(cg,{...m,"aria-current":nt,className:rt,ref:b,style:dt,to:h,viewTransition:g},typeof y=="function"?y(J):y)});Ao.displayName="NavLink";var b1=T.forwardRef(({discover:l="render",fetcherKey:i,navigate:s,reloadDocument:o,replace:c,state:f,method:h=zu,action:g,onSubmit:y,relative:m,preventScrollReset:b,viewTransition:v,unstable_defaultShouldRevalidate:A,...N},O)=>{let{unstable_useTransitions:H}=T.useContext(_e),Y=R1(),q=A1(g,{relative:m}),V=h.toLowerCase()==="get"?"get":"post",X=typeof g=="string"&&og.test(g),$=tt=>{if(y&&y(tt),tt.defaultPrevented)return;tt.preventDefault();let st=tt.nativeEvent.submitter,J=(st==null?void 0:st.getAttribute("formmethod"))||h,nt=()=>Y(st||tt.currentTarget,{fetcherKey:i,method:J,navigate:s,replace:c,state:f,relative:m,preventScrollReset:b,viewTransition:v,unstable_defaultShouldRevalidate:A});H&&s!==!1?T.startTransition(()=>nt()):nt()};return T.createElement("form",{ref:O,method:V,action:q,onSubmit:o?y:$,...N,"data-discover":!X&&l==="render"?"true":void 0})});b1.displayName="Form";function S1(l){return`${l} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function fg(l){let i=T.useContext(tl);return wt(i,S1(l)),i}function x1(l,{target:i,replace:s,unstable_mask:o,state:c,preventScrollReset:f,relative:h,viewTransition:g,unstable_defaultShouldRevalidate:y,unstable_useTransitions:m}={}){let b=Uo(),v=Ce(),A=ui(l,{relative:h});return T.useCallback(N=>{if(Iv(N,i)){N.preventDefault();let O=s!==void 0?s:ni(v)===ni(A),H=()=>b(l,{replace:O,unstable_mask:o,state:c,preventScrollReset:f,relative:h,viewTransition:g,unstable_defaultShouldRevalidate:y});m?T.startTransition(()=>H()):H()}},[v,b,A,s,o,c,i,l,f,h,g,y,m])}function kS(l){Oe(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let i=T.useRef(Ro(l)),s=T.useRef(!1),o=Ce(),c=T.useMemo(()=>Pv(o.search,s.current?null:i.current),[o.search]),f=Uo(),h=T.useCallback((g,y)=>{const m=Ro(typeof g=="function"?g(new URLSearchParams(c)):g);s.current=!0,f("?"+m,y)},[f,c]);return[c,h]}var E1=0,T1=()=>`__${String(++E1)}__`;function R1(){let{router:l}=fg("useSubmit"),{basename:i}=T.useContext(_e),s=qv(),o=l.fetch,c=l.navigate;return T.useCallback(async(f,h={})=>{let{action:g,method:y,encType:m,formData:b,body:v}=a1(f,i);if(h.navigate===!1){let A=h.fetcherKey||T1();await o(A,s,h.action||g,{unstable_defaultShouldRevalidate:h.unstable_defaultShouldRevalidate,preventScrollReset:h.preventScrollReset,formData:b,body:v,formMethod:h.method||y,formEncType:h.encType||m,flushSync:h.flushSync})}else await c(h.action||g,{unstable_defaultShouldRevalidate:h.unstable_defaultShouldRevalidate,preventScrollReset:h.preventScrollReset,formData:b,body:v,formMethod:h.method||y,formEncType:h.encType||m,replace:h.replace,state:h.state,fromRouteId:s,flushSync:h.flushSync,viewTransition:h.viewTransition})},[o,c,i,s])}function A1(l,{relative:i}={}){let{basename:s}=T.useContext(_e),o=T.useContext(ke);wt(o,"useFormAction must be used inside a RouteContext");let[c]=o.matches.slice(-1),f={...ui(l||".",{relative:i})},h=Ce();if(l==null){f.search=h.search;let g=new URLSearchParams(f.search),y=g.getAll("index");if(y.some(b=>b==="")){g.delete("index"),y.filter(v=>v).forEach(v=>g.append("index",v));let b=g.toString();f.search=b?`?${b}`:""}}return(!l||l===".")&&c.route.index&&(f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index"),s!=="/"&&(f.pathname=f.pathname==="/"?s:Ge([s,f.pathname])),ni(f)}function O1(l,{relative:i}={}){let s=T.useContext(tg);wt(s!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:o}=fg("useViewTransitionState"),c=ui(l,{relative:i});if(!s.isTransitioning)return!1;let f=ha(s.currentLocation.pathname,o)||s.currentLocation.pathname,h=ha(s.nextLocation.pathname,o)||s.nextLocation.pathname;return Du(c.pathname,h)!=null||Du(c.pathname,f)!=null}const _1=(l,i,s,o)=>{var f,h,g,y;const c=[s,{code:i,...o||{}}];if((h=(f=l==null?void 0:l.services)==null?void 0:f.logger)!=null&&h.forward)return l.services.logger.forward(c,"warn","react-i18next::",!0);cn(c[0])&&(c[0]=`react-i18next:: ${c[0]}`),(y=(g=l==null?void 0:l.services)==null?void 0:g.logger)!=null&&y.warn?l.services.logger.warn(...c):console!=null&&console.warn&&console.warn(...c)},dm={},Oo=(l,i,s,o)=>{cn(s)&&dm[s]||(cn(s)&&(dm[s]=new Date),_1(l,i,s,o))},dg=(l,i)=>()=>{if(l.isInitialized)i();else{const s=()=>{setTimeout(()=>{l.off("initialized",s)},0),i()};l.on("initialized",s)}},_o=(l,i,s)=>{l.loadNamespaces(i,dg(l,s))},hm=(l,i,s,o)=>{if(cn(s)&&(s=[s]),l.options.preload&&l.options.preload.indexOf(i)>-1)return _o(l,s,o);s.forEach(c=>{l.options.ns.indexOf(c)<0&&l.options.ns.push(c)}),l.loadLanguages(i,dg(l,o))},C1=(l,i,s={})=>!i.languages||!i.languages.length?(Oo(i,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:i.languages}),!0):i.hasLoadedNamespace(l,{lng:s.lng,precheck:(o,c)=>{if(s.bindI18n&&s.bindI18n.indexOf("languageChanging")>-1&&o.services.backendConnector.backend&&o.isLanguageChangingTo&&!c(o.isLanguageChangingTo,l))return!1}}),cn=l=>typeof l=="string",z1=l=>typeof l=="object"&&l!==null,N1=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,M1={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},D1=l=>M1[l],L1=l=>l.replace(N1,D1);let Co={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:L1};const j1=(l={})=>{Co={...Co,...l}},w1=()=>Co;let hg;const U1=l=>{hg=l},H1=()=>hg,B1={type:"3rdParty",init(l){j1(l.options.react),U1(l)}},k1=T.createContext();class Y1{constructor(){this.usedNamespaces={}}addUsedNamespaces(i){i.forEach(s=>{this.usedNamespaces[s]||(this.usedNamespaces[s]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const q1=(l,i)=>{const s=T.useRef();return T.useEffect(()=>{s.current=l},[l,i]),s.current},mg=(l,i,s,o)=>l.getFixedT(i,s,o),V1=(l,i,s,o)=>T.useCallback(mg(l,i,s,o),[l,i,s,o]),G1=(l,i={})=>{var $,tt,st,J;const{i18n:s}=i,{i18n:o,defaultNS:c}=T.useContext(k1)||{},f=s||o||H1();if(f&&!f.reportNamespaces&&(f.reportNamespaces=new Y1),!f){Oo(f,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const nt=(dt,Dt)=>cn(Dt)?Dt:z1(Dt)&&cn(Dt.defaultValue)?Dt.defaultValue:Array.isArray(dt)?dt[dt.length-1]:dt,rt=[nt,{},!1];return rt.t=nt,rt.i18n={},rt.ready=!1,rt}($=f.options.react)!=null&&$.wait&&Oo(f,"DEPRECATED_OPTION","useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const h={...w1(),...f.options.react,...i},{useSuspense:g,keyPrefix:y}=h;let m=c||((tt=f.options)==null?void 0:tt.defaultNS);m=cn(m)?[m]:m||["translation"],(J=(st=f.reportNamespaces).addUsedNamespaces)==null||J.call(st,m);const b=(f.isInitialized||f.initializedStoreOnce)&&m.every(nt=>C1(nt,f,h)),v=V1(f,i.lng||null,h.nsMode==="fallback"?m:m[0],y),A=()=>v,N=()=>mg(f,i.lng||null,h.nsMode==="fallback"?m:m[0],y),[O,H]=T.useState(A);let Y=m.join();i.lng&&(Y=`${i.lng}${Y}`);const q=q1(Y),V=T.useRef(!0);T.useEffect(()=>{const{bindI18n:nt,bindI18nStore:rt}=h;V.current=!0,!b&&!g&&(i.lng?hm(f,i.lng,m,()=>{V.current&&H(N)}):_o(f,m,()=>{V.current&&H(N)})),b&&q&&q!==Y&&V.current&&H(N);const dt=()=>{V.current&&H(N)};return nt&&(f==null||f.on(nt,dt)),rt&&(f==null||f.store.on(rt,dt)),()=>{V.current=!1,f&&nt&&(nt==null||nt.split(" ").forEach(Dt=>f.off(Dt,dt))),rt&&f&&rt.split(" ").forEach(Dt=>f.store.off(Dt,dt))}},[f,Y]),T.useEffect(()=>{V.current&&b&&H(A)},[f,y,b]);const X=[O,f,b];if(X.t=O,X.i18n=f,X.ready=b,b||!b&&!g)return X;throw new Promise(nt=>{i.lng?hm(f,i.lng,m,()=>nt()):_o(f,m,()=>nt())})};function gg(l){var i,s,o="";if(typeof l=="string"||typeof l=="number")o+=l;else if(typeof l=="object")if(Array.isArray(l)){var c=l.length;for(i=0;i<c;i++)l[i]&&(s=gg(l[i]))&&(o&&(o+=" "),o+=s)}else for(s in l)l[s]&&(o&&(o+=" "),o+=s);return o}function K1(){for(var l,i,s=0,o="",c=arguments.length;s<c;s++)(l=arguments[s])&&(i=gg(l))&&(o&&(o+=" "),o+=i);return o}function ne(...l){return K1(l)}function YS(l){return l?new Date(l).toLocaleString():"-"}function qS(l,i="just now"){if(!l)return"";const s=Math.floor((Date.now()-new Date(l).getTime())/6e4);if(s<1)return i;if(s<60)return`${s}m`;const o=Math.floor(s/60);return o<24?`${o}h`:`${Math.floor(o/24)}d`}const mm=l=>{let i;const s=new Set,o=(m,b)=>{const v=typeof m=="function"?m(i):m;if(!Object.is(v,i)){const A=i;i=b??(typeof v!="object"||v===null)?v:Object.assign({},i,v),s.forEach(N=>N(i,A))}},c=()=>i,g={setState:o,getState:c,getInitialState:()=>y,subscribe:m=>(s.add(m),()=>s.delete(m))},y=i=l(o,c,g);return g},X1=(l=>l?mm(l):mm),Q1=l=>l;function Z1(l,i=Q1){const s=In.useSyncExternalStore(l.subscribe,In.useCallback(()=>i(l.getState()),[l,i]),In.useCallback(()=>i(l.getInitialState()),[l,i]));return In.useDebugValue(s),s}const gm=l=>{const i=X1(l),s=o=>Z1(i,o);return Object.assign(s,i),s},pg=(l=>l?gm(l):gm),Go=pg(l=>({snapshot:null,setSnapshot:i=>l({snapshot:i})}));function pm(l){Go.getState().setSnapshot(l)}function J1(){return Go.getState().snapshot}function $1(l){return!!(l!=null&&l.knowledge.some(i=>i.enabled!==!1))}function F1(l){return!!(l!=null&&l.schedulers.some(i=>i.enabled!==!1))}function W1(l){var i;return!!((i=l==null?void 0:l.monitors)!=null&&i.some(s=>s.enabled!==!1))}function ym(l){return!!(l!=null&&l.agents.some(i=>i.agentType))}function I1(l=J1()){const i=!!l,s=i?ym(l):!0;return{desktopRuntime:!0,desktopChat:s,chatRoute:i?s:!0,desktopWorkspace:i?ym(l):!0,knowledgeModule:i?$1(l):!0,schedulerModule:i?F1(l):!0,monitorModule:i?W1(l):!0}}function Ko(){const l=Go(i=>i.snapshot);return I1(l)}function vm(l){return l==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":l}function bm(l){document.documentElement.classList.toggle("dark",l==="dark")}const yg=pg(l=>({theme:"dark",resolved:"dark",setTheme:i=>{const s=vm(i);localStorage.setItem("cc_theme",i),bm(s),l({theme:i,resolved:s})},init:()=>{const i=localStorage.getItem("cc_theme")||"dark",s=vm(i);bm(s),l({theme:i,resolved:s})}})),P1="modulepreload",tb=function(l,i){return new URL(l,i).href},Sm={},Ae=function(i,s,o){let c=Promise.resolve();if(s&&s.length>0){let h=function(b){return Promise.all(b.map(v=>Promise.resolve(v).then(A=>({status:"fulfilled",value:A}),A=>({status:"rejected",reason:A}))))};const g=document.getElementsByTagName("link"),y=document.querySelector("meta[property=csp-nonce]"),m=(y==null?void 0:y.nonce)||(y==null?void 0:y.getAttribute("nonce"));c=h(s.map(b=>{if(b=tb(b,o),b in Sm)return;Sm[b]=!0;const v=b.endsWith(".css"),A=v?'[rel="stylesheet"]':"";if(!!o)for(let H=g.length-1;H>=0;H--){const Y=g[H];if(Y.href===b&&(!v||Y.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${b}"]${A}`))return;const O=document.createElement("link");if(O.rel=v?"stylesheet":P1,v||(O.as="script"),O.crossOrigin="",O.href=b,m&&O.setAttribute("nonce",m),document.head.appendChild(O),v)return new Promise((H,Y)=>{O.addEventListener("load",H),O.addEventListener("error",()=>Y(new Error(`Unable to preload CSS for ${b}`)))})}))}function f(h){const g=new Event("vite:preloadError",{cancelable:!0});if(g.payload=h,window.dispatchEvent(g),!g.defaultPrevented)throw h}return c.then(h=>{for(const g of h||[])g.status==="rejected"&&f(g.reason);return i().catch(f)})},eb=T.lazy(()=>Ae(()=>import("./Dashboard-Bvp7-_2z.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url)),ab=T.lazy(()=>Ae(()=>import("./ThreadChat-BxXRpYa1.js").then(l=>l.T),__vite__mapDeps([8,9,10,7,11,12,13,14,15,16,17,5]),import.meta.url)),nb=T.lazy(()=>Ae(()=>import("./Workspace-YC0pC7cM.js"),__vite__mapDeps([18,12,13,11,19,10,3,4,1,9,16,20,21]),import.meta.url)),lb=T.lazy(()=>Ae(()=>import("./AutomationList-DR-micIT.js"),__vite__mapDeps([22,5,1,2,19,13,10,3,4,12,11]),import.meta.url)),ib=T.lazy(()=>Ae(()=>import("./Config-BKqxfhZi.js"),__vite__mapDeps([23,2,11,4,1,7,21]),import.meta.url)),ub=T.lazy(()=>Ae(()=>import("./Logs-B6cXFvW4.js"),__vite__mapDeps([24,1,2,11,19,13,10,4,25,14]),import.meta.url)),rb=T.lazy(()=>Ae(()=>import("./KnowledgeHome-Cqk5_nJh.js"),__vite__mapDeps([26,1,12,13,11,3,17,15,16,14,20,6]),import.meta.url)),sb=T.lazy(()=>Ae(()=>import("./KnowledgeDetail-DjXYNMIs.js"),__vite__mapDeps([27,1,11,3,17,25,14,16]),import.meta.url));class ob{constructor(){Au(this,"routes",new Map);Au(this,"navItems",new Map)}registerRoute(i){this.routes.set(i.id,i)}registerNavItem(i){this.navItems.set(i.id,i)}listRoutes(){return[...this.routes.values()].sort((i,s)=>i.order-s.order)}listNavItems(){return[...this.navItems.values()].sort((i,s)=>i.order-s.order)}}function ka(l,i,s="/"){return l?i:j.jsx(qa,{to:s,replace:!0})}function cb(){const{name:l}=lg();return j.jsx(qa,{to:l?`/workspace?project=${encodeURIComponent(l)}`:"/workspace",replace:!0})}function xm(){const{project:l,id:i}=lg(),s=new URLSearchParams;return l&&s.set("project",l),i&&s.set("session",i),j.jsx(qa,{to:`/chat${s.toString()?`?${s.toString()}`:""}`,replace:!0})}function fb(l){[{id:"dashboard",index:!0,titleKey:"nav.dashboard",order:10,element:()=>j.jsx(eb,{})},{id:"chat",path:"chat",titleKey:"nav.chat",order:20,element:({features:s})=>ka(s.chatRoute,j.jsx(ab,{}))},{id:"workspace",path:"workspace",titleKey:"nav.workspace",order:30,element:({features:s})=>ka(s.desktopWorkspace,j.jsx(nb,{}))},{id:"knowledge",path:"knowledge",titleKey:"nav.knowledge",order:40,element:({features:s})=>ka(s.knowledgeModule,j.jsx(rb,{}))},{id:"knowledge-detail",path:"knowledge/:knowledgebaseId",titleKey:"nav.knowledge",order:41,element:({features:s})=>ka(s.knowledgeModule,j.jsx(sb,{}))},{id:"projects",path:"projects",titleKey:"nav.projects",order:50,element:({features:s})=>ka(s.desktopWorkspace,j.jsx(qa,{to:"/workspace",replace:!0}))},{id:"project-detail",path:"projects/:name",titleKey:"nav.projects",order:51,element:()=>j.jsx(cb,{})},{id:"sessions",path:"sessions",titleKey:"nav.sessions",order:60,element:()=>j.jsx(xm,{})},{id:"session-detail",path:"sessions/:project/:id",titleKey:"nav.sessions",order:61,element:()=>j.jsx(xm,{})},{id:"automations",path:"automations",titleKey:"nav.automations",order:70,element:({features:s})=>ka(s.schedulerModule||s.monitorModule,j.jsx(lb,{}))},{id:"cron-legacy",path:"cron",titleKey:"nav.automations",order:71,element:({features:s})=>ka(s.schedulerModule||s.monitorModule,j.jsx(qa,{to:"/automations?origin=scheduled-job",replace:!0}))},{id:"monitors-legacy",path:"monitors",titleKey:"nav.automations",order:72,element:({features:s})=>ka(s.schedulerModule||s.monitorModule,j.jsx(qa,{to:"/automations?origin=automation-monitor",replace:!0}))},{id:"system",path:"system",titleKey:"nav.system",order:80,element:()=>j.jsx(ib,{})},{id:"system-logs",path:"system/logs",titleKey:"nav.system",order:81,element:()=>j.jsx(ub,{})}].forEach(s=>l.registerRoute(s))}function db(l){[{id:"dashboard",path:"/",labelKey:"nav.dashboard",icon:Sy,order:10,end:!0},{id:"chat",path:"/chat",labelKey:"nav.chat",icon:Oy,order:20,visible:({features:s})=>s.chatRoute,resolveLabelKey:({features:s})=>s.desktopChat?"nav.chat":"nav.chatWeb"},{id:"workspace",path:"/workspace",labelKey:"nav.workspace",icon:ky,order:30,visible:({features:s})=>s.desktopWorkspace},{id:"knowledge",path:"/knowledge",labelKey:"nav.knowledge",icon:Ey,order:40,visible:({features:s})=>s.knowledgeModule},{id:"projects",path:"/projects",labelKey:"nav.projects",icon:py,order:50,visible:()=>!1},{id:"sessions",path:"/sessions",labelKey:"nav.sessions",icon:Ry,order:60,visible:()=>!1},{id:"automations",path:"/automations",labelKey:"nav.automations",icon:cy,order:70,visible:({features:s})=>s.schedulerModule||s.monitorModule},{id:"system",path:"/system",labelKey:"nav.system",icon:Ly,order:80}].forEach(s=>l.registerNavItem(s))}const qu=new ob;fb(qu);db(qu);function hb({className:l,markClassName:i,showWordmark:s=!1}){const o=T.useId(),c=`${o}-bg`,f=`${o}-stroke`;return j.jsxs("div",{className:ne("inline-flex items-center gap-3",l),children:[j.jsxs("svg",{className:ne("h-8 w-8 shrink-0",i),viewBox:"0 0 64 64",role:"img","aria-label":"AgentDock",fill:"none",children:[j.jsxs("defs",{children:[j.jsxs("linearGradient",{id:c,x1:"7",y1:"5",x2:"57",y2:"59",gradientUnits:"userSpaceOnUse",children:[j.jsx("stop",{className:"[stop-color:#FFFFFF] dark:[stop-color:#3A3A3C]"}),j.jsx("stop",{offset:"0.52",className:"[stop-color:#F5F5F7] dark:[stop-color:#2C2C2E]"}),j.jsx("stop",{offset:"1",className:"[stop-color:#E5E5EA] dark:[stop-color:#1C1C1E]"})]}),j.jsxs("linearGradient",{id:f,x1:"18",y1:"16",x2:"47",y2:"48",gradientUnits:"userSpaceOnUse",children:[j.jsx("stop",{stopColor:"#5AC8FA"}),j.jsx("stop",{offset:"0.44",stopColor:"#0A84FF"}),j.jsx("stop",{offset:"1",stopColor:"#007AFF"})]})]}),j.jsx("rect",{x:"4",y:"4",width:"56",height:"56",rx:"16",fill:`url(#${c})`,className:"stroke-black/10 dark:stroke-white/10",strokeWidth:"1.5"}),j.jsx("path",{d:"M14.5 45L25.3 20.1C26.1 18.1 28.9 18.1 29.8 20.1L40.8 45",stroke:`url(#${f})`,strokeWidth:"7.5",strokeLinecap:"round",strokeLinejoin:"round"}),j.jsx("path",{d:"M20.8 37.5H34.7",className:"stroke-white dark:stroke-white",strokeWidth:"5.25",strokeLinecap:"round"}),j.jsx("path",{d:"M33.8 20.2H37.4C45.1 20.2 50 25.6 50 32.5C50 39.4 45.1 44.8 37.4 44.8H33.8",stroke:`url(#${f})`,strokeWidth:"7",strokeLinecap:"round",strokeLinejoin:"round",opacity:"0.82"}),j.jsx("path",{d:"M34 25.5V39.5",className:"stroke-black/70 dark:stroke-black/80",strokeWidth:"3",strokeLinecap:"round",opacity:"0.18"})]}),s&&j.jsx("span",{className:"text-sm font-semibold tracking-tight text-foreground",children:"AgentDock"})]})}var yo={};const et=l=>typeof l=="string",Il=()=>{let l,i;const s=new Promise((o,c)=>{l=o,i=c});return s.resolve=l,s.reject=i,s},Em=l=>l==null?"":""+l,mb=(l,i,s)=>{l.forEach(o=>{i[o]&&(s[o]=i[o])})},gb=/###/g,Tm=l=>l&&l.indexOf("###")>-1?l.replace(gb,"."):l,Rm=l=>!l||et(l),ti=(l,i,s)=>{const o=et(i)?i.split("."):i;let c=0;for(;c<o.length-1;){if(Rm(l))return{};const f=Tm(o[c]);!l[f]&&s&&(l[f]=new s),Object.prototype.hasOwnProperty.call(l,f)?l=l[f]:l={},++c}return Rm(l)?{}:{obj:l,k:Tm(o[c])}},Am=(l,i,s)=>{const{obj:o,k:c}=ti(l,i,Object);if(o!==void 0||i.length===1){o[c]=s;return}let f=i[i.length-1],h=i.slice(0,i.length-1),g=ti(l,h,Object);for(;g.obj===void 0&&h.length;)f=`${h[h.length-1]}.${f}`,h=h.slice(0,h.length-1),g=ti(l,h,Object),g!=null&&g.obj&&typeof g.obj[`${g.k}.${f}`]<"u"&&(g.obj=void 0);g.obj[`${g.k}.${f}`]=s},pb=(l,i,s,o)=>{const{obj:c,k:f}=ti(l,i,Object);c[f]=c[f]||[],c[f].push(s)},ju=(l,i)=>{const{obj:s,k:o}=ti(l,i);if(s&&Object.prototype.hasOwnProperty.call(s,o))return s[o]},yb=(l,i,s)=>{const o=ju(l,s);return o!==void 0?o:ju(i,s)},vg=(l,i,s)=>{for(const o in i)o!=="__proto__"&&o!=="constructor"&&(o in l?et(l[o])||l[o]instanceof String||et(i[o])||i[o]instanceof String?s&&(l[o]=i[o]):vg(l[o],i[o],s):l[o]=i[o]);return l},on=l=>l.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var vb={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const bb=l=>et(l)?l.replace(/[&<>"'\/]/g,i=>vb[i]):l;class Sb{constructor(i){this.capacity=i,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(i){const s=this.regExpMap.get(i);if(s!==void 0)return s;const o=new RegExp(i);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(i,o),this.regExpQueue.push(i),o}}const xb=[" ",",","?","!",";"],Eb=new Sb(20),Tb=(l,i,s)=>{i=i||"",s=s||"";const o=xb.filter(h=>i.indexOf(h)<0&&s.indexOf(h)<0);if(o.length===0)return!0;const c=Eb.getRegExp(`(${o.map(h=>h==="?"?"\\?":h).join("|")})`);let f=!c.test(l);if(!f){const h=l.indexOf(s);h>0&&!c.test(l.substring(0,h))&&(f=!0)}return f},zo=(l,i,s=".")=>{if(!l)return;if(l[i])return Object.prototype.hasOwnProperty.call(l,i)?l[i]:void 0;const o=i.split(s);let c=l;for(let f=0;f<o.length;){if(!c||typeof c!="object")return;let h,g="";for(let y=f;y<o.length;++y)if(y!==f&&(g+=s),g+=o[y],h=c[g],h!==void 0){if(["string","number","boolean"].indexOf(typeof h)>-1&&y<o.length-1)continue;f+=y-f+1;break}c=h}return c},li=l=>l==null?void 0:l.replace(/_/g,"-"),Rb={type:"logger",log(l){this.output("log",l)},warn(l){this.output("warn",l)},error(l){this.output("error",l)},output(l,i){var s,o;(o=(s=console==null?void 0:console[l])==null?void 0:s.apply)==null||o.call(s,console,i)}};class wu{constructor(i,s={}){this.init(i,s)}init(i,s={}){this.prefix=s.prefix||"i18next:",this.logger=i||Rb,this.options=s,this.debug=s.debug}log(...i){return this.forward(i,"log","",!0)}warn(...i){return this.forward(i,"warn","",!0)}error(...i){return this.forward(i,"error","")}deprecate(...i){return this.forward(i,"warn","WARNING DEPRECATED: ",!0)}forward(i,s,o,c){return c&&!this.debug?null:(et(i[0])&&(i[0]=`${o}${this.prefix} ${i[0]}`),this.logger[s](i))}create(i){return new wu(this.logger,{prefix:`${this.prefix}:${i}:`,...this.options})}clone(i){return i=i||this.options,i.prefix=i.prefix||this.prefix,new wu(this.logger,i)}}var Je=new wu;class Vu{constructor(){this.observers={}}on(i,s){return i.split(" ").forEach(o=>{this.observers[o]||(this.observers[o]=new Map);const c=this.observers[o].get(s)||0;this.observers[o].set(s,c+1)}),this}off(i,s){if(this.observers[i]){if(!s){delete this.observers[i];return}this.observers[i].delete(s)}}emit(i,...s){this.observers[i]&&Array.from(this.observers[i].entries()).forEach(([c,f])=>{for(let h=0;h<f;h++)c(...s)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([c,f])=>{for(let h=0;h<f;h++)c.apply(c,[i,...s])})}}class Om extends Vu{constructor(i,s={ns:["translation"],defaultNS:"translation"}){super(),this.data=i||{},this.options=s,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(i){this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}removeNamespaces(i){const s=this.options.ns.indexOf(i);s>-1&&this.options.ns.splice(s,1)}getResource(i,s,o,c={}){var m,b;const f=c.keySeparator!==void 0?c.keySeparator:this.options.keySeparator,h=c.ignoreJSONStructure!==void 0?c.ignoreJSONStructure:this.options.ignoreJSONStructure;let g;i.indexOf(".")>-1?g=i.split("."):(g=[i,s],o&&(Array.isArray(o)?g.push(...o):et(o)&&f?g.push(...o.split(f)):g.push(o)));const y=ju(this.data,g);return!y&&!s&&!o&&i.indexOf(".")>-1&&(i=g[0],s=g[1],o=g.slice(2).join(".")),y||!h||!et(o)?y:zo((b=(m=this.data)==null?void 0:m[i])==null?void 0:b[s],o,f)}addResource(i,s,o,c,f={silent:!1}){const h=f.keySeparator!==void 0?f.keySeparator:this.options.keySeparator;let g=[i,s];o&&(g=g.concat(h?o.split(h):o)),i.indexOf(".")>-1&&(g=i.split("."),c=s,s=g[1]),this.addNamespaces(s),Am(this.data,g,c),f.silent||this.emit("added",i,s,o,c)}addResources(i,s,o,c={silent:!1}){for(const f in o)(et(o[f])||Array.isArray(o[f]))&&this.addResource(i,s,f,o[f],{silent:!0});c.silent||this.emit("added",i,s,o)}addResourceBundle(i,s,o,c,f,h={silent:!1,skipCopy:!1}){let g=[i,s];i.indexOf(".")>-1&&(g=i.split("."),c=o,o=s,s=g[1]),this.addNamespaces(s);let y=ju(this.data,g)||{};h.skipCopy||(o=JSON.parse(JSON.stringify(o))),c?vg(y,o,f):y={...y,...o},Am(this.data,g,y),h.silent||this.emit("added",i,s,o)}removeResourceBundle(i,s){this.hasResourceBundle(i,s)&&delete this.data[i][s],this.removeNamespaces(s),this.emit("removed",i,s)}hasResourceBundle(i,s){return this.getResource(i,s)!==void 0}getResourceBundle(i,s){return s||(s=this.options.defaultNS),this.getResource(i,s)}getDataByLanguage(i){return this.data[i]}hasLanguageSomeTranslations(i){const s=this.getDataByLanguage(i);return!!(s&&Object.keys(s)||[]).find(c=>s[c]&&Object.keys(s[c]).length>0)}toJSON(){return this.data}}var bg={processors:{},addPostProcessor(l){this.processors[l.name]=l},handle(l,i,s,o,c){return l.forEach(f=>{var h;i=((h=this.processors[f])==null?void 0:h.process(i,s,o,c))??i}),i}};const Sg=Symbol("i18next/PATH_KEY");function Ab(){const l=[],i=Object.create(null);let s;return i.get=(o,c)=>{var f;return(f=s==null?void 0:s.revoke)==null||f.call(s),c===Sg?l:(l.push(c),s=Proxy.revocable(o,i),s.proxy)},Proxy.revocable(Object.create(null),i).proxy}function Pn(l,i){const{[Sg]:s}=l(Ab()),o=(i==null?void 0:i.keySeparator)??".",c=(i==null?void 0:i.nsSeparator)??":";if(s.length>1&&c){const f=i==null?void 0:i.ns,h=Array.isArray(f)?f:null;if(h&&h.length>1&&h.slice(1).includes(s[0]))return`${s[0]}${c}${s.slice(1).join(o)}`}return s.join(o)}const _m={},vo=l=>!et(l)&&typeof l!="boolean"&&typeof l!="number";class Uu extends Vu{constructor(i,s={}){super(),mb(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],i,this),this.options=s,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Je.create("translator")}changeLanguage(i){i&&(this.language=i)}exists(i,s={interpolation:{}}){const o={...s};if(i==null)return!1;const c=this.resolve(i,o);if((c==null?void 0:c.res)===void 0)return!1;const f=vo(c.res);return!(o.returnObjects===!1&&f)}extractFromKey(i,s){let o=s.nsSeparator!==void 0?s.nsSeparator:this.options.nsSeparator;o===void 0&&(o=":");const c=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator;let f=s.ns||this.options.defaultNS||[];const h=o&&i.indexOf(o)>-1,g=!this.options.userDefinedKeySeparator&&!s.keySeparator&&!this.options.userDefinedNsSeparator&&!s.nsSeparator&&!Tb(i,o,c);if(h&&!g){const y=i.match(this.interpolator.nestingRegexp);if(y&&y.length>0)return{key:i,namespaces:et(f)?[f]:f};const m=i.split(o);(o!==c||o===c&&this.options.ns.indexOf(m[0])>-1)&&(f=m.shift()),i=m.join(c)}return{key:i,namespaces:et(f)?[f]:f}}translate(i,s,o){let c=typeof s=="object"?{...s}:s;if(typeof c!="object"&&this.options.overloadTranslationOptionHandler&&(c=this.options.overloadTranslationOptionHandler(arguments)),typeof c=="object"&&(c={...c}),c||(c={}),i==null)return"";typeof i=="function"&&(i=Pn(i,{...this.options,...c})),Array.isArray(i)||(i=[String(i)]),i=i.map(zt=>typeof zt=="function"?Pn(zt,{...this.options,...c}):String(zt));const f=c.returnDetails!==void 0?c.returnDetails:this.options.returnDetails,h=c.keySeparator!==void 0?c.keySeparator:this.options.keySeparator,{key:g,namespaces:y}=this.extractFromKey(i[i.length-1],c),m=y[y.length-1];let b=c.nsSeparator!==void 0?c.nsSeparator:this.options.nsSeparator;b===void 0&&(b=":");const v=c.lng||this.language,A=c.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((v==null?void 0:v.toLowerCase())==="cimode")return A?f?{res:`${m}${b}${g}`,usedKey:g,exactUsedKey:g,usedLng:v,usedNS:m,usedParams:this.getUsedParamsDetails(c)}:`${m}${b}${g}`:f?{res:g,usedKey:g,exactUsedKey:g,usedLng:v,usedNS:m,usedParams:this.getUsedParamsDetails(c)}:g;const N=this.resolve(i,c);let O=N==null?void 0:N.res;const H=(N==null?void 0:N.usedKey)||g,Y=(N==null?void 0:N.exactUsedKey)||g,q=["[object Number]","[object Function]","[object RegExp]"],V=c.joinArrays!==void 0?c.joinArrays:this.options.joinArrays,X=!this.i18nFormat||this.i18nFormat.handleAsObject,$=c.count!==void 0&&!et(c.count),tt=Uu.hasDefaultValue(c),st=$?this.pluralResolver.getSuffix(v,c.count,c):"",J=c.ordinal&&$?this.pluralResolver.getSuffix(v,c.count,{ordinal:!1}):"",nt=$&&!c.ordinal&&c.count===0,rt=nt&&c[`defaultValue${this.options.pluralSeparator}zero`]||c[`defaultValue${st}`]||c[`defaultValue${J}`]||c.defaultValue;let dt=O;X&&!O&&tt&&(dt=rt);const Dt=vo(dt),$t=Object.prototype.toString.apply(dt);if(X&&dt&&Dt&&q.indexOf($t)<0&&!(et(V)&&Array.isArray(dt))){if(!c.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const zt=this.options.returnedObjectHandler?this.options.returnedObjectHandler(H,dt,{...c,ns:y}):`key '${g} (${this.language})' returned an object instead of string.`;return f?(N.res=zt,N.usedParams=this.getUsedParamsDetails(c),N):zt}if(h){const zt=Array.isArray(dt),Lt=zt?[]:{},Ut=zt?Y:H;for(const D in dt)if(Object.prototype.hasOwnProperty.call(dt,D)){const G=`${Ut}${h}${D}`;tt&&!O?Lt[D]=this.translate(G,{...c,defaultValue:vo(rt)?rt[D]:void 0,joinArrays:!1,ns:y}):Lt[D]=this.translate(G,{...c,joinArrays:!1,ns:y}),Lt[D]===G&&(Lt[D]=dt[D])}O=Lt}}else if(X&&et(V)&&Array.isArray(O))O=O.join(V),O&&(O=this.extendTranslation(O,i,c,o));else{let zt=!1,Lt=!1;!this.isValidLookup(O)&&tt&&(zt=!0,O=rt),this.isValidLookup(O)||(Lt=!0,O=g);const D=(c.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&Lt?void 0:O,G=tt&&rt!==O&&this.options.updateMissing;if(Lt||zt||G){if(this.logger.log(G?"updateKey":"missingKey",v,m,g,G?rt:O),h){const x=this.resolve(g,{...c,keySeparator:!1});x&&x.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 I=[];const pt=this.languageUtils.getFallbackCodes(this.options.fallbackLng,c.lng||this.language);if(this.options.saveMissingTo==="fallback"&&pt&&pt[0])for(let x=0;x<pt.length;x++)I.push(pt[x]);else this.options.saveMissingTo==="all"?I=this.languageUtils.toResolveHierarchy(c.lng||this.language):I.push(c.lng||this.language);const xt=(x,w,K)=>{var at;const Q=tt&&K!==O?K:D;this.options.missingKeyHandler?this.options.missingKeyHandler(x,m,w,Q,G,c):(at=this.backendConnector)!=null&&at.saveMissing&&this.backendConnector.saveMissing(x,m,w,Q,G,c),this.emit("missingKey",x,m,w,O)};this.options.saveMissing&&(this.options.saveMissingPlurals&&$?I.forEach(x=>{const w=this.pluralResolver.getSuffixes(x,c);nt&&c[`defaultValue${this.options.pluralSeparator}zero`]&&w.indexOf(`${this.options.pluralSeparator}zero`)<0&&w.push(`${this.options.pluralSeparator}zero`),w.forEach(K=>{xt([x],g+K,c[`defaultValue${K}`]||rt)})}):xt(I,g,rt))}O=this.extendTranslation(O,i,c,N,o),Lt&&O===g&&this.options.appendNamespaceToMissingKey&&(O=`${m}${b}${g}`),(Lt||zt)&&this.options.parseMissingKeyHandler&&(O=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${m}${b}${g}`:g,zt?O:void 0,c))}return f?(N.res=O,N.usedParams=this.getUsedParamsDetails(c),N):O}extendTranslation(i,s,o,c,f){var y,m;if((y=this.i18nFormat)!=null&&y.parse)i=this.i18nFormat.parse(i,{...this.options.interpolation.defaultVariables,...o},o.lng||this.language||c.usedLng,c.usedNS,c.usedKey,{resolved:c});else if(!o.skipInterpolation){o.interpolation&&this.interpolator.init({...o,interpolation:{...this.options.interpolation,...o.interpolation}});const b=et(i)&&(((m=o==null?void 0:o.interpolation)==null?void 0:m.skipOnVariables)!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let v;if(b){const N=i.match(this.interpolator.nestingRegexp);v=N&&N.length}let A=o.replace&&!et(o.replace)?o.replace:o;if(this.options.interpolation.defaultVariables&&(A={...this.options.interpolation.defaultVariables,...A}),i=this.interpolator.interpolate(i,A,o.lng||this.language||c.usedLng,o),b){const N=i.match(this.interpolator.nestingRegexp),O=N&&N.length;v<O&&(o.nest=!1)}!o.lng&&c&&c.res&&(o.lng=this.language||c.usedLng),o.nest!==!1&&(i=this.interpolator.nest(i,(...N)=>(f==null?void 0:f[0])===N[0]&&!o.context?(this.logger.warn(`It seems you are nesting recursively key: ${N[0]} in key: ${s[0]}`),null):this.translate(...N,s),o)),o.interpolation&&this.interpolator.reset()}const h=o.postProcess||this.options.postProcess,g=et(h)?[h]:h;return i!=null&&(g!=null&&g.length)&&o.applyPostProcessor!==!1&&(i=bg.handle(g,i,s,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...c,usedParams:this.getUsedParamsDetails(o)},...o}:o,this)),i}resolve(i,s={}){let o,c,f,h,g;return et(i)&&(i=[i]),Array.isArray(i)&&(i=i.map(y=>typeof y=="function"?Pn(y,{...this.options,...s}):y)),i.forEach(y=>{if(this.isValidLookup(o))return;const m=this.extractFromKey(y,s),b=m.key;c=b;let v=m.namespaces;this.options.fallbackNS&&(v=v.concat(this.options.fallbackNS));const A=s.count!==void 0&&!et(s.count),N=A&&!s.ordinal&&s.count===0,O=s.context!==void 0&&(et(s.context)||typeof s.context=="number")&&s.context!=="",H=s.lngs?s.lngs:this.languageUtils.toResolveHierarchy(s.lng||this.language,s.fallbackLng);v.forEach(Y=>{var q,V;this.isValidLookup(o)||(g=Y,!_m[`${H[0]}-${Y}`]&&((q=this.utils)!=null&&q.hasLoadedNamespace)&&!((V=this.utils)!=null&&V.hasLoadedNamespace(g))&&(_m[`${H[0]}-${Y}`]=!0,this.logger.warn(`key "${c}" for languages "${H.join(", ")}" won't get resolved as namespace "${g}" 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!!!")),H.forEach(X=>{var st;if(this.isValidLookup(o))return;h=X;const $=[b];if((st=this.i18nFormat)!=null&&st.addLookupKeys)this.i18nFormat.addLookupKeys($,b,X,Y,s);else{let J;A&&(J=this.pluralResolver.getSuffix(X,s.count,s));const nt=`${this.options.pluralSeparator}zero`,rt=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(A&&(s.ordinal&&J.indexOf(rt)===0&&$.push(b+J.replace(rt,this.options.pluralSeparator)),$.push(b+J),N&&$.push(b+nt)),O){const dt=`${b}${this.options.contextSeparator||"_"}${s.context}`;$.push(dt),A&&(s.ordinal&&J.indexOf(rt)===0&&$.push(dt+J.replace(rt,this.options.pluralSeparator)),$.push(dt+J),N&&$.push(dt+nt))}}let tt;for(;tt=$.pop();)this.isValidLookup(o)||(f=tt,o=this.getResource(X,Y,tt,s))}))})}),{res:o,usedKey:c,exactUsedKey:f,usedLng:h,usedNS:g}}isValidLookup(i){return i!==void 0&&!(!this.options.returnNull&&i===null)&&!(!this.options.returnEmptyString&&i==="")}getResource(i,s,o,c={}){var f;return(f=this.i18nFormat)!=null&&f.getResource?this.i18nFormat.getResource(i,s,o,c):this.resourceStore.getResource(i,s,o,c)}getUsedParamsDetails(i={}){const s=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],o=i.replace&&!et(i.replace);let c=o?i.replace:i;if(o&&typeof i.count<"u"&&(c.count=i.count),this.options.interpolation.defaultVariables&&(c={...this.options.interpolation.defaultVariables,...c}),!o){c={...c};for(const f of s)delete c[f]}return c}static hasDefaultValue(i){const s="defaultValue";for(const o in i)if(Object.prototype.hasOwnProperty.call(i,o)&&s===o.substring(0,s.length)&&i[o]!==void 0)return!0;return!1}}class Cm{constructor(i){this.options=i,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Je.create("languageUtils")}getScriptPartFromCode(i){if(i=li(i),!i||i.indexOf("-")<0)return null;const s=i.split("-");return s.length===2||(s.pop(),s[s.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(s.join("-"))}getLanguagePartFromCode(i){if(i=li(i),!i||i.indexOf("-")<0)return i;const s=i.split("-");return this.formatLanguageCode(s[0])}formatLanguageCode(i){if(et(i)&&i.indexOf("-")>-1){let s;try{s=Intl.getCanonicalLocales(i)[0]}catch{}return s&&this.options.lowerCaseLng&&(s=s.toLowerCase()),s||(this.options.lowerCaseLng?i.toLowerCase():i)}return this.options.cleanCode||this.options.lowerCaseLng?i.toLowerCase():i}isSupportedCode(i){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(i=this.getLanguagePartFromCode(i)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(i)>-1}getBestMatchFromCodes(i){if(!i)return null;let s;return i.forEach(o=>{if(s)return;const c=this.formatLanguageCode(o);(!this.options.supportedLngs||this.isSupportedCode(c))&&(s=c)}),!s&&this.options.supportedLngs&&i.forEach(o=>{if(s)return;const c=this.getScriptPartFromCode(o);if(this.isSupportedCode(c))return s=c;const f=this.getLanguagePartFromCode(o);if(this.isSupportedCode(f))return s=f;s=this.options.supportedLngs.find(h=>{if(h===f)return h;if(!(h.indexOf("-")<0&&f.indexOf("-")<0)&&(h.indexOf("-")>0&&f.indexOf("-")<0&&h.substring(0,h.indexOf("-"))===f||h.indexOf(f)===0&&f.length>1))return h})}),s||(s=this.getFallbackCodes(this.options.fallbackLng)[0]),s}getFallbackCodes(i,s){if(!i)return[];if(typeof i=="function"&&(i=i(s)),et(i)&&(i=[i]),Array.isArray(i))return i;if(!s)return i.default||[];let o=i[s];return o||(o=i[this.getScriptPartFromCode(s)]),o||(o=i[this.formatLanguageCode(s)]),o||(o=i[this.getLanguagePartFromCode(s)]),o||(o=i.default),o||[]}toResolveHierarchy(i,s){const o=this.getFallbackCodes((s===!1?[]:s)||this.options.fallbackLng||[],i),c=[],f=h=>{h&&(this.isSupportedCode(h)?c.push(h):this.logger.warn(`rejecting language code not found in supportedLngs: ${h}`))};return et(i)&&(i.indexOf("-")>-1||i.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&f(this.formatLanguageCode(i)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&f(this.getScriptPartFromCode(i)),this.options.load!=="currentOnly"&&f(this.getLanguagePartFromCode(i))):et(i)&&f(this.formatLanguageCode(i)),o.forEach(h=>{c.indexOf(h)<0&&f(this.formatLanguageCode(h))}),c}}const zm={zero:0,one:1,two:2,few:3,many:4,other:5},Nm={select:l=>l===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class Ob{constructor(i,s={}){this.languageUtils=i,this.options=s,this.logger=Je.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(i,s={}){const o=li(i==="dev"?"en":i),c=s.ordinal?"ordinal":"cardinal",f=JSON.stringify({cleanedCode:o,type:c});if(f in this.pluralRulesCache)return this.pluralRulesCache[f];let h;try{h=new Intl.PluralRules(o,{type:c})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl polyfill!"),Nm;if(!i.match(/-|_/))return Nm;const y=this.languageUtils.getLanguagePartFromCode(i);h=this.getRule(y,s)}return this.pluralRulesCache[f]=h,h}needsPlural(i,s={}){let o=this.getRule(i,s);return o||(o=this.getRule("dev",s)),(o==null?void 0:o.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(i,s,o={}){return this.getSuffixes(i,o).map(c=>`${s}${c}`)}getSuffixes(i,s={}){let o=this.getRule(i,s);return o||(o=this.getRule("dev",s)),o?o.resolvedOptions().pluralCategories.sort((c,f)=>zm[c]-zm[f]).map(c=>`${this.options.prepend}${s.ordinal?`ordinal${this.options.prepend}`:""}${c}`):[]}getSuffix(i,s,o={}){const c=this.getRule(i,o);return c?`${this.options.prepend}${o.ordinal?`ordinal${this.options.prepend}`:""}${c.select(s)}`:(this.logger.warn(`no plural rule found for: ${i}`),this.getSuffix("dev",s,o))}}const Mm=(l,i,s,o=".",c=!0)=>{let f=yb(l,i,s);return!f&&c&&et(s)&&(f=zo(l,s,o),f===void 0&&(f=zo(i,s,o))),f},bo=l=>l.replace(/\$/g,"$$$$");class Dm{constructor(i={}){var s;this.logger=Je.create("interpolator"),this.options=i,this.format=((s=i==null?void 0:i.interpolation)==null?void 0:s.format)||(o=>o),this.init(i)}init(i={}){i.interpolation||(i.interpolation={escapeValue:!0});const{escape:s,escapeValue:o,useRawValueToEscape:c,prefix:f,prefixEscaped:h,suffix:g,suffixEscaped:y,formatSeparator:m,unescapeSuffix:b,unescapePrefix:v,nestingPrefix:A,nestingPrefixEscaped:N,nestingSuffix:O,nestingSuffixEscaped:H,nestingOptionsSeparator:Y,maxReplaces:q,alwaysFormat:V}=i.interpolation;this.escape=s!==void 0?s:bb,this.escapeValue=o!==void 0?o:!0,this.useRawValueToEscape=c!==void 0?c:!1,this.prefix=f?on(f):h||"{{",this.suffix=g?on(g):y||"}}",this.formatSeparator=m||",",this.unescapePrefix=b?"":v||"-",this.unescapeSuffix=this.unescapePrefix?"":b||"",this.nestingPrefix=A?on(A):N||on("$t("),this.nestingSuffix=O?on(O):H||on(")"),this.nestingOptionsSeparator=Y||",",this.maxReplaces=q||1e3,this.alwaysFormat=V!==void 0?V:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const i=(s,o)=>(s==null?void 0:s.source)===o?(s.lastIndex=0,s):new RegExp(o,"g");this.regexp=i(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=i(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=i(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(i,s,o,c){var N;let f,h,g;const y=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},m=O=>{if(O.indexOf(this.formatSeparator)<0){const V=Mm(s,y,O,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(V,void 0,o,{...c,...s,interpolationkey:O}):V}const H=O.split(this.formatSeparator),Y=H.shift().trim(),q=H.join(this.formatSeparator).trim();return this.format(Mm(s,y,Y,this.options.keySeparator,this.options.ignoreJSONStructure),q,o,{...c,...s,interpolationkey:Y})};this.resetRegExp();const b=(c==null?void 0:c.missingInterpolationHandler)||this.options.missingInterpolationHandler,v=((N=c==null?void 0:c.interpolation)==null?void 0:N.skipOnVariables)!==void 0?c.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:O=>bo(O)},{regex:this.regexp,safeValue:O=>this.escapeValue?bo(this.escape(O)):bo(O)}].forEach(O=>{for(g=0;f=O.regex.exec(i);){const H=f[1].trim();if(h=m(H),h===void 0)if(typeof b=="function"){const q=b(i,f,c);h=et(q)?q:""}else if(c&&Object.prototype.hasOwnProperty.call(c,H))h="";else if(v){h=f[0];continue}else this.logger.warn(`missed to pass in variable ${H} for interpolating ${i}`),h="";else!et(h)&&!this.useRawValueToEscape&&(h=Em(h));const Y=O.safeValue(h);if(i=i.replace(f[0],Y),v?(O.regex.lastIndex+=h.length,O.regex.lastIndex-=f[0].length):O.regex.lastIndex=0,g++,g>=this.maxReplaces)break}}),i}nest(i,s,o={}){let c,f,h;const g=(y,m)=>{const b=this.nestingOptionsSeparator;if(y.indexOf(b)<0)return y;const v=y.split(new RegExp(`${on(b)}[ ]*{`));let A=`{${v[1]}`;y=v[0],A=this.interpolate(A,h);const N=A.match(/'/g),O=A.match(/"/g);(((N==null?void 0:N.length)??0)%2===0&&!O||((O==null?void 0:O.length)??0)%2!==0)&&(A=A.replace(/'/g,'"'));try{h=JSON.parse(A),m&&(h={...m,...h})}catch(H){return this.logger.warn(`failed parsing options string in nesting for key ${y}`,H),`${y}${b}${A}`}return h.defaultValue&&h.defaultValue.indexOf(this.prefix)>-1&&delete h.defaultValue,y};for(;c=this.nestingRegexp.exec(i);){let y=[];h={...o},h=h.replace&&!et(h.replace)?h.replace:h,h.applyPostProcessor=!1,delete h.defaultValue;const m=/{.*}/.test(c[1])?c[1].lastIndexOf("}")+1:c[1].indexOf(this.formatSeparator);if(m!==-1&&(y=c[1].slice(m).split(this.formatSeparator).map(b=>b.trim()).filter(Boolean),c[1]=c[1].slice(0,m)),f=s(g.call(this,c[1].trim(),h),h),f&&c[0]===i&&!et(f))return f;et(f)||(f=Em(f)),f||(this.logger.warn(`missed to resolve ${c[1]} for nesting ${i}`),f=""),y.length&&(f=y.reduce((b,v)=>this.format(b,v,o.lng,{...o,interpolationkey:c[1].trim()}),f.trim())),i=i.replace(c[0],f),this.regexp.lastIndex=0}return i}}const _b=l=>{let i=l.toLowerCase().trim();const s={};if(l.indexOf("(")>-1){const o=l.split("(");i=o[0].toLowerCase().trim();const c=o[1].substring(0,o[1].length-1);i==="currency"&&c.indexOf(":")<0?s.currency||(s.currency=c.trim()):i==="relativetime"&&c.indexOf(":")<0?s.range||(s.range=c.trim()):c.split(";").forEach(h=>{if(h){const[g,...y]=h.split(":"),m=y.join(":").trim().replace(/^'+|'+$/g,""),b=g.trim();s[b]||(s[b]=m),m==="false"&&(s[b]=!1),m==="true"&&(s[b]=!0),isNaN(m)||(s[b]=parseInt(m,10))}})}return{formatName:i,formatOptions:s}},Lm=l=>{const i={};return(s,o,c)=>{let f=c;c&&c.interpolationkey&&c.formatParams&&c.formatParams[c.interpolationkey]&&c[c.interpolationkey]&&(f={...f,[c.interpolationkey]:void 0});const h=o+JSON.stringify(f);let g=i[h];return g||(g=l(li(o),c),i[h]=g),g(s)}},Cb=l=>(i,s,o)=>l(li(s),o)(i);class zb{constructor(i={}){this.logger=Je.create("formatter"),this.options=i,this.init(i)}init(i,s={interpolation:{}}){this.formatSeparator=s.interpolation.formatSeparator||",";const o=s.cacheInBuiltFormats?Lm:Cb;this.formats={number:o((c,f)=>{const h=new Intl.NumberFormat(c,{...f});return g=>h.format(g)}),currency:o((c,f)=>{const h=new Intl.NumberFormat(c,{...f,style:"currency"});return g=>h.format(g)}),datetime:o((c,f)=>{const h=new Intl.DateTimeFormat(c,{...f});return g=>h.format(g)}),relativetime:o((c,f)=>{const h=new Intl.RelativeTimeFormat(c,{...f});return g=>h.format(g,f.range||"day")}),list:o((c,f)=>{const h=new Intl.ListFormat(c,{...f});return g=>h.format(g)})}}add(i,s){this.formats[i.toLowerCase().trim()]=s}addCached(i,s){this.formats[i.toLowerCase().trim()]=Lm(s)}format(i,s,o,c={}){const f=s.split(this.formatSeparator);if(f.length>1&&f[0].indexOf("(")>1&&f[0].indexOf(")")<0&&f.find(g=>g.indexOf(")")>-1)){const g=f.findIndex(y=>y.indexOf(")")>-1);f[0]=[f[0],...f.splice(1,g)].join(this.formatSeparator)}return f.reduce((g,y)=>{var v;const{formatName:m,formatOptions:b}=_b(y);if(this.formats[m]){let A=g;try{const N=((v=c==null?void 0:c.formatParams)==null?void 0:v[c.interpolationkey])||{},O=N.locale||N.lng||c.locale||c.lng||o;A=this.formats[m](g,O,{...b,...c,...N})}catch(N){this.logger.warn(N)}return A}else this.logger.warn(`there was no format function for ${m}`);return g},i)}}const Nb=(l,i)=>{l.pending[i]!==void 0&&(delete l.pending[i],l.pendingCount--)};class Mb extends Vu{constructor(i,s,o,c={}){var f,h;super(),this.backend=i,this.store=s,this.services=o,this.languageUtils=o.languageUtils,this.options=c,this.logger=Je.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=c.maxParallelReads||10,this.readingCalls=0,this.maxRetries=c.maxRetries>=0?c.maxRetries:5,this.retryTimeout=c.retryTimeout>=1?c.retryTimeout:350,this.state={},this.queue=[],(h=(f=this.backend)==null?void 0:f.init)==null||h.call(f,o,c.backend,c)}queueLoad(i,s,o,c){const f={},h={},g={},y={};return i.forEach(m=>{let b=!0;s.forEach(v=>{const A=`${m}|${v}`;!o.reload&&this.store.hasResourceBundle(m,v)?this.state[A]=2:this.state[A]<0||(this.state[A]===1?h[A]===void 0&&(h[A]=!0):(this.state[A]=1,b=!1,h[A]===void 0&&(h[A]=!0),f[A]===void 0&&(f[A]=!0),y[v]===void 0&&(y[v]=!0)))}),b||(g[m]=!0)}),(Object.keys(f).length||Object.keys(h).length)&&this.queue.push({pending:h,pendingCount:Object.keys(h).length,loaded:{},errors:[],callback:c}),{toLoad:Object.keys(f),pending:Object.keys(h),toLoadLanguages:Object.keys(g),toLoadNamespaces:Object.keys(y)}}loaded(i,s,o){const c=i.split("|"),f=c[0],h=c[1];s&&this.emit("failedLoading",f,h,s),!s&&o&&this.store.addResourceBundle(f,h,o,void 0,void 0,{skipCopy:!0}),this.state[i]=s?-1:2,s&&o&&(this.state[i]=0);const g={};this.queue.forEach(y=>{pb(y.loaded,[f],h),Nb(y,i),s&&y.errors.push(s),y.pendingCount===0&&!y.done&&(Object.keys(y.loaded).forEach(m=>{g[m]||(g[m]={});const b=y.loaded[m];b.length&&b.forEach(v=>{g[m][v]===void 0&&(g[m][v]=!0)})}),y.done=!0,y.errors.length?y.callback(y.errors):y.callback())}),this.emit("loaded",g),this.queue=this.queue.filter(y=>!y.done)}read(i,s,o,c=0,f=this.retryTimeout,h){if(!i.length)return h(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:i,ns:s,fcName:o,tried:c,wait:f,callback:h});return}this.readingCalls++;const g=(m,b)=>{if(this.readingCalls--,this.waitingReads.length>0){const v=this.waitingReads.shift();this.read(v.lng,v.ns,v.fcName,v.tried,v.wait,v.callback)}if(m&&b&&c<this.maxRetries){setTimeout(()=>{this.read.call(this,i,s,o,c+1,f*2,h)},f);return}h(m,b)},y=this.backend[o].bind(this.backend);if(y.length===2){try{const m=y(i,s);m&&typeof m.then=="function"?m.then(b=>g(null,b)).catch(g):g(null,m)}catch(m){g(m)}return}return y(i,s,g)}prepareLoading(i,s,o={},c){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),c&&c();et(i)&&(i=this.languageUtils.toResolveHierarchy(i)),et(s)&&(s=[s]);const f=this.queueLoad(i,s,o,c);if(!f.toLoad.length)return f.pending.length||c(),null;f.toLoad.forEach(h=>{this.loadOne(h)})}load(i,s,o){this.prepareLoading(i,s,{},o)}reload(i,s,o){this.prepareLoading(i,s,{reload:!0},o)}loadOne(i,s=""){const o=i.split("|"),c=o[0],f=o[1];this.read(c,f,"read",void 0,void 0,(h,g)=>{h&&this.logger.warn(`${s}loading namespace ${f} for language ${c} failed`,h),!h&&g&&this.logger.log(`${s}loaded namespace ${f} for language ${c}`,g),this.loaded(i,h,g)})}saveMissing(i,s,o,c,f,h={},g=()=>{}){var y,m,b,v,A;if((m=(y=this.services)==null?void 0:y.utils)!=null&&m.hasLoadedNamespace&&!((v=(b=this.services)==null?void 0:b.utils)!=null&&v.hasLoadedNamespace(s))){this.logger.warn(`did not save key "${o}" as the namespace "${s}" 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(!(o==null||o==="")){if((A=this.backend)!=null&&A.create){const N={...h,isUpdate:f},O=this.backend.create.bind(this.backend);if(O.length<6)try{let H;O.length===5?H=O(i,s,o,c,N):H=O(i,s,o,c),H&&typeof H.then=="function"?H.then(Y=>g(null,Y)).catch(g):g(null,H)}catch(H){g(H)}else O(i,s,o,c,g,N)}!i||!i[0]||this.store.addResource(i[0],s,o,c)}}}const So=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",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:l=>{let i={};if(typeof l[1]=="object"&&(i=l[1]),et(l[1])&&(i.defaultValue=l[1]),et(l[2])&&(i.tDescription=l[2]),typeof l[2]=="object"||typeof l[3]=="object"){const s=l[3]||l[2];Object.keys(s).forEach(o=>{i[o]=s[o]})}return i},interpolation:{escapeValue:!0,format:l=>l,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),jm=l=>{var i,s;return et(l.ns)&&(l.ns=[l.ns]),et(l.fallbackLng)&&(l.fallbackLng=[l.fallbackLng]),et(l.fallbackNS)&&(l.fallbackNS=[l.fallbackNS]),((s=(i=l.supportedLngs)==null?void 0:i.indexOf)==null?void 0:s.call(i,"cimode"))<0&&(l.supportedLngs=l.supportedLngs.concat(["cimode"])),typeof l.initImmediate=="boolean"&&(l.initAsync=l.initImmediate),l},_u=()=>{},Db=l=>{Object.getOwnPropertyNames(Object.getPrototypeOf(l)).forEach(s=>{typeof l[s]=="function"&&(l[s]=l[s].bind(l))})},xg="__i18next_supportNoticeShown",Lb=()=>!!(typeof globalThis<"u"&&globalThis[xg]||typeof process<"u"&&yo&&yo.I18NEXT_NO_SUPPORT_NOTICE||typeof process<"u"&&yo),jb=()=>{typeof globalThis<"u"&&(globalThis[xg]=!0)},wb=l=>{var i,s,o,c,f,h,g,y,m,b,v,A,N;return!!(((o=(s=(i=l==null?void 0:l.modules)==null?void 0:i.backend)==null?void 0:s.name)==null?void 0:o.indexOf("Locize"))>0||((g=(h=(f=(c=l==null?void 0:l.modules)==null?void 0:c.backend)==null?void 0:f.constructor)==null?void 0:h.name)==null?void 0:g.indexOf("Locize"))>0||(m=(y=l==null?void 0:l.options)==null?void 0:y.backend)!=null&&m.backends&&l.options.backend.backends.some(O=>{var H,Y,q;return((H=O==null?void 0:O.name)==null?void 0:H.indexOf("Locize"))>0||((q=(Y=O==null?void 0:O.constructor)==null?void 0:Y.name)==null?void 0:q.indexOf("Locize"))>0})||(v=(b=l==null?void 0:l.options)==null?void 0:b.backend)!=null&&v.projectId||(N=(A=l==null?void 0:l.options)==null?void 0:A.backend)!=null&&N.backendOptions&&l.options.backend.backendOptions.some(O=>O==null?void 0:O.projectId))};class ei extends Vu{constructor(i={},s){if(super(),this.options=jm(i),this.services={},this.logger=Je,this.modules={external:[]},Db(this),s&&!this.isInitialized&&!i.isClone){if(!this.options.initAsync)return this.init(i,s),this;setTimeout(()=>{this.init(i,s)},0)}}init(i={},s){this.isInitializing=!0,typeof i=="function"&&(s=i,i={}),i.defaultNS==null&&i.ns&&(et(i.ns)?i.defaultNS=i.ns:i.ns.indexOf("translation")<0&&(i.defaultNS=i.ns[0]));const o=So();this.options={...o,...this.options,...jm(i)},this.options.interpolation={...o.interpolation,...this.options.interpolation},i.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=i.keySeparator),i.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=i.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=o.overloadTranslationOptionHandler),this.options.showSupportNotice!==!1&&!wb(this)&&!Lb()&&(typeof console<"u"&&typeof console.info<"u"&&console.info("🌐 i18next is made possible by our own product, Locize — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙"),jb());const c=m=>m?typeof m=="function"?new m:m:null;if(!this.options.isClone){this.modules.logger?Je.init(c(this.modules.logger),this.options):Je.init(null,this.options);let m;this.modules.formatter?m=this.modules.formatter:m=zb;const b=new Cm(this.options);this.store=new Om(this.options.resources,this.options);const v=this.services;v.logger=Je,v.resourceStore=this.store,v.languageUtils=b,v.pluralResolver=new Ob(b,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==o.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),m&&(!this.options.interpolation.format||this.options.interpolation.format===o.interpolation.format)&&(v.formatter=c(m),v.formatter.init&&v.formatter.init(v,this.options),this.options.interpolation.format=v.formatter.format.bind(v.formatter)),v.interpolator=new Dm(this.options),v.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},v.backendConnector=new Mb(c(this.modules.backend),v.resourceStore,v,this.options),v.backendConnector.on("*",(N,...O)=>{this.emit(N,...O)}),this.modules.languageDetector&&(v.languageDetector=c(this.modules.languageDetector),v.languageDetector.init&&v.languageDetector.init(v,this.options.detection,this.options)),this.modules.i18nFormat&&(v.i18nFormat=c(this.modules.i18nFormat),v.i18nFormat.init&&v.i18nFormat.init(this)),this.translator=new Uu(this.services,this.options),this.translator.on("*",(N,...O)=>{this.emit(N,...O)}),this.modules.external.forEach(N=>{N.init&&N.init(this)})}if(this.format=this.options.interpolation.format,s||(s=_u),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const m=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);m.length>0&&m[0]!=="dev"&&(this.options.lng=m[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(m=>{this[m]=(...b)=>this.store[m](...b)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(m=>{this[m]=(...b)=>(this.store[m](...b),this)});const g=Il(),y=()=>{const m=(b,v)=>{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),g.resolve(v),s(b,v)};if(this.languages&&!this.isInitialized)return m(null,this.t.bind(this));this.changeLanguage(this.options.lng,m)};return this.options.resources||!this.options.initAsync?y():setTimeout(y,0),g}loadResources(i,s=_u){var f,h;let o=s;const c=et(i)?i:this.language;if(typeof i=="function"&&(o=i),!this.options.resources||this.options.partialBundledLanguages){if((c==null?void 0:c.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return o();const g=[],y=m=>{if(!m||m==="cimode")return;this.services.languageUtils.toResolveHierarchy(m).forEach(v=>{v!=="cimode"&&g.indexOf(v)<0&&g.push(v)})};c?y(c):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(b=>y(b)),(h=(f=this.options.preload)==null?void 0:f.forEach)==null||h.call(f,m=>y(m)),this.services.backendConnector.load(g,this.options.ns,m=>{!m&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),o(m)})}else o(null)}reloadResources(i,s,o){const c=Il();return typeof i=="function"&&(o=i,i=void 0),typeof s=="function"&&(o=s,s=void 0),i||(i=this.languages),s||(s=this.options.ns),o||(o=_u),this.services.backendConnector.reload(i,s,f=>{c.resolve(),o(f)}),c}use(i){if(!i)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!i.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return i.type==="backend"&&(this.modules.backend=i),(i.type==="logger"||i.log&&i.warn&&i.error)&&(this.modules.logger=i),i.type==="languageDetector"&&(this.modules.languageDetector=i),i.type==="i18nFormat"&&(this.modules.i18nFormat=i),i.type==="postProcessor"&&bg.addPostProcessor(i),i.type==="formatter"&&(this.modules.formatter=i),i.type==="3rdParty"&&this.modules.external.push(i),this}setResolvedLanguage(i){if(!(!i||!this.languages)&&!(["cimode","dev"].indexOf(i)>-1)){for(let s=0;s<this.languages.length;s++){const o=this.languages[s];if(!(["cimode","dev"].indexOf(o)>-1)&&this.store.hasLanguageSomeTranslations(o)){this.resolvedLanguage=o;break}}!this.resolvedLanguage&&this.languages.indexOf(i)<0&&this.store.hasLanguageSomeTranslations(i)&&(this.resolvedLanguage=i,this.languages.unshift(i))}}changeLanguage(i,s){this.isLanguageChangingTo=i;const o=Il();this.emit("languageChanging",i);const c=g=>{this.language=g,this.languages=this.services.languageUtils.toResolveHierarchy(g),this.resolvedLanguage=void 0,this.setResolvedLanguage(g)},f=(g,y)=>{y?this.isLanguageChangingTo===i&&(c(y),this.translator.changeLanguage(y),this.isLanguageChangingTo=void 0,this.emit("languageChanged",y),this.logger.log("languageChanged",y)):this.isLanguageChangingTo=void 0,o.resolve((...m)=>this.t(...m)),s&&s(g,(...m)=>this.t(...m))},h=g=>{var b,v;!i&&!g&&this.services.languageDetector&&(g=[]);const y=et(g)?g:g&&g[0],m=this.store.hasLanguageSomeTranslations(y)?y:this.services.languageUtils.getBestMatchFromCodes(et(g)?[g]:g);m&&(this.language||c(m),this.translator.language||this.translator.changeLanguage(m),(v=(b=this.services.languageDetector)==null?void 0:b.cacheUserLanguage)==null||v.call(b,m)),this.loadResources(m,A=>{f(A,m)})};return!i&&this.services.languageDetector&&!this.services.languageDetector.async?h(this.services.languageDetector.detect()):!i&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(h):this.services.languageDetector.detect(h):h(i),o}getFixedT(i,s,o){const c=(f,h,...g)=>{let y;typeof h!="object"?y=this.options.overloadTranslationOptionHandler([f,h].concat(g)):y={...h},y.lng=y.lng||c.lng,y.lngs=y.lngs||c.lngs,y.ns=y.ns||c.ns,y.keyPrefix!==""&&(y.keyPrefix=y.keyPrefix||o||c.keyPrefix);const m={...this.options,...y};typeof y.keyPrefix=="function"&&(y.keyPrefix=Pn(y.keyPrefix,m));const b=this.options.keySeparator||".";let v;return y.keyPrefix&&Array.isArray(f)?v=f.map(A=>(typeof A=="function"&&(A=Pn(A,m)),`${y.keyPrefix}${b}${A}`)):(typeof f=="function"&&(f=Pn(f,m)),v=y.keyPrefix?`${y.keyPrefix}${b}${f}`:f),this.t(v,y)};return et(i)?c.lng=i:c.lngs=i,c.ns=s,c.keyPrefix=o,c}t(...i){var s;return(s=this.translator)==null?void 0:s.translate(...i)}exists(...i){var s;return(s=this.translator)==null?void 0:s.exists(...i)}setDefaultNamespace(i){this.options.defaultNS=i}hasLoadedNamespace(i,s={}){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 o=s.lng||this.resolvedLanguage||this.languages[0],c=this.options?this.options.fallbackLng:!1,f=this.languages[this.languages.length-1];if(o.toLowerCase()==="cimode")return!0;const h=(g,y)=>{const m=this.services.backendConnector.state[`${g}|${y}`];return m===-1||m===0||m===2};if(s.precheck){const g=s.precheck(this,h);if(g!==void 0)return g}return!!(this.hasResourceBundle(o,i)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||h(o,i)&&(!c||h(f,i)))}loadNamespaces(i,s){const o=Il();return this.options.ns?(et(i)&&(i=[i]),i.forEach(c=>{this.options.ns.indexOf(c)<0&&this.options.ns.push(c)}),this.loadResources(c=>{o.resolve(),s&&s(c)}),o):(s&&s(),Promise.resolve())}loadLanguages(i,s){const o=Il();et(i)&&(i=[i]);const c=this.options.preload||[],f=i.filter(h=>c.indexOf(h)<0&&this.services.languageUtils.isSupportedCode(h));return f.length?(this.options.preload=c.concat(f),this.loadResources(h=>{o.resolve(),s&&s(h)}),o):(s&&s(),Promise.resolve())}dir(i){var c,f;if(i||(i=this.resolvedLanguage||(((c=this.languages)==null?void 0:c.length)>0?this.languages[0]:this.language)),!i)return"rtl";try{const h=new Intl.Locale(i);if(h&&h.getTextInfo){const g=h.getTextInfo();if(g&&g.direction)return g.direction}}catch{}const s=["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"],o=((f=this.services)==null?void 0:f.languageUtils)||new Cm(So());return i.toLowerCase().indexOf("-latn")>1?"ltr":s.indexOf(o.getLanguagePartFromCode(i))>-1||i.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(i={},s){const o=new ei(i,s);return o.createInstance=ei.createInstance,o}cloneInstance(i={},s=_u){const o=i.forkResourceStore;o&&delete i.forkResourceStore;const c={...this.options,...i,isClone:!0},f=new ei(c);if((i.debug!==void 0||i.prefix!==void 0)&&(f.logger=f.logger.clone(i)),["store","services","language"].forEach(g=>{f[g]=this[g]}),f.services={...this.services},f.services.utils={hasLoadedNamespace:f.hasLoadedNamespace.bind(f)},o){const g=Object.keys(this.store.data).reduce((y,m)=>(y[m]={...this.store.data[m]},y[m]=Object.keys(y[m]).reduce((b,v)=>(b[v]={...y[m][v]},b),y[m]),y),{});f.store=new Om(g,c),f.services.resourceStore=f.store}if(i.interpolation){const y={...So().interpolation,...this.options.interpolation,...i.interpolation},m={...c,interpolation:y};f.services.interpolator=new Dm(m)}return f.translator=new Uu(f.services,c),f.translator.on("*",(g,...y)=>{f.emit(g,...y)}),f.init(c,s),f.translator.options=c,f.translator.backendConnector.services.utils={hasLoadedNamespace:f.hasLoadedNamespace.bind(f)},f}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Jt=ei.createInstance();Jt.createInstance;Jt.dir;Jt.init;Jt.loadResources;Jt.reloadResources;Jt.use;Jt.changeLanguage;Jt.getFixedT;Jt.t;Jt.exists;Jt.setDefaultNamespace;Jt.hasLoadedNamespace;Jt.loadNamespaces;Jt.loadLanguages;const ai="en",Eg={en:()=>Ae(()=>import("./en-Bnr4nMzg.js"),[],import.meta.url),zh:()=>Ae(()=>import("./zh-MSddxMDX.js"),[],import.meta.url),"zh-TW":()=>Ae(()=>import("./zh-TW-C_LNWX0o.js"),[],import.meta.url),ja:()=>Ae(()=>import("./ja-CDWPWqEW.js"),[],import.meta.url),es:()=>Ae(()=>import("./es-B1GIFh3i.js"),[],import.meta.url)},Mu={};function wm(l){return l in Eg}function Tg(l){if(wm(l))return l;const i=l.split("-")[0];return wm(i)?i:ai}function Ub(){const l=localStorage.getItem("cc_lang");return Tg(l||navigator.language||ai)}async function No(l){if(Mu[l])return;const i=await Eg[l]();Mu[l]=i.default,Jt.isInitialized&&Jt.addResourceBundle(l,"translation",Mu[l],!0,!0)}async function Hb(){const l=Ub();await Promise.all([No(ai),l===ai?Promise.resolve():No(l)]),Jt.isInitialized||await Jt.use(B1).init({lng:l,fallbackLng:ai,resources:Object.fromEntries(Object.entries(Mu).map(([i,s])=>[i,{translation:s}])),interpolation:{escapeValue:!1}})}async function Bb(l){const i=Tg(l);await No(i),await Jt.changeLanguage(i),localStorage.setItem("cc_lang",i)}const Um=[{code:"en",label:"English"},{code:"zh",label:"中文"},{code:"zh-TW",label:"繁體中文"},{code:"ja",label:"日本語"},{code:"es",label:"Español"}],kb=[{label:"Core",ids:["dashboard","chat","workspace","projects","sessions"]},{label:"Knowledge",ids:["knowledge","automations"]},{label:"System",ids:["system"]}];function Yb(){var q;const{pathname:l}=Ce(),{t:i,i18n:s}=G1(),{theme:o,setTheme:c}=yg(),f=Ko(),[h,g]=T.useState(!1),[y,m]=T.useState(!1),b=V=>{Bb(V),m(!1)},v={light:wy,dark:Ny,system:Cy},A={light:"dark",dark:"system",system:"light"},N=v[o],O=qu.listNavItems().filter(V=>{var X;return((X=V.visible)==null?void 0:X.call(V,{features:f}))??!0}),H=O.map(V=>{var tt;const X=V.icon,$=((tt=V.resolveLabelKey)==null?void 0:tt.call(V,{features:f}))||V.labelKey;return{...V,Icon:X,labelKey:$}}),Y=l.startsWith("/chat");return j.jsxs(j.Fragment,{children:[j.jsxs("aside",{className:ne("relative hidden h-[100dvh] flex-col overflow-hidden border-r transition-all duration-300 ease-out md:flex","border-white/55 bg-white/24 shadow-[inset_-1px_0_0_rgba(255,255,255,0.36)] backdrop-blur-[34px] supports-[backdrop-filter]:bg-white/18","dark:border-white/[0.10] dark:bg-[#1c1c1e]/34 dark:shadow-[inset_-1px_0_0_rgba(255,255,255,0.08)] dark:supports-[backdrop-filter]:bg-[#1c1c1e]/26",h?"w-16":"w-56"),children:[j.jsx("div",{className:"pointer-events-none absolute inset-0 bg-[linear-gradient(180deg,rgba(255,255,255,0.55),rgba(255,255,255,0.18)_48%,rgba(255,255,255,0.08))] dark:bg-[linear-gradient(180deg,rgba(255,255,255,0.08),rgba(255,255,255,0.025)_52%,rgba(255,255,255,0.015))]","aria-hidden":"true"}),j.jsx("div",{className:ne("relative flex h-[5.25rem] items-center gap-3 px-4 pt-7 transition-colors"),children:j.jsx(hb,{showWordmark:!h})}),j.jsx("nav",{className:"relative flex-1 py-3 space-y-4 px-2 overflow-y-auto",children:kb.map(V=>{const X=O.filter($=>V.ids.includes($.id));return X.length===0?null:j.jsxs("div",{className:"space-y-1",children:[!h&&j.jsx("p",{className:"px-3 pb-1 text-[10px] font-semibold uppercase tracking-[0.08em] text-muted-foreground/80",children:V.label}),X.map($=>{var J;const tt=$.icon,st=((J=$.resolveLabelKey)==null?void 0:J.call($,{features:f}))||$.labelKey;return j.jsxs(Ao,{to:$.path,end:$.end,className:({isActive:nt})=>ne("flex items-center gap-3 px-3 py-2 rounded-lg text-sm font-medium transition-colors duration-200","focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",nt?"bg-black/[0.07] text-foreground dark:bg-white/[0.10]":"text-muted-foreground hover:bg-black/[0.05] hover:text-foreground dark:hover:bg-white/[0.07]"),children:[j.jsx(tt,{size:18,className:"shrink-0"}),!h&&j.jsx("span",{children:i(st)})]},$.id)})]},V.label)})}),j.jsxs("div",{className:ne("relative border-t p-2 space-y-1","border-black/10 dark:border-white/[0.08]"),children:[!h&&j.jsxs("div",{className:"px-3 pb-1 pt-0.5 text-[11px] font-medium text-muted-foreground/75",children:["AgentDock v","0.1.63"]}),j.jsxs("div",{className:"relative",children:[j.jsxs("button",{type:"button",onClick:()=>m(!y),className:ne("flex items-center gap-3 w-full px-3 py-2 rounded-lg text-sm transition-colors duration-200","text-muted-foreground hover:bg-black/[0.05] hover:text-foreground dark:hover:bg-white/[0.07]","focus:outline-none focus-visible:ring-2 focus-visible:ring-ring"),children:[j.jsx(vy,{size:18,className:"shrink-0"}),!h&&j.jsx("span",{children:((q=Um.find(V=>V.code===s.language))==null?void 0:q.label)||"English"})]}),y&&j.jsx("div",{className:ne("absolute bottom-full left-0 mb-1 w-48 rounded-xl py-1 z-50 overflow-hidden","border border-black/10 bg-white/90 text-popover-foreground shadow-[0_18px_40px_rgba(0,0,0,0.12)] backdrop-blur-2xl","dark:border-white/[0.08] dark:bg-[#2c2c2e]/90"),children:Um.map(V=>j.jsx("button",{type:"button",onClick:()=>b(V.code),className:ne("w-full text-left px-3 py-2 text-sm transition-colors duration-150",s.language===V.code?"text-primary font-medium bg-primary/10":"text-muted-foreground hover:bg-black/[0.05] hover:text-foreground dark:hover:bg-white/[0.07]"),children:V.label},V.code))})]}),j.jsxs("button",{type:"button",onClick:()=>c(A[o]),className:ne("flex items-center gap-3 w-full px-3 py-2 rounded-lg text-sm transition-colors duration-200","text-muted-foreground hover:bg-black/[0.05] hover:text-foreground dark:hover:bg-white/[0.07]","focus:outline-none focus-visible:ring-2 focus-visible:ring-ring"),children:[j.jsx(N,{size:18,className:"shrink-0"}),!h&&j.jsx("span",{children:i(`theme.${o}`)})]}),j.jsx("button",{type:"button",onClick:()=>g(!h),className:ne("flex items-center justify-center w-full px-3 py-2 rounded-lg transition-colors duration-200","text-muted-foreground hover:bg-black/[0.05] hover:text-foreground dark:hover:bg-white/[0.07]","focus:outline-none focus-visible:ring-2 focus-visible:ring-ring"),children:h?j.jsx(my,{size:18}):j.jsx(dy,{size:18})})]})]}),Y?null:j.jsx("nav",{className:ne("fixed inset-x-0 bottom-0 z-50 border-t px-2 pb-[max(env(safe-area-inset-bottom),0.5rem)] pt-2 md:hidden","border-black/10 bg-white/88 shadow-[0_-12px_32px_rgba(15,23,42,0.10)] backdrop-blur-2xl","dark:border-white/[0.08] dark:bg-[#111113]/88 dark:shadow-[0_-16px_42px_rgba(0,0,0,0.34)]"),"aria-label":"Primary navigation",children:j.jsx("div",{className:"flex items-stretch gap-1 overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:H.map(({id:V,path:X,end:$,Icon:tt,labelKey:st})=>j.jsxs(Ao,{to:X,end:$,className:({isActive:J})=>ne("flex min-w-[4.5rem] flex-1 flex-col items-center justify-center gap-1 rounded-xl px-2 py-2 text-[11px] font-medium transition-colors","focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",J?"bg-primary/10 text-primary":"text-muted-foreground hover:bg-black/[0.05] hover:text-foreground dark:hover:bg-white/[0.07]"),children:[j.jsx(tt,{size:18,className:"shrink-0"}),j.jsx("span",{className:"max-w-[4.25rem] truncate",children:i(st)})]},V))})})]})}function qb(){const{pathname:l}=Ce(),{desktopChat:i}=Ko(),s=l.startsWith("/chat"),o=l.startsWith("/chat")&&i;return j.jsxs("div",{className:ne("flex h-[100dvh] overflow-hidden","bg-background/60 backdrop-blur-2xl"),children:[j.jsx("div",{className:"fixed left-0 right-0 top-0 z-50 hidden h-8 [-webkit-app-region:drag] md:block","aria-hidden":"true"}),j.jsx(Yb,{}),j.jsx("div",{className:"flex-1 flex flex-col overflow-hidden min-w-0 bg-background/45 backdrop-blur-2xl",children:j.jsx("main",{className:ne("flex-1 min-h-0",o?"overflow-hidden":"overflow-y-auto",s?"p-4 pb-4 sm:p-6 sm:pb-6":"p-4 pb-24 sm:p-6 sm:pb-6"),children:j.jsx("div",{className:ne(o&&"h-full min-h-0","mx-auto w-full max-w-7xl"),children:j.jsx(Xv,{})})})})]})}function Vb(){return j.jsx("div",{className:"flex min-h-64 items-center justify-center text-sm text-muted-foreground",children:"正在加载…"})}function Gb(){const l=Ko();return j.jsx(T.Suspense,{fallback:j.jsx(Vb,{}),children:j.jsxs(Zv,{children:[j.jsxs(Wn,{element:j.jsx(qb,{}),children:[qu.listRoutes().map(i=>i.index?j.jsx(Wn,{index:!0,element:i.element({features:l})},i.id):j.jsx(Wn,{path:i.path,element:i.element({features:l})},i.id)),j.jsx(Wn,{path:"*",element:j.jsx(qa,{to:"/",replace:!0})})]}),j.jsx(Wn,{path:"*",element:j.jsx(qa,{to:"/",replace:!0})})]})})}class Kb extends In.Component{constructor(){super(...arguments);Au(this,"state",{hasError:!1,errorMessage:""})}static getDerivedStateFromError(s){return{hasError:!0,errorMessage:s instanceof Error?s.message:String(s)}}componentDidCatch(s,o){console.error("App render failed",s,o)}render(){return this.state.hasError?j.jsx("div",{className:"min-h-screen flex items-center justify-center bg-white dark:bg-gray-950 p-6",children:j.jsxs("div",{className:"max-w-lg w-full rounded-2xl border border-red-200 dark:border-red-900/40 bg-red-50 dark:bg-red-950/20 px-6 py-5",children:[j.jsx("h1",{className:"text-lg font-semibold text-red-700 dark:text-red-300",children:"页面渲染失败"}),j.jsx("p",{className:"mt-2 text-sm text-red-600 dark:text-red-400 break-words",children:this.state.errorMessage||"Unknown renderer error"}),j.jsx("button",{type:"button",onClick:()=>window.location.reload(),className:"mt-4 inline-flex items-center rounded-lg bg-red-600 px-4 py-2 text-sm font-medium text-white hover:bg-red-700",children:"Reload"})]})}):this.props.children}}function Hm(l,i){if(typeof l=="function")return l(i);l!=null&&(l.current=i)}function Rg(...l){return i=>{let s=!1;const o=l.map(c=>{const f=Hm(c,i);return!s&&typeof f=="function"&&(s=!0),f});if(s)return()=>{for(let c=0;c<o.length;c++){const f=o[c];typeof f=="function"?f():Hm(l[c],null)}}}}function VS(...l){return T.useCallback(Rg(...l),l)}var Xb=Symbol.for("react.lazy"),Hu=ly[" use ".trim().toString()];function Qb(l){return typeof l=="object"&&l!==null&&"then"in l}function Ag(l){return l!=null&&typeof l=="object"&&"$$typeof"in l&&l.$$typeof===Xb&&"_payload"in l&&Qb(l._payload)}function Zb(l){const i=$b(l),s=T.forwardRef((o,c)=>{let{children:f,...h}=o;Ag(f)&&typeof Hu=="function"&&(f=Hu(f._payload));const g=T.Children.toArray(f),y=g.find(Wb);if(y){const m=y.props.children,b=g.map(v=>v===y?T.Children.count(m)>1?T.Children.only(null):T.isValidElement(m)?m.props.children:null:v);return j.jsx(i,{...h,ref:c,children:T.isValidElement(m)?T.cloneElement(m,void 0,b):null})}return j.jsx(i,{...h,ref:c,children:f})});return s.displayName=`${l}.Slot`,s}var Jb=Zb("Slot");function $b(l){const i=T.forwardRef((s,o)=>{let{children:c,...f}=s;if(Ag(c)&&typeof Hu=="function"&&(c=Hu(c._payload)),T.isValidElement(c)){const h=Pb(c),g=Ib(f,c.props);return c.type!==T.Fragment&&(g.ref=o?Rg(o,h):h),T.cloneElement(c,g)}return T.Children.count(c)>1?T.Children.only(null):null});return i.displayName=`${l}.SlotClone`,i}var Fb=Symbol("radix.slottable");function Wb(l){return T.isValidElement(l)&&typeof l.type=="function"&&"__radixId"in l.type&&l.type.__radixId===Fb}function Ib(l,i){const s={...i};for(const o in i){const c=l[o],f=i[o];/^on[A-Z]/.test(o)?c&&f?s[o]=(...g)=>{const y=f(...g);return c(...g),y}:c&&(s[o]=c):o==="style"?s[o]={...c,...f}:o==="className"&&(s[o]=[c,f].filter(Boolean).join(" "))}return{...l,...s}}function Pb(l){var o,c;let i=(o=Object.getOwnPropertyDescriptor(l.props,"ref"))==null?void 0:o.get,s=i&&"isReactWarning"in i&&i.isReactWarning;return s?l.ref:(i=(c=Object.getOwnPropertyDescriptor(l,"ref"))==null?void 0:c.get,s=i&&"isReactWarning"in i&&i.isReactWarning,s?l.props.ref:l.props.ref||l.ref)}const tS={default:"bg-primary text-primary-foreground hover:bg-accent-dim",primary:"bg-primary text-primary-foreground hover:bg-accent-dim",secondary:"bg-black/[0.05] text-secondary-foreground hover:bg-black/[0.08] dark:bg-white/[0.08] dark:hover:bg-white/[0.12]",outline:"border border-input bg-background hover:bg-black/[0.04] hover:text-foreground dark:hover:bg-white/[0.06]",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",danger:"bg-destructive text-destructive-foreground hover:bg-destructive/90",ghost:"text-muted-foreground hover:bg-black/[0.05] hover:text-foreground dark:hover:bg-white/[0.07]",link:"text-primary underline-offset-4 hover:underline"},eS={default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",md:"h-9 rounded-md px-4 py-2 text-sm",lg:"h-10 rounded-md px-6 text-sm",icon:"h-9 w-9"};function Bm({variant:l="primary",size:i="md",className:s,children:o,loading:c,asChild:f,disabled:h,type:g="button",...y}){const m=i==="default"?"md":i,b=f?Jb:"button";return j.jsxs(b,{...f?{}:{type:g},className:ne("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors duration-200","cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background","disabled:pointer-events-none disabled:opacity-50",tS[l],eS[m],s),disabled:h||c,...y,children:[c&&j.jsxs("svg",{className:"animate-spin h-4 w-4",viewBox:"0 0 24 24","aria-hidden":!0,children:[j.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),j.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),o]})}const Mo="http://127.0.0.1:9831",aS=`${Mo}/api/local/v1`,nS=["runtime.updated","runtime.detect.started","runtime.detect.completed","runtime.detect.failed","runtime.status.changed","thread.updated","thread.session.activated","message.created","message.updated","run.updated","scheduler.job.updated","scheduler.run.updated","automation.monitor.updated","automation.monitor.run.updated","automation.definition.updated","automation.evaluation.updated","automation.run.updated","automation.script-version.updated","presence.updated","stream.updated"];function Og(l){return(l.trim()||aS).replace(/\/+$/,"")}function bt(l){return typeof l=="object"&&l!==null&&!Array.isArray(l)}function k(l,i){return typeof l[i]=="string"}function Va(l,i){return typeof l[i]=="boolean"}function Pl(l,i){return bt(l[i])}function Xo(l){return bt(l)&&k(l,"type")&&k(l,"channelId")}function lS(l){if(!bt(l))return!1;const i=l.value;return k(l,"metric")&&k(l,"operator")&&(typeof i=="number"||typeof i=="string"||typeof i=="boolean")}function iS(l){return bt(l)&&k(l,"id")&&k(l,"workspaceId")&&k(l,"title")&&Va(l,"live")&&k(l,"updatedAt")&&k(l,"createdAt")&&typeof l.historyCount=="number"&&k(l,"excerpt")}function uS(l){return bt(l)&&k(l,"id")&&k(l,"role")&&k(l,"content")&&k(l,"timestamp")}function rS(l){return bt(l)?(l.id===void 0||typeof l.id=="string")&&(l.role===void 0||["user","assistant","system"].includes(l.role))&&(l.content===void 0||typeof l.content=="string")&&(l.timestamp===void 0||typeof l.timestamp=="string"):!1}function sS(l){return bt(l)&&k(l,"id")&&k(l,"threadId")&&k(l,"status")&&k(l,"startedAt")&&k(l,"updatedAt")}function oS(l){return bt(l)&&k(l,"id")&&k(l,"workspaceId")&&k(l,"platform")&&Xo(l.route)&&k(l,"executionMode")&&k(l,"triggerType")&&k(l,"promptTemplate")&&k(l,"description")&&Va(l,"enabled")&&k(l,"concurrencyPolicy")&&k(l,"createdAt")&&k(l,"updatedAt")}function cS(l){return bt(l)&&k(l,"id")&&k(l,"jobId")&&k(l,"status")&&k(l,"triggeredAt")}function fS(l){return bt(l)&&k(l,"id")&&k(l,"workspaceId")&&k(l,"title")&&k(l,"sourceType")&&Pl(l,"sourceConfig")&&lS(l.condition)&&k(l,"promptTemplate")&&k(l,"platform")&&Xo(l.route)&&k(l,"executionMode")&&Va(l,"enabled")&&typeof l.cooldownMs=="number"&&k(l,"concurrencyPolicy")&&k(l,"createdAt")&&k(l,"updatedAt")}function dS(l){return bt(l)&&k(l,"id")&&k(l,"monitorId")&&k(l,"status")&&k(l,"triggeredAt")}function hS(l){return bt(l)&&k(l,"id")&&k(l,"workspaceId")&&k(l,"title")&&Va(l,"enabled")&&(l.health==="healthy"||l.health==="blocked")&&yS(l.activation)&&vS(l.condition)&&bS(l.action)&&SS(l.delivery)&&xS(l.policies)&&Ya(l.consecutiveEvaluationFailures)&&k(l,"createdAt")&&k(l,"updatedAt")&&(l.health!=="blocked"||k(l,"blockedReason"))&&(l.blockedReason===void 0||typeof l.blockedReason=="string")&&(l.lastSuccessfulMatch===void 0||typeof l.lastSuccessfulMatch=="boolean")&&(l.lastEvaluationAt===void 0||typeof l.lastEvaluationAt=="string")&&(l.lastTriggeredAt===void 0||typeof l.lastTriggeredAt=="string")}function mS(l){return!bt(l)||!k(l,"id")||!k(l,"automationId")||!k(l,"activationKind")||!["cron","once","interval","provider-event"].includes(String(l.activationKind))||!k(l,"status")||!k(l,"startedAt")?!1:l.status==="running"?l.conditionOutcome===void 0&&l.triggerDecision===void 0&&l.finishedAt===void 0&&l.durationMs===void 0&&l.exitCode===void 0&&l.errorCategory===void 0&&l.stdout===void 0&&l.stderr===void 0&&l.resultSummary===void 0&&l.payload===void 0&&l.nextState===void 0&&l.sandboxViolations===void 0&&l.networkAudit===void 0:l.status!=="finished"||!k(l,"finishedAt")?!1:l.conditionOutcome==="matched"?["triggered","not_rising","skipped_cooldown","skipped_action_running"].includes(String(l.triggerDecision)):l.conditionOutcome==="not_matched"?l.triggerDecision==="not_rising":l.conditionOutcome==="error"?l.triggerDecision==="not_evaluated":l.conditionOutcome==="skipped"&&["not_evaluated","skipped_concurrent","skipped_cooldown","skipped_action_running"].includes(String(l.triggerDecision))}function gS(l){return bt(l)&&k(l,"id")&&k(l,"automationId")&&k(l,"evaluationId")&&["queued","running","succeeded","failed","skipped"].includes(String(l.status))&&["same-thread","side-thread"].includes(String(l.executionMode))&&k(l,"createdAt")&&(l.deliveryStatus===void 0||["pending","delivering","delivered","failed"].includes(String(l.deliveryStatus)))&&(l.threadId===void 0||typeof l.threadId=="string")&&(l.acpRunId===void 0||typeof l.acpRunId=="string")&&(l.error===void 0||typeof l.error=="string")}function pS(l){return bt(l)&&k(l,"id")&&k(l,"scriptId")&&k(l,"status")&&["draft","pending_test_approval","test_authorized","testing","tested","pending_approval","approved","rejected","revoked"].includes(String(l.status))&&k(l,"packageSha256")&&k(l,"packagePath")&&k(l,"shebang")&&k(l,"interpreterPath")&&k(l,"interpreterVersion")&&bt(l.capabilities)&&bt(l.config)&&bt(l.configSchema)&&(l.networkMode==="none"||l.networkMode==="public")&&Va(l,"internalAccess")&&xo(l.allowedReadDirs)&&xo(l.secretRefs)&&xo(l.env)&&bt(l.limits)&&Ya(l.limits.timeoutMs)&&Ya(l.limits.stdoutBytes)&&Ya(l.limits.stderrBytes)&&Ya(l.limits.payloadBytes)&&Ya(l.limits.stateBytes)&&bt(l.staticCheck)&&bt(l.testPlan)&&k(l,"createdAt")&&k(l,"updatedAt")}function yS(l){return bt(l)?l.kind==="cron"?k(l,"expression")&&k(l,"timezone"):l.kind==="once"?k(l,"runAt"):l.kind==="interval"?typeof l.intervalMs=="number"&&Ya(l.intervalMs)&&l.intervalMs>0:l.kind==="provider-event"&&k(l,"sourceType")&&bt(l.sourceConfig):!1}function vS(l){return bt(l)?l.kind==="always"?!0:l.kind==="expression"?k(l,"expression"):l.kind==="approved-script"&&k(l,"scriptId")&&k(l,"approvedVersionId")&&l.edge==="rising":!1}function bS(l){return bt(l)&&l.kind==="agent-prompt"&&k(l,"promptTemplate")&&(l.executionMode==="same-thread"||l.executionMode==="side-thread")}function SS(l){return bt(l)&&k(l,"platform")&&Xo(l.route)}function xS(l){return bt(l)&&l.concurrency==="skip-if-running"&&Ya(l.cooldownMs)}function xo(l){return Array.isArray(l)&&l.every(i=>typeof i=="string")}function Ya(l){return typeof l=="number"&&Number.isSafeInteger(l)&&l>=0}function km(l){return bt(l)&&k(l,"agentType")&&k(l,"runtimeId")&&k(l,"displayName")&&k(l,"status")&&Va(l,"installed")&&k(l,"detectedAt")&&k(l,"summary")&&Array.isArray(l.issues)&&Array.isArray(l.recommendedActions)&&k(l,"source")}function ES(l){return bt(l)&&l.mode==="desktop"&&k(l,"phase")&&Va(l,"pendingRestart")&&Pl(l,"service")&&Pl(l,"roles")&&Pl(l,"settings")&&Pl(l,"runtimeConfig")&&Array.isArray(l.logs)&&l.logs.every(i=>typeof i=="string")}function Fn(l){return bt(l)&&k(l,"type")}function TS(l){if(!bt(l)||!k(l,"type"))return!1;switch(l.type){case"runtime.updated":return ES(l.runtime);case"runtime.detect.started":return k(l,"detectedAt");case"runtime.detect.completed":return k(l,"detectedAt")&&Array.isArray(l.runtimes)&&l.runtimes.every(km);case"runtime.detect.failed":return k(l,"detectedAt")&&k(l,"error");case"runtime.status.changed":return km(l.runtime);case"thread.updated":return iS(l.thread);case"thread.session.activated":return k(l,"workspaceId")&&k(l,"threadId")&&k(l,"reason");case"message.created":return k(l,"threadId")&&uS(l.message)&&(l.stream===void 0||Fn(l.stream));case"message.updated":return k(l,"threadId")&&rS(l.message)&&(l.stream===void 0||Fn(l.stream));case"run.updated":return sS(l.run)&&(l.stream===void 0||Fn(l.stream));case"scheduler.job.updated":return oS(l.job);case"scheduler.run.updated":return cS(l.run);case"automation.monitor.updated":return fS(l.monitor);case"automation.monitor.run.updated":return dS(l.run);case"automation.definition.updated":return hS(l.automation);case"automation.evaluation.updated":return mS(l.evaluation);case"automation.run.updated":return gS(l.run);case"automation.script-version.updated":return pS(l.version);case"presence.updated":return Va(l,"live")&&(l.stream===void 0||Fn(l.stream));case"stream.updated":return Fn(l.stream);case"external.run.snapshot":return bt(l.snapshot)&&k(l.snapshot,"runId");case"external.run.stream":return k(l,"runId")&&Fn(l.stream);default:return!1}}function RS(l){return l.type==="stream.updated"||(l.type==="message.created"||l.type==="message.updated"||l.type==="run.updated")&&l.stream?l.stream:null}const Cu=new Map;function AS(l,i,s){const o=new Set,c=new Set;let f=null,h=null,g="disconnected";const y=N=>{g=N,c.forEach(O=>{try{O(N)}catch{}})},m=()=>{h!==null&&(i.cancelReconnect(h),h=null)},b=()=>{f==null||f.close(),f=null},v=()=>{m(),b(),s()},A=()=>{if(f||o.size===0&&c.size===0)return;const N=i.eventSourceFactory(`${l}/events`);f=N,N.onopen=()=>{f===N&&y("connected")};const O=H=>{try{const Y=JSON.parse(H.data);TS(Y)&&o.forEach(q=>{try{q(Y)}catch{}})}catch{}};nS.forEach(H=>N.addEventListener(H,O)),N.onerror=()=>{f===N&&(b(),y("disconnected"),(o.size>0||c.size>0)&&h===null&&(h=i.scheduleReconnect(()=>{h=null,A()},1e3)))}};return{subscribe(N){const O=H=>N(H);return o.add(O),A(),()=>{o.delete(O)&&o.size===0&&c.size===0&&v()}},subscribeConnectionState(N){if(c.add(N),A(),g==="connected")try{N("connected")}catch{}return()=>{c.delete(N)&&o.size===0&&c.size===0&&v()}}}}function Ym(l,i){const s=Cu.get(l);if(s)return s;let o;return o=AS(l,i,()=>{Cu.get(l)===o&&Cu.delete(l)}),Cu.set(l,o),o}function OS(l){const i=Og(l.baseUrl),s=l.fetchImpl||globalThis.fetch.bind(globalThis),o=l.eventSourceFactory||(b=>new EventSource(b)),c=l.scheduleReconnect||((b,v)=>setTimeout(b,v)),f=l.cancelReconnect||(b=>clearTimeout(b)),h=new Set,g=b=>{const A=Ym(i,{eventSourceFactory:o,scheduleReconnect:c,cancelReconnect:f}).subscribe(b);return h.add(A),()=>{h.delete(A),A()}};return{baseUrl:i,request:async(b,v,A)=>{const N=await s(`${i}${v}`,{method:b,headers:{"Content-Type":"application/json"},body:A===void 0?void 0:JSON.stringify(A)}),O=await N.json();if(!N.ok||!O.ok)throw new Error(O.error||`Local AI Core request failed: ${N.status}`);return O.data},async detect(b=350){var N;const v=new AbortController,A=setTimeout(()=>v.abort(),b);try{const O=await s(`${i}/health`,{signal:v.signal}),H=await O.json();return O.ok&&H.ok&&((N=H.data)==null?void 0:N.name)==="local-ai-core"}catch{return!1}finally{clearTimeout(A)}},events:{subscribe:g,subscribeConnectionState:b=>{const A=Ym(i,{eventSourceFactory:o,scheduleReconnect:c,cancelReconnect:f}).subscribeConnectionState(b);return h.add(A),()=>{h.delete(A),A()}},subscribeRuntime(b){return g(v=>{v.type==="runtime.updated"&&b(v.runtime)})},subscribeBridge(b){return g(v=>{const A=RS(v);A&&b(A)})},close(){const b=Array.from(h);h.clear(),b.forEach(v=>v())}}}}const Do=Og("/api/local/v1");Do.endsWith("/api/local/v1")&&Do.slice(0,-13);const _g=OS({baseUrl:Do});function kt(l,i,s){return _g.request(l,i,s)}function Cg(l){const i=Object.entries(l).filter(([,o])=>o!==void 0&&o!=="");if(i.length===0)return"";const s=new URLSearchParams;for(const[o,c]of i)s.set(o,String(c));return`?${s.toString()}`}function _S(l){return _g.events.subscribe(l)}function CS(){return kt("GET","/runtime")}function GS(){return kt("POST","/runtime/service/start")}function KS(){return kt("POST","/runtime/service/restart")}function zS(l){const i=Cg({limit:l});return kt("GET",`/runtime/logs${i}`)}function XS(l="sys",i=200){const s=Cg({level:l,limit:i});return kt("GET",`/logs${s}`)}function QS(){return kt("GET","/runtime/agent-runtimes")}function ZS(){return kt("POST","/runtimes/refresh")}function JS(){return kt("GET","/diagnostics/errors")}function $S(){return kt("POST","/diagnostics/doctor")}function FS(){return kt("GET","/runtime/runtime-config")}function WS(l){return kt("POST","/runtime/runtime-config",{config:l})}function IS(l){return kt("POST","/runtime/settings",l)}function PS(){return kt("GET","/providers")}function t2(l){return kt("POST","/providers",l)}function e2(l,i){return kt("PUT",`/providers/${encodeURIComponent(l)}`,i)}function a2(l){return kt("DELETE",`/providers/${encodeURIComponent(l)}`)}function n2(l={}){const i=new URLSearchParams;l.workspaceId&&i.set("workspace_id",l.workspaceId),l.runtimeId&&i.set("runtime_id",l.runtimeId),l.status&&i.set("status",Array.isArray(l.status)?l.status.join(","):l.status),l.limit&&i.set("limit",String(l.limit));const s=i.toString()?`?${i.toString()}`:"";return kt("GET",`/tasks${s}`)}function l2(l={}){const i=new URLSearchParams;l.workspaceId&&i.set("workspace_id",l.workspaceId),l.taskId&&i.set("task_id",l.taskId),l.status&&i.set("status",Array.isArray(l.status)?l.status.join(","):l.status),l.limit&&i.set("limit",String(l.limit));const s=i.toString()?`?${i.toString()}`:"";return kt("GET",`/approvals${s}`)}function i2(l,i){return kt("POST",`/approvals/${encodeURIComponent(l)}/resolve`,i)}function u2(l={}){const i=new URLSearchParams;l.workspaceId&&i.set("workspace_id",l.workspaceId),l.taskId&&i.set("task_id",l.taskId),l.approvalId&&i.set("approval_id",l.approvalId),l.type&&i.set("type",Array.isArray(l.type)?l.type.join(","):l.type),l.limit&&i.set("limit",String(l.limit));const s=i.toString()?`?${i.toString()}`:"";return kt("GET",`/audit-events${s}`)}function qm(){return kt("GET","/capabilities/snapshot")}function r2(){return kt("GET","/plugins/diagnostics")}function NS(l){return _S(i=>{i.type==="runtime.updated"&&l(i.runtime)})}const Vm=20,MS=500;function DS(l){return new Promise(i=>window.setTimeout(i,l))}function LS(){const l=window.navigator.userAgent.toLowerCase().includes("windows")?"windows":window.navigator.userAgent.toLowerCase().includes("mac os x")?"macos":window.navigator.userAgent.toLowerCase().includes("linux")?"linux":"unknown";document.documentElement.classList.add(`platform-${l}`)}function jS(){return j.jsx("div",{className:"min-h-screen flex items-center justify-center bg-white dark:bg-gray-950 p-6",children:j.jsxs("div",{className:"flex items-center gap-3 rounded-2xl border border-gray-200 dark:border-white/[0.08] bg-white dark:bg-gray-900 px-5 py-4 text-sm text-gray-600 dark:text-gray-300 shadow-sm",children:[j.jsx(Xm,{size:16,className:"animate-spin"}),"正在初始化 AgentDock 运行时…"]})})}function wS({message:l,logs:i,onRetry:s}){return j.jsx("div",{className:"min-h-screen flex items-center justify-center bg-white dark:bg-gray-950 p-6",children:j.jsxs("div",{className:"max-w-2xl w-full rounded-3xl border border-red-200 dark:border-red-900/40 bg-white dark:bg-gray-900 shadow-sm overflow-hidden",children:[j.jsx("div",{className:"px-6 py-5 border-b border-red-100 dark:border-red-900/30 bg-red-50/80 dark:bg-red-950/20",children:j.jsxs("div",{className:"flex items-start gap-3",children:[j.jsx("div",{className:"w-10 h-10 rounded-2xl bg-red-100 dark:bg-red-950/40 text-red-600 dark:text-red-300 flex items-center justify-center shrink-0",children:j.jsx(Hy,{size:18})}),j.jsxs("div",{children:[j.jsx("h1",{className:"text-lg font-semibold text-red-700 dark:text-red-300",children:"AgentDock 运行时初始化失败"}),j.jsx("p",{className:"mt-1 text-sm text-red-600 dark:text-red-400 break-words",children:l})]})]})}),j.jsxs("div",{className:"px-6 py-5 space-y-4",children:[j.jsxs("div",{className:"rounded-2xl border border-gray-200 dark:border-white/[0.08] px-4 py-3 text-sm text-gray-600 dark:text-gray-300",children:[j.jsx("p",{className:"font-medium text-gray-900 dark:text-white",children:"What we can do next"}),j.jsx("p",{className:"mt-1",children:"请先重试本地运行时初始化。如果仍然失败,请检查下方运行时日志,并确认 Local AI Core 配置文件路径与运行环境是否正确。"})]}),i.length>0&&j.jsxs("div",{className:"rounded-2xl border border-gray-200 dark:border-white/[0.08] bg-gray-50 dark:bg-gray-950/40 px-4 py-3",children:[j.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-white",children:"最近的桌面日志"}),j.jsx("pre",{className:"mt-2 max-h-64 overflow-auto whitespace-pre-wrap break-words text-xs text-gray-600 dark:text-gray-300 font-mono",children:i.join(`
|
|
162
162
|
`)})]}),j.jsxs("div",{className:"flex gap-3",children:[j.jsxs(Bm,{onClick:s,children:[j.jsx(Xm,{size:14})," 重试初始化"]}),j.jsx(Bm,{variant:"secondary",onClick:()=>window.location.reload(),children:"重新加载应用"})]})]})]})})}function US(){const[l,i]=T.useState({status:"loading"}),s=T.useCallback(async()=>{i({status:"loading"});try{let o=null;for(let c=0;c<Vm;c+=1)try{await CS(),o=null;break}catch(f){o=f,c<Vm-1&&await DS(MS)}if(o)throw o;pm(await qm())}catch(o){let c=[];try{c=await zS(80)}catch{c=[]}i({status:"error",message:o instanceof Error?o.message:String(o),logs:c});return}i({status:"ready"})},[]);return T.useEffect(()=>{s()},[s]),T.useEffect(()=>NS(()=>{qm().then(o=>pm(o)).catch(()=>{})}),[]),l.status==="loading"?j.jsx(jS,{}):l.status==="error"?j.jsx(wS,{message:l.message,logs:l.logs,onRetry:()=>void s()}):j.jsx(v1,{children:j.jsx(Gb,{})})}async function HS(){LS(),await Hb(),yg.getState().init(),Zy.createRoot(document.getElementById("root")).render(j.jsx(Kb,{children:j.jsx(US,{})}))}HS();export{cy as A,Bm as B,my as C,Cg as D,i2 as E,py as F,r2 as G,JS as H,KS as I,IS as J,$S as K,cg as L,Ry as M,XS as N,VS as O,Ey as P,YS as Q,Xm as R,Ly as S,Hy as T,Gy as U,ly as V,ky as W,Rg as X,lg as Y,Do as Z,Ae as _,Ko as a,n2 as b,ie as c,l2 as d,u2 as e,ZS as f,ne as g,Gm as h,GS as i,j,CS as k,QS as l,kS as m,In as n,NS as o,FS as p,PS as q,T as r,_S as s,qS as t,G1 as u,WS as v,t2 as w,e2 as x,a2 as y,kt as z};
|