@chenpu17/cc-gw 0.3.2 → 0.3.3
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/package.json +1 -1
- package/src/cli/dist/index.js +1 -1
- package/src/server/dist/index.js +1 -1
- package/src/web/dist/assets/{About-BRJQg6-i.js → About-BkmW2Z_P.js} +1 -1
- package/src/web/dist/assets/{ApiKeys-BcWxL_bz.js → ApiKeys-iCkTrMfd.js} +1 -1
- package/src/web/dist/assets/{Dashboard-RjvGXnju.js → Dashboard-DtlXibMw.js} +1 -1
- package/src/web/dist/assets/{Help-C33N-jg2.js → Help-CuCYVmBi.js} +1 -1
- package/src/web/dist/assets/{Logs-B-TUIEjX.js → Logs-BePSHk5K.js} +1 -1
- package/src/web/dist/assets/{ModelManagement-Bjnc9-06.js → ModelManagement-elB5p1yK.js} +1 -1
- package/src/web/dist/assets/{Settings-Btgwveb7.js → Settings-r15dRAJv.js} +1 -1
- package/src/web/dist/assets/{index-fNmJF3BX.js → index-A9KFYVCR.js} +2 -2
- package/src/web/dist/assets/{index-DWhAov2p.js → index-D4HwI-vo.js} +1 -1
- package/src/web/dist/assets/{useApiQuery-CCi1tkCr.js → useApiQuery-DA9HUB4n.js} +1 -1
- package/src/web/dist/index.html +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Dashboard-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Dashboard-DtlXibMw.js","assets/index-D4HwI-vo.js","assets/useApiQuery-DA9HUB4n.js","assets/Logs-BePSHk5K.js","assets/ModelManagement-elB5p1yK.js","assets/ApiKeys-iCkTrMfd.js","assets/Settings-r15dRAJv.js","assets/About-BkmW2Z_P.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
var vp=Object.defineProperty;var Na=e=>{throw TypeError(e)};var wp=(e,t,n)=>t in e?vp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Oa=(e,t,n)=>wp(e,typeof t!="symbol"?t+"":t,n),Js=(e,t,n)=>t.has(e)||Na("Cannot "+n);var k=(e,t,n)=>(Js(e,t,"read from private field"),n?n.call(e):t.get(e)),_=(e,t,n)=>t.has(e)?Na("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),j=(e,t,n,r)=>(Js(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),de=(e,t,n)=>(Js(e,t,"access private method"),n);var vi=(e,t,n,r)=>({set _(i){j(e,t,i,n)},get _(){return k(e,t,r)}});function kp(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const s=Object.getOwnPropertyDescriptor(r,i);s&&Object.defineProperty(e,i,s.get?s:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();function Sp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Oc={exports:{}},Ls={},Rc={exports:{}},A={};/**
|
|
3
3
|
* @license React
|
|
4
4
|
* react.production.min.js
|
|
@@ -130,4 +130,4 @@ Error generating stack: `+s.message+`
|
|
|
130
130
|
*
|
|
131
131
|
* This source code is licensed under the ISC license.
|
|
132
132
|
* See the LICENSE file in the root directory of this source tree.
|
|
133
|
-
*/const Ju=Je("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Yu="cc-gw-theme",op=x.createContext(void 0);function My(e){return e==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e}function Xu(e){const t=document.documentElement;t.dataset.theme=e,e==="dark"?t.classList.add("dark"):t.classList.remove("dark")}function Dy({children:e}){const[t,n]=x.useState(()=>{if(typeof window>"u")return"system";const s=window.localStorage.getItem(Yu);return s==="light"||s==="dark"||s==="system"?s:"system"}),r=x.useMemo(()=>typeof window<"u"?My(t):"light",[t]);x.useEffect(()=>{if(typeof window>"u")return;const s=window.matchMedia("(prefers-color-scheme: dark)"),o=l=>{t==="system"&&Xu(l.matches?"dark":"light")};return s.addEventListener("change",o),()=>s.removeEventListener("change",o)},[t]),x.useEffect(()=>{typeof window>"u"||(Xu(r),window.localStorage.setItem(Yu,t))},[t,r]);const i=x.useMemo(()=>({mode:t,resolved:r,setMode:n}),[t,r]);return L.jsx(op.Provider,{value:i,children:e})}function Ay(){const e=x.useContext(op);if(!e)throw new Error("useTheme must be used within ThemeProvider");return e}const Zu=[{mode:"light",labelKey:"common.theme.light"},{mode:"dark",labelKey:"common.theme.dark"},{mode:"system",labelKey:"common.theme.system"}];function _y(){var l;const{mode:e,setMode:t,resolved:n}=Ay(),{t:r}=mi(),[i,s]=x.useState(!1),o=n==="dark"?L.jsx(Iy,{size:16,"aria-hidden":"true"}):L.jsx(jy,{size:16,"aria-hidden":"true"});return L.jsxs("div",{className:"relative",children:[L.jsxs("button",{type:"button",className:"flex items-center gap-2 rounded-md border border-slate-200 bg-white px-3 py-1.5 text-sm shadow-sm transition hover:bg-slate-100 dark:border-slate-700 dark:bg-slate-800 dark:hover:bg-slate-700","aria-haspopup":"listbox","aria-expanded":i,onClick:()=>s(a=>!a),onBlur:()=>s(!1),"aria-label":r("common.theme.label"),children:[o,L.jsx("span",{children:r(((l=Zu.find(a=>a.mode===e))==null?void 0:l.labelKey)??"common.theme.label")})]}),i?L.jsx("ul",{className:"absolute right-0 z-10 mt-1 w-40 overflow-hidden rounded-md border border-slate-200 bg-white shadow-lg dark:border-slate-700 dark:bg-slate-800",children:Zu.map(a=>L.jsx("li",{children:L.jsxs("button",{type:"button",onMouseDown:u=>u.preventDefault(),onClick:()=>{t(a.mode),s(!1)},className:`flex w-full items-center gap-2 px-3 py-2 text-left text-sm transition hover:bg-slate-100 dark:hover:bg-slate-700 ${a.mode===e?"bg-slate-100 dark:bg-slate-700":""}`,children:[L.jsx("span",{className:"h-2 w-2 rounded-full border border-slate-400",children:L.jsx("span",{className:`block h-full w-full rounded-full ${e===a.mode?"bg-blue-500":""}`})}),r(a.labelKey)]})},a.mode))}):null]})}const zy=[{code:"zh",labelKey:"language.zh"},{code:"en",labelKey:"language.en"}];function Uy(){const{i18n:e,t}=mi();return L.jsx("select",{value:e.language.startsWith("zh")?"zh":"en",onChange:n=>e.changeLanguage(n.target.value),className:"rounded-md border border-slate-200 bg-white px-2 py-1 text-sm dark:border-slate-700 dark:bg-slate-800","aria-label":t("common.languageSelector"),children:zy.map(n=>L.jsx("option",{value:n.code,children:t(n.labelKey)},n.code))})}const by=[{to:"/",icon:Cy,labelKey:"nav.dashboard"},{to:"/logs",icon:Ty,labelKey:"nav.logs"},{to:"/models",icon:Ny,labelKey:"nav.models"},{to:"/api-keys",icon:Ly,labelKey:"nav.apiKeys"},{to:"/settings",icon:Fy,labelKey:"nav.settings"},{to:"/help",icon:Oy,labelKey:"nav.help"},{to:"/about",icon:Ey,labelKey:"nav.about"}];function ec({onNavigate:e}){const{t}=mi();return L.jsx("nav",{className:"flex h-full flex-col gap-1","aria-label":t("app.title"),children:by.map(n=>{const r=n.icon;return L.jsxs(ty,{to:n.to,onClick:e,className:({isActive:i})=>`flex items-center gap-3 rounded-md px-3 py-2 text-sm transition hover:bg-slate-100 dark:hover:bg-slate-800 ${i?"bg-blue-100 text-blue-600 dark:bg-blue-900/40 dark:text-blue-200":"text-slate-600 dark:text-slate-300"}`,end:n.to==="/",children:[L.jsx(r,{size:18,"aria-hidden":"true"}),L.jsx("span",{children:t(n.labelKey)})]},n.to)})})}function $y(){const{t:e}=mi(),t=hr(),[n,r]=x.useState(!1);return x.useEffect(()=>{r(!1)},[t.pathname]),L.jsxs("div",{className:"flex h-full bg-slate-50 text-slate-900 dark:bg-slate-950 dark:text-slate-50",children:[L.jsx("a",{href:"#main-content",className:"sr-only focus:not-sr-only focus:absolute focus:z-50 focus:m-4 focus:rounded-md focus:bg-blue-600 focus:px-4 focus:py-2 focus:text-white",children:e("app.skipToContent")}),L.jsxs("aside",{className:"hidden w-60 border-r border-slate-200 bg-white px-4 py-6 dark:border-slate-800 dark:bg-slate-900 lg:block",children:[L.jsx("div",{className:"mb-6 text-lg font-semibold","aria-label":e("app.title"),children:e("app.title")}),L.jsx(ec,{})]}),L.jsxs("div",{className:"flex flex-1 flex-col",children:[L.jsxs("header",{className:"flex items-center justify-between border-b border-slate-200 bg-white px-4 py-3 dark:border-slate-800 dark:bg-slate-900",children:[L.jsxs("div",{className:"flex items-center gap-3 lg:hidden",children:[L.jsx("button",{type:"button",className:"rounded-md border border-slate-200 p-2 text-slate-600 transition hover:bg-slate-100 dark:border-slate-700 dark:text-slate-200 dark:hover:bg-slate-800",onClick:()=>r(i=>!i),"aria-label":e(n?"common.actions.closeNavigation":"common.actions.openNavigation"),"aria-expanded":n,"aria-controls":"mobile-nav",children:n?L.jsx(Ju,{size:18,"aria-hidden":"true"}):L.jsx(Ry,{size:18,"aria-hidden":"true"})}),L.jsx("div",{className:"text-base font-semibold",children:e("app.title")})]}),L.jsxs("div",{className:"flex items-center gap-3",children:[L.jsx(Uy,{}),L.jsx(_y,{})]})]}),L.jsx("main",{id:"main-content",role:"main",tabIndex:-1,className:"flex-1 overflow-y-auto bg-slate-100 p-4 sm:p-6 dark:bg-slate-950",children:L.jsx($g,{})})]}),n?L.jsx("div",{className:"fixed inset-0 z-40 bg-slate-900/60 backdrop-blur-sm lg:hidden",role:"dialog","aria-modal":"true",children:L.jsxs("div",{id:"mobile-nav",className:"absolute inset-y-0 left-0 w-64 border-r border-slate-200 bg-white px-4 py-6 shadow-lg dark:border-slate-800 dark:bg-slate-900",children:[L.jsxs("div",{className:"mb-6 flex items-center justify-between",children:[L.jsx("span",{className:"text-base font-semibold",children:e("app.title")}),L.jsx("button",{type:"button",className:"rounded-md border border-slate-200 p-2 text-slate-600 transition hover:bg-slate-100 dark:border-slate-700 dark:text-slate-200 dark:hover:bg-slate-800",onClick:()=>r(!1),"aria-label":e("common.actions.closeNavigation"),children:L.jsx(Ju,{size:18,"aria-hidden":"true"})})]}),L.jsx(ec,{onNavigate:()=>r(!1)})]})}):null]})}var Qs=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Ky={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Lt,Il,kc,Vy=(kc=class{constructor(){_(this,Lt,Ky);_(this,Il,!1)}setTimeoutProvider(e){j(this,Lt,e)}setTimeout(e,t){return k(this,Lt).setTimeout(e,t)}clearTimeout(e){k(this,Lt).clearTimeout(e)}setInterval(e,t){return k(this,Lt).setInterval(e,t)}clearInterval(e){k(this,Lt).clearInterval(e)}},Lt=new WeakMap,Il=new WeakMap,kc),Tl=new Vy;function By(e){setTimeout(e,0)}var qs=typeof window>"u"||"Deno"in globalThis;function Ke(){}function Hy(e,t){return typeof e=="function"?e(t):e}function Qy(e){return typeof e=="number"&&e>=0&&e!==1/0}function qy(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ll(e,t){return typeof e=="function"?e(t):e}function Wy(e,t){return typeof e=="function"?e(t):e}function tc(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:s,queryKey:o,stale:l}=e;if(o){if(r){if(t.queryHash!==Ta(o,t.options))return!1}else if(!ii(t.queryKey,o))return!1}if(n!=="all"){const a=t.isActive();if(n==="active"&&!a||n==="inactive"&&a)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||i&&i!==t.state.fetchStatus||s&&!s(t))}function nc(e,t){const{exact:n,status:r,predicate:i,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(ri(t.options.mutationKey)!==ri(s))return!1}else if(!ii(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Ta(e,t){return((t==null?void 0:t.queryKeyHashFn)||ri)(e)}function ri(e){return JSON.stringify(e,(t,n)=>Nl(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function ii(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>ii(e[n],t[n])):!1}var Gy=Object.prototype.hasOwnProperty;function lp(e,t){if(e===t)return e;const n=rc(e)&&rc(t);if(!n&&!(Nl(e)&&Nl(t)))return t;const i=(n?e:Object.keys(e)).length,s=n?t:Object.keys(t),o=s.length,l=n?new Array(o):{};let a=0;for(let u=0;u<o;u++){const d=n?u:s[u],f=e[d],c=t[d];if(f===c){l[d]=f,(n?u<i:Gy.call(e,d))&&a++;continue}if(f===null||c===null||typeof f!="object"||typeof c!="object"){l[d]=c;continue}const y=lp(f,c);l[d]=y,y===f&&a++}return i===o&&a===i?e:l}function Yv(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function rc(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Nl(e){if(!ic(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!ic(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function ic(e){return Object.prototype.toString.call(e)==="[object Object]"}function Jy(e){return new Promise(t=>{Tl.setTimeout(t,e)})}function Yy(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?lp(e,t):t}function Xv(e){return e}function Xy(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function Zy(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var La=Symbol();function ap(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===La?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Zv(e,t){return typeof e=="function"?e(...t):!!e}var an,Nt,Wn,Sc,ev=(Sc=class extends Qs{constructor(){super();_(this,an);_(this,Nt);_(this,Wn);j(this,Wn,t=>{if(!qs&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){k(this,Nt)||this.setEventListener(k(this,Wn))}onUnsubscribe(){var t;this.hasListeners()||((t=k(this,Nt))==null||t.call(this),j(this,Nt,void 0))}setEventListener(t){var n;j(this,Wn,t),(n=k(this,Nt))==null||n.call(this),j(this,Nt,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){k(this,an)!==t&&(j(this,an,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof k(this,an)=="boolean"?k(this,an):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},an=new WeakMap,Nt=new WeakMap,Wn=new WeakMap,Sc),up=new ev;function tv(){let e,t;const n=new Promise((i,s)=>{e=i,t=s});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}var nv=By;function rv(){let e=[],t=0,n=l=>{l()},r=l=>{l()},i=nv;const s=l=>{t?e.push(l):i(()=>{n(l)})},o=()=>{const l=e;e=[],l.length&&i(()=>{r(()=>{l.forEach(a=>{n(a)})})})};return{batch:l=>{let a;t++;try{a=l()}finally{t--,t||o()}return a},batchCalls:l=>(...a)=>{s(()=>{l(...a)})},schedule:s,setNotifyFunction:l=>{n=l},setBatchNotifyFunction:l=>{r=l},setScheduler:l=>{i=l}}}var ve=rv(),Gn,Ot,Jn,xc,iv=(xc=class extends Qs{constructor(){super();_(this,Gn,!0);_(this,Ot);_(this,Jn);j(this,Jn,t=>{if(!qs&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){k(this,Ot)||this.setEventListener(k(this,Jn))}onUnsubscribe(){var t;this.hasListeners()||((t=k(this,Ot))==null||t.call(this),j(this,Ot,void 0))}setEventListener(t){var n;j(this,Jn,t),(n=k(this,Ot))==null||n.call(this),j(this,Ot,t(this.setOnline.bind(this)))}setOnline(t){k(this,Gn)!==t&&(j(this,Gn,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return k(this,Gn)}},Gn=new WeakMap,Ot=new WeakMap,Jn=new WeakMap,xc),xs=new iv;function sv(e){return Math.min(1e3*2**e,3e4)}function cp(e){return(e??"online")==="online"?xs.isOnline():!0}var Ol=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function dp(e){let t=!1,n=0,r;const i=tv(),s=()=>i.status!=="pending",o=v=>{var S;if(!s()){const h=new Ol(v);c(h),(S=e.onCancel)==null||S.call(e,h)}},l=()=>{t=!0},a=()=>{t=!1},u=()=>up.isFocused()&&(e.networkMode==="always"||xs.isOnline())&&e.canRun(),d=()=>cp(e.networkMode)&&e.canRun(),f=v=>{s()||(r==null||r(),i.resolve(v))},c=v=>{s()||(r==null||r(),i.reject(v))},y=()=>new Promise(v=>{var S;r=h=>{(s()||u())&&v(h)},(S=e.onPause)==null||S.call(e)}).then(()=>{var v;r=void 0,s()||(v=e.onContinue)==null||v.call(e)}),w=()=>{if(s())return;let v;const S=n===0?e.initialPromise:void 0;try{v=S??e.fn()}catch(h){v=Promise.reject(h)}Promise.resolve(v).then(f).catch(h=>{var C;if(s())return;const p=e.retry??(qs?0:3),m=e.retryDelay??sv,g=typeof m=="function"?m(n,h):m,P=p===!0||typeof p=="number"&&n<p||typeof p=="function"&&p(n,h);if(t||!P){c(h);return}n++,(C=e.onFail)==null||C.call(e,n,h),Jy(g).then(()=>u()?void 0:y()).then(()=>{t?c(h):w()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r==null||r(),i),cancelRetry:l,continueRetry:a,canStart:d,start:()=>(d()?w():y().then(w),i)}}var un,Pc,fp=(Pc=class{constructor(){_(this,un)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Qy(this.gcTime)&&j(this,un,Tl.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(qs?1/0:5*60*1e3))}clearGcTimeout(){k(this,un)&&(Tl.clearTimeout(k(this,un)),j(this,un,void 0))}},un=new WeakMap,Pc),cn,Yn,je,dn,ie,oi,fn,Ve,lt,Cc,ov=(Cc=class extends fp{constructor(t){super();_(this,Ve);_(this,cn);_(this,Yn);_(this,je);_(this,dn);_(this,ie);_(this,oi);_(this,fn);j(this,fn,!1),j(this,oi,t.defaultOptions),this.setOptions(t.options),this.observers=[],j(this,dn,t.client),j(this,je,k(this,dn).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,j(this,cn,sc(this.options)),this.state=t.state??k(this,cn),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=k(this,ie))==null?void 0:t.promise}setOptions(t){if(this.options={...k(this,oi),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=sc(this.options);n.data!==void 0&&(this.setData(n.data,{updatedAt:n.dataUpdatedAt,manual:!0}),j(this,cn,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&k(this,je).remove(this)}setData(t,n){const r=Yy(this.state.data,t,this.options);return de(this,Ve,lt).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){de(this,Ve,lt).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,i;const n=(r=k(this,ie))==null?void 0:r.promise;return(i=k(this,ie))==null||i.cancel(t),n?n.then(Ke).catch(Ke):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(k(this,cn))}isActive(){return this.observers.some(t=>Wy(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===La||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Ll(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!qy(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=k(this,ie))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=k(this,ie))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),k(this,je).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(k(this,ie)&&(k(this,fn)?k(this,ie).cancel({revert:!0}):k(this,ie).cancelRetry()),this.scheduleGc()),k(this,je).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||de(this,Ve,lt).call(this,{type:"invalidate"})}async fetch(t,n){var a,u,d,f,c,y,w,v,S,h,p,m;if(this.state.fetchStatus!=="idle"&&((a=k(this,ie))==null?void 0:a.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(k(this,ie))return k(this,ie).continueRetry(),k(this,ie).promise}if(t&&this.setOptions(t),!this.options.queryFn){const g=this.observers.find(P=>P.options.queryFn);g&&this.setOptions(g.options)}const r=new AbortController,i=g=>{Object.defineProperty(g,"signal",{enumerable:!0,get:()=>(j(this,fn,!0),r.signal)})},s=()=>{const g=ap(this.options,n),C=(()=>{const E={client:k(this,dn),queryKey:this.queryKey,meta:this.meta};return i(E),E})();return j(this,fn,!1),this.options.persister?this.options.persister(g,C,this):g(C)},l=(()=>{const g={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:k(this,dn),state:this.state,fetchFn:s};return i(g),g})();(u=this.options.behavior)==null||u.onFetch(l,this),j(this,Yn,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=l.fetchOptions)==null?void 0:d.meta))&&de(this,Ve,lt).call(this,{type:"fetch",meta:(f=l.fetchOptions)==null?void 0:f.meta}),j(this,ie,dp({initialPromise:n==null?void 0:n.initialPromise,fn:l.fetchFn,onCancel:g=>{g instanceof Ol&&g.revert&&this.setState({...k(this,Yn),fetchStatus:"idle"}),r.abort()},onFail:(g,P)=>{de(this,Ve,lt).call(this,{type:"failed",failureCount:g,error:P})},onPause:()=>{de(this,Ve,lt).call(this,{type:"pause"})},onContinue:()=>{de(this,Ve,lt).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0}));try{const g=await k(this,ie).start();if(g===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(g),(y=(c=k(this,je).config).onSuccess)==null||y.call(c,g,this),(v=(w=k(this,je).config).onSettled)==null||v.call(w,g,this.state.error,this),g}catch(g){if(g instanceof Ol){if(g.silent)return k(this,ie).promise;if(g.revert){if(this.state.data===void 0)throw g;return this.state.data}}throw de(this,Ve,lt).call(this,{type:"error",error:g}),(h=(S=k(this,je).config).onError)==null||h.call(S,g,this),(m=(p=k(this,je).config).onSettled)==null||m.call(p,this.state.data,g,this),g}finally{this.scheduleGc()}}},cn=new WeakMap,Yn=new WeakMap,je=new WeakMap,dn=new WeakMap,ie=new WeakMap,oi=new WeakMap,fn=new WeakMap,Ve=new WeakSet,lt=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...lv(r.data,this.options),fetchMeta:t.meta??null};case"success":const i={...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return j(this,Yn,t.manual?i:void 0),i;case"error":const s=t.error;return{...r,error:s,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),ve.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),k(this,je).notify({query:this,type:"updated",action:t})})},Cc);function lv(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:cp(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function sc(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}function oc(e){return{onFetch:(t,n)=>{var d,f,c,y,w;const r=t.options,i=(c=(f=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:f.fetchMore)==null?void 0:c.direction,s=((y=t.state.data)==null?void 0:y.pages)||[],o=((w=t.state.data)==null?void 0:w.pageParams)||[];let l={pages:[],pageParams:[]},a=0;const u=async()=>{let v=!1;const S=m=>{Object.defineProperty(m,"signal",{enumerable:!0,get:()=>(t.signal.aborted?v=!0:t.signal.addEventListener("abort",()=>{v=!0}),t.signal)})},h=ap(t.options,t.fetchOptions),p=async(m,g,P)=>{if(v)return Promise.reject();if(g==null&&m.pages.length)return Promise.resolve(m);const E=(()=>{const $={client:t.client,queryKey:t.queryKey,pageParam:g,direction:P?"backward":"forward",meta:t.options.meta};return S($),$})(),O=await h(E),{maxPages:U}=t.options,I=P?Zy:Xy;return{pages:I(m.pages,O,U),pageParams:I(m.pageParams,g,U)}};if(i&&s.length){const m=i==="backward",g=m?av:lc,P={pages:s,pageParams:o},C=g(r,P);l=await p(P,C,m)}else{const m=e??s.length;do{const g=a===0?o[0]??r.initialPageParam:lc(r,l);if(a>0&&g==null)break;l=await p(l,g),a++}while(a<m)}return l};t.options.persister?t.fetchFn=()=>{var v,S;return(S=(v=t.options).persister)==null?void 0:S.call(v,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=u}}}function lc(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function av(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var li,et,ge,pn,tt,xt,Ec,uv=(Ec=class extends fp{constructor(t){super();_(this,tt);_(this,li);_(this,et);_(this,ge);_(this,pn);j(this,li,t.client),this.mutationId=t.mutationId,j(this,ge,t.mutationCache),j(this,et,[]),this.state=t.state||cv(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){k(this,et).includes(t)||(k(this,et).push(t),this.clearGcTimeout(),k(this,ge).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){j(this,et,k(this,et).filter(n=>n!==t)),this.scheduleGc(),k(this,ge).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){k(this,et).length||(this.state.status==="pending"?this.scheduleGc():k(this,ge).remove(this))}continue(){var t;return((t=k(this,pn))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,l,a,u,d,f,c,y,w,v,S,h,p,m,g,P,C,E,O,U;const n=()=>{de(this,tt,xt).call(this,{type:"continue"})},r={client:k(this,li),meta:this.options.meta,mutationKey:this.options.mutationKey};j(this,pn,dp({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(I,$)=>{de(this,tt,xt).call(this,{type:"failed",failureCount:I,error:$})},onPause:()=>{de(this,tt,xt).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>k(this,ge).canRun(this)}));const i=this.state.status==="pending",s=!k(this,pn).canStart();try{if(i)n();else{de(this,tt,xt).call(this,{type:"pending",variables:t,isPaused:s}),await((l=(o=k(this,ge).config).onMutate)==null?void 0:l.call(o,t,this,r));const $=await((u=(a=this.options).onMutate)==null?void 0:u.call(a,t,r));$!==this.state.context&&de(this,tt,xt).call(this,{type:"pending",context:$,variables:t,isPaused:s})}const I=await k(this,pn).start();return await((f=(d=k(this,ge).config).onSuccess)==null?void 0:f.call(d,I,t,this.state.context,this,r)),await((y=(c=this.options).onSuccess)==null?void 0:y.call(c,I,t,this.state.context,r)),await((v=(w=k(this,ge).config).onSettled)==null?void 0:v.call(w,I,null,this.state.variables,this.state.context,this,r)),await((h=(S=this.options).onSettled)==null?void 0:h.call(S,I,null,t,this.state.context,r)),de(this,tt,xt).call(this,{type:"success",data:I}),I}catch(I){try{throw await((m=(p=k(this,ge).config).onError)==null?void 0:m.call(p,I,t,this.state.context,this,r)),await((P=(g=this.options).onError)==null?void 0:P.call(g,I,t,this.state.context,r)),await((E=(C=k(this,ge).config).onSettled)==null?void 0:E.call(C,void 0,I,this.state.variables,this.state.context,this,r)),await((U=(O=this.options).onSettled)==null?void 0:U.call(O,void 0,I,t,this.state.context,r)),I}finally{de(this,tt,xt).call(this,{type:"error",error:I})}}finally{k(this,ge).runNext(this)}}},li=new WeakMap,et=new WeakMap,ge=new WeakMap,pn=new WeakMap,tt=new WeakSet,xt=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),ve.batch(()=>{k(this,et).forEach(r=>{r.onMutationUpdate(t)}),k(this,ge).notify({mutation:this,type:"updated",action:t})})},Ec);function cv(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var ct,Be,ai,Tc,dv=(Tc=class extends Qs{constructor(t={}){super();_(this,ct);_(this,Be);_(this,ai);this.config=t,j(this,ct,new Set),j(this,Be,new Map),j(this,ai,0)}build(t,n,r){const i=new uv({client:t,mutationCache:this,mutationId:++vi(this,ai)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){k(this,ct).add(t);const n=Ai(t);if(typeof n=="string"){const r=k(this,Be).get(n);r?r.push(t):k(this,Be).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(k(this,ct).delete(t)){const n=Ai(t);if(typeof n=="string"){const r=k(this,Be).get(n);if(r)if(r.length>1){const i=r.indexOf(t);i!==-1&&r.splice(i,1)}else r[0]===t&&k(this,Be).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=Ai(t);if(typeof n=="string"){const r=k(this,Be).get(n),i=r==null?void 0:r.find(s=>s.state.status==="pending");return!i||i===t}else return!0}runNext(t){var r;const n=Ai(t);if(typeof n=="string"){const i=(r=k(this,Be).get(n))==null?void 0:r.find(s=>s!==t&&s.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){ve.batch(()=>{k(this,ct).forEach(t=>{this.notify({type:"removed",mutation:t})}),k(this,ct).clear(),k(this,Be).clear()})}getAll(){return Array.from(k(this,ct))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>nc(n,r))}findAll(t={}){return this.getAll().filter(n=>nc(t,n))}notify(t){ve.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return ve.batch(()=>Promise.all(t.map(n=>n.continue().catch(Ke))))}},ct=new WeakMap,Be=new WeakMap,ai=new WeakMap,Tc);function Ai(e){var t;return(t=e.options.scope)==null?void 0:t.id}var nt,Lc,fv=(Lc=class extends Qs{constructor(t={}){super();_(this,nt);this.config=t,j(this,nt,new Map)}build(t,n,r){const i=n.queryKey,s=n.queryHash??Ta(i,n);let o=this.get(s);return o||(o=new ov({client:t,queryKey:i,queryHash:s,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(o)),o}add(t){k(this,nt).has(t.queryHash)||(k(this,nt).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=k(this,nt).get(t.queryHash);n&&(t.destroy(),n===t&&k(this,nt).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){ve.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return k(this,nt).get(t)}getAll(){return[...k(this,nt).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>tc(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>tc(t,r)):n}notify(t){ve.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){ve.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){ve.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},nt=new WeakMap,Lc),J,Rt,It,Xn,Zn,Ft,er,tr,Nc,pv=(Nc=class{constructor(e={}){_(this,J);_(this,Rt);_(this,It);_(this,Xn);_(this,Zn);_(this,Ft);_(this,er);_(this,tr);j(this,J,e.queryCache||new fv),j(this,Rt,e.mutationCache||new dv),j(this,It,e.defaultOptions||{}),j(this,Xn,new Map),j(this,Zn,new Map),j(this,Ft,0)}mount(){vi(this,Ft)._++,k(this,Ft)===1&&(j(this,er,up.subscribe(async e=>{e&&(await this.resumePausedMutations(),k(this,J).onFocus())})),j(this,tr,xs.subscribe(async e=>{e&&(await this.resumePausedMutations(),k(this,J).onOnline())})))}unmount(){var e,t;vi(this,Ft)._--,k(this,Ft)===0&&((e=k(this,er))==null||e.call(this),j(this,er,void 0),(t=k(this,tr))==null||t.call(this),j(this,tr,void 0))}isFetching(e){return k(this,J).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return k(this,Rt).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=k(this,J).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=k(this,J).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Ll(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return k(this,J).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),i=k(this,J).get(r.queryHash),s=i==null?void 0:i.state.data,o=Hy(t,s);if(o!==void 0)return k(this,J).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return ve.batch(()=>k(this,J).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=k(this,J).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=k(this,J);ve.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=k(this,J);return ve.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=ve.batch(()=>k(this,J).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(Ke).catch(Ke)}invalidateQueries(e,t={}){return ve.batch(()=>(k(this,J).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=ve.batch(()=>k(this,J).findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let s=i.fetch(void 0,n);return n.throwOnError||(s=s.catch(Ke)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(Ke)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=k(this,J).build(this,t);return n.isStaleByTime(Ll(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Ke).catch(Ke)}fetchInfiniteQuery(e){return e.behavior=oc(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Ke).catch(Ke)}ensureInfiniteQueryData(e){return e.behavior=oc(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return xs.isOnline()?k(this,Rt).resumePausedMutations():Promise.resolve()}getQueryCache(){return k(this,J)}getMutationCache(){return k(this,Rt)}getDefaultOptions(){return k(this,It)}setDefaultOptions(e){j(this,It,e)}setQueryDefaults(e,t){k(this,Xn).set(ri(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...k(this,Xn).values()],n={};return t.forEach(r=>{ii(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){k(this,Zn).set(ri(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...k(this,Zn).values()],n={};return t.forEach(r=>{ii(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...k(this,It).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Ta(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===La&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...k(this,It).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){k(this,J).clear(),k(this,Rt).clear()}},J=new WeakMap,Rt=new WeakMap,It=new WeakMap,Xn=new WeakMap,Zn=new WeakMap,Ft=new WeakMap,er=new WeakMap,tr=new WeakMap,Nc),pp=x.createContext(void 0),e0=e=>{const t=x.useContext(pp);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},hv=({client:e,children:t})=>(x.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),L.jsx(pp.Provider,{value:e,children:t}));const M=e=>typeof e=="string",Pr=()=>{let e,t;const n=new Promise((r,i)=>{e=r,t=i});return n.resolve=e,n.reject=t,n},ac=e=>e==null?"":""+e,mv=(e,t,n)=>{e.forEach(r=>{t[r]&&(n[r]=t[r])})},gv=/###/g,uc=e=>e&&e.indexOf("###")>-1?e.replace(gv,"."):e,cc=e=>!e||M(e),_r=(e,t,n)=>{const r=M(t)?t.split("."):t;let i=0;for(;i<r.length-1;){if(cc(e))return{};const s=uc(r[i]);!e[s]&&n&&(e[s]=new n),Object.prototype.hasOwnProperty.call(e,s)?e=e[s]:e={},++i}return cc(e)?{}:{obj:e,k:uc(r[i])}},dc=(e,t,n)=>{const{obj:r,k:i}=_r(e,t,Object);if(r!==void 0||t.length===1){r[i]=n;return}let s=t[t.length-1],o=t.slice(0,t.length-1),l=_r(e,o,Object);for(;l.obj===void 0&&o.length;)s=`${o[o.length-1]}.${s}`,o=o.slice(0,o.length-1),l=_r(e,o,Object),l&&l.obj&&typeof l.obj[`${l.k}.${s}`]<"u"&&(l.obj=void 0);l.obj[`${l.k}.${s}`]=n},yv=(e,t,n,r)=>{const{obj:i,k:s}=_r(e,t,Object);i[s]=i[s]||[],i[s].push(n)},Ps=(e,t)=>{const{obj:n,k:r}=_r(e,t);if(n)return n[r]},vv=(e,t,n)=>{const r=Ps(e,n);return r!==void 0?r:Ps(t,n)},hp=(e,t,n)=>{for(const r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?M(e[r])||e[r]instanceof String||M(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):hp(e[r],t[r],n):e[r]=t[r]);return e},Nn=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var wv={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const kv=e=>M(e)?e.replace(/[&<>"'\/]/g,t=>wv[t]):e;class Sv{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const n=this.regExpMap.get(t);if(n!==void 0)return n;const r=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,r),this.regExpQueue.push(t),r}}const xv=[" ",",","?","!",";"],Pv=new Sv(20),Cv=(e,t,n)=>{t=t||"",n=n||"";const r=xv.filter(o=>t.indexOf(o)<0&&n.indexOf(o)<0);if(r.length===0)return!0;const i=Pv.getRegExp(`(${r.map(o=>o==="?"?"\\?":o).join("|")})`);let s=!i.test(e);if(!s){const o=e.indexOf(n);o>0&&!i.test(e.substring(0,o))&&(s=!0)}return s},Rl=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!e)return;if(e[t])return e[t];const r=t.split(n);let i=e;for(let s=0;s<r.length;){if(!i||typeof i!="object")return;let o,l="";for(let a=s;a<r.length;++a)if(a!==s&&(l+=n),l+=r[a],o=i[l],o!==void 0){if(["string","number","boolean"].indexOf(typeof o)>-1&&a<r.length-1)continue;s+=a-s+1;break}i=o}return i},Cs=e=>e&&e.replace("_","-"),Ev={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console&&console[e]&&console[e].apply(console,t)}};class Es{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(t,n)}init(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=n.prefix||"i18next:",this.logger=t||Ev,this.options=n,this.debug=n.debug}log(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"log","",!0)}warn(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"warn","",!0)}error(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"error","")}deprecate(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"warn","WARNING DEPRECATED: ",!0)}forward(t,n,r,i){return i&&!this.debug?null:(M(t[0])&&(t[0]=`${r}${this.prefix} ${t[0]}`),this.logger[n](t))}create(t){return new Es(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new Es(this.logger,t)}}var it=new Es;class Ws{constructor(){this.observers={}}on(t,n){return t.split(" ").forEach(r=>{this.observers[r]||(this.observers[r]=new Map);const i=this.observers[r].get(n)||0;this.observers[r].set(n,i+1)}),this}off(t,n){if(this.observers[t]){if(!n){delete this.observers[t];return}this.observers[t].delete(n)}}emit(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];this.observers[t]&&Array.from(this.observers[t].entries()).forEach(o=>{let[l,a]=o;for(let u=0;u<a;u++)l(...r)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(o=>{let[l,a]=o;for(let u=0;u<a;u++)l.apply(l,[t,...r])})}}class fc extends Ws{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=t||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const n=this.options.ns.indexOf(t);n>-1&&this.options.ns.splice(n,1)}getResource(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const s=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,o=i.ignoreJSONStructure!==void 0?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let l;t.indexOf(".")>-1?l=t.split("."):(l=[t,n],r&&(Array.isArray(r)?l.push(...r):M(r)&&s?l.push(...r.split(s)):l.push(r)));const a=Ps(this.data,l);return!a&&!n&&!r&&t.indexOf(".")>-1&&(t=l[0],n=l[1],r=l.slice(2).join(".")),a||!o||!M(r)?a:Rl(this.data&&this.data[t]&&this.data[t][n],r,s)}addResource(t,n,r,i){let s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const o=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator;let l=[t,n];r&&(l=l.concat(o?r.split(o):r)),t.indexOf(".")>-1&&(l=t.split("."),i=n,n=l[1]),this.addNamespaces(n),dc(this.data,l,i),s.silent||this.emit("added",t,n,r,i)}addResources(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const s in r)(M(r[s])||Array.isArray(r[s]))&&this.addResource(t,n,s,r[s],{silent:!0});i.silent||this.emit("added",t,n,r)}addResourceBundle(t,n,r,i,s){let o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},l=[t,n];t.indexOf(".")>-1&&(l=t.split("."),i=r,r=n,n=l[1]),this.addNamespaces(n);let a=Ps(this.data,l)||{};o.skipCopy||(r=JSON.parse(JSON.stringify(r))),i?hp(a,r,s):a={...a,...r},dc(this.data,l,a),o.silent||this.emit("added",t,n,r)}removeResourceBundle(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}hasResourceBundle(t,n){return this.getResource(t,n)!==void 0}getResourceBundle(t,n){return n||(n=this.options.defaultNS),this.options.compatibilityAPI==="v1"?{...this.getResource(t,n)}:this.getResource(t,n)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(i=>n[i]&&Object.keys(n[i]).length>0)}toJSON(){return this.data}}var mp={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,i){return e.forEach(s=>{this.processors[s]&&(t=this.processors[s].process(t,n,r,i))}),t}};const pc={};class Ts extends Ws{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),mv(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=it.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(t==null)return!1;const r=this.resolve(t,n);return r&&r.res!==void 0}extractFromKey(t,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const i=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let s=n.ns||this.options.defaultNS||[];const o=r&&t.indexOf(r)>-1,l=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!Cv(t,r,i);if(o&&!l){const a=t.match(this.interpolator.nestingRegexp);if(a&&a.length>0)return{key:t,namespaces:M(s)?[s]:s};const u=t.split(r);(r!==i||r===i&&this.options.ns.indexOf(u[0])>-1)&&(s=u.shift()),t=u.join(i)}return{key:t,namespaces:M(s)?[s]:s}}translate(t,n,r){if(typeof n!="object"&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),typeof n=="object"&&(n={...n}),n||(n={}),t==null)return"";Array.isArray(t)||(t=[String(t)]);const i=n.returnDetails!==void 0?n.returnDetails:this.options.returnDetails,s=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,{key:o,namespaces:l}=this.extractFromKey(t[t.length-1],n),a=l[l.length-1],u=n.lng||this.language,d=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(u&&u.toLowerCase()==="cimode"){if(d){const g=n.nsSeparator||this.options.nsSeparator;return i?{res:`${a}${g}${o}`,usedKey:o,exactUsedKey:o,usedLng:u,usedNS:a,usedParams:this.getUsedParamsDetails(n)}:`${a}${g}${o}`}return i?{res:o,usedKey:o,exactUsedKey:o,usedLng:u,usedNS:a,usedParams:this.getUsedParamsDetails(n)}:o}const f=this.resolve(t,n);let c=f&&f.res;const y=f&&f.usedKey||o,w=f&&f.exactUsedKey||o,v=Object.prototype.toString.apply(c),S=["[object Number]","[object Function]","[object RegExp]"],h=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,p=!this.i18nFormat||this.i18nFormat.handleAsObject,m=!M(c)&&typeof c!="boolean"&&typeof c!="number";if(p&&c&&m&&S.indexOf(v)<0&&!(M(h)&&Array.isArray(c))){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const g=this.options.returnedObjectHandler?this.options.returnedObjectHandler(y,c,{...n,ns:l}):`key '${o} (${this.language})' returned an object instead of string.`;return i?(f.res=g,f.usedParams=this.getUsedParamsDetails(n),f):g}if(s){const g=Array.isArray(c),P=g?[]:{},C=g?w:y;for(const E in c)if(Object.prototype.hasOwnProperty.call(c,E)){const O=`${C}${s}${E}`;P[E]=this.translate(O,{...n,joinArrays:!1,ns:l}),P[E]===O&&(P[E]=c[E])}c=P}}else if(p&&M(h)&&Array.isArray(c))c=c.join(h),c&&(c=this.extendTranslation(c,t,n,r));else{let g=!1,P=!1;const C=n.count!==void 0&&!M(n.count),E=Ts.hasDefaultValue(n),O=C?this.pluralResolver.getSuffix(u,n.count,n):"",U=n.ordinal&&C?this.pluralResolver.getSuffix(u,n.count,{ordinal:!1}):"",I=C&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),$=I&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${O}`]||n[`defaultValue${U}`]||n.defaultValue;!this.isValidLookup(c)&&E&&(g=!0,c=$),this.isValidLookup(c)||(P=!0,c=o);const Xt=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&P?void 0:c,wt=E&&$!==c&&this.options.updateMissing;if(P||g||wt){if(this.logger.log(wt?"updateKey":"missingKey",u,a,o,wt?$:c),s){const N=this.resolve(o,{...n,keySeparator:!1});N&&N.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 Zt=[];const kt=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&kt&&kt[0])for(let N=0;N<kt.length;N++)Zt.push(kt[N]);else this.options.saveMissingTo==="all"?Zt=this.languageUtils.toResolveHierarchy(n.lng||this.language):Zt.push(n.lng||this.language);const Tn=(N,F,D)=>{const H=E&&D!==c?D:Xt;this.options.missingKeyHandler?this.options.missingKeyHandler(N,a,F,H,wt,n):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(N,a,F,H,wt,n),this.emit("missingKey",N,a,F,c)};this.options.saveMissing&&(this.options.saveMissingPlurals&&C?Zt.forEach(N=>{const F=this.pluralResolver.getSuffixes(N,n);I&&n[`defaultValue${this.options.pluralSeparator}zero`]&&F.indexOf(`${this.options.pluralSeparator}zero`)<0&&F.push(`${this.options.pluralSeparator}zero`),F.forEach(D=>{Tn([N],o+D,n[`defaultValue${D}`]||$)})}):Tn(Zt,o,$))}c=this.extendTranslation(c,t,n,f,r),P&&c===o&&this.options.appendNamespaceToMissingKey&&(c=`${a}:${o}`),(P||g)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?c=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${a}:${o}`:o,g?c:void 0):c=this.options.parseMissingKeyHandler(c))}return i?(f.res=c,f.usedParams=this.getUsedParamsDetails(n),f):c}extendTranslation(t,n,r,i,s){var o=this;if(this.i18nFormat&&this.i18nFormat.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const u=M(t)&&(r&&r.interpolation&&r.interpolation.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let d;if(u){const c=t.match(this.interpolator.nestingRegexp);d=c&&c.length}let f=r.replace&&!M(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(f={...this.options.interpolation.defaultVariables,...f}),t=this.interpolator.interpolate(t,f,r.lng||this.language||i.usedLng,r),u){const c=t.match(this.interpolator.nestingRegexp),y=c&&c.length;d<y&&(r.nest=!1)}!r.lng&&this.options.compatibilityAPI!=="v1"&&i&&i.res&&(r.lng=this.language||i.usedLng),r.nest!==!1&&(t=this.interpolator.nest(t,function(){for(var c=arguments.length,y=new Array(c),w=0;w<c;w++)y[w]=arguments[w];return s&&s[0]===y[0]&&!r.context?(o.logger.warn(`It seems you are nesting recursively key: ${y[0]} in key: ${n[0]}`),null):o.translate(...y,n)},r)),r.interpolation&&this.interpolator.reset()}const l=r.postProcess||this.options.postProcess,a=M(l)?[l]:l;return t!=null&&a&&a.length&&r.applyPostProcessor!==!1&&(t=mp.handle(a,t,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...i,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),t}resolve(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r,i,s,o,l;return M(t)&&(t=[t]),t.forEach(a=>{if(this.isValidLookup(r))return;const u=this.extractFromKey(a,n),d=u.key;i=d;let f=u.namespaces;this.options.fallbackNS&&(f=f.concat(this.options.fallbackNS));const c=n.count!==void 0&&!M(n.count),y=c&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),w=n.context!==void 0&&(M(n.context)||typeof n.context=="number")&&n.context!=="",v=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);f.forEach(S=>{this.isValidLookup(r)||(l=S,!pc[`${v[0]}-${S}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(l)&&(pc[`${v[0]}-${S}`]=!0,this.logger.warn(`key "${i}" for languages "${v.join(", ")}" won't get resolved as namespace "${l}" 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!!!")),v.forEach(h=>{if(this.isValidLookup(r))return;o=h;const p=[d];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(p,d,h,S,n);else{let g;c&&(g=this.pluralResolver.getSuffix(h,n.count,n));const P=`${this.options.pluralSeparator}zero`,C=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(c&&(p.push(d+g),n.ordinal&&g.indexOf(C)===0&&p.push(d+g.replace(C,this.options.pluralSeparator)),y&&p.push(d+P)),w){const E=`${d}${this.options.contextSeparator}${n.context}`;p.push(E),c&&(p.push(E+g),n.ordinal&&g.indexOf(C)===0&&p.push(E+g.replace(C,this.options.pluralSeparator)),y&&p.push(E+P))}}let m;for(;m=p.pop();)this.isValidLookup(r)||(s=m,r=this.getResource(h,S,m,n))}))})}),{res:r,usedKey:i,exactUsedKey:s,usedLng:o,usedNS:l}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(t,n,r,i):this.resourceStore.getResource(t,n,r,i)}getUsedParamsDetails(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=t.replace&&!M(t.replace);let i=r?t.replace:t;if(r&&typeof t.count<"u"&&(i.count=t.count),this.options.interpolation.defaultVariables&&(i={...this.options.interpolation.defaultVariables,...i}),!r){i={...i};for(const s of n)delete i[s]}return i}static hasDefaultValue(t){const n="defaultValue";for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&n===r.substring(0,n.length)&&t[r]!==void 0)return!0;return!1}}const Eo=e=>e.charAt(0).toUpperCase()+e.slice(1);class hc{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=it.create("languageUtils")}getScriptPartFromCode(t){if(t=Cs(t),!t||t.indexOf("-")<0)return null;const n=t.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(t){if(t=Cs(t),!t||t.indexOf("-")<0)return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(M(t)&&t.indexOf("-")>-1){if(typeof Intl<"u"&&typeof Intl.getCanonicalLocales<"u")try{let i=Intl.getCanonicalLocales(t)[0];if(i&&this.options.lowerCaseLng&&(i=i.toLowerCase()),i)return i}catch{}const n=["hans","hant","latn","cyrl","cans","mong","arab"];let r=t.split("-");return this.options.lowerCaseLng?r=r.map(i=>i.toLowerCase()):r.length===2?(r[0]=r[0].toLowerCase(),r[1]=r[1].toUpperCase(),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=Eo(r[1].toLowerCase()))):r.length===3&&(r[0]=r[0].toLowerCase(),r[1].length===2&&(r[1]=r[1].toUpperCase()),r[0]!=="sgn"&&r[2].length===2&&(r[2]=r[2].toUpperCase()),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=Eo(r[1].toLowerCase())),n.indexOf(r[2].toLowerCase())>-1&&(r[2]=Eo(r[2].toLowerCase()))),r.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let n;return t.forEach(r=>{if(n)return;const i=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(i))&&(n=i)}),!n&&this.options.supportedLngs&&t.forEach(r=>{if(n)return;const i=this.getLanguagePartFromCode(r);if(this.isSupportedCode(i))return n=i;n=this.options.supportedLngs.find(s=>{if(s===i)return s;if(!(s.indexOf("-")<0&&i.indexOf("-")<0)&&(s.indexOf("-")>0&&i.indexOf("-")<0&&s.substring(0,s.indexOf("-"))===i||s.indexOf(i)===0&&i.length>1))return s})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),M(t)&&(t=[t]),Array.isArray(t))return t;if(!n)return t.default||[];let r=t[n];return r||(r=t[this.getScriptPartFromCode(n)]),r||(r=t[this.formatLanguageCode(n)]),r||(r=t[this.getLanguagePartFromCode(n)]),r||(r=t.default),r||[]}toResolveHierarchy(t,n){const r=this.getFallbackCodes(n||this.options.fallbackLng||[],t),i=[],s=o=>{o&&(this.isSupportedCode(o)?i.push(o):this.logger.warn(`rejecting language code not found in supportedLngs: ${o}`))};return M(t)&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&s(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&s(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&s(this.getLanguagePartFromCode(t))):M(t)&&s(this.formatLanguageCode(t)),r.forEach(o=>{i.indexOf(o)<0&&s(this.formatLanguageCode(o))}),i}}let Tv=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],Lv={1:e=>+(e>1),2:e=>+(e!=1),3:e=>0,4:e=>e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2,5:e=>e==0?0:e==1?1:e==2?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5,6:e=>e==1?0:e>=2&&e<=4?1:2,7:e=>e==1?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2,8:e=>e==1?0:e==2?1:e!=8&&e!=11?2:3,9:e=>+(e>=2),10:e=>e==1?0:e==2?1:e<7?2:e<11?3:4,11:e=>e==1||e==11?0:e==2||e==12?1:e>2&&e<20?2:3,12:e=>+(e%10!=1||e%100==11),13:e=>+(e!==0),14:e=>e==1?0:e==2?1:e==3?2:3,15:e=>e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2,16:e=>e%10==1&&e%100!=11?0:e!==0?1:2,17:e=>e==1||e%10==1&&e%100!=11?0:1,18:e=>e==0?0:e==1?1:2,19:e=>e==1?0:e==0||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3,20:e=>e==1?0:e==0||e%100>0&&e%100<20?1:2,21:e=>e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0,22:e=>e==1?0:e==2?1:(e<0||e>10)&&e%10==0?2:3};const Nv=["v1","v2","v3"],Ov=["v4"],mc={zero:0,one:1,two:2,few:3,many:4,other:5},Rv=()=>{const e={};return Tv.forEach(t=>{t.lngs.forEach(n=>{e[n]={numbers:t.nr,plurals:Lv[t.fc]}})}),e};class Iv{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=t,this.options=n,this.logger=it.create("pluralResolver"),(!this.options.compatibilityJSON||Ov.includes(this.options.compatibilityJSON))&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=Rv(),this.pluralRulesCache={}}addRule(t,n){this.rules[t]=n}clearCache(){this.pluralRulesCache={}}getRule(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi()){const r=Cs(t==="dev"?"en":t),i=n.ordinal?"ordinal":"cardinal",s=JSON.stringify({cleanedCode:r,type:i});if(s in this.pluralRulesCache)return this.pluralRulesCache[s];let o;try{o=new Intl.PluralRules(r,{type:i})}catch{if(!t.match(/-|_/))return;const a=this.languageUtils.getLanguagePartFromCode(t);o=this.getRule(a,n)}return this.pluralRulesCache[s]=o,o}return this.rules[t]||this.rules[this.languageUtils.getLanguagePartFromCode(t)]}needsPlural(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=this.getRule(t,n);return this.shouldUseIntlApi()?r&&r.resolvedOptions().pluralCategories.length>1:r&&r.numbers.length>1}getPluralFormsOfKey(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(t,r).map(i=>`${n}${i}`)}getSuffixes(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=this.getRule(t,n);return r?this.shouldUseIntlApi()?r.resolvedOptions().pluralCategories.sort((i,s)=>mc[i]-mc[s]).map(i=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${i}`):r.numbers.map(i=>this.getSuffix(t,i,n)):[]}getSuffix(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const i=this.getRule(t,r);return i?this.shouldUseIntlApi()?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${i.select(n)}`:this.getSuffixRetroCompatible(i,n):(this.logger.warn(`no plural rule found for: ${t}`),"")}getSuffixRetroCompatible(t,n){const r=t.noAbs?t.plurals(n):t.plurals(Math.abs(n));let i=t.numbers[r];this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1&&(i===2?i="plural":i===1&&(i=""));const s=()=>this.options.prepend&&i.toString()?this.options.prepend+i.toString():i.toString();return this.options.compatibilityJSON==="v1"?i===1?"":typeof i=="number"?`_plural_${i.toString()}`:s():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1?s():this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString()}shouldUseIntlApi(){return!Nv.includes(this.options.compatibilityJSON)}}const gc=function(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,s=vv(e,t,n);return!s&&i&&M(n)&&(s=Rl(e,n,r),s===void 0&&(s=Rl(t,n,r))),s},To=e=>e.replace(/\$/g,"$$$$");class Fv{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=it.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||(n=>n),this.init(t)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:i,prefix:s,prefixEscaped:o,suffix:l,suffixEscaped:a,formatSeparator:u,unescapeSuffix:d,unescapePrefix:f,nestingPrefix:c,nestingPrefixEscaped:y,nestingSuffix:w,nestingSuffixEscaped:v,nestingOptionsSeparator:S,maxReplaces:h,alwaysFormat:p}=t.interpolation;this.escape=n!==void 0?n:kv,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=i!==void 0?i:!1,this.prefix=s?Nn(s):o||"{{",this.suffix=l?Nn(l):a||"}}",this.formatSeparator=u||",",this.unescapePrefix=d?"":f||"-",this.unescapeSuffix=this.unescapePrefix?"":d||"",this.nestingPrefix=c?Nn(c):y||Nn("$t("),this.nestingSuffix=w?Nn(w):v||Nn(")"),this.nestingOptionsSeparator=S||",",this.maxReplaces=h||1e3,this.alwaysFormat=p!==void 0?p:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(n,r)=>n&&n.source===r?(n.lastIndex=0,n):new RegExp(r,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(t,n,r,i){let s,o,l;const a=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=y=>{if(y.indexOf(this.formatSeparator)<0){const h=gc(n,a,y,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(h,void 0,r,{...i,...n,interpolationkey:y}):h}const w=y.split(this.formatSeparator),v=w.shift().trim(),S=w.join(this.formatSeparator).trim();return this.format(gc(n,a,v,this.options.keySeparator,this.options.ignoreJSONStructure),S,r,{...i,...n,interpolationkey:v})};this.resetRegExp();const d=i&&i.missingInterpolationHandler||this.options.missingInterpolationHandler,f=i&&i.interpolation&&i.interpolation.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:y=>To(y)},{regex:this.regexp,safeValue:y=>this.escapeValue?To(this.escape(y)):To(y)}].forEach(y=>{for(l=0;s=y.regex.exec(t);){const w=s[1].trim();if(o=u(w),o===void 0)if(typeof d=="function"){const S=d(t,s,i);o=M(S)?S:""}else if(i&&Object.prototype.hasOwnProperty.call(i,w))o="";else if(f){o=s[0];continue}else this.logger.warn(`missed to pass in variable ${w} for interpolating ${t}`),o="";else!M(o)&&!this.useRawValueToEscape&&(o=ac(o));const v=y.safeValue(o);if(t=t.replace(s[0],v),f?(y.regex.lastIndex+=o.length,y.regex.lastIndex-=s[0].length):y.regex.lastIndex=0,l++,l>=this.maxReplaces)break}}),t}nest(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i,s,o;const l=(a,u)=>{const d=this.nestingOptionsSeparator;if(a.indexOf(d)<0)return a;const f=a.split(new RegExp(`${d}[ ]*{`));let c=`{${f[1]}`;a=f[0],c=this.interpolate(c,o);const y=c.match(/'/g),w=c.match(/"/g);(y&&y.length%2===0&&!w||w.length%2!==0)&&(c=c.replace(/'/g,'"'));try{o=JSON.parse(c),u&&(o={...u,...o})}catch(v){return this.logger.warn(`failed parsing options string in nesting for key ${a}`,v),`${a}${d}${c}`}return o.defaultValue&&o.defaultValue.indexOf(this.prefix)>-1&&delete o.defaultValue,a};for(;i=this.nestingRegexp.exec(t);){let a=[];o={...r},o=o.replace&&!M(o.replace)?o.replace:o,o.applyPostProcessor=!1,delete o.defaultValue;let u=!1;if(i[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(i[1])){const d=i[1].split(this.formatSeparator).map(f=>f.trim());i[1]=d.shift(),a=d,u=!0}if(s=n(l.call(this,i[1].trim(),o),o),s&&i[0]===t&&!M(s))return s;M(s)||(s=ac(s)),s||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${t}`),s=""),u&&(s=a.reduce((d,f)=>this.format(d,f,r.lng,{...r,interpolationkey:i[1].trim()}),s.trim())),t=t.replace(i[0],s),this.regexp.lastIndex=0}return t}}const jv=e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const i=r[1].substring(0,r[1].length-1);t==="currency"&&i.indexOf(":")<0?n.currency||(n.currency=i.trim()):t==="relativetime"&&i.indexOf(":")<0?n.range||(n.range=i.trim()):i.split(";").forEach(o=>{if(o){const[l,...a]=o.split(":"),u=a.join(":").trim().replace(/^'+|'+$/g,""),d=l.trim();n[d]||(n[d]=u),u==="false"&&(n[d]=!1),u==="true"&&(n[d]=!0),isNaN(u)||(n[d]=parseInt(u,10))}})}return{formatName:t,formatOptions:n}},On=e=>{const t={};return(n,r,i)=>{let s=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(s={...s,[i.interpolationkey]:void 0});const o=r+JSON.stringify(s);let l=t[o];return l||(l=e(Cs(r),i),t[o]=l),l(n)}};class Mv{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=it.create("formatter"),this.options=t,this.formats={number:On((n,r)=>{const i=new Intl.NumberFormat(n,{...r});return s=>i.format(s)}),currency:On((n,r)=>{const i=new Intl.NumberFormat(n,{...r,style:"currency"});return s=>i.format(s)}),datetime:On((n,r)=>{const i=new Intl.DateTimeFormat(n,{...r});return s=>i.format(s)}),relativetime:On((n,r)=>{const i=new Intl.RelativeTimeFormat(n,{...r});return s=>i.format(s,r.range||"day")}),list:On((n,r)=>{const i=new Intl.ListFormat(n,{...r});return s=>i.format(s)})},this.init(t)}init(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};this.formatSeparator=n.interpolation.formatSeparator||","}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=On(n)}format(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const s=n.split(this.formatSeparator);if(s.length>1&&s[0].indexOf("(")>1&&s[0].indexOf(")")<0&&s.find(l=>l.indexOf(")")>-1)){const l=s.findIndex(a=>a.indexOf(")")>-1);s[0]=[s[0],...s.splice(1,l)].join(this.formatSeparator)}return s.reduce((l,a)=>{const{formatName:u,formatOptions:d}=jv(a);if(this.formats[u]){let f=l;try{const c=i&&i.formatParams&&i.formatParams[i.interpolationkey]||{},y=c.locale||c.lng||i.locale||i.lng||r;f=this.formats[u](l,y,{...d,...i,...c})}catch(c){this.logger.warn(c)}return f}else this.logger.warn(`there was no format function for ${u}`);return l},t)}}const Dv=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class Av extends Ws{constructor(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=t,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=i,this.logger=it.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(r,i.backend,i)}queueLoad(t,n,r,i){const s={},o={},l={},a={};return t.forEach(u=>{let d=!0;n.forEach(f=>{const c=`${u}|${f}`;!r.reload&&this.store.hasResourceBundle(u,f)?this.state[c]=2:this.state[c]<0||(this.state[c]===1?o[c]===void 0&&(o[c]=!0):(this.state[c]=1,d=!1,o[c]===void 0&&(o[c]=!0),s[c]===void 0&&(s[c]=!0),a[f]===void 0&&(a[f]=!0)))}),d||(l[u]=!0)}),(Object.keys(s).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(s),pending:Object.keys(o),toLoadLanguages:Object.keys(l),toLoadNamespaces:Object.keys(a)}}loaded(t,n,r){const i=t.split("|"),s=i[0],o=i[1];n&&this.emit("failedLoading",s,o,n),!n&&r&&this.store.addResourceBundle(s,o,r,void 0,void 0,{skipCopy:!0}),this.state[t]=n?-1:2,n&&r&&(this.state[t]=0);const l={};this.queue.forEach(a=>{yv(a.loaded,[s],o),Dv(a,t),n&&a.errors.push(n),a.pendingCount===0&&!a.done&&(Object.keys(a.loaded).forEach(u=>{l[u]||(l[u]={});const d=a.loaded[u];d.length&&d.forEach(f=>{l[u][f]===void 0&&(l[u][f]=!0)})}),a.done=!0,a.errors.length?a.callback(a.errors):a.callback())}),this.emit("loaded",l),this.queue=this.queue.filter(a=>!a.done)}read(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,o=arguments.length>5?arguments[5]:void 0;if(!t.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:r,tried:i,wait:s,callback:o});return}this.readingCalls++;const l=(u,d)=>{if(this.readingCalls--,this.waitingReads.length>0){const f=this.waitingReads.shift();this.read(f.lng,f.ns,f.fcName,f.tried,f.wait,f.callback)}if(u&&d&&i<this.maxRetries){setTimeout(()=>{this.read.call(this,t,n,r,i+1,s*2,o)},s);return}o(u,d)},a=this.backend[r].bind(this.backend);if(a.length===2){try{const u=a(t,n);u&&typeof u.then=="function"?u.then(d=>l(null,d)).catch(l):l(null,u)}catch(u){l(u)}return}return a(t,n,l)}prepareLoading(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();M(t)&&(t=this.languageUtils.toResolveHierarchy(t)),M(n)&&(n=[n]);const s=this.queueLoad(t,n,r,i);if(!s.toLoad.length)return s.pending.length||i(),null;s.toLoad.forEach(o=>{this.loadOne(o)})}load(t,n,r){this.prepareLoading(t,n,{},r)}reload(t,n,r){this.prepareLoading(t,n,{reload:!0},r)}loadOne(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const r=t.split("|"),i=r[0],s=r[1];this.read(i,s,"read",void 0,void 0,(o,l)=>{o&&this.logger.warn(`${n}loading namespace ${s} for language ${i} failed`,o),!o&&l&&this.logger.log(`${n}loaded namespace ${s} for language ${i}`,l),this.loaded(t,o,l)})}saveMissing(t,n,r,i,s){let o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},l=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(n)){this.logger.warn(`did not save key "${r}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if(this.backend&&this.backend.create){const a={...o,isUpdate:s},u=this.backend.create.bind(this.backend);if(u.length<6)try{let d;u.length===5?d=u(t,n,r,i,a):d=u(t,n,r,i),d&&typeof d.then=="function"?d.then(f=>l(null,f)).catch(l):l(null,d)}catch(d){l(d)}else u(t,n,r,i,l,a)}!t||!t[0]||this.store.addResource(t[0],n,r,i)}}}const yc=()=>({debug:!1,initImmediate:!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:e=>{let t={};if(typeof e[1]=="object"&&(t=e[1]),M(e[1])&&(t.defaultValue=e[1]),M(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const n=e[3]||e[2];Object.keys(n).forEach(r=>{t[r]=n[r]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),vc=e=>(M(e.ns)&&(e.ns=[e.ns]),M(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),M(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e),_i=()=>{},_v=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})};class si extends Ws{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(super(),this.options=vc(t),this.services={},this.logger=it,this.modules={external:[]},_v(this),n&&!this.isInitialized&&!t.isClone){if(!this.options.initImmediate)return this.init(t,n),this;setTimeout(()=>{this.init(t,n)},0)}}init(){var t=this;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof n=="function"&&(r=n,n={}),!n.defaultNS&&n.defaultNS!==!1&&n.ns&&(M(n.ns)?n.defaultNS=n.ns:n.ns.indexOf("translation")<0&&(n.defaultNS=n.ns[0]));const i=yc();this.options={...i,...this.options,...vc(n)},this.options.compatibilityAPI!=="v1"&&(this.options.interpolation={...i.interpolation,...this.options.interpolation}),n.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=n.keySeparator),n.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=n.nsSeparator);const s=d=>d?typeof d=="function"?new d:d:null;if(!this.options.isClone){this.modules.logger?it.init(s(this.modules.logger),this.options):it.init(null,this.options);let d;this.modules.formatter?d=this.modules.formatter:typeof Intl<"u"&&(d=Mv);const f=new hc(this.options);this.store=new fc(this.options.resources,this.options);const c=this.services;c.logger=it,c.resourceStore=this.store,c.languageUtils=f,c.pluralResolver=new Iv(f,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),d&&(!this.options.interpolation.format||this.options.interpolation.format===i.interpolation.format)&&(c.formatter=s(d),c.formatter.init(c,this.options),this.options.interpolation.format=c.formatter.format.bind(c.formatter)),c.interpolator=new Fv(this.options),c.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},c.backendConnector=new Av(s(this.modules.backend),c.resourceStore,c,this.options),c.backendConnector.on("*",function(y){for(var w=arguments.length,v=new Array(w>1?w-1:0),S=1;S<w;S++)v[S-1]=arguments[S];t.emit(y,...v)}),this.modules.languageDetector&&(c.languageDetector=s(this.modules.languageDetector),c.languageDetector.init&&c.languageDetector.init(c,this.options.detection,this.options)),this.modules.i18nFormat&&(c.i18nFormat=s(this.modules.i18nFormat),c.i18nFormat.init&&c.i18nFormat.init(this)),this.translator=new Ts(this.services,this.options),this.translator.on("*",function(y){for(var w=arguments.length,v=new Array(w>1?w-1:0),S=1;S<w;S++)v[S-1]=arguments[S];t.emit(y,...v)}),this.modules.external.forEach(y=>{y.init&&y.init(this)})}if(this.format=this.options.interpolation.format,r||(r=_i),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const d=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);d.length>0&&d[0]!=="dev"&&(this.options.lng=d[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(d=>{this[d]=function(){return t.store[d](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(d=>{this[d]=function(){return t.store[d](...arguments),t}});const a=Pr(),u=()=>{const d=(f,c)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),a.resolve(c),r(f,c)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return d(null,this.t.bind(this));this.changeLanguage(this.options.lng,d)};return this.options.resources||!this.options.initImmediate?u():setTimeout(u,0),a}loadResources(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:_i;const i=M(t)?t:this.language;if(typeof t=="function"&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if(i&&i.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const s=[],o=l=>{if(!l||l==="cimode")return;this.services.languageUtils.toResolveHierarchy(l).forEach(u=>{u!=="cimode"&&s.indexOf(u)<0&&s.push(u)})};i?o(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(a=>o(a)),this.options.preload&&this.options.preload.forEach(l=>o(l)),this.services.backendConnector.load(s,this.options.ns,l=>{!l&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(l)})}else r(null)}reloadResources(t,n,r){const i=Pr();return typeof t=="function"&&(r=t,t=void 0),typeof n=="function"&&(r=n,n=void 0),t||(t=this.languages),n||(n=this.options.ns),r||(r=_i),this.services.backendConnector.reload(t,n,s=>{i.resolve(),r(s)}),i}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&mp.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1))for(let n=0;n<this.languages.length;n++){const r=this.languages[n];if(!(["cimode","dev"].indexOf(r)>-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}}changeLanguage(t,n){var r=this;this.isLanguageChangingTo=t;const i=Pr();this.emit("languageChanging",t);const s=a=>{this.language=a,this.languages=this.services.languageUtils.toResolveHierarchy(a),this.resolvedLanguage=void 0,this.setResolvedLanguage(a)},o=(a,u)=>{u?(s(u),this.translator.changeLanguage(u),this.isLanguageChangingTo=void 0,this.emit("languageChanged",u),this.logger.log("languageChanged",u)):this.isLanguageChangingTo=void 0,i.resolve(function(){return r.t(...arguments)}),n&&n(a,function(){return r.t(...arguments)})},l=a=>{!t&&!a&&this.services.languageDetector&&(a=[]);const u=M(a)?a:this.services.languageUtils.getBestMatchFromCodes(a);u&&(this.language||s(u),this.translator.language||this.translator.changeLanguage(u),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(u)),this.loadResources(u,d=>{o(d,u)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?l(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(l):this.services.languageDetector.detect(l):l(t),i}getFixedT(t,n,r){var i=this;const s=function(o,l){let a;if(typeof l!="object"){for(var u=arguments.length,d=new Array(u>2?u-2:0),f=2;f<u;f++)d[f-2]=arguments[f];a=i.options.overloadTranslationOptionHandler([o,l].concat(d))}else a={...l};a.lng=a.lng||s.lng,a.lngs=a.lngs||s.lngs,a.ns=a.ns||s.ns,a.keyPrefix!==""&&(a.keyPrefix=a.keyPrefix||r||s.keyPrefix);const c=i.options.keySeparator||".";let y;return a.keyPrefix&&Array.isArray(o)?y=o.map(w=>`${a.keyPrefix}${c}${w}`):y=a.keyPrefix?`${a.keyPrefix}${c}${o}`:o,i.t(y,a)};return M(t)?s.lng=t:s.lngs=t,s.ns=n,s.keyPrefix=r,s}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};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 r=n.lng||this.resolvedLanguage||this.languages[0],i=this.options?this.options.fallbackLng:!1,s=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const o=(l,a)=>{const u=this.services.backendConnector.state[`${l}|${a}`];return u===-1||u===0||u===2};if(n.precheck){const l=n.precheck(this,o);if(l!==void 0)return l}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||o(r,t)&&(!i||o(s,t)))}loadNamespaces(t,n){const r=Pr();return this.options.ns?(M(t)&&(t=[t]),t.forEach(i=>{this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}),this.loadResources(i=>{r.resolve(),n&&n(i)}),r):(n&&n(),Promise.resolve())}loadLanguages(t,n){const r=Pr();M(t)&&(t=[t]);const i=this.options.preload||[],s=t.filter(o=>i.indexOf(o)<0&&this.services.languageUtils.isSupportedCode(o));return s.length?(this.options.preload=i.concat(s),this.loadResources(o=>{r.resolve(),n&&n(o)}),r):(n&&n(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!t)return"rtl";const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=this.services&&this.services.languageUtils||new hc(yc());return n.indexOf(r.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new si(t,n)}cloneInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:_i;const r=t.forkResourceStore;r&&delete t.forkResourceStore;const i={...this.options,...t,isClone:!0},s=new si(i);return(t.debug!==void 0||t.prefix!==void 0)&&(s.logger=s.logger.clone(t)),["store","services","language"].forEach(l=>{s[l]=this[l]}),s.services={...this.services},s.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},r&&(s.store=new fc(this.store.data,i),s.services.resourceStore=s.store),s.translator=new Ts(s.services,i),s.translator.on("*",function(l){for(var a=arguments.length,u=new Array(a>1?a-1:0),d=1;d<a;d++)u[d-1]=arguments[d];s.emit(l,...u)}),s.init(i,n),s.translator.options=i,s.translator.backendConnector.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},s}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const le=si.createInstance();le.createInstance=si.createInstance;le.createInstance;le.dir;le.init;le.loadResources;le.reloadResources;le.use;le.changeLanguage;le.getFixedT;le.t;le.exists;le.setDefaultNamespace;le.hasLoadedNamespace;le.loadNamespaces;le.loadLanguages;const zv={zh:{translation:{app:{title:"cc-gw 控制台",skipToContent:"跳转到主要内容"},nav:{dashboard:"仪表盘",logs:"请求日志",models:"模型管理",apiKeys:"API 密钥",settings:"设置",help:"使用指南",about:"关于"},language:{zh:"简体中文",en:"English"},common:{loading:"加载中...",loadingShort:"加载中...",noData:"暂无数据",languageSelector:"语言选择",actions:{refresh:"刷新",refreshing:"刷新中...",manualRefresh:"手动刷新",reset:"重置",close:"关闭",openNavigation:"打开导航",closeNavigation:"关闭导航",save:"保存设置",saving:"保存中...",cancel:"取消",copy:"复制",testConnection:"测试连接",testingConnection:"测试中...",cleanup:"清理历史日志",cleaning:"清理中...",checkUpdates:"检查更新"},theme:{label:"主题",light:"亮色",dark:"暗色",system:"跟随系统"},status:{success:"成功",error:"失败"},notifications:{featureInProgress:"功能开发中,敬请期待。"},units:{request:"次",ms:"ms",token:"Tokens",msPerToken:"ms/Token"}},dashboard:{description:"快速了解请求规模与实时运行状态。",filters:{endpoint:"端点筛选",endpointAll:"全部端点",endpointAnthropic:"anthropic",endpointOpenAI:"openai"},status:{listening:"监听:{{host}}:{{port}}",providers:"Provider 数量:{{value}}",todayRequests:"今日请求:{{value}}",active:"活动请求:{{value}}",dbSize:"数据库:{{value}}"},toast:{overviewError:"统计数据获取失败",dailyError:"趋势数据获取失败",modelError:"模型统计获取失败",statusError:"状态信息获取失败",dbError:"数据库信息获取失败",recentError:"最近请求获取失败"},cards:{todayRequests:"今日请求数",todayInput:"今日输入 Tokens",todayOutput:"今日输出 Tokens",avgLatency:"平均响应耗时"},charts:{requestsTitle:"请求趋势",requestsDesc:"最近 14 天请求与 Token 走势",modelTitle:"模型调用分布",modelDesc:"近 7 天不同模型的调用次数与 Token 走势",barRequests:"请求数",lineInput:"输入 Tokens",lineOutput:"输出 Tokens",axisTokens:"Tokens",ttftLabel:"TTFT(ms)",tpotLabel:"TPOT(ms/Token)",ttftTitle:"TTFT 模型对比",ttftDesc:"比较不同模型的首 Token 耗时 (TTFT)",ttftEmpty:"暂无 TTFT 数据。",tpotTitle:"TPOT 模型对比",tpotDesc:"比较不同模型的平均 Token 耗时 (TPOT)",tpotEmpty:"暂无 TPOT 数据。",ttftAxis:"TTFT (ms)",tpotAxis:"TPOT (ms/Token)",empty:"暂无数据"},recent:{title:"最新请求",subtitle:"仅展示最近 {{count}} 条记录",loading:"加载中...",empty:"暂无请求记录",routePlaceholder:"未指定",columns:{time:"时间",endpoint:"端点",provider:"Provider",route:"路由",latency:"耗时(ms)",status:"状态"}},modelTable:{title:"模型性能摘要",description:"统计每个后端模型的请求数、平均耗时、TTFT 与 TPOT。",empty:"暂无模型统计数据。",columns:{model:"Provider/模型",requests:"请求数",latency:"平均耗时",ttft:"TTFT",tpot:"TPOT"}}},logs:{title:"请求日志",description:"查看近期请求,支持筛选 Provider、模型、成功状态及时间范围。",summary:{total:"记录总数:{{value}}"},filters:{provider:"Provider",providerAll:"全部 Provider",endpoint:"请求端点",endpointAll:"全部端点",endpointAnthropic:"anthropic",endpointOpenAI:"openai",apiKey:"API Key",apiKeyHint:"可多选,不选择时将展示全部密钥。",modelId:"模型 ID",modelPlaceholder:"如 deepseek-chat",status:"状态",statusAll:"全部",statusSuccess:"成功",statusError:"失败",startDate:"起始日期",endDate:"结束日期",apiKeyAll:"全部密钥",apiKeySelected:"{{count}} 个已选"},actions:{manualRefresh:"手动刷新",refreshing:"刷新中...",detail:"详情"},table:{loading:"正在加载日志...",empty:"未找到符合条件的日志记录。",requestedModelFallback:"未指定",apiKeyUnknown:"未知密钥",columns:{time:"时间",endpoint:"端点",provider:"Provider",requestedModel:"请求模型",routedModel:"路由模型",apiKey:"API Key",inputTokens:"输入 Tokens",cachedTokens:"缓存 Tokens",outputTokens:"输出 Tokens",stream:"Stream",latency:"耗时(ms)",ttft:"TTFT(ms)",tpot:"TPOT(ms/Token)",status:"状态",error:"错误信息",actions:"操作"},pagination:{perPage:"每页",unit:"条",previous:"上一页",next:"下一页",pageLabel:"第 {{page}} / {{total}} 页"}},endpointAnthropic:"anthropic",endpointOpenAI:"openai",toast:{listError:{title:"日志获取失败",desc:"错误信息:{{message}}"},providerError:{title:"Provider 列表获取失败",desc:"错误信息:{{message}}"}},stream:{streaming:"流式",single:"单次"},detail:{title:"日志详情",id:"ID #{{id}}",infoSection:"基本信息",info:{time:"时间",sessionId:"Session ID",endpoint:"端点",provider:"Provider",requestedModel:"请求模型",noRequestedModel:"未指定",model:"路由模型",stream:"Stream",latency:"耗时",status:"状态",inputTokens:"输入 Tokens",cachedTokens:"缓存 Tokens",outputTokens:"输出 Tokens",ttft:"TTFT (首 Token 耗时)",tpot:"TPOT (平均 ms/Token)",error:"错误信息"},summary:{route:"{{from}} → {{to}}",latency:"耗时:{{value}}",ttft:"TTFT:{{value}}",tpot:"TPOT:{{value}}",stream:"Stream:{{value}}"},payload:{request:"请求体",response:"响应体",emptyRequest:"暂无请求内容",emptyResponse:"暂无响应内容"},apiKey:{title:"密钥信息",name:"密钥名称",identifier:"密钥 ID",masked:"掩码展示",maskedUnavailable:"暂无掩码信息",raw:"原始密钥",rawUnavailable:"未记录原始密钥",missing:"未记录",lastUsed:"最后使用"},copy:{requestSuccess:"请求体已复制到剪贴板。",responseSuccess:"响应体已复制到剪贴板。",keySuccess:"API 密钥已复制到剪贴板。",empty:"{{label}}为空,无法复制。",failure:"复制失败",failureFallback:"无法复制内容,请稍后再试。"},loadError:"无法加载日志详情。"}},providers:{title:"模型提供商",description:"管理集成的模型服务,查看默认模型及支持能力。",emptyState:"暂无 Provider,请点击“新增提供商”以开始配置。",count:"已配置:{{count}} 个 Provider",toast:{createSuccess:"已添加 Provider:{{name}}",updateSuccess:"已更新 Provider:{{name}}",testSuccess:"Provider 连通性检查通过。",testSuccessDesc:"状态:{{status}} · 耗时:{{duration}}",testFailure:"Provider 连通性检查失败:{{message}}",loadFailure:"获取配置失败:{{message}}",deleteSuccess:"已删除 Provider:{{name}}",deleteFailure:"删除 Provider 失败:{{message}}"},actions:{add:"新增提供商",refresh:"刷新",refreshing:"刷新中...",edit:"编辑",delete:"删除",test:"测试连接"},quickAddHuawei:{button:"一键添加华为云模型",title:"一键添加华为云模型",description:"输入 API Key 即可快速添加华为云 DeepSeek V3.1、KIMI-K2 与 Qwen3-235B-A22B 模型。",apiKeyLabel:"API Key",apiKeyPlaceholder:"请输入华为云 API Key",note:"完成后可在提供商列表中查看并进一步调整配置。",submit:"添加",providerLabel:"华为云",validation:{apiKey:"请填写 API Key"},toast:{success:"已添加华为云模型",added:"已添加 {{name}}",failure:"添加失败,请稍后重试"}},card:{defaultModel:"默认模型:{{model}}",noDefault:"未设置默认模型",modelsTitle:"支持模型",noModels:"尚未配置模型。"},drawer:{createTitle:"新增 Provider",editTitle:"编辑 Provider",description:"配置基础信息与模型列表。",modelsDescription:"维护支持的模型列表。",defaultHint:"当前默认模型:{{model}}",fields:{id:"Provider ID",idPlaceholder:"如 openai",label:"显示名称",labelPlaceholder:"如 OpenAI 官方",baseUrl:"Base URL",baseUrlPlaceholder:"https://api.example.com/v1",type:"Provider 类型",apiKey:"API Key(可选)",apiKeyPlaceholder:"可留空以从环境变量读取",authMode:"认证方式",authModeHint:"Claude Code 可使用 Token 或 API Key,选择后填写对应值。",authModeApiKey:"使用 API Key(x-api-key)",authModeAuthToken:"使用 Auth Token(Authorization: Bearer)",models:"模型配置",showAdvanced:"显示高级选项",hideAdvanced:"隐藏高级选项",addModel:"新增模型",modelId:"模型 ID",modelIdPlaceholder:"如 claude-sonnet-4-5-20250929",modelLabel:"显示名称(可选)",modelLabelPlaceholder:"如 GPT-4 旗舰",setDefault:"设为默认模型",removeModel:"删除模型"},errors:{idRequired:"请填写 Provider ID",idDuplicate:"该 Provider ID 已存在",baseUrlInvalid:"Base URL 格式无效",modelsRequired:"请至少配置一个模型",modelInvalid:"模型 ID 不可为空或重复",defaultInvalid:"默认模型必须在模型列表中"},toast:{saveFailure:"保存失败:{{message}}"}},confirm:{delete:"确认删除 Provider「{{name}}」?"}},modelManagement:{title:"模型管理",description:"统一维护模型提供商配置与模型路由映射。",tabs:{providers:"模型提供商",providersDesc:"配置上游模型提供商以及认证信息。",anthropic:"Anthropic 路由",anthropicDesc:"管理 /anthropic 端点的模型映射和默认配置。",openai:"OpenAI 路由",openaiDesc:"管理 /openai 端点的模型映射和默认配置。"},actions:{saveRoutes:"保存路由"},routing:{selectTarget:"请选择目标 Provider:模型"},toast:{routesSaved:"模型路由已更新。",routesSaveFailure:"保存模型路由失败:{{message}}"}},settings:{title:"系统设置",description:"调整网关端口、日志策略及其他运行参数。",toast:{loadFailure:"配置加载失败:{{message}}",saveSuccess:"系统配置已更新。",saveFailure:"保存失败:{{message}}",copySuccess:"配置文件路径已复制到剪贴板。",copyFailure:"复制失败:{{message}}",cleanupSuccess:"已删除 {{count}} 条历史日志。",cleanupNone:"没有需要删除的日志。",cleanupFailure:"清理失败:{{message}}",clearAllSuccess:"日志已清空(请求 {{logs}} 条,统计 {{metrics}} 条)。",clearAllFailure:"清空失败:{{message}}",missingConfig:"未能加载配置,请刷新或稍后再试。"},sections:{basics:"基础配置",routing:"模型路由",configFile:"配置文件",cleanup:"日志清理"},fields:{port:"监听端口",host:"监听地址(可选)",hostPlaceholder:"默认 0.0.0.0",retention:"日志保留天数",defaults:"默认模型配置",storePayloads:"保存请求/响应内容",storePayloadsHint:"关闭后仅记录元数据,可减少磁盘占用。",logLevel:"日志级别",logLevelOption:{fatal:"致命 (fatal)",error:"错误 (error)",warn:"警告 (warn)",info:"信息 (info)",debug:"调试 (debug)",trace:"跟踪 (trace)"},requestLogging:"输出访问日志",requestLoggingHint:"关闭后将不再在终端打印每个请求的访问日志。",responseLogging:"输出响应日志",responseLoggingHint:"关闭后将不再输出请求完成时的日志。"},validation:{port:"请输入 1-65535 之间的端口号",retention:"日志保留天数需为 1-365 之间的数字",routePair:"请填写完整的来源模型与目标模型配置。",routeDuplicate:"模型 {{model}} 已存在映射,请勿重复配置。"},defaults:{completion:"对话:{{model}}",reasoning:"推理:{{model}}",background:"后台:{{model}}",none:"未设置默认模型"},routing:{title:"模型路由映射",description:"为 Claude Code 发起的模型请求指定实际 Provider 与模型 ID(如将 claude 系列映射至 Kimi)。如需禁用映射,可留空或移除。",titleByEndpoint:"{{endpoint}} 路由配置",descriptionByEndpoint:{anthropic:"当 Claude Code 通过 /anthropic 端点请求特定模型时,将根据此映射选择目标 Provider 与模型。",openai:"当 Codex 通过 /openai 端点请求特定模型时,将根据此映射选择目标 Provider 与模型。"},add:"新增映射",empty:"尚未配置映射,系统将使用默认模型策略。",sourceLabel:"来源模型",sourcePlaceholder:"如 claude-sonnet-4-5-20250929",targetLabel:"目标 Provider:模型",targetPlaceholder:"如 kimi:kimi-k2-0905-preview",customTargetOption:"自定义目标…",remove:"移除",suggested:"常用 Anthropic 模型"},file:{description:"当前配置存储在本地文件,可通过编辑该文件进行离线修改。",unknown:"未知路径"},cleanup:{description:"立即清理早于当前保留天数的日志记录。",clearAll:"彻底清空",clearingAll:"清空中...",clearAllWarning:"该操作会删除所有日志记录及日统计数据,请谨慎操作。"}},help:{title:"使用指南",intro:"本页汇总了如何通过 Web UI 完成配置与日常运维,帮助新接入者快速上手 cc-gw。",note:"所有变更都会实时写入 ~/.cc-gw/config.json,并立即影响正在运行的网关;建议通过 Web UI 完成常规操作,CLI 仅用于启动/重启。",sections:{configuration:{title:"一、初始配置",items:["在“系统设置”中确认监听地址、端口以及日志策略,并视需要开启或关闭请求/响应日志。","前往“模型管理 → 模型提供商”添加上游 Provider,填写 Base URL、API Key、默认模型等信息。","使用“测试连接”按钮验证 Provider 是否可用;如果失败,请检查网络连通性与密钥权限。","在“模型管理 → 路由配置”中为 /anthropic 与 /openai 端点指定目标模型,保存后立即生效。","在 IDE 中配置接入:Claude Code(含 VS Code 插件)统一设置 Base URL=http://127.0.0.1:4100/anthropic,客户端会自动附加 /v1/messages?beta=true;Codex 指向 http://127.0.0.1:4100/openai/v1,并使用 cc-gw 生成的 API Key。"]},usage:{title:"二、日常使用",items:["Dashboard 提供实时请求量、Token、缓存命中以及 TTFT/TPOT 指标,便于了解服务运行状况。","“请求日志”支持多维度筛选,并可查看完整的请求/响应 Payload,适合排查联调问题。","“模型管理”可以快速切换默认模型或更新路由映射,适合 IDE / 自动化场景的随时切换。","“系统设置”中可调整日志保留天数、Payload 存储策略以及日志输出级别。"]},tips:{title:"三、实用技巧",items:["开启“保存请求/响应内容”后,可在日志详情中复制原始 Payload,定位上游兼容性问题。","分别关闭“访问日志”或“响应日志”可降低终端噪声,同时仍保留数据库与统计数据。","若手动修改配置文件后 UI 未更新,可使用“系统设置”页的刷新按钮或重启 cc-gw。"]}},faq:{title:"常见问题",items:[{q:"如何切换不同端点的默认模型?",a:"在“模型管理 → 路由配置”中分别选择 /anthropic 与 /openai 的默认模型并保存,即可立即生效。"},{q:"为什么日志里没有缓存命中数据?",a:"需要上游模型返回 cached_tokens 或 input_tokens_details.cached_tokens 字段,确认 Provider 已启用相关功能。"}]}},about:{title:"关于",description:"查看 cc-gw 的版本信息、构建元数据与运行状态。",app:{title:"应用信息",labels:{name:"名称",version:"版本",buildTime:"构建时间",node:"Node 版本"}},status:{title:"运行状态",loading:"正在获取运行状态...",empty:"未能获取状态信息。",labels:{host:"监听地址",port:"监听端口",providers:"已配置 Provider",active:"活动请求"}},support:{title:"使用提示",subtitle:"运行维护说明",description:"通过 Web UI 管理 Provider、模型路由与日志,高级配置可直接编辑 ~/.cc-gw/config.json。",actions:{checkUpdates:"检查更新"}},toast:{statusError:{title:"状态加载失败"},updatesPlanned:"检查更新功能将在后续版本提供。"}},apiKeys:{title:"API 密钥管理",description:"创建和管理用于访问网关的 API 密钥",createNew:"创建新密钥",createAction:"创建",createDescription:"创建一个新的 API 密钥用于身份验证,可选填写密钥描述。",descriptionLabel:"密钥描述(可选)",keyDescriptionPlaceholder:"例如:仅供内部测试环境使用",keyNamePlaceholder:"输入密钥名称",keyCreated:"API 密钥已创建",saveKeyWarning:"这是唯一一次看到完整密钥的机会,请妥善保存!",wildcard:"通配符",wildcardHint:"启用该密钥后,任何自定义密钥与空密钥都可以通过认证;如需限制访问,可随时禁用该密钥。",status:{enabled:"已启用",disabled:"已禁用"},actions:{enable:"启用",disable:"禁用",delete:"删除"},created:"创建时间",lastUsed:"最后使用",requestCount:"请求次数",totalTokens:"总令牌数",confirmDelete:"确定要删除此 API 密钥吗?此操作无法撤销。",errors:{nameRequired:"密钥名称不能为空"},analytics:{title:"密钥使用分析",description:"展示最近 {{days}} 天的密钥调用情况",range:{today:"今日",week:"近 7 天",month:"近 30 天"},cards:{total:"总密钥数",enabled:"启用密钥",active:"活跃密钥({{days}} 天)"},charts:{requests:"按密钥的请求次数(Top 10)",tokens:"按密钥的 Token 消耗(Top 10)"},tokens:{input:"输入 Token",output:"输出 Token"},requestsSeries:"请求次数",empty:"所选时间范围内暂无统计数据。",unknownKey:"未知密钥"},list:{title:"密钥列表",empty:"尚未创建 API 密钥,点击右上角按钮开始创建。"},toast:{keyCreated:"API 密钥创建成功",keyUpdated:"API 密钥已更新",keyDeleted:"API 密钥已删除",keyCopied:"密钥已复制到剪贴板",createFailure:"创建失败:{{message}}",updateFailure:"更新失败:{{message}}",deleteFailure:"删除失败:{{message}}"}}}},en:{translation:{app:{title:"cc-gw Console",skipToContent:"Skip to main content"},nav:{dashboard:"Dashboard",logs:"Logs",models:"Model Management",apiKeys:"API Keys",settings:"Settings",help:"Help",about:"About"},language:{zh:"Simplified Chinese",en:"English"},common:{loading:"Loading...",loadingShort:"Loading...",noData:"No data available",languageSelector:"Language selector",actions:{refresh:"Refresh",refreshing:"Refreshing...",manualRefresh:"Manual refresh",reset:"Reset",close:"Close",openNavigation:"Open navigation",closeNavigation:"Close navigation",save:"Save changes",saving:"Saving...",cancel:"Cancel",copy:"Copy",testConnection:"Test connection",testingConnection:"Testing...",cleanup:"Clean up logs",cleaning:"Cleaning...",checkUpdates:"Check for updates"},theme:{label:"Theme",light:"Light",dark:"Dark",system:"System"},status:{success:"Success",error:"Error"},notifications:{featureInProgress:"Feature under development. Stay tuned!"},units:{request:"req",ms:"ms",token:"tokens",msPerToken:"ms/token"}},dashboard:{description:"Monitor request volume and runtime health at a glance.",filters:{endpoint:"Endpoint",endpointAll:"All endpoints",endpointAnthropic:"anthropic",endpointOpenAI:"openai"},status:{listening:"Listening: {{host}}:{{port}}",providers:"Providers: {{value}}",todayRequests:"Requests today: {{value}}",active:"Active requests: {{value}}",dbSize:"Database: {{value}}"},toast:{overviewError:"Failed to load overview metrics",dailyError:"Failed to load trend metrics",modelError:"Failed to load model statistics",statusError:"Failed to load gateway status",dbError:"Failed to load database info",recentError:"Failed to load recent requests"},cards:{todayRequests:"Requests Today",todayInput:"Input Tokens Today",todayOutput:"Output Tokens Today",avgLatency:"Average Latency"},charts:{requestsTitle:"Request Trends",requestsDesc:"Requests and token usage over the last 14 days",modelTitle:"Model Distribution",modelDesc:"Requests and tokens by model in the past 7 days",barRequests:"Requests",lineInput:"Input tokens",lineOutput:"Output tokens",axisTokens:"Tokens",ttftLabel:"TTFT (ms)",tpotLabel:"TPOT (ms/token)",ttftTitle:"TTFT Comparison",ttftDesc:"Compare first-token latency (TTFT) across models",ttftEmpty:"No TTFT data available.",tpotTitle:"TPOT Comparison",tpotDesc:"Compare per-token latency (TPOT) across models",tpotEmpty:"No TPOT data available.",ttftAxis:"TTFT (ms)",tpotAxis:"TPOT (ms/token)",empty:"No data"},recent:{title:"Recent Requests",subtitle:"Showing the latest {{count}} records",loading:"Loading...",empty:"No recent requests",routePlaceholder:"Not specified",columns:{time:"Time",endpoint:"Endpoint",provider:"Provider",route:"Route",latency:"Latency (ms)",status:"Status"}},modelTable:{title:"Model Performance Snapshot",description:"Requests, average latency, TTFT, and TPOT by downstream model.",empty:"No model statistics available.",columns:{model:"Provider/Model",requests:"Requests",latency:"Avg Latency",ttft:"TTFT",tpot:"TPOT"}}},logs:{title:"Request Logs",description:"Inspect recent traffic with provider/model/status filters and date range.",summary:{total:"Total records: {{value}}"},filters:{provider:"Provider",providerAll:"All providers",endpoint:"Endpoint",endpointAll:"All endpoints",endpointAnthropic:"anthropic",endpointOpenAI:"openai",apiKey:"API Key",apiKeyHint:"Select one or more keys; leave empty to include all.",modelId:"Model ID",modelPlaceholder:"e.g. deepseek-chat",status:"Status",statusAll:"All",statusSuccess:"Success",statusError:"Error",startDate:"Start date",endDate:"End date",apiKeyAll:"All keys",apiKeySelected:"{{count}} selected"},actions:{manualRefresh:"Manual refresh",refreshing:"Refreshing...",detail:"Detail"},table:{loading:"Loading logs...",empty:"No records match the current filters.",requestedModelFallback:"Not specified",apiKeyUnknown:"Unknown key",columns:{time:"Time",endpoint:"Endpoint",provider:"Provider",requestedModel:"Requested model",routedModel:"Routed model",apiKey:"API Key",inputTokens:"Input Tokens",cachedTokens:"Cached Tokens",outputTokens:"Output Tokens",stream:"Stream",latency:"Latency (ms)",ttft:"TTFT (ms)",tpot:"TPOT (ms/token)",status:"Status",error:"Error",actions:"Actions"},pagination:{perPage:"per page",unit:"items",previous:"Previous",next:"Next",pageLabel:"Page {{page}} / {{total}}"}},endpointAnthropic:"anthropic",endpointOpenAI:"openai",stream:{streaming:"Streaming",single:"Non-streaming"},toast:{listError:{title:"Failed to fetch logs",desc:"Error: {{message}}"},providerError:{title:"Failed to fetch providers",desc:"Error: {{message}}"}},detail:{title:"Log Detail",id:"ID #{{id}}",infoSection:"Overview",info:{time:"Time",sessionId:"Session ID",endpoint:"Endpoint",provider:"Provider",requestedModel:"Requested model",noRequestedModel:"Not specified",model:"Routed model",stream:"Stream",latency:"Latency",status:"Status",inputTokens:"Input Tokens",cachedTokens:"Cached Tokens",outputTokens:"Output Tokens",ttft:"TTFT (first token latency)",tpot:"TPOT (avg ms/token)",error:"Error"},summary:{route:"{{from}} → {{to}}",latency:"Latency: {{value}}",ttft:"TTFT: {{value}}",tpot:"TPOT: {{value}}",stream:"Stream: {{value}}"},payload:{request:"Request body",response:"Response body",emptyRequest:"No request content",emptyResponse:"No response content"},apiKey:{title:"API key",name:"Key name",identifier:"Key ID",masked:"Masked form",maskedUnavailable:"No mask available",raw:"Raw key",rawUnavailable:"Raw key not stored",missing:"Not recorded",lastUsed:"Last used"},copy:{requestSuccess:"Request body copied to clipboard.",responseSuccess:"Response body copied to clipboard.",keySuccess:"API key copied to clipboard.",empty:"Cannot copy empty {{label}}.",failure:"Copy failed",failureFallback:"Unable to copy content. Please try again later."},loadError:"Unable to load log detail."}},providers:{title:"Model Providers",description:"Manage integrated services and default models.",emptyState:'No providers yet. Click "Add provider" to get started.',count:"{{count}} providers configured",toast:{createSuccess:"Provider added: {{name}}",updateSuccess:"Provider updated: {{name}}",testSuccess:"Connection test succeeded.",testSuccessDesc:"HTTP {{status}} · {{duration}} elapsed",testFailure:"Connection test failed: {{message}}",loadFailure:"Failed to load config: {{message}}",deleteSuccess:"Provider removed: {{name}}",deleteFailure:"Failed to remove provider: {{message}}"},actions:{add:"Add provider",refresh:"Refresh",refreshing:"Refreshing...",edit:"Edit",delete:"Delete",test:"Test connection"},quickAddHuawei:{button:"Quick add Huawei models",title:"Quick add Huawei models",description:"Provide the API key to automatically configure Huawei Cloud DeepSeek V3.1, KIMI-K2, and Qwen3-235B-A22B.",apiKeyLabel:"API Key",apiKeyPlaceholder:"Enter your Huawei Cloud API Key",note:"You can further adjust settings from the provider list after creation.",submit:"Add provider",providerLabel:"Huawei Cloud",validation:{apiKey:"API Key is required"},toast:{success:"Huawei provider added",added:"{{name}} added successfully",failure:"Failed to add provider. Please try again later."}},card:{defaultModel:"Default model: {{model}}",noDefault:"No default model",modelsTitle:"Supported models",noModels:"No models configured yet."},drawer:{createTitle:"Add Provider",editTitle:"Edit Provider",description:"Configure base settings and model list.",modelsDescription:"Maintain supported models.",defaultHint:"Current default model: {{model}}",fields:{id:"Provider ID",idPlaceholder:"e.g. openai",label:"Display name",labelPlaceholder:"e.g. OpenAI Official",baseUrl:"Base URL",baseUrlPlaceholder:"https://api.example.com/v1",type:"Provider type",apiKey:"API Key (optional)",apiKeyPlaceholder:"Leave blank to read from environment",authMode:"Authentication mode",authModeHint:"Claude Code can authenticate with either an API key (x-api-key) or an auth token (Authorization: Bearer).",authModeApiKey:"Use API Key (x-api-key)",authModeAuthToken:"Use Auth Token (Authorization: Bearer)",models:"Model configuration",showAdvanced:"Show advanced options",hideAdvanced:"Hide advanced options",addModel:"Add model",modelId:"Model ID",modelIdPlaceholder:"e.g. claude-sonnet-4-5-20250929",modelLabel:"Display name (optional)",modelLabelPlaceholder:"e.g. GPT-4 Flagship",setDefault:"Set as default",removeModel:"Remove model"},errors:{idRequired:"Provider ID is required",idDuplicate:"Provider ID already exists",baseUrlInvalid:"Invalid Base URL",modelsRequired:"Configure at least one model",modelInvalid:"Model IDs must be unique and non-empty",defaultInvalid:"Default model must exist in the list"},toast:{saveFailure:"Save failed: {{message}}"}},confirm:{delete:"Remove provider “{{name}}”?"}},modelManagement:{title:"Model Management",description:"Configure providers and maintain model routing rules in one place.",tabs:{providers:"Providers",providersDesc:"Manage upstream providers and authentication.",anthropic:"Anthropic Routing",anthropicDesc:"Control mappings for the /anthropic endpoint.",openai:"OpenAI Routing",openaiDesc:"Control mappings for the /openai endpoint."},actions:{saveRoutes:"Save routes"},routing:{selectTarget:"Select provider:model"},toast:{routesSaved:"Model routes updated successfully.",routesSaveFailure:"Failed to save model routes: {{message}}"}},settings:{title:"System Settings",description:"Adjust gateway port, log retention, and runtime parameters.",toast:{loadFailure:"Failed to load config: {{message}}",saveSuccess:"Settings saved successfully.",saveFailure:"Save failed: {{message}}",copySuccess:"Config path copied to clipboard.",copyFailure:"Copy failed: {{message}}",cleanupSuccess:"{{count}} old logs removed.",cleanupNone:"No logs met the cleanup criteria.",cleanupFailure:"Cleanup failed: {{message}}",clearAllSuccess:"All logs cleared ({{logs}} requests, {{metrics}} daily rows).",clearAllFailure:"Full wipe failed: {{message}}",missingConfig:"Configuration not available. Refresh and try again."},sections:{basics:"Basic configuration",routing:"Model routing",configFile:"Configuration file",cleanup:"Log cleanup"},fields:{port:"Listen port",host:"Listen host (optional)",hostPlaceholder:"Defaults to 0.0.0.0",retention:"Log retention days",defaults:"Default models",storePayloads:"Store request & response bodies",storePayloadsHint:"Disable to keep only metadata and save disk space.",logLevel:"Log level",logLevelOption:{fatal:"Fatal",error:"Error",warn:"Warn",info:"Info",debug:"Debug",trace:"Trace"},requestLogging:"Emit request logs",requestLoggingHint:"Disable to stop printing each HTTP request in the console.",responseLogging:"Emit response logs",responseLoggingHint:"Disable to stop printing completion logs for each HTTP request."},validation:{port:"Enter a port between 1 and 65535",retention:"Retention days must be between 1 and 365",routePair:"Fill both the source and target models.",routeDuplicate:"A route for {{model}} already exists."},defaults:{completion:"Conversation: {{model}}",reasoning:"Reasoning: {{model}}",background:"Background: {{model}}",none:"No defaults configured"},routing:{title:"Model routing map",description:"Override Claude Code model requests with provider:model targets (e.g., map Claude to Kimi). Leave empty to fall back to defaults.",titleByEndpoint:"{{endpoint}} routing",descriptionByEndpoint:{anthropic:"Requests hitting the /anthropic endpoint will use these mappings.",openai:"Requests hitting the /openai endpoint will use these mappings."},add:"Add route",empty:"No custom routes configured. Default strategy will be used.",sourceLabel:"Source model",sourcePlaceholder:"e.g. claude-sonnet-4-5-20250929",targetLabel:"Target provider:model",targetPlaceholder:"e.g. kimi:kimi-k2-0905-preview",customTargetOption:"Custom target…",remove:"Remove",suggested:"Anthropic presets"},file:{description:"Configuration is stored locally; edit the file for offline adjustments.",unknown:"Unknown path"},cleanup:{description:"Immediately purge logs older than the retention window.",clearAll:"Clear everything",clearingAll:"Clearing…",clearAllWarning:"Deletes every log entry and daily metric. This cannot be undone."}},help:{title:"Help & Guidance",intro:"This page summarises how to configure cc-gw via the Web UI and how to operate it day to day.",note:"Changes are written to ~/.cc-gw/config.json immediately. Prefer editing through the Web UI; use the CLI mainly to start or restart the daemon.",sections:{configuration:{title:"1. Initial setup",items:["Review “Settings” to confirm the listening host/port and decide whether to emit request or response access logs.","Open “Model Management → Providers” to add upstream providers, including base URL, API key, and default model.","Click “Test connection” to ensure the provider is reachable. If it fails, double-check network access and API key permissions.","Configure “Model Management → Routing” for both /anthropic and /openai endpoints, then save to apply immediately.","Point your IDEs to the gateway: set `http://127.0.0.1:4100/anthropic` for both the Claude CLI and VS Code extension (they append `/v1/messages?beta=true` automatically), and target `http://127.0.0.1:4100/openai/v1` for Codex; authenticate with a cc-gw API key."]},usage:{title:"2. Daily usage",items:["Use the dashboard to keep an eye on request volume, token usage, cache hits, and TTFT/TPOT trends.","“Request Logs” provides rich filters plus full payload replay for debugging client/provider compatibility issues.","“Model Management” lets you switch defaults or update mappings without redeploying IDE extensions or automation scripts.","“Settings” controls log retention, payload storage, and log verbosity to suit your operations."]},tips:{title:"3. Practical tips",items:["Enable “Store request/response bodies” to copy raw payloads from the log drawer when troubleshooting.","Turn off request or response logs individually to keep the console quiet while preserving metrics and database records.","If you edit ~/.cc-gw/config.json manually, refresh the Settings page or restart cc-gw so the UI reflects the latest configuration."]}},faq:{title:"Frequently asked questions",items:[{q:"How can I change the default model for each endpoint?",a:"Go to “Model Management → Routing” and choose defaults for /anthropic and /openai. Saving applies the change right away."},{q:"Why are cached token numbers missing?",a:"Upstream providers must return cached_tokens or input_tokens_details.cached_tokens. Enable cache metrics on the provider if supported."}]}},apiKeys:{title:"API Keys Management",description:"Create and manage API keys for gateway access",createNew:"Create New Key",createAction:"Create",createDescription:"Create a new API key for authentication and optionally add a description.",descriptionLabel:"Key description (optional)",keyDescriptionPlaceholder:"e.g. Internal staging access only",keyNamePlaceholder:"Enter key name",keyCreated:"API Key Created",saveKeyWarning:"This is the only time you'll see the full key. Save it securely!",wildcard:"Any Key",wildcardHint:"When enabled, any custom key — including an empty key — is accepted. Disable this key to enforce strict authentication.",status:{enabled:"Enabled",disabled:"Disabled"},actions:{enable:"Enable",disable:"Disable",delete:"Delete"},created:"Created",lastUsed:"Last Used",requestCount:"Requests",totalTokens:"Total Tokens",confirmDelete:"Are you sure you want to delete this API key? This action cannot be undone.",errors:{nameRequired:"Key name is required"},analytics:{title:"Key Usage Analytics",description:"Highlights for the past {{days}} days of API key activity",range:{today:"Today",week:"Last 7 days",month:"Last 30 days"},cards:{total:"Total keys",enabled:"Enabled keys",active:"Active keys ({{days}} days)"},charts:{requests:"Top 10 keys by request count",tokens:"Top 10 keys by token usage"},tokens:{input:"Input tokens",output:"Output tokens"},requestsSeries:"Requests",empty:"No activity for the selected range.",unknownKey:"Unknown key"},list:{title:"Key Inventory",empty:"No API keys found. Use the button above to create one."},toast:{keyCreated:"API key created successfully",keyUpdated:"API key updated successfully",keyDeleted:"API key deleted successfully",keyCopied:"Key copied to clipboard",createFailure:"Failed to create: {{message}}",updateFailure:"Failed to update: {{message}}",deleteFailure:"Failed to delete: {{message}}"}},about:{title:"About",description:"Review cc-gw version details, build metadata, and current runtime status.",app:{title:"Application",labels:{name:"Name",version:"Version",buildTime:"Build time",node:"Node version"}},status:{title:"Runtime status",loading:"Fetching status...",empty:"Unable to retrieve status information.",labels:{host:"Listen host",port:"Listen port",providers:"Providers configured",active:"Active requests"}},support:{title:"Operational notes",subtitle:"Maintenance guidance",description:"Manage providers, routing, and logs in the Web UI; advanced settings live in ~/.cc-gw/config.json.",actions:{checkUpdates:"Check for updates"}},toast:{statusError:{title:"Failed to load status"},updatesPlanned:"Update checks will arrive in a future release."}}}}};le.isInitialized||le.use(yy).init({resources:zv,lng:"zh",fallbackLng:"en",interpolation:{escapeValue:!1}});const gp=x.createContext(void 0);function Uv(){return`toast_${Math.random().toString(36).slice(2)}`}function bv({children:e}){const[t,n]=x.useState([]),r=x.useCallback(o=>{n(l=>l.filter(a=>a.id!==o))},[]),i=x.useCallback(o=>{const l=o.id??Uv();n(u=>[...u,{...o,id:l}]);const a=o.durationMs??3e3;a>0&&setTimeout(()=>r(l),a)},[r]),s=x.useMemo(()=>({toasts:t,pushToast:i,dismissToast:r}),[t,r,i]);return L.jsxs(gp.Provider,{value:s,children:[e,L.jsx("div",{className:"fixed right-6 top-6 z-50 flex w-80 flex-col gap-3",children:t.map(o=>L.jsx("div",{className:`rounded-md border border-slate-200 bg-white p-4 shadow-lg dark:border-slate-700 dark:bg-slate-800 ${o.variant==="error"?"border-red-200 bg-red-50 text-red-900 dark:border-red-700 dark:bg-red-900/40 dark:text-red-200":o.variant==="success"?"border-emerald-200 bg-emerald-50 text-emerald-900 dark:border-emerald-700 dark:bg-emerald-900/40 dark:text-emerald-200":""}`,children:L.jsxs("div",{className:"flex items-start justify-between gap-4",children:[L.jsxs("div",{children:[L.jsx("p",{className:"text-sm font-semibold",children:o.title}),o.description?L.jsx("p",{className:"mt-1 text-sm opacity-75",children:o.description}):null]}),L.jsx("button",{type:"button",className:"text-sm text-slate-500 hover:text-slate-900 dark:text-slate-400 dark:hover:text-slate-100",onClick:()=>r(o.id),children:"×"})]})},o.id))})]})}function t0(){const e=x.useContext(gp);if(!e)throw new Error("useToast must be used within ToastProvider");return e}function $v({children:e}){const[t]=x.useState(()=>new pv);return L.jsx(hv,{client:t,children:L.jsx(Sy,{i18n:le,children:L.jsx(Dy,{children:L.jsx(bv,{children:e})})})})}function Kv(){const{t:e}=mi();return L.jsx("div",{className:"flex h-full items-center justify-center p-12",role:"status","aria-live":"polite",children:L.jsxs("div",{className:"flex flex-col items-center gap-4",children:[L.jsx("div",{className:"h-12 w-12 animate-spin rounded-full border-4 border-primary border-t-transparent"}),L.jsx("p",{className:"text-sm text-slate-500 dark:text-slate-400",children:e("common.loading")})]})})}const Vv=x.lazy(()=>Cn(()=>import("./Dashboard-RjvGXnju.js"),__vite__mapDeps([0,1,2]))),Bv=x.lazy(()=>Cn(()=>import("./Logs-B-TUIEjX.js"),__vite__mapDeps([3,2]))),wc=x.lazy(()=>Cn(()=>import("./ModelManagement-Bjnc9-06.js"),__vite__mapDeps([4,2]))),Hv=x.lazy(()=>Cn(()=>import("./ApiKeys-BcWxL_bz.js"),__vite__mapDeps([5,1,2]))),Qv=x.lazy(()=>Cn(()=>import("./Settings-Btgwveb7.js"),__vite__mapDeps([6,2]))),qv=x.lazy(()=>Cn(()=>import("./About-BRJQg6-i.js"),__vite__mapDeps([7,2]))),Wv=x.lazy(()=>Cn(()=>import("./Help-C33N-jg2.js"),[]));function Gv(){return L.jsx($v,{children:L.jsx(Yg,{basename:typeof window<"u"&&window.location.pathname.startsWith("/ui")?"/ui":"/",children:L.jsx(x.Suspense,{fallback:L.jsx(Kv,{}),children:L.jsx(Vg,{children:L.jsxs(Xe,{path:"/",element:L.jsx($y,{}),children:[L.jsx(Xe,{index:!0,element:L.jsx(Vv,{})}),L.jsx(Xe,{path:"logs",element:L.jsx(Bv,{})}),L.jsx(Xe,{path:"models",element:L.jsx(wc,{})}),L.jsx(Xe,{path:"providers",element:L.jsx(wc,{})}),L.jsx(Xe,{path:"api-keys",element:L.jsx(Hv,{})}),L.jsx(Xe,{path:"settings",element:L.jsx(Qv,{})}),L.jsx(Xe,{path:"about",element:L.jsx(qv,{})}),L.jsx(Xe,{path:"help",element:L.jsx(Wv,{})})]})})})})})}const yp=document.getElementById("root");if(!yp)throw new Error("Root element #root not found");Lo.createRoot(yp).render(L.jsx(Uc.StrictMode,{children:L.jsx(Gv,{})}));export{Ly as K,Kv as L,Uc as R,Qs as S,t0 as a,Wm as b,Je as c,Wy as d,Ll as e,Qy as f,Sp as g,Tl as h,qs as i,L as j,up as k,lv as l,Yy as m,Ke as n,ve as o,tv as p,Zv as q,x as r,Yv as s,qy as t,mi as u,e0 as v,Xv as w};
|
|
133
|
+
*/const Ju=Je("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Yu="cc-gw-theme",op=x.createContext(void 0);function My(e){return e==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e}function Xu(e){const t=document.documentElement;t.dataset.theme=e,e==="dark"?t.classList.add("dark"):t.classList.remove("dark")}function Dy({children:e}){const[t,n]=x.useState(()=>{if(typeof window>"u")return"system";const s=window.localStorage.getItem(Yu);return s==="light"||s==="dark"||s==="system"?s:"system"}),r=x.useMemo(()=>typeof window<"u"?My(t):"light",[t]);x.useEffect(()=>{if(typeof window>"u")return;const s=window.matchMedia("(prefers-color-scheme: dark)"),o=l=>{t==="system"&&Xu(l.matches?"dark":"light")};return s.addEventListener("change",o),()=>s.removeEventListener("change",o)},[t]),x.useEffect(()=>{typeof window>"u"||(Xu(r),window.localStorage.setItem(Yu,t))},[t,r]);const i=x.useMemo(()=>({mode:t,resolved:r,setMode:n}),[t,r]);return L.jsx(op.Provider,{value:i,children:e})}function Ay(){const e=x.useContext(op);if(!e)throw new Error("useTheme must be used within ThemeProvider");return e}const Zu=[{mode:"light",labelKey:"common.theme.light"},{mode:"dark",labelKey:"common.theme.dark"},{mode:"system",labelKey:"common.theme.system"}];function _y(){var l;const{mode:e,setMode:t,resolved:n}=Ay(),{t:r}=mi(),[i,s]=x.useState(!1),o=n==="dark"?L.jsx(Iy,{size:16,"aria-hidden":"true"}):L.jsx(jy,{size:16,"aria-hidden":"true"});return L.jsxs("div",{className:"relative",children:[L.jsxs("button",{type:"button",className:"flex items-center gap-2 rounded-md border border-slate-200 bg-white px-3 py-1.5 text-sm shadow-sm transition hover:bg-slate-100 dark:border-slate-700 dark:bg-slate-800 dark:hover:bg-slate-700","aria-haspopup":"listbox","aria-expanded":i,onClick:()=>s(a=>!a),onBlur:()=>s(!1),"aria-label":r("common.theme.label"),children:[o,L.jsx("span",{children:r(((l=Zu.find(a=>a.mode===e))==null?void 0:l.labelKey)??"common.theme.label")})]}),i?L.jsx("ul",{className:"absolute right-0 z-10 mt-1 w-40 overflow-hidden rounded-md border border-slate-200 bg-white shadow-lg dark:border-slate-700 dark:bg-slate-800",children:Zu.map(a=>L.jsx("li",{children:L.jsxs("button",{type:"button",onMouseDown:u=>u.preventDefault(),onClick:()=>{t(a.mode),s(!1)},className:`flex w-full items-center gap-2 px-3 py-2 text-left text-sm transition hover:bg-slate-100 dark:hover:bg-slate-700 ${a.mode===e?"bg-slate-100 dark:bg-slate-700":""}`,children:[L.jsx("span",{className:"h-2 w-2 rounded-full border border-slate-400",children:L.jsx("span",{className:`block h-full w-full rounded-full ${e===a.mode?"bg-blue-500":""}`})}),r(a.labelKey)]})},a.mode))}):null]})}const zy=[{code:"zh",labelKey:"language.zh"},{code:"en",labelKey:"language.en"}];function Uy(){const{i18n:e,t}=mi();return L.jsx("select",{value:e.language.startsWith("zh")?"zh":"en",onChange:n=>e.changeLanguage(n.target.value),className:"rounded-md border border-slate-200 bg-white px-2 py-1 text-sm dark:border-slate-700 dark:bg-slate-800","aria-label":t("common.languageSelector"),children:zy.map(n=>L.jsx("option",{value:n.code,children:t(n.labelKey)},n.code))})}const by=[{to:"/",icon:Cy,labelKey:"nav.dashboard"},{to:"/logs",icon:Ty,labelKey:"nav.logs"},{to:"/models",icon:Ny,labelKey:"nav.models"},{to:"/api-keys",icon:Ly,labelKey:"nav.apiKeys"},{to:"/settings",icon:Fy,labelKey:"nav.settings"},{to:"/help",icon:Oy,labelKey:"nav.help"},{to:"/about",icon:Ey,labelKey:"nav.about"}];function ec({onNavigate:e}){const{t}=mi();return L.jsx("nav",{className:"flex h-full flex-col gap-1","aria-label":t("app.title"),children:by.map(n=>{const r=n.icon;return L.jsxs(ty,{to:n.to,onClick:e,className:({isActive:i})=>`flex items-center gap-3 rounded-md px-3 py-2 text-sm transition hover:bg-slate-100 dark:hover:bg-slate-800 ${i?"bg-blue-100 text-blue-600 dark:bg-blue-900/40 dark:text-blue-200":"text-slate-600 dark:text-slate-300"}`,end:n.to==="/",children:[L.jsx(r,{size:18,"aria-hidden":"true"}),L.jsx("span",{children:t(n.labelKey)})]},n.to)})})}function $y(){const{t:e}=mi(),t=hr(),[n,r]=x.useState(!1);return x.useEffect(()=>{r(!1)},[t.pathname]),L.jsxs("div",{className:"flex h-full bg-slate-50 text-slate-900 dark:bg-slate-950 dark:text-slate-50",children:[L.jsx("a",{href:"#main-content",className:"sr-only focus:not-sr-only focus:absolute focus:z-50 focus:m-4 focus:rounded-md focus:bg-blue-600 focus:px-4 focus:py-2 focus:text-white",children:e("app.skipToContent")}),L.jsxs("aside",{className:"hidden w-60 border-r border-slate-200 bg-white px-4 py-6 dark:border-slate-800 dark:bg-slate-900 lg:block",children:[L.jsx("div",{className:"mb-6 text-lg font-semibold","aria-label":e("app.title"),children:e("app.title")}),L.jsx(ec,{})]}),L.jsxs("div",{className:"flex flex-1 flex-col",children:[L.jsxs("header",{className:"flex items-center justify-between border-b border-slate-200 bg-white px-4 py-3 dark:border-slate-800 dark:bg-slate-900",children:[L.jsxs("div",{className:"flex items-center gap-3 lg:hidden",children:[L.jsx("button",{type:"button",className:"rounded-md border border-slate-200 p-2 text-slate-600 transition hover:bg-slate-100 dark:border-slate-700 dark:text-slate-200 dark:hover:bg-slate-800",onClick:()=>r(i=>!i),"aria-label":e(n?"common.actions.closeNavigation":"common.actions.openNavigation"),"aria-expanded":n,"aria-controls":"mobile-nav",children:n?L.jsx(Ju,{size:18,"aria-hidden":"true"}):L.jsx(Ry,{size:18,"aria-hidden":"true"})}),L.jsx("div",{className:"text-base font-semibold",children:e("app.title")})]}),L.jsxs("div",{className:"flex items-center gap-3",children:[L.jsx(Uy,{}),L.jsx(_y,{})]})]}),L.jsx("main",{id:"main-content",role:"main",tabIndex:-1,className:"flex-1 overflow-y-auto bg-slate-100 p-4 sm:p-6 dark:bg-slate-950",children:L.jsx($g,{})})]}),n?L.jsx("div",{className:"fixed inset-0 z-40 bg-slate-900/60 backdrop-blur-sm lg:hidden",role:"dialog","aria-modal":"true",children:L.jsxs("div",{id:"mobile-nav",className:"absolute inset-y-0 left-0 w-64 border-r border-slate-200 bg-white px-4 py-6 shadow-lg dark:border-slate-800 dark:bg-slate-900",children:[L.jsxs("div",{className:"mb-6 flex items-center justify-between",children:[L.jsx("span",{className:"text-base font-semibold",children:e("app.title")}),L.jsx("button",{type:"button",className:"rounded-md border border-slate-200 p-2 text-slate-600 transition hover:bg-slate-100 dark:border-slate-700 dark:text-slate-200 dark:hover:bg-slate-800",onClick:()=>r(!1),"aria-label":e("common.actions.closeNavigation"),children:L.jsx(Ju,{size:18,"aria-hidden":"true"})})]}),L.jsx(ec,{onNavigate:()=>r(!1)})]})}):null]})}var Qs=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Ky={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Lt,Il,kc,Vy=(kc=class{constructor(){_(this,Lt,Ky);_(this,Il,!1)}setTimeoutProvider(e){j(this,Lt,e)}setTimeout(e,t){return k(this,Lt).setTimeout(e,t)}clearTimeout(e){k(this,Lt).clearTimeout(e)}setInterval(e,t){return k(this,Lt).setInterval(e,t)}clearInterval(e){k(this,Lt).clearInterval(e)}},Lt=new WeakMap,Il=new WeakMap,kc),Tl=new Vy;function By(e){setTimeout(e,0)}var qs=typeof window>"u"||"Deno"in globalThis;function Ke(){}function Hy(e,t){return typeof e=="function"?e(t):e}function Qy(e){return typeof e=="number"&&e>=0&&e!==1/0}function qy(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ll(e,t){return typeof e=="function"?e(t):e}function Wy(e,t){return typeof e=="function"?e(t):e}function tc(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:s,queryKey:o,stale:l}=e;if(o){if(r){if(t.queryHash!==Ta(o,t.options))return!1}else if(!ii(t.queryKey,o))return!1}if(n!=="all"){const a=t.isActive();if(n==="active"&&!a||n==="inactive"&&a)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||i&&i!==t.state.fetchStatus||s&&!s(t))}function nc(e,t){const{exact:n,status:r,predicate:i,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(ri(t.options.mutationKey)!==ri(s))return!1}else if(!ii(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Ta(e,t){return((t==null?void 0:t.queryKeyHashFn)||ri)(e)}function ri(e){return JSON.stringify(e,(t,n)=>Nl(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function ii(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>ii(e[n],t[n])):!1}var Gy=Object.prototype.hasOwnProperty;function lp(e,t){if(e===t)return e;const n=rc(e)&&rc(t);if(!n&&!(Nl(e)&&Nl(t)))return t;const i=(n?e:Object.keys(e)).length,s=n?t:Object.keys(t),o=s.length,l=n?new Array(o):{};let a=0;for(let u=0;u<o;u++){const d=n?u:s[u],f=e[d],c=t[d];if(f===c){l[d]=f,(n?u<i:Gy.call(e,d))&&a++;continue}if(f===null||c===null||typeof f!="object"||typeof c!="object"){l[d]=c;continue}const y=lp(f,c);l[d]=y,y===f&&a++}return i===o&&a===i?e:l}function Yv(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function rc(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Nl(e){if(!ic(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!ic(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function ic(e){return Object.prototype.toString.call(e)==="[object Object]"}function Jy(e){return new Promise(t=>{Tl.setTimeout(t,e)})}function Yy(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?lp(e,t):t}function Xv(e){return e}function Xy(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function Zy(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var La=Symbol();function ap(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===La?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Zv(e,t){return typeof e=="function"?e(...t):!!e}var an,Nt,Wn,Sc,ev=(Sc=class extends Qs{constructor(){super();_(this,an);_(this,Nt);_(this,Wn);j(this,Wn,t=>{if(!qs&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){k(this,Nt)||this.setEventListener(k(this,Wn))}onUnsubscribe(){var t;this.hasListeners()||((t=k(this,Nt))==null||t.call(this),j(this,Nt,void 0))}setEventListener(t){var n;j(this,Wn,t),(n=k(this,Nt))==null||n.call(this),j(this,Nt,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){k(this,an)!==t&&(j(this,an,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof k(this,an)=="boolean"?k(this,an):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},an=new WeakMap,Nt=new WeakMap,Wn=new WeakMap,Sc),up=new ev;function tv(){let e,t;const n=new Promise((i,s)=>{e=i,t=s});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}var nv=By;function rv(){let e=[],t=0,n=l=>{l()},r=l=>{l()},i=nv;const s=l=>{t?e.push(l):i(()=>{n(l)})},o=()=>{const l=e;e=[],l.length&&i(()=>{r(()=>{l.forEach(a=>{n(a)})})})};return{batch:l=>{let a;t++;try{a=l()}finally{t--,t||o()}return a},batchCalls:l=>(...a)=>{s(()=>{l(...a)})},schedule:s,setNotifyFunction:l=>{n=l},setBatchNotifyFunction:l=>{r=l},setScheduler:l=>{i=l}}}var ve=rv(),Gn,Ot,Jn,xc,iv=(xc=class extends Qs{constructor(){super();_(this,Gn,!0);_(this,Ot);_(this,Jn);j(this,Jn,t=>{if(!qs&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){k(this,Ot)||this.setEventListener(k(this,Jn))}onUnsubscribe(){var t;this.hasListeners()||((t=k(this,Ot))==null||t.call(this),j(this,Ot,void 0))}setEventListener(t){var n;j(this,Jn,t),(n=k(this,Ot))==null||n.call(this),j(this,Ot,t(this.setOnline.bind(this)))}setOnline(t){k(this,Gn)!==t&&(j(this,Gn,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return k(this,Gn)}},Gn=new WeakMap,Ot=new WeakMap,Jn=new WeakMap,xc),xs=new iv;function sv(e){return Math.min(1e3*2**e,3e4)}function cp(e){return(e??"online")==="online"?xs.isOnline():!0}var Ol=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function dp(e){let t=!1,n=0,r;const i=tv(),s=()=>i.status!=="pending",o=v=>{var S;if(!s()){const h=new Ol(v);c(h),(S=e.onCancel)==null||S.call(e,h)}},l=()=>{t=!0},a=()=>{t=!1},u=()=>up.isFocused()&&(e.networkMode==="always"||xs.isOnline())&&e.canRun(),d=()=>cp(e.networkMode)&&e.canRun(),f=v=>{s()||(r==null||r(),i.resolve(v))},c=v=>{s()||(r==null||r(),i.reject(v))},y=()=>new Promise(v=>{var S;r=h=>{(s()||u())&&v(h)},(S=e.onPause)==null||S.call(e)}).then(()=>{var v;r=void 0,s()||(v=e.onContinue)==null||v.call(e)}),w=()=>{if(s())return;let v;const S=n===0?e.initialPromise:void 0;try{v=S??e.fn()}catch(h){v=Promise.reject(h)}Promise.resolve(v).then(f).catch(h=>{var C;if(s())return;const p=e.retry??(qs?0:3),m=e.retryDelay??sv,g=typeof m=="function"?m(n,h):m,P=p===!0||typeof p=="number"&&n<p||typeof p=="function"&&p(n,h);if(t||!P){c(h);return}n++,(C=e.onFail)==null||C.call(e,n,h),Jy(g).then(()=>u()?void 0:y()).then(()=>{t?c(h):w()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r==null||r(),i),cancelRetry:l,continueRetry:a,canStart:d,start:()=>(d()?w():y().then(w),i)}}var un,Pc,fp=(Pc=class{constructor(){_(this,un)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Qy(this.gcTime)&&j(this,un,Tl.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(qs?1/0:5*60*1e3))}clearGcTimeout(){k(this,un)&&(Tl.clearTimeout(k(this,un)),j(this,un,void 0))}},un=new WeakMap,Pc),cn,Yn,je,dn,ie,oi,fn,Ve,lt,Cc,ov=(Cc=class extends fp{constructor(t){super();_(this,Ve);_(this,cn);_(this,Yn);_(this,je);_(this,dn);_(this,ie);_(this,oi);_(this,fn);j(this,fn,!1),j(this,oi,t.defaultOptions),this.setOptions(t.options),this.observers=[],j(this,dn,t.client),j(this,je,k(this,dn).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,j(this,cn,sc(this.options)),this.state=t.state??k(this,cn),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=k(this,ie))==null?void 0:t.promise}setOptions(t){if(this.options={...k(this,oi),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=sc(this.options);n.data!==void 0&&(this.setData(n.data,{updatedAt:n.dataUpdatedAt,manual:!0}),j(this,cn,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&k(this,je).remove(this)}setData(t,n){const r=Yy(this.state.data,t,this.options);return de(this,Ve,lt).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){de(this,Ve,lt).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,i;const n=(r=k(this,ie))==null?void 0:r.promise;return(i=k(this,ie))==null||i.cancel(t),n?n.then(Ke).catch(Ke):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(k(this,cn))}isActive(){return this.observers.some(t=>Wy(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===La||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Ll(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!qy(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=k(this,ie))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=k(this,ie))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),k(this,je).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(k(this,ie)&&(k(this,fn)?k(this,ie).cancel({revert:!0}):k(this,ie).cancelRetry()),this.scheduleGc()),k(this,je).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||de(this,Ve,lt).call(this,{type:"invalidate"})}async fetch(t,n){var a,u,d,f,c,y,w,v,S,h,p,m;if(this.state.fetchStatus!=="idle"&&((a=k(this,ie))==null?void 0:a.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(k(this,ie))return k(this,ie).continueRetry(),k(this,ie).promise}if(t&&this.setOptions(t),!this.options.queryFn){const g=this.observers.find(P=>P.options.queryFn);g&&this.setOptions(g.options)}const r=new AbortController,i=g=>{Object.defineProperty(g,"signal",{enumerable:!0,get:()=>(j(this,fn,!0),r.signal)})},s=()=>{const g=ap(this.options,n),C=(()=>{const E={client:k(this,dn),queryKey:this.queryKey,meta:this.meta};return i(E),E})();return j(this,fn,!1),this.options.persister?this.options.persister(g,C,this):g(C)},l=(()=>{const g={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:k(this,dn),state:this.state,fetchFn:s};return i(g),g})();(u=this.options.behavior)==null||u.onFetch(l,this),j(this,Yn,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=l.fetchOptions)==null?void 0:d.meta))&&de(this,Ve,lt).call(this,{type:"fetch",meta:(f=l.fetchOptions)==null?void 0:f.meta}),j(this,ie,dp({initialPromise:n==null?void 0:n.initialPromise,fn:l.fetchFn,onCancel:g=>{g instanceof Ol&&g.revert&&this.setState({...k(this,Yn),fetchStatus:"idle"}),r.abort()},onFail:(g,P)=>{de(this,Ve,lt).call(this,{type:"failed",failureCount:g,error:P})},onPause:()=>{de(this,Ve,lt).call(this,{type:"pause"})},onContinue:()=>{de(this,Ve,lt).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0}));try{const g=await k(this,ie).start();if(g===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(g),(y=(c=k(this,je).config).onSuccess)==null||y.call(c,g,this),(v=(w=k(this,je).config).onSettled)==null||v.call(w,g,this.state.error,this),g}catch(g){if(g instanceof Ol){if(g.silent)return k(this,ie).promise;if(g.revert){if(this.state.data===void 0)throw g;return this.state.data}}throw de(this,Ve,lt).call(this,{type:"error",error:g}),(h=(S=k(this,je).config).onError)==null||h.call(S,g,this),(m=(p=k(this,je).config).onSettled)==null||m.call(p,this.state.data,g,this),g}finally{this.scheduleGc()}}},cn=new WeakMap,Yn=new WeakMap,je=new WeakMap,dn=new WeakMap,ie=new WeakMap,oi=new WeakMap,fn=new WeakMap,Ve=new WeakSet,lt=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...lv(r.data,this.options),fetchMeta:t.meta??null};case"success":const i={...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return j(this,Yn,t.manual?i:void 0),i;case"error":const s=t.error;return{...r,error:s,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),ve.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),k(this,je).notify({query:this,type:"updated",action:t})})},Cc);function lv(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:cp(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function sc(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}function oc(e){return{onFetch:(t,n)=>{var d,f,c,y,w;const r=t.options,i=(c=(f=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:f.fetchMore)==null?void 0:c.direction,s=((y=t.state.data)==null?void 0:y.pages)||[],o=((w=t.state.data)==null?void 0:w.pageParams)||[];let l={pages:[],pageParams:[]},a=0;const u=async()=>{let v=!1;const S=m=>{Object.defineProperty(m,"signal",{enumerable:!0,get:()=>(t.signal.aborted?v=!0:t.signal.addEventListener("abort",()=>{v=!0}),t.signal)})},h=ap(t.options,t.fetchOptions),p=async(m,g,P)=>{if(v)return Promise.reject();if(g==null&&m.pages.length)return Promise.resolve(m);const E=(()=>{const $={client:t.client,queryKey:t.queryKey,pageParam:g,direction:P?"backward":"forward",meta:t.options.meta};return S($),$})(),O=await h(E),{maxPages:U}=t.options,I=P?Zy:Xy;return{pages:I(m.pages,O,U),pageParams:I(m.pageParams,g,U)}};if(i&&s.length){const m=i==="backward",g=m?av:lc,P={pages:s,pageParams:o},C=g(r,P);l=await p(P,C,m)}else{const m=e??s.length;do{const g=a===0?o[0]??r.initialPageParam:lc(r,l);if(a>0&&g==null)break;l=await p(l,g),a++}while(a<m)}return l};t.options.persister?t.fetchFn=()=>{var v,S;return(S=(v=t.options).persister)==null?void 0:S.call(v,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=u}}}function lc(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function av(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var li,et,ge,pn,tt,xt,Ec,uv=(Ec=class extends fp{constructor(t){super();_(this,tt);_(this,li);_(this,et);_(this,ge);_(this,pn);j(this,li,t.client),this.mutationId=t.mutationId,j(this,ge,t.mutationCache),j(this,et,[]),this.state=t.state||cv(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){k(this,et).includes(t)||(k(this,et).push(t),this.clearGcTimeout(),k(this,ge).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){j(this,et,k(this,et).filter(n=>n!==t)),this.scheduleGc(),k(this,ge).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){k(this,et).length||(this.state.status==="pending"?this.scheduleGc():k(this,ge).remove(this))}continue(){var t;return((t=k(this,pn))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,l,a,u,d,f,c,y,w,v,S,h,p,m,g,P,C,E,O,U;const n=()=>{de(this,tt,xt).call(this,{type:"continue"})},r={client:k(this,li),meta:this.options.meta,mutationKey:this.options.mutationKey};j(this,pn,dp({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(I,$)=>{de(this,tt,xt).call(this,{type:"failed",failureCount:I,error:$})},onPause:()=>{de(this,tt,xt).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>k(this,ge).canRun(this)}));const i=this.state.status==="pending",s=!k(this,pn).canStart();try{if(i)n();else{de(this,tt,xt).call(this,{type:"pending",variables:t,isPaused:s}),await((l=(o=k(this,ge).config).onMutate)==null?void 0:l.call(o,t,this,r));const $=await((u=(a=this.options).onMutate)==null?void 0:u.call(a,t,r));$!==this.state.context&&de(this,tt,xt).call(this,{type:"pending",context:$,variables:t,isPaused:s})}const I=await k(this,pn).start();return await((f=(d=k(this,ge).config).onSuccess)==null?void 0:f.call(d,I,t,this.state.context,this,r)),await((y=(c=this.options).onSuccess)==null?void 0:y.call(c,I,t,this.state.context,r)),await((v=(w=k(this,ge).config).onSettled)==null?void 0:v.call(w,I,null,this.state.variables,this.state.context,this,r)),await((h=(S=this.options).onSettled)==null?void 0:h.call(S,I,null,t,this.state.context,r)),de(this,tt,xt).call(this,{type:"success",data:I}),I}catch(I){try{throw await((m=(p=k(this,ge).config).onError)==null?void 0:m.call(p,I,t,this.state.context,this,r)),await((P=(g=this.options).onError)==null?void 0:P.call(g,I,t,this.state.context,r)),await((E=(C=k(this,ge).config).onSettled)==null?void 0:E.call(C,void 0,I,this.state.variables,this.state.context,this,r)),await((U=(O=this.options).onSettled)==null?void 0:U.call(O,void 0,I,t,this.state.context,r)),I}finally{de(this,tt,xt).call(this,{type:"error",error:I})}}finally{k(this,ge).runNext(this)}}},li=new WeakMap,et=new WeakMap,ge=new WeakMap,pn=new WeakMap,tt=new WeakSet,xt=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),ve.batch(()=>{k(this,et).forEach(r=>{r.onMutationUpdate(t)}),k(this,ge).notify({mutation:this,type:"updated",action:t})})},Ec);function cv(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var ct,Be,ai,Tc,dv=(Tc=class extends Qs{constructor(t={}){super();_(this,ct);_(this,Be);_(this,ai);this.config=t,j(this,ct,new Set),j(this,Be,new Map),j(this,ai,0)}build(t,n,r){const i=new uv({client:t,mutationCache:this,mutationId:++vi(this,ai)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){k(this,ct).add(t);const n=Ai(t);if(typeof n=="string"){const r=k(this,Be).get(n);r?r.push(t):k(this,Be).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(k(this,ct).delete(t)){const n=Ai(t);if(typeof n=="string"){const r=k(this,Be).get(n);if(r)if(r.length>1){const i=r.indexOf(t);i!==-1&&r.splice(i,1)}else r[0]===t&&k(this,Be).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=Ai(t);if(typeof n=="string"){const r=k(this,Be).get(n),i=r==null?void 0:r.find(s=>s.state.status==="pending");return!i||i===t}else return!0}runNext(t){var r;const n=Ai(t);if(typeof n=="string"){const i=(r=k(this,Be).get(n))==null?void 0:r.find(s=>s!==t&&s.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){ve.batch(()=>{k(this,ct).forEach(t=>{this.notify({type:"removed",mutation:t})}),k(this,ct).clear(),k(this,Be).clear()})}getAll(){return Array.from(k(this,ct))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>nc(n,r))}findAll(t={}){return this.getAll().filter(n=>nc(t,n))}notify(t){ve.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return ve.batch(()=>Promise.all(t.map(n=>n.continue().catch(Ke))))}},ct=new WeakMap,Be=new WeakMap,ai=new WeakMap,Tc);function Ai(e){var t;return(t=e.options.scope)==null?void 0:t.id}var nt,Lc,fv=(Lc=class extends Qs{constructor(t={}){super();_(this,nt);this.config=t,j(this,nt,new Map)}build(t,n,r){const i=n.queryKey,s=n.queryHash??Ta(i,n);let o=this.get(s);return o||(o=new ov({client:t,queryKey:i,queryHash:s,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(o)),o}add(t){k(this,nt).has(t.queryHash)||(k(this,nt).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=k(this,nt).get(t.queryHash);n&&(t.destroy(),n===t&&k(this,nt).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){ve.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return k(this,nt).get(t)}getAll(){return[...k(this,nt).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>tc(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>tc(t,r)):n}notify(t){ve.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){ve.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){ve.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},nt=new WeakMap,Lc),J,Rt,It,Xn,Zn,Ft,er,tr,Nc,pv=(Nc=class{constructor(e={}){_(this,J);_(this,Rt);_(this,It);_(this,Xn);_(this,Zn);_(this,Ft);_(this,er);_(this,tr);j(this,J,e.queryCache||new fv),j(this,Rt,e.mutationCache||new dv),j(this,It,e.defaultOptions||{}),j(this,Xn,new Map),j(this,Zn,new Map),j(this,Ft,0)}mount(){vi(this,Ft)._++,k(this,Ft)===1&&(j(this,er,up.subscribe(async e=>{e&&(await this.resumePausedMutations(),k(this,J).onFocus())})),j(this,tr,xs.subscribe(async e=>{e&&(await this.resumePausedMutations(),k(this,J).onOnline())})))}unmount(){var e,t;vi(this,Ft)._--,k(this,Ft)===0&&((e=k(this,er))==null||e.call(this),j(this,er,void 0),(t=k(this,tr))==null||t.call(this),j(this,tr,void 0))}isFetching(e){return k(this,J).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return k(this,Rt).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=k(this,J).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=k(this,J).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Ll(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return k(this,J).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),i=k(this,J).get(r.queryHash),s=i==null?void 0:i.state.data,o=Hy(t,s);if(o!==void 0)return k(this,J).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return ve.batch(()=>k(this,J).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=k(this,J).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=k(this,J);ve.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=k(this,J);return ve.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=ve.batch(()=>k(this,J).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(Ke).catch(Ke)}invalidateQueries(e,t={}){return ve.batch(()=>(k(this,J).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=ve.batch(()=>k(this,J).findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let s=i.fetch(void 0,n);return n.throwOnError||(s=s.catch(Ke)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(Ke)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=k(this,J).build(this,t);return n.isStaleByTime(Ll(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Ke).catch(Ke)}fetchInfiniteQuery(e){return e.behavior=oc(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Ke).catch(Ke)}ensureInfiniteQueryData(e){return e.behavior=oc(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return xs.isOnline()?k(this,Rt).resumePausedMutations():Promise.resolve()}getQueryCache(){return k(this,J)}getMutationCache(){return k(this,Rt)}getDefaultOptions(){return k(this,It)}setDefaultOptions(e){j(this,It,e)}setQueryDefaults(e,t){k(this,Xn).set(ri(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...k(this,Xn).values()],n={};return t.forEach(r=>{ii(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){k(this,Zn).set(ri(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...k(this,Zn).values()],n={};return t.forEach(r=>{ii(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...k(this,It).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Ta(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===La&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...k(this,It).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){k(this,J).clear(),k(this,Rt).clear()}},J=new WeakMap,Rt=new WeakMap,It=new WeakMap,Xn=new WeakMap,Zn=new WeakMap,Ft=new WeakMap,er=new WeakMap,tr=new WeakMap,Nc),pp=x.createContext(void 0),e0=e=>{const t=x.useContext(pp);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},hv=({client:e,children:t})=>(x.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),L.jsx(pp.Provider,{value:e,children:t}));const M=e=>typeof e=="string",Pr=()=>{let e,t;const n=new Promise((r,i)=>{e=r,t=i});return n.resolve=e,n.reject=t,n},ac=e=>e==null?"":""+e,mv=(e,t,n)=>{e.forEach(r=>{t[r]&&(n[r]=t[r])})},gv=/###/g,uc=e=>e&&e.indexOf("###")>-1?e.replace(gv,"."):e,cc=e=>!e||M(e),_r=(e,t,n)=>{const r=M(t)?t.split("."):t;let i=0;for(;i<r.length-1;){if(cc(e))return{};const s=uc(r[i]);!e[s]&&n&&(e[s]=new n),Object.prototype.hasOwnProperty.call(e,s)?e=e[s]:e={},++i}return cc(e)?{}:{obj:e,k:uc(r[i])}},dc=(e,t,n)=>{const{obj:r,k:i}=_r(e,t,Object);if(r!==void 0||t.length===1){r[i]=n;return}let s=t[t.length-1],o=t.slice(0,t.length-1),l=_r(e,o,Object);for(;l.obj===void 0&&o.length;)s=`${o[o.length-1]}.${s}`,o=o.slice(0,o.length-1),l=_r(e,o,Object),l&&l.obj&&typeof l.obj[`${l.k}.${s}`]<"u"&&(l.obj=void 0);l.obj[`${l.k}.${s}`]=n},yv=(e,t,n,r)=>{const{obj:i,k:s}=_r(e,t,Object);i[s]=i[s]||[],i[s].push(n)},Ps=(e,t)=>{const{obj:n,k:r}=_r(e,t);if(n)return n[r]},vv=(e,t,n)=>{const r=Ps(e,n);return r!==void 0?r:Ps(t,n)},hp=(e,t,n)=>{for(const r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?M(e[r])||e[r]instanceof String||M(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):hp(e[r],t[r],n):e[r]=t[r]);return e},Nn=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var wv={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const kv=e=>M(e)?e.replace(/[&<>"'\/]/g,t=>wv[t]):e;class Sv{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const n=this.regExpMap.get(t);if(n!==void 0)return n;const r=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,r),this.regExpQueue.push(t),r}}const xv=[" ",",","?","!",";"],Pv=new Sv(20),Cv=(e,t,n)=>{t=t||"",n=n||"";const r=xv.filter(o=>t.indexOf(o)<0&&n.indexOf(o)<0);if(r.length===0)return!0;const i=Pv.getRegExp(`(${r.map(o=>o==="?"?"\\?":o).join("|")})`);let s=!i.test(e);if(!s){const o=e.indexOf(n);o>0&&!i.test(e.substring(0,o))&&(s=!0)}return s},Rl=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!e)return;if(e[t])return e[t];const r=t.split(n);let i=e;for(let s=0;s<r.length;){if(!i||typeof i!="object")return;let o,l="";for(let a=s;a<r.length;++a)if(a!==s&&(l+=n),l+=r[a],o=i[l],o!==void 0){if(["string","number","boolean"].indexOf(typeof o)>-1&&a<r.length-1)continue;s+=a-s+1;break}i=o}return i},Cs=e=>e&&e.replace("_","-"),Ev={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console&&console[e]&&console[e].apply(console,t)}};class Es{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(t,n)}init(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=n.prefix||"i18next:",this.logger=t||Ev,this.options=n,this.debug=n.debug}log(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"log","",!0)}warn(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"warn","",!0)}error(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"error","")}deprecate(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"warn","WARNING DEPRECATED: ",!0)}forward(t,n,r,i){return i&&!this.debug?null:(M(t[0])&&(t[0]=`${r}${this.prefix} ${t[0]}`),this.logger[n](t))}create(t){return new Es(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new Es(this.logger,t)}}var it=new Es;class Ws{constructor(){this.observers={}}on(t,n){return t.split(" ").forEach(r=>{this.observers[r]||(this.observers[r]=new Map);const i=this.observers[r].get(n)||0;this.observers[r].set(n,i+1)}),this}off(t,n){if(this.observers[t]){if(!n){delete this.observers[t];return}this.observers[t].delete(n)}}emit(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];this.observers[t]&&Array.from(this.observers[t].entries()).forEach(o=>{let[l,a]=o;for(let u=0;u<a;u++)l(...r)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(o=>{let[l,a]=o;for(let u=0;u<a;u++)l.apply(l,[t,...r])})}}class fc extends Ws{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=t||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const n=this.options.ns.indexOf(t);n>-1&&this.options.ns.splice(n,1)}getResource(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const s=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,o=i.ignoreJSONStructure!==void 0?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let l;t.indexOf(".")>-1?l=t.split("."):(l=[t,n],r&&(Array.isArray(r)?l.push(...r):M(r)&&s?l.push(...r.split(s)):l.push(r)));const a=Ps(this.data,l);return!a&&!n&&!r&&t.indexOf(".")>-1&&(t=l[0],n=l[1],r=l.slice(2).join(".")),a||!o||!M(r)?a:Rl(this.data&&this.data[t]&&this.data[t][n],r,s)}addResource(t,n,r,i){let s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const o=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator;let l=[t,n];r&&(l=l.concat(o?r.split(o):r)),t.indexOf(".")>-1&&(l=t.split("."),i=n,n=l[1]),this.addNamespaces(n),dc(this.data,l,i),s.silent||this.emit("added",t,n,r,i)}addResources(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const s in r)(M(r[s])||Array.isArray(r[s]))&&this.addResource(t,n,s,r[s],{silent:!0});i.silent||this.emit("added",t,n,r)}addResourceBundle(t,n,r,i,s){let o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},l=[t,n];t.indexOf(".")>-1&&(l=t.split("."),i=r,r=n,n=l[1]),this.addNamespaces(n);let a=Ps(this.data,l)||{};o.skipCopy||(r=JSON.parse(JSON.stringify(r))),i?hp(a,r,s):a={...a,...r},dc(this.data,l,a),o.silent||this.emit("added",t,n,r)}removeResourceBundle(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}hasResourceBundle(t,n){return this.getResource(t,n)!==void 0}getResourceBundle(t,n){return n||(n=this.options.defaultNS),this.options.compatibilityAPI==="v1"?{...this.getResource(t,n)}:this.getResource(t,n)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(i=>n[i]&&Object.keys(n[i]).length>0)}toJSON(){return this.data}}var mp={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,i){return e.forEach(s=>{this.processors[s]&&(t=this.processors[s].process(t,n,r,i))}),t}};const pc={};class Ts extends Ws{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),mv(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=it.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(t==null)return!1;const r=this.resolve(t,n);return r&&r.res!==void 0}extractFromKey(t,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const i=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let s=n.ns||this.options.defaultNS||[];const o=r&&t.indexOf(r)>-1,l=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!Cv(t,r,i);if(o&&!l){const a=t.match(this.interpolator.nestingRegexp);if(a&&a.length>0)return{key:t,namespaces:M(s)?[s]:s};const u=t.split(r);(r!==i||r===i&&this.options.ns.indexOf(u[0])>-1)&&(s=u.shift()),t=u.join(i)}return{key:t,namespaces:M(s)?[s]:s}}translate(t,n,r){if(typeof n!="object"&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),typeof n=="object"&&(n={...n}),n||(n={}),t==null)return"";Array.isArray(t)||(t=[String(t)]);const i=n.returnDetails!==void 0?n.returnDetails:this.options.returnDetails,s=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,{key:o,namespaces:l}=this.extractFromKey(t[t.length-1],n),a=l[l.length-1],u=n.lng||this.language,d=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(u&&u.toLowerCase()==="cimode"){if(d){const g=n.nsSeparator||this.options.nsSeparator;return i?{res:`${a}${g}${o}`,usedKey:o,exactUsedKey:o,usedLng:u,usedNS:a,usedParams:this.getUsedParamsDetails(n)}:`${a}${g}${o}`}return i?{res:o,usedKey:o,exactUsedKey:o,usedLng:u,usedNS:a,usedParams:this.getUsedParamsDetails(n)}:o}const f=this.resolve(t,n);let c=f&&f.res;const y=f&&f.usedKey||o,w=f&&f.exactUsedKey||o,v=Object.prototype.toString.apply(c),S=["[object Number]","[object Function]","[object RegExp]"],h=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,p=!this.i18nFormat||this.i18nFormat.handleAsObject,m=!M(c)&&typeof c!="boolean"&&typeof c!="number";if(p&&c&&m&&S.indexOf(v)<0&&!(M(h)&&Array.isArray(c))){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const g=this.options.returnedObjectHandler?this.options.returnedObjectHandler(y,c,{...n,ns:l}):`key '${o} (${this.language})' returned an object instead of string.`;return i?(f.res=g,f.usedParams=this.getUsedParamsDetails(n),f):g}if(s){const g=Array.isArray(c),P=g?[]:{},C=g?w:y;for(const E in c)if(Object.prototype.hasOwnProperty.call(c,E)){const O=`${C}${s}${E}`;P[E]=this.translate(O,{...n,joinArrays:!1,ns:l}),P[E]===O&&(P[E]=c[E])}c=P}}else if(p&&M(h)&&Array.isArray(c))c=c.join(h),c&&(c=this.extendTranslation(c,t,n,r));else{let g=!1,P=!1;const C=n.count!==void 0&&!M(n.count),E=Ts.hasDefaultValue(n),O=C?this.pluralResolver.getSuffix(u,n.count,n):"",U=n.ordinal&&C?this.pluralResolver.getSuffix(u,n.count,{ordinal:!1}):"",I=C&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),$=I&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${O}`]||n[`defaultValue${U}`]||n.defaultValue;!this.isValidLookup(c)&&E&&(g=!0,c=$),this.isValidLookup(c)||(P=!0,c=o);const Xt=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&P?void 0:c,wt=E&&$!==c&&this.options.updateMissing;if(P||g||wt){if(this.logger.log(wt?"updateKey":"missingKey",u,a,o,wt?$:c),s){const N=this.resolve(o,{...n,keySeparator:!1});N&&N.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 Zt=[];const kt=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&kt&&kt[0])for(let N=0;N<kt.length;N++)Zt.push(kt[N]);else this.options.saveMissingTo==="all"?Zt=this.languageUtils.toResolveHierarchy(n.lng||this.language):Zt.push(n.lng||this.language);const Tn=(N,F,D)=>{const H=E&&D!==c?D:Xt;this.options.missingKeyHandler?this.options.missingKeyHandler(N,a,F,H,wt,n):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(N,a,F,H,wt,n),this.emit("missingKey",N,a,F,c)};this.options.saveMissing&&(this.options.saveMissingPlurals&&C?Zt.forEach(N=>{const F=this.pluralResolver.getSuffixes(N,n);I&&n[`defaultValue${this.options.pluralSeparator}zero`]&&F.indexOf(`${this.options.pluralSeparator}zero`)<0&&F.push(`${this.options.pluralSeparator}zero`),F.forEach(D=>{Tn([N],o+D,n[`defaultValue${D}`]||$)})}):Tn(Zt,o,$))}c=this.extendTranslation(c,t,n,f,r),P&&c===o&&this.options.appendNamespaceToMissingKey&&(c=`${a}:${o}`),(P||g)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?c=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${a}:${o}`:o,g?c:void 0):c=this.options.parseMissingKeyHandler(c))}return i?(f.res=c,f.usedParams=this.getUsedParamsDetails(n),f):c}extendTranslation(t,n,r,i,s){var o=this;if(this.i18nFormat&&this.i18nFormat.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const u=M(t)&&(r&&r.interpolation&&r.interpolation.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let d;if(u){const c=t.match(this.interpolator.nestingRegexp);d=c&&c.length}let f=r.replace&&!M(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(f={...this.options.interpolation.defaultVariables,...f}),t=this.interpolator.interpolate(t,f,r.lng||this.language||i.usedLng,r),u){const c=t.match(this.interpolator.nestingRegexp),y=c&&c.length;d<y&&(r.nest=!1)}!r.lng&&this.options.compatibilityAPI!=="v1"&&i&&i.res&&(r.lng=this.language||i.usedLng),r.nest!==!1&&(t=this.interpolator.nest(t,function(){for(var c=arguments.length,y=new Array(c),w=0;w<c;w++)y[w]=arguments[w];return s&&s[0]===y[0]&&!r.context?(o.logger.warn(`It seems you are nesting recursively key: ${y[0]} in key: ${n[0]}`),null):o.translate(...y,n)},r)),r.interpolation&&this.interpolator.reset()}const l=r.postProcess||this.options.postProcess,a=M(l)?[l]:l;return t!=null&&a&&a.length&&r.applyPostProcessor!==!1&&(t=mp.handle(a,t,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...i,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),t}resolve(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r,i,s,o,l;return M(t)&&(t=[t]),t.forEach(a=>{if(this.isValidLookup(r))return;const u=this.extractFromKey(a,n),d=u.key;i=d;let f=u.namespaces;this.options.fallbackNS&&(f=f.concat(this.options.fallbackNS));const c=n.count!==void 0&&!M(n.count),y=c&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),w=n.context!==void 0&&(M(n.context)||typeof n.context=="number")&&n.context!=="",v=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);f.forEach(S=>{this.isValidLookup(r)||(l=S,!pc[`${v[0]}-${S}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(l)&&(pc[`${v[0]}-${S}`]=!0,this.logger.warn(`key "${i}" for languages "${v.join(", ")}" won't get resolved as namespace "${l}" 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!!!")),v.forEach(h=>{if(this.isValidLookup(r))return;o=h;const p=[d];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(p,d,h,S,n);else{let g;c&&(g=this.pluralResolver.getSuffix(h,n.count,n));const P=`${this.options.pluralSeparator}zero`,C=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(c&&(p.push(d+g),n.ordinal&&g.indexOf(C)===0&&p.push(d+g.replace(C,this.options.pluralSeparator)),y&&p.push(d+P)),w){const E=`${d}${this.options.contextSeparator}${n.context}`;p.push(E),c&&(p.push(E+g),n.ordinal&&g.indexOf(C)===0&&p.push(E+g.replace(C,this.options.pluralSeparator)),y&&p.push(E+P))}}let m;for(;m=p.pop();)this.isValidLookup(r)||(s=m,r=this.getResource(h,S,m,n))}))})}),{res:r,usedKey:i,exactUsedKey:s,usedLng:o,usedNS:l}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(t,n,r,i):this.resourceStore.getResource(t,n,r,i)}getUsedParamsDetails(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=t.replace&&!M(t.replace);let i=r?t.replace:t;if(r&&typeof t.count<"u"&&(i.count=t.count),this.options.interpolation.defaultVariables&&(i={...this.options.interpolation.defaultVariables,...i}),!r){i={...i};for(const s of n)delete i[s]}return i}static hasDefaultValue(t){const n="defaultValue";for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&n===r.substring(0,n.length)&&t[r]!==void 0)return!0;return!1}}const Eo=e=>e.charAt(0).toUpperCase()+e.slice(1);class hc{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=it.create("languageUtils")}getScriptPartFromCode(t){if(t=Cs(t),!t||t.indexOf("-")<0)return null;const n=t.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(t){if(t=Cs(t),!t||t.indexOf("-")<0)return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(M(t)&&t.indexOf("-")>-1){if(typeof Intl<"u"&&typeof Intl.getCanonicalLocales<"u")try{let i=Intl.getCanonicalLocales(t)[0];if(i&&this.options.lowerCaseLng&&(i=i.toLowerCase()),i)return i}catch{}const n=["hans","hant","latn","cyrl","cans","mong","arab"];let r=t.split("-");return this.options.lowerCaseLng?r=r.map(i=>i.toLowerCase()):r.length===2?(r[0]=r[0].toLowerCase(),r[1]=r[1].toUpperCase(),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=Eo(r[1].toLowerCase()))):r.length===3&&(r[0]=r[0].toLowerCase(),r[1].length===2&&(r[1]=r[1].toUpperCase()),r[0]!=="sgn"&&r[2].length===2&&(r[2]=r[2].toUpperCase()),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=Eo(r[1].toLowerCase())),n.indexOf(r[2].toLowerCase())>-1&&(r[2]=Eo(r[2].toLowerCase()))),r.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let n;return t.forEach(r=>{if(n)return;const i=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(i))&&(n=i)}),!n&&this.options.supportedLngs&&t.forEach(r=>{if(n)return;const i=this.getLanguagePartFromCode(r);if(this.isSupportedCode(i))return n=i;n=this.options.supportedLngs.find(s=>{if(s===i)return s;if(!(s.indexOf("-")<0&&i.indexOf("-")<0)&&(s.indexOf("-")>0&&i.indexOf("-")<0&&s.substring(0,s.indexOf("-"))===i||s.indexOf(i)===0&&i.length>1))return s})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),M(t)&&(t=[t]),Array.isArray(t))return t;if(!n)return t.default||[];let r=t[n];return r||(r=t[this.getScriptPartFromCode(n)]),r||(r=t[this.formatLanguageCode(n)]),r||(r=t[this.getLanguagePartFromCode(n)]),r||(r=t.default),r||[]}toResolveHierarchy(t,n){const r=this.getFallbackCodes(n||this.options.fallbackLng||[],t),i=[],s=o=>{o&&(this.isSupportedCode(o)?i.push(o):this.logger.warn(`rejecting language code not found in supportedLngs: ${o}`))};return M(t)&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&s(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&s(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&s(this.getLanguagePartFromCode(t))):M(t)&&s(this.formatLanguageCode(t)),r.forEach(o=>{i.indexOf(o)<0&&s(this.formatLanguageCode(o))}),i}}let Tv=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],Lv={1:e=>+(e>1),2:e=>+(e!=1),3:e=>0,4:e=>e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2,5:e=>e==0?0:e==1?1:e==2?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5,6:e=>e==1?0:e>=2&&e<=4?1:2,7:e=>e==1?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2,8:e=>e==1?0:e==2?1:e!=8&&e!=11?2:3,9:e=>+(e>=2),10:e=>e==1?0:e==2?1:e<7?2:e<11?3:4,11:e=>e==1||e==11?0:e==2||e==12?1:e>2&&e<20?2:3,12:e=>+(e%10!=1||e%100==11),13:e=>+(e!==0),14:e=>e==1?0:e==2?1:e==3?2:3,15:e=>e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2,16:e=>e%10==1&&e%100!=11?0:e!==0?1:2,17:e=>e==1||e%10==1&&e%100!=11?0:1,18:e=>e==0?0:e==1?1:2,19:e=>e==1?0:e==0||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3,20:e=>e==1?0:e==0||e%100>0&&e%100<20?1:2,21:e=>e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0,22:e=>e==1?0:e==2?1:(e<0||e>10)&&e%10==0?2:3};const Nv=["v1","v2","v3"],Ov=["v4"],mc={zero:0,one:1,two:2,few:3,many:4,other:5},Rv=()=>{const e={};return Tv.forEach(t=>{t.lngs.forEach(n=>{e[n]={numbers:t.nr,plurals:Lv[t.fc]}})}),e};class Iv{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=t,this.options=n,this.logger=it.create("pluralResolver"),(!this.options.compatibilityJSON||Ov.includes(this.options.compatibilityJSON))&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=Rv(),this.pluralRulesCache={}}addRule(t,n){this.rules[t]=n}clearCache(){this.pluralRulesCache={}}getRule(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi()){const r=Cs(t==="dev"?"en":t),i=n.ordinal?"ordinal":"cardinal",s=JSON.stringify({cleanedCode:r,type:i});if(s in this.pluralRulesCache)return this.pluralRulesCache[s];let o;try{o=new Intl.PluralRules(r,{type:i})}catch{if(!t.match(/-|_/))return;const a=this.languageUtils.getLanguagePartFromCode(t);o=this.getRule(a,n)}return this.pluralRulesCache[s]=o,o}return this.rules[t]||this.rules[this.languageUtils.getLanguagePartFromCode(t)]}needsPlural(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=this.getRule(t,n);return this.shouldUseIntlApi()?r&&r.resolvedOptions().pluralCategories.length>1:r&&r.numbers.length>1}getPluralFormsOfKey(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(t,r).map(i=>`${n}${i}`)}getSuffixes(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=this.getRule(t,n);return r?this.shouldUseIntlApi()?r.resolvedOptions().pluralCategories.sort((i,s)=>mc[i]-mc[s]).map(i=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${i}`):r.numbers.map(i=>this.getSuffix(t,i,n)):[]}getSuffix(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const i=this.getRule(t,r);return i?this.shouldUseIntlApi()?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${i.select(n)}`:this.getSuffixRetroCompatible(i,n):(this.logger.warn(`no plural rule found for: ${t}`),"")}getSuffixRetroCompatible(t,n){const r=t.noAbs?t.plurals(n):t.plurals(Math.abs(n));let i=t.numbers[r];this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1&&(i===2?i="plural":i===1&&(i=""));const s=()=>this.options.prepend&&i.toString()?this.options.prepend+i.toString():i.toString();return this.options.compatibilityJSON==="v1"?i===1?"":typeof i=="number"?`_plural_${i.toString()}`:s():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1?s():this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString()}shouldUseIntlApi(){return!Nv.includes(this.options.compatibilityJSON)}}const gc=function(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,s=vv(e,t,n);return!s&&i&&M(n)&&(s=Rl(e,n,r),s===void 0&&(s=Rl(t,n,r))),s},To=e=>e.replace(/\$/g,"$$$$");class Fv{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=it.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||(n=>n),this.init(t)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:i,prefix:s,prefixEscaped:o,suffix:l,suffixEscaped:a,formatSeparator:u,unescapeSuffix:d,unescapePrefix:f,nestingPrefix:c,nestingPrefixEscaped:y,nestingSuffix:w,nestingSuffixEscaped:v,nestingOptionsSeparator:S,maxReplaces:h,alwaysFormat:p}=t.interpolation;this.escape=n!==void 0?n:kv,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=i!==void 0?i:!1,this.prefix=s?Nn(s):o||"{{",this.suffix=l?Nn(l):a||"}}",this.formatSeparator=u||",",this.unescapePrefix=d?"":f||"-",this.unescapeSuffix=this.unescapePrefix?"":d||"",this.nestingPrefix=c?Nn(c):y||Nn("$t("),this.nestingSuffix=w?Nn(w):v||Nn(")"),this.nestingOptionsSeparator=S||",",this.maxReplaces=h||1e3,this.alwaysFormat=p!==void 0?p:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(n,r)=>n&&n.source===r?(n.lastIndex=0,n):new RegExp(r,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(t,n,r,i){let s,o,l;const a=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=y=>{if(y.indexOf(this.formatSeparator)<0){const h=gc(n,a,y,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(h,void 0,r,{...i,...n,interpolationkey:y}):h}const w=y.split(this.formatSeparator),v=w.shift().trim(),S=w.join(this.formatSeparator).trim();return this.format(gc(n,a,v,this.options.keySeparator,this.options.ignoreJSONStructure),S,r,{...i,...n,interpolationkey:v})};this.resetRegExp();const d=i&&i.missingInterpolationHandler||this.options.missingInterpolationHandler,f=i&&i.interpolation&&i.interpolation.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:y=>To(y)},{regex:this.regexp,safeValue:y=>this.escapeValue?To(this.escape(y)):To(y)}].forEach(y=>{for(l=0;s=y.regex.exec(t);){const w=s[1].trim();if(o=u(w),o===void 0)if(typeof d=="function"){const S=d(t,s,i);o=M(S)?S:""}else if(i&&Object.prototype.hasOwnProperty.call(i,w))o="";else if(f){o=s[0];continue}else this.logger.warn(`missed to pass in variable ${w} for interpolating ${t}`),o="";else!M(o)&&!this.useRawValueToEscape&&(o=ac(o));const v=y.safeValue(o);if(t=t.replace(s[0],v),f?(y.regex.lastIndex+=o.length,y.regex.lastIndex-=s[0].length):y.regex.lastIndex=0,l++,l>=this.maxReplaces)break}}),t}nest(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i,s,o;const l=(a,u)=>{const d=this.nestingOptionsSeparator;if(a.indexOf(d)<0)return a;const f=a.split(new RegExp(`${d}[ ]*{`));let c=`{${f[1]}`;a=f[0],c=this.interpolate(c,o);const y=c.match(/'/g),w=c.match(/"/g);(y&&y.length%2===0&&!w||w.length%2!==0)&&(c=c.replace(/'/g,'"'));try{o=JSON.parse(c),u&&(o={...u,...o})}catch(v){return this.logger.warn(`failed parsing options string in nesting for key ${a}`,v),`${a}${d}${c}`}return o.defaultValue&&o.defaultValue.indexOf(this.prefix)>-1&&delete o.defaultValue,a};for(;i=this.nestingRegexp.exec(t);){let a=[];o={...r},o=o.replace&&!M(o.replace)?o.replace:o,o.applyPostProcessor=!1,delete o.defaultValue;let u=!1;if(i[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(i[1])){const d=i[1].split(this.formatSeparator).map(f=>f.trim());i[1]=d.shift(),a=d,u=!0}if(s=n(l.call(this,i[1].trim(),o),o),s&&i[0]===t&&!M(s))return s;M(s)||(s=ac(s)),s||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${t}`),s=""),u&&(s=a.reduce((d,f)=>this.format(d,f,r.lng,{...r,interpolationkey:i[1].trim()}),s.trim())),t=t.replace(i[0],s),this.regexp.lastIndex=0}return t}}const jv=e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const i=r[1].substring(0,r[1].length-1);t==="currency"&&i.indexOf(":")<0?n.currency||(n.currency=i.trim()):t==="relativetime"&&i.indexOf(":")<0?n.range||(n.range=i.trim()):i.split(";").forEach(o=>{if(o){const[l,...a]=o.split(":"),u=a.join(":").trim().replace(/^'+|'+$/g,""),d=l.trim();n[d]||(n[d]=u),u==="false"&&(n[d]=!1),u==="true"&&(n[d]=!0),isNaN(u)||(n[d]=parseInt(u,10))}})}return{formatName:t,formatOptions:n}},On=e=>{const t={};return(n,r,i)=>{let s=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(s={...s,[i.interpolationkey]:void 0});const o=r+JSON.stringify(s);let l=t[o];return l||(l=e(Cs(r),i),t[o]=l),l(n)}};class Mv{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=it.create("formatter"),this.options=t,this.formats={number:On((n,r)=>{const i=new Intl.NumberFormat(n,{...r});return s=>i.format(s)}),currency:On((n,r)=>{const i=new Intl.NumberFormat(n,{...r,style:"currency"});return s=>i.format(s)}),datetime:On((n,r)=>{const i=new Intl.DateTimeFormat(n,{...r});return s=>i.format(s)}),relativetime:On((n,r)=>{const i=new Intl.RelativeTimeFormat(n,{...r});return s=>i.format(s,r.range||"day")}),list:On((n,r)=>{const i=new Intl.ListFormat(n,{...r});return s=>i.format(s)})},this.init(t)}init(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};this.formatSeparator=n.interpolation.formatSeparator||","}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=On(n)}format(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const s=n.split(this.formatSeparator);if(s.length>1&&s[0].indexOf("(")>1&&s[0].indexOf(")")<0&&s.find(l=>l.indexOf(")")>-1)){const l=s.findIndex(a=>a.indexOf(")")>-1);s[0]=[s[0],...s.splice(1,l)].join(this.formatSeparator)}return s.reduce((l,a)=>{const{formatName:u,formatOptions:d}=jv(a);if(this.formats[u]){let f=l;try{const c=i&&i.formatParams&&i.formatParams[i.interpolationkey]||{},y=c.locale||c.lng||i.locale||i.lng||r;f=this.formats[u](l,y,{...d,...i,...c})}catch(c){this.logger.warn(c)}return f}else this.logger.warn(`there was no format function for ${u}`);return l},t)}}const Dv=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class Av extends Ws{constructor(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=t,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=i,this.logger=it.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(r,i.backend,i)}queueLoad(t,n,r,i){const s={},o={},l={},a={};return t.forEach(u=>{let d=!0;n.forEach(f=>{const c=`${u}|${f}`;!r.reload&&this.store.hasResourceBundle(u,f)?this.state[c]=2:this.state[c]<0||(this.state[c]===1?o[c]===void 0&&(o[c]=!0):(this.state[c]=1,d=!1,o[c]===void 0&&(o[c]=!0),s[c]===void 0&&(s[c]=!0),a[f]===void 0&&(a[f]=!0)))}),d||(l[u]=!0)}),(Object.keys(s).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(s),pending:Object.keys(o),toLoadLanguages:Object.keys(l),toLoadNamespaces:Object.keys(a)}}loaded(t,n,r){const i=t.split("|"),s=i[0],o=i[1];n&&this.emit("failedLoading",s,o,n),!n&&r&&this.store.addResourceBundle(s,o,r,void 0,void 0,{skipCopy:!0}),this.state[t]=n?-1:2,n&&r&&(this.state[t]=0);const l={};this.queue.forEach(a=>{yv(a.loaded,[s],o),Dv(a,t),n&&a.errors.push(n),a.pendingCount===0&&!a.done&&(Object.keys(a.loaded).forEach(u=>{l[u]||(l[u]={});const d=a.loaded[u];d.length&&d.forEach(f=>{l[u][f]===void 0&&(l[u][f]=!0)})}),a.done=!0,a.errors.length?a.callback(a.errors):a.callback())}),this.emit("loaded",l),this.queue=this.queue.filter(a=>!a.done)}read(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,o=arguments.length>5?arguments[5]:void 0;if(!t.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:r,tried:i,wait:s,callback:o});return}this.readingCalls++;const l=(u,d)=>{if(this.readingCalls--,this.waitingReads.length>0){const f=this.waitingReads.shift();this.read(f.lng,f.ns,f.fcName,f.tried,f.wait,f.callback)}if(u&&d&&i<this.maxRetries){setTimeout(()=>{this.read.call(this,t,n,r,i+1,s*2,o)},s);return}o(u,d)},a=this.backend[r].bind(this.backend);if(a.length===2){try{const u=a(t,n);u&&typeof u.then=="function"?u.then(d=>l(null,d)).catch(l):l(null,u)}catch(u){l(u)}return}return a(t,n,l)}prepareLoading(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();M(t)&&(t=this.languageUtils.toResolveHierarchy(t)),M(n)&&(n=[n]);const s=this.queueLoad(t,n,r,i);if(!s.toLoad.length)return s.pending.length||i(),null;s.toLoad.forEach(o=>{this.loadOne(o)})}load(t,n,r){this.prepareLoading(t,n,{},r)}reload(t,n,r){this.prepareLoading(t,n,{reload:!0},r)}loadOne(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const r=t.split("|"),i=r[0],s=r[1];this.read(i,s,"read",void 0,void 0,(o,l)=>{o&&this.logger.warn(`${n}loading namespace ${s} for language ${i} failed`,o),!o&&l&&this.logger.log(`${n}loaded namespace ${s} for language ${i}`,l),this.loaded(t,o,l)})}saveMissing(t,n,r,i,s){let o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},l=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(n)){this.logger.warn(`did not save key "${r}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if(this.backend&&this.backend.create){const a={...o,isUpdate:s},u=this.backend.create.bind(this.backend);if(u.length<6)try{let d;u.length===5?d=u(t,n,r,i,a):d=u(t,n,r,i),d&&typeof d.then=="function"?d.then(f=>l(null,f)).catch(l):l(null,d)}catch(d){l(d)}else u(t,n,r,i,l,a)}!t||!t[0]||this.store.addResource(t[0],n,r,i)}}}const yc=()=>({debug:!1,initImmediate:!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:e=>{let t={};if(typeof e[1]=="object"&&(t=e[1]),M(e[1])&&(t.defaultValue=e[1]),M(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const n=e[3]||e[2];Object.keys(n).forEach(r=>{t[r]=n[r]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),vc=e=>(M(e.ns)&&(e.ns=[e.ns]),M(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),M(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e),_i=()=>{},_v=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})};class si extends Ws{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(super(),this.options=vc(t),this.services={},this.logger=it,this.modules={external:[]},_v(this),n&&!this.isInitialized&&!t.isClone){if(!this.options.initImmediate)return this.init(t,n),this;setTimeout(()=>{this.init(t,n)},0)}}init(){var t=this;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof n=="function"&&(r=n,n={}),!n.defaultNS&&n.defaultNS!==!1&&n.ns&&(M(n.ns)?n.defaultNS=n.ns:n.ns.indexOf("translation")<0&&(n.defaultNS=n.ns[0]));const i=yc();this.options={...i,...this.options,...vc(n)},this.options.compatibilityAPI!=="v1"&&(this.options.interpolation={...i.interpolation,...this.options.interpolation}),n.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=n.keySeparator),n.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=n.nsSeparator);const s=d=>d?typeof d=="function"?new d:d:null;if(!this.options.isClone){this.modules.logger?it.init(s(this.modules.logger),this.options):it.init(null,this.options);let d;this.modules.formatter?d=this.modules.formatter:typeof Intl<"u"&&(d=Mv);const f=new hc(this.options);this.store=new fc(this.options.resources,this.options);const c=this.services;c.logger=it,c.resourceStore=this.store,c.languageUtils=f,c.pluralResolver=new Iv(f,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),d&&(!this.options.interpolation.format||this.options.interpolation.format===i.interpolation.format)&&(c.formatter=s(d),c.formatter.init(c,this.options),this.options.interpolation.format=c.formatter.format.bind(c.formatter)),c.interpolator=new Fv(this.options),c.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},c.backendConnector=new Av(s(this.modules.backend),c.resourceStore,c,this.options),c.backendConnector.on("*",function(y){for(var w=arguments.length,v=new Array(w>1?w-1:0),S=1;S<w;S++)v[S-1]=arguments[S];t.emit(y,...v)}),this.modules.languageDetector&&(c.languageDetector=s(this.modules.languageDetector),c.languageDetector.init&&c.languageDetector.init(c,this.options.detection,this.options)),this.modules.i18nFormat&&(c.i18nFormat=s(this.modules.i18nFormat),c.i18nFormat.init&&c.i18nFormat.init(this)),this.translator=new Ts(this.services,this.options),this.translator.on("*",function(y){for(var w=arguments.length,v=new Array(w>1?w-1:0),S=1;S<w;S++)v[S-1]=arguments[S];t.emit(y,...v)}),this.modules.external.forEach(y=>{y.init&&y.init(this)})}if(this.format=this.options.interpolation.format,r||(r=_i),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const d=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);d.length>0&&d[0]!=="dev"&&(this.options.lng=d[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(d=>{this[d]=function(){return t.store[d](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(d=>{this[d]=function(){return t.store[d](...arguments),t}});const a=Pr(),u=()=>{const d=(f,c)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),a.resolve(c),r(f,c)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return d(null,this.t.bind(this));this.changeLanguage(this.options.lng,d)};return this.options.resources||!this.options.initImmediate?u():setTimeout(u,0),a}loadResources(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:_i;const i=M(t)?t:this.language;if(typeof t=="function"&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if(i&&i.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const s=[],o=l=>{if(!l||l==="cimode")return;this.services.languageUtils.toResolveHierarchy(l).forEach(u=>{u!=="cimode"&&s.indexOf(u)<0&&s.push(u)})};i?o(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(a=>o(a)),this.options.preload&&this.options.preload.forEach(l=>o(l)),this.services.backendConnector.load(s,this.options.ns,l=>{!l&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(l)})}else r(null)}reloadResources(t,n,r){const i=Pr();return typeof t=="function"&&(r=t,t=void 0),typeof n=="function"&&(r=n,n=void 0),t||(t=this.languages),n||(n=this.options.ns),r||(r=_i),this.services.backendConnector.reload(t,n,s=>{i.resolve(),r(s)}),i}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&mp.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1))for(let n=0;n<this.languages.length;n++){const r=this.languages[n];if(!(["cimode","dev"].indexOf(r)>-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}}changeLanguage(t,n){var r=this;this.isLanguageChangingTo=t;const i=Pr();this.emit("languageChanging",t);const s=a=>{this.language=a,this.languages=this.services.languageUtils.toResolveHierarchy(a),this.resolvedLanguage=void 0,this.setResolvedLanguage(a)},o=(a,u)=>{u?(s(u),this.translator.changeLanguage(u),this.isLanguageChangingTo=void 0,this.emit("languageChanged",u),this.logger.log("languageChanged",u)):this.isLanguageChangingTo=void 0,i.resolve(function(){return r.t(...arguments)}),n&&n(a,function(){return r.t(...arguments)})},l=a=>{!t&&!a&&this.services.languageDetector&&(a=[]);const u=M(a)?a:this.services.languageUtils.getBestMatchFromCodes(a);u&&(this.language||s(u),this.translator.language||this.translator.changeLanguage(u),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(u)),this.loadResources(u,d=>{o(d,u)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?l(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(l):this.services.languageDetector.detect(l):l(t),i}getFixedT(t,n,r){var i=this;const s=function(o,l){let a;if(typeof l!="object"){for(var u=arguments.length,d=new Array(u>2?u-2:0),f=2;f<u;f++)d[f-2]=arguments[f];a=i.options.overloadTranslationOptionHandler([o,l].concat(d))}else a={...l};a.lng=a.lng||s.lng,a.lngs=a.lngs||s.lngs,a.ns=a.ns||s.ns,a.keyPrefix!==""&&(a.keyPrefix=a.keyPrefix||r||s.keyPrefix);const c=i.options.keySeparator||".";let y;return a.keyPrefix&&Array.isArray(o)?y=o.map(w=>`${a.keyPrefix}${c}${w}`):y=a.keyPrefix?`${a.keyPrefix}${c}${o}`:o,i.t(y,a)};return M(t)?s.lng=t:s.lngs=t,s.ns=n,s.keyPrefix=r,s}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};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 r=n.lng||this.resolvedLanguage||this.languages[0],i=this.options?this.options.fallbackLng:!1,s=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const o=(l,a)=>{const u=this.services.backendConnector.state[`${l}|${a}`];return u===-1||u===0||u===2};if(n.precheck){const l=n.precheck(this,o);if(l!==void 0)return l}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||o(r,t)&&(!i||o(s,t)))}loadNamespaces(t,n){const r=Pr();return this.options.ns?(M(t)&&(t=[t]),t.forEach(i=>{this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}),this.loadResources(i=>{r.resolve(),n&&n(i)}),r):(n&&n(),Promise.resolve())}loadLanguages(t,n){const r=Pr();M(t)&&(t=[t]);const i=this.options.preload||[],s=t.filter(o=>i.indexOf(o)<0&&this.services.languageUtils.isSupportedCode(o));return s.length?(this.options.preload=i.concat(s),this.loadResources(o=>{r.resolve(),n&&n(o)}),r):(n&&n(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!t)return"rtl";const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=this.services&&this.services.languageUtils||new hc(yc());return n.indexOf(r.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new si(t,n)}cloneInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:_i;const r=t.forkResourceStore;r&&delete t.forkResourceStore;const i={...this.options,...t,isClone:!0},s=new si(i);return(t.debug!==void 0||t.prefix!==void 0)&&(s.logger=s.logger.clone(t)),["store","services","language"].forEach(l=>{s[l]=this[l]}),s.services={...this.services},s.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},r&&(s.store=new fc(this.store.data,i),s.services.resourceStore=s.store),s.translator=new Ts(s.services,i),s.translator.on("*",function(l){for(var a=arguments.length,u=new Array(a>1?a-1:0),d=1;d<a;d++)u[d-1]=arguments[d];s.emit(l,...u)}),s.init(i,n),s.translator.options=i,s.translator.backendConnector.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},s}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const le=si.createInstance();le.createInstance=si.createInstance;le.createInstance;le.dir;le.init;le.loadResources;le.reloadResources;le.use;le.changeLanguage;le.getFixedT;le.t;le.exists;le.setDefaultNamespace;le.hasLoadedNamespace;le.loadNamespaces;le.loadLanguages;const zv={zh:{translation:{app:{title:"cc-gw 控制台",skipToContent:"跳转到主要内容"},nav:{dashboard:"仪表盘",logs:"请求日志",models:"模型管理",apiKeys:"API 密钥",settings:"设置",help:"使用指南",about:"关于"},language:{zh:"简体中文",en:"English"},common:{loading:"加载中...",loadingShort:"加载中...",noData:"暂无数据",languageSelector:"语言选择",actions:{refresh:"刷新",refreshing:"刷新中...",manualRefresh:"手动刷新",reset:"重置",close:"关闭",openNavigation:"打开导航",closeNavigation:"关闭导航",save:"保存设置",saving:"保存中...",cancel:"取消",copy:"复制",testConnection:"测试连接",testingConnection:"测试中...",cleanup:"清理历史日志",cleaning:"清理中...",checkUpdates:"检查更新"},theme:{label:"主题",light:"亮色",dark:"暗色",system:"跟随系统"},status:{success:"成功",error:"失败"},notifications:{featureInProgress:"功能开发中,敬请期待。"},units:{request:"次",ms:"ms",token:"Tokens",msPerToken:"ms/Token"}},dashboard:{description:"快速了解请求规模与实时运行状态。",filters:{endpoint:"端点筛选",endpointAll:"全部端点",endpointAnthropic:"anthropic",endpointOpenAI:"openai"},status:{listening:"监听:{{host}}:{{port}}",providers:"Provider 数量:{{value}}",todayRequests:"今日请求:{{value}}",active:"活动请求:{{value}}",dbSize:"数据库:{{value}}"},toast:{overviewError:"统计数据获取失败",dailyError:"趋势数据获取失败",modelError:"模型统计获取失败",statusError:"状态信息获取失败",dbError:"数据库信息获取失败",recentError:"最近请求获取失败"},cards:{todayRequests:"今日请求数",todayInput:"今日输入 Tokens",todayOutput:"今日输出 Tokens",avgLatency:"平均响应耗时"},charts:{requestsTitle:"请求趋势",requestsDesc:"最近 14 天请求与 Token 走势",modelTitle:"模型调用分布",modelDesc:"近 7 天不同模型的调用次数与 Token 走势",barRequests:"请求数",lineInput:"输入 Tokens",lineOutput:"输出 Tokens",axisTokens:"Tokens",ttftLabel:"TTFT(ms)",tpotLabel:"TPOT(ms/Token)",ttftTitle:"TTFT 模型对比",ttftDesc:"比较不同模型的首 Token 耗时 (TTFT)",ttftEmpty:"暂无 TTFT 数据。",tpotTitle:"TPOT 模型对比",tpotDesc:"比较不同模型的平均 Token 耗时 (TPOT)",tpotEmpty:"暂无 TPOT 数据。",ttftAxis:"TTFT (ms)",tpotAxis:"TPOT (ms/Token)",empty:"暂无数据"},recent:{title:"最新请求",subtitle:"仅展示最近 {{count}} 条记录",loading:"加载中...",empty:"暂无请求记录",routePlaceholder:"未指定",columns:{time:"时间",endpoint:"端点",provider:"Provider",route:"路由",latency:"耗时(ms)",status:"状态"}},modelTable:{title:"模型性能摘要",description:"统计每个后端模型的请求数、平均耗时、TTFT 与 TPOT。",empty:"暂无模型统计数据。",columns:{model:"Provider/模型",requests:"请求数",latency:"平均耗时",ttft:"TTFT",tpot:"TPOT"}}},logs:{title:"请求日志",description:"查看近期请求,支持筛选 Provider、模型、成功状态及时间范围。",summary:{total:"记录总数:{{value}}"},filters:{provider:"Provider",providerAll:"全部 Provider",endpoint:"请求端点",endpointAll:"全部端点",endpointAnthropic:"anthropic",endpointOpenAI:"openai",apiKey:"API Key",apiKeyHint:"可多选,不选择时将展示全部密钥。",modelId:"模型 ID",modelPlaceholder:"如 deepseek-chat",status:"状态",statusAll:"全部",statusSuccess:"成功",statusError:"失败",startDate:"起始日期",endDate:"结束日期",apiKeyAll:"全部密钥",apiKeySelected:"{{count}} 个已选"},actions:{manualRefresh:"手动刷新",refreshing:"刷新中...",detail:"详情"},table:{loading:"正在加载日志...",empty:"未找到符合条件的日志记录。",requestedModelFallback:"未指定",apiKeyUnknown:"未知密钥",columns:{time:"时间",endpoint:"端点",provider:"Provider",requestedModel:"请求模型",routedModel:"路由模型",apiKey:"API Key",inputTokens:"输入 Tokens",cachedTokens:"缓存 Tokens",outputTokens:"输出 Tokens",stream:"Stream",latency:"耗时(ms)",ttft:"TTFT(ms)",tpot:"TPOT(ms/Token)",status:"状态",error:"错误信息",actions:"操作"},pagination:{perPage:"每页",unit:"条",previous:"上一页",next:"下一页",pageLabel:"第 {{page}} / {{total}} 页"}},endpointAnthropic:"anthropic",endpointOpenAI:"openai",toast:{listError:{title:"日志获取失败",desc:"错误信息:{{message}}"},providerError:{title:"Provider 列表获取失败",desc:"错误信息:{{message}}"}},stream:{streaming:"流式",single:"单次"},detail:{title:"日志详情",id:"ID #{{id}}",infoSection:"基本信息",info:{time:"时间",sessionId:"Session ID",endpoint:"端点",provider:"Provider",requestedModel:"请求模型",noRequestedModel:"未指定",model:"路由模型",stream:"Stream",latency:"耗时",status:"状态",inputTokens:"输入 Tokens",cachedTokens:"缓存 Tokens",outputTokens:"输出 Tokens",ttft:"TTFT (首 Token 耗时)",tpot:"TPOT (平均 ms/Token)",error:"错误信息"},summary:{route:"{{from}} → {{to}}",latency:"耗时:{{value}}",ttft:"TTFT:{{value}}",tpot:"TPOT:{{value}}",stream:"Stream:{{value}}"},payload:{request:"请求体",response:"响应体",emptyRequest:"暂无请求内容",emptyResponse:"暂无响应内容"},apiKey:{title:"密钥信息",name:"密钥名称",identifier:"密钥 ID",masked:"掩码展示",maskedUnavailable:"暂无掩码信息",raw:"原始密钥",rawUnavailable:"未记录原始密钥",missing:"未记录",lastUsed:"最后使用"},copy:{requestSuccess:"请求体已复制到剪贴板。",responseSuccess:"响应体已复制到剪贴板。",keySuccess:"API 密钥已复制到剪贴板。",empty:"{{label}}为空,无法复制。",failure:"复制失败",failureFallback:"无法复制内容,请稍后再试。"},loadError:"无法加载日志详情。"}},providers:{title:"模型提供商",description:"管理集成的模型服务,查看默认模型及支持能力。",emptyState:"暂无 Provider,请点击“新增提供商”以开始配置。",count:"已配置:{{count}} 个 Provider",toast:{createSuccess:"已添加 Provider:{{name}}",updateSuccess:"已更新 Provider:{{name}}",testSuccess:"Provider 连通性检查通过。",testSuccessDesc:"状态:{{status}} · 耗时:{{duration}}",testFailure:"Provider 连通性检查失败:{{message}}",loadFailure:"获取配置失败:{{message}}",deleteSuccess:"已删除 Provider:{{name}}",deleteFailure:"删除 Provider 失败:{{message}}"},actions:{add:"新增提供商",refresh:"刷新",refreshing:"刷新中...",edit:"编辑",delete:"删除",test:"测试连接"},quickAddHuawei:{button:"一键添加华为云模型",title:"一键添加华为云模型",description:"输入 API Key 即可快速添加华为云 DeepSeek V3.1、KIMI-K2 与 Qwen3-235B-A22B 模型。",apiKeyLabel:"API Key",apiKeyPlaceholder:"请输入华为云 API Key",note:"完成后可在提供商列表中查看并进一步调整配置。",submit:"添加",providerLabel:"华为云",validation:{apiKey:"请填写 API Key"},toast:{success:"已添加华为云模型",added:"已添加 {{name}}",failure:"添加失败,请稍后重试"}},card:{defaultModel:"默认模型:{{model}}",noDefault:"未设置默认模型",modelsTitle:"支持模型",noModels:"尚未配置模型。"},drawer:{createTitle:"新增 Provider",editTitle:"编辑 Provider",description:"配置基础信息与模型列表。",modelsDescription:"维护支持的模型列表。",defaultHint:"当前默认模型:{{model}}",fields:{id:"Provider ID",idPlaceholder:"如 openai",label:"显示名称",labelPlaceholder:"如 OpenAI 官方",baseUrl:"Base URL",baseUrlPlaceholder:"https://api.example.com/v1",type:"Provider 类型",apiKey:"API Key(可选)",apiKeyPlaceholder:"可留空以从环境变量读取",authMode:"认证方式",authModeHint:"Claude Code 可使用 Token 或 API Key,选择后填写对应值。",authModeApiKey:"使用 API Key(x-api-key)",authModeAuthToken:"使用 Auth Token(Authorization: Bearer)",models:"模型配置",showAdvanced:"显示高级选项",hideAdvanced:"隐藏高级选项",addModel:"新增模型",modelId:"模型 ID",modelIdPlaceholder:"如 claude-sonnet-4-5-20250929",modelLabel:"显示名称(可选)",modelLabelPlaceholder:"如 GPT-4 旗舰",setDefault:"设为默认模型",removeModel:"删除模型"},errors:{idRequired:"请填写 Provider ID",idDuplicate:"该 Provider ID 已存在",baseUrlInvalid:"Base URL 格式无效",modelsRequired:"请至少配置一个模型",modelInvalid:"模型 ID 不可为空或重复",defaultInvalid:"默认模型必须在模型列表中"},toast:{saveFailure:"保存失败:{{message}}"}},confirm:{delete:"确认删除 Provider「{{name}}」?"}},modelManagement:{title:"模型管理",description:"统一维护模型提供商配置与模型路由映射。",tabs:{providers:"模型提供商",providersDesc:"配置上游模型提供商以及认证信息。",anthropic:"Anthropic 路由",anthropicDesc:"管理 /anthropic 端点的模型映射和默认配置。",openai:"OpenAI 路由",openaiDesc:"管理 /openai 端点的模型映射和默认配置。"},actions:{saveRoutes:"保存路由"},routing:{selectTarget:"请选择目标 Provider:模型"},toast:{routesSaved:"模型路由已更新。",routesSaveFailure:"保存模型路由失败:{{message}}"}},settings:{title:"系统设置",description:"调整网关端口、日志策略及其他运行参数。",toast:{loadFailure:"配置加载失败:{{message}}",saveSuccess:"系统配置已更新。",saveFailure:"保存失败:{{message}}",copySuccess:"配置文件路径已复制到剪贴板。",copyFailure:"复制失败:{{message}}",cleanupSuccess:"已删除 {{count}} 条历史日志。",cleanupNone:"没有需要删除的日志。",cleanupFailure:"清理失败:{{message}}",clearAllSuccess:"日志已清空(请求 {{logs}} 条,统计 {{metrics}} 条)。",clearAllFailure:"清空失败:{{message}}",missingConfig:"未能加载配置,请刷新或稍后再试。"},sections:{basics:"基础配置",routing:"模型路由",configFile:"配置文件",cleanup:"日志清理"},fields:{port:"监听端口",host:"监听地址(可选)",hostPlaceholder:"默认 0.0.0.0",retention:"日志保留天数",defaults:"默认模型配置",storePayloads:"保存请求/响应内容",storePayloadsHint:"关闭后仅记录元数据,可减少磁盘占用。",logLevel:"日志级别",logLevelOption:{fatal:"致命 (fatal)",error:"错误 (error)",warn:"警告 (warn)",info:"信息 (info)",debug:"调试 (debug)",trace:"跟踪 (trace)"},requestLogging:"输出访问日志",requestLoggingHint:"关闭后将不再在终端打印每个请求的访问日志。",responseLogging:"输出响应日志",responseLoggingHint:"关闭后将不再输出请求完成时的日志。"},validation:{port:"请输入 1-65535 之间的端口号",retention:"日志保留天数需为 1-365 之间的数字",routePair:"请填写完整的来源模型与目标模型配置。",routeDuplicate:"模型 {{model}} 已存在映射,请勿重复配置。"},defaults:{completion:"对话:{{model}}",reasoning:"推理:{{model}}",background:"后台:{{model}}",none:"未设置默认模型"},routing:{title:"模型路由映射",description:"为 Claude Code 发起的模型请求指定实际 Provider 与模型 ID(如将 claude 系列映射至 Kimi)。如需禁用映射,可留空或移除。",titleByEndpoint:"{{endpoint}} 路由配置",descriptionByEndpoint:{anthropic:"当 Claude Code 通过 /anthropic 端点请求特定模型时,将根据此映射选择目标 Provider 与模型。",openai:"当 Codex 通过 /openai 端点请求特定模型时,将根据此映射选择目标 Provider 与模型。"},add:"新增映射",empty:"尚未配置映射,系统将使用默认模型策略。",sourceLabel:"来源模型",sourcePlaceholder:"如 claude-sonnet-4-5-20250929",targetLabel:"目标 Provider:模型",targetPlaceholder:"如 kimi:kimi-k2-0905-preview",customTargetOption:"自定义目标…",remove:"移除",suggested:"常用 Anthropic 模型"},file:{description:"当前配置存储在本地文件,可通过编辑该文件进行离线修改。",unknown:"未知路径"},cleanup:{description:"立即清理早于当前保留天数的日志记录。",clearAll:"彻底清空",clearingAll:"清空中...",clearAllWarning:"该操作会删除所有日志记录及日统计数据,请谨慎操作。"}},help:{title:"使用指南",intro:"本页汇总了如何通过 Web UI 完成配置与日常运维,帮助新接入者快速上手 cc-gw。",note:"所有变更都会实时写入 ~/.cc-gw/config.json,并立即影响正在运行的网关;建议通过 Web UI 完成常规操作,CLI 仅用于启动/重启。",sections:{configuration:{title:"一、初始配置",items:["在“系统设置”中确认监听地址、端口以及日志策略,并视需要开启或关闭请求/响应日志。","前往“模型管理 → 模型提供商”添加上游 Provider,填写 Base URL、API Key、默认模型等信息。","使用“测试连接”按钮验证 Provider 是否可用;如果失败,请检查网络连通性与密钥权限。","在“模型管理 → 路由配置”中为 /anthropic 与 /openai 端点指定目标模型,保存后立即生效。","在 IDE 中配置接入:Claude Code(含 VS Code 插件)统一设置 Base URL=http://127.0.0.1:4100/anthropic,客户端会自动附加 /v1/messages?beta=true;Codex 指向 http://127.0.0.1:4100/openai/v1,并使用 cc-gw 生成的 API Key。"]},usage:{title:"二、日常使用",items:["Dashboard 提供实时请求量、Token、缓存命中以及 TTFT/TPOT 指标,便于了解服务运行状况。","“请求日志”支持多维度筛选,并可查看完整的请求/响应 Payload,适合排查联调问题。","“模型管理”可以快速切换默认模型或更新路由映射,适合 IDE / 自动化场景的随时切换。","“系统设置”中可调整日志保留天数、Payload 存储策略以及日志输出级别。"]},tips:{title:"三、实用技巧",items:["开启“保存请求/响应内容”后,可在日志详情中复制原始 Payload,定位上游兼容性问题。","分别关闭“访问日志”或“响应日志”可降低终端噪声,同时仍保留数据库与统计数据。","若手动修改配置文件后 UI 未更新,可使用“系统设置”页的刷新按钮或重启 cc-gw。"]}},faq:{title:"常见问题",items:[{q:"如何切换不同端点的默认模型?",a:"在“模型管理 → 路由配置”中分别选择 /anthropic 与 /openai 的默认模型并保存,即可立即生效。"},{q:"为什么日志里没有缓存命中数据?",a:"需要上游模型返回 cached_tokens 或 input_tokens_details.cached_tokens 字段,确认 Provider 已启用相关功能。"}]}},about:{title:"关于",description:"查看 cc-gw 的版本信息、构建元数据与运行状态。",app:{title:"应用信息",labels:{name:"名称",version:"版本",buildTime:"构建时间",node:"Node 版本"}},status:{title:"运行状态",loading:"正在获取运行状态...",empty:"未能获取状态信息。",labels:{host:"监听地址",port:"监听端口",providers:"已配置 Provider",active:"活动请求"}},support:{title:"使用提示",subtitle:"运行维护说明",description:"通过 Web UI 管理 Provider、模型路由与日志,高级配置可直接编辑 ~/.cc-gw/config.json。",actions:{checkUpdates:"检查更新"}},toast:{statusError:{title:"状态加载失败"},updatesPlanned:"检查更新功能将在后续版本提供。"}},apiKeys:{title:"API 密钥管理",description:"创建和管理用于访问网关的 API 密钥",createNew:"创建新密钥",createAction:"创建",createDescription:"创建一个新的 API 密钥用于身份验证,可选填写密钥描述。",descriptionLabel:"密钥描述(可选)",keyDescriptionPlaceholder:"例如:仅供内部测试环境使用",keyNamePlaceholder:"输入密钥名称",keyCreated:"API 密钥已创建",saveKeyWarning:"这是唯一一次看到完整密钥的机会,请妥善保存!",wildcard:"通配符",wildcardHint:"启用该密钥后,任何自定义密钥与空密钥都可以通过认证;如需限制访问,可随时禁用该密钥。",status:{enabled:"已启用",disabled:"已禁用"},actions:{enable:"启用",disable:"禁用",delete:"删除"},created:"创建时间",lastUsed:"最后使用",requestCount:"请求次数",totalTokens:"总令牌数",confirmDelete:"确定要删除此 API 密钥吗?此操作无法撤销。",errors:{nameRequired:"密钥名称不能为空"},analytics:{title:"密钥使用分析",description:"展示最近 {{days}} 天的密钥调用情况",range:{today:"今日",week:"近 7 天",month:"近 30 天"},cards:{total:"总密钥数",enabled:"启用密钥",active:"活跃密钥({{days}} 天)"},charts:{requests:"按密钥的请求次数(Top 10)",tokens:"按密钥的 Token 消耗(Top 10)"},tokens:{input:"输入 Token",output:"输出 Token"},requestsSeries:"请求次数",empty:"所选时间范围内暂无统计数据。",unknownKey:"未知密钥"},list:{title:"密钥列表",empty:"尚未创建 API 密钥,点击右上角按钮开始创建。"},toast:{keyCreated:"API 密钥创建成功",keyUpdated:"API 密钥已更新",keyDeleted:"API 密钥已删除",keyCopied:"密钥已复制到剪贴板",createFailure:"创建失败:{{message}}",updateFailure:"更新失败:{{message}}",deleteFailure:"删除失败:{{message}}"}}}},en:{translation:{app:{title:"cc-gw Console",skipToContent:"Skip to main content"},nav:{dashboard:"Dashboard",logs:"Logs",models:"Model Management",apiKeys:"API Keys",settings:"Settings",help:"Help",about:"About"},language:{zh:"Simplified Chinese",en:"English"},common:{loading:"Loading...",loadingShort:"Loading...",noData:"No data available",languageSelector:"Language selector",actions:{refresh:"Refresh",refreshing:"Refreshing...",manualRefresh:"Manual refresh",reset:"Reset",close:"Close",openNavigation:"Open navigation",closeNavigation:"Close navigation",save:"Save changes",saving:"Saving...",cancel:"Cancel",copy:"Copy",testConnection:"Test connection",testingConnection:"Testing...",cleanup:"Clean up logs",cleaning:"Cleaning...",checkUpdates:"Check for updates"},theme:{label:"Theme",light:"Light",dark:"Dark",system:"System"},status:{success:"Success",error:"Error"},notifications:{featureInProgress:"Feature under development. Stay tuned!"},units:{request:"req",ms:"ms",token:"tokens",msPerToken:"ms/token"}},dashboard:{description:"Monitor request volume and runtime health at a glance.",filters:{endpoint:"Endpoint",endpointAll:"All endpoints",endpointAnthropic:"anthropic",endpointOpenAI:"openai"},status:{listening:"Listening: {{host}}:{{port}}",providers:"Providers: {{value}}",todayRequests:"Requests today: {{value}}",active:"Active requests: {{value}}",dbSize:"Database: {{value}}"},toast:{overviewError:"Failed to load overview metrics",dailyError:"Failed to load trend metrics",modelError:"Failed to load model statistics",statusError:"Failed to load gateway status",dbError:"Failed to load database info",recentError:"Failed to load recent requests"},cards:{todayRequests:"Requests Today",todayInput:"Input Tokens Today",todayOutput:"Output Tokens Today",avgLatency:"Average Latency"},charts:{requestsTitle:"Request Trends",requestsDesc:"Requests and token usage over the last 14 days",modelTitle:"Model Distribution",modelDesc:"Requests and tokens by model in the past 7 days",barRequests:"Requests",lineInput:"Input tokens",lineOutput:"Output tokens",axisTokens:"Tokens",ttftLabel:"TTFT (ms)",tpotLabel:"TPOT (ms/token)",ttftTitle:"TTFT Comparison",ttftDesc:"Compare first-token latency (TTFT) across models",ttftEmpty:"No TTFT data available.",tpotTitle:"TPOT Comparison",tpotDesc:"Compare per-token latency (TPOT) across models",tpotEmpty:"No TPOT data available.",ttftAxis:"TTFT (ms)",tpotAxis:"TPOT (ms/token)",empty:"No data"},recent:{title:"Recent Requests",subtitle:"Showing the latest {{count}} records",loading:"Loading...",empty:"No recent requests",routePlaceholder:"Not specified",columns:{time:"Time",endpoint:"Endpoint",provider:"Provider",route:"Route",latency:"Latency (ms)",status:"Status"}},modelTable:{title:"Model Performance Snapshot",description:"Requests, average latency, TTFT, and TPOT by downstream model.",empty:"No model statistics available.",columns:{model:"Provider/Model",requests:"Requests",latency:"Avg Latency",ttft:"TTFT",tpot:"TPOT"}}},logs:{title:"Request Logs",description:"Inspect recent traffic with provider/model/status filters and date range.",summary:{total:"Total records: {{value}}"},filters:{provider:"Provider",providerAll:"All providers",endpoint:"Endpoint",endpointAll:"All endpoints",endpointAnthropic:"anthropic",endpointOpenAI:"openai",apiKey:"API Key",apiKeyHint:"Select one or more keys; leave empty to include all.",modelId:"Model ID",modelPlaceholder:"e.g. deepseek-chat",status:"Status",statusAll:"All",statusSuccess:"Success",statusError:"Error",startDate:"Start date",endDate:"End date",apiKeyAll:"All keys",apiKeySelected:"{{count}} selected"},actions:{manualRefresh:"Manual refresh",refreshing:"Refreshing...",detail:"Detail"},table:{loading:"Loading logs...",empty:"No records match the current filters.",requestedModelFallback:"Not specified",apiKeyUnknown:"Unknown key",columns:{time:"Time",endpoint:"Endpoint",provider:"Provider",requestedModel:"Requested model",routedModel:"Routed model",apiKey:"API Key",inputTokens:"Input Tokens",cachedTokens:"Cached Tokens",outputTokens:"Output Tokens",stream:"Stream",latency:"Latency (ms)",ttft:"TTFT (ms)",tpot:"TPOT (ms/token)",status:"Status",error:"Error",actions:"Actions"},pagination:{perPage:"per page",unit:"items",previous:"Previous",next:"Next",pageLabel:"Page {{page}} / {{total}}"}},endpointAnthropic:"anthropic",endpointOpenAI:"openai",stream:{streaming:"Streaming",single:"Non-streaming"},toast:{listError:{title:"Failed to fetch logs",desc:"Error: {{message}}"},providerError:{title:"Failed to fetch providers",desc:"Error: {{message}}"}},detail:{title:"Log Detail",id:"ID #{{id}}",infoSection:"Overview",info:{time:"Time",sessionId:"Session ID",endpoint:"Endpoint",provider:"Provider",requestedModel:"Requested model",noRequestedModel:"Not specified",model:"Routed model",stream:"Stream",latency:"Latency",status:"Status",inputTokens:"Input Tokens",cachedTokens:"Cached Tokens",outputTokens:"Output Tokens",ttft:"TTFT (first token latency)",tpot:"TPOT (avg ms/token)",error:"Error"},summary:{route:"{{from}} → {{to}}",latency:"Latency: {{value}}",ttft:"TTFT: {{value}}",tpot:"TPOT: {{value}}",stream:"Stream: {{value}}"},payload:{request:"Request body",response:"Response body",emptyRequest:"No request content",emptyResponse:"No response content"},apiKey:{title:"API key",name:"Key name",identifier:"Key ID",masked:"Masked form",maskedUnavailable:"No mask available",raw:"Raw key",rawUnavailable:"Raw key not stored",missing:"Not recorded",lastUsed:"Last used"},copy:{requestSuccess:"Request body copied to clipboard.",responseSuccess:"Response body copied to clipboard.",keySuccess:"API key copied to clipboard.",empty:"Cannot copy empty {{label}}.",failure:"Copy failed",failureFallback:"Unable to copy content. Please try again later."},loadError:"Unable to load log detail."}},providers:{title:"Model Providers",description:"Manage integrated services and default models.",emptyState:'No providers yet. Click "Add provider" to get started.',count:"{{count}} providers configured",toast:{createSuccess:"Provider added: {{name}}",updateSuccess:"Provider updated: {{name}}",testSuccess:"Connection test succeeded.",testSuccessDesc:"HTTP {{status}} · {{duration}} elapsed",testFailure:"Connection test failed: {{message}}",loadFailure:"Failed to load config: {{message}}",deleteSuccess:"Provider removed: {{name}}",deleteFailure:"Failed to remove provider: {{message}}"},actions:{add:"Add provider",refresh:"Refresh",refreshing:"Refreshing...",edit:"Edit",delete:"Delete",test:"Test connection"},quickAddHuawei:{button:"Quick add Huawei models",title:"Quick add Huawei models",description:"Provide the API key to automatically configure Huawei Cloud DeepSeek V3.1, KIMI-K2, and Qwen3-235B-A22B.",apiKeyLabel:"API Key",apiKeyPlaceholder:"Enter your Huawei Cloud API Key",note:"You can further adjust settings from the provider list after creation.",submit:"Add provider",providerLabel:"Huawei Cloud",validation:{apiKey:"API Key is required"},toast:{success:"Huawei provider added",added:"{{name}} added successfully",failure:"Failed to add provider. Please try again later."}},card:{defaultModel:"Default model: {{model}}",noDefault:"No default model",modelsTitle:"Supported models",noModels:"No models configured yet."},drawer:{createTitle:"Add Provider",editTitle:"Edit Provider",description:"Configure base settings and model list.",modelsDescription:"Maintain supported models.",defaultHint:"Current default model: {{model}}",fields:{id:"Provider ID",idPlaceholder:"e.g. openai",label:"Display name",labelPlaceholder:"e.g. OpenAI Official",baseUrl:"Base URL",baseUrlPlaceholder:"https://api.example.com/v1",type:"Provider type",apiKey:"API Key (optional)",apiKeyPlaceholder:"Leave blank to read from environment",authMode:"Authentication mode",authModeHint:"Claude Code can authenticate with either an API key (x-api-key) or an auth token (Authorization: Bearer).",authModeApiKey:"Use API Key (x-api-key)",authModeAuthToken:"Use Auth Token (Authorization: Bearer)",models:"Model configuration",showAdvanced:"Show advanced options",hideAdvanced:"Hide advanced options",addModel:"Add model",modelId:"Model ID",modelIdPlaceholder:"e.g. claude-sonnet-4-5-20250929",modelLabel:"Display name (optional)",modelLabelPlaceholder:"e.g. GPT-4 Flagship",setDefault:"Set as default",removeModel:"Remove model"},errors:{idRequired:"Provider ID is required",idDuplicate:"Provider ID already exists",baseUrlInvalid:"Invalid Base URL",modelsRequired:"Configure at least one model",modelInvalid:"Model IDs must be unique and non-empty",defaultInvalid:"Default model must exist in the list"},toast:{saveFailure:"Save failed: {{message}}"}},confirm:{delete:"Remove provider “{{name}}”?"}},modelManagement:{title:"Model Management",description:"Configure providers and maintain model routing rules in one place.",tabs:{providers:"Providers",providersDesc:"Manage upstream providers and authentication.",anthropic:"Anthropic Routing",anthropicDesc:"Control mappings for the /anthropic endpoint.",openai:"OpenAI Routing",openaiDesc:"Control mappings for the /openai endpoint."},actions:{saveRoutes:"Save routes"},routing:{selectTarget:"Select provider:model"},toast:{routesSaved:"Model routes updated successfully.",routesSaveFailure:"Failed to save model routes: {{message}}"}},settings:{title:"System Settings",description:"Adjust gateway port, log retention, and runtime parameters.",toast:{loadFailure:"Failed to load config: {{message}}",saveSuccess:"Settings saved successfully.",saveFailure:"Save failed: {{message}}",copySuccess:"Config path copied to clipboard.",copyFailure:"Copy failed: {{message}}",cleanupSuccess:"{{count}} old logs removed.",cleanupNone:"No logs met the cleanup criteria.",cleanupFailure:"Cleanup failed: {{message}}",clearAllSuccess:"All logs cleared ({{logs}} requests, {{metrics}} daily rows).",clearAllFailure:"Full wipe failed: {{message}}",missingConfig:"Configuration not available. Refresh and try again."},sections:{basics:"Basic configuration",routing:"Model routing",configFile:"Configuration file",cleanup:"Log cleanup"},fields:{port:"Listen port",host:"Listen host (optional)",hostPlaceholder:"Defaults to 0.0.0.0",retention:"Log retention days",defaults:"Default models",storePayloads:"Store request & response bodies",storePayloadsHint:"Disable to keep only metadata and save disk space.",logLevel:"Log level",logLevelOption:{fatal:"Fatal",error:"Error",warn:"Warn",info:"Info",debug:"Debug",trace:"Trace"},requestLogging:"Emit request logs",requestLoggingHint:"Disable to stop printing each HTTP request in the console.",responseLogging:"Emit response logs",responseLoggingHint:"Disable to stop printing completion logs for each HTTP request."},validation:{port:"Enter a port between 1 and 65535",retention:"Retention days must be between 1 and 365",routePair:"Fill both the source and target models.",routeDuplicate:"A route for {{model}} already exists."},defaults:{completion:"Conversation: {{model}}",reasoning:"Reasoning: {{model}}",background:"Background: {{model}}",none:"No defaults configured"},routing:{title:"Model routing map",description:"Override Claude Code model requests with provider:model targets (e.g., map Claude to Kimi). Leave empty to fall back to defaults.",titleByEndpoint:"{{endpoint}} routing",descriptionByEndpoint:{anthropic:"Requests hitting the /anthropic endpoint will use these mappings.",openai:"Requests hitting the /openai endpoint will use these mappings."},add:"Add route",empty:"No custom routes configured. Default strategy will be used.",sourceLabel:"Source model",sourcePlaceholder:"e.g. claude-sonnet-4-5-20250929",targetLabel:"Target provider:model",targetPlaceholder:"e.g. kimi:kimi-k2-0905-preview",customTargetOption:"Custom target…",remove:"Remove",suggested:"Anthropic presets"},file:{description:"Configuration is stored locally; edit the file for offline adjustments.",unknown:"Unknown path"},cleanup:{description:"Immediately purge logs older than the retention window.",clearAll:"Clear everything",clearingAll:"Clearing…",clearAllWarning:"Deletes every log entry and daily metric. This cannot be undone."}},help:{title:"Help & Guidance",intro:"This page summarises how to configure cc-gw via the Web UI and how to operate it day to day.",note:"Changes are written to ~/.cc-gw/config.json immediately. Prefer editing through the Web UI; use the CLI mainly to start or restart the daemon.",sections:{configuration:{title:"1. Initial setup",items:["Review “Settings” to confirm the listening host/port and decide whether to emit request or response access logs.","Open “Model Management → Providers” to add upstream providers, including base URL, API key, and default model.","Click “Test connection” to ensure the provider is reachable. If it fails, double-check network access and API key permissions.","Configure “Model Management → Routing” for both /anthropic and /openai endpoints, then save to apply immediately.","Point your IDEs to the gateway: set `http://127.0.0.1:4100/anthropic` for both the Claude CLI and VS Code extension (they append `/v1/messages?beta=true` automatically), and target `http://127.0.0.1:4100/openai/v1` for Codex; authenticate with a cc-gw API key."]},usage:{title:"2. Daily usage",items:["Use the dashboard to keep an eye on request volume, token usage, cache hits, and TTFT/TPOT trends.","“Request Logs” provides rich filters plus full payload replay for debugging client/provider compatibility issues.","“Model Management” lets you switch defaults or update mappings without redeploying IDE extensions or automation scripts.","“Settings” controls log retention, payload storage, and log verbosity to suit your operations."]},tips:{title:"3. Practical tips",items:["Enable “Store request/response bodies” to copy raw payloads from the log drawer when troubleshooting.","Turn off request or response logs individually to keep the console quiet while preserving metrics and database records.","If you edit ~/.cc-gw/config.json manually, refresh the Settings page or restart cc-gw so the UI reflects the latest configuration."]}},faq:{title:"Frequently asked questions",items:[{q:"How can I change the default model for each endpoint?",a:"Go to “Model Management → Routing” and choose defaults for /anthropic and /openai. Saving applies the change right away."},{q:"Why are cached token numbers missing?",a:"Upstream providers must return cached_tokens or input_tokens_details.cached_tokens. Enable cache metrics on the provider if supported."}]}},apiKeys:{title:"API Keys Management",description:"Create and manage API keys for gateway access",createNew:"Create New Key",createAction:"Create",createDescription:"Create a new API key for authentication and optionally add a description.",descriptionLabel:"Key description (optional)",keyDescriptionPlaceholder:"e.g. Internal staging access only",keyNamePlaceholder:"Enter key name",keyCreated:"API Key Created",saveKeyWarning:"This is the only time you'll see the full key. Save it securely!",wildcard:"Any Key",wildcardHint:"When enabled, any custom key — including an empty key — is accepted. Disable this key to enforce strict authentication.",status:{enabled:"Enabled",disabled:"Disabled"},actions:{enable:"Enable",disable:"Disable",delete:"Delete"},created:"Created",lastUsed:"Last Used",requestCount:"Requests",totalTokens:"Total Tokens",confirmDelete:"Are you sure you want to delete this API key? This action cannot be undone.",errors:{nameRequired:"Key name is required"},analytics:{title:"Key Usage Analytics",description:"Highlights for the past {{days}} days of API key activity",range:{today:"Today",week:"Last 7 days",month:"Last 30 days"},cards:{total:"Total keys",enabled:"Enabled keys",active:"Active keys ({{days}} days)"},charts:{requests:"Top 10 keys by request count",tokens:"Top 10 keys by token usage"},tokens:{input:"Input tokens",output:"Output tokens"},requestsSeries:"Requests",empty:"No activity for the selected range.",unknownKey:"Unknown key"},list:{title:"Key Inventory",empty:"No API keys found. Use the button above to create one."},toast:{keyCreated:"API key created successfully",keyUpdated:"API key updated successfully",keyDeleted:"API key deleted successfully",keyCopied:"Key copied to clipboard",createFailure:"Failed to create: {{message}}",updateFailure:"Failed to update: {{message}}",deleteFailure:"Failed to delete: {{message}}"}},about:{title:"About",description:"Review cc-gw version details, build metadata, and current runtime status.",app:{title:"Application",labels:{name:"Name",version:"Version",buildTime:"Build time",node:"Node version"}},status:{title:"Runtime status",loading:"Fetching status...",empty:"Unable to retrieve status information.",labels:{host:"Listen host",port:"Listen port",providers:"Providers configured",active:"Active requests"}},support:{title:"Operational notes",subtitle:"Maintenance guidance",description:"Manage providers, routing, and logs in the Web UI; advanced settings live in ~/.cc-gw/config.json.",actions:{checkUpdates:"Check for updates"}},toast:{statusError:{title:"Failed to load status"},updatesPlanned:"Update checks will arrive in a future release."}}}}};le.isInitialized||le.use(yy).init({resources:zv,lng:"zh",fallbackLng:"en",interpolation:{escapeValue:!1}});const gp=x.createContext(void 0);function Uv(){return`toast_${Math.random().toString(36).slice(2)}`}function bv({children:e}){const[t,n]=x.useState([]),r=x.useCallback(o=>{n(l=>l.filter(a=>a.id!==o))},[]),i=x.useCallback(o=>{const l=o.id??Uv();n(u=>[...u,{...o,id:l}]);const a=o.durationMs??3e3;a>0&&setTimeout(()=>r(l),a)},[r]),s=x.useMemo(()=>({toasts:t,pushToast:i,dismissToast:r}),[t,r,i]);return L.jsxs(gp.Provider,{value:s,children:[e,L.jsx("div",{className:"fixed right-6 top-6 z-50 flex w-80 flex-col gap-3",children:t.map(o=>L.jsx("div",{className:`rounded-md border border-slate-200 bg-white p-4 shadow-lg dark:border-slate-700 dark:bg-slate-800 ${o.variant==="error"?"border-red-200 bg-red-50 text-red-900 dark:border-red-700 dark:bg-red-900/40 dark:text-red-200":o.variant==="success"?"border-emerald-200 bg-emerald-50 text-emerald-900 dark:border-emerald-700 dark:bg-emerald-900/40 dark:text-emerald-200":""}`,children:L.jsxs("div",{className:"flex items-start justify-between gap-4",children:[L.jsxs("div",{children:[L.jsx("p",{className:"text-sm font-semibold",children:o.title}),o.description?L.jsx("p",{className:"mt-1 text-sm opacity-75",children:o.description}):null]}),L.jsx("button",{type:"button",className:"text-sm text-slate-500 hover:text-slate-900 dark:text-slate-400 dark:hover:text-slate-100",onClick:()=>r(o.id),children:"×"})]})},o.id))})]})}function t0(){const e=x.useContext(gp);if(!e)throw new Error("useToast must be used within ToastProvider");return e}function $v({children:e}){const[t]=x.useState(()=>new pv);return L.jsx(hv,{client:t,children:L.jsx(Sy,{i18n:le,children:L.jsx(Dy,{children:L.jsx(bv,{children:e})})})})}function Kv(){const{t:e}=mi();return L.jsx("div",{className:"flex h-full items-center justify-center p-12",role:"status","aria-live":"polite",children:L.jsxs("div",{className:"flex flex-col items-center gap-4",children:[L.jsx("div",{className:"h-12 w-12 animate-spin rounded-full border-4 border-primary border-t-transparent"}),L.jsx("p",{className:"text-sm text-slate-500 dark:text-slate-400",children:e("common.loading")})]})})}const Vv=x.lazy(()=>Cn(()=>import("./Dashboard-DtlXibMw.js"),__vite__mapDeps([0,1,2]))),Bv=x.lazy(()=>Cn(()=>import("./Logs-BePSHk5K.js"),__vite__mapDeps([3,2]))),wc=x.lazy(()=>Cn(()=>import("./ModelManagement-elB5p1yK.js"),__vite__mapDeps([4,2]))),Hv=x.lazy(()=>Cn(()=>import("./ApiKeys-iCkTrMfd.js"),__vite__mapDeps([5,1,2]))),Qv=x.lazy(()=>Cn(()=>import("./Settings-r15dRAJv.js"),__vite__mapDeps([6,2]))),qv=x.lazy(()=>Cn(()=>import("./About-BkmW2Z_P.js"),__vite__mapDeps([7,2]))),Wv=x.lazy(()=>Cn(()=>import("./Help-CuCYVmBi.js"),[]));function Gv(){return L.jsx($v,{children:L.jsx(Yg,{basename:typeof window<"u"&&window.location.pathname.startsWith("/ui")?"/ui":"/",children:L.jsx(x.Suspense,{fallback:L.jsx(Kv,{}),children:L.jsx(Vg,{children:L.jsxs(Xe,{path:"/",element:L.jsx($y,{}),children:[L.jsx(Xe,{index:!0,element:L.jsx(Vv,{})}),L.jsx(Xe,{path:"logs",element:L.jsx(Bv,{})}),L.jsx(Xe,{path:"models",element:L.jsx(wc,{})}),L.jsx(Xe,{path:"providers",element:L.jsx(wc,{})}),L.jsx(Xe,{path:"api-keys",element:L.jsx(Hv,{})}),L.jsx(Xe,{path:"settings",element:L.jsx(Qv,{})}),L.jsx(Xe,{path:"about",element:L.jsx(qv,{})}),L.jsx(Xe,{path:"help",element:L.jsx(Wv,{})})]})})})})})}const yp=document.getElementById("root");if(!yp)throw new Error("Root element #root not found");Lo.createRoot(yp).render(L.jsx(Uc.StrictMode,{children:L.jsx(Gv,{})}));export{Ly as K,Kv as L,Uc as R,Qs as S,t0 as a,Wm as b,Je as c,Wy as d,Ll as e,Qy as f,Sp as g,Tl as h,qs as i,L as j,up as k,lv as l,Yy as m,Ke as n,ve as o,tv as p,Zv as q,x as r,Yv as s,qy as t,mi as u,e0 as v,Xv as w};
|