@chenpu17/cc-gw 0.2.3 → 0.2.5
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/README.md +23 -13
- package/package.json +1 -1
- package/src/web/dist/assets/{About-ChfDc2NI.js → About-B7UuxVKg.js} +1 -1
- package/src/web/dist/assets/{Dashboard-CDJyyn7X.js → Dashboard-Bvkc9Nqm.js} +1 -1
- package/src/web/dist/assets/{Logs-D05vFMv1.js → Logs-D1s40rEu.js} +1 -1
- package/src/web/dist/assets/ModelManagement-j5J5TDOy.js +1 -0
- package/src/web/dist/assets/{Settings-DAYDEvz0.js → Settings-CgAFUZes.js} +1 -1
- package/src/web/dist/assets/{index-B82tYC06.js → index-B_Unl5wz.js} +2 -2
- package/src/web/dist/assets/{useApiQuery-BKzEW-RR.js → useApiQuery-DZqtpbk3.js} +1 -1
- package/src/web/dist/index.html +1 -1
- package/src/web/dist/assets/ModelManagement-B3YFArK5.js +0 -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-Bvkc9Nqm.js","assets/useApiQuery-DZqtpbk3.js","assets/Logs-D1s40rEu.js","assets/ModelManagement-j5J5TDOy.js","assets/Settings-CgAFUZes.js","assets/About-B7UuxVKg.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
var yp=Object.defineProperty;var Na=e=>{throw TypeError(e)};var wp=(e,t,n)=>t in e?yp(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 S=(e,t,n)=>(Js(e,t,"read from private field"),n?n.call(e):t.get(e)),z=(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 yi=(e,t,n,r)=>({set _(i){j(e,t,i,n)},get _(){return S(e,t,r)}});function Sp(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 xp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Oc={exports:{}},Ls={},Rc={exports:{}},_={};/**
|
|
3
3
|
* @license React
|
|
4
4
|
* react.production.min.js
|
|
@@ -120,4 +120,4 @@ Error generating stack: `+s.message+`
|
|
|
120
120
|
*
|
|
121
121
|
* This source code is licensed under the ISC license.
|
|
122
122
|
* See the LICENSE file in the root directory of this source tree.
|
|
123
|
-
*/const Ju=vt("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Yu="cc-gw-theme",op=k.createContext(void 0);function Iv(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 jv({children:e}){const[t,n]=k.useState(()=>{if(typeof window>"u")return"system";const s=window.localStorage.getItem(Yu);return s==="light"||s==="dark"||s==="system"?s:"system"}),r=k.useMemo(()=>typeof window<"u"?Iv(t):"light",[t]);k.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]),k.useEffect(()=>{typeof window>"u"||(Xu(r),window.localStorage.setItem(Yu,t))},[t,r]);const i=k.useMemo(()=>({mode:t,resolved:r,setMode:n}),[t,r]);return L.jsx(op.Provider,{value:i,children:e})}function Mv(){const e=k.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 Dv(){var l;const{mode:e,setMode:t,resolved:n}=Mv(),{t:r}=mi(),[i,s]=k.useState(!1),o=n==="dark"?L.jsx(Ov,{size:16,"aria-hidden":"true"}):L.jsx(Fv,{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 _v=[{code:"zh",labelKey:"language.zh"},{code:"en",labelKey:"language.en"}];function zv(){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:_v.map(n=>L.jsx("option",{value:n.code,children:t(n.labelKey)},n.code))})}const Av=[{to:"/",icon:Pv,labelKey:"nav.dashboard"},{to:"/logs",icon:Tv,labelKey:"nav.logs"},{to:"/models",icon:Lv,labelKey:"nav.models"},{to:"/settings",icon:Rv,labelKey:"nav.settings"},{to:"/about",icon:Ev,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:Av.map(n=>{const r=n.icon;return L.jsxs(tv,{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 $v(){const{t:e}=mi(),t=pr(),[n,r]=k.useState(!1);return k.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(Nv,{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(zv,{}),L.jsx(Dv,{})]})]}),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(bg,{})})]}),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(){}},Uv={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Lt,Fl,Sc,bv=(Sc=class{constructor(){z(this,Lt,Uv);z(this,Fl,!1)}setTimeoutProvider(e){j(this,Lt,e)}setTimeout(e,t){return S(this,Lt).setTimeout(e,t)}clearTimeout(e){S(this,Lt).clearTimeout(e)}setInterval(e,t){return S(this,Lt).setInterval(e,t)}clearInterval(e){S(this,Lt).clearInterval(e)}},Lt=new WeakMap,Fl=new WeakMap,Sc),Tl=new bv;function Vv(e){setTimeout(e,0)}var Ws=typeof window>"u"||"Deno"in globalThis;function Ve(){}function Bv(e,t){return typeof e=="function"?e(t):e}function Kv(e){return typeof e=="number"&&e>=0&&e!==1/0}function Hv(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ll(e,t){return typeof e=="function"?e(t):e}function Qv(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(!ri(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(ni(t.options.mutationKey)!==ni(s))return!1}else if(!ri(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)||ni)(e)}function ni(e){return JSON.stringify(e,(t,n)=>Nl(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function ri(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>ri(e[n],t[n])):!1}var Wv=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:Wv.call(e,d))&&a++;continue}if(f===null||c===null||typeof f!="object"||typeof c!="object"){l[d]=c;continue}const v=lp(f,c);l[d]=v,v===f&&a++}return i===o&&a===i?e:l}function Wy(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 qv(e){return new Promise(t=>{Tl.setTimeout(t,e)})}function Gv(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?lp(e,t):t}function qy(e){return e}function Jv(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function Yv(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 Gy(e,t){return typeof e=="function"?e(...t):!!e}var an,Nt,Wn,xc,Xv=(xc=class extends Qs{constructor(){super();z(this,an);z(this,Nt);z(this,Wn);j(this,Wn,t=>{if(!Ws&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){S(this,Nt)||this.setEventListener(S(this,Wn))}onUnsubscribe(){var t;this.hasListeners()||((t=S(this,Nt))==null||t.call(this),j(this,Nt,void 0))}setEventListener(t){var n;j(this,Wn,t),(n=S(this,Nt))==null||n.call(this),j(this,Nt,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){S(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 S(this,an)=="boolean"?S(this,an):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},an=new WeakMap,Nt=new WeakMap,Wn=new WeakMap,xc),up=new Xv;function Zv(){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 ey=Vv;function ty(){let e=[],t=0,n=l=>{l()},r=l=>{l()},i=ey;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 ye=ty(),qn,Ot,Gn,kc,ny=(kc=class extends Qs{constructor(){super();z(this,qn,!0);z(this,Ot);z(this,Gn);j(this,Gn,t=>{if(!Ws&&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(){S(this,Ot)||this.setEventListener(S(this,Gn))}onUnsubscribe(){var t;this.hasListeners()||((t=S(this,Ot))==null||t.call(this),j(this,Ot,void 0))}setEventListener(t){var n;j(this,Gn,t),(n=S(this,Ot))==null||n.call(this),j(this,Ot,t(this.setOnline.bind(this)))}setOnline(t){S(this,qn)!==t&&(j(this,qn,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return S(this,qn)}},qn=new WeakMap,Ot=new WeakMap,Gn=new WeakMap,kc),ks=new ny;function ry(e){return Math.min(1e3*2**e,3e4)}function cp(e){return(e??"online")==="online"?ks.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=Zv(),s=()=>i.status!=="pending",o=y=>{var x;if(!s()){const h=new Ol(y);c(h),(x=e.onCancel)==null||x.call(e,h)}},l=()=>{t=!0},a=()=>{t=!1},u=()=>up.isFocused()&&(e.networkMode==="always"||ks.isOnline())&&e.canRun(),d=()=>cp(e.networkMode)&&e.canRun(),f=y=>{s()||(r==null||r(),i.resolve(y))},c=y=>{s()||(r==null||r(),i.reject(y))},v=()=>new Promise(y=>{var x;r=h=>{(s()||u())&&y(h)},(x=e.onPause)==null||x.call(e)}).then(()=>{var y;r=void 0,s()||(y=e.onContinue)==null||y.call(e)}),w=()=>{if(s())return;let y;const x=n===0?e.initialPromise:void 0;try{y=x??e.fn()}catch(h){y=Promise.reject(h)}Promise.resolve(y).then(f).catch(h=>{var P;if(s())return;const p=e.retry??(Ws?0:3),m=e.retryDelay??ry,g=typeof m=="function"?m(n,h):m,C=p===!0||typeof p=="number"&&n<p||typeof p=="function"&&p(n,h);if(t||!C){c(h);return}n++,(P=e.onFail)==null||P.call(e,n,h),qv(g).then(()=>u()?void 0:v()).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():v().then(w),i)}}var un,Cc,fp=(Cc=class{constructor(){z(this,un)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Kv(this.gcTime)&&j(this,un,Tl.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Ws?1/0:5*60*1e3))}clearGcTimeout(){S(this,un)&&(Tl.clearTimeout(S(this,un)),j(this,un,void 0))}},un=new WeakMap,Cc),cn,Jn,je,dn,ie,si,fn,Be,st,Pc,iy=(Pc=class extends fp{constructor(t){super();z(this,Be);z(this,cn);z(this,Jn);z(this,je);z(this,dn);z(this,ie);z(this,si);z(this,fn);j(this,fn,!1),j(this,si,t.defaultOptions),this.setOptions(t.options),this.observers=[],j(this,dn,t.client),j(this,je,S(this,dn).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,j(this,cn,sc(this.options)),this.state=t.state??S(this,cn),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=S(this,ie))==null?void 0:t.promise}setOptions(t){if(this.options={...S(this,si),...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"&&S(this,je).remove(this)}setData(t,n){const r=Gv(this.state.data,t,this.options);return de(this,Be,st).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,Be,st).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,i;const n=(r=S(this,ie))==null?void 0:r.promise;return(i=S(this,ie))==null||i.cancel(t),n?n.then(Ve).catch(Ve):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(S(this,cn))}isActive(){return this.observers.some(t=>Qv(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:!Hv(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=S(this,ie))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=S(this,ie))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),S(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||(S(this,ie)&&(S(this,fn)?S(this,ie).cancel({revert:!0}):S(this,ie).cancelRetry()),this.scheduleGc()),S(this,je).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||de(this,Be,st).call(this,{type:"invalidate"})}async fetch(t,n){var a,u,d,f,c,v,w,y,x,h,p,m;if(this.state.fetchStatus!=="idle"&&((a=S(this,ie))==null?void 0:a.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(S(this,ie))return S(this,ie).continueRetry(),S(this,ie).promise}if(t&&this.setOptions(t),!this.options.queryFn){const g=this.observers.find(C=>C.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),P=(()=>{const E={client:S(this,dn),queryKey:this.queryKey,meta:this.meta};return i(E),E})();return j(this,fn,!1),this.options.persister?this.options.persister(g,P,this):g(P)},l=(()=>{const g={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:S(this,dn),state:this.state,fetchFn:s};return i(g),g})();(u=this.options.behavior)==null||u.onFetch(l,this),j(this,Jn,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=l.fetchOptions)==null?void 0:d.meta))&&de(this,Be,st).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({...S(this,Jn),fetchStatus:"idle"}),r.abort()},onFail:(g,C)=>{de(this,Be,st).call(this,{type:"failed",failureCount:g,error:C})},onPause:()=>{de(this,Be,st).call(this,{type:"pause"})},onContinue:()=>{de(this,Be,st).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0}));try{const g=await S(this,ie).start();if(g===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(g),(v=(c=S(this,je).config).onSuccess)==null||v.call(c,g,this),(y=(w=S(this,je).config).onSettled)==null||y.call(w,g,this.state.error,this),g}catch(g){if(g instanceof Ol){if(g.silent)return S(this,ie).promise;if(g.revert){if(this.state.data===void 0)throw g;return this.state.data}}throw de(this,Be,st).call(this,{type:"error",error:g}),(h=(x=S(this,je).config).onError)==null||h.call(x,g,this),(m=(p=S(this,je).config).onSettled)==null||m.call(p,this.state.data,g,this),g}finally{this.scheduleGc()}}},cn=new WeakMap,Jn=new WeakMap,je=new WeakMap,dn=new WeakMap,ie=new WeakMap,si=new WeakMap,fn=new WeakMap,Be=new WeakSet,st=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,...sy(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,Jn,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),ye.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),S(this,je).notify({query:this,type:"updated",action:t})})},Pc);function sy(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,v,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=((v=t.state.data)==null?void 0:v.pages)||[],o=((w=t.state.data)==null?void 0:w.pageParams)||[];let l={pages:[],pageParams:[]},a=0;const u=async()=>{let y=!1;const x=m=>{Object.defineProperty(m,"signal",{enumerable:!0,get:()=>(t.signal.aborted?y=!0:t.signal.addEventListener("abort",()=>{y=!0}),t.signal)})},h=ap(t.options,t.fetchOptions),p=async(m,g,C)=>{if(y)return Promise.reject();if(g==null&&m.pages.length)return Promise.resolve(m);const E=(()=>{const b={client:t.client,queryKey:t.queryKey,pageParam:g,direction:C?"backward":"forward",meta:t.options.meta};return x(b),b})(),O=await h(E),{maxPages:$}=t.options,F=C?Yv:Jv;return{pages:F(m.pages,O,$),pageParams:F(m.pageParams,g,$)}};if(i&&s.length){const m=i==="backward",g=m?oy:lc,C={pages:s,pageParams:o},P=g(r,C);l=await p(C,P,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 y,x;return(x=(y=t.options).persister)==null?void 0:x.call(y,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 oy(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 oi,Xe,ge,pn,Ze,kt,Ec,ly=(Ec=class extends fp{constructor(t){super();z(this,Ze);z(this,oi);z(this,Xe);z(this,ge);z(this,pn);j(this,oi,t.client),this.mutationId=t.mutationId,j(this,ge,t.mutationCache),j(this,Xe,[]),this.state=t.state||ay(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){S(this,Xe).includes(t)||(S(this,Xe).push(t),this.clearGcTimeout(),S(this,ge).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){j(this,Xe,S(this,Xe).filter(n=>n!==t)),this.scheduleGc(),S(this,ge).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){S(this,Xe).length||(this.state.status==="pending"?this.scheduleGc():S(this,ge).remove(this))}continue(){var t;return((t=S(this,pn))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,l,a,u,d,f,c,v,w,y,x,h,p,m,g,C,P,E,O,$;const n=()=>{de(this,Ze,kt).call(this,{type:"continue"})},r={client:S(this,oi),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:(F,b)=>{de(this,Ze,kt).call(this,{type:"failed",failureCount:F,error:b})},onPause:()=>{de(this,Ze,kt).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>S(this,ge).canRun(this)}));const i=this.state.status==="pending",s=!S(this,pn).canStart();try{if(i)n();else{de(this,Ze,kt).call(this,{type:"pending",variables:t,isPaused:s}),await((l=(o=S(this,ge).config).onMutate)==null?void 0:l.call(o,t,this,r));const b=await((u=(a=this.options).onMutate)==null?void 0:u.call(a,t,r));b!==this.state.context&&de(this,Ze,kt).call(this,{type:"pending",context:b,variables:t,isPaused:s})}const F=await S(this,pn).start();return await((f=(d=S(this,ge).config).onSuccess)==null?void 0:f.call(d,F,t,this.state.context,this,r)),await((v=(c=this.options).onSuccess)==null?void 0:v.call(c,F,t,this.state.context,r)),await((y=(w=S(this,ge).config).onSettled)==null?void 0:y.call(w,F,null,this.state.variables,this.state.context,this,r)),await((h=(x=this.options).onSettled)==null?void 0:h.call(x,F,null,t,this.state.context,r)),de(this,Ze,kt).call(this,{type:"success",data:F}),F}catch(F){try{throw await((m=(p=S(this,ge).config).onError)==null?void 0:m.call(p,F,t,this.state.context,this,r)),await((C=(g=this.options).onError)==null?void 0:C.call(g,F,t,this.state.context,r)),await((E=(P=S(this,ge).config).onSettled)==null?void 0:E.call(P,void 0,F,this.state.variables,this.state.context,this,r)),await(($=(O=this.options).onSettled)==null?void 0:$.call(O,void 0,F,t,this.state.context,r)),F}finally{de(this,Ze,kt).call(this,{type:"error",error:F})}}finally{S(this,ge).runNext(this)}}},oi=new WeakMap,Xe=new WeakMap,ge=new WeakMap,pn=new WeakMap,Ze=new WeakSet,kt=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),ye.batch(()=>{S(this,Xe).forEach(r=>{r.onMutationUpdate(t)}),S(this,ge).notify({mutation:this,type:"updated",action:t})})},Ec);function ay(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var at,Ke,li,Tc,uy=(Tc=class extends Qs{constructor(t={}){super();z(this,at);z(this,Ke);z(this,li);this.config=t,j(this,at,new Set),j(this,Ke,new Map),j(this,li,0)}build(t,n,r){const i=new ly({client:t,mutationCache:this,mutationId:++yi(this,li)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){S(this,at).add(t);const n=_i(t);if(typeof n=="string"){const r=S(this,Ke).get(n);r?r.push(t):S(this,Ke).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(S(this,at).delete(t)){const n=_i(t);if(typeof n=="string"){const r=S(this,Ke).get(n);if(r)if(r.length>1){const i=r.indexOf(t);i!==-1&&r.splice(i,1)}else r[0]===t&&S(this,Ke).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=_i(t);if(typeof n=="string"){const r=S(this,Ke).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=_i(t);if(typeof n=="string"){const i=(r=S(this,Ke).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(){ye.batch(()=>{S(this,at).forEach(t=>{this.notify({type:"removed",mutation:t})}),S(this,at).clear(),S(this,Ke).clear()})}getAll(){return Array.from(S(this,at))}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){ye.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return ye.batch(()=>Promise.all(t.map(n=>n.continue().catch(Ve))))}},at=new WeakMap,Ke=new WeakMap,li=new WeakMap,Tc);function _i(e){var t;return(t=e.options.scope)==null?void 0:t.id}var et,Lc,cy=(Lc=class extends Qs{constructor(t={}){super();z(this,et);this.config=t,j(this,et,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 iy({client:t,queryKey:i,queryHash:s,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(o)),o}add(t){S(this,et).has(t.queryHash)||(S(this,et).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=S(this,et).get(t.queryHash);n&&(t.destroy(),n===t&&S(this,et).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){ye.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return S(this,et).get(t)}getAll(){return[...S(this,et).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){ye.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){ye.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){ye.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},et=new WeakMap,Lc),J,Rt,Ft,Yn,Xn,It,Zn,er,Nc,dy=(Nc=class{constructor(e={}){z(this,J);z(this,Rt);z(this,Ft);z(this,Yn);z(this,Xn);z(this,It);z(this,Zn);z(this,er);j(this,J,e.queryCache||new cy),j(this,Rt,e.mutationCache||new uy),j(this,Ft,e.defaultOptions||{}),j(this,Yn,new Map),j(this,Xn,new Map),j(this,It,0)}mount(){yi(this,It)._++,S(this,It)===1&&(j(this,Zn,up.subscribe(async e=>{e&&(await this.resumePausedMutations(),S(this,J).onFocus())})),j(this,er,ks.subscribe(async e=>{e&&(await this.resumePausedMutations(),S(this,J).onOnline())})))}unmount(){var e,t;yi(this,It)._--,S(this,It)===0&&((e=S(this,Zn))==null||e.call(this),j(this,Zn,void 0),(t=S(this,er))==null||t.call(this),j(this,er,void 0))}isFetching(e){return S(this,J).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return S(this,Rt).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=S(this,J).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=S(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 S(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=S(this,J).get(r.queryHash),s=i==null?void 0:i.state.data,o=Bv(t,s);if(o!==void 0)return S(this,J).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return ye.batch(()=>S(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=S(this,J).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=S(this,J);ye.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=S(this,J);return ye.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=ye.batch(()=>S(this,J).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(Ve).catch(Ve)}invalidateQueries(e,t={}){return ye.batch(()=>(S(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=ye.batch(()=>S(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(Ve)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(Ve)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=S(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(Ve).catch(Ve)}fetchInfiniteQuery(e){return e.behavior=oc(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Ve).catch(Ve)}ensureInfiniteQueryData(e){return e.behavior=oc(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return ks.isOnline()?S(this,Rt).resumePausedMutations():Promise.resolve()}getQueryCache(){return S(this,J)}getMutationCache(){return S(this,Rt)}getDefaultOptions(){return S(this,Ft)}setDefaultOptions(e){j(this,Ft,e)}setQueryDefaults(e,t){S(this,Yn).set(ni(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...S(this,Yn).values()],n={};return t.forEach(r=>{ri(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){S(this,Xn).set(ni(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...S(this,Xn).values()],n={};return t.forEach(r=>{ri(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...S(this,Ft).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:{...S(this,Ft).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){S(this,J).clear(),S(this,Rt).clear()}},J=new WeakMap,Rt=new WeakMap,Ft=new WeakMap,Yn=new WeakMap,Xn=new WeakMap,It=new WeakMap,Zn=new WeakMap,er=new WeakMap,Nc),pp=k.createContext(void 0),Jy=e=>{const t=k.useContext(pp);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},fy=({client:e,children:t})=>(k.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),L.jsx(pp.Provider,{value:e,children:t}));const M=e=>typeof e=="string",kr=()=>{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,py=(e,t,n)=>{e.forEach(r=>{t[r]&&(n[r]=t[r])})},hy=/###/g,uc=e=>e&&e.indexOf("###")>-1?e.replace(hy,"."):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},my=(e,t,n,r)=>{const{obj:i,k:s}=_r(e,t,Object);i[s]=i[s]||[],i[s].push(n)},Cs=(e,t)=>{const{obj:n,k:r}=_r(e,t);if(n)return n[r]},gy=(e,t,n)=>{const r=Cs(e,n);return r!==void 0?r:Cs(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},Ln=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var vy={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const yy=e=>M(e)?e.replace(/[&<>"'\/]/g,t=>vy[t]):e;class wy{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 Sy=[" ",",","?","!",";"],xy=new wy(20),ky=(e,t,n)=>{t=t||"",n=n||"";const r=Sy.filter(o=>t.indexOf(o)<0&&n.indexOf(o)<0);if(r.length===0)return!0;const i=xy.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},Ps=e=>e&&e.replace("_","-"),Cy={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||Cy,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 nt=new Es;class qs{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 qs{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=Cs(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=Cs(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 qs{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),py(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=nt.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&&!ky(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 v=f&&f.usedKey||o,w=f&&f.exactUsedKey||o,y=Object.prototype.toString.apply(c),x=["[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&&x.indexOf(y)<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(v,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),C=g?[]:{},P=g?w:v;for(const E in c)if(Object.prototype.hasOwnProperty.call(c,E)){const O=`${P}${s}${E}`;C[E]=this.translate(O,{...n,joinArrays:!1,ns:l}),C[E]===O&&(C[E]=c[E])}c=C}}else if(p&&M(h)&&Array.isArray(c))c=c.join(h),c&&(c=this.extendTranslation(c,t,n,r));else{let g=!1,C=!1;const P=n.count!==void 0&&!M(n.count),E=Ts.hasDefaultValue(n),O=P?this.pluralResolver.getSuffix(u,n.count,n):"",$=n.ordinal&&P?this.pluralResolver.getSuffix(u,n.count,{ordinal:!1}):"",F=P&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),b=F&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${O}`]||n[`defaultValue${$}`]||n.defaultValue;!this.isValidLookup(c)&&E&&(g=!0,c=b),this.isValidLookup(c)||(C=!0,c=o);const Xt=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&C?void 0:c,yt=E&&b!==c&&this.options.updateMissing;if(C||g||yt){if(this.logger.log(yt?"updateKey":"missingKey",u,a,o,yt?b: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 wt=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&wt&&wt[0])for(let N=0;N<wt.length;N++)Zt.push(wt[N]);else this.options.saveMissingTo==="all"?Zt=this.languageUtils.toResolveHierarchy(n.lng||this.language):Zt.push(n.lng||this.language);const En=(N,I,D)=>{const H=E&&D!==c?D:Xt;this.options.missingKeyHandler?this.options.missingKeyHandler(N,a,I,H,yt,n):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(N,a,I,H,yt,n),this.emit("missingKey",N,a,I,c)};this.options.saveMissing&&(this.options.saveMissingPlurals&&P?Zt.forEach(N=>{const I=this.pluralResolver.getSuffixes(N,n);F&&n[`defaultValue${this.options.pluralSeparator}zero`]&&I.indexOf(`${this.options.pluralSeparator}zero`)<0&&I.push(`${this.options.pluralSeparator}zero`),I.forEach(D=>{En([N],o+D,n[`defaultValue${D}`]||b)})}):En(Zt,o,b))}c=this.extendTranslation(c,t,n,f,r),C&&c===o&&this.options.appendNamespaceToMissingKey&&(c=`${a}:${o}`),(C||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),v=c&&c.length;d<v&&(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,v=new Array(c),w=0;w<c;w++)v[w]=arguments[w];return s&&s[0]===v[0]&&!r.context?(o.logger.warn(`It seems you are nesting recursively key: ${v[0]} in key: ${n[0]}`),null):o.translate(...v,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),v=c&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),w=n.context!==void 0&&(M(n.context)||typeof n.context=="number")&&n.context!=="",y=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);f.forEach(x=>{this.isValidLookup(r)||(l=x,!pc[`${y[0]}-${x}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(l)&&(pc[`${y[0]}-${x}`]=!0,this.logger.warn(`key "${i}" for languages "${y.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!!!")),y.forEach(h=>{if(this.isValidLookup(r))return;o=h;const p=[d];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(p,d,h,x,n);else{let g;c&&(g=this.pluralResolver.getSuffix(h,n.count,n));const C=`${this.options.pluralSeparator}zero`,P=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(c&&(p.push(d+g),n.ordinal&&g.indexOf(P)===0&&p.push(d+g.replace(P,this.options.pluralSeparator)),v&&p.push(d+C)),w){const E=`${d}${this.options.contextSeparator}${n.context}`;p.push(E),c&&(p.push(E+g),n.ordinal&&g.indexOf(P)===0&&p.push(E+g.replace(P,this.options.pluralSeparator)),v&&p.push(E+C))}}let m;for(;m=p.pop();)this.isValidLookup(r)||(s=m,r=this.getResource(h,x,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=nt.create("languageUtils")}getScriptPartFromCode(t){if(t=Ps(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=Ps(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 Py=[{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}],Ey={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 Ty=["v1","v2","v3"],Ly=["v4"],mc={zero:0,one:1,two:2,few:3,many:4,other:5},Ny=()=>{const e={};return Py.forEach(t=>{t.lngs.forEach(n=>{e[n]={numbers:t.nr,plurals:Ey[t.fc]}})}),e};class Oy{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=t,this.options=n,this.logger=nt.create("pluralResolver"),(!this.options.compatibilityJSON||Ly.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=Ny(),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=Ps(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!Ty.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=gy(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 Ry{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=nt.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:v,nestingSuffix:w,nestingSuffixEscaped:y,nestingOptionsSeparator:x,maxReplaces:h,alwaysFormat:p}=t.interpolation;this.escape=n!==void 0?n:yy,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=i!==void 0?i:!1,this.prefix=s?Ln(s):o||"{{",this.suffix=l?Ln(l):a||"}}",this.formatSeparator=u||",",this.unescapePrefix=d?"":f||"-",this.unescapeSuffix=this.unescapePrefix?"":d||"",this.nestingPrefix=c?Ln(c):v||Ln("$t("),this.nestingSuffix=w?Ln(w):y||Ln(")"),this.nestingOptionsSeparator=x||",",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=v=>{if(v.indexOf(this.formatSeparator)<0){const h=gc(n,a,v,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(h,void 0,r,{...i,...n,interpolationkey:v}):h}const w=v.split(this.formatSeparator),y=w.shift().trim(),x=w.join(this.formatSeparator).trim();return this.format(gc(n,a,y,this.options.keySeparator,this.options.ignoreJSONStructure),x,r,{...i,...n,interpolationkey:y})};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:v=>To(v)},{regex:this.regexp,safeValue:v=>this.escapeValue?To(this.escape(v)):To(v)}].forEach(v=>{for(l=0;s=v.regex.exec(t);){const w=s[1].trim();if(o=u(w),o===void 0)if(typeof d=="function"){const x=d(t,s,i);o=M(x)?x:""}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 y=v.safeValue(o);if(t=t.replace(s[0],y),f?(v.regex.lastIndex+=o.length,v.regex.lastIndex-=s[0].length):v.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 v=c.match(/'/g),w=c.match(/"/g);(v&&v.length%2===0&&!w||w.length%2!==0)&&(c=c.replace(/'/g,'"'));try{o=JSON.parse(c),u&&(o={...u,...o})}catch(y){return this.logger.warn(`failed parsing options string in nesting for key ${a}`,y),`${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 Fy=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}},Nn=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(Ps(r),i),t[o]=l),l(n)}};class Iy{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=nt.create("formatter"),this.options=t,this.formats={number:Nn((n,r)=>{const i=new Intl.NumberFormat(n,{...r});return s=>i.format(s)}),currency:Nn((n,r)=>{const i=new Intl.NumberFormat(n,{...r,style:"currency"});return s=>i.format(s)}),datetime:Nn((n,r)=>{const i=new Intl.DateTimeFormat(n,{...r});return s=>i.format(s)}),relativetime:Nn((n,r)=>{const i=new Intl.RelativeTimeFormat(n,{...r});return s=>i.format(s,r.range||"day")}),list:Nn((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()]=Nn(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}=Fy(a);if(this.formats[u]){let f=l;try{const c=i&&i.formatParams&&i.formatParams[i.interpolationkey]||{},v=c.locale||c.lng||i.locale||i.lng||r;f=this.formats[u](l,v,{...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 jy=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class My extends qs{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=nt.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=>{my(a.loaded,[s],o),jy(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 vc=()=>({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}}),yc=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),zi=()=>{},Dy=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})};class ii extends qs{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(super(),this.options=yc(t),this.services={},this.logger=nt,this.modules={external:[]},Dy(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=vc();this.options={...i,...this.options,...yc(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?nt.init(s(this.modules.logger),this.options):nt.init(null,this.options);let d;this.modules.formatter?d=this.modules.formatter:typeof Intl<"u"&&(d=Iy);const f=new hc(this.options);this.store=new fc(this.options.resources,this.options);const c=this.services;c.logger=nt,c.resourceStore=this.store,c.languageUtils=f,c.pluralResolver=new Oy(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 Ry(this.options),c.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},c.backendConnector=new My(s(this.modules.backend),c.resourceStore,c,this.options),c.backendConnector.on("*",function(v){for(var w=arguments.length,y=new Array(w>1?w-1:0),x=1;x<w;x++)y[x-1]=arguments[x];t.emit(v,...y)}),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(v){for(var w=arguments.length,y=new Array(w>1?w-1:0),x=1;x<w;x++)y[x-1]=arguments[x];t.emit(v,...y)}),this.modules.external.forEach(v=>{v.init&&v.init(this)})}if(this.format=this.options.interpolation.format,r||(r=zi),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=kr(),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]:zi;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=kr();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=zi),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=kr();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 v;return a.keyPrefix&&Array.isArray(o)?v=o.map(w=>`${a.keyPrefix}${c}${w}`):v=a.keyPrefix?`${a.keyPrefix}${c}${o}`:o,i.t(v,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=kr();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=kr();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(vc());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 ii(t,n)}cloneInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:zi;const r=t.forkResourceStore;r&&delete t.forkResourceStore;const i={...this.options,...t,isClone:!0},s=new ii(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=ii.createInstance();le.createInstance=ii.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 _y={zh:{translation:{app:{title:"cc-gw 控制台",skipToContent:"跳转到主要内容"},nav:{dashboard:"仪表盘",logs:"请求日志",models:"模型管理",settings:"设置",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:"快速了解请求规模与实时运行状态。",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:"时间",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",modelId:"模型 ID",modelPlaceholder:"如 deepseek-chat",status:"状态",statusAll:"全部",statusSuccess:"成功",statusError:"失败",startDate:"起始日期",endDate:"结束日期"},actions:{manualRefresh:"手动刷新",refreshing:"刷新中...",detail:"详情"},table:{loading:"正在加载日志...",empty:"未找到符合条件的日志记录。",requestedModelFallback:"未指定",columns:{time:"时间",provider:"Provider",requestedModel:"请求模型",routedModel:"路由模型",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}} 页"}},toast:{listError:{title:"日志获取失败",desc:"错误信息:{{message}}"},providerError:{title:"Provider 列表获取失败",desc:"错误信息:{{message}}"}},stream:{streaming:"流式",single:"单次"},detail:{title:"日志详情",id:"ID #{{id}}",infoSection:"基本信息",info:{time:"时间",sessionId:"Session ID",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:"暂无响应内容"},copy:{requestSuccess:"请求体已复制到剪贴板。",responseSuccess:"响应体已复制到剪贴板。",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:"可留空以从环境变量读取",models:"模型配置",showAdvanced:"显示高级选项",hideAdvanced:"隐藏高级选项",addModel:"新增模型",modelId:"模型 ID",modelIdPlaceholder:"如 claude-sonnet-4-20250514",modelLabel:"显示名称(可选)",modelLabelPlaceholder:"如 GPT-4 旗舰",maxTokens:"最大 Tokens(可选)",capabilities:"能力标签",capabilityThinking:"Thinking",capabilityTools:"Tools",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:"统一维护模型提供商配置与模型路由映射。",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:"关闭后将不再在终端打印每个请求的访问日志。"},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)。如需禁用映射,可留空或移除。",add:"新增映射",empty:"尚未配置映射,系统将使用默认模型策略。",sourceLabel:"来源模型",sourcePlaceholder:"如 claude-sonnet-4-20250514",targetLabel:"目标 Provider:模型",targetPlaceholder:"如 kimi:kimi-k2-0905-preview",remove:"移除",suggested:"常用 Claude 模型"},file:{description:"当前配置存储在本地文件,可通过编辑该文件进行离线修改。",unknown:"未知路径"},cleanup:{description:"立即清理早于当前保留天数的日志记录。",clearAll:"彻底清空",clearingAll:"清空中...",clearAllWarning:"该操作会删除所有日志记录及日统计数据,请谨慎操作。"}},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:"检查更新功能将在后续版本提供。"}}}},en:{translation:{app:{title:"cc-gw Console",skipToContent:"Skip to main content"},nav:{dashboard:"Dashboard",logs:"Logs",models:"Model Management",settings:"Settings",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.",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",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",modelId:"Model ID",modelPlaceholder:"e.g. deepseek-chat",status:"Status",statusAll:"All",statusSuccess:"Success",statusError:"Error",startDate:"Start date",endDate:"End date"},actions:{manualRefresh:"Manual refresh",refreshing:"Refreshing...",detail:"Detail"},table:{loading:"Loading logs...",empty:"No records match the current filters.",requestedModelFallback:"Not specified",columns:{time:"Time",provider:"Provider",requestedModel:"Requested model",routedModel:"Routed model",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}}"}},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",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"},copy:{requestSuccess:"Request body copied to clipboard.",responseSuccess:"Response body 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, default models, and capabilities.",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, model list, and capabilities.",modelsDescription:"Maintain supported models and capability flags.",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",models:"Model configuration",showAdvanced:"Show advanced options",hideAdvanced:"Hide advanced options",addModel:"Add model",modelId:"Model ID",modelIdPlaceholder:"e.g. claude-sonnet-4-20250514",modelLabel:"Display name (optional)",modelLabelPlaceholder:"e.g. GPT-4 Flagship",maxTokens:"Max tokens (optional)",capabilities:"Capabilities",capabilityThinking:"Thinking",capabilityTools:"Tools",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.",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."},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.",add:"Add route",empty:"No custom routes configured. Default strategy will be used.",sourceLabel:"Source model",sourcePlaceholder:"e.g. claude-sonnet-4-20250514",targetLabel:"Target provider:model",targetPlaceholder:"e.g. kimi:kimi-k2-0905-preview",remove:"Remove",suggested:"Claude 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."}},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(vv).init({resources:_y,lng:"zh",fallbackLng:"en",interpolation:{escapeValue:!1}});const gp=k.createContext(void 0);function zy(){return`toast_${Math.random().toString(36).slice(2)}`}function Ay({children:e}){const[t,n]=k.useState([]),r=k.useCallback(o=>{n(l=>l.filter(a=>a.id!==o))},[]),i=k.useCallback(o=>{const l=o.id??zy();n(u=>[...u,{...o,id:l}]);const a=o.durationMs??3e3;a>0&&setTimeout(()=>r(l),a)},[r]),s=k.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 Yy(){const e=k.useContext(gp);if(!e)throw new Error("useToast must be used within ToastProvider");return e}function $y({children:e}){const[t]=k.useState(()=>new dy);return L.jsx(fy,{client:t,children:L.jsx(xv,{i18n:le,children:L.jsx(jv,{children:L.jsx(Ay,{children:e})})})})}function Uy(){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 by=k.lazy(()=>pi(()=>import("./Dashboard-CDJyyn7X.js"),__vite__mapDeps([0,1]))),Vy=k.lazy(()=>pi(()=>import("./Logs-D05vFMv1.js"),__vite__mapDeps([2,1]))),wc=k.lazy(()=>pi(()=>import("./ModelManagement-B3YFArK5.js"),__vite__mapDeps([3,1]))),By=k.lazy(()=>pi(()=>import("./Settings-DAYDEvz0.js"),__vite__mapDeps([4,1]))),Ky=k.lazy(()=>pi(()=>import("./About-ChfDc2NI.js"),__vite__mapDeps([5,1])));function Hy(){return L.jsx($y,{children:L.jsx(Yg,{basename:typeof window<"u"&&window.location.pathname.startsWith("/ui")?"/ui":"/",children:L.jsx(k.Suspense,{fallback:L.jsx(Uy,{}),children:L.jsx(Bg,{children:L.jsxs(xt,{path:"/",element:L.jsx($v,{}),children:[L.jsx(xt,{index:!0,element:L.jsx(by,{})}),L.jsx(xt,{path:"logs",element:L.jsx(Vy,{})}),L.jsx(xt,{path:"models",element:L.jsx(wc,{})}),L.jsx(xt,{path:"providers",element:L.jsx(wc,{})}),L.jsx(xt,{path:"settings",element:L.jsx(By,{})}),L.jsx(xt,{path:"about",element:L.jsx(Ky,{})})]})})})})})}const vp=document.getElementById("root");if(!vp)throw new Error("Root element #root not found");Lo.createRoot(vp).render(L.jsx($c.StrictMode,{children:L.jsx(Hy,{})}));export{Uy as L,$c as R,Qs as S,Yy as a,Qv as b,Ll as c,Kv as d,Tl as e,up as f,xp as g,sy as h,Ws as i,L as j,Gv as k,ye as l,Gy as m,Ve as n,Jy as o,Zv as p,qy as q,k as r,Wy as s,Hv as t,mi as u};
|
|
123
|
+
*/const Ju=vt("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Yu="cc-gw-theme",op=k.createContext(void 0);function Iv(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 jv({children:e}){const[t,n]=k.useState(()=>{if(typeof window>"u")return"system";const s=window.localStorage.getItem(Yu);return s==="light"||s==="dark"||s==="system"?s:"system"}),r=k.useMemo(()=>typeof window<"u"?Iv(t):"light",[t]);k.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]),k.useEffect(()=>{typeof window>"u"||(Xu(r),window.localStorage.setItem(Yu,t))},[t,r]);const i=k.useMemo(()=>({mode:t,resolved:r,setMode:n}),[t,r]);return L.jsx(op.Provider,{value:i,children:e})}function Mv(){const e=k.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 Dv(){var l;const{mode:e,setMode:t,resolved:n}=Mv(),{t:r}=mi(),[i,s]=k.useState(!1),o=n==="dark"?L.jsx(Ov,{size:16,"aria-hidden":"true"}):L.jsx(Fv,{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 _v=[{code:"zh",labelKey:"language.zh"},{code:"en",labelKey:"language.en"}];function zv(){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:_v.map(n=>L.jsx("option",{value:n.code,children:t(n.labelKey)},n.code))})}const Av=[{to:"/",icon:Pv,labelKey:"nav.dashboard"},{to:"/logs",icon:Tv,labelKey:"nav.logs"},{to:"/models",icon:Lv,labelKey:"nav.models"},{to:"/settings",icon:Rv,labelKey:"nav.settings"},{to:"/about",icon:Ev,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:Av.map(n=>{const r=n.icon;return L.jsxs(tv,{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 $v(){const{t:e}=mi(),t=pr(),[n,r]=k.useState(!1);return k.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(Nv,{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(zv,{}),L.jsx(Dv,{})]})]}),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(bg,{})})]}),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(){}},Uv={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Lt,Fl,Sc,bv=(Sc=class{constructor(){z(this,Lt,Uv);z(this,Fl,!1)}setTimeoutProvider(e){j(this,Lt,e)}setTimeout(e,t){return S(this,Lt).setTimeout(e,t)}clearTimeout(e){S(this,Lt).clearTimeout(e)}setInterval(e,t){return S(this,Lt).setInterval(e,t)}clearInterval(e){S(this,Lt).clearInterval(e)}},Lt=new WeakMap,Fl=new WeakMap,Sc),Tl=new bv;function Vv(e){setTimeout(e,0)}var Ws=typeof window>"u"||"Deno"in globalThis;function Ve(){}function Bv(e,t){return typeof e=="function"?e(t):e}function Kv(e){return typeof e=="number"&&e>=0&&e!==1/0}function Hv(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ll(e,t){return typeof e=="function"?e(t):e}function Qv(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(!ri(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(ni(t.options.mutationKey)!==ni(s))return!1}else if(!ri(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)||ni)(e)}function ni(e){return JSON.stringify(e,(t,n)=>Nl(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function ri(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>ri(e[n],t[n])):!1}var Wv=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:Wv.call(e,d))&&a++;continue}if(f===null||c===null||typeof f!="object"||typeof c!="object"){l[d]=c;continue}const v=lp(f,c);l[d]=v,v===f&&a++}return i===o&&a===i?e:l}function Wy(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 qv(e){return new Promise(t=>{Tl.setTimeout(t,e)})}function Gv(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?lp(e,t):t}function qy(e){return e}function Jv(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function Yv(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 Gy(e,t){return typeof e=="function"?e(...t):!!e}var an,Nt,Wn,xc,Xv=(xc=class extends Qs{constructor(){super();z(this,an);z(this,Nt);z(this,Wn);j(this,Wn,t=>{if(!Ws&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){S(this,Nt)||this.setEventListener(S(this,Wn))}onUnsubscribe(){var t;this.hasListeners()||((t=S(this,Nt))==null||t.call(this),j(this,Nt,void 0))}setEventListener(t){var n;j(this,Wn,t),(n=S(this,Nt))==null||n.call(this),j(this,Nt,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){S(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 S(this,an)=="boolean"?S(this,an):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},an=new WeakMap,Nt=new WeakMap,Wn=new WeakMap,xc),up=new Xv;function Zv(){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 ey=Vv;function ty(){let e=[],t=0,n=l=>{l()},r=l=>{l()},i=ey;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 ye=ty(),qn,Ot,Gn,kc,ny=(kc=class extends Qs{constructor(){super();z(this,qn,!0);z(this,Ot);z(this,Gn);j(this,Gn,t=>{if(!Ws&&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(){S(this,Ot)||this.setEventListener(S(this,Gn))}onUnsubscribe(){var t;this.hasListeners()||((t=S(this,Ot))==null||t.call(this),j(this,Ot,void 0))}setEventListener(t){var n;j(this,Gn,t),(n=S(this,Ot))==null||n.call(this),j(this,Ot,t(this.setOnline.bind(this)))}setOnline(t){S(this,qn)!==t&&(j(this,qn,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return S(this,qn)}},qn=new WeakMap,Ot=new WeakMap,Gn=new WeakMap,kc),ks=new ny;function ry(e){return Math.min(1e3*2**e,3e4)}function cp(e){return(e??"online")==="online"?ks.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=Zv(),s=()=>i.status!=="pending",o=y=>{var x;if(!s()){const h=new Ol(y);c(h),(x=e.onCancel)==null||x.call(e,h)}},l=()=>{t=!0},a=()=>{t=!1},u=()=>up.isFocused()&&(e.networkMode==="always"||ks.isOnline())&&e.canRun(),d=()=>cp(e.networkMode)&&e.canRun(),f=y=>{s()||(r==null||r(),i.resolve(y))},c=y=>{s()||(r==null||r(),i.reject(y))},v=()=>new Promise(y=>{var x;r=h=>{(s()||u())&&y(h)},(x=e.onPause)==null||x.call(e)}).then(()=>{var y;r=void 0,s()||(y=e.onContinue)==null||y.call(e)}),w=()=>{if(s())return;let y;const x=n===0?e.initialPromise:void 0;try{y=x??e.fn()}catch(h){y=Promise.reject(h)}Promise.resolve(y).then(f).catch(h=>{var P;if(s())return;const p=e.retry??(Ws?0:3),m=e.retryDelay??ry,g=typeof m=="function"?m(n,h):m,C=p===!0||typeof p=="number"&&n<p||typeof p=="function"&&p(n,h);if(t||!C){c(h);return}n++,(P=e.onFail)==null||P.call(e,n,h),qv(g).then(()=>u()?void 0:v()).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():v().then(w),i)}}var un,Cc,fp=(Cc=class{constructor(){z(this,un)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Kv(this.gcTime)&&j(this,un,Tl.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Ws?1/0:5*60*1e3))}clearGcTimeout(){S(this,un)&&(Tl.clearTimeout(S(this,un)),j(this,un,void 0))}},un=new WeakMap,Cc),cn,Jn,je,dn,ie,si,fn,Be,st,Pc,iy=(Pc=class extends fp{constructor(t){super();z(this,Be);z(this,cn);z(this,Jn);z(this,je);z(this,dn);z(this,ie);z(this,si);z(this,fn);j(this,fn,!1),j(this,si,t.defaultOptions),this.setOptions(t.options),this.observers=[],j(this,dn,t.client),j(this,je,S(this,dn).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,j(this,cn,sc(this.options)),this.state=t.state??S(this,cn),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=S(this,ie))==null?void 0:t.promise}setOptions(t){if(this.options={...S(this,si),...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"&&S(this,je).remove(this)}setData(t,n){const r=Gv(this.state.data,t,this.options);return de(this,Be,st).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,Be,st).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,i;const n=(r=S(this,ie))==null?void 0:r.promise;return(i=S(this,ie))==null||i.cancel(t),n?n.then(Ve).catch(Ve):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(S(this,cn))}isActive(){return this.observers.some(t=>Qv(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:!Hv(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=S(this,ie))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=S(this,ie))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),S(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||(S(this,ie)&&(S(this,fn)?S(this,ie).cancel({revert:!0}):S(this,ie).cancelRetry()),this.scheduleGc()),S(this,je).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||de(this,Be,st).call(this,{type:"invalidate"})}async fetch(t,n){var a,u,d,f,c,v,w,y,x,h,p,m;if(this.state.fetchStatus!=="idle"&&((a=S(this,ie))==null?void 0:a.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(S(this,ie))return S(this,ie).continueRetry(),S(this,ie).promise}if(t&&this.setOptions(t),!this.options.queryFn){const g=this.observers.find(C=>C.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),P=(()=>{const E={client:S(this,dn),queryKey:this.queryKey,meta:this.meta};return i(E),E})();return j(this,fn,!1),this.options.persister?this.options.persister(g,P,this):g(P)},l=(()=>{const g={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:S(this,dn),state:this.state,fetchFn:s};return i(g),g})();(u=this.options.behavior)==null||u.onFetch(l,this),j(this,Jn,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=l.fetchOptions)==null?void 0:d.meta))&&de(this,Be,st).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({...S(this,Jn),fetchStatus:"idle"}),r.abort()},onFail:(g,C)=>{de(this,Be,st).call(this,{type:"failed",failureCount:g,error:C})},onPause:()=>{de(this,Be,st).call(this,{type:"pause"})},onContinue:()=>{de(this,Be,st).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0}));try{const g=await S(this,ie).start();if(g===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(g),(v=(c=S(this,je).config).onSuccess)==null||v.call(c,g,this),(y=(w=S(this,je).config).onSettled)==null||y.call(w,g,this.state.error,this),g}catch(g){if(g instanceof Ol){if(g.silent)return S(this,ie).promise;if(g.revert){if(this.state.data===void 0)throw g;return this.state.data}}throw de(this,Be,st).call(this,{type:"error",error:g}),(h=(x=S(this,je).config).onError)==null||h.call(x,g,this),(m=(p=S(this,je).config).onSettled)==null||m.call(p,this.state.data,g,this),g}finally{this.scheduleGc()}}},cn=new WeakMap,Jn=new WeakMap,je=new WeakMap,dn=new WeakMap,ie=new WeakMap,si=new WeakMap,fn=new WeakMap,Be=new WeakSet,st=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,...sy(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,Jn,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),ye.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),S(this,je).notify({query:this,type:"updated",action:t})})},Pc);function sy(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,v,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=((v=t.state.data)==null?void 0:v.pages)||[],o=((w=t.state.data)==null?void 0:w.pageParams)||[];let l={pages:[],pageParams:[]},a=0;const u=async()=>{let y=!1;const x=m=>{Object.defineProperty(m,"signal",{enumerable:!0,get:()=>(t.signal.aborted?y=!0:t.signal.addEventListener("abort",()=>{y=!0}),t.signal)})},h=ap(t.options,t.fetchOptions),p=async(m,g,C)=>{if(y)return Promise.reject();if(g==null&&m.pages.length)return Promise.resolve(m);const E=(()=>{const b={client:t.client,queryKey:t.queryKey,pageParam:g,direction:C?"backward":"forward",meta:t.options.meta};return x(b),b})(),O=await h(E),{maxPages:$}=t.options,F=C?Yv:Jv;return{pages:F(m.pages,O,$),pageParams:F(m.pageParams,g,$)}};if(i&&s.length){const m=i==="backward",g=m?oy:lc,C={pages:s,pageParams:o},P=g(r,C);l=await p(C,P,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 y,x;return(x=(y=t.options).persister)==null?void 0:x.call(y,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 oy(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 oi,Xe,ge,pn,Ze,kt,Ec,ly=(Ec=class extends fp{constructor(t){super();z(this,Ze);z(this,oi);z(this,Xe);z(this,ge);z(this,pn);j(this,oi,t.client),this.mutationId=t.mutationId,j(this,ge,t.mutationCache),j(this,Xe,[]),this.state=t.state||ay(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){S(this,Xe).includes(t)||(S(this,Xe).push(t),this.clearGcTimeout(),S(this,ge).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){j(this,Xe,S(this,Xe).filter(n=>n!==t)),this.scheduleGc(),S(this,ge).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){S(this,Xe).length||(this.state.status==="pending"?this.scheduleGc():S(this,ge).remove(this))}continue(){var t;return((t=S(this,pn))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,l,a,u,d,f,c,v,w,y,x,h,p,m,g,C,P,E,O,$;const n=()=>{de(this,Ze,kt).call(this,{type:"continue"})},r={client:S(this,oi),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:(F,b)=>{de(this,Ze,kt).call(this,{type:"failed",failureCount:F,error:b})},onPause:()=>{de(this,Ze,kt).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>S(this,ge).canRun(this)}));const i=this.state.status==="pending",s=!S(this,pn).canStart();try{if(i)n();else{de(this,Ze,kt).call(this,{type:"pending",variables:t,isPaused:s}),await((l=(o=S(this,ge).config).onMutate)==null?void 0:l.call(o,t,this,r));const b=await((u=(a=this.options).onMutate)==null?void 0:u.call(a,t,r));b!==this.state.context&&de(this,Ze,kt).call(this,{type:"pending",context:b,variables:t,isPaused:s})}const F=await S(this,pn).start();return await((f=(d=S(this,ge).config).onSuccess)==null?void 0:f.call(d,F,t,this.state.context,this,r)),await((v=(c=this.options).onSuccess)==null?void 0:v.call(c,F,t,this.state.context,r)),await((y=(w=S(this,ge).config).onSettled)==null?void 0:y.call(w,F,null,this.state.variables,this.state.context,this,r)),await((h=(x=this.options).onSettled)==null?void 0:h.call(x,F,null,t,this.state.context,r)),de(this,Ze,kt).call(this,{type:"success",data:F}),F}catch(F){try{throw await((m=(p=S(this,ge).config).onError)==null?void 0:m.call(p,F,t,this.state.context,this,r)),await((C=(g=this.options).onError)==null?void 0:C.call(g,F,t,this.state.context,r)),await((E=(P=S(this,ge).config).onSettled)==null?void 0:E.call(P,void 0,F,this.state.variables,this.state.context,this,r)),await(($=(O=this.options).onSettled)==null?void 0:$.call(O,void 0,F,t,this.state.context,r)),F}finally{de(this,Ze,kt).call(this,{type:"error",error:F})}}finally{S(this,ge).runNext(this)}}},oi=new WeakMap,Xe=new WeakMap,ge=new WeakMap,pn=new WeakMap,Ze=new WeakSet,kt=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),ye.batch(()=>{S(this,Xe).forEach(r=>{r.onMutationUpdate(t)}),S(this,ge).notify({mutation:this,type:"updated",action:t})})},Ec);function ay(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var at,Ke,li,Tc,uy=(Tc=class extends Qs{constructor(t={}){super();z(this,at);z(this,Ke);z(this,li);this.config=t,j(this,at,new Set),j(this,Ke,new Map),j(this,li,0)}build(t,n,r){const i=new ly({client:t,mutationCache:this,mutationId:++yi(this,li)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){S(this,at).add(t);const n=_i(t);if(typeof n=="string"){const r=S(this,Ke).get(n);r?r.push(t):S(this,Ke).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(S(this,at).delete(t)){const n=_i(t);if(typeof n=="string"){const r=S(this,Ke).get(n);if(r)if(r.length>1){const i=r.indexOf(t);i!==-1&&r.splice(i,1)}else r[0]===t&&S(this,Ke).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=_i(t);if(typeof n=="string"){const r=S(this,Ke).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=_i(t);if(typeof n=="string"){const i=(r=S(this,Ke).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(){ye.batch(()=>{S(this,at).forEach(t=>{this.notify({type:"removed",mutation:t})}),S(this,at).clear(),S(this,Ke).clear()})}getAll(){return Array.from(S(this,at))}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){ye.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return ye.batch(()=>Promise.all(t.map(n=>n.continue().catch(Ve))))}},at=new WeakMap,Ke=new WeakMap,li=new WeakMap,Tc);function _i(e){var t;return(t=e.options.scope)==null?void 0:t.id}var et,Lc,cy=(Lc=class extends Qs{constructor(t={}){super();z(this,et);this.config=t,j(this,et,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 iy({client:t,queryKey:i,queryHash:s,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(o)),o}add(t){S(this,et).has(t.queryHash)||(S(this,et).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=S(this,et).get(t.queryHash);n&&(t.destroy(),n===t&&S(this,et).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){ye.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return S(this,et).get(t)}getAll(){return[...S(this,et).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){ye.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){ye.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){ye.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},et=new WeakMap,Lc),J,Rt,Ft,Yn,Xn,It,Zn,er,Nc,dy=(Nc=class{constructor(e={}){z(this,J);z(this,Rt);z(this,Ft);z(this,Yn);z(this,Xn);z(this,It);z(this,Zn);z(this,er);j(this,J,e.queryCache||new cy),j(this,Rt,e.mutationCache||new uy),j(this,Ft,e.defaultOptions||{}),j(this,Yn,new Map),j(this,Xn,new Map),j(this,It,0)}mount(){yi(this,It)._++,S(this,It)===1&&(j(this,Zn,up.subscribe(async e=>{e&&(await this.resumePausedMutations(),S(this,J).onFocus())})),j(this,er,ks.subscribe(async e=>{e&&(await this.resumePausedMutations(),S(this,J).onOnline())})))}unmount(){var e,t;yi(this,It)._--,S(this,It)===0&&((e=S(this,Zn))==null||e.call(this),j(this,Zn,void 0),(t=S(this,er))==null||t.call(this),j(this,er,void 0))}isFetching(e){return S(this,J).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return S(this,Rt).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=S(this,J).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=S(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 S(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=S(this,J).get(r.queryHash),s=i==null?void 0:i.state.data,o=Bv(t,s);if(o!==void 0)return S(this,J).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return ye.batch(()=>S(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=S(this,J).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=S(this,J);ye.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=S(this,J);return ye.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=ye.batch(()=>S(this,J).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(Ve).catch(Ve)}invalidateQueries(e,t={}){return ye.batch(()=>(S(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=ye.batch(()=>S(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(Ve)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(Ve)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=S(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(Ve).catch(Ve)}fetchInfiniteQuery(e){return e.behavior=oc(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Ve).catch(Ve)}ensureInfiniteQueryData(e){return e.behavior=oc(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return ks.isOnline()?S(this,Rt).resumePausedMutations():Promise.resolve()}getQueryCache(){return S(this,J)}getMutationCache(){return S(this,Rt)}getDefaultOptions(){return S(this,Ft)}setDefaultOptions(e){j(this,Ft,e)}setQueryDefaults(e,t){S(this,Yn).set(ni(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...S(this,Yn).values()],n={};return t.forEach(r=>{ri(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){S(this,Xn).set(ni(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...S(this,Xn).values()],n={};return t.forEach(r=>{ri(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...S(this,Ft).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:{...S(this,Ft).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){S(this,J).clear(),S(this,Rt).clear()}},J=new WeakMap,Rt=new WeakMap,Ft=new WeakMap,Yn=new WeakMap,Xn=new WeakMap,It=new WeakMap,Zn=new WeakMap,er=new WeakMap,Nc),pp=k.createContext(void 0),Jy=e=>{const t=k.useContext(pp);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},fy=({client:e,children:t})=>(k.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),L.jsx(pp.Provider,{value:e,children:t}));const M=e=>typeof e=="string",kr=()=>{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,py=(e,t,n)=>{e.forEach(r=>{t[r]&&(n[r]=t[r])})},hy=/###/g,uc=e=>e&&e.indexOf("###")>-1?e.replace(hy,"."):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},my=(e,t,n,r)=>{const{obj:i,k:s}=_r(e,t,Object);i[s]=i[s]||[],i[s].push(n)},Cs=(e,t)=>{const{obj:n,k:r}=_r(e,t);if(n)return n[r]},gy=(e,t,n)=>{const r=Cs(e,n);return r!==void 0?r:Cs(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},Ln=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var vy={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const yy=e=>M(e)?e.replace(/[&<>"'\/]/g,t=>vy[t]):e;class wy{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 Sy=[" ",",","?","!",";"],xy=new wy(20),ky=(e,t,n)=>{t=t||"",n=n||"";const r=Sy.filter(o=>t.indexOf(o)<0&&n.indexOf(o)<0);if(r.length===0)return!0;const i=xy.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},Ps=e=>e&&e.replace("_","-"),Cy={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||Cy,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 nt=new Es;class qs{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 qs{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=Cs(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=Cs(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 qs{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),py(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=nt.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&&!ky(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 v=f&&f.usedKey||o,w=f&&f.exactUsedKey||o,y=Object.prototype.toString.apply(c),x=["[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&&x.indexOf(y)<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(v,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),C=g?[]:{},P=g?w:v;for(const E in c)if(Object.prototype.hasOwnProperty.call(c,E)){const O=`${P}${s}${E}`;C[E]=this.translate(O,{...n,joinArrays:!1,ns:l}),C[E]===O&&(C[E]=c[E])}c=C}}else if(p&&M(h)&&Array.isArray(c))c=c.join(h),c&&(c=this.extendTranslation(c,t,n,r));else{let g=!1,C=!1;const P=n.count!==void 0&&!M(n.count),E=Ts.hasDefaultValue(n),O=P?this.pluralResolver.getSuffix(u,n.count,n):"",$=n.ordinal&&P?this.pluralResolver.getSuffix(u,n.count,{ordinal:!1}):"",F=P&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),b=F&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${O}`]||n[`defaultValue${$}`]||n.defaultValue;!this.isValidLookup(c)&&E&&(g=!0,c=b),this.isValidLookup(c)||(C=!0,c=o);const Xt=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&C?void 0:c,yt=E&&b!==c&&this.options.updateMissing;if(C||g||yt){if(this.logger.log(yt?"updateKey":"missingKey",u,a,o,yt?b: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 wt=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&wt&&wt[0])for(let N=0;N<wt.length;N++)Zt.push(wt[N]);else this.options.saveMissingTo==="all"?Zt=this.languageUtils.toResolveHierarchy(n.lng||this.language):Zt.push(n.lng||this.language);const En=(N,I,D)=>{const H=E&&D!==c?D:Xt;this.options.missingKeyHandler?this.options.missingKeyHandler(N,a,I,H,yt,n):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(N,a,I,H,yt,n),this.emit("missingKey",N,a,I,c)};this.options.saveMissing&&(this.options.saveMissingPlurals&&P?Zt.forEach(N=>{const I=this.pluralResolver.getSuffixes(N,n);F&&n[`defaultValue${this.options.pluralSeparator}zero`]&&I.indexOf(`${this.options.pluralSeparator}zero`)<0&&I.push(`${this.options.pluralSeparator}zero`),I.forEach(D=>{En([N],o+D,n[`defaultValue${D}`]||b)})}):En(Zt,o,b))}c=this.extendTranslation(c,t,n,f,r),C&&c===o&&this.options.appendNamespaceToMissingKey&&(c=`${a}:${o}`),(C||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),v=c&&c.length;d<v&&(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,v=new Array(c),w=0;w<c;w++)v[w]=arguments[w];return s&&s[0]===v[0]&&!r.context?(o.logger.warn(`It seems you are nesting recursively key: ${v[0]} in key: ${n[0]}`),null):o.translate(...v,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),v=c&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),w=n.context!==void 0&&(M(n.context)||typeof n.context=="number")&&n.context!=="",y=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);f.forEach(x=>{this.isValidLookup(r)||(l=x,!pc[`${y[0]}-${x}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(l)&&(pc[`${y[0]}-${x}`]=!0,this.logger.warn(`key "${i}" for languages "${y.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!!!")),y.forEach(h=>{if(this.isValidLookup(r))return;o=h;const p=[d];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(p,d,h,x,n);else{let g;c&&(g=this.pluralResolver.getSuffix(h,n.count,n));const C=`${this.options.pluralSeparator}zero`,P=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(c&&(p.push(d+g),n.ordinal&&g.indexOf(P)===0&&p.push(d+g.replace(P,this.options.pluralSeparator)),v&&p.push(d+C)),w){const E=`${d}${this.options.contextSeparator}${n.context}`;p.push(E),c&&(p.push(E+g),n.ordinal&&g.indexOf(P)===0&&p.push(E+g.replace(P,this.options.pluralSeparator)),v&&p.push(E+C))}}let m;for(;m=p.pop();)this.isValidLookup(r)||(s=m,r=this.getResource(h,x,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=nt.create("languageUtils")}getScriptPartFromCode(t){if(t=Ps(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=Ps(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 Py=[{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}],Ey={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 Ty=["v1","v2","v3"],Ly=["v4"],mc={zero:0,one:1,two:2,few:3,many:4,other:5},Ny=()=>{const e={};return Py.forEach(t=>{t.lngs.forEach(n=>{e[n]={numbers:t.nr,plurals:Ey[t.fc]}})}),e};class Oy{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=t,this.options=n,this.logger=nt.create("pluralResolver"),(!this.options.compatibilityJSON||Ly.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=Ny(),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=Ps(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!Ty.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=gy(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 Ry{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=nt.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:v,nestingSuffix:w,nestingSuffixEscaped:y,nestingOptionsSeparator:x,maxReplaces:h,alwaysFormat:p}=t.interpolation;this.escape=n!==void 0?n:yy,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=i!==void 0?i:!1,this.prefix=s?Ln(s):o||"{{",this.suffix=l?Ln(l):a||"}}",this.formatSeparator=u||",",this.unescapePrefix=d?"":f||"-",this.unescapeSuffix=this.unescapePrefix?"":d||"",this.nestingPrefix=c?Ln(c):v||Ln("$t("),this.nestingSuffix=w?Ln(w):y||Ln(")"),this.nestingOptionsSeparator=x||",",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=v=>{if(v.indexOf(this.formatSeparator)<0){const h=gc(n,a,v,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(h,void 0,r,{...i,...n,interpolationkey:v}):h}const w=v.split(this.formatSeparator),y=w.shift().trim(),x=w.join(this.formatSeparator).trim();return this.format(gc(n,a,y,this.options.keySeparator,this.options.ignoreJSONStructure),x,r,{...i,...n,interpolationkey:y})};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:v=>To(v)},{regex:this.regexp,safeValue:v=>this.escapeValue?To(this.escape(v)):To(v)}].forEach(v=>{for(l=0;s=v.regex.exec(t);){const w=s[1].trim();if(o=u(w),o===void 0)if(typeof d=="function"){const x=d(t,s,i);o=M(x)?x:""}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 y=v.safeValue(o);if(t=t.replace(s[0],y),f?(v.regex.lastIndex+=o.length,v.regex.lastIndex-=s[0].length):v.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 v=c.match(/'/g),w=c.match(/"/g);(v&&v.length%2===0&&!w||w.length%2!==0)&&(c=c.replace(/'/g,'"'));try{o=JSON.parse(c),u&&(o={...u,...o})}catch(y){return this.logger.warn(`failed parsing options string in nesting for key ${a}`,y),`${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 Fy=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}},Nn=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(Ps(r),i),t[o]=l),l(n)}};class Iy{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=nt.create("formatter"),this.options=t,this.formats={number:Nn((n,r)=>{const i=new Intl.NumberFormat(n,{...r});return s=>i.format(s)}),currency:Nn((n,r)=>{const i=new Intl.NumberFormat(n,{...r,style:"currency"});return s=>i.format(s)}),datetime:Nn((n,r)=>{const i=new Intl.DateTimeFormat(n,{...r});return s=>i.format(s)}),relativetime:Nn((n,r)=>{const i=new Intl.RelativeTimeFormat(n,{...r});return s=>i.format(s,r.range||"day")}),list:Nn((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()]=Nn(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}=Fy(a);if(this.formats[u]){let f=l;try{const c=i&&i.formatParams&&i.formatParams[i.interpolationkey]||{},v=c.locale||c.lng||i.locale||i.lng||r;f=this.formats[u](l,v,{...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 jy=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class My extends qs{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=nt.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=>{my(a.loaded,[s],o),jy(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 vc=()=>({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}}),yc=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),zi=()=>{},Dy=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})};class ii extends qs{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(super(),this.options=yc(t),this.services={},this.logger=nt,this.modules={external:[]},Dy(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=vc();this.options={...i,...this.options,...yc(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?nt.init(s(this.modules.logger),this.options):nt.init(null,this.options);let d;this.modules.formatter?d=this.modules.formatter:typeof Intl<"u"&&(d=Iy);const f=new hc(this.options);this.store=new fc(this.options.resources,this.options);const c=this.services;c.logger=nt,c.resourceStore=this.store,c.languageUtils=f,c.pluralResolver=new Oy(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 Ry(this.options),c.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},c.backendConnector=new My(s(this.modules.backend),c.resourceStore,c,this.options),c.backendConnector.on("*",function(v){for(var w=arguments.length,y=new Array(w>1?w-1:0),x=1;x<w;x++)y[x-1]=arguments[x];t.emit(v,...y)}),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(v){for(var w=arguments.length,y=new Array(w>1?w-1:0),x=1;x<w;x++)y[x-1]=arguments[x];t.emit(v,...y)}),this.modules.external.forEach(v=>{v.init&&v.init(this)})}if(this.format=this.options.interpolation.format,r||(r=zi),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=kr(),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]:zi;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=kr();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=zi),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=kr();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 v;return a.keyPrefix&&Array.isArray(o)?v=o.map(w=>`${a.keyPrefix}${c}${w}`):v=a.keyPrefix?`${a.keyPrefix}${c}${o}`:o,i.t(v,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=kr();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=kr();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(vc());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 ii(t,n)}cloneInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:zi;const r=t.forkResourceStore;r&&delete t.forkResourceStore;const i={...this.options,...t,isClone:!0},s=new ii(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=ii.createInstance();le.createInstance=ii.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 _y={zh:{translation:{app:{title:"cc-gw 控制台",skipToContent:"跳转到主要内容"},nav:{dashboard:"仪表盘",logs:"请求日志",models:"模型管理",settings:"设置",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:"快速了解请求规模与实时运行状态。",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:"时间",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",modelId:"模型 ID",modelPlaceholder:"如 deepseek-chat",status:"状态",statusAll:"全部",statusSuccess:"成功",statusError:"失败",startDate:"起始日期",endDate:"结束日期"},actions:{manualRefresh:"手动刷新",refreshing:"刷新中...",detail:"详情"},table:{loading:"正在加载日志...",empty:"未找到符合条件的日志记录。",requestedModelFallback:"未指定",columns:{time:"时间",provider:"Provider",requestedModel:"请求模型",routedModel:"路由模型",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}} 页"}},toast:{listError:{title:"日志获取失败",desc:"错误信息:{{message}}"},providerError:{title:"Provider 列表获取失败",desc:"错误信息:{{message}}"}},stream:{streaming:"流式",single:"单次"},detail:{title:"日志详情",id:"ID #{{id}}",infoSection:"基本信息",info:{time:"时间",sessionId:"Session ID",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:"暂无响应内容"},copy:{requestSuccess:"请求体已复制到剪贴板。",responseSuccess:"响应体已复制到剪贴板。",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:"可留空以从环境变量读取",models:"模型配置",showAdvanced:"显示高级选项",hideAdvanced:"隐藏高级选项",addModel:"新增模型",modelId:"模型 ID",modelIdPlaceholder:"如 claude-sonnet-4-5-20250929",modelLabel:"显示名称(可选)",modelLabelPlaceholder:"如 GPT-4 旗舰",maxTokens:"最大 Tokens(可选)",capabilities:"能力标签",capabilityThinking:"Thinking",capabilityTools:"Tools",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:"统一维护模型提供商配置与模型路由映射。",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:"关闭后将不再在终端打印每个请求的访问日志。"},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)。如需禁用映射,可留空或移除。",add:"新增映射",empty:"尚未配置映射,系统将使用默认模型策略。",sourceLabel:"来源模型",sourcePlaceholder:"如 claude-sonnet-4-5-20250929",targetLabel:"目标 Provider:模型",targetPlaceholder:"如 kimi:kimi-k2-0905-preview",remove:"移除",suggested:"常用 Claude 模型"},file:{description:"当前配置存储在本地文件,可通过编辑该文件进行离线修改。",unknown:"未知路径"},cleanup:{description:"立即清理早于当前保留天数的日志记录。",clearAll:"彻底清空",clearingAll:"清空中...",clearAllWarning:"该操作会删除所有日志记录及日统计数据,请谨慎操作。"}},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:"检查更新功能将在后续版本提供。"}}}},en:{translation:{app:{title:"cc-gw Console",skipToContent:"Skip to main content"},nav:{dashboard:"Dashboard",logs:"Logs",models:"Model Management",settings:"Settings",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.",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",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",modelId:"Model ID",modelPlaceholder:"e.g. deepseek-chat",status:"Status",statusAll:"All",statusSuccess:"Success",statusError:"Error",startDate:"Start date",endDate:"End date"},actions:{manualRefresh:"Manual refresh",refreshing:"Refreshing...",detail:"Detail"},table:{loading:"Loading logs...",empty:"No records match the current filters.",requestedModelFallback:"Not specified",columns:{time:"Time",provider:"Provider",requestedModel:"Requested model",routedModel:"Routed model",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}}"}},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",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"},copy:{requestSuccess:"Request body copied to clipboard.",responseSuccess:"Response body 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, default models, and capabilities.",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, model list, and capabilities.",modelsDescription:"Maintain supported models and capability flags.",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",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",maxTokens:"Max tokens (optional)",capabilities:"Capabilities",capabilityThinking:"Thinking",capabilityTools:"Tools",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.",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."},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.",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",remove:"Remove",suggested:"Claude 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."}},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(vv).init({resources:_y,lng:"zh",fallbackLng:"en",interpolation:{escapeValue:!1}});const gp=k.createContext(void 0);function zy(){return`toast_${Math.random().toString(36).slice(2)}`}function Ay({children:e}){const[t,n]=k.useState([]),r=k.useCallback(o=>{n(l=>l.filter(a=>a.id!==o))},[]),i=k.useCallback(o=>{const l=o.id??zy();n(u=>[...u,{...o,id:l}]);const a=o.durationMs??3e3;a>0&&setTimeout(()=>r(l),a)},[r]),s=k.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 Yy(){const e=k.useContext(gp);if(!e)throw new Error("useToast must be used within ToastProvider");return e}function $y({children:e}){const[t]=k.useState(()=>new dy);return L.jsx(fy,{client:t,children:L.jsx(xv,{i18n:le,children:L.jsx(jv,{children:L.jsx(Ay,{children:e})})})})}function Uy(){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 by=k.lazy(()=>pi(()=>import("./Dashboard-Bvkc9Nqm.js"),__vite__mapDeps([0,1]))),Vy=k.lazy(()=>pi(()=>import("./Logs-D1s40rEu.js"),__vite__mapDeps([2,1]))),wc=k.lazy(()=>pi(()=>import("./ModelManagement-j5J5TDOy.js"),__vite__mapDeps([3,1]))),By=k.lazy(()=>pi(()=>import("./Settings-CgAFUZes.js"),__vite__mapDeps([4,1]))),Ky=k.lazy(()=>pi(()=>import("./About-B7UuxVKg.js"),__vite__mapDeps([5,1])));function Hy(){return L.jsx($y,{children:L.jsx(Yg,{basename:typeof window<"u"&&window.location.pathname.startsWith("/ui")?"/ui":"/",children:L.jsx(k.Suspense,{fallback:L.jsx(Uy,{}),children:L.jsx(Bg,{children:L.jsxs(xt,{path:"/",element:L.jsx($v,{}),children:[L.jsx(xt,{index:!0,element:L.jsx(by,{})}),L.jsx(xt,{path:"logs",element:L.jsx(Vy,{})}),L.jsx(xt,{path:"models",element:L.jsx(wc,{})}),L.jsx(xt,{path:"providers",element:L.jsx(wc,{})}),L.jsx(xt,{path:"settings",element:L.jsx(By,{})}),L.jsx(xt,{path:"about",element:L.jsx(Ky,{})})]})})})})})}const vp=document.getElementById("root");if(!vp)throw new Error("Root element #root not found");Lo.createRoot(vp).render(L.jsx($c.StrictMode,{children:L.jsx(Hy,{})}));export{Uy as L,$c as R,Qs as S,Yy as a,Qv as b,Ll as c,Kv as d,Tl as e,up as f,xp as g,sy as h,Ws as i,L as j,Gv as k,ye as l,Gy as m,Ve as n,Jy as o,Zv as p,qy as q,k as r,Wy as s,Hv as t,mi as u};
|