@kaitranntt/ccs 7.52.2-dev.5 → 7.52.2-dev.7

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.
Files changed (82) hide show
  1. package/README.md +4 -0
  2. package/dist/api/services/index.d.ts +3 -1
  3. package/dist/api/services/index.d.ts.map +1 -1
  4. package/dist/api/services/index.js +10 -1
  5. package/dist/api/services/index.js.map +1 -1
  6. package/dist/api/services/profile-lifecycle-service.d.ts +24 -0
  7. package/dist/api/services/profile-lifecycle-service.d.ts.map +1 -0
  8. package/dist/api/services/profile-lifecycle-service.js +364 -0
  9. package/dist/api/services/profile-lifecycle-service.js.map +1 -0
  10. package/dist/api/services/profile-lifecycle-validation.d.ts +11 -0
  11. package/dist/api/services/profile-lifecycle-validation.d.ts.map +1 -0
  12. package/dist/api/services/profile-lifecycle-validation.js +87 -0
  13. package/dist/api/services/profile-lifecycle-validation.js.map +1 -0
  14. package/dist/api/services/profile-types.d.ts +66 -0
  15. package/dist/api/services/profile-types.d.ts.map +1 -1
  16. package/dist/cliproxy/auth/gemini-token-refresh.d.ts.map +1 -1
  17. package/dist/cliproxy/auth/gemini-token-refresh.js +42 -14
  18. package/dist/cliproxy/auth/gemini-token-refresh.js.map +1 -1
  19. package/dist/cliproxy/quota-fetcher-codex.d.ts.map +1 -1
  20. package/dist/cliproxy/quota-fetcher-codex.js +199 -63
  21. package/dist/cliproxy/quota-fetcher-codex.js.map +1 -1
  22. package/dist/cliproxy/quota-fetcher.d.ts +12 -0
  23. package/dist/cliproxy/quota-fetcher.d.ts.map +1 -1
  24. package/dist/cliproxy/quota-fetcher.js +328 -260
  25. package/dist/cliproxy/quota-fetcher.js.map +1 -1
  26. package/dist/cliproxy/quota-types.d.ts +18 -4
  27. package/dist/cliproxy/quota-types.d.ts.map +1 -1
  28. package/dist/commands/api-command.d.ts.map +1 -1
  29. package/dist/commands/api-command.js +275 -1
  30. package/dist/commands/api-command.js.map +1 -1
  31. package/dist/commands/help-command.d.ts.map +1 -1
  32. package/dist/commands/help-command.js +4 -0
  33. package/dist/commands/help-command.js.map +1 -1
  34. package/dist/ui/assets/accounts-C19R3bH_.js +1 -0
  35. package/dist/ui/assets/{alert-dialog-Cua4nIwu.js → alert-dialog-HJSnKjIs.js} +1 -1
  36. package/dist/ui/assets/api-DSqH5CNY.js +4 -0
  37. package/dist/ui/assets/auth-section-CYKSK386.js +1 -0
  38. package/dist/ui/assets/backups-section-DG3ZbzbF.js +1 -0
  39. package/dist/ui/assets/{checkbox-BHwnoAEc.js → checkbox-Du_1Cq1z.js} +1 -1
  40. package/dist/ui/assets/cliproxy-CrhOC0jn.js +3 -0
  41. package/dist/ui/assets/cliproxy-control-panel-DLzDKBdd.js +1 -0
  42. package/dist/ui/assets/{confirm-dialog-sXvRWo2S.js → confirm-dialog-D5ln-pf7.js} +1 -1
  43. package/dist/ui/assets/{copilot-CpoZ-JIF.js → copilot-Bhp7sQwN.js} +2 -2
  44. package/dist/ui/assets/{cursor-DPNnilw3.js → cursor-Dfn3jHV4.js} +1 -1
  45. package/dist/ui/assets/{droid-DK_cjIrQ.js → droid-Vjl6_n7D.js} +1 -1
  46. package/dist/ui/assets/globalenv-section-CcmKdM4g.js +1 -0
  47. package/dist/ui/assets/{health-Den6iwHL.js → health-3zy8jvwf.js} +1 -1
  48. package/dist/ui/assets/{icons-BYZM_9Gm.js → icons-D2eEmpHv.js} +1 -1
  49. package/dist/ui/assets/index-BusjPRWX.css +1 -0
  50. package/dist/ui/assets/index-CP_OIR4n.js +1 -0
  51. package/dist/ui/assets/index-DbxzdeHz.js +1 -0
  52. package/dist/ui/assets/index-f_yPeQQQ.js +1 -0
  53. package/dist/ui/assets/{index-CHfQZxYq.js → index-iOpyYqld.js} +1 -1
  54. package/dist/ui/assets/index-uTmtgDew.js +47 -0
  55. package/dist/ui/assets/proxy-status-widget-1lHBE3f2.js +1 -0
  56. package/dist/ui/assets/{separator-CMSZsZ-K.js → separator-CsVbirkY.js} +1 -1
  57. package/dist/ui/assets/shared-DGq6uQfx.js +8 -0
  58. package/dist/ui/assets/{switch-BAw-ZttB.js → switch-BR0F3O9R.js} +1 -1
  59. package/dist/ui/assets/{updates-BsJ2V6_I.js → updates-ZSQz4CLF.js} +1 -1
  60. package/dist/ui/index.html +3 -3
  61. package/dist/web-server/routes/cliproxy-stats-routes.d.ts +12 -0
  62. package/dist/web-server/routes/cliproxy-stats-routes.d.ts.map +1 -1
  63. package/dist/web-server/routes/cliproxy-stats-routes.js +14 -0
  64. package/dist/web-server/routes/cliproxy-stats-routes.js.map +1 -1
  65. package/dist/web-server/routes/profile-routes.d.ts.map +1 -1
  66. package/dist/web-server/routes/profile-routes.js +206 -9
  67. package/dist/web-server/routes/profile-routes.js.map +1 -1
  68. package/package.json +1 -1
  69. package/dist/ui/assets/accounts-BrujKA4_.js +0 -1
  70. package/dist/ui/assets/api-h_I7-lO7.js +0 -1
  71. package/dist/ui/assets/auth-section-DCxO2_eL.js +0 -1
  72. package/dist/ui/assets/backups-section-EE1TN60x.js +0 -1
  73. package/dist/ui/assets/cliproxy-Cccwn5Zy.js +0 -3
  74. package/dist/ui/assets/cliproxy-control-panel-CSWIAklH.js +0 -1
  75. package/dist/ui/assets/globalenv-section-hiOP8-EO.js +0 -1
  76. package/dist/ui/assets/index-7UOuuXPH.js +0 -1
  77. package/dist/ui/assets/index-BfTpnChw.js +0 -1
  78. package/dist/ui/assets/index-CWdqGG3Z.js +0 -1
  79. package/dist/ui/assets/index-DmXx1Pyv.js +0 -47
  80. package/dist/ui/assets/index-WBo504Wu.css +0 -1
  81. package/dist/ui/assets/proxy-status-widget-Cx62Adpq.js +0 -1
  82. package/dist/ui/assets/shared-Cjq_jPQd.js +0 -8
@@ -1,47 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-BfTpnChw.js","assets/radix-ui-BR1vy4kf.js","assets/react-vendor-CNOkPC89.js","assets/switch-BAw-ZttB.js","assets/icons-BYZM_9Gm.js","assets/tanstack-e99Cjjy2.js","assets/notifications-B2HqRBj7.js","assets/utils-CzKF5WmX.js","assets/form-utils-Cn_Uld6y.js","assets/code-highlight-BRUf_pqB.js","assets/globalenv-section-hiOP8-EO.js","assets/index-7UOuuXPH.js","assets/index-CWdqGG3Z.js","assets/default-ports-1QQSffYX.js","assets/proxy-status-widget-Cx62Adpq.js","assets/alert-dialog-Cua4nIwu.js","assets/auth-section-DCxO2_eL.js","assets/backups-section-EE1TN60x.js","assets/index-CHfQZxYq.js","assets/charts-BBPXh0Ar.js","assets/api-h_I7-lO7.js","assets/confirm-dialog-sXvRWo2S.js","assets/separator-CMSZsZ-K.js","assets/cliproxy-Cccwn5Zy.js","assets/checkbox-BHwnoAEc.js","assets/cliproxy-control-panel-CSWIAklH.js","assets/copilot-CpoZ-JIF.js","assets/cursor-DPNnilw3.js","assets/droid-DK_cjIrQ.js","assets/accounts-BrujKA4_.js","assets/health-Den6iwHL.js","assets/shared-Cjq_jPQd.js","assets/updates-BsJ2V6_I.js"])))=>i.map(i=>d[i]);
2
- import{j as r,S as pr,R as Ay,C as ky,a as jy,T as Ty,D as My,P as Dy,O as Ey,b as U0,c as I0,d as H0,e as B0,f as K0,A as q0,g as G0,h as Y0,i as V0,k as F0,l as Q0,m as $0,n as W0,I as X0,o as Oy,p as Z0,q as Ry,r as Py,s as J0,t as Ly,V as eS,L as _y,u as zy,v as tS,w as nS,x as Uy,y as aS,z as iS,G as oS,B as Iy,E as sS,F as lS,H as Hy,J as rS,K as By,M as Ky,N as qy,Q as cS,U as uS,W as dS,X as Gy,Y as fS,Z as hS,_ as mS}from"./radix-ui-BR1vy4kf.js";import{e as Td,f as pS,r as S,u as gr,O as md,N as gS,h as Md,L as pd,R as yS,g as xS,i as vS,c as ie,B as bS,j as SS,k as Lt}from"./react-vendor-CNOkPC89.js";import{Q as CS,u as jt,a as dt,b as pt,c as wS}from"./tanstack-e99Cjjy2.js";import{t as ce,T as NS}from"./notifications-B2HqRBj7.js";import{L as Dn,X as bo,P as AS,C as yr,H as kS,a as jS,K as Yy,G as TS,Z as Vy,b as Fy,F as Qy,U as $y,S as MS,A as Ds,c as DS,d as ES,M as OS,E as xr,e as vr,B as RS,R as Es,W as PS,f as LS,g as _S,h as zS,i as cg,j as ug,k as xo,l as Dd,m as lr,n as Wy,o as US,p as IS,q as br,r as Ed,s as Xy,t as Os,u as Sr,v as Od,w as HS,x as BS,y as Cr,z as KS,T as va,D as qS,I as GS,J as wr,N as YS,O as VS,Q as FS,V as QS,Y as $S,_ as WS,$ as XS,a0 as Rd,a1 as dg,a2 as ZS,a3 as Pd,a4 as JS,a5 as eC,a6 as tC,a7 as fg,a8 as nC,a9 as aC}from"./icons-BYZM_9Gm.js";import{t as iC,c as oC,a as Nr,e as xs,f as Cs,b as sC,d as lC,g as rC,h as cC,i as uC,j as dC,k as fC,l as hC,m as mC,n as pC,o as gC,p as yC,q as xC,r as vC,s as bC,u as SC,v as CC,w as wC,x as NC,y as AC,z as kC,A as jC,B as TC,C as MC,D as DC,E as EC,F as OC,G as RC,H as PC,I as LC,J as _C}from"./utils-CzKF5WmX.js";import{o as hg,s as mg,p as zC,a as UC,$ as IC,b as Zy,c as HC,_ as BC,d as xi,u as KC,e as pg}from"./form-utils-Cn_Uld6y.js";import{H as qC,t as gg}from"./code-highlight-BRUf_pqB.js";(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))l(u);new MutationObserver(u=>{for(const f of u)if(f.type==="childList")for(const h of f.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&l(h)}).observe(document,{childList:!0,subtree:!0});function s(u){const f={};return u.integrity&&(f.integrity=u.integrity),u.referrerPolicy&&(f.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?f.credentials="include":u.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function l(u){if(u.ep)return;u.ep=!0;const f=s(u);fetch(u.href,f)}})();var Vu={exports:{}},vs={},Fu={exports:{}},Qu={};var yg;function GC(){return yg||(yg=1,(function(n){function a(R,$){var ee=R.length;R.push($);e:for(;0<ee;){var X=ee-1>>>1,se=R[X];if(0<u(se,$))R[X]=$,R[ee]=se,ee=X;else break e}}function s(R){return R.length===0?null:R[0]}function l(R){if(R.length===0)return null;var $=R[0],ee=R.pop();if(ee!==$){R[0]=ee;e:for(var X=0,se=R.length,fe=se>>>1;X<fe;){var Ne=2*(X+1)-1,V=R[Ne],J=Ne+1,le=R[J];if(0>u(V,ee))J<se&&0>u(le,V)?(R[X]=le,R[J]=ee,X=J):(R[X]=V,R[Ne]=ee,X=Ne);else if(J<se&&0>u(le,ee))R[X]=le,R[J]=ee,X=J;else break e}}return $}function u(R,$){var ee=R.sortIndex-$.sortIndex;return ee!==0?ee:R.id-$.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;n.unstable_now=function(){return f.now()}}else{var h=Date,m=h.now();n.unstable_now=function(){return h.now()-m}}var p=[],y=[],C=1,x=null,b=3,N=!1,w=!1,T=!1,E=!1,M=typeof setTimeout=="function"?setTimeout:null,H=typeof clearTimeout=="function"?clearTimeout:null,B=typeof setImmediate<"u"?setImmediate:null;function U(R){for(var $=s(y);$!==null;){if($.callback===null)l(y);else if($.startTime<=R)l(y),$.sortIndex=$.expirationTime,a(p,$);else break;$=s(y)}}function O(R){if(T=!1,U(R),!w)if(s(p)!==null)w=!0,A||(A=!0,te());else{var $=s(y);$!==null&&Ce(O,$.startTime-R)}}var A=!1,_=-1,W=5,F=-1;function Q(){return E?!0:!(n.unstable_now()-F<W)}function ae(){if(E=!1,A){var R=n.unstable_now();F=R;var $=!0;try{e:{w=!1,T&&(T=!1,H(_),_=-1),N=!0;var ee=b;try{t:{for(U(R),x=s(p);x!==null&&!(x.expirationTime>R&&Q());){var X=x.callback;if(typeof X=="function"){x.callback=null,b=x.priorityLevel;var se=X(x.expirationTime<=R);if(R=n.unstable_now(),typeof se=="function"){x.callback=se,U(R),$=!0;break t}x===s(p)&&l(p),U(R)}else l(p);x=s(p)}if(x!==null)$=!0;else{var fe=s(y);fe!==null&&Ce(O,fe.startTime-R),$=!1}}break e}finally{x=null,b=ee,N=!1}$=void 0}}finally{$?te():A=!1}}}var te;if(typeof B=="function")te=function(){B(ae)};else if(typeof MessageChannel<"u"){var ye=new MessageChannel,de=ye.port2;ye.port1.onmessage=ae,te=function(){de.postMessage(null)}}else te=function(){M(ae,0)};function Ce(R,$){_=M(function(){R(n.unstable_now())},$)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(R){R.callback=null},n.unstable_forceFrameRate=function(R){0>R||125<R?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):W=0<R?Math.floor(1e3/R):5},n.unstable_getCurrentPriorityLevel=function(){return b},n.unstable_next=function(R){switch(b){case 1:case 2:case 3:var $=3;break;default:$=b}var ee=b;b=$;try{return R()}finally{b=ee}},n.unstable_requestPaint=function(){E=!0},n.unstable_runWithPriority=function(R,$){switch(R){case 1:case 2:case 3:case 4:case 5:break;default:R=3}var ee=b;b=R;try{return $()}finally{b=ee}},n.unstable_scheduleCallback=function(R,$,ee){var X=n.unstable_now();switch(typeof ee=="object"&&ee!==null?(ee=ee.delay,ee=typeof ee=="number"&&0<ee?X+ee:X):ee=X,R){case 1:var se=-1;break;case 2:se=250;break;case 5:se=1073741823;break;case 4:se=1e4;break;default:se=5e3}return se=ee+se,R={id:C++,callback:$,priorityLevel:R,startTime:ee,expirationTime:se,sortIndex:-1},ee>X?(R.sortIndex=ee,a(y,R),s(p)===null&&R===s(y)&&(T?(H(_),_=-1):T=!0,Ce(O,ee-X))):(R.sortIndex=se,a(p,R),w||N||(w=!0,A||(A=!0,te()))),R},n.unstable_shouldYield=Q,n.unstable_wrapCallback=function(R){var $=b;return function(){var ee=b;b=$;try{return R.apply(this,arguments)}finally{b=ee}}}})(Qu)),Qu}var xg;function YC(){return xg||(xg=1,Fu.exports=GC()),Fu.exports}var vg;function VC(){if(vg)return vs;vg=1;var n=YC(),a=Td(),s=pS();function l(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)t+="&args[]="+encodeURIComponent(arguments[i])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function u(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function f(e){var t=e,i=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(i=t.return),e=t.return;while(e)}return t.tag===3?i:null}function h(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function m(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function p(e){if(f(e)!==e)throw Error(l(188))}function y(e){var t=e.alternate;if(!t){if(t=f(e),t===null)throw Error(l(188));return t!==e?null:e}for(var i=e,o=t;;){var c=i.return;if(c===null)break;var d=c.alternate;if(d===null){if(o=c.return,o!==null){i=o;continue}break}if(c.child===d.child){for(d=c.child;d;){if(d===i)return p(c),e;if(d===o)return p(c),t;d=d.sibling}throw Error(l(188))}if(i.return!==o.return)i=c,o=d;else{for(var g=!1,v=c.child;v;){if(v===i){g=!0,i=c,o=d;break}if(v===o){g=!0,o=c,i=d;break}v=v.sibling}if(!g){for(v=d.child;v;){if(v===i){g=!0,i=d,o=c;break}if(v===o){g=!0,o=d,i=c;break}v=v.sibling}if(!g)throw Error(l(189))}}if(i.alternate!==o)throw Error(l(190))}if(i.tag!==3)throw Error(l(188));return i.stateNode.current===i?e:t}function C(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=C(e),t!==null)return t;e=e.sibling}return null}var x=Object.assign,b=Symbol.for("react.element"),N=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),T=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),M=Symbol.for("react.profiler"),H=Symbol.for("react.consumer"),B=Symbol.for("react.context"),U=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),_=Symbol.for("react.memo"),W=Symbol.for("react.lazy"),F=Symbol.for("react.activity"),Q=Symbol.for("react.memo_cache_sentinel"),ae=Symbol.iterator;function te(e){return e===null||typeof e!="object"?null:(e=ae&&e[ae]||e["@@iterator"],typeof e=="function"?e:null)}var ye=Symbol.for("react.client.reference");function de(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ye?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case T:return"Fragment";case M:return"Profiler";case E:return"StrictMode";case O:return"Suspense";case A:return"SuspenseList";case F:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case w:return"Portal";case B:return e.displayName||"Context";case H:return(e._context.displayName||"Context")+".Consumer";case U:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case _:return t=e.displayName||null,t!==null?t:de(e.type)||"Memo";case W:t=e._payload,e=e._init;try{return de(e(t))}catch{}}return null}var Ce=Array.isArray,R=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ee={pending:!1,data:null,method:null,action:null},X=[],se=-1;function fe(e){return{current:e}}function Ne(e){0>se||(e.current=X[se],X[se]=null,se--)}function V(e,t){se++,X[se]=e.current,e.current=t}var J=fe(null),le=fe(null),ne=fe(null),oe=fe(null);function xe(e,t){switch(V(ne,t),V(le,e),V(J,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Op(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Op(t),e=Rp(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Ne(J),V(J,e)}function Pe(){Ne(J),Ne(le),Ne(ne)}function qe(e){e.memoizedState!==null&&V(oe,e);var t=J.current,i=Rp(t,e.type);t!==i&&(V(le,e),V(J,i))}function St(e){le.current===e&&(Ne(J),Ne(le)),oe.current===e&&(Ne(oe),ms._currentValue=ee)}var Ct,Ye;function nt(e){if(Ct===void 0)try{throw Error()}catch(i){var t=i.stack.trim().match(/\n( *(at )?)/);Ct=t&&t[1]||"",Ye=-1<i.stack.indexOf(`
3
- at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
4
- `+Ct+e+Ye}var Ut=!1;function Qt(e,t){if(!e||Ut)return"";Ut=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var o={DetermineComponentFrameRoot:function(){try{if(t){var Y=function(){throw Error()};if(Object.defineProperty(Y.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Y,[])}catch(I){var z=I}Reflect.construct(e,[],Y)}else{try{Y.call()}catch(I){z=I}e.call(Y.prototype)}}else{try{throw Error()}catch(I){z=I}(Y=e())&&typeof Y.catch=="function"&&Y.catch(function(){})}}catch(I){if(I&&z&&typeof I.stack=="string")return[I.stack,z.stack]}return[null,null]}};o.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var c=Object.getOwnPropertyDescriptor(o.DetermineComponentFrameRoot,"name");c&&c.configurable&&Object.defineProperty(o.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var d=o.DetermineComponentFrameRoot(),g=d[0],v=d[1];if(g&&v){var k=g.split(`
5
- `),L=v.split(`
6
- `);for(c=o=0;o<k.length&&!k[o].includes("DetermineComponentFrameRoot");)o++;for(;c<L.length&&!L[c].includes("DetermineComponentFrameRoot");)c++;if(o===k.length||c===L.length)for(o=k.length-1,c=L.length-1;1<=o&&0<=c&&k[o]!==L[c];)c--;for(;1<=o&&0<=c;o--,c--)if(k[o]!==L[c]){if(o!==1||c!==1)do if(o--,c--,0>c||k[o]!==L[c]){var q=`
7
- `+k[o].replace(" at new "," at ");return e.displayName&&q.includes("<anonymous>")&&(q=q.replace("<anonymous>",e.displayName)),q}while(1<=o&&0<=c);break}}}finally{Ut=!1,Error.prepareStackTrace=i}return(i=e?e.displayName||e.name:"")?nt(i):""}function Gn(e,t){switch(e.tag){case 26:case 27:case 5:return nt(e.type);case 16:return nt("Lazy");case 13:return e.child!==t&&t!==null?nt("Suspense Fallback"):nt("Suspense");case 19:return nt("SuspenseList");case 0:case 15:return Qt(e.type,!1);case 11:return Qt(e.type.render,!1);case 1:return Qt(e.type,!0);case 31:return nt("Activity");default:return""}}function je(e){try{var t="",i=null;do t+=Gn(e,i),i=e,e=e.return;while(e);return t}catch(o){return`
8
- Error generating stack: `+o.message+`
9
- `+o.stack}}var $t=Object.prototype.hasOwnProperty,En=n.unstable_scheduleCallback,Wt=n.unstable_cancelCallback,Sa=n.unstable_shouldYield,Yn=n.unstable_requestPaint,ft=n.unstable_now,Xt=n.unstable_getCurrentPriorityLevel,Vn=n.unstable_ImmediatePriority,Ja=n.unstable_UserBlockingPriority,On=n.unstable_NormalPriority,Rn=n.unstable_LowPriority,ji=n.unstable_IdlePriority,wo=n.log,No=n.unstable_setDisableYieldValue,Fn=null,Z=null;function De(e){if(typeof wo=="function"&&No(e),Z&&typeof Z.setStrictMode=="function")try{Z.setStrictMode(Fn,e)}catch{}}var ve=Math.clz32?Math.clz32:he,Ee=Math.log,at=Math.LN2;function he(e){return e>>>=0,e===0?32:31-(Ee(e)/at|0)|0}var ke=256,be=262144,Oe=4194304;function Je(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function we(e,t,i){var o=e.pendingLanes;if(o===0)return 0;var c=0,d=e.suspendedLanes,g=e.pingedLanes;e=e.warmLanes;var v=o&134217727;return v!==0?(o=v&~d,o!==0?c=Je(o):(g&=v,g!==0?c=Je(g):i||(i=v&~e,i!==0&&(c=Je(i))))):(v=o&~d,v!==0?c=Je(v):g!==0?c=Je(g):i||(i=o&~e,i!==0&&(c=Je(i)))),c===0?0:t!==0&&t!==c&&(t&d)===0&&(d=c&-c,i=t&-t,d>=i||d===32&&(i&4194048)!==0)?t:c}function Pt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Qn(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Nt(){var e=Oe;return Oe<<=1,(Oe&62914560)===0&&(Oe=4194304),e}function Zt(e){for(var t=[],i=0;31>i;i++)t.push(e);return t}function wn(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ao(e,t,i,o,c,d){var g=e.pendingLanes;e.pendingLanes=i,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=i,e.entangledLanes&=i,e.errorRecoveryDisabledLanes&=i,e.shellSuspendCounter=0;var v=e.entanglements,k=e.expirationTimes,L=e.hiddenUpdates;for(i=g&~i;0<i;){var q=31-ve(i),Y=1<<q;v[q]=0,k[q]=-1;var z=L[q];if(z!==null)for(L[q]=null,q=0;q<z.length;q++){var I=z[q];I!==null&&(I.lane&=-536870913)}i&=~Y}o!==0&&ei(e,o,0),d!==0&&c===0&&e.tag!==0&&(e.suspendedLanes|=d&~(g&~t))}function ei(e,t,i){e.pendingLanes|=t,e.suspendedLanes&=~t;var o=31-ve(t);e.entangledLanes|=t,e.entanglements[o]=e.entanglements[o]|1073741824|i&261930}function ko(e,t){var i=e.entangledLanes|=t;for(e=e.entanglements;i;){var o=31-ve(i),c=1<<o;c&t|e[o]&t&&(e[o]|=t),i&=~c}}function dn(e,t){var i=t&-t;return i=(i&42)!==0?1:$n(i),(i&(e.suspendedLanes|t))!==0?0:i}function $n(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Ti(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function jo(){var e=$.p;return e!==0?e:(e=window.event,e===void 0?32:ng(e.type))}function To(e,t){var i=$.p;try{return $.p=e,t()}finally{$.p=i}}var Ca=Math.random().toString(36).slice(2),Tt="__reactFiber$"+Ca,It="__reactProps$"+Ca,Mi="__reactContainer$"+Ca,zr="__reactEvents$"+Ca,jv="__reactListeners$"+Ca,Tv="__reactHandles$"+Ca,vf="__reactResources$"+Ca,Mo="__reactMarker$"+Ca;function Ur(e){delete e[Tt],delete e[It],delete e[zr],delete e[jv],delete e[Tv]}function Di(e){var t=e[Tt];if(t)return t;for(var i=e.parentNode;i;){if(t=i[Mi]||i[Tt]){if(i=t.alternate,t.child!==null||i!==null&&i.child!==null)for(e=Hp(e);e!==null;){if(i=e[Tt])return i;e=Hp(e)}return t}e=i,i=e.parentNode}return null}function Ei(e){if(e=e[Tt]||e[Mi]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Do(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(l(33))}function Oi(e){var t=e[vf];return t||(t=e[vf]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function At(e){e[Mo]=!0}var bf=new Set,Sf={};function ti(e,t){Ri(e,t),Ri(e+"Capture",t)}function Ri(e,t){for(Sf[e]=t,e=0;e<t.length;e++)bf.add(t[e])}var Mv=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Cf={},wf={};function Dv(e){return $t.call(wf,e)?!0:$t.call(Cf,e)?!1:Mv.test(e)?wf[e]=!0:(Cf[e]=!0,!1)}function Hs(e,t,i){if(Dv(t))if(i===null)e.removeAttribute(t);else{switch(typeof i){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var o=t.toLowerCase().slice(0,5);if(o!=="data-"&&o!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+i)}}function Bs(e,t,i){if(i===null)e.removeAttribute(t);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+i)}}function Wn(e,t,i,o){if(o===null)e.removeAttribute(i);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(i);return}e.setAttributeNS(t,i,""+o)}}function fn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Nf(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Ev(e,t,i){var o=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var c=o.get,d=o.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return c.call(this)},set:function(g){i=""+g,d.call(this,g)}}),Object.defineProperty(e,t,{enumerable:o.enumerable}),{getValue:function(){return i},setValue:function(g){i=""+g},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ir(e){if(!e._valueTracker){var t=Nf(e)?"checked":"value";e._valueTracker=Ev(e,t,""+e[t])}}function Af(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var i=t.getValue(),o="";return e&&(o=Nf(e)?e.checked?"true":"false":e.value),e=o,e!==i?(t.setValue(e),!0):!1}function Ks(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var Ov=/[\n"\\]/g;function hn(e){return e.replace(Ov,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Hr(e,t,i,o,c,d,g,v){e.name="",g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"?e.type=g:e.removeAttribute("type"),t!=null?g==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+fn(t)):e.value!==""+fn(t)&&(e.value=""+fn(t)):g!=="submit"&&g!=="reset"||e.removeAttribute("value"),t!=null?Br(e,g,fn(t)):i!=null?Br(e,g,fn(i)):o!=null&&e.removeAttribute("value"),c==null&&d!=null&&(e.defaultChecked=!!d),c!=null&&(e.checked=c&&typeof c!="function"&&typeof c!="symbol"),v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"?e.name=""+fn(v):e.removeAttribute("name")}function kf(e,t,i,o,c,d,g,v){if(d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(e.type=d),t!=null||i!=null){if(!(d!=="submit"&&d!=="reset"||t!=null)){Ir(e);return}i=i!=null?""+fn(i):"",t=t!=null?""+fn(t):i,v||t===e.value||(e.value=t),e.defaultValue=t}o=o??c,o=typeof o!="function"&&typeof o!="symbol"&&!!o,e.checked=v?e.checked:!!o,e.defaultChecked=!!o,g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(e.name=g),Ir(e)}function Br(e,t,i){t==="number"&&Ks(e.ownerDocument)===e||e.defaultValue===""+i||(e.defaultValue=""+i)}function Pi(e,t,i,o){if(e=e.options,t){t={};for(var c=0;c<i.length;c++)t["$"+i[c]]=!0;for(i=0;i<e.length;i++)c=t.hasOwnProperty("$"+e[i].value),e[i].selected!==c&&(e[i].selected=c),c&&o&&(e[i].defaultSelected=!0)}else{for(i=""+fn(i),t=null,c=0;c<e.length;c++){if(e[c].value===i){e[c].selected=!0,o&&(e[c].defaultSelected=!0);return}t!==null||e[c].disabled||(t=e[c])}t!==null&&(t.selected=!0)}}function jf(e,t,i){if(t!=null&&(t=""+fn(t),t!==e.value&&(e.value=t),i==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=i!=null?""+fn(i):""}function Tf(e,t,i,o){if(t==null){if(o!=null){if(i!=null)throw Error(l(92));if(Ce(o)){if(1<o.length)throw Error(l(93));o=o[0]}i=o}i==null&&(i=""),t=i}i=fn(t),e.defaultValue=i,o=e.textContent,o===i&&o!==""&&o!==null&&(e.value=o),Ir(e)}function Li(e,t){if(t){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=t;return}}e.textContent=t}var Rv=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Mf(e,t,i){var o=t.indexOf("--")===0;i==null||typeof i=="boolean"||i===""?o?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":o?e.setProperty(t,i):typeof i!="number"||i===0||Rv.has(t)?t==="float"?e.cssFloat=i:e[t]=(""+i).trim():e[t]=i+"px"}function Df(e,t,i){if(t!=null&&typeof t!="object")throw Error(l(62));if(e=e.style,i!=null){for(var o in i)!i.hasOwnProperty(o)||t!=null&&t.hasOwnProperty(o)||(o.indexOf("--")===0?e.setProperty(o,""):o==="float"?e.cssFloat="":e[o]="");for(var c in t)o=t[c],t.hasOwnProperty(c)&&i[c]!==o&&Mf(e,c,o)}else for(var d in t)t.hasOwnProperty(d)&&Mf(e,d,t[d])}function Kr(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Pv=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Lv=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function qs(e){return Lv.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Xn(){}var qr=null;function Gr(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var _i=null,zi=null;function Ef(e){var t=Ei(e);if(t&&(e=t.stateNode)){var i=e[It]||null;e:switch(e=t.stateNode,t.type){case"input":if(Hr(e,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name),t=i.name,i.type==="radio"&&t!=null){for(i=e;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll('input[name="'+hn(""+t)+'"][type="radio"]'),t=0;t<i.length;t++){var o=i[t];if(o!==e&&o.form===e.form){var c=o[It]||null;if(!c)throw Error(l(90));Hr(o,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name)}}for(t=0;t<i.length;t++)o=i[t],o.form===e.form&&Af(o)}break e;case"textarea":jf(e,i.value,i.defaultValue);break e;case"select":t=i.value,t!=null&&Pi(e,!!i.multiple,t,!1)}}}var Yr=!1;function Of(e,t,i){if(Yr)return e(t,i);Yr=!0;try{var o=e(t);return o}finally{if(Yr=!1,(_i!==null||zi!==null)&&(Dl(),_i&&(t=_i,e=zi,zi=_i=null,Ef(t),e)))for(t=0;t<e.length;t++)Ef(e[t])}}function Eo(e,t){var i=e.stateNode;if(i===null)return null;var o=i[It]||null;if(o===null)return null;i=o[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(o=!o.disabled)||(e=e.type,o=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!o;break e;default:e=!1}if(e)return null;if(i&&typeof i!="function")throw Error(l(231,t,typeof i));return i}var Zn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Vr=!1;if(Zn)try{var Oo={};Object.defineProperty(Oo,"passive",{get:function(){Vr=!0}}),window.addEventListener("test",Oo,Oo),window.removeEventListener("test",Oo,Oo)}catch{Vr=!1}var wa=null,Fr=null,Gs=null;function Rf(){if(Gs)return Gs;var e,t=Fr,i=t.length,o,c="value"in wa?wa.value:wa.textContent,d=c.length;for(e=0;e<i&&t[e]===c[e];e++);var g=i-e;for(o=1;o<=g&&t[i-o]===c[d-o];o++);return Gs=c.slice(e,1<o?1-o:void 0)}function Ys(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Vs(){return!0}function Pf(){return!1}function Ht(e){function t(i,o,c,d,g){this._reactName=i,this._targetInst=c,this.type=o,this.nativeEvent=d,this.target=g,this.currentTarget=null;for(var v in e)e.hasOwnProperty(v)&&(i=e[v],this[v]=i?i(d):d[v]);return this.isDefaultPrevented=(d.defaultPrevented!=null?d.defaultPrevented:d.returnValue===!1)?Vs:Pf,this.isPropagationStopped=Pf,this}return x(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=Vs)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=Vs)},persist:function(){},isPersistent:Vs}),t}var ni={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Fs=Ht(ni),Ro=x({},ni,{view:0,detail:0}),_v=Ht(Ro),Qr,$r,Po,Qs=x({},Ro,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Xr,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Po&&(Po&&e.type==="mousemove"?(Qr=e.screenX-Po.screenX,$r=e.screenY-Po.screenY):$r=Qr=0,Po=e),Qr)},movementY:function(e){return"movementY"in e?e.movementY:$r}}),Lf=Ht(Qs),zv=x({},Qs,{dataTransfer:0}),Uv=Ht(zv),Iv=x({},Ro,{relatedTarget:0}),Wr=Ht(Iv),Hv=x({},ni,{animationName:0,elapsedTime:0,pseudoElement:0}),Bv=Ht(Hv),Kv=x({},ni,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),qv=Ht(Kv),Gv=x({},ni,{data:0}),_f=Ht(Gv),Yv={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Vv={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Fv={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Qv(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Fv[e])?!!t[e]:!1}function Xr(){return Qv}var $v=x({},Ro,{key:function(e){if(e.key){var t=Yv[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ys(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Vv[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Xr,charCode:function(e){return e.type==="keypress"?Ys(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ys(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Wv=Ht($v),Xv=x({},Qs,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),zf=Ht(Xv),Zv=x({},Ro,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Xr}),Jv=Ht(Zv),eb=x({},ni,{propertyName:0,elapsedTime:0,pseudoElement:0}),tb=Ht(eb),nb=x({},Qs,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),ab=Ht(nb),ib=x({},ni,{newState:0,oldState:0}),ob=Ht(ib),sb=[9,13,27,32],Zr=Zn&&"CompositionEvent"in window,Lo=null;Zn&&"documentMode"in document&&(Lo=document.documentMode);var lb=Zn&&"TextEvent"in window&&!Lo,Uf=Zn&&(!Zr||Lo&&8<Lo&&11>=Lo),If=" ",Hf=!1;function Bf(e,t){switch(e){case"keyup":return sb.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Kf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ui=!1;function rb(e,t){switch(e){case"compositionend":return Kf(t);case"keypress":return t.which!==32?null:(Hf=!0,If);case"textInput":return e=t.data,e===If&&Hf?null:e;default:return null}}function cb(e,t){if(Ui)return e==="compositionend"||!Zr&&Bf(e,t)?(e=Rf(),Gs=Fr=wa=null,Ui=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Uf&&t.locale!=="ko"?null:t.data;default:return null}}var ub={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function qf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!ub[e.type]:t==="textarea"}function Gf(e,t,i,o){_i?zi?zi.push(o):zi=[o]:_i=o,t=zl(t,"onChange"),0<t.length&&(i=new Fs("onChange","change",null,i,o),e.push({event:i,listeners:t}))}var _o=null,zo=null;function db(e){kp(e,0)}function $s(e){var t=Do(e);if(Af(t))return e}function Yf(e,t){if(e==="change")return t}var Vf=!1;if(Zn){var Jr;if(Zn){var ec="oninput"in document;if(!ec){var Ff=document.createElement("div");Ff.setAttribute("oninput","return;"),ec=typeof Ff.oninput=="function"}Jr=ec}else Jr=!1;Vf=Jr&&(!document.documentMode||9<document.documentMode)}function Qf(){_o&&(_o.detachEvent("onpropertychange",$f),zo=_o=null)}function $f(e){if(e.propertyName==="value"&&$s(zo)){var t=[];Gf(t,zo,e,Gr(e)),Of(db,t)}}function fb(e,t,i){e==="focusin"?(Qf(),_o=t,zo=i,_o.attachEvent("onpropertychange",$f)):e==="focusout"&&Qf()}function hb(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return $s(zo)}function mb(e,t){if(e==="click")return $s(t)}function pb(e,t){if(e==="input"||e==="change")return $s(t)}function gb(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Jt=typeof Object.is=="function"?Object.is:gb;function Uo(e,t){if(Jt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var i=Object.keys(e),o=Object.keys(t);if(i.length!==o.length)return!1;for(o=0;o<i.length;o++){var c=i[o];if(!$t.call(t,c)||!Jt(e[c],t[c]))return!1}return!0}function Wf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Xf(e,t){var i=Wf(e);e=0;for(var o;i;){if(i.nodeType===3){if(o=e+i.textContent.length,e<=t&&o>=t)return{node:i,offset:t-e};e=o}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=Wf(i)}}function Zf(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Zf(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Jf(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ks(e.document);t instanceof e.HTMLIFrameElement;){try{var i=typeof t.contentWindow.location.href=="string"}catch{i=!1}if(i)e=t.contentWindow;else break;t=Ks(e.document)}return t}function tc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var yb=Zn&&"documentMode"in document&&11>=document.documentMode,Ii=null,nc=null,Io=null,ac=!1;function eh(e,t,i){var o=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;ac||Ii==null||Ii!==Ks(o)||(o=Ii,"selectionStart"in o&&tc(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),Io&&Uo(Io,o)||(Io=o,o=zl(nc,"onSelect"),0<o.length&&(t=new Fs("onSelect","select",null,t,i),e.push({event:t,listeners:o}),t.target=Ii)))}function ai(e,t){var i={};return i[e.toLowerCase()]=t.toLowerCase(),i["Webkit"+e]="webkit"+t,i["Moz"+e]="moz"+t,i}var Hi={animationend:ai("Animation","AnimationEnd"),animationiteration:ai("Animation","AnimationIteration"),animationstart:ai("Animation","AnimationStart"),transitionrun:ai("Transition","TransitionRun"),transitionstart:ai("Transition","TransitionStart"),transitioncancel:ai("Transition","TransitionCancel"),transitionend:ai("Transition","TransitionEnd")},ic={},th={};Zn&&(th=document.createElement("div").style,"AnimationEvent"in window||(delete Hi.animationend.animation,delete Hi.animationiteration.animation,delete Hi.animationstart.animation),"TransitionEvent"in window||delete Hi.transitionend.transition);function ii(e){if(ic[e])return ic[e];if(!Hi[e])return e;var t=Hi[e],i;for(i in t)if(t.hasOwnProperty(i)&&i in th)return ic[e]=t[i];return e}var nh=ii("animationend"),ah=ii("animationiteration"),ih=ii("animationstart"),xb=ii("transitionrun"),vb=ii("transitionstart"),bb=ii("transitioncancel"),oh=ii("transitionend"),sh=new Map,oc="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");oc.push("scrollEnd");function Nn(e,t){sh.set(e,t),ti(t,[e])}var Ws=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},mn=[],Bi=0,sc=0;function Xs(){for(var e=Bi,t=sc=Bi=0;t<e;){var i=mn[t];mn[t++]=null;var o=mn[t];mn[t++]=null;var c=mn[t];mn[t++]=null;var d=mn[t];if(mn[t++]=null,o!==null&&c!==null){var g=o.pending;g===null?c.next=c:(c.next=g.next,g.next=c),o.pending=c}d!==0&&lh(i,c,d)}}function Zs(e,t,i,o){mn[Bi++]=e,mn[Bi++]=t,mn[Bi++]=i,mn[Bi++]=o,sc|=o,e.lanes|=o,e=e.alternate,e!==null&&(e.lanes|=o)}function lc(e,t,i,o){return Zs(e,t,i,o),Js(e)}function oi(e,t){return Zs(e,null,null,t),Js(e)}function lh(e,t,i){e.lanes|=i;var o=e.alternate;o!==null&&(o.lanes|=i);for(var c=!1,d=e.return;d!==null;)d.childLanes|=i,o=d.alternate,o!==null&&(o.childLanes|=i),d.tag===22&&(e=d.stateNode,e===null||e._visibility&1||(c=!0)),e=d,d=d.return;return e.tag===3?(d=e.stateNode,c&&t!==null&&(c=31-ve(i),e=d.hiddenUpdates,o=e[c],o===null?e[c]=[t]:o.push(t),t.lane=i|536870912),d):null}function Js(e){if(50<ls)throw ls=0,gu=null,Error(l(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ki={};function Sb(e,t,i,o){this.tag=e,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function en(e,t,i,o){return new Sb(e,t,i,o)}function rc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Jn(e,t){var i=e.alternate;return i===null?(i=en(e.tag,t,e.key,e.mode),i.elementType=e.elementType,i.type=e.type,i.stateNode=e.stateNode,i.alternate=e,e.alternate=i):(i.pendingProps=t,i.type=e.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=e.flags&65011712,i.childLanes=e.childLanes,i.lanes=e.lanes,i.child=e.child,i.memoizedProps=e.memoizedProps,i.memoizedState=e.memoizedState,i.updateQueue=e.updateQueue,t=e.dependencies,i.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},i.sibling=e.sibling,i.index=e.index,i.ref=e.ref,i.refCleanup=e.refCleanup,i}function rh(e,t){e.flags&=65011714;var i=e.alternate;return i===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=i.childLanes,e.lanes=i.lanes,e.child=i.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=i.memoizedProps,e.memoizedState=i.memoizedState,e.updateQueue=i.updateQueue,e.type=i.type,t=i.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function el(e,t,i,o,c,d){var g=0;if(o=e,typeof e=="function")rc(e)&&(g=1);else if(typeof e=="string")g=k0(e,i,J.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case F:return e=en(31,i,t,c),e.elementType=F,e.lanes=d,e;case T:return si(i.children,c,d,t);case E:g=8,c|=24;break;case M:return e=en(12,i,t,c|2),e.elementType=M,e.lanes=d,e;case O:return e=en(13,i,t,c),e.elementType=O,e.lanes=d,e;case A:return e=en(19,i,t,c),e.elementType=A,e.lanes=d,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case B:g=10;break e;case H:g=9;break e;case U:g=11;break e;case _:g=14;break e;case W:g=16,o=null;break e}g=29,i=Error(l(130,e===null?"null":typeof e,"")),o=null}return t=en(g,i,t,c),t.elementType=e,t.type=o,t.lanes=d,t}function si(e,t,i,o){return e=en(7,e,o,t),e.lanes=i,e}function cc(e,t,i){return e=en(6,e,null,t),e.lanes=i,e}function ch(e){var t=en(18,null,null,0);return t.stateNode=e,t}function uc(e,t,i){return t=en(4,e.children!==null?e.children:[],e.key,t),t.lanes=i,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var uh=new WeakMap;function pn(e,t){if(typeof e=="object"&&e!==null){var i=uh.get(e);return i!==void 0?i:(t={value:e,source:t,stack:je(t)},uh.set(e,t),t)}return{value:e,source:t,stack:je(t)}}var qi=[],Gi=0,tl=null,Ho=0,gn=[],yn=0,Na=null,Pn=1,Ln="";function ea(e,t){qi[Gi++]=Ho,qi[Gi++]=tl,tl=e,Ho=t}function dh(e,t,i){gn[yn++]=Pn,gn[yn++]=Ln,gn[yn++]=Na,Na=e;var o=Pn;e=Ln;var c=32-ve(o)-1;o&=~(1<<c),i+=1;var d=32-ve(t)+c;if(30<d){var g=c-c%5;d=(o&(1<<g)-1).toString(32),o>>=g,c-=g,Pn=1<<32-ve(t)+c|i<<c|o,Ln=d+e}else Pn=1<<d|i<<c|o,Ln=e}function dc(e){e.return!==null&&(ea(e,1),dh(e,1,0))}function fc(e){for(;e===tl;)tl=qi[--Gi],qi[Gi]=null,Ho=qi[--Gi],qi[Gi]=null;for(;e===Na;)Na=gn[--yn],gn[yn]=null,Ln=gn[--yn],gn[yn]=null,Pn=gn[--yn],gn[yn]=null}function fh(e,t){gn[yn++]=Pn,gn[yn++]=Ln,gn[yn++]=Na,Pn=t.id,Ln=t.overflow,Na=e}var Mt=null,et=null,Ie=!1,Aa=null,xn=!1,hc=Error(l(519));function ka(e){var t=Error(l(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Bo(pn(t,e)),hc}function hh(e){var t=e.stateNode,i=e.type,o=e.memoizedProps;switch(t[Tt]=e,t[It]=o,i){case"dialog":_e("cancel",t),_e("close",t);break;case"iframe":case"object":case"embed":_e("load",t);break;case"video":case"audio":for(i=0;i<cs.length;i++)_e(cs[i],t);break;case"source":_e("error",t);break;case"img":case"image":case"link":_e("error",t),_e("load",t);break;case"details":_e("toggle",t);break;case"input":_e("invalid",t),kf(t,o.value,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name,!0);break;case"select":_e("invalid",t);break;case"textarea":_e("invalid",t),Tf(t,o.value,o.defaultValue,o.children)}i=o.children,typeof i!="string"&&typeof i!="number"&&typeof i!="bigint"||t.textContent===""+i||o.suppressHydrationWarning===!0||Dp(t.textContent,i)?(o.popover!=null&&(_e("beforetoggle",t),_e("toggle",t)),o.onScroll!=null&&_e("scroll",t),o.onScrollEnd!=null&&_e("scrollend",t),o.onClick!=null&&(t.onclick=Xn),t=!0):t=!1,t||ka(e,!0)}function mh(e){for(Mt=e.return;Mt;)switch(Mt.tag){case 5:case 31:case 13:xn=!1;return;case 27:case 3:xn=!0;return;default:Mt=Mt.return}}function Yi(e){if(e!==Mt)return!1;if(!Ie)return mh(e),Ie=!0,!1;var t=e.tag,i;if((i=t!==3&&t!==27)&&((i=t===5)&&(i=e.type,i=!(i!=="form"&&i!=="button")||Eu(e.type,e.memoizedProps)),i=!i),i&&et&&ka(e),mh(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));et=Ip(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));et=Ip(e)}else t===27?(t=et,Ha(e.type)?(e=_u,_u=null,et=e):et=t):et=Mt?bn(e.stateNode.nextSibling):null;return!0}function li(){et=Mt=null,Ie=!1}function mc(){var e=Aa;return e!==null&&(Gt===null?Gt=e:Gt.push.apply(Gt,e),Aa=null),e}function Bo(e){Aa===null?Aa=[e]:Aa.push(e)}var pc=fe(null),ri=null,ta=null;function ja(e,t,i){V(pc,t._currentValue),t._currentValue=i}function na(e){e._currentValue=pc.current,Ne(pc)}function gc(e,t,i){for(;e!==null;){var o=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,o!==null&&(o.childLanes|=t)):o!==null&&(o.childLanes&t)!==t&&(o.childLanes|=t),e===i)break;e=e.return}}function yc(e,t,i,o){var c=e.child;for(c!==null&&(c.return=e);c!==null;){var d=c.dependencies;if(d!==null){var g=c.child;d=d.firstContext;e:for(;d!==null;){var v=d;d=c;for(var k=0;k<t.length;k++)if(v.context===t[k]){d.lanes|=i,v=d.alternate,v!==null&&(v.lanes|=i),gc(d.return,i,e),o||(g=null);break e}d=v.next}}else if(c.tag===18){if(g=c.return,g===null)throw Error(l(341));g.lanes|=i,d=g.alternate,d!==null&&(d.lanes|=i),gc(g,i,e),g=null}else g=c.child;if(g!==null)g.return=c;else for(g=c;g!==null;){if(g===e){g=null;break}if(c=g.sibling,c!==null){c.return=g.return,g=c;break}g=g.return}c=g}}function Vi(e,t,i,o){e=null;for(var c=t,d=!1;c!==null;){if(!d){if((c.flags&524288)!==0)d=!0;else if((c.flags&262144)!==0)break}if(c.tag===10){var g=c.alternate;if(g===null)throw Error(l(387));if(g=g.memoizedProps,g!==null){var v=c.type;Jt(c.pendingProps.value,g.value)||(e!==null?e.push(v):e=[v])}}else if(c===oe.current){if(g=c.alternate,g===null)throw Error(l(387));g.memoizedState.memoizedState!==c.memoizedState.memoizedState&&(e!==null?e.push(ms):e=[ms])}c=c.return}e!==null&&yc(t,e,i,o),t.flags|=262144}function nl(e){for(e=e.firstContext;e!==null;){if(!Jt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ci(e){ri=e,ta=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Dt(e){return ph(ri,e)}function al(e,t){return ri===null&&ci(e),ph(e,t)}function ph(e,t){var i=t._currentValue;if(t={context:t,memoizedValue:i,next:null},ta===null){if(e===null)throw Error(l(308));ta=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ta=ta.next=t;return i}var Cb=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(i,o){e.push(o)}};this.abort=function(){t.aborted=!0,e.forEach(function(i){return i()})}},wb=n.unstable_scheduleCallback,Nb=n.unstable_NormalPriority,yt={$$typeof:B,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function xc(){return{controller:new Cb,data:new Map,refCount:0}}function Ko(e){e.refCount--,e.refCount===0&&wb(Nb,function(){e.controller.abort()})}var qo=null,vc=0,Fi=0,Qi=null;function Ab(e,t){if(qo===null){var i=qo=[];vc=0,Fi=Cu(),Qi={status:"pending",value:void 0,then:function(o){i.push(o)}}}return vc++,t.then(gh,gh),t}function gh(){if(--vc===0&&qo!==null){Qi!==null&&(Qi.status="fulfilled");var e=qo;qo=null,Fi=0,Qi=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function kb(e,t){var i=[],o={status:"pending",value:null,reason:null,then:function(c){i.push(c)}};return e.then(function(){o.status="fulfilled",o.value=t;for(var c=0;c<i.length;c++)(0,i[c])(t)},function(c){for(o.status="rejected",o.reason=c,c=0;c<i.length;c++)(0,i[c])(void 0)}),o}var yh=R.S;R.S=function(e,t){ep=ft(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Ab(e,t),yh!==null&&yh(e,t)};var ui=fe(null);function bc(){var e=ui.current;return e!==null?e:Ze.pooledCache}function il(e,t){t===null?V(ui,ui.current):V(ui,t.pool)}function xh(){var e=bc();return e===null?null:{parent:yt._currentValue,pool:e}}var $i=Error(l(460)),Sc=Error(l(474)),ol=Error(l(542)),sl={then:function(){}};function vh(e){return e=e.status,e==="fulfilled"||e==="rejected"}function bh(e,t,i){switch(i=e[i],i===void 0?e.push(t):i!==t&&(t.then(Xn,Xn),t=i),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Ch(e),e;default:if(typeof t.status=="string")t.then(Xn,Xn);else{if(e=Ze,e!==null&&100<e.shellSuspendCounter)throw Error(l(482));e=t,e.status="pending",e.then(function(o){if(t.status==="pending"){var c=t;c.status="fulfilled",c.value=o}},function(o){if(t.status==="pending"){var c=t;c.status="rejected",c.reason=o}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Ch(e),e}throw fi=t,$i}}function di(e){try{var t=e._init;return t(e._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?(fi=i,$i):i}}var fi=null;function Sh(){if(fi===null)throw Error(l(459));var e=fi;return fi=null,e}function Ch(e){if(e===$i||e===ol)throw Error(l(483))}var Wi=null,Go=0;function ll(e){var t=Go;return Go+=1,Wi===null&&(Wi=[]),bh(Wi,e,t)}function Yo(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function rl(e,t){throw t.$$typeof===b?Error(l(525)):(e=Object.prototype.toString.call(t),Error(l(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function wh(e){function t(D,j){if(e){var P=D.deletions;P===null?(D.deletions=[j],D.flags|=16):P.push(j)}}function i(D,j){if(!e)return null;for(;j!==null;)t(D,j),j=j.sibling;return null}function o(D){for(var j=new Map;D!==null;)D.key!==null?j.set(D.key,D):j.set(D.index,D),D=D.sibling;return j}function c(D,j){return D=Jn(D,j),D.index=0,D.sibling=null,D}function d(D,j,P){return D.index=P,e?(P=D.alternate,P!==null?(P=P.index,P<j?(D.flags|=67108866,j):P):(D.flags|=67108866,j)):(D.flags|=1048576,j)}function g(D){return e&&D.alternate===null&&(D.flags|=67108866),D}function v(D,j,P,G){return j===null||j.tag!==6?(j=cc(P,D.mode,G),j.return=D,j):(j=c(j,P),j.return=D,j)}function k(D,j,P,G){var pe=P.type;return pe===T?q(D,j,P.props.children,G,P.key):j!==null&&(j.elementType===pe||typeof pe=="object"&&pe!==null&&pe.$$typeof===W&&di(pe)===j.type)?(j=c(j,P.props),Yo(j,P),j.return=D,j):(j=el(P.type,P.key,P.props,null,D.mode,G),Yo(j,P),j.return=D,j)}function L(D,j,P,G){return j===null||j.tag!==4||j.stateNode.containerInfo!==P.containerInfo||j.stateNode.implementation!==P.implementation?(j=uc(P,D.mode,G),j.return=D,j):(j=c(j,P.children||[]),j.return=D,j)}function q(D,j,P,G,pe){return j===null||j.tag!==7?(j=si(P,D.mode,G,pe),j.return=D,j):(j=c(j,P),j.return=D,j)}function Y(D,j,P){if(typeof j=="string"&&j!==""||typeof j=="number"||typeof j=="bigint")return j=cc(""+j,D.mode,P),j.return=D,j;if(typeof j=="object"&&j!==null){switch(j.$$typeof){case N:return P=el(j.type,j.key,j.props,null,D.mode,P),Yo(P,j),P.return=D,P;case w:return j=uc(j,D.mode,P),j.return=D,j;case W:return j=di(j),Y(D,j,P)}if(Ce(j)||te(j))return j=si(j,D.mode,P,null),j.return=D,j;if(typeof j.then=="function")return Y(D,ll(j),P);if(j.$$typeof===B)return Y(D,al(D,j),P);rl(D,j)}return null}function z(D,j,P,G){var pe=j!==null?j.key:null;if(typeof P=="string"&&P!==""||typeof P=="number"||typeof P=="bigint")return pe!==null?null:v(D,j,""+P,G);if(typeof P=="object"&&P!==null){switch(P.$$typeof){case N:return P.key===pe?k(D,j,P,G):null;case w:return P.key===pe?L(D,j,P,G):null;case W:return P=di(P),z(D,j,P,G)}if(Ce(P)||te(P))return pe!==null?null:q(D,j,P,G,null);if(typeof P.then=="function")return z(D,j,ll(P),G);if(P.$$typeof===B)return z(D,j,al(D,P),G);rl(D,P)}return null}function I(D,j,P,G,pe){if(typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint")return D=D.get(P)||null,v(j,D,""+G,pe);if(typeof G=="object"&&G!==null){switch(G.$$typeof){case N:return D=D.get(G.key===null?P:G.key)||null,k(j,D,G,pe);case w:return D=D.get(G.key===null?P:G.key)||null,L(j,D,G,pe);case W:return G=di(G),I(D,j,P,G,pe)}if(Ce(G)||te(G))return D=D.get(P)||null,q(j,D,G,pe,null);if(typeof G.then=="function")return I(D,j,P,ll(G),pe);if(G.$$typeof===B)return I(D,j,P,al(j,G),pe);rl(j,G)}return null}function re(D,j,P,G){for(var pe=null,He=null,ue=j,Me=j=0,Ue=null;ue!==null&&Me<P.length;Me++){ue.index>Me?(Ue=ue,ue=null):Ue=ue.sibling;var Be=z(D,ue,P[Me],G);if(Be===null){ue===null&&(ue=Ue);break}e&&ue&&Be.alternate===null&&t(D,ue),j=d(Be,j,Me),He===null?pe=Be:He.sibling=Be,He=Be,ue=Ue}if(Me===P.length)return i(D,ue),Ie&&ea(D,Me),pe;if(ue===null){for(;Me<P.length;Me++)ue=Y(D,P[Me],G),ue!==null&&(j=d(ue,j,Me),He===null?pe=ue:He.sibling=ue,He=ue);return Ie&&ea(D,Me),pe}for(ue=o(ue);Me<P.length;Me++)Ue=I(ue,D,Me,P[Me],G),Ue!==null&&(e&&Ue.alternate!==null&&ue.delete(Ue.key===null?Me:Ue.key),j=d(Ue,j,Me),He===null?pe=Ue:He.sibling=Ue,He=Ue);return e&&ue.forEach(function(Ya){return t(D,Ya)}),Ie&&ea(D,Me),pe}function Se(D,j,P,G){if(P==null)throw Error(l(151));for(var pe=null,He=null,ue=j,Me=j=0,Ue=null,Be=P.next();ue!==null&&!Be.done;Me++,Be=P.next()){ue.index>Me?(Ue=ue,ue=null):Ue=ue.sibling;var Ya=z(D,ue,Be.value,G);if(Ya===null){ue===null&&(ue=Ue);break}e&&ue&&Ya.alternate===null&&t(D,ue),j=d(Ya,j,Me),He===null?pe=Ya:He.sibling=Ya,He=Ya,ue=Ue}if(Be.done)return i(D,ue),Ie&&ea(D,Me),pe;if(ue===null){for(;!Be.done;Me++,Be=P.next())Be=Y(D,Be.value,G),Be!==null&&(j=d(Be,j,Me),He===null?pe=Be:He.sibling=Be,He=Be);return Ie&&ea(D,Me),pe}for(ue=o(ue);!Be.done;Me++,Be=P.next())Be=I(ue,D,Me,Be.value,G),Be!==null&&(e&&Be.alternate!==null&&ue.delete(Be.key===null?Me:Be.key),j=d(Be,j,Me),He===null?pe=Be:He.sibling=Be,He=Be);return e&&ue.forEach(function(z0){return t(D,z0)}),Ie&&ea(D,Me),pe}function Xe(D,j,P,G){if(typeof P=="object"&&P!==null&&P.type===T&&P.key===null&&(P=P.props.children),typeof P=="object"&&P!==null){switch(P.$$typeof){case N:e:{for(var pe=P.key;j!==null;){if(j.key===pe){if(pe=P.type,pe===T){if(j.tag===7){i(D,j.sibling),G=c(j,P.props.children),G.return=D,D=G;break e}}else if(j.elementType===pe||typeof pe=="object"&&pe!==null&&pe.$$typeof===W&&di(pe)===j.type){i(D,j.sibling),G=c(j,P.props),Yo(G,P),G.return=D,D=G;break e}i(D,j);break}else t(D,j);j=j.sibling}P.type===T?(G=si(P.props.children,D.mode,G,P.key),G.return=D,D=G):(G=el(P.type,P.key,P.props,null,D.mode,G),Yo(G,P),G.return=D,D=G)}return g(D);case w:e:{for(pe=P.key;j!==null;){if(j.key===pe)if(j.tag===4&&j.stateNode.containerInfo===P.containerInfo&&j.stateNode.implementation===P.implementation){i(D,j.sibling),G=c(j,P.children||[]),G.return=D,D=G;break e}else{i(D,j);break}else t(D,j);j=j.sibling}G=uc(P,D.mode,G),G.return=D,D=G}return g(D);case W:return P=di(P),Xe(D,j,P,G)}if(Ce(P))return re(D,j,P,G);if(te(P)){if(pe=te(P),typeof pe!="function")throw Error(l(150));return P=pe.call(P),Se(D,j,P,G)}if(typeof P.then=="function")return Xe(D,j,ll(P),G);if(P.$$typeof===B)return Xe(D,j,al(D,P),G);rl(D,P)}return typeof P=="string"&&P!==""||typeof P=="number"||typeof P=="bigint"?(P=""+P,j!==null&&j.tag===6?(i(D,j.sibling),G=c(j,P),G.return=D,D=G):(i(D,j),G=cc(P,D.mode,G),G.return=D,D=G),g(D)):i(D,j)}return function(D,j,P,G){try{Go=0;var pe=Xe(D,j,P,G);return Wi=null,pe}catch(ue){if(ue===$i||ue===ol)throw ue;var He=en(29,ue,null,D.mode);return He.lanes=G,He.return=D,He}finally{}}}var hi=wh(!0),Nh=wh(!1),Ta=!1;function Cc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function wc(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ma(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Da(e,t,i){var o=e.updateQueue;if(o===null)return null;if(o=o.shared,(Ge&2)!==0){var c=o.pending;return c===null?t.next=t:(t.next=c.next,c.next=t),o.pending=t,t=Js(e),lh(e,null,i),t}return Zs(e,o,t,i),Js(e)}function Vo(e,t,i){if(t=t.updateQueue,t!==null&&(t=t.shared,(i&4194048)!==0)){var o=t.lanes;o&=e.pendingLanes,i|=o,t.lanes=i,ko(e,i)}}function Nc(e,t){var i=e.updateQueue,o=e.alternate;if(o!==null&&(o=o.updateQueue,i===o)){var c=null,d=null;if(i=i.firstBaseUpdate,i!==null){do{var g={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};d===null?c=d=g:d=d.next=g,i=i.next}while(i!==null);d===null?c=d=t:d=d.next=t}else c=d=t;i={baseState:o.baseState,firstBaseUpdate:c,lastBaseUpdate:d,shared:o.shared,callbacks:o.callbacks},e.updateQueue=i;return}e=i.lastBaseUpdate,e===null?i.firstBaseUpdate=t:e.next=t,i.lastBaseUpdate=t}var Ac=!1;function Fo(){if(Ac){var e=Qi;if(e!==null)throw e}}function Qo(e,t,i,o){Ac=!1;var c=e.updateQueue;Ta=!1;var d=c.firstBaseUpdate,g=c.lastBaseUpdate,v=c.shared.pending;if(v!==null){c.shared.pending=null;var k=v,L=k.next;k.next=null,g===null?d=L:g.next=L,g=k;var q=e.alternate;q!==null&&(q=q.updateQueue,v=q.lastBaseUpdate,v!==g&&(v===null?q.firstBaseUpdate=L:v.next=L,q.lastBaseUpdate=k))}if(d!==null){var Y=c.baseState;g=0,q=L=k=null,v=d;do{var z=v.lane&-536870913,I=z!==v.lane;if(I?(ze&z)===z:(o&z)===z){z!==0&&z===Fi&&(Ac=!0),q!==null&&(q=q.next={lane:0,tag:v.tag,payload:v.payload,callback:null,next:null});e:{var re=e,Se=v;z=t;var Xe=i;switch(Se.tag){case 1:if(re=Se.payload,typeof re=="function"){Y=re.call(Xe,Y,z);break e}Y=re;break e;case 3:re.flags=re.flags&-65537|128;case 0:if(re=Se.payload,z=typeof re=="function"?re.call(Xe,Y,z):re,z==null)break e;Y=x({},Y,z);break e;case 2:Ta=!0}}z=v.callback,z!==null&&(e.flags|=64,I&&(e.flags|=8192),I=c.callbacks,I===null?c.callbacks=[z]:I.push(z))}else I={lane:z,tag:v.tag,payload:v.payload,callback:v.callback,next:null},q===null?(L=q=I,k=Y):q=q.next=I,g|=z;if(v=v.next,v===null){if(v=c.shared.pending,v===null)break;I=v,v=I.next,I.next=null,c.lastBaseUpdate=I,c.shared.pending=null}}while(!0);q===null&&(k=Y),c.baseState=k,c.firstBaseUpdate=L,c.lastBaseUpdate=q,d===null&&(c.shared.lanes=0),La|=g,e.lanes=g,e.memoizedState=Y}}function Ah(e,t){if(typeof e!="function")throw Error(l(191,e));e.call(t)}function kh(e,t){var i=e.callbacks;if(i!==null)for(e.callbacks=null,e=0;e<i.length;e++)Ah(i[e],t)}var Xi=fe(null),cl=fe(0);function jh(e,t){e=da,V(cl,e),V(Xi,t),da=e|t.baseLanes}function kc(){V(cl,da),V(Xi,Xi.current)}function jc(){da=cl.current,Ne(Xi),Ne(cl)}var tn=fe(null),vn=null;function Ea(e){var t=e.alternate;V(ht,ht.current&1),V(tn,e),vn===null&&(t===null||Xi.current!==null||t.memoizedState!==null)&&(vn=e)}function Tc(e){V(ht,ht.current),V(tn,e),vn===null&&(vn=e)}function Th(e){e.tag===22?(V(ht,ht.current),V(tn,e),vn===null&&(vn=e)):Oa()}function Oa(){V(ht,ht.current),V(tn,tn.current)}function nn(e){Ne(tn),vn===e&&(vn=null),Ne(ht)}var ht=fe(0);function ul(e){for(var t=e;t!==null;){if(t.tag===13){var i=t.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||Pu(i)||Lu(i)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var aa=0,Te=null,$e=null,xt=null,dl=!1,Zi=!1,mi=!1,fl=0,$o=0,Ji=null,jb=0;function st(){throw Error(l(321))}function Mc(e,t){if(t===null)return!1;for(var i=0;i<t.length&&i<e.length;i++)if(!Jt(e[i],t[i]))return!1;return!0}function Dc(e,t,i,o,c,d){return aa=d,Te=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,R.H=e===null||e.memoizedState===null?dm:Yc,mi=!1,d=i(o,c),mi=!1,Zi&&(d=Dh(t,i,o,c)),Mh(e),d}function Mh(e){R.H=Zo;var t=$e!==null&&$e.next!==null;if(aa=0,xt=$e=Te=null,dl=!1,$o=0,Ji=null,t)throw Error(l(300));e===null||vt||(e=e.dependencies,e!==null&&nl(e)&&(vt=!0))}function Dh(e,t,i,o){Te=e;var c=0;do{if(Zi&&(Ji=null),$o=0,Zi=!1,25<=c)throw Error(l(301));if(c+=1,xt=$e=null,e.updateQueue!=null){var d=e.updateQueue;d.lastEffect=null,d.events=null,d.stores=null,d.memoCache!=null&&(d.memoCache.index=0)}R.H=fm,d=t(i,o)}while(Zi);return d}function Tb(){var e=R.H,t=e.useState()[0];return t=typeof t.then=="function"?Wo(t):t,e=e.useState()[0],($e!==null?$e.memoizedState:null)!==e&&(Te.flags|=1024),t}function Ec(){var e=fl!==0;return fl=0,e}function Oc(e,t,i){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i}function Rc(e){if(dl){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}dl=!1}aa=0,xt=$e=Te=null,Zi=!1,$o=fl=0,Ji=null}function zt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return xt===null?Te.memoizedState=xt=e:xt=xt.next=e,xt}function mt(){if($e===null){var e=Te.alternate;e=e!==null?e.memoizedState:null}else e=$e.next;var t=xt===null?Te.memoizedState:xt.next;if(t!==null)xt=t,$e=e;else{if(e===null)throw Te.alternate===null?Error(l(467)):Error(l(310));$e=e,e={memoizedState:$e.memoizedState,baseState:$e.baseState,baseQueue:$e.baseQueue,queue:$e.queue,next:null},xt===null?Te.memoizedState=xt=e:xt=xt.next=e}return xt}function hl(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Wo(e){var t=$o;return $o+=1,Ji===null&&(Ji=[]),e=bh(Ji,e,t),t=Te,(xt===null?t.memoizedState:xt.next)===null&&(t=t.alternate,R.H=t===null||t.memoizedState===null?dm:Yc),e}function ml(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Wo(e);if(e.$$typeof===B)return Dt(e)}throw Error(l(438,String(e)))}function Pc(e){var t=null,i=Te.updateQueue;if(i!==null&&(t=i.memoCache),t==null){var o=Te.alternate;o!==null&&(o=o.updateQueue,o!==null&&(o=o.memoCache,o!=null&&(t={data:o.data.map(function(c){return c.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),i===null&&(i=hl(),Te.updateQueue=i),i.memoCache=t,i=t.data[t.index],i===void 0)for(i=t.data[t.index]=Array(e),o=0;o<e;o++)i[o]=Q;return t.index++,i}function ia(e,t){return typeof t=="function"?t(e):t}function pl(e){var t=mt();return Lc(t,$e,e)}function Lc(e,t,i){var o=e.queue;if(o===null)throw Error(l(311));o.lastRenderedReducer=i;var c=e.baseQueue,d=o.pending;if(d!==null){if(c!==null){var g=c.next;c.next=d.next,d.next=g}t.baseQueue=c=d,o.pending=null}if(d=e.baseState,c===null)e.memoizedState=d;else{t=c.next;var v=g=null,k=null,L=t,q=!1;do{var Y=L.lane&-536870913;if(Y!==L.lane?(ze&Y)===Y:(aa&Y)===Y){var z=L.revertLane;if(z===0)k!==null&&(k=k.next={lane:0,revertLane:0,gesture:null,action:L.action,hasEagerState:L.hasEagerState,eagerState:L.eagerState,next:null}),Y===Fi&&(q=!0);else if((aa&z)===z){L=L.next,z===Fi&&(q=!0);continue}else Y={lane:0,revertLane:L.revertLane,gesture:null,action:L.action,hasEagerState:L.hasEagerState,eagerState:L.eagerState,next:null},k===null?(v=k=Y,g=d):k=k.next=Y,Te.lanes|=z,La|=z;Y=L.action,mi&&i(d,Y),d=L.hasEagerState?L.eagerState:i(d,Y)}else z={lane:Y,revertLane:L.revertLane,gesture:L.gesture,action:L.action,hasEagerState:L.hasEagerState,eagerState:L.eagerState,next:null},k===null?(v=k=z,g=d):k=k.next=z,Te.lanes|=Y,La|=Y;L=L.next}while(L!==null&&L!==t);if(k===null?g=d:k.next=v,!Jt(d,e.memoizedState)&&(vt=!0,q&&(i=Qi,i!==null)))throw i;e.memoizedState=d,e.baseState=g,e.baseQueue=k,o.lastRenderedState=d}return c===null&&(o.lanes=0),[e.memoizedState,o.dispatch]}function _c(e){var t=mt(),i=t.queue;if(i===null)throw Error(l(311));i.lastRenderedReducer=e;var o=i.dispatch,c=i.pending,d=t.memoizedState;if(c!==null){i.pending=null;var g=c=c.next;do d=e(d,g.action),g=g.next;while(g!==c);Jt(d,t.memoizedState)||(vt=!0),t.memoizedState=d,t.baseQueue===null&&(t.baseState=d),i.lastRenderedState=d}return[d,o]}function Eh(e,t,i){var o=Te,c=mt(),d=Ie;if(d){if(i===void 0)throw Error(l(407));i=i()}else i=t();var g=!Jt(($e||c).memoizedState,i);if(g&&(c.memoizedState=i,vt=!0),c=c.queue,Ic(Ph.bind(null,o,c,e),[e]),c.getSnapshot!==t||g||xt!==null&&xt.memoizedState.tag&1){if(o.flags|=2048,eo(9,{destroy:void 0},Rh.bind(null,o,c,i,t),null),Ze===null)throw Error(l(349));d||(aa&127)!==0||Oh(o,t,i)}return i}function Oh(e,t,i){e.flags|=16384,e={getSnapshot:t,value:i},t=Te.updateQueue,t===null?(t=hl(),Te.updateQueue=t,t.stores=[e]):(i=t.stores,i===null?t.stores=[e]:i.push(e))}function Rh(e,t,i,o){t.value=i,t.getSnapshot=o,Lh(t)&&_h(e)}function Ph(e,t,i){return i(function(){Lh(t)&&_h(e)})}function Lh(e){var t=e.getSnapshot;e=e.value;try{var i=t();return!Jt(e,i)}catch{return!0}}function _h(e){var t=oi(e,2);t!==null&&Yt(t,e,2)}function zc(e){var t=zt();if(typeof e=="function"){var i=e;if(e=i(),mi){De(!0);try{i()}finally{De(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ia,lastRenderedState:e},t}function zh(e,t,i,o){return e.baseState=i,Lc(e,$e,typeof o=="function"?o:ia)}function Mb(e,t,i,o,c){if(xl(e))throw Error(l(485));if(e=t.action,e!==null){var d={payload:c,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(g){d.listeners.push(g)}};R.T!==null?i(!0):d.isTransition=!1,o(d),i=t.pending,i===null?(d.next=t.pending=d,Uh(t,d)):(d.next=i.next,t.pending=i.next=d)}}function Uh(e,t){var i=t.action,o=t.payload,c=e.state;if(t.isTransition){var d=R.T,g={};R.T=g;try{var v=i(c,o),k=R.S;k!==null&&k(g,v),Ih(e,t,v)}catch(L){Uc(e,t,L)}finally{d!==null&&g.types!==null&&(d.types=g.types),R.T=d}}else try{d=i(c,o),Ih(e,t,d)}catch(L){Uc(e,t,L)}}function Ih(e,t,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(o){Hh(e,t,o)},function(o){return Uc(e,t,o)}):Hh(e,t,i)}function Hh(e,t,i){t.status="fulfilled",t.value=i,Bh(t),e.state=i,t=e.pending,t!==null&&(i=t.next,i===t?e.pending=null:(i=i.next,t.next=i,Uh(e,i)))}function Uc(e,t,i){var o=e.pending;if(e.pending=null,o!==null){o=o.next;do t.status="rejected",t.reason=i,Bh(t),t=t.next;while(t!==o)}e.action=null}function Bh(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Kh(e,t){return t}function qh(e,t){if(Ie){var i=Ze.formState;if(i!==null){e:{var o=Te;if(Ie){if(et){t:{for(var c=et,d=xn;c.nodeType!==8;){if(!d){c=null;break t}if(c=bn(c.nextSibling),c===null){c=null;break t}}d=c.data,c=d==="F!"||d==="F"?c:null}if(c){et=bn(c.nextSibling),o=c.data==="F!";break e}}ka(o)}o=!1}o&&(t=i[0])}}return i=zt(),i.memoizedState=i.baseState=t,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Kh,lastRenderedState:t},i.queue=o,i=rm.bind(null,Te,o),o.dispatch=i,o=zc(!1),d=Gc.bind(null,Te,!1,o.queue),o=zt(),c={state:t,dispatch:null,action:e,pending:null},o.queue=c,i=Mb.bind(null,Te,c,d,i),c.dispatch=i,o.memoizedState=e,[t,i,!1]}function Gh(e){var t=mt();return Yh(t,$e,e)}function Yh(e,t,i){if(t=Lc(e,t,Kh)[0],e=pl(ia)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var o=Wo(t)}catch(g){throw g===$i?ol:g}else o=t;t=mt();var c=t.queue,d=c.dispatch;return i!==t.memoizedState&&(Te.flags|=2048,eo(9,{destroy:void 0},Db.bind(null,c,i),null)),[o,d,e]}function Db(e,t){e.action=t}function Vh(e){var t=mt(),i=$e;if(i!==null)return Yh(t,i,e);mt(),t=t.memoizedState,i=mt();var o=i.queue.dispatch;return i.memoizedState=e,[t,o,!1]}function eo(e,t,i,o){return e={tag:e,create:i,deps:o,inst:t,next:null},t=Te.updateQueue,t===null&&(t=hl(),Te.updateQueue=t),i=t.lastEffect,i===null?t.lastEffect=e.next=e:(o=i.next,i.next=e,e.next=o,t.lastEffect=e),e}function Fh(){return mt().memoizedState}function gl(e,t,i,o){var c=zt();Te.flags|=e,c.memoizedState=eo(1|t,{destroy:void 0},i,o===void 0?null:o)}function yl(e,t,i,o){var c=mt();o=o===void 0?null:o;var d=c.memoizedState.inst;$e!==null&&o!==null&&Mc(o,$e.memoizedState.deps)?c.memoizedState=eo(t,d,i,o):(Te.flags|=e,c.memoizedState=eo(1|t,d,i,o))}function Qh(e,t){gl(8390656,8,e,t)}function Ic(e,t){yl(2048,8,e,t)}function Eb(e){Te.flags|=4;var t=Te.updateQueue;if(t===null)t=hl(),Te.updateQueue=t,t.events=[e];else{var i=t.events;i===null?t.events=[e]:i.push(e)}}function $h(e){var t=mt().memoizedState;return Eb({ref:t,nextImpl:e}),function(){if((Ge&2)!==0)throw Error(l(440));return t.impl.apply(void 0,arguments)}}function Wh(e,t){return yl(4,2,e,t)}function Xh(e,t){return yl(4,4,e,t)}function Zh(e,t){if(typeof t=="function"){e=e();var i=t(e);return function(){typeof i=="function"?i():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Jh(e,t,i){i=i!=null?i.concat([e]):null,yl(4,4,Zh.bind(null,t,e),i)}function Hc(){}function em(e,t){var i=mt();t=t===void 0?null:t;var o=i.memoizedState;return t!==null&&Mc(t,o[1])?o[0]:(i.memoizedState=[e,t],e)}function tm(e,t){var i=mt();t=t===void 0?null:t;var o=i.memoizedState;if(t!==null&&Mc(t,o[1]))return o[0];if(o=e(),mi){De(!0);try{e()}finally{De(!1)}}return i.memoizedState=[o,t],o}function Bc(e,t,i){return i===void 0||(aa&1073741824)!==0&&(ze&261930)===0?e.memoizedState=t:(e.memoizedState=i,e=np(),Te.lanes|=e,La|=e,i)}function nm(e,t,i,o){return Jt(i,t)?i:Xi.current!==null?(e=Bc(e,i,o),Jt(e,t)||(vt=!0),e):(aa&42)===0||(aa&1073741824)!==0&&(ze&261930)===0?(vt=!0,e.memoizedState=i):(e=np(),Te.lanes|=e,La|=e,t)}function am(e,t,i,o,c){var d=$.p;$.p=d!==0&&8>d?d:8;var g=R.T,v={};R.T=v,Gc(e,!1,t,i);try{var k=c(),L=R.S;if(L!==null&&L(v,k),k!==null&&typeof k=="object"&&typeof k.then=="function"){var q=kb(k,o);Xo(e,t,q,sn(e))}else Xo(e,t,o,sn(e))}catch(Y){Xo(e,t,{then:function(){},status:"rejected",reason:Y},sn())}finally{$.p=d,g!==null&&v.types!==null&&(g.types=v.types),R.T=g}}function Ob(){}function Kc(e,t,i,o){if(e.tag!==5)throw Error(l(476));var c=im(e).queue;am(e,c,t,ee,i===null?Ob:function(){return om(e),i(o)})}function im(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ee,baseState:ee,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ia,lastRenderedState:ee},next:null};var i={};return t.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ia,lastRenderedState:i},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function om(e){var t=im(e);t.next===null&&(t=e.alternate.memoizedState),Xo(e,t.next.queue,{},sn())}function qc(){return Dt(ms)}function sm(){return mt().memoizedState}function lm(){return mt().memoizedState}function Rb(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var i=sn();e=Ma(i);var o=Da(t,e,i);o!==null&&(Yt(o,t,i),Vo(o,t,i)),t={cache:xc()},e.payload=t;return}t=t.return}}function Pb(e,t,i){var o=sn();i={lane:o,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},xl(e)?cm(t,i):(i=lc(e,t,i,o),i!==null&&(Yt(i,e,o),um(i,t,o)))}function rm(e,t,i){var o=sn();Xo(e,t,i,o)}function Xo(e,t,i,o){var c={lane:o,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(xl(e))cm(t,c);else{var d=e.alternate;if(e.lanes===0&&(d===null||d.lanes===0)&&(d=t.lastRenderedReducer,d!==null))try{var g=t.lastRenderedState,v=d(g,i);if(c.hasEagerState=!0,c.eagerState=v,Jt(v,g))return Zs(e,t,c,0),Ze===null&&Xs(),!1}catch{}finally{}if(i=lc(e,t,c,o),i!==null)return Yt(i,e,o),um(i,t,o),!0}return!1}function Gc(e,t,i,o){if(o={lane:2,revertLane:Cu(),gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},xl(e)){if(t)throw Error(l(479))}else t=lc(e,i,o,2),t!==null&&Yt(t,e,2)}function xl(e){var t=e.alternate;return e===Te||t!==null&&t===Te}function cm(e,t){Zi=dl=!0;var i=e.pending;i===null?t.next=t:(t.next=i.next,i.next=t),e.pending=t}function um(e,t,i){if((i&4194048)!==0){var o=t.lanes;o&=e.pendingLanes,i|=o,t.lanes=i,ko(e,i)}}var Zo={readContext:Dt,use:ml,useCallback:st,useContext:st,useEffect:st,useImperativeHandle:st,useLayoutEffect:st,useInsertionEffect:st,useMemo:st,useReducer:st,useRef:st,useState:st,useDebugValue:st,useDeferredValue:st,useTransition:st,useSyncExternalStore:st,useId:st,useHostTransitionStatus:st,useFormState:st,useActionState:st,useOptimistic:st,useMemoCache:st,useCacheRefresh:st};Zo.useEffectEvent=st;var dm={readContext:Dt,use:ml,useCallback:function(e,t){return zt().memoizedState=[e,t===void 0?null:t],e},useContext:Dt,useEffect:Qh,useImperativeHandle:function(e,t,i){i=i!=null?i.concat([e]):null,gl(4194308,4,Zh.bind(null,t,e),i)},useLayoutEffect:function(e,t){return gl(4194308,4,e,t)},useInsertionEffect:function(e,t){gl(4,2,e,t)},useMemo:function(e,t){var i=zt();t=t===void 0?null:t;var o=e();if(mi){De(!0);try{e()}finally{De(!1)}}return i.memoizedState=[o,t],o},useReducer:function(e,t,i){var o=zt();if(i!==void 0){var c=i(t);if(mi){De(!0);try{i(t)}finally{De(!1)}}}else c=t;return o.memoizedState=o.baseState=c,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:c},o.queue=e,e=e.dispatch=Pb.bind(null,Te,e),[o.memoizedState,e]},useRef:function(e){var t=zt();return e={current:e},t.memoizedState=e},useState:function(e){e=zc(e);var t=e.queue,i=rm.bind(null,Te,t);return t.dispatch=i,[e.memoizedState,i]},useDebugValue:Hc,useDeferredValue:function(e,t){var i=zt();return Bc(i,e,t)},useTransition:function(){var e=zc(!1);return e=am.bind(null,Te,e.queue,!0,!1),zt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,i){var o=Te,c=zt();if(Ie){if(i===void 0)throw Error(l(407));i=i()}else{if(i=t(),Ze===null)throw Error(l(349));(ze&127)!==0||Oh(o,t,i)}c.memoizedState=i;var d={value:i,getSnapshot:t};return c.queue=d,Qh(Ph.bind(null,o,d,e),[e]),o.flags|=2048,eo(9,{destroy:void 0},Rh.bind(null,o,d,i,t),null),i},useId:function(){var e=zt(),t=Ze.identifierPrefix;if(Ie){var i=Ln,o=Pn;i=(o&~(1<<32-ve(o)-1)).toString(32)+i,t="_"+t+"R_"+i,i=fl++,0<i&&(t+="H"+i.toString(32)),t+="_"}else i=jb++,t="_"+t+"r_"+i.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:qc,useFormState:qh,useActionState:qh,useOptimistic:function(e){var t=zt();t.memoizedState=t.baseState=e;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=i,t=Gc.bind(null,Te,!0,i),i.dispatch=t,[e,t]},useMemoCache:Pc,useCacheRefresh:function(){return zt().memoizedState=Rb.bind(null,Te)},useEffectEvent:function(e){var t=zt(),i={impl:e};return t.memoizedState=i,function(){if((Ge&2)!==0)throw Error(l(440));return i.impl.apply(void 0,arguments)}}},Yc={readContext:Dt,use:ml,useCallback:em,useContext:Dt,useEffect:Ic,useImperativeHandle:Jh,useInsertionEffect:Wh,useLayoutEffect:Xh,useMemo:tm,useReducer:pl,useRef:Fh,useState:function(){return pl(ia)},useDebugValue:Hc,useDeferredValue:function(e,t){var i=mt();return nm(i,$e.memoizedState,e,t)},useTransition:function(){var e=pl(ia)[0],t=mt().memoizedState;return[typeof e=="boolean"?e:Wo(e),t]},useSyncExternalStore:Eh,useId:sm,useHostTransitionStatus:qc,useFormState:Gh,useActionState:Gh,useOptimistic:function(e,t){var i=mt();return zh(i,$e,e,t)},useMemoCache:Pc,useCacheRefresh:lm};Yc.useEffectEvent=$h;var fm={readContext:Dt,use:ml,useCallback:em,useContext:Dt,useEffect:Ic,useImperativeHandle:Jh,useInsertionEffect:Wh,useLayoutEffect:Xh,useMemo:tm,useReducer:_c,useRef:Fh,useState:function(){return _c(ia)},useDebugValue:Hc,useDeferredValue:function(e,t){var i=mt();return $e===null?Bc(i,e,t):nm(i,$e.memoizedState,e,t)},useTransition:function(){var e=_c(ia)[0],t=mt().memoizedState;return[typeof e=="boolean"?e:Wo(e),t]},useSyncExternalStore:Eh,useId:sm,useHostTransitionStatus:qc,useFormState:Vh,useActionState:Vh,useOptimistic:function(e,t){var i=mt();return $e!==null?zh(i,$e,e,t):(i.baseState=e,[e,i.queue.dispatch])},useMemoCache:Pc,useCacheRefresh:lm};fm.useEffectEvent=$h;function Vc(e,t,i,o){t=e.memoizedState,i=i(o,t),i=i==null?t:x({},t,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var Fc={enqueueSetState:function(e,t,i){e=e._reactInternals;var o=sn(),c=Ma(o);c.payload=t,i!=null&&(c.callback=i),t=Da(e,c,o),t!==null&&(Yt(t,e,o),Vo(t,e,o))},enqueueReplaceState:function(e,t,i){e=e._reactInternals;var o=sn(),c=Ma(o);c.tag=1,c.payload=t,i!=null&&(c.callback=i),t=Da(e,c,o),t!==null&&(Yt(t,e,o),Vo(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var i=sn(),o=Ma(i);o.tag=2,t!=null&&(o.callback=t),t=Da(e,o,i),t!==null&&(Yt(t,e,i),Vo(t,e,i))}};function hm(e,t,i,o,c,d,g){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(o,d,g):t.prototype&&t.prototype.isPureReactComponent?!Uo(i,o)||!Uo(c,d):!0}function mm(e,t,i,o){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(i,o),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(i,o),t.state!==e&&Fc.enqueueReplaceState(t,t.state,null)}function pi(e,t){var i=t;if("ref"in t){i={};for(var o in t)o!=="ref"&&(i[o]=t[o])}if(e=e.defaultProps){i===t&&(i=x({},i));for(var c in e)i[c]===void 0&&(i[c]=e[c])}return i}function pm(e){Ws(e)}function gm(e){console.error(e)}function ym(e){Ws(e)}function vl(e,t){try{var i=e.onUncaughtError;i(t.value,{componentStack:t.stack})}catch(o){setTimeout(function(){throw o})}}function xm(e,t,i){try{var o=e.onCaughtError;o(i.value,{componentStack:i.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(c){setTimeout(function(){throw c})}}function Qc(e,t,i){return i=Ma(i),i.tag=3,i.payload={element:null},i.callback=function(){vl(e,t)},i}function vm(e){return e=Ma(e),e.tag=3,e}function bm(e,t,i,o){var c=i.type.getDerivedStateFromError;if(typeof c=="function"){var d=o.value;e.payload=function(){return c(d)},e.callback=function(){xm(t,i,o)}}var g=i.stateNode;g!==null&&typeof g.componentDidCatch=="function"&&(e.callback=function(){xm(t,i,o),typeof c!="function"&&(_a===null?_a=new Set([this]):_a.add(this));var v=o.stack;this.componentDidCatch(o.value,{componentStack:v!==null?v:""})})}function Lb(e,t,i,o,c){if(i.flags|=32768,o!==null&&typeof o=="object"&&typeof o.then=="function"){if(t=i.alternate,t!==null&&Vi(t,i,c,!0),i=tn.current,i!==null){switch(i.tag){case 31:case 13:return vn===null?El():i.alternate===null&&lt===0&&(lt=3),i.flags&=-257,i.flags|=65536,i.lanes=c,o===sl?i.flags|=16384:(t=i.updateQueue,t===null?i.updateQueue=new Set([o]):t.add(o),vu(e,o,c)),!1;case 22:return i.flags|=65536,o===sl?i.flags|=16384:(t=i.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([o])},i.updateQueue=t):(i=t.retryQueue,i===null?t.retryQueue=new Set([o]):i.add(o)),vu(e,o,c)),!1}throw Error(l(435,i.tag))}return vu(e,o,c),El(),!1}if(Ie)return t=tn.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=c,o!==hc&&(e=Error(l(422),{cause:o}),Bo(pn(e,i)))):(o!==hc&&(t=Error(l(423),{cause:o}),Bo(pn(t,i))),e=e.current.alternate,e.flags|=65536,c&=-c,e.lanes|=c,o=pn(o,i),c=Qc(e.stateNode,o,c),Nc(e,c),lt!==4&&(lt=2)),!1;var d=Error(l(520),{cause:o});if(d=pn(d,i),ss===null?ss=[d]:ss.push(d),lt!==4&&(lt=2),t===null)return!0;o=pn(o,i),i=t;do{switch(i.tag){case 3:return i.flags|=65536,e=c&-c,i.lanes|=e,e=Qc(i.stateNode,o,e),Nc(i,e),!1;case 1:if(t=i.type,d=i.stateNode,(i.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||d!==null&&typeof d.componentDidCatch=="function"&&(_a===null||!_a.has(d))))return i.flags|=65536,c&=-c,i.lanes|=c,c=vm(c),bm(c,e,i,o),Nc(i,c),!1}i=i.return}while(i!==null);return!1}var $c=Error(l(461)),vt=!1;function Et(e,t,i,o){t.child=e===null?Nh(t,null,i,o):hi(t,e.child,i,o)}function Sm(e,t,i,o,c){i=i.render;var d=t.ref;if("ref"in o){var g={};for(var v in o)v!=="ref"&&(g[v]=o[v])}else g=o;return ci(t),o=Dc(e,t,i,g,d,c),v=Ec(),e!==null&&!vt?(Oc(e,t,c),oa(e,t,c)):(Ie&&v&&dc(t),t.flags|=1,Et(e,t,o,c),t.child)}function Cm(e,t,i,o,c){if(e===null){var d=i.type;return typeof d=="function"&&!rc(d)&&d.defaultProps===void 0&&i.compare===null?(t.tag=15,t.type=d,wm(e,t,d,o,c)):(e=el(i.type,null,o,t,t.mode,c),e.ref=t.ref,e.return=t,t.child=e)}if(d=e.child,!au(e,c)){var g=d.memoizedProps;if(i=i.compare,i=i!==null?i:Uo,i(g,o)&&e.ref===t.ref)return oa(e,t,c)}return t.flags|=1,e=Jn(d,o),e.ref=t.ref,e.return=t,t.child=e}function wm(e,t,i,o,c){if(e!==null){var d=e.memoizedProps;if(Uo(d,o)&&e.ref===t.ref)if(vt=!1,t.pendingProps=o=d,au(e,c))(e.flags&131072)!==0&&(vt=!0);else return t.lanes=e.lanes,oa(e,t,c)}return Wc(e,t,i,o,c)}function Nm(e,t,i,o){var c=o.children,d=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.mode==="hidden"){if((t.flags&128)!==0){if(d=d!==null?d.baseLanes|i:i,e!==null){for(o=t.child=e.child,c=0;o!==null;)c=c|o.lanes|o.childLanes,o=o.sibling;o=c&~d}else o=0,t.child=null;return Am(e,t,d,i,o)}if((i&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&il(t,d!==null?d.cachePool:null),d!==null?jh(t,d):kc(),Th(t);else return o=t.lanes=536870912,Am(e,t,d!==null?d.baseLanes|i:i,i,o)}else d!==null?(il(t,d.cachePool),jh(t,d),Oa(),t.memoizedState=null):(e!==null&&il(t,null),kc(),Oa());return Et(e,t,c,i),t.child}function Jo(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Am(e,t,i,o,c){var d=bc();return d=d===null?null:{parent:yt._currentValue,pool:d},t.memoizedState={baseLanes:i,cachePool:d},e!==null&&il(t,null),kc(),Th(t),e!==null&&Vi(e,t,o,!0),t.childLanes=c,null}function bl(e,t){return t=Cl({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function km(e,t,i){return hi(t,e.child,null,i),e=bl(t,t.pendingProps),e.flags|=2,nn(t),t.memoizedState=null,e}function _b(e,t,i){var o=t.pendingProps,c=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ie){if(o.mode==="hidden")return e=bl(t,o),t.lanes=536870912,Jo(null,e);if(Tc(t),(e=et)?(e=Up(e,xn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Na!==null?{id:Pn,overflow:Ln}:null,retryLane:536870912,hydrationErrors:null},i=ch(e),i.return=t,t.child=i,Mt=t,et=null)):e=null,e===null)throw ka(t);return t.lanes=536870912,null}return bl(t,o)}var d=e.memoizedState;if(d!==null){var g=d.dehydrated;if(Tc(t),c)if(t.flags&256)t.flags&=-257,t=km(e,t,i);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(l(558));else if(vt||Vi(e,t,i,!1),c=(i&e.childLanes)!==0,vt||c){if(o=Ze,o!==null&&(g=dn(o,i),g!==0&&g!==d.retryLane))throw d.retryLane=g,oi(e,g),Yt(o,e,g),$c;El(),t=km(e,t,i)}else e=d.treeContext,et=bn(g.nextSibling),Mt=t,Ie=!0,Aa=null,xn=!1,e!==null&&fh(t,e),t=bl(t,o),t.flags|=4096;return t}return e=Jn(e.child,{mode:o.mode,children:o.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Sl(e,t){var i=t.ref;if(i===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof i!="function"&&typeof i!="object")throw Error(l(284));(e===null||e.ref!==i)&&(t.flags|=4194816)}}function Wc(e,t,i,o,c){return ci(t),i=Dc(e,t,i,o,void 0,c),o=Ec(),e!==null&&!vt?(Oc(e,t,c),oa(e,t,c)):(Ie&&o&&dc(t),t.flags|=1,Et(e,t,i,c),t.child)}function jm(e,t,i,o,c,d){return ci(t),t.updateQueue=null,i=Dh(t,o,i,c),Mh(e),o=Ec(),e!==null&&!vt?(Oc(e,t,d),oa(e,t,d)):(Ie&&o&&dc(t),t.flags|=1,Et(e,t,i,d),t.child)}function Tm(e,t,i,o,c){if(ci(t),t.stateNode===null){var d=Ki,g=i.contextType;typeof g=="object"&&g!==null&&(d=Dt(g)),d=new i(o,d),t.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,d.updater=Fc,t.stateNode=d,d._reactInternals=t,d=t.stateNode,d.props=o,d.state=t.memoizedState,d.refs={},Cc(t),g=i.contextType,d.context=typeof g=="object"&&g!==null?Dt(g):Ki,d.state=t.memoizedState,g=i.getDerivedStateFromProps,typeof g=="function"&&(Vc(t,i,g,o),d.state=t.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof d.getSnapshotBeforeUpdate=="function"||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(g=d.state,typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount(),g!==d.state&&Fc.enqueueReplaceState(d,d.state,null),Qo(t,o,d,c),Fo(),d.state=t.memoizedState),typeof d.componentDidMount=="function"&&(t.flags|=4194308),o=!0}else if(e===null){d=t.stateNode;var v=t.memoizedProps,k=pi(i,v);d.props=k;var L=d.context,q=i.contextType;g=Ki,typeof q=="object"&&q!==null&&(g=Dt(q));var Y=i.getDerivedStateFromProps;q=typeof Y=="function"||typeof d.getSnapshotBeforeUpdate=="function",v=t.pendingProps!==v,q||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(v||L!==g)&&mm(t,d,o,g),Ta=!1;var z=t.memoizedState;d.state=z,Qo(t,o,d,c),Fo(),L=t.memoizedState,v||z!==L||Ta?(typeof Y=="function"&&(Vc(t,i,Y,o),L=t.memoizedState),(k=Ta||hm(t,i,k,o,z,L,g))?(q||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount()),typeof d.componentDidMount=="function"&&(t.flags|=4194308)):(typeof d.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=o,t.memoizedState=L),d.props=o,d.state=L,d.context=g,o=k):(typeof d.componentDidMount=="function"&&(t.flags|=4194308),o=!1)}else{d=t.stateNode,wc(e,t),g=t.memoizedProps,q=pi(i,g),d.props=q,Y=t.pendingProps,z=d.context,L=i.contextType,k=Ki,typeof L=="object"&&L!==null&&(k=Dt(L)),v=i.getDerivedStateFromProps,(L=typeof v=="function"||typeof d.getSnapshotBeforeUpdate=="function")||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(g!==Y||z!==k)&&mm(t,d,o,k),Ta=!1,z=t.memoizedState,d.state=z,Qo(t,o,d,c),Fo();var I=t.memoizedState;g!==Y||z!==I||Ta||e!==null&&e.dependencies!==null&&nl(e.dependencies)?(typeof v=="function"&&(Vc(t,i,v,o),I=t.memoizedState),(q=Ta||hm(t,i,q,o,z,I,k)||e!==null&&e.dependencies!==null&&nl(e.dependencies))?(L||typeof d.UNSAFE_componentWillUpdate!="function"&&typeof d.componentWillUpdate!="function"||(typeof d.componentWillUpdate=="function"&&d.componentWillUpdate(o,I,k),typeof d.UNSAFE_componentWillUpdate=="function"&&d.UNSAFE_componentWillUpdate(o,I,k)),typeof d.componentDidUpdate=="function"&&(t.flags|=4),typeof d.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof d.componentDidUpdate!="function"||g===e.memoizedProps&&z===e.memoizedState||(t.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||g===e.memoizedProps&&z===e.memoizedState||(t.flags|=1024),t.memoizedProps=o,t.memoizedState=I),d.props=o,d.state=I,d.context=k,o=q):(typeof d.componentDidUpdate!="function"||g===e.memoizedProps&&z===e.memoizedState||(t.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||g===e.memoizedProps&&z===e.memoizedState||(t.flags|=1024),o=!1)}return d=o,Sl(e,t),o=(t.flags&128)!==0,d||o?(d=t.stateNode,i=o&&typeof i.getDerivedStateFromError!="function"?null:d.render(),t.flags|=1,e!==null&&o?(t.child=hi(t,e.child,null,c),t.child=hi(t,null,i,c)):Et(e,t,i,c),t.memoizedState=d.state,e=t.child):e=oa(e,t,c),e}function Mm(e,t,i,o){return li(),t.flags|=256,Et(e,t,i,o),t.child}var Xc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Zc(e){return{baseLanes:e,cachePool:xh()}}function Jc(e,t,i){return e=e!==null?e.childLanes&~i:0,t&&(e|=on),e}function Dm(e,t,i){var o=t.pendingProps,c=!1,d=(t.flags&128)!==0,g;if((g=d)||(g=e!==null&&e.memoizedState===null?!1:(ht.current&2)!==0),g&&(c=!0,t.flags&=-129),g=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ie){if(c?Ea(t):Oa(),(e=et)?(e=Up(e,xn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Na!==null?{id:Pn,overflow:Ln}:null,retryLane:536870912,hydrationErrors:null},i=ch(e),i.return=t,t.child=i,Mt=t,et=null)):e=null,e===null)throw ka(t);return Lu(e)?t.lanes=32:t.lanes=536870912,null}var v=o.children;return o=o.fallback,c?(Oa(),c=t.mode,v=Cl({mode:"hidden",children:v},c),o=si(o,c,i,null),v.return=t,o.return=t,v.sibling=o,t.child=v,o=t.child,o.memoizedState=Zc(i),o.childLanes=Jc(e,g,i),t.memoizedState=Xc,Jo(null,o)):(Ea(t),eu(t,v))}var k=e.memoizedState;if(k!==null&&(v=k.dehydrated,v!==null)){if(d)t.flags&256?(Ea(t),t.flags&=-257,t=tu(e,t,i)):t.memoizedState!==null?(Oa(),t.child=e.child,t.flags|=128,t=null):(Oa(),v=o.fallback,c=t.mode,o=Cl({mode:"visible",children:o.children},c),v=si(v,c,i,null),v.flags|=2,o.return=t,v.return=t,o.sibling=v,t.child=o,hi(t,e.child,null,i),o=t.child,o.memoizedState=Zc(i),o.childLanes=Jc(e,g,i),t.memoizedState=Xc,t=Jo(null,o));else if(Ea(t),Lu(v)){if(g=v.nextSibling&&v.nextSibling.dataset,g)var L=g.dgst;g=L,o=Error(l(419)),o.stack="",o.digest=g,Bo({value:o,source:null,stack:null}),t=tu(e,t,i)}else if(vt||Vi(e,t,i,!1),g=(i&e.childLanes)!==0,vt||g){if(g=Ze,g!==null&&(o=dn(g,i),o!==0&&o!==k.retryLane))throw k.retryLane=o,oi(e,o),Yt(g,e,o),$c;Pu(v)||El(),t=tu(e,t,i)}else Pu(v)?(t.flags|=192,t.child=e.child,t=null):(e=k.treeContext,et=bn(v.nextSibling),Mt=t,Ie=!0,Aa=null,xn=!1,e!==null&&fh(t,e),t=eu(t,o.children),t.flags|=4096);return t}return c?(Oa(),v=o.fallback,c=t.mode,k=e.child,L=k.sibling,o=Jn(k,{mode:"hidden",children:o.children}),o.subtreeFlags=k.subtreeFlags&65011712,L!==null?v=Jn(L,v):(v=si(v,c,i,null),v.flags|=2),v.return=t,o.return=t,o.sibling=v,t.child=o,Jo(null,o),o=t.child,v=e.child.memoizedState,v===null?v=Zc(i):(c=v.cachePool,c!==null?(k=yt._currentValue,c=c.parent!==k?{parent:k,pool:k}:c):c=xh(),v={baseLanes:v.baseLanes|i,cachePool:c}),o.memoizedState=v,o.childLanes=Jc(e,g,i),t.memoizedState=Xc,Jo(e.child,o)):(Ea(t),i=e.child,e=i.sibling,i=Jn(i,{mode:"visible",children:o.children}),i.return=t,i.sibling=null,e!==null&&(g=t.deletions,g===null?(t.deletions=[e],t.flags|=16):g.push(e)),t.child=i,t.memoizedState=null,i)}function eu(e,t){return t=Cl({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Cl(e,t){return e=en(22,e,null,t),e.lanes=0,e}function tu(e,t,i){return hi(t,e.child,null,i),e=eu(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Em(e,t,i){e.lanes|=t;var o=e.alternate;o!==null&&(o.lanes|=t),gc(e.return,t,i)}function nu(e,t,i,o,c,d){var g=e.memoizedState;g===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:o,tail:i,tailMode:c,treeForkCount:d}:(g.isBackwards=t,g.rendering=null,g.renderingStartTime=0,g.last=o,g.tail=i,g.tailMode=c,g.treeForkCount=d)}function Om(e,t,i){var o=t.pendingProps,c=o.revealOrder,d=o.tail;o=o.children;var g=ht.current,v=(g&2)!==0;if(v?(g=g&1|2,t.flags|=128):g&=1,V(ht,g),Et(e,t,o,i),o=Ie?Ho:0,!v&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Em(e,i,t);else if(e.tag===19)Em(e,i,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(c){case"forwards":for(i=t.child,c=null;i!==null;)e=i.alternate,e!==null&&ul(e)===null&&(c=i),i=i.sibling;i=c,i===null?(c=t.child,t.child=null):(c=i.sibling,i.sibling=null),nu(t,!1,c,i,d,o);break;case"backwards":case"unstable_legacy-backwards":for(i=null,c=t.child,t.child=null;c!==null;){if(e=c.alternate,e!==null&&ul(e)===null){t.child=c;break}e=c.sibling,c.sibling=i,i=c,c=e}nu(t,!0,i,null,d,o);break;case"together":nu(t,!1,null,null,void 0,o);break;default:t.memoizedState=null}return t.child}function oa(e,t,i){if(e!==null&&(t.dependencies=e.dependencies),La|=t.lanes,(i&t.childLanes)===0)if(e!==null){if(Vi(e,t,i,!1),(i&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(l(153));if(t.child!==null){for(e=t.child,i=Jn(e,e.pendingProps),t.child=i,i.return=t;e.sibling!==null;)e=e.sibling,i=i.sibling=Jn(e,e.pendingProps),i.return=t;i.sibling=null}return t.child}function au(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&nl(e)))}function zb(e,t,i){switch(t.tag){case 3:xe(t,t.stateNode.containerInfo),ja(t,yt,e.memoizedState.cache),li();break;case 27:case 5:qe(t);break;case 4:xe(t,t.stateNode.containerInfo);break;case 10:ja(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Tc(t),null;break;case 13:var o=t.memoizedState;if(o!==null)return o.dehydrated!==null?(Ea(t),t.flags|=128,null):(i&t.child.childLanes)!==0?Dm(e,t,i):(Ea(t),e=oa(e,t,i),e!==null?e.sibling:null);Ea(t);break;case 19:var c=(e.flags&128)!==0;if(o=(i&t.childLanes)!==0,o||(Vi(e,t,i,!1),o=(i&t.childLanes)!==0),c){if(o)return Om(e,t,i);t.flags|=128}if(c=t.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),V(ht,ht.current),o)break;return null;case 22:return t.lanes=0,Nm(e,t,i,t.pendingProps);case 24:ja(t,yt,e.memoizedState.cache)}return oa(e,t,i)}function Rm(e,t,i){if(e!==null)if(e.memoizedProps!==t.pendingProps)vt=!0;else{if(!au(e,i)&&(t.flags&128)===0)return vt=!1,zb(e,t,i);vt=(e.flags&131072)!==0}else vt=!1,Ie&&(t.flags&1048576)!==0&&dh(t,Ho,t.index);switch(t.lanes=0,t.tag){case 16:e:{var o=t.pendingProps;if(e=di(t.elementType),t.type=e,typeof e=="function")rc(e)?(o=pi(e,o),t.tag=1,t=Tm(null,t,e,o,i)):(t.tag=0,t=Wc(null,t,e,o,i));else{if(e!=null){var c=e.$$typeof;if(c===U){t.tag=11,t=Sm(null,t,e,o,i);break e}else if(c===_){t.tag=14,t=Cm(null,t,e,o,i);break e}}throw t=de(e)||e,Error(l(306,t,""))}}return t;case 0:return Wc(e,t,t.type,t.pendingProps,i);case 1:return o=t.type,c=pi(o,t.pendingProps),Tm(e,t,o,c,i);case 3:e:{if(xe(t,t.stateNode.containerInfo),e===null)throw Error(l(387));o=t.pendingProps;var d=t.memoizedState;c=d.element,wc(e,t),Qo(t,o,null,i);var g=t.memoizedState;if(o=g.cache,ja(t,yt,o),o!==d.cache&&yc(t,[yt],i,!0),Fo(),o=g.element,d.isDehydrated)if(d={element:o,isDehydrated:!1,cache:g.cache},t.updateQueue.baseState=d,t.memoizedState=d,t.flags&256){t=Mm(e,t,o,i);break e}else if(o!==c){c=pn(Error(l(424)),t),Bo(c),t=Mm(e,t,o,i);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(et=bn(e.firstChild),Mt=t,Ie=!0,Aa=null,xn=!0,i=Nh(t,null,o,i),t.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling}else{if(li(),o===c){t=oa(e,t,i);break e}Et(e,t,o,i)}t=t.child}return t;case 26:return Sl(e,t),e===null?(i=Gp(t.type,null,t.pendingProps,null))?t.memoizedState=i:Ie||(i=t.type,e=t.pendingProps,o=Ul(ne.current).createElement(i),o[Tt]=t,o[It]=e,Ot(o,i,e),At(o),t.stateNode=o):t.memoizedState=Gp(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return qe(t),e===null&&Ie&&(o=t.stateNode=Bp(t.type,t.pendingProps,ne.current),Mt=t,xn=!0,c=et,Ha(t.type)?(_u=c,et=bn(o.firstChild)):et=c),Et(e,t,t.pendingProps.children,i),Sl(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ie&&((c=o=et)&&(o=h0(o,t.type,t.pendingProps,xn),o!==null?(t.stateNode=o,Mt=t,et=bn(o.firstChild),xn=!1,c=!0):c=!1),c||ka(t)),qe(t),c=t.type,d=t.pendingProps,g=e!==null?e.memoizedProps:null,o=d.children,Eu(c,d)?o=null:g!==null&&Eu(c,g)&&(t.flags|=32),t.memoizedState!==null&&(c=Dc(e,t,Tb,null,null,i),ms._currentValue=c),Sl(e,t),Et(e,t,o,i),t.child;case 6:return e===null&&Ie&&((e=i=et)&&(i=m0(i,t.pendingProps,xn),i!==null?(t.stateNode=i,Mt=t,et=null,e=!0):e=!1),e||ka(t)),null;case 13:return Dm(e,t,i);case 4:return xe(t,t.stateNode.containerInfo),o=t.pendingProps,e===null?t.child=hi(t,null,o,i):Et(e,t,o,i),t.child;case 11:return Sm(e,t,t.type,t.pendingProps,i);case 7:return Et(e,t,t.pendingProps,i),t.child;case 8:return Et(e,t,t.pendingProps.children,i),t.child;case 12:return Et(e,t,t.pendingProps.children,i),t.child;case 10:return o=t.pendingProps,ja(t,t.type,o.value),Et(e,t,o.children,i),t.child;case 9:return c=t.type._context,o=t.pendingProps.children,ci(t),c=Dt(c),o=o(c),t.flags|=1,Et(e,t,o,i),t.child;case 14:return Cm(e,t,t.type,t.pendingProps,i);case 15:return wm(e,t,t.type,t.pendingProps,i);case 19:return Om(e,t,i);case 31:return _b(e,t,i);case 22:return Nm(e,t,i,t.pendingProps);case 24:return ci(t),o=Dt(yt),e===null?(c=bc(),c===null&&(c=Ze,d=xc(),c.pooledCache=d,d.refCount++,d!==null&&(c.pooledCacheLanes|=i),c=d),t.memoizedState={parent:o,cache:c},Cc(t),ja(t,yt,c)):((e.lanes&i)!==0&&(wc(e,t),Qo(t,null,null,i),Fo()),c=e.memoizedState,d=t.memoizedState,c.parent!==o?(c={parent:o,cache:o},t.memoizedState=c,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=c),ja(t,yt,o)):(o=d.cache,ja(t,yt,o),o!==c.cache&&yc(t,[yt],i,!0))),Et(e,t,t.pendingProps.children,i),t.child;case 29:throw t.pendingProps}throw Error(l(156,t.tag))}function sa(e){e.flags|=4}function iu(e,t,i,o,c){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(c&335544128)===c)if(e.stateNode.complete)e.flags|=8192;else if(sp())e.flags|=8192;else throw fi=sl,Sc}else e.flags&=-16777217}function Pm(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!$p(t))if(sp())e.flags|=8192;else throw fi=sl,Sc}function wl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Nt():536870912,e.lanes|=t,io|=t)}function es(e,t){if(!Ie)switch(e.tailMode){case"hidden":t=e.tail;for(var i=null;t!==null;)t.alternate!==null&&(i=t),t=t.sibling;i===null?e.tail=null:i.sibling=null;break;case"collapsed":i=e.tail;for(var o=null;i!==null;)i.alternate!==null&&(o=i),i=i.sibling;o===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:o.sibling=null}}function tt(e){var t=e.alternate!==null&&e.alternate.child===e.child,i=0,o=0;if(t)for(var c=e.child;c!==null;)i|=c.lanes|c.childLanes,o|=c.subtreeFlags&65011712,o|=c.flags&65011712,c.return=e,c=c.sibling;else for(c=e.child;c!==null;)i|=c.lanes|c.childLanes,o|=c.subtreeFlags,o|=c.flags,c.return=e,c=c.sibling;return e.subtreeFlags|=o,e.childLanes=i,t}function Ub(e,t,i){var o=t.pendingProps;switch(fc(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return tt(t),null;case 1:return tt(t),null;case 3:return i=t.stateNode,o=null,e!==null&&(o=e.memoizedState.cache),t.memoizedState.cache!==o&&(t.flags|=2048),na(yt),Pe(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(Yi(t)?sa(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,mc())),tt(t),null;case 26:var c=t.type,d=t.memoizedState;return e===null?(sa(t),d!==null?(tt(t),Pm(t,d)):(tt(t),iu(t,c,null,o,i))):d?d!==e.memoizedState?(sa(t),tt(t),Pm(t,d)):(tt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==o&&sa(t),tt(t),iu(t,c,e,o,i)),null;case 27:if(St(t),i=ne.current,c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==o&&sa(t);else{if(!o){if(t.stateNode===null)throw Error(l(166));return tt(t),null}e=J.current,Yi(t)?hh(t):(e=Bp(c,o,i),t.stateNode=e,sa(t))}return tt(t),null;case 5:if(St(t),c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==o&&sa(t);else{if(!o){if(t.stateNode===null)throw Error(l(166));return tt(t),null}if(d=J.current,Yi(t))hh(t);else{var g=Ul(ne.current);switch(d){case 1:d=g.createElementNS("http://www.w3.org/2000/svg",c);break;case 2:d=g.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;default:switch(c){case"svg":d=g.createElementNS("http://www.w3.org/2000/svg",c);break;case"math":d=g.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;case"script":d=g.createElement("div"),d.innerHTML="<script><\/script>",d=d.removeChild(d.firstChild);break;case"select":d=typeof o.is=="string"?g.createElement("select",{is:o.is}):g.createElement("select"),o.multiple?d.multiple=!0:o.size&&(d.size=o.size);break;default:d=typeof o.is=="string"?g.createElement(c,{is:o.is}):g.createElement(c)}}d[Tt]=t,d[It]=o;e:for(g=t.child;g!==null;){if(g.tag===5||g.tag===6)d.appendChild(g.stateNode);else if(g.tag!==4&&g.tag!==27&&g.child!==null){g.child.return=g,g=g.child;continue}if(g===t)break e;for(;g.sibling===null;){if(g.return===null||g.return===t)break e;g=g.return}g.sibling.return=g.return,g=g.sibling}t.stateNode=d;e:switch(Ot(d,c,o),c){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break e;case"img":o=!0;break e;default:o=!1}o&&sa(t)}}return tt(t),iu(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,i),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==o&&sa(t);else{if(typeof o!="string"&&t.stateNode===null)throw Error(l(166));if(e=ne.current,Yi(t)){if(e=t.stateNode,i=t.memoizedProps,o=null,c=Mt,c!==null)switch(c.tag){case 27:case 5:o=c.memoizedProps}e[Tt]=t,e=!!(e.nodeValue===i||o!==null&&o.suppressHydrationWarning===!0||Dp(e.nodeValue,i)),e||ka(t,!0)}else e=Ul(e).createTextNode(o),e[Tt]=t,t.stateNode=e}return tt(t),null;case 31:if(i=t.memoizedState,e===null||e.memoizedState!==null){if(o=Yi(t),i!==null){if(e===null){if(!o)throw Error(l(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(557));e[Tt]=t}else li(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;tt(t),e=!1}else i=mc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),e=!0;if(!e)return t.flags&256?(nn(t),t):(nn(t),null);if((t.flags&128)!==0)throw Error(l(558))}return tt(t),null;case 13:if(o=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(c=Yi(t),o!==null&&o.dehydrated!==null){if(e===null){if(!c)throw Error(l(318));if(c=t.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(l(317));c[Tt]=t}else li(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;tt(t),c=!1}else c=mc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=c),c=!0;if(!c)return t.flags&256?(nn(t),t):(nn(t),null)}return nn(t),(t.flags&128)!==0?(t.lanes=i,t):(i=o!==null,e=e!==null&&e.memoizedState!==null,i&&(o=t.child,c=null,o.alternate!==null&&o.alternate.memoizedState!==null&&o.alternate.memoizedState.cachePool!==null&&(c=o.alternate.memoizedState.cachePool.pool),d=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(d=o.memoizedState.cachePool.pool),d!==c&&(o.flags|=2048)),i!==e&&i&&(t.child.flags|=8192),wl(t,t.updateQueue),tt(t),null);case 4:return Pe(),e===null&&ku(t.stateNode.containerInfo),tt(t),null;case 10:return na(t.type),tt(t),null;case 19:if(Ne(ht),o=t.memoizedState,o===null)return tt(t),null;if(c=(t.flags&128)!==0,d=o.rendering,d===null)if(c)es(o,!1);else{if(lt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(d=ul(e),d!==null){for(t.flags|=128,es(o,!1),e=d.updateQueue,t.updateQueue=e,wl(t,e),t.subtreeFlags=0,e=i,i=t.child;i!==null;)rh(i,e),i=i.sibling;return V(ht,ht.current&1|2),Ie&&ea(t,o.treeForkCount),t.child}e=e.sibling}o.tail!==null&&ft()>Tl&&(t.flags|=128,c=!0,es(o,!1),t.lanes=4194304)}else{if(!c)if(e=ul(d),e!==null){if(t.flags|=128,c=!0,e=e.updateQueue,t.updateQueue=e,wl(t,e),es(o,!0),o.tail===null&&o.tailMode==="hidden"&&!d.alternate&&!Ie)return tt(t),null}else 2*ft()-o.renderingStartTime>Tl&&i!==536870912&&(t.flags|=128,c=!0,es(o,!1),t.lanes=4194304);o.isBackwards?(d.sibling=t.child,t.child=d):(e=o.last,e!==null?e.sibling=d:t.child=d,o.last=d)}return o.tail!==null?(e=o.tail,o.rendering=e,o.tail=e.sibling,o.renderingStartTime=ft(),e.sibling=null,i=ht.current,V(ht,c?i&1|2:i&1),Ie&&ea(t,o.treeForkCount),e):(tt(t),null);case 22:case 23:return nn(t),jc(),o=t.memoizedState!==null,e!==null?e.memoizedState!==null!==o&&(t.flags|=8192):o&&(t.flags|=8192),o?(i&536870912)!==0&&(t.flags&128)===0&&(tt(t),t.subtreeFlags&6&&(t.flags|=8192)):tt(t),i=t.updateQueue,i!==null&&wl(t,i.retryQueue),i=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),o=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(o=t.memoizedState.cachePool.pool),o!==i&&(t.flags|=2048),e!==null&&Ne(ui),null;case 24:return i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),na(yt),tt(t),null;case 25:return null;case 30:return null}throw Error(l(156,t.tag))}function Ib(e,t){switch(fc(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return na(yt),Pe(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return St(t),null;case 31:if(t.memoizedState!==null){if(nn(t),t.alternate===null)throw Error(l(340));li()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(nn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(l(340));li()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ne(ht),null;case 4:return Pe(),null;case 10:return na(t.type),null;case 22:case 23:return nn(t),jc(),e!==null&&Ne(ui),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return na(yt),null;case 25:return null;default:return null}}function Lm(e,t){switch(fc(t),t.tag){case 3:na(yt),Pe();break;case 26:case 27:case 5:St(t);break;case 4:Pe();break;case 31:t.memoizedState!==null&&nn(t);break;case 13:nn(t);break;case 19:Ne(ht);break;case 10:na(t.type);break;case 22:case 23:nn(t),jc(),e!==null&&Ne(ui);break;case 24:na(yt)}}function ts(e,t){try{var i=t.updateQueue,o=i!==null?i.lastEffect:null;if(o!==null){var c=o.next;i=c;do{if((i.tag&e)===e){o=void 0;var d=i.create,g=i.inst;o=d(),g.destroy=o}i=i.next}while(i!==c)}}catch(v){Fe(t,t.return,v)}}function Ra(e,t,i){try{var o=t.updateQueue,c=o!==null?o.lastEffect:null;if(c!==null){var d=c.next;o=d;do{if((o.tag&e)===e){var g=o.inst,v=g.destroy;if(v!==void 0){g.destroy=void 0,c=t;var k=i,L=v;try{L()}catch(q){Fe(c,k,q)}}}o=o.next}while(o!==d)}}catch(q){Fe(t,t.return,q)}}function _m(e){var t=e.updateQueue;if(t!==null){var i=e.stateNode;try{kh(t,i)}catch(o){Fe(e,e.return,o)}}}function zm(e,t,i){i.props=pi(e.type,e.memoizedProps),i.state=e.memoizedState;try{i.componentWillUnmount()}catch(o){Fe(e,t,o)}}function ns(e,t){try{var i=e.ref;if(i!==null){switch(e.tag){case 26:case 27:case 5:var o=e.stateNode;break;case 30:o=e.stateNode;break;default:o=e.stateNode}typeof i=="function"?e.refCleanup=i(o):i.current=o}}catch(c){Fe(e,t,c)}}function _n(e,t){var i=e.ref,o=e.refCleanup;if(i!==null)if(typeof o=="function")try{o()}catch(c){Fe(e,t,c)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(c){Fe(e,t,c)}else i.current=null}function Um(e){var t=e.type,i=e.memoizedProps,o=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":i.autoFocus&&o.focus();break e;case"img":i.src?o.src=i.src:i.srcSet&&(o.srcset=i.srcSet)}}catch(c){Fe(e,e.return,c)}}function ou(e,t,i){try{var o=e.stateNode;l0(o,e.type,i,t),o[It]=t}catch(c){Fe(e,e.return,c)}}function Im(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ha(e.type)||e.tag===4}function su(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Im(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Ha(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function lu(e,t,i){var o=e.tag;if(o===5||o===6)e=e.stateNode,t?(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i).insertBefore(e,t):(t=i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,t.appendChild(e),i=i._reactRootContainer,i!=null||t.onclick!==null||(t.onclick=Xn));else if(o!==4&&(o===27&&Ha(e.type)&&(i=e.stateNode,t=null),e=e.child,e!==null))for(lu(e,t,i),e=e.sibling;e!==null;)lu(e,t,i),e=e.sibling}function Nl(e,t,i){var o=e.tag;if(o===5||o===6)e=e.stateNode,t?i.insertBefore(e,t):i.appendChild(e);else if(o!==4&&(o===27&&Ha(e.type)&&(i=e.stateNode),e=e.child,e!==null))for(Nl(e,t,i),e=e.sibling;e!==null;)Nl(e,t,i),e=e.sibling}function Hm(e){var t=e.stateNode,i=e.memoizedProps;try{for(var o=e.type,c=t.attributes;c.length;)t.removeAttributeNode(c[0]);Ot(t,o,i),t[Tt]=e,t[It]=i}catch(d){Fe(e,e.return,d)}}var la=!1,bt=!1,ru=!1,Bm=typeof WeakSet=="function"?WeakSet:Set,kt=null;function Hb(e,t){if(e=e.containerInfo,Mu=Yl,e=Jf(e),tc(e)){if("selectionStart"in e)var i={start:e.selectionStart,end:e.selectionEnd};else e:{i=(i=e.ownerDocument)&&i.defaultView||window;var o=i.getSelection&&i.getSelection();if(o&&o.rangeCount!==0){i=o.anchorNode;var c=o.anchorOffset,d=o.focusNode;o=o.focusOffset;try{i.nodeType,d.nodeType}catch{i=null;break e}var g=0,v=-1,k=-1,L=0,q=0,Y=e,z=null;t:for(;;){for(var I;Y!==i||c!==0&&Y.nodeType!==3||(v=g+c),Y!==d||o!==0&&Y.nodeType!==3||(k=g+o),Y.nodeType===3&&(g+=Y.nodeValue.length),(I=Y.firstChild)!==null;)z=Y,Y=I;for(;;){if(Y===e)break t;if(z===i&&++L===c&&(v=g),z===d&&++q===o&&(k=g),(I=Y.nextSibling)!==null)break;Y=z,z=Y.parentNode}Y=I}i=v===-1||k===-1?null:{start:v,end:k}}else i=null}i=i||{start:0,end:0}}else i=null;for(Du={focusedElem:e,selectionRange:i},Yl=!1,kt=t;kt!==null;)if(t=kt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,kt=e;else for(;kt!==null;){switch(t=kt,d=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(i=0;i<e.length;i++)c=e[i],c.ref.impl=c.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&d!==null){e=void 0,i=t,c=d.memoizedProps,d=d.memoizedState,o=i.stateNode;try{var re=pi(i.type,c);e=o.getSnapshotBeforeUpdate(re,d),o.__reactInternalSnapshotBeforeUpdate=e}catch(Se){Fe(i,i.return,Se)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,i=e.nodeType,i===9)Ru(e);else if(i===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Ru(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(l(163))}if(e=t.sibling,e!==null){e.return=t.return,kt=e;break}kt=t.return}}function Km(e,t,i){var o=i.flags;switch(i.tag){case 0:case 11:case 15:ca(e,i),o&4&&ts(5,i);break;case 1:if(ca(e,i),o&4)if(e=i.stateNode,t===null)try{e.componentDidMount()}catch(g){Fe(i,i.return,g)}else{var c=pi(i.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(c,t,e.__reactInternalSnapshotBeforeUpdate)}catch(g){Fe(i,i.return,g)}}o&64&&_m(i),o&512&&ns(i,i.return);break;case 3:if(ca(e,i),o&64&&(e=i.updateQueue,e!==null)){if(t=null,i.child!==null)switch(i.child.tag){case 27:case 5:t=i.child.stateNode;break;case 1:t=i.child.stateNode}try{kh(e,t)}catch(g){Fe(i,i.return,g)}}break;case 27:t===null&&o&4&&Hm(i);case 26:case 5:ca(e,i),t===null&&o&4&&Um(i),o&512&&ns(i,i.return);break;case 12:ca(e,i);break;case 31:ca(e,i),o&4&&Ym(e,i);break;case 13:ca(e,i),o&4&&Vm(e,i),o&64&&(e=i.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(i=$b.bind(null,i),p0(e,i))));break;case 22:if(o=i.memoizedState!==null||la,!o){t=t!==null&&t.memoizedState!==null||bt,c=la;var d=bt;la=o,(bt=t)&&!d?ua(e,i,(i.subtreeFlags&8772)!==0):ca(e,i),la=c,bt=d}break;case 30:break;default:ca(e,i)}}function qm(e){var t=e.alternate;t!==null&&(e.alternate=null,qm(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Ur(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var it=null,Bt=!1;function ra(e,t,i){for(i=i.child;i!==null;)Gm(e,t,i),i=i.sibling}function Gm(e,t,i){if(Z&&typeof Z.onCommitFiberUnmount=="function")try{Z.onCommitFiberUnmount(Fn,i)}catch{}switch(i.tag){case 26:bt||_n(i,t),ra(e,t,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:bt||_n(i,t);var o=it,c=Bt;Ha(i.type)&&(it=i.stateNode,Bt=!1),ra(e,t,i),ds(i.stateNode),it=o,Bt=c;break;case 5:bt||_n(i,t);case 6:if(o=it,c=Bt,it=null,ra(e,t,i),it=o,Bt=c,it!==null)if(Bt)try{(it.nodeType===9?it.body:it.nodeName==="HTML"?it.ownerDocument.body:it).removeChild(i.stateNode)}catch(d){Fe(i,t,d)}else try{it.removeChild(i.stateNode)}catch(d){Fe(i,t,d)}break;case 18:it!==null&&(Bt?(e=it,_p(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,i.stateNode),ho(e)):_p(it,i.stateNode));break;case 4:o=it,c=Bt,it=i.stateNode.containerInfo,Bt=!0,ra(e,t,i),it=o,Bt=c;break;case 0:case 11:case 14:case 15:Ra(2,i,t),bt||Ra(4,i,t),ra(e,t,i);break;case 1:bt||(_n(i,t),o=i.stateNode,typeof o.componentWillUnmount=="function"&&zm(i,t,o)),ra(e,t,i);break;case 21:ra(e,t,i);break;case 22:bt=(o=bt)||i.memoizedState!==null,ra(e,t,i),bt=o;break;default:ra(e,t,i)}}function Ym(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{ho(e)}catch(i){Fe(t,t.return,i)}}}function Vm(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{ho(e)}catch(i){Fe(t,t.return,i)}}function Bb(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Bm),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Bm),t;default:throw Error(l(435,e.tag))}}function Al(e,t){var i=Bb(e);t.forEach(function(o){if(!i.has(o)){i.add(o);var c=Wb.bind(null,e,o);o.then(c,c)}})}function Kt(e,t){var i=t.deletions;if(i!==null)for(var o=0;o<i.length;o++){var c=i[o],d=e,g=t,v=g;e:for(;v!==null;){switch(v.tag){case 27:if(Ha(v.type)){it=v.stateNode,Bt=!1;break e}break;case 5:it=v.stateNode,Bt=!1;break e;case 3:case 4:it=v.stateNode.containerInfo,Bt=!0;break e}v=v.return}if(it===null)throw Error(l(160));Gm(d,g,c),it=null,Bt=!1,d=c.alternate,d!==null&&(d.return=null),c.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Fm(t,e),t=t.sibling}var An=null;function Fm(e,t){var i=e.alternate,o=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Kt(t,e),qt(e),o&4&&(Ra(3,e,e.return),ts(3,e),Ra(5,e,e.return));break;case 1:Kt(t,e),qt(e),o&512&&(bt||i===null||_n(i,i.return)),o&64&&la&&(e=e.updateQueue,e!==null&&(o=e.callbacks,o!==null&&(i=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=i===null?o:i.concat(o))));break;case 26:var c=An;if(Kt(t,e),qt(e),o&512&&(bt||i===null||_n(i,i.return)),o&4){var d=i!==null?i.memoizedState:null;if(o=e.memoizedState,i===null)if(o===null)if(e.stateNode===null){e:{o=e.type,i=e.memoizedProps,c=c.ownerDocument||c;t:switch(o){case"title":d=c.getElementsByTagName("title")[0],(!d||d[Mo]||d[Tt]||d.namespaceURI==="http://www.w3.org/2000/svg"||d.hasAttribute("itemprop"))&&(d=c.createElement(o),c.head.insertBefore(d,c.querySelector("head > title"))),Ot(d,o,i),d[Tt]=e,At(d),o=d;break e;case"link":var g=Fp("link","href",c).get(o+(i.href||""));if(g){for(var v=0;v<g.length;v++)if(d=g[v],d.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&d.getAttribute("rel")===(i.rel==null?null:i.rel)&&d.getAttribute("title")===(i.title==null?null:i.title)&&d.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){g.splice(v,1);break t}}d=c.createElement(o),Ot(d,o,i),c.head.appendChild(d);break;case"meta":if(g=Fp("meta","content",c).get(o+(i.content||""))){for(v=0;v<g.length;v++)if(d=g[v],d.getAttribute("content")===(i.content==null?null:""+i.content)&&d.getAttribute("name")===(i.name==null?null:i.name)&&d.getAttribute("property")===(i.property==null?null:i.property)&&d.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&d.getAttribute("charset")===(i.charSet==null?null:i.charSet)){g.splice(v,1);break t}}d=c.createElement(o),Ot(d,o,i),c.head.appendChild(d);break;default:throw Error(l(468,o))}d[Tt]=e,At(d),o=d}e.stateNode=o}else Qp(c,e.type,e.stateNode);else e.stateNode=Vp(c,o,e.memoizedProps);else d!==o?(d===null?i.stateNode!==null&&(i=i.stateNode,i.parentNode.removeChild(i)):d.count--,o===null?Qp(c,e.type,e.stateNode):Vp(c,o,e.memoizedProps)):o===null&&e.stateNode!==null&&ou(e,e.memoizedProps,i.memoizedProps)}break;case 27:Kt(t,e),qt(e),o&512&&(bt||i===null||_n(i,i.return)),i!==null&&o&4&&ou(e,e.memoizedProps,i.memoizedProps);break;case 5:if(Kt(t,e),qt(e),o&512&&(bt||i===null||_n(i,i.return)),e.flags&32){c=e.stateNode;try{Li(c,"")}catch(re){Fe(e,e.return,re)}}o&4&&e.stateNode!=null&&(c=e.memoizedProps,ou(e,c,i!==null?i.memoizedProps:c)),o&1024&&(ru=!0);break;case 6:if(Kt(t,e),qt(e),o&4){if(e.stateNode===null)throw Error(l(162));o=e.memoizedProps,i=e.stateNode;try{i.nodeValue=o}catch(re){Fe(e,e.return,re)}}break;case 3:if(Bl=null,c=An,An=Il(t.containerInfo),Kt(t,e),An=c,qt(e),o&4&&i!==null&&i.memoizedState.isDehydrated)try{ho(t.containerInfo)}catch(re){Fe(e,e.return,re)}ru&&(ru=!1,Qm(e));break;case 4:o=An,An=Il(e.stateNode.containerInfo),Kt(t,e),qt(e),An=o;break;case 12:Kt(t,e),qt(e);break;case 31:Kt(t,e),qt(e),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,Al(e,o)));break;case 13:Kt(t,e),qt(e),e.child.flags&8192&&e.memoizedState!==null!=(i!==null&&i.memoizedState!==null)&&(jl=ft()),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,Al(e,o)));break;case 22:c=e.memoizedState!==null;var k=i!==null&&i.memoizedState!==null,L=la,q=bt;if(la=L||c,bt=q||k,Kt(t,e),bt=q,la=L,qt(e),o&8192)e:for(t=e.stateNode,t._visibility=c?t._visibility&-2:t._visibility|1,c&&(i===null||k||la||bt||gi(e)),i=null,t=e;;){if(t.tag===5||t.tag===26){if(i===null){k=i=t;try{if(d=k.stateNode,c)g=d.style,typeof g.setProperty=="function"?g.setProperty("display","none","important"):g.display="none";else{v=k.stateNode;var Y=k.memoizedProps.style,z=Y!=null&&Y.hasOwnProperty("display")?Y.display:null;v.style.display=z==null||typeof z=="boolean"?"":(""+z).trim()}}catch(re){Fe(k,k.return,re)}}}else if(t.tag===6){if(i===null){k=t;try{k.stateNode.nodeValue=c?"":k.memoizedProps}catch(re){Fe(k,k.return,re)}}}else if(t.tag===18){if(i===null){k=t;try{var I=k.stateNode;c?zp(I,!0):zp(k.stateNode,!1)}catch(re){Fe(k,k.return,re)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;i===t&&(i=null),t=t.return}i===t&&(i=null),t.sibling.return=t.return,t=t.sibling}o&4&&(o=e.updateQueue,o!==null&&(i=o.retryQueue,i!==null&&(o.retryQueue=null,Al(e,i))));break;case 19:Kt(t,e),qt(e),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,Al(e,o)));break;case 30:break;case 21:break;default:Kt(t,e),qt(e)}}function qt(e){var t=e.flags;if(t&2){try{for(var i,o=e.return;o!==null;){if(Im(o)){i=o;break}o=o.return}if(i==null)throw Error(l(160));switch(i.tag){case 27:var c=i.stateNode,d=su(e);Nl(e,d,c);break;case 5:var g=i.stateNode;i.flags&32&&(Li(g,""),i.flags&=-33);var v=su(e);Nl(e,v,g);break;case 3:case 4:var k=i.stateNode.containerInfo,L=su(e);lu(e,L,k);break;default:throw Error(l(161))}}catch(q){Fe(e,e.return,q)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Qm(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Qm(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function ca(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Km(e,t.alternate,t),t=t.sibling}function gi(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Ra(4,t,t.return),gi(t);break;case 1:_n(t,t.return);var i=t.stateNode;typeof i.componentWillUnmount=="function"&&zm(t,t.return,i),gi(t);break;case 27:ds(t.stateNode);case 26:case 5:_n(t,t.return),gi(t);break;case 22:t.memoizedState===null&&gi(t);break;case 30:gi(t);break;default:gi(t)}e=e.sibling}}function ua(e,t,i){for(i=i&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var o=t.alternate,c=e,d=t,g=d.flags;switch(d.tag){case 0:case 11:case 15:ua(c,d,i),ts(4,d);break;case 1:if(ua(c,d,i),o=d,c=o.stateNode,typeof c.componentDidMount=="function")try{c.componentDidMount()}catch(L){Fe(o,o.return,L)}if(o=d,c=o.updateQueue,c!==null){var v=o.stateNode;try{var k=c.shared.hiddenCallbacks;if(k!==null)for(c.shared.hiddenCallbacks=null,c=0;c<k.length;c++)Ah(k[c],v)}catch(L){Fe(o,o.return,L)}}i&&g&64&&_m(d),ns(d,d.return);break;case 27:Hm(d);case 26:case 5:ua(c,d,i),i&&o===null&&g&4&&Um(d),ns(d,d.return);break;case 12:ua(c,d,i);break;case 31:ua(c,d,i),i&&g&4&&Ym(c,d);break;case 13:ua(c,d,i),i&&g&4&&Vm(c,d);break;case 22:d.memoizedState===null&&ua(c,d,i),ns(d,d.return);break;case 30:break;default:ua(c,d,i)}t=t.sibling}}function cu(e,t){var i=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==i&&(e!=null&&e.refCount++,i!=null&&Ko(i))}function uu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ko(e))}function kn(e,t,i,o){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)$m(e,t,i,o),t=t.sibling}function $m(e,t,i,o){var c=t.flags;switch(t.tag){case 0:case 11:case 15:kn(e,t,i,o),c&2048&&ts(9,t);break;case 1:kn(e,t,i,o);break;case 3:kn(e,t,i,o),c&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ko(e)));break;case 12:if(c&2048){kn(e,t,i,o),e=t.stateNode;try{var d=t.memoizedProps,g=d.id,v=d.onPostCommit;typeof v=="function"&&v(g,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(k){Fe(t,t.return,k)}}else kn(e,t,i,o);break;case 31:kn(e,t,i,o);break;case 13:kn(e,t,i,o);break;case 23:break;case 22:d=t.stateNode,g=t.alternate,t.memoizedState!==null?d._visibility&2?kn(e,t,i,o):as(e,t):d._visibility&2?kn(e,t,i,o):(d._visibility|=2,to(e,t,i,o,(t.subtreeFlags&10256)!==0||!1)),c&2048&&cu(g,t);break;case 24:kn(e,t,i,o),c&2048&&uu(t.alternate,t);break;default:kn(e,t,i,o)}}function to(e,t,i,o,c){for(c=c&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var d=e,g=t,v=i,k=o,L=g.flags;switch(g.tag){case 0:case 11:case 15:to(d,g,v,k,c),ts(8,g);break;case 23:break;case 22:var q=g.stateNode;g.memoizedState!==null?q._visibility&2?to(d,g,v,k,c):as(d,g):(q._visibility|=2,to(d,g,v,k,c)),c&&L&2048&&cu(g.alternate,g);break;case 24:to(d,g,v,k,c),c&&L&2048&&uu(g.alternate,g);break;default:to(d,g,v,k,c)}t=t.sibling}}function as(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var i=e,o=t,c=o.flags;switch(o.tag){case 22:as(i,o),c&2048&&cu(o.alternate,o);break;case 24:as(i,o),c&2048&&uu(o.alternate,o);break;default:as(i,o)}t=t.sibling}}var is=8192;function no(e,t,i){if(e.subtreeFlags&is)for(e=e.child;e!==null;)Wm(e,t,i),e=e.sibling}function Wm(e,t,i){switch(e.tag){case 26:no(e,t,i),e.flags&is&&e.memoizedState!==null&&j0(i,An,e.memoizedState,e.memoizedProps);break;case 5:no(e,t,i);break;case 3:case 4:var o=An;An=Il(e.stateNode.containerInfo),no(e,t,i),An=o;break;case 22:e.memoizedState===null&&(o=e.alternate,o!==null&&o.memoizedState!==null?(o=is,is=16777216,no(e,t,i),is=o):no(e,t,i));break;default:no(e,t,i)}}function Xm(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function os(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var o=t[i];kt=o,Jm(o,e)}Xm(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Zm(e),e=e.sibling}function Zm(e){switch(e.tag){case 0:case 11:case 15:os(e),e.flags&2048&&Ra(9,e,e.return);break;case 3:os(e);break;case 12:os(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,kl(e)):os(e);break;default:os(e)}}function kl(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var o=t[i];kt=o,Jm(o,e)}Xm(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ra(8,t,t.return),kl(t);break;case 22:i=t.stateNode,i._visibility&2&&(i._visibility&=-3,kl(t));break;default:kl(t)}e=e.sibling}}function Jm(e,t){for(;kt!==null;){var i=kt;switch(i.tag){case 0:case 11:case 15:Ra(8,i,t);break;case 23:case 22:if(i.memoizedState!==null&&i.memoizedState.cachePool!==null){var o=i.memoizedState.cachePool.pool;o!=null&&o.refCount++}break;case 24:Ko(i.memoizedState.cache)}if(o=i.child,o!==null)o.return=i,kt=o;else e:for(i=e;kt!==null;){o=kt;var c=o.sibling,d=o.return;if(qm(o),o===i){kt=null;break e}if(c!==null){c.return=d,kt=c;break e}kt=d}}}var Kb={getCacheForType:function(e){var t=Dt(yt),i=t.data.get(e);return i===void 0&&(i=e(),t.data.set(e,i)),i},cacheSignal:function(){return Dt(yt).controller.signal}},qb=typeof WeakMap=="function"?WeakMap:Map,Ge=0,Ze=null,Le=null,ze=0,Ve=0,an=null,Pa=!1,ao=!1,du=!1,da=0,lt=0,La=0,yi=0,fu=0,on=0,io=0,ss=null,Gt=null,hu=!1,jl=0,ep=0,Tl=1/0,Ml=null,_a=null,wt=0,za=null,oo=null,fa=0,mu=0,pu=null,tp=null,ls=0,gu=null;function sn(){return(Ge&2)!==0&&ze!==0?ze&-ze:R.T!==null?Cu():jo()}function np(){if(on===0)if((ze&536870912)===0||Ie){var e=be;be<<=1,(be&3932160)===0&&(be=262144),on=e}else on=536870912;return e=tn.current,e!==null&&(e.flags|=32),on}function Yt(e,t,i){(e===Ze&&(Ve===2||Ve===9)||e.cancelPendingCommit!==null)&&(so(e,0),Ua(e,ze,on,!1)),wn(e,i),((Ge&2)===0||e!==Ze)&&(e===Ze&&((Ge&2)===0&&(yi|=i),lt===4&&Ua(e,ze,on,!1)),zn(e))}function ap(e,t,i){if((Ge&6)!==0)throw Error(l(327));var o=!i&&(t&127)===0&&(t&e.expiredLanes)===0||Pt(e,t),c=o?Vb(e,t):xu(e,t,!0),d=o;do{if(c===0){ao&&!o&&Ua(e,t,0,!1);break}else{if(i=e.current.alternate,d&&!Gb(i)){c=xu(e,t,!1),d=!1;continue}if(c===2){if(d=t,e.errorRecoveryDisabledLanes&d)var g=0;else g=e.pendingLanes&-536870913,g=g!==0?g:g&536870912?536870912:0;if(g!==0){t=g;e:{var v=e;c=ss;var k=v.current.memoizedState.isDehydrated;if(k&&(so(v,g).flags|=256),g=xu(v,g,!1),g!==2){if(du&&!k){v.errorRecoveryDisabledLanes|=d,yi|=d,c=4;break e}d=Gt,Gt=c,d!==null&&(Gt===null?Gt=d:Gt.push.apply(Gt,d))}c=g}if(d=!1,c!==2)continue}}if(c===1){so(e,0),Ua(e,t,0,!0);break}e:{switch(o=e,d=c,d){case 0:case 1:throw Error(l(345));case 4:if((t&4194048)!==t)break;case 6:Ua(o,t,on,!Pa);break e;case 2:Gt=null;break;case 3:case 5:break;default:throw Error(l(329))}if((t&62914560)===t&&(c=jl+300-ft(),10<c)){if(Ua(o,t,on,!Pa),we(o,0,!0)!==0)break e;fa=t,o.timeoutHandle=Pp(ip.bind(null,o,i,Gt,Ml,hu,t,on,yi,io,Pa,d,"Throttled",-0,0),c);break e}ip(o,i,Gt,Ml,hu,t,on,yi,io,Pa,d,null,-0,0)}}break}while(!0);zn(e)}function ip(e,t,i,o,c,d,g,v,k,L,q,Y,z,I){if(e.timeoutHandle=-1,Y=t.subtreeFlags,Y&8192||(Y&16785408)===16785408){Y={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Xn},Wm(t,d,Y);var re=(d&62914560)===d?jl-ft():(d&4194048)===d?ep-ft():0;if(re=T0(Y,re),re!==null){fa=d,e.cancelPendingCommit=re(fp.bind(null,e,t,d,i,o,c,g,v,k,q,Y,null,z,I)),Ua(e,d,g,!L);return}}fp(e,t,d,i,o,c,g,v,k)}function Gb(e){for(var t=e;;){var i=t.tag;if((i===0||i===11||i===15)&&t.flags&16384&&(i=t.updateQueue,i!==null&&(i=i.stores,i!==null)))for(var o=0;o<i.length;o++){var c=i[o],d=c.getSnapshot;c=c.value;try{if(!Jt(d(),c))return!1}catch{return!1}}if(i=t.child,t.subtreeFlags&16384&&i!==null)i.return=t,t=i;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Ua(e,t,i,o){t&=~fu,t&=~yi,e.suspendedLanes|=t,e.pingedLanes&=~t,o&&(e.warmLanes|=t),o=e.expirationTimes;for(var c=t;0<c;){var d=31-ve(c),g=1<<d;o[d]=-1,c&=~g}i!==0&&ei(e,i,t)}function Dl(){return(Ge&6)===0?(rs(0),!1):!0}function yu(){if(Le!==null){if(Ve===0)var e=Le.return;else e=Le,ta=ri=null,Rc(e),Wi=null,Go=0,e=Le;for(;e!==null;)Lm(e.alternate,e),e=e.return;Le=null}}function so(e,t){var i=e.timeoutHandle;i!==-1&&(e.timeoutHandle=-1,u0(i)),i=e.cancelPendingCommit,i!==null&&(e.cancelPendingCommit=null,i()),fa=0,yu(),Ze=e,Le=i=Jn(e.current,null),ze=t,Ve=0,an=null,Pa=!1,ao=Pt(e,t),du=!1,io=on=fu=yi=La=lt=0,Gt=ss=null,hu=!1,(t&8)!==0&&(t|=t&32);var o=e.entangledLanes;if(o!==0)for(e=e.entanglements,o&=t;0<o;){var c=31-ve(o),d=1<<c;t|=e[c],o&=~d}return da=t,Xs(),i}function op(e,t){Te=null,R.H=Zo,t===$i||t===ol?(t=Sh(),Ve=3):t===Sc?(t=Sh(),Ve=4):Ve=t===$c?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,an=t,Le===null&&(lt=1,vl(e,pn(t,e.current)))}function sp(){var e=tn.current;return e===null?!0:(ze&4194048)===ze?vn===null:(ze&62914560)===ze||(ze&536870912)!==0?e===vn:!1}function lp(){var e=R.H;return R.H=Zo,e===null?Zo:e}function rp(){var e=R.A;return R.A=Kb,e}function El(){lt=4,Pa||(ze&4194048)!==ze&&tn.current!==null||(ao=!0),(La&134217727)===0&&(yi&134217727)===0||Ze===null||Ua(Ze,ze,on,!1)}function xu(e,t,i){var o=Ge;Ge|=2;var c=lp(),d=rp();(Ze!==e||ze!==t)&&(Ml=null,so(e,t)),t=!1;var g=lt;e:do try{if(Ve!==0&&Le!==null){var v=Le,k=an;switch(Ve){case 8:yu(),g=6;break e;case 3:case 2:case 9:case 6:tn.current===null&&(t=!0);var L=Ve;if(Ve=0,an=null,lo(e,v,k,L),i&&ao){g=0;break e}break;default:L=Ve,Ve=0,an=null,lo(e,v,k,L)}}Yb(),g=lt;break}catch(q){op(e,q)}while(!0);return t&&e.shellSuspendCounter++,ta=ri=null,Ge=o,R.H=c,R.A=d,Le===null&&(Ze=null,ze=0,Xs()),g}function Yb(){for(;Le!==null;)cp(Le)}function Vb(e,t){var i=Ge;Ge|=2;var o=lp(),c=rp();Ze!==e||ze!==t?(Ml=null,Tl=ft()+500,so(e,t)):ao=Pt(e,t);e:do try{if(Ve!==0&&Le!==null){t=Le;var d=an;t:switch(Ve){case 1:Ve=0,an=null,lo(e,t,d,1);break;case 2:case 9:if(vh(d)){Ve=0,an=null,up(t);break}t=function(){Ve!==2&&Ve!==9||Ze!==e||(Ve=7),zn(e)},d.then(t,t);break e;case 3:Ve=7;break e;case 4:Ve=5;break e;case 7:vh(d)?(Ve=0,an=null,up(t)):(Ve=0,an=null,lo(e,t,d,7));break;case 5:var g=null;switch(Le.tag){case 26:g=Le.memoizedState;case 5:case 27:var v=Le;if(g?$p(g):v.stateNode.complete){Ve=0,an=null;var k=v.sibling;if(k!==null)Le=k;else{var L=v.return;L!==null?(Le=L,Ol(L)):Le=null}break t}}Ve=0,an=null,lo(e,t,d,5);break;case 6:Ve=0,an=null,lo(e,t,d,6);break;case 8:yu(),lt=6;break e;default:throw Error(l(462))}}Fb();break}catch(q){op(e,q)}while(!0);return ta=ri=null,R.H=o,R.A=c,Ge=i,Le!==null?0:(Ze=null,ze=0,Xs(),lt)}function Fb(){for(;Le!==null&&!Sa();)cp(Le)}function cp(e){var t=Rm(e.alternate,e,da);e.memoizedProps=e.pendingProps,t===null?Ol(e):Le=t}function up(e){var t=e,i=t.alternate;switch(t.tag){case 15:case 0:t=jm(i,t,t.pendingProps,t.type,void 0,ze);break;case 11:t=jm(i,t,t.pendingProps,t.type.render,t.ref,ze);break;case 5:Rc(t);default:Lm(i,t),t=Le=rh(t,da),t=Rm(i,t,da)}e.memoizedProps=e.pendingProps,t===null?Ol(e):Le=t}function lo(e,t,i,o){ta=ri=null,Rc(t),Wi=null,Go=0;var c=t.return;try{if(Lb(e,c,t,i,ze)){lt=1,vl(e,pn(i,e.current)),Le=null;return}}catch(d){if(c!==null)throw Le=c,d;lt=1,vl(e,pn(i,e.current)),Le=null;return}t.flags&32768?(Ie||o===1?e=!0:ao||(ze&536870912)!==0?e=!1:(Pa=e=!0,(o===2||o===9||o===3||o===6)&&(o=tn.current,o!==null&&o.tag===13&&(o.flags|=16384))),dp(t,e)):Ol(t)}function Ol(e){var t=e;do{if((t.flags&32768)!==0){dp(t,Pa);return}e=t.return;var i=Ub(t.alternate,t,da);if(i!==null){Le=i;return}if(t=t.sibling,t!==null){Le=t;return}Le=t=e}while(t!==null);lt===0&&(lt=5)}function dp(e,t){do{var i=Ib(e.alternate,e);if(i!==null){i.flags&=32767,Le=i;return}if(i=e.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!t&&(e=e.sibling,e!==null)){Le=e;return}Le=e=i}while(e!==null);lt=6,Le=null}function fp(e,t,i,o,c,d,g,v,k){e.cancelPendingCommit=null;do Rl();while(wt!==0);if((Ge&6)!==0)throw Error(l(327));if(t!==null){if(t===e.current)throw Error(l(177));if(d=t.lanes|t.childLanes,d|=sc,Ao(e,i,d,g,v,k),e===Ze&&(Le=Ze=null,ze=0),oo=t,za=e,fa=i,mu=d,pu=c,tp=o,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Xb(On,function(){return yp(),null})):(e.callbackNode=null,e.callbackPriority=0),o=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||o){o=R.T,R.T=null,c=$.p,$.p=2,g=Ge,Ge|=4;try{Hb(e,t,i)}finally{Ge=g,$.p=c,R.T=o}}wt=1,hp(),mp(),pp()}}function hp(){if(wt===1){wt=0;var e=za,t=oo,i=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||i){i=R.T,R.T=null;var o=$.p;$.p=2;var c=Ge;Ge|=4;try{Fm(t,e);var d=Du,g=Jf(e.containerInfo),v=d.focusedElem,k=d.selectionRange;if(g!==v&&v&&v.ownerDocument&&Zf(v.ownerDocument.documentElement,v)){if(k!==null&&tc(v)){var L=k.start,q=k.end;if(q===void 0&&(q=L),"selectionStart"in v)v.selectionStart=L,v.selectionEnd=Math.min(q,v.value.length);else{var Y=v.ownerDocument||document,z=Y&&Y.defaultView||window;if(z.getSelection){var I=z.getSelection(),re=v.textContent.length,Se=Math.min(k.start,re),Xe=k.end===void 0?Se:Math.min(k.end,re);!I.extend&&Se>Xe&&(g=Xe,Xe=Se,Se=g);var D=Xf(v,Se),j=Xf(v,Xe);if(D&&j&&(I.rangeCount!==1||I.anchorNode!==D.node||I.anchorOffset!==D.offset||I.focusNode!==j.node||I.focusOffset!==j.offset)){var P=Y.createRange();P.setStart(D.node,D.offset),I.removeAllRanges(),Se>Xe?(I.addRange(P),I.extend(j.node,j.offset)):(P.setEnd(j.node,j.offset),I.addRange(P))}}}}for(Y=[],I=v;I=I.parentNode;)I.nodeType===1&&Y.push({element:I,left:I.scrollLeft,top:I.scrollTop});for(typeof v.focus=="function"&&v.focus(),v=0;v<Y.length;v++){var G=Y[v];G.element.scrollLeft=G.left,G.element.scrollTop=G.top}}Yl=!!Mu,Du=Mu=null}finally{Ge=c,$.p=o,R.T=i}}e.current=t,wt=2}}function mp(){if(wt===2){wt=0;var e=za,t=oo,i=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||i){i=R.T,R.T=null;var o=$.p;$.p=2;var c=Ge;Ge|=4;try{Km(e,t.alternate,t)}finally{Ge=c,$.p=o,R.T=i}}wt=3}}function pp(){if(wt===4||wt===3){wt=0,Yn();var e=za,t=oo,i=fa,o=tp;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?wt=5:(wt=0,oo=za=null,gp(e,e.pendingLanes));var c=e.pendingLanes;if(c===0&&(_a=null),Ti(i),t=t.stateNode,Z&&typeof Z.onCommitFiberRoot=="function")try{Z.onCommitFiberRoot(Fn,t,void 0,(t.current.flags&128)===128)}catch{}if(o!==null){t=R.T,c=$.p,$.p=2,R.T=null;try{for(var d=e.onRecoverableError,g=0;g<o.length;g++){var v=o[g];d(v.value,{componentStack:v.stack})}}finally{R.T=t,$.p=c}}(fa&3)!==0&&Rl(),zn(e),c=e.pendingLanes,(i&261930)!==0&&(c&42)!==0?e===gu?ls++:(ls=0,gu=e):ls=0,rs(0)}}function gp(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ko(t)))}function Rl(){return hp(),mp(),pp(),yp()}function yp(){if(wt!==5)return!1;var e=za,t=mu;mu=0;var i=Ti(fa),o=R.T,c=$.p;try{$.p=32>i?32:i,R.T=null,i=pu,pu=null;var d=za,g=fa;if(wt=0,oo=za=null,fa=0,(Ge&6)!==0)throw Error(l(331));var v=Ge;if(Ge|=4,Zm(d.current),$m(d,d.current,g,i),Ge=v,rs(0,!1),Z&&typeof Z.onPostCommitFiberRoot=="function")try{Z.onPostCommitFiberRoot(Fn,d)}catch{}return!0}finally{$.p=c,R.T=o,gp(e,t)}}function xp(e,t,i){t=pn(i,t),t=Qc(e.stateNode,t,2),e=Da(e,t,2),e!==null&&(wn(e,2),zn(e))}function Fe(e,t,i){if(e.tag===3)xp(e,e,i);else for(;t!==null;){if(t.tag===3){xp(t,e,i);break}else if(t.tag===1){var o=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(_a===null||!_a.has(o))){e=pn(i,e),i=vm(2),o=Da(t,i,2),o!==null&&(bm(i,o,t,e),wn(o,2),zn(o));break}}t=t.return}}function vu(e,t,i){var o=e.pingCache;if(o===null){o=e.pingCache=new qb;var c=new Set;o.set(t,c)}else c=o.get(t),c===void 0&&(c=new Set,o.set(t,c));c.has(i)||(du=!0,c.add(i),e=Qb.bind(null,e,t,i),t.then(e,e))}function Qb(e,t,i){var o=e.pingCache;o!==null&&o.delete(t),e.pingedLanes|=e.suspendedLanes&i,e.warmLanes&=~i,Ze===e&&(ze&i)===i&&(lt===4||lt===3&&(ze&62914560)===ze&&300>ft()-jl?(Ge&2)===0&&so(e,0):fu|=i,io===ze&&(io=0)),zn(e)}function vp(e,t){t===0&&(t=Nt()),e=oi(e,t),e!==null&&(wn(e,t),zn(e))}function $b(e){var t=e.memoizedState,i=0;t!==null&&(i=t.retryLane),vp(e,i)}function Wb(e,t){var i=0;switch(e.tag){case 31:case 13:var o=e.stateNode,c=e.memoizedState;c!==null&&(i=c.retryLane);break;case 19:o=e.stateNode;break;case 22:o=e.stateNode._retryCache;break;default:throw Error(l(314))}o!==null&&o.delete(t),vp(e,i)}function Xb(e,t){return En(e,t)}var Pl=null,ro=null,bu=!1,Ll=!1,Su=!1,Ia=0;function zn(e){e!==ro&&e.next===null&&(ro===null?Pl=ro=e:ro=ro.next=e),Ll=!0,bu||(bu=!0,Jb())}function rs(e,t){if(!Su&&Ll){Su=!0;do for(var i=!1,o=Pl;o!==null;){if(e!==0){var c=o.pendingLanes;if(c===0)var d=0;else{var g=o.suspendedLanes,v=o.pingedLanes;d=(1<<31-ve(42|e)+1)-1,d&=c&~(g&~v),d=d&201326741?d&201326741|1:d?d|2:0}d!==0&&(i=!0,wp(o,d))}else d=ze,d=we(o,o===Ze?d:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),(d&3)===0||Pt(o,d)||(i=!0,wp(o,d));o=o.next}while(i);Su=!1}}function Zb(){bp()}function bp(){Ll=bu=!1;var e=0;Ia!==0&&c0()&&(e=Ia);for(var t=ft(),i=null,o=Pl;o!==null;){var c=o.next,d=Sp(o,t);d===0?(o.next=null,i===null?Pl=c:i.next=c,c===null&&(ro=i)):(i=o,(e!==0||(d&3)!==0)&&(Ll=!0)),o=c}wt!==0&&wt!==5||rs(e),Ia!==0&&(Ia=0)}function Sp(e,t){for(var i=e.suspendedLanes,o=e.pingedLanes,c=e.expirationTimes,d=e.pendingLanes&-62914561;0<d;){var g=31-ve(d),v=1<<g,k=c[g];k===-1?((v&i)===0||(v&o)!==0)&&(c[g]=Qn(v,t)):k<=t&&(e.expiredLanes|=v),d&=~v}if(t=Ze,i=ze,i=we(e,e===t?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),o=e.callbackNode,i===0||e===t&&(Ve===2||Ve===9)||e.cancelPendingCommit!==null)return o!==null&&o!==null&&Wt(o),e.callbackNode=null,e.callbackPriority=0;if((i&3)===0||Pt(e,i)){if(t=i&-i,t===e.callbackPriority)return t;switch(o!==null&&Wt(o),Ti(i)){case 2:case 8:i=Ja;break;case 32:i=On;break;case 268435456:i=ji;break;default:i=On}return o=Cp.bind(null,e),i=En(i,o),e.callbackPriority=t,e.callbackNode=i,t}return o!==null&&o!==null&&Wt(o),e.callbackPriority=2,e.callbackNode=null,2}function Cp(e,t){if(wt!==0&&wt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var i=e.callbackNode;if(Rl()&&e.callbackNode!==i)return null;var o=ze;return o=we(e,e===Ze?o:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),o===0?null:(ap(e,o,t),Sp(e,ft()),e.callbackNode!=null&&e.callbackNode===i?Cp.bind(null,e):null)}function wp(e,t){if(Rl())return null;ap(e,t,!0)}function Jb(){d0(function(){(Ge&6)!==0?En(Vn,Zb):bp()})}function Cu(){if(Ia===0){var e=Fi;e===0&&(e=ke,ke<<=1,(ke&261888)===0&&(ke=256)),Ia=e}return Ia}function Np(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:qs(""+e)}function Ap(e,t){var i=t.ownerDocument.createElement("input");return i.name=t.name,i.value=t.value,e.id&&i.setAttribute("form",e.id),t.parentNode.insertBefore(i,t),e=new FormData(e),i.parentNode.removeChild(i),e}function e0(e,t,i,o,c){if(t==="submit"&&i&&i.stateNode===c){var d=Np((c[It]||null).action),g=o.submitter;g&&(t=(t=g[It]||null)?Np(t.formAction):g.getAttribute("formAction"),t!==null&&(d=t,g=null));var v=new Fs("action","action",null,o,c);e.push({event:v,listeners:[{instance:null,listener:function(){if(o.defaultPrevented){if(Ia!==0){var k=g?Ap(c,g):new FormData(c);Kc(i,{pending:!0,data:k,method:c.method,action:d},null,k)}}else typeof d=="function"&&(v.preventDefault(),k=g?Ap(c,g):new FormData(c),Kc(i,{pending:!0,data:k,method:c.method,action:d},d,k))},currentTarget:c}]})}}for(var wu=0;wu<oc.length;wu++){var Nu=oc[wu],t0=Nu.toLowerCase(),n0=Nu[0].toUpperCase()+Nu.slice(1);Nn(t0,"on"+n0)}Nn(nh,"onAnimationEnd"),Nn(ah,"onAnimationIteration"),Nn(ih,"onAnimationStart"),Nn("dblclick","onDoubleClick"),Nn("focusin","onFocus"),Nn("focusout","onBlur"),Nn(xb,"onTransitionRun"),Nn(vb,"onTransitionStart"),Nn(bb,"onTransitionCancel"),Nn(oh,"onTransitionEnd"),Ri("onMouseEnter",["mouseout","mouseover"]),Ri("onMouseLeave",["mouseout","mouseover"]),Ri("onPointerEnter",["pointerout","pointerover"]),Ri("onPointerLeave",["pointerout","pointerover"]),ti("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ti("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ti("onBeforeInput",["compositionend","keypress","textInput","paste"]),ti("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ti("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ti("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var cs="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),a0=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(cs));function kp(e,t){t=(t&4)!==0;for(var i=0;i<e.length;i++){var o=e[i],c=o.event;o=o.listeners;e:{var d=void 0;if(t)for(var g=o.length-1;0<=g;g--){var v=o[g],k=v.instance,L=v.currentTarget;if(v=v.listener,k!==d&&c.isPropagationStopped())break e;d=v,c.currentTarget=L;try{d(c)}catch(q){Ws(q)}c.currentTarget=null,d=k}else for(g=0;g<o.length;g++){if(v=o[g],k=v.instance,L=v.currentTarget,v=v.listener,k!==d&&c.isPropagationStopped())break e;d=v,c.currentTarget=L;try{d(c)}catch(q){Ws(q)}c.currentTarget=null,d=k}}}}function _e(e,t){var i=t[zr];i===void 0&&(i=t[zr]=new Set);var o=e+"__bubble";i.has(o)||(jp(t,e,2,!1),i.add(o))}function Au(e,t,i){var o=0;t&&(o|=4),jp(i,e,o,t)}var _l="_reactListening"+Math.random().toString(36).slice(2);function ku(e){if(!e[_l]){e[_l]=!0,bf.forEach(function(i){i!=="selectionchange"&&(a0.has(i)||Au(i,!1,e),Au(i,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[_l]||(t[_l]=!0,Au("selectionchange",!1,t))}}function jp(e,t,i,o){switch(ng(t)){case 2:var c=E0;break;case 8:c=O0;break;default:c=Bu}i=c.bind(null,t,i,e),c=void 0,!Vr||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(c=!0),o?c!==void 0?e.addEventListener(t,i,{capture:!0,passive:c}):e.addEventListener(t,i,!0):c!==void 0?e.addEventListener(t,i,{passive:c}):e.addEventListener(t,i,!1)}function ju(e,t,i,o,c){var d=o;if((t&1)===0&&(t&2)===0&&o!==null)e:for(;;){if(o===null)return;var g=o.tag;if(g===3||g===4){var v=o.stateNode.containerInfo;if(v===c)break;if(g===4)for(g=o.return;g!==null;){var k=g.tag;if((k===3||k===4)&&g.stateNode.containerInfo===c)return;g=g.return}for(;v!==null;){if(g=Di(v),g===null)return;if(k=g.tag,k===5||k===6||k===26||k===27){o=d=g;continue e}v=v.parentNode}}o=o.return}Of(function(){var L=d,q=Gr(i),Y=[];e:{var z=sh.get(e);if(z!==void 0){var I=Fs,re=e;switch(e){case"keypress":if(Ys(i)===0)break e;case"keydown":case"keyup":I=Wv;break;case"focusin":re="focus",I=Wr;break;case"focusout":re="blur",I=Wr;break;case"beforeblur":case"afterblur":I=Wr;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":I=Lf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":I=Uv;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":I=Jv;break;case nh:case ah:case ih:I=Bv;break;case oh:I=tb;break;case"scroll":case"scrollend":I=_v;break;case"wheel":I=ab;break;case"copy":case"cut":case"paste":I=qv;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":I=zf;break;case"toggle":case"beforetoggle":I=ob}var Se=(t&4)!==0,Xe=!Se&&(e==="scroll"||e==="scrollend"),D=Se?z!==null?z+"Capture":null:z;Se=[];for(var j=L,P;j!==null;){var G=j;if(P=G.stateNode,G=G.tag,G!==5&&G!==26&&G!==27||P===null||D===null||(G=Eo(j,D),G!=null&&Se.push(us(j,G,P))),Xe)break;j=j.return}0<Se.length&&(z=new I(z,re,null,i,q),Y.push({event:z,listeners:Se}))}}if((t&7)===0){e:{if(z=e==="mouseover"||e==="pointerover",I=e==="mouseout"||e==="pointerout",z&&i!==qr&&(re=i.relatedTarget||i.fromElement)&&(Di(re)||re[Mi]))break e;if((I||z)&&(z=q.window===q?q:(z=q.ownerDocument)?z.defaultView||z.parentWindow:window,I?(re=i.relatedTarget||i.toElement,I=L,re=re?Di(re):null,re!==null&&(Xe=f(re),Se=re.tag,re!==Xe||Se!==5&&Se!==27&&Se!==6)&&(re=null)):(I=null,re=L),I!==re)){if(Se=Lf,G="onMouseLeave",D="onMouseEnter",j="mouse",(e==="pointerout"||e==="pointerover")&&(Se=zf,G="onPointerLeave",D="onPointerEnter",j="pointer"),Xe=I==null?z:Do(I),P=re==null?z:Do(re),z=new Se(G,j+"leave",I,i,q),z.target=Xe,z.relatedTarget=P,G=null,Di(q)===L&&(Se=new Se(D,j+"enter",re,i,q),Se.target=P,Se.relatedTarget=Xe,G=Se),Xe=G,I&&re)t:{for(Se=i0,D=I,j=re,P=0,G=D;G;G=Se(G))P++;G=0;for(var pe=j;pe;pe=Se(pe))G++;for(;0<P-G;)D=Se(D),P--;for(;0<G-P;)j=Se(j),G--;for(;P--;){if(D===j||j!==null&&D===j.alternate){Se=D;break t}D=Se(D),j=Se(j)}Se=null}else Se=null;I!==null&&Tp(Y,z,I,Se,!1),re!==null&&Xe!==null&&Tp(Y,Xe,re,Se,!0)}}e:{if(z=L?Do(L):window,I=z.nodeName&&z.nodeName.toLowerCase(),I==="select"||I==="input"&&z.type==="file")var He=Yf;else if(qf(z))if(Vf)He=pb;else{He=hb;var ue=fb}else I=z.nodeName,!I||I.toLowerCase()!=="input"||z.type!=="checkbox"&&z.type!=="radio"?L&&Kr(L.elementType)&&(He=Yf):He=mb;if(He&&(He=He(e,L))){Gf(Y,He,i,q);break e}ue&&ue(e,z,L),e==="focusout"&&L&&z.type==="number"&&L.memoizedProps.value!=null&&Br(z,"number",z.value)}switch(ue=L?Do(L):window,e){case"focusin":(qf(ue)||ue.contentEditable==="true")&&(Ii=ue,nc=L,Io=null);break;case"focusout":Io=nc=Ii=null;break;case"mousedown":ac=!0;break;case"contextmenu":case"mouseup":case"dragend":ac=!1,eh(Y,i,q);break;case"selectionchange":if(yb)break;case"keydown":case"keyup":eh(Y,i,q)}var Me;if(Zr)e:{switch(e){case"compositionstart":var Ue="onCompositionStart";break e;case"compositionend":Ue="onCompositionEnd";break e;case"compositionupdate":Ue="onCompositionUpdate";break e}Ue=void 0}else Ui?Bf(e,i)&&(Ue="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(Ue="onCompositionStart");Ue&&(Uf&&i.locale!=="ko"&&(Ui||Ue!=="onCompositionStart"?Ue==="onCompositionEnd"&&Ui&&(Me=Rf()):(wa=q,Fr="value"in wa?wa.value:wa.textContent,Ui=!0)),ue=zl(L,Ue),0<ue.length&&(Ue=new _f(Ue,e,null,i,q),Y.push({event:Ue,listeners:ue}),Me?Ue.data=Me:(Me=Kf(i),Me!==null&&(Ue.data=Me)))),(Me=lb?rb(e,i):cb(e,i))&&(Ue=zl(L,"onBeforeInput"),0<Ue.length&&(ue=new _f("onBeforeInput","beforeinput",null,i,q),Y.push({event:ue,listeners:Ue}),ue.data=Me)),e0(Y,e,L,i,q)}kp(Y,t)})}function us(e,t,i){return{instance:e,listener:t,currentTarget:i}}function zl(e,t){for(var i=t+"Capture",o=[];e!==null;){var c=e,d=c.stateNode;if(c=c.tag,c!==5&&c!==26&&c!==27||d===null||(c=Eo(e,i),c!=null&&o.unshift(us(e,c,d)),c=Eo(e,t),c!=null&&o.push(us(e,c,d))),e.tag===3)return o;e=e.return}return[]}function i0(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Tp(e,t,i,o,c){for(var d=t._reactName,g=[];i!==null&&i!==o;){var v=i,k=v.alternate,L=v.stateNode;if(v=v.tag,k!==null&&k===o)break;v!==5&&v!==26&&v!==27||L===null||(k=L,c?(L=Eo(i,d),L!=null&&g.unshift(us(i,L,k))):c||(L=Eo(i,d),L!=null&&g.push(us(i,L,k)))),i=i.return}g.length!==0&&e.push({event:t,listeners:g})}var o0=/\r\n?/g,s0=/\u0000|\uFFFD/g;function Mp(e){return(typeof e=="string"?e:""+e).replace(o0,`
10
- `).replace(s0,"")}function Dp(e,t){return t=Mp(t),Mp(e)===t}function We(e,t,i,o,c,d){switch(i){case"children":typeof o=="string"?t==="body"||t==="textarea"&&o===""||Li(e,o):(typeof o=="number"||typeof o=="bigint")&&t!=="body"&&Li(e,""+o);break;case"className":Bs(e,"class",o);break;case"tabIndex":Bs(e,"tabindex",o);break;case"dir":case"role":case"viewBox":case"width":case"height":Bs(e,i,o);break;case"style":Df(e,o,d);break;case"data":if(t!=="object"){Bs(e,"data",o);break}case"src":case"href":if(o===""&&(t!=="a"||i!=="href")){e.removeAttribute(i);break}if(o==null||typeof o=="function"||typeof o=="symbol"||typeof o=="boolean"){e.removeAttribute(i);break}o=qs(""+o),e.setAttribute(i,o);break;case"action":case"formAction":if(typeof o=="function"){e.setAttribute(i,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof d=="function"&&(i==="formAction"?(t!=="input"&&We(e,t,"name",c.name,c,null),We(e,t,"formEncType",c.formEncType,c,null),We(e,t,"formMethod",c.formMethod,c,null),We(e,t,"formTarget",c.formTarget,c,null)):(We(e,t,"encType",c.encType,c,null),We(e,t,"method",c.method,c,null),We(e,t,"target",c.target,c,null)));if(o==null||typeof o=="symbol"||typeof o=="boolean"){e.removeAttribute(i);break}o=qs(""+o),e.setAttribute(i,o);break;case"onClick":o!=null&&(e.onclick=Xn);break;case"onScroll":o!=null&&_e("scroll",e);break;case"onScrollEnd":o!=null&&_e("scrollend",e);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(l(61));if(i=o.__html,i!=null){if(c.children!=null)throw Error(l(60));e.innerHTML=i}}break;case"multiple":e.multiple=o&&typeof o!="function"&&typeof o!="symbol";break;case"muted":e.muted=o&&typeof o!="function"&&typeof o!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(o==null||typeof o=="function"||typeof o=="boolean"||typeof o=="symbol"){e.removeAttribute("xlink:href");break}i=qs(""+o),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",i);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":o!=null&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(i,""+o):e.removeAttribute(i);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":o&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(i,""):e.removeAttribute(i);break;case"capture":case"download":o===!0?e.setAttribute(i,""):o!==!1&&o!=null&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(i,o):e.removeAttribute(i);break;case"cols":case"rows":case"size":case"span":o!=null&&typeof o!="function"&&typeof o!="symbol"&&!isNaN(o)&&1<=o?e.setAttribute(i,o):e.removeAttribute(i);break;case"rowSpan":case"start":o==null||typeof o=="function"||typeof o=="symbol"||isNaN(o)?e.removeAttribute(i):e.setAttribute(i,o);break;case"popover":_e("beforetoggle",e),_e("toggle",e),Hs(e,"popover",o);break;case"xlinkActuate":Wn(e,"http://www.w3.org/1999/xlink","xlink:actuate",o);break;case"xlinkArcrole":Wn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",o);break;case"xlinkRole":Wn(e,"http://www.w3.org/1999/xlink","xlink:role",o);break;case"xlinkShow":Wn(e,"http://www.w3.org/1999/xlink","xlink:show",o);break;case"xlinkTitle":Wn(e,"http://www.w3.org/1999/xlink","xlink:title",o);break;case"xlinkType":Wn(e,"http://www.w3.org/1999/xlink","xlink:type",o);break;case"xmlBase":Wn(e,"http://www.w3.org/XML/1998/namespace","xml:base",o);break;case"xmlLang":Wn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",o);break;case"xmlSpace":Wn(e,"http://www.w3.org/XML/1998/namespace","xml:space",o);break;case"is":Hs(e,"is",o);break;case"innerText":case"textContent":break;default:(!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(i=Pv.get(i)||i,Hs(e,i,o))}}function Tu(e,t,i,o,c,d){switch(i){case"style":Df(e,o,d);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(l(61));if(i=o.__html,i!=null){if(c.children!=null)throw Error(l(60));e.innerHTML=i}}break;case"children":typeof o=="string"?Li(e,o):(typeof o=="number"||typeof o=="bigint")&&Li(e,""+o);break;case"onScroll":o!=null&&_e("scroll",e);break;case"onScrollEnd":o!=null&&_e("scrollend",e);break;case"onClick":o!=null&&(e.onclick=Xn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Sf.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(c=i.endsWith("Capture"),t=i.slice(2,c?i.length-7:void 0),d=e[It]||null,d=d!=null?d[i]:null,typeof d=="function"&&e.removeEventListener(t,d,c),typeof o=="function")){typeof d!="function"&&d!==null&&(i in e?e[i]=null:e.hasAttribute(i)&&e.removeAttribute(i)),e.addEventListener(t,o,c);break e}i in e?e[i]=o:o===!0?e.setAttribute(i,""):Hs(e,i,o)}}}function Ot(e,t,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":_e("error",e),_e("load",e);var o=!1,c=!1,d;for(d in i)if(i.hasOwnProperty(d)){var g=i[d];if(g!=null)switch(d){case"src":o=!0;break;case"srcSet":c=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(l(137,t));default:We(e,t,d,g,i,null)}}c&&We(e,t,"srcSet",i.srcSet,i,null),o&&We(e,t,"src",i.src,i,null);return;case"input":_e("invalid",e);var v=d=g=c=null,k=null,L=null;for(o in i)if(i.hasOwnProperty(o)){var q=i[o];if(q!=null)switch(o){case"name":c=q;break;case"type":g=q;break;case"checked":k=q;break;case"defaultChecked":L=q;break;case"value":d=q;break;case"defaultValue":v=q;break;case"children":case"dangerouslySetInnerHTML":if(q!=null)throw Error(l(137,t));break;default:We(e,t,o,q,i,null)}}kf(e,d,v,k,L,g,c,!1);return;case"select":_e("invalid",e),o=g=d=null;for(c in i)if(i.hasOwnProperty(c)&&(v=i[c],v!=null))switch(c){case"value":d=v;break;case"defaultValue":g=v;break;case"multiple":o=v;default:We(e,t,c,v,i,null)}t=d,i=g,e.multiple=!!o,t!=null?Pi(e,!!o,t,!1):i!=null&&Pi(e,!!o,i,!0);return;case"textarea":_e("invalid",e),d=c=o=null;for(g in i)if(i.hasOwnProperty(g)&&(v=i[g],v!=null))switch(g){case"value":o=v;break;case"defaultValue":c=v;break;case"children":d=v;break;case"dangerouslySetInnerHTML":if(v!=null)throw Error(l(91));break;default:We(e,t,g,v,i,null)}Tf(e,o,c,d);return;case"option":for(k in i)if(i.hasOwnProperty(k)&&(o=i[k],o!=null))switch(k){case"selected":e.selected=o&&typeof o!="function"&&typeof o!="symbol";break;default:We(e,t,k,o,i,null)}return;case"dialog":_e("beforetoggle",e),_e("toggle",e),_e("cancel",e),_e("close",e);break;case"iframe":case"object":_e("load",e);break;case"video":case"audio":for(o=0;o<cs.length;o++)_e(cs[o],e);break;case"image":_e("error",e),_e("load",e);break;case"details":_e("toggle",e);break;case"embed":case"source":case"link":_e("error",e),_e("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(L in i)if(i.hasOwnProperty(L)&&(o=i[L],o!=null))switch(L){case"children":case"dangerouslySetInnerHTML":throw Error(l(137,t));default:We(e,t,L,o,i,null)}return;default:if(Kr(t)){for(q in i)i.hasOwnProperty(q)&&(o=i[q],o!==void 0&&Tu(e,t,q,o,i,void 0));return}}for(v in i)i.hasOwnProperty(v)&&(o=i[v],o!=null&&We(e,t,v,o,i,null))}function l0(e,t,i,o){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var c=null,d=null,g=null,v=null,k=null,L=null,q=null;for(I in i){var Y=i[I];if(i.hasOwnProperty(I)&&Y!=null)switch(I){case"checked":break;case"value":break;case"defaultValue":k=Y;default:o.hasOwnProperty(I)||We(e,t,I,null,o,Y)}}for(var z in o){var I=o[z];if(Y=i[z],o.hasOwnProperty(z)&&(I!=null||Y!=null))switch(z){case"type":d=I;break;case"name":c=I;break;case"checked":L=I;break;case"defaultChecked":q=I;break;case"value":g=I;break;case"defaultValue":v=I;break;case"children":case"dangerouslySetInnerHTML":if(I!=null)throw Error(l(137,t));break;default:I!==Y&&We(e,t,z,I,o,Y)}}Hr(e,g,v,k,L,q,d,c);return;case"select":I=g=v=z=null;for(d in i)if(k=i[d],i.hasOwnProperty(d)&&k!=null)switch(d){case"value":break;case"multiple":I=k;default:o.hasOwnProperty(d)||We(e,t,d,null,o,k)}for(c in o)if(d=o[c],k=i[c],o.hasOwnProperty(c)&&(d!=null||k!=null))switch(c){case"value":z=d;break;case"defaultValue":v=d;break;case"multiple":g=d;default:d!==k&&We(e,t,c,d,o,k)}t=v,i=g,o=I,z!=null?Pi(e,!!i,z,!1):!!o!=!!i&&(t!=null?Pi(e,!!i,t,!0):Pi(e,!!i,i?[]:"",!1));return;case"textarea":I=z=null;for(v in i)if(c=i[v],i.hasOwnProperty(v)&&c!=null&&!o.hasOwnProperty(v))switch(v){case"value":break;case"children":break;default:We(e,t,v,null,o,c)}for(g in o)if(c=o[g],d=i[g],o.hasOwnProperty(g)&&(c!=null||d!=null))switch(g){case"value":z=c;break;case"defaultValue":I=c;break;case"children":break;case"dangerouslySetInnerHTML":if(c!=null)throw Error(l(91));break;default:c!==d&&We(e,t,g,c,o,d)}jf(e,z,I);return;case"option":for(var re in i)if(z=i[re],i.hasOwnProperty(re)&&z!=null&&!o.hasOwnProperty(re))switch(re){case"selected":e.selected=!1;break;default:We(e,t,re,null,o,z)}for(k in o)if(z=o[k],I=i[k],o.hasOwnProperty(k)&&z!==I&&(z!=null||I!=null))switch(k){case"selected":e.selected=z&&typeof z!="function"&&typeof z!="symbol";break;default:We(e,t,k,z,o,I)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Se in i)z=i[Se],i.hasOwnProperty(Se)&&z!=null&&!o.hasOwnProperty(Se)&&We(e,t,Se,null,o,z);for(L in o)if(z=o[L],I=i[L],o.hasOwnProperty(L)&&z!==I&&(z!=null||I!=null))switch(L){case"children":case"dangerouslySetInnerHTML":if(z!=null)throw Error(l(137,t));break;default:We(e,t,L,z,o,I)}return;default:if(Kr(t)){for(var Xe in i)z=i[Xe],i.hasOwnProperty(Xe)&&z!==void 0&&!o.hasOwnProperty(Xe)&&Tu(e,t,Xe,void 0,o,z);for(q in o)z=o[q],I=i[q],!o.hasOwnProperty(q)||z===I||z===void 0&&I===void 0||Tu(e,t,q,z,o,I);return}}for(var D in i)z=i[D],i.hasOwnProperty(D)&&z!=null&&!o.hasOwnProperty(D)&&We(e,t,D,null,o,z);for(Y in o)z=o[Y],I=i[Y],!o.hasOwnProperty(Y)||z===I||z==null&&I==null||We(e,t,Y,z,o,I)}function Ep(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function r0(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,i=performance.getEntriesByType("resource"),o=0;o<i.length;o++){var c=i[o],d=c.transferSize,g=c.initiatorType,v=c.duration;if(d&&v&&Ep(g)){for(g=0,v=c.responseEnd,o+=1;o<i.length;o++){var k=i[o],L=k.startTime;if(L>v)break;var q=k.transferSize,Y=k.initiatorType;q&&Ep(Y)&&(k=k.responseEnd,g+=q*(k<v?1:(v-L)/(k-L)))}if(--o,t+=8*(d+g)/(c.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Mu=null,Du=null;function Ul(e){return e.nodeType===9?e:e.ownerDocument}function Op(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Rp(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Eu(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Ou=null;function c0(){var e=window.event;return e&&e.type==="popstate"?e===Ou?!1:(Ou=e,!0):(Ou=null,!1)}var Pp=typeof setTimeout=="function"?setTimeout:void 0,u0=typeof clearTimeout=="function"?clearTimeout:void 0,Lp=typeof Promise=="function"?Promise:void 0,d0=typeof queueMicrotask=="function"?queueMicrotask:typeof Lp<"u"?function(e){return Lp.resolve(null).then(e).catch(f0)}:Pp;function f0(e){setTimeout(function(){throw e})}function Ha(e){return e==="head"}function _p(e,t){var i=t,o=0;do{var c=i.nextSibling;if(e.removeChild(i),c&&c.nodeType===8)if(i=c.data,i==="/$"||i==="/&"){if(o===0){e.removeChild(c),ho(t);return}o--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")o++;else if(i==="html")ds(e.ownerDocument.documentElement);else if(i==="head"){i=e.ownerDocument.head,ds(i);for(var d=i.firstChild;d;){var g=d.nextSibling,v=d.nodeName;d[Mo]||v==="SCRIPT"||v==="STYLE"||v==="LINK"&&d.rel.toLowerCase()==="stylesheet"||i.removeChild(d),d=g}}else i==="body"&&ds(e.ownerDocument.body);i=c}while(i);ho(t)}function zp(e,t){var i=e;e=0;do{var o=i.nextSibling;if(i.nodeType===1?t?(i._stashedDisplay=i.style.display,i.style.display="none"):(i.style.display=i._stashedDisplay||"",i.getAttribute("style")===""&&i.removeAttribute("style")):i.nodeType===3&&(t?(i._stashedText=i.nodeValue,i.nodeValue=""):i.nodeValue=i._stashedText||""),o&&o.nodeType===8)if(i=o.data,i==="/$"){if(e===0)break;e--}else i!=="$"&&i!=="$?"&&i!=="$~"&&i!=="$!"||e++;i=o}while(i)}function Ru(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var i=t;switch(t=t.nextSibling,i.nodeName){case"HTML":case"HEAD":case"BODY":Ru(i),Ur(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}e.removeChild(i)}}function h0(e,t,i,o){for(;e.nodeType===1;){var c=i;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!o&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(o){if(!e[Mo])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(d=e.getAttribute("rel"),d==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(d!==c.rel||e.getAttribute("href")!==(c.href==null||c.href===""?null:c.href)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin)||e.getAttribute("title")!==(c.title==null?null:c.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(d=e.getAttribute("src"),(d!==(c.src==null?null:c.src)||e.getAttribute("type")!==(c.type==null?null:c.type)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin))&&d&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var d=c.name==null?null:""+c.name;if(c.type==="hidden"&&e.getAttribute("name")===d)return e}else return e;if(e=bn(e.nextSibling),e===null)break}return null}function m0(e,t,i){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!i||(e=bn(e.nextSibling),e===null))return null;return e}function Up(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=bn(e.nextSibling),e===null))return null;return e}function Pu(e){return e.data==="$?"||e.data==="$~"}function Lu(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function p0(e,t){var i=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||i.readyState!=="loading")t();else{var o=function(){t(),i.removeEventListener("DOMContentLoaded",o)};i.addEventListener("DOMContentLoaded",o),e._reactRetry=o}}function bn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var _u=null;function Ip(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="/$"||i==="/&"){if(t===0)return bn(e.nextSibling);t--}else i!=="$"&&i!=="$!"&&i!=="$?"&&i!=="$~"&&i!=="&"||t++}e=e.nextSibling}return null}function Hp(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"){if(t===0)return e;t--}else i!=="/$"&&i!=="/&"||t++}e=e.previousSibling}return null}function Bp(e,t,i){switch(t=Ul(i),e){case"html":if(e=t.documentElement,!e)throw Error(l(452));return e;case"head":if(e=t.head,!e)throw Error(l(453));return e;case"body":if(e=t.body,!e)throw Error(l(454));return e;default:throw Error(l(451))}}function ds(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Ur(e)}var Sn=new Map,Kp=new Set;function Il(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var ha=$.d;$.d={f:g0,r:y0,D:x0,C:v0,L:b0,m:S0,X:w0,S:C0,M:N0};function g0(){var e=ha.f(),t=Dl();return e||t}function y0(e){var t=Ei(e);t!==null&&t.tag===5&&t.type==="form"?om(t):ha.r(e)}var co=typeof document>"u"?null:document;function qp(e,t,i){var o=co;if(o&&typeof t=="string"&&t){var c=hn(t);c='link[rel="'+e+'"][href="'+c+'"]',typeof i=="string"&&(c+='[crossorigin="'+i+'"]'),Kp.has(c)||(Kp.add(c),e={rel:e,crossOrigin:i,href:t},o.querySelector(c)===null&&(t=o.createElement("link"),Ot(t,"link",e),At(t),o.head.appendChild(t)))}}function x0(e){ha.D(e),qp("dns-prefetch",e,null)}function v0(e,t){ha.C(e,t),qp("preconnect",e,t)}function b0(e,t,i){ha.L(e,t,i);var o=co;if(o&&e&&t){var c='link[rel="preload"][as="'+hn(t)+'"]';t==="image"&&i&&i.imageSrcSet?(c+='[imagesrcset="'+hn(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(c+='[imagesizes="'+hn(i.imageSizes)+'"]')):c+='[href="'+hn(e)+'"]';var d=c;switch(t){case"style":d=uo(e);break;case"script":d=fo(e)}Sn.has(d)||(e=x({rel:"preload",href:t==="image"&&i&&i.imageSrcSet?void 0:e,as:t},i),Sn.set(d,e),o.querySelector(c)!==null||t==="style"&&o.querySelector(fs(d))||t==="script"&&o.querySelector(hs(d))||(t=o.createElement("link"),Ot(t,"link",e),At(t),o.head.appendChild(t)))}}function S0(e,t){ha.m(e,t);var i=co;if(i&&e){var o=t&&typeof t.as=="string"?t.as:"script",c='link[rel="modulepreload"][as="'+hn(o)+'"][href="'+hn(e)+'"]',d=c;switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":d=fo(e)}if(!Sn.has(d)&&(e=x({rel:"modulepreload",href:e},t),Sn.set(d,e),i.querySelector(c)===null)){switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(hs(d)))return}o=i.createElement("link"),Ot(o,"link",e),At(o),i.head.appendChild(o)}}}function C0(e,t,i){ha.S(e,t,i);var o=co;if(o&&e){var c=Oi(o).hoistableStyles,d=uo(e);t=t||"default";var g=c.get(d);if(!g){var v={loading:0,preload:null};if(g=o.querySelector(fs(d)))v.loading=5;else{e=x({rel:"stylesheet",href:e,"data-precedence":t},i),(i=Sn.get(d))&&zu(e,i);var k=g=o.createElement("link");At(k),Ot(k,"link",e),k._p=new Promise(function(L,q){k.onload=L,k.onerror=q}),k.addEventListener("load",function(){v.loading|=1}),k.addEventListener("error",function(){v.loading|=2}),v.loading|=4,Hl(g,t,o)}g={type:"stylesheet",instance:g,count:1,state:v},c.set(d,g)}}}function w0(e,t){ha.X(e,t);var i=co;if(i&&e){var o=Oi(i).hoistableScripts,c=fo(e),d=o.get(c);d||(d=i.querySelector(hs(c)),d||(e=x({src:e,async:!0},t),(t=Sn.get(c))&&Uu(e,t),d=i.createElement("script"),At(d),Ot(d,"link",e),i.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},o.set(c,d))}}function N0(e,t){ha.M(e,t);var i=co;if(i&&e){var o=Oi(i).hoistableScripts,c=fo(e),d=o.get(c);d||(d=i.querySelector(hs(c)),d||(e=x({src:e,async:!0,type:"module"},t),(t=Sn.get(c))&&Uu(e,t),d=i.createElement("script"),At(d),Ot(d,"link",e),i.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},o.set(c,d))}}function Gp(e,t,i,o){var c=(c=ne.current)?Il(c):null;if(!c)throw Error(l(446));switch(e){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(t=uo(i.href),i=Oi(c).hoistableStyles,o=i.get(t),o||(o={type:"style",instance:null,count:0,state:null},i.set(t,o)),o):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){e=uo(i.href);var d=Oi(c).hoistableStyles,g=d.get(e);if(g||(c=c.ownerDocument||c,g={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},d.set(e,g),(d=c.querySelector(fs(e)))&&!d._p&&(g.instance=d,g.state.loading=5),Sn.has(e)||(i={rel:"preload",as:"style",href:i.href,crossOrigin:i.crossOrigin,integrity:i.integrity,media:i.media,hrefLang:i.hrefLang,referrerPolicy:i.referrerPolicy},Sn.set(e,i),d||A0(c,e,i,g.state))),t&&o===null)throw Error(l(528,""));return g}if(t&&o!==null)throw Error(l(529,""));return null;case"script":return t=i.async,i=i.src,typeof i=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=fo(i),i=Oi(c).hoistableScripts,o=i.get(t),o||(o={type:"script",instance:null,count:0,state:null},i.set(t,o)),o):{type:"void",instance:null,count:0,state:null};default:throw Error(l(444,e))}}function uo(e){return'href="'+hn(e)+'"'}function fs(e){return'link[rel="stylesheet"]['+e+"]"}function Yp(e){return x({},e,{"data-precedence":e.precedence,precedence:null})}function A0(e,t,i,o){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?o.loading=1:(t=e.createElement("link"),o.preload=t,t.addEventListener("load",function(){return o.loading|=1}),t.addEventListener("error",function(){return o.loading|=2}),Ot(t,"link",i),At(t),e.head.appendChild(t))}function fo(e){return'[src="'+hn(e)+'"]'}function hs(e){return"script[async]"+e}function Vp(e,t,i){if(t.count++,t.instance===null)switch(t.type){case"style":var o=e.querySelector('style[data-href~="'+hn(i.href)+'"]');if(o)return t.instance=o,At(o),o;var c=x({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return o=(e.ownerDocument||e).createElement("style"),At(o),Ot(o,"style",c),Hl(o,i.precedence,e),t.instance=o;case"stylesheet":c=uo(i.href);var d=e.querySelector(fs(c));if(d)return t.state.loading|=4,t.instance=d,At(d),d;o=Yp(i),(c=Sn.get(c))&&zu(o,c),d=(e.ownerDocument||e).createElement("link"),At(d);var g=d;return g._p=new Promise(function(v,k){g.onload=v,g.onerror=k}),Ot(d,"link",o),t.state.loading|=4,Hl(d,i.precedence,e),t.instance=d;case"script":return d=fo(i.src),(c=e.querySelector(hs(d)))?(t.instance=c,At(c),c):(o=i,(c=Sn.get(d))&&(o=x({},i),Uu(o,c)),e=e.ownerDocument||e,c=e.createElement("script"),At(c),Ot(c,"link",o),e.head.appendChild(c),t.instance=c);case"void":return null;default:throw Error(l(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(o=t.instance,t.state.loading|=4,Hl(o,i.precedence,e));return t.instance}function Hl(e,t,i){for(var o=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),c=o.length?o[o.length-1]:null,d=c,g=0;g<o.length;g++){var v=o[g];if(v.dataset.precedence===t)d=v;else if(d!==c)break}d?d.parentNode.insertBefore(e,d.nextSibling):(t=i.nodeType===9?i.head:i,t.insertBefore(e,t.firstChild))}function zu(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Uu(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Bl=null;function Fp(e,t,i){if(Bl===null){var o=new Map,c=Bl=new Map;c.set(i,o)}else c=Bl,o=c.get(i),o||(o=new Map,c.set(i,o));if(o.has(e))return o;for(o.set(e,null),i=i.getElementsByTagName(e),c=0;c<i.length;c++){var d=i[c];if(!(d[Mo]||d[Tt]||e==="link"&&d.getAttribute("rel")==="stylesheet")&&d.namespaceURI!=="http://www.w3.org/2000/svg"){var g=d.getAttribute(t)||"";g=e+g;var v=o.get(g);v?v.push(d):o.set(g,[d])}}return o}function Qp(e,t,i){e=e.ownerDocument||e,e.head.insertBefore(i,t==="title"?e.querySelector("head > title"):null)}function k0(e,t,i){if(i===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function $p(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function j0(e,t,i,o){if(i.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(i.state.loading&4)===0){if(i.instance===null){var c=uo(o.href),d=t.querySelector(fs(c));if(d){t=d._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Kl.bind(e),t.then(e,e)),i.state.loading|=4,i.instance=d,At(d);return}d=t.ownerDocument||t,o=Yp(o),(c=Sn.get(c))&&zu(o,c),d=d.createElement("link"),At(d);var g=d;g._p=new Promise(function(v,k){g.onload=v,g.onerror=k}),Ot(d,"link",o),i.instance=d}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(i,t),(t=i.state.preload)&&(i.state.loading&3)===0&&(e.count++,i=Kl.bind(e),t.addEventListener("load",i),t.addEventListener("error",i))}}var Iu=0;function T0(e,t){return e.stylesheets&&e.count===0&&Gl(e,e.stylesheets),0<e.count||0<e.imgCount?function(i){var o=setTimeout(function(){if(e.stylesheets&&Gl(e,e.stylesheets),e.unsuspend){var d=e.unsuspend;e.unsuspend=null,d()}},6e4+t);0<e.imgBytes&&Iu===0&&(Iu=62500*r0());var c=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Gl(e,e.stylesheets),e.unsuspend)){var d=e.unsuspend;e.unsuspend=null,d()}},(e.imgBytes>Iu?50:800)+t);return e.unsuspend=i,function(){e.unsuspend=null,clearTimeout(o),clearTimeout(c)}}:null}function Kl(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Gl(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var ql=null;function Gl(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ql=new Map,t.forEach(M0,e),ql=null,Kl.call(e))}function M0(e,t){if(!(t.state.loading&4)){var i=ql.get(e);if(i)var o=i.get(null);else{i=new Map,ql.set(e,i);for(var c=e.querySelectorAll("link[data-precedence],style[data-precedence]"),d=0;d<c.length;d++){var g=c[d];(g.nodeName==="LINK"||g.getAttribute("media")!=="not all")&&(i.set(g.dataset.precedence,g),o=g)}o&&i.set(null,o)}c=t.instance,g=c.getAttribute("data-precedence"),d=i.get(g)||o,d===o&&i.set(null,c),i.set(g,c),this.count++,o=Kl.bind(this),c.addEventListener("load",o),c.addEventListener("error",o),d?d.parentNode.insertBefore(c,d.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(c,e.firstChild)),t.state.loading|=4}}var ms={$$typeof:B,Provider:null,Consumer:null,_currentValue:ee,_currentValue2:ee,_threadCount:0};function D0(e,t,i,o,c,d,g,v,k){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Zt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Zt(0),this.hiddenUpdates=Zt(null),this.identifierPrefix=o,this.onUncaughtError=c,this.onCaughtError=d,this.onRecoverableError=g,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=k,this.incompleteTransitions=new Map}function Wp(e,t,i,o,c,d,g,v,k,L,q,Y){return e=new D0(e,t,i,g,k,L,q,Y,v),t=1,d===!0&&(t|=24),d=en(3,null,null,t),e.current=d,d.stateNode=e,t=xc(),t.refCount++,e.pooledCache=t,t.refCount++,d.memoizedState={element:o,isDehydrated:i,cache:t},Cc(d),e}function Xp(e){return e?(e=Ki,e):Ki}function Zp(e,t,i,o,c,d){c=Xp(c),o.context===null?o.context=c:o.pendingContext=c,o=Ma(t),o.payload={element:i},d=d===void 0?null:d,d!==null&&(o.callback=d),i=Da(e,o,t),i!==null&&(Yt(i,e,t),Vo(i,e,t))}function Jp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<t?i:t}}function Hu(e,t){Jp(e,t),(e=e.alternate)&&Jp(e,t)}function eg(e){if(e.tag===13||e.tag===31){var t=oi(e,67108864);t!==null&&Yt(t,e,67108864),Hu(e,67108864)}}function tg(e){if(e.tag===13||e.tag===31){var t=sn();t=$n(t);var i=oi(e,t);i!==null&&Yt(i,e,t),Hu(e,t)}}var Yl=!0;function E0(e,t,i,o){var c=R.T;R.T=null;var d=$.p;try{$.p=2,Bu(e,t,i,o)}finally{$.p=d,R.T=c}}function O0(e,t,i,o){var c=R.T;R.T=null;var d=$.p;try{$.p=8,Bu(e,t,i,o)}finally{$.p=d,R.T=c}}function Bu(e,t,i,o){if(Yl){var c=Ku(o);if(c===null)ju(e,t,o,Vl,i),ag(e,o);else if(P0(c,e,t,i,o))o.stopPropagation();else if(ag(e,o),t&4&&-1<R0.indexOf(e)){for(;c!==null;){var d=Ei(c);if(d!==null)switch(d.tag){case 3:if(d=d.stateNode,d.current.memoizedState.isDehydrated){var g=Je(d.pendingLanes);if(g!==0){var v=d;for(v.pendingLanes|=2,v.entangledLanes|=2;g;){var k=1<<31-ve(g);v.entanglements[1]|=k,g&=~k}zn(d),(Ge&6)===0&&(Tl=ft()+500,rs(0))}}break;case 31:case 13:v=oi(d,2),v!==null&&Yt(v,d,2),Dl(),Hu(d,2)}if(d=Ku(o),d===null&&ju(e,t,o,Vl,i),d===c)break;c=d}c!==null&&o.stopPropagation()}else ju(e,t,o,null,i)}}function Ku(e){return e=Gr(e),qu(e)}var Vl=null;function qu(e){if(Vl=null,e=Di(e),e!==null){var t=f(e);if(t===null)e=null;else{var i=t.tag;if(i===13){if(e=h(t),e!==null)return e;e=null}else if(i===31){if(e=m(t),e!==null)return e;e=null}else if(i===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Vl=e,null}function ng(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Xt()){case Vn:return 2;case Ja:return 8;case On:case Rn:return 32;case ji:return 268435456;default:return 32}default:return 32}}var Gu=!1,Ba=null,Ka=null,qa=null,ps=new Map,gs=new Map,Ga=[],R0="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function ag(e,t){switch(e){case"focusin":case"focusout":Ba=null;break;case"dragenter":case"dragleave":Ka=null;break;case"mouseover":case"mouseout":qa=null;break;case"pointerover":case"pointerout":ps.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":gs.delete(t.pointerId)}}function ys(e,t,i,o,c,d){return e===null||e.nativeEvent!==d?(e={blockedOn:t,domEventName:i,eventSystemFlags:o,nativeEvent:d,targetContainers:[c]},t!==null&&(t=Ei(t),t!==null&&eg(t)),e):(e.eventSystemFlags|=o,t=e.targetContainers,c!==null&&t.indexOf(c)===-1&&t.push(c),e)}function P0(e,t,i,o,c){switch(t){case"focusin":return Ba=ys(Ba,e,t,i,o,c),!0;case"dragenter":return Ka=ys(Ka,e,t,i,o,c),!0;case"mouseover":return qa=ys(qa,e,t,i,o,c),!0;case"pointerover":var d=c.pointerId;return ps.set(d,ys(ps.get(d)||null,e,t,i,o,c)),!0;case"gotpointercapture":return d=c.pointerId,gs.set(d,ys(gs.get(d)||null,e,t,i,o,c)),!0}return!1}function ig(e){var t=Di(e.target);if(t!==null){var i=f(t);if(i!==null){if(t=i.tag,t===13){if(t=h(i),t!==null){e.blockedOn=t,To(e.priority,function(){tg(i)});return}}else if(t===31){if(t=m(i),t!==null){e.blockedOn=t,To(e.priority,function(){tg(i)});return}}else if(t===3&&i.stateNode.current.memoizedState.isDehydrated){e.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Fl(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var i=Ku(e.nativeEvent);if(i===null){i=e.nativeEvent;var o=new i.constructor(i.type,i);qr=o,i.target.dispatchEvent(o),qr=null}else return t=Ei(i),t!==null&&eg(t),e.blockedOn=i,!1;t.shift()}return!0}function og(e,t,i){Fl(e)&&i.delete(t)}function L0(){Gu=!1,Ba!==null&&Fl(Ba)&&(Ba=null),Ka!==null&&Fl(Ka)&&(Ka=null),qa!==null&&Fl(qa)&&(qa=null),ps.forEach(og),gs.forEach(og)}function Ql(e,t){e.blockedOn===t&&(e.blockedOn=null,Gu||(Gu=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,L0)))}var $l=null;function sg(e){$l!==e&&($l=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){$l===e&&($l=null);for(var t=0;t<e.length;t+=3){var i=e[t],o=e[t+1],c=e[t+2];if(typeof o!="function"){if(qu(o||i)===null)continue;break}var d=Ei(i);d!==null&&(e.splice(t,3),t-=3,Kc(d,{pending:!0,data:c,method:i.method,action:o},o,c))}}))}function ho(e){function t(k){return Ql(k,e)}Ba!==null&&Ql(Ba,e),Ka!==null&&Ql(Ka,e),qa!==null&&Ql(qa,e),ps.forEach(t),gs.forEach(t);for(var i=0;i<Ga.length;i++){var o=Ga[i];o.blockedOn===e&&(o.blockedOn=null)}for(;0<Ga.length&&(i=Ga[0],i.blockedOn===null);)ig(i),i.blockedOn===null&&Ga.shift();if(i=(e.ownerDocument||e).$$reactFormReplay,i!=null)for(o=0;o<i.length;o+=3){var c=i[o],d=i[o+1],g=c[It]||null;if(typeof d=="function")g||sg(i);else if(g){var v=null;if(d&&d.hasAttribute("formAction")){if(c=d,g=d[It]||null)v=g.formAction;else if(qu(c)!==null)continue}else v=g.action;typeof v=="function"?i[o+1]=v:(i.splice(o,3),o-=3),sg(i)}}}function lg(){function e(d){d.canIntercept&&d.info==="react-transition"&&d.intercept({handler:function(){return new Promise(function(g){return c=g})},focusReset:"manual",scroll:"manual"})}function t(){c!==null&&(c(),c=null),o||setTimeout(i,20)}function i(){if(!o&&!navigation.transition){var d=navigation.currentEntry;d&&d.url!=null&&navigation.navigate(d.url,{state:d.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var o=!1,c=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(i,100),function(){o=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),c!==null&&(c(),c=null)}}}function Yu(e){this._internalRoot=e}Wl.prototype.render=Yu.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(l(409));var i=t.current,o=sn();Zp(i,o,e,t,null,null)},Wl.prototype.unmount=Yu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Zp(e.current,2,null,e,null,null),Dl(),t[Mi]=null}};function Wl(e){this._internalRoot=e}Wl.prototype.unstable_scheduleHydration=function(e){if(e){var t=jo();e={blockedOn:null,target:e,priority:t};for(var i=0;i<Ga.length&&t!==0&&t<Ga[i].priority;i++);Ga.splice(i,0,e),i===0&&ig(e)}};var rg=a.version;if(rg!=="19.2.1")throw Error(l(527,rg,"19.2.1"));$.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(l(188)):(e=Object.keys(e).join(","),Error(l(268,e)));return e=y(t),e=e!==null?C(e):null,e=e===null?null:e.stateNode,e};var _0={bundleType:0,version:"19.2.1",rendererPackageName:"react-dom",currentDispatcherRef:R,reconcilerVersion:"19.2.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Xl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Xl.isDisabled&&Xl.supportsFiber)try{Fn=Xl.inject(_0),Z=Xl}catch{}}return vs.createRoot=function(e,t){if(!u(e))throw Error(l(299));var i=!1,o="",c=pm,d=gm,g=ym;return t!=null&&(t.unstable_strictMode===!0&&(i=!0),t.identifierPrefix!==void 0&&(o=t.identifierPrefix),t.onUncaughtError!==void 0&&(c=t.onUncaughtError),t.onCaughtError!==void 0&&(d=t.onCaughtError),t.onRecoverableError!==void 0&&(g=t.onRecoverableError)),t=Wp(e,1,!1,null,null,i,o,null,c,d,g,lg),e[Mi]=t.current,ku(e),new Yu(t)},vs.hydrateRoot=function(e,t,i){if(!u(e))throw Error(l(299));var o=!1,c="",d=pm,g=gm,v=ym,k=null;return i!=null&&(i.unstable_strictMode===!0&&(o=!0),i.identifierPrefix!==void 0&&(c=i.identifierPrefix),i.onUncaughtError!==void 0&&(d=i.onUncaughtError),i.onCaughtError!==void 0&&(g=i.onCaughtError),i.onRecoverableError!==void 0&&(v=i.onRecoverableError),i.formState!==void 0&&(k=i.formState)),t=Wp(e,1,!0,t,i??null,o,c,k,d,g,v,lg),t.context=Xp(null),i=t.current,o=sn(),o=$n(o),c=Ma(o),c.callback=null,Da(i,c,o),i=o,t.current.lanes=i,wn(t,i),zn(t),e[Mi]=t.current,ku(e),new Wl(t)},vs.version="19.2.1",vs}var bg;function FC(){if(bg)return Vu.exports;bg=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(a){console.error(a)}}return n(),Vu.exports=VC(),Vu.exports}var QC=FC();const $C="modulepreload",WC=function(n){return"/"+n},Sg={},gt=function(a,s,l){let u=Promise.resolve();if(s&&s.length>0){let p=function(y){return Promise.all(y.map(C=>Promise.resolve(C).then(x=>({status:"fulfilled",value:x}),x=>({status:"rejected",reason:x}))))};document.getElementsByTagName("link");const h=document.querySelector("meta[property=csp-nonce]"),m=h?.nonce||h?.getAttribute("nonce");u=p(s.map(y=>{if(y=WC(y),y in Sg)return;Sg[y]=!0;const C=y.endsWith(".css"),x=C?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${y}"]${x}`))return;const b=document.createElement("link");if(b.rel=C?"stylesheet":$C,C||(b.as="script"),b.crossOrigin="",b.href=y,m&&b.setAttribute("nonce",m),document.head.appendChild(b),C)return new Promise((N,w)=>{b.addEventListener("load",N),b.addEventListener("error",()=>w(new Error(`Unable to preload CSS for ${y}`)))})}))}function f(h){const m=new Event("vite:preloadError",{cancelable:!0});if(m.payload=h,window.dispatchEvent(m),!m.defaultPrevented)throw h}return u.then(h=>{for(const m of h||[])m.status==="rejected"&&f(m.reason);return a().catch(f)})},XC=new CS({defaultOptions:{queries:{staleTime:5e3,refetchOnWindowFocus:!1,retry:1},mutations:{retry:!1}}}),Ae=n=>typeof n=="string",bs=()=>{let n,a;const s=new Promise((l,u)=>{n=l,a=u});return s.resolve=n,s.reject=a,s},Cg=n=>n==null?"":""+n,ZC=(n,a,s)=>{n.forEach(l=>{a[l]&&(s[l]=a[l])})},JC=/###/g,wg=n=>n&&n.indexOf("###")>-1?n.replace(JC,"."):n,Ng=n=>!n||Ae(n),js=(n,a,s)=>{const l=Ae(a)?a.split("."):a;let u=0;for(;u<l.length-1;){if(Ng(n))return{};const f=wg(l[u]);!n[f]&&s&&(n[f]=new s),Object.prototype.hasOwnProperty.call(n,f)?n=n[f]:n={},++u}return Ng(n)?{}:{obj:n,k:wg(l[u])}},Ag=(n,a,s)=>{const{obj:l,k:u}=js(n,a,Object);if(l!==void 0||a.length===1){l[u]=s;return}let f=a[a.length-1],h=a.slice(0,a.length-1),m=js(n,h,Object);for(;m.obj===void 0&&h.length;)f=`${h[h.length-1]}.${f}`,h=h.slice(0,h.length-1),m=js(n,h,Object),m?.obj&&typeof m.obj[`${m.k}.${f}`]<"u"&&(m.obj=void 0);m.obj[`${m.k}.${f}`]=s},ew=(n,a,s,l)=>{const{obj:u,k:f}=js(n,a,Object);u[f]=u[f]||[],u[f].push(s)},rr=(n,a)=>{const{obj:s,k:l}=js(n,a);if(s&&Object.prototype.hasOwnProperty.call(s,l))return s[l]},tw=(n,a,s)=>{const l=rr(n,s);return l!==void 0?l:rr(a,s)},Jy=(n,a,s)=>{for(const l in a)l!=="__proto__"&&l!=="constructor"&&(l in n?Ae(n[l])||n[l]instanceof String||Ae(a[l])||a[l]instanceof String?s&&(n[l]=a[l]):Jy(n[l],a[l],s):n[l]=a[l]);return n},vi=n=>n.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var nw={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const aw=n=>Ae(n)?n.replace(/[&<>"'\/]/g,a=>nw[a]):n;class iw{constructor(a){this.capacity=a,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(a){const s=this.regExpMap.get(a);if(s!==void 0)return s;const l=new RegExp(a);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(a,l),this.regExpQueue.push(a),l}}const ow=[" ",",","?","!",";"],sw=new iw(20),lw=(n,a,s)=>{a=a||"",s=s||"";const l=ow.filter(h=>a.indexOf(h)<0&&s.indexOf(h)<0);if(l.length===0)return!0;const u=sw.getRegExp(`(${l.map(h=>h==="?"?"\\?":h).join("|")})`);let f=!u.test(n);if(!f){const h=n.indexOf(s);h>0&&!u.test(n.substring(0,h))&&(f=!0)}return f},gd=(n,a,s=".")=>{if(!n)return;if(n[a])return Object.prototype.hasOwnProperty.call(n,a)?n[a]:void 0;const l=a.split(s);let u=n;for(let f=0;f<l.length;){if(!u||typeof u!="object")return;let h,m="";for(let p=f;p<l.length;++p)if(p!==f&&(m+=s),m+=l[p],h=u[m],h!==void 0){if(["string","number","boolean"].indexOf(typeof h)>-1&&p<l.length-1)continue;f+=p-f+1;break}u=h}return u},Rs=n=>n?.replace("_","-"),rw={type:"logger",log(n){this.output("log",n)},warn(n){this.output("warn",n)},error(n){this.output("error",n)},output(n,a){console?.[n]?.apply?.(console,a)}};class cr{constructor(a,s={}){this.init(a,s)}init(a,s={}){this.prefix=s.prefix||"i18next:",this.logger=a||rw,this.options=s,this.debug=s.debug}log(...a){return this.forward(a,"log","",!0)}warn(...a){return this.forward(a,"warn","",!0)}error(...a){return this.forward(a,"error","")}deprecate(...a){return this.forward(a,"warn","WARNING DEPRECATED: ",!0)}forward(a,s,l,u){return u&&!this.debug?null:(Ae(a[0])&&(a[0]=`${l}${this.prefix} ${a[0]}`),this.logger[s](a))}create(a){return new cr(this.logger,{prefix:`${this.prefix}:${a}:`,...this.options})}clone(a){return a=a||this.options,a.prefix=a.prefix||this.prefix,new cr(this.logger,a)}}var Hn=new cr;class Ar{constructor(){this.observers={}}on(a,s){return a.split(" ").forEach(l=>{this.observers[l]||(this.observers[l]=new Map);const u=this.observers[l].get(s)||0;this.observers[l].set(s,u+1)}),this}off(a,s){if(this.observers[a]){if(!s){delete this.observers[a];return}this.observers[a].delete(s)}}emit(a,...s){this.observers[a]&&Array.from(this.observers[a].entries()).forEach(([u,f])=>{for(let h=0;h<f;h++)u(...s)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([u,f])=>{for(let h=0;h<f;h++)u.apply(u,[a,...s])})}}class kg extends Ar{constructor(a,s={ns:["translation"],defaultNS:"translation"}){super(),this.data=a||{},this.options=s,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(a){this.options.ns.indexOf(a)<0&&this.options.ns.push(a)}removeNamespaces(a){const s=this.options.ns.indexOf(a);s>-1&&this.options.ns.splice(s,1)}getResource(a,s,l,u={}){const f=u.keySeparator!==void 0?u.keySeparator:this.options.keySeparator,h=u.ignoreJSONStructure!==void 0?u.ignoreJSONStructure:this.options.ignoreJSONStructure;let m;a.indexOf(".")>-1?m=a.split("."):(m=[a,s],l&&(Array.isArray(l)?m.push(...l):Ae(l)&&f?m.push(...l.split(f)):m.push(l)));const p=rr(this.data,m);return!p&&!s&&!l&&a.indexOf(".")>-1&&(a=m[0],s=m[1],l=m.slice(2).join(".")),p||!h||!Ae(l)?p:gd(this.data?.[a]?.[s],l,f)}addResource(a,s,l,u,f={silent:!1}){const h=f.keySeparator!==void 0?f.keySeparator:this.options.keySeparator;let m=[a,s];l&&(m=m.concat(h?l.split(h):l)),a.indexOf(".")>-1&&(m=a.split("."),u=s,s=m[1]),this.addNamespaces(s),Ag(this.data,m,u),f.silent||this.emit("added",a,s,l,u)}addResources(a,s,l,u={silent:!1}){for(const f in l)(Ae(l[f])||Array.isArray(l[f]))&&this.addResource(a,s,f,l[f],{silent:!0});u.silent||this.emit("added",a,s,l)}addResourceBundle(a,s,l,u,f,h={silent:!1,skipCopy:!1}){let m=[a,s];a.indexOf(".")>-1&&(m=a.split("."),u=l,l=s,s=m[1]),this.addNamespaces(s);let p=rr(this.data,m)||{};h.skipCopy||(l=JSON.parse(JSON.stringify(l))),u?Jy(p,l,f):p={...p,...l},Ag(this.data,m,p),h.silent||this.emit("added",a,s,l)}removeResourceBundle(a,s){this.hasResourceBundle(a,s)&&delete this.data[a][s],this.removeNamespaces(s),this.emit("removed",a,s)}hasResourceBundle(a,s){return this.getResource(a,s)!==void 0}getResourceBundle(a,s){return s||(s=this.options.defaultNS),this.getResource(a,s)}getDataByLanguage(a){return this.data[a]}hasLanguageSomeTranslations(a){const s=this.getDataByLanguage(a);return!!(s&&Object.keys(s)||[]).find(u=>s[u]&&Object.keys(s[u]).length>0)}toJSON(){return this.data}}var ex={processors:{},addPostProcessor(n){this.processors[n.name]=n},handle(n,a,s,l,u){return n.forEach(f=>{a=this.processors[f]?.process(a,s,l,u)??a}),a}};const tx=Symbol("i18next/PATH_KEY");function cw(){const n=[],a=Object.create(null);let s;return a.get=(l,u)=>(s?.revoke?.(),u===tx?n:(n.push(u),s=Proxy.revocable(l,a),s.proxy)),Proxy.revocable(Object.create(null),a).proxy}function yd(n,a){const{[tx]:s}=n(cw());return s.join(a?.keySeparator??".")}const jg={},$u=n=>!Ae(n)&&typeof n!="boolean"&&typeof n!="number";class ur extends Ar{constructor(a,s={}){super(),ZC(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],a,this),this.options=s,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Hn.create("translator")}changeLanguage(a){a&&(this.language=a)}exists(a,s={interpolation:{}}){const l={...s};if(a==null)return!1;const u=this.resolve(a,l);if(u?.res===void 0)return!1;const f=$u(u.res);return!(l.returnObjects===!1&&f)}extractFromKey(a,s){let l=s.nsSeparator!==void 0?s.nsSeparator:this.options.nsSeparator;l===void 0&&(l=":");const u=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator;let f=s.ns||this.options.defaultNS||[];const h=l&&a.indexOf(l)>-1,m=!this.options.userDefinedKeySeparator&&!s.keySeparator&&!this.options.userDefinedNsSeparator&&!s.nsSeparator&&!lw(a,l,u);if(h&&!m){const p=a.match(this.interpolator.nestingRegexp);if(p&&p.length>0)return{key:a,namespaces:Ae(f)?[f]:f};const y=a.split(l);(l!==u||l===u&&this.options.ns.indexOf(y[0])>-1)&&(f=y.shift()),a=y.join(u)}return{key:a,namespaces:Ae(f)?[f]:f}}translate(a,s,l){let u=typeof s=="object"?{...s}:s;if(typeof u!="object"&&this.options.overloadTranslationOptionHandler&&(u=this.options.overloadTranslationOptionHandler(arguments)),typeof u=="object"&&(u={...u}),u||(u={}),a==null)return"";typeof a=="function"&&(a=yd(a,{...this.options,...u})),Array.isArray(a)||(a=[String(a)]);const f=u.returnDetails!==void 0?u.returnDetails:this.options.returnDetails,h=u.keySeparator!==void 0?u.keySeparator:this.options.keySeparator,{key:m,namespaces:p}=this.extractFromKey(a[a.length-1],u),y=p[p.length-1];let C=u.nsSeparator!==void 0?u.nsSeparator:this.options.nsSeparator;C===void 0&&(C=":");const x=u.lng||this.language,b=u.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(x?.toLowerCase()==="cimode")return b?f?{res:`${y}${C}${m}`,usedKey:m,exactUsedKey:m,usedLng:x,usedNS:y,usedParams:this.getUsedParamsDetails(u)}:`${y}${C}${m}`:f?{res:m,usedKey:m,exactUsedKey:m,usedLng:x,usedNS:y,usedParams:this.getUsedParamsDetails(u)}:m;const N=this.resolve(a,u);let w=N?.res;const T=N?.usedKey||m,E=N?.exactUsedKey||m,M=["[object Number]","[object Function]","[object RegExp]"],H=u.joinArrays!==void 0?u.joinArrays:this.options.joinArrays,B=!this.i18nFormat||this.i18nFormat.handleAsObject,U=u.count!==void 0&&!Ae(u.count),O=ur.hasDefaultValue(u),A=U?this.pluralResolver.getSuffix(x,u.count,u):"",_=u.ordinal&&U?this.pluralResolver.getSuffix(x,u.count,{ordinal:!1}):"",W=U&&!u.ordinal&&u.count===0,F=W&&u[`defaultValue${this.options.pluralSeparator}zero`]||u[`defaultValue${A}`]||u[`defaultValue${_}`]||u.defaultValue;let Q=w;B&&!w&&O&&(Q=F);const ae=$u(Q),te=Object.prototype.toString.apply(Q);if(B&&Q&&ae&&M.indexOf(te)<0&&!(Ae(H)&&Array.isArray(Q))){if(!u.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const ye=this.options.returnedObjectHandler?this.options.returnedObjectHandler(T,Q,{...u,ns:p}):`key '${m} (${this.language})' returned an object instead of string.`;return f?(N.res=ye,N.usedParams=this.getUsedParamsDetails(u),N):ye}if(h){const ye=Array.isArray(Q),de=ye?[]:{},Ce=ye?E:T;for(const R in Q)if(Object.prototype.hasOwnProperty.call(Q,R)){const $=`${Ce}${h}${R}`;O&&!w?de[R]=this.translate($,{...u,defaultValue:$u(F)?F[R]:void 0,joinArrays:!1,ns:p}):de[R]=this.translate($,{...u,joinArrays:!1,ns:p}),de[R]===$&&(de[R]=Q[R])}w=de}}else if(B&&Ae(H)&&Array.isArray(w))w=w.join(H),w&&(w=this.extendTranslation(w,a,u,l));else{let ye=!1,de=!1;!this.isValidLookup(w)&&O&&(ye=!0,w=F),this.isValidLookup(w)||(de=!0,w=m);const R=(u.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&de?void 0:w,$=O&&F!==w&&this.options.updateMissing;if(de||ye||$){if(this.logger.log($?"updateKey":"missingKey",x,y,m,$?F:w),h){const fe=this.resolve(m,{...u,keySeparator:!1});fe&&fe.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 ee=[];const X=this.languageUtils.getFallbackCodes(this.options.fallbackLng,u.lng||this.language);if(this.options.saveMissingTo==="fallback"&&X&&X[0])for(let fe=0;fe<X.length;fe++)ee.push(X[fe]);else this.options.saveMissingTo==="all"?ee=this.languageUtils.toResolveHierarchy(u.lng||this.language):ee.push(u.lng||this.language);const se=(fe,Ne,V)=>{const J=O&&V!==w?V:R;this.options.missingKeyHandler?this.options.missingKeyHandler(fe,y,Ne,J,$,u):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(fe,y,Ne,J,$,u),this.emit("missingKey",fe,y,Ne,w)};this.options.saveMissing&&(this.options.saveMissingPlurals&&U?ee.forEach(fe=>{const Ne=this.pluralResolver.getSuffixes(fe,u);W&&u[`defaultValue${this.options.pluralSeparator}zero`]&&Ne.indexOf(`${this.options.pluralSeparator}zero`)<0&&Ne.push(`${this.options.pluralSeparator}zero`),Ne.forEach(V=>{se([fe],m+V,u[`defaultValue${V}`]||F)})}):se(ee,m,F))}w=this.extendTranslation(w,a,u,N,l),de&&w===m&&this.options.appendNamespaceToMissingKey&&(w=`${y}${C}${m}`),(de||ye)&&this.options.parseMissingKeyHandler&&(w=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${y}${C}${m}`:m,ye?w:void 0,u))}return f?(N.res=w,N.usedParams=this.getUsedParamsDetails(u),N):w}extendTranslation(a,s,l,u,f){if(this.i18nFormat?.parse)a=this.i18nFormat.parse(a,{...this.options.interpolation.defaultVariables,...l},l.lng||this.language||u.usedLng,u.usedNS,u.usedKey,{resolved:u});else if(!l.skipInterpolation){l.interpolation&&this.interpolator.init({...l,interpolation:{...this.options.interpolation,...l.interpolation}});const p=Ae(a)&&(l?.interpolation?.skipOnVariables!==void 0?l.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let y;if(p){const x=a.match(this.interpolator.nestingRegexp);y=x&&x.length}let C=l.replace&&!Ae(l.replace)?l.replace:l;if(this.options.interpolation.defaultVariables&&(C={...this.options.interpolation.defaultVariables,...C}),a=this.interpolator.interpolate(a,C,l.lng||this.language||u.usedLng,l),p){const x=a.match(this.interpolator.nestingRegexp),b=x&&x.length;y<b&&(l.nest=!1)}!l.lng&&u&&u.res&&(l.lng=this.language||u.usedLng),l.nest!==!1&&(a=this.interpolator.nest(a,(...x)=>f?.[0]===x[0]&&!l.context?(this.logger.warn(`It seems you are nesting recursively key: ${x[0]} in key: ${s[0]}`),null):this.translate(...x,s),l)),l.interpolation&&this.interpolator.reset()}const h=l.postProcess||this.options.postProcess,m=Ae(h)?[h]:h;return a!=null&&m?.length&&l.applyPostProcessor!==!1&&(a=ex.handle(m,a,s,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...u,usedParams:this.getUsedParamsDetails(l)},...l}:l,this)),a}resolve(a,s={}){let l,u,f,h,m;return Ae(a)&&(a=[a]),a.forEach(p=>{if(this.isValidLookup(l))return;const y=this.extractFromKey(p,s),C=y.key;u=C;let x=y.namespaces;this.options.fallbackNS&&(x=x.concat(this.options.fallbackNS));const b=s.count!==void 0&&!Ae(s.count),N=b&&!s.ordinal&&s.count===0,w=s.context!==void 0&&(Ae(s.context)||typeof s.context=="number")&&s.context!=="",T=s.lngs?s.lngs:this.languageUtils.toResolveHierarchy(s.lng||this.language,s.fallbackLng);x.forEach(E=>{this.isValidLookup(l)||(m=E,!jg[`${T[0]}-${E}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(m)&&(jg[`${T[0]}-${E}`]=!0,this.logger.warn(`key "${u}" for languages "${T.join(", ")}" won't get resolved as namespace "${m}" 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!!!")),T.forEach(M=>{if(this.isValidLookup(l))return;h=M;const H=[C];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(H,C,M,E,s);else{let U;b&&(U=this.pluralResolver.getSuffix(M,s.count,s));const O=`${this.options.pluralSeparator}zero`,A=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(b&&(s.ordinal&&U.indexOf(A)===0&&H.push(C+U.replace(A,this.options.pluralSeparator)),H.push(C+U),N&&H.push(C+O)),w){const _=`${C}${this.options.contextSeparator||"_"}${s.context}`;H.push(_),b&&(s.ordinal&&U.indexOf(A)===0&&H.push(_+U.replace(A,this.options.pluralSeparator)),H.push(_+U),N&&H.push(_+O))}}let B;for(;B=H.pop();)this.isValidLookup(l)||(f=B,l=this.getResource(M,E,B,s))}))})}),{res:l,usedKey:u,exactUsedKey:f,usedLng:h,usedNS:m}}isValidLookup(a){return a!==void 0&&!(!this.options.returnNull&&a===null)&&!(!this.options.returnEmptyString&&a==="")}getResource(a,s,l,u={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(a,s,l,u):this.resourceStore.getResource(a,s,l,u)}getUsedParamsDetails(a={}){const s=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],l=a.replace&&!Ae(a.replace);let u=l?a.replace:a;if(l&&typeof a.count<"u"&&(u.count=a.count),this.options.interpolation.defaultVariables&&(u={...this.options.interpolation.defaultVariables,...u}),!l){u={...u};for(const f of s)delete u[f]}return u}static hasDefaultValue(a){const s="defaultValue";for(const l in a)if(Object.prototype.hasOwnProperty.call(a,l)&&s===l.substring(0,s.length)&&a[l]!==void 0)return!0;return!1}}class Tg{constructor(a){this.options=a,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Hn.create("languageUtils")}getScriptPartFromCode(a){if(a=Rs(a),!a||a.indexOf("-")<0)return null;const s=a.split("-");return s.length===2||(s.pop(),s[s.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(s.join("-"))}getLanguagePartFromCode(a){if(a=Rs(a),!a||a.indexOf("-")<0)return a;const s=a.split("-");return this.formatLanguageCode(s[0])}formatLanguageCode(a){if(Ae(a)&&a.indexOf("-")>-1){let s;try{s=Intl.getCanonicalLocales(a)[0]}catch{}return s&&this.options.lowerCaseLng&&(s=s.toLowerCase()),s||(this.options.lowerCaseLng?a.toLowerCase():a)}return this.options.cleanCode||this.options.lowerCaseLng?a.toLowerCase():a}isSupportedCode(a){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(a=this.getLanguagePartFromCode(a)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(a)>-1}getBestMatchFromCodes(a){if(!a)return null;let s;return a.forEach(l=>{if(s)return;const u=this.formatLanguageCode(l);(!this.options.supportedLngs||this.isSupportedCode(u))&&(s=u)}),!s&&this.options.supportedLngs&&a.forEach(l=>{if(s)return;const u=this.getScriptPartFromCode(l);if(this.isSupportedCode(u))return s=u;const f=this.getLanguagePartFromCode(l);if(this.isSupportedCode(f))return s=f;s=this.options.supportedLngs.find(h=>{if(h===f)return h;if(!(h.indexOf("-")<0&&f.indexOf("-")<0)&&(h.indexOf("-")>0&&f.indexOf("-")<0&&h.substring(0,h.indexOf("-"))===f||h.indexOf(f)===0&&f.length>1))return h})}),s||(s=this.getFallbackCodes(this.options.fallbackLng)[0]),s}getFallbackCodes(a,s){if(!a)return[];if(typeof a=="function"&&(a=a(s)),Ae(a)&&(a=[a]),Array.isArray(a))return a;if(!s)return a.default||[];let l=a[s];return l||(l=a[this.getScriptPartFromCode(s)]),l||(l=a[this.formatLanguageCode(s)]),l||(l=a[this.getLanguagePartFromCode(s)]),l||(l=a.default),l||[]}toResolveHierarchy(a,s){const l=this.getFallbackCodes((s===!1?[]:s)||this.options.fallbackLng||[],a),u=[],f=h=>{h&&(this.isSupportedCode(h)?u.push(h):this.logger.warn(`rejecting language code not found in supportedLngs: ${h}`))};return Ae(a)&&(a.indexOf("-")>-1||a.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&f(this.formatLanguageCode(a)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&f(this.getScriptPartFromCode(a)),this.options.load!=="currentOnly"&&f(this.getLanguagePartFromCode(a))):Ae(a)&&f(this.formatLanguageCode(a)),l.forEach(h=>{u.indexOf(h)<0&&f(this.formatLanguageCode(h))}),u}}const Mg={zero:0,one:1,two:2,few:3,many:4,other:5},Dg={select:n=>n===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class uw{constructor(a,s={}){this.languageUtils=a,this.options=s,this.logger=Hn.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(a,s={}){const l=Rs(a==="dev"?"en":a),u=s.ordinal?"ordinal":"cardinal",f=JSON.stringify({cleanedCode:l,type:u});if(f in this.pluralRulesCache)return this.pluralRulesCache[f];let h;try{h=new Intl.PluralRules(l,{type:u})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl polyfill!"),Dg;if(!a.match(/-|_/))return Dg;const p=this.languageUtils.getLanguagePartFromCode(a);h=this.getRule(p,s)}return this.pluralRulesCache[f]=h,h}needsPlural(a,s={}){let l=this.getRule(a,s);return l||(l=this.getRule("dev",s)),l?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(a,s,l={}){return this.getSuffixes(a,l).map(u=>`${s}${u}`)}getSuffixes(a,s={}){let l=this.getRule(a,s);return l||(l=this.getRule("dev",s)),l?l.resolvedOptions().pluralCategories.sort((u,f)=>Mg[u]-Mg[f]).map(u=>`${this.options.prepend}${s.ordinal?`ordinal${this.options.prepend}`:""}${u}`):[]}getSuffix(a,s,l={}){const u=this.getRule(a,l);return u?`${this.options.prepend}${l.ordinal?`ordinal${this.options.prepend}`:""}${u.select(s)}`:(this.logger.warn(`no plural rule found for: ${a}`),this.getSuffix("dev",s,l))}}const Eg=(n,a,s,l=".",u=!0)=>{let f=tw(n,a,s);return!f&&u&&Ae(s)&&(f=gd(n,s,l),f===void 0&&(f=gd(a,s,l))),f},Wu=n=>n.replace(/\$/g,"$$$$");class Og{constructor(a={}){this.logger=Hn.create("interpolator"),this.options=a,this.format=a?.interpolation?.format||(s=>s),this.init(a)}init(a={}){a.interpolation||(a.interpolation={escapeValue:!0});const{escape:s,escapeValue:l,useRawValueToEscape:u,prefix:f,prefixEscaped:h,suffix:m,suffixEscaped:p,formatSeparator:y,unescapeSuffix:C,unescapePrefix:x,nestingPrefix:b,nestingPrefixEscaped:N,nestingSuffix:w,nestingSuffixEscaped:T,nestingOptionsSeparator:E,maxReplaces:M,alwaysFormat:H}=a.interpolation;this.escape=s!==void 0?s:aw,this.escapeValue=l!==void 0?l:!0,this.useRawValueToEscape=u!==void 0?u:!1,this.prefix=f?vi(f):h||"{{",this.suffix=m?vi(m):p||"}}",this.formatSeparator=y||",",this.unescapePrefix=C?"":x||"-",this.unescapeSuffix=this.unescapePrefix?"":C||"",this.nestingPrefix=b?vi(b):N||vi("$t("),this.nestingSuffix=w?vi(w):T||vi(")"),this.nestingOptionsSeparator=E||",",this.maxReplaces=M||1e3,this.alwaysFormat=H!==void 0?H:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const a=(s,l)=>s?.source===l?(s.lastIndex=0,s):new RegExp(l,"g");this.regexp=a(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=a(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=a(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(a,s,l,u){let f,h,m;const p=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},y=N=>{if(N.indexOf(this.formatSeparator)<0){const M=Eg(s,p,N,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(M,void 0,l,{...u,...s,interpolationkey:N}):M}const w=N.split(this.formatSeparator),T=w.shift().trim(),E=w.join(this.formatSeparator).trim();return this.format(Eg(s,p,T,this.options.keySeparator,this.options.ignoreJSONStructure),E,l,{...u,...s,interpolationkey:T})};this.resetRegExp();const C=u?.missingInterpolationHandler||this.options.missingInterpolationHandler,x=u?.interpolation?.skipOnVariables!==void 0?u.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:N=>Wu(N)},{regex:this.regexp,safeValue:N=>this.escapeValue?Wu(this.escape(N)):Wu(N)}].forEach(N=>{for(m=0;f=N.regex.exec(a);){const w=f[1].trim();if(h=y(w),h===void 0)if(typeof C=="function"){const E=C(a,f,u);h=Ae(E)?E:""}else if(u&&Object.prototype.hasOwnProperty.call(u,w))h="";else if(x){h=f[0];continue}else this.logger.warn(`missed to pass in variable ${w} for interpolating ${a}`),h="";else!Ae(h)&&!this.useRawValueToEscape&&(h=Cg(h));const T=N.safeValue(h);if(a=a.replace(f[0],T),x?(N.regex.lastIndex+=h.length,N.regex.lastIndex-=f[0].length):N.regex.lastIndex=0,m++,m>=this.maxReplaces)break}}),a}nest(a,s,l={}){let u,f,h;const m=(p,y)=>{const C=this.nestingOptionsSeparator;if(p.indexOf(C)<0)return p;const x=p.split(new RegExp(`${vi(C)}[ ]*{`));let b=`{${x[1]}`;p=x[0],b=this.interpolate(b,h);const N=b.match(/'/g),w=b.match(/"/g);((N?.length??0)%2===0&&!w||(w?.length??0)%2!==0)&&(b=b.replace(/'/g,'"'));try{h=JSON.parse(b),y&&(h={...y,...h})}catch(T){return this.logger.warn(`failed parsing options string in nesting for key ${p}`,T),`${p}${C}${b}`}return h.defaultValue&&h.defaultValue.indexOf(this.prefix)>-1&&delete h.defaultValue,p};for(;u=this.nestingRegexp.exec(a);){let p=[];h={...l},h=h.replace&&!Ae(h.replace)?h.replace:h,h.applyPostProcessor=!1,delete h.defaultValue;const y=/{.*}/.test(u[1])?u[1].lastIndexOf("}")+1:u[1].indexOf(this.formatSeparator);if(y!==-1&&(p=u[1].slice(y).split(this.formatSeparator).map(C=>C.trim()).filter(Boolean),u[1]=u[1].slice(0,y)),f=s(m.call(this,u[1].trim(),h),h),f&&u[0]===a&&!Ae(f))return f;Ae(f)||(f=Cg(f)),f||(this.logger.warn(`missed to resolve ${u[1]} for nesting ${a}`),f=""),p.length&&(f=p.reduce((C,x)=>this.format(C,x,l.lng,{...l,interpolationkey:u[1].trim()}),f.trim())),a=a.replace(u[0],f),this.regexp.lastIndex=0}return a}}const dw=n=>{let a=n.toLowerCase().trim();const s={};if(n.indexOf("(")>-1){const l=n.split("(");a=l[0].toLowerCase().trim();const u=l[1].substring(0,l[1].length-1);a==="currency"&&u.indexOf(":")<0?s.currency||(s.currency=u.trim()):a==="relativetime"&&u.indexOf(":")<0?s.range||(s.range=u.trim()):u.split(";").forEach(h=>{if(h){const[m,...p]=h.split(":"),y=p.join(":").trim().replace(/^'+|'+$/g,""),C=m.trim();s[C]||(s[C]=y),y==="false"&&(s[C]=!1),y==="true"&&(s[C]=!0),isNaN(y)||(s[C]=parseInt(y,10))}})}return{formatName:a,formatOptions:s}},Rg=n=>{const a={};return(s,l,u)=>{let f=u;u&&u.interpolationkey&&u.formatParams&&u.formatParams[u.interpolationkey]&&u[u.interpolationkey]&&(f={...f,[u.interpolationkey]:void 0});const h=l+JSON.stringify(f);let m=a[h];return m||(m=n(Rs(l),u),a[h]=m),m(s)}},fw=n=>(a,s,l)=>n(Rs(s),l)(a);class hw{constructor(a={}){this.logger=Hn.create("formatter"),this.options=a,this.init(a)}init(a,s={interpolation:{}}){this.formatSeparator=s.interpolation.formatSeparator||",";const l=s.cacheInBuiltFormats?Rg:fw;this.formats={number:l((u,f)=>{const h=new Intl.NumberFormat(u,{...f});return m=>h.format(m)}),currency:l((u,f)=>{const h=new Intl.NumberFormat(u,{...f,style:"currency"});return m=>h.format(m)}),datetime:l((u,f)=>{const h=new Intl.DateTimeFormat(u,{...f});return m=>h.format(m)}),relativetime:l((u,f)=>{const h=new Intl.RelativeTimeFormat(u,{...f});return m=>h.format(m,f.range||"day")}),list:l((u,f)=>{const h=new Intl.ListFormat(u,{...f});return m=>h.format(m)})}}add(a,s){this.formats[a.toLowerCase().trim()]=s}addCached(a,s){this.formats[a.toLowerCase().trim()]=Rg(s)}format(a,s,l,u={}){const f=s.split(this.formatSeparator);if(f.length>1&&f[0].indexOf("(")>1&&f[0].indexOf(")")<0&&f.find(m=>m.indexOf(")")>-1)){const m=f.findIndex(p=>p.indexOf(")")>-1);f[0]=[f[0],...f.splice(1,m)].join(this.formatSeparator)}return f.reduce((m,p)=>{const{formatName:y,formatOptions:C}=dw(p);if(this.formats[y]){let x=m;try{const b=u?.formatParams?.[u.interpolationkey]||{},N=b.locale||b.lng||u.locale||u.lng||l;x=this.formats[y](m,N,{...C,...u,...b})}catch(b){this.logger.warn(b)}return x}else this.logger.warn(`there was no format function for ${y}`);return m},a)}}const mw=(n,a)=>{n.pending[a]!==void 0&&(delete n.pending[a],n.pendingCount--)};class pw extends Ar{constructor(a,s,l,u={}){super(),this.backend=a,this.store=s,this.services=l,this.languageUtils=l.languageUtils,this.options=u,this.logger=Hn.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=u.maxParallelReads||10,this.readingCalls=0,this.maxRetries=u.maxRetries>=0?u.maxRetries:5,this.retryTimeout=u.retryTimeout>=1?u.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(l,u.backend,u)}queueLoad(a,s,l,u){const f={},h={},m={},p={};return a.forEach(y=>{let C=!0;s.forEach(x=>{const b=`${y}|${x}`;!l.reload&&this.store.hasResourceBundle(y,x)?this.state[b]=2:this.state[b]<0||(this.state[b]===1?h[b]===void 0&&(h[b]=!0):(this.state[b]=1,C=!1,h[b]===void 0&&(h[b]=!0),f[b]===void 0&&(f[b]=!0),p[x]===void 0&&(p[x]=!0)))}),C||(m[y]=!0)}),(Object.keys(f).length||Object.keys(h).length)&&this.queue.push({pending:h,pendingCount:Object.keys(h).length,loaded:{},errors:[],callback:u}),{toLoad:Object.keys(f),pending:Object.keys(h),toLoadLanguages:Object.keys(m),toLoadNamespaces:Object.keys(p)}}loaded(a,s,l){const u=a.split("|"),f=u[0],h=u[1];s&&this.emit("failedLoading",f,h,s),!s&&l&&this.store.addResourceBundle(f,h,l,void 0,void 0,{skipCopy:!0}),this.state[a]=s?-1:2,s&&l&&(this.state[a]=0);const m={};this.queue.forEach(p=>{ew(p.loaded,[f],h),mw(p,a),s&&p.errors.push(s),p.pendingCount===0&&!p.done&&(Object.keys(p.loaded).forEach(y=>{m[y]||(m[y]={});const C=p.loaded[y];C.length&&C.forEach(x=>{m[y][x]===void 0&&(m[y][x]=!0)})}),p.done=!0,p.errors.length?p.callback(p.errors):p.callback())}),this.emit("loaded",m),this.queue=this.queue.filter(p=>!p.done)}read(a,s,l,u=0,f=this.retryTimeout,h){if(!a.length)return h(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:a,ns:s,fcName:l,tried:u,wait:f,callback:h});return}this.readingCalls++;const m=(y,C)=>{if(this.readingCalls--,this.waitingReads.length>0){const x=this.waitingReads.shift();this.read(x.lng,x.ns,x.fcName,x.tried,x.wait,x.callback)}if(y&&C&&u<this.maxRetries){setTimeout(()=>{this.read.call(this,a,s,l,u+1,f*2,h)},f);return}h(y,C)},p=this.backend[l].bind(this.backend);if(p.length===2){try{const y=p(a,s);y&&typeof y.then=="function"?y.then(C=>m(null,C)).catch(m):m(null,y)}catch(y){m(y)}return}return p(a,s,m)}prepareLoading(a,s,l={},u){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),u&&u();Ae(a)&&(a=this.languageUtils.toResolveHierarchy(a)),Ae(s)&&(s=[s]);const f=this.queueLoad(a,s,l,u);if(!f.toLoad.length)return f.pending.length||u(),null;f.toLoad.forEach(h=>{this.loadOne(h)})}load(a,s,l){this.prepareLoading(a,s,{},l)}reload(a,s,l){this.prepareLoading(a,s,{reload:!0},l)}loadOne(a,s=""){const l=a.split("|"),u=l[0],f=l[1];this.read(u,f,"read",void 0,void 0,(h,m)=>{h&&this.logger.warn(`${s}loading namespace ${f} for language ${u} failed`,h),!h&&m&&this.logger.log(`${s}loaded namespace ${f} for language ${u}`,m),this.loaded(a,h,m)})}saveMissing(a,s,l,u,f,h={},m=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(s)){this.logger.warn(`did not save key "${l}" as the namespace "${s}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(l==null||l==="")){if(this.backend?.create){const p={...h,isUpdate:f},y=this.backend.create.bind(this.backend);if(y.length<6)try{let C;y.length===5?C=y(a,s,l,u,p):C=y(a,s,l,u),C&&typeof C.then=="function"?C.then(x=>m(null,x)).catch(m):m(null,C)}catch(C){m(C)}else y(a,s,l,u,m,p)}!a||!a[0]||this.store.addResource(a[0],s,l,u)}}}const Xu=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:n=>{let a={};if(typeof n[1]=="object"&&(a=n[1]),Ae(n[1])&&(a.defaultValue=n[1]),Ae(n[2])&&(a.tDescription=n[2]),typeof n[2]=="object"||typeof n[3]=="object"){const s=n[3]||n[2];Object.keys(s).forEach(l=>{a[l]=s[l]})}return a},interpolation:{escapeValue:!0,format:n=>n,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),Pg=n=>(Ae(n.ns)&&(n.ns=[n.ns]),Ae(n.fallbackLng)&&(n.fallbackLng=[n.fallbackLng]),Ae(n.fallbackNS)&&(n.fallbackNS=[n.fallbackNS]),n.supportedLngs?.indexOf?.("cimode")<0&&(n.supportedLngs=n.supportedLngs.concat(["cimode"])),typeof n.initImmediate=="boolean"&&(n.initAsync=n.initImmediate),n),Zl=()=>{},gw=n=>{Object.getOwnPropertyNames(Object.getPrototypeOf(n)).forEach(s=>{typeof n[s]=="function"&&(n[s]=n[s].bind(n))})},nx="__i18next_supportNoticeShown",yw=()=>typeof globalThis<"u"&&!!globalThis[nx],xw=()=>{typeof globalThis<"u"&&(globalThis[nx]=!0)},vw=n=>!!(n?.modules?.backend?.name?.indexOf("Locize")>0||n?.modules?.backend?.constructor?.name?.indexOf("Locize")>0||n?.options?.backend?.backends&&n.options.backend.backends.some(a=>a?.name?.indexOf("Locize")>0||a?.constructor?.name?.indexOf("Locize")>0)||n?.options?.backend?.projectId||n?.options?.backend?.backendOptions&&n.options.backend.backendOptions.some(a=>a?.projectId));class Ts extends Ar{constructor(a={},s){if(super(),this.options=Pg(a),this.services={},this.logger=Hn,this.modules={external:[]},gw(this),s&&!this.isInitialized&&!a.isClone){if(!this.options.initAsync)return this.init(a,s),this;setTimeout(()=>{this.init(a,s)},0)}}init(a={},s){this.isInitializing=!0,typeof a=="function"&&(s=a,a={}),a.defaultNS==null&&a.ns&&(Ae(a.ns)?a.defaultNS=a.ns:a.ns.indexOf("translation")<0&&(a.defaultNS=a.ns[0]));const l=Xu();this.options={...l,...this.options,...Pg(a)},this.options.interpolation={...l.interpolation,...this.options.interpolation},a.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=a.keySeparator),a.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=a.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=l.overloadTranslationOptionHandler),this.options.showSupportNotice!==!1&&!vw(this)&&!yw()&&(typeof console<"u"&&typeof console.info<"u"&&console.info("🌐 i18next is maintained with support from Locize — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙"),xw());const u=y=>y?typeof y=="function"?new y:y:null;if(!this.options.isClone){this.modules.logger?Hn.init(u(this.modules.logger),this.options):Hn.init(null,this.options);let y;this.modules.formatter?y=this.modules.formatter:y=hw;const C=new Tg(this.options);this.store=new kg(this.options.resources,this.options);const x=this.services;x.logger=Hn,x.resourceStore=this.store,x.languageUtils=C,x.pluralResolver=new uw(C,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==l.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),y&&(!this.options.interpolation.format||this.options.interpolation.format===l.interpolation.format)&&(x.formatter=u(y),x.formatter.init&&x.formatter.init(x,this.options),this.options.interpolation.format=x.formatter.format.bind(x.formatter)),x.interpolator=new Og(this.options),x.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},x.backendConnector=new pw(u(this.modules.backend),x.resourceStore,x,this.options),x.backendConnector.on("*",(N,...w)=>{this.emit(N,...w)}),this.modules.languageDetector&&(x.languageDetector=u(this.modules.languageDetector),x.languageDetector.init&&x.languageDetector.init(x,this.options.detection,this.options)),this.modules.i18nFormat&&(x.i18nFormat=u(this.modules.i18nFormat),x.i18nFormat.init&&x.i18nFormat.init(this)),this.translator=new ur(this.services,this.options),this.translator.on("*",(N,...w)=>{this.emit(N,...w)}),this.modules.external.forEach(N=>{N.init&&N.init(this)})}if(this.format=this.options.interpolation.format,s||(s=Zl),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const y=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);y.length>0&&y[0]!=="dev"&&(this.options.lng=y[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(y=>{this[y]=(...C)=>this.store[y](...C)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(y=>{this[y]=(...C)=>(this.store[y](...C),this)});const m=bs(),p=()=>{const y=(C,x)=>{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),m.resolve(x),s(C,x)};if(this.languages&&!this.isInitialized)return y(null,this.t.bind(this));this.changeLanguage(this.options.lng,y)};return this.options.resources||!this.options.initAsync?p():setTimeout(p,0),m}loadResources(a,s=Zl){let l=s;const u=Ae(a)?a:this.language;if(typeof a=="function"&&(l=a),!this.options.resources||this.options.partialBundledLanguages){if(u?.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return l();const f=[],h=m=>{if(!m||m==="cimode")return;this.services.languageUtils.toResolveHierarchy(m).forEach(y=>{y!=="cimode"&&f.indexOf(y)<0&&f.push(y)})};u?h(u):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(p=>h(p)),this.options.preload?.forEach?.(m=>h(m)),this.services.backendConnector.load(f,this.options.ns,m=>{!m&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),l(m)})}else l(null)}reloadResources(a,s,l){const u=bs();return typeof a=="function"&&(l=a,a=void 0),typeof s=="function"&&(l=s,s=void 0),a||(a=this.languages),s||(s=this.options.ns),l||(l=Zl),this.services.backendConnector.reload(a,s,f=>{u.resolve(),l(f)}),u}use(a){if(!a)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!a.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return a.type==="backend"&&(this.modules.backend=a),(a.type==="logger"||a.log&&a.warn&&a.error)&&(this.modules.logger=a),a.type==="languageDetector"&&(this.modules.languageDetector=a),a.type==="i18nFormat"&&(this.modules.i18nFormat=a),a.type==="postProcessor"&&ex.addPostProcessor(a),a.type==="formatter"&&(this.modules.formatter=a),a.type==="3rdParty"&&this.modules.external.push(a),this}setResolvedLanguage(a){if(!(!a||!this.languages)&&!(["cimode","dev"].indexOf(a)>-1)){for(let s=0;s<this.languages.length;s++){const l=this.languages[s];if(!(["cimode","dev"].indexOf(l)>-1)&&this.store.hasLanguageSomeTranslations(l)){this.resolvedLanguage=l;break}}!this.resolvedLanguage&&this.languages.indexOf(a)<0&&this.store.hasLanguageSomeTranslations(a)&&(this.resolvedLanguage=a,this.languages.unshift(a))}}changeLanguage(a,s){this.isLanguageChangingTo=a;const l=bs();this.emit("languageChanging",a);const u=m=>{this.language=m,this.languages=this.services.languageUtils.toResolveHierarchy(m),this.resolvedLanguage=void 0,this.setResolvedLanguage(m)},f=(m,p)=>{p?this.isLanguageChangingTo===a&&(u(p),this.translator.changeLanguage(p),this.isLanguageChangingTo=void 0,this.emit("languageChanged",p),this.logger.log("languageChanged",p)):this.isLanguageChangingTo=void 0,l.resolve((...y)=>this.t(...y)),s&&s(m,(...y)=>this.t(...y))},h=m=>{!a&&!m&&this.services.languageDetector&&(m=[]);const p=Ae(m)?m:m&&m[0],y=this.store.hasLanguageSomeTranslations(p)?p:this.services.languageUtils.getBestMatchFromCodes(Ae(m)?[m]:m);y&&(this.language||u(y),this.translator.language||this.translator.changeLanguage(y),this.services.languageDetector?.cacheUserLanguage?.(y)),this.loadResources(y,C=>{f(C,y)})};return!a&&this.services.languageDetector&&!this.services.languageDetector.async?h(this.services.languageDetector.detect()):!a&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(h):this.services.languageDetector.detect(h):h(a),l}getFixedT(a,s,l){const u=(f,h,...m)=>{let p;typeof h!="object"?p=this.options.overloadTranslationOptionHandler([f,h].concat(m)):p={...h},p.lng=p.lng||u.lng,p.lngs=p.lngs||u.lngs,p.ns=p.ns||u.ns,p.keyPrefix!==""&&(p.keyPrefix=p.keyPrefix||l||u.keyPrefix);const y=this.options.keySeparator||".";let C;return p.keyPrefix&&Array.isArray(f)?C=f.map(x=>(typeof x=="function"&&(x=yd(x,{...this.options,...h})),`${p.keyPrefix}${y}${x}`)):(typeof f=="function"&&(f=yd(f,{...this.options,...h})),C=p.keyPrefix?`${p.keyPrefix}${y}${f}`:f),this.t(C,p)};return Ae(a)?u.lng=a:u.lngs=a,u.ns=s,u.keyPrefix=l,u}t(...a){return this.translator?.translate(...a)}exists(...a){return this.translator?.exists(...a)}setDefaultNamespace(a){this.options.defaultNS=a}hasLoadedNamespace(a,s={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const l=s.lng||this.resolvedLanguage||this.languages[0],u=this.options?this.options.fallbackLng:!1,f=this.languages[this.languages.length-1];if(l.toLowerCase()==="cimode")return!0;const h=(m,p)=>{const y=this.services.backendConnector.state[`${m}|${p}`];return y===-1||y===0||y===2};if(s.precheck){const m=s.precheck(this,h);if(m!==void 0)return m}return!!(this.hasResourceBundle(l,a)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||h(l,a)&&(!u||h(f,a)))}loadNamespaces(a,s){const l=bs();return this.options.ns?(Ae(a)&&(a=[a]),a.forEach(u=>{this.options.ns.indexOf(u)<0&&this.options.ns.push(u)}),this.loadResources(u=>{l.resolve(),s&&s(u)}),l):(s&&s(),Promise.resolve())}loadLanguages(a,s){const l=bs();Ae(a)&&(a=[a]);const u=this.options.preload||[],f=a.filter(h=>u.indexOf(h)<0&&this.services.languageUtils.isSupportedCode(h));return f.length?(this.options.preload=u.concat(f),this.loadResources(h=>{l.resolve(),s&&s(h)}),l):(s&&s(),Promise.resolve())}dir(a){if(a||(a=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!a)return"rtl";try{const u=new Intl.Locale(a);if(u&&u.getTextInfo){const f=u.getTextInfo();if(f&&f.direction)return f.direction}}catch{}const s=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],l=this.services?.languageUtils||new Tg(Xu());return a.toLowerCase().indexOf("-latn")>1?"ltr":s.indexOf(l.getLanguagePartFromCode(a))>-1||a.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(a={},s){const l=new Ts(a,s);return l.createInstance=Ts.createInstance,l}cloneInstance(a={},s=Zl){const l=a.forkResourceStore;l&&delete a.forkResourceStore;const u={...this.options,...a,isClone:!0},f=new Ts(u);if((a.debug!==void 0||a.prefix!==void 0)&&(f.logger=f.logger.clone(a)),["store","services","language"].forEach(m=>{f[m]=this[m]}),f.services={...this.services},f.services.utils={hasLoadedNamespace:f.hasLoadedNamespace.bind(f)},l){const m=Object.keys(this.store.data).reduce((p,y)=>(p[y]={...this.store.data[y]},p[y]=Object.keys(p[y]).reduce((C,x)=>(C[x]={...p[y][x]},C),p[y]),p),{});f.store=new kg(m,u),f.services.resourceStore=f.store}if(a.interpolation){const p={...Xu().interpolation,...this.options.interpolation,...a.interpolation},y={...u,interpolation:p};f.services.interpolator=new Og(y)}return f.translator=new ur(f.services,u),f.translator.on("*",(m,...p)=>{f.emit(m,...p)}),f.init(u,s),f.translator.options=u,f.translator.backendConnector.services.utils={hasLoadedNamespace:f.hasLoadedNamespace.bind(f)},f}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const ct=Ts.createInstance();ct.createInstance;ct.dir;ct.init;ct.loadResources;ct.reloadResources;ct.use;ct.changeLanguage;ct.getFixedT;ct.t;ct.exists;ct.setDefaultNamespace;ct.hasLoadedNamespace;ct.loadNamespaces;ct.loadLanguages;const bw=(n,a,s,l)=>{const u=[s,{code:a,...l||{}}];if(n?.services?.logger?.forward)return n.services.logger.forward(u,"warn","react-i18next::",!0);Ni(u[0])&&(u[0]=`react-i18next:: ${u[0]}`),n?.services?.logger?.warn?n.services.logger.warn(...u):console?.warn&&console.warn(...u)},Lg={},ax=(n,a,s,l)=>{Ni(s)&&Lg[s]||(Ni(s)&&(Lg[s]=new Date),bw(n,a,s,l))},ix=(n,a)=>()=>{if(n.isInitialized)a();else{const s=()=>{setTimeout(()=>{n.off("initialized",s)},0),a()};n.on("initialized",s)}},xd=(n,a,s)=>{n.loadNamespaces(a,ix(n,s))},_g=(n,a,s,l)=>{if(Ni(s)&&(s=[s]),n.options.preload&&n.options.preload.indexOf(a)>-1)return xd(n,s,l);s.forEach(u=>{n.options.ns.indexOf(u)<0&&n.options.ns.push(u)}),n.loadLanguages(a,ix(n,l))},Sw=(n,a,s={})=>!a.languages||!a.languages.length?(ax(a,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:a.languages}),!0):a.hasLoadedNamespace(n,{lng:s.lng,precheck:(l,u)=>{if(s.bindI18n&&s.bindI18n.indexOf("languageChanging")>-1&&l.services.backendConnector.backend&&l.isLanguageChangingTo&&!u(l.isLanguageChangingTo,n))return!1}}),Ni=n=>typeof n=="string",Cw=n=>typeof n=="object"&&n!==null,ww=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,Nw={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},Aw=n=>Nw[n],kw=n=>n.replace(ww,Aw);let vd={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:kw,transDefaultProps:void 0};const jw=(n={})=>{vd={...vd,...n}},Tw=()=>vd;let ox;const Mw=n=>{ox=n},Dw=()=>ox,Ew={type:"3rdParty",init(n){jw(n.options.react),Mw(n)}},Ow=S.createContext();class Rw{constructor(){this.usedNamespaces={}}addUsedNamespaces(a){a.forEach(s=>{this.usedNamespaces[s]||(this.usedNamespaces[s]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}var Zu={exports:{}},Ju={};var zg;function Pw(){if(zg)return Ju;zg=1;var n=Td();function a(x,b){return x===b&&(x!==0||1/x===1/b)||x!==x&&b!==b}var s=typeof Object.is=="function"?Object.is:a,l=n.useState,u=n.useEffect,f=n.useLayoutEffect,h=n.useDebugValue;function m(x,b){var N=b(),w=l({inst:{value:N,getSnapshot:b}}),T=w[0].inst,E=w[1];return f(function(){T.value=N,T.getSnapshot=b,p(T)&&E({inst:T})},[x,N,b]),u(function(){return p(T)&&E({inst:T}),x(function(){p(T)&&E({inst:T})})},[x]),h(N),N}function p(x){var b=x.getSnapshot;x=x.value;try{var N=b();return!s(x,N)}catch{return!0}}function y(x,b){return b()}var C=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?y:m;return Ju.useSyncExternalStore=n.useSyncExternalStore!==void 0?n.useSyncExternalStore:C,Ju}var Ug;function Lw(){return Ug||(Ug=1,Zu.exports=Pw()),Zu.exports}var _w=Lw();const zw=(n,a)=>Ni(a)?a:Cw(a)&&Ni(a.defaultValue)?a.defaultValue:Array.isArray(n)?n[n.length-1]:n,Uw={t:zw,ready:!1},Iw=()=>()=>{},_t=(n,a={})=>{const{i18n:s}=a,{i18n:l,defaultNS:u}=S.useContext(Ow)||{},f=s||l||Dw();f&&!f.reportNamespaces&&(f.reportNamespaces=new Rw),f||ax(f,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const h=S.useMemo(()=>({...Tw(),...f?.options?.react,...a}),[f,a]),{useSuspense:m,keyPrefix:p}=h,y=u||f?.options?.defaultNS,C=Ni(y)?[y]:y||["translation"],x=S.useMemo(()=>C,C);f?.reportNamespaces?.addUsedNamespaces?.(x);const b=S.useRef(0),N=S.useCallback(F=>{if(!f)return Iw;const{bindI18n:Q,bindI18nStore:ae}=h,te=()=>{b.current+=1,F()};return Q&&f.on(Q,te),ae&&f.store.on(ae,te),()=>{Q&&Q.split(" ").forEach(ye=>f.off(ye,te)),ae&&ae.split(" ").forEach(ye=>f.store.off(ye,te))}},[f,h]),w=S.useRef(),T=S.useCallback(()=>{if(!f)return Uw;const F=!!(f.isInitialized||f.initializedStoreOnce)&&x.every(Ce=>Sw(Ce,f,h)),Q=a.lng||f.language,ae=b.current,te=w.current;if(te&&te.ready===F&&te.lng===Q&&te.keyPrefix===p&&te.revision===ae)return te;const de={t:f.getFixedT(Q,h.nsMode==="fallback"?x:x[0],p),ready:F,lng:Q,keyPrefix:p,revision:ae};return w.current=de,de},[f,x,p,h,a.lng]),[E,M]=S.useState(0),{t:H,ready:B}=_w.useSyncExternalStore(N,T,T);S.useEffect(()=>{if(f&&!B&&!m){const F=()=>M(Q=>Q+1);a.lng?_g(f,a.lng,x,F):xd(f,x,F)}},[f,a.lng,x,B,m,E]);const U=f||{},O=S.useRef(null),A=S.useRef(),_=F=>{const Q=Object.getOwnPropertyDescriptors(F);Q.__original&&delete Q.__original;const ae=Object.create(Object.getPrototypeOf(F),Q);if(!Object.prototype.hasOwnProperty.call(ae,"__original"))try{Object.defineProperty(ae,"__original",{value:F,writable:!1,enumerable:!1,configurable:!1})}catch{}return ae},W=S.useMemo(()=>{const F=U,Q=F?.language;let ae=F;F&&(O.current&&O.current.__original===F?A.current!==Q?(ae=_(F),O.current=ae,A.current=Q):ae=O.current:(ae=_(F),O.current=ae,A.current=Q));const te=[H,ae,B];return te.t=H,te.i18n=ae,te.ready=B,te},[H,U,B,U.resolvedLanguage,U.language,U.languages]);if(f&&m&&!B)throw new Promise(F=>{const Q=()=>F();a.lng?_g(f,a.lng,x,Q):xd(f,x,Q)});return W},sx="ccs-ui-locale",Hw=["en","zh-CN","vi"];function zs(n){return n?n.toLowerCase().startsWith("zh")?"zh-CN":n.toLowerCase().startsWith("vi")?"vi":"en":"en"}function lx(){if(typeof window>"u")return null;try{const n=window.localStorage.getItem(sx);return n?zs(n):null}catch{return null}}function Bw(){const n=lx();return n||(typeof navigator<"u"?zs(navigator.language):"en")}function Ld(n){const a=lx();return a||(typeof navigator<"u"?zs(navigator.language):"en")}function Kw(n){const a=zs(n);if(typeof window<"u")try{window.localStorage.setItem(sx,a)}catch{}return a}const qw={en:{translation:{locale:{en:"English","zh-CN":"Simplified Chinese",vi:"Vietnamese"},layout:{languageSwitcher:"Language"},nav:{general:"General",home:"Home",analytics:"Analytics",identityAccess:"Identity & Access",apiProfiles:"API Profiles",cliproxyPlus:"CLIProxy Plus",cliproxyOverview:"Overview",controlPanel:"Control Panel",githubCopilot:"GitHub Copilot",cursorIde:"Cursor IDE",accounts:"Accounts",allAccounts:"All Accounts",sharedData:"Shared Data",compatibleClis:"Compatible CLIs",factoryDroid:"Factory Droid",system:"System",health:"Health",settings:"Settings",openrouterTooltip:"Featured: OpenRouter + Alibaba Coding Plan + Ollama"},home:{profiles:"Profiles",cliproxy:"CLIProxy",accounts:"Accounts",health:"Health",configurationRequired:"Configuration Required"},auth:{dashboardTitle:"CCS Dashboard",loginDescription:"Enter your credentials to access the dashboard",username:"Username",password:"Password",usernamePlaceholder:"Enter username",passwordPlaceholder:"Enter password",signIn:"Sign In",signingIn:"Signing in...",loginFailed:"Login failed"},commonToast:{apiKeyRequired:"API key is required",accountAddedPresetFailed:"Account added, but failed to apply default preset",settingsCopied:"Settings copied to clipboard",enterPresetName:"Please enter a preset name to save",codeCopied:"Code copied to clipboard",copyCodeFailed:"Failed to copy code",appliedModelAllTiers:"Applied model to all tiers",settingsSaved:"Settings saved",defaultTargetUpdated:"Default target updated",failedUpdateDefaultTarget:"Failed to update default target to {{target}}{{suffix}}"},profileDialog:{editTitle:"Edit Profile",createTitle:"Create API Profile",name:"Name",namePlaceholder:"my-api",baseUrl:"Base URL",baseUrlPlaceholder:"https://api.example.com",apiKey:"API Key",defaultModel:"Default Model (ANTHROPIC_MODEL)",defaultModelHint:"Leave blank to use: {{model}}",modelMappingTitle:"Model Mapping (Opus/Sonnet/Haiku)",modelMappingDesc:"Configure different model IDs for each tier. Useful for API proxies that route different model types to different backends.",opusModel:"Opus Model (ANTHROPIC_DEFAULT_OPUS_MODEL)",sonnetModel:"Sonnet Model (ANTHROPIC_DEFAULT_SONNET_MODEL)",haikuModel:"Haiku Model (ANTHROPIC_DEFAULT_HAIKU_MODEL)",cancel:"Cancel",saving:"Saving...",update:"Update",create:"Create"},modelTierMapping:{title:"Model Tier Mapping",advanced:"Advanced",description:"Configure different models for Claude Code's opus/sonnet/haiku tiers.",autoSuggest:"Auto-suggest based on {{provider}}",opusPlaceholder:"e.g., anthropic/claude-opus-4",sonnetPlaceholder:"e.g., anthropic/claude-sonnet-4",haikuPlaceholder:"e.g., anthropic/claude-3.5-haiku",footer:"These set ANTHROPIC_DEFAULT_OPUS_MODEL, ANTHROPIC_DEFAULT_SONNET_MODEL, ANTHROPIC_DEFAULT_HAIKU_MODEL."},envEditor:{sensitive:"sensitive",none:"No environment variables configured.",noneHint:"Add variables using the input below or edit the JSON directly.",addVariable:"Add Environment Variable",keyPlaceholder:"VARIABLE_NAME",valuePlaceholder:"value"},setupVariant:{using:"Using:",variantNameRequired:"Variant Name *",variantNamePlaceholder:"e.g., my-gemini, g3, flash",invokeHintPrefix:"Use this name to invoke:",model:"Model",modelPlaceholder:"e.g., gemini-2.5-pro, claude-opus-4-6-thinking",choosePresetInstead:"Choose from presets instead",selectModel:"Select a model",customModelName:"Custom model name...",enterAnyModel:"Enter any model name supported by CLIProxy",defaultModel:"Default: {{model}}",providerDefault:"provider default",back:"Back",skip:"Skip",creating:"Creating...",createVariant:"Create Variant",skipHint:"Skip if you just wanted to add an account without creating a variant"},customPresetDialog:{title:"Custom Preset",presetNameOptional:"Preset Name (optional)",presetNamePlaceholder:"e.g., My Custom Config",codexTipPrefix:"Codex tip: suffixes",codexTipSuffix:"pin effort. Unsuffixed models use Thinking settings.",defaultModel:"Default Model",defaultModelDesc:"Used when no specific tier is requested",opusModel:"Opus (Most capable)",opusModelDesc:"For complex reasoning tasks",sonnetModel:"Sonnet (Balanced)",sonnetModelDesc:"Balance of speed and capability",haikuModel:"Haiku (Fast)",haikuModelDesc:"Quick responses for simple tasks",cancel:"Cancel",savePreset:"Save Preset",applyPreset:"Apply Preset"},componentModelSelector:{selectModel:"Select model",availableModelsCount:"Available Models ({{count}})",preview:"Preview"},copilotSettings:{enableCopilot:"Enable Copilot",enableCopilotDesc:"Allow using GitHub Copilot subscription",basicSettings:"Basic Settings",accountType:"Account Type",accountTypeIndividual:"Individual",accountTypeBusiness:"Business",accountTypeEnterprise:"Enterprise",rateLimiting:"Rate Limiting",rateLimitSeconds:"Rate Limit (seconds)",noLimit:"No limit",waitOnRateLimit:"Wait on Rate Limit",waitOnRateLimitDesc:"Wait instead of error when limit hit",daemonSettings:"Daemon Settings",autoStartDaemon:"Auto-start Daemon",autoStartDaemonDesc:"Start copilot-api when using profile"},providerModelSelector:{selectModel:"Select model",noModelsForProvider:"No models available for this provider",broken:"BROKEN",deprecated:"DEPRECATED",paid:"PAID",freeTier:"Free Tier",paidTier:"Paid Tier",modelKnownIssues:"This model has known issues",viewIssueDetails:"View issue details",modelDeprecated:"This model is deprecated",recommended:"Recommended",allModelsCount:"All Models ({{count}})",noModelsAvailable:"No models available"},createAuthProfileDialog:{title:"Create New Account",description:"Auth profiles require Claude CLI login. Run the command below in your terminal. You can edit sync mode, group, and continuity depth later from the Accounts table.",profileName:"Profile Name",profileNamePlaceholder:"e.g., work, personal, client",invalidProfileName:"Name must start with a letter and contain only letters, numbers, dashes, or underscores.",enableSharedHistory:"Enable shared history sync with other ccs auth accounts",historySyncGroupOptional:"History Sync Group (optional)",historySyncGroupPlaceholder:"default, sprint-a, client-x",historySyncGroupHint:"Leave empty to use the default shared group. Spaces are normalized to dashes.",deeperContinuity:"Advanced: deeper continuity mode",deeperContinuityHint:"Adds sync for session-env, file-history, shell-snapshots, and todos. Credentials stay isolated.",invalidContextGroup:"Group must start with a letter and use only letters, numbers, dashes, or underscores (max {{max}} chars).",command:"Command",commandFallback:"ccs auth create <name>",afterRunPrefix:"After running the command:",afterRunStep1:"Complete the Claude login in your browser",afterRunStep2:"Return here and refresh to see the new account",poolingHint:"Prefer pooled Claude OAuth routing instead? Use CLIProxy Claude pool from the Accounts page action button.",close:"Close",copied:"Copied!",copyCommand:"Copy Command"},cliproxyModelCategory:{google:"Google (Gemini)",openai:"OpenAI (GPT)",anthropic:"Anthropic (Claude)",antigravity:"Antigravity",other:"Other"},cliproxyOverviewComponents:{availableModels:"Available Models",noModelsAvailable:"No models available",startSessionHint:"Start a CLIProxy session to fetch available models",totalCount:"{{count}} total",availableThroughGroupedByProvider:"Models available through {{backendLabel}}, grouped by provider",moreCount:"+{{count}} more"},categorizedModelSelector:{selectModel:"Select a model",noModelsAvailable:"No models available",modelPlaceholder:"Model..."},openrouterQuickStart:{recommended:"Recommended",title:"Start with OpenRouter",description:"Access {{modelCountLabel}} models from OpenAI, Anthropic, Google, Meta and more - all through one API.",featureOneApi:"One API, all providers",featureTierMapping:"Model tier mapping",createOpenRouterProfile:"Create OpenRouter Profile",getApiKeyAt:"Get your API key at",or:"or",createCustomProfile:"Create Custom API Profile"},alibabaCodingPlanQuickStart:{recommended:"Recommended",title:"Try Alibaba Coding Plan",description:"Use Alibaba Cloud Coding Plan through an Anthropic-compatible endpoint for coding workloads.",featureEndpoint:"Anthropic-compatible endpoint",featureKeyFormat:"Dedicated sk-sp API keys",createAlibabaProfile:"Create Alibaba Coding Plan Profile",readGuideAt:"Read setup guide at"},alibabaCodingPlanPromo:{title:"Alibaba Coding Plan",subtitle:"Model Studio Coding Plan via Anthropic endpoint",add:"Add"},credentialHealth:{title:"Credential Health",ready:"Ready",noCredentialsConfigured:"No credentials configured. Use the login buttons above to authenticate.",neverUsed:"Never used",justNow:"Just now",unknown:"Unknown",daysAgo:"{{count}}d ago",hoursAgo:"{{count}}h ago",minutesAgo:"{{count}}m ago"},proxyStatusWidget:{justNow:"just now",minutesAgo:"{{count}}m ago",hoursAgo:"{{count}}h ago",syncReady:"Sync Ready",noConfig:"No Config",remoteProxy:"Remote Proxy",active:"Active",trafficAutoRouted:"Traffic auto-routed to remote server",tooltipSync:"Sync profiles to CLIProxy",tooltipRestart:"Restart",tooltipStop:"Stop",tooltipClose:"Close",tooltipVersionSettings:"Version settings",versionManagement:"Version Management",selectVersionPlaceholder:"Select version to install...",stable:"(stable)",install:"Install",versionsAboveUnstable:"Versions above {{version}} have known issues",versionsKnownIssues:"Version {{version}} has known issues",lastChecked:"Last checked {{time}}",notRunning:"Not running",start:"Start",port:"Port {{port}}",sessionCount:"{{count}} session",sessionCount_other:"{{count}} sessions",installFaultyTitle:"Install Version With Known Issues?",installFaultyDesc:"You are about to install <strong>v{{version}}</strong>, which falls inside the known faulty range <strong>{{range}}</strong>.",installFaultyWarning:"This version has known bugs and may fail or leave the proxy in a bad state.",installUnstableTitle:"Install Unstable Version?",installUnstableDesc:"You are about to install <strong>v{{version}}</strong>, which is above the maximum stable version <strong>v{{maxStable}}</strong>.",installUnstableWarning:"This version has known stability issues and may cause unexpected behavior.",installUnstableConfirm:"Are you sure you want to proceed?",cancel:"Cancel",installAnyway:"Install Anyway",clickToDowngrade:"Click to downgrade",clickToUpdate:"Click to update"},syncStatusCard:{profileSync:"Profile Sync",ready:"Ready",noConfig:"No Config",syncsProfilesDesc:"Syncs API profiles to local CLIProxy config",runDoctorHint:"Run <code>ccs doctor --fix</code> to generate config.",details:"Details",syncNow:"Sync Now"},syncDialog:{title:"Sync Profiles to Local CLIProxy",description:"Sync your CCS API profiles to the local CLIProxy config.yaml.",noProfiles:"No profiles configured to sync.",createProfilesFirst:"Create API profiles first using the Profiles tab.",modelLabel:"Model:",ready:"Ready",profilesToSync_one:"{{count}} profile to sync",profilesToSync_other:"{{count}} profiles to sync",cancel:"Cancel",syncing:"Syncing...",synced:"Synced!",syncNow:"Sync Now"},errorLogs:{title:"Error Logs",failedRequests_one:"{{count}} failed request",failedRequests_other:"{{count}} failed requests",cliproxyDiagnostics:"CLIProxy Diagnostics",showingCount:"Showing 50 of {{total}} logs",selectLog:"Select a log to view details",failedLoadContent:"Failed to load log content",copyAbsolutePath:"Copy absolute path",copyRawContent:"Copy raw log content",tabOverview:"Overview",tabHeaders:"Headers",tabRequest:"Request",tabResponse:"Response",tabRaw:"Raw",modelLabel:"Model:",quotaResetsIn:"Quota resets in ",method:"Method",provider:"Provider",version:"Version",endpoint:"Endpoint",url:"URL",timestamp:"Timestamp",na:"N/A",noHeaders:"No headers available",noRequestBody:"No request body",noResponseBody:"No response body",rateLimitedMsg:"Rate Limited. Switch to a different account or wait for quota reset. Model {{model}} has exhausted quota.",rateLimitedMsgNoModel:"Rate Limited. Switch to a different account or wait for quota reset.",authFailedMsg:"Authentication failed. Re-authenticate via CLIProxy Settings or check API key.",notFoundMsg:"Endpoint not found. This endpoint may not exist on this provider.",serverErrorMsg:"Server error from upstream. Retry later or check provider status page.",timeoutMsg:"Request timed out. Check network connection or increase timeout settings.",unknown:"unknown"},editAccountContext:{title:"Edit History Sync",description:'Configure how "{{name}}" shares history and continuity with other ccs auth accounts.',syncMode:"Sync Mode",selectContextMode:"Select context mode",isolatedOption:"isolated (no sync)",sharedOption:"shared (sync enabled)",sharedModeHint:"Shared mode reuses workspace context for accounts in the same history sync group.",isolatedModeHint:"Isolated mode keeps this account fully separate from other ccs auth accounts.",historySyncGroup:"History Sync Group",groupPlaceholder:"default",groupHint:"Normalized to lowercase (spaces become dashes). Allowed: letters, numbers, _ , - (max {{max}} chars).",invalidGroup:"Enter a valid group name that starts with a letter.",continuityDepth:"Continuity Depth",selectContinuityDepth:"Select continuity depth",standardOption:"standard (projects only)",deeperOption:"deeper continuity (advanced)",deeperHint:"Advanced mode also syncs session-env, file-history, shell-snapshots, and todos.",standardHint:"Standard mode syncs project workspace context only.",credentialsIsolated:"Credentials and .anthropic remain isolated per account in all modes.",cancel:"Cancel",save:"Save",saving:"Saving..."},historySyncLearningMap:{title:"How History Sync Works",description:"Isolated -> Shared -> Deeper. Use Sync per row for all changes.",learningMap:"Learning Map",isolated:"Isolated",shared:"Shared",deeper:"Deeper",cliproxyManaged_one:"{{count}} CLIProxy Claude pool account is managed in Action Center / CLIProxy page.",cliproxyManaged_other:"{{count}} CLIProxy Claude pool accounts are managed in Action Center / CLIProxy page.",showDetails:"Show details: groups, switching, and legacy policy",modeSwitch:"Mode Switch",modeSwitchDesc:"Sync dialog lets users move between isolated/shared and choose deeper continuity.",historySyncGroup:"History Sync Group",historySyncGroupDesc:"Same group means shared project context lane. Default fallback is default."},accountsTable:{name:"Name",type:"Type",defaultBadge:"default",created:"Created",lastUsed:"Last Used",historySync:"History Sync",actions:"Actions",syncTitle:"Edit sync mode, group, and continuity depth",confirmLegacyTitle:"Confirm this legacy account's current mode as explicit",sync:"Sync",confirm:"Confirm",active:"Active",setDefault:"Set Default",deleteAccount:"Delete account",cannotDeleteDefault:"Cannot delete default account",noAccounts:"No CCS auth accounts found. Use ccs auth create to add accounts.",resetToDefault:"Reset to CCS Default",deleteDialogTitle:"Delete Account",deleteDialogDesc:'Are you sure you want to delete the account "{{name}}"? This will remove the profile and all its session data. This action cannot be undone.',cancel:"Cancel",delete:"Delete",sharedGroupStandard:"shared ({{group}}, standard)",sharedGroupDeeper:"shared ({{group}}, deeper)",sharedGroupLegacy:"shared ({{group}}, standard legacy)",isolatedLegacy:"isolated (legacy default)",isolated:"isolated"},addAccountDialog:{title:"Add {{displayName}} Account",descKiro:"Choose a Kiro auth method, then authenticate via browser or import from Kiro IDE.",descDeviceCode:"Click Authenticate. A verification code will appear for you to enter on the provider website.",descOauth:"Click Authenticate to get an OAuth URL. Open it in any browser to sign in.",powerUserEnabled:"Power user mode enabled",powerUserSkipped:"AGY responsibility checklist is skipped from Settings > Proxy. You accept full responsibility for OAuth/account risk.",authMethod:"Auth Method",selectKiroAuthMethod:"Select Kiro auth method",nicknameRequired:"Nickname (required)",nicknameOptional:"Nickname (optional)",nicknamePlaceholder:"e.g., work, personal",nicknameRequiredHint:"Required for this provider. Use a unique friendly name (e.g., work, personal).",nicknameOptionalHint:"A friendly name to identify this account. Auto-generated from email if left empty.",waitingForAuth:"Waiting for authentication...",deviceCodeHint:"A verification code dialog will appear shortly. Enter the code on the provider website.",browserHint:"Complete the authentication in your browser. This dialog closes automatically.",openUrlLabel:"Open this URL in any browser to sign in:",copied:"Copied",copy:"Copy",open:"Open",popupBlocked:"Popup blocked. Copy the URL above and open it manually in your browser.",redirectPasteLabel:"Redirect didn't work? Paste the callback URL:",callbackPlaceholder:"Paste the redirect URL here...",submitCallback:"Submit Callback",submitting:"Submitting...",preparingUrl:"Preparing sign-in URL...",cancel:"Cancel",importingToken:"Importing token from Kiro IDE...",authenticate:"Authenticate",importFromIde:"Import from IDE",importing:"Importing..."},flowViz:{backToProviders:"Back to providers",showDetails:"Show Details",hideDetails:"Hide Details",resetLayout:"Reset layout",provider:"Provider",totalRequests:"Total Requests",accounts:"Accounts",connectionTimeline:"Connection Timeline",noRecentConnections:"No recent connections"},quickStats:{totalRequests:"Total Requests",successRate:"Success Rate",totalTokens:"Total Tokens",activeModels:"Active Models"},authMonitor:{accounts:"Accounts",accountsCount:"{{count}} accounts",success:"Success",failed:"Failed",successRate:"Success Rate"},accountCard:{resumeAccount:"Resume account",pauseAccount:"Pause account",quotaLoading:"Quota...",quota:"Quota",quotaUnavailable:"Quota limits unavailable",reauthNeeded:"Reauth needed",removeAndReadd:"Remove and re-add account",autoRefreshFailed:"Auto-refresh failed"},antigravityChecklist:{title:"Antigravity OAuth Responsibility",subtitle:"Complete all 4 steps before you can authenticate.",mandatory:"Mandatory",completion:"Completion",stepsCount:"{{current}}/4 steps"},accountSafetyWarning:{title:"OAuth Account Safety Warning",subtitle:"Issue #509 · Gemini + AGY OAuth risk",firstLine:"Issue #509 documents suspension/ban reports tied to ccs agy and shared-account usage between ccs gemini and ccs agy.",secondLine:"Continue only if you accept full responsibility for OAuth and account-access risk.",issueLabel:"Read issue #509",proxySettingsLabel:"Gemini + AGY controls: Settings > Proxy"},cliproxyDialog:{name:"Name",provider:"Provider",account:"Account",accountOptional:"Account (optional)",model:"Model",modelOptional:"Model (optional)",defaultTarget:"Default Target",defaultTier:"Default Tier",tierConfig:"Tier Configuration",selectProvider:"Select provider...",useDefaultAccount:"Use default account",defaultSuffix:"(default)",opus:"Opus",sonnet:"Sonnet",haiku:"Haiku",claudeCode:"Claude Code",factoryDroid:"Factory Droid",cancel:"Cancel",create:"Create",creating:"Creating...",saveChanges:"Save Changes",saving:"Saving...",placeholderName:"my-gemini",placeholderModel:"gemini-2.5-pro",placeholderComposite:"my-composite",placeholderModelId:"model-id",placeholderAccountId:"account-id",editCompositeTitle:"Edit Composite Variant: {{name}}",editSingleTitle:"Edit Single Variant: {{name}}"},profileEditor:{profileInfo:"Profile Information",profileName:"Profile Name",filePath:"File Path",lastModified:"Last Modified",defaultTarget:"Default Target",quickUsage:"Quick Usage",runWithProfile:"Run with profile",runOnDroid:"Run on Droid",droidAliasExplicit:"Droid alias (explicit)",overrideToClaude:"Override to Claude",overrideToClaudeExplicit:"Override to Claude (explicit)",setAsDefault:"Set as default",provider:"Provider",custom:"Custom"},settings:{sectionLoadFailed:"Failed to load section",unknownError:"Unknown error occurred",reloadPage:"Reload page",refresh:"Refresh",copy:"Copy",copied:"Copied",saved:"Saved",loading:"Loading...",configFileNotFound:"Config file not found"},settingsTabs:{web:"Web",env:"Env",think:"Think",proxy:"Proxy",auth:"Auth",backup:"Backup"},settingsAuth:{failedFetchTokens:"Failed to fetch auth tokens",failedSaveTokens:"Failed to save tokens",tokensUpdated:"Tokens updated. Restart CLIProxy to apply.",failedRegenerate:"Failed to regenerate secret",secretRegenerated:"New management secret generated. Restart CLIProxy to apply.",failedReset:"Failed to reset tokens",tokensReset:"Tokens reset to defaults. Restart CLIProxy to apply.",description:"Configure CLIProxy authentication tokens. Changes require CLIProxy restart.",apiKey:"API Key",custom:"Custom",apiKeyDesc:"Used by Claude Code to authenticate with CLIProxy",apiKeyPlaceholder:"API key",managementSecret:"Management Secret",managementSecretDesc:"Used by CCS dashboard to access CLIProxy management APIs",managementSecretPlaceholder:"Management secret",generateSecret:"Generate new secure secret",resetDefaults:"Reset to Defaults",resetDesc:"Resets both API key and management secret to their default values.",saving:"Saving...",save:"Save"},settingsGlobalEnv:{description:"Environment variables injected into all non-Claude subscription profiles (gemini, codex, agy, ghcp, etc.)",enabled:"Global Env enabled",disabled:"Global Env disabled",enabledDesc:"Env vars will be injected into third-party profiles",disabledDesc:"Env vars will not be injected",envVars:"Environment Variables",noneConfigured:"No environment variables configured",addNew:"Add New Variable",keyName:"KEY_NAME",value:"value",add:"Add",quickAdd:"Quick Add Common Variables",allConfigured:"All common variables are configured"},settingsBackups:{failedFetch:"Failed to fetch backups",failedRestore:"Failed to restore backup",restoreSuccess:"Backup restored successfully",title:"Settings Backups",description:"Restore previous versions of your settings.json file. Backups are created automatically when settings are modified.",none:"No backups available",noneHint:"Backups will appear here when you modify settings",latest:"Latest",restoring:"Restoring...",restore:"Restore",restoreConfirmTitle:"Restore Backup?",restoreConfirmPrefix:"This will replace your current settings with backup from",restoreConfirmSuffix:"This action cannot be undone.",cancel:"Cancel"},settingsWebsearch:{description:"CLI-based web search for third-party profiles (gemini, codex, agy, etc.)",enabled:"WebSearch enabled",disabled:"WebSearch disabled",checking:"Checking status...",providers:"Providers",noneConfigured:"No providers configured",noneConfiguredHint:"Install CLI tools to enable web search providers",checkProviders:"Check for providers",installed:"installed",notInstalled:"not installed",model:"Model:",howInstall:"How to install {{name}} CLI",installGlobally:"Install globally",requiresKey:"(requires xAI API key)",freeTier:"(FREE tier available)",viewDocs:"View documentation"},settingsProxy:{failedLoadAgyMode:"Failed to load AGY power user mode",failedUpdateAgyMode:"Failed to update AGY power user mode",failedVerifyAgyMode:"Failed to verify AGY power user mode persistence",notPersistedAgyMode:"AGY power user mode was not persisted. Config may have been modified by another process.",agyModeEnabled:"AGY power user mode enabled.",agyModeDisabled:"AGY power user mode disabled.",typePhraseToContinue:'Type "{{value}}" to continue.',description:"Configure local or remote {{backend}} connection for proxy-based profiles",backendPlus:"CLIProxy Plus",backend:"CLIProxy",instanceStatus:"Instance Status",connectionMode:"Connection Mode",local:"Local",remote:"Remote",localDesc:"Run {{backend}} binary on this machine",remoteDesc:"Connect to a remote {{backend}} server",backendBinary:"Backend Binary",stopProxyToSwitch:"Stop the running proxy in Instance Status to switch backend.",default:"Default",plusDesc:"Full provider support including Kiro and GitHub Copilot",originalDesc:"Original binary (Gemini, Codex, Antigravity only)",variantsIncompatible:"Existing Kiro/Copilot variants will not work with CLIProxyAPI. Switch to CLIProxyAPIPlus or remove those variants.",safety:"Safety",agyModeTitle:"Antigravity Power User Mode",agyModeDesc:"Skip AGY responsibility checklist in Add Account and `ccs agy` flows.",agyWarning:"Use only if you fully understand the OAuth suspension/ban risk pattern (#509). CCS cannot assume responsibility for account loss.",finalConfirm:"Final confirmation required",finalConfirmDesc:"Enabling this will skip AGY safety checkpoints in both dashboard and CLI. Review issue #509 and type the exact phrase to proceed.",step1:"Step 1",readIssue:"Read issue #509",step2:"Step 2",typePrefix:"Type",typeSuffix:"to enable.",typePhraseAria:"Type I ACCEPT RISK to enable Antigravity power user mode",exactPhrase:"Exact phrase required.",enableAgyMode:"Enable Power User Mode",toggleAgyMode:"Toggle AGY power user mode",fallbackSettings:"Fallback Settings",enableFallback:"Enable fallback to local",enableFallbackDesc:"Use local proxy if remote is unreachable",autoStartLocal:"Auto-start local proxy",autoStartLocalDesc:"Automatically start local proxy on fallback",advanced:"Advanced",debugMode:"Debug Mode",debugModeDesc:"Enable developer diagnostics in browser console",debugModeEnabled:"Debug mode enabled. Check browser console for detailed logs.",localProxy:"Local Proxy",port:"Port",autoStart:"Auto-start",localAutoStartDesc:"Start local proxy automatically when needed",remoteConfigTitle:"Remote Server Configuration",host:"Host",hostPlaceholder:"192.168.1.100 or proxy.example.com",defaultPort:"default: {{value}}",portPlaceholder:"Leave empty for {{value}}",protocol:"Protocol",http:"HTTP",https:"HTTPS",apiKeyOptional:"API Key (optional)",apiKeyPlaceholder:"For /v1/* API endpoints",apiKeyDesc:"Used for API requests to /v1/chat/completions",managementKeyOptional:"Management Key (optional)",managementKeyPlaceholder:"For /v0/management/* endpoints",managementKeyDesc:"Used for dashboard management APIs. Falls back to API Key if not set.",testing:"Testing...",testConnection:"Test Connection",connectedLatency:"Connected ({{value}}ms)",connectionFailed:"Connection failed",invalidPortOrEmpty:"Port must be an integer between 1 and 65535, or empty for default",invalidLocalPort:"Local port must be an integer between 1 and 65535",backendPlusApi:"CLIProxyAPIPlus",backendApi:"CLIProxyAPI"},settingsThinking:{description:"Configure extended thinking/reasoning for supported models.",supportedProviders:"Supported Providers",modeTitle:"Thinking Mode",modeAutoDesc:"Automatically set thinking based on model tier",modeOffDesc:"Disable extended thinking",modeManualDesc:"Set a persistent override level or use CLI flags per run",tierDefaults:"Tier Defaults",tierDefaultsDesc:"Default thinking level for each model tier when in auto mode.",persistentOverride:"Persistent Override",persistentOverrideDesc:"Applied to all sessions. CLI flags still take priority.",enterCustomBudget:"Enter custom budget",apply:"Apply",providerOverrides:"Provider Overrides ({{count}})",providerOverridesDesc:"Override tier defaults for specific providers. Add custom provider keys as needed.",addProviderPlaceholder:"Add provider key (e.g. qwen)",showWarnings:"Show Warnings",showWarningsDesc:"Display warnings when thinking values are clamped or adjusted",cliEnvOverride:"CLI & Env Override",supportLine1Prefix:"Thinking budget:",supportLine1Suffix:"(token-based)",supportLine2Prefix:"Reasoning effort:",supportLine2SuffixPrefix:"(suffix or ",supportLine2SuffixPostfix:": medium/high/xhigh)",supportLine3Prefix:"Codex suffixes pin effort (for example ",supportLine3Suffix:"); unsuffixed models use Thinking mode."},analytics:{title:"Analytics",subtitle:"Track usage and insights",month:"Month",allTime:"All Time",updated:"Updated {{value}}"},analyticsSummary:{totalTokens:"Total Tokens",totalTokensSubtitle:"{{input}} in / {{output}} out",totalCost:"Total Cost",totalCostSubtitle:"${{value}}/day avg",cacheTokens:"Cache Tokens",cacheTokensSubtitle:"${{cost}} ({{percent}}% of cost)",inputCost:"Input Cost",outputCost:"Output Cost",tokensSubtitle:"{{value}} tokens"},apiProfiles:{title:"API Profiles",new:"New",searchPlaceholder:"Search profiles...",loadingProfiles:"Loading profiles...",failedLoadTitle:"Failed to load profiles",failedLoadDesc:"Unable to fetch API profiles. Please try again.",retry:"Retry",noProfilesYet:"No API profiles yet",noProfilesDesc:"Create your first profile to connect to custom API endpoints",createProfile:"Create Profile",noProfileMatch:'No profiles match "{{query}}"',profileCount:"{{count}} profile",profileCount_other:"{{count}} profiles",configuredCount:"{{count}} configured",deleteProfileTitle:"Delete Profile",deleteProfileDesc:'Are you sure you want to delete "{{name}}"? This will remove the settings file and cannot be undone.',delete:"Delete",unsavedChangesTitle:"Unsaved Changes",unsavedChangesDesc:'You have unsaved changes in "{{current}}". Discard and switch to "{{next}}"?',discardSwitch:"Discard and Switch"},accountsPage:{title:"Accounts",managePrefix:"Manage",manageSuffix:"accounts and pool onboarding from one panel.",mobileManageSuffix:"continuity per account.",primaryActions:"Primary Actions",createAccount:"Create Account",authClaudeInPool:"Authenticate Claude in Pool",openClaudePoolSettings:"Open Claude Pool Settings",openCliProxyClaudePool:"Open CLIProxy Claude Pool",migrationFollowup:"Migration Follow-up",legacyContextPending:"{{count}} account still needs first-time mode confirmation.",legacyContextPending_other:"{{count}} accounts still need first-time mode confirmation.",legacyContinuityPending:"{{count}} shared account remains on standard legacy continuity depth.",legacyContinuityPending_other:"{{count}} shared accounts remain on standard legacy continuity depth.",confirmingLegacy:"Confirming Legacy Policies...",confirmLegacy:"Confirm Legacy Policies ({{count}})",noLegacyFollowup:"No legacy follow-up pending.",continuityGuide:"Continuity Guide",expandWhenNeeded:"Expand only when needed.",sharedStandard:"Shared Standard",sharedStandardDesc:"Project workspace sync only. Best default for most teams.",sharedDeeper:"Shared Deeper",sharedDeeperPrefix:"Adds",isolated:"Isolated",isolatedDesc:"No link. Best for strict separation.",quickCommands:"Quick Commands",quickCommandsDesc:"Copy and run in terminal.",workspaceBadge:"ccs auth Workspace",historySyncBadge:"History Sync Controls",authAccounts:"Auth Accounts",tableScopePrefix:"This table is intentionally scoped to",tableScopeMiddle:"accounts. Use",tableScopeSuffix:"for mode/group/depth changes.",accountMatrix:"Account Matrix",sharedTotalDesc:"Shared total: {{count}}. Actions include Sync settings and legacy confirmation.",loadingAccounts:"Loading accounts..."},health:{justNow:"just now",secondsAgo:"{{count}}s ago",minutesAgo:"{{count}}m ago",hoursAgo:"{{count}}h ago",systemHealth:"System Health",build:"build {{version}}",lastScan:"Last scan:",autoRefresh:"Auto-refresh:",refresh:"Refresh",checks:"Checks",version:"Version",platform:"Platform",liveMonitoring:"Live monitoring active",copied:"Copied to clipboard",refreshing:"Refreshing health checks...",fix:"Fix",applyFix:"Apply Fix",healthLabel:"health"},updates:{actionRequired:"Action Required",done:"Done",all:"All",inboxTitle:"Updates Inbox",inboxSubtitle:"Focus on actions, then mark updates done or dismissed.",needsAction:"Needs Action",doneCount:"Done",searchPlaceholder:"Search actions or commands",noNotices:"No notices match this view.",noUpdates:"No updates available.",published:"Published {{date}}",markDone:"Mark done",dismiss:"Dismiss",reopen:"Reopen",doNext:"Do Next",impactedIntegrations:"Impacted Integrations",impactedDesc:"Related areas based on update scope and routing.",whyMatters:"Why It Matters",whyMattersDesc:"Short context only, no wall-of-text release notes.",open:"Open",progressNeedsAction:"Needs Action",progressInReview:"In Review",progressDone:"Done",progressDismissed:"Dismissed",statusNew:"New",statusStable:"Stable",statusPlanned:"Planned",dashboard:"Dashboard",cliUsage:"CLI Usage"},cliproxyPage:{connected:"Connected",notConnected:"Not connected",variant:"variant",parentNotConnected:"Parent not connected",viaProvider:"via {{provider}}",emptyTitle:"CCS Profile Manager",emptyDesc:"Manage OAuth authentication, account preferences, and model selection for CLIProxy providers. Configure how CCS routes requests to different AI backends.",emptyControlPanelPrefix:"For live usage stats and real-time monitoring, visit the",controlPanel:"Control Panel",quickSetup:"Quick Setup",accountManagement:"CCS-level account management",providers:"Providers",variants:"Variants",providerCount:"{{count}} provider",providerCount_other:"{{count}} providers",connectedCount:"{{count}} connected",variantDisplay:"{{name}} ({{provider}} variant)"},copilotPage:{title:"Copilot",subtitle:"GitHub Copilot proxy",setup:"Setup",auth:"Auth",daemon:"Daemon",unofficialTitle:"Unofficial API - Use at Your Own Risk",unofficialItem1:"Reverse-engineered API - may break anytime",unofficialItem2:"Excessive use may trigger account restrictions",unofficialItem3:"No warranty, no responsibility from CCS",yes:"Yes",no:"No",installed:"Installed",missing:"Missing",integration:"Integration",enabled:"Enabled",disabled:"Disabled",github:"GitHub",connected:"Connected",notConnected:"Not Connected",authenticate:"Authenticate",authenticating:"Authenticating...",status:"Status",running:"Running",stopped:"Stopped",port:"Port",stopping:"Stopping...",stop:"Stop",starting:"Starting...",start:"Start",installing:"Installing...",installCopilotApi:"Install copilot-api",proxy:"Proxy",active:"Active",inactive:"Inactive"},cursorPage:{title:"Cursor",beta:"Beta",subtitle:"Dedicated Cursor integration controls",unofficialTitle:"Unofficial API - Use at Your Own Risk",unofficialItem1:"Reverse-engineered integration may break anytime",unofficialItem2:"Abuse or excessive usage may risk account restrictions",unofficialItem3:"No warranty, no responsibility from CCS",integration:"Integration",authentication:"Authentication",daemon:"Daemon",enabled:"Enabled",disabled:"Disabled",expired:"Expired",connected:"Connected",notConnected:"Not connected",running:"Running",stopped:"Stopped",actions:"Actions",disableIntegration:"Disable Integration",enableIntegration:"Enable Integration",autoDetectAuth:"Auto-detect Auth",manualAuthImport:"Manual Auth Import",stopDaemon:"Stop Daemon",startDaemon:"Start Daemon",port:"Port",configuration:"Cursor Configuration",lastModified:"Last modified:",neverSaved:"Never saved",saving:"Saving...",save:"Save",modelConfig:"Model Config",settings:"Settings",info:"Info",presets:"Presets",presetsDesc:"Apply pre-configured model mappings",modelMapping:"Model Mapping",modelMappingDesc:"Configure which models to use for each tier",defaultModel:"Default Model",defaultModelDesc:"Used when no specific tier is requested.",opusModel:"Opus (Most capable)",opusModelDesc:"Complex reasoning and highest quality responses.",sonnetModel:"Sonnet (Balanced)",sonnetModelDesc:"General coding and day-to-day chat workloads.",haikuModel:"Haiku (Fast)",haikuModelDesc:"Low-latency and lightweight request paths.",runtimeSettings:"Runtime Settings",autoStartDaemon:"Auto-start Daemon",autoStartDesc:"Start Cursor daemon automatically when integration is used.",ghostMode:"Ghost Mode",ghostModeDesc:"Request x-ghost-mode to reduce telemetry.",provider:"Provider",filePath:"File Path",availableModels:"Available Models",loadingModels:"Loading models...",noModels:"No model metadata available yet. Start daemon and refresh.",default:"Default",rawConfiguration:"Raw Configuration (JSON)",manualImportTitle:"Manual Cursor Auth Import",manualImportDesc:"Provide Cursor access token and machine ID if auto-detect is unavailable.",accessToken:"Access Token",accessTokenPlaceholder:"Paste Cursor access token",machineId:"Machine ID",machineIdPlaceholder:"32-char hex (UUID without hyphens)",cancel:"Cancel",import:"Import",selectModel:"Select model",useDefaultModel:"Use Default Model",availableModelCount:"Available Models ({{count}})",invalidPort:"Port must be an integer between 1 and 65535",defaultModelRequired:"Default model is required",savedConfig:"Cursor config and model mapping saved",failedSaveConfig:"Failed to save config",modelsLoadingWait:"Models are still loading. Please wait before applying a preset.",noModelsAvailable:"No models available yet. Start the daemon and refresh first.",appliedCodexPreset:"Applied GPT-5.3 Codex preset",appliedClaudePreset:"Applied Claude 4.6 preset",appliedGeminiPreset:"Applied Gemini 3 preset",integrationEnabled:"Cursor integration enabled",integrationDisabled:"Cursor integration disabled",failedUpdateIntegration:"Failed to update integration state",credentialsImported:"Cursor credentials imported",autoDetectFailed:"Auto-detect failed",manualRequired:"Token and machine ID are required",manualImportFailed:"Manual import failed",failedStartDaemon:"Failed to start daemon",daemonStarted:"Daemon started",daemonStartedWithPid:"Daemon started (PID: {{pid}})",failedStopDaemon:"Failed to stop daemon",daemonStopped:"Daemon stopped",rawLoading:"Raw settings are still loading. Please wait and try again.",invalidJson:"Invalid JSON",rawSaved:"Raw settings saved",rawChanged:"Raw settings changed externally. Refresh and retry.",failedSaveRaw:"Failed to save raw settings",savedAll:"Cursor configuration saved"},droidPage:{loadingDiagnostics:"Loading Droid diagnostics...",failedDiagnostics:"Failed to load Droid diagnostics.",overview:"Overview",byok:"BYOK",docs:"Docs",runtimeInstall:"Runtime and Installation",status:"Status",detected:"Detected",notFound:"Not Found",detectionSource:"Detection source",binaryPath:"Binary path",installDirectory:"Install directory",version:"Version",overridePath:"Override (CCS_DROID_PATH)",configFiles:"Config Files",path:"Path",resolved:"Resolved",size:"Size",lastModified:"Last modified",parseWarning:"Parse warning: {{value}}",readWarning:"Read warning: {{value}}",warnings:"Warnings",byokSummary:"BYOK Summary",activeModelSelector:"Active model selector",customModels:"Custom models",ccsManaged:"CCS-managed",userManaged:"User-managed",malformedEntries:"Malformed entries",providers:"Providers",none:"none",customModelsTitle:"Custom Models",modelName:"Name / Model",provider:"Provider",baseUrl:"Base URL",noCustomModels:"No custom models",docsAlignedNotes:"Docs-Aligned Notes",factoryDocs:"Factory Docs",providerFactCheckDocs:"Provider Fact-Check Docs",providerValues:"Provider values: {{value}}",settingsHierarchy:"Settings hierarchy: {{value}}",settingsTitle:"Droid BYOK Settings",fixJsonBeforeQuickSettings:"Fix JSON syntax before using quick settings controls.",fixJsonBeforeReasoning:"Fix JSON syntax before updating BYOK reasoning settings.",unableUpdateReasoning:"Unable to update selected BYOK model reasoning setting.",fixJsonBeforeBudget:"Fix JSON syntax before updating thinking budget.",anthropicOnlyBudget:"Thinking budget is only available for Anthropic BYOK models.",invalidJson:"Invalid JSON: {{value}}",saved:"Droid settings saved",changedExternally:"Droid settings changed externally. Refresh and retry.",failedSave:"Failed to save Droid settings"},sharedPage:{commands:"Commands",skills:"Skills",agents:"Agents",title:"Shared Data",subtitle:"Commands, skills, and agents shared across Claude instances",totalShared:"Total Shared",visible:"Visible",markdownDetail:"Markdown detail view",filterPrefix:"Filter:",configurationRequired:"Configuration Required",countsUnavailable:"Counts unavailable",retryCounts:"Retry counts",filterPlaceholder:"Filter {{tab}} by name, description, or path",showing:"Showing {{visible}} of {{total}} {{tab}}",showingQuery:' for "{{query}}"',refreshing:" (refreshing...)",loadingShared:"Loading shared {{tab}}...",failedLoadShared:"Failed to load shared {{tab}}",retry:"Retry",noSharedFound:"No shared {{tab}} found. Run `ccs sync` or add items in your shared directory.",noMatch:'No {{tab}} match "{{query}}".',selectOne:"Select a {{tab}} to view full content.",pathLabel:"Path",resolvedSource:"Resolved Source",loadingMarkdown:"Loading markdown content...",failedLoadContent:"Failed to load content",retryContent:"Retry content",noMarkdown:"No markdown content available."}}},"zh-CN":{translation:{locale:{en:"English","zh-CN":"简体中文",vi:"越南语"},layout:{languageSwitcher:"语言"},nav:{general:"通用",home:"首页",analytics:"分析",identityAccess:"身份与访问",apiProfiles:"API 配置",cliproxyPlus:"CLIProxy Plus",cliproxyOverview:"概览",controlPanel:"控制面板",githubCopilot:"GitHub Copilot",cursorIde:"Cursor IDE",accounts:"账号",allAccounts:"全部账号",sharedData:"共享数据",compatibleClis:"兼容 CLI",factoryDroid:"Factory Droid",system:"系统",health:"健康",settings:"设置",openrouterTooltip:"精选:OpenRouter + Alibaba Coding Plan + Ollama"},home:{profiles:"配置",cliproxy:"CLIProxy",accounts:"账号",health:"健康",configurationRequired:"需要配置"},auth:{dashboardTitle:"CCS 控制台",loginDescription:"请输入凭据以访问控制台",username:"用户名",password:"密码",usernamePlaceholder:"请输入用户名",passwordPlaceholder:"请输入密码",signIn:"登录",signingIn:"登录中...",loginFailed:"登录失败"},commonToast:{apiKeyRequired:"API key 为必填项",accountAddedPresetFailed:"账号已添加,但应用默认预设失败",settingsCopied:"设置已复制到剪贴板",enterPresetName:"请先输入预设名称再保存",codeCopied:"验证码已复制到剪贴板",copyCodeFailed:"复制验证码失败",appliedModelAllTiers:"已将模型应用到全部层级",settingsSaved:"设置已保存",defaultTargetUpdated:"默认目标已更新",failedUpdateDefaultTarget:"更新默认目标到 {{target}} 失败{{suffix}}"},profileDialog:{editTitle:"编辑配置",createTitle:"创建 API 配置",name:"名称",namePlaceholder:"my-api",baseUrl:"Base URL",baseUrlPlaceholder:"https://api.example.com",apiKey:"API Key",defaultModel:"默认模型(ANTHROPIC_MODEL)",defaultModelHint:"留空则使用:{{model}}",modelMappingTitle:"模型映射(Opus/Sonnet/Haiku)",modelMappingDesc:"为不同档位配置不同模型 ID,适合按模型类型路由到不同后端的 API 代理。",opusModel:"Opus 模型(ANTHROPIC_DEFAULT_OPUS_MODEL)",sonnetModel:"Sonnet 模型(ANTHROPIC_DEFAULT_SONNET_MODEL)",haikuModel:"Haiku 模型(ANTHROPIC_DEFAULT_HAIKU_MODEL)",cancel:"取消",saving:"保存中...",update:"更新",create:"创建"},modelTierMapping:{title:"模型档位映射",advanced:"高级",description:"为 Claude Code 的 opus/sonnet/haiku 档位配置不同模型。",autoSuggest:"基于 {{provider}} 自动建议",opusPlaceholder:"例如:anthropic/claude-opus-4",sonnetPlaceholder:"例如:anthropic/claude-sonnet-4",haikuPlaceholder:"例如:anthropic/claude-3.5-haiku",footer:"这些字段对应 ANTHROPIC_DEFAULT_OPUS_MODEL、ANTHROPIC_DEFAULT_SONNET_MODEL、ANTHROPIC_DEFAULT_HAIKU_MODEL。"},envEditor:{sensitive:"敏感",none:"尚未配置环境变量。",noneHint:"可在下方输入添加,或直接编辑 JSON。",addVariable:"添加环境变量",keyPlaceholder:"VARIABLE_NAME",valuePlaceholder:"value"},setupVariant:{using:"当前使用:",variantNameRequired:"变体名称 *",variantNamePlaceholder:"例如:my-gemini、g3、flash",invokeHintPrefix:"可通过该名称调用:",model:"模型",modelPlaceholder:"例如:gemini-2.5-pro、claude-opus-4-6-thinking",choosePresetInstead:"改为从预设中选择",selectModel:"选择模型",customModelName:"自定义模型名称...",enterAnyModel:"可输入 CLIProxy 支持的任意模型名",defaultModel:"默认:{{model}}",providerDefault:"提供商默认值",back:"返回",skip:"跳过",creating:"创建中...",createVariant:"创建变体",skipHint:"如果你只想添加账号而不创建变体,可以直接跳过"},customPresetDialog:{title:"自定义预设",presetNameOptional:"预设名称(可选)",presetNamePlaceholder:"例如:我的自定义配置",codexTipPrefix:"Codex 提示:后缀",codexTipSuffix:"会固定 effort。无后缀模型使用 Thinking 设置。",defaultModel:"默认模型",defaultModelDesc:"未指定档位时使用",opusModel:"Opus(最强)",opusModelDesc:"用于复杂推理任务",sonnetModel:"Sonnet(均衡)",sonnetModelDesc:"兼顾速度与能力",haikuModel:"Haiku(快速)",haikuModelDesc:"适合简单任务的快速响应",cancel:"取消",savePreset:"保存预设",applyPreset:"应用预设"},componentModelSelector:{selectModel:"选择模型",availableModelsCount:"可用模型({{count}})",preview:"预览"},copilotSettings:{enableCopilot:"启用 Copilot",enableCopilotDesc:"允许使用 GitHub Copilot 订阅",basicSettings:"基础设置",accountType:"账户类型",accountTypeIndividual:"个人",accountTypeBusiness:"企业",accountTypeEnterprise:"组织",rateLimiting:"速率限制",rateLimitSeconds:"速率限制(秒)",noLimit:"不限制",waitOnRateLimit:"触发限速时等待",waitOnRateLimitDesc:"达到限制时等待而不是报错",daemonSettings:"守护进程设置",autoStartDaemon:"自动启动守护进程",autoStartDaemonDesc:"使用配置时自动启动 copilot-api"},providerModelSelector:{selectModel:"选择模型",noModelsForProvider:"该提供商暂无可用模型",broken:"故障",deprecated:"已弃用",paid:"付费",freeTier:"免费档",paidTier:"付费档",modelKnownIssues:"该模型存在已知问题",viewIssueDetails:"查看问题详情",modelDeprecated:"该模型已弃用",recommended:"推荐",allModelsCount:"全部模型({{count}})",noModelsAvailable:"暂无可用模型"},createAuthProfileDialog:{title:"创建新账号",description:"Auth 配置需要先完成 Claude CLI 登录。请在终端执行下方命令。稍后你仍可在 Accounts 表中编辑同步模式、分组与连续性深度。",profileName:"配置名称",profileNamePlaceholder:"例如:work、personal、client",invalidProfileName:"名称必须以字母开头,且只能包含字母、数字、短横线或下划线。",enableSharedHistory:"与其他 ccs auth 账号启用共享历史同步",historySyncGroupOptional:"历史同步分组(可选)",historySyncGroupPlaceholder:"default、sprint-a、client-x",historySyncGroupHint:"留空将使用默认共享分组。空格会自动规范为短横线。",deeperContinuity:"高级:更深连续性模式",deeperContinuityHint:"会同步 session-env、file-history、shell-snapshots 与 todos。凭据仍保持隔离。",invalidContextGroup:"分组必须以字母开头,且只能包含字母、数字、短横线或下划线(最多 {{max}} 个字符)。",command:"命令",commandFallback:"ccs auth create <name>",afterRunPrefix:"执行命令后:",afterRunStep1:"在浏览器中完成 Claude 登录",afterRunStep2:"返回此处并刷新,即可看到新账号",poolingHint:"如果更倾向于共享池化 Claude OAuth 路由,可在 Accounts 页面操作按钮中使用 CLIProxy Claude pool。",close:"关闭",copied:"已复制!",copyCommand:"复制命令"},cliproxyModelCategory:{google:"Google(Gemini)",openai:"OpenAI(GPT)",anthropic:"Anthropic(Claude)",antigravity:"Antigravity",other:"其他"},cliproxyOverviewComponents:{availableModels:"可用模型",noModelsAvailable:"暂无可用模型",startSessionHint:"启动 CLIProxy 会话后即可拉取可用模型",totalCount:"共 {{count}} 个",availableThroughGroupedByProvider:"通过 {{backendLabel}} 提供的模型,按提供商分组",moreCount:"另外 {{count}} 个"},categorizedModelSelector:{selectModel:"选择模型",noModelsAvailable:"暂无可用模型",modelPlaceholder:"模型..."},openrouterQuickStart:{recommended:"推荐",title:"从 OpenRouter 开始",description:"通过一个 API 即可访问来自 OpenAI、Anthropic、Google、Meta 等的 {{modelCountLabel}} 个模型。",featureOneApi:"一个 API,接入全部提供商",featureTierMapping:"模型档位映射",createOpenRouterProfile:"创建 OpenRouter 配置",getApiKeyAt:"在此获取 API Key:",or:"或",createCustomProfile:"创建自定义 API 配置"},alibabaCodingPlanQuickStart:{recommended:"推荐",title:"试用阿里云 Coding Plan",description:"通过 Anthropic 兼容端点接入阿里云 Model Studio Coding Plan。",featureEndpoint:"Anthropic 兼容端点",featureKeyFormat:"专用 sk-sp API Key",createAlibabaProfile:"创建 Alibaba Coding Plan 配置",readGuideAt:"查看配置文档:"},alibabaCodingPlanPromo:{title:"Alibaba Coding Plan",subtitle:"通过 Anthropic 端点接入 Model Studio Coding Plan",add:"添加"},credentialHealth:{title:"凭据健康状态",ready:"就绪",noCredentialsConfigured:"尚未配置凭据。请使用上方登录按钮完成认证。",neverUsed:"从未使用",justNow:"刚刚",unknown:"未知",daysAgo:"{{count}} 天前",hoursAgo:"{{count}} 小时前",minutesAgo:"{{count}} 分钟前"},proxyStatusWidget:{justNow:"刚刚",minutesAgo:"{{count}} 分钟前",hoursAgo:"{{count}} 小时前",syncReady:"同步就绪",noConfig:"未配置",remoteProxy:"远程代理",active:"已连接",trafficAutoRouted:"流量已自动转发到远程服务器",tooltipSync:"同步配置到 CLIProxy",tooltipRestart:"重启",tooltipStop:"停止",tooltipClose:"关闭",tooltipVersionSettings:"版本设置",versionManagement:"版本管理",selectVersionPlaceholder:"选择要安装的版本...",stable:"(稳定版)",install:"安装",versionsAboveUnstable:"高于 {{version}} 的版本存在已知问题",versionsKnownIssues:"版本 {{version}} 存在已知问题",lastChecked:"上次检查 {{time}}",notRunning:"未运行",start:"启动",port:"端口 {{port}}",sessionCount:"{{count}} 个会话",sessionCount_other:"{{count}} 个会话",installFaultyTitle:"安装存在已知问题的版本?",installFaultyDesc:"即将安装 <strong>v{{version}}</strong>,该版本位于已知故障范围 <strong>{{range}}</strong> 内。",installFaultyWarning:"该版本存在已知缺陷,可能安装失败或让代理处于异常状态。",installUnstableTitle:"安装非稳定版本?",installUnstableDesc:"即将安装 <strong>v{{version}}</strong>,该版本高于当前最大稳定版 <strong>v{{maxStable}}</strong>。",installUnstableWarning:"该版本存在已知稳定性问题,可能导致异常行为。",installUnstableConfirm:"确定要继续吗?",cancel:"取消",installAnyway:"仍要安装",clickToDowngrade:"点击降级",clickToUpdate:"点击更新"},syncStatusCard:{profileSync:"配置同步",ready:"就绪",noConfig:"未配置",syncsProfilesDesc:"将 API 配置同步到本地 CLIProxy 配置",runDoctorHint:"运行 <code>ccs doctor --fix</code> 生成配置。",details:"详情",syncNow:"立即同步"},syncDialog:{title:"同步配置到本地 CLIProxy",description:"将 CCS API 配置同步到本地 CLIProxy 的 config.yaml。",noProfiles:"没有可同步的配置。",createProfilesFirst:"请先在「配置」页创建 API 配置。",modelLabel:"模型:",ready:"就绪",profilesToSync_one:"{{count}} 个配置待同步",profilesToSync_other:"{{count}} 个配置待同步",cancel:"取消",syncing:"同步中...",synced:"已同步!",syncNow:"立即同步"},errorLogs:{title:"错误日志",failedRequests_one:"{{count}} 个失败请求",failedRequests_other:"{{count}} 个失败请求",cliproxyDiagnostics:"CLIProxy 诊断",showingCount:"显示 50 / {{total}} 条",selectLog:"选择一条日志查看详情",failedLoadContent:"加载日志内容失败",copyAbsolutePath:"复制绝对路径",copyRawContent:"复制原始日志",tabOverview:"概览",tabHeaders:"请求头",tabRequest:"请求体",tabResponse:"响应体",tabRaw:"原始",modelLabel:"模型:",quotaResetsIn:"配额重置于 ",method:"方法",provider:"提供商",version:"版本",endpoint:"端点",url:"URL",timestamp:"时间戳",na:"无",noHeaders:"无请求头",noRequestBody:"无请求体内容",noResponseBody:"无响应体内容",rateLimitedMsg:"触发限速。请切换账号或等待配额重置。模型 {{model}} 配额已用尽。",rateLimitedMsgNoModel:"触发限速。请切换账号或等待配额重置。",authFailedMsg:"认证失败。请通过 CLIProxy 设置重新认证或检查 API Key。",notFoundMsg:"端点未找到,该提供商可能不存在此端点。",serverErrorMsg:"上游服务器错误。请稍后重试或查看提供商状态页。",timeoutMsg:"请求超时。请检查网络或增大超时设置。",unknown:"未知"},editAccountContext:{title:"编辑历史同步",description:"配置「{{name}}」与其他 ccs auth 账号共享历史与连续性的方式。",syncMode:"同步模式",selectContextMode:"选择同步模式",isolatedOption:"隔离(不同步)",sharedOption:"共享(启用同步)",sharedModeHint:"共享模式会为同一历史同步分组内的账号复用工作区上下文。",isolatedModeHint:"隔离模式使该账号与其他 ccs auth 账号完全独立。",historySyncGroup:"历史同步分组",groupPlaceholder:"default",groupHint:"会规范为小写(空格变为短横线)。允许:字母、数字、_、-(最多 {{max}} 字符)。",invalidGroup:"请输入以字母开头的有效分组名。",continuityDepth:"连续性深度",selectContinuityDepth:"选择连续性深度",standardOption:"标准(仅项目)",deeperOption:"更深连续性(高级)",deeperHint:"高级模式还会同步 session-env、file-history、shell-snapshots 和 todos。",standardHint:"标准模式仅同步项目工作区上下文。",credentialsIsolated:"凭据与 .anthropic 在所有模式下均按账号隔离。",cancel:"取消",save:"保存",saving:"保存中..."},historySyncLearningMap:{title:"历史同步说明",description:"隔离 -> 共享 -> 更深。在每行使用「同步」进行所有更改。",learningMap:"说明",isolated:"隔离",shared:"共享",deeper:"更深",cliproxyManaged_one:"{{count}} 个 CLIProxy Claude 池账号在操作中心 / CLIProxy 页面管理。",cliproxyManaged_other:"{{count}} 个 CLIProxy Claude 池账号在操作中心 / CLIProxy 页面管理。",showDetails:"显示详情:分组、切换与旧策略",modeSwitch:"模式切换",modeSwitchDesc:"同步对话框可让用户在隔离/共享间切换并选择更深连续性。",historySyncGroup:"历史同步分组",historySyncGroupDesc:"同一分组即共享项目上下文。默认回退为 default。"},accountsTable:{name:"名称",type:"类型",defaultBadge:"默认",created:"创建时间",lastUsed:"最后使用",historySync:"历史同步",actions:"操作",syncTitle:"编辑同步模式、分组与连续性深度",confirmLegacyTitle:"确认此旧账号的当前模式为显式",sync:"同步",confirm:"确认",active:"当前",setDefault:"设为默认",deleteAccount:"删除账号",cannotDeleteDefault:"不能删除默认账号",noAccounts:"未找到 CCS auth 账号。请使用 ccs auth create 添加。",resetToDefault:"恢复为 CCS 默认",deleteDialogTitle:"删除账号",deleteDialogDesc:"确定要删除账号「{{name}}」吗?将移除该配置及其所有会话数据,且无法撤销。",cancel:"取消",delete:"删除",sharedGroupStandard:"共享({{group}},标准)",sharedGroupDeeper:"共享({{group}},更深)",sharedGroupLegacy:"共享({{group}},标准旧策略)",isolatedLegacy:"隔离(旧默认)",isolated:"隔离"},addAccountDialog:{title:"添加 {{displayName}} 账号",descKiro:"选择 Kiro 认证方式,然后通过浏览器或从 Kiro IDE 导入完成认证。",descDeviceCode:"点击认证后,验证码将显示,请在提供商网站输入。",descOauth:"点击认证获取 OAuth URL,在任意浏览器中打开即可登录。",powerUserEnabled:"已启用高级用户模式",powerUserSkipped:"已在设置 > 代理 中跳过 AGY 责任清单,您需自行承担 OAuth/账号风险。",authMethod:"认证方式",selectKiroAuthMethod:"选择 Kiro 认证方式",nicknameRequired:"昵称(必填)",nicknameOptional:"昵称(选填)",nicknamePlaceholder:"例如:工作、个人",nicknameRequiredHint:"该提供商必填。请使用唯一易记名称(如工作、个人)。",nicknameOptionalHint:"用于区分账号的友好名称。留空将根据邮箱自动生成。",waitingForAuth:"等待认证中...",deviceCodeHint:"验证码对话框即将出现,请在提供商网站输入验证码。",browserHint:"在浏览器中完成认证后,本对话框将自动关闭。",openUrlLabel:"在任意浏览器中打开此 URL 登录:",copied:"已复制",copy:"复制",open:"打开",popupBlocked:"弹窗被拦截。请复制上方 URL 在浏览器中手动打开。",redirectPasteLabel:"重定向未生效?请粘贴回调 URL:",callbackPlaceholder:"在此粘贴重定向 URL...",submitCallback:"提交回调",submitting:"提交中...",preparingUrl:"正在准备登录 URL...",cancel:"取消",importingToken:"正在从 Kiro IDE 导入令牌...",authenticate:"认证",importFromIde:"从 IDE 导入",importing:"导入中..."},flowViz:{backToProviders:"返回提供商",showDetails:"显示详情",hideDetails:"隐藏详情",resetLayout:"重置布局",provider:"提供商",totalRequests:"总请求数",accounts:"账号",connectionTimeline:"连接时间线",noRecentConnections:"暂无最近连接"},quickStats:{totalRequests:"总请求数",successRate:"成功率",totalTokens:"总 Token 数",activeModels:"活跃模型数"},authMonitor:{accounts:"账号",accountsCount:"{{count}} 个账号",success:"成功",failed:"失败",successRate:"成功率"},accountCard:{resumeAccount:"恢复账号",pauseAccount:"暂停账号",quotaLoading:"配额...",quota:"配额",quotaUnavailable:"配额限制不可用",reauthNeeded:"需要重新认证",removeAndReadd:"移除并重新添加账号",autoRefreshFailed:"自动刷新失败"},antigravityChecklist:{title:"Antigravity OAuth 责任须知",subtitle:"认证前请完成全部 4 步。",mandatory:"必读",completion:"完成度",stepsCount:"{{current}}/4 步"},accountSafetyWarning:{title:"OAuth 账号安全提示",subtitle:"Issue #509 · Gemini + AGY OAuth 风险",firstLine:"Issue #509 记录了与 ccs agy 及 ccs gemini 与 ccs agy 共享账号使用相关的封禁/停用报告。",secondLine:"仅在您愿意承担 OAuth 与账号访问风险的前提下继续。",issueLabel:"查看 issue #509",proxySettingsLabel:"Gemini + AGY 控制:设置 > 代理"},cliproxyDialog:{name:"名称",provider:"提供商",account:"账号",accountOptional:"账号(选填)",model:"模型",modelOptional:"模型(选填)",defaultTarget:"默认目标",defaultTier:"默认档位",tierConfig:"档位配置",selectProvider:"选择提供商...",useDefaultAccount:"使用默认账号",defaultSuffix:"(默认)",opus:"Opus",sonnet:"Sonnet",haiku:"Haiku",claudeCode:"Claude Code",factoryDroid:"Factory Droid",cancel:"取消",create:"创建",creating:"创建中...",saveChanges:"保存更改",saving:"保存中...",placeholderName:"my-gemini",placeholderModel:"gemini-2.5-pro",placeholderComposite:"my-composite",placeholderModelId:"model-id",placeholderAccountId:"account-id",editCompositeTitle:"编辑复合变体:{{name}}",editSingleTitle:"编辑单一样式:{{name}}"},profileEditor:{profileInfo:"配置信息",profileName:"配置名称",filePath:"文件路径",lastModified:"最后修改",defaultTarget:"默认目标",quickUsage:"快速使用",runWithProfile:"使用配置运行",runOnDroid:"在 Droid 上运行",droidAliasExplicit:"Droid 别名(显式)",overrideToClaude:"切换为 Claude",overrideToClaudeExplicit:"切换为 Claude(显式)",setAsDefault:"设为默认",provider:"提供商",custom:"自定义"},settings:{sectionLoadFailed:"加载分区失败",unknownError:"发生未知错误",reloadPage:"重新加载页面",refresh:"刷新",copy:"复制",copied:"已复制",saved:"已保存",loading:"加载中...",configFileNotFound:"未找到配置文件"},settingsTabs:{web:"网页",env:"环境",think:"思考",proxy:"代理",auth:"认证",backup:"备份"},settingsAuth:{failedFetchTokens:"获取认证令牌失败",failedSaveTokens:"保存令牌失败",tokensUpdated:"令牌已更新,请重启 CLIProxy 生效。",failedRegenerate:"重新生成密钥失败",secretRegenerated:"新的管理密钥已生成,请重启 CLIProxy 生效。",failedReset:"重置令牌失败",tokensReset:"令牌已重置为默认值,请重启 CLIProxy 生效。",description:"配置 CLIProxy 认证令牌。修改后需要重启 CLIProxy。",apiKey:"API Key",custom:"自定义",apiKeyDesc:"Claude Code 通过该值向 CLIProxy 鉴权",apiKeyPlaceholder:"API key",managementSecret:"管理密钥",managementSecretDesc:"CCS Dashboard 使用该值访问 CLIProxy 管理接口",managementSecretPlaceholder:"管理密钥",generateSecret:"生成新的安全密钥",resetDefaults:"重置为默认值",resetDesc:"将 API key 和管理密钥都恢复为默认值。",saving:"保存中...",save:"保存"},settingsGlobalEnv:{description:"向所有非 Claude 订阅型配置注入环境变量(gemini、codex、agy、ghcp 等)",enabled:"全局环境变量已启用",disabled:"全局环境变量已禁用",enabledDesc:"环境变量将注入第三方配置",disabledDesc:"环境变量不会被注入",envVars:"环境变量",noneConfigured:"尚未配置环境变量",addNew:"新增变量",keyName:"KEY_NAME",value:"value",add:"添加",quickAdd:"快速添加常用变量",allConfigured:"常用变量已全部配置"},settingsBackups:{failedFetch:"获取备份失败",failedRestore:"恢复备份失败",restoreSuccess:"备份恢复成功",title:"设置备份",description:"恢复 settings.json 的历史版本。每次修改设置时会自动创建备份。",none:"暂无备份",noneHint:"修改设置后,备份会显示在这里",latest:"最新",restoring:"恢复中...",restore:"恢复",restoreConfirmTitle:"确认恢复备份?",restoreConfirmPrefix:"这将用以下备份替换当前设置:",restoreConfirmSuffix:"此操作不可撤销。",cancel:"取消"},settingsWebsearch:{description:"面向第三方配置(gemini、codex、agy 等)的 CLI 网页搜索",enabled:"WebSearch 已启用",disabled:"WebSearch 已禁用",checking:"正在检查状态...",providers:"提供商",noneConfigured:"未配置任何提供商",noneConfiguredHint:"请先安装 CLI 工具以启用网页搜索提供商",checkProviders:"检查可用提供商",installed:"已安装",notInstalled:"未安装",model:"模型:",howInstall:"如何安装 {{name}} CLI",installGlobally:"全局安装",requiresKey:"(需要 xAI API key)",freeTier:"(提供免费额度)",viewDocs:"查看文档"},settingsProxy:{failedLoadAgyMode:"加载 AGY 高级模式失败",failedUpdateAgyMode:"更新 AGY 高级模式失败",failedVerifyAgyMode:"校验 AGY 高级模式持久化失败",notPersistedAgyMode:"AGY 高级模式未成功持久化,配置可能被其他进程修改。",agyModeEnabled:"AGY 高级模式已启用。",agyModeDisabled:"AGY 高级模式已关闭。",typePhraseToContinue:"请输入“{{value}}”后继续。",description:"为基于代理的配置设置本地或远程 {{backend}} 连接",backendPlus:"CLIProxy Plus",backend:"CLIProxy",instanceStatus:"实例状态",connectionMode:"连接模式",local:"本地",remote:"远程",localDesc:"在本机运行 {{backend}} 二进制",remoteDesc:"连接到远程 {{backend}} 服务器",backendBinary:"后端二进制",stopProxyToSwitch:"请先在实例状态中停止正在运行的代理,再切换后端。",default:"默认",plusDesc:"完整支持包括 Kiro 和 GitHub Copilot 在内的提供商",originalDesc:"原版二进制(仅 Gemini、Codex、Antigravity)",variantsIncompatible:"现有 Kiro/Copilot 变体与 CLIProxyAPI 不兼容。请切换到 CLIProxyAPIPlus 或移除这些变体。",safety:"安全",agyModeTitle:"Antigravity 高级模式",agyModeDesc:"在 Add Account 与 `ccs agy` 流程中跳过 AGY 责任确认清单。",agyWarning:"仅在你充分理解 OAuth 封禁风险模式(#509)后使用。CCS 不对账号损失承担责任。",finalConfirm:"需要最终确认",finalConfirmDesc:"启用后会跳过 Dashboard 与 CLI 的 AGY 安全检查。请先阅读 issue #509,并输入精确短语后继续。",step1:"步骤 1",readIssue:"阅读 issue #509",step2:"步骤 2",typePrefix:"输入",typeSuffix:"以启用。",typePhraseAria:"输入 I ACCEPT RISK 以启用 Antigravity 高级模式",exactPhrase:"必须输入完全一致的短语。",enableAgyMode:"启用高级模式",toggleAgyMode:"切换 AGY 高级模式",fallbackSettings:"回退设置",enableFallback:"启用本地回退",enableFallbackDesc:"远程不可达时使用本地代理",autoStartLocal:"自动启动本地代理",autoStartLocalDesc:"发生回退时自动启动本地代理",advanced:"高级",debugMode:"调试模式",debugModeDesc:"在浏览器控制台输出开发诊断信息",debugModeEnabled:"调试模式已开启,请在浏览器控制台查看详细日志。",localProxy:"本地代理",port:"端口",autoStart:"自动启动",localAutoStartDesc:"需要时自动启动本地代理",remoteConfigTitle:"远程服务器配置",host:"主机",hostPlaceholder:"192.168.1.100 或 proxy.example.com",defaultPort:"默认:{{value}}",portPlaceholder:"留空使用 {{value}}",protocol:"协议",http:"HTTP",https:"HTTPS",apiKeyOptional:"API Key(可选)",apiKeyPlaceholder:"用于 /v1/* API 接口",apiKeyDesc:"用于 /v1/chat/completions 接口请求",managementKeyOptional:"管理密钥(可选)",managementKeyPlaceholder:"用于 /v0/management/* 接口",managementKeyDesc:"用于 Dashboard 管理接口。未设置时回退使用 API Key。",testing:"测试中...",testConnection:"测试连接",connectedLatency:"已连接({{value}}ms)",connectionFailed:"连接失败",invalidPortOrEmpty:"端口必须是 1 到 65535 的整数,或留空使用默认值",invalidLocalPort:"本地端口必须是 1 到 65535 的整数",backendPlusApi:"CLIProxyAPIPlus",backendApi:"CLIProxyAPI"},settingsThinking:{description:"为支持的模型配置扩展思考/推理。",supportedProviders:"支持的提供商",modeTitle:"思考模式",modeAutoDesc:"根据模型档位自动设置思考级别",modeOffDesc:"关闭扩展思考",modeManualDesc:"设置持久覆盖级别,或按次使用 CLI 参数",tierDefaults:"档位默认值",tierDefaultsDesc:"自动模式下各模型档位的默认思考级别。",persistentOverride:"持久覆盖",persistentOverrideDesc:"应用到所有会话。CLI 参数仍具有更高优先级。",enterCustomBudget:"输入自定义预算",apply:"应用",providerOverrides:"提供商覆盖({{count}})",providerOverridesDesc:"为特定提供商覆盖档位默认值。可按需添加自定义提供商键。",addProviderPlaceholder:"添加提供商键(例如 qwen)",showWarnings:"显示告警",showWarningsDesc:"当思考值被限制或调整时显示告警",cliEnvOverride:"CLI 与环境变量覆盖",supportLine1Prefix:"思考预算:",supportLine1Suffix:"(基于 token)",supportLine2Prefix:"推理强度:",supportLine2SuffixPrefix:"(后缀或 ",supportLine2SuffixPostfix:":medium/high/xhigh)",supportLine3Prefix:"Codex 后缀会固定强度(例如 ",supportLine3Suffix:");无后缀模型使用 Thinking mode。"},analytics:{title:"分析",subtitle:"追踪使用情况与洞察",month:"本月",allTime:"全部时间",updated:"更新于 {{value}}"},analyticsSummary:{totalTokens:"总 Token",totalTokensSubtitle:"输入 {{input}} / 输出 {{output}}",totalCost:"总成本",totalCostSubtitle:"日均 ${{value}}",cacheTokens:"缓存 Token",cacheTokensSubtitle:"${{cost}}(占成本 {{percent}}%)",inputCost:"输入成本",outputCost:"输出成本",tokensSubtitle:"{{value}} 个 token"},apiProfiles:{title:"API 配置",new:"新建",searchPlaceholder:"搜索配置...",loadingProfiles:"正在加载配置...",failedLoadTitle:"加载配置失败",failedLoadDesc:"无法获取 API 配置,请稍后重试。",retry:"重试",noProfilesYet:"还没有 API 配置",noProfilesDesc:"创建你的第一个配置以连接自定义 API 端点",createProfile:"创建配置",noProfileMatch:"没有匹配“{{query}}”的配置",profileCount:"{{count}} 个配置",configuredCount:"{{count}} 个已配置",deleteProfileTitle:"删除配置",deleteProfileDesc:"确定要删除“{{name}}”吗?这会移除设置文件且无法恢复。",delete:"删除",unsavedChangesTitle:"未保存的更改",unsavedChangesDesc:"你在“{{current}}”中有未保存内容,是否丢弃并切换到“{{next}}”?",discardSwitch:"丢弃并切换"},accountsPage:{title:"账号",managePrefix:"统一管理",manageSuffix:"账号与池化接入流程。",mobileManageSuffix:"的连续性配置。",primaryActions:"主要操作",createAccount:"创建账号",authClaudeInPool:"在 Pool 中认证 Claude",openClaudePoolSettings:"打开 Claude Pool 设置",openCliProxyClaudePool:"打开 CLIProxy Claude Pool",migrationFollowup:"迁移后续处理",legacyContextPending:"{{count}} 个账号仍需首次模式确认。",legacyContinuityPending:"{{count}} 个共享账号仍处于标准旧版连续性深度。",confirmingLegacy:"正在确认旧版策略...",confirmLegacy:"确认旧版策略({{count}})",noLegacyFollowup:"暂无待处理的迁移后续项。",continuityGuide:"连续性指南",expandWhenNeeded:"按需展开查看。",sharedStandard:"共享标准",sharedStandardDesc:"仅同步项目工作区。适合大多数团队。",sharedDeeper:"共享更深",sharedDeeperPrefix:"额外包含",isolated:"隔离",isolatedDesc:"不建立链接。适合严格隔离场景。",quickCommands:"快捷命令",quickCommandsDesc:"复制后在终端运行。",workspaceBadge:"ccs auth 工作区",historySyncBadge:"历史同步控制",authAccounts:"认证账号",tableScopePrefix:"该表仅展示",tableScopeMiddle:"账号。模式/分组/深度调整请使用",tableScopeSuffix:"。",accountMatrix:"账号矩阵",sharedTotalDesc:"共享总数:{{count}}。可执行 Sync 设置和旧版确认操作。",loadingAccounts:"正在加载账号..."},health:{justNow:"刚刚",secondsAgo:"{{count}} 秒前",minutesAgo:"{{count}} 分钟前",hoursAgo:"{{count}} 小时前",systemHealth:"系统健康",build:"构建 {{version}}",lastScan:"上次扫描:",autoRefresh:"自动刷新:",refresh:"刷新",checks:"检查项",version:"版本",platform:"平台",liveMonitoring:"实时监控已启用",copied:"已复制到剪贴板",refreshing:"正在刷新健康检查...",fix:"修复",applyFix:"应用修复",healthLabel:"健康"},updates:{actionRequired:"待处理",done:"已完成",all:"全部",inboxTitle:"更新收件箱",inboxSubtitle:"先处理操作,再将更新标记为完成或忽略。",needsAction:"需处理",doneCount:"已完成",searchPlaceholder:"搜索操作或命令",noNotices:"当前视图下没有通知。",noUpdates:"暂无更新。",published:"发布于 {{date}}",markDone:"标记完成",dismiss:"忽略",reopen:"重新打开",doNext:"下一步",impactedIntegrations:"受影响的集成",impactedDesc:"根据更新范围与路由匹配的相关区域。",whyMatters:"为什么重要",whyMattersDesc:"仅保留简要背景,不展示冗长发布说明。",open:"打开",progressNeedsAction:"需处理",progressInReview:"审阅中",progressDone:"已完成",progressDismissed:"已忽略",statusNew:"新",statusStable:"稳定",statusPlanned:"计划中",dashboard:"Dashboard",cliUsage:"CLI 用法"},cliproxyPage:{connected:"已连接",notConnected:"未连接",variant:"变体",parentNotConnected:"上游未连接",viaProvider:"通过 {{provider}}",emptyTitle:"CCS 配置管理",emptyDesc:"管理 CLIProxy 提供商的 OAuth 认证、账号偏好与模型选择,配置 CCS 的请求路由。",emptyControlPanelPrefix:"如需查看实时用量和监控,请前往",controlPanel:"控制面板",quickSetup:"快速设置",accountManagement:"CCS 级账号管理",providers:"提供商",variants:"变体",providerCount:"{{count}} 个提供商",connectedCount:"{{count}} 个已连接",variantDisplay:"{{name}}({{provider}} 变体)"},copilotPage:{title:"Copilot",subtitle:"GitHub Copilot 代理",setup:"安装",auth:"认证",daemon:"守护进程",unofficialTitle:"非官方 API - 风险自负",unofficialItem1:"逆向接口,可能随时失效",unofficialItem2:"过度使用可能触发账号限制",unofficialItem3:"CCS 不提供担保,也不承担责任",yes:"是",no:"否",installed:"已安装",missing:"缺失",integration:"集成",enabled:"已启用",disabled:"已禁用",github:"GitHub",connected:"已连接",notConnected:"未连接",authenticate:"去认证",authenticating:"认证中...",status:"状态",running:"运行中",stopped:"已停止",port:"端口",stopping:"停止中...",stop:"停止",starting:"启动中...",start:"启动",installing:"安装中...",installCopilotApi:"安装 copilot-api",proxy:"代理",active:"活跃",inactive:"未激活"},cursorPage:{title:"Cursor",beta:"Beta",subtitle:"Cursor 集成专用控制面板",unofficialTitle:"非官方 API - 风险自负",unofficialItem1:"逆向集成可能随时失效",unofficialItem2:"滥用或过量使用可能导致账号受限",unofficialItem3:"CCS 不提供担保,也不承担责任",integration:"集成",authentication:"认证",daemon:"守护进程",enabled:"已启用",disabled:"已禁用",expired:"已过期",connected:"已连接",notConnected:"未连接",running:"运行中",stopped:"已停止",actions:"操作",disableIntegration:"禁用集成",enableIntegration:"启用集成",autoDetectAuth:"自动检测认证",manualAuthImport:"手动导入认证",stopDaemon:"停止守护进程",startDaemon:"启动守护进程",port:"端口",configuration:"Cursor 配置",lastModified:"最后修改:",neverSaved:"从未保存",saving:"保存中...",save:"保存",modelConfig:"模型配置",settings:"设置",info:"信息",presets:"预设",presetsDesc:"应用预设模型映射",modelMapping:"模型映射",modelMappingDesc:"为不同档位配置使用模型",defaultModel:"默认模型",defaultModelDesc:"未指定档位时使用。",opusModel:"Opus(最强)",opusModelDesc:"复杂推理与最高质量输出。",sonnetModel:"Sonnet(均衡)",sonnetModelDesc:"日常编码和通用对话。",haikuModel:"Haiku(快速)",haikuModelDesc:"低延迟与轻量请求。",runtimeSettings:"运行时设置",autoStartDaemon:"自动启动守护进程",autoStartDesc:"在使用集成时自动启动 Cursor 守护进程。",ghostMode:"Ghost 模式",ghostModeDesc:"请求时附带 x-ghost-mode 以减少遥测。",provider:"提供商",filePath:"文件路径",availableModels:"可用模型",loadingModels:"加载模型中...",noModels:"暂无模型元数据,请先启动守护进程后刷新。",default:"默认",rawConfiguration:"原始配置(JSON)",manualImportTitle:"手动导入 Cursor 认证",manualImportDesc:"若无法自动检测,请提供 Cursor access token 与 machine ID。",accessToken:"访问令牌",accessTokenPlaceholder:"粘贴 Cursor access token",machineId:"机器 ID",machineIdPlaceholder:"32 位十六进制(无连字符 UUID)",cancel:"取消",import:"导入",selectModel:"选择模型",useDefaultModel:"使用默认模型",availableModelCount:"可用模型({{count}})",invalidPort:"端口必须是 1 到 65535 之间的整数",defaultModelRequired:"默认模型必填",savedConfig:"Cursor 配置与模型映射已保存",failedSaveConfig:"保存配置失败",modelsLoadingWait:"模型仍在加载中,请稍后再应用预设。",noModelsAvailable:"暂无可用模型,请先启动守护进程并刷新。",appliedCodexPreset:"已应用 GPT-5.3 Codex 预设",appliedClaudePreset:"已应用 Claude 4.6 预设",appliedGeminiPreset:"已应用 Gemini 3 预设",integrationEnabled:"Cursor 集成已启用",integrationDisabled:"Cursor 集成已禁用",failedUpdateIntegration:"更新集成状态失败",credentialsImported:"Cursor 凭据已导入",autoDetectFailed:"自动检测失败",manualRequired:"Token 和 machine ID 为必填项",manualImportFailed:"手动导入失败",failedStartDaemon:"启动守护进程失败",daemonStarted:"守护进程已启动",daemonStartedWithPid:"守护进程已启动(PID: {{pid}})",failedStopDaemon:"停止守护进程失败",daemonStopped:"守护进程已停止",rawLoading:"原始设置仍在加载,请稍后重试。",invalidJson:"JSON 无效",rawSaved:"原始设置已保存",rawChanged:"原始设置已被外部修改,请刷新后重试。",failedSaveRaw:"保存原始设置失败",savedAll:"Cursor 配置已保存"},droidPage:{loadingDiagnostics:"加载 Droid 诊断中...",failedDiagnostics:"加载 Droid 诊断失败。",overview:"概览",byok:"BYOK",docs:"文档",runtimeInstall:"运行时与安装",status:"状态",detected:"已检测",notFound:"未找到",detectionSource:"检测来源",binaryPath:"二进制路径",installDirectory:"安装目录",version:"版本",overridePath:"覆盖路径(CCS_DROID_PATH)",configFiles:"配置文件",path:"路径",resolved:"解析结果",size:"大小",lastModified:"最后修改",parseWarning:"解析告警:{{value}}",readWarning:"读取告警:{{value}}",warnings:"告警",byokSummary:"BYOK 概览",activeModelSelector:"当前模型选择器",customModels:"自定义模型",ccsManaged:"CCS 管理",userManaged:"用户管理",malformedEntries:"异常条目",providers:"提供商",none:"无",customModelsTitle:"自定义模型",modelName:"名称 / 模型",provider:"提供商",baseUrl:"Base URL",noCustomModels:"没有自定义模型",docsAlignedNotes:"文档对齐说明",factoryDocs:"Factory 文档",providerFactCheckDocs:"Provider 校验文档",providerValues:"Provider 值:{{value}}",settingsHierarchy:"Settings 层级:{{value}}",settingsTitle:"Droid BYOK 设置",fixJsonBeforeQuickSettings:"请先修复 JSON 语法,再使用快速设置。",fixJsonBeforeReasoning:"请先修复 JSON 语法,再更新 BYOK 推理设置。",unableUpdateReasoning:"无法更新所选 BYOK 模型的推理设置。",fixJsonBeforeBudget:"请先修复 JSON 语法,再更新思考预算。",anthropicOnlyBudget:"思考预算仅适用于 Anthropic BYOK 模型。",invalidJson:"JSON 无效:{{value}}",saved:"Droid 设置已保存",changedExternally:"Droid 设置已被外部修改,请刷新后重试。",failedSave:"保存 Droid 设置失败"},sharedPage:{commands:"命令",skills:"技能",agents:"代理",title:"共享数据",subtitle:"在 Claude 实例间共享的命令、技能和代理",totalShared:"共享总数",visible:"可见",markdownDetail:"Markdown 详情视图",filterPrefix:"筛选:",configurationRequired:"需要配置",countsUnavailable:"统计不可用",retryCounts:"重试统计",filterPlaceholder:"按名称、描述或路径筛选 {{tab}}",showing:"显示 {{visible}} / {{total}} 个{{tab}}",showingQuery:"(关键字“{{query}}”)",refreshing:"(刷新中...)",loadingShared:"正在加载共享{{tab}}...",failedLoadShared:"加载共享{{tab}}失败",retry:"重试",noSharedFound:"未找到共享{{tab}}。请运行 `ccs sync` 或在共享目录添加内容。",noMatch:"没有匹配“{{query}}”的{{tab}}。",selectOne:"选择一个{{tab}}查看完整内容。",pathLabel:"路径",resolvedSource:"解析后来源",loadingMarkdown:"正在加载 Markdown 内容...",failedLoadContent:"加载内容失败",retryContent:"重试内容加载",noMarkdown:"暂无 Markdown 内容。"}}},vi:{translation:{locale:{en:"Tiếng Anh","zh-CN":"Tiếng Trung giản thể",vi:"Tiếng Việt"},layout:{languageSwitcher:"Ngôn ngữ"},nav:{general:"Chung",home:"Trang chủ",analytics:"Phân tích",identityAccess:"Nhận dạng & Quyền truy cập",apiProfiles:"Hồ sơ API",cliproxyPlus:"CLIProxy Plus",cliproxyOverview:"Tổng quan",controlPanel:"Bảng điều khiển",githubCopilot:"GitHub Copilot",cursorIde:"Cursor IDE",accounts:"Tài khoản",allAccounts:"Tất cả tài khoản",sharedData:"Dữ liệu dùng chung",compatibleClis:"CLI tương thích",factoryDroid:"Factory Droid",system:"Hệ thống",health:"Sức khỏe",settings:"Cài đặt",openrouterTooltip:"Nổi bật: OpenRouter + Alibaba Coding Plan + Ollama"},home:{profiles:"Hồ sơ",cliproxy:"CLIProxy",accounts:"Tài khoản",health:"Sức khỏe",configurationRequired:"Cần cấu hình"},auth:{dashboardTitle:"Bảng điều khiển CCS",loginDescription:"Nhập thông tin đăng nhập của bạn để truy cập bảng điều khiển",username:"Tên người dùng",password:"Mật khẩu",usernamePlaceholder:"Nhập tên người dùng",passwordPlaceholder:"Nhập mật khẩu",signIn:"Đăng nhập",signingIn:"Đang đăng nhập...",loginFailed:"Đăng nhập không thành công"},commonToast:{apiKeyRequired:"Cần có khóa API",accountAddedPresetFailed:"Đã thêm tài khoản nhưng không áp dụng được preset mặc định",settingsCopied:"Đã sao chép cài đặt vào bảng nhớ tạm",enterPresetName:"Vui lòng nhập tên preset để lưu",codeCopied:"Đã sao chép mã vào bảng nhớ tạm",copyCodeFailed:"Không sao chép được mã",appliedModelAllTiers:"Đã áp dụng mô hình cho tất cả các tier",settingsSaved:"Đã lưu cài đặt",defaultTargetUpdated:"Đã cập nhật mục tiêu mặc định",failedUpdateDefaultTarget:"Không cập nhật được mục tiêu mặc định thành {{target}}{{suffix}}"},profileDialog:{editTitle:"Chỉnh sửa hồ sơ",createTitle:"Tạo hồ sơ API",name:"Tên",namePlaceholder:"my-api",baseUrl:"URL cơ sở",baseUrlPlaceholder:"https://api.example.com",apiKey:"Khóa API",defaultModel:"Mô hình mặc định (ANTHROPIC_MODEL)",defaultModelHint:"Để trống để sử dụng: {{model}}",modelMappingTitle:"Ánh xạ mô hình (Opus/Sonnet/Haiku)",modelMappingDesc:"Cấu hình ID mô hình riêng cho từng tier. Hữu ích với API proxy định tuyến từng loại mô hình đến backend khác nhau.",opusModel:"Mô hình Opus (ANTHROPIC_DEFAULT_OPUS_MODEL)",sonnetModel:"Mô hình Sonnet (ANTHROPIC_DEFAULT_SONNET_MODEL)",haikuModel:"Mô hình Haiku (ANTHROPIC_DEFAULT_HAIKU_MODEL)",cancel:"Hủy bỏ",saving:"Đang lưu...",update:"Cập nhật",create:"Tạo"},modelTierMapping:{title:"Ánh xạ tầng mô hình",advanced:"Nâng cao",description:"Định cấu hình các mô hình khác nhau cho các cấp độ opus/sonnet/haiku của Claude Code.",autoSuggest:"Tự động đề xuất dựa trên {{provider}}",opusPlaceholder:"vd: anthropic/claude-opus-4",sonnetPlaceholder:"ví dụ: anthropic/claude-sonnet-4",haikuPlaceholder:"vd: anthropic/claude-3.5-haiku",footer:"Các biến này thiết lập ANTHROPIC_DEFAULT_OPUS_MODEL, ANTHROPIC_DEFAULT_SONNET_MODEL, ANTHROPIC_DEFAULT_HAIKU_MODEL."},envEditor:{sensitive:"nhạy cảm",none:"Không có biến môi trường nào được cấu hình.",noneHint:"Thêm biến bằng ô nhập bên dưới hoặc chỉnh sửa trực tiếp JSON.",addVariable:"Thêm biến môi trường",keyPlaceholder:"VARIABLE_NAME",valuePlaceholder:"giá trị"},setupVariant:{using:"Sử dụng:",variantNameRequired:"Tên biến thể *",variantNamePlaceholder:"ví dụ: my-gemini, g3, flash",invokeHintPrefix:"Sử dụng tên này để gọi:",model:"Mô hình",modelPlaceholder:"ví dụ: gemini-2.5-pro, claude-opus-4-5",choosePresetInstead:"Hoặc chọn từ preset có sẵn",selectModel:"Chọn mô hình",customModelName:"Tên mô hình tùy chỉnh...",enterAnyModel:"Nhập bất kỳ tên mô hình nào được CLIProxy hỗ trợ",defaultModel:"Mặc định: {{model}}",providerDefault:"mặc định theo nhà cung cấp",back:"Quay lại",skip:"Bỏ qua",creating:"Đang tạo...",createVariant:"Tạo biến thể",skipHint:"Bỏ qua nếu bạn chỉ muốn thêm tài khoản mà không tạo biến thể"},customPresetDialog:{title:"Preset tùy chỉnh",presetNameOptional:"Tên preset (tùy chọn)",presetNamePlaceholder:"ví dụ: Preset tùy chỉnh của tôi",codexTipPrefix:"Mẹo Codex: hậu tố",codexTipSuffix:"nỗ lực ghim. Các mô hình không có hậu tố sử dụng cài đặt Tư duy.",defaultModel:"Mô hình mặc định",defaultModelDesc:"Dùng khi không yêu cầu cấp mô hình cụ thể",opusModel:"Opus (Có khả năng nhất)",opusModelDesc:"Đối với các nhiệm vụ lý luận phức tạp",sonnetModel:"Sonnet (Cân bằng)",sonnetModelDesc:"Cân bằng giữa tốc độ và khả năng",haikuModel:"Haiku (Nhanh)",haikuModelDesc:"Phản hồi nhanh cho các tác vụ đơn giản",cancel:"Hủy bỏ",savePreset:"Lưu preset",applyPreset:"Áp dụng cài sẵn"},componentModelSelector:{selectModel:"Chọn mô hình",availableModelsCount:"Mô hình khả dụng ({{count}})",preview:"Xem trước"},copilotSettings:{enableCopilot:"Bật Copilot",enableCopilotDesc:"Cho phép sử dụng đăng ký GitHub Copilot",basicSettings:"Cài đặt cơ bản",accountType:"Loại tài khoản",accountTypeIndividual:"Cá nhân",accountTypeBusiness:"Business",accountTypeEnterprise:"Enterprise",rateLimiting:"Giới hạn tỷ lệ",rateLimitSeconds:"Giới hạn tốc độ (giây)",noLimit:"Không giới hạn",waitOnRateLimit:"Chờ giới hạn tỷ lệ",waitOnRateLimitDesc:"Chờ thay vì lỗi khi đạt đến giới hạn",daemonSettings:"Cài đặt Daemon",autoStartDaemon:"Daemon tự động khởi động",autoStartDaemonDesc:"Bắt đầu copilot-api khi sử dụng hồ sơ"},providerModelSelector:{selectModel:"Chọn mô hình",noModelsForProvider:"Không có mô hình nào cho nhà cung cấp này",broken:"BROKEN",deprecated:"DEPRECATED",paid:"PAID",freeTier:"Gói miễn phí",paidTier:"Gói trả phí",modelKnownIssues:"Mô hình này có vấn đề đã biết",viewIssueDetails:"Xem chi tiết vấn đề",modelDeprecated:"Mô hình này không được dùng nữa",recommended:"Đề xuất",allModelsCount:"Tất cả mô hình ({{count}})",noModelsAvailable:"Không có mô hình khả dụng"},createAuthProfileDialog:{title:"Tạo tài khoản mới",description:"Hồ sơ xác thực yêu cầu đăng nhập Claude CLI. Chạy lệnh dưới đây trong terminal của bạn. Bạn có thể chỉnh sửa chế độ đồng bộ hóa, nhóm và độ liên tục sau này từ bảng Tài khoản.",profileName:"Tên hồ sơ",profileNamePlaceholder:"ví dụ: công việc, cá nhân, khách hàng",invalidProfileName:"Tên phải bắt đầu bằng một chữ cái và chỉ chứa các chữ cái, số, dấu gạch ngang hoặc dấu gạch dưới.",enableSharedHistory:"Bật đồng bộ hóa lịch sử chia sẻ với các tài khoản xác thực ccs khác",historySyncGroupOptional:"Nhóm đồng bộ hóa lịch sử (tùy chọn)",historySyncGroupPlaceholder:"default, sprint-a, client-x",historySyncGroupHint:"Để trống để sử dụng nhóm chia sẻ mặc định. Dấu cách được chuẩn hóa thành dấu gạch ngang.",deeperContinuity:"Nâng cao: chế độ liên tục sâu hơn",deeperContinuityHint:"Thêm đồng bộ cho session-env, file-history, shell-snapshots và todos. Thông tin xác thực vẫn tách biệt.",invalidContextGroup:"Nhóm phải bắt đầu bằng một chữ cái và chỉ sử dụng các chữ cái, số, dấu gạch ngang hoặc dấu gạch dưới (tối đa {{max}} ký tự).",command:"Lệnh",commandFallback:"ccs auth create <name>",afterRunPrefix:"Sau khi chạy lệnh:",afterRunStep1:"Hoàn tất đăng nhập Claude trong trình duyệt của bạn",afterRunStep2:"Quay lại đây và làm mới để xem tài khoản mới",poolingHint:"Muốn dùng định tuyến Claude OAuth dạng pool? Dùng CLIProxy Claude pool từ nút hành động ở trang Tài khoản.",close:"Đóng",copied:"Đã sao chép!",copyCommand:"Sao chép lệnh"},cliproxyModelCategory:{google:"Google (Gemini)",openai:"OpenAI (GPT)",anthropic:"Anthropic (Claude)",antigravity:"Antigravity",other:"Khác"},cliproxyOverviewComponents:{availableModels:"Mô hình khả dụng",noModelsAvailable:"Không có mô hình khả dụng",startSessionHint:"Bắt đầu phiên CLIProxy để tải danh sách mô hình khả dụng",totalCount:"tổng cộng {{count}}",availableThroughGroupedByProvider:"Các mô hình khả dụng qua {{backendLabel}}, được nhóm theo nhà cung cấp",moreCount:"+{{count}} thêm"},categorizedModelSelector:{selectModel:"Chọn mô hình",noModelsAvailable:"Không có mô hình khả dụng",modelPlaceholder:"Mô hình..."},openrouterQuickStart:{recommended:"Đề xuất",title:"Bắt đầu với OpenRouter",description:"Truy cập các mô hình {{modelCountLabel}} từ OpenAI, Anthropic, Google, Meta, v.v. - tất cả đều thông qua một API.",featureOneApi:"Một API cho mọi nhà cung cấp",featureTierMapping:"Ánh xạ tầng mô hình",createOpenRouterProfile:"Tạo hồ sơ OpenRouter",getApiKeyAt:"Nhận khóa API của bạn tại",or:"hoặc",createCustomProfile:"Tạo hồ sơ API tùy chỉnh"},alibabaCodingPlanQuickStart:{recommended:"Đề xuất",title:"Dùng thử Alibaba Coding Plan",description:"Sử dụng Alibaba Cloud Coding Plan qua endpoint tương thích Anthropic cho tác vụ lập trình.",featureEndpoint:"Endpoint tương thích Anthropic",featureKeyFormat:"Khóa API sk-sp chuyên dụng",createAlibabaProfile:"Tạo hồ sơ Alibaba Coding Plan",readGuideAt:"Xem hướng dẫn tại"},alibabaCodingPlanPromo:{title:"Alibaba Coding Plan",subtitle:"Model Studio Coding Plan qua endpoint Anthropic",add:"Thêm"},credentialHealth:{title:"Tình trạng thông tin xác thực",ready:"Sẵn sàng",noCredentialsConfigured:"Không có thông tin xác thực nào được định cấu hình. Sử dụng các nút đăng nhập ở trên để xác thực.",neverUsed:"Chưa bao giờ sử dụng",justNow:"Vừa rồi",unknown:"Không xác định",daysAgo:"{{count}} ngày trước",hoursAgo:"{{count}} giờ trước",minutesAgo:"{{count}} phút trước"},proxyStatusWidget:{justNow:"vừa xong",minutesAgo:"{{count}} phút trước",hoursAgo:"{{count}} giờ trước",syncReady:"Sẵn sàng đồng bộ hóa",noConfig:"Không có cấu hình",remoteProxy:"Proxy từ xa",active:"Đang hoạt động",trafficAutoRouted:"Lưu lượng truy cập tự động được định tuyến đến máy chủ từ xa",tooltipSync:"Đồng bộ hóa hồ sơ với CLIProxy",tooltipRestart:"Khởi động lại",tooltipStop:"Dừng lại",tooltipClose:"Đóng",tooltipVersionSettings:"Cài đặt phiên bản",versionManagement:"Quản lý phiên bản",selectVersionPlaceholder:"Chọn phiên bản để cài đặt...",stable:"(ổn định)",install:"Cài đặt",versionsAboveUnstable:"Các phiên bản trên {{version}} có vấn đề đã biết",versionsKnownIssues:"Phiên bản {{version}} có vấn đề đã biết",lastChecked:"Đã kiểm tra lần cuối {{time}}",notRunning:"Không chạy",start:"Bắt đầu",port:"Cổng {{port}}",sessionCount:"{{count}} phiên",sessionCount_other:"{{count}} phiên",installFaultyTitle:"Cài đặt phiên bản có lỗi đã biết?",installFaultyDesc:"Bạn sắp cài đặt <strong>v{{version}}</strong>, phiên bản này nằm trong dải lỗi đã biết <strong>{{range}}</strong>.",installFaultyWarning:"Phiên bản này có lỗi đã biết và có thể cài đặt thất bại hoặc làm proxy ở trạng thái xấu.",installUnstableTitle:"Cài đặt phiên bản không ổn định?",installUnstableDesc:"Bạn sắp cài đặt <strong>v{{version}}</strong>, phiên bản này cao hơn phiên bản ổn định tối đa <strong>v{{maxStable}}</strong>.",installUnstableWarning:"Phiên bản này đã biết có vấn đề về độ ổn định và có thể gây ra hành vi không mong muốn.",installUnstableConfirm:"Bạn có chắc chắn muốn tiếp tục không?",cancel:"Hủy bỏ",installAnyway:"Vẫn cài đặt",clickToDowngrade:"Bấm để hạ cấp",clickToUpdate:"Bấm để cập nhật"},syncStatusCard:{profileSync:"Đồng bộ hồ sơ",ready:"Sẵn sàng",noConfig:"Không có cấu hình",syncsProfilesDesc:"Đồng bộ hóa cấu hình API với cấu hình CLIProxy cục bộ",runDoctorHint:"Chạy <code>ccs doctor --fix</code> để tạo cấu hình.",details:"Chi tiết",syncNow:"Đồng bộ ngay"},syncDialog:{title:"Đồng bộ hóa hồ sơ với CLIProxy cục bộ",description:"Đồng bộ hóa cấu hình API CCS của bạn với CLIProxy config.yaml cục bộ.",noProfiles:"Không có profile nào để đồng bộ.",createProfilesFirst:"Trước tiên hãy tạo hồ sơ API bằng tab Hồ sơ.",modelLabel:"Mô hình:",ready:"Sẵn sàng",profilesToSync_one:"{{count}} hồ sơ để đồng bộ hóa",profilesToSync_other:"{{count}} hồ sơ cần đồng bộ hóa",cancel:"Hủy bỏ",syncing:"Đang đồng bộ hóa...",synced:"Đã đồng bộ hóa!",syncNow:"Đồng bộ ngay"},errorLogs:{title:"Nhật ký lỗi",failedRequests_one:"{{count}} yêu cầu thất bại",failedRequests_other:"{{count}} yêu cầu thất bại",cliproxyDiagnostics:"Chẩn đoán CLIProxy",showingCount:"Hiển thị 50 trong số {{total}} nhật ký",selectLog:"Chọn nhật ký để xem chi tiết",failedLoadContent:"Không tải được nội dung nhật ký",copyAbsolutePath:"Sao chép đường dẫn tuyệt đối",copyRawContent:"Sao chép nội dung nhật ký thô",tabOverview:"Tổng quan",tabHeaders:"Tiêu đề",tabRequest:"Yêu cầu",tabResponse:"Phản hồi",tabRaw:"Raw",modelLabel:"Mô hình:",quotaResetsIn:"Quota sẽ được đặt lại sau",method:"Phương thức",provider:"Nhà cung cấp",version:"Phiên bản",endpoint:"Điểm cuối",url:"URL",timestamp:"Dấu thời gian",na:"không áp dụng",noHeaders:"Không có tiêu đề nào",noRequestBody:"Không có nội dung yêu cầu",noResponseBody:"Không có nội dung phản hồi",rateLimitedMsg:"Bị giới hạn tốc độ. Hãy chuyển sang tài khoản khác hoặc chờ reset hạn ngạch. Mô hình {{model}} đã hết quota.",rateLimitedMsgNoModel:"Bị giới hạn tốc độ. Hãy chuyển sang tài khoản khác hoặc chờ reset hạn ngạch.",authFailedMsg:"Xác thực không thành công. Xác thực lại thông qua Cài đặt CLIProxy hoặc kiểm tra khóa API.",notFoundMsg:"Không tìm thấy điểm cuối. Điểm cuối này có thể không tồn tại trên nhà cung cấp này.",serverErrorMsg:"Lỗi máy chủ từ upstream. Hãy thử lại sau hoặc kiểm tra trang trạng thái của nhà cung cấp.",timeoutMsg:"Yêu cầu hết thời gian chờ. Kiểm tra kết nối mạng hoặc tăng timeout.",unknown:"không rõ"},editAccountContext:{title:"Chỉnh sửa đồng bộ hóa lịch sử",description:'Định cấu hình cách "{{name}}" chia sẻ lịch sử và tính liên tục với các tài khoản xác thực ccs khác.',syncMode:"Chế độ đồng bộ",selectContextMode:"Chọn chế độ ngữ cảnh",isolatedOption:"tách biệt (không đồng bộ)",sharedOption:"chia sẻ (đã bật đồng bộ)",sharedModeHint:"Chế độ chia sẻ sử dụng lại ngữ cảnh không gian làm việc cho các tài khoản trong cùng một nhóm đồng bộ lịch sử.",isolatedModeHint:"Chế độ biệt lập giúp tài khoản này tách biệt hoàn toàn với các tài khoản xác thực ccs khác.",historySyncGroup:"Nhóm đồng bộ hóa lịch sử",groupPlaceholder:"mặc định",groupHint:"Chuẩn hóa thành chữ thường (dấu cách trở thành dấu gạch ngang). Được phép: chữ cái, số, _ , - (tối đa {{max}} ký tự).",invalidGroup:"Nhập tên nhóm hợp lệ bắt đầu bằng một chữ cái.",continuityDepth:"Độ sâu liên tục",selectContinuityDepth:"Chọn độ sâu liên tục",standardOption:"tiêu chuẩn (chỉ đồng bộ project)",deeperOption:"tính liên tục sâu hơn (nâng cao)",deeperHint:"Chế độ nâng cao cũng đồng bộ hóa phiên-env, lịch sử tệp, ảnh chụp nhanh shell và todos.",standardHint:"Chế độ tiêu chuẩn chỉ đồng bộ hóa bối cảnh không gian làm việc của dự án.",credentialsIsolated:"Thông tin xác thực và .anthropic vẫn được tách riêng cho mỗi tài khoản ở tất cả các chế độ.",cancel:"Hủy bỏ",save:"Lưu",saving:"Đang lưu..."},historySyncLearningMap:{title:"Cách đồng bộ hóa lịch sử hoạt động",description:"Tách biệt -> Chia sẻ -> Sâu hơn. Dùng Sync trên từng dòng để áp dụng thay đổi.",learningMap:"Bản đồ học tập",isolated:"Tách biệt",shared:"Chia sẻ",deeper:"Sâu hơn",cliproxyManaged_one:"{{count}} Tài khoản nhóm CLIProxy Claude được quản lý trong trang Action Center / CLIProxy.",cliproxyManaged_other:"{{count}} Tài khoản CLIProxy Claude pool được quản lý trong trang Action Center / CLIProxy.",showDetails:"Hiển thị chi tiết: nhóm, chuyển đổi và chính sách kế thừa",modeSwitch:"Chuyển đổi chế độ",modeSwitchDesc:"Hộp thoại đồng bộ hóa cho phép người dùng di chuyển giữa cách ly/chia sẻ và chọn tính liên tục sâu hơn.",historySyncGroup:"Nhóm đồng bộ hóa lịch sử",historySyncGroupDesc:"Cùng một nhóm nghĩa là chia sẻ cùng bối cảnh project. Nếu để trống sẽ dùng nhóm mặc định."},accountsTable:{name:"Tên",type:"Kiểu",defaultBadge:"mặc định",created:"Ngày tạo",lastUsed:"Được sử dụng lần cuối",historySync:"Đồng bộ hóa lịch sử",actions:"Hành động",syncTitle:"Chỉnh sửa chế độ đồng bộ, nhóm và độ sâu liên tục",confirmLegacyTitle:"Xác nhận chế độ hiện tại của tài khoản cũ này là rõ ràng",sync:"Đồng bộ hóa",confirm:"Xác nhận",active:"Đang hoạt động",setDefault:"Đặt mặc định",deleteAccount:"Xóa tài khoản",cannotDeleteDefault:"Không thể xóa tài khoản mặc định",noAccounts:"Không tìm thấy tài khoản xác thực CCS nào. Sử dụng ccs auth create để thêm tài khoản.",resetToDefault:"Đặt lại về mặc định CCS",deleteDialogTitle:"Xóa tài khoản",deleteDialogDesc:'Bạn có chắc chắn muốn xóa tài khoản "{{name}}" không? Thao tác này sẽ xóa hồ sơ và tất cả dữ liệu phiên của nó. Không thể hoàn tác hành động này.',cancel:"Hủy bỏ",delete:"Xóa",sharedGroupStandard:"chia sẻ ({{group}}, tiêu chuẩn)",sharedGroupDeeper:"chia sẻ ({{group}}, sâu hơn)",sharedGroupLegacy:"chia sẻ ({{group}}, kế thừa tiêu chuẩn)",isolatedLegacy:"tách biệt (mặc định cũ)",isolated:"tách biệt"},addAccountDialog:{title:"Thêm tài khoản {{displayName}}",descKiro:"Chọn phương thức xác thực Kiro, sau đó xác thực qua trình duyệt hoặc nhập từ Kiro IDE.",descDeviceCode:"Nhấp vào Xác thực. Mã xác minh sẽ xuất hiện để bạn nhập vào trang web của nhà cung cấp.",descOauth:"Nhấp vào Xác thực để nhận URL OAuth. Mở nó trong bất kỳ trình duyệt nào để đăng nhập.",powerUserEnabled:"Đã bật chế độ power user",powerUserSkipped:"Danh sách kiểm tra trách nhiệm của AGY bị bỏ qua khỏi Cài đặt > Proxy. Bạn chấp nhận hoàn toàn trách nhiệm về rủi ro tài khoản/OAuth.",authMethod:"Phương thức xác thực",selectKiroAuthMethod:"Chọn phương thức xác thực Kiro",nicknameRequired:"Biệt danh (bắt buộc)",nicknameOptional:"Biệt danh (tùy chọn)",nicknamePlaceholder:"ví dụ: công việc, cá nhân",nicknameRequiredHint:"Bắt buộc với nhà cung cấp này. Dùng tên thân thiện duy nhất (ví dụ: work, personal).",nicknameOptionalHint:"Một cái tên thân thiện để xác định tài khoản này. Tự động tạo từ email nếu để trống.",waitingForAuth:"Đang chờ xác thực...",deviceCodeHint:"Hộp thoại mã xác minh sẽ sớm xuất hiện. Nhập mã trên trang web của nhà cung cấp.",browserHint:"Hoàn tất xác thực trong trình duyệt của bạn. Hộp thoại này sẽ tự động đóng lại.",openUrlLabel:"Mở URL này trong bất kỳ trình duyệt nào để đăng nhập:",copied:"Đã sao chép",copy:"Sao chép",open:"Mở",popupBlocked:"Cửa sổ bật lên bị chặn. Sao chép URL ở trên và mở thủ công trong trình duyệt của bạn.",redirectPasteLabel:"Chuyển hướng không hoạt động? Dán URL gọi lại:",callbackPlaceholder:"Dán URL chuyển hướng vào đây...",submitCallback:"Gửi cuộc gọi lại",submitting:"Đang gửi...",preparingUrl:"Đang chuẩn bị URL đăng nhập...",cancel:"Hủy bỏ",importingToken:"Đang nhập token từ Kiro IDE...",authenticate:"Xác thực",importFromIde:"Nhập từ IDE",importing:"Đang nhập..."},flowViz:{backToProviders:"Quay lại nhà cung cấp",showDetails:"Hiển thị chi tiết",hideDetails:"Ẩn chi tiết",resetLayout:"Đặt lại bố cục",provider:"Nhà cung cấp",totalRequests:"Tổng số yêu cầu",accounts:"Tài khoản",connectionTimeline:"Dòng thời gian kết nối",noRecentConnections:"Không có kết nối gần đây"},quickStats:{totalRequests:"Tổng số yêu cầu",successRate:"Tỷ lệ thành công",totalTokens:"Tổng số token",activeModels:"Mô hình hoạt động"},authMonitor:{accounts:"Tài khoản",accountsCount:"{{count}} tài khoản",success:"Thành công",failed:"Thất bại",successRate:"Tỷ lệ thành công"},accountCard:{resumeAccount:"Tiếp tục tài khoản",pauseAccount:"Tạm dừng tài khoản",quotaLoading:"Hạn ngạch...",quota:"hạn ngạch",quotaUnavailable:"Thông tin quota chưa khả dụng",reauthNeeded:"Cần xác thực lại",removeAndReadd:"Xóa và thêm lại tài khoản",autoRefreshFailed:"Tự động làm mới không thành công"},antigravityChecklist:{title:"Trách nhiệm OAuth Antigravity",subtitle:"Hoàn thành tất cả 4 bước trước khi bạn có thể xác thực.",mandatory:"Bắt buộc",completion:"Hoàn thành",stepsCount:"{{current}}/4 bước"},accountSafetyWarning:{title:"Cảnh báo an toàn tài khoản OAuth",subtitle:"Vấn đề #509 · Rủi ro Gemini + AGY OAuth",firstLine:"Issue #509 ghi nhận các trường hợp bị đình chỉ/cấm liên quan đến ccs agy và việc dùng chung tài khoản giữa ccs gemini và ccs agy.",secondLine:"Chỉ tiếp tục nếu bạn chấp nhận hoàn toàn trách nhiệm về OAuth và rủi ro truy cập tài khoản.",issueLabel:"Đọc vấn đề #509",proxySettingsLabel:"Điều khiển Gemini + AGY: Cài đặt > Proxy"},cliproxyDialog:{name:"Tên",provider:"Nhà cung cấp",account:"Tài khoản",accountOptional:"Tài khoản (tùy chọn)",model:"Mô hình",modelOptional:"Mô hình (tùy chọn)",defaultTarget:"Mục tiêu mặc định",defaultTier:"Cấp mặc định",tierConfig:"Cấu hình cấp độ",selectProvider:"Chọn nhà cung cấp...",useDefaultAccount:"Sử dụng tài khoản mặc định",defaultSuffix:"(mặc định)",opus:"Opus",sonnet:"Sonnet",haiku:"Haiku",claudeCode:"Claude Code",factoryDroid:"Factory Droid",cancel:"Hủy bỏ",create:"Tạo",creating:"Đang tạo...",saveChanges:"Lưu thay đổi",saving:"Đang lưu...",placeholderName:"Gemini của tôi",placeholderModel:"gemini-2.5-pro",placeholderComposite:"my-composite",placeholderModelId:"model-id",placeholderAccountId:"account-id",editCompositeTitle:"Chỉnh sửa biến thể tổng hợp: {{name}}",editSingleTitle:"Chỉnh sửa biến thể: {{name}}"},profileEditor:{profileInfo:"Thông tin hồ sơ",profileName:"Tên hồ sơ",filePath:"Đường dẫn tệp",lastModified:"Sửa đổi lần cuối",defaultTarget:"Mục tiêu mặc định",quickUsage:"Sử dụng nhanh",runWithProfile:"Chạy với hồ sơ",runOnDroid:"Chạy trên Droid",droidAliasExplicit:"Bí danh Droid (rõ ràng)",overrideToClaude:"Ghi đè lên Claude",overrideToClaudeExplicit:"Ghi đè lên Claude (rõ ràng)",setAsDefault:"Đặt làm mặc định",provider:"Nhà cung cấp",custom:"Tùy chỉnh"},settings:{sectionLoadFailed:"Không tải được phần",unknownError:"Đã xảy ra lỗi không xác định",reloadPage:"Tải lại trang",refresh:"Làm mới",copy:"Sao chép",copied:"Đã sao chép",saved:"Đã lưu",loading:"Đang tải...",configFileNotFound:"Không tìm thấy tập tin cấu hình"},settingsTabs:{web:"Web",env:"Env",think:"Tư duy",proxy:"Proxy",auth:"Xác thực",backup:"Sao lưu"},settingsAuth:{failedFetchTokens:"Không thể tải token xác thực",failedSaveTokens:"Không thể lưu token",tokensUpdated:"Đã cập nhật token. Khởi động lại CLIProxy để áp dụng.",failedRegenerate:"Không thể tạo lại bí mật",secretRegenerated:"Bí mật quản lý mới được tạo. Khởi động lại CLIProxy để áp dụng.",failedReset:"Không thể đặt lại token",tokensReset:"Token đã được đặt lại về mặc định. Khởi động lại CLIProxy để áp dụng.",description:"Cấu hình token xác thực CLIProxy. Các thay đổi yêu cầu khởi động lại CLIProxy.",apiKey:"Khóa API",custom:"Tùy chỉnh",apiKeyDesc:"Được Claude Code dùng để xác thực qua CLIProxy",apiKeyPlaceholder:"Khóa API",managementSecret:"Bí mật quản lý",managementSecretDesc:"Được bảng điều khiển CCS sử dụng để truy cập API quản lý CLIProxy",managementSecretPlaceholder:"Bí mật quản lý",generateSecret:"Tạo bí mật an toàn mới",resetDefaults:"Đặt lại về mặc định",resetDesc:"Đặt lại cả khóa API và bí mật quản lý về giá trị mặc định.",saving:"Đang lưu...",save:"Lưu"},settingsGlobalEnv:{description:"Biến môi trường được áp dụng cho tất cả hồ sơ không dùng Claude subscription (gemini, codex, agy, ghcp, v.v.)",enabled:"Đã bật Env toàn cầu",disabled:"Env toàn cầu bị vô hiệu hóa",enabledDesc:"Biến Env sẽ được áp dụng cho các hồ sơ bên thứ ba",disabledDesc:"Biến Env sẽ không được áp dụng",envVars:"Biến môi trường",noneConfigured:"Không có biến môi trường nào được cấu hình",addNew:"Thêm biến mới",keyName:"KEY_NAME",value:"giá trị",add:"Thêm",quickAdd:"Thêm nhanh các biến phổ biến",allConfigured:"Tất cả biến phổ biến đã được cấu hình"},settingsBackups:{failedFetch:"Không tìm nạp được bản sao lưu",failedRestore:"Không thể khôi phục bản sao lưu",restoreSuccess:"Đã khôi phục bản sao lưu thành công",title:"Sao lưu cài đặt",description:"Khôi phục các phiên bản trước của tệp settings.json của bạn. Bản sao lưu được tạo tự động khi cài đặt được sửa đổi.",none:"Không có bản sao lưu nào",noneHint:"Bản sao lưu sẽ xuất hiện ở đây khi bạn sửa đổi cài đặt",latest:"Mới nhất",restoring:"Đang khôi phục...",restore:"Khôi phục",restoreConfirmTitle:"Khôi phục bản sao lưu?",restoreConfirmPrefix:"Điều này sẽ thay thế cài đặt hiện tại của bạn bằng bản sao lưu từ",restoreConfirmSuffix:"Không thể hoàn tác hành động này.",cancel:"Hủy bỏ"},settingsWebsearch:{description:"Tìm kiếm trên web dựa trên CLI cho hồ sơ của bên thứ ba (gemini, codex, agy, v.v.)",enabled:"Đã bật Tìm kiếm trên web",disabled:"Tìm kiếm trên web bị vô hiệu hóa",checking:"Đang kiểm tra trạng thái...",providers:"Nhà cung cấp",noneConfigured:"Không có nhà cung cấp nào được cấu hình",noneConfiguredHint:"Cài công cụ CLI để bật các nhà cung cấp WebSearch",checkProviders:"Kiểm tra các nhà cung cấp",installed:"đã cài đặt",notInstalled:"chưa được cài đặt",model:"Mô hình:",howInstall:"Cách cài đặt {{name}} CLI",installGlobally:"Cài đặt trên toàn cầu",requiresKey:"(cần khóa API xAI)",freeTier:"(Có sẵn cấp MIỄN PHÍ)",viewDocs:"Xem tài liệu"},settingsProxy:{failedLoadAgyMode:"Không thể tải chế độ power user AGY",failedUpdateAgyMode:"Không thể cập nhật chế độ power user AGY",failedVerifyAgyMode:"Không thể xác minh trạng thái lưu của chế độ power user AGY",notPersistedAgyMode:"Chế độ power user AGY chưa được lưu bền vững. Cấu hình có thể đã bị tiến trình khác sửa.",agyModeEnabled:"Đã bật chế độ power user AGY.",agyModeDisabled:"Đã tắt chế độ power user AGY.",typePhraseToContinue:'Nhập "{{value}}" để tiếp tục.',description:"Định cấu hình kết nối {{backend}} cục bộ hoặc từ xa cho cấu hình dựa trên proxy",backendPlus:"CLIProxy Plus",backend:"CLIProxy",instanceStatus:"Trạng thái phiên bản",connectionMode:"Chế độ kết nối",local:"Cục bộ",remote:"Từ xa",localDesc:"Chạy nhị phân {{backend}} trên máy này",remoteDesc:"Kết nối với máy chủ {{backend}} từ xa",backendBinary:"Tệp thực thi backend",stopProxyToSwitch:"Dừng proxy đang chạy trong Trạng thái phiên bản trước khi chuyển backend.",default:"Mặc định",plusDesc:"Hỗ trợ đầy đủ nhà cung cấp, bao gồm Kiro và GitHub Copilot",originalDesc:"Binary gốc (chỉ Gemini, Codex, Antigravity)",variantsIncompatible:"Các biến thể Kiro/Copilot hiện tại sẽ không hoạt động với CLIProxyAPI. Chuyển sang CLIProxyAPIPlus hoặc xóa các biến thể đó.",safety:"An toàn",agyModeTitle:"Chế độ power user Antigravity",agyModeDesc:"Bỏ qua danh sách kiểm tra trách nhiệm AGY trong quy trình Thêm tài khoản và `ccs agy`.",agyWarning:"Chỉ bật nếu bạn hiểu rõ rủi ro bị đình chỉ/cấm OAuth (#509). CCS không chịu trách nhiệm khi mất tài khoản.",finalConfirm:"Xác nhận cuối cùng",finalConfirmDesc:"Việc bật tính năng này sẽ bỏ qua các điểm kiểm tra an toàn AGY trong cả bảng điều khiển và CLI. Xem lại vấn đề #509 và nhập cụm từ chính xác để tiếp tục.",step1:"Bước 1",readIssue:"Đọc vấn đề #509",step2:"Bước 2",typePrefix:"Nhập",typeSuffix:"để kích hoạt.",typePhraseAria:"Nhập I ACCEPT RISK để bật chế độ power user Antigravity",exactPhrase:"Phải nhập chính xác cụm từ.",enableAgyMode:"Bật chế độ power user",toggleAgyMode:"Chuyển đổi chế độ power user AGY",fallbackSettings:"Cài đặt dự phòng",enableFallback:"Cho phép dự phòng về cục bộ",enableFallbackDesc:"Sử dụng proxy cục bộ nếu không thể truy cập được từ xa",autoStartLocal:"Tự động khởi động proxy cục bộ",autoStartLocalDesc:"Tự động khởi động proxy cục bộ khi dự phòng",advanced:"Nâng cao",debugMode:"Chế độ gỡ lỗi",debugModeDesc:"Bật chẩn đoán dành cho nhà phát triển trong bảng điều khiển trình duyệt",debugModeEnabled:"Đã bật chế độ gỡ lỗi. Kiểm tra bảng điều khiển trình duyệt để biết nhật ký chi tiết.",localProxy:"Proxy cục bộ",port:"Cổng",autoStart:"Tự động khởi động",localAutoStartDesc:"Tự động khởi động proxy cục bộ khi cần",remoteConfigTitle:"Cấu hình máy chủ từ xa",host:"Host",hostPlaceholder:"192.168.1.100 hoặc proxy.example.com",defaultPort:"mặc định {{value}}",portPlaceholder:"Để trống để dùng {{value}}",protocol:"Giao thức",http:"HTTP",https:"HTTPS",apiKeyOptional:"Khóa API (tùy chọn)",apiKeyPlaceholder:"Đối với điểm cuối API /v1/*",apiKeyDesc:"Dùng cho các yêu cầu API đến /v1/chat/completions",managementKeyOptional:"Khóa quản lý (tùy chọn)",managementKeyPlaceholder:"Đối với điểm cuối /v0/management/*",managementKeyDesc:"Dùng cho API quản lý dashboard. Nếu bỏ trống sẽ dùng Khóa API.",testing:"Đang thử nghiệm...",testConnection:"Kiểm tra kết nối",connectedLatency:"Đã kết nối ({{value}}ms)",connectionFailed:"Kết nối không thành công",invalidPortOrEmpty:"Cổng phải là số nguyên từ 1 đến 65535 hoặc để trống theo mặc định",invalidLocalPort:"Cổng cục bộ phải là số nguyên từ 1 đến 65535",backendPlusApi:"CLIProxyAPIPlus",backendApi:"CLIProxyAPI"},settingsThinking:{description:"Định cấu hình tư duy/lý luận mở rộng cho các mô hình được hỗ trợ.",supportedProviders:"Nhà cung cấp được hỗ trợ",modeTitle:"Chế độ Thinking",modeAutoDesc:"Tự động thiết lập tư duy dựa trên tầng mô hình",modeOffDesc:"Vô hiệu hóa suy nghĩ mở rộng",modeManualDesc:"Đặt mức ghi đè liên tục hoặc sử dụng cờ CLI mỗi lần chạy",tierDefaults:"Mặc định cấp độ",tierDefaultsDesc:"Mức độ tư duy mặc định cho từng tầng mô hình khi ở chế độ tự động.",persistentOverride:"Ghi đè liên tục",persistentOverrideDesc:"Áp dụng cho tất cả các buổi. Cờ CLI vẫn được ưu tiên.",enterCustomBudget:"Nhập ngân sách tùy chỉnh",apply:"Áp dụng",providerOverrides:"Ghi đè nhà cung cấp ({{count}})",providerOverridesDesc:"Ghi đè mặc định cấp độ cho các nhà cung cấp cụ thể. Thêm khóa nhà cung cấp tùy chỉnh nếu cần.",addProviderPlaceholder:"Thêm khóa nhà cung cấp (ví dụ: qwen)",showWarnings:"Hiển thị cảnh báo",showWarningsDesc:"Hiển thị cảnh báo khi các giá trị suy nghĩ bị hạn chế hoặc điều chỉnh",cliEnvOverride:"Ghi đè CLI & Env",supportLine1Prefix:"Ngân sách suy nghĩ:",supportLine1Suffix:"(dựa trên token)",supportLine2Prefix:"Nỗ lực lý luận:",supportLine2SuffixPrefix:"(hậu tố hoặc ",supportLine2SuffixPostfix:": medium/high/xhigh)",supportLine3Prefix:"Hậu tố Codex cố định mức effort (ví dụ ",supportLine3Suffix:"); model không hậu tố sẽ dùng chế độ Thinking."},analytics:{title:"Phân tích",subtitle:"Theo dõi việc sử dụng và thông tin chi tiết",month:"Tháng",allTime:"Tất cả thời gian",updated:"Đã cập nhật {{value}}"},analyticsSummary:{totalTokens:"Tổng số token",totalTokensSubtitle:"{{input}} vào / {{output}} ra",totalCost:"Tổng chi phí",totalCostSubtitle:"trung bình ${{value}}/ngày",cacheTokens:"Token bộ đệm",cacheTokensSubtitle:"${{cost}} ({{percent}}% chi phí)",inputCost:"Chi phí đầu vào",outputCost:"Chi phí đầu ra",tokensSubtitle:"{{value}} token"},apiProfiles:{title:"Hồ sơ API",new:"Mới",searchPlaceholder:"Tìm kiếm hồ sơ...",loadingProfiles:"Đang tải hồ sơ...",failedLoadTitle:"Không tải được hồ sơ",failedLoadDesc:"Không thể tìm nạp hồ sơ API. Vui lòng thử lại.",retry:"Thử lại",noProfilesYet:"Chưa có hồ sơ API nào",noProfilesDesc:"Tạo hồ sơ đầu tiên của bạn để kết nối với các điểm cuối API tùy chỉnh",createProfile:"Tạo hồ sơ",noProfileMatch:'Không có hồ sơ nào khớp với "{{query}}"',profileCount:"{{count}} hồ sơ",profileCount_other:"{{count}} hồ sơ",configuredCount:"{{count}} đã cấu hình",deleteProfileTitle:"Xóa hồ sơ",deleteProfileDesc:'Bạn có chắc chắn muốn xóa "{{name}}" không? Thao tác này sẽ xóa tệp cài đặt và không thể hoàn tác.',delete:"Xóa",unsavedChangesTitle:"Những thay đổi chưa được lưu",unsavedChangesDesc:'Bạn có những thay đổi chưa được lưu trong "{{current}}". Hủy và chuyển sang "{{next}}"?',discardSwitch:"Loại bỏ và chuyển đổi"},accountsPage:{title:"Tài khoản",managePrefix:"Quản lý",manageSuffix:"tài khoản và nhóm đồng bộ từ một nơi.",mobileManageSuffix:"tính liên tục cho mỗi tài khoản.",primaryActions:"Hành động chính",createAccount:"Tạo tài khoản",authClaudeInPool:"Xác thực Claude trong Pool",openClaudePoolSettings:"Mở cài đặt Claude pool",openCliProxyClaudePool:"Mở CLIProxy Claude Pool",migrationFollowup:"Theo dõi sau di chuyển",legacyContextPending:"{{count}} tài khoản vẫn cần xác nhận chế độ lần đầu.",legacyContextPending_other:"{{count}} tài khoản vẫn cần xác nhận chế độ lần đầu.",legacyContinuityPending:"{{count}} tài khoản được chia sẻ vẫn ở mức độ liên tục kế thừa tiêu chuẩn.",legacyContinuityPending_other:"{{count}} tài khoản được chia sẻ vẫn ở mức độ liên tục kế thừa tiêu chuẩn.",confirmingLegacy:"Đang xác nhận chính sách kế thừa...",confirmLegacy:"Xác nhận chính sách kế thừa ({{count}})",noLegacyFollowup:"Không có hoạt động theo dõi kế thừa nào đang chờ xử lý.",continuityGuide:"Hướng dẫn liên tục",expandWhenNeeded:"Chỉ mở rộng khi cần thiết.",sharedStandard:"Tiêu chuẩn chung",sharedStandardDesc:"Chỉ đồng bộ hóa không gian làm việc của dự án. Mặc định tốt nhất cho hầu hết các đội.",sharedDeeper:"Chia sẻ sâu hơn",sharedDeeperPrefix:"Thêm",isolated:"Tách biệt",isolatedDesc:"Không có liên kết. Tốt nhất cho sự tách biệt nghiêm ngặt.",quickCommands:"Lệnh nhanh",quickCommandsDesc:"Sao chép và chạy trong terminal.",workspaceBadge:"Không gian làm việc `ccs auth`",historySyncBadge:"Kiểm soát đồng bộ hóa lịch sử",authAccounts:"Tài khoản xác thực",tableScopePrefix:"Bảng này được cố ý đặt trong phạm vi",tableScopeMiddle:"tài khoản. Sử dụng",tableScopeSuffix:"để thay đổi chế độ/nhóm/độ sâu.",accountMatrix:"Ma trận tài khoản",sharedTotalDesc:"Tổng số tài khoản chia sẻ: {{count}}. Bao gồm thao tác Sync và xác nhận kế thừa.",loadingAccounts:"Đang tải tài khoản..."},health:{justNow:"vừa xong",secondsAgo:"{{count}} giây trước",minutesAgo:"{{count}} phút trước",hoursAgo:"{{count}} giờ trước",systemHealth:"Tình trạng hệ thống",build:"bản dựng {{version}}",lastScan:"Lần quét cuối cùng:",autoRefresh:"Tự động làm mới:",refresh:"Làm mới",checks:"Kiểm tra",version:"Phiên bản",platform:"Nền tảng",liveMonitoring:"Giám sát trực tiếp đang hoạt động",copied:"Đã sao chép vào bảng nhớ tạm",refreshing:"Đang làm mới kiểm tra trạng thái...",fix:"Sửa chữa",applyFix:"Áp dụng bản sửa lỗi",healthLabel:"trạng thái"},updates:{actionRequired:"Hành động bắt buộc",done:"Xong",all:"Tất cả",inboxTitle:"Hộp thư cập nhật",inboxSubtitle:"Tập trung vào các hành động, sau đó đánh dấu các cập nhật đã hoàn tất hoặc bị loại bỏ.",needsAction:"Cần hành động",doneCount:"Xong",searchPlaceholder:"Tìm kiếm hành động hoặc lệnh",noNotices:"Không có thông báo nào khớp với chế độ xem này.",noUpdates:"Hiện không có bản cập nhật nào.",published:"Đã xuất bản {{date}}",markDone:"Đánh dấu hoàn tất",dismiss:"Ẩn",reopen:"Mở lại",doNext:"Làm tiếp theo",impactedIntegrations:"Tích hợp bị ảnh hưởng",impactedDesc:"Các khu vực liên quan dựa trên phạm vi cập nhật và định tuyến.",whyMatters:"Tại sao nó quan trọng",whyMattersDesc:"Chỉ ngữ cảnh ngắn, không có ghi chú phát hành trên tường văn bản.",open:"Mở",progressNeedsAction:"Cần hành động",progressInReview:"Đang xem xét",progressDone:"Xong",progressDismissed:"Bị loại bỏ",statusNew:"Mới",statusStable:"Ổn định",statusPlanned:"Đã lên kế hoạch",dashboard:"Trang tổng quan",cliUsage:"Cách sử dụng CLI"},cliproxyPage:{connected:"Đã kết nối",notConnected:"Chưa kết nối",variant:"Biến thể",parentNotConnected:"Profile gốc chưa kết nối",viaProvider:"qua {{provider}}",emptyTitle:"Trình quản lý hồ sơ CCS",emptyDesc:"Quản lý xác thực OAuth, tùy chọn tài khoản và chọn mô hình cho nhà cung cấp CLIProxy. Cấu hình cách CCS định tuyến yêu cầu đến các backend AI khác nhau.",emptyControlPanelPrefix:"Để biết số liệu thống kê sử dụng trực tiếp và theo dõi thời gian thực, hãy truy cập",controlPanel:"Bảng điều khiển",quickSetup:"Thiết lập nhanh",accountManagement:"Quản lý tài khoản cấp CCS",providers:"Nhà cung cấp",variants:"Biến thể",providerCount:"{{count}} nhà cung cấp",providerCount_other:"{{count}} nhà cung cấp",connectedCount:"{{count}} đã kết nối",variantDisplay:"{{name}} (biến thể {{provider}})"},copilotPage:{title:"Copilot",subtitle:"Proxy GitHub Copilot",setup:"Cài đặt",auth:"Xác thực",daemon:"Daemon",unofficialTitle:"API không chính thức - Bạn phải tự chịu rủi ro khi sử dụng",unofficialItem1:"API được thiết kế ngược - có thể bị hỏng bất cứ lúc nào",unofficialItem2:"Việc sử dụng quá mức có thể gây ra hạn chế tài khoản",unofficialItem3:"Không bảo hành, không chịu trách nhiệm từ CCS",yes:"Có",no:"Không",installed:"Đã cài đặt",missing:"Thiếu",integration:"Tích hợp",enabled:"Đã bật",disabled:"Đã tắt",github:"GitHub",connected:"Đã kết nối",notConnected:"Chưa kết nối",authenticate:"Xác thực",authenticating:"Đang xác thực...",status:"Trạng thái",running:"Đang chạy",stopped:"Đã dừng",port:"Cổng",stopping:"Đang dừng...",stop:"Dừng lại",starting:"Đang bắt đầu...",start:"Bắt đầu",installing:"Đang cài đặt...",installCopilotApi:"Cài đặt copilot-api",proxy:"Proxy",active:"Đang hoạt động",inactive:"Không hoạt động"},cursorPage:{title:"Cursor",beta:"Beta",subtitle:"Bảng điều khiển tích hợp Cursor",unofficialTitle:"API không chính thức - Bạn phải tự chịu rủi ro khi sử dụng",unofficialItem1:"Tích hợp thiết kế ngược có thể bị hỏng bất cứ lúc nào",unofficialItem2:"Lạm dụng hoặc sử dụng quá mức có thể có nguy cơ bị hạn chế tài khoản",unofficialItem3:"Không bảo hành, không chịu trách nhiệm từ CCS",integration:"Tích hợp",authentication:"Xác thực",daemon:"Daemon",enabled:"Đã bật",disabled:"Đã tắt",expired:"Hết hạn",connected:"Đã kết nối",notConnected:"Chưa kết nối",running:"Đang chạy",stopped:"Đã dừng",actions:"Hành động",disableIntegration:"Vô hiệu hóa tích hợp",enableIntegration:"Kích hoạt tích hợp",autoDetectAuth:"Tự động phát hiện xác thực",manualAuthImport:"Nhập xác thực thủ công",stopDaemon:"Dừng Daemon",startDaemon:"Khởi động Daemon",port:"Cổng",configuration:"Cấu hình Cursor",lastModified:"Sửa đổi lần cuối:",neverSaved:"Chưa bao giờ lưu",saving:"Đang lưu...",save:"Lưu",modelConfig:"Cấu hình mô hình",settings:"Cài đặt",info:"Thông tin",presets:"Cài đặt sẵn",presetsDesc:"Áp dụng ánh xạ mô hình được cấu hình sẵn",modelMapping:"Ánh xạ mô hình",modelMappingDesc:"Định cấu hình mô hình nào sẽ sử dụng cho từng tầng",defaultModel:"Mô hình mặc định",defaultModelDesc:"Dùng khi không chỉ định tier cụ thể.",opusModel:"Opus (Có khả năng nhất)",opusModelDesc:"Lý luận phức tạp và phản hồi chất lượng cao nhất.",sonnetModel:"Sonnet (Cân bằng)",sonnetModelDesc:"Khối lượng công việc mã hóa chung và trò chuyện hàng ngày.",haikuModel:"Haiku (Nhanh)",haikuModelDesc:"Đường dẫn yêu cầu nhẹ, độ trễ thấp.",runtimeSettings:"Cài đặt thời gian chạy",autoStartDaemon:"Daemon tự động khởi động",autoStartDesc:"Tự động khởi động daemon Cursor khi dùng tích hợp.",ghostMode:"Chế độ ma",ghostModeDesc:"Gửi x-ghost-mode để giảm telemetry.",provider:"Nhà cung cấp",filePath:"Đường dẫn tệp",availableModels:"Mô hình khả dụng",loadingModels:"Đang tải mô hình...",noModels:"Chưa có siêu dữ liệu mô hình nào. Bắt đầu daemon và làm mới.",default:"Mặc định",rawConfiguration:"Cấu hình thô (JSON)",manualImportTitle:"Nhập xác thực Cursor thủ công",manualImportDesc:"Cung cấp access token và machine ID của Cursor nếu không tự phát hiện được.",accessToken:"Access token",accessTokenPlaceholder:"Dán access token của Cursor",machineId:"ID máy",machineIdPlaceholder:"Hex 32 ký tự (UUID không có dấu gạch nối)",cancel:"Hủy bỏ",import:"Nhập",selectModel:"Chọn mô hình",useDefaultModel:"Sử dụng mô hình mặc định",availableModelCount:"Mô hình khả dụng ({{count}})",invalidPort:"Cổng phải là số nguyên từ 1 đến 65535",defaultModelRequired:"Mô hình mặc định là bắt buộc",savedConfig:"Đã lưu cấu hình Cursor và ánh xạ mô hình",failedSaveConfig:"Không lưu được cấu hình",modelsLoadingWait:"Mô hình vẫn đang tải. Vui lòng đợi trước khi áp dụng preset.",noModelsAvailable:"Chưa có mô hình nào. Hãy khởi động daemon rồi làm mới.",appliedCodexPreset:"Đã áp dụng preset Codex GPT-5.3",appliedClaudePreset:"Đã áp dụng preset Claude 4.6",appliedGeminiPreset:"Đã áp dụng preset Gemini 3",integrationEnabled:"Đã bật tích hợp Cursor",integrationDisabled:"Đã tắt tích hợp Cursor",failedUpdateIntegration:"Không cập nhật được trạng thái tích hợp",credentialsImported:"Đã nhập thông tin xác thực Cursor",autoDetectFailed:"Tự động phát hiện không thành công",manualRequired:"Cần token và machine ID",manualImportFailed:"Nhập thủ công không thành công",failedStartDaemon:"Không thể khởi động daemon",daemonStarted:"Đã khởi động daemon",daemonStartedWithPid:"Daemon đã khởi động (PID: {{pid}})",failedStopDaemon:"Không thể dừng daemon",daemonStopped:"Đã dừng daemon",rawLoading:"Cài đặt thô vẫn đang tải. Vui lòng đợi và thử lại.",invalidJson:"JSON không hợp lệ",rawSaved:"Đã lưu cài đặt thô",rawChanged:"Cài đặt thô đã thay đổi bên ngoài. Làm mới và thử lại.",failedSaveRaw:"Không lưu được cài đặt thô",savedAll:"Đã lưu cấu hình Cursor"},droidPage:{loadingDiagnostics:"Đang tải chẩn đoán Droid...",failedDiagnostics:"Không tải được chẩn đoán Droid.",overview:"Tổng quan",byok:"BYOK",docs:"Tài liệu",runtimeInstall:"Thời gian chạy và cài đặt",status:"Trạng thái",detected:"Đã phát hiện",notFound:"Không tìm thấy",detectionSource:"Nguồn phát hiện",binaryPath:"Đường dẫn nhị phân",installDirectory:"Thư mục cài đặt",version:"Phiên bản",overridePath:"Ghi đè (CCS_DROID_PATH)",configFiles:"Tệp cấu hình",path:"Đường dẫn",resolved:"Đã giải quyết",size:"Kích cỡ",lastModified:"Sửa đổi lần cuối",parseWarning:"Cảnh báo phân tích cú pháp: {{value}}",readWarning:"Đọc cảnh báo: {{value}}",warnings:"Cảnh báo",byokSummary:"Tóm tắt BYOK",activeModelSelector:"Bộ chọn mô hình hoạt động",customModels:"Mô hình tùy chỉnh",ccsManaged:"do CCS quản lý",userManaged:"Do người dùng quản lý",malformedEntries:"Mục nhập không đúng định dạng",providers:"Nhà cung cấp",none:"không có",customModelsTitle:"Mô hình tùy chỉnh",modelName:"Tên/model",provider:"Nhà cung cấp",baseUrl:"URL cơ sở",noCustomModels:"Không có mô hình tùy chỉnh",docsAlignedNotes:"Ghi chú được căn chỉnh trong Tài liệu",factoryDocs:"Tài liệu Factory",providerFactCheckDocs:"Tài liệu kiểm tra thực tế của nhà cung cấp",providerValues:"Giá trị của nhà cung cấp: {{value}}",settingsHierarchy:"Phân cấp cài đặt: {{value}}",settingsTitle:"Cài đặt BYOK của Droid",fixJsonBeforeQuickSettings:"Sửa cú pháp JSON trước khi sử dụng các điều khiển cài đặt nhanh.",fixJsonBeforeReasoning:"Sửa cú pháp JSON trước khi cập nhật cài đặt lý luận BYOK.",unableUpdateReasoning:"Không thể cập nhật cài đặt lý luận mô hình BYOK đã chọn.",fixJsonBeforeBudget:"Sửa cú pháp JSON trước khi cập nhật ngân sách tư duy.",anthropicOnlyBudget:"Ngân sách tư duy chỉ có sẵn cho các mô hình BYOK của Anthropic.",invalidJson:"JSON không hợp lệ: {{value}}",saved:"Đã lưu cài đặt Droid",changedExternally:"Cài đặt Droid đã thay đổi bên ngoài. Làm mới và thử lại.",failedSave:"Không lưu được cài đặt Droid"},sharedPage:{commands:"Lệnh",skills:"Kỹ năng",agents:"Agent",title:"Dữ liệu dùng chung",subtitle:"Các lệnh, kỹ năng và agent được chia sẻ giữa các phiên Claude",totalShared:"Tổng số mục dùng chung",visible:"Hiển thị",markdownDetail:"Chế độ xem chi tiết Markdown",filterPrefix:"Lọc:",configurationRequired:"Cần cấu hình",countsUnavailable:"Không có số liệu",retryCounts:"Số lần thử lại",filterPlaceholder:"Lọc {{tab}} theo tên, mô tả hoặc đường dẫn",showing:"Đang hiển thị {{visible}} trong số {{total}} {{tab}}",showingQuery:'cho "{{query}}"',refreshing:"(đang làm mới...)",loadingShared:"Đang tải {{tab}} dùng chung...",failedLoadShared:"Không tải được danh sách {{tab}} dùng chung",retry:"Thử lại",noSharedFound:"Không tìm thấy {{tab}} dùng chung. Chạy `ccs sync` hoặc thêm mục trong thư mục dùng chung của bạn.",noMatch:'Không có {{tab}} khớp với "{{query}}".',selectOne:"Chọn {{tab}} để xem toàn bộ nội dung.",pathLabel:"Đường dẫn",resolvedSource:"Nguồn đã giải quyết",loadingMarkdown:"Đang tải nội dung Markdown...",failedLoadContent:"Không tải được nội dung",retryContent:"Thử lại nội dung",noMarkdown:"Không có nội dung Markdown khả dụng."}}}};ct.isInitialized||ct.use(Ew).init({resources:qw,lng:Bw(),fallbackLng:"en",interpolation:{escapeValue:!1}});const Gw={theme:"system",setTheme:()=>null,isDark:!1},rx=S.createContext(Gw);function Yw({children:n,defaultTheme:a="system",storageKey:s="vite-ui-theme"}){const[l,u]=S.useState(()=>localStorage.getItem(s)||a),[f,h]=S.useState(()=>typeof window<"u"?window.matchMedia("(prefers-color-scheme: dark)").matches:!1);S.useEffect(()=>{const y=window.matchMedia("(prefers-color-scheme: dark)"),C=x=>{h(x.matches)};return y.addEventListener("change",C),()=>y.removeEventListener("change",C)},[]);const m=l==="dark"||l==="system"&&f;S.useEffect(()=>{const y=window.document.documentElement;y.classList.remove("light","dark"),y.classList.add(m?"dark":"light")},[m]);const p={theme:l,setTheme:y=>{localStorage.setItem(s,y),u(y)},isDark:m};return r.jsx(rx.Provider,{value:p,children:n})}const cx=S.createContext(null),Ig="ccs-privacy-mode";function Vw({children:n}){const[a,s]=S.useState(()=>typeof window<"u"?localStorage.getItem(Ig)==="true":!1);S.useEffect(()=>{localStorage.setItem(Ig,String(a))},[a]);const l=S.useCallback(()=>s(f=>!f),[]),u=S.useMemo(()=>({privacyMode:a,togglePrivacyMode:l}),[a,l]);return r.jsx(cx.Provider,{value:u,children:n})}function _d(){const n=S.useContext(cx);if(!n)throw new Error("usePrivacy must be used within a PrivacyProvider");return n}const ux="blur-[4px] select-none hover:blur-none transition-all duration-200",Fw="/api/auth";async function zd(n,a){const s=await fetch(`${Fw}${n}`,{headers:{"Content-Type":"application/json"},credentials:"include",...a});if(!s.ok){const l=await s.json().catch(()=>({error:"Unknown error"}));throw new Error(l.error||s.statusText)}return s.json()}function Qw(){return zd("/check")}function $w(n,a){return zd("/login",{method:"POST",body:JSON.stringify({username:n,password:a})})}function Ww(){return zd("/logout",{method:"POST"})}const dx=S.createContext(null);function Xw({children:n}){const[a,s]=S.useState(!1),[l,u]=S.useState(!1),[f,h]=S.useState(null),[m,p]=S.useState(!0);S.useEffect(()=>{Qw().then(b=>{s(b.authRequired),u(b.authenticated),h(b.username)}).catch(()=>{s(!1),u(!0)}).finally(()=>p(!1))},[]);const y=S.useCallback(async(b,N)=>{const w=await $w(b,N);u(!0),h(w.username)},[]),C=S.useCallback(async()=>{await Ww(),u(!1),h(null)},[]),x=S.useMemo(()=>({authRequired:a,isAuthenticated:l,username:f,loading:m,login:y,logout:C}),[a,l,f,m,y,C]);return r.jsx(dx.Provider,{value:x,children:n})}function Ud(){const n=S.useContext(dx);if(!n)throw new Error("useAuth must be used within an AuthProvider");return n}function Zw(){const{authRequired:n,isAuthenticated:a,loading:s}=Ud(),l=gr();return s?r.jsx("div",{className:"flex h-screen items-center justify-center",children:r.jsx(Dn,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):n?a?r.jsx(md,{}):r.jsx(gS,{to:"/login",state:{from:l},replace:!0}):r.jsx(md,{})}const ed=768;function Jw(){const[n,a]=S.useState(void 0);return S.useEffect(()=>{const s=window.matchMedia(`(max-width: ${ed-1}px)`),l=()=>{a(window.innerWidth<ed)};return s.addEventListener("change",l),a(window.innerWidth<ed),()=>s.removeEventListener("change",l)},[]),!!n}const fx=S.createContext(null);function kr(){const n=S.useContext(fx);if(!n)throw new Error("useSidebar must be used within a SidebarProvider.");return n}function K(...n){return iC(oC(n))}function hx(n){if(!Number.isFinite(n))return"0";const a=Math.max(0,Math.min(100,n));return`${Math.round(a)}`}const Hg=["#f94144","#f3722c","#f8961e","#f9844a","#f9c74f","#90be6d","#43aa8b","#4d908e","#577590","#277da1"],Ft={success:"#15803d",degraded:"#b45309",failed:"#b91c1c"};function tD(n){let a=2166136261;for(let s=0;s<n.length;s++)a^=n.charCodeAt(s),a=Math.imul(a,16777619);return Hg[(a>>>0)%Hg.length]}function bd(n){if(!n)return null;try{const a=new Date(n),s=new Date,l=a.getTime()-s.getTime();if(l<=0)return"soon";const u=Math.floor(l/(1e3*60*60));if(u>=24)return a.toLocaleDateString(void 0,{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"});const f=Math.floor(l%(1e3*60*60)/(1e3*60));return u>0?`in ${u}h ${f}m`:`in ${f}m`}catch{return null}}function Id(n){return n.filter(a=>{const s=(a.displayName||a.name||"").toLowerCase();return s.includes("claude")||s.includes("gpt")})}function eN(n){if(n.length===0)return null;const a=Id(n);if(a.length===0)return 0;const s=a.map(l=>l.percentage).filter(l=>typeof l=="number"&&isFinite(l));return s.length===0?0:Math.min(...s)}function tN(n){if(n.length===0)return null;const a=Id(n);return a.length===0?null:a.reduce((s,l)=>l.resetTime?s?new Date(l.resetTime)<new Date(s)?l.resetTime:s:l.resetTime:s,null)}const nN=/claude-(?:opus|sonnet)-4(?:[.-])5(?:-thinking)?(?=(?:$|[^a-z0-9]))/i;function nD(n){return nN.test((n||"").trim())}const aN=[{name:"claude-opus-4-6-thinking",displayName:"Claude Opus 4.6 (Thinking)"},{name:"claude-sonnet-4-6",displayName:"Claude Sonnet 4.6"},{name:"gpt-oss-120b",displayName:"GPT-OSS 120B (Medium)"}];function iN(n){const a=n.toLowerCase();return a.includes("claude")||a.includes("gpt")?"primary":a.includes("gemini 3")||a.includes("gemini-3")?"gemini-3":a.includes("gemini 2")||a.includes("gemini-2")?"gemini-2":"other"}function oN(n){if(n.length===0)return[];const a=Id(n),s=[];if(a.length===0)for(const u of aN)s.push({name:u.name,displayName:u.displayName,percentage:0,tier:"primary",exhausted:!0});for(const u of n){const f=u.displayName||u.name,h=iN(f);s.push({name:u.name,displayName:f,percentage:u.percentage,tier:h,exhausted:h==="primary"&&u.percentage===0})}const l=["primary","gemini-3","gemini-2","other"];return s.sort((u,f)=>{const h=l.indexOf(u.tier)-l.indexOf(f.tier);return h!==0?h:u.displayName.localeCompare(f.displayName)})}function sN(n){const a=new Map;for(const s of n){const l=a.get(s.tier)||[];l.push(s),a.set(s.tier,l)}return a}function Ms(n){const a=(n||"").toLowerCase(),s=a.includes("code review")||a.includes("code_review"),l=a.includes("primary"),u=a.includes("secondary");return s?l?"code-review-5h":u?"code-review-weekly":"code-review":l?"usage-5h":u?"usage-weekly":"unknown"}function lN(n,a){if(Ms(n.label)==="code-review-weekly")return"weekly";const l=n.resetAfterSeconds;if(typeof l!="number"||!isFinite(l)||l<=0)return null;const u=a.find(p=>Ms(p.label)==="usage-5h"&&typeof p.resetAfterSeconds=="number"&&isFinite(p.resetAfterSeconds)&&p.resetAfterSeconds>0),f=a.find(p=>Ms(p.label)==="usage-weekly"&&typeof p.resetAfterSeconds=="number"&&isFinite(p.resetAfterSeconds)&&p.resetAfterSeconds>0);if(!u||!f)return null;const h=Math.abs(l-u.resetAfterSeconds);return Math.abs(l-f.resetAfterSeconds)<=h?"weekly":"5h"}function rN(n,a=[]){const s=typeof n=="string"?n:n.label,l=typeof n=="string"?{label:s,resetAfterSeconds:null}:{label:s,resetAfterSeconds:n.resetAfterSeconds},u=a.length>0?a:[l];switch(Ms(s)){case"usage-5h":return"5h usage limit";case"usage-weekly":return"Weekly usage limit";case"code-review-5h":case"code-review-weekly":case"code-review":{const f=lN(l,u);return f==="5h"?"Code review (5h)":f==="weekly"?"Code review (weekly)":"Code review"}case"unknown":return s}}function jr(n){if(!n||n.length===0)return{fiveHourWindow:null,weeklyWindow:null,codeReviewWindows:[],unknownWindows:[]};let a=null,s=null;const l=[],u=[],f=[];for(const h of n)switch(Ms(h.label)){case"usage-5h":a||(a=h),f.push(h);break;case"usage-weekly":s||(s=h),f.push(h);break;case"code-review-5h":case"code-review-weekly":case"code-review":l.push(h);break;case"unknown":u.push(h),f.push(h);break}if((!a||!s)&&f.length>0){const h=f.filter(m=>typeof m.resetAfterSeconds=="number"&&m.resetAfterSeconds>=0).sort((m,p)=>(m.resetAfterSeconds||0)-(p.resetAfterSeconds||0));a||(a=h[0]||f[0]||null),s||(s=h.length>1?h[h.length-1]:f.find(m=>m!==a)||null)}return{fiveHourWindow:a,weeklyWindow:s,codeReviewWindows:l,unknownWindows:u}}function cN(n){if(!n||n.length===0)return null;const{fiveHourWindow:a,weeklyWindow:s}=jr(n),l=[a,s].filter((h,m,p)=>!!h&&p.indexOf(h)===m),f=(l.length>0?l:n).map(h=>h.remainingPercent);return Math.min(...f)}function uN(n){if(!n||n.length===0)return null;const{fiveHourWindow:a,weeklyWindow:s}=jr(n),l=[a,s].filter((h,m,p)=>!!h&&p.indexOf(h)===m),f=(l.length>0?l:n).map(h=>h.resetAt).filter(h=>h!==null);return f.length===0?null:f.sort()[0]}function dN(n){if(!n.success)return null;const a=[n.coreUsage?.fiveHour,n.coreUsage?.weekly].filter(l=>!!l);if(a.length>0)return Math.min(...a.map(l=>l.remainingPercent));const s=n.windows.filter(l=>l.rateLimitType!=="overage");return s.length>0?Math.min(...s.map(l=>l.remainingPercent)):null}function fN(n){if(!n.success)return null;const a=[n.coreUsage?.fiveHour?.resetAt,n.coreUsage?.weekly?.resetAt].filter(l=>!!l);if(a.length>0)return a.sort()[0];const s=n.windows.filter(l=>l.rateLimitType!=="overage").map(l=>l.resetAt).filter(l=>l!==null);return s.length===0?null:s.sort()[0]}function hN(n){if(!n||n.length===0)return null;const a=n.map(s=>s.remainingPercent);return Math.min(...a)}function mN(n){if(!n||n.length===0)return null;const a=n.map(s=>s.resetTime).filter(s=>s!==null);return a.length===0?null:a.sort()[0]}function pN(n){if(!n)return null;const a=[n.premiumInteractions.percentRemaining,n.chat.percentRemaining,n.completions.percentRemaining].filter(s=>typeof s=="number"&&isFinite(s));return a.length===0?null:Math.min(...a)}function Kn(n){return typeof n=="object"&&n!==null}function Ai(n){return typeof n=="number"&&Number.isFinite(n)}function Hd(n){if(!Kn(n))return!1;const a=n.models;return typeof n.success=="boolean"&&Array.isArray(a)}function Tr(n){if(!Kn(n))return!1;const a=n;return typeof a.success!="boolean"||!Array.isArray(a.windows)||!("planType"in a)?!1:a.windows.every(s=>Kn(s)&&typeof s.label=="string"&&Ai(s.usedPercent)&&Ai(s.remainingPercent))}function Mr(n){if(!Kn(n))return!1;const a=n;return typeof a.success!="boolean"||!Array.isArray(a.windows)||"planType"in a?!1:a.windows.every(s=>Kn(s)&&typeof s.rateLimitType=="string"&&Ai(s.remainingPercent)&&typeof s.status=="string")}function Bd(n){if(!Kn(n))return!1;const a=n;return typeof a.success!="boolean"||!Array.isArray(a.buckets)?!1:a.buckets.every(s=>Kn(s)&&typeof s.id=="string"&&Ai(s.remainingFraction)&&Ai(s.remainingPercent)&&Array.isArray(s.modelIds))}function Kd(n){if(!Kn(n))return!1;const a=n,s=a.snapshots;return typeof a.success!="boolean"||!Kn(s)?!1:["premiumInteractions","chat","completions"].every(u=>{const f=s[u];return Kn(f)&&Ai(f.percentRemaining)&&Ai(f.percentUsed)})}function gN(n,a){if(!a?.success)return null;switch(n.trim().toLowerCase()){case"agy":return Hd(a)?eN(a.models):null;case"codex":return Tr(a)?cN(a.windows):null;case"claude":case"anthropic":return Mr(a)?dN(a):null;case"gemini":return Bd(a)?hN(a.buckets):null;case"ghcp":case"github-copilot":return Kd(a)?pN(a.snapshots):null;default:return null}}function yN(n,a){if(!a?.success)return null;switch(n.trim().toLowerCase()){case"agy":return Hd(a)?tN(a.models):null;case"codex":return Tr(a)?uN(a.windows):null;case"claude":case"anthropic":return Mr(a)?fN(a):null;case"gemini":return Bd(a)?mN(a.buckets):null;case"ghcp":case"github-copilot":return Kd(a)?a.quotaResetDate:null;default:return null}}const ar=Nr("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:ring-1 focus-visible:ring-ring aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function ut({className:n,variant:a,size:s,asChild:l=!1,...u}){const f=l?pr:"button";return r.jsx(f,{"data-slot":"button",className:K(ar({variant:a,size:s,className:n})),...u})}function Un({className:n,type:a,...s}){return r.jsx("input",{type:a,"data-slot":"input",className:K("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",n),...s})}function xN({...n}){return r.jsx(Ay,{"data-slot":"sheet",...n})}function vN({...n}){return r.jsx(Dy,{"data-slot":"sheet-portal",...n})}function bN({className:n,...a}){return r.jsx(Ey,{"data-slot":"sheet-overlay",className:K("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",n),...a})}function SN({className:n,children:a,side:s="right",...l}){return r.jsxs(vN,{children:[r.jsx(bN,{}),r.jsxs(ky,{"data-slot":"sheet-content",className:K("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",s==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",s==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",s==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",s==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",n),...l,children:[a,r.jsxs(jy,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[r.jsx(bo,{className:"size-4"}),r.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function CN({className:n,...a}){return r.jsx("div",{"data-slot":"sheet-header",className:K("flex flex-col gap-1.5 p-4",n),...a})}function wN({className:n,...a}){return r.jsx(Ty,{"data-slot":"sheet-title",className:K("text-foreground font-semibold",n),...a})}function NN({className:n,...a}){return r.jsx(My,{"data-slot":"sheet-description",className:K("text-muted-foreground text-sm",n),...a})}function Ke({className:n,...a}){return r.jsx("div",{"data-slot":"skeleton",className:K("relative overflow-hidden bg-muted/50 before:absolute before:inset-0 before:-translate-x-full","before:bg-gradient-to-r before:from-transparent before:via-muted/30 before:to-transparent","before:animate-[shimmer_2s_infinite_ease-out] rounded-md",n),...a})}function Ci({delayDuration:n=0,...a}){return r.jsx(U0,{"data-slot":"tooltip-provider",delayDuration:n,...a})}function $a({...n}){return r.jsx(Ci,{children:r.jsx(I0,{"data-slot":"tooltip",...n})})}function Wa({...n}){return r.jsx(H0,{"data-slot":"tooltip-trigger",...n})}function Xa({className:n,sideOffset:a=0,children:s,...l}){return r.jsx(B0,{children:r.jsxs(K0,{"data-slot":"tooltip-content",sideOffset:a,className:K("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",n),...l,children:[s,r.jsx(q0,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}const AN="sidebar_state",kN=3600*24*7,jN="16rem",TN="18rem",MN="3rem",DN="b";function EN({defaultOpen:n=!0,open:a,onOpenChange:s,className:l,style:u,children:f,...h}){const m=Jw(),[p,y]=S.useState(!1),[C,x]=S.useState(n),b=a??C,N=S.useCallback(M=>{const H=typeof M=="function"?M(b):M;s?s(H):x(H),document.cookie=`${AN}=${H}; path=/; max-age=${kN}`},[s,b]),w=S.useCallback(()=>m?y(M=>!M):N(M=>!M),[m,N,y]);S.useEffect(()=>{const M=H=>{H.key===DN&&(H.metaKey||H.ctrlKey)&&(H.preventDefault(),w())};return window.addEventListener("keydown",M),()=>window.removeEventListener("keydown",M)},[w]);const T=b?"expanded":"collapsed",E=S.useMemo(()=>({state:T,open:b,setOpen:N,isMobile:m,openMobile:p,setOpenMobile:y,toggleSidebar:w}),[T,b,N,m,p,y,w]);return r.jsx(fx.Provider,{value:E,children:r.jsx(Ci,{delayDuration:0,children:r.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":jN,"--sidebar-width-icon":MN,...u},className:K("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex h-svh min-h-0 w-full overflow-hidden",l),...h,children:f})})})}function ON({side:n="left",variant:a="sidebar",collapsible:s="offcanvas",className:l,children:u,...f}){const{isMobile:h,state:m,openMobile:p,setOpenMobile:y}=kr();return s==="none"?r.jsx("div",{"data-slot":"sidebar",className:K("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",l),...f,children:u}):h?r.jsx(xN,{open:p,onOpenChange:y,...f,children:r.jsxs(SN,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:{"--sidebar-width":TN},side:n,children:[r.jsxs(CN,{className:"sr-only",children:[r.jsx(wN,{children:"Sidebar"}),r.jsx(NN,{children:"Displays the mobile sidebar."})]}),r.jsx("div",{className:"flex h-full w-full flex-col",children:u})]})}):r.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":m,"data-collapsible":m==="collapsed"?s:"","data-variant":a,"data-side":n,"data-slot":"sidebar",children:[r.jsx("div",{"data-slot":"sidebar-gap",className:K("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",a==="floating"||a==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),r.jsx("div",{"data-slot":"sidebar-container",className:K("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",n==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",a==="floating"||a==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",l),...f,children:r.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:u})})]})}function RN({className:n,onClick:a,...s}){const{toggleSidebar:l}=kr();return r.jsxs(ut,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:K("size-7",n),onClick:u=>{a?.(u),l()},...s,children:[r.jsx(AS,{}),r.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function PN({className:n,...a}){return r.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:K("flex flex-col gap-2 p-2",n),...a})}function LN({className:n,...a}){return r.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:K("flex flex-col gap-2 p-2",n),...a})}function _N({className:n,...a}){return r.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:K("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",n),...a})}function zN({className:n,...a}){return r.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:K("relative flex w-full min-w-0 flex-col p-2",n),...a})}function UN({className:n,asChild:a=!1,...s}){const l=a?pr:"div";return r.jsx(l,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:K("text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",n),...s})}function IN({className:n,...a}){return r.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:K("w-full text-sm",n),...a})}function HN({className:n,...a}){return r.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:K("flex w-full min-w-0 flex-col gap-1 group-data-[collapsible=icon]:items-center",n),...a})}function BN({className:n,...a}){return r.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:K("group/menu-item relative",n),...a})}const KN=Nr("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 group-data-[collapsible=icon]:justify-center",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function Bg({asChild:n=!1,isActive:a=!1,variant:s="default",size:l="default",tooltip:u,className:f,...h}){const m=n?pr:"button",{isMobile:p,state:y}=kr(),C=r.jsx(m,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":l,"data-active":a,className:K(KN({variant:s,size:l}),f),...h});return u?(typeof u=="string"&&(u={children:u}),r.jsxs($a,{children:[r.jsx(Wa,{asChild:!0,children:C}),r.jsx(Xa,{side:"right",align:"center",hidden:y!=="collapsed"||p,...u})]})):C}function qN({className:n,...a}){return r.jsx("ul",{"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:K("border-sidebar-border mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",n),...a})}function GN({className:n,...a}){return r.jsx("li",{"data-slot":"sidebar-menu-sub-item","data-sidebar":"menu-sub-item",className:K("group/menu-sub-item relative",n),...a})}function YN({asChild:n=!1,size:a="md",isActive:s=!1,className:l,...u}){const f=n?pr:"a";return r.jsx(f,{"data-slot":"sidebar-menu-sub-button","data-sidebar":"menu-sub-button","data-size":a,"data-active":s,className:K("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-hidden focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",a==="sm"&&"text-xs",a==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",l),...u})}const VN={sm:24,md:32,lg:48};function mx({size:n="md",className:a,showText:s=!0}){const l=VN[n];return r.jsxs("div",{className:K("flex items-center gap-2",a),children:[r.jsx("img",{src:"/logo/ccs-logo-256.png",alt:"CCS Logo",width:l,height:l,className:"rounded"}),s&&r.jsx("span",{className:"font-bold text-lg",children:"CCS Config"})]})}const Jl="/api",px="CONFLICT";class aD extends Error{code=px;constructor(a="Resource modified externally"){super(a),this.name="ApiConflictError"}}function iD(n){return n instanceof Error&&"code"in n&&n.code===px}function ws(n){return n?/^https?:\/\//i.test(n)||n===Jl||n.startsWith(`${Jl}/`)?n:`${Jl}${n.startsWith("/")?n:`/${n}`}`:Jl}async function FN(n){const a=`Request failed (${n.status}${n.statusText?` ${n.statusText}`:""})`,s=await n.text();if(!s)return a;try{const l=JSON.parse(s);return l.error?.trim()?l.error:l.message?.trim()?l.message:a}catch{return s.trim()||a}}async function ge(n,a){const s=await fetch(ws(n),{headers:{"Content-Type":"application/json"},...a});if(!s.ok)throw new Error(await FN(s));if(s.status===204)return;if((s.headers.get("content-type")?.toLowerCase()??"").includes("application/json"))return await s.json();const u=await s.text();if(u)try{return JSON.parse(u)}catch{return u}}const Qe={profiles:{list:()=>ge("/profiles"),create:n=>ge("/profiles",{method:"POST",body:JSON.stringify(n)}),update:(n,a)=>ge(`/profiles/${n}`,{method:"PUT",body:JSON.stringify(a)}),delete:n=>ge(`/profiles/${n}`,{method:"DELETE"})},cliproxy:{list:()=>ge("/cliproxy"),getAuthStatus:()=>ge("/cliproxy/auth"),create:n=>ge("/cliproxy",{method:"POST",body:JSON.stringify(n)}),update:(n,a)=>ge(`/cliproxy/${n}`,{method:"PUT",body:JSON.stringify(a)}),delete:n=>ge(`/cliproxy/${n}`,{method:"DELETE"}),proxyStatus:()=>ge("/cliproxy/proxy-status"),proxyStart:()=>ge("/cliproxy/proxy-start",{method:"POST"}),proxyStop:()=>ge("/cliproxy/proxy-stop",{method:"POST"}),updateCheck:()=>ge("/cliproxy/update-check"),versions:()=>ge("/cliproxy/versions"),install:(n,a)=>ge("/cliproxy/install",{method:"POST",body:JSON.stringify({version:n,force:a})}),restart:()=>ge("/cliproxy/restart",{method:"POST"}),stats:()=>ge("/cliproxy/usage"),models:()=>ge("/cliproxy/models"),updateModel:(n,a)=>ge(`/cliproxy/models/${n}`,{method:"PUT",body:JSON.stringify({model:a})}),getConfigYaml:async()=>{const n=await fetch(ws("/cliproxy/config.yaml"));if(!n.ok)throw new Error("Failed to load config");return n.text()},saveConfigYaml:async n=>{const a=await fetch(ws("/cliproxy/config.yaml"),{method:"PUT",headers:{"Content-Type":"application/yaml"},body:n});if(!a.ok){const s=await a.json().catch(()=>({error:"Failed to save config"}));throw new Error(s.error||"Failed to save config")}},getAuthFiles:()=>ge("/cliproxy/auth-files"),getAuthFile:async n=>{const a=await fetch(ws(`/cliproxy/auth-files/download?name=${encodeURIComponent(n)}`));if(!a.ok)throw new Error("Failed to load auth file");return a.text()},accounts:{list:()=>ge("/cliproxy/auth/accounts"),listByProvider:n=>ge(`/cliproxy/auth/accounts/${n}`),setDefault:(n,a)=>ge(`/cliproxy/auth/accounts/${n}/default`,{method:"POST",body:JSON.stringify({accountId:a})}),remove:(n,a)=>ge(`/cliproxy/auth/accounts/${n}/${a}`,{method:"DELETE"}),pause:(n,a)=>ge(`/cliproxy/auth/accounts/${n}/${a}/pause`,{method:"POST"}),resume:(n,a)=>ge(`/cliproxy/auth/accounts/${n}/${a}/resume`,{method:"POST"}),solo:(n,a)=>ge("/accounts/solo",{method:"POST",body:JSON.stringify({provider:n,accountId:a})}),bulkPause:(n,a)=>ge("/accounts/bulk-pause",{method:"POST",body:JSON.stringify({provider:n,accountIds:a})}),bulkResume:(n,a)=>ge("/accounts/bulk-resume",{method:"POST",body:JSON.stringify({provider:n,accountIds:a})})},auth:{start:(n,a)=>ge(`/cliproxy/auth/${n}/start`,{method:"POST",body:JSON.stringify({nickname:a})}),cancel:n=>ge(`/cliproxy/auth/${n}/cancel`,{method:"POST"}),kiroImport:()=>ge("/cliproxy/auth/kiro/import",{method:"POST"})},errorLogs:{list:()=>ge("/cliproxy/error-logs"),getContent:async n=>{const a=await fetch(ws(`/cliproxy/error-logs/${encodeURIComponent(n)}`));if(!a.ok)throw new Error("Failed to load error log");return a.text()}}},accounts:{list:()=>ge("/accounts"),setDefault:n=>ge("/accounts/default",{method:"POST",body:JSON.stringify({name:n})}),resetDefault:()=>ge("/accounts/reset-default",{method:"DELETE"}),delete:n=>ge(`/accounts/${n}`,{method:"DELETE"}),updateContext:(n,a)=>ge(`/accounts/${encodeURIComponent(n)}/context`,{method:"PUT",body:JSON.stringify(a)})},config:{format:()=>ge("/config/format"),get:()=>ge("/config"),update:n=>ge("/config",{method:"PUT",body:JSON.stringify(n)}),migrate:(n=!1)=>ge(`/config/migrate?dryRun=${n}`,{method:"POST"}),rollback:n=>ge("/config/rollback",{method:"POST",body:JSON.stringify({backupPath:n})})},presets:{list:n=>ge(`/settings/${n}/presets`),create:(n,a)=>ge(`/settings/${n}/presets`,{method:"POST",body:JSON.stringify(a)}),delete:(n,a)=>ge(`/settings/${n}/presets/${encodeURIComponent(a)}`,{method:"DELETE"})},cliproxyServer:{get:()=>ge("/cliproxy-server"),update:n=>ge("/cliproxy-server",{method:"PUT",body:JSON.stringify(n)}),getBackend:()=>ge("/cliproxy-server/backend"),updateBackend:(n,a=!1)=>ge("/cliproxy-server/backend",{method:"PUT",body:JSON.stringify({backend:n,force:a})}),test:n=>ge("/cliproxy-server/test",{method:"POST",body:JSON.stringify(n)})},quota:{get:(n,a)=>ge(`/cliproxy/quota/${n}/${encodeURIComponent(a)}`),getCodex:n=>ge(`/cliproxy/quota/codex/${encodeURIComponent(n)}`),getClaude:n=>ge(`/cliproxy/quota/claude/${encodeURIComponent(n)}`),getGemini:n=>ge(`/cliproxy/quota/gemini/${encodeURIComponent(n)}`)}};function oD(){return jt({queryKey:["cliproxy"],queryFn:()=>Qe.cliproxy.list()})}function QN(){return jt({queryKey:["cliproxy-auth"],queryFn:()=>Qe.cliproxy.getAuthStatus()})}function sD(){const n=dt();return pt({mutationFn:a=>Qe.cliproxy.create(a),onSuccess:()=>{n.invalidateQueries({queryKey:["cliproxy"]}),ce.success("Variant created successfully")},onError:a=>{ce.error(a.message)}})}function lD(){const n=dt();return pt({mutationFn:a=>Qe.cliproxy.delete(a),onSuccess:()=>{n.invalidateQueries({queryKey:["cliproxy"]}),ce.success("Variant deleted successfully")},onError:a=>{ce.error(a.message)}})}function rD(){const n=dt();return pt({mutationFn:({provider:a,accountId:s})=>Qe.cliproxy.accounts.setDefault(a,s),onSuccess:()=>{n.invalidateQueries({queryKey:["cliproxy-accounts"]}),n.invalidateQueries({queryKey:["cliproxy-auth"]}),ce.success("Default account updated")},onError:a=>{ce.error(a.message)}})}function cD(){const n=dt();return pt({mutationFn:({provider:a,accountId:s})=>Qe.cliproxy.accounts.remove(a,s),onSuccess:()=>{n.invalidateQueries({queryKey:["cliproxy-accounts"]}),n.invalidateQueries({queryKey:["cliproxy-auth"]}),ce.success("Account removed")},onError:a=>{ce.error(a.message)}})}function $N(){const n=dt();return pt({mutationFn:({provider:a,accountId:s})=>Qe.cliproxy.accounts.pause(a,s),onSuccess:()=>{n.invalidateQueries({queryKey:["cliproxy-accounts"]}),n.invalidateQueries({queryKey:["cliproxy-auth"]}),n.invalidateQueries({queryKey:["cliproxy-stats"]}),ce.success("Account paused")},onError:a=>{ce.error(a.message)}})}function WN(){const n=dt();return pt({mutationFn:({provider:a,accountId:s})=>Qe.cliproxy.accounts.resume(a,s),onSuccess:()=>{n.invalidateQueries({queryKey:["cliproxy-accounts"]}),n.invalidateQueries({queryKey:["cliproxy-auth"]}),n.invalidateQueries({queryKey:["cliproxy-stats"]}),ce.success("Account resumed")},onError:a=>{ce.error(a.message)}})}function uD(){const n=dt();return pt({mutationFn:({provider:a,accountId:s})=>Qe.cliproxy.accounts.solo(a,s),onSuccess:a=>{n.invalidateQueries({queryKey:["cliproxy-accounts"]}),n.invalidateQueries({queryKey:["cliproxy-auth"]}),n.invalidateQueries({queryKey:["cliproxy-stats"]});const s=a.paused.length;ce.success(`Solo mode: paused ${s} other account${s!==1?"s":""}`)},onError:a=>{ce.error(a.message)}})}function dD(){const n=dt();return pt({mutationFn:({provider:a,accountIds:s})=>Qe.cliproxy.accounts.bulkPause(a,s),onSuccess:a=>{n.invalidateQueries({queryKey:["cliproxy-accounts"]}),n.invalidateQueries({queryKey:["cliproxy-auth"]}),n.invalidateQueries({queryKey:["cliproxy-stats"]}),ce.success(`Paused ${a.succeeded.length} account${a.succeeded.length!==1?"s":""}`),a.failed.length>0&&ce.warning(`${a.failed.length} account${a.failed.length!==1?"s":""} failed to pause`)},onError:a=>{ce.error(a.message)}})}function fD(){const n=dt();return pt({mutationFn:({provider:a,accountIds:s})=>Qe.cliproxy.accounts.bulkResume(a,s),onSuccess:a=>{n.invalidateQueries({queryKey:["cliproxy-accounts"]}),n.invalidateQueries({queryKey:["cliproxy-auth"]}),n.invalidateQueries({queryKey:["cliproxy-stats"]}),ce.success(`Resumed ${a.succeeded.length} account${a.succeeded.length!==1?"s":""}`),a.failed.length>0&&ce.warning(`${a.failed.length} account${a.failed.length!==1?"s":""} failed to resume`)},onError:a=>{ce.error(a.message)}})}function hD(){const n=dt();return pt({mutationFn:({provider:a,nickname:s})=>Qe.cliproxy.auth.start(a,s),onSuccess:(a,s)=>{n.invalidateQueries({queryKey:["cliproxy-accounts"]}),n.invalidateQueries({queryKey:["cliproxy-auth"]}),ce.success(`Account added for ${s.provider}`)},onError:a=>{ce.error(a.message)}})}function mD(){return pt({mutationFn:n=>Qe.cliproxy.auth.cancel(n),onError:n=>{ce.error(n.message)}})}function pD(){const n=dt();return pt({mutationFn:()=>Qe.cliproxy.auth.kiroImport(),onSuccess:a=>{n.invalidateQueries({queryKey:["cliproxy-accounts"]}),n.invalidateQueries({queryKey:["cliproxy-auth"]}),a.account?ce.success(`Imported Kiro account: ${a.account.email||a.account.id}`):ce.success("Kiro token imported")},onError:a=>{ce.error(a.message)}})}function gD(){return jt({queryKey:["cliproxy-models"],queryFn:()=>Qe.cliproxy.models()})}function yD(n){return jt({queryKey:["presets",n],queryFn:()=>Qe.presets.list(n),enabled:!!n})}function xD(){const n=dt();return pt({mutationFn:({profile:a,data:s})=>Qe.presets.create(a,s),onSuccess:(a,s)=>{n.invalidateQueries({queryKey:["presets",s.profile]}),ce.success(`Preset "${s.data.name}" saved`)},onError:a=>{ce.error(a.message)}})}function vD(){const n=dt();return pt({mutationFn:({profile:a,name:s})=>Qe.presets.delete(a,s),onSuccess:(a,s)=>{n.invalidateQueries({queryKey:["presets",s.profile]}),ce.success("Preset deleted")},onError:a=>{ce.error(a.message)}})}function bD(){return jt({queryKey:["proxy-status"],queryFn:()=>Qe.cliproxy.proxyStatus(),refetchInterval:3e4})}function SD(){const n=dt();return pt({mutationFn:()=>Qe.cliproxy.proxyStart(),onSuccess:a=>{n.invalidateQueries({queryKey:["proxy-status"]}),a.alreadyRunning?ce.info("CLIProxy was already running"):a.started?ce.success("CLIProxy started successfully"):ce.error(a.error||"Failed to start CLIProxy")},onError:a=>{ce.error(a.message)}})}function CD(){const n=dt();return pt({mutationFn:()=>Qe.cliproxy.proxyStop(),onSuccess:a=>{n.invalidateQueries({queryKey:["proxy-status"]}),a.stopped?ce.success(`CLIProxy stopped${a.sessionCount?` (${a.sessionCount} session(s) disconnected)`:""}`):ce.error(a.error||"Failed to stop CLIProxy")},onError:a=>{ce.error(a.message)}})}function XN(){return jt({queryKey:["cliproxy-update-check"],queryFn:()=>Qe.cliproxy.updateCheck(),staleTime:300*1e3,refetchInterval:300*1e3,refetchOnWindowFocus:!0})}function wD(){const n=dt();return pt({mutationKey:["update-backend"],mutationFn:({backend:a,force:s=!1})=>Qe.cliproxyServer.updateBackend(a,s),onSuccess:()=>{n.invalidateQueries({queryKey:["cliproxy-update-check"],refetchType:"all"}),n.invalidateQueries({queryKey:["cliproxy-versions"],refetchType:"all"}),n.invalidateQueries({queryKey:["cliproxy-server-config"],refetchType:"all"}),n.invalidateQueries({queryKey:["proxy-status"]}),n.invalidateQueries({queryKey:["cliproxy-stats"]}),ce.success("Backend updated")},onError:a=>{a.message.includes("Proxy is running")?ce.error("Stop the proxy first to change backend"):ce.error(a.message)}})}function ND(){return jt({queryKey:["cliproxy-versions"],queryFn:()=>Qe.cliproxy.versions(),staleTime:300*1e3,refetchOnWindowFocus:!0})}function AD(){const n=dt();return pt({mutationFn:({version:a,force:s})=>Qe.cliproxy.install(a,s),onSuccess:a=>{a.requiresConfirmation||(n.invalidateQueries({queryKey:["cliproxy-versions"]}),n.invalidateQueries({queryKey:["cliproxy-update-check"]}),n.invalidateQueries({queryKey:["proxy-status"]}),a.success?ce.success(a.message||`Installed v${a.version}`):ce.error(a.error||"Installation failed"))},onError:a=>{ce.error(a.message)}})}function kD(){const n=dt();return pt({mutationFn:()=>Qe.cliproxy.restart(),onSuccess:a=>{n.invalidateQueries({queryKey:["proxy-status"]}),a.success?ce.success(`Proxy restarted on port ${a.port}`):ce.error(a.error||"Restart failed")},onError:a=>{ce.error(a.message)}})}const ZN=G0,JN=Y0,e1=V0;function t1(n){return[{title:n("nav.general"),items:[{path:"/",icon:kS,label:n("nav.home")},{path:"/analytics",icon:jS,label:n("nav.analytics")}]},{title:n("nav.identityAccess"),items:[{path:"/providers",icon:Yy,label:n("nav.apiProfiles"),badge:{icons:["/icons/openrouter.svg","/assets/providers/alibabacloud-color.svg","/icons/ollama.svg"]}},{path:"/cliproxy",icon:Vy,label:n("nav.cliproxyPlus"),isCollapsible:!0,children:[{path:"/cliproxy",label:n("nav.cliproxyOverview")},{path:"/cliproxy/control-panel",icon:TS,label:n("nav.controlPanel")}]},{path:"/copilot",icon:Fy,label:n("nav.githubCopilot")},{path:"/cursor",iconSrc:"/assets/sidebar/cursor.svg",label:n("nav.cursorIde")},{path:"/accounts",icon:$y,label:n("nav.accounts"),isCollapsible:!0,children:[{path:"/accounts",label:n("nav.allAccounts")},{path:"/shared",icon:Qy,label:n("nav.sharedData")}]}]},{title:n("nav.compatibleClis"),items:[{path:"/droid",icon:MS,label:n("nav.factoryDroid")}]},{title:n("nav.system"),items:[{path:"/health",icon:Ds,label:n("nav.health")},{path:"/settings",icon:DS,label:n("nav.settings")}]}]}function n1(){const{t:n}=_t(),a=gr(),s=Md(),{state:l}=kr(),{data:u}=XN(),f=t1(n),h=u?.backendLabel??"CLIProxy",m=b=>b.path==="/cliproxy"?h:b.label,p=b=>a.pathname===b,y=b=>b.some(N=>p(N.path)||a.pathname.startsWith(N.path+"/")),C=b=>b.path==="/accounts"?"/shared":b.path,x=b=>{if(b.iconSrc)return r.jsx("img",{src:b.iconSrc,alt:"",className:"w-4 h-4 object-contain"});if(b.icon){const N=b.icon;return r.jsx(N,{className:"w-4 h-4"})}return null};return r.jsxs(ON,{collapsible:"icon",children:[r.jsx(PN,{className:"h-12 flex items-center justify-center",children:r.jsx(mx,{size:"sm",showText:l==="expanded"})}),r.jsx(_N,{children:f.map((b,N)=>r.jsxs(zN,{children:[b.title&&r.jsx(UN,{children:b.title}),r.jsx(IN,{children:r.jsx(HN,{children:b.items.map(w=>r.jsx(BN,{children:w.isCollapsible&&w.children?r.jsxs(ZN,{defaultOpen:y(w.children)||p(w.path),className:"group/collapsible",children:[r.jsx(JN,{asChild:!0,children:r.jsxs(Bg,{tooltip:m(w),isActive:y(w.children),onClick:()=>s(C(w)),children:[x(w),r.jsx("span",{className:"group-data-[collapsible=icon]:hidden",children:m(w)}),r.jsx(yr,{className:"ml-auto transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90 group-data-[collapsible=icon]:hidden"})]})}),r.jsx(e1,{children:r.jsx(qN,{children:w.children.map(T=>r.jsx(GN,{children:r.jsx(YN,{asChild:!0,isActive:p(T.path),children:r.jsx(pd,{to:T.path,children:r.jsx("span",{children:T.label})})})},T.path))})})]}):r.jsx(Bg,{asChild:!0,isActive:p(w.path),tooltip:m(w),children:r.jsxs(pd,{to:w.path,children:[x(w),r.jsx("span",{className:"group-data-[collapsible=icon]:hidden flex-1",children:m(w)}),w.badge&&r.jsxs($a,{children:[r.jsx(Wa,{asChild:!0,children:r.jsxs("span",{className:K("group-data-[collapsible=icon]:hidden ml-auto flex items-center gap-1 px-1.5 py-0.5 text-[10px] font-medium rounded transition-colors",p(w.path)?"bg-white/92 border border-white/65 shadow-sm":"bg-accent/15 text-accent border border-accent/30 group-hover/menu-item:bg-sidebar-accent-foreground/20 group-hover/menu-item:text-sidebar-accent-foreground group-hover/menu-item:border-sidebar-accent-foreground/30"),children:[(w.badge.icons&&w.badge.icons.length>0?w.badge.icons:w.badge.icon?[w.badge.icon]:[]).map(T=>r.jsx("span",{className:K("inline-flex h-4 w-4 items-center justify-center rounded-[3px] border",p(w.path)?"bg-white border-black/10":"bg-background/80 border-border/40 group-hover/menu-item:bg-white/90"),children:r.jsx("img",{src:T,alt:"",className:"h-3 w-3 object-contain"})},T)),w.badge.text&&r.jsx("span",{className:"hidden sm:inline",children:w.badge.text})]})}),r.jsx(Xa,{side:"right",children:r.jsx("p",{children:n("nav.openrouterTooltip")})})]})]})})},w.path))})})]},b.title||N))}),r.jsx(LN,{className:"p-4 border-t flex items-center justify-center",children:r.jsx(RN,{})})]})}const gx=()=>{const n=S.useContext(rx);if(n===void 0)throw new Error("useTheme must be used within a ThemeProvider");return n};function a1(){const{theme:n,setTheme:a}=gx();return r.jsxs(ut,{variant:"ghost",size:"icon",onClick:()=>a(n==="dark"?"light":"dark"),children:[r.jsx(ES,{className:"h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),r.jsx(OS,{className:"absolute h-[1.2rem] w-[1.2rem] rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),r.jsx("span",{className:"sr-only",children:"Toggle theme"})]})}function i1(){const{privacyMode:n,togglePrivacyMode:a}=_d();return r.jsxs($a,{children:[r.jsx(Wa,{asChild:!0,children:r.jsx(ut,{variant:"ghost",size:"icon",onClick:a,className:K("h-8 w-8 transition-colors",n&&"text-amber-600 hover:text-amber-700 dark:text-amber-400"),children:n?r.jsx(xr,{className:"h-4 w-4"}):r.jsx(vr,{className:"h-4 w-4"})})}),r.jsx(Xa,{children:r.jsx("p",{children:n?"Privacy mode ON - Click to show data":"Privacy mode OFF - Click to hide data"})})]})}const o1="https://github.com/kaitranntt/ccs/issues";function s1(){return r.jsx(ut,{variant:"ghost",size:"icon",asChild:!0,title:"Report an issue on GitHub",children:r.jsx("a",{href:o1,target:"_blank",rel:"noopener noreferrer",children:r.jsx(Fy,{className:"w-4 h-4"})})})}const l1="https://docs.ccs.kaitran.ca";function r1(){return r.jsx(ut,{variant:"ghost",size:"icon",asChild:!0,title:"View documentation",children:r.jsx("a",{href:l1,target:"_blank",rel:"noopener noreferrer",children:r.jsx(RS,{className:"w-4 h-4"})})})}function c1(){const[n,a]=S.useState("disconnected"),[s,l]=S.useState(!1),u=S.useRef(null),f=dt(),h=S.useRef(0),m=5,p=S.useRef(null),y=S.useRef(()=>{}),C=S.useCallback(N=>{switch(N.type){case"connected":console.log("[WS] Server acknowledged connection");break;case"config-changed":f.invalidateQueries({queryKey:["profiles"]}),f.invalidateQueries({queryKey:["cliproxy"]}),ce.info("Configuration updated externally");break;case"settings-changed":f.invalidateQueries({queryKey:["profiles"]}),ce.info("Settings file updated");break;case"profiles-changed":f.invalidateQueries({queryKey:["accounts"]}),ce.info("Accounts updated");break;case"proxy-status-changed":f.invalidateQueries({queryKey:["proxy-status"]});break;case"pong":break;default:console.log(`[WS] Unknown message: ${N.type}`)}},[f]),x=S.useCallback(()=>{if(u.current?.readyState===WebSocket.OPEN)return;a("connecting");const N=window.location.protocol==="https:"?"wss:":"ws:",w=new WebSocket(`${N}//${window.location.host}`);u.current=w,w.onopen=()=>{a("connected"),l(!1),h.current=0,console.log("[WS] Connected")},w.onmessage=T=>{try{const E=JSON.parse(T.data);C(E),window.dispatchEvent(new CustomEvent("ws-message",{detail:E}))}catch{console.log("[WS] Invalid message")}},w.onclose=()=>{if(a("disconnected"),u.current=null,h.current<m){l(!0);const T=Math.min(1e3*Math.pow(2,h.current),3e4);h.current++,console.log(`[WS] Reconnecting in ${T}ms (attempt ${h.current})`),p.current=setTimeout(()=>{y.current()},T)}else l(!1)},w.onerror=()=>{console.log("[WS] Connection error")}},[C]);y.current=x;const b=S.useCallback(()=>{h.current=m,l(!1),p.current&&(clearTimeout(p.current),p.current=null),u.current?.close()},[]);return S.useEffect(()=>(y.current(),()=>b()),[]),S.useEffect(()=>{const N=setInterval(()=>{u.current?.readyState===WebSocket.OPEN&&u.current.send(JSON.stringify({type:"ping"}))},3e4);return()=>clearInterval(N)},[]),S.useMemo(()=>({status:n,isReconnecting:s,connect:x,disconnect:b}),[n,s,x,b])}function u1(){const{status:n,isReconnecting:a}=c1(),l={connected:{icon:LS,color:"text-green-600",label:"Connected",animate:!1},connecting:{icon:Es,color:"text-yellow-500",label:"Connecting...",animate:!0},disconnected:{icon:a?Es:PS,color:a?"text-amber-500":"text-red-500",label:a?"Reconnecting...":"Disconnected",animate:a}}[n],u=l.icon;return r.jsxs("div",{className:`flex items-center gap-1 text-sm ${l.color}`,children:[r.jsx(u,{className:`w-4 h-4 ${l.animate?"animate-spin":""}`}),r.jsx("span",{className:"hidden sm:inline",children:l.label})]})}function d1(){const[n,a]=S.useState(!1);return n?null:r.jsx("div",{className:"w-full bg-yellow-50 dark:bg-yellow-900/20 border-t border-yellow-200 dark:border-yellow-800 px-4 py-2 transition-colors duration-200",children:r.jsxs("div",{className:"flex items-center justify-center gap-4",children:[r.jsxs("div",{className:"flex items-center gap-2 text-sm text-yellow-800 dark:text-yellow-200",children:[r.jsx(_S,{className:"w-4 h-4 flex-shrink-0"}),r.jsx("span",{className:"hidden sm:inline",children:"This dashboard runs locally. All data stays on your machine."}),r.jsx("span",{className:"sm:hidden",children:"Local dashboard - data stays on your device."})]}),r.jsx("button",{onClick:()=>a(!0),className:"text-yellow-600 hover:text-yellow-800 dark:text-yellow-400 flex-shrink-0 p-1 rounded hover:bg-yellow-100 dark:hover:bg-yellow-800/30 transition-colors","aria-label":"Dismiss disclaimer",children:r.jsx(bo,{className:"w-4 h-4"})})]})})}const f1="https://claudekit.cc?ref=HMNKXOHN";function h1(){return r.jsxs("a",{href:f1,target:"_blank",rel:"noopener noreferrer",className:K("group inline-flex items-center gap-2 px-3 py-1.5 rounded-lg","bg-accent/10 border-2 border-accent/40","hover:bg-accent hover:border-accent","transition-all duration-200 shadow-sm hover:shadow-md"),title:"Powered by ClaudeKit Framework",children:[r.jsx("img",{src:"/logos/claudekit-logo.png",alt:"ClaudeKit",className:"w-5 h-5"}),r.jsxs("span",{className:"flex items-baseline gap-1.5 whitespace-nowrap",children:[r.jsx("span",{className:K("text-[10px] font-medium uppercase tracking-wide","text-muted-foreground group-hover:text-accent-foreground/80","transition-colors"),children:"Powered by"}),r.jsx("span",{className:K("text-xs font-bold text-foreground","group-hover:text-accent-foreground","transition-colors"),children:"ClaudeKit"})]})]})}const m1="https://github.com/sponsors/kaitranntt";function p1(){return r.jsxs("a",{href:m1,target:"_blank",rel:"noopener noreferrer",className:K("group inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg","bg-pink-500/10 border-2 border-pink-500/40","hover:bg-pink-400 hover:border-pink-400","transition-all duration-200 shadow-sm hover:shadow-md"),title:"Sponsor this project on GitHub",children:[r.jsx(zS,{className:K("w-4 h-4 text-pink-500","group-hover:text-white group-hover:fill-white","group-hover:animate-pulse","transition-colors")}),r.jsx("span",{className:K("text-xs font-bold text-pink-600 dark:text-pink-300","group-hover:text-white dark:group-hover:text-white","transition-colors"),children:"Sponsor"})]})}function qd({...n}){return r.jsx(Ay,{"data-slot":"dialog",...n})}function g1({...n}){return r.jsx(Dy,{"data-slot":"dialog-portal",...n})}function y1({className:n,...a}){return r.jsx(Ey,{"data-slot":"dialog-overlay",className:K("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",n),...a})}function Gd({className:n,children:a,showCloseButton:s=!0,...l}){return r.jsxs(g1,{"data-slot":"dialog-portal",children:[r.jsx(y1,{}),r.jsxs(ky,{"data-slot":"dialog-content",className:K("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",n),...l,children:[a,s&&r.jsxs(jy,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[r.jsx(bo,{}),r.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Yd({className:n,...a}){return r.jsx("div",{"data-slot":"dialog-header",className:K("flex flex-col gap-2 text-center sm:text-left",n),...a})}function x1({className:n,...a}){return r.jsx("div",{"data-slot":"dialog-footer",className:K("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",n),...a})}function Vd({className:n,...a}){return r.jsx(Ty,{"data-slot":"dialog-title",className:K("text-lg leading-none font-semibold",n),...a})}function Fd({className:n,...a}){return r.jsx(My,{"data-slot":"dialog-description",className:K("text-muted-foreground text-sm",n),...a})}function v1({open:n,onClose:a,sessionId:s,provider:l,projects:u,defaultProjectId:f,supportsAll:h,onSelect:m,timeoutSeconds:p=30}){const[y,C]=S.useState(f),[x,b]=S.useState(!1),[N,w]=S.useState(p);S.useEffect(()=>{if(!n){w(p);return}const M=setInterval(()=>{w(H=>H<=1?(clearInterval(M),T(!0),0):H-1)},1e3);return()=>clearInterval(M)},[n,p]),S.useEffect(()=>{n&&(C(f),b(!1),w(p))},[n,f,p]);const T=async(M=!1)=>{if(!x){b(!0);try{await m(M?"":y),a()}catch(H){console.error("Failed to submit project selection:",H);try{await m("")}catch{}a()}}},E=l.charAt(0).toUpperCase()+l.slice(1);return r.jsx(qd,{open:n,onOpenChange:M=>!M&&!x&&a(),children:r.jsxs(Gd,{className:"sm:max-w-lg",children:[r.jsxs(Yd,{children:[r.jsxs(Vd,{className:"flex items-center gap-2",children:[r.jsx(Qy,{className:"w-5 h-5"}),"Select Google Cloud Project"]}),r.jsxs(Fd,{children:["Choose which project to use for ",E," authentication.",N>0&&r.jsxs("span",{className:"text-muted-foreground ml-1",children:["(Auto-selecting default in ",N,"s)"]})]})]}),r.jsxs("div",{className:"space-y-4 py-4",children:[r.jsxs("div",{className:"space-y-2",children:[u.map(M=>r.jsxs("div",{className:`flex items-center space-x-3 p-3 rounded-lg border cursor-pointer transition-colors ${y===M.id?"border-primary bg-primary/5":"border-border hover:border-primary/50"}`,onClick:()=>!x&&C(M.id),children:[y===M.id?r.jsx(cg,{className:"w-5 h-5 text-primary"}):r.jsx(ug,{className:"w-5 h-5 text-muted-foreground"}),r.jsxs("div",{className:"flex-1",children:[r.jsx("div",{className:"font-medium",children:M.name}),r.jsx("div",{className:"text-sm text-muted-foreground font-mono",children:M.id})]}),M.id===f&&r.jsx("span",{className:"text-xs px-2 py-1 bg-secondary rounded",children:"Default"})]},M.id)),h&&r.jsxs("div",{className:`flex items-center space-x-3 p-3 rounded-lg border cursor-pointer transition-colors ${y==="ALL"?"border-primary bg-primary/5":"border-border hover:border-primary/50"}`,onClick:()=>!x&&C("ALL"),children:[y==="ALL"?r.jsx(cg,{className:"w-5 h-5 text-primary"}):r.jsx(ug,{className:"w-5 h-5 text-muted-foreground"}),r.jsxs("div",{className:"flex-1",children:[r.jsx("div",{className:"font-medium",children:"All Projects"}),r.jsxs("div",{className:"text-sm text-muted-foreground",children:["Onboard all ",u.length," listed projects"]})]})]})]}),r.jsxs("div",{className:"flex items-center justify-end gap-2 pt-2",children:[r.jsx(ut,{variant:"ghost",onClick:()=>T(!0),disabled:x,children:"Use Default"}),r.jsx(ut,{onClick:()=>T(!1),disabled:x,children:x?r.jsxs(r.Fragment,{children:[r.jsx(Dn,{className:"w-4 h-4 mr-2 animate-spin"}),"Selecting..."]}):r.jsxs(r.Fragment,{children:[r.jsx(xo,{className:"w-4 h-4 mr-2"}),"Confirm Selection"]})})]})]})]})})}const vo={gemini:{displayName:"Google Gemini",description:"Gemini Pro/Flash models",oauthFlow:"authorization_code",callbackPort:8085,callbackProviderName:"gemini",authUrlProviderName:"gemini-cli",refreshOwnership:"ccs",authFilePrefixes:["gemini-","google-"],tokenTypeValues:["gemini"],aliases:["gemini-cli"]},codex:{displayName:"OpenAI Codex",description:"GPT-4 and codex models",oauthFlow:"authorization_code",callbackPort:1455,callbackProviderName:"codex",authUrlProviderName:"codex",refreshOwnership:"cliproxy",authFilePrefixes:["codex-","openai-"],tokenTypeValues:["codex"],aliases:[]},agy:{displayName:"Antigravity",description:"Antigravity AI models",oauthFlow:"authorization_code",callbackPort:51121,callbackProviderName:"antigravity",authUrlProviderName:"antigravity",refreshOwnership:"cliproxy",authFilePrefixes:["antigravity-","agy-"],tokenTypeValues:["antigravity"],aliases:["antigravity"]},qwen:{displayName:"Alibaba Qwen",description:"Qwen Code models",oauthFlow:"device_code",callbackPort:null,callbackProviderName:"qwen",authUrlProviderName:"qwen",refreshOwnership:"cliproxy",authFilePrefixes:["qwen-"],tokenTypeValues:["qwen"],aliases:[]},iflow:{displayName:"iFlow",description:"iFlow AI models",oauthFlow:"authorization_code",callbackPort:11451,callbackProviderName:"iflow",authUrlProviderName:"iflow",refreshOwnership:"cliproxy",authFilePrefixes:["iflow-"],tokenTypeValues:["iflow"],aliases:[]},kiro:{displayName:"Kiro (AWS)",description:"AWS CodeWhisperer models",oauthFlow:"device_code",callbackPort:null,callbackProviderName:"kiro",authUrlProviderName:"kiro",refreshOwnership:"cliproxy",authFilePrefixes:["kiro-","aws-","codewhisperer-"],tokenTypeValues:["kiro","codewhisperer"],aliases:["codewhisperer"]},ghcp:{displayName:"GitHub Copilot (OAuth)",description:"GitHub Copilot via OAuth",oauthFlow:"device_code",callbackPort:null,callbackProviderName:"copilot",authUrlProviderName:"github",refreshOwnership:"cliproxy",authFilePrefixes:["github-copilot-","copilot-","gh-"],tokenTypeValues:["github-copilot","copilot"],aliases:["github-copilot","copilot"]},claude:{displayName:"Claude (Anthropic)",description:"Claude Opus/Sonnet models",oauthFlow:"authorization_code",callbackPort:54545,callbackProviderName:"anthropic",authUrlProviderName:"anthropic",refreshOwnership:"unsupported",authFilePrefixes:["claude-","anthropic-"],tokenTypeValues:["claude","anthropic"],aliases:["anthropic"]},kimi:{displayName:"Kimi (Moonshot)",description:"Moonshot AI K2/K2.5 models",oauthFlow:"device_code",callbackPort:null,callbackProviderName:"kimi",authUrlProviderName:"kimi",refreshOwnership:"cliproxy",authFilePrefixes:["kimi-"],tokenTypeValues:["kimi"],aliases:["moonshot"]}},Qd=Object.freeze(Object.keys(vo)),Sd=Object.freeze(["agy","codex","claude","gemini","ghcp"]);new Set(Sd);const b1=Object.freeze([...Sd,...Sd.flatMap(n=>vo[n].aliases),"all"].filter((n,a,s)=>s.indexOf(n)===a));b1.join(", ");new Set(Qd);function S1(n=vo){const a=new Map,s=Object.keys(n),l=(u,f)=>{const h=u.trim().toLowerCase();if(!h)return;const m=a.get(h);if(m&&m!==f)throw new Error(`Provider alias collision for "${h}": ${m} and ${f}`);a.set(h,f)};for(const u of s){l(u,u);for(const f of n[u].aliases)l(f,u)}return a}S1();function C1(n){return Qd.filter(a=>vo[a].oauthFlow===n)}const $d=Qd;function Za(n){return $d.includes(n)}function ba(n){return typeof n=="string"?n.trim().toLowerCase():""}const yx=Object.freeze(Object.fromEntries($d.map(n=>[n,{displayName:vo[n].displayName,description:vo[n].description}]))),w1={gemini:"/assets/providers/gemini-color.svg",agy:"/assets/providers/agy.png",codex:"/assets/providers/openai.svg",qwen:"/assets/providers/qwen-color.svg",iflow:"/assets/providers/iflow.png",kiro:"/assets/providers/kiro.png",ghcp:"/assets/providers/copilot.svg",claude:"/assets/providers/claude.svg",kimi:"/assets/providers/kimi.svg"},Kg={textClass:"text-gray-600",letter:"?"},N1={gemini:{textClass:"text-blue-600",letter:"G"},claude:{textClass:"text-orange-600",letter:"C"},codex:{textClass:"text-emerald-600",letter:"X"},agy:{textClass:"text-violet-600",letter:"A"},qwen:{textClass:"text-cyan-600",letter:"Q"},iflow:{textClass:"text-indigo-600",letter:"i"},kiro:{textClass:"text-teal-600",letter:"K"},ghcp:{textClass:"text-green-600",letter:"C"},kimi:{textClass:"text-orange-500",letter:"K"}},A1=new Set(["kimi"]);function k1(n){const a=ba(n);if(Za(a))return w1[a]}function jD(n){const a=ba(n);return Za(a)?N1[a]:{...Kg,letter:a[0]?.toUpperCase()||Kg.letter}}function TD(n){const a=ba(n);return Za(a)&&A1.has(a)}const Wd={gemini:"#4285F4",agy:"#f3722c",codex:"#10a37f",vertex:"#4285F4",iflow:"#f94144",qwen:"#6236FF",kiro:"#4d908e",ghcp:"#43aa8b",claude:"#D97757",kimi:"#FF6B35"},j1={...Object.fromEntries($d.map(n=>[n,yx[n].displayName])),vertex:"Vertex AI"};function Xd(n){const a=ba(n);return a?j1[a]||String(n):"Unknown provider"}function T1(n){const a=ba(n);return Za(a)?yx[a].description:""}const M1=[...C1("device_code")],D1=Object.freeze({ghcp:"GitHub Copilot",kiro:"Kiro (AWS)",qwen:"Qwen Code"}),E1=Object.freeze({ghcp:"Sign in with your GitHub account that has Copilot access.",qwen:"Sign in with your Qwen account to authorize access.",kiro:"Sign in with your selected Kiro auth provider to continue.",kimi:"Sign in with your Kimi account and finish the device authorization."});function MD(n){const a=ba(n);return Za(a)&&M1.includes(a)}function ir(n){const a=ba(n);return a?Za(a)?D1[a]||Xd(a):String(n):"Unknown provider"}function O1(n){const a=ba(n);return Za(a)&&E1[a]||"Complete the authorization in your browser."}const R1=["ghcp","kiro"];function DD(n){const a=ba(n);return Za(a)&&R1.includes(a)}const ED="aws",qg=[{id:"aws",label:"AWS Builder ID (Recommended)",description:"Device code flow for AWS organizations and Builder ID accounts.",flowType:"device_code",startEndpoint:"start"},{id:"aws-authcode",label:"AWS Builder ID (Auth Code)",description:"Authorization code flow via CLI binary.",flowType:"authorization_code",startEndpoint:"start"},{id:"google",label:"Google OAuth",description:"Social OAuth flow with callback URL support.",flowType:"authorization_code",startEndpoint:"start-url"},{id:"github",label:"GitHub OAuth",description:"Social OAuth flow via management API callback.",flowType:"authorization_code",startEndpoint:"start-url"}];function OD(n){return qg.find(s=>s.id===n)||qg[0]}function P1({open:n,onClose:a,sessionId:s,provider:l,userCode:u,verificationUrl:f,expiresAt:h}){const[m,p]=S.useState(!1),[y,C]=S.useState(null);S.useEffect(()=>{if(!n)return;let H=null;const B=()=>{const U=Math.max(0,Math.floor((h-Date.now())/1e3));C(U),U===0&&H&&(clearInterval(H),H=null)};return B(),H=setInterval(B,1e3),()=>{H&&clearInterval(H)}},[n,h]);const x=S.useCallback(async()=>{try{await navigator.clipboard.writeText(u),p(!0),ce.success(ct.t("commonToast.codeCopied")),setTimeout(()=>p(!1),2e3)}catch{ce.error(ct.t("commonToast.copyCodeFailed"))}},[u]),b=S.useCallback(()=>{window.open(f,"_blank","noopener,noreferrer")},[f]),N=ir(l),w=O1(l),T=N==="Unknown provider"?"Open verification page":`Open ${N.split(" ")[0]}`,E=H=>{const B=Math.floor(H/60),U=H%60;return`${B}:${U.toString().padStart(2,"0")}`},M=y===0;return r.jsx(qd,{open:n,onOpenChange:H=>!H&&a(),children:r.jsxs(Gd,{className:"sm:max-w-md","data-session-id":s,children:[r.jsxs(Yd,{children:[r.jsxs(Vd,{className:"flex items-center gap-2",children:[r.jsx(Dd,{className:"w-5 h-5"}),"Authorize ",N]}),r.jsxs(Fd,{children:["Enter the code below at the authorization page.",y!==null&&y>0&&r.jsxs("span",{className:"text-muted-foreground ml-1",children:["(Expires in ",E(y),")"]}),M&&r.jsx("span",{className:"text-destructive ml-1 font-medium",children:"(Code expired)"})]})]}),r.jsxs("div",{className:"space-y-6 py-4",children:[r.jsxs("div",{className:"relative",children:[r.jsx("div",{className:"bg-muted rounded-lg p-6 text-center",children:r.jsx("div",{className:"text-4xl font-mono font-bold tracking-[0.3em] text-foreground select-all",children:u})}),r.jsx(ut,{variant:"outline",size:"icon",className:"absolute top-2 right-2",onClick:x,"aria-label":m?"Code copied":"Copy verification code",children:m?r.jsx(xo,{className:"h-4 w-4 text-green-500"}):r.jsx(lr,{className:"h-4 w-4"})})]}),r.jsx("div",{className:"text-sm text-muted-foreground text-center",children:r.jsx("p",{children:w})}),r.jsxs("div",{className:"flex flex-col gap-3",children:[r.jsxs(ut,{onClick:b,className:"w-full",children:[r.jsx(Wy,{className:"w-4 h-4 mr-2"}),T]}),r.jsx(ut,{variant:"outline",onClick:x,className:"w-full",children:m?r.jsxs(r.Fragment,{children:[r.jsx(xo,{className:"w-4 h-4 mr-2 text-green-500"}),"Copied!"]}):r.jsxs(r.Fragment,{children:[r.jsx(lr,{className:"w-4 h-4 mr-2"}),"Copy Code"]})})]}),r.jsxs("div",{className:"flex items-center justify-center gap-2 text-sm text-muted-foreground",children:[r.jsx(Dn,{className:"h-4 w-4 animate-spin"}),r.jsx("span",{children:"Waiting for authorization..."})]})]})]})})}function L1({...n}){return r.jsx(F0,{"data-slot":"dropdown-menu",...n})}function _1({...n}){return r.jsx(Q0,{"data-slot":"dropdown-menu-trigger",...n})}function z1({className:n,sideOffset:a=4,...s}){return r.jsx($0,{children:r.jsx(W0,{"data-slot":"dropdown-menu-content",sideOffset:a,className:K("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md bg-white dark:bg-zinc-950",n),...s})})}function U1({className:n,inset:a,variant:s="default",...l}){return r.jsx(X0,{"data-slot":"dropdown-menu-item","data-inset":a,"data-variant":s,className:K("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground focus:[&_svg:not([class*='text-'])]:text-current relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",n),...l})}function I1(){const{authRequired:n,isAuthenticated:a,username:s,logout:l}=Ud();if(!n||!a)return null;const u=async()=>{await l()};return r.jsxs(L1,{children:[r.jsx(_1,{asChild:!0,children:r.jsxs(ut,{variant:"ghost",size:"sm",className:"gap-2",children:[r.jsx(US,{className:"h-4 w-4"}),r.jsx("span",{className:"hidden sm:inline",children:s})]})}),r.jsx(z1,{align:"end",children:r.jsxs(U1,{onClick:u,className:"gap-2 text-destructive",children:[r.jsx(IS,{className:"h-4 w-4"}),"Sign Out"]})})]})}const xx=aS,RD=oS,vx=iS,Zd=S.forwardRef(({className:n,children:a,...s},l)=>r.jsxs(Oy,{ref:l,className:K("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",n),...s,children:[a,r.jsx(Z0,{asChild:!0,children:r.jsx(br,{className:"h-4 w-4 opacity-50"})})]}));Zd.displayName=Oy.displayName;const bx=S.forwardRef(({className:n,...a},s)=>r.jsx(Ry,{ref:s,className:K("flex cursor-default items-center justify-center py-1",n),...a,children:r.jsx(Ed,{className:"h-4 w-4"})}));bx.displayName=Ry.displayName;const Sx=S.forwardRef(({className:n,...a},s)=>r.jsx(Py,{ref:s,className:K("flex cursor-default items-center justify-center py-1",n),...a,children:r.jsx(br,{className:"h-4 w-4"})}));Sx.displayName=Py.displayName;const Jd=S.forwardRef(({className:n,children:a,position:s="popper",...l},u)=>r.jsx(J0,{children:r.jsxs(Ly,{ref:u,className:K("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",s==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",n),position:s,...l,children:[r.jsx(bx,{}),r.jsx(eS,{className:K("p-1",s==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:a}),r.jsx(Sx,{})]})}));Jd.displayName=Ly.displayName;const H1=S.forwardRef(({className:n,...a},s)=>r.jsx(_y,{ref:s,className:K("px-2 py-1.5 text-sm font-semibold",n),...a}));H1.displayName=_y.displayName;const dr=S.forwardRef(({className:n,children:a,...s},l)=>r.jsxs(zy,{ref:l,className:K("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",n),...s,children:[r.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:r.jsx(tS,{children:r.jsx(xo,{className:"h-4 w-4"})})}),r.jsx(nS,{children:a})]}));dr.displayName=zy.displayName;const B1=S.forwardRef(({className:n,...a},s)=>r.jsx(Uy,{ref:s,className:K("-mx-1 my-1 h-px bg-muted",n),...a}));B1.displayName=Uy.displayName;function K1(){const{t:n,i18n:a}=_t(),s=zs(a.resolvedLanguage??a.language??"en"),l=u=>{const f=Kw(u);a.changeLanguage(f)};return r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Xy,{className:"h-4 w-4 text-muted-foreground"}),r.jsxs(xx,{value:s,onValueChange:l,children:[r.jsx(Zd,{className:"h-8 w-[150px]",children:r.jsx(vx,{placeholder:n("layout.languageSwitcher")})}),r.jsx(Jd,{children:Hw.map(u=>r.jsx(dr,{value:u,children:n(`locale.${u}`)},u))})]})]})}function q1(){const[n,a]=S.useState({isOpen:!1,prompt:null});S.useEffect(()=>{const u=f=>{const h=f.detail;h.type==="projectSelectionRequired"?(console.log("[ProjectSelection] Received prompt:",h.sessionId),a({isOpen:!0,prompt:{sessionId:h.sessionId,provider:h.provider,projects:h.projects,defaultProjectId:h.defaultProjectId,supportsAll:h.supportsAll}})):h.type==="projectSelectionTimeout"?(console.log("[ProjectSelection] Timeout:",h.sessionId),a(m=>m.prompt?.sessionId===h.sessionId?{isOpen:!1,prompt:null}:m)):h.type==="projectSelectionSubmitted"&&(console.log("[ProjectSelection] Submitted:",h.sessionId),a(m=>m.prompt?.sessionId===h.sessionId?{isOpen:!1,prompt:null}:m))};return window.addEventListener("ws-message",u),()=>{window.removeEventListener("ws-message",u)}},[]);const s=S.useCallback(async u=>{if(!n.prompt)return;if(!(await fetch(`/api/cliproxy/auth/project-selection/${n.prompt.sessionId}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({selectedId:u})})).ok)throw new Error("Failed to submit project selection")},[n.prompt]),l=S.useCallback(()=>{a({isOpen:!1,prompt:null})},[]);return S.useMemo(()=>({isOpen:n.isOpen,prompt:n.prompt,onSelect:s,onClose:l}),[n.isOpen,n.prompt,s,l])}function G1(n){return typeof n!="string"?"unknown":n.trim().toLowerCase()||"unknown"}function Y1(){const[n,a]=S.useState({isOpen:!1,prompt:null,error:null});S.useEffect(()=>{const f=h=>{const m=h.detail;if(m.type==="deviceCodeReceived"){console.log("[DeviceCode] Received prompt:",m.sessionId);const p=G1(m.provider),y=ir(p);ce.info(`${y} authorization required`),a({isOpen:!0,prompt:{sessionId:m.sessionId,provider:p,userCode:m.userCode,verificationUrl:m.verificationUrl,expiresAt:m.expiresAt},error:null})}else m.type==="deviceCodeCompleted"?(console.log("[DeviceCode] Auth completed:",m.sessionId),a(p=>{if(p.prompt&&p.prompt.sessionId===m.sessionId){const y=ir(p.prompt.provider);return ce.success(`${y} authentication successful!`),{isOpen:!1,prompt:null,error:null}}return p})):m.type==="deviceCodeFailed"?(console.log("[DeviceCode] Auth failed:",m.sessionId,m.error),a(p=>{if(p.prompt&&p.prompt.sessionId===m.sessionId){const y=ir(p.prompt.provider);return ce.error(`${y} authentication failed`),{isOpen:!1,prompt:null,error:m.error}}return p})):m.type==="deviceCodeExpired"&&(console.log("[DeviceCode] Code expired:",m.sessionId),a(p=>p.prompt?.sessionId===m.sessionId?(ce.error("Device code expired. Please try again."),{isOpen:!1,prompt:null,error:"Device code expired"}):p))};return window.addEventListener("ws-message",f),()=>{window.removeEventListener("ws-message",f)}},[]);const s=S.useCallback(()=>{a({isOpen:!1,prompt:null,error:null})},[]),l=S.useCallback(()=>{n.prompt?.verificationUrl&&window.open(n.prompt.verificationUrl,"_blank","noopener,noreferrer")},[n.prompt]),u=S.useCallback(async()=>{if(n.prompt?.userCode)try{await navigator.clipboard.writeText(n.prompt.userCode),ce.success("Code copied to clipboard")}catch{ce.error("Failed to copy code")}},[n.prompt]);return S.useMemo(()=>({isOpen:n.isOpen,prompt:n.prompt,error:n.error,onClose:s,onOpenUrl:l,onCopyCode:u}),[n.isOpen,n.prompt,n.error,s,l,u])}const V1="ccs-dashboard:last-route";function F1(n,a="",s=""){try{localStorage.setItem(V1,`${n}${a}${s}`)}catch{}}function Q1(){return r.jsxs("div",{className:"p-6 space-y-4",children:[r.jsx(Ke,{className:"h-8 w-48"}),r.jsx(Ke,{className:"h-64 w-full"})]})}function $1(){const n=gr(),{isOpen:a,prompt:s,onSelect:l,onClose:u}=q1(),f=Y1();return S.useEffect(()=>{F1(n.pathname,n.search,n.hash)},[n.pathname,n.search,n.hash]),r.jsxs(EN,{children:[r.jsx(n1,{}),r.jsxs("main",{className:"flex-1 flex flex-col min-h-0 overflow-hidden bg-background",children:[r.jsxs("header",{className:"flex h-14 items-center justify-between px-6 border-b shrink-0 bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx(h1,{}),r.jsx(p1,{})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(u1,{}),r.jsx(K1,{}),r.jsx(r1,{}),r.jsx(s1,{}),r.jsx(i1,{}),r.jsx(a1,{}),r.jsx(I1,{})]})]}),r.jsx("div",{className:"flex-1 overflow-auto min-h-0",children:r.jsx(S.Suspense,{fallback:r.jsx(Q1,{}),children:r.jsx(md,{})})}),r.jsx(d1,{})]}),s&&r.jsx(v1,{open:a,onClose:u,sessionId:s.sessionId,provider:s.provider,projects:s.projects,defaultProjectId:s.defaultProjectId,supportsAll:s.supportsAll,onSelect:l}),f.prompt&&r.jsx(P1,{open:f.isOpen,onClose:f.onClose,sessionId:f.prompt.sessionId,provider:f.prompt.provider,userCode:f.prompt.userCode,verificationUrl:f.prompt.verificationUrl,expiresAt:f.prompt.expiresAt})]})}const W1=Nr("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Qa({className:n,variant:a,...s}){return r.jsx("div",{className:K(W1({variant:a}),n),...s})}function X1({version:n="5.0.0"}){return r.jsxs("div",{className:"flex items-center gap-4",children:[r.jsx(mx,{size:"lg",showText:!1}),r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("h1",{className:"text-2xl font-bold",children:"CCS Config"}),r.jsxs(Qa,{variant:"outline",className:"font-mono text-xs",children:["v",n]})]}),r.jsx("p",{className:"text-muted-foreground text-sm mt-1",children:"Claude Code Switch Dashboard"})]})]})}const Z1=100,Gg=["#3b3c36","#568203","#8d4557","#da9100","#3c6c82","#c96907"];function J1(n){return Gg[n%Gg.length]}function Cx(n){return n.replace(/@(gmail|yahoo|hotmail|outlook|icloud)\.com$/i,"")}function eA(n){const s=new Date().getTime()-n.getTime(),l=Math.floor(s/6e4);if(l<1)return"now";if(l<60)return`${l}m`;const u=Math.floor(l/60);return u<24?`${u}h`:`${Math.floor(u/24)}d`}function tA(n){const a=[];return n.forEach(s=>{const l=s.lastUsedAt?new Date(s.lastUsedAt):new Date,u=(f,h)=>{for(let m=0;m<f;m++){const p=Math.floor(Math.random()*24*60*60*1e3*(m/(f||1))),y=new Date(l.getTime()-p),C=Math.floor((Math.random()-.5)*10*60*1e3);y.setTime(y.getTime()+C);const x=new Date;y>x&&y.setTime(x.getTime()),a.push({id:`${s.id}-${h}-${m}`,timestamp:y,accountEmail:s.email,status:h,latencyMs:h==="success"?50+Math.floor(Math.random()*150):200+Math.floor(Math.random()*4800)})}};u(s.successCount,"success"),u(s.failureCount,"failed")}),a.sort((s,l)=>l.timestamp.getTime()-s.timestamp.getTime())}function nA({containerRef:n,svgRef:a,accounts:s}){if(!n.current||!a.current)return[];const l=n.current,f=a.current.getBoundingClientRect(),h=l.querySelector("[data-provider-node]");if(!h)return[];const m=h.getBoundingClientRect(),p=[];return s.forEach((y,C)=>{const x=l.querySelector(`[data-account-index="${C}"]`);if(!x)return;const b=x.getBoundingClientRect(),N=x.getAttribute("data-zone")||"left";let w,T,E,M;switch(N){case"right":w=b.left-f.left,T=b.top+b.height/2-f.top,E=m.right-f.left,M=m.top+m.height/2-f.top;break;case"top":w=b.left+b.width/2-f.left,T=b.bottom-f.top,E=m.left+m.width/2-f.left,M=m.top-f.top;break;case"bottom":w=b.left+b.width/2-f.left,T=b.top-f.top,E=m.left+m.width/2-f.left,M=m.bottom-f.top;break;default:w=b.right-f.left,T=b.top+b.height/2-f.top,E=m.left-f.left,M=m.top+m.height/2-f.top}let H,B,U,O;N==="top"||N==="bottom"?(H=w,B=T+(M-T)*.5,U=E,O=M-(M-T)*.5):(H=w+(E-w)*.5,B=T,U=E-(E-w)*.5,O=M),p.push(`M ${w} ${T} C ${H} ${B}, ${U} ${O}, ${E} ${M}`)}),p}function aA(n){const a=n.length;if(a<=2)return{leftAccounts:n,rightAccounts:[],topAccounts:[],bottomAccounts:[]};if(a<=4){const l=Math.ceil(a/2);return{leftAccounts:n.slice(0,l),rightAccounts:n.slice(l),topAccounts:[],bottomAccounts:[]}}if(a<=8){const l=Math.ceil(a/3);return{leftAccounts:n.slice(0,l),rightAccounts:n.slice(l,l*2),topAccounts:n.slice(l*2),bottomAccounts:[]}}const s=Math.ceil(a/4);return{leftAccounts:n.slice(0,s),rightAccounts:n.slice(s,s*2),topAccounts:n.slice(s*2,s*3),bottomAccounts:n.slice(s*3)}}function iA(n){return n>=9?"w-64":n>=5?"w-60":n>=3?"w-56":"w-52"}function oA({storageKey:n,onDrag:a}){const[s,l]=S.useState(null),u=S.useRef(null),f=S.useRef(!1),h=S.useCallback(()=>{try{const w=localStorage.getItem(n);if(w)return JSON.parse(w)}catch{}return{}},[n]),[m,p]=S.useState(()=>h());S.useEffect(()=>{Object.keys(m).length>0&&localStorage.setItem(n,JSON.stringify(m))},[m,n]);const y=S.useCallback(()=>{p({}),localStorage.removeItem(n)},[n]),C=S.useCallback((w,T)=>{T.preventDefault(),T.stopPropagation(),T.target.setPointerCapture(T.pointerId);const E=m[w]||{x:0,y:0};u.current={x:T.clientX,y:T.clientY,offsetX:E.x,offsetY:E.y},f.current=!1,l(w)},[m]),x=S.useCallback(w=>{if(!s||!u.current)return;const T=u.current,E=w.clientX-T.x,M=w.clientY-T.y;(Math.abs(E)>3||Math.abs(M)>3)&&(f.current=!0),p(H=>({...H,[s]:{x:T.offsetX+E,y:T.offsetY+M}})),a&&requestAnimationFrame(a)},[s,a]),b=S.useCallback(()=>{l(null),u.current=null},[]);return{dragOffsets:m,draggingId:s,didDragRef:f,handlePointerDown:C,handlePointerMove:x,handlePointerUp:b,getOffset:w=>m[w]||{x:0,y:0},resetPositions:y,hasCustomPositions:Object.keys(m).length>0}}function sA(n){let a=0,s=0;return Object.values(n).forEach(l=>{a=Math.min(a,l.y),s=Math.max(s,l.y)}),{paddingTop:Math.max(0,-a),paddingBottom:Math.max(0,s),extraHeight:Math.max(0,Math.abs(a),Math.abs(s))*2}}function lA(n){const[a,s]=S.useState(new Set),l=S.useRef({});return S.useEffect(()=>{const u=new Set,f={};if(n.forEach(h=>{const m=h.successCount+h.failureCount;f[h.id]=m;const p=l.current[h.id];p!==void 0&&m>p&&u.add(h.id)}),l.current=f,u.size>0){s(u);const h=setTimeout(()=>s(new Set),2e3);return()=>clearTimeout(h)}},[n]),a}function rA({events:n,privacyMode:a}){const{t:s}=_t();return n.length===0?r.jsx("div",{className:"h-full flex items-center justify-center rounded-xl bg-muted/20 dark:bg-zinc-900/40 border border-border/30 dark:border-white/[0.05]",children:r.jsx("div",{className:"text-xs text-muted-foreground font-mono",children:s("flowViz.noRecentConnections")})}):r.jsxs("div",{className:"h-full flex flex-col",children:[r.jsxs("div",{className:"flex items-center gap-2 mb-3 px-2",children:[r.jsx(Ds,{className:"w-3.5 h-3.5 text-muted-foreground"}),r.jsx("span",{className:"text-[10px] text-muted-foreground font-medium uppercase tracking-wider",children:s("flowViz.connectionTimeline")})]}),r.jsx("div",{className:K("flex-1 rounded-xl p-4 overflow-y-auto","bg-muted/20 dark:bg-zinc-900/40 backdrop-blur-sm","border border-border/30 dark:border-white/[0.05]"),children:r.jsxs("div",{className:"relative",children:[r.jsx("div",{className:"absolute left-[7px] top-2 bottom-2 w-px bg-border/50 dark:bg-white/[0.08]"}),r.jsx("div",{className:"space-y-3",children:n.map(l=>{const u=l.status==="success"?Ft.success:l.status==="failed"?Ft.failed:Ft.degraded;return r.jsxs("div",{className:"relative flex items-start gap-3 pl-1",children:[r.jsx("div",{className:K("relative z-10 w-3.5 h-3.5 rounded-full flex-shrink-0 mt-0.5","ring-2 ring-background dark:ring-zinc-950"),style:{backgroundColor:u}}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("div",{className:"flex items-center justify-between gap-2",children:[r.jsx("span",{className:K("text-[10px] font-mono text-foreground truncate",a&&ux),children:Cx(l.accountEmail)}),r.jsx("span",{className:"text-[9px] text-muted-foreground font-mono flex-shrink-0",children:eA(l.timestamp)})]}),r.jsxs("div",{className:"flex items-center gap-2 mt-0.5",children:[r.jsx("span",{className:"text-[9px] font-medium uppercase",style:{color:u},children:l.status}),l.latencyMs&&r.jsxs("span",{className:"text-[9px] text-muted-foreground font-mono",children:[l.latencyMs,"ms"]})]})]})]},l.id)})})]})})]})}async function cA(){const n=await fetch("/api/cliproxy/stats");if(!n.ok){const a=await n.json();throw new Error(a.message||"Failed to fetch stats")}return n.json()}async function uA(){const n=await fetch("/api/cliproxy/status");if(!n.ok)throw new Error("Failed to fetch status");return n.json()}function dA(){return jt({queryKey:["cliproxy-status"],queryFn:uA,refetchInterval:1e4,retry:1})}function fA(n=!0){return jt({queryKey:["cliproxy-stats"],queryFn:cA,enabled:n,refetchInterval:5e3,retry:1,staleTime:3e3})}async function hA(){const n=await fetch("/api/cliproxy/error-logs");if(!n.ok){const s=await n.json();throw new Error(s.message||"Failed to fetch error logs")}return(await n.json()).files??[]}async function mA(n){const a=await fetch(`/api/cliproxy/error-logs/${encodeURIComponent(n)}`);if(!a.ok)throw new Error("Failed to fetch error log content");return a.text()}function pA(n=!0){return jt({queryKey:["cliproxy-error-logs"],queryFn:hA,enabled:n,refetchInterval:3e4,retry:1,staleTime:1e4})}function gA(n){return jt({queryKey:["cliproxy-error-log-content",n],queryFn:()=>n?mA(n):Promise.resolve(""),enabled:!!n,staleTime:6e4})}const wx=["agy","codex","claude","gemini","ghcp"],yA={antigravity:"agy",anthropic:"claude","gemini-cli":"gemini",copilot:"ghcp","github-copilot":"ghcp"};function Nx(n){const a=n.trim().toLowerCase();return a?wx.includes(a)?a:yA[a]??null:null}async function Yg(n,a){const s=await fetch(`/api/cliproxy/quota/${n}/${encodeURIComponent(a)}`);if(!s.ok){let l="Failed to fetch quota";try{l=(await s.json()).message||l}catch{}throw new Error(l)}return s.json()}async function xA(n){const a=await fetch(`/api/cliproxy/quota/codex/${encodeURIComponent(n)}`);if(!a.ok){let s="Failed to fetch Codex quota";try{s=(await a.json()).message||s}catch{}throw new Error(s)}return a.json()}async function vA(n){const a=await fetch(`/api/cliproxy/quota/claude/${encodeURIComponent(n)}`);if(!a.ok){let s="Failed to fetch Claude quota";try{s=(await a.json()).message||s}catch{}throw new Error(s)}return a.json()}async function bA(n){const a=await fetch(`/api/cliproxy/quota/gemini/${encodeURIComponent(n)}`);if(!a.ok){let s="Failed to fetch Gemini quota";try{s=(await a.json()).message||s}catch{}throw new Error(s)}return a.json()}async function SA(n){const a=await fetch(`/api/cliproxy/quota/ghcp/${encodeURIComponent(n)}`);if(!a.ok){let s="Failed to fetch GitHub Copilot quota";try{s=(await a.json()).message||s}catch{}throw new Error(s)}return a.json()}async function CA(n,a){const s=Nx(n);if(!s)return Yg(n,a);switch(s){case"codex":return xA(a);case"claude":return vA(a);case"gemini":return bA(a);case"ghcp":return SA(a);default:return Yg(n,a)}}function wA(n,a,s=!0){const l=Nx(n);return jt({queryKey:["account-quota",l??n,a],queryFn:()=>CA(l??n,a),enabled:s&&!!l&&!!a,staleTime:6e4,refetchInterval:6e4,refetchOnWindowFocus:!1,refetchOnMount:!1,retry:1})}function NA(n){if(!n)return null;const a=n.split(/[\s_-]+/g).map(s=>s.trim()).filter(s=>s.length>0).map(s=>s.charAt(0).toUpperCase()+s.slice(1));return a.length>0?a.join(" "):n}function AA(n,a){switch(n){case"five_hour":return"5h usage limit";case"seven_day":return"Weekly usage limit";case"seven_day_opus":return"Weekly usage (Opus)";case"seven_day_sonnet":return"Weekly usage (Sonnet)";case"seven_day_oauth_apps":return"Weekly usage (OAuth apps)";case"seven_day_cowork":return"Weekly usage (Cowork)";case"overage":return"Extra usage";default:return a}}function kA({quota:n,resetTime:a}){if(!n)return r.jsx("p",{className:"text-xs text-muted-foreground",children:"Loading quota..."});if(!n.success)return r.jsx("p",{className:"text-xs text-destructive",children:n.error||"Failed to load quota"});if(Hd(n)){const s=oN(n.models||[]),l=sN(s),u=["primary","gemini-3","gemini-2","other"];return r.jsxs("div",{className:"text-xs space-y-1",children:[r.jsx("p",{className:"font-medium",children:"Model Quotas:"}),u.map((f,h)=>{const m=l.get(f);if(!m||m.length===0)return null;const p=u.slice(0,h).every(y=>!l.get(y)?.length);return r.jsxs("div",{children:[!p&&r.jsx("div",{className:"border-t border-border/40 my-1"}),m.map(y=>r.jsxs("div",{className:"flex justify-between gap-4",children:[r.jsx("span",{className:K("truncate",y.exhausted&&"text-red-500"),children:y.displayName}),r.jsxs("span",{className:K("font-mono",y.exhausted&&"text-red-500"),children:[y.percentage,"%"]})]},y.name))]},f)}),r.jsx(or,{resetTime:a})]})}if(Tr(n)){const{fiveHourWindow:s,weeklyWindow:l,codeReviewWindows:u,unknownWindows:f}=jr(n.windows),h=n.coreUsage?.fiveHour?.resetAt??s?.resetAt??null,m=n.coreUsage?.weekly?.resetAt??l?.resetAt??null,p=[s,l,...u,...f].filter(y=>!!y).filter((y,C,x)=>x.findIndex(b=>b.label===y.label&&b.resetAt===y.resetAt)===C);return r.jsxs("div",{className:"text-xs space-y-1",children:[r.jsx("p",{className:"font-medium",children:"Rate Limits:"}),n.planType&&r.jsxs("p",{className:"text-muted-foreground",children:["Plan: ",n.planType]}),p.map((y,C)=>r.jsxs("div",{className:"flex justify-between gap-4",children:[r.jsx("span",{className:K(y.remainingPercent<20&&"text-red-500"),children:rN(y,p)}),r.jsxs("span",{className:"font-mono",children:[y.remainingPercent,"%"]})]},`${y.label}-${y.resetAt??"no-reset"}-${C}`)),r.jsx(Vg,{fiveHourResetTime:h,weeklyResetTime:m,fallbackResetTime:a})]})}if(Mr(n)){const s=[n.coreUsage?.fiveHour,n.coreUsage?.weekly].filter(m=>!!m).map(m=>({rateLimitType:m.rateLimitType,label:m.label,remainingPercent:m.remainingPercent,resetAt:m.resetAt,status:m.status})),l=n.windows.map(m=>({rateLimitType:m.rateLimitType,label:m.label,remainingPercent:m.remainingPercent,resetAt:m.resetAt,status:m.status})),u=[...s,...l].filter((m,p,y)=>y.findIndex(C=>C.rateLimitType===m.rateLimitType&&C.resetAt===m.resetAt&&C.status===m.status)===p),f=n.coreUsage?.fiveHour?.resetAt??n.windows.find(m=>m.rateLimitType==="five_hour")?.resetAt??null,h=n.coreUsage?.weekly?.resetAt??n.windows.find(m=>["seven_day","seven_day_opus","seven_day_sonnet","seven_day_oauth_apps","seven_day_cowork"].includes(m.rateLimitType))?.resetAt??null;return r.jsxs("div",{className:"text-xs space-y-1",children:[r.jsx("p",{className:"font-medium",children:"Rate Limits:"}),u.map((m,p)=>r.jsxs("div",{className:"flex justify-between gap-4",children:[r.jsx("span",{className:K(m.remainingPercent<20&&"text-red-500"),children:AA(m.rateLimitType,m.label)}),r.jsxs("span",{className:"font-mono",children:[m.remainingPercent,"%"]})]},`${m.rateLimitType}-${m.resetAt??"no-reset"}-${m.status}-${p}`)),r.jsx(Vg,{fiveHourResetTime:f,weeklyResetTime:h,fallbackResetTime:a})]})}if(Bd(n))return r.jsxs("div",{className:"text-xs space-y-1",children:[r.jsx("p",{className:"font-medium",children:"Buckets:"}),n.buckets.map(s=>r.jsxs("div",{className:"flex justify-between gap-4",children:[r.jsxs("span",{className:K(s.remainingPercent<20&&"text-red-500"),children:[s.label,s.tokenType?` (${s.tokenType})`:""]}),r.jsxs("span",{className:"font-mono",children:[s.remainingPercent,"%"]})]},s.id)),r.jsx(or,{resetTime:a})]});if(Kd(n)){const s=[{label:"Premium Interactions",snapshot:n.snapshots.premiumInteractions},{label:"Chat",snapshot:n.snapshots.chat},{label:"Completions",snapshot:n.snapshots.completions}],l=n.quotaResetDate??a,u=NA(n.planType);return r.jsxs("div",{className:"text-xs space-y-1",children:[r.jsx("p",{className:"font-medium",children:"Quota Snapshots:"}),u&&r.jsxs("p",{className:"text-muted-foreground",children:["Plan: ",u]}),s.map(({label:f,snapshot:h})=>{const m=h.percentRemaining<20;return r.jsxs("div",{className:"space-y-0.5",children:[r.jsxs("div",{className:"flex justify-between gap-4",children:[r.jsx("span",{className:K(m&&"text-red-500"),children:f}),r.jsx("span",{className:K("font-mono",m&&"text-red-500"),children:h.unlimited?"Unlimited":`${hx(h.percentRemaining)}%`})]}),!h.unlimited&&r.jsxs("div",{className:"text-[11px] text-muted-foreground",children:[h.remaining,"/",h.entitlement," remaining"]})]},f)}),r.jsx(or,{resetTime:l})]})}return null}function or({resetTime:n}){return n?r.jsxs("div",{className:"flex items-center gap-1.5 pt-1 border-t border-border/50",children:[r.jsx(Os,{className:"w-3 h-3 text-blue-400"}),r.jsxs("span",{className:"text-blue-400 font-medium",children:["Resets ",bd(n)]})]}):null}function Vg({fiveHourResetTime:n,weeklyResetTime:a,fallbackResetTime:s}){const l=!!n||!!a;return!l&&!s?null:r.jsxs("div",{className:"pt-1 border-t border-border/50 space-y-1",children:[n&&r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx(Os,{className:"w-3 h-3 text-blue-400"}),r.jsxs("span",{className:"text-blue-400 font-medium",children:["5h resets ",bd(n)]})]}),a&&r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx(Os,{className:"w-3 h-3 text-indigo-400"}),r.jsxs("span",{className:"text-indigo-400 font-medium",children:["Weekly resets ",bd(a)]})]}),!l&&s&&r.jsx(or,{resetTime:s})]})}function jA({success:n,failure:a,showDetails:s}){const l=n+a,u=l>0?n/l*100:100;return r.jsxs("div",{className:"mt-2 space-y-2",children:[r.jsxs("div",{className:"flex items-end justify-between px-0.5",children:[r.jsxs("div",{className:"flex flex-col",children:[r.jsx("span",{className:"text-[8px] text-muted-foreground/70 uppercase font-bold tracking-tight",children:"Success Rate"}),r.jsxs("span",{className:K("text-sm font-mono font-bold leading-none mt-0.5",u===100?"text-emerald-600 dark:text-emerald-400":u>=90?"text-amber-500":"text-red-500"),children:[Math.round(u),"%"]})]}),r.jsxs("div",{className:"flex flex-col items-end",children:[r.jsx("span",{className:"text-[8px] text-muted-foreground/70 uppercase font-bold tracking-tight",children:"Volume"}),r.jsx("span",{className:"text-xs font-mono font-medium text-foreground/80 leading-none mt-0.5",children:l.toLocaleString()})]})]}),r.jsxs("div",{className:K("grid grid-cols-2 gap-2 overflow-hidden transition-all duration-300 ease-in-out",s?"max-h-20 opacity-100 mt-2":"max-h-0 opacity-0 mt-0"),children:[r.jsxs("div",{className:"flex items-center gap-1.5 px-1.5 py-1 rounded-md bg-emerald-500/5 dark:bg-emerald-500/10 border border-emerald-500/10",children:[r.jsx(Sr,{className:"w-2.5 h-2.5 text-emerald-600 dark:text-emerald-400"}),r.jsx("span",{className:"text-[10px] font-mono font-bold text-emerald-600 dark:text-emerald-400",children:n})]}),r.jsxs("div",{className:K("flex items-center gap-1.5 px-1.5 py-1 rounded-md border",a>0?"bg-red-500/5 dark:bg-red-500/10 border-red-500/20":"bg-muted/10 border-transparent opacity-40"),children:[r.jsx(Od,{className:K("w-2.5 h-2.5",a>0?"text-red-500":"text-muted-foreground")}),r.jsx("span",{className:K("text-[10px] font-mono font-bold",a>0?"text-red-500":"text-muted-foreground"),children:a})]})]})]})}const TA=["antigravity","anthropic","gemini-cli","copilot","github-copilot"],MA={left:"border-l-2",right:"border-r-2",top:"border-t-2",bottom:"border-b-2"},DA={left:"top-1/2 -right-1.5 -translate-y-1/2",right:"top-1/2 -left-1.5 -translate-y-1/2",top:"left-1/2 -bottom-1.5 -translate-x-1/2",bottom:"left-1/2 -top-1.5 -translate-x-1/2"};function EA(n,a){switch(n){case"left":return{borderLeftColor:a};case"right":return{borderRightColor:a};case"top":return{borderTopColor:a};case"bottom":return{borderBottomColor:a}}}function OA({account:n,zone:a,originalIndex:s,isHovered:l,isDragging:u,offset:f,showDetails:h,privacyMode:m,onMouseEnter:p,onMouseLeave:y,onPointerDown:C,onPointerMove:x,onPointerUp:b,onPauseToggle:N,isPausingAccount:w}){const{t:T}=_t(),E=MA[a],M=EA(a,n.color),H=DA[a],B=n.provider.toLowerCase(),U=wx.includes(B)||TA.includes(B),O=B==="codex",A=B==="claude"||B==="anthropic",{data:_,isLoading:W}=wA(B,n.id,U),F=gN(n.provider,_),Q=yN(n.provider,_),ae=O&&_&&Tr(_)?jr(_.windows):null,te=[{label:"5h",value:ae?.fiveHourWindow?.remainingPercent??null},{label:"Wk",value:ae?.weeklyWindow?.remainingPercent??null}].filter(ee=>ee.value!==null),ye=A&&_&&Mr(_)?[{label:"5h",value:_.coreUsage?.fiveHour?.remainingPercent??_.windows.find(ee=>ee.rateLimitType==="five_hour")?.remainingPercent??null},{label:"Wk",value:_.coreUsage?.weekly?.remainingPercent??_.windows.find(ee=>["seven_day","seven_day_opus","seven_day_sonnet","seven_day_oauth_apps","seven_day_cowork"].includes(ee.rateLimitType))?.remainingPercent??null}].filter(ee=>ee.value!==null):[],de=O?te:A?ye:[],Ce=F!==null?hx(F):null,R=Ce!==null?Number(Ce):null,$=n.provider==="agy"&&n.tier&&n.tier!=="unknown"&&n.tier!=="free";return r.jsxs("div",{"data-account-index":s,"data-zone":a,onMouseEnter:p,onMouseLeave:y,onPointerDown:C,onPointerMove:x,onPointerUp:b,onPointerCancel:b,className:K("group/card relative rounded-lg p-3 w-44 cursor-grab transition-shadow duration-200","bg-muted/30 dark:bg-zinc-900/60 backdrop-blur-sm","border border-border/50 dark:border-white/[0.08]",E,"select-none touch-none",l&&"bg-muted/50 dark:bg-zinc-800/60",u&&"cursor-grabbing shadow-xl scale-105 z-50",n.paused&&"opacity-60"),style:{...M,transform:`translate(${f.x}px, ${f.y}px)${u?" scale(1.05)":""}`},children:[r.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[r.jsxs("div",{className:"flex items-center gap-1.5 flex-1 min-w-0",children:[r.jsx("span",{className:K("text-xs font-semibold text-foreground tracking-tight truncate",m&&ux),children:Cx(n.email)}),$&&r.jsx("span",{className:K("text-[7px] font-bold uppercase tracking-wide px-1 py-px rounded shrink-0",n.tier==="ultra"?"bg-violet-500/15 text-violet-600 dark:bg-violet-500/25 dark:text-violet-300":"bg-yellow-500/15 text-yellow-700 dark:bg-yellow-500/20 dark:text-yellow-400"),children:n.tier})]}),N&&r.jsx(Ci,{children:r.jsxs($a,{children:[r.jsx(Wa,{asChild:!0,children:r.jsx(ut,{variant:"ghost",size:"icon",className:K("h-4 w-4 shrink-0","transition-all rounded-full",n.paused?"bg-amber-500/20 hover:bg-amber-500/30":"hover:bg-muted"),onClick:ee=>{ee.stopPropagation(),N(n.id,!n.paused)},disabled:w,children:w?r.jsx(Dn,{className:"w-2.5 h-2.5 animate-spin"}):n.paused?r.jsx(HS,{className:"w-2.5 h-2.5 text-amber-600 dark:text-amber-400"}):r.jsx(BS,{className:"w-2.5 h-2.5 text-muted-foreground/50 hover:text-foreground"})})}),r.jsx(Xa,{side:"top",className:"text-xs",children:n.paused?T("accountCard.resumeAccount"):T("accountCard.pauseAccount")})]})}),r.jsx(Cr,{className:"w-4 h-4 text-muted-foreground/40 shrink-0"})]}),r.jsx(jA,{success:n.successCount,failure:n.failureCount,showDetails:h}),U&&r.jsx("div",{className:"mt-2 px-0.5",children:W?r.jsxs("div",{className:"flex items-center gap-1 text-[8px] text-muted-foreground",children:[r.jsx(Dn,{className:"w-2.5 h-2.5 animate-spin"}),r.jsx("span",{children:T("accountCard.quotaLoading")})]}):R!==null?r.jsx(Ci,{children:r.jsxs($a,{children:[r.jsx(Wa,{asChild:!0,children:r.jsxs("div",{className:"space-y-0.5 cursor-help",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("span",{className:"text-[8px] text-muted-foreground/70 uppercase font-bold tracking-tight",children:T("accountCard.quota")}),r.jsxs("span",{className:K("text-[10px] font-mono font-bold",R>50?"text-emerald-600 dark:text-emerald-400":R>20?"text-amber-500":"text-red-500"),children:[Ce,"%"]})]}),de.length>0&&r.jsx("div",{className:"flex items-center justify-between text-[7px] text-muted-foreground/70",children:de.map(ee=>r.jsxs("span",{children:[ee.label," ",ee.value,"%"]},ee.label))}),r.jsx("div",{className:"w-full bg-muted dark:bg-zinc-800/50 h-1 rounded-full overflow-hidden",children:r.jsx("div",{className:K("h-full rounded-full transition-all",R>50?"bg-emerald-500":R>20?"bg-amber-500":"bg-red-500"),style:{width:`${R}%`}})})]})}),r.jsx(Xa,{side:"top",className:"max-w-xs",children:r.jsx(kA,{quota:_,resetTime:Q})})]})}):_?.success?r.jsx("div",{className:"text-[8px] text-muted-foreground/60",children:T("accountCard.quotaUnavailable")}):_?.needsReauth?r.jsx(Ci,{children:r.jsxs($a,{children:[r.jsx(Wa,{asChild:!0,children:r.jsxs("div",{className:"flex items-center gap-1 text-[8px] text-amber-600 dark:text-amber-400",children:[r.jsx(Dd,{className:"w-2.5 h-2.5"}),r.jsx("span",{children:T("accountCard.reauthNeeded")})]})}),r.jsx(Xa,{side:"top",className:"max-w-[200px]",children:r.jsx("p",{className:"text-xs",children:_.error?.includes("No refresh token")?T("accountCard.removeAndReadd"):_.error||T("accountCard.autoRefreshFailed")})})]})}):_?.error?r.jsx("div",{className:"text-[8px] text-muted-foreground/60 truncate",title:_.error,children:_.error.length>20?`${_.error.slice(0,18)}...`:_.error}):null}),r.jsx("div",{className:K("absolute w-3 h-3 rounded-full transform z-20 transition-colors border","bg-muted dark:bg-zinc-800 border-border dark:border-zinc-600",H,l&&"bg-foreground dark:bg-white border-transparent")})]})}function ef({provider:n,className:a,size:s=18,withBackground:l=!1}){const u=n.toLowerCase(),f=k1(n),h=Wd[u]||"#6b7280",m=l?Math.floor(s*.65):s,p=f?r.jsx("img",{src:f,alt:`${n} icon`,width:m,height:m,className:"shrink-0 object-contain"}):r.jsx("span",{className:"font-bold",style:{color:h,fontSize:m*.6},children:n.charAt(0).toUpperCase()});if(l)return r.jsx("div",{className:K("shrink-0 rounded-full bg-white border border-border flex items-center justify-center shadow-sm",a),style:{width:s,height:s},children:p});if(f)return r.jsx("img",{src:f,alt:`${n} icon`,width:s,height:s,className:K("shrink-0 rounded-sm object-contain",a)});const y=h;return r.jsx("div",{className:K("shrink-0 rounded-full flex items-center justify-center text-white font-bold",a),style:{width:s,height:s,backgroundColor:y,fontSize:s*.5},children:n.charAt(0).toUpperCase()})}function RA({providerData:n,providerColor:a,totalRequests:s,maxRequests:l,isDragging:u,offset:f,hoveredAccount:h,hasRightAccounts:m,hasTopAccounts:p,hasBottomAccounts:y,onPointerDown:C,onPointerMove:x,onPointerUp:b}){const{t:N}=_t(),{accounts:w}=n;return r.jsxs("div",{"data-provider-node":!0,onPointerDown:C,onPointerMove:x,onPointerUp:b,onPointerCancel:b,className:K("group relative w-full rounded-xl p-4 cursor-grab transition-shadow duration-200","bg-muted/30 dark:bg-zinc-900/60 backdrop-blur-sm","border-2 border-border/50 dark:border-white/[0.08]",!u&&"animate-subtle-float animate-border-glow","select-none touch-none",h!==null&&"scale-[1.02]",u&&"cursor-grabbing shadow-2xl scale-105 z-50"),style:{"--glow-color":`${a}60`,borderColor:h!==null?`${a}80`:void 0,transform:`translate(${f.x}px, ${f.y}px)${u?" scale(1.05)":""}`},children:[r.jsx(Cr,{className:"absolute top-2 right-2 w-4 h-4 text-muted-foreground/40"}),r.jsx("div",{className:"absolute inset-0 rounded-xl animate-glow-pulse pointer-events-none",style:{"--glow-color":`${a}30`}}),r.jsx("div",{className:"absolute top-1/2 -left-1.5 w-3 h-3 rounded-full transform -translate-y-1/2",style:{backgroundColor:a,boxShadow:"0 0 0 4px var(--background)"}}),m&&r.jsx("div",{className:"absolute top-1/2 -right-1.5 w-3 h-3 rounded-full transform -translate-y-1/2",style:{backgroundColor:a,boxShadow:"0 0 0 4px var(--background)"}}),p&&r.jsx("div",{className:"absolute left-1/2 -top-1.5 w-3 h-3 rounded-full transform -translate-x-1/2",style:{backgroundColor:a,boxShadow:"0 0 0 4px var(--background)"}}),y&&r.jsx("div",{className:"absolute left-1/2 -bottom-1.5 w-3 h-3 rounded-full transform -translate-x-1/2",style:{backgroundColor:a,boxShadow:"0 0 0 4px var(--background)"}}),r.jsxs("div",{className:"flex items-center gap-3 mb-4 relative z-10",children:[r.jsx("div",{className:"animate-icon-breathe",children:r.jsx(ef,{provider:n.provider,size:36,withBackground:!0})}),r.jsxs("div",{children:[r.jsx("h3",{className:"text-sm font-semibold text-foreground tracking-tight",children:n.displayName}),r.jsx("p",{className:"text-[10px] text-muted-foreground font-medium uppercase",children:N("flowViz.provider")})]})]}),r.jsxs("div",{className:"space-y-2 relative z-10",children:[r.jsxs("div",{className:"flex justify-between items-center text-xs",children:[r.jsx("span",{className:"text-muted-foreground",children:N("flowViz.totalRequests")}),r.jsx("span",{className:"text-foreground font-mono",children:s.toLocaleString()})]}),r.jsxs("div",{className:"flex justify-between items-center text-xs",children:[r.jsx("span",{className:"text-muted-foreground",children:N("flowViz.accounts")}),r.jsx("span",{className:"text-foreground font-mono",children:w.length})]}),r.jsx("div",{className:"w-full bg-muted dark:bg-zinc-800/50 h-1 rounded-full mt-2 overflow-hidden",children:r.jsx("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${Math.min(100,s/(l*w.length)*100)}%`,backgroundColor:a}})})]})]})}function PA({paths:n,accounts:a,maxRequests:s,hoveredAccount:l,pulsingAccounts:u}){return r.jsxs(r.Fragment,{children:[r.jsx("defs",{children:r.jsxs("filter",{id:"flow-glow",x:"-20%",y:"-20%",width:"140%",height:"140%",filterUnits:"userSpaceOnUse",children:[r.jsx("feGaussianBlur",{stdDeviation:"3",result:"blur"}),r.jsx("feComposite",{in:"SourceGraphic",in2:"blur",operator:"over"})]})}),n.map((f,h)=>{const m=a[h];if(!m)return null;const p=m.successCount+m.failureCount,y=Math.max(2,p/s*10),C=l===h,x=l!==null&&l!==h,b=u.has(m.id),N=J1(h);return r.jsxs("g",{children:[r.jsx("path",{d:f,fill:"none",stroke:N,strokeWidth:y,strokeOpacity:C?.8:x?.15:.4,strokeLinecap:"round",filter:C?"url(#flow-glow)":void 0,className:"transition-all duration-300"}),b&&r.jsxs(r.Fragment,{children:[r.jsx("path",{d:f,fill:"none",stroke:m.color,strokeWidth:y*2,strokeLinecap:"round",filter:"url(#flow-glow)",className:"animate-request-pulse"}),r.jsx("circle",{r:6,fill:m.color,filter:"url(#flow-glow)",style:{offsetPath:`path('${f}')`,offsetDistance:"0%",animation:"travel-dot 1.5s cubic-bezier(0.4, 0, 0.2, 1) forwards"}})]})]},h)})]})}function LA({onBack:n,showDetails:a,onToggleDetails:s,hasCustomPositions:l,onResetPositions:u}){const{t:f}=_t();return r.jsxs("div",{className:"flex items-center justify-between px-3 py-1.5",children:[n?r.jsxs("button",{onClick:n,className:"group flex items-center gap-1.5 text-xs font-medium text-muted-foreground hover:text-foreground transition-all duration-200 px-3 py-1.5 rounded-md hover:bg-muted/50 border border-transparent hover:border-border/50",children:[r.jsx(yr,{className:"w-3.5 h-3.5 rotate-180 transition-transform group-hover:-translate-x-0.5"}),r.jsx("span",{children:f("flowViz.backToProviders")})]}):r.jsx("div",{}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs("button",{onClick:s,className:K("flex items-center gap-1.5 text-xs font-medium transition-all duration-200 px-3 py-1.5 rounded-md border shadow-sm",a?"bg-primary text-primary-foreground border-primary hover:bg-primary/90":"bg-background text-muted-foreground hover:text-foreground border-border/60 hover:border-border hover:bg-muted/50"),children:[a?r.jsx(xr,{className:"w-3.5 h-3.5"}):r.jsx(vr,{className:"w-3.5 h-3.5"}),r.jsx("span",{children:f(a?"flowViz.hideDetails":"flowViz.showDetails")})]}),l&&r.jsxs("button",{onClick:u,className:"flex items-center gap-1.5 text-xs font-medium text-muted-foreground hover:text-foreground transition-all duration-200 px-3 py-1.5 rounded-md border border-border/60 hover:border-border bg-background hover:bg-muted/50 shadow-sm",children:[r.jsx(KS,{className:"w-3.5 h-3.5"}),r.jsx("span",{children:f("flowViz.resetLayout")})]})]})]})}function _A({providerData:n,onBack:a,onPauseToggle:s,isPausingAccount:l}){const u=S.useRef(null),f=S.useRef(null),[h,m]=S.useState(null),[p,y]=S.useState(!1),[C,x]=S.useState([]),{privacyMode:b}=_d(),{accounts:N}=n,w=Math.max(...N.map(J=>J.successCount+J.failureCount),1),T=N.reduce((J,le)=>J+le.successCount+le.failureCount,0),E=S.useCallback(()=>{const J=nA({containerRef:u,svgRef:f,accounts:N});J.length>0&&x(J)},[N]),M=`ccs-flow-positions-${n.provider}`,{dragOffsets:H,draggingId:B,handlePointerDown:U,handlePointerMove:O,handlePointerUp:A,getOffset:_,resetPositions:W,hasCustomPositions:F}=oA({storageKey:M,onDrag:E}),Q=sA(H),ae=lA(N),te=S.useMemo(()=>tA(N).slice(0,Z1),[N]);S.useEffect(()=>{const J=setTimeout(E,50);return window.addEventListener("resize",E),()=>{clearTimeout(J),window.removeEventListener("resize",E)}},[E]),S.useEffect(()=>{const J=setTimeout(E,10);return()=>clearTimeout(J)},[H,E]),S.useEffect(()=>{const J=Date.now(),le=350,ne=()=>{E(),Date.now()-J<le&&requestAnimationFrame(ne)};requestAnimationFrame(ne)},[p,E]);const ye=Wd[n.provider.toLowerCase()]||"#6b7280",de=S.useMemo(()=>aA(N),[N]),{leftAccounts:Ce,rightAccounts:R,topAccounts:$,bottomAccounts:ee}=de,X=R.length>0,se=$.length>0,fe=ee.length>0,Ne=S.useMemo(()=>iA(N.length),[N.length]),V=(J,le)=>J.map(ne=>{const oe=N.findIndex(xe=>xe.id===ne.id);return r.jsx(OA,{account:ne,zone:le,originalIndex:oe,isHovered:h===oe,isDragging:B===ne.id,offset:_(ne.id),showDetails:p,privacyMode:b,onMouseEnter:()=>m(oe),onMouseLeave:()=>m(null),onPointerDown:xe=>U(ne.id,xe),onPointerMove:O,onPointerUp:A,onPauseToggle:s,isPausingAccount:l},ne.id)});return r.jsxs("div",{className:"flex flex-col",ref:u,children:[r.jsx(LA,{onBack:a,showDetails:p,onToggleDetails:()=>y(!p),hasCustomPositions:F,onResetPositions:W}),r.jsxs("div",{className:"min-h-[320px] flex gap-4 px-4 py-6 self-stretch items-stretch transition-all duration-200",children:[r.jsxs("div",{className:"relative flex-1 flex flex-col items-stretch justify-center px-4",style:{paddingTop:`${24+Q.paddingTop}px`,paddingBottom:`${24+Q.paddingBottom}px`,minHeight:`${320+Q.extraHeight}px`},children:[r.jsx("svg",{ref:f,className:"absolute inset-0 w-full h-full pointer-events-none z-0 overflow-visible",children:r.jsx(PA,{paths:C,accounts:N,maxRequests:w,hoveredAccount:h,pulsingAccounts:ae})}),se&&r.jsx("div",{className:"flex flex-row gap-3 z-10 justify-center flex-wrap mb-8",children:V($,"top")}),r.jsxs("div",{className:"flex items-center justify-between gap-8 flex-1",children:[r.jsx("div",{className:"flex flex-col gap-3 z-10 w-48 justify-center flex-shrink-0",children:V(Ce,"left")}),r.jsx("div",{className:K("z-10 flex items-center flex-shrink-0",Ne),children:r.jsx(RA,{providerData:n,providerColor:ye,totalRequests:T,maxRequests:w,isDragging:B==="provider",offset:_("provider"),hoveredAccount:h,hasRightAccounts:X,hasTopAccounts:se,hasBottomAccounts:fe,onPointerDown:J=>U("provider",J),onPointerMove:O,onPointerUp:A})}),X&&r.jsx("div",{className:"flex flex-col gap-3 z-10 w-48 justify-center flex-shrink-0",children:V(R,"right")})]}),fe&&r.jsx("div",{className:"flex flex-row gap-3 z-10 justify-center flex-wrap mt-8",children:V(ee,"bottom")})]}),r.jsx("div",{className:"w-56 flex-shrink-0 self-stretch relative",children:r.jsx("div",{className:"absolute inset-0",children:r.jsx(rA,{events:te,privacyMode:b})})})]})]})}function zA(n,a){const s=n+a;return s===0?100:Math.round(n/s*100)}function UA(n){return n.replace(/@(gmail|yahoo|hotmail|outlook|icloud)\.com$/i,"")}const Fg=["#1e6091","#2d8a6e","#d4a012","#c92a2d","#c45a1a","#6b9c4d","#3d5a73","#cc7614","#3a7371","#7c5fc4"];function IA(){const{data:n,isLoading:a,error:s}=QN(),{data:l,isLoading:u,dataUpdatedAt:f}=fA(),[h,m]=S.useState("");S.useEffect(()=>{if(!f)return;const T=()=>{const M=Math.floor((Date.now()-f)/1e3);M<60?m(`${M}s ago`):m(`${Math.floor(M/60)}m ago`)};T();const E=setInterval(T,1e3);return()=>clearInterval(E)},[f]);const p=S.useMemo(()=>l?.accountStats?new Map(Object.entries(l.accountStats)):new Map,[l?.accountStats]),{accounts:y,totalSuccess:C,totalFailure:x,totalRequests:b,providerStats:N}=S.useMemo(()=>{if(!n?.authStatus)return{accounts:[],totalSuccess:0,totalFailure:0,totalRequests:0,providerStats:[]};const T=[],E=new Map;let M=0,H=0,B=0;n.authStatus.forEach(O=>{const A=O.provider;E.has(A)||E.set(A,{success:0,failure:0,accounts:[]});const _=E.get(A);_&&O.accounts?.forEach(W=>{const F=W.email||W.id,Q=p.get(F),ae=Q?.successCount??0,te=Q?.failureCount??0;M+=ae,H+=te,_.success+=ae,_.failure+=te;const ye={id:W.id,email:W.email||W.id,provider:O.provider,displayName:O.displayName,isDefault:W.isDefault,successCount:ae,failureCount:te,lastUsedAt:Q?.lastUsedAt??W.lastUsedAt,color:Fg[B%Fg.length],projectId:W.projectId,paused:W.paused,tier:W.tier};T.push(ye),_.accounts.push(ye),B++})});const U=[];return E.forEach((O,A)=>{O.accounts.length!==0&&U.push({provider:A,displayName:Xd(A),totalRequests:O.success+O.failure,successCount:O.success,failureCount:O.failure,accountCount:O.accounts.length,accounts:O.accounts})}),U.sort((O,A)=>A.totalRequests-O.totalRequests),{accounts:T,totalSuccess:M,totalFailure:H,totalRequests:M+H,providerStats:U}},[n?.authStatus,p]),w=b>0?Math.round(C/b*100):100;return{accounts:y,totalSuccess:C,totalFailure:x,totalRequests:b,providerStats:N,overallSuccessRate:w,isLoading:a||u,error:s??null,timeSinceUpdate:h}}function HA(){return r.jsxs("div",{className:"relative flex items-center justify-center w-5 h-5",children:[r.jsx("div",{className:"absolute w-4 h-4 rounded-full animate-ping opacity-20",style:{backgroundColor:Ft.success}}),r.jsx("div",{className:"absolute w-3 h-3 rounded-full animate-pulse opacity-40",style:{backgroundColor:Ft.success}}),r.jsx("div",{className:"relative w-2 h-2 rounded-full z-10",style:{backgroundColor:Ft.success}})]})}function BA({success:n,failure:a}){return n===0&&a===0?r.jsx("span",{className:"text-[9px] text-muted-foreground/50 font-mono",children:"no activity"}):r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs("div",{className:"flex items-center gap-0.5",children:[r.jsx(Sr,{className:"w-3 h-3 text-emerald-700 dark:text-emerald-500"}),r.jsx("span",{className:"text-[10px] font-mono font-medium text-emerald-700 dark:text-emerald-500",children:n.toLocaleString()})]}),a>0&&r.jsxs("div",{className:"flex items-center gap-0.5",children:[r.jsx(Od,{className:"w-3 h-3 text-red-700 dark:text-red-500"}),r.jsx("span",{className:"text-[10px] font-mono font-medium text-red-700 dark:text-red-500",children:a.toLocaleString()})]})]})}function KA({stats:n,isHovered:a,privacyMode:s,onSelect:l,onMouseEnter:u,onMouseLeave:f}){const h=zA(n.successCount,n.failureCount),m=Wd[n.provider.toLowerCase()]||"#6b7280";return r.jsxs("button",{onClick:l,onMouseEnter:u,onMouseLeave:f,className:K("group relative rounded-xl p-4 text-left transition-all duration-300","bg-muted/30 dark:bg-zinc-900/60 backdrop-blur-sm","border border-border/50 dark:border-white/[0.08]","hover:border-opacity-50 hover:scale-[1.02] hover:shadow-lg",a&&"ring-1"),style:{borderColor:a?m:void 0,"--ring-color":m},children:[r.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[r.jsx(ef,{provider:n.provider,size:36,withBackground:!0}),r.jsxs("div",{children:[r.jsx("h3",{className:"text-sm font-semibold text-foreground tracking-tight",children:n.displayName}),r.jsxs("p",{className:"text-[10px] text-muted-foreground",children:[n.accountCount," account",n.accountCount!==1?"s":""]})]}),r.jsx(yr,{className:K("w-4 h-4 ml-auto text-muted-foreground transition-all",a?"opacity-100 translate-x-0":"opacity-0 -translate-x-2")})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsxs("div",{className:"flex justify-between items-center text-xs",children:[r.jsx("span",{className:"text-muted-foreground",children:"Stats"}),r.jsx(BA,{success:n.successCount,failure:n.failureCount})]}),r.jsxs("div",{className:"flex justify-between text-xs",children:[r.jsx("span",{className:"text-muted-foreground",children:"Success Rate"}),r.jsxs("span",{className:"font-mono font-semibold",style:{color:h===100?Ft.success:h>=95?Ft.degraded:Ft.failed},children:[h,"%"]})]}),r.jsx("div",{className:"w-full bg-muted dark:bg-zinc-800/50 h-1 rounded-full overflow-hidden",children:r.jsx("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${h}%`,backgroundColor:m}})})]}),r.jsxs("div",{className:"flex gap-1 mt-3 items-center",children:[n.accounts.slice(0,5).map(p=>{const y=n.provider==="agy"&&!p.projectId;return r.jsxs("div",{className:"relative",children:[r.jsx("div",{className:K("w-2 h-2 rounded-full",p.paused&&"opacity-50"),style:{backgroundColor:p.color},title:s?"••••••":UA(p.email)}),y&&r.jsx(Ci,{children:r.jsxs($a,{children:[r.jsx(Wa,{asChild:!0,children:r.jsx(va,{className:"absolute -top-1 -right-1 w-2.5 h-2.5 text-amber-500","aria-label":"Missing Project ID"})}),r.jsx(Xa,{side:"top",className:"text-xs",children:"Missing Project ID - re-add account to fix"})]})})]},p.id)}),n.accounts.length>5&&r.jsxs("span",{className:"text-[10px] text-muted-foreground ml-1",children:["+",n.accounts.length-5]})]})]})}function er({icon:n,label:a,value:s,color:l}){return r.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-card/50 dark:bg-zinc-900/50 border border-border/50 dark:border-white/[0.06]",children:[r.jsx("div",{className:"w-8 h-8 rounded-md flex items-center justify-center",style:{backgroundColor:l?`${l}15`:"var(--muted)",color:l||"var(--muted-foreground)"},children:n}),r.jsxs("div",{children:[r.jsx("div",{className:"text-[10px] text-muted-foreground uppercase tracking-wider",children:a}),r.jsx("div",{className:"text-lg font-semibold font-mono leading-tight",style:{color:l||"var(--foreground)"},children:s})]})]})}const td="auth-monitor-selected-provider";function qA(){const{t:n}=_t(),{accounts:a,totalSuccess:s,totalFailure:l,totalRequests:u,providerStats:f,overallSuccessRate:h,isLoading:m,error:p,timeSinceUpdate:y}=IA(),{privacyMode:C}=_d(),[x,b]=S.useState(()=>typeof window<"u"?localStorage.getItem(td):null),N=O=>{b(O),O?localStorage.setItem(td,O):localStorage.removeItem(td)},w=S.useMemo(()=>x&&f.some(O=>O.provider===x)?x:null,[x,f]),[T,E]=S.useState(null),M=$N(),H=WN(),B=w?f.find(O=>O.provider===w):null,U=(O,A)=>{!w||M.isPending||H.isPending||(A?M.mutate({provider:w,accountId:O}):H.mutate({provider:w,accountId:O}))};return m?r.jsxs("div",{className:"rounded-xl border border-border overflow-hidden font-mono text-[13px] bg-card/50 dark:bg-zinc-900/60 backdrop-blur-sm",children:[r.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border",children:[r.jsx(Ke,{className:"h-4 w-32"}),r.jsx(Ke,{className:"h-4 w-20"})]}),r.jsxs("div",{className:"p-4 space-y-4",children:[r.jsx("div",{className:"flex gap-3",children:[1,2,3,4].map(O=>r.jsx(Ke,{className:"h-16 flex-1 rounded-lg"},O))}),r.jsx(Ke,{className:"h-48 w-full rounded-lg"})]})]}):p||a.length===0?null:r.jsxs("div",{className:"rounded-xl border border-border overflow-hidden font-mono text-[13px] text-foreground bg-card/50 dark:bg-zinc-900/60 backdrop-blur-sm",children:[r.jsxs("div",{className:"flex items-center justify-between px-4 py-2.5 border-b border-border bg-gradient-to-r from-emerald-500/5 via-transparent to-transparent dark:from-emerald-500/10",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(HA,{}),r.jsx("span",{className:"text-xs font-semibold tracking-tight text-foreground",children:"LIVE"}),r.jsx("span",{className:"text-[10px] text-muted-foreground",children:"Account Monitor"})]}),r.jsxs("div",{className:"flex items-center gap-4 text-[10px] text-muted-foreground",children:[r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx(qS,{className:"w-3 h-3 animate-pulse"}),r.jsxs("span",{children:["Updated ",y||"now"]})]}),r.jsx("span",{className:"text-muted-foreground/50",children:"|"}),r.jsx("span",{children:n("authMonitor.accountsCount",{count:a.length})}),r.jsxs("span",{className:"font-mono",children:[u.toLocaleString()," req"]})]})]}),r.jsxs("div",{className:"grid grid-cols-4 gap-3 p-4 border-b border-border bg-muted/20 dark:bg-zinc-900/30",children:[r.jsx(er,{icon:r.jsx(Ds,{className:"w-4 h-4"}),label:n("authMonitor.accounts"),value:a.length,color:"var(--accent)"}),r.jsx(er,{icon:r.jsx(Sr,{className:"w-4 h-4"}),label:n("authMonitor.success"),value:s.toLocaleString(),color:Ft.success}),r.jsx(er,{icon:r.jsx(Od,{className:"w-4 h-4"}),label:n("authMonitor.failed"),value:l.toLocaleString(),color:l>0?Ft.failed:void 0}),r.jsx(er,{icon:r.jsx(Ds,{className:"w-4 h-4"}),label:n("authMonitor.successRate"),value:`${h}%`,color:h===100?Ft.success:h>=95?Ft.degraded:Ft.failed})]}),r.jsx("div",{className:"relative overflow-hidden",children:B?r.jsx(_A,{providerData:B,onBack:()=>N(null),onPauseToggle:U,isPausingAccount:M.isPending||H.isPending}):r.jsxs("div",{className:"p-6",children:[r.jsx("div",{className:"text-[10px] text-muted-foreground uppercase tracking-widest mb-4",children:"Request Distribution by Provider"}),r.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-3 gap-4",children:f.map(O=>r.jsx(KA,{stats:O,isHovered:T===O.provider,privacyMode:C,onSelect:()=>N(O.provider),onMouseEnter:()=>E(O.provider),onMouseLeave:()=>E(null)},O.provider))})]})})]})}const Dr=S.createContext(null);Dr.displayName="PanelGroupContext";const rt={group:"data-panel-group",groupDirection:"data-panel-group-direction",groupId:"data-panel-group-id",panel:"data-panel",panelCollapsible:"data-panel-collapsible",panelId:"data-panel-id",panelSize:"data-panel-size",resizeHandle:"data-resize-handle",resizeHandleActive:"data-resize-handle-active",resizeHandleEnabled:"data-panel-resize-handle-enabled",resizeHandleId:"data-panel-resize-handle-id",resizeHandleState:"data-resize-handle-state"},tf=10,wi=S.useLayoutEffect,Qg=yS.useId,GA=typeof Qg=="function"?Qg:()=>null;let YA=0;function nf(n=null){const a=GA(),s=S.useRef(n||a||null);return s.current===null&&(s.current=""+YA++),n??s.current}function Ax({children:n,className:a="",collapsedSize:s,collapsible:l,defaultSize:u,forwardedRef:f,id:h,maxSize:m,minSize:p,onCollapse:y,onExpand:C,onResize:x,order:b,style:N,tagName:w="div",...T}){const E=S.useContext(Dr);if(E===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:M,expandPanel:H,getPanelSize:B,getPanelStyle:U,groupId:O,isPanelCollapsed:A,reevaluatePanelConstraints:_,registerPanel:W,resizePanel:F,unregisterPanel:Q}=E,ae=nf(h),te=S.useRef({callbacks:{onCollapse:y,onExpand:C,onResize:x},constraints:{collapsedSize:s,collapsible:l,defaultSize:u,maxSize:m,minSize:p},id:ae,idIsFromProps:h!==void 0,order:b});S.useRef({didLogMissingDefaultSizeWarning:!1}),wi(()=>{const{callbacks:de,constraints:Ce}=te.current,R={...Ce};te.current.id=ae,te.current.idIsFromProps=h!==void 0,te.current.order=b,de.onCollapse=y,de.onExpand=C,de.onResize=x,Ce.collapsedSize=s,Ce.collapsible=l,Ce.defaultSize=u,Ce.maxSize=m,Ce.minSize=p,(R.collapsedSize!==Ce.collapsedSize||R.collapsible!==Ce.collapsible||R.maxSize!==Ce.maxSize||R.minSize!==Ce.minSize)&&_(te.current,R)}),wi(()=>{const de=te.current;return W(de),()=>{Q(de)}},[b,ae,W,Q]),S.useImperativeHandle(f,()=>({collapse:()=>{M(te.current)},expand:de=>{H(te.current,de)},getId(){return ae},getSize(){return B(te.current)},isCollapsed(){return A(te.current)},isExpanded(){return!A(te.current)},resize:de=>{F(te.current,de)}}),[M,H,B,A,ae,F]);const ye=U(te.current,u);return S.createElement(w,{...T,children:n,className:a,id:ae,style:{...ye,...N},[rt.groupId]:O,[rt.panel]:"",[rt.panelCollapsible]:l||void 0,[rt.panelId]:ae,[rt.panelSize]:parseFloat(""+ye.flexGrow).toFixed(1)})}const Ps=S.forwardRef((n,a)=>S.createElement(Ax,{...n,forwardedRef:a}));Ax.displayName="Panel";Ps.displayName="forwardRef(Panel)";let Cd=null,sr=-1,Va=null;function VA(n,a,s){const l=(a&Dx)!==0,u=(a&Ex)!==0,f=(a&Ox)!==0,h=(a&Rx)!==0;if(a){if(l)return f?"se-resize":h?"ne-resize":"e-resize";if(u)return f?"sw-resize":h?"nw-resize":"w-resize";if(f)return"s-resize";if(h)return"n-resize"}switch(n){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function FA(){Va!==null&&(document.head.removeChild(Va),Cd=null,Va=null,sr=-1)}function nd(n,a,s){var l,u;const f=VA(n,a);if(Cd!==f){if(Cd=f,Va===null&&(Va=document.createElement("style"),document.head.appendChild(Va)),sr>=0){var h;(h=Va.sheet)===null||h===void 0||h.removeRule(sr)}sr=(l=(u=Va.sheet)===null||u===void 0?void 0:u.insertRule(`*{cursor: ${f} !important;}`))!==null&&l!==void 0?l:-1}}function kx(n){return n.type==="keydown"}function jx(n){return n.type.startsWith("pointer")}function Tx(n){return n.type.startsWith("mouse")}function Er(n){if(jx(n)){if(n.isPrimary)return{x:n.clientX,y:n.clientY}}else if(Tx(n))return{x:n.clientX,y:n.clientY};return{x:1/0,y:1/0}}function QA(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function $A(n,a,s){return n.x<a.x+a.width&&n.x+n.width>a.x&&n.y<a.y+a.height&&n.y+n.height>a.y}function WA(n,a){if(n===a)throw new Error("Cannot compare node with itself");const s={a:Xg(n),b:Xg(a)};let l;for(;s.a.at(-1)===s.b.at(-1);)n=s.a.pop(),a=s.b.pop(),l=n;Re(l,"Stacking order can only be calculated for elements with a common ancestor");const u={a:Wg($g(s.a)),b:Wg($g(s.b))};if(u.a===u.b){const f=l.childNodes,h={a:s.a.at(-1),b:s.b.at(-1)};let m=f.length;for(;m--;){const p=f[m];if(p===h.a)return 1;if(p===h.b)return-1}}return Math.sign(u.a-u.b)}const XA=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function ZA(n){var a;const s=getComputedStyle((a=Mx(n))!==null&&a!==void 0?a:n).display;return s==="flex"||s==="inline-flex"}function JA(n){const a=getComputedStyle(n);return!!(a.position==="fixed"||a.zIndex!=="auto"&&(a.position!=="static"||ZA(n))||+a.opacity<1||"transform"in a&&a.transform!=="none"||"webkitTransform"in a&&a.webkitTransform!=="none"||"mixBlendMode"in a&&a.mixBlendMode!=="normal"||"filter"in a&&a.filter!=="none"||"webkitFilter"in a&&a.webkitFilter!=="none"||"isolation"in a&&a.isolation==="isolate"||XA.test(a.willChange)||a.webkitOverflowScrolling==="touch")}function $g(n){let a=n.length;for(;a--;){const s=n[a];if(Re(s,"Missing node"),JA(s))return s}return null}function Wg(n){return n&&Number(getComputedStyle(n).zIndex)||0}function Xg(n){const a=[];for(;n;)a.push(n),n=Mx(n);return a}function Mx(n){const{parentNode:a}=n;return a&&a instanceof ShadowRoot?a.host:a}const Dx=1,Ex=2,Ox=4,Rx=8,ek=QA()==="coarse";let Mn=[],yo=!1,Fa=new Map,Or=new Map;const Ls=new Set;function tk(n,a,s,l,u){var f;const{ownerDocument:h}=a,m={direction:s,element:a,hitAreaMargins:l,setResizeHandlerState:u},p=(f=Fa.get(h))!==null&&f!==void 0?f:0;return Fa.set(h,p+1),Ls.add(m),fr(),function(){var C;Or.delete(n),Ls.delete(m);const x=(C=Fa.get(h))!==null&&C!==void 0?C:1;if(Fa.set(h,x-1),fr(),x===1&&Fa.delete(h),Mn.includes(m)){const b=Mn.indexOf(m);b>=0&&Mn.splice(b,1),Rr(),u("up",!0,null)}}}function nk(n){const{target:a}=n,{x:s,y:l}=Er(n);yo=!0,af({target:a,x:s,y:l}),fr(),Mn.length>0&&(hr("down",n),Rr(),n.preventDefault(),Px(a)||n.stopImmediatePropagation())}function ad(n){const{x:a,y:s}=Er(n);if(yo&&n.type!=="pointerleave"&&n.buttons===0&&(yo=!1,hr("up",n)),!yo){const{target:l}=n;af({target:l,x:a,y:s})}hr("move",n),Rr(),Mn.length>0&&n.preventDefault()}function id(n){const{target:a}=n,{x:s,y:l}=Er(n);Or.clear(),yo=!1,Mn.length>0&&(n.preventDefault(),Px(a)||n.stopImmediatePropagation()),hr("up",n),af({target:a,x:s,y:l}),Rr(),fr()}function Px(n){let a=n;for(;a;){if(a.hasAttribute(rt.resizeHandle))return!0;a=a.parentElement}return!1}function af({target:n,x:a,y:s}){Mn.splice(0);let l=null;(n instanceof HTMLElement||n instanceof SVGElement)&&(l=n),Ls.forEach(u=>{const{element:f,hitAreaMargins:h}=u,m=f.getBoundingClientRect(),{bottom:p,left:y,right:C,top:x}=m,b=ek?h.coarse:h.fine;if(a>=y-b&&a<=C+b&&s>=x-b&&s<=p+b){if(l!==null&&document.contains(l)&&f!==l&&!f.contains(l)&&!l.contains(f)&&WA(l,f)>0){let w=l,T=!1;for(;w&&!w.contains(f);){if($A(w.getBoundingClientRect(),m)){T=!0;break}w=w.parentElement}if(T)return}Mn.push(u)}})}function od(n,a){Or.set(n,a)}function Rr(){let n=!1,a=!1;Mn.forEach(l=>{const{direction:u}=l;u==="horizontal"?n=!0:a=!0});let s=0;Or.forEach(l=>{s|=l}),n&&a?nd("intersection",s):n?nd("horizontal",s):a?nd("vertical",s):FA()}let sd;function fr(){var n;(n=sd)===null||n===void 0||n.abort(),sd=new AbortController;const a={capture:!0,signal:sd.signal};Ls.size&&(yo?(Mn.length>0&&Fa.forEach((s,l)=>{const{body:u}=l;s>0&&(u.addEventListener("contextmenu",id,a),u.addEventListener("pointerleave",ad,a),u.addEventListener("pointermove",ad,a))}),Fa.forEach((s,l)=>{const{body:u}=l;u.addEventListener("pointerup",id,a),u.addEventListener("pointercancel",id,a)})):Fa.forEach((s,l)=>{const{body:u}=l;s>0&&(u.addEventListener("pointerdown",nk,a),u.addEventListener("pointermove",ad,a))}))}function hr(n,a){Ls.forEach(s=>{const{setResizeHandlerState:l}=s,u=Mn.includes(s);l(n,u,a)})}function ak(){const[n,a]=S.useState(0);return S.useCallback(()=>a(s=>s+1),[])}function Re(n,a){if(!n)throw console.error(a),Error(a)}function ki(n,a,s=tf){return n.toFixed(s)===a.toFixed(s)?0:n>a?1:-1}function pa(n,a,s=tf){return ki(n,a,s)===0}function rn(n,a,s){return ki(n,a,s)===0}function ik(n,a,s){if(n.length!==a.length)return!1;for(let l=0;l<n.length;l++){const u=n[l],f=a[l];if(!rn(u,f,s))return!1}return!0}function go({panelConstraints:n,panelIndex:a,size:s}){const l=n[a];Re(l!=null,`Panel constraints not found for index ${a}`);let{collapsedSize:u=0,collapsible:f,maxSize:h=100,minSize:m=0}=l;if(ki(s,m)<0)if(f){const p=(u+m)/2;ki(s,p)<0?s=u:s=m}else s=m;return s=Math.min(h,s),s=parseFloat(s.toFixed(tf)),s}function Ns({delta:n,initialLayout:a,panelConstraints:s,pivotIndices:l,prevLayout:u,trigger:f}){if(rn(n,0))return a;const h=[...a],[m,p]=l;Re(m!=null,"Invalid first pivot index"),Re(p!=null,"Invalid second pivot index");let y=0;if(f==="keyboard"){{const x=n<0?p:m,b=s[x];Re(b,`Panel constraints not found for index ${x}`);const{collapsedSize:N=0,collapsible:w,minSize:T=0}=b;if(w){const E=a[x];if(Re(E!=null,`Previous layout not found for panel index ${x}`),rn(E,N)){const M=T-E;ki(M,Math.abs(n))>0&&(n=n<0?0-M:M)}}}{const x=n<0?m:p,b=s[x];Re(b,`No panel constraints found for index ${x}`);const{collapsedSize:N=0,collapsible:w,minSize:T=0}=b;if(w){const E=a[x];if(Re(E!=null,`Previous layout not found for panel index ${x}`),rn(E,T)){const M=E-N;ki(M,Math.abs(n))>0&&(n=n<0?0-M:M)}}}}{const x=n<0?1:-1;let b=n<0?p:m,N=0;for(;;){const T=a[b];Re(T!=null,`Previous layout not found for panel index ${b}`);const M=go({panelConstraints:s,panelIndex:b,size:100})-T;if(N+=M,b+=x,b<0||b>=s.length)break}const w=Math.min(Math.abs(n),Math.abs(N));n=n<0?0-w:w}{let b=n<0?m:p;for(;b>=0&&b<s.length;){const N=Math.abs(n)-Math.abs(y),w=a[b];Re(w!=null,`Previous layout not found for panel index ${b}`);const T=w-N,E=go({panelConstraints:s,panelIndex:b,size:T});if(!rn(w,E)&&(y+=w-E,h[b]=E,y.toFixed(3).localeCompare(Math.abs(n).toFixed(3),void 0,{numeric:!0})>=0))break;n<0?b--:b++}}if(ik(u,h))return u;{const x=n<0?p:m,b=a[x];Re(b!=null,`Previous layout not found for panel index ${x}`);const N=b+y,w=go({panelConstraints:s,panelIndex:x,size:N});if(h[x]=w,!rn(w,N)){let T=N-w,M=n<0?p:m;for(;M>=0&&M<s.length;){const H=h[M];Re(H!=null,`Previous layout not found for panel index ${M}`);const B=H+T,U=go({panelConstraints:s,panelIndex:M,size:B});if(rn(H,U)||(T-=U-H,h[M]=U),rn(T,0))break;n>0?M--:M++}}}const C=h.reduce((x,b)=>b+x,0);return rn(C,100)?h:u}function ok({layout:n,panelsArray:a,pivotIndices:s}){let l=0,u=100,f=0,h=0;const m=s[0];Re(m!=null,"No pivot index found"),a.forEach((x,b)=>{const{constraints:N}=x,{maxSize:w=100,minSize:T=0}=N;b===m?(l=T,u=w):(f+=T,h+=w)});const p=Math.min(u,100-f),y=Math.max(l,100-h),C=n[m];return{valueMax:p,valueMin:y,valueNow:C}}function _s(n,a=document){return Array.from(a.querySelectorAll(`[${rt.resizeHandleId}][data-panel-group-id="${n}"]`))}function Lx(n,a,s=document){const u=_s(n,s).findIndex(f=>f.getAttribute(rt.resizeHandleId)===a);return u??null}function _x(n,a,s){const l=Lx(n,a,s);return l!=null?[l,l+1]:[-1,-1]}function sk(n){return n instanceof HTMLElement?!0:typeof n=="object"&&n!==null&&"tagName"in n&&"getAttribute"in n}function zx(n,a=document){if(sk(a)&&a.dataset.panelGroupId==n)return a;const s=a.querySelector(`[data-panel-group][data-panel-group-id="${n}"]`);return s||null}function Pr(n,a=document){const s=a.querySelector(`[${rt.resizeHandleId}="${n}"]`);return s||null}function lk(n,a,s,l=document){var u,f,h,m;const p=Pr(a,l),y=_s(n,l),C=p?y.indexOf(p):-1,x=(u=(f=s[C])===null||f===void 0?void 0:f.id)!==null&&u!==void 0?u:null,b=(h=(m=s[C+1])===null||m===void 0?void 0:m.id)!==null&&h!==void 0?h:null;return[x,b]}function rk({committedValuesRef:n,eagerValuesRef:a,groupId:s,layout:l,panelDataArray:u,panelGroupElement:f,setLayout:h}){S.useRef({didWarnAboutMissingResizeHandle:!1}),wi(()=>{if(!f)return;const m=_s(s,f);for(let p=0;p<u.length-1;p++){const{valueMax:y,valueMin:C,valueNow:x}=ok({layout:l,panelsArray:u,pivotIndices:[p,p+1]}),b=m[p];if(b!=null){const N=u[p];Re(N,`No panel data found for index "${p}"`),b.setAttribute("aria-controls",N.id),b.setAttribute("aria-valuemax",""+Math.round(y)),b.setAttribute("aria-valuemin",""+Math.round(C)),b.setAttribute("aria-valuenow",x!=null?""+Math.round(x):"")}}return()=>{m.forEach((p,y)=>{p.removeAttribute("aria-controls"),p.removeAttribute("aria-valuemax"),p.removeAttribute("aria-valuemin"),p.removeAttribute("aria-valuenow")})}},[s,l,u,f]),S.useEffect(()=>{if(!f)return;const m=a.current;Re(m,"Eager values not found");const{panelDataArray:p}=m,y=zx(s,f);Re(y!=null,`No group found for id "${s}"`);const C=_s(s,f);Re(C,`No resize handles found for group id "${s}"`);const x=C.map(b=>{const N=b.getAttribute(rt.resizeHandleId);Re(N,"Resize handle element has no handle id attribute");const[w,T]=lk(s,N,p,f);if(w==null||T==null)return()=>{};const E=M=>{if(!M.defaultPrevented)switch(M.key){case"Enter":{M.preventDefault();const H=p.findIndex(B=>B.id===w);if(H>=0){const B=p[H];Re(B,`No panel data found for index ${H}`);const U=l[H],{collapsedSize:O=0,collapsible:A,minSize:_=0}=B.constraints;if(U!=null&&A){const W=Ns({delta:rn(U,O)?_-O:O-U,initialLayout:l,panelConstraints:p.map(F=>F.constraints),pivotIndices:_x(s,N,f),prevLayout:l,trigger:"keyboard"});l!==W&&h(W)}}break}}};return b.addEventListener("keydown",E),()=>{b.removeEventListener("keydown",E)}});return()=>{x.forEach(b=>b())}},[f,n,a,s,l,u,h])}function Zg(n,a){if(n.length!==a.length)return!1;for(let s=0;s<n.length;s++)if(n[s]!==a[s])return!1;return!0}function Ux(n,a){const s=n==="horizontal",{x:l,y:u}=Er(a);return s?l:u}function ck(n,a,s,l,u){const f=s==="horizontal",h=Pr(a,u);Re(h,`No resize handle element found for id "${a}"`);const m=h.getAttribute(rt.groupId);Re(m,"Resize handle element has no group id attribute");let{initialCursorPosition:p}=l;const y=Ux(s,n),C=zx(m,u);Re(C,`No group element found for id "${m}"`);const x=C.getBoundingClientRect(),b=f?x.width:x.height;return(y-p)/b*100}function uk(n,a,s,l,u,f){if(kx(n)){const h=s==="horizontal";let m=0;n.shiftKey?m=100:u!=null?m=u:m=10;let p=0;switch(n.key){case"ArrowDown":p=h?0:m;break;case"ArrowLeft":p=h?-m:0;break;case"ArrowRight":p=h?m:0;break;case"ArrowUp":p=h?0:-m;break;case"End":p=100;break;case"Home":p=-100;break}return p}else return l==null?0:ck(n,a,s,l,f)}function dk({panelDataArray:n}){const a=Array(n.length),s=n.map(f=>f.constraints);let l=0,u=100;for(let f=0;f<n.length;f++){const h=s[f];Re(h,`Panel constraints not found for index ${f}`);const{defaultSize:m}=h;m!=null&&(l++,a[f]=m,u-=m)}for(let f=0;f<n.length;f++){const h=s[f];Re(h,`Panel constraints not found for index ${f}`);const{defaultSize:m}=h;if(m!=null)continue;const p=n.length-l,y=u/p;l++,a[f]=y,u-=y}return a}function mo(n,a,s){a.forEach((l,u)=>{const f=n[u];Re(f,`Panel data not found for index ${u}`);const{callbacks:h,constraints:m,id:p}=f,{collapsedSize:y=0,collapsible:C}=m,x=s[p];if(x==null||l!==x){s[p]=l;const{onCollapse:b,onExpand:N,onResize:w}=h;w&&w(l,x),C&&(b||N)&&(N&&(x==null||pa(x,y))&&!pa(l,y)&&N(),b&&(x==null||!pa(x,y))&&pa(l,y)&&b())}})}function tr(n,a){if(n.length!==a.length)return!1;for(let s=0;s<n.length;s++)if(n[s]!=a[s])return!1;return!0}function fk({defaultSize:n,dragState:a,layout:s,panelData:l,panelIndex:u,precision:f=3}){const h=s[u];let m;return h==null?m=n!=null?n.toFixed(f):"1":l.length===1?m="1":m=h.toFixed(f),{flexBasis:0,flexGrow:m,flexShrink:1,overflow:"hidden",pointerEvents:a!==null?"none":void 0}}function hk(n,a=10){let s=null;return(...u)=>{s!==null&&clearTimeout(s),s=setTimeout(()=>{n(...u)},a)}}function Jg(n){try{if(typeof localStorage<"u")n.getItem=a=>localStorage.getItem(a),n.setItem=(a,s)=>{localStorage.setItem(a,s)};else throw new Error("localStorage not supported in this environment")}catch(a){console.error(a),n.getItem=()=>null,n.setItem=()=>{}}}function Ix(n){return`react-resizable-panels:${n}`}function Hx(n){return n.map(a=>{const{constraints:s,id:l,idIsFromProps:u,order:f}=a;return u?l:f?`${f}:${JSON.stringify(s)}`:JSON.stringify(s)}).sort((a,s)=>a.localeCompare(s)).join(",")}function Bx(n,a){try{const s=Ix(n),l=a.getItem(s);if(l){const u=JSON.parse(l);if(typeof u=="object"&&u!=null)return u}}catch{}return null}function mk(n,a,s){var l,u;const f=(l=Bx(n,s))!==null&&l!==void 0?l:{},h=Hx(a);return(u=f[h])!==null&&u!==void 0?u:null}function pk(n,a,s,l,u){var f;const h=Ix(n),m=Hx(a),p=(f=Bx(n,u))!==null&&f!==void 0?f:{};p[m]={expandToSizes:Object.fromEntries(s.entries()),layout:l};try{u.setItem(h,JSON.stringify(p))}catch(y){console.error(y)}}function ey({layout:n,panelConstraints:a}){const s=[...n],l=s.reduce((f,h)=>f+h,0);if(s.length!==a.length)throw Error(`Invalid ${a.length} panel layout: ${s.map(f=>`${f}%`).join(", ")}`);if(!rn(l,100)&&s.length>0)for(let f=0;f<a.length;f++){const h=s[f];Re(h!=null,`No layout data found for index ${f}`);const m=100/l*h;s[f]=m}let u=0;for(let f=0;f<a.length;f++){const h=s[f];Re(h!=null,`No layout data found for index ${f}`);const m=go({panelConstraints:a,panelIndex:f,size:h});h!=m&&(u+=h-m,s[f]=m)}if(!rn(u,0))for(let f=0;f<a.length;f++){const h=s[f];Re(h!=null,`No layout data found for index ${f}`);const m=h+u,p=go({panelConstraints:a,panelIndex:f,size:m});if(h!==p&&(u-=p-h,s[f]=p,rn(u,0)))break}return s}const gk=100,As={getItem:n=>(Jg(As),As.getItem(n)),setItem:(n,a)=>{Jg(As),As.setItem(n,a)}},ty={};function Kx({autoSaveId:n=null,children:a,className:s="",direction:l,forwardedRef:u,id:f=null,onLayout:h=null,keyboardResizeBy:m=null,storage:p=As,style:y,tagName:C="div",...x}){const b=nf(f),N=S.useRef(null),[w,T]=S.useState(null),[E,M]=S.useState([]),H=ak(),B=S.useRef({}),U=S.useRef(new Map),O=S.useRef(0),A=S.useRef({autoSaveId:n,direction:l,dragState:w,id:b,keyboardResizeBy:m,onLayout:h,storage:p}),_=S.useRef({layout:E,panelDataArray:[],panelDataArrayChanged:!1});S.useRef({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),S.useImperativeHandle(u,()=>({getId:()=>A.current.id,getLayout:()=>{const{layout:V}=_.current;return V},setLayout:V=>{const{onLayout:J}=A.current,{layout:le,panelDataArray:ne}=_.current,oe=ey({layout:V,panelConstraints:ne.map(xe=>xe.constraints)});Zg(le,oe)||(M(oe),_.current.layout=oe,J&&J(oe),mo(ne,oe,B.current))}}),[]),wi(()=>{A.current.autoSaveId=n,A.current.direction=l,A.current.dragState=w,A.current.id=b,A.current.onLayout=h,A.current.storage=p}),rk({committedValuesRef:A,eagerValuesRef:_,groupId:b,layout:E,panelDataArray:_.current.panelDataArray,setLayout:M,panelGroupElement:N.current}),S.useEffect(()=>{const{panelDataArray:V}=_.current;if(n){if(E.length===0||E.length!==V.length)return;let J=ty[n];J==null&&(J=hk(pk,gk),ty[n]=J);const le=[...V],ne=new Map(U.current);J(n,le,ne,E,p)}},[n,E,p]),S.useEffect(()=>{});const W=S.useCallback(V=>{const{onLayout:J}=A.current,{layout:le,panelDataArray:ne}=_.current;if(V.constraints.collapsible){const oe=ne.map(St=>St.constraints),{collapsedSize:xe=0,panelSize:Pe,pivotIndices:qe}=bi(ne,V,le);if(Re(Pe!=null,`Panel size not found for panel "${V.id}"`),!pa(Pe,xe)){U.current.set(V.id,Pe);const Ct=po(ne,V)===ne.length-1?Pe-xe:xe-Pe,Ye=Ns({delta:Ct,initialLayout:le,panelConstraints:oe,pivotIndices:qe,prevLayout:le,trigger:"imperative-api"});tr(le,Ye)||(M(Ye),_.current.layout=Ye,J&&J(Ye),mo(ne,Ye,B.current))}}},[]),F=S.useCallback((V,J)=>{const{onLayout:le}=A.current,{layout:ne,panelDataArray:oe}=_.current;if(V.constraints.collapsible){const xe=oe.map(nt=>nt.constraints),{collapsedSize:Pe=0,panelSize:qe=0,minSize:St=0,pivotIndices:Ct}=bi(oe,V,ne),Ye=J??St;if(pa(qe,Pe)){const nt=U.current.get(V.id),Ut=nt!=null&&nt>=Ye?nt:Ye,Gn=po(oe,V)===oe.length-1?qe-Ut:Ut-qe,je=Ns({delta:Gn,initialLayout:ne,panelConstraints:xe,pivotIndices:Ct,prevLayout:ne,trigger:"imperative-api"});tr(ne,je)||(M(je),_.current.layout=je,le&&le(je),mo(oe,je,B.current))}}},[]),Q=S.useCallback(V=>{const{layout:J,panelDataArray:le}=_.current,{panelSize:ne}=bi(le,V,J);return Re(ne!=null,`Panel size not found for panel "${V.id}"`),ne},[]),ae=S.useCallback((V,J)=>{const{panelDataArray:le}=_.current,ne=po(le,V);return fk({defaultSize:J,dragState:w,layout:E,panelData:le,panelIndex:ne})},[w,E]),te=S.useCallback(V=>{const{layout:J,panelDataArray:le}=_.current,{collapsedSize:ne=0,collapsible:oe,panelSize:xe}=bi(le,V,J);return Re(xe!=null,`Panel size not found for panel "${V.id}"`),oe===!0&&pa(xe,ne)},[]),ye=S.useCallback(V=>{const{layout:J,panelDataArray:le}=_.current,{collapsedSize:ne=0,collapsible:oe,panelSize:xe}=bi(le,V,J);return Re(xe!=null,`Panel size not found for panel "${V.id}"`),!oe||ki(xe,ne)>0},[]),de=S.useCallback(V=>{const{panelDataArray:J}=_.current;J.push(V),J.sort((le,ne)=>{const oe=le.order,xe=ne.order;return oe==null&&xe==null?0:oe==null?-1:xe==null?1:oe-xe}),_.current.panelDataArrayChanged=!0,H()},[H]);wi(()=>{if(_.current.panelDataArrayChanged){_.current.panelDataArrayChanged=!1;const{autoSaveId:V,onLayout:J,storage:le}=A.current,{layout:ne,panelDataArray:oe}=_.current;let xe=null;if(V){const qe=mk(V,oe,le);qe&&(U.current=new Map(Object.entries(qe.expandToSizes)),xe=qe.layout)}xe==null&&(xe=dk({panelDataArray:oe}));const Pe=ey({layout:xe,panelConstraints:oe.map(qe=>qe.constraints)});Zg(ne,Pe)||(M(Pe),_.current.layout=Pe,J&&J(Pe),mo(oe,Pe,B.current))}}),wi(()=>{const V=_.current;return()=>{V.layout=[]}},[]);const Ce=S.useCallback(V=>{let J=!1;const le=N.current;return le&&window.getComputedStyle(le,null).getPropertyValue("direction")==="rtl"&&(J=!0),function(oe){oe.preventDefault();const xe=N.current;if(!xe)return()=>null;const{direction:Pe,dragState:qe,id:St,keyboardResizeBy:Ct,onLayout:Ye}=A.current,{layout:nt,panelDataArray:Ut}=_.current,{initialLayout:Qt}=qe??{},Gn=_x(St,V,xe);let je=uk(oe,V,Pe,qe,Ct,xe);const $t=Pe==="horizontal";$t&&J&&(je=-je);const En=Ut.map(Yn=>Yn.constraints),Wt=Ns({delta:je,initialLayout:Qt??nt,panelConstraints:En,pivotIndices:Gn,prevLayout:nt,trigger:kx(oe)?"keyboard":"mouse-or-touch"}),Sa=!tr(nt,Wt);(jx(oe)||Tx(oe))&&O.current!=je&&(O.current=je,!Sa&&je!==0?$t?od(V,je<0?Dx:Ex):od(V,je<0?Ox:Rx):od(V,0)),Sa&&(M(Wt),_.current.layout=Wt,Ye&&Ye(Wt),mo(Ut,Wt,B.current))}},[]),R=S.useCallback((V,J)=>{const{onLayout:le}=A.current,{layout:ne,panelDataArray:oe}=_.current,xe=oe.map(nt=>nt.constraints),{panelSize:Pe,pivotIndices:qe}=bi(oe,V,ne);Re(Pe!=null,`Panel size not found for panel "${V.id}"`);const Ct=po(oe,V)===oe.length-1?Pe-J:J-Pe,Ye=Ns({delta:Ct,initialLayout:ne,panelConstraints:xe,pivotIndices:qe,prevLayout:ne,trigger:"imperative-api"});tr(ne,Ye)||(M(Ye),_.current.layout=Ye,le&&le(Ye),mo(oe,Ye,B.current))},[]),$=S.useCallback((V,J)=>{const{layout:le,panelDataArray:ne}=_.current,{collapsedSize:oe=0,collapsible:xe}=J,{collapsedSize:Pe=0,collapsible:qe,maxSize:St=100,minSize:Ct=0}=V.constraints,{panelSize:Ye}=bi(ne,V,le);Ye!=null&&(xe&&qe&&pa(Ye,oe)?pa(oe,Pe)||R(V,Pe):Ye<Ct?R(V,Ct):Ye>St&&R(V,St))},[R]),ee=S.useCallback((V,J)=>{const{direction:le}=A.current,{layout:ne}=_.current;if(!N.current)return;const oe=Pr(V,N.current);Re(oe,`Drag handle element not found for id "${V}"`);const xe=Ux(le,J);T({dragHandleId:V,dragHandleRect:oe.getBoundingClientRect(),initialCursorPosition:xe,initialLayout:ne})},[]),X=S.useCallback(()=>{T(null)},[]),se=S.useCallback(V=>{const{panelDataArray:J}=_.current,le=po(J,V);le>=0&&(J.splice(le,1),delete B.current[V.id],_.current.panelDataArrayChanged=!0,H())},[H]),fe=S.useMemo(()=>({collapsePanel:W,direction:l,dragState:w,expandPanel:F,getPanelSize:Q,getPanelStyle:ae,groupId:b,isPanelCollapsed:te,isPanelExpanded:ye,reevaluatePanelConstraints:$,registerPanel:de,registerResizeHandle:Ce,resizePanel:R,startDragging:ee,stopDragging:X,unregisterPanel:se,panelGroupElement:N.current}),[W,w,l,F,Q,ae,b,te,ye,$,de,Ce,R,ee,X,se]),Ne={display:"flex",flexDirection:l==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return S.createElement(Dr.Provider,{value:fe},S.createElement(C,{...x,children:a,className:s,id:f,ref:N,style:{...Ne,...y},[rt.group]:"",[rt.groupDirection]:l,[rt.groupId]:b}))}const of=S.forwardRef((n,a)=>S.createElement(Kx,{...n,forwardedRef:a}));Kx.displayName="PanelGroup";of.displayName="forwardRef(PanelGroup)";function po(n,a){return n.findIndex(s=>s===a||s.id===a.id)}function bi(n,a,s){const l=po(n,a),f=l===n.length-1?[l-1,l]:[l,l+1],h=s[l];return{...a.constraints,panelSize:h,pivotIndices:f}}function yk({disabled:n,handleId:a,resizeHandler:s,panelGroupElement:l}){S.useEffect(()=>{if(n||s==null||l==null)return;const u=Pr(a,l);if(u==null)return;const f=h=>{if(!h.defaultPrevented)switch(h.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{h.preventDefault(),s(h);break}case"F6":{h.preventDefault();const m=u.getAttribute(rt.groupId);Re(m,`No group element found for id "${m}"`);const p=_s(m,l),y=Lx(m,a,l);Re(y!==null,`No resize element found for id "${a}"`);const C=h.shiftKey?y>0?y-1:p.length-1:y+1<p.length?y+1:0;p[C].focus();break}}};return u.addEventListener("keydown",f),()=>{u.removeEventListener("keydown",f)}},[l,n,a,s])}function sf({children:n=null,className:a="",disabled:s=!1,hitAreaMargins:l,id:u,onBlur:f,onClick:h,onDragging:m,onFocus:p,onPointerDown:y,onPointerUp:C,style:x={},tabIndex:b=0,tagName:N="div",...w}){var T,E;const M=S.useRef(null),H=S.useRef({onClick:h,onDragging:m,onPointerDown:y,onPointerUp:C});S.useEffect(()=>{H.current.onClick=h,H.current.onDragging=m,H.current.onPointerDown=y,H.current.onPointerUp=C});const B=S.useContext(Dr);if(B===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:U,groupId:O,registerResizeHandle:A,startDragging:_,stopDragging:W,panelGroupElement:F}=B,Q=nf(u),[ae,te]=S.useState("inactive"),[ye,de]=S.useState(!1),[Ce,R]=S.useState(null),$=S.useRef({state:ae});wi(()=>{$.current.state=ae}),S.useEffect(()=>{if(s)R(null);else{const fe=A(Q);R(()=>fe)}},[s,Q,A]);const ee=(T=l?.coarse)!==null&&T!==void 0?T:15,X=(E=l?.fine)!==null&&E!==void 0?E:5;S.useEffect(()=>{if(s||Ce==null)return;const fe=M.current;Re(fe,"Element ref not attached");let Ne=!1;return tk(Q,fe,U,{coarse:ee,fine:X},(J,le,ne)=>{if(!le){te("inactive");return}switch(J){case"down":{te("drag"),Ne=!1,Re(ne,'Expected event to be defined for "down" action'),_(Q,ne);const{onDragging:oe,onPointerDown:xe}=H.current;oe?.(!0),xe?.();break}case"move":{const{state:oe}=$.current;Ne=!0,oe!=="drag"&&te("hover"),Re(ne,'Expected event to be defined for "move" action'),Ce(ne);break}case"up":{te("hover"),W();const{onClick:oe,onDragging:xe,onPointerUp:Pe}=H.current;xe?.(!1),Pe?.(),Ne||oe?.();break}}})},[ee,U,s,X,A,Q,Ce,_,W]),yk({disabled:s,handleId:Q,resizeHandler:Ce,panelGroupElement:F});const se={touchAction:"none",userSelect:"none"};return S.createElement(N,{...w,children:n,className:a,id:u,onBlur:()=>{de(!1),f?.()},onFocus:()=>{de(!0),p?.()},ref:M,role:"separator",style:{...se,...x},tabIndex:b,[rt.groupDirection]:U,[rt.groupId]:O,[rt.resizeHandle]:"",[rt.resizeHandleActive]:ae==="drag"?"pointer":ye?"keyboard":void 0,[rt.resizeHandleEnabled]:!s,[rt.resizeHandleId]:Q,[rt.resizeHandleState]:ae})}sf.displayName="PanelResizeHandle";const So=S.forwardRef(({className:n,children:a,...s},l)=>r.jsxs(Iy,{ref:l,className:K("relative overflow-hidden",n),...s,children:[r.jsx(sS,{className:"h-full w-full rounded-[inherit]",children:a}),r.jsx(qx,{}),r.jsx(lS,{})]}));So.displayName=Iy.displayName;const qx=S.forwardRef(({className:n,orientation:a="vertical",...s},l)=>r.jsx(Hy,{ref:l,orientation:a,className:K("flex touch-none select-none transition-colors",a==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",a==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",n),...s,children:r.jsx(rS,{className:"relative flex-1 rounded-full bg-border"})}));qx.displayName=Hy.displayName;function xk(n){const a={provider:"unknown",endpoint:"unknown",timestamp:new Date,raw:n},s=n.match(/error-api-provider-([^-]+)-/);s&&(a.provider=s[1]);const l=n.match(/error-api-provider-[^-]+-(.+?)-\d{4}-\d{2}-\d{2}T/);l&&(a.endpoint=l[1].replace(/-/g,"/"));const u=n.match(/(\d{4}-\d{2}-\d{2}T\d{6})/);if(u){const f=u[1],h=`${f.slice(0,10)}T${f.slice(11,13)}:${f.slice(13,15)}:${f.slice(15,17)}`;a.timestamp=new Date(h)}return a}function vk(n){const a={version:"",url:"",method:"",timestamp:"",statusCode:0,statusText:"",requestHeaders:{},requestBody:"",responseHeaders:{},responseBody:"",provider:"",endpoint:"",isClientError:!1,isServerError:!1,errorType:"unknown",model:null,quotaResetDelay:null,quotaResetTimestamp:null},s=n.split(/^===\s*(.+?)\s*===$/m);let l="";for(let u=0;u<s.length;u++){const f=s[u].trim();if(f==="REQUEST INFO"){l="request_info";continue}else if(f==="HEADERS"){l="headers";continue}else if(f==="REQUEST BODY"){l="request_body";continue}else if(f==="API RESPONSE"){l="";continue}else if(f==="RESPONSE"){l="response";continue}switch(l){case"request_info":bk(f,a);break;case"headers":a.requestHeaders=Sk(f);break;case"request_body":a.requestBody=f;break;case"response":Ck(f,a);break}}return wk(a),a}function bk(n,a){const s=n.split(`
11
- `);for(const l of s){const[u,...f]=l.split(":"),h=f.join(":").trim();switch(u?.trim()?.toLowerCase()){case"version":a.version=h;break;case"url":a.url=h;break;case"method":a.method=h;break;case"timestamp":a.timestamp=h;break}}}function Sk(n){const a={},s=n.split(`
12
- `);for(const l of s){const u=l.indexOf(":");if(u>0){const f=l.slice(0,u).trim(),h=l.slice(u+1).trim();f&&(a[f]=h)}}return a}function Ck(n,a){const s=n.split(`
13
- `);let l=!1;const u=[];for(const f of s){if(f.startsWith("Status:")){const m=f.replace("Status:","").trim().split(/\s+/);a.statusCode=parseInt(m[0],10)||0,a.statusText=m.slice(1).join(" ")||kk(a.statusCode);continue}if(f.trim()===""&&!l){l=!0;continue}if(l)u.push(f);else{const h=f.indexOf(":");if(h>0){const m=f.slice(0,h).trim(),p=f.slice(h+1).trim();m&&(a.responseHeaders[m]=p)}}}a.responseBody=u.join(`
14
- `).trim()}function wk(n){const a=n.url.match(/\/api\/provider\/([^/]+)/);a&&(n.provider=a[1]);const s=n.url.match(/\/api\/provider\/[^/]+\/(.+?)(?:\?|$)/);s&&(n.endpoint=s[1]),n.isClientError=n.statusCode>=400&&n.statusCode<500,n.isServerError=n.statusCode>=500,n.statusCode===429?n.errorType="rate_limit":n.statusCode===401||n.statusCode===403?n.errorType="auth":n.statusCode===404?n.errorType="not_found":n.statusCode>=500?n.errorType="server":(n.statusCode===408||n.statusCode===504)&&(n.errorType="timeout"),Nk(n),n.statusCode===429&&Ak(n)}function Nk(n){if(n.requestBody)try{const a=JSON.parse(n.requestBody);typeof a.model=="string"&&(n.model=a.model)}catch{}}function Ak(n){if(n.responseBody)try{const a=JSON.parse(n.responseBody),s=wd(a);s!==null&&(n.quotaResetDelay=s);const l=Nd(a);l&&(n.quotaResetTimestamp=l)}catch{}}function wd(n){if(typeof n!="object"||n===null)return null;const a=n;if("quotaResetDelay"in a){const s=a.quotaResetDelay;if(typeof s=="number")return s;if(typeof s=="string"){const l=s.match(/^(\d+)s?$/);if(l)return parseInt(l[1],10)}}if("error"in a&&typeof a.error=="object"){const s=wd(a.error);if(s!==null)return s}if("details"in a&&Array.isArray(a.details))for(const s of a.details){const l=wd(s);if(l!==null)return l}return null}function Nd(n){if(typeof n!="object"||n===null)return null;const a=n;for(const s of["quotaResetTimeStamp","quotaResetTimestamp","resetTime","reset_time"])if(s in a&&typeof a[s]=="string")return a[s];if("error"in a&&typeof a.error=="object"){const s=Nd(a.error);if(s)return s}if("details"in a&&Array.isArray(a.details))for(const s of a.details){const l=Nd(s);if(l)return l}return null}function kk(n){return{400:"Bad Request",401:"Unauthorized",403:"Forbidden",404:"Not Found",408:"Request Timeout",429:"Too Many Requests",500:"Internal Server Error",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout"}[n]||""}function jk(n,a){const s=Ld(),l=s==="zh-CN",u=s==="vi",f=Date.now(),h=n*1e3,m=f-h,p=Math.floor(m/1e3),y=Math.floor(p/60),C=Math.floor(y/60),x=Math.floor(C/24);return p<60?l?"刚刚":u?"vừa xong":"just now":y<60?l?`${y} 分钟前`:u?`${y} phút trước`:`${y}m ago`:C<24?l?`${C} 小时前`:u?`${C} giờ trước`:`${C}h ago`:x<7?l?`${x} 天前`:u?`${x} ngày trước`:`${x}d ago`:new Date(h).toLocaleDateString(s,{month:"short",day:"numeric"})}function Tk(n){return n>=500?"text-red-500":n===429?"text-orange-500":n>=400?"text-yellow-500":"text-gray-500"}function Mk(n,a){const s=Ld();return s==="zh-CN"?{rate_limit:"限流",auth:"认证错误",not_found:"未找到",server:"服务错误",timeout:"超时",unknown:"错误"}[n]||"错误":s==="vi"?{rate_limit:"Quá giới hạn",auth:"Lỗi xác thực",not_found:"Không tìm thấy",server:"Lỗi máy chủ",timeout:"Hết thời gian chờ",unknown:"Lỗi"}[n]||"Lỗi":{rate_limit:"Rate Limited",auth:"Auth Error",not_found:"Not Found",server:"Server Error",timeout:"Timeout",unknown:"Error"}[n]||"Error"}function Dk(n){if(n===null||n<=0)return null;if(n<60)return`${n}s`;if(n<3600)return`${Math.floor(n/60)}m`;const a=Math.floor(n/3600),s=Math.floor(n%3600/60);return s>0?`${a}h ${s}m`:`${a}h`}function Ek(n,a){if(!n)return null;const s=Ld(),l=s==="zh-CN",u=s==="vi";try{const f=new Date(n),h=new Date,m=f.getTime()-h.getTime();if(m<=0)return l?"现在":u?"bây giờ":"now";const p=Math.floor(m/1e3);if(p<60)return l?`${p}秒`:u?`${p} giây`:`${p}s`;if(p<3600){const x=Math.floor(p/60);return l?`${x}分钟`:u?`${x} phút`:`${x}m`}const y=Math.floor(p/3600),C=Math.floor(p%3600/60);return l?C>0?`${y}小时 ${C}分钟`:`${y}小时`:u?C>0?`${y} giờ ${C} phút`:`${y} giờ`:C>0?`${y}h ${C}m`:`${y}h`}catch{return null}}function Ok(n){return n?n===429?"bg-amber-100 text-amber-700 dark:bg-amber-900/30 dark:text-amber-400":n>=500?"bg-red-100 text-red-700 dark:bg-red-900/30 dark:text-red-400":n>=400?"bg-orange-100 text-orange-700 dark:bg-orange-900/30 dark:text-orange-400":"bg-gray-100 text-gray-600":"bg-gray-100 text-gray-600"}function Rk(n){return n||""}function Pk({name:n,size:a,modified:s,isSelected:l,onClick:u,statusCode:f,model:h}){const m=S.useMemo(()=>xk(n),[n]),p=S.useMemo(()=>Rk(h),[h]);return r.jsxs("button",{onClick:u,className:K("w-full px-2.5 py-2 flex items-center gap-2 text-left transition-colors","hover:bg-muted/40 border-l-[3px]",l?"bg-muted/50 border-l-red-500":"border-l-transparent"),children:[r.jsx("span",{className:K("shrink-0 text-[10px] font-bold px-1.5 py-0.5 rounded min-w-[32px] text-center",Ok(f)),children:f||"???"}),r.jsx(ef,{provider:m.provider,size:18,withBackground:!0,className:"shrink-0"}),r.jsxs("div",{className:"flex-1 min-w-0 flex flex-col",children:[r.jsx("span",{className:"text-[11px] font-medium text-foreground truncate",children:m.endpoint||"unknown"}),p&&r.jsx("span",{className:"text-[10px] text-muted-foreground truncate",title:p,children:p}),r.jsxs("div",{className:"flex items-center gap-1 text-[9px] text-muted-foreground/60",children:[r.jsx(Os,{className:"w-2.5 h-2.5"}),r.jsx("span",{children:jk(s)})]})]})]})}function ny({value:n,className:a,variant:s="outline",size:l="icon",label:u="Copy to clipboard"}){const[f,h]=S.useState(!1),m=()=>{navigator.clipboard.writeText(n),h(!0),setTimeout(()=>h(!1),2e3)};return r.jsx(Ci,{children:r.jsxs($a,{children:[r.jsx(Wa,{asChild:!0,children:r.jsxs(ut,{size:l,variant:s,className:K("relative z-10 text-muted-foreground hover:text-foreground",a),onClick:p=>{p.stopPropagation(),m()},children:[f?r.jsx(xo,{className:"h-3.5 w-3.5 text-green-500"}):r.jsx(lr,{className:"h-3.5 w-3.5"}),r.jsx("span",{className:"sr-only",children:u})]})}),r.jsx(Xa,{children:r.jsx("p",{children:f?"Copied!":u})})]})})}function Ss({active:n,onClick:a,children:s,icon:l}){return r.jsxs("button",{onClick:a,className:K("px-2.5 py-1.5 text-xs font-medium rounded transition-colors flex items-center gap-1.5",n?"bg-primary/15 text-primary":"text-muted-foreground hover:bg-muted/50 hover:text-foreground"),children:[l&&r.jsx(l,{className:"w-3.5 h-3.5"}),s]})}function Gx({code:n}){const a=Tk(n);return r.jsx("span",{className:K("inline-flex items-center justify-center min-w-[36px] px-2 py-0.5 rounded text-xs font-bold","bg-current/10 border border-current/20",a),children:n})}function Lk({parsed:n}){const{t:a}=_t(),s=Dk(n.quotaResetDelay)||Ek(n.quotaResetTimestamp),l=a("errorLogs.na");return r.jsx(So,{className:"h-full",children:r.jsxs("div",{className:"p-4 space-y-4",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx(Gx,{code:n.statusCode}),r.jsx("span",{className:"text-sm font-medium",children:n.statusText}),r.jsx("span",{className:"text-xs text-muted-foreground px-2 py-0.5 rounded bg-muted/50",children:Mk(n.errorType)})]}),n.model&&r.jsxs("div",{className:"flex items-center gap-2.5 p-3 rounded-lg bg-violet-500/10 border border-violet-500/20",children:[r.jsx(GS,{className:"w-4 h-4 text-violet-500 shrink-0"}),r.jsxs("div",{className:"text-sm",children:[r.jsx("span",{className:"text-muted-foreground",children:a("errorLogs.modelLabel")}),r.jsx("span",{className:"font-semibold text-violet-600 dark:text-violet-400",children:n.model})]})]}),n.errorType==="rate_limit"&&s&&r.jsxs("div",{className:"flex items-center gap-2.5 p-3 rounded-lg bg-amber-500/10 border border-amber-500/20",children:[r.jsx(Os,{className:"w-4 h-4 text-amber-500 shrink-0"}),r.jsxs("div",{className:"text-sm",children:[r.jsx("span",{className:"text-muted-foreground",children:a("errorLogs.quotaResetsIn")}),r.jsx("span",{className:"font-semibold text-amber-600 dark:text-amber-400",children:s})]})]}),r.jsxs("div",{className:"grid grid-cols-4 gap-3 text-xs",children:[r.jsxs("div",{className:"p-2.5 rounded bg-muted/30 border border-border/50",children:[r.jsx("div",{className:"text-muted-foreground mb-1",children:a("errorLogs.method")}),r.jsx("div",{className:"font-medium",children:n.method||l})]}),r.jsxs("div",{className:"p-2.5 rounded bg-muted/30 border border-border/50",children:[r.jsx("div",{className:"text-muted-foreground mb-1",children:a("errorLogs.provider")}),r.jsx("div",{className:"font-medium",children:n.provider||l})]}),r.jsxs("div",{className:"p-2.5 rounded bg-muted/30 border border-border/50",children:[r.jsx("div",{className:"text-muted-foreground mb-1",children:a("errorLogs.version")}),r.jsx("div",{className:"font-medium",children:n.version||l})]}),r.jsxs("div",{className:"p-2.5 rounded bg-muted/30 border border-border/50",children:[r.jsx("div",{className:"text-muted-foreground mb-1",children:a("errorLogs.endpoint")}),r.jsx("div",{className:"font-medium truncate",title:n.endpoint,children:n.endpoint||l})]})]}),r.jsxs("div",{className:"text-xs",children:[r.jsx("div",{className:"text-muted-foreground mb-1.5",children:a("errorLogs.url")}),r.jsx("div",{className:"font-mono p-2.5 rounded bg-muted/30 border border-border/50 break-all leading-relaxed",children:n.url||l})]}),r.jsxs("div",{className:"text-xs",children:[r.jsx("div",{className:"text-muted-foreground mb-1.5",children:a("errorLogs.timestamp")}),r.jsx("div",{className:"font-mono",children:n.timestamp||l})]}),n.errorType!=="unknown"&&r.jsxs("div",{className:K("flex items-start gap-3 p-3 rounded text-xs",n.errorType==="rate_limit"?"bg-amber-500/10 border border-amber-500/20":n.errorType==="auth"?"bg-red-500/10 border border-red-500/20":"bg-blue-500/10 border border-blue-500/20"),children:[n.errorType==="rate_limit"?r.jsx(va,{className:"w-4 h-4 mt-0.5 text-amber-500 shrink-0"}):n.errorType==="auth"?r.jsx(va,{className:"w-4 h-4 mt-0.5 text-red-500 shrink-0"}):r.jsx(wr,{className:"w-4 h-4 mt-0.5 text-blue-500 shrink-0"}),r.jsxs("div",{className:K("leading-relaxed",n.errorType==="rate_limit"?"text-amber-600 dark:text-amber-400":n.errorType==="auth"?"text-red-600 dark:text-red-400":"text-blue-600 dark:text-blue-400"),children:[n.errorType==="rate_limit"&&(n.model?a("errorLogs.rateLimitedMsg",{model:n.model}):a("errorLogs.rateLimitedMsgNoModel")),n.errorType==="auth"&&a("errorLogs.authFailedMsg"),n.errorType==="not_found"&&a("errorLogs.notFoundMsg"),n.errorType==="server"&&a("errorLogs.serverErrorMsg"),n.errorType==="timeout"&&a("errorLogs.timeoutMsg")]})]})]})})}function _k({headers:n}){const a=Object.entries(n);return a.length===0?r.jsx("div",{className:"p-4 text-xs text-muted-foreground",children:"No headers available"}):r.jsx(So,{className:"h-full",children:r.jsx("div",{className:"p-4 space-y-1",children:a.map(([s,l])=>r.jsxs("div",{className:"flex gap-3 text-xs font-mono py-1.5 border-b border-border/30 last:border-0",children:[r.jsxs("span",{className:"text-muted-foreground shrink-0 min-w-[140px]",children:[s,":"]}),r.jsx("span",{className:"break-all",children:l})]},s))})})}function ay({content:n,label:a}){const{t:s}=_t();if(!n||n.trim()===""){const f=a==="Request"?"errorLogs.noRequestBody":"errorLogs.noResponseBody";return r.jsx("div",{className:"p-4 text-xs text-muted-foreground",children:s(f)})}let l=n,u=!1;try{const f=JSON.parse(n);l=JSON.stringify(f,null,2),u=!0}catch{}return r.jsx(So,{className:"h-full",children:r.jsx("pre",{className:K("p-4 text-xs font-mono whitespace-pre-wrap break-all leading-relaxed",u?"text-emerald-700 dark:text-green-400":"text-zinc-700 dark:text-muted-foreground"),children:l})})}function zk({content:n}){return r.jsx(So,{className:"h-full",children:r.jsx("pre",{className:"p-4 text-xs font-mono text-zinc-700 dark:text-muted-foreground whitespace-pre-wrap break-all leading-relaxed",children:n})})}function Uk({name:n,absolutePath:a}){const{t:s}=_t(),[l,u]=S.useState("overview"),{data:f,isLoading:h,error:m}=gA(n),p=S.useMemo(()=>f?vk(f):null,[f]);return n?h?r.jsxs("div",{className:"flex-1 p-6 space-y-3",children:[r.jsx(Ke,{className:"h-5 w-full"}),r.jsx(Ke,{className:"h-5 w-3/4"}),r.jsx(Ke,{className:"h-5 w-5/6"}),r.jsx(Ke,{className:"h-5 w-2/3"})]}):m||!f||!p?r.jsx("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:r.jsx("p",{className:"text-sm",children:s("errorLogs.failedLoadContent")})}):r.jsxs("div",{className:"flex-1 flex flex-col min-w-0 h-full",children:[r.jsxs("div",{className:"px-4 py-3 border-b border-border bg-muted/30 flex items-center justify-between gap-3 shrink-0",children:[r.jsxs("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[r.jsx(Gx,{code:p.statusCode}),r.jsxs("span",{className:"text-xs font-semibold truncate text-foreground",children:[p.provider,"/",p.endpoint||"unknown"]}),n&&r.jsx(ny,{value:a||n,label:s("errorLogs.copyAbsolutePath"),size:"icon-sm",className:"ml-1 text-muted-foreground hover:text-foreground opacity-50 hover:opacity-100 transition-opacity"})]}),r.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[f&&r.jsx(ny,{value:f,label:s("errorLogs.copyRawContent"),variant:"ghost",size:"icon-sm",className:"text-muted-foreground hover:text-foreground"}),r.jsx("span",{className:"text-[10px] text-muted-foreground font-mono bg-muted px-1.5 py-0.5 rounded border border-border/50",children:p.method})]})]}),r.jsxs("div",{className:"px-3 py-2 border-b border-border flex items-center gap-1 bg-muted/10 shrink-0 overflow-x-auto",children:[r.jsx(Ss,{active:l==="overview",onClick:()=>u("overview"),icon:wr,children:s("errorLogs.tabOverview")}),r.jsx(Ss,{active:l==="headers",onClick:()=>u("headers"),icon:VS,children:s("errorLogs.tabHeaders")}),r.jsx(Ss,{active:l==="request",onClick:()=>u("request"),icon:FS,children:s("errorLogs.tabRequest")}),r.jsx(Ss,{active:l==="response",onClick:()=>u("response"),icon:QS,children:s("errorLogs.tabResponse")}),r.jsx(Ss,{active:l==="raw",onClick:()=>u("raw"),icon:$S,children:s("errorLogs.tabRaw")})]}),r.jsxs("div",{className:"flex-1 overflow-hidden bg-card/30",children:[l==="overview"&&r.jsx(Lk,{parsed:p}),l==="headers"&&r.jsx(_k,{headers:p.requestHeaders}),l==="request"&&r.jsx(ay,{content:p.requestBody,label:"Request"}),l==="response"&&r.jsx(ay,{content:p.responseBody,label:"Response"}),l==="raw"&&r.jsx(zk,{content:f})]})]}):r.jsx("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:r.jsxs("div",{className:"text-center space-y-3",children:[r.jsx(YS,{className:"w-10 h-10 mx-auto opacity-40"}),r.jsx("p",{className:"text-sm",children:s("errorLogs.selectLog")})]})})}function Ik(){const{t:n}=_t(),{data:a,isLoading:s}=dA(),{data:l,isLoading:u,error:f}=pA(a?.running??!1),[h,m]=S.useState(500),[p,y]=S.useState(!1),C=S.useRef(null),x=S.useRef(null),b=()=>{x.current&&(clearInterval(x.current),x.current=null)};S.useEffect(()=>{if(!p)return;const U=A=>{const _=C.current;if(!_)return;const F=_.getBoundingClientRect().top+window.scrollY,Q=A.pageY-F;m(Math.max(300,Q));const te=window.innerHeight-A.clientY,ye=15;b(),te<50?x.current=setInterval(()=>{window.scrollBy(0,ye)},16):A.clientY<50&&(x.current=setInterval(()=>{window.scrollBy(0,-ye)},16))},O=()=>{y(!1),b(),document.body.style.cursor="default",document.body.style.userSelect="auto"};return document.addEventListener("mousemove",U),document.addEventListener("mouseup",O),document.body.style.cursor="row-resize",document.body.style.userSelect="none",()=>{document.removeEventListener("mousemove",U),document.removeEventListener("mouseup",O),document.body.style.cursor="default",document.body.style.userSelect="auto",b()}},[p]);const N=U=>{U.preventDefault(),y(!0)},w=S.useMemo(()=>l?.[0]?.name??null,[l]),[T,E]=S.useState(null),M=T??w,H=S.useMemo(()=>!M||!l?void 0:l.find(O=>O.name===M)?.absolutePath,[M,l]);if(s||!a?.running)return null;if(u)return r.jsxs("div",{className:"rounded-xl border border-border overflow-hidden font-mono text-sm bg-card/50 dark:bg-zinc-900/60 backdrop-blur-sm h-[500px]",children:[r.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border",children:[r.jsx(Ke,{className:"h-4 w-32"}),r.jsx(Ke,{className:"h-4 w-20"})]}),r.jsx("div",{className:"p-4 space-y-3",children:[1,2,3].map(U=>r.jsx(Ke,{className:"h-12 w-full rounded-lg"},U))})]});if(!l||l.length===0)return null;const B=l.length;return r.jsxs("div",{ref:C,className:"rounded-xl border border-border overflow-hidden font-mono text-sm text-foreground bg-card/50 dark:bg-zinc-900/60 backdrop-blur-sm flex flex-col shadow-sm transition-[height] duration-0 ease-linear relative group/container",style:{height:h},children:[r.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border bg-gradient-to-r from-amber-500/10 via-transparent to-transparent dark:from-amber-500/15 shrink-0",children:[r.jsxs("div",{className:"flex items-center gap-2.5",children:[r.jsx(va,{className:"w-4 h-4 text-amber-500"}),r.jsx("span",{className:"text-sm font-semibold tracking-tight",children:n("errorLogs.title")}),r.jsx("span",{className:"text-xs text-muted-foreground ml-1",children:n("errorLogs.failedRequests",{count:B})})]}),r.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[r.jsx(WS,{className:"w-3.5 h-3.5"}),r.jsx("span",{children:n("errorLogs.cliproxyDiagnostics")})]})]}),r.jsx("div",{className:"flex-1 min-h-0",children:r.jsxs(of,{direction:"horizontal",children:[r.jsx(Ps,{defaultSize:30,minSize:20,maxSize:50,className:"flex flex-col min-w-0",children:r.jsxs(So,{className:"h-full",children:[r.jsx("div",{className:"divide-y divide-border/50",children:l.slice(0,50).map(U=>r.jsx(Pk,{name:U.name,size:U.size,modified:U.modified,isSelected:M===U.name,onClick:()=>E(U.name),statusCode:U.statusCode,model:U.model},U.name))}),l.length>50&&r.jsx("div",{className:"px-3 py-3 text-center text-[10px] text-muted-foreground border-t border-border/50",children:n("errorLogs.showingCount",{total:l.length})})]})}),r.jsxs(sf,{className:"w-[1px] bg-border hover:bg-primary/50 transition-colors flex items-center justify-center group relative z-10 w-2 -ml-1 flex items-center justify-center outline-none",children:[r.jsx("div",{className:"w-[1px] h-full bg-border group-hover:bg-primary/50 transition-colors"}),r.jsx("div",{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-4 h-8 rounded-sm flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity bg-muted border border-border",children:r.jsx(Cr,{className:"h-4 w-4 text-muted-foreground"})})]}),r.jsx(Ps,{className:"flex flex-col min-w-0 bg-background/50",children:r.jsx(Uk,{name:M,absolutePath:H})})]})}),f?r.jsx("div",{className:"px-4 py-2 border-t border-border text-xs text-destructive bg-destructive/5 shrink-0",children:f.message}):r.jsx("div",{className:"h-2 bg-border/10 border-t border-border/30 hover:bg-primary/10 transition-colors cursor-row-resize flex items-center justify-center group/handle shrink-0",onMouseDown:N,children:r.jsx(XS,{className:"w-8 h-3 text-border group-hover:text-primary/50 transition-colors"})})]})}const Hk=Nr("relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive",warning:"border-yellow-200 bg-yellow-50 text-yellow-900 dark:border-yellow-900/50 dark:bg-yellow-900/20 dark:text-yellow-200 [&>svg]:text-yellow-600 dark:[&>svg]:text-yellow-500",info:"border-blue-200 bg-blue-50 text-blue-900 dark:border-blue-900/50 dark:bg-blue-900/20 dark:text-blue-200 [&>svg]:text-blue-600 dark:[&>svg]:text-blue-500",success:"border-green-200 bg-green-50 text-green-900 dark:border-green-900/50 dark:bg-green-900/20 dark:text-green-200 [&>svg]:text-green-600 dark:[&>svg]:text-green-500"}},defaultVariants:{variant:"default"}}),lf=S.forwardRef(({className:n,variant:a,...s},l)=>r.jsx("div",{ref:l,role:"alert",className:K(Hk({variant:a}),n),...s}));lf.displayName="Alert";const Yx=S.forwardRef(({className:n,...a},s)=>r.jsx("h5",{ref:s,className:K("mb-1 font-medium leading-none tracking-tight",n),...a}));Yx.displayName="AlertTitle";const rf=S.forwardRef(({className:n,...a},s)=>r.jsx("div",{ref:s,className:K("text-sm [&_p]:leading-relaxed",n),...a}));rf.displayName="AlertDescription";function Bk(){return jt({queryKey:["overview"],queryFn:async()=>(await fetch("/api/overview")).json()})}function Vx(n,a){return typeof n=="object"&&n!==null&&"error"in n&&typeof n.error=="string"?n.error:a}function Fx(n){const a=n.trim();if(!a)return null;try{return JSON.parse(a)}catch{return null}}function Kk(n){const a=n.trim().toLowerCase();return a.startsWith("<!doctype html")||a.startsWith("<html")}function qk(n){if(!n||typeof n!="object")return!1;const a=n;return!(typeof a.content!="string"||"contentPath"in a&&typeof a.contentPath!="string")}async function Qx(n,a){const s=await n.text(),l=Fx(s);if(!n.ok){const u=Vx(l,a);throw new Error(u)}if(l===null)throw new Error(a);return l}function Gk(){return jt({queryKey:["shared","summary"],queryFn:async()=>{const n=await fetch("/api/shared/summary");return Qx(n,"Failed to fetch shared summary")}})}function PD(n){return jt({queryKey:["shared",n],queryFn:async()=>{const a=await fetch(`/api/shared/${n}`);return Qx(a,`Failed to fetch shared ${n}`)}})}function LD(n,a){return jt({queryKey:["shared",n,"content",a],enabled:typeof a=="string"&&a.length>0,queryFn:async()=>{if(!a)throw new Error("Missing shared item path");const s=new URLSearchParams({type:n,path:a}),l=await fetch(`/api/shared/content?${s.toString()}`),u=await l.text(),f=Fx(u);if(!l.ok)throw new Error(Vx(f,`Failed to fetch shared ${n} content`));if(qk(f))return{content:f.content,contentPath:typeof f.contentPath=="string"&&f.contentPath.length>0?f.contentPath:a};if(u.trim().length>0){if(Kk(u))throw new Error("Shared content endpoint unavailable. Restart `ccs config` and try again.");return{content:u,contentPath:a}}throw new Error(`Failed to fetch shared ${n} content`)}})}const Yk={ok:"success",warning:"warning",error:"error"},Vk={default:{iconBg:"bg-muted",iconColor:"text-muted-foreground"},success:{iconBg:"bg-green-600/15",iconColor:"text-green-700 dark:text-green-500"},warning:{iconBg:"bg-amber-500/15",iconColor:"text-amber-700 dark:text-amber-400"},error:{iconBg:"bg-red-600/15",iconColor:"text-red-700 dark:text-red-500"},accent:{iconBg:"bg-accent/15",iconColor:"text-accent"}};function nr({title:n,value:a,icon:s,variant:l="default",onClick:u}){const f=Vk[l];return r.jsxs("button",{onClick:u,className:K("flex items-center gap-3 px-4 py-2.5 rounded-lg border bg-card/50","transition-all hover:bg-card hover:shadow-sm hover:-translate-y-0.5","active:scale-[0.98]"),children:[r.jsx("div",{className:K("flex items-center justify-center w-9 h-9 rounded-md",f.iconBg),children:r.jsx(s,{className:K("w-4 h-4",f.iconColor)})}),r.jsxs("div",{className:"text-left",children:[r.jsx("p",{className:"text-[10px] text-muted-foreground uppercase tracking-wider",children:n}),r.jsx("p",{className:K("text-lg font-bold font-mono leading-tight",f.iconColor),children:a})]})]})}function Fk(){const{t:n}=_t(),a=Md(),{data:s,isLoading:l}=Bk(),{data:u,isLoading:f}=Gk();if(l||f)return r.jsxs("div",{className:"p-6 space-y-6",children:[r.jsxs("div",{className:"rounded-xl border p-6 flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center gap-4",children:[r.jsx(Ke,{className:"h-12 w-12 rounded-lg"}),r.jsxs("div",{children:[r.jsx(Ke,{className:"h-7 w-[180px] mb-2"}),r.jsx(Ke,{className:"h-4 w-[220px]"})]})]}),r.jsx("div",{className:"flex items-center gap-3",children:[1,2,3,4].map(m=>r.jsx(Ke,{className:"h-14 w-28 rounded-lg"},m))})]}),r.jsxs("div",{className:"border rounded-xl overflow-hidden",children:[r.jsxs("div",{className:"px-4 py-2.5 border-b flex items-center justify-between",children:[r.jsx(Ke,{className:"h-4 w-32"}),r.jsx(Ke,{className:"h-4 w-20"})]}),r.jsx("div",{className:"px-4 py-3 border-b",children:r.jsx(Ke,{className:"h-2 w-full rounded-full"})}),[1,2,3].map(m=>r.jsxs("div",{className:"px-4 py-2.5 flex items-center gap-3 border-b last:border-b-0",children:[r.jsx(Ke,{className:"w-2.5 h-2.5 rounded-full"}),r.jsx(Ke,{className:"h-4 flex-1"}),r.jsx(Ke,{className:"h-1.5 w-24 rounded-full"}),r.jsx(Ke,{className:"h-4 w-16"})]},m))]})]});const h=s?.health?Yk[s.health.status]:void 0;return r.jsxs("div",{className:"p-6 space-y-6",children:[r.jsxs("div",{className:"relative overflow-hidden rounded-xl border bg-gradient-to-br from-background via-background to-muted/30",children:[r.jsx("div",{className:"absolute inset-0 opacity-[0.03] pointer-events-none",children:r.jsx("div",{className:"absolute inset-0",style:{backgroundImage:"radial-gradient(circle at 1px 1px, currentColor 1px, transparent 0)",backgroundSize:"24px 24px"}})}),r.jsxs("div",{className:"relative p-6 flex flex-col lg:flex-row lg:items-center lg:justify-between gap-4",children:[r.jsx(X1,{version:s?.version}),r.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[r.jsx(nr,{title:n("home.profiles"),value:s?.profiles??0,icon:Yy,variant:"accent",onClick:()=>a("/providers")}),r.jsx(nr,{title:n("home.cliproxy"),value:s?.cliproxy??0,icon:Vy,variant:"accent",onClick:()=>a("/cliproxy")}),r.jsx(nr,{title:n("home.accounts"),value:s?.accounts??0,icon:$y,variant:"default",onClick:()=>a("/accounts")}),r.jsx(nr,{title:n("home.health"),value:s?.health?`${s.health.passed}/${s.health.total}`:"-",icon:Ds,variant:h,onClick:()=>a("/health")})]})]})]}),u?.symlinkStatus&&!u.symlinkStatus.valid&&r.jsxs(lf,{variant:"warning",children:[r.jsx(va,{className:"h-4 w-4"}),r.jsx(Yx,{children:n("home.configurationRequired")}),r.jsx(rf,{children:u.symlinkStatus.message})]}),r.jsx(qA,{}),r.jsx(Ik,{})]})}const $x=cS,cf=S.forwardRef(({className:n,...a},s)=>r.jsx(By,{ref:s,className:K("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",n),...a}));cf.displayName=By.displayName;const mr=S.forwardRef(({className:n,...a},s)=>r.jsx(Ky,{ref:s,className:K("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",n),...a}));mr.displayName=Ky.displayName;const Ad=S.forwardRef(({className:n,...a},s)=>r.jsx(qy,{ref:s,className:K("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",n),...a}));Ad.displayName=qy.displayName;function ln({className:n,...a}){return r.jsx(uS,{"data-slot":"label",className:K("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",n),...a})}const uf="ccs:openrouter-models",Qk=1440*60*1e3,Wx="1";function kd(n){const a=parseFloat(n);return isNaN(a)||a===0?0:a*1e6}function iy(n){const a=kd(n);return a===0?"Free":a<.01?"<$0.01":a<1?`$${a.toFixed(2)}`:`$${a.toFixed(a<10?2:0)}`}function $k(n){const a=iy(n.prompt),s=iy(n.completion);return a==="Free"&&s==="Free"?"Free":`${a}/${s}`}function Wk(n){const a=n.id.toLowerCase();return a.startsWith("anthropic/")?"anthropic":a.startsWith("openai/")?"openai":a.startsWith("google/")?"google":a.startsWith("meta-llama/")||a.startsWith("meta/")?"meta":a.startsWith("mistralai/")?"mistral":a.includes(":free")||a.includes("qwen")||a.includes("deepseek")?"opensource":"other"}function Xk(n){return{...n,category:Wk(n),pricePerMillionPrompt:kd(n.pricing.prompt),pricePerMillionCompletion:kd(n.pricing.completion),isFree:n.pricing.prompt==="0"&&n.pricing.completion==="0",isExacto:n.id.includes(":exacto")}}function Zk(n,a,s){const l=a.toLowerCase().trim();return n.filter(u=>s?.category&&u.category!==s.category||s?.freeOnly&&!u.isFree||s?.minContext&&u.context_length<s.minContext?!1:l?u.id.toLowerCase().includes(l)||u.name.toLowerCase().includes(l)||u.description?.toLowerCase().includes(l):!0)}function _D(n){return[...n].sort((a,s)=>{if(a.isFree&&!s.isFree)return-1;if(!a.isFree&&s.isFree)return 1;if(!a.isFree&&!s.isFree){if(a.isExacto&&!s.isExacto)return-1;if(!a.isExacto&&s.isExacto)return 1}return a.name.localeCompare(s.name)})}function Jk(){try{const n=localStorage.getItem(uf);if(!n)return null;const a=JSON.parse(n);return a.version!==Wx||Date.now()-a.fetchedAt>Qk?null:a.models}catch{return null}}function ej(n){try{localStorage.setItem(uf,JSON.stringify({models:n,fetchedAt:Date.now(),version:Wx}))}catch{}}function tj(){localStorage.removeItem(uf)}function zD(n,a){const[s]=n.split("/");if(!s)return{};const l=a.filter(h=>h.id.startsWith(`${s}/`));if(l.length===0)return{};const u=[...l].sort((h,m)=>m.pricePerMillionPrompt-h.pricePerMillionPrompt),f=Math.ceil(u.length/3);return{opus:u[0]?.id,sonnet:u[Math.min(f,u.length-1)]?.id,haiku:u[u.length-1]?.id}}function nj(n){return n>=1e6?`${(n/1e6).toFixed(1)}M`:n>=1e3?`${Math.round(n/1e3)}K`:String(n)}const UD={anthropic:"Anthropic (Claude)",openai:"OpenAI (GPT)",google:"Google (Gemini)",meta:"Meta (Llama)",mistral:"Mistral",opensource:"Open Source",other:"Other"},aj={anthropic:["anthropic/"],openai:["openai/"],google:["google/"],meta:["meta-llama/","meta/"],mistral:["mistralai/"],opensource:["deepseek/","qwen/","cohere/"],other:[]};function ij(n,a=2){const s=[],l=["anthropic","openai","google","meta","mistral","opensource"];for(const u of l){const f=aj[u];if(f.length===0)continue;const m=[...n.filter(p=>f.some(y=>p.id.toLowerCase().startsWith(y)))].sort((p,y)=>(y.created??0)-(p.created??0));s.push(...m.slice(0,a))}return s.sort((u,f)=>(f.created??0)-(u.created??0))}function oj(n){const s=Date.now()/1e3-n;return s<86400?"Today":s<172800?"Yesterday":s<604800?`${Math.floor(s/86400)}d ago`:s<2592e3?`${Math.floor(s/604800)}w ago`:s<31536e3?`${Math.floor(s/2592e3)}mo ago`:`${Math.floor(s/31536e3)}y ago`}const sj="https://openrouter.ai/api/v1/models",Xx=["openrouter-models"],oy=1440*60*1e3;async function lj(){const n=await fetch(sj);if(!n.ok)throw new Error(`Failed to fetch OpenRouter models: ${n.status}`);const s=(await n.json()).data;return ej(s),s}function Zx(){return jt({queryKey:Xx,queryFn:lj,staleTime:oy,gcTime:oy,initialData:()=>Jk()??void 0,refetchOnWindowFocus:!1})}function rj(){const n=Zx(),a=(n.data??[]).map(Xk);return{...n,models:a}}function ID(){const n=dt();return()=>(tj(),n.invalidateQueries({queryKey:Xx}))}function HD(){const{data:n,isLoading:a,isError:s}=Zx();return{isReady:!!n&&n.length>0,isLoading:a,isError:s,modelCount:n?.length??0}}function df({profileEnv:n={}}){const[a,s]=S.useState(null),[l,u]=S.useState(!0),[f,h]=S.useState(!1);S.useEffect(()=>{m()},[]);const m=async()=>{try{u(!0);const b=await fetch("/api/global-env");if(!b.ok)throw new Error("Failed to load");const N=await b.json();s(N)}catch{s(null)}finally{u(!1)}};if(l||!a?.enabled)return null;const p=a.env||{},y=Object.keys(p);if(y.length===0)return null;const C=y.filter(b=>!(b in n)),x=y.filter(b=>b in n);return r.jsxs("div",{className:"border-t bg-muted/20",children:[r.jsxs("button",{onClick:()=>h(!f),className:"w-full px-4 py-2 flex items-center gap-2 hover:bg-muted/30 transition-colors",children:[r.jsx(wr,{className:"w-4 h-4 text-blue-500"}),r.jsxs("span",{className:"text-xs text-muted-foreground flex-1 text-left",children:[r.jsx("span",{className:"font-medium text-foreground",children:C.length})," global env var",C.length!==1?"s":""," will be injected at runtime",x.length>0&&r.jsxs("span",{className:"text-amber-600 dark:text-amber-400 ml-1",children:["(",x.length," overridden by profile)"]})]}),f?r.jsx(Ed,{className:"w-4 h-4 text-muted-foreground"}):r.jsx(br,{className:"w-4 h-4 text-muted-foreground"})]}),f&&r.jsxs("div",{className:"px-4 pb-3 space-y-2",children:[C.length>0&&r.jsx("div",{className:"space-y-1",children:C.map(b=>r.jsxs("div",{className:"flex items-center gap-2 text-xs font-mono bg-green-500/10 text-green-700 dark:text-green-400 px-2 py-1 rounded",children:[r.jsx("span",{className:"text-green-500",children:"+"}),r.jsxs("span",{className:"truncate",children:[b,"=",p[b]]})]},b))}),x.length>0&&r.jsxs("div",{className:"space-y-1",children:[r.jsx("p",{className:"text-xs text-muted-foreground",children:"Skipped (profile already defines):"}),x.map(b=>r.jsxs("div",{className:"flex items-center gap-2 text-xs font-mono bg-amber-500/10 text-amber-700 dark:text-amber-400 px-2 py-1 rounded",children:[r.jsx("span",{className:"text-amber-500",children:"~"}),r.jsx("span",{className:"truncate",children:b})]},b))]}),r.jsx("div",{className:"pt-2 border-t border-border/50",children:r.jsx(ut,{variant:"ghost",size:"sm",asChild:!0,className:"h-7 text-xs gap-1.5 -ml-2",children:r.jsxs(pd,{to:"/settings?tab=globalenv",children:[r.jsx(Rd,{className:"w-3.5 h-3.5"}),"Configure in Settings",r.jsx(Wy,{className:"w-3 h-3 opacity-50"})]})})})]})]})}const cj=S.lazy(()=>gt(()=>Promise.resolve().then(()=>hf),void 0).then(n=>({default:n.CodeEditor})));function BD({rawJsonContent:n,isRawJsonValid:a,rawJsonEdits:s,settings:l,onChange:u,missingRequiredFields:f=[]}){const h=f.length>0;return r.jsx(S.Suspense,{fallback:r.jsxs("div",{className:"flex items-center justify-center h-full",children:[r.jsx(Dn,{className:"w-6 h-6 animate-spin text-muted-foreground"}),r.jsx("span",{className:"ml-2 text-muted-foreground",children:"Loading editor..."})]}),children:r.jsxs("div",{className:"h-full flex flex-col",children:[!a&&s!==null&&r.jsxs("div",{className:"mb-2 px-3 py-2 bg-destructive/10 text-destructive text-sm rounded-md flex items-center gap-2 mx-6 mt-4 shrink-0",children:[r.jsx(bo,{className:"w-4 h-4"}),"Invalid JSON syntax"]}),a&&h&&r.jsxs("div",{className:"mb-2 px-3 py-2 bg-warning/10 text-warning-foreground text-sm rounded-md flex items-start gap-2 mx-6 mt-4 shrink-0 border border-warning/20",children:[r.jsx(va,{className:"w-4 h-4 mt-0.5 text-amber-500 shrink-0"}),r.jsxs("div",{children:[r.jsx("span",{className:"font-medium text-amber-600 dark:text-amber-400",children:"Missing required fields:"})," ",r.jsx("code",{className:"text-xs bg-muted px-1 py-0.5 rounded",children:f.join(", ")}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"These fields will use default values at runtime."})]})]}),r.jsx("div",{className:"flex-1 overflow-hidden px-6 pb-4 pt-4",children:r.jsx("div",{className:"h-full border rounded-md overflow-hidden bg-background",children:r.jsx(cj,{value:n,onChange:u,language:"json",minHeight:"100%"})})}),r.jsx("div",{className:"mx-6 mb-4",children:r.jsx("div",{className:"border rounded-md overflow-hidden",children:r.jsx(df,{profileEnv:l?.env})})})]})})}function sy(n,a){try{var s=n()}catch(l){return a(l)}return s&&s.then?s.then(void 0,a):s}function uj(n,a){for(var s={};n.length;){var l=n[0],u=l.code,f=l.message,h=l.path.join(".");if(!s[h])if("unionErrors"in l){var m=l.unionErrors[0].errors[0];s[h]={message:m.message,type:m.code}}else s[h]={message:f,type:u};if("unionErrors"in l&&l.unionErrors.forEach(function(C){return C.errors.forEach(function(x){return n.push(x)})}),a){var p=s[h].types,y=p&&p[l.code];s[h]=Zy(h,a,s,u,y?[].concat(y,l.message):l.message)}n.shift()}return s}function dj(n,a){for(var s={};n.length;){var l=n[0],u=l.code,f=l.message,h=l.path.join(".");if(!s[h])if(l.code==="invalid_union"&&l.errors.length>0){var m=l.errors[0][0];s[h]={message:m.message,type:m.code}}else s[h]={message:f,type:u};if(l.code==="invalid_union"&&l.errors.forEach(function(C){return C.forEach(function(x){return n.push(x)})}),a){var p=s[h].types,y=p&&p[l.code];s[h]=Zy(h,a,s,u,y?[].concat(y,l.message):l.message)}n.shift()}return s}function fj(n,a,s){if(s===void 0&&(s={}),(function(l){return"_def"in l&&typeof l._def=="object"&&"typeName"in l._def})(n))return function(l,u,f){try{return Promise.resolve(sy(function(){return Promise.resolve(n[s.mode==="sync"?"parse":"parseAsync"](l,a)).then(function(h){return f.shouldUseNativeValidation&&hg({},f),{errors:{},values:s.raw?Object.assign({},l):h}})},function(h){if((function(m){return Array.isArray(m?.issues)})(h))return{values:{},errors:mg(uj(h.errors,!f.shouldUseNativeValidation&&f.criteriaMode==="all"),f)};throw h}))}catch(h){return Promise.reject(h)}};if((function(l){return"_zod"in l&&typeof l._zod=="object"})(n))return function(l,u,f){try{return Promise.resolve(sy(function(){return Promise.resolve((s.mode==="sync"?zC:UC)(n,l,a)).then(function(h){return f.shouldUseNativeValidation&&hg({},f),{errors:{},values:s.raw?Object.assign({},l):h}})},function(h){if((function(m){return m instanceof IC})(h))return{values:{},errors:mg(dj(h.issues,!f.shouldUseNativeValidation&&f.criteriaMode==="all"),f)};throw h}))}catch(h){return Promise.reject(h)}};throw new Error("Invalid input: not a Zod schema")}function KD(){return jt({queryKey:["profiles"],queryFn:()=>Qe.profiles.list()})}function hj(){const n=dt();return pt({mutationFn:a=>Qe.profiles.create(a),onSuccess:()=>{n.invalidateQueries({queryKey:["profiles"]}),ce.success("Profile created successfully")},onError:a=>{ce.error(a.message)}})}function qD(){const n=dt();return pt({mutationFn:a=>Qe.profiles.delete(a),onSuccess:()=>{n.invalidateQueries({queryKey:["profiles"]}),ce.success("Profile deleted successfully")},onError:a=>{ce.error(a.message)}})}const mj="https://openrouter.ai/api",Jx=Object.freeze({kimi:"km",alibaba:"alibaba-coding-plan",acp:"alibaba-coding-plan"}),ev=[{id:"openrouter",name:"OpenRouter",description:"349+ models from OpenAI, Anthropic, Google, Meta",baseUrl:mj,defaultProfileName:"openrouter",defaultModel:"anthropic/claude-opus-4.5",apiKeyPlaceholder:"sk-or-...",apiKeyHint:"Get your API key at openrouter.ai/keys",category:"recommended",requiresApiKey:!0,badge:"349+ models",featured:!0,icon:"/icons/openrouter.svg"},{id:"alibaba-coding-plan",name:"Alibaba Coding Plan",description:"Alibaba Cloud Coding Plan via Anthropic-compatible endpoint",baseUrl:"https://coding-intl.dashscope.aliyuncs.com/apps/anthropic",defaultProfileName:"albb",defaultModel:"qwen3-coder-plus",apiKeyPlaceholder:"sk-sp-...",apiKeyHint:"Get your Coding Plan key from Alibaba Cloud Model Studio",category:"recommended",requiresApiKey:!0,badge:"Coding Plan",featured:!0,icon:"/assets/providers/alibabacloud-color.svg"},{id:"ollama",name:"Ollama (Local)",description:"Local open-source models via Ollama (32K+ context)",baseUrl:"http://localhost:11434",defaultProfileName:"ollama",defaultModel:"qwen3-coder",apiKeyPlaceholder:"ollama",apiKeyHint:"Install Ollama from ollama.com - no API key needed for local",category:"recommended",requiresApiKey:!1,badge:"Local",featured:!0,icon:"/icons/ollama.svg"},{id:"glm",name:"GLM",description:"Claude via Z.AI",baseUrl:"https://api.z.ai/api/anthropic",defaultProfileName:"glm",defaultModel:"glm-5",apiKeyPlaceholder:"ghp_...",apiKeyHint:"Get your API key from Z.AI",category:"alternative",requiresApiKey:!0,badge:"Z.AI",icon:"/icons/zai.svg"},{id:"glmt",name:"GLMT",description:"GLM with Thinking mode support",baseUrl:"https://api.z.ai/api/coding/paas/v4/chat/completions",defaultProfileName:"glmt",defaultModel:"glm-5",apiKeyPlaceholder:"ghp_...",apiKeyHint:"Same API key as GLM",category:"alternative",requiresApiKey:!0,extraEnv:{ANTHROPIC_TEMPERATURE:"0.2",ANTHROPIC_MAX_TOKENS:"65536",MAX_THINKING_TOKENS:"32768",ENABLE_STREAMING:"true",ANTHROPIC_SAFE_MODE:"false",API_TIMEOUT_MS:"3000000"},alwaysThinkingEnabled:!0,badge:"Thinking",icon:"/icons/zai.svg"},{id:"km",name:"Kimi",description:"Moonshot AI - Fast reasoning model",baseUrl:"https://api.kimi.com/coding/",defaultProfileName:"km",defaultModel:"kimi-k2-thinking-turbo",apiKeyPlaceholder:"sk-...",apiKeyHint:"Get your API key from Moonshot AI",category:"alternative",requiresApiKey:!0,alwaysThinkingEnabled:!0,badge:"Reasoning",icon:"/icons/kimi.svg"},{id:"foundry",name:"Azure Foundry",description:"Claude via Microsoft Azure AI Foundry",baseUrl:"https://<your-resource>.services.ai.azure.com/api/anthropic",defaultProfileName:"foundry",defaultModel:"claude-sonnet-4-5",apiKeyPlaceholder:"YOUR_AZURE_API_KEY",apiKeyHint:"Create resource at ai.azure.com, get API key from Keys tab",category:"alternative",requiresApiKey:!0,badge:"Azure",icon:"/icons/azure.svg"},{id:"mm",name:"Minimax",description:"M2.1/M2.1-lightning/M2 - multilang coding (1M context)",baseUrl:"https://api.minimax.io/anthropic",defaultProfileName:"mm",defaultModel:"MiniMax-M2.1",apiKeyPlaceholder:"YOUR_MINIMAX_API_KEY_HERE",apiKeyHint:"Get your API key at platform.minimax.io",category:"alternative",requiresApiKey:!0,badge:"1M context",icon:"/icons/minimax.svg"},{id:"deepseek",name:"DeepSeek",description:"V3.2 and R1 reasoning model (128K context)",baseUrl:"https://api.deepseek.com/anthropic",defaultProfileName:"deepseek",defaultModel:"deepseek-chat",apiKeyPlaceholder:"sk-...",apiKeyHint:"Get your API key at platform.deepseek.com",category:"alternative",requiresApiKey:!0,badge:"Reasoning",icon:"/icons/deepseek.svg"},{id:"qwen",name:"Qwen",description:"Alibaba Cloud - Qwen3 models (256K-1M context, thinking support)",baseUrl:"https://dashscope-intl.aliyuncs.com/apps/anthropic",defaultProfileName:"qwen-api",defaultModel:"qwen3-coder-plus",apiKeyPlaceholder:"sk-...",apiKeyHint:"Get your API key from Alibaba Cloud Model Studio",category:"alternative",requiresApiKey:!0,badge:"Alibaba",icon:"/assets/providers/qwen-color.svg"},{id:"ollama-cloud",name:"Ollama Cloud",description:"Ollama cloud models via direct API (glm-5:cloud, minimax-m2.1:cloud)",baseUrl:"https://ollama.com",defaultProfileName:"ollama-cloud",defaultModel:"glm-5:cloud",apiKeyPlaceholder:"YOUR_OLLAMA_CLOUD_API_KEY",apiKeyHint:"Get your API key at ollama.com",category:"alternative",requiresApiKey:!0,badge:"Cloud",icon:"/icons/ollama.svg"}];function tv(n){return{...n,extraEnv:n.extraEnv?{...n.extraEnv}:void 0}}function pj(n){const a=tv(n);return a.extraEnv&&Object.freeze(a.extraEnv),Object.freeze(a)}function gj(n,a){const s=new Set;for(const u of n){const f=u.id.trim().toLowerCase();if(u.id!==f)throw new Error(`Preset ID must be normalized: "${u.id}"`);if(s.has(u.id))throw new Error(`Duplicate preset ID detected: "${u.id}"`);s.add(u.id)}const l=new Set;for(const[u,f]of Object.entries(a)){const h=u.trim().toLowerCase();if(!h)throw new Error("Preset alias keys cannot be empty");if(u!==h)throw new Error(`Preset alias must be normalized: "${u}"`);if(l.has(h))throw new Error(`Duplicate normalized preset alias detected: "${u}"`);if(l.add(h),!s.has(f))throw new Error(`Preset alias "${u}" points to unknown target "${f}"`);if(s.has(h))throw new Error(`Preset alias "${u}" collides with canonical preset ID "${h}"`)}}gj(ev,Jx);const yj=Object.freeze(ev.map(pj));function xj(){return yj.map(tv)}function vj(n){const a=n.trim().toLowerCase();return Jx[a]||a}const bj=Object.freeze({ollama:{apiKeyPlaceholder:""}});function Sj(n){const a=bj[n.id];return a?{...n,...a}:{...n}}const Cj=xj(),ff=Object.freeze(Cj.map(Sj));function wj(n){return ff.filter(a=>a.category===n)}function ld(n){const a=vj(n);return ff.find(s=>s.id===a)}const Nj=HC({name:xi().min(1,"Name is required").regex(/^[a-zA-Z][a-zA-Z0-9._-]*$/,"Must start with letter, only letters/numbers/.-_"),baseUrl:xi().url("Invalid URL format"),apiKey:xi(),model:xi().optional(),opusModel:xi().optional(),sonnetModel:xi().optional(),haikuModel:xi().optional(),target:BC(["claude","droid"])}),Aj=["/chat/completions","/v1/messages","/messages","/completions"],ma="custom",rd="openrouter",cd={name:"",baseUrl:"",apiKey:"",model:"",opusModel:"",sonnetModel:"",haikuModel:"",target:"claude"},kj=wj("recommended"),nv=ff.filter(n=>n.category!=="recommended"),jj=new Set(nv.map(n=>n.id));function GD({open:n,onOpenChange:a,onSuccess:s,initialMode:l="openrouter"}){const{t:u}=_t(),f=hj(),[h,m]=S.useState("basic"),[p,y]=S.useState(null),[C,x]=S.useState(!1),[b,N]=S.useState(rd),[w,T]=S.useState(""),{models:E}=rj(),{register:M,handleSubmit:H,formState:{errors:B},control:U,reset:O,setValue:A}=KC({resolver:fj(Nj),defaultValues:cd}),_=pg({control:U,name:"baseUrl"}),W=pg({control:U,name:"target"}),F=S.useCallback(X=>{if(!X){O(cd);return}O({...cd,name:X.defaultProfileName,baseUrl:X.baseUrl,model:X.defaultModel,opusModel:X.defaultModel,sonnetModel:X.defaultModel,haikuModel:X.defaultModel})},[O]),Q=S.useMemo(()=>b===ma?null:ld(b)??null,[b]),ae=S.useMemo(()=>w.trim()?[...Zk(E,w)].sort((se,fe)=>(fe.created??0)-(se.created??0)).slice(0,20):ij(E,2),[E,w]);S.useEffect(()=>{if(n)if(m("basic"),y(null),x(!1),T(""),l==="normal")N(ma),F(null);else{const se=ld(l==="openrouter"?rd:l);if(se){N(se.id),F(se);return}N(ma),F(null)}},[n,l,F]);const te=X=>{const se=ld(X);if(se){N(se.id),F(se);return}N(ma),F(null)},ye=X=>{A("model",X.id),A("opusModel",X.id),A("sonnetModel",X.id),A("haikuModel",X.id),T(X.name),ce.success(`Applied "${X.name}" to all model tiers`,{duration:2e3})};S.useEffect(()=>{if(_&&b===ma){const se=_.toLowerCase();for(const fe of Aj)if(se.endsWith(fe)){const Ne=_.replace(new RegExp(fe+"$","i"),"");y(`URL ends with "${fe}" - Claude appends this automatically. You likely want: ${Ne}`);return}}y(null)},[_,b]);const de=async X=>{if(Q?.requiresApiKey!==!1&&!X.apiKey){ce.error(ct.t("commonToast.apiKeyRequired"));return}const se={...X,apiKey:X.apiKey||""};try{await f.mutateAsync(se),ce.success(`Profile "${se.name}" created`),s(se.name),a(!1)}catch(fe){ce.error(fe.message||"Failed to create profile")}},Ce=!!B.name||!!B.baseUrl||!!B.apiKey,R=!!B.model||!!B.opusModel||!!B.sonnetModel||!!B.haikuModel,$=b!==ma&&jj.has(b),ee=Q?.id===rd;return r.jsx(qd,{open:n,onOpenChange:a,children:r.jsxs(Gd,{className:"sm:max-w-[700px] p-0 gap-0 overflow-hidden max-h-[90vh] !flex !flex-col",children:[r.jsxs(Yd,{className:"p-6 pb-4 border-b",children:[r.jsxs(Vd,{className:"flex items-center gap-2",children:[r.jsx(dg,{className:"w-5 h-5 text-primary"}),"Create API Profile"]}),r.jsx(Fd,{children:"Choose a provider or configure a custom API endpoint."})]}),r.jsxs("form",{onSubmit:H(de),className:"flex flex-col flex-1 min-h-0 overflow-hidden",children:[r.jsxs("div",{className:"px-6 py-3 border-b bg-muted/30 space-y-2",children:[r.jsxs("div",{children:[r.jsx(ln,{className:"text-xs text-muted-foreground mb-1.5 block",children:u("profileEditor.provider")}),r.jsxs("div",{className:"flex gap-2",children:[kj.map(X=>r.jsx(ly,{preset:X,isSelected:b===X.id,onClick:()=>te(X.id)},X.id)),r.jsxs("button",{type:"button",onClick:()=>te(ma),className:K("flex items-center gap-2 px-4 py-2 rounded-md border-2 transition-all text-sm font-medium",b===ma||$?"border-primary bg-primary/10 text-primary dark:bg-primary/20":"border-dashed border-muted-foreground/40 hover:border-primary/50 hover:bg-muted/50 text-muted-foreground hover:text-foreground"),children:[r.jsx(Rd,{className:"w-4 h-4"}),r.jsx("span",{children:u("profileEditor.custom")})]})]})]}),(b===ma||$)&&r.jsxs("div",{className:"pt-3 mt-2 border-t border-dashed border-muted-foreground/30",children:[r.jsx(ln,{className:"text-xs font-medium text-foreground/70 mb-2 block",children:"Quick Templates"}),r.jsx("div",{className:"flex gap-2 flex-wrap",children:nv.map(X=>r.jsx(ly,{preset:X,isSelected:b===X.id,onClick:()=>te(X.id)},X.id))})]})]}),r.jsxs($x,{value:h,onValueChange:m,className:"flex flex-col flex-1 min-h-0 overflow-hidden",children:[r.jsx("div",{className:"px-6 pt-4",children:r.jsxs(cf,{className:"grid w-full grid-cols-2",children:[r.jsxs(mr,{value:"basic",className:"relative",children:["Basic Information",Ce&&r.jsx("span",{className:"absolute top-1 right-2 w-2 h-2 rounded-full bg-destructive animate-pulse"})]}),r.jsxs(mr,{value:"models",className:"relative",children:["Model Configuration",R&&r.jsx("span",{className:"absolute top-1 right-2 w-2 h-2 rounded-full bg-destructive animate-pulse"})]})]})}),r.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[r.jsxs(Ad,{value:"basic",className:"p-6 space-y-4 mt-0",children:[r.jsxs("div",{className:"space-y-1.5",children:[r.jsxs(ln,{htmlFor:"name",children:["Profile Name ",r.jsx("span",{className:"text-destructive",children:"*"})]}),r.jsx(Un,{id:"name",...M("name"),placeholder:"my-api",className:"font-mono"}),B.name?r.jsx("p",{className:"text-xs text-destructive",children:B.name.message}):r.jsxs("p",{className:"text-xs text-muted-foreground",children:["Used in CLI:"," ",r.jsx("code",{className:"bg-muted px-1 rounded text-[10px]",children:'ccs my-api "prompt"'})]})]}),r.jsxs("div",{className:"space-y-1.5",children:[r.jsxs(ln,{htmlFor:"baseUrl",children:["API Base URL ",r.jsx("span",{className:"text-destructive",children:"*"})]}),r.jsx(Un,{id:"baseUrl",...M("baseUrl"),placeholder:"https://api.example.com/v1"}),B.baseUrl?r.jsx("p",{className:"text-xs text-destructive",children:B.baseUrl.message}):p?r.jsxs("div",{className:"flex items-start gap-2 text-xs text-yellow-600 bg-yellow-50 dark:bg-yellow-900/20 p-2 rounded",children:[r.jsx(va,{className:"w-4 h-4 shrink-0 mt-0.5"}),r.jsx("span",{children:p})]}):Q?r.jsxs("p",{className:"text-xs text-muted-foreground",children:["Pre-filled from ",Q.name,". You can customize if needed."]}):r.jsx("p",{className:"text-xs text-muted-foreground",children:"The endpoint that accepts OpenAI-compatible and Anthropic requests"})]}),r.jsxs("div",{className:"space-y-1.5",children:[r.jsxs(ln,{htmlFor:"apiKey",children:["API Key"," ",Q?.requiresApiKey!==!1&&r.jsx("span",{className:"text-destructive",children:"*"}),Q?.requiresApiKey===!1&&r.jsx("span",{className:"text-muted-foreground text-xs font-normal",children:"(optional)"})]}),r.jsxs("div",{className:"relative",children:[r.jsx(Un,{id:"apiKey",type:C?"text":"password",...M("apiKey"),placeholder:Q?.requiresApiKey===!1?"Optional - only if auth is enabled":Q?.apiKeyPlaceholder??"sk-...",className:"pr-10"}),r.jsx(ut,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-9 w-9 text-muted-foreground hover:text-foreground",onClick:()=>x(!C),tabIndex:-1,children:C?r.jsx(xr,{className:"h-4 w-4"}):r.jsx(vr,{className:"h-4 w-4"})})]}),B.apiKey?r.jsx("p",{className:"text-xs text-destructive",children:B.apiKey.message}):Q?.requiresApiKey===!1?r.jsx("p",{className:"text-xs text-muted-foreground",children:"Only needed if you have configured Ollama authentication"}):Q?.apiKeyHint&&r.jsx("p",{className:"text-xs text-muted-foreground",children:Q.apiKeyHint})]}),r.jsxs("div",{className:"space-y-1.5",children:[r.jsx(ln,{htmlFor:"target",children:"Default Target CLI"}),r.jsxs(xx,{value:W,onValueChange:X=>A("target",X),children:[r.jsx(Zd,{id:"target",children:r.jsx(vx,{})}),r.jsxs(Jd,{children:[r.jsx(dr,{value:"claude",children:"Claude Code (default)"}),r.jsx(dr,{value:"droid",children:"Factory Droid"})]})]}),r.jsxs("p",{className:"text-xs text-muted-foreground",children:["Run with"," ",r.jsx("code",{className:"bg-muted px-1 rounded text-[10px]",children:W==="droid"?"ccsd":"ccs"})," ","by default. You can still override each run with"," ",r.jsx("code",{className:"bg-muted px-1 rounded text-[10px]",children:"--target"}),"."]})]})]}),r.jsxs(Ad,{value:"models",className:"p-6 mt-0 space-y-4",children:[r.jsxs("div",{className:"flex items-start gap-3 p-3 bg-blue-50 dark:bg-blue-950/20 text-blue-800 dark:text-blue-300 rounded-md text-sm border border-blue-100 dark:border-blue-900/30",children:[r.jsx(wr,{className:"w-5 h-5 shrink-0 mt-0.5"}),r.jsxs("div",{children:[r.jsx("p",{className:"font-medium mb-1",children:"Model Mapping"}),r.jsx("p",{className:"text-xs opacity-90",children:"Map Claude Code tiers (Opus/Sonnet/Haiku) to models supported by your provider."})]})]}),ee&&r.jsxs("div",{className:"space-y-2",children:[r.jsx(ln,{children:"Search Models"}),r.jsx(Un,{value:w,onChange:X=>T(X.target.value),placeholder:"Type to search (e.g., opus, sonnet, gpt-4o)...",onKeyDown:X=>{X.key==="Enter"&&ae.length>0&&(X.preventDefault(),ye(ae[0]))}}),r.jsx("div",{className:"border rounded-md max-h-48 overflow-y-auto",children:ae.length===0?r.jsx("p",{className:"text-sm text-muted-foreground p-3 text-center",children:w?`No models found for "${w}"`:"Loading models..."}):r.jsxs("div",{className:"p-1",children:[!w&&r.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1 text-xs text-muted-foreground",children:[r.jsx(ZS,{className:"w-3 h-3 text-accent"}),r.jsx("span",{children:"Newest Models"})]}),ae.map(X=>r.jsx(Tj,{model:X,onClick:()=>ye(X),showAge:!w},X.id))]})})]}),r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"space-y-1.5",children:[r.jsxs(ln,{htmlFor:"model",children:["Default Model",r.jsx(Qa,{variant:"outline",className:"ml-2 text-[10px] font-mono",children:"ANTHROPIC_MODEL"})]}),r.jsx(Un,{id:"model",...M("model"),placeholder:Q?.defaultModel??"claude-sonnet-4",className:"font-mono text-sm"})]}),r.jsxs("div",{className:"grid gap-3 pt-2 border-t",children:[r.jsxs("div",{className:"space-y-1.5",children:[r.jsxs(ln,{htmlFor:"sonnetModel",className:"text-sm",children:["Sonnet Mapping",r.jsx(Qa,{variant:"outline",className:"ml-2 text-[10px] font-mono",children:"DEFAULT_SONNET"})]}),r.jsx(Un,{id:"sonnetModel",...M("sonnetModel"),placeholder:"e.g. gpt-4o, claude-sonnet-4",className:"font-mono text-sm h-9"})]}),r.jsxs("div",{className:"space-y-1.5",children:[r.jsxs(ln,{htmlFor:"opusModel",className:"text-sm",children:["Opus Mapping",r.jsx(Qa,{variant:"outline",className:"ml-2 text-[10px] font-mono",children:"DEFAULT_OPUS"})]}),r.jsx(Un,{id:"opusModel",...M("opusModel"),placeholder:"e.g. o1, claude-opus-4.5",className:"font-mono text-sm h-9"})]}),r.jsxs("div",{className:"space-y-1.5",children:[r.jsxs(ln,{htmlFor:"haikuModel",className:"text-sm",children:["Haiku Mapping",r.jsx(Qa,{variant:"outline",className:"ml-2 text-[10px] font-mono",children:"DEFAULT_HAIKU"})]}),r.jsx(Un,{id:"haikuModel",...M("haikuModel"),placeholder:"e.g. gpt-4o-mini, claude-3.5-haiku",className:"font-mono text-sm h-9"})]})]})]})]})]}),r.jsxs(x1,{className:"p-6 pt-4 border-t bg-muted/10",children:[r.jsx(ut,{type:"button",variant:"outline",onClick:()=>a(!1),children:"Cancel"}),r.jsx(ut,{type:"submit",disabled:f.isPending,className:K(f.isPending&&"opacity-80"),children:f.isPending?r.jsxs(r.Fragment,{children:[r.jsx(Dn,{className:"w-4 h-4 mr-2 animate-spin"}),"Creating..."]}):r.jsxs(r.Fragment,{children:[r.jsx(dg,{className:"w-4 h-4 mr-2"}),"Create Profile"]})})]})]})]})]})})}function ly({preset:n,isSelected:a,onClick:s}){return r.jsxs("button",{type:"button",onClick:s,className:K("flex items-center gap-2 px-3 py-2 rounded-md border transition-all text-sm",a?n.featured?"border-accent bg-accent/10 dark:bg-accent/20 font-medium":"border-primary bg-primary/10 dark:bg-primary/20 font-medium":"border-muted-foreground/20 hover:border-muted-foreground/40 hover:bg-muted/50"),children:[n.icon?r.jsx("img",{src:n.icon,alt:"",className:"w-4 h-4"}):r.jsx("div",{className:"w-4 h-4 rounded-full bg-muted-foreground/20 flex items-center justify-center text-[9px] font-bold text-foreground/70",children:n.name.charAt(0)}),r.jsx("span",{className:"font-medium",children:n.name}),n.badge&&r.jsx(Qa,{variant:"secondary",className:"text-[10px] px-1.5 py-0 ml-0.5 bg-muted-foreground/10 text-muted-foreground",children:n.badge})]})}function Tj({model:n,onClick:a,showAge:s}){return r.jsxs("button",{type:"button",onClick:a,className:"group flex w-full items-center justify-between rounded-sm px-2 py-1.5 text-left text-sm hover:bg-accent hover:text-accent-foreground",children:[r.jsx("span",{className:"flex-1 truncate",children:n.name}),r.jsxs("span",{className:"text-muted-foreground group-hover:text-accent-foreground/80 ml-2 flex items-center gap-2 text-xs",children:[s&&n.created&&r.jsx(Qa,{variant:"outline",className:"text-[10px] text-accent group-hover:text-accent-foreground/80 group-hover:border-accent-foreground/30",children:oj(n.created)}),n.isFree?r.jsx(Qa,{variant:"secondary",className:"text-xs group-hover:bg-accent-foreground/20 group-hover:text-accent-foreground",children:"Free"}):r.jsx("span",{children:$k(n.pricing)}),r.jsx("span",{children:nj(n.context_length)})]})]})}function Mj({className:n,...a}){return r.jsx("div",{"data-slot":"card",className:K("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",n),...a})}function Dj({className:n,...a}){return r.jsx("div",{"data-slot":"card-header",className:K("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",n),...a})}function Ej({className:n,...a}){return r.jsx("div",{"data-slot":"card-title",className:K("leading-none font-semibold",n),...a})}function Oj({className:n,...a}){return r.jsx("div",{"data-slot":"card-description",className:K("text-muted-foreground text-sm",n),...a})}function Rj({className:n,...a}){return r.jsx("div",{"data-slot":"card-content",className:K("px-6",n),...a})}const Pj=["agy","claude","gemini","codex","qwen","kimi","iflow","kiro","ghcp"],YD=Pj.map(n=>({id:n,name:Xd(n),description:T1(n)})),Lj=["provider","auth","variant","success"];function VD(n){return n==="account"?1:Lj.indexOf(n)}const _j=S.forwardRef(({className:n,value:a=0,max:s=100,indicatorClassName:l,...u},f)=>{const h=Math.min(Math.max(a/s*100,0),100);return r.jsx("div",{ref:f,role:"progressbar","aria-valuemin":0,"aria-valuemax":s,"aria-valuenow":a,className:K("relative h-2 w-full overflow-hidden rounded-full bg-secondary",n),...u,children:r.jsx("div",{className:K("h-full transition-all",l||"bg-primary"),style:{width:`${h}%`}})})});_j.displayName="Progress";const zj=S.lazy(()=>gt(()=>Promise.resolve().then(()=>hf),void 0).then(n=>({default:n.CodeEditor})));function FD({rawJsonContent:n,isRawJsonValid:a,rawJsonEdits:s,onRawJsonChange:l,profileEnv:u,missingRequiredFields:f=[]}){const h=f.length>0;return r.jsx(S.Suspense,{fallback:r.jsxs("div",{className:"flex items-center justify-center h-full",children:[r.jsx(Dn,{className:"w-6 h-6 animate-spin text-muted-foreground"}),r.jsx("span",{className:"ml-2 text-muted-foreground",children:"Loading editor..."})]}),children:r.jsxs("div",{className:"h-full flex flex-col",children:[!a&&s!==null&&r.jsxs("div",{className:"mb-2 px-3 py-2 bg-destructive/10 text-destructive text-sm rounded-md flex items-center gap-2 mx-6 mt-4 shrink-0",children:[r.jsx(bo,{className:"w-4 h-4"}),"Invalid JSON syntax"]}),a&&h&&r.jsxs("div",{className:"mb-2 px-3 py-2 bg-warning/10 text-warning-foreground text-sm rounded-md flex items-start gap-2 mx-6 mt-4 shrink-0 border border-warning/20",children:[r.jsx(va,{className:"w-4 h-4 mt-0.5 text-amber-500 shrink-0"}),r.jsxs("div",{children:[r.jsx("span",{className:"font-medium text-amber-600 dark:text-amber-400",children:"Missing required fields:"})," ",r.jsx("code",{className:"text-xs bg-muted px-1 py-0.5 rounded",children:f.join(", ")}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Apply a preset from Model Config tab or add these fields manually. Without them, Claude Code will fail with 404 errors."})]})]}),r.jsx("div",{className:"flex-1 overflow-hidden px-6 pb-4 pt-4",children:r.jsx("div",{className:"h-full border rounded-md overflow-hidden bg-background",children:r.jsx(zj,{value:n,onChange:l,language:"json",minHeight:"100%"})})}),r.jsx("div",{className:"mx-6 mb-4",children:r.jsx("div",{className:"border rounded-md overflow-hidden",children:r.jsx(df,{profileEnv:u})})})]})})}var Vt={},ry;function Uj(){if(ry)return Vt;ry=1;var n=Vt&&Vt.__assign||function(){return n=Object.assign||function(O){for(var A,_=1,W=arguments.length;_<W;_++){A=arguments[_];for(var F in A)Object.prototype.hasOwnProperty.call(A,F)&&(O[F]=A[F])}return O},n.apply(this,arguments)},a=Vt&&Vt.__createBinding||(Object.create?(function(O,A,_,W){W===void 0&&(W=_);var F=Object.getOwnPropertyDescriptor(A,_);(!F||("get"in F?!A.__esModule:F.writable||F.configurable))&&(F={enumerable:!0,get:function(){return A[_]}}),Object.defineProperty(O,W,F)}):(function(O,A,_,W){W===void 0&&(W=_),O[W]=A[_]})),s=Vt&&Vt.__setModuleDefault||(Object.create?(function(O,A){Object.defineProperty(O,"default",{enumerable:!0,value:A})}):function(O,A){O.default=A}),l=Vt&&Vt.__importStar||function(O){if(O&&O.__esModule)return O;var A={};if(O!=null)for(var _ in O)_!=="default"&&Object.prototype.hasOwnProperty.call(O,_)&&a(A,O,_);return s(A,O),A},u=Vt&&Vt.__rest||function(O,A){var _={};for(var W in O)Object.prototype.hasOwnProperty.call(O,W)&&A.indexOf(W)<0&&(_[W]=O[W]);if(O!=null&&typeof Object.getOwnPropertySymbols=="function")for(var F=0,W=Object.getOwnPropertySymbols(O);F<W.length;F++)A.indexOf(W[F])<0&&Object.prototype.propertyIsEnumerable.call(O,W[F])&&(_[W[F]]=O[W[F]]);return _};Object.defineProperty(Vt,"__esModule",{value:!0});var f=l(Td()),h=89,m=90,p=77,y=57,C=219,x=222,b=192,N=100,w=3e3,T=typeof window<"u"&&"navigator"in window&&/Win/i.test(navigator.platform),E=typeof window<"u"&&"navigator"in window&&/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform),M="npm__react-simple-code-editor__textarea",H=`
15
- /**
16
- * Reset the text fill color so that placeholder is visible
17
- */
18
- .`.concat(M,`:empty {
19
- -webkit-text-fill-color: inherit !important;
20
- }
21
-
22
- /**
23
- * Hack to apply on some CSS on IE10 and IE11
24
- */
25
- @media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
26
- /**
27
- * IE doesn't support '-webkit-text-fill-color'
28
- * So we use 'color: transparent' to make the text transparent on IE
29
- * Unlike other browsers, it doesn't affect caret color in IE
30
- */
31
- .`).concat(M,` {
32
- color: transparent !important;
33
- }
34
-
35
- .`).concat(M,`::selection {
36
- background-color: #accef7 !important;
37
- color: transparent !important;
38
- }
39
- }
40
- `),B=f.forwardRef(function(A,_){var W=A.autoFocus,F=A.disabled,Q=A.form,ae=A.highlight,te=A.ignoreTabKey,ye=te===void 0?!1:te,de=A.insertSpaces,Ce=de===void 0?!0:de,R=A.maxLength,$=A.minLength,ee=A.name,X=A.onBlur,se=A.onClick,fe=A.onFocus,Ne=A.onKeyDown,V=A.onKeyUp,J=A.onValueChange,le=A.padding,ne=le===void 0?0:le,oe=A.placeholder,xe=A.preClassName,Pe=A.readOnly,qe=A.required,St=A.style,Ct=A.tabSize,Ye=Ct===void 0?2:Ct,nt=A.textareaClassName,Ut=A.textareaId,Qt=A.value,Gn=u(A,["autoFocus","disabled","form","highlight","ignoreTabKey","insertSpaces","maxLength","minLength","name","onBlur","onClick","onFocus","onKeyDown","onKeyUp","onValueChange","padding","placeholder","preClassName","readOnly","required","style","tabSize","textareaClassName","textareaId","value"]),je=f.useRef({stack:[],offset:-1}),$t=f.useRef(null),En=f.useState(!0),Wt=En[0],Sa=En[1],Yn={paddingTop:typeof ne=="object"?ne.top:ne,paddingRight:typeof ne=="object"?ne.right:ne,paddingBottom:typeof ne=="object"?ne.bottom:ne,paddingLeft:typeof ne=="object"?ne.left:ne},ft=ae(Qt),Xt=function(Z,De){return Z.substring(0,De).split(`
41
- `)},Vn=f.useCallback(function(Z,De){var ve,Ee,at;De===void 0&&(De=!1);var he=je.current,ke=he.stack,be=he.offset;if(ke.length&&be>-1){je.current.stack=ke.slice(0,be+1);var Oe=je.current.stack.length;if(Oe>N){var Je=Oe-N;je.current.stack=ke.slice(Je,Oe),je.current.offset=Math.max(je.current.offset-Je,0)}}var we=Date.now();if(De){var Pt=je.current.stack[je.current.offset];if(Pt&&we-Pt.timestamp<w){var Qn=/[^a-z0-9]([a-z0-9]+)$/i,Nt=(ve=Xt(Pt.value,Pt.selectionStart).pop())===null||ve===void 0?void 0:ve.match(Qn),Zt=(Ee=Xt(Z.value,Z.selectionStart).pop())===null||Ee===void 0?void 0:Ee.match(Qn);if(Nt?.[1]&&(!((at=Zt?.[1])===null||at===void 0)&&at.startsWith(Nt[1]))){je.current.stack[je.current.offset]=n(n({},Z),{timestamp:we});return}}}je.current.stack.push(n(n({},Z),{timestamp:we})),je.current.offset++},[]),Ja=f.useCallback(function(){var Z=$t.current;if(Z){var De=Z.value,ve=Z.selectionStart,Ee=Z.selectionEnd;Vn({value:De,selectionStart:ve,selectionEnd:Ee})}},[Vn]),On=function(Z){var De=$t.current;De&&(De.value=Z.value,De.selectionStart=Z.selectionStart,De.selectionEnd=Z.selectionEnd,J?.(Z.value))},Rn=function(Z){var De=$t.current,ve=je.current.stack[je.current.offset];ve&&De&&(je.current.stack[je.current.offset]=n(n({},ve),{selectionStart:De.selectionStart,selectionEnd:De.selectionEnd})),Vn(Z),On(Z)},ji=function(){var Z=je.current,De=Z.stack,ve=Z.offset,Ee=De[ve-1];Ee&&(On(Ee),je.current.offset=Math.max(ve-1,0))},wo=function(){var Z=je.current,De=Z.stack,ve=Z.offset,Ee=De[ve+1];Ee&&(On(Ee),je.current.offset=Math.min(ve+1,De.length-1))},No=function(Z){if(!(Ne&&(Ne(Z),Z.defaultPrevented))){Z.key==="Escape"&&Z.currentTarget.blur();var De=Z.currentTarget,ve=De.value,Ee=De.selectionStart,at=De.selectionEnd,he=(Ce?" ":" ").repeat(Ye);if(Z.key==="Tab"&&!ye&&Wt)if(Z.preventDefault(),Z.shiftKey){var ke=Xt(ve,Ee),be=ke.length-1,Oe=Xt(ve,at).length-1,Je=ve.split(`
42
- `).map(function($n,Ti){return Ti>=be&&Ti<=Oe&&$n.startsWith(he)?$n.substring(he.length):$n}).join(`
43
- `);if(ve!==Je){var we=ke[be];Rn({value:Je,selectionStart:we?.startsWith(he)?Ee-he.length:Ee,selectionEnd:at-(ve.length-Je.length)})}}else if(Ee!==at){var ke=Xt(ve,Ee),Pt=ke.length-1,Qn=Xt(ve,at).length-1,we=ke[Pt];Rn({value:ve.split(`
44
- `).map(function(jo,To){return To>=Pt&&To<=Qn?he+jo:jo}).join(`
45
- `),selectionStart:we&&/\S/.test(we)?Ee+he.length:Ee,selectionEnd:at+he.length*(Qn-Pt+1)})}else{var Nt=Ee+he.length;Rn({value:ve.substring(0,Ee)+he+ve.substring(at),selectionStart:Nt,selectionEnd:Nt})}else if(Z.key==="Backspace"){var Zt=Ee!==at,wn=ve.substring(0,Ee);if(wn.endsWith(he)&&!Zt){Z.preventDefault();var Nt=Ee-he.length;Rn({value:ve.substring(0,Ee-he.length)+ve.substring(at),selectionStart:Nt,selectionEnd:Nt})}}else if(Z.key==="Enter"){if(Ee===at){var Ao=Xt(ve,Ee).pop(),ei=Ao?.match(/^\s+/);if(ei?.[0]){Z.preventDefault();var ko=`
46
- `+ei[0],Nt=Ee+ko.length;Rn({value:ve.substring(0,Ee)+ko+ve.substring(at),selectionStart:Nt,selectionEnd:Nt})}}}else if(Z.keyCode===y||Z.keyCode===C||Z.keyCode===x||Z.keyCode===b){var dn=void 0;Z.keyCode===y&&Z.shiftKey?dn=["(",")"]:Z.keyCode===C?Z.shiftKey?dn=["{","}"]:dn=["[","]"]:Z.keyCode===x?Z.shiftKey?dn=['"','"']:dn=["'","'"]:Z.keyCode===b&&!Z.shiftKey&&(dn=["`","`"]),Ee!==at&&dn&&(Z.preventDefault(),Rn({value:ve.substring(0,Ee)+dn[0]+ve.substring(Ee,at)+dn[1]+ve.substring(at),selectionStart:Ee,selectionEnd:at+2}))}else(E?Z.metaKey&&Z.keyCode===m:Z.ctrlKey&&Z.keyCode===m)&&!Z.shiftKey&&!Z.altKey?(Z.preventDefault(),ji()):(E?Z.metaKey&&Z.keyCode===m&&Z.shiftKey:T?Z.ctrlKey&&Z.keyCode===h:Z.ctrlKey&&Z.keyCode===m&&Z.shiftKey)&&!Z.altKey?(Z.preventDefault(),wo()):Z.keyCode===p&&Z.ctrlKey&&(!E||Z.shiftKey)&&(Z.preventDefault(),Sa(function($n){return!$n}))}},Fn=function(Z){var De=Z.currentTarget,ve=De.value,Ee=De.selectionStart,at=De.selectionEnd;Vn({value:ve,selectionStart:Ee,selectionEnd:at},!0),J(ve)};return f.useEffect(function(){Ja()},[Ja]),f.useImperativeHandle(_,function(){return{get session(){return{history:je.current}},set session(Z){je.current=Z.history}}},[]),f.createElement("div",n({},Gn,{style:n(n({},U.container),St)}),f.createElement("pre",n({className:xe,"aria-hidden":"true",style:n(n(n({},U.editor),U.highlight),Yn)},typeof ft=="string"?{dangerouslySetInnerHTML:{__html:ft+"<br />"}}:{children:ft})),f.createElement("textarea",{ref:function(Z){return $t.current=Z},style:n(n(n({},U.editor),U.textarea),Yn),className:M+(nt?" ".concat(nt):""),id:Ut,value:Qt,onChange:Fn,onKeyDown:No,onClick:se,onKeyUp:V,onFocus:fe,onBlur:X,disabled:F,form:Q,maxLength:R,minLength:$,name:ee,placeholder:oe,readOnly:Pe,required:qe,autoFocus:W,autoCapitalize:"off",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"data-gramm":!1}),f.createElement("style",{dangerouslySetInnerHTML:{__html:H}}))}),U={container:{position:"relative",textAlign:"left",boxSizing:"border-box",padding:0,overflow:"hidden"},textarea:{position:"absolute",top:0,left:0,height:"100%",width:"100%",resize:"none",color:"inherit",overflow:"hidden",MozOsxFontSmoothing:"grayscale",WebkitFontSmoothing:"antialiased",WebkitTextFillColor:"transparent"},highlight:{position:"relative",pointerEvents:"none"},editor:{margin:0,border:0,background:"none",boxSizing:"inherit",display:"inherit",fontFamily:"inherit",fontSize:"inherit",fontStyle:"inherit",fontVariantLigatures:"inherit",fontWeight:"inherit",letterSpacing:"inherit",lineHeight:"inherit",tabSize:"inherit",textIndent:"inherit",textRendering:"inherit",textTransform:"inherit",whiteSpace:"pre-wrap",wordBreak:"keep-all",overflowWrap:"break-word"}};return Vt.default=B,Vt}var Ij=Uj();const Hj=xS(Ij),Bj=[/^ANTHROPIC_AUTH_TOKEN$/,/_API_KEY$/,/_AUTH_TOKEN$/,/_SECRET$/,/_SECRET_KEY$/,/^API_KEY$/,/^AUTH_TOKEN$/,/^SECRET$/,/_PASSWORD$/,/^PASSWORD$/,/_CREDENTIAL$/,/_PRIVATE_KEY$/];function Kj(n){return Bj.some(a=>a.test(n))}function qj(n){if(!n.trim())return{valid:!0};try{return JSON.parse(n),{valid:!0}}catch(a){const l=a.message,u=l.match(/position (\d+)/);if(u){const f=parseInt(u[1],10),h=n.substring(0,f).split(`
47
- `);return{valid:!1,error:l,line:h.length}}return{valid:!1,error:l}}}function av({value:n,onChange:a,language:s="json",readonly:l=!1,className:u,minHeight:f="300px"}){const{isDark:h}=gx(),[m,p]=S.useState(!1),[y,C]=S.useState(!0),x=S.useMemo(()=>s==="json"?qj(n):{valid:!0},[n,s]),b=S.useCallback(N=>r.jsx(qC,{theme:h?gg.nightOwl:gg.github,code:N,language:s,children:({tokens:w,getLineProps:T,getTokenProps:E})=>{let M=!1;return r.jsx(r.Fragment,{children:w.map((H,B)=>r.jsx("div",{...T({line:H}),className:K(x.line===B+1&&"bg-destructive/20"),children:H.map((U,O)=>{let A=!1;if(U.types.includes("property")){const W=U.content.replace(/['"]/g,"");Kj(W)?M=!0:M=!1}else(U.types.includes("string")||U.types.includes("number")||U.types.includes("boolean"))&&M?(A=!0,M=!1):U.types.includes("punctuation")&&U.content!==":"&&U.content!=="["&&U.content!=="{"&&(M=!1);const _=E({token:U});return A&&y&&(_.className=K(_.className,"blur-[3px] select-none opacity-70 transition-all duration-200")),r.jsx("span",{..._},O)})},B))})}}),[h,s,x.line,y]);return r.jsxs("div",{className:K("flex flex-col",u),children:[r.jsxs("div",{className:K("relative rounded-md border overflow-hidden","bg-muted/30",m&&"ring-2 ring-ring ring-offset-2 ring-offset-background",l&&"opacity-70 cursor-not-allowed",!x.valid&&"border-destructive"),style:{minHeight:f},children:[r.jsx(Hj,{value:n,onValueChange:l?()=>{}:a,highlight:b,padding:12,disabled:l,onFocus:()=>p(!0),onBlur:()=>p(!1),textareaClassName:K("focus:outline-none font-mono text-sm",l&&"cursor-not-allowed"),preClassName:"font-mono text-sm",style:{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace",fontSize:"0.875rem",minHeight:f}},h?"dark-editor":"light-editor"),r.jsx("div",{className:"absolute top-2 right-2 z-10 opacity-50 hover:opacity-100 transition-opacity",children:r.jsx(ut,{variant:"ghost",size:"icon",className:"h-6 w-6 bg-background/50 hover:bg-background border shadow-sm rounded-full",onClick:()=>C(!y),title:y?"Reveal sensitive values":"Mask sensitive values",children:y?r.jsx(vr,{className:"h-3 w-3"}):r.jsx(xr,{className:"h-3 w-3"})})})]}),r.jsxs("div",{className:"flex items-center gap-2 mt-2 text-xs",children:[x.valid?r.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground",children:[r.jsx(Sr,{className:"w-3 h-3 text-green-500"}),"Valid ",s.toUpperCase()]}):r.jsxs("span",{className:"flex items-center gap-1 text-destructive",children:[r.jsx(Pd,{className:"w-3 h-3"}),x.error,x.line&&` (line ${x.line})`]}),l&&r.jsx("span",{className:"ml-auto text-muted-foreground",children:"(Read-only)"})]})]})}const hf=Object.freeze(Object.defineProperty({__proto__:null,CodeEditor:av},Symbol.toStringTag,{value:"Module"})),Gj={webSearchConfig:null,webSearchStatus:null,webSearchLoading:!0,webSearchStatusLoading:!0,webSearchSaving:!1,webSearchError:null,webSearchSuccess:!1,globalEnvConfig:null,globalEnvLoading:!0,globalEnvSaving:!1,globalEnvError:null,globalEnvSuccess:!1,proxyConfig:null,proxyLoading:!0,proxySaving:!1,proxyError:null,proxySuccess:!1,proxyTestResult:null,proxyTesting:!1,rawConfig:null,rawConfigLoading:!1};function Yj(n,a){switch(a.type){case"SET_WEBSEARCH_CONFIG":return{...n,webSearchConfig:a.payload};case"SET_WEBSEARCH_STATUS":return{...n,webSearchStatus:a.payload};case"SET_WEBSEARCH_LOADING":return{...n,webSearchLoading:a.payload};case"SET_WEBSEARCH_STATUS_LOADING":return{...n,webSearchStatusLoading:a.payload};case"SET_WEBSEARCH_SAVING":return{...n,webSearchSaving:a.payload};case"SET_WEBSEARCH_ERROR":return{...n,webSearchError:a.payload};case"SET_WEBSEARCH_SUCCESS":return{...n,webSearchSuccess:a.payload};case"SET_GLOBALENV_CONFIG":return{...n,globalEnvConfig:a.payload};case"SET_GLOBALENV_LOADING":return{...n,globalEnvLoading:a.payload};case"SET_GLOBALENV_SAVING":return{...n,globalEnvSaving:a.payload};case"SET_GLOBALENV_ERROR":return{...n,globalEnvError:a.payload};case"SET_GLOBALENV_SUCCESS":return{...n,globalEnvSuccess:a.payload};case"SET_PROXY_CONFIG":return{...n,proxyConfig:a.payload};case"SET_PROXY_LOADING":return{...n,proxyLoading:a.payload};case"SET_PROXY_SAVING":return{...n,proxySaving:a.payload};case"SET_PROXY_ERROR":return{...n,proxyError:a.payload};case"SET_PROXY_SUCCESS":return{...n,proxySuccess:a.payload};case"SET_PROXY_TEST_RESULT":return{...n,proxyTestResult:a.payload};case"SET_PROXY_TESTING":return{...n,proxyTesting:a.payload};case"SET_RAW_CONFIG":return{...n,rawConfig:a.payload};case"SET_RAW_CONFIG_LOADING":return{...n,rawConfigLoading:a.payload};default:return n}}const iv=S.createContext(null);function Vj({children:n}){const[a,s]=S.useReducer(Yj,Gj);return r.jsx(iv.Provider,{value:{state:a,dispatch:s},children:n})}function ov(){const n=S.useContext(iv);if(!n)throw new Error("useSettingsContext must be used within a SettingsProvider");return n}function Fj(){const{dispatch:n}=ov(),a=S.useCallback(A=>n({type:"SET_WEBSEARCH_CONFIG",payload:A}),[n]),s=S.useCallback(A=>n({type:"SET_WEBSEARCH_STATUS",payload:A}),[n]),l=S.useCallback(A=>n({type:"SET_WEBSEARCH_LOADING",payload:A}),[n]),u=S.useCallback(A=>n({type:"SET_WEBSEARCH_STATUS_LOADING",payload:A}),[n]),f=S.useCallback(A=>n({type:"SET_WEBSEARCH_SAVING",payload:A}),[n]),h=S.useCallback(A=>n({type:"SET_WEBSEARCH_ERROR",payload:A}),[n]),m=S.useCallback(A=>n({type:"SET_WEBSEARCH_SUCCESS",payload:A}),[n]),p=S.useCallback(A=>n({type:"SET_GLOBALENV_CONFIG",payload:A}),[n]),y=S.useCallback(A=>n({type:"SET_GLOBALENV_LOADING",payload:A}),[n]),C=S.useCallback(A=>n({type:"SET_GLOBALENV_SAVING",payload:A}),[n]),x=S.useCallback(A=>n({type:"SET_GLOBALENV_ERROR",payload:A}),[n]),b=S.useCallback(A=>n({type:"SET_GLOBALENV_SUCCESS",payload:A}),[n]),N=S.useCallback(A=>n({type:"SET_PROXY_CONFIG",payload:A}),[n]),w=S.useCallback(A=>n({type:"SET_PROXY_LOADING",payload:A}),[n]),T=S.useCallback(A=>n({type:"SET_PROXY_SAVING",payload:A}),[n]),E=S.useCallback(A=>n({type:"SET_PROXY_ERROR",payload:A}),[n]),M=S.useCallback(A=>n({type:"SET_PROXY_SUCCESS",payload:A}),[n]),H=S.useCallback(A=>n({type:"SET_PROXY_TEST_RESULT",payload:A}),[n]),B=S.useCallback(A=>n({type:"SET_PROXY_TESTING",payload:A}),[n]),U=S.useCallback(A=>n({type:"SET_RAW_CONFIG",payload:A}),[n]),O=S.useCallback(A=>n({type:"SET_RAW_CONFIG_LOADING",payload:A}),[n]);return S.useMemo(()=>({setWebSearchConfig:a,setWebSearchStatus:s,setWebSearchLoading:l,setWebSearchStatusLoading:u,setWebSearchSaving:f,setWebSearchError:h,setWebSearchSuccess:m,setGlobalEnvConfig:p,setGlobalEnvLoading:y,setGlobalEnvSaving:C,setGlobalEnvError:x,setGlobalEnvSuccess:b,setProxyConfig:N,setProxyLoading:w,setProxySaving:T,setProxyError:E,setProxySuccess:M,setProxyTestResult:H,setProxyTesting:B,setRawConfig:U,setRawConfigLoading:O}),[a,s,l,u,f,h,m,p,y,C,x,b,N,w,T,E,M,H,B,U,O])}function Qj(){const[n,a]=vS(),s=n.get("tab")?.toLowerCase(),l=s==="globalenv"?"globalenv":s==="proxy"?"proxy":s==="auth"?"auth":s==="thinking"?"thinking":s==="backups"?"backups":"websearch",u=S.useCallback(f=>{a({tab:f},{replace:!0})},[a]);return{activeTab:l,setActiveTab:u}}function $j(){const{state:n}=ov(),a=Fj(),[s,l]=S.useState(!1),u=S.useCallback(async()=>{try{a.setRawConfigLoading(!0);const h=await fetch("/api/config/raw");if(!h.ok){a.setRawConfig(null);return}const m=await h.text();a.setRawConfig(m)}catch{a.setRawConfig(null)}finally{a.setRawConfigLoading(!1)}},[a]),f=S.useCallback(async()=>{if(n.rawConfig)try{await navigator.clipboard.writeText(n.rawConfig),l(!0),setTimeout(()=>l(!1),2e3)}catch{}},[n.rawConfig]);return{rawConfig:n.rawConfig,loading:n.rawConfigLoading,copied:s,fetchRawConfig:u,copyToClipboard:f}}function cy({activeTab:n,onTabChange:a}){const{t:s}=_t(),l=[{value:"websearch",label:s("settingsTabs.web"),icon:Xy},{value:"globalenv",label:s("settingsTabs.env"),icon:Rd},{value:"thinking",label:s("settingsTabs.think"),icon:JS},{value:"proxy",label:s("settingsTabs.proxy"),icon:eC},{value:"auth",label:s("settingsTabs.auth"),icon:Dd},{value:"backups",label:s("settingsTabs.backup"),icon:tC}];return r.jsx($x,{value:n,onValueChange:u=>a(u),children:r.jsx(cf,{className:"grid w-full grid-cols-6",children:l.map(({value:u,label:f,icon:h})=>r.jsxs(mr,{value:u,className:"gap-1.5 px-1 text-xs",children:[r.jsx(h,{className:"h-3.5 w-3.5 shrink-0"}),r.jsx("span",{className:"truncate",children:f})]},u))})})}function uy(){return r.jsxs("div",{className:"flex-1 p-5 space-y-6",children:[r.jsx(Ke,{className:"h-4 w-2/3"}),r.jsx("div",{className:"p-4 rounded-lg border",children:r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(Ke,{className:"h-5 w-32"}),r.jsx(Ke,{className:"h-4 w-48"})]}),r.jsx(Ke,{className:"h-6 w-10 rounded-full"})]})}),r.jsxs("div",{className:"space-y-3",children:[r.jsx(Ke,{className:"h-5 w-24"}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Ke,{className:"h-20 w-full rounded-lg"}),r.jsx(Ke,{className:"h-20 w-full rounded-lg"}),r.jsx(Ke,{className:"h-20 w-full rounded-lg"})]})]})]})}function sv(n,a=3,s=1e3){return n().catch(l=>{if(a<=0)throw l;return new Promise(u=>setTimeout(u,s)).then(()=>sv(n,a-1,s*2))})}function Co(n){return S.lazy(()=>sv(n))}const dy=Co(()=>gt(()=>import("./index-BfTpnChw.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]))),fy=Co(()=>gt(()=>import("./globalenv-section-hiOP8-EO.js"),__vite__mapDeps([10,1,2,3,4,5,6,7,8,9]))),hy=Co(()=>gt(()=>import("./index-7UOuuXPH.js"),__vite__mapDeps([11,1,2,3,4,5,6,7,8,9]))),my=Co(()=>gt(()=>import("./index-CWdqGG3Z.js"),__vite__mapDeps([12,1,2,3,13,4,14,15,5,6,7,8,9]))),py=Co(()=>gt(()=>import("./auth-section-DCxO2_eL.js"),__vite__mapDeps([16,1,2,4,5,6,7,8,9]))),gy=Co(()=>gt(()=>import("./backups-section-EE1TN60x.js"),__vite__mapDeps([17,1,2,15,4,5,6,7,8,9])));class yy extends S.Component{constructor(a){super(a),this.state={hasError:!1,error:null}}static getDerivedStateFromError(a){return{hasError:!0,error:a}}render(){return this.state.hasError?r.jsx("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:r.jsxs("div",{className:"text-center p-6 max-w-md",children:[r.jsx(Pd,{className:"w-12 h-12 mx-auto mb-4 text-destructive"}),r.jsx("p",{className:"font-medium text-foreground mb-2",children:ct.t("settings.sectionLoadFailed")}),r.jsx("p",{className:"text-sm mb-4",children:this.state.error?.message||ct.t("settings.unknownError")}),r.jsxs(ut,{variant:"outline",onClick:()=>window.location.reload(),className:"inline-flex items-center gap-2",children:[r.jsx(Es,{className:"w-4 h-4"}),ct.t("settings.reloadPage")]})]})}):this.props.children}}function Wj(){const{t:n}=_t(),{activeTab:a,setActiveTab:s}=Qj(),{rawConfig:l,loading:u,copied:f,fetchRawConfig:h,copyToClipboard:m}=$j();S.useEffect(()=>{h()},[h]);const p=y=>{S.startTransition(()=>{s(y)})};return r.jsxs("div",{className:"h-[calc(100vh-100px)]",children:[r.jsxs("div",{className:"md:hidden h-full flex flex-col",children:[r.jsx("div",{className:"border-b bg-background p-4",children:r.jsx(cy,{activeTab:a,onTabChange:p})}),r.jsx(yy,{children:r.jsxs(S.Suspense,{fallback:r.jsx(uy,{}),children:[a==="websearch"&&r.jsx(dy,{}),a==="globalenv"&&r.jsx(fy,{}),a==="thinking"&&r.jsx(hy,{}),a==="proxy"&&r.jsx(my,{}),a==="auth"&&r.jsx(py,{}),a==="backups"&&r.jsx(gy,{})]})})]}),r.jsxs(of,{direction:"horizontal",className:"h-full hidden md:flex",children:[r.jsx(Ps,{defaultSize:40,minSize:30,maxSize:55,children:r.jsxs("div",{className:"h-full border-r flex flex-col bg-muted/30 relative",children:[r.jsx("div",{className:"p-5 border-b bg-background",children:r.jsx(cy,{activeTab:a,onTabChange:p})}),r.jsx(yy,{children:r.jsxs(S.Suspense,{fallback:r.jsx(uy,{}),children:[a==="websearch"&&r.jsx(dy,{}),a==="globalenv"&&r.jsx(fy,{}),a==="thinking"&&r.jsx(hy,{}),a==="proxy"&&r.jsx(my,{}),a==="auth"&&r.jsx(py,{}),a==="backups"&&r.jsx(gy,{})]})})]})}),r.jsx(sf,{className:"w-2 bg-border hover:bg-primary/20 transition-colors cursor-col-resize flex items-center justify-center group",children:r.jsx(Cr,{className:"w-3 h-3 text-muted-foreground group-hover:text-primary"})}),r.jsx(Ps,{defaultSize:60,minSize:35,children:r.jsxs("div",{className:"h-full flex flex-col",children:[r.jsxs("div",{className:"p-4 border-b bg-background flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx(fg,{className:"w-5 h-5 text-primary"}),r.jsxs("div",{children:[r.jsx("h2",{className:"font-semibold",children:"config.yaml"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"~/.ccs/config.yaml"})]})]}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx(ut,{variant:"outline",size:"sm",onClick:m,disabled:!l,children:f?r.jsxs(r.Fragment,{children:[r.jsx(xo,{className:"w-4 h-4 mr-1"}),n("settings.copied")]}):r.jsxs(r.Fragment,{children:[r.jsx(lr,{className:"w-4 h-4 mr-1"}),n("settings.copy")]})}),r.jsx(ut,{variant:"outline",size:"sm",onClick:h,disabled:u,children:r.jsx(Es,{className:`w-4 h-4 ${u?"animate-spin":""}`})})]})]}),r.jsx("div",{className:"flex-1 overflow-auto",children:u?r.jsxs("div",{className:"flex items-center justify-center h-full text-muted-foreground",children:[r.jsx(Es,{className:"w-5 h-5 animate-spin mr-2"}),n("settings.loading")]}):l?r.jsx(av,{value:l,onChange:()=>{},language:"yaml",readonly:!0,minHeight:"auto",className:"min-h-full"}):r.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground",children:r.jsxs("div",{className:"text-center",children:[r.jsx(fg,{className:"w-12 h-12 mx-auto mb-3 opacity-30"}),r.jsx("p",{children:n("settings.configFileNotFound")}),r.jsx("code",{className:"text-sm bg-muted px-2 py-1 rounded mt-2 inline-block",children:"ccs migrate"})]})})})]})})]})]})}function Xj(){return r.jsx(Vj,{children:r.jsx(Wj,{})})}const Zj=Object.freeze(Object.defineProperty({__proto__:null,SettingsPage:Xj},Symbol.toStringTag,{value:"Module"})),QD=fS,$D=mS,WD=hS,Jj=S.forwardRef(({className:n,align:a="center",sideOffset:s=4,...l},u)=>r.jsx(dS,{children:r.jsx(Gy,{ref:u,align:a,sideOffset:s,className:K("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n),...l})}));Jj.displayName=Gy.displayName;function eT(n,a,s="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:n,timeZoneName:s}).format(a).split(/\s/g).slice(2).join(" ")}const tT={},ks={};function Si(n,a){try{const l=(tT[n]||=new Intl.DateTimeFormat("en-US",{timeZone:n,timeZoneName:"longOffset"}).format)(a).split("GMT")[1];return l in ks?ks[l]:xy(l,l.split(":"))}catch{if(n in ks)return ks[n];const s=n?.match(nT);return s?xy(n,s.slice(1)):NaN}}const nT=/([+-]\d\d):?(\d\d)?/;function xy(n,a){const s=+(a[0]||0),l=+(a[1]||0),u=+(a[2]||0)/60;return ks[n]=s*60+l>0?s*60+l+u:s*60-l-u}class Bn extends Date{constructor(...a){super(),a.length>1&&typeof a[a.length-1]=="string"&&(this.timeZone=a.pop()),this.internal=new Date,isNaN(Si(this.timeZone,this))?this.setTime(NaN):a.length?typeof a[0]=="number"&&(a.length===1||a.length===2&&typeof a[1]!="number")?this.setTime(a[0]):typeof a[0]=="string"?this.setTime(+new Date(a[0])):a[0]instanceof Date?this.setTime(+a[0]):(this.setTime(+new Date(...a)),lv(this),jd(this)):this.setTime(Date.now())}static tz(a,...s){return s.length?new Bn(...s,a):new Bn(Date.now(),a)}withTimeZone(a){return new Bn(+this,a)}getTimezoneOffset(){const a=-Si(this.timeZone,this);return a>0?Math.floor(a):Math.ceil(a)}setTime(a){return Date.prototype.setTime.apply(this,arguments),jd(this),+this}[Symbol.for("constructDateFrom")](a){return new Bn(+new Date(a),this.timeZone)}}const vy=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(n=>{if(!vy.test(n))return;const a=n.replace(vy,"$1UTC");Bn.prototype[a]&&(n.startsWith("get")?Bn.prototype[n]=function(){return this.internal[a]()}:(Bn.prototype[n]=function(){return Date.prototype[a].apply(this.internal,arguments),aT(this),+this},Bn.prototype[a]=function(){return Date.prototype[a].apply(this,arguments),jd(this),+this}))});function jd(n){n.internal.setTime(+n),n.internal.setUTCSeconds(n.internal.getUTCSeconds()-Math.round(-Si(n.timeZone,n)*60))}function aT(n){Date.prototype.setFullYear.call(n,n.internal.getUTCFullYear(),n.internal.getUTCMonth(),n.internal.getUTCDate()),Date.prototype.setHours.call(n,n.internal.getUTCHours(),n.internal.getUTCMinutes(),n.internal.getUTCSeconds(),n.internal.getUTCMilliseconds()),lv(n)}function lv(n){const a=Si(n.timeZone,n),s=a>0?Math.floor(a):Math.ceil(a),l=new Date(+n);l.setUTCHours(l.getUTCHours()-1);const u=-new Date(+n).getTimezoneOffset(),f=-new Date(+l).getTimezoneOffset(),h=u-f,m=Date.prototype.getHours.apply(n)!==n.internal.getUTCHours();h&&m&&n.internal.setUTCMinutes(n.internal.getUTCMinutes()+h);const p=u-s;p&&Date.prototype.setUTCMinutes.call(n,Date.prototype.getUTCMinutes.call(n)+p);const y=new Date(+n);y.setUTCSeconds(0);const C=u>0?y.getSeconds():(y.getSeconds()-60)%60,x=Math.round(-(Si(n.timeZone,n)*60))%60;(x||C)&&(n.internal.setUTCSeconds(n.internal.getUTCSeconds()+x),Date.prototype.setUTCSeconds.call(n,Date.prototype.getUTCSeconds.call(n)+x+C));const b=Si(n.timeZone,n),N=b>0?Math.floor(b):Math.ceil(b),T=-new Date(+n).getTimezoneOffset()-N,E=N!==s,M=T-p;if(E&&M){Date.prototype.setUTCMinutes.call(n,Date.prototype.getUTCMinutes.call(n)+M);const H=Si(n.timeZone,n),B=H>0?Math.floor(H):Math.ceil(H),U=N-B;U&&(n.internal.setUTCMinutes(n.internal.getUTCMinutes()+U),Date.prototype.setUTCMinutes.call(n,Date.prototype.getUTCMinutes.call(n)+U))}}class ga extends Bn{static tz(a,...s){return s.length?new ga(...s,a):new ga(Date.now(),a)}toISOString(){const[a,s,l]=this.tzComponents(),u=`${a}${s}:${l}`;return this.internal.toISOString().slice(0,-1)+u}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[a,s,l,u]=this.internal.toUTCString().split(" ");return`${a?.slice(0,-1)} ${l} ${s} ${u}`}toTimeString(){const a=this.internal.toUTCString().split(" ")[4],[s,l,u]=this.tzComponents();return`${a} GMT${s}${l}${u} (${eT(this.timeZone,this)})`}toLocaleString(a,s){return Date.prototype.toLocaleString.call(this,a,{...s,timeZone:s?.timeZone||this.timeZone})}toLocaleDateString(a,s){return Date.prototype.toLocaleDateString.call(this,a,{...s,timeZone:s?.timeZone||this.timeZone})}toLocaleTimeString(a,s){return Date.prototype.toLocaleTimeString.call(this,a,{...s,timeZone:s?.timeZone||this.timeZone})}tzComponents(){const a=this.getTimezoneOffset(),s=a>0?"-":"+",l=String(Math.floor(Math.abs(a)/60)).padStart(2,"0"),u=String(Math.abs(a)%60).padStart(2,"0");return[s,l,u]}withTimeZone(a){return new ga(+this,a)}[Symbol.for("constructDateFrom")](a){return new ga(+new Date(a),this.timeZone)}}const by=5,iT=4;function oT(n,a){const s=a.startOfMonth(n),l=s.getDay()>0?s.getDay():7,u=a.addDays(n,-l+1),f=a.addDays(u,by*7-1);return a.getMonth(n)===a.getMonth(f)?by:iT}function rv(n,a){const s=a.startOfMonth(n),l=s.getDay();return l===1?s:l===0?a.addDays(s,-6):a.addDays(s,-1*(l-1))}function sT(n,a){const s=rv(n,a),l=oT(n,a);return a.addDays(s,l*7-1)}const cv={...xs,labels:{labelDayButton:(n,a,s,l)=>{let u;l&&typeof l.format=="function"?u=l.format.bind(l):u=(h,m)=>Cs(h,m,{locale:xs,...s});let f=u(n,"PPPP");return a.today&&(f=`Today, ${f}`),a.selected&&(f=`${f}, selected`),f},labelMonthDropdown:"Choose the Month",labelNext:"Go to the Next Month",labelPrevious:"Go to the Previous Month",labelWeekNumber:n=>`Week ${n}`,labelYearDropdown:"Choose the Year",labelGrid:(n,a,s)=>{let l;return s&&typeof s.format=="function"?l=s.format.bind(s):l=(u,f)=>Cs(u,f,{locale:xs,...a}),l(n,"LLLL yyyy")},labelGridcell:(n,a,s,l)=>{let u;l&&typeof l.format=="function"?u=l.format.bind(l):u=(h,m)=>Cs(h,m,{locale:xs,...s});let f=u(n,"PPPP");return a?.today&&(f=`Today, ${f}`),f},labelNav:"Navigation bar",labelWeekNumberHeader:"Week Number",labelWeekday:(n,a,s)=>{let l;return s&&typeof s.format=="function"?l=s.format.bind(s):l=(u,f)=>Cs(u,f,{locale:xs,...a}),l(n,"cccc")}}};class un{constructor(a,s){this.Date=Date,this.today=()=>this.overrides?.today?this.overrides.today():this.options.timeZone?ga.tz(this.options.timeZone):new this.Date,this.newDate=(l,u,f)=>this.overrides?.newDate?this.overrides.newDate(l,u,f):this.options.timeZone?new ga(l,u,f,this.options.timeZone):new Date(l,u,f),this.addDays=(l,u)=>this.overrides?.addDays?this.overrides.addDays(l,u):sC(l,u),this.addMonths=(l,u)=>this.overrides?.addMonths?this.overrides.addMonths(l,u):lC(l,u),this.addWeeks=(l,u)=>this.overrides?.addWeeks?this.overrides.addWeeks(l,u):rC(l,u),this.addYears=(l,u)=>this.overrides?.addYears?this.overrides.addYears(l,u):cC(l,u),this.differenceInCalendarDays=(l,u)=>this.overrides?.differenceInCalendarDays?this.overrides.differenceInCalendarDays(l,u):uC(l,u),this.differenceInCalendarMonths=(l,u)=>this.overrides?.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(l,u):dC(l,u),this.eachMonthOfInterval=l=>this.overrides?.eachMonthOfInterval?this.overrides.eachMonthOfInterval(l):fC(l),this.eachYearOfInterval=l=>{const u=this.overrides?.eachYearOfInterval?this.overrides.eachYearOfInterval(l):hC(l),f=new Set(u.map(m=>this.getYear(m)));if(f.size===u.length)return u;const h=[];return f.forEach(m=>{h.push(new Date(m,0,1))}),h},this.endOfBroadcastWeek=l=>this.overrides?.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(l):sT(l,this),this.endOfISOWeek=l=>this.overrides?.endOfISOWeek?this.overrides.endOfISOWeek(l):mC(l),this.endOfMonth=l=>this.overrides?.endOfMonth?this.overrides.endOfMonth(l):pC(l),this.endOfWeek=(l,u)=>this.overrides?.endOfWeek?this.overrides.endOfWeek(l,u):gC(l,this.options),this.endOfYear=l=>this.overrides?.endOfYear?this.overrides.endOfYear(l):yC(l),this.format=(l,u,f)=>{const h=this.overrides?.format?this.overrides.format(l,u,this.options):Cs(l,u,this.options);return this.options.numerals&&this.options.numerals!=="latn"?this.replaceDigits(h):h},this.getISOWeek=l=>this.overrides?.getISOWeek?this.overrides.getISOWeek(l):xC(l),this.getMonth=(l,u)=>this.overrides?.getMonth?this.overrides.getMonth(l,this.options):vC(l,this.options),this.getYear=(l,u)=>this.overrides?.getYear?this.overrides.getYear(l,this.options):bC(l,this.options),this.getWeek=(l,u)=>this.overrides?.getWeek?this.overrides.getWeek(l,this.options):SC(l,this.options),this.isAfter=(l,u)=>this.overrides?.isAfter?this.overrides.isAfter(l,u):CC(l,u),this.isBefore=(l,u)=>this.overrides?.isBefore?this.overrides.isBefore(l,u):wC(l,u),this.isDate=l=>this.overrides?.isDate?this.overrides.isDate(l):NC(l),this.isSameDay=(l,u)=>this.overrides?.isSameDay?this.overrides.isSameDay(l,u):AC(l,u),this.isSameMonth=(l,u)=>this.overrides?.isSameMonth?this.overrides.isSameMonth(l,u):kC(l,u),this.isSameYear=(l,u)=>this.overrides?.isSameYear?this.overrides.isSameYear(l,u):jC(l,u),this.max=l=>this.overrides?.max?this.overrides.max(l):TC(l),this.min=l=>this.overrides?.min?this.overrides.min(l):MC(l),this.setMonth=(l,u)=>this.overrides?.setMonth?this.overrides.setMonth(l,u):DC(l,u),this.setYear=(l,u)=>this.overrides?.setYear?this.overrides.setYear(l,u):EC(l,u),this.startOfBroadcastWeek=(l,u)=>this.overrides?.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(l,this):rv(l,this),this.startOfDay=l=>this.overrides?.startOfDay?this.overrides.startOfDay(l):OC(l),this.startOfISOWeek=l=>this.overrides?.startOfISOWeek?this.overrides.startOfISOWeek(l):RC(l),this.startOfMonth=l=>this.overrides?.startOfMonth?this.overrides.startOfMonth(l):PC(l),this.startOfWeek=(l,u)=>this.overrides?.startOfWeek?this.overrides.startOfWeek(l,this.options):LC(l,this.options),this.startOfYear=l=>this.overrides?.startOfYear?this.overrides.startOfYear(l):_C(l),this.options={locale:cv,...a},this.overrides=s}getDigitMap(){const{numerals:a="latn"}=this.options,s=new Intl.NumberFormat("en-US",{numberingSystem:a}),l={};for(let u=0;u<10;u++)l[u.toString()]=s.format(u);return l}replaceDigits(a){const s=this.getDigitMap();return a.replace(/\d/g,l=>s[l]||l)}formatNumber(a){return this.replaceDigits(a.toString())}getMonthYearOrder(){const a=this.options.locale?.code;return a&&un.yearFirstLocales.has(a)?"year-first":"month-first"}formatMonthYear(a){const{locale:s,timeZone:l,numerals:u}=this.options,f=s?.code;if(f&&un.yearFirstLocales.has(f))try{return new Intl.DateTimeFormat(f,{month:"long",year:"numeric",timeZone:l,numberingSystem:u}).format(a)}catch{}const h=this.getMonthYearOrder()==="year-first"?"y LLLL":"LLLL y";return this.format(a,h)}}un.yearFirstLocales=new Set(["eu","hu","ja","ja-Hira","ja-JP","ko","ko-KR","lt","lt-LT","lv","lv-LV","mn","mn-MN","zh","zh-CN","zh-HK","zh-TW"]);const qn=new un;class uv{constructor(a,s,l=qn){this.date=a,this.displayMonth=s,this.outside=!!(s&&!l.isSameMonth(a,s)),this.dateLib=l,this.isoDate=l.format(a,"yyyy-MM-dd"),this.displayMonthId=l.format(s,"yyyy-MM"),this.dateMonthId=l.format(a,"yyyy-MM")}isEqualTo(a){return this.dateLib.isSameDay(a.date,this.date)&&this.dateLib.isSameMonth(a.displayMonth,this.displayMonth)}}class lT{constructor(a,s){this.date=a,this.weeks=s}}class rT{constructor(a,s){this.days=s,this.weekNumber=a}}function cT(n){return ie.createElement("button",{...n})}function uT(n){return ie.createElement("span",{...n})}function dT(n){const{size:a=24,orientation:s="left",className:l}=n;return ie.createElement("svg",{className:l,width:a,height:a,viewBox:"0 0 24 24"},s==="up"&&ie.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),s==="down"&&ie.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),s==="left"&&ie.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),s==="right"&&ie.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))}function fT(n){const{day:a,modifiers:s,...l}=n;return ie.createElement("td",{...l})}function hT(n){const{day:a,modifiers:s,...l}=n,u=ie.useRef(null);return ie.useEffect(()=>{s.focused&&u.current?.focus()},[s.focused]),ie.createElement("button",{ref:u,...l})}var me;(function(n){n.Root="root",n.Chevron="chevron",n.Day="day",n.DayButton="day_button",n.CaptionLabel="caption_label",n.Dropdowns="dropdowns",n.Dropdown="dropdown",n.DropdownRoot="dropdown_root",n.Footer="footer",n.MonthGrid="month_grid",n.MonthCaption="month_caption",n.MonthsDropdown="months_dropdown",n.Month="month",n.Months="months",n.Nav="nav",n.NextMonthButton="button_next",n.PreviousMonthButton="button_previous",n.Week="week",n.Weeks="weeks",n.Weekday="weekday",n.Weekdays="weekdays",n.WeekNumber="week_number",n.WeekNumberHeader="week_number_header",n.YearsDropdown="years_dropdown"})(me||(me={}));var ot;(function(n){n.disabled="disabled",n.hidden="hidden",n.outside="outside",n.focused="focused",n.today="today"})(ot||(ot={}));var Tn;(function(n){n.range_end="range_end",n.range_middle="range_middle",n.range_start="range_start",n.selected="selected"})(Tn||(Tn={}));var cn;(function(n){n.weeks_before_enter="weeks_before_enter",n.weeks_before_exit="weeks_before_exit",n.weeks_after_enter="weeks_after_enter",n.weeks_after_exit="weeks_after_exit",n.caption_after_enter="caption_after_enter",n.caption_after_exit="caption_after_exit",n.caption_before_enter="caption_before_enter",n.caption_before_exit="caption_before_exit"})(cn||(cn={}));function mT(n){const{options:a,className:s,components:l,classNames:u,...f}=n,h=[u[me.Dropdown],s].join(" "),m=a?.find(({value:p})=>p===f.value);return ie.createElement("span",{"data-disabled":f.disabled,className:u[me.DropdownRoot]},ie.createElement(l.Select,{className:h,...f},a?.map(({value:p,label:y,disabled:C})=>ie.createElement(l.Option,{key:p,value:p,disabled:C},y))),ie.createElement("span",{className:u[me.CaptionLabel],"aria-hidden":!0},m?.label,ie.createElement(l.Chevron,{orientation:"down",size:18,className:u[me.Chevron]})))}function pT(n){return ie.createElement("div",{...n})}function gT(n){return ie.createElement("div",{...n})}function yT(n){const{calendarMonth:a,displayIndex:s,...l}=n;return ie.createElement("div",{...l},n.children)}function xT(n){const{calendarMonth:a,displayIndex:s,...l}=n;return ie.createElement("div",{...l})}function vT(n){return ie.createElement("table",{...n})}function bT(n){return ie.createElement("div",{...n})}const dv=S.createContext(void 0);function Us(){const n=S.useContext(dv);if(n===void 0)throw new Error("useDayPicker() must be used within a custom component.");return n}function ST(n){const{components:a}=Us();return ie.createElement(a.Dropdown,{...n})}function CT(n){const{onPreviousClick:a,onNextClick:s,previousMonth:l,nextMonth:u,...f}=n,{components:h,classNames:m,labels:{labelPrevious:p,labelNext:y}}=Us(),C=S.useCallback(b=>{u&&s?.(b)},[u,s]),x=S.useCallback(b=>{l&&a?.(b)},[l,a]);return ie.createElement("nav",{...f},ie.createElement(h.PreviousMonthButton,{type:"button",className:m[me.PreviousMonthButton],tabIndex:l?void 0:-1,"aria-disabled":l?void 0:!0,"aria-label":p(l),onClick:x},ie.createElement(h.Chevron,{disabled:l?void 0:!0,className:m[me.Chevron],orientation:"left"})),ie.createElement(h.NextMonthButton,{type:"button",className:m[me.NextMonthButton],tabIndex:u?void 0:-1,"aria-disabled":u?void 0:!0,"aria-label":y(u),onClick:C},ie.createElement(h.Chevron,{disabled:u?void 0:!0,orientation:"right",className:m[me.Chevron]})))}function wT(n){const{components:a}=Us();return ie.createElement(a.Button,{...n})}function NT(n){return ie.createElement("option",{...n})}function AT(n){const{components:a}=Us();return ie.createElement(a.Button,{...n})}function kT(n){const{rootRef:a,...s}=n;return ie.createElement("div",{...s,ref:a})}function jT(n){return ie.createElement("select",{...n})}function TT(n){const{week:a,...s}=n;return ie.createElement("tr",{...s})}function MT(n){return ie.createElement("th",{...n})}function DT(n){return ie.createElement("thead",{"aria-hidden":!0},ie.createElement("tr",{...n}))}function ET(n){const{week:a,...s}=n;return ie.createElement("th",{...s})}function OT(n){return ie.createElement("th",{...n})}function RT(n){return ie.createElement("tbody",{...n})}function PT(n){const{components:a}=Us();return ie.createElement(a.Dropdown,{...n})}const LT=Object.freeze(Object.defineProperty({__proto__:null,Button:cT,CaptionLabel:uT,Chevron:dT,Day:fT,DayButton:hT,Dropdown:mT,DropdownNav:pT,Footer:gT,Month:yT,MonthCaption:xT,MonthGrid:vT,Months:bT,MonthsDropdown:ST,Nav:CT,NextMonthButton:wT,Option:NT,PreviousMonthButton:AT,Root:kT,Select:jT,Week:TT,WeekNumber:ET,WeekNumberHeader:OT,Weekday:MT,Weekdays:DT,Weeks:RT,YearsDropdown:PT},Symbol.toStringTag,{value:"Module"}));function ya(n,a,s=!1,l=qn){let{from:u,to:f}=n;const{differenceInCalendarDays:h,isSameDay:m}=l;return u&&f?(h(f,u)<0&&([u,f]=[f,u]),h(a,u)>=(s?1:0)&&h(f,a)>=(s?1:0)):!s&&f?m(f,a):!s&&u?m(u,a):!1}function mf(n){return!!(n&&typeof n=="object"&&"before"in n&&"after"in n)}function Lr(n){return!!(n&&typeof n=="object"&&"from"in n)}function pf(n){return!!(n&&typeof n=="object"&&"after"in n)}function gf(n){return!!(n&&typeof n=="object"&&"before"in n)}function fv(n){return!!(n&&typeof n=="object"&&"dayOfWeek"in n)}function hv(n,a){return Array.isArray(n)&&n.every(a.isDate)}function xa(n,a,s=qn){const l=Array.isArray(a)?a:[a],{isSameDay:u,differenceInCalendarDays:f,isAfter:h}=s;return l.some(m=>{if(typeof m=="boolean")return m;if(s.isDate(m))return u(n,m);if(hv(m,s))return m.some(p=>u(n,p));if(Lr(m))return ya(m,n,!1,s);if(fv(m))return Array.isArray(m.dayOfWeek)?m.dayOfWeek.includes(n.getDay()):m.dayOfWeek===n.getDay();if(mf(m)){const p=f(m.before,n),y=f(m.after,n),C=p>0,x=y<0;return h(m.before,m.after)?x&&C:C||x}return pf(m)?f(n,m.after)>0:gf(m)?f(m.before,n)>0:typeof m=="function"?m(n):!1})}function _T(n,a,s,l,u){const{disabled:f,hidden:h,modifiers:m,showOutsideDays:p,broadcastCalendar:y,today:C=u.today()}=a,{isSameDay:x,isSameMonth:b,startOfMonth:N,isBefore:w,endOfMonth:T,isAfter:E}=u,M=s&&N(s),H=l&&T(l),B={[ot.focused]:[],[ot.outside]:[],[ot.disabled]:[],[ot.hidden]:[],[ot.today]:[]},U={};for(const O of n){const{date:A,displayMonth:_}=O,W=!!(_&&!b(A,_)),F=!!(M&&w(A,M)),Q=!!(H&&E(A,H)),ae=!!(f&&xa(A,f,u)),te=!!(h&&xa(A,h,u))||F||Q||!y&&!p&&W||y&&p===!1&&W,ye=x(A,C);W&&B.outside.push(O),ae&&B.disabled.push(O),te&&B.hidden.push(O),ye&&B.today.push(O),m&&Object.keys(m).forEach(de=>{const Ce=m?.[de];Ce&&xa(A,Ce,u)&&(U[de]?U[de].push(O):U[de]=[O])})}return O=>{const A={[ot.focused]:!1,[ot.disabled]:!1,[ot.hidden]:!1,[ot.outside]:!1,[ot.today]:!1},_={};for(const W in B){const F=B[W];A[W]=F.some(Q=>Q===O)}for(const W in U)_[W]=U[W].some(F=>F===O);return{...A,..._}}}function zT(n,a,s={}){return Object.entries(n).filter(([,u])=>u===!0).reduce((u,[f])=>(s[f]?u.push(s[f]):a[ot[f]]?u.push(a[ot[f]]):a[Tn[f]]&&u.push(a[Tn[f]]),u),[a[me.Day]])}function UT(n){return{...LT,...n}}function IT(n){const a={"data-mode":n.mode??void 0,"data-required":"required"in n?n.required:void 0,"data-multiple-months":n.numberOfMonths&&n.numberOfMonths>1||void 0,"data-week-numbers":n.showWeekNumber||void 0,"data-broadcast-calendar":n.broadcastCalendar||void 0,"data-nav-layout":n.navLayout||void 0};return Object.entries(n).forEach(([s,l])=>{s.startsWith("data-")&&(a[s]=l)}),a}function HT(){const n={};for(const a in me)n[me[a]]=`rdp-${me[a]}`;for(const a in ot)n[ot[a]]=`rdp-${ot[a]}`;for(const a in Tn)n[Tn[a]]=`rdp-${Tn[a]}`;for(const a in cn)n[cn[a]]=`rdp-${cn[a]}`;return n}function mv(n,a,s){return(s??new un(a)).formatMonthYear(n)}const BT=mv;function KT(n,a,s){return(s??new un(a)).format(n,"d")}function qT(n,a=qn){return a.format(n,"LLLL")}function GT(n,a,s){return(s??new un(a)).format(n,"cccccc")}function YT(n,a=qn){return n<10?a.formatNumber(`0${n.toLocaleString()}`):a.formatNumber(`${n.toLocaleString()}`)}function VT(){return""}function pv(n,a=qn){return a.format(n,"yyyy")}const FT=pv,QT=Object.freeze(Object.defineProperty({__proto__:null,formatCaption:mv,formatDay:KT,formatMonthCaption:BT,formatMonthDropdown:qT,formatWeekNumber:YT,formatWeekNumberHeader:VT,formatWeekdayName:GT,formatYearCaption:FT,formatYearDropdown:pv},Symbol.toStringTag,{value:"Module"}));function $T(n){return n?.formatMonthCaption&&!n.formatCaption&&(n.formatCaption=n.formatMonthCaption),n?.formatYearCaption&&!n.formatYearDropdown&&(n.formatYearDropdown=n.formatYearCaption),{...QT,...n}}function yf(n,a,s,l){let u=(l??new un(s)).format(n,"PPPP");return a.today&&(u=`Today, ${u}`),a.selected&&(u=`${u}, selected`),u}const WT=yf;function xf(n,a,s){return(s??new un(a)).formatMonthYear(n)}const XT=xf;function gv(n,a,s,l){let u=(l??new un(s)).format(n,"PPPP");return a?.today&&(u=`Today, ${u}`),u}function yv(n){return"Choose the Month"}function xv(){return""}const ZT="Go to the Next Month";function vv(n,a){return ZT}function bv(n){return"Go to the Previous Month"}function Sv(n,a,s){return(s??new un(a)).format(n,"cccc")}function Cv(n,a){return`Week ${n}`}function wv(n){return"Week Number"}function Nv(n){return"Choose the Year"}const JT=Object.freeze(Object.defineProperty({__proto__:null,labelCaption:XT,labelDay:WT,labelDayButton:yf,labelGrid:xf,labelGridcell:gv,labelMonthDropdown:yv,labelNav:xv,labelNext:vv,labelPrevious:bv,labelWeekNumber:Cv,labelWeekNumberHeader:wv,labelWeekday:Sv,labelYearDropdown:Nv},Symbol.toStringTag,{value:"Module"})),jn=(n,a,s)=>a||(s?typeof s=="function"?s:(...l)=>s:n);function eM(n,a){const s=a.locale?.labels??{};return{...JT,...n??{},labelDayButton:jn(yf,n?.labelDayButton,s.labelDayButton),labelMonthDropdown:jn(yv,n?.labelMonthDropdown,s.labelMonthDropdown),labelNext:jn(vv,n?.labelNext,s.labelNext),labelPrevious:jn(bv,n?.labelPrevious,s.labelPrevious),labelWeekNumber:jn(Cv,n?.labelWeekNumber,s.labelWeekNumber),labelYearDropdown:jn(Nv,n?.labelYearDropdown,s.labelYearDropdown),labelGrid:jn(xf,n?.labelGrid,s.labelGrid),labelGridcell:jn(gv,n?.labelGridcell,s.labelGridcell),labelNav:jn(xv,n?.labelNav,s.labelNav),labelWeekNumberHeader:jn(wv,n?.labelWeekNumberHeader,s.labelWeekNumberHeader),labelWeekday:jn(Sv,n?.labelWeekday,s.labelWeekday)}}function tM(n,a,s,l,u){const{startOfMonth:f,startOfYear:h,endOfYear:m,eachMonthOfInterval:p,getMonth:y}=u;return p({start:h(n),end:m(n)}).map(b=>{const N=l.formatMonthDropdown(b,u),w=y(b),T=a&&b<f(a)||s&&b>f(s)||!1;return{value:w,label:N,disabled:T}})}function nM(n,a={},s={}){let l={...a?.[me.Day]};return Object.entries(n).filter(([,u])=>u===!0).forEach(([u])=>{l={...l,...s?.[u]}}),l}function aM(n,a,s,l){const u=l??n.today(),f=s?n.startOfBroadcastWeek(u,n):a?n.startOfISOWeek(u):n.startOfWeek(u),h=[];for(let m=0;m<7;m++){const p=n.addDays(f,m);h.push(p)}return h}function iM(n,a,s,l,u=!1){if(!n||!a)return;const{startOfYear:f,endOfYear:h,eachYearOfInterval:m,getYear:p}=l,y=f(n),C=h(a),x=m({start:y,end:C});return u&&x.reverse(),x.map(b=>{const N=s.formatYearDropdown(b,l);return{value:p(b),label:N,disabled:!1}})}const Is=n=>n instanceof HTMLElement?n:null,ud=n=>[...n.querySelectorAll("[data-animated-month]")??[]],oM=n=>Is(n.querySelector("[data-animated-month]")),dd=n=>Is(n.querySelector("[data-animated-caption]")),fd=n=>Is(n.querySelector("[data-animated-weeks]")),sM=n=>Is(n.querySelector("[data-animated-nav]")),lM=n=>Is(n.querySelector("[data-animated-weekdays]"));function rM(n,a,{classNames:s,months:l,focused:u,dateLib:f}){const h=S.useRef(null),m=S.useRef(l),p=S.useRef(!1);S.useLayoutEffect(()=>{const y=m.current;if(m.current=l,!a||!n.current||!(n.current instanceof HTMLElement)||l.length===0||y.length===0||l.length!==y.length)return;const C=f.isSameMonth(l[0].date,y[0].date),x=f.isAfter(l[0].date,y[0].date),b=x?s[cn.caption_after_enter]:s[cn.caption_before_enter],N=x?s[cn.weeks_after_enter]:s[cn.weeks_before_enter],w=h.current,T=n.current.cloneNode(!0);if(T instanceof HTMLElement?(ud(T).forEach(B=>{if(!(B instanceof HTMLElement))return;const U=oM(B);U&&B.contains(U)&&B.removeChild(U);const O=dd(B);O&&O.classList.remove(b);const A=fd(B);A&&A.classList.remove(N)}),h.current=T):h.current=null,p.current||C||u)return;const E=w instanceof HTMLElement?ud(w):[],M=ud(n.current);if(M?.every(H=>H instanceof HTMLElement)&&E&&E.every(H=>H instanceof HTMLElement)){p.current=!0,n.current.style.isolation="isolate";const H=sM(n.current);H&&(H.style.zIndex="1"),M.forEach((B,U)=>{const O=E[U];if(!O)return;B.style.position="relative",B.style.overflow="hidden";const A=dd(B);A&&A.classList.add(b);const _=fd(B);_&&_.classList.add(N);const W=()=>{p.current=!1,n.current&&(n.current.style.isolation=""),H&&(H.style.zIndex=""),A&&A.classList.remove(b),_&&_.classList.remove(N),B.style.position="",B.style.overflow="",B.contains(O)&&B.removeChild(O)};O.style.pointerEvents="none",O.style.position="absolute",O.style.overflow="hidden",O.setAttribute("aria-hidden","true");const F=lM(O);F&&(F.style.opacity="0");const Q=dd(O);Q&&(Q.classList.add(x?s[cn.caption_before_exit]:s[cn.caption_after_exit]),Q.addEventListener("animationend",W));const ae=fd(O);ae&&ae.classList.add(x?s[cn.weeks_before_exit]:s[cn.weeks_after_exit]),B.insertBefore(O,B.firstChild)})}})}function cM(n,a,s,l){const u=n[0],f=n[n.length-1],{ISOWeek:h,fixedWeeks:m,broadcastCalendar:p}=s??{},{addDays:y,differenceInCalendarDays:C,differenceInCalendarMonths:x,endOfBroadcastWeek:b,endOfISOWeek:N,endOfMonth:w,endOfWeek:T,isAfter:E,startOfBroadcastWeek:M,startOfISOWeek:H,startOfWeek:B}=l,U=p?M(u,l):h?H(u):B(u),O=p?b(f):h?N(w(f)):T(w(f)),A=a&&(p?b(a):h?N(a):T(a)),_=A&&E(O,A)?A:O,W=C(_,U),F=x(f,u)+1,Q=[];for(let ye=0;ye<=W;ye++){const de=y(U,ye);Q.push(de)}const te=(p?35:42)*F;if(m&&Q.length<te){const ye=te-Q.length;for(let de=0;de<ye;de++){const Ce=y(Q[Q.length-1],1);Q.push(Ce)}}return Q}function uM(n){const a=[];return n.reduce((s,l)=>{const u=l.weeks.reduce((f,h)=>f.concat(h.days.slice()),a.slice());return s.concat(u.slice())},a.slice())}function dM(n,a,s,l){const{numberOfMonths:u=1}=s,f=[];for(let h=0;h<u;h++){const m=l.addMonths(n,h);if(a&&m>a)break;f.push(m)}return f}function Sy(n,a,s,l){const{month:u,defaultMonth:f,today:h=l.today(),numberOfMonths:m=1}=n;let p=u||f||h;const{differenceInCalendarMonths:y,addMonths:C,startOfMonth:x}=l;if(s&&y(s,p)<m-1){const b=-1*(m-1);p=C(s,b)}return a&&y(p,a)<0&&(p=a),x(p)}function fM(n,a,s,l){const{addDays:u,endOfBroadcastWeek:f,endOfISOWeek:h,endOfMonth:m,endOfWeek:p,getISOWeek:y,getWeek:C,startOfBroadcastWeek:x,startOfISOWeek:b,startOfWeek:N}=l,w=n.reduce((T,E)=>{const M=s.broadcastCalendar?x(E,l):s.ISOWeek?b(E):N(E),H=s.broadcastCalendar?f(E):s.ISOWeek?h(m(E)):p(m(E)),B=a.filter(_=>_>=M&&_<=H),U=s.broadcastCalendar?35:42;if(s.fixedWeeks&&B.length<U){const _=a.filter(W=>{const F=U-B.length;return W>H&&W<=u(H,F)});B.push(..._)}const O=B.reduce((_,W)=>{const F=s.ISOWeek?y(W):C(W),Q=_.find(te=>te.weekNumber===F),ae=new uv(W,E,l);return Q?Q.days.push(ae):_.push(new rT(F,[ae])),_},[]),A=new lT(E,O);return T.push(A),T},[]);return s.reverseMonths?w.reverse():w}function hM(n,a){let{startMonth:s,endMonth:l}=n;const{startOfYear:u,startOfDay:f,startOfMonth:h,endOfMonth:m,addYears:p,endOfYear:y,newDate:C,today:x}=a,{fromYear:b,toYear:N,fromMonth:w,toMonth:T}=n;!s&&w&&(s=w),!s&&b&&(s=a.newDate(b,0,1)),!l&&T&&(l=T),!l&&N&&(l=C(N,11,31));const E=n.captionLayout==="dropdown"||n.captionLayout==="dropdown-years";return s?s=h(s):b?s=C(b,0,1):!s&&E&&(s=u(p(n.today??x(),-100))),l?l=m(l):N?l=C(N,11,31):!l&&E&&(l=y(n.today??x())),[s&&f(s),l&&f(l)]}function mM(n,a,s,l){if(s.disableNavigation)return;const{pagedNavigation:u,numberOfMonths:f=1}=s,{startOfMonth:h,addMonths:m,differenceInCalendarMonths:p}=l,y=u?f:1,C=h(n);if(!a)return m(C,y);if(!(p(a,n)<f))return m(C,y)}function pM(n,a,s,l){if(s.disableNavigation)return;const{pagedNavigation:u,numberOfMonths:f}=s,{startOfMonth:h,addMonths:m,differenceInCalendarMonths:p}=l,y=u?f??1:1,C=h(n);if(!a)return m(C,-y);if(!(p(C,a)<=0))return m(C,-y)}function gM(n){const a=[];return n.reduce((s,l)=>s.concat(l.weeks.slice()),a.slice())}function _r(n,a){const[s,l]=S.useState(n);return[a===void 0?s:a,l]}function yM(n,a){const[s,l]=hM(n,a),{startOfMonth:u,endOfMonth:f}=a,h=Sy(n,s,l,a),[m,p]=_r(h,n.month?h:void 0);S.useEffect(()=>{const U=Sy(n,s,l,a);p(U)},[n.timeZone]);const{months:y,weeks:C,days:x,previousMonth:b,nextMonth:N}=S.useMemo(()=>{const U=dM(m,l,{numberOfMonths:n.numberOfMonths},a),O=cM(U,n.endMonth?f(n.endMonth):void 0,{ISOWeek:n.ISOWeek,fixedWeeks:n.fixedWeeks,broadcastCalendar:n.broadcastCalendar},a),A=fM(U,O,{broadcastCalendar:n.broadcastCalendar,fixedWeeks:n.fixedWeeks,ISOWeek:n.ISOWeek,reverseMonths:n.reverseMonths},a),_=gM(A),W=uM(A),F=pM(m,s,n,a),Q=mM(m,l,n,a);return{months:A,weeks:_,days:W,previousMonth:F,nextMonth:Q}},[a,m.getTime(),l?.getTime(),s?.getTime(),n.disableNavigation,n.broadcastCalendar,n.endMonth?.getTime(),n.fixedWeeks,n.ISOWeek,n.numberOfMonths,n.pagedNavigation,n.reverseMonths]),{disableNavigation:w,onMonthChange:T}=n,E=U=>C.some(O=>O.days.some(A=>A.isEqualTo(U))),M=U=>{if(w)return;let O=u(U);s&&O<u(s)&&(O=u(s)),l&&O>u(l)&&(O=u(l)),p(O),T?.(O)};return{months:y,weeks:C,days:x,navStart:s,navEnd:l,previousMonth:b,nextMonth:N,goToMonth:M,goToDay:U=>{E(U)||M(U.date)}}}var In;(function(n){n[n.Today=0]="Today",n[n.Selected=1]="Selected",n[n.LastFocused=2]="LastFocused",n[n.FocusedModifier=3]="FocusedModifier"})(In||(In={}));function Cy(n){return!n[ot.disabled]&&!n[ot.hidden]&&!n[ot.outside]}function xM(n,a,s,l){let u,f=-1;for(const h of n){const m=a(h);Cy(m)&&(m[ot.focused]&&f<In.FocusedModifier?(u=h,f=In.FocusedModifier):l?.isEqualTo(h)&&f<In.LastFocused?(u=h,f=In.LastFocused):s(h.date)&&f<In.Selected?(u=h,f=In.Selected):m[ot.today]&&f<In.Today&&(u=h,f=In.Today))}return u||(u=n.find(h=>Cy(a(h)))),u}function vM(n,a,s,l,u,f,h){const{ISOWeek:m,broadcastCalendar:p}=f,{addDays:y,addMonths:C,addWeeks:x,addYears:b,endOfBroadcastWeek:N,endOfISOWeek:w,endOfWeek:T,max:E,min:M,startOfBroadcastWeek:H,startOfISOWeek:B,startOfWeek:U}=h;let A={day:y,week:x,month:C,year:b,startOfWeek:_=>p?H(_,h):m?B(_):U(_),endOfWeek:_=>p?N(_):m?w(_):T(_)}[n](s,a==="after"?1:-1);return a==="before"&&l?A=E([l,A]):a==="after"&&u&&(A=M([u,A])),A}function Av(n,a,s,l,u,f,h,m=0){if(m>365)return;const p=vM(n,a,s.date,l,u,f,h),y=!!(f.disabled&&xa(p,f.disabled,h)),C=!!(f.hidden&&xa(p,f.hidden,h)),x=p,b=new uv(p,x,h);return!y&&!C?b:Av(n,a,b,l,u,f,h,m+1)}function bM(n,a,s,l,u){const{autoFocus:f}=n,[h,m]=S.useState(),p=xM(a.days,s,l||(()=>!1),h),[y,C]=S.useState(f?p:void 0);return{isFocusTarget:T=>!!p?.isEqualTo(T),setFocused:C,focused:y,blur:()=>{m(y),C(void 0)},moveFocus:(T,E)=>{if(!y)return;const M=Av(T,E,y,a.navStart,a.navEnd,n,u);M&&(n.disableNavigation&&!a.days.some(B=>B.isEqualTo(M))||(a.goToDay(M),C(M)))}}}function SM(n,a){const{selected:s,required:l,onSelect:u}=n,[f,h]=_r(s,u?s:void 0),m=u?s:f,{isSameDay:p}=a,y=N=>m?.some(w=>p(w,N))??!1,{min:C,max:x}=n;return{selected:m,select:(N,w,T)=>{let E=[...m??[]];if(y(N)){if(m?.length===C||l&&m?.length===1)return;E=m?.filter(M=>!p(M,N))}else m?.length===x?E=[N]:E=[...E,N];return u||h(E),u?.(E,N,w,T),E},isSelected:y}}function CM(n,a,s=0,l=0,u=!1,f=qn){const{from:h,to:m}=a||{},{isSameDay:p,isAfter:y,isBefore:C}=f;let x;if(!h&&!m)x={from:n,to:s>0?void 0:n};else if(h&&!m)p(h,n)?s===0?x={from:h,to:n}:u?x={from:h,to:void 0}:x=void 0:C(n,h)?x={from:n,to:h}:x={from:h,to:n};else if(h&&m)if(p(h,n)&&p(m,n))u?x={from:h,to:m}:x=void 0;else if(p(h,n))x={from:h,to:s>0?void 0:n};else if(p(m,n))x={from:n,to:s>0?void 0:n};else if(C(n,h))x={from:n,to:m};else if(y(n,h))x={from:h,to:n};else if(y(n,m))x={from:h,to:n};else throw new Error("Invalid range");if(x?.from&&x?.to){const b=f.differenceInCalendarDays(x.to,x.from);l>0&&b>l?x={from:n,to:void 0}:s>1&&b<s&&(x={from:n,to:void 0})}return x}function wM(n,a,s=qn){const l=Array.isArray(a)?a:[a];let u=n.from;const f=s.differenceInCalendarDays(n.to,n.from),h=Math.min(f,6);for(let m=0;m<=h;m++){if(l.includes(u.getDay()))return!0;u=s.addDays(u,1)}return!1}function wy(n,a,s=qn){return ya(n,a.from,!1,s)||ya(n,a.to,!1,s)||ya(a,n.from,!1,s)||ya(a,n.to,!1,s)}function NM(n,a,s=qn){const l=Array.isArray(a)?a:[a];if(l.filter(m=>typeof m!="function").some(m=>typeof m=="boolean"?m:s.isDate(m)?ya(n,m,!1,s):hv(m,s)?m.some(p=>ya(n,p,!1,s)):Lr(m)?m.from&&m.to?wy(n,{from:m.from,to:m.to},s):!1:fv(m)?wM(n,m.dayOfWeek,s):mf(m)?s.isAfter(m.before,m.after)?wy(n,{from:s.addDays(m.after,1),to:s.addDays(m.before,-1)},s):xa(n.from,m,s)||xa(n.to,m,s):pf(m)||gf(m)?xa(n.from,m,s)||xa(n.to,m,s):!1))return!0;const h=l.filter(m=>typeof m=="function");if(h.length){let m=n.from;const p=s.differenceInCalendarDays(n.to,n.from);for(let y=0;y<=p;y++){if(h.some(C=>C(m)))return!0;m=s.addDays(m,1)}}return!1}function AM(n,a){const{disabled:s,excludeDisabled:l,selected:u,required:f,onSelect:h}=n,[m,p]=_r(u,h?u:void 0),y=h?u:m;return{selected:y,select:(b,N,w)=>{const{min:T,max:E}=n,M=b?CM(b,y,T,E,f,a):void 0;return l&&s&&M?.from&&M.to&&NM({from:M.from,to:M.to},s,a)&&(M.from=b,M.to=void 0),h||p(M),h?.(M,b,N,w),M},isSelected:b=>y&&ya(y,b,!1,a)}}function kM(n,a){const{selected:s,required:l,onSelect:u}=n,[f,h]=_r(s,u?s:void 0),m=u?s:f,{isSameDay:p}=a;return{selected:m,select:(x,b,N)=>{let w=x;return!l&&m&&m&&p(x,m)&&(w=void 0),u||h(w),u?.(w,x,b,N),w},isSelected:x=>m?p(m,x):!1}}function jM(n,a){const s=kM(n,a),l=SM(n,a),u=AM(n,a);switch(n.mode){case"single":return s;case"multiple":return l;case"range":return u;default:return}}function Rt(n,a){return n instanceof ga&&n.timeZone===a?n:new ga(n,a)}function Ny(n,a){return typeof n=="boolean"||typeof n=="function"?n:n instanceof Date?Rt(n,a):Array.isArray(n)?n.map(s=>s instanceof Date?Rt(s,a):s):Lr(n)?{...n,from:n.from?Rt(n.from,a):n.from,to:n.to?Rt(n.to,a):n.to}:mf(n)?{before:Rt(n.before,a),after:Rt(n.after,a)}:pf(n)?{after:Rt(n.after,a)}:gf(n)?{before:Rt(n.before,a)}:n}function hd(n,a){return n&&(Array.isArray(n)?n.map(s=>Ny(s,a)):Ny(n,a))}function TM(n){let a=n;const s=a.timeZone;if(s&&(a={...n,timeZone:s},a.today&&(a.today=Rt(a.today,s)),a.month&&(a.month=Rt(a.month,s)),a.defaultMonth&&(a.defaultMonth=Rt(a.defaultMonth,s)),a.startMonth&&(a.startMonth=Rt(a.startMonth,s)),a.endMonth&&(a.endMonth=Rt(a.endMonth,s)),a.mode==="single"&&a.selected?a.selected=Rt(a.selected,s):a.mode==="multiple"&&a.selected?a.selected=a.selected?.map(he=>Rt(he,s)):a.mode==="range"&&a.selected&&(a.selected={from:a.selected.from?Rt(a.selected.from,s):a.selected.from,to:a.selected.to?Rt(a.selected.to,s):a.selected.to}),a.disabled!==void 0&&(a.disabled=hd(a.disabled,s)),a.hidden!==void 0&&(a.hidden=hd(a.hidden,s)),a.modifiers)){const he={};Object.keys(a.modifiers).forEach(ke=>{he[ke]=hd(a.modifiers?.[ke],s)}),a.modifiers=he}const{components:l,formatters:u,labels:f,dateLib:h,locale:m,classNames:p}=S.useMemo(()=>{const he={...cv,...a.locale},ke=new un({locale:he,weekStartsOn:a.broadcastCalendar?1:a.weekStartsOn,firstWeekContainsDate:a.firstWeekContainsDate,useAdditionalWeekYearTokens:a.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:a.useAdditionalDayOfYearTokens,timeZone:a.timeZone,numerals:a.numerals},a.dateLib);return{dateLib:ke,components:UT(a.components),formatters:$T(a.formatters),labels:eM(a.labels,ke.options),locale:he,classNames:{...HT(),...a.classNames}}},[a.locale,a.broadcastCalendar,a.weekStartsOn,a.firstWeekContainsDate,a.useAdditionalWeekYearTokens,a.useAdditionalDayOfYearTokens,a.timeZone,a.numerals,a.dateLib,a.components,a.formatters,a.labels,a.classNames]);a.today||(a={...a,today:h.today()});const{captionLayout:y,mode:C,navLayout:x,numberOfMonths:b=1,onDayBlur:N,onDayClick:w,onDayFocus:T,onDayKeyDown:E,onDayMouseEnter:M,onDayMouseLeave:H,onNextClick:B,onPrevClick:U,showWeekNumber:O,styles:A}=a,{formatCaption:_,formatDay:W,formatMonthDropdown:F,formatWeekNumber:Q,formatWeekNumberHeader:ae,formatWeekdayName:te,formatYearDropdown:ye}=u,de=yM(a,h),{days:Ce,months:R,navStart:$,navEnd:ee,previousMonth:X,nextMonth:se,goToMonth:fe}=de,Ne=_T(Ce,a,$,ee,h),{isSelected:V,select:J,selected:le}=jM(a,h)??{},{blur:ne,focused:oe,isFocusTarget:xe,moveFocus:Pe,setFocused:qe}=bM(a,de,Ne,V??(()=>!1),h),{labelDayButton:St,labelGridcell:Ct,labelGrid:Ye,labelMonthDropdown:nt,labelNav:Ut,labelPrevious:Qt,labelNext:Gn,labelWeekday:je,labelWeekNumber:$t,labelWeekNumberHeader:En,labelYearDropdown:Wt}=f,Sa=S.useMemo(()=>aM(h,a.ISOWeek,a.broadcastCalendar,a.today),[h,a.ISOWeek,a.broadcastCalendar,a.today]),Yn=C!==void 0||w!==void 0,ft=S.useCallback(()=>{X&&(fe(X),U?.(X))},[X,fe,U]),Xt=S.useCallback(()=>{se&&(fe(se),B?.(se))},[fe,se,B]),Vn=S.useCallback((he,ke)=>be=>{be.preventDefault(),be.stopPropagation(),qe(he),!ke.disabled&&(J?.(he.date,ke,be),w?.(he.date,ke,be))},[J,w,qe]),Ja=S.useCallback((he,ke)=>be=>{qe(he),T?.(he.date,ke,be)},[T,qe]),On=S.useCallback((he,ke)=>be=>{ne(),N?.(he.date,ke,be)},[ne,N]),Rn=S.useCallback((he,ke)=>be=>{const Oe={ArrowLeft:[be.shiftKey?"month":"day",a.dir==="rtl"?"after":"before"],ArrowRight:[be.shiftKey?"month":"day",a.dir==="rtl"?"before":"after"],ArrowDown:[be.shiftKey?"year":"week","after"],ArrowUp:[be.shiftKey?"year":"week","before"],PageUp:[be.shiftKey?"year":"month","before"],PageDown:[be.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(Oe[be.key]){be.preventDefault(),be.stopPropagation();const[Je,we]=Oe[be.key];Pe(Je,we)}E?.(he.date,ke,be)},[Pe,E,a.dir]),ji=S.useCallback((he,ke)=>be=>{M?.(he.date,ke,be)},[M]),wo=S.useCallback((he,ke)=>be=>{H?.(he.date,ke,be)},[H]),No=S.useCallback(he=>ke=>{const be=Number(ke.target.value),Oe=h.setMonth(h.startOfMonth(he),be);fe(Oe)},[h,fe]),Fn=S.useCallback(he=>ke=>{const be=Number(ke.target.value),Oe=h.setYear(h.startOfMonth(he),be);fe(Oe)},[h,fe]),{className:Z,style:De}=S.useMemo(()=>({className:[p[me.Root],a.className].filter(Boolean).join(" "),style:{...A?.[me.Root],...a.style}}),[p,a.className,a.style,A]),ve=IT(a),Ee=S.useRef(null);rM(Ee,!!a.animate,{classNames:p,months:R,focused:oe,dateLib:h});const at={dayPickerProps:a,selected:le,select:J,isSelected:V,months:R,nextMonth:se,previousMonth:X,goToMonth:fe,getModifiers:Ne,components:l,classNames:p,styles:A,labels:f,formatters:u};return ie.createElement(dv.Provider,{value:at},ie.createElement(l.Root,{rootRef:a.animate?Ee:void 0,className:Z,style:De,dir:a.dir,id:a.id,lang:a.lang,nonce:a.nonce,title:a.title,role:a.role,"aria-label":a["aria-label"],"aria-labelledby":a["aria-labelledby"],...ve},ie.createElement(l.Months,{className:p[me.Months],style:A?.[me.Months]},!a.hideNavigation&&!x&&ie.createElement(l.Nav,{"data-animated-nav":a.animate?"true":void 0,className:p[me.Nav],style:A?.[me.Nav],"aria-label":Ut(),onPreviousClick:ft,onNextClick:Xt,previousMonth:X,nextMonth:se}),R.map((he,ke)=>ie.createElement(l.Month,{"data-animated-month":a.animate?"true":void 0,className:p[me.Month],style:A?.[me.Month],key:ke,displayIndex:ke,calendarMonth:he},x==="around"&&!a.hideNavigation&&ke===0&&ie.createElement(l.PreviousMonthButton,{type:"button",className:p[me.PreviousMonthButton],tabIndex:X?void 0:-1,"aria-disabled":X?void 0:!0,"aria-label":Qt(X),onClick:ft,"data-animated-button":a.animate?"true":void 0},ie.createElement(l.Chevron,{disabled:X?void 0:!0,className:p[me.Chevron],orientation:a.dir==="rtl"?"right":"left"})),ie.createElement(l.MonthCaption,{"data-animated-caption":a.animate?"true":void 0,className:p[me.MonthCaption],style:A?.[me.MonthCaption],calendarMonth:he,displayIndex:ke},y?.startsWith("dropdown")?ie.createElement(l.DropdownNav,{className:p[me.Dropdowns],style:A?.[me.Dropdowns]},(()=>{const be=y==="dropdown"||y==="dropdown-months"?ie.createElement(l.MonthsDropdown,{key:"month",className:p[me.MonthsDropdown],"aria-label":nt(),classNames:p,components:l,disabled:!!a.disableNavigation,onChange:No(he.date),options:tM(he.date,$,ee,u,h),style:A?.[me.Dropdown],value:h.getMonth(he.date)}):ie.createElement("span",{key:"month"},F(he.date,h)),Oe=y==="dropdown"||y==="dropdown-years"?ie.createElement(l.YearsDropdown,{key:"year",className:p[me.YearsDropdown],"aria-label":Wt(h.options),classNames:p,components:l,disabled:!!a.disableNavigation,onChange:Fn(he.date),options:iM($,ee,u,h,!!a.reverseYears),style:A?.[me.Dropdown],value:h.getYear(he.date)}):ie.createElement("span",{key:"year"},ye(he.date,h));return h.getMonthYearOrder()==="year-first"?[Oe,be]:[be,Oe]})(),ie.createElement("span",{role:"status","aria-live":"polite",style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"}},_(he.date,h.options,h))):ie.createElement(l.CaptionLabel,{className:p[me.CaptionLabel],role:"status","aria-live":"polite"},_(he.date,h.options,h))),x==="around"&&!a.hideNavigation&&ke===b-1&&ie.createElement(l.NextMonthButton,{type:"button",className:p[me.NextMonthButton],tabIndex:se?void 0:-1,"aria-disabled":se?void 0:!0,"aria-label":Gn(se),onClick:Xt,"data-animated-button":a.animate?"true":void 0},ie.createElement(l.Chevron,{disabled:se?void 0:!0,className:p[me.Chevron],orientation:a.dir==="rtl"?"left":"right"})),ke===b-1&&x==="after"&&!a.hideNavigation&&ie.createElement(l.Nav,{"data-animated-nav":a.animate?"true":void 0,className:p[me.Nav],style:A?.[me.Nav],"aria-label":Ut(),onPreviousClick:ft,onNextClick:Xt,previousMonth:X,nextMonth:se}),ie.createElement(l.MonthGrid,{role:"grid","aria-multiselectable":C==="multiple"||C==="range","aria-label":Ye(he.date,h.options,h)||void 0,className:p[me.MonthGrid],style:A?.[me.MonthGrid]},!a.hideWeekdays&&ie.createElement(l.Weekdays,{"data-animated-weekdays":a.animate?"true":void 0,className:p[me.Weekdays],style:A?.[me.Weekdays]},O&&ie.createElement(l.WeekNumberHeader,{"aria-label":En(h.options),className:p[me.WeekNumberHeader],style:A?.[me.WeekNumberHeader],scope:"col"},ae()),Sa.map(be=>ie.createElement(l.Weekday,{"aria-label":je(be,h.options,h),className:p[me.Weekday],key:String(be),style:A?.[me.Weekday],scope:"col"},te(be,h.options,h)))),ie.createElement(l.Weeks,{"data-animated-weeks":a.animate?"true":void 0,className:p[me.Weeks],style:A?.[me.Weeks]},he.weeks.map(be=>ie.createElement(l.Week,{className:p[me.Week],key:be.weekNumber,style:A?.[me.Week],week:be},O&&ie.createElement(l.WeekNumber,{week:be,style:A?.[me.WeekNumber],"aria-label":$t(be.weekNumber,{locale:m}),className:p[me.WeekNumber],scope:"row",role:"rowheader"},Q(be.weekNumber,h)),be.days.map(Oe=>{const{date:Je}=Oe,we=Ne(Oe);if(we[ot.focused]=!we.hidden&&!!oe?.isEqualTo(Oe),we[Tn.selected]=V?.(Je)||we.selected,Lr(le)){const{from:Zt,to:wn}=le;we[Tn.range_start]=!!(Zt&&wn&&h.isSameDay(Je,Zt)),we[Tn.range_end]=!!(Zt&&wn&&h.isSameDay(Je,wn)),we[Tn.range_middle]=ya(le,Je,!0,h)}const Pt=nM(we,A,a.modifiersStyles),Qn=zT(we,p,a.modifiersClassNames),Nt=!Yn&&!we.hidden?Ct(Je,we,h.options,h):void 0;return ie.createElement(l.Day,{key:`${Oe.isoDate}_${Oe.displayMonthId}`,day:Oe,modifiers:we,className:Qn.join(" "),style:Pt,role:"gridcell","aria-selected":we.selected||void 0,"aria-label":Nt,"data-day":Oe.isoDate,"data-month":Oe.outside?Oe.dateMonthId:void 0,"data-selected":we.selected||void 0,"data-disabled":we.disabled||void 0,"data-hidden":we.hidden||void 0,"data-outside":Oe.outside||void 0,"data-focused":we.focused||void 0,"data-today":we.today||void 0},!we.hidden&&Yn?ie.createElement(l.DayButton,{className:p[me.DayButton],style:A?.[me.DayButton],type:"button",day:Oe,modifiers:we,disabled:!we.focused&&we.disabled||void 0,"aria-disabled":we.focused&&we.disabled||void 0,tabIndex:xe(Oe)?0:-1,"aria-label":St(Je,we,h.options,h),onClick:Vn(Oe,we),onBlur:On(Oe,we),onFocus:Ja(Oe,we),onKeyDown:Rn(Oe,we),onMouseEnter:ji(Oe,we),onMouseLeave:wo(Oe,we)},W(Je,h.options,h)):!we.hidden&&W(Oe.date,h.options,h))})))))))),a.footer&&ie.createElement(l.Footer,{className:p[me.Footer],style:A?.[me.Footer],role:"status","aria-live":"polite"},a.footer)))}function MM({className:n,classNames:a,showOutsideDays:s=!0,...l}){return r.jsx(TM,{showOutsideDays:s,className:K("p-2",n),classNames:{root:"relative",months:"flex flex-col sm:flex-row gap-2 sm:gap-4",month:"flex flex-col gap-2",month_caption:"flex justify-center pt-1 relative items-center h-8",caption_label:"text-sm font-medium",nav:"absolute inset-x-0 top-2 flex items-center justify-between px-1 z-10",button_previous:K(ar({variant:"ghost"}),"h-7 w-7 bg-transparent p-0 opacity-70 hover:opacity-100 hover:bg-accent rounded-md"),button_next:K(ar({variant:"ghost"}),"h-7 w-7 bg-transparent p-0 opacity-70 hover:opacity-100 hover:bg-accent rounded-md"),month_grid:"w-full border-collapse",weekdays:"flex w-full",weekday:"text-muted-foreground w-8 font-normal text-xs text-center",weeks:"flex flex-col",week:"flex w-full",day:K("relative h-8 w-8 p-0 text-center text-xs font-normal focus-within:relative focus-within:z-20","hover:bg-accent hover:text-accent-foreground rounded-full select-none"),day_button:K(ar({variant:"ghost"}),"h-8 w-8 p-0 font-normal rounded-full text-xs","aria-selected:opacity-100"),range_start:K("aria-selected:bg-primary aria-selected:text-primary-foreground","aria-selected:rounded-l-full aria-selected:rounded-r-none","aria-selected:hover:bg-primary aria-selected:hover:text-primary-foreground"),range_end:K("aria-selected:bg-primary aria-selected:text-primary-foreground","aria-selected:rounded-r-full aria-selected:rounded-l-none","aria-selected:hover:bg-primary aria-selected:hover:text-primary-foreground"),range_middle:K("aria-selected:bg-accent aria-selected:text-accent-foreground","aria-selected:rounded-none"),selected:K("bg-primary text-primary-foreground rounded-full","hover:bg-primary hover:text-primary-foreground","focus:bg-primary focus:text-primary-foreground"),today:"bg-accent text-accent-foreground rounded-full",outside:"text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30",disabled:"text-muted-foreground opacity-50",hidden:"invisible",...a},components:{Chevron:({orientation:u,className:f,...h})=>{const m=u==="left"?nC:u==="right"?yr:u==="up"?Ed:br;return r.jsx(m,{className:K("h-4 w-4",f),...h})}},...l})}MM.displayName="Calendar";const DM=S.lazy(()=>gt(()=>Promise.resolve().then(()=>hf),void 0).then(n=>({default:n.CodeEditor})));function XD({rawJsonContent:n,isRawJsonValid:a,rawJsonEdits:s,rawSettingsEnv:l,onChange:u,missingRequiredFields:f=[]}){const h=f.length>0;return r.jsx(S.Suspense,{fallback:r.jsxs("div",{className:"flex items-center justify-center h-full",children:[r.jsx(Dn,{className:"w-6 h-6 animate-spin text-muted-foreground"}),r.jsx("span",{className:"ml-2 text-muted-foreground",children:"Loading editor..."})]}),children:r.jsxs("div",{className:"h-full flex flex-col",children:[!a&&s!==null&&r.jsxs("div",{className:"mb-2 px-3 py-2 bg-destructive/10 text-destructive text-sm rounded-md flex items-center gap-2 mx-6 mt-4 shrink-0",children:[r.jsx(bo,{className:"w-4 h-4"}),"Invalid JSON syntax"]}),a&&h&&r.jsxs("div",{className:"mb-2 px-3 py-2 bg-warning/10 text-warning-foreground text-sm rounded-md flex items-start gap-2 mx-6 mt-4 shrink-0 border border-warning/20",children:[r.jsx(va,{className:"w-4 h-4 mt-0.5 text-amber-500 shrink-0"}),r.jsxs("div",{children:[r.jsx("span",{className:"font-medium text-amber-600 dark:text-amber-400",children:"Missing required fields:"})," ",r.jsx("code",{className:"text-xs bg-muted px-1 py-0.5 rounded",children:f.join(", ")}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"These fields will use default values at runtime."})]})]}),r.jsx("div",{className:"flex-1 overflow-hidden px-6 pb-4 pt-4",children:r.jsx("div",{className:"h-full border rounded-md overflow-hidden bg-background",children:r.jsx(DM,{value:n,onChange:u,language:"json",minHeight:"100%"})})}),r.jsx("div",{className:"mx-6 mb-4",children:r.jsx("div",{className:"border rounded-md overflow-hidden",children:r.jsx(df,{profileEnv:l})})})]})})}const ZD={target:"Target CLI",cliproxy:"CLIProxy Provider","api-profiles":"API Profile",websearch:"WebSearch"},JD=[{id:"droid-target-support",title:"Factory Droid support is live",summary:"API Profiles and CLIProxy variants now support Droid as a first-class execution target.",primaryAction:"Set Droid as your default execution target for non-Claude workflows.",publishedAt:"2026-02-25",status:"new",scopes:["target","api-profiles","cliproxy"],entryIds:["droid-target","custom-api-profiles","codex-cliproxy","agy-cliproxy"],highlights:["Set default target to Droid when creating or editing API Profiles.","Set default target to Droid for CLIProxy variants, including Codex and Antigravity flows.","Use ccsd alias or --target droid for one-off target overrides."],actions:[{id:"open-api-profiles",label:"Set default target in API Profiles",description:"Open API Profiles and set Default Target to Droid for profiles you run often.",type:"route",path:"/providers"},{id:"open-cliproxy",label:"Set default target in CLIProxy variants",description:"Open CLIProxy variants and set target to Droid for Codex/Antigravity or custom variants.",type:"route",path:"/cliproxy"},{id:"copy-ccsd-command",label:"Run once with Droid alias",description:"Use ccsd to force Droid target with your current profile.",type:"command",command:"ccsd glm"},{id:"copy-target-override",label:"Run once with --target override",description:"Keep your default profile but force Droid for a single command.",type:"command",command:'ccs codex --target droid "your prompt"'}],routes:[{label:"API Profiles",path:"/providers"},{label:"CLIProxy",path:"/cliproxy"}],commands:["ccsd glm",'ccs codex --target droid "your prompt"',"ccs cliproxy create mycodex --provider codex --target droid"]},{id:"updates-center-launch",title:"Updates inbox is available for rollout tasks",summary:"A focused updates inbox exists for setup tasks and rollout guidance when you need it.",primaryAction:"Use this page only when needed for rollout tasks, then return to your normal workflow.",publishedAt:"2026-02-25",status:"new",scopes:["target","cliproxy","api-profiles","websearch"],entryIds:["droid-target","codex-cliproxy","custom-api-profiles","opencode-websearch"],highlights:["Single data source powers update content and integration mapping.","Notices can be tracked as new, seen, done, or dismissed.","Catalog covers target CLI, CLIProxy providers, and WebSearch integrations."],actions:[{id:"open-updates-page",label:"Open updates inbox when needed",description:"Review rollout tasks only when you want guided setup changes.",type:"route",path:"/updates"},{id:"copy-open-dashboard",label:"Open dashboard from terminal",description:"Re-open config dashboard anytime from CLI.",type:"command",command:"ccs config"}],routes:[{label:"Updates Inbox",path:"/updates"}],commands:["ccs config"]}],EM=[{id:"claude-target",name:"Claude Code",scope:"target",status:"stable",summary:"Default runtime target for all CCS profile types.",pillars:{baseUrl:"From profile settings (ANTHROPIC_BASE_URL)",auth:"From profile settings (ANTHROPIC_AUTH_TOKEN)",model:"From profile settings (ANTHROPIC_MODEL)"},routes:[{label:"API Profiles",path:"/providers"},{label:"CLIProxy",path:"/cliproxy"}],commands:["ccs",'ccs glm "your prompt"']},{id:"droid-target",name:"Factory Droid",scope:"target",status:"new",summary:"First-class target for API Profiles and CLIProxy variants.",pillars:{baseUrl:"From profile or variant settings",auth:"From profile or variant settings",model:"From profile or variant settings"},routes:[{label:"API Profiles",path:"/providers"},{label:"CLIProxy",path:"/cliproxy"}],commands:["ccsd glm","ccs km --target droid","ccs codex --target droid"],notes:"Use ccsd alias for automatic Droid target selection."},{id:"codex-cliproxy",name:"Codex via CLIProxy",scope:"cliproxy",status:"stable",summary:"OAuth-backed provider with configurable variant model and target.",pillars:{baseUrl:"Managed by CLIProxy backend",auth:"OAuth account via CLIProxy auth flow",model:"Selectable per provider or variant"},routes:[{label:"CLIProxy",path:"/cliproxy"},{label:"Control Panel",path:"/cliproxy/control-panel"}],commands:["ccs codex","ccs cliproxy create mycodex --provider codex"]},{id:"gemini-cliproxy",name:"Gemini via CLIProxy",scope:"cliproxy",status:"stable",summary:"OAuth-backed Gemini provider with multi-account management.",pillars:{baseUrl:"Managed by CLIProxy backend",auth:"OAuth account via CLIProxy auth flow",model:"Selectable per provider or variant"},routes:[{label:"CLIProxy",path:"/cliproxy"},{label:"Control Panel",path:"/cliproxy/control-panel"}],commands:["ccs gemini","ccs cliproxy create mygem --provider gemini"]},{id:"agy-cliproxy",name:"Antigravity via CLIProxy",scope:"cliproxy",status:"stable",summary:"OAuth-backed Antigravity provider with variant target controls.",pillars:{baseUrl:"Managed by CLIProxy backend",auth:"OAuth account via CLIProxy auth flow",model:"Selectable per provider or variant"},routes:[{label:"CLIProxy",path:"/cliproxy"},{label:"Control Panel",path:"/cliproxy/control-panel"}],commands:["ccs agy","ccs cliproxy create myagy --provider agy --target droid"]},{id:"custom-api-profiles",name:"Custom API Profiles",scope:"api-profiles",status:"stable",summary:"Any Anthropic-compatible endpoint with per-profile target and model mapping.",pillars:{baseUrl:"User-defined endpoint",auth:"User-defined token/key",model:"User-defined model identifier"},routes:[{label:"API Profiles",path:"/providers"}],commands:["ccs api create myprofile",'ccs myprofile "your prompt"']},{id:"opencode-websearch",name:"OpenCode WebSearch",scope:"websearch",status:"stable",summary:"WebSearch provider surfaced in Settings for third-party profile workflows.",pillars:{baseUrl:"Managed by OpenCode CLI integration",auth:"Provider-specific (managed externally)",model:"Configurable in WebSearch settings"},routes:[{label:"Settings",path:"/settings"}],commands:["ccs config",'ccs codex "your prompt"'],notes:"Enable OpenCode in Settings > WebSearch to activate fallback search."}],OM=new Map(EM.map(n=>[n.id,n]));function eE(n){return n.entryIds.map(a=>OM.get(a)).filter(a=>!!a)}function tE(n){const a=new Date(`${n}T00:00:00Z`);return Number.isNaN(a.getTime())?n:new Intl.DateTimeFormat(void 0,{year:"numeric",month:"short",day:"numeric",timeZone:"UTC"}).format(a)}function RM(){const{t:n}=_t(),[a,s]=S.useState(""),[l,u]=S.useState(""),[f,h]=S.useState(null),[m,p]=S.useState(!1),{login:y,authRequired:C,isAuthenticated:x}=Ud(),b=Md(),w=gr().state?.from?.pathname||"/";if(S.useEffect(()=>{(x||!C)&&b(w,{replace:!0})},[x,C,b,w]),x||!C)return null;const T=async E=>{E.preventDefault(),h(null),p(!0);try{await y(a,l),b(w,{replace:!0})}catch(M){h(M instanceof Error?M.message:n("auth.loginFailed"))}finally{p(!1)}};return r.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background p-4",children:r.jsxs(Mj,{className:"w-full max-w-sm",children:[r.jsxs(Dj,{className:"space-y-1 text-center",children:[r.jsx("div",{className:"mx-auto mb-2 flex h-12 w-12 items-center justify-center rounded-full bg-primary/10",children:r.jsx(aC,{className:"h-6 w-6 text-primary"})}),r.jsx(Ej,{className:"text-2xl",children:n("auth.dashboardTitle")}),r.jsx(Oj,{children:n("auth.loginDescription")})]}),r.jsx(Rj,{children:r.jsxs("form",{onSubmit:T,className:"space-y-4",children:[f&&r.jsxs(lf,{variant:"destructive",children:[r.jsx(Pd,{className:"h-4 w-4"}),r.jsx(rf,{children:f})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(ln,{htmlFor:"username",children:n("auth.username")}),r.jsx(Un,{id:"username",type:"text",value:a,onChange:E=>s(E.target.value),placeholder:n("auth.usernamePlaceholder"),autoComplete:"username",disabled:m,required:!0})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(ln,{htmlFor:"password",children:n("auth.password")}),r.jsx(Un,{id:"password",type:"password",value:l,onChange:E=>u(E.target.value),placeholder:n("auth.passwordPlaceholder"),autoComplete:"current-password",disabled:m,required:!0})]}),r.jsx(ut,{type:"submit",className:"w-full",disabled:m,children:m?r.jsxs(r.Fragment,{children:[r.jsx(Dn,{className:"mr-2 h-4 w-4 animate-spin"}),n("auth.signingIn")]}):n("auth.signIn")})]})})]})})}const PM=S.lazy(()=>gt(()=>import("./index-CHfQZxYq.js"),__vite__mapDeps([18,1,2,4,5,7,19,6,8,9])).then(n=>({default:n.AnalyticsPage}))),LM=S.lazy(()=>gt(()=>import("./api-h_I7-lO7.js"),__vite__mapDeps([20,1,2,5,21,15,6,4,22,7,8,9])).then(n=>({default:n.ApiPage}))),_M=S.lazy(()=>gt(()=>import("./cliproxy-Cccwn5Zy.js"),__vite__mapDeps([23,1,2,5,13,6,4,14,15,24,21,22,3,7,8,9])).then(n=>({default:n.CliproxyPage}))),zM=S.lazy(()=>gt(()=>import("./cliproxy-control-panel-CSWIAklH.js"),__vite__mapDeps([25,1,2,5,13,4,6,7,8,9])).then(n=>({default:n.CliproxyControlPanelPage}))),UM=S.lazy(()=>gt(()=>import("./copilot-CpoZ-JIF.js"),__vite__mapDeps([26,1,2,5,21,15,4,22,3,6,7,8,9])).then(n=>({default:n.CopilotPage}))),IM=S.lazy(()=>gt(()=>import("./cursor-DPNnilw3.js"),__vite__mapDeps([27,1,2,6,5,13,3,22,4,7,8,9])).then(n=>({default:n.CursorPage}))),HM=S.lazy(()=>gt(()=>import("./droid-DK_cjIrQ.js"),__vite__mapDeps([28,1,2,6,5,4,22,7,8,9])).then(n=>({default:n.DroidPage}))),BM=S.lazy(()=>gt(()=>import("./accounts-BrujKA4_.js"),__vite__mapDeps([29,1,2,5,15,6,4,24,7,8,9])).then(n=>({default:n.AccountsPage}))),KM=S.lazy(()=>gt(()=>Promise.resolve().then(()=>Zj),void 0).then(n=>({default:n.SettingsPage}))),qM=S.lazy(()=>gt(()=>import("./health-Den6iwHL.js"),__vite__mapDeps([30,1,2,5,6,4,7,8,9])).then(n=>({default:n.HealthPage}))),GM=S.lazy(()=>gt(()=>import("./shared-Cjq_jPQd.js"),__vite__mapDeps([31,1,2,4,5,6,7,8,9])).then(n=>({default:n.SharedPage}))),YM=S.lazy(()=>gt(()=>import("./updates-BsJ2V6_I.js"),__vite__mapDeps([32,1,2,4,5,6,7,8,9])).then(n=>({default:n.UpdatesPage})));function Cn(){return r.jsx("div",{className:"flex h-64 items-center justify-center",children:r.jsx(Dn,{className:"h-8 w-8 animate-spin text-muted-foreground"})})}function VM(){return r.jsx(wS,{client:XC,children:r.jsx(Yw,{defaultTheme:"system",storageKey:"vite-ui-theme",children:r.jsx(Vw,{children:r.jsx(Xw,{children:r.jsxs(bS,{children:[r.jsxs(SS,{children:[r.jsx(Lt,{path:"/login",element:r.jsx(RM,{})}),r.jsx(Lt,{element:r.jsx(Zw,{}),children:r.jsxs(Lt,{element:r.jsx($1,{}),children:[r.jsx(Lt,{path:"/",element:r.jsx(Fk,{})}),r.jsx(Lt,{path:"/analytics",element:r.jsx(S.Suspense,{fallback:r.jsx(Cn,{}),children:r.jsx(PM,{})})}),r.jsx(Lt,{path:"/updates",element:r.jsx(S.Suspense,{fallback:r.jsx(Cn,{}),children:r.jsx(YM,{})})}),r.jsx(Lt,{path:"/providers",element:r.jsx(S.Suspense,{fallback:r.jsx(Cn,{}),children:r.jsx(LM,{})})}),r.jsx(Lt,{path:"/cliproxy",element:r.jsx(S.Suspense,{fallback:r.jsx(Cn,{}),children:r.jsx(_M,{})})}),r.jsx(Lt,{path:"/cliproxy/control-panel",element:r.jsx(S.Suspense,{fallback:r.jsx(Cn,{}),children:r.jsx(zM,{})})}),r.jsx(Lt,{path:"/copilot",element:r.jsx(S.Suspense,{fallback:r.jsx(Cn,{}),children:r.jsx(UM,{})})}),r.jsx(Lt,{path:"/cursor",element:r.jsx(S.Suspense,{fallback:r.jsx(Cn,{}),children:r.jsx(IM,{})})}),r.jsx(Lt,{path:"/droid",element:r.jsx(S.Suspense,{fallback:r.jsx(Cn,{}),children:r.jsx(HM,{})})}),r.jsx(Lt,{path:"/accounts",element:r.jsx(S.Suspense,{fallback:r.jsx(Cn,{}),children:r.jsx(BM,{})})}),r.jsx(Lt,{path:"/settings",element:r.jsx(S.Suspense,{fallback:r.jsx(Cn,{}),children:r.jsx(KM,{})})}),r.jsx(Lt,{path:"/health",element:r.jsx(S.Suspense,{fallback:r.jsx(Cn,{}),children:r.jsx(qM,{})})}),r.jsx(Lt,{path:"/shared",element:r.jsx(S.Suspense,{fallback:r.jsx(Cn,{}),children:r.jsx(GM,{})})})]})})]}),r.jsx(NS,{position:"top-right"})]})})})})})}const kv=document.getElementById("root");if(!kv)throw new Error("Root element not found. Failed to mount React application.");QC.createRoot(kv).render(r.jsx(S.StrictMode,{children:r.jsx(VM,{})}));export{KD as $,Zk as A,Qa as B,Mj as C,ij as D,_D as E,UD as F,$k as G,nj as H,Un as I,oj as J,zD as K,ln as L,ZN as M,JN as N,e1 as O,ux as P,$x as Q,cf as R,Ke as S,$a as T,mr as U,Ad as V,ct as W,BD as X,Qe as Y,HD as Z,Oj as _,_t as a,XD as a$,qD as a0,Zx as a1,GD as a2,nD as a3,QN as a4,sD as a5,hD as a6,mD as a7,qd as a8,Gd as a9,Ci as aA,L1 as aB,_1 as aC,z1 as aD,U1 as aE,hx as aF,kA as aG,wx as aH,gD as aI,yD as aJ,xD as aK,vD as aL,FD as aM,oD as aN,XN as aO,rD as aP,cD as aQ,$N as aR,WN as aS,uD as aT,dD as aU,fD as aV,lD as aW,Xd as aX,ws as aY,aD as aZ,iD as a_,Yd as aa,Vd as ab,Fd as ac,YD as ad,Lj as ae,VD as af,Za as ag,MD as ah,_j as ai,ED as aj,pD as ak,DD as al,OD as am,qg as an,RD as ao,H1 as ap,x1 as aq,jD as ar,k1 as as,TD as at,wA as au,gN as av,yN as aw,Tr as ax,jr as ay,Mr as az,Rj as b,av as b0,of as b1,Ps as b2,sf as b3,Gk as b4,PD as b5,LD as b6,lf as b7,Yx as b8,rf as b9,tE as ba,ZD as bb,JD as bc,eE as bd,ov as be,Fj as bf,$j as bg,wD as bh,bD as bi,ax as bj,Dw as bk,Tw as bl,yd as bm,Ni as bn,bw as bo,Cw as bp,kw as bq,Ow as br,ND as bs,SD as bt,CD as bu,kD as bv,AD as bw,ar as bx,K as c,ut as d,QD as e,$D as f,Jj as g,MM as h,tD as i,Dj as j,Ej as k,dA as l,fA as m,So as n,WD as o,Wa as p,Xa as q,xx as r,Zd as s,vx as t,_d as u,Jd as v,dr as w,ny as x,rj as y,ID as z};